create-rigline-plugin 1.0.0-alpha.13 → 1.0.0-alpha.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  Scaffolds a workspace for [Rigline](https://github.com/Rigline/Rigline) plugins — plugins for the
4
4
  Claude Code VS Code extension.
5
5
 
6
- npm create rigline-plugin my-plugins
6
+ npm create rigline-plugin my-plugin
7
7
 
8
8
  A plugin runs inside a modification of Anthropic's extension, so the
9
9
  [plugin policy](https://github.com/Rigline/Rigline/blob/main/docs/plugin-policy.md) applies to it —
@@ -15,17 +15,19 @@ A pnpm workspace with `plugins/*` and one plugin in it, rather than a single-plu
15
15
  multi-plugin shape scaffolds correctly for one plugin and a second is then a directory copy, where a
16
16
  single-plugin template could not grow into a workspace without a restructure.
17
17
 
18
- my-plugins/
18
+ my-plugin/
19
19
  generated.ts the harvested identifiers, shared by every plugin here
20
20
  pnpm-workspace.yaml with the supply-chain settings written down rather than inherited
21
- tsconfig.base.json pulls the root harvest into every plugin's program
21
+ tsconfig.base.json the compiler settings every plugin shares
22
+ tsconfig.plugin.json pulls the root harvest into every plugin's program
22
23
  plugins/my-plugin/
23
24
  rigline.json what the plugin declares it needs from the extension
24
- src/index.ts the plugin
25
+ src/index.tsx the plugin
25
26
  src/index.test.ts
26
27
 
27
28
  Then:
28
29
 
30
+ cd my-plugin
29
31
  pnpm install
30
32
  pnpm codegen # harvest your installed extension, and commit the result
31
33
  pnpm build
@@ -46,8 +48,8 @@ and the diff when you run against a newer extension is how you find out what mov
46
48
 
47
49
  The identifiers are harvested once, at the root, and imported by every plugin in the repository,
48
50
  because they all compile against the same installed extension. Module augmentation is per-program,
49
- so each plugin's tsconfig has to pull that harvest in — which the shared base config does, and which
50
- is the one ordering dependency in the whole arrangement.
51
+ so each plugin's tsconfig has to pull that harvest in — which `tsconfig.plugin.json`, the config each
52
+ plugin extends, does, and which is the one ordering dependency in the whole arrangement.
51
53
 
52
54
  [Authoring guide](https://github.com/Rigline/Rigline/blob/main/docs/authoring.md)
53
55
 
package/dist/bin.js ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import { main } from "./index.js";
3
+ process.exitCode = main(process.argv.slice(2));
4
+ //# sourceMappingURL=bin.js.map
package/dist/index.js CHANGED
@@ -1,4 +1,3 @@
1
- #!/usr/bin/env node
2
1
  import { existsSync, mkdirSync, readdirSync, readFileSync, writeFileSync } from "node:fs";
3
2
  import { basename, dirname, join, relative, resolve } from "node:path";
4
3
  import { fileURLToPath } from "node:url";
@@ -132,7 +131,4 @@ const USAGE = `create-rigline-plugin
132
131
 
133
132
  Scaffolds a pnpm workspace holding one Rigline plugin. The directory's own name is the plugin's
134
133
  unless --name says otherwise; a second plugin later is a copy of the first.`;
135
- if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === resolve(process.argv[1])) {
136
- process.exitCode = main(process.argv.slice(2));
137
- }
138
134
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-rigline-plugin",
3
- "version": "1.0.0-alpha.13",
3
+ "version": "1.0.0-alpha.14",
4
4
  "description": "Scaffold a workspace for Claude Code VS Code extension plugins",
5
5
  "keywords": [
6
6
  "rigline",
@@ -29,10 +29,10 @@
29
29
  "template"
30
30
  ],
31
31
  "bin": {
32
- "create-rigline-plugin": "./dist/index.js"
32
+ "create-rigline-plugin": "./dist/bin.js"
33
33
  },
34
34
  "devDependencies": {
35
- "@rigline/plugin-api": "1.0.0-alpha.13"
35
+ "@rigline/plugin-api": "1.0.0-alpha.14"
36
36
  },
37
37
  "scripts": {
38
38
  "build": "node ../../scripts/clean-dist.mjs && tsc -p tsconfig.build.json",
@@ -0,0 +1,7 @@
1
+ # LF in the repository, and each platform's own line endings in the working tree, so a diff never
2
+ # depends on who checked the file out.
3
+ * text=auto
4
+
5
+ # Written by `pnpm codegen`, so review tools collapse it. Still diffed: after a Claude Code update,
6
+ # its diff is how you see what moved.
7
+ generated.ts linguist-generated
@@ -37,14 +37,14 @@ jobs:
37
37
  # claim to match, because a floor nothing runs on is a guess.
38
38
  node: ["22.12.0", "24", "26"]
39
39
  steps:
40
- - uses: actions/checkout@v5
40
+ - uses: actions/checkout@v7
41
41
 
42
42
  # Pinned exactly rather than to the major: this action's `v6` tag still resolves to the last
43
43
  # release before pnpm v12 support, and `v4` runs on a runner runtime GitHub has deprecated.
44
44
  - uses: pnpm/action-setup@v6.1.0
45
45
 
46
46
  # After pnpm, never before: `cache: pnpm` asks pnpm where its store is.
47
- - uses: actions/setup-node@v5
47
+ - uses: actions/setup-node@v7
48
48
  with:
49
49
  node-version: ${{ matrix.node }}
50
50
  cache: pnpm
@@ -2,15 +2,15 @@
2
2
  #
3
3
  # GitHub authenticates to npm over OIDC, so the secret this workflow would otherwise need does not
4
4
  # exist. What it does is *stage*: a staged version sits in a queue that nobody can install until you
5
- # approve it from your own machine with 2FA. Approving says you meant to ship it.
6
- #
7
- # pnpm stage approve
5
+ # approve it with your second factor. Approving says you meant to ship it. Approve on npmjs.com,
6
+ # under your profile's Staged Packages, or with `npm stage approve <id>` (`npm stage list` shows the
7
+ # ids); `pnpm stage approve` asks for a typed code, which a security key cannot give.
8
8
  #
9
9
  # Before this works, once per package, on npmjs.com:
10
10
  #
11
11
  # 1. Publish the first version by hand. A package that does not exist yet has nothing for a
12
- # trusted publisher to attach to: `pnpm publish -r --otp <code>` (a one-time password, not a
13
- # token — there is then nothing to store or revoke).
12
+ # trusted publisher to attach to: `pnpm build`, then `npm publish` in the plugin's directory,
13
+ # which opens a browser for your second factor (no token, so nothing to store or revoke).
14
14
  # 2. Add a trusted publisher under the package's settings, naming this repository and this file
15
15
  # by path. Renaming this file breaks the exchange until the entry is edited to match.
16
16
  # Set its permission to stage-only.
@@ -56,7 +56,7 @@ jobs:
56
56
  echo "::error::Releases go from ${{ github.event.repository.default_branch }}."
57
57
  exit 1
58
58
 
59
- - uses: actions/checkout@v5
59
+ - uses: actions/checkout@v7
60
60
 
61
61
  # npm binds a provenance attestation to the package's `repository` field, so a package
62
62
  # without one cannot be staged with `--provenance` at all. Asked here, before the build, so
@@ -82,7 +82,7 @@ jobs:
82
82
  # Pinned exactly rather than to the major: this action's `v6` tag still resolves to the last
83
83
  # release before pnpm v12 support, and `v4` runs on a runner runtime GitHub has deprecated.
84
84
  - uses: pnpm/action-setup@v6.1.0
85
- - uses: actions/setup-node@v5
85
+ - uses: actions/setup-node@v7
86
86
  with:
87
87
  node-version: 26
88
88
  cache: pnpm
@@ -107,6 +107,8 @@ jobs:
107
107
  # went up and the one command that finishes the job.
108
108
  - name: Summarise
109
109
  if: always()
110
+ env:
111
+ DRY_RUN: ${{ inputs.dry_run }}
110
112
  run: |
111
113
  if [ ! -f pnpm-publish-summary.json ]; then
112
114
  echo "## Nothing was staged" >> "$GITHUB_STEP_SUMMARY"
@@ -118,13 +120,15 @@ jobs:
118
120
  const s = JSON.parse(require("fs").readFileSync("pnpm-publish-summary.json", "utf8"));
119
121
  const out = [];
120
122
  const staged = s.publishedPackages ?? [];
123
+ const table = ["| package | version |", "| --- | --- |", ...staged.map((p) => `| \`${p.name}\` | \`${p.version}\` |`)];
121
124
  if (staged.length === 0) {
122
125
  out.push("## Nothing was staged", "", "Every version is already on the registry. Bump one to release it.");
126
+ } else if (process.env.DRY_RUN === "true") {
127
+ out.push("## Dry run: nothing was staged", "", "A run without the dry run would stage these:", "", ...table);
123
128
  } else {
124
- out.push("## Staged, and awaiting approval", "", "| package | version |", "| --- | --- |");
125
- for (const p of staged) out.push(`| \`${p.name}\` | \`${p.version}\` |`);
126
- out.push("", "**Nobody can install these yet.** On a machine with your npm 2FA:", "", "```", "pnpm stage approve", "```", "",
127
- "It lists what is queued and takes the batch under one one-time password. A version you would rather not ship needs no action — do not approve it, and it expires.");
129
+ out.push("## Staged, and awaiting approval", "", ...table);
130
+ out.push("", "**Nobody can install these yet.** Approve them on npmjs.com, under Staged Packages in your profile, or from a terminal:", "", "```", "npm stage list", "npm stage approve <id>", "```", "",
131
+ "A version you would rather not ship needs no action — do not approve it, and it expires.");
128
132
  }
129
133
  require("fs").appendFileSync(process.env.GITHUB_STEP_SUMMARY, out.join("\n") + "\n");
130
134
  '
@@ -23,7 +23,7 @@ you run against a newer extension, and the diff is how you find out what moved.
23
23
 
24
24
  pnpm rigline dev plugins/__NAME__
25
25
 
26
- Rebuilds and re-injects on every save. Reload webviews to see each change.
26
+ Rebuilds, installs the build and re-injects on every save. Reload webviews to see each change.
27
27
 
28
28
  ## What a plugin declares
29
29
 
@@ -65,8 +65,9 @@ lands in the right place, survives a re-render, or costs a row a line of height
65
65
  the app can answer: build, add, reload, look.
66
66
 
67
67
  `.github/workflows/ci.yml` runs typecheck, build and test on every push and every pull request,
68
- over three Node versions — the same set the release workflow runs, so nothing reaches a release
69
- that a pull request would not already have failed on. Commit `pnpm-lock.yaml`: CI installs what it
68
+ over three Node versions. The release workflow runs the same three steps again on the newest of
69
+ them before it stages anything, so nothing reaches a release that a pull request would not already
70
+ have failed on. Commit `pnpm-lock.yaml`: CI installs what it
70
71
  says rather than resolving its own.
71
72
 
72
73
  ## Publishing
@@ -78,9 +79,10 @@ and both `@rigline/core` and `@rigline/plugin-api` stay *devDependencies*.
78
79
 
79
80
  `.github/workflows/release.yml` does it from CI, with no npm token stored anywhere: GitHub
80
81
  authenticates to npm over OIDC, and what the workflow does is *stage* — a version nobody can
81
- install until you approve it from your own machine with 2FA.
82
-
83
- pnpm stage approve
82
+ install until you approve it with your second factor. Approve on npmjs.com, under your profile's
83
+ *Staged Packages*, which lists what is waiting; or from a terminal, `npm stage list` then
84
+ `npm stage approve <id>`. Not `pnpm stage approve`: it asks for a typed one-time password, which a
85
+ security key — the only second factor npm still enrols — cannot give.
84
86
 
85
87
  **One field to fill in before the first publish: `repository`.** npm binds a provenance attestation
86
88
  to it, and this workflow stages with provenance, so a package without one cannot be staged at all.
@@ -99,9 +101,9 @@ MIT, and npm ships a licence file whatever `files` says, so adding one is the wh
99
101
  `rigline-plugin` keyword is already there: it is how somebody finds a plugin on npm.
100
102
 
101
103
  Two things to set up once per package, the first time. Publish version one by hand, because a
102
- package that does not exist yet has nothing for a trusted publisher to attach to — `pnpm publish -r
103
- --otp <code>`, supplying a one-time password rather than creating a token, so there is nothing to
104
- store or to revoke afterwards. Then add a trusted publisher in the package's settings on npmjs.com,
104
+ package that does not exist yet has nothing for a trusted publisher to attach to: `pnpm build`, then
105
+ `npm publish` in the plugin's directory, which opens your browser for the second factor rather than
106
+ needing a token, so there is nothing to store or to revoke afterwards. Then add a trusted publisher in the package's settings on npmjs.com,
105
107
  naming this repository and `release.yml` by path, with its permission set to stage-only. The
106
108
  workflow's own header repeats both, where you will be when you need them.
107
109
 
@@ -1,5 +1,4 @@
1
1
  {
2
2
  "extends": "../../tsconfig.plugin.json",
3
- "include": ["src/**/*.ts", "src/**/*.tsx"],
4
- "exclude": ["src/**/*.test.ts"]
3
+ "include": ["src/**/*.ts", "src/**/*.tsx"]
5
4
  }