@wirecat/cli-base 0.106.0 → 0.108.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.
Files changed (43) hide show
  1. package/CHANGELOG.md +125 -0
  2. package/README.md +2 -1
  3. package/dist/codegen/fake.d.ts +64 -0
  4. package/dist/codegen/fake.js +341 -0
  5. package/dist/codegen/index.d.ts +11 -4
  6. package/dist/codegen/index.js +10 -3
  7. package/dist/codegen/manifest.d.ts +4 -1
  8. package/dist/codegen/manifest.js +69 -2
  9. package/dist/codegen/merge.d.ts +37 -0
  10. package/dist/codegen/merge.js +257 -0
  11. package/dist/codegen/model.d.ts +94 -0
  12. package/dist/codegen/openapi.d.ts +5 -1
  13. package/dist/codegen/openapi.js +102 -10
  14. package/dist/codegen/pagination.d.ts +14 -0
  15. package/dist/codegen/pagination.js +129 -0
  16. package/dist/codegen/patch.d.ts +28 -0
  17. package/dist/codegen/patch.js +75 -0
  18. package/dist/codegen/pipeline.d.ts +52 -1
  19. package/dist/codegen/pipeline.js +198 -4
  20. package/dist/codegen/swagger.d.ts +7 -0
  21. package/dist/codegen/swagger.js +39 -0
  22. package/dist/credentials.d.ts +2 -2
  23. package/dist/credentials.js +17 -3
  24. package/dist/dev/conformance.d.ts +0 -2
  25. package/dist/dev/conformance.js +3 -9
  26. package/dist/dev/main.js +11 -3
  27. package/dist/dev/ready.d.ts +30 -0
  28. package/dist/dev/ready.js +249 -0
  29. package/dist/dev/slow-tests.d.ts +6 -1
  30. package/dist/dev/slow-tests.js +14 -2
  31. package/dist/http/fetch.js +21 -1
  32. package/dist/standards/audit.js +2 -1
  33. package/dist/standards/errors.js +6 -0
  34. package/dist/standards/index.d.ts +1 -0
  35. package/dist/standards/index.js +1 -0
  36. package/dist/standards/monthly.d.ts +5 -0
  37. package/dist/standards/monthly.js +12 -0
  38. package/docs/standards/README.md +1 -1
  39. package/docs/standards/ci.md +4 -2
  40. package/docs/standards/kit-surface.md +138 -0
  41. package/docs/standards/new-cli.md +14 -7
  42. package/docs/standards/testing.md +22 -1
  43. package/package.json +11 -1
@@ -97,7 +97,8 @@ and which run after merge is in [CI](ci.md).
97
97
  - **Enforced by:** review only.
98
98
  - **Example:** waits go through an injected `SleepLike`, and `fakeClock()` from `@wirecat/cli-base/testing` records
99
99
  them without waiting. A test harness passes `sleep: async () => {}`. `pnpm test:slow` lists the 20 slowest tests
100
- and the 10 slowest files. A test may wait for a local process or server it started, for example polling its
100
+ and the 10 slowest files, and warns about each test over 3 s
101
+ ([WC-TEST-20](#wc-test-20--one-test-time-limit-of-15-s-and-each-test-runs-within-3-s)). A test may wait for a local process or server it started, for example polling its
101
102
  status with `vi.waitFor` and a timeout shorter than the test's own; that waits for an event, not for time. A
102
103
  fixed sleep or `setTimeout` is still a wait for real time.
103
104
  - **Exceptions:** none. A new wait in the code gets a seam, never a longer test timeout.
@@ -268,6 +269,26 @@ a captured answer, beside it or in the table it comes from.
268
269
  vocabulary.
269
270
  - **Applies to:** all CLIs that talk to a provider. **Since:** cli-base 0.80.1. **Rulings:** none.
270
271
 
272
+ ### WC-TEST-20 · One test time limit of 15 s, and each test runs within 3 s
273
+
274
+ Every repository sets `testTimeout: 15_000` in `vitest.config.ts`. A test that builds big data, such as a thousand
275
+ meetings or a long conversation, sizes it so the test runs within 3 s on a developer machine: a fifth of the limit,
276
+ because a slow CI runner takes up to five times as long. `pnpm test:slow` warns about each test over 3 s, so it is
277
+ shrunk before a release runner fails it.
278
+
279
+ - **Why:** twice a release failed on a slow GitHub runner with no real wait involved, only CPU work: cli-core's test
280
+ of 1200 meetings, and zoom-cli's `src/answer-entities.test.ts` at 6.9 s against vitest's default 5 s. Each
281
+ repository had its own limit (15 s in cli-core and tg-cli, 5 s in zoom-cli, gcal-cli and max-cli), so the same
282
+ test passed in one and failed in another.
283
+ - **Enforced by:** `pnpm test:slow`.
284
+ - **Example:** `vitest.config.ts` has `test: { testTimeout: 15_000 }`. A test that checks paging over many meetings
285
+ builds as many as it needs to cross two pages, not 1200. `pnpm test:slow` ends with
286
+ `warning: 1 test takes over 3 s, …` and the test's line on stderr; it still exits 0.
287
+ - **Exceptions:** none. A longer timeout on one test is not the fix: cli-core #2980 gave the 1200-meeting test 60 s,
288
+ and the next slower runner fails it again. The macOS and Windows jobs of cli-base's `node-ci.yml` pass
289
+ `--testTimeout=20000` because those runners are slower for every test, not for one.
290
+ - **Applies to:** all CLIs and the shared packages. **Since:** cli-base 0.107.0. **Rulings:** owner, 2026-11-16.
291
+
271
292
  ## Sources
272
293
 
273
294
  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": "0.106.0",
3
+ "version": "0.108.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",
@@ -143,6 +143,7 @@
143
143
  "@cspell/dict-en-gb": "5.0.38",
144
144
  "@cspell/dict-es-es": "3.0.9",
145
145
  "@cspell/dict-ru_ru": "2.3.4",
146
+ "@scalar/openapi-upgrader": "0.4.6",
146
147
  "@types/cross-spawn": "6.0.6",
147
148
  "@types/node": "^22.20.5",
148
149
  "@vitest/coverage-v8": "^5.0.5",
@@ -151,6 +152,7 @@
151
152
  "esbuild": "0.28.2",
152
153
  "lefthook": "2.2.2",
153
154
  "markdownlint-cli2": "0.24.0",
155
+ "swagger-converter": "2.1.0",
154
156
  "typescript": "^7.0.2",
155
157
  "vitest": "^5.0.5",
156
158
  "yaml": "^2.9.1"
@@ -159,17 +161,25 @@
159
161
  "access": "public"
160
162
  },
161
163
  "peerDependencies": {
164
+ "@scalar/openapi-upgrader": "^0.4.6",
162
165
  "commander": ">=15",
163
166
  "esbuild": "^0.28.0",
167
+ "swagger-converter": "^2.1.0",
164
168
  "vitest": ">=5"
165
169
  },
166
170
  "peerDependenciesMeta": {
171
+ "@scalar/openapi-upgrader": {
172
+ "optional": true
173
+ },
167
174
  "commander": {
168
175
  "optional": true
169
176
  },
170
177
  "esbuild": {
171
178
  "optional": true
172
179
  },
180
+ "swagger-converter": {
181
+ "optional": true
182
+ },
173
183
  "vitest": {
174
184
  "optional": true
175
185
  }