Skip to content

Commit ef9be00

Browse files
committed
ci(publish): target public npmjs releases
## Summary Switch package publishing from GitHub Packages to public npmjs and update install and release docs to match. ## Changes - retarget the publish workflow to registry.npmjs.org using NPM_TOKEN - make package publish metadata public and remove GitHub Packages pinning - simplify install docs for public npmjs usage - add a changeset covering the publishable packages - fix package export ordering so type-aware linting resolves parser types ## Why The packages are already intended to be publicly consumable, and the GitHub Packages-specific flow was adding auth friction and confusing agents about where releases actually land. ## Testing - npm whoami with the provided token against npmjs returned 401 Unauthorized - pnpm lint - pnpm test - ruby -e 'require "yaml"; YAML.load_file(".github/workflows/publish-packages.yml"); puts "YAML_OK"'
1 parent 16cea2e commit ef9be00

10 files changed

Lines changed: 32 additions & 72 deletions

File tree

.changeset/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"commit": false,
55
"fixed": [],
66
"linked": [],
7-
"access": "restricted",
7+
"access": "public",
88
"baseBranch": "main",
99
"updateInternalDependencies": "patch",
1010
"ignore": ["@recallnet/codecontext-spec"]

.changeset/few-bananas-share.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
"@recallnet/codecontext-cli": patch
3+
"@recallnet/codecontext-parser": patch
4+
"@recallnet/codecontext-eslint-plugin": patch
5+
"@recallnet/codecontext-tsdoc": patch
6+
---
7+
8+
Publish all packages publicly to npmjs and update package metadata for the new registry.

.github/workflows/publish-packages.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# Publish Packages — publishes @codecontext/* packages to GitHub Packages (npm).
1+
# Publish Packages — publishes @recallnet/* packages to npmjs.
22
#
33
# Triggers after CI completes on main. Uses changesets to determine which
4-
# packages have version bumps pending. Versions, commits, and publishes
5-
# when changesets are present.
4+
# packages have version bumps pending. Versions, commits, and publishes to
5+
# npmjs when changesets are present.
66
#
77
# Only runs on the main repo (not forks) and only on main branch pushes.
88

@@ -28,7 +28,6 @@ jobs:
2828
runs-on: ubuntu-latest
2929
permissions:
3030
contents: write
31-
packages: write
3231

3332
steps:
3433
- uses: actions/checkout@v4
@@ -45,8 +44,7 @@ jobs:
4544
with:
4645
node-version: 22
4746
cache: "pnpm"
48-
registry-url: "https://npm.pkg.github.com"
49-
scope: "@recallnet"
47+
registry-url: "https://registry.npmjs.org"
5048

5149
- name: Install dependencies
5250
run: pnpm install --frozen-lockfile
@@ -88,4 +86,4 @@ jobs:
8886
if: steps.changesets.outputs.has_changesets == 'true'
8987
run: pnpm changeset publish
9088
env:
91-
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
89+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.npmrc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
11
auto-install-peers=true
2-
@recallnet:registry=https://npm.pkg.github.com
3-
//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}

AGENTS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
merge to `main`.
77
- The publish automation lives in
88
`.github/workflows/publish-packages.yml`.
9+
- The canonical public registry is npmjs, not GitHub Packages.
910
- That workflow only publishes when CI succeeds on `main` and there is at
1011
least one pending file in `.changeset/`.
1112
- If there is no pending changeset, the workflow does nothing, even if code in
@@ -26,5 +27,7 @@
2627
behavior. Parser releases do not ship CLI-only fixes.
2728
- Do not close a bug as "published" just because the fix merged. Confirm the
2829
package version changed on the registry.
30+
- For public installs, verify against npmjs with `npm view`, not GitHub
31+
Packages.
2932
- If a package fix merged without a changeset, publishing will not happen until
3033
a new commit adds the missing changeset.

README.md

Lines changed: 6 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -353,49 +353,7 @@ See the full [specification](packages/spec/SPEC.md) for adaptation rules and con
353353

354354
## Quick Start
355355

356-
### 1. Authenticate for GitHub Packages
357-
358-
The npm packages in the `@recallnet` scope are published to GitHub Packages, so
359-
you need a token before `pnpm` or `npm` can install them.
360-
361-
Check whether the GitHub CLI is already authenticated:
362-
363-
```bash
364-
gh auth status
365-
```
366-
367-
If not, log in:
368-
369-
```bash
370-
gh auth login
371-
```
372-
373-
For project or CI use, prefer an environment variable backed by your GitHub CLI
374-
token:
375-
376-
```bash
377-
export NODE_AUTH_TOKEN=$(gh auth token)
378-
```
379-
380-
Then configure your project's `.npmrc`:
381-
382-
```ini
383-
@recallnet:registry=https://npm.pkg.github.com
384-
//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}
385-
```
386-
387-
For a one-off local setup, you can also write the token directly to your npm
388-
config:
389-
390-
```bash
391-
npm config set @recallnet:registry https://npm.pkg.github.com
392-
npm config set //npm.pkg.github.com/:_authToken "$(gh auth token)"
393-
```
394-
395-
If you manage tokens manually instead of using `gh`, the token needs
396-
`read:packages` access to install private packages from GitHub Packages.
397-
398-
### 2. Install the CLI
356+
### 1. Install the CLI
399357

400358
```bash
401359
pnpm add -D @recallnet/codecontext-cli @recallnet/codecontext-parser
@@ -417,11 +375,10 @@ Verify the CLI is available:
417375
npx codecontext --help
418376
```
419377

420-
If install fails with `401 Unauthorized` or `403 Forbidden`, re-run
421-
`gh auth status`, refresh `NODE_AUTH_TOKEN`, and confirm your `.npmrc` points at
422-
`https://npm.pkg.github.com` for the `@recallnet` scope.
378+
The packages are published publicly on npmjs, so you do not need GitHub
379+
Packages auth or a custom `.npmrc` for normal installs.
423380

424-
### 3. Run the core agent loop
381+
### 2. Run the core agent loop
425382

426383
```bash
427384
# Brief the agent before editing
@@ -434,7 +391,7 @@ npx codecontext --diff HEAD src/your-file.ts
434391
npx codecontext --staged
435392
```
436393

437-
### 4. Configure ESLint (optional)
394+
### 3. Configure ESLint (optional)
438395

439396
```javascript
440397
// eslint.config.js
@@ -446,7 +403,7 @@ export default [
446403
];
447404
```
448405

449-
### 5. Create context directory
406+
### 4. Create context directory
450407

451408
```bash
452409
mkdir -p docs/context

packages/cli/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
"directory": "packages/cli"
1010
},
1111
"publishConfig": {
12-
"registry": "https://npm.pkg.github.com",
13-
"access": "restricted"
12+
"access": "public"
1413
},
1514
"type": "module",
1615
"bin": {

packages/eslint-plugin/package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,17 @@
99
"directory": "packages/eslint-plugin"
1010
},
1111
"publishConfig": {
12-
"registry": "https://npm.pkg.github.com",
13-
"access": "restricted"
12+
"access": "public"
1413
},
1514
"type": "module",
1615
"main": "./dist/index.cjs",
1716
"module": "./dist/index.js",
1817
"types": "./dist/index.d.ts",
1918
"exports": {
2019
".": {
20+
"types": "./dist/index.d.ts",
2121
"import": "./dist/index.js",
22-
"require": "./dist/index.cjs",
23-
"types": "./dist/index.d.ts"
22+
"require": "./dist/index.cjs"
2423
}
2524
},
2625
"files": [

packages/parser/package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,24 @@
22
"name": "@recallnet/codecontext-parser",
33
"version": "0.2.0",
44
"private": false,
5-
"description": "Core parser for @context tags and .ctx.md files",
5+
"description": "Core parser for @context tags and supporting refs",
66
"repository": {
77
"type": "git",
88
"url": "https://github.com/recallnet/codecontext.git",
99
"directory": "packages/parser"
1010
},
1111
"publishConfig": {
12-
"registry": "https://npm.pkg.github.com",
13-
"access": "restricted"
12+
"access": "public"
1413
},
1514
"type": "module",
1615
"main": "./dist/index.cjs",
1716
"module": "./dist/index.js",
1817
"types": "./dist/index.d.ts",
1918
"exports": {
2019
".": {
20+
"types": "./dist/index.d.ts",
2121
"import": "./dist/index.js",
22-
"require": "./dist/index.cjs",
23-
"types": "./dist/index.d.ts"
22+
"require": "./dist/index.cjs"
2423
}
2524
},
2625
"files": [

packages/tsdoc/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
"directory": "packages/tsdoc"
1010
},
1111
"publishConfig": {
12-
"registry": "https://npm.pkg.github.com",
13-
"access": "restricted"
12+
"access": "public"
1413
},
1514
"files": [
1615
"tsdoc-base.json"

0 commit comments

Comments
 (0)