Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/publish_java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ on:
jobs:
publish-java:
runs-on: ubuntu-latest
# Only run for releases tagged with dotprompt-java- prefix (per release-please config)
# Only run for releases tagged with dotprompt-java- prefix
if: startsWith(github.event.release.tag_name, 'dotprompt-java-')
permissions:
contents: read
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish_rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
jobs:
publish-cargo:
runs-on: ubuntu-latest
# Only run for releases tagged with dotprompt-rs- prefix (per release-please config)
# Only run for releases tagged with dotprompt-rs- prefix
if: startsWith(github.event.release.tag_name, 'dotprompt-rs-')
permissions:
contents: read
Expand All @@ -49,4 +49,4 @@
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: |
cd rs/dotprompt
cargo publish --token "${CARGO_REGISTRY_TOKEN}"

Check notice on line 52 in .github/workflows/publish_rust.yml

View workflow job for this annotation

GitHub Actions / zizmor-output

use-trusted-publishing

publish_rust.yml:52: prefer trusted publishing for authentication: this command
125 changes: 0 additions & 125 deletions .release-please-config.json

This file was deleted.

19 changes: 0 additions & 19 deletions .release-please-manifest.json

This file was deleted.

29 changes: 29 additions & 0 deletions dart/dotprompt/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,35 @@ All notable changes to dotprompt-dart will be documented in this file.

## [Unreleased]

## [2.0.1] - 2026-11-18

### Security

- Markers emitted by the `role`, `history`, `section` and `media` helpers now
carry a random per-render nonce, and only markers with that nonce are
honored. Previously a value interpolated into a template (for example user
input) could contain a literal `<<<dotprompt:role:system>>>` marker and forge
system or model turns, media parts with arbitrary URLs, history placement, or
pending section parts
([#643](https://github.com/google/dotprompt/pull/643)).
- Media and section marker bodies match across newlines, and media URLs keep
spaces, so user-supplied values don't break the marker and leak it as text.

### Changed

- Literal `<<<dotprompt:...>>>` markers written in templates, passed in input,
or returned by custom helpers are no longer interpreted. Use the `{{role}}`,
`{{history}}`, `{{section}}` and `{{media}}` helpers.
- Rendered output is now split by marker position instead of line by line:
several markers on one line are all honored, text after `{{history}}` on the
same line goes after the history, and output made only of markers yields no
messages.
- The marker-building and marker-parsing methods on `RoleHelper`,
`HistoryHelper`, `SectionHelper` and `MediaHelper` take the render nonce and
are annotated `@internal`; they're implementation details of `Dotprompt`
rendering, not a public API. Their `markerPrefix`, `markerSuffix`,
`containsMarker` and `extract*` members were removed.

## [2.0.0] - 2026-10-04

Picoschema now follows the spec and behaves like the other runtimes. Schemas
Expand Down
2 changes: 1 addition & 1 deletion dart/dotprompt/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ name: dotprompt
description: >-
Dotprompt for Dart: parse and render .prompt files (YAML frontmatter +
Handlebars templates) for Generative AI.
version: 2.0.0
version: 2.0.1
license: Apache-2.0
homepage: https://github.com/google/dotprompt
repository: https://github.com/google/dotprompt
Expand Down
7 changes: 3 additions & 4 deletions docs/contributing/coding_guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -492,8 +492,8 @@ Include the Apache 2.0 license header at the top of each file (update year as ne
## Git Commit Message Guidelines

Use [Conventional Commits](https://www.conventionalcommits.org/) format with the
package name as the scope. This ensures release-please correctly attributes
commits to packages and generates accurate changelogs.
package name as the scope, so commits are attributed to the right package when
writing changelogs.

### Format

Expand Down Expand Up @@ -522,8 +522,7 @@ commits to packages and generates accurate changelogs.

### Commit Scopes (Package Names)

**IMPORTANT**: Use the exact scope from the table below. These match the package
names in `.release-please-config.json` and are used to generate release PRs.
**IMPORTANT**: Use the exact scope from the table below.

| Scope | Package/Directory | Description |
|-------|-------------------|-------------|
Expand Down
135 changes: 32 additions & 103 deletions docs/contributing/releases.md
Original file line number Diff line number Diff line change
@@ -1,105 +1,34 @@
# Making Releases

This repository uses
[release-please](https://github.com/googleapis/release-please) for managing
releases across multiple packages. Release-please automates versioning and
changelog generation based on [Conventional
Commits](https://www.conventionalcommits.org/).

## Monorepo Structure

The repository is configured to manage releases independently for the following
packages:

* `js/` - JavaScript implementation of dotprompt
* `python/dotpromptz/` - Python implementation of dotprompt
* `python/handlebars/` - Pure-Python Handlebars engine (`dotpromptz-handlebars`)
* `go/` - Go implementation of dotprompt
* `java/` - Java implementation of dotprompt

## How It Works

1. When commits are pushed to `main`, `release-please` automatically creates or
updates release PRs for each package that has changes.
2. Each package has its own release PR and will be versioned independently.
3. When a release PR is merged, `release-please` will:
* Create a new release with appropriate tags.
* Update the package version.
* Generate changelog entries.

## Commit Message Format

To ensure proper versioning, commit messages should follow the [Conventional
Commits](https://www.conventionalcommits.org/) format:

```
<type>(<scope>): <description>

[optional body]

[optional footer(s)]
```

### Types

* `feat`: A new feature (triggers a minor version bump)
* `fix`: A bug fix (triggers a patch version bump)
* `docs`: Documentation changes
* `style`: Code style changes (formatting, etc.)
* `refactor`: Code changes that neither fix bugs nor add features
* `perf`: Performance improvements
* `test`: Adding or updating tests
* `build`: Changes to build system or dependencies
* `ci`: Changes to CI configuration
* `chore`: Other changes that don't modify source code
* `revert`: Reverting a previous commit

### Scopes

To target specific packages, use these scopes:

* `js`: For changes to the JavaScript implementation
* `py`: For changes affecting all Python packages
* `py/dotpromptz`: For changes to the Python dotpromptz package
* `py/handlebars`: For changes to the Python Handlebars engine
* `go`: For changes to the Go implementation
* `java`: For changes to the Java implementation
* `deps`: For dependency updates

### Examples

```
feat(js): add new template helper function

fix(py/dotpromptz): resolve issue with template parsing

docs(go): update API documentation

build(py/handlebars): update build configuration
```

## Breaking Changes

For breaking changes, add `BREAKING CHANGE:` in the commit message body or
footer:

```
feat(js): change API interface

BREAKING CHANGE: The `render` method now returns a Promise instead of a string
```

This will trigger a major version bump for the affected package.

## Manual Release

If you need to manually trigger a release, you can:

1. Create a new release PR by running the release-please GitHub Action workflow
manually
2. Or push a commit to main with the appropriate conventional commit message

## Checking Release Status

The `.release-please-manifest.json` file tracks the current version of each
package.
Releases are manual: each package is versioned and published on its own. Bump
the version and changelog in a PR, merge it, then publish from `main`.

Commit messages still follow [Conventional
Commits](https://www.conventionalcommits.org/) with the package scopes listed
in `GEMINI.md`; they drive changelog entries and make it easy to see what
changed per package.

## Choosing a version

* `fix`: patch bump.
* `feat`: minor bump.
* Breaking change: major bump, or minor while the package is still `0.x`.

Mind downstream ranges. For example, Genkit depends on `dotprompt ^1.x` (npm)
and `dotprompt ^2.x` (pub.dev), so a fix shipped as a new major version won't
reach existing Genkit installs.

## Per package

| Package | Bump | Publish |
|---------|------|---------|
| `dotprompt` (npm, `js/`) | `js/package.json` | Run the **Release JS** workflow (`releaseTag`: `latest` or `next`). It publishes the version in `js/package.json`. |
| `dotpromptz` (PyPI, `python/dotpromptz/`) | `pyproject.toml`, `CHANGELOG.md`; then `uv lock` in `python/` and `scripts/export_requirements` | Create a GitHub release tagged `dotpromptz-X.Y.Z`. `publish_python_dotpromptz_package.yml` checks the tag against `pyproject.toml` and publishes. |
| `dotpromptz-handlebars` (PyPI, `python/handlebars/`) | same as above | GitHub release tagged `dotpromptz-handlebars-X.Y.Z` (`publish_python_handlebarrz_package.yml`). |
| `dotprompt` (pub.dev, `dart/dotprompt/`) | `pubspec.yaml`, `CHANGELOG.md` | `dart pub publish` from `dart/dotprompt/`. |
| Go module (`go/`) | `CHANGELOG.md` (optional) | Not tagged; consumers use pseudo-versions (`go get github.com/google/dotprompt/go@main`). If tags are ever added they must be `go/vX.Y.Z`, and from then on `@latest` resolves to the newest tag. |
| VS Code extension | `packages/vscode/package.json` | GitHub release tagged `dotprompt-vscode-X.Y.Z` (`vscode_publish.yml`). |
| Monaco, CodeMirror, tree-sitter (npm) | the package's `package.json` | Published by `web_editors.yml` / `treesitter.yml` when a push to `main` modifies that `package.json`. |
| JetBrains plugin | `plugin.xml` | Published by `ide_plugins.yml` when a push to `main` modifies `plugin.xml`. |
| `promptly` (npm) | `rs/promptly` | Push a `promptly-vX.Y.Z` tag (`promptly-npm.yml`). |
| Rust crate, Java library | `rs/dotprompt/Cargo.toml`, `java/com/google/dotprompt/BUILD.bazel` | Not published yet. `publish_rust.yml` / `publish_java.yml` run on GitHub releases tagged `dotprompt-rs-X.Y.Z` / `dotprompt-java-X.Y.Z`. |
24 changes: 6 additions & 18 deletions java/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,25 +69,13 @@ Configure these secrets in the repository settings (Settings → Secrets and var

## Release Process

Releases are managed by [release-please](https://github.com/googleapis/release-please).
Releases are manual (see `docs/contributing/releases.md`):

### Automated Flow

1. **Commit changes** to `main` using conventional commit messages with the `java` scope:
```
feat(java): add new template helper
fix(java): resolve parsing issue
```

2. **Release-please creates a PR** automatically with:
* Updated version in `BUILD.bazel`
* Generated `CHANGELOG.md`

3. **Merge the release PR** when ready.

4. **Publishing is automated** via `.github/workflows/publish_java.yml`:
* Triggers on release creation
* Signs and uploads to Maven Central
1. **Bump the version** in the `maven_coordinates` of `dotprompt_pkg` in
`java/com/google/dotprompt/BUILD.bazel` in a PR, and merge it.
2. **Create a GitHub release** tagged `dotprompt-java-X.Y.Z`.
3. **Publishing is automated** via `.github/workflows/publish_java.yml`, which
triggers on the release, signs and uploads to Maven Central.

### Verification

Expand Down
Loading
Loading