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
25 changes: 25 additions & 0 deletions .github/workflows/release-deepl.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: release-deepl

on:
workflow_dispatch:
inputs:
version:
description: 'Version bump for @kiritan/deepl: patch/minor/major/prerelease, or an explicit version (e.g. 0.2.0)'
required: true
default: patch
dist_tag:
description: 'npm dist-tag to publish under. Leave empty to auto-detect: the prerelease identifier (e.g. "beta" from 0.2.0-beta.0), or "latest" for a stable version.'
required: false
default: ''

jobs:
release:
uses: ./.github/workflows/_release-package.yml
with:
package_dir: packages/deepl
npm_package_name: '@kiritan/deepl'
version: ${{ inputs.version }}
dist_tag: ${{ inputs.dist_tag }}
permissions:
contents: write
id-token: write
5 changes: 5 additions & 0 deletions .kiritanconfig
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ export default {
strategy: "inline",
naming: { template: "packages/runtime/{base}.{locale}.{ext}" },
},
{
glob: "packages/deepl/base/README.base.md",
strategy: "inline",
naming: { template: "packages/deepl/{base}.{locale}.{ext}" },
},
{
glob: "extensions/vscode/base/README.base.md",
strategy: "inline",
Expand Down
7 changes: 4 additions & 3 deletions CONTRIBUTING.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ npm install
| --- | --- | --- |
| `kiritan` | `packages/kiritan` | CLI とビルドパイプライン(設定・翻訳ストア・レンダラー・翻訳ミドルウェア) |
| `@kiritan/runtime` | `packages/runtime` | ビルド時依存を持たない、最小限の `t(key, params)` ランタイム |
| `@kiritan/deepl` | `packages/deepl` | `translate.middlewares` 用のDeepL翻訳ミドルウェア |
| `otoneko1102.kiritan` | `extensions/vscode` | VS Code拡張機能(`:::kiritan{...}` ブロックのシンタックスハイライト)。npm workspaceのメンバーではない — 詳細は後述の「リリース」を参照。 |
| — | `extensions/vim` | Vim/Neovimプラグイン(同じディレクティブハイライトに加え、`*.kiritanconfig` のfiletype判定)。どこにも公開せず、プラグインマネージャーの`rtp`オプションでこのリポジトリから直接インストールする。 |

Expand Down Expand Up @@ -78,17 +79,17 @@ npm run ci && npm run typecheck && npm run test && npm run build

## リリース(メンテナー向け)

`kiritan` と `@kiritan/runtime` はそれぞれ専用の `workflow_dispatch` ワークフロー(`release.yml` / `release-runtime.yml`)を持っており、片方をリリースしてももう片方に誤って影響することはありません。どちらも実際の処理を行う共通の再利用可能ワークフロー(`_release-package.yml`。単体では実行不可)への薄いラッパーです。
npmパッケージ(`kiritan`・`@kiritan/runtime`・`@kiritan/deepl`)はそれぞれ専用の `workflow_dispatch` ワークフロー(`release.yml` / `release-runtime.yml` / `release-deepl.yml`)を持っており、1つをリリースしても他のパッケージに誤って影響することはありません。いずれも実際の処理を行う共通の再利用可能ワークフロー(`_release-package.yml`。単体では実行不可)への薄いラッパーです。

Actions タブから `release` または `release-runtime` を、2つの入力で実行してください:
Actions タブから対象パッケージのワークフロー(例: `release-runtime`)を、2つの入力で実行してください:

- `version`: semverのbump種別(`patch` / `minor` / `major` / `prerelease`)、または明示的なバージョン(例: `0.2.0`)。そのまま `npm version` に渡されます。
- `dist_tag`: 公開先のnpm dist-tag。空なら自動判定(プレリリースならそのタグ、例えば `0.2.0-beta.0` なら `beta`。安定版なら `latest`)。

ワークフローは対象パッケージの `package.json` を更新し(changelogファイルは無く、代わりにマージ済みPRから生成されるGitHubの自動リリースノートを使用)、`base/*.base.md` から生成される全ドキュメントを再生成し(`kiritan build`。バージョンアップと同じコミットにまとめられます)、**trusted publishing**(OIDC。`NPM_TOKEN` 不要)で npm に provenance 付きで公開し、バージョンコミットと `<package>@<version>` タグを push した上で、GitHub Release を作成します。

trusted publishing は npmjs.com 上でパッケージごとに一度だけ設定が必要です。
パッケージの **Settings → Publishing access → Trusted publishers → GitHub** から、そのパッケージ自身のワークフローファイル(`release.yml` または `release-runtime.yml`)を指定してください。
パッケージの **Settings → Publishing access → Trusted publishers → GitHub** から、そのパッケージ自身のワークフローファイル(例: `kiritan` なら `release.yml`、`@kiritan/deepl` なら `release-deepl.yml`)を指定してください。

`kiritan` は `@kiritan/runtime` に依存している(現在 `^0.1.0`)ため、runtimeのminor/majorバージョンを上げても Kiritan 側の依存範囲は自動更新されません。これは意図的な仕様で、runtime単体のリリースが Kiritan の `package.json` に触れることが無いようにするためです。該当する場合は別途手動でPRを出してください。

Expand Down
7 changes: 4 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ This is an npm workspaces monorepo (see [docs/DESIGN.md](./docs/DESIGN.md) chapt
| --- | --- | --- |
| `kiritan` | `packages/kiritan` | The CLI + build pipeline (config, stores, renderers, translate middlewares) |
| `@kiritan/runtime` | `packages/runtime` | The minimal `t(key, params)` runtime, with no build-time dependencies |
| `@kiritan/deepl` | `packages/deepl` | A DeepL translate middleware for `translate.middlewares` |
| `otoneko1102.kiritan` | `extensions/vscode` | VS Code extension (syntax highlighting for `:::kiritan{...}` blocks). Not an npm workspace member — see "Releasing" below. |
| — | `extensions/vim` | Vim/Neovim plugin (the same directive highlighting, plus `*.kiritanconfig` filetype detection). Not published anywhere — installed directly from this repo via a plugin manager's `rtp` option. |

Expand Down Expand Up @@ -81,17 +82,17 @@ Keep each change focused and add tests for any new behaviour. There's no changes

## Releasing (maintainers)

`kiritan` and `@kiritan/runtime` each have their own `workflow_dispatch` GitHub Actions workflow — `release.yml` and `release-runtime.yml` — so releasing one package can never accidentally touch the other. Both are thin wrappers around a shared reusable workflow (`_release-package.yml`, not runnable on its own) that does the actual work.
Every npm package (`kiritan`, `@kiritan/runtime`, `@kiritan/deepl`) has its own `workflow_dispatch` GitHub Actions workflow — `release.yml`, `release-runtime.yml`, `release-deepl.yml` — so releasing one package can never accidentally touch another. Each is a thin wrapper around a shared reusable workflow (`_release-package.yml`, not runnable on its own) that does the actual work.

From the Actions tab, run `release` or `release-runtime` with two inputs:
From the Actions tab, run the package's workflow (e.g. `release-runtime`) with two inputs:

- `version`: a semver bump (`patch` / `minor` / `major` / `prerelease`) or an explicit version (e.g. `0.2.0`), passed straight to `npm version`.
- `dist_tag`: the npm dist-tag to publish under. Leave empty to auto-detect — the prerelease identifier (e.g. `beta` from `0.2.0-beta.0`), or `latest` for a stable version.

The workflow bumps that package's `package.json` (no changelog file — GitHub's auto-generated release notes, from merged PRs, are used instead), regenerates every `base/*.base.md`-derived doc (`kiritan build`, folded into the same commit), publishes to npm with provenance via **trusted publishing** (OIDC — no `NPM_TOKEN` needed), pushes the version commit and a `<package>@<version>` tag, and creates a GitHub Release.

Trusted publishing must be configured once per package on npmjs.com:
package **Settings → Publishing access → Trusted publishers → GitHub**, pointing at that package's own workflow file (`release.yml` or `release-runtime.yml`).
package **Settings → Publishing access → Trusted publishers → GitHub**, pointing at that package's own workflow file (e.g. `release.yml` for `kiritan`, `release-deepl.yml` for `@kiritan/deepl`).

Since `kiritan` depends on `@kiritan/runtime` (currently `^0.1.0`), bumping runtime's minor or major version doesn't automatically update Kiritan's dependency range — that's a manual follow-up PR when it happens, on purpose, so releasing runtime alone never touches Kiritan's `package.json`.

Expand Down
1 change: 1 addition & 0 deletions README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
| --- | --- | --- |
| [`kiritan`](./packages/kiritan) | `packages/kiritan` | CLI とビルドパイプライン(設定・翻訳ストア・レンダラー・翻訳ミドルウェア) |
| [`@kiritan/runtime`](./packages/runtime) | `packages/runtime` | ビルド時依存を持たない、最小限の `t(key, params)` ランタイム |
| [`@kiritan/deepl`](./packages/deepl) | `packages/deepl` | `translate.middlewares` 用の [DeepL](https://www.deepl.com/) 翻訳ミドルウェア |

## 関連ツール

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ This is an npm workspaces monorepo. The full design lives in [docs/DESIGN.md](./
| --- | --- | --- |
| [`kiritan`](./packages/kiritan) | `packages/kiritan` | The CLI + build pipeline: config, translation stores, renderers, translate middlewares |
| [`@kiritan/runtime`](./packages/runtime) | `packages/runtime` | The minimal `t(key, params)` runtime, with no build-time dependencies |
| [`@kiritan/deepl`](./packages/deepl) | `packages/deepl` | A [DeepL](https://www.deepl.com/) translate middleware for `translate.middlewares` |

## Related tooling

Expand Down
14 changes: 8 additions & 6 deletions base/CONTRIBUTING.base.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ This is an npm workspaces monorepo (see [docs/DESIGN.md](./docs/DESIGN.md) chapt
| --- | --- | --- |
| `kiritan` | `packages/kiritan` | The CLI + build pipeline (config, stores, renderers, translate middlewares) |
| `@kiritan/runtime` | `packages/runtime` | The minimal `t(key, params)` runtime, with no build-time dependencies |
| `@kiritan/deepl` | `packages/deepl` | A DeepL translate middleware for `translate.middlewares` |
| `otoneko1102.kiritan` | `extensions/vscode` | VS Code extension (syntax highlighting for `:::kiritan{...}` blocks). Not an npm workspace member — see "Releasing" below. |
| — | `extensions/vim` | Vim/Neovim plugin (the same directive highlighting, plus `*.kiritanconfig` filetype detection). Not published anywhere — installed directly from this repo via a plugin manager's `rtp` option. |

Expand All @@ -64,6 +65,7 @@ The design and rationale for everything above live in [docs/DESIGN.md](./docs/DE
| --- | --- | --- |
| `kiritan` | `packages/kiritan` | CLI とビルドパイプライン(設定・翻訳ストア・レンダラー・翻訳ミドルウェア) |
| `@kiritan/runtime` | `packages/runtime` | ビルド時依存を持たない、最小限の `t(key, params)` ランタイム |
| `@kiritan/deepl` | `packages/deepl` | `translate.middlewares` 用のDeepL翻訳ミドルウェア |
| `otoneko1102.kiritan` | `extensions/vscode` | VS Code拡張機能(`:::kiritan{...}` ブロックのシンタックスハイライト)。npm workspaceのメンバーではない — 詳細は後述の「リリース」を参照。 |
| — | `extensions/vim` | Vim/Neovimプラグイン(同じディレクティブハイライトに加え、`*.kiritanconfig` のfiletype判定)。どこにも公開せず、プラグインマネージャーの`rtp`オプションでこのリポジトリから直接インストールする。 |

Expand Down Expand Up @@ -181,16 +183,16 @@ Keep each change focused and add tests for any new behaviour. There's no changes
:::kiritan{locale=en}
## Releasing (maintainers)

`kiritan` and `@kiritan/runtime` each have their own `workflow_dispatch` GitHub Actions workflow — `release.yml` and `release-runtime.yml` — so releasing one package can never accidentally touch the other. Both are thin wrappers around a shared reusable workflow (`_release-package.yml`, not runnable on its own) that does the actual work.
Every npm package (`kiritan`, `@kiritan/runtime`, `@kiritan/deepl`) has its own `workflow_dispatch` GitHub Actions workflow — `release.yml`, `release-runtime.yml`, `release-deepl.yml` — so releasing one package can never accidentally touch another. Each is a thin wrapper around a shared reusable workflow (`_release-package.yml`, not runnable on its own) that does the actual work.

From the Actions tab, run `release` or `release-runtime` with two inputs:
From the Actions tab, run the package's workflow (e.g. `release-runtime`) with two inputs:
- `version`: a semver bump (`patch` / `minor` / `major` / `prerelease`) or an explicit version (e.g. `0.2.0`), passed straight to `npm version`.
- `dist_tag`: the npm dist-tag to publish under. Leave empty to auto-detect — the prerelease identifier (e.g. `beta` from `0.2.0-beta.0`), or `latest` for a stable version.

The workflow bumps that package's `package.json` (no changelog file — GitHub's auto-generated release notes, from merged PRs, are used instead), regenerates every `base/*.base.md`-derived doc (`kiritan build`, folded into the same commit), publishes to npm with provenance via **trusted publishing** (OIDC — no `NPM_TOKEN` needed), pushes the version commit and a `<package>@<version>` tag, and creates a GitHub Release.

Trusted publishing must be configured once per package on npmjs.com:
package **Settings → Publishing access → Trusted publishers → GitHub**, pointing at that package's own workflow file (`release.yml` or `release-runtime.yml`).
package **Settings → Publishing access → Trusted publishers → GitHub**, pointing at that package's own workflow file (e.g. `release.yml` for `kiritan`, `release-deepl.yml` for `@kiritan/deepl`).

Since `kiritan` depends on `@kiritan/runtime` (currently `^0.1.0`), bumping runtime's minor or major version doesn't automatically update Kiritan's dependency range — that's a manual follow-up PR when it happens, on purpose, so releasing runtime alone never touches Kiritan's `package.json`.

Expand All @@ -203,16 +205,16 @@ The Vim/Neovim plugin (`extensions/vim`) has nothing to build or publish — use
:::kiritan{locale=ja}
## リリース(メンテナー向け)

`kiritan` と `@kiritan/runtime` はそれぞれ専用の `workflow_dispatch` ワークフロー(`release.yml` / `release-runtime.yml`)を持っており、片方をリリースしてももう片方に誤って影響することはありません。どちらも実際の処理を行う共通の再利用可能ワークフロー(`_release-package.yml`。単体では実行不可)への薄いラッパーです。
npmパッケージ(`kiritan`・`@kiritan/runtime`・`@kiritan/deepl`)はそれぞれ専用の `workflow_dispatch` ワークフロー(`release.yml` / `release-runtime.yml` / `release-deepl.yml`)を持っており、1つをリリースしても他のパッケージに誤って影響することはありません。いずれも実際の処理を行う共通の再利用可能ワークフロー(`_release-package.yml`。単体では実行不可)への薄いラッパーです。

Actions タブから `release` または `release-runtime` を、2つの入力で実行してください:
Actions タブから対象パッケージのワークフロー(例: `release-runtime`)を、2つの入力で実行してください:
- `version`: semverのbump種別(`patch` / `minor` / `major` / `prerelease`)、または明示的なバージョン(例: `0.2.0`)。そのまま `npm version` に渡されます。
- `dist_tag`: 公開先のnpm dist-tag。空なら自動判定(プレリリースならそのタグ、例えば `0.2.0-beta.0` なら `beta`。安定版なら `latest`)。

ワークフローは対象パッケージの `package.json` を更新し(changelogファイルは無く、代わりにマージ済みPRから生成されるGitHubの自動リリースノートを使用)、`base/*.base.md` から生成される全ドキュメントを再生成し(`kiritan build`。バージョンアップと同じコミットにまとめられます)、**trusted publishing**(OIDC。`NPM_TOKEN` 不要)で npm に provenance 付きで公開し、バージョンコミットと `<package>@<version>` タグを push した上で、GitHub Release を作成します。

trusted publishing は npmjs.com 上でパッケージごとに一度だけ設定が必要です。
パッケージの **Settings → Publishing access → Trusted publishers → GitHub** から、そのパッケージ自身のワークフローファイル(`release.yml` または `release-runtime.yml`)を指定してください。
パッケージの **Settings → Publishing access → Trusted publishers → GitHub** から、そのパッケージ自身のワークフローファイル(例: `kiritan` なら `release.yml`、`@kiritan/deepl` なら `release-deepl.yml`)を指定してください。

`kiritan` は `@kiritan/runtime` に依存している(現在 `^0.1.0`)ため、runtimeのminor/majorバージョンを上げても Kiritan 側の依存範囲は自動更新されません。これは意図的な仕様で、runtime単体のリリースが Kiritan の `package.json` に触れることが無いようにするためです。該当する場合は別途手動でPRを出してください。

Expand Down
Loading
Loading