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
5 changes: 5 additions & 0 deletions .changeset/readme-nav-links.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@vndv/pi-codegraph": patch
---

Link the README navigation items to their sections.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# pi-codegraph
### CodeGraph tools for pi

Install · Usage · How it works
[Install](#install) · [Usage](#usage) · [How it works](#how-it-works)

Ask pi structural questions about your codebase without falling back to slow grep/read loops.

Expand All @@ -15,7 +15,7 @@ An extension for [pi](https://pi.dev) that gives the agent access to [CodeGraph]
npm install -g @colbymchenry/codegraph
cd /path/to/project
codegraph init -i
pi install npm:@vndv/pi-codegraph@0.1.1
pi install npm:@vndv/pi-codegraph@0.1.4
pi
```

Expand Down Expand Up @@ -51,7 +51,7 @@ Extension tools only. There is no MCP setup for pi users to maintain.
From npm:

```bash
pi install npm:@vndv/pi-codegraph@0.1.1
pi install npm:@vndv/pi-codegraph@0.1.4
```

From GitHub:
Expand Down Expand Up @@ -160,7 +160,7 @@ That means another developer only needs the npm package, the `codegraph` CLI, an
Remove the package using the same source shown by `pi list`:

```bash
pi remove npm:@vndv/pi-codegraph@0.1.1
pi remove npm:@vndv/pi-codegraph@0.1.4
```

If you installed from GitHub or a local path, remove that exact entry instead:
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,17 @@
]
},
"scripts": {
"ci": "npm run typecheck && npm test && npm run compat:codegraph && npm pack --dry-run",
"check:readme-version": "node scripts/sync-readme-version.mjs --check",
"ci": "npm run typecheck && npm test && npm run compat:codegraph && npm run check:readme-version && npm pack --dry-run",
"compat:codegraph": "codegraph --version",
"local-release": "changeset version && changeset publish",
"publish-packages": "node -e \"const {execSync}=require('node:child_process'); const p=require('./package.json'); const spec=p.name+'@'+p.version; try { execSync('npm view '+spec+' version', {stdio:'ignore'}); console.log(spec+' already published; skipping.'); } catch { execSync('npm publish --access public --provenance --ignore-scripts', {stdio:'inherit'}); }\"",
"prepack": "npm run typecheck && npm test",
"prepublishOnly": "npm run ci",
"typecheck": "tsc --noEmit",
"test": "vitest run",
"version-packages": "changeset version && npm install --package-lock-only --ignore-scripts"
"sync:readme-version": "node scripts/sync-readme-version.mjs",
"version-packages": "changeset version && npm run sync:readme-version && npm install --package-lock-only --ignore-scripts"
},
"engines": {
"node": ">=22.19.0 <25"
Expand Down
24 changes: 24 additions & 0 deletions scripts/sync-readme-version.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { readFile, writeFile } from 'node:fs/promises';

const checkOnly = process.argv.includes('--check');
const packageJson = JSON.parse(await readFile(new URL('../package.json', import.meta.url), 'utf8'));
const readmeUrl = new URL('../README.md', import.meta.url);
const readme = await readFile(readmeUrl, 'utf8');
const packageName = packageJson.name;
const version = packageJson.version;
const installPattern = new RegExp(`npm:${packageName.replaceAll('/', '\\/')}@\\d+\\.\\d+\\.\\d+`, 'g');
const expected = `npm:${packageName}@${version}`;
const updated = readme.replace(installPattern, expected);

if (updated === readme) {
console.log(`README package version already ${version}.`);
process.exit(0);
}

if (checkOnly) {
console.error(`README package version is stale. Run npm run sync:readme-version.`);
process.exit(1);
}

await writeFile(readmeUrl, updated);
console.log(`Updated README package references to ${version}.`);