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 package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"test": "bun test ./src",
"test:dom": "vitest run",
"typecheck": "tsgo --noEmit",
"version": "changeset version && bun run format CHANGELOG.md"
"version": "changeset version && bun scripts/sync-skill-versions.ts && bun run format CHANGELOG.md"
},
"devDependencies": {
"@changesets/changelog-github": "0.7.0",
Expand Down
24 changes: 24 additions & 0 deletions scripts/sync-skill-versions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env bun
// Stamp `library_version` in every skills/*/SKILL.md frontmatter to the
// current package version. Wired into the `version` script so the changesets
// "Version packages" PR carries the skill bump alongside the package bump —
// keeps `intent stale` quiet without a manual review PR per release.
import { readFileSync, readdirSync, writeFileSync, existsSync } from "node:fs";
import { join } from "node:path";

const { version } = JSON.parse(readFileSync("package.json", "utf8"));
const FIELD = /^( *library_version:\s*")([^"]*)(")/m;

let touched = 0;
for (const entry of readdirSync("skills", { withFileTypes: true })) {
if (!entry.isDirectory()) continue;
const file = join("skills", entry.name, "SKILL.md");
if (!existsSync(file)) continue;
const before = readFileSync(file, "utf8");
const after = before.replace(FIELD, `$1${version}$3`);
if (after !== before) {
writeFileSync(file, after);
touched++;
}
}
console.log(`sync-skill-versions: ${touched} skill(s) → ${version}`);
2 changes: 1 addition & 1 deletion skills/tanstack-store/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Persist a @tanstack/store Store or writable Atom with @stainless-co
license: MIT
metadata:
library: "@stainless-code/persist"
library_version: "0.0.0"
library_version: "0.1.0"
framework: "tanstack-store"
sources:
- README.md
Expand Down
Loading