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
15 changes: 12 additions & 3 deletions .claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
22 changes: 19 additions & 3 deletions .commitlintrc.json
Original file line number Diff line number Diff line change
@@ -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"
]
}
}
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
44 changes: 43 additions & 1 deletion .releaserc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"branches": ["main"],
"branches": [
"main"
],
"tagFormat": "marketplace@${version}",
"plugins": [
[
Expand Down Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/codeweaver/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"branches": [
"main"
],
"tagFormat": "codeweaver@${version}",
"tagFormat": "@knitli/codeweaver-v${version}",
"plugins": [
[
"@semantic-release/commit-analyzer",
Expand Down
2 changes: 1 addition & 1 deletion plugins/ctx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"branches": [
"main"
],
"tagFormat": "ctx@${version}",
"tagFormat": "@knitli/ctx-v${version}",
"plugins": [
[
"@semantic-release/commit-analyzer",
Expand Down
22 changes: 21 additions & 1 deletion plugins/strip-ansi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"branches": [
"main"
],
"tagFormat": "strip-ansi@${version}",
"tagFormat": "@knitli/strip-ansi-v${version}",
"plugins": [
[
"@semantic-release/commit-analyzer",
Expand Down Expand Up @@ -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
}
Expand Down
15 changes: 12 additions & 3 deletions scripts/generate.mts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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]) =>
Expand Down
Loading