diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index 8bca525..7896143 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -33,9 +33,18 @@ "license": "MIT OR Apache-2.0", "private": false, "scopeAliases": { - "marketplace": ["mkt", "market", "mp"], - "codeweaver": ["cw"], - "strip-ansi": ["sa", "ansi"] + "marketplace": [ + "mkt", + "market", + "mp" + ], + "codeweaver": [ + "cw" + ], + "strip-ansi": [ + "sa", + "ansi" + ] } }, "metadata": { diff --git a/.commitlintrc.json b/.commitlintrc.json index bd6197e..3dcb96d 100644 --- a/.commitlintrc.json +++ b/.commitlintrc.json @@ -1,11 +1,27 @@ { - "extends": ["@commitlint/config-conventional"], + "extends": [ + "@commitlint/config-conventional" + ], "rules": { "scope-enum": [ 2, "always", - ["ctx", "strip-ansi", "codeweaver", "marketplace", "mkt", "cw", "sa"] + [ + "ctx", + "strip-ansi", + "codeweaver", + "marketplace", + "mkt", + "market", + "mp", + "cw", + "sa", + "ansi" + ] ], - "scope-empty": [2, "never"] + "scope-empty": [ + 2, + "never" + ] } } diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3104b0c..9be1bda 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,7 +24,7 @@ jobs: - uses: oven-sh/setup-bun@v2 with: bun-version: latest - # semantic-release sometimes gets grumpy with bunx + - uses: actions/setup-node@v6 with: node-version: 24 @@ -35,7 +35,7 @@ jobs: working-directory: plugins/${{ matrix.plugin }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: npx semantic-release + run: bunx semantic-release - name: Regenerate plugin.json from bumped package.json run: bun scripts/generate.mts @@ -67,7 +67,7 @@ jobs: - name: Release marketplace env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: npx semantic-release + run: bunx semantic-release - name: Regenerate marketplace.json from bumped package.json run: bun scripts/generate.mts diff --git a/.releaserc.json b/.releaserc.json index f6e8afe..b847f98 100644 --- a/.releaserc.json +++ b/.releaserc.json @@ -1,5 +1,7 @@ { - "branches": ["main"], + "branches": [ + "main" + ], "tagFormat": "marketplace@${version}", "plugins": [ [ @@ -47,6 +49,46 @@ "type": "perf", "release": "patch" }, + { + "breaking": true, + "scope": "market", + "release": "major" + }, + { + "scope": "market", + "type": "feat", + "release": "minor" + }, + { + "scope": "market", + "type": "fix", + "release": "patch" + }, + { + "scope": "market", + "type": "perf", + "release": "patch" + }, + { + "breaking": true, + "scope": "mp", + "release": "major" + }, + { + "scope": "mp", + "type": "feat", + "release": "minor" + }, + { + "scope": "mp", + "type": "fix", + "release": "patch" + }, + { + "scope": "mp", + "type": "perf", + "release": "patch" + }, { "release": false } diff --git a/plugins/codeweaver/package.json b/plugins/codeweaver/package.json index 38abce2..36ef7b2 100644 --- a/plugins/codeweaver/package.json +++ b/plugins/codeweaver/package.json @@ -32,7 +32,7 @@ "branches": [ "main" ], - "tagFormat": "codeweaver@${version}", + "tagFormat": "@knitli/codeweaver-v${version}", "plugins": [ [ "@semantic-release/commit-analyzer", diff --git a/plugins/ctx/package.json b/plugins/ctx/package.json index 98d5159..6e14462 100644 --- a/plugins/ctx/package.json +++ b/plugins/ctx/package.json @@ -28,7 +28,7 @@ "branches": [ "main" ], - "tagFormat": "ctx@${version}", + "tagFormat": "@knitli/ctx-v${version}", "plugins": [ [ "@semantic-release/commit-analyzer", diff --git a/plugins/strip-ansi/package.json b/plugins/strip-ansi/package.json index 0f5efcf..721743f 100644 --- a/plugins/strip-ansi/package.json +++ b/plugins/strip-ansi/package.json @@ -27,7 +27,7 @@ "branches": [ "main" ], - "tagFormat": "strip-ansi@${version}", + "tagFormat": "@knitli/strip-ansi-v${version}", "plugins": [ [ "@semantic-release/commit-analyzer", @@ -74,6 +74,26 @@ "type": "perf", "release": "patch" }, + { + "breaking": true, + "scope": "ansi", + "release": "major" + }, + { + "scope": "ansi", + "type": "feat", + "release": "minor" + }, + { + "scope": "ansi", + "type": "fix", + "release": "patch" + }, + { + "scope": "ansi", + "type": "perf", + "release": "patch" + }, { "release": false } diff --git a/scripts/generate.mts b/scripts/generate.mts index 631af9a..aedaf68 100644 --- a/scripts/generate.mts +++ b/scripts/generate.mts @@ -152,15 +152,20 @@ function releaseRulesForScope(scope: string) { * catchall `release: false` entry, which short-circuits commit-analyzer's * preset defaults. */ -function buildPluginReleaseConfig(canonical: string, aliases: string[] = []) { +function buildPluginReleaseConfig( + canonical: string, + aliases: string[] = [], + npmScope: string = "", +) { const scopes = [canonical, ...aliases]; const releaseRules = [ ...scopes.flatMap(releaseRulesForScope), { release: false }, ]; + const tagPrefix = npmScope ? `@${npmScope}/` : ""; return { branches: ["main"], - tagFormat: `${canonical}@\${version}`, + tagFormat: `${tagPrefix}${canonical}-v\${version}`, plugins: [ [ "@semantic-release/commit-analyzer", @@ -357,7 +362,11 @@ for (const plugin of plugins) { url: shared.repository, directory: pluginRelPath, }, - release: buildPluginReleaseConfig(plugin.name, aliasesByScope[plugin.name]), + release: buildPluginReleaseConfig( + plugin.name, + aliasesByScope[plugin.name], + shared.npmScope, + ), ...Object.fromEntries( Object.entries(extensions).filter( ([key]) =>