@wirecat/cli-base 1.0.0 → 1.2.0
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/CHANGELOG.md +92 -0
- package/dist/codegen/graphql.js +37 -1
- package/dist/dev/adopt.d.ts +2 -1
- package/dist/dev/adopt.js +7 -1
- package/dist/dev/audit.js +6 -3
- package/dist/dev/bundle.d.ts +22 -0
- package/dist/dev/bundle.js +20 -5
- package/dist/dev/core-override.d.ts +15 -0
- package/dist/dev/core-override.js +70 -0
- package/dist/dev/index.d.ts +2 -0
- package/dist/dev/index.js +2 -0
- package/dist/dev/lint.d.ts +16 -0
- package/dist/dev/lint.js +48 -5
- package/dist/dev/main.js +16 -18
- package/dist/dev/version-command.d.ts +8 -0
- package/dist/dev/version-command.js +29 -0
- package/dist/standards/audit.js +9 -6
- package/dist/standards/lint.js +6 -0
- package/dist/wcat/manifest.d.ts +120 -2
- package/dist/wcat/manifest.js +84 -7
- package/docs/standards/README.md +2 -2
- package/docs/standards/accounts.md +9 -11
- package/docs/standards/architecture.md +2 -1
- package/docs/standards/ci.md +11 -5
- package/docs/standards/commands.md +35 -2
- package/docs/standards/kit-surface.md +3 -3
- package/docs/standards/new-cli.md +3 -2
- package/docs/standards/toolchain.md +25 -1
- package/package.json +5 -1
|
@@ -178,9 +178,9 @@ source whose subtypes the definitions cannot tell apart.
|
|
|
178
178
|
`apiSkillFiles({ cli, folder, files, service, skill, operations, commands, banner })` writes the API part of the
|
|
179
179
|
CLI's skill, in the shape of [openapi-to-skills](https://github.com/neutree-ai/openapi-to-skills): `references/api.md`,
|
|
180
180
|
a short index of the groups with their effects, and `references/api/api-<group>.md`, one file per group. An
|
|
181
|
-
operation's group is its `group` (WC-CMD-33), else its first tag
|
|
182
|
-
cannot name a file and stops the
|
|
183
|
-
the index, then only the group it needs, with `<cli> skill show api-<group>`. The `skill` command already ships and
|
|
181
|
+
operation's group is its `group` (WC-CMD-33), else its first tag (for GraphQL, the entity its field acts on); one
|
|
182
|
+
without either is in `api-untagged.md`. A tag with no Latin letter or digit cannot name a file and stops the
|
|
183
|
+
generation. An agent reads the index, then only the group it needs, with `<cli> skill show api-<group>`. The `skill` command already ships and
|
|
184
184
|
shows every file beside `SKILL.md`; nothing else is needed.
|
|
185
185
|
|
|
186
186
|
- `commands` is `describeProgram(createProgram())` from the built program, made with the CLI's own copy of cli-base.
|
|
@@ -122,8 +122,9 @@ installing that command; nothing else is registered anywhere.
|
|
|
122
122
|
is stale. `wcatStart` reads the shipped file for `--wcat-describe`, so the bin needs only the format-1 fields and
|
|
123
123
|
keeps the program out of its first import. List `contracts/wirecat.json`, not all of `contracts`, in `files`
|
|
124
124
|
([WC-REL-16](releases.md#wc-rel-16--the-package-ships-only-the-files-it-names)). A CLI with a
|
|
125
|
-
`sync` command also sets `syncs`, what it copies in at most 40 characters. The file holds no version
|
|
126
|
-
`mcpServer`
|
|
125
|
+
`sync` command also sets `syncs`, what it copies in at most 40 characters. The file holds no version: Desktop reads it from npm.
|
|
126
|
+
`mcpServer` has a port only when the identity sets `mcpPort`, for a WireCat tool with a fixed port. Desktop gives
|
|
127
|
+
any other tool a free port. A command the manifest lists
|
|
127
128
|
without `effects` counts as a write; `permissionOf` adds each command's permission key. See
|
|
128
129
|
[WC-CMD-29](commands.md#wc-cmd-29--answer---wcat-describe-and-take-no-name-wirecat-reserves).
|
|
129
130
|
- **The hosts it talks to.** `hosts` lists every host the CLI contacts (`[]` for none), and `userHosts` says in words
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
How a repository is built and checked before review: the shared presets and `standards:check`, strict TypeScript,
|
|
8
8
|
the shared Biome preset and its grit plugins, the file size cap, import cycles, layer boundaries as lint, the command
|
|
9
|
-
lint, spelling, Markdown lint,
|
|
9
|
+
lint, spelling, Markdown lint, the checks for a Go part, and the root override that gives a CLI cli-core's types.
|
|
10
10
|
|
|
11
11
|
Rule ids on this page are `WC-TOOL-<n>`. How to read a rule, how ids work and which rule wins are in the
|
|
12
12
|
[index](README.md). What runs on which trigger is on the [CI page](ci.md).
|
|
@@ -267,6 +267,30 @@ no-unbounded-spread ([WC-TOOL-12](#wc-tool-12--do-not-spread-a-list-of-user-data
|
|
|
267
267
|
- **Exceptions:** none.
|
|
268
268
|
- **Applies to:** CLIs with a Go part (wa). **Since:** cli-base 0.44.0. **Rulings:** none.
|
|
269
269
|
|
|
270
|
+
### WC-TOOL-21 · Pin cli-core `X.Y.Z` and override it to `X.Y.Z-dev` at the root
|
|
271
|
+
|
|
272
|
+
- **Why:** the `X.Y.Z` of `@wirecat/cli-core` that users install has no type files, so they do not download 12.5 MB
|
|
273
|
+
that only a compiler reads. Every release also publishes `X.Y.Z-dev`: the same JavaScript with the `.d.ts` files,
|
|
274
|
+
their maps, the JavaScript maps and `src/`. pnpm reads `pnpm-workspace.yaml` only in the project it installs, and
|
|
275
|
+
npm and Bun never read it, so the CLI's checkout gets `-dev` and its users still get `X.Y.Z`.
|
|
276
|
+
- **Enforced by:** `node-ci.yml:check` (right after install, before typecheck) · `<app>: pnpm version:check` (cli-dev
|
|
277
|
+
version) · `src/dev/core-override.test.ts`.
|
|
278
|
+
- **Example:** `package.json` has `"@wirecat/cli-core": "2.1.0"` under `dependencies`, and `pnpm-workspace.yaml` has
|
|
279
|
+
|
|
280
|
+
```yaml
|
|
281
|
+
overrides:
|
|
282
|
+
"@wirecat/cli-core": 2.1.0-dev
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
Without the override, `pnpm typecheck` fails with TS7016, "Could not find a declaration file for module
|
|
286
|
+
'@wirecat/cli-core'", and `cli-dev version` fails with the line to add. With an override to another version, every
|
|
287
|
+
check runs against a cli-core the users never get, and `cli-dev version` names the line to change. The fix is that
|
|
288
|
+
line, then `pnpm install`. `cli-dev adopt <x.y.z>` moves the pin and the override together.
|
|
289
|
+
- **Exceptions:** cli-core itself, and a repository with no `bin` or with cli-core only in `devDependencies`
|
|
290
|
+
(cli-docs). A cli-core released before the `-dev` releases has no `-dev` and still ships its types; while a CLI
|
|
291
|
+
pins one, `cli-dev version` only notes the missing override.
|
|
292
|
+
- **Applies to:** the CLIs and cli-template. **Since:** cli-base 1.2.0. **Rulings:** NEED-10.
|
|
293
|
+
|
|
270
294
|
## Sources
|
|
271
295
|
|
|
272
296
|
These documents explain the rules on this page in more detail. Where one of them disagrees with this page, this page
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wirecat/cli-base",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "The parts every command line tool needs: output modes, terminal rendering, error model, exit codes, credentials, clocks",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Viacheslav Ptsarev",
|
|
@@ -103,6 +103,10 @@
|
|
|
103
103
|
"types": "./dist/wcat/manifest.d.ts",
|
|
104
104
|
"default": "./dist/wcat/manifest.js"
|
|
105
105
|
},
|
|
106
|
+
"./dev": {
|
|
107
|
+
"types": "./dist/dev/index.d.ts",
|
|
108
|
+
"default": "./dist/dev/index.js"
|
|
109
|
+
},
|
|
106
110
|
"./biome": "./config/biome.base.json",
|
|
107
111
|
"./tsconfig.base.json": "./config/tsconfig.base.json",
|
|
108
112
|
"./tsconfig.test.json": "./config/tsconfig.test.json",
|