Skip to content

Commit 32f6214

Browse files
committed
docs(packages): add npm package readmes
## Summary Add package-level READMEs so npmjs package pages render useful install and usage docs, and finish the move to trusted publishing in CI. ## Changes - add README.md files for the CLI, parser, ESLint plugin, and TSDoc packages - update publish workflow to use GitHub OIDC trusted publishing - document trusted publishing in AGENTS.md - add a changeset for the README-bearing package releases ## Why The newly published npm packages had blank package pages because the package artifacts contained no package-level README files. ## Testing - pnpm lint - npm pack --json ./packages/cli - npm pack --json ./packages/parser - npm pack --json ./packages/eslint-plugin - npm pack --json ./packages/tsdoc
1 parent fdcb51a commit 32f6214

7 files changed

Lines changed: 111 additions & 2 deletions

File tree

.changeset/late-hounds-bow.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+
Add package-level READMEs so npmjs package pages render useful install and usage docs.

.github/workflows/publish-packages.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ jobs:
2828
runs-on: ubuntu-latest
2929
permissions:
3030
contents: write
31+
id-token: write
3132

3233
steps:
3334
- uses: actions/checkout@v4
@@ -85,5 +86,3 @@ jobs:
8586
- name: Publish packages
8687
if: steps.changesets.outputs.has_changesets == 'true'
8788
run: pnpm changeset publish
88-
env:
89-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

AGENTS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
- The publish automation lives in
88
`.github/workflows/publish-packages.yml`.
99
- The canonical public registry is npmjs, not GitHub Packages.
10+
- npmjs publishing uses GitHub Actions trusted publishing via OIDC, not an
11+
`NPM_TOKEN` secret.
1012
- That workflow only publishes when CI succeeds on `main` and there is at
1113
least one pending file in `.changeset/`.
1214
- If there is no pending changeset, the workflow does nothing, even if code in

packages/cli/README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# @recallnet/codecontext-cli
2+
3+
CLI for querying `@context` annotations in source code.
4+
5+
## Install
6+
7+
```bash
8+
npm install -D @recallnet/codecontext-cli @recallnet/codecontext-parser
9+
```
10+
11+
## Common commands
12+
13+
```bash
14+
npx codecontext --scope src/file.ts
15+
npx codecontext --diff HEAD src/file.ts
16+
npx codecontext --report
17+
npx codecontext --staged
18+
```
19+
20+
## Packages
21+
22+
- `@recallnet/codecontext-cli`: CLI commands and repo scanning
23+
- `@recallnet/codecontext-parser`: parser and staleness logic
24+
- `@recallnet/codecontext-eslint-plugin`: ESLint integration
25+
- `@recallnet/codecontext-tsdoc`: TSDoc tag definitions
26+
27+
## Docs
28+
29+
- Repo: https://github.com/recallnet/codecontext
30+
- Full README: https://github.com/recallnet/codecontext/blob/main/README.md

packages/eslint-plugin/README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# @recallnet/codecontext-eslint-plugin
2+
3+
ESLint rules for validating `@context` annotations and related freshness checks.
4+
5+
## Install
6+
7+
```bash
8+
npm install -D @recallnet/codecontext-eslint-plugin @recallnet/codecontext-parser eslint
9+
```
10+
11+
## Configure
12+
13+
```js
14+
import codecontext from "@recallnet/codecontext-eslint-plugin";
15+
16+
export default [codecontext.configs.recommended];
17+
```
18+
19+
## Docs
20+
21+
- Repo: https://github.com/recallnet/codecontext
22+
- Full README: https://github.com/recallnet/codecontext/blob/main/README.md

packages/parser/README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# @recallnet/codecontext-parser
2+
3+
Core parser for `@context` tags and supporting refs.
4+
5+
## Install
6+
7+
```bash
8+
npm install -D @recallnet/codecontext-parser
9+
```
10+
11+
## Use
12+
13+
```ts
14+
import { buildFileContext, parseContextTags } from "@recallnet/codecontext-parser";
15+
16+
const ctx = buildFileContext("src/file.ts");
17+
console.log(ctx.tags);
18+
```
19+
20+
## Docs
21+
22+
- Repo: https://github.com/recallnet/codecontext
23+
- Full README: https://github.com/recallnet/codecontext/blob/main/README.md
24+
- Spec: https://github.com/recallnet/codecontext/blob/main/packages/spec/SPEC.md

packages/tsdoc/README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# @recallnet/codecontext-tsdoc
2+
3+
TSDoc tag definitions for `codecontext`.
4+
5+
## Install
6+
7+
```bash
8+
npm install -D @recallnet/codecontext-tsdoc
9+
```
10+
11+
## Use
12+
13+
Reference the bundled config from your TSDoc or API Extractor setup:
14+
15+
```json
16+
{
17+
"extends": ["./node_modules/@recallnet/codecontext-tsdoc/tsdoc-base.json"]
18+
}
19+
```
20+
21+
## Docs
22+
23+
- Repo: https://github.com/recallnet/codecontext
24+
- Full README: https://github.com/recallnet/codecontext/blob/main/README.md

0 commit comments

Comments
 (0)