wp-typia 0.24.4 → 0.24.5

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 (58) hide show
  1. package/README.md +7 -5
  2. package/bin/wp-typia.js +24 -103
  3. package/{dist-bunli/node-cli.js → dist/cli.js} +5013 -3687
  4. package/package.json +9 -36
  5. package/bin/routing-metadata.generated.d.ts +0 -8
  6. package/bin/routing-metadata.generated.js +0 -93
  7. package/bin/runtime-routing.d.ts +0 -34
  8. package/bin/runtime-routing.js +0 -124
  9. package/dist-bunli/.bunli/commands.gen.js +0 -304441
  10. package/dist-bunli/.bunli/highlights-eq9cgrbb.scm +0 -604
  11. package/dist-bunli/.bunli/highlights-ghv9g403.scm +0 -205
  12. package/dist-bunli/.bunli/highlights-hk7bwhj4.scm +0 -284
  13. package/dist-bunli/.bunli/highlights-r812a2qc.scm +0 -150
  14. package/dist-bunli/.bunli/highlights-x6tmsnaa.scm +0 -115
  15. package/dist-bunli/.bunli/injections-73j83es3.scm +0 -27
  16. package/dist-bunli/.bunli/tree-sitter-javascript-nd0q4pe9.wasm +0 -0
  17. package/dist-bunli/.bunli/tree-sitter-markdown-411r6y9b.wasm +0 -0
  18. package/dist-bunli/.bunli/tree-sitter-markdown_inline-j5349f42.wasm +0 -0
  19. package/dist-bunli/.bunli/tree-sitter-typescript-zxjzwt75.wasm +0 -0
  20. package/dist-bunli/.bunli/tree-sitter-zig-e78zbjpm.wasm +0 -0
  21. package/dist-bunli/agents-91fpdyyt.js +0 -12
  22. package/dist-bunli/chunk-bdqvmfwv-f5qmzmxg.js +0 -16825
  23. package/dist-bunli/cli-03j0axbt.js +0 -163
  24. package/dist-bunli/cli-1170yyve.js +0 -106
  25. package/dist-bunli/cli-368d4cgy.js +0 -1235
  26. package/dist-bunli/cli-377p86mf.js +0 -191
  27. package/dist-bunli/cli-6v0pcxw6.js +0 -314
  28. package/dist-bunli/cli-84c7wff4.js +0 -198
  29. package/dist-bunli/cli-8hxf9qw6.js +0 -198
  30. package/dist-bunli/cli-9fx0qgb7.js +0 -3680
  31. package/dist-bunli/cli-ac2ebaf8.js +0 -3
  32. package/dist-bunli/cli-add-qjd3ba8j.js +0 -10671
  33. package/dist-bunli/cli-am5x7tb4.js +0 -192
  34. package/dist-bunli/cli-bajwv85z.js +0 -24
  35. package/dist-bunli/cli-ccax7s0s.js +0 -34
  36. package/dist-bunli/cli-cvxvcw7c.js +0 -46
  37. package/dist-bunli/cli-diagnostics-10drxh34.js +0 -34
  38. package/dist-bunli/cli-doctor-6fyxq940.js +0 -1446
  39. package/dist-bunli/cli-e4bwd81c.js +0 -1260
  40. package/dist-bunli/cli-fv4h3ydt.js +0 -173823
  41. package/dist-bunli/cli-hv2yedw2.js +0 -74591
  42. package/dist-bunli/cli-init-7avk42dh.js +0 -880
  43. package/dist-bunli/cli-kfm9mm68.js +0 -14679
  44. package/dist-bunli/cli-prompt-ncyg68rn.js +0 -12
  45. package/dist-bunli/cli-rdcga1bd.js +0 -135
  46. package/dist-bunli/cli-scaffold-0bb6pr3w.js +0 -538
  47. package/dist-bunli/cli-t73q5aqz.js +0 -103
  48. package/dist-bunli/cli-templates-g8t4fm11.js +0 -167
  49. package/dist-bunli/cli-tj7ajdvf.js +0 -2612
  50. package/dist-bunli/cli-tq730sqt.js +0 -344
  51. package/dist-bunli/cli-xnn9xjcy.js +0 -68
  52. package/dist-bunli/cli-z48frc8t.js +0 -229
  53. package/dist-bunli/cli.js +0 -2523
  54. package/dist-bunli/command-list-y3g7e9rb.js +0 -4013
  55. package/dist-bunli/create-template-validation-4fr851vg.js +0 -16
  56. package/dist-bunli/migrations-3vngdy51.js +0 -47
  57. package/dist-bunli/sync-k2k8svyc.js +0 -13
  58. package/dist-bunli/workspace-project-gmv2a71z.js +0 -22
package/README.md CHANGED
@@ -11,6 +11,10 @@ Use this package for new projects:
11
11
  - `npx wp-typia create my-plugin --template workspace --profile plugin-qa`
12
12
  - `npx wp-typia create my-books --template query-loop --query-post-type book`
13
13
 
14
+ The published package executes through the Node-first CLI runtime. `bunx` is a
15
+ supported package-runner invocation, not a requirement for npm-installed
16
+ commands.
17
+
14
18
  Extend an existing workspace with:
15
19
 
16
20
  - `wp-typia add block counter-card --template basic`
@@ -45,18 +49,16 @@ Configuration files:
45
49
  Compatibility notes:
46
50
 
47
51
  - `@wp-typia/project-tools` is the canonical programmatic project orchestration package
48
- - the published CLI now ships built `dist-bunli` runtimes, and the canonical Node bin uses a Node-safe fallback runtime for non-TUI `create`/`add`/`migrate`, `doctor`, `sync`, `--version`, `--help`, and template inspection without requiring a locally installed Bun binary
49
- - if `wp-typia --help` says `Runtime: Node fallback`, you are on that Bun-free path. You get human-readable help/output, common non-interactive project workflows, and lighter prompt behavior where interactive fallback is still supported
52
+ - the published CLI ships a built `dist` runtime, and the canonical Node bin supports `create`, `add`, `migrate`, `doctor`, `sync`, `skills`, `completions`, `mcp`, `--version`, `--help`, and template inspection without requiring a locally installed Bun binary
53
+ - Bun remains supported for repository development, tests, and builds, while Node is the canonical npm runtime for the published CLI
50
54
  - when you request machine-readable output with `--format json`, CLI failures now include a stable `error.code` field so wrappers and CI can branch without parsing English text
51
55
  - the stable machine-handled branching key is `error.code`. Structured context like `error.command`, `error.kind`, and `error.tag` may also be useful to consumers, while free-form text like `error.message`, `error.summary`, and `error.detailLines` stays human-facing guidance and can evolve without notice
52
- - when that Node fallback prompts interactively, it intentionally stays lighter than the Bun/OpenTUI flow: numbered lists, option label/value matching, inline validation retries, and redraw commands for the current choices: `?` for the short reprint shortcut, `help` for the explicit redraw command, and `list` for users who expect option listing semantics
53
- - Bunli-specific command surfaces such as `skills`, `completions`, and `mcp` still run through the built `dist-bunli/cli.js` artifact and require Bun when you use the npm package directly; if you want the full Bunli/OpenTUI runtime story without a local Bun install, prefer the standalone installer from the latest GitHub Release
54
56
  - standalone release assets are published per platform together with checksum manifests and install scripts: `install-wp-typia.sh` for macOS/Linux and `install-wp-typia.ps1` for Windows
55
57
  - internal runtime-bridge helper modules are implementation details; integrations
56
58
  should target the CLI or `@wp-typia/project-tools`, not CLI internals
57
59
 
58
60
  Maintainers: see [`docs/bunli-cli-migration.md`](https://imjlk.github.io/wp-typia/maintainers/bunli-cli-migration/)
59
- for the active CLI ownership contract and the staged Bunli cutover plan.
61
+ for historical Gunshi migration notes.
60
62
 
61
63
  Project meta docs:
62
64
 
package/bin/wp-typia.js CHANGED
@@ -5,42 +5,18 @@ import { spawnSync } from 'node:child_process';
5
5
  import path from 'node:path';
6
6
  import { fileURLToPath, pathToFileURL } from 'node:url';
7
7
 
8
- import {
9
- fullRuntimeCommands,
10
- interactiveRuntimeCommands,
11
- longValueOptions,
12
- reservedCommands,
13
- shortValueOptions,
14
- } from './routing-metadata.generated.js';
15
- import {
16
- getRuntimeRoutingInvocation,
17
- shouldRouteToFullRuntime,
18
- } from './runtime-routing.js';
19
-
20
8
  const packageRoot = path.resolve(
21
9
  path.dirname(fileURLToPath(import.meta.url)),
22
10
  '..',
23
11
  );
24
- const cliEntrypoint = path.join(packageRoot, 'dist-bunli', 'cli.js');
25
- const nodeCliEntrypoint = path.join(packageRoot, 'dist-bunli', 'node-cli.js');
26
- const bunBinary = process.env.BUN_BIN || 'bun';
27
- const fullRuntimeCommandSet = new Set(fullRuntimeCommands);
28
- const interactiveRuntimeCommandSet = new Set(interactiveRuntimeCommands);
29
- const longValueOptionSet = new Set(longValueOptions);
30
- const reservedCommandSet = new Set(reservedCommands);
31
- const shortValueOptionSet = new Set(shortValueOptions);
32
- const buildScriptEntrypoint = path.join(
33
- packageRoot,
34
- 'scripts',
35
- 'build-bunli-runtime.ts',
36
- );
37
- const sourceCliEntrypoint = path.join(packageRoot, 'src', 'cli.ts');
38
- const sourceCheckoutRoot = path.resolve(packageRoot, '..', '..');
12
+ const cliEntrypoint = path.join(packageRoot, 'dist', 'cli.js');
13
+ const buildScriptEntrypoint = path.join(packageRoot, 'scripts', 'build-runtime.ts');
39
14
  const sourceProjectToolsPackageRoot = path.resolve(
40
15
  packageRoot,
41
16
  '..',
42
17
  'wp-typia-project-tools',
43
18
  );
19
+ const sourceCheckoutRoot = path.resolve(packageRoot, '..', '..');
44
20
  const sourceProjectToolsPackageManifest = path.join(
45
21
  sourceProjectToolsPackageRoot,
46
22
  'package.json',
@@ -53,8 +29,6 @@ const sourceProjectToolsRuntimeProbe = path.join(
53
29
  );
54
30
  const sourceProjectToolsBuildCommand =
55
31
  'bun run --filter @wp-typia/project-tools build';
56
- const standaloneGuidance =
57
- 'Prefer not to install Bun? Use the standalone wp-typia binary from the GitHub release assets.';
58
32
 
59
33
  function normalizeTopLevelHelpArgv(argv) {
60
34
  const [firstArg, secondArg, ...rest] = argv;
@@ -70,8 +44,12 @@ function normalizeTopLevelHelpArgv(argv) {
70
44
  return argv;
71
45
  }
72
46
 
47
+ function canAutobuildSourceCheckout() {
48
+ return fs.existsSync(buildScriptEntrypoint);
49
+ }
50
+
73
51
  function isWorkingBunBinary() {
74
- const bunCheck = spawnSync(bunBinary, ['--version'], {
52
+ const bunCheck = spawnSync(process.env.BUN_BIN || 'bun', ['--version'], {
75
53
  env: process.env,
76
54
  stdio: 'ignore',
77
55
  });
@@ -79,10 +57,13 @@ function isWorkingBunBinary() {
79
57
  return !bunCheck.error && bunCheck.status === 0;
80
58
  }
81
59
 
82
- function canAutobuildSourceCheckout() {
83
- return (
84
- fs.existsSync(buildScriptEntrypoint) && fs.existsSync(sourceCliEntrypoint)
85
- );
60
+ function runBun(args, options) {
61
+ return spawnSync(process.env.BUN_BIN || 'bun', args, {
62
+ cwd: packageRoot,
63
+ env: process.env,
64
+ stdio: 'inherit',
65
+ ...options,
66
+ });
86
67
  }
87
68
 
88
69
  function hasMissingSourceProjectToolsRuntime() {
@@ -119,13 +100,10 @@ function ensureSourceProjectToolsRuntime() {
119
100
  `Running \`${sourceProjectToolsBuildCommand}\` from ${sourceCheckoutRoot} before rebuilding the CLI runtime...`,
120
101
  );
121
102
 
122
- const buildResult = spawnSync(
123
- bunBinary,
103
+ const buildResult = runBun(
124
104
  ['run', '--filter', '@wp-typia/project-tools', 'build'],
125
105
  {
126
106
  cwd: sourceCheckoutRoot,
127
- env: process.env,
128
- stdio: 'inherit',
129
107
  },
130
108
  );
131
109
 
@@ -136,14 +114,7 @@ function ensureSourceProjectToolsRuntime() {
136
114
  process.exit(buildResult.status ?? 1);
137
115
  }
138
116
 
139
- if (fs.existsSync(sourceProjectToolsRuntimeProbe)) {
140
- return true;
141
- }
142
-
143
- console.error(
144
- `Error: @wp-typia/project-tools build completed but ${relativeProbe} is still missing. Run \`${sourceProjectToolsBuildCommand}\` from the repository root, then rerun wp-typia.`,
145
- );
146
- return false;
117
+ return fs.existsSync(sourceProjectToolsRuntimeProbe);
147
118
  }
148
119
 
149
120
  function ensureBuiltRuntime() {
@@ -151,7 +122,7 @@ function ensureBuiltRuntime() {
151
122
  return false;
152
123
  }
153
124
 
154
- if (fs.existsSync(cliEntrypoint) && fs.existsSync(nodeCliEntrypoint)) {
125
+ if (fs.existsSync(cliEntrypoint)) {
155
126
  return true;
156
127
  }
157
128
 
@@ -159,72 +130,22 @@ function ensureBuiltRuntime() {
159
130
  return false;
160
131
  }
161
132
 
162
- const buildResult = spawnSync(bunBinary, ['run', 'build'], {
163
- cwd: packageRoot,
164
- env: process.env,
165
- stdio: 'inherit',
166
- });
167
-
133
+ const buildResult = runBun(['run', 'build']);
168
134
  if (buildResult.status !== 0) {
169
135
  process.exit(buildResult.status ?? 1);
170
136
  }
171
137
 
172
- return fs.existsSync(cliEntrypoint) && fs.existsSync(nodeCliEntrypoint);
138
+ return fs.existsSync(cliEntrypoint);
173
139
  }
174
140
 
175
141
  const argv = normalizeTopLevelHelpArgv(process.argv.slice(2));
176
- const { command } = getRuntimeRoutingInvocation(argv, {
177
- longValueOptions: longValueOptionSet,
178
- reservedCommands: reservedCommandSet,
179
- shortValueOptions: shortValueOptionSet,
180
- });
181
- const commandRequiresFullRuntime = command
182
- ? fullRuntimeCommandSet.has(command)
183
- : false;
184
- const hasBuiltRuntime = ensureBuiltRuntime();
185
- const hasWorkingBun = isWorkingBunBinary();
186
- const shouldUseFullRuntime = shouldRouteToFullRuntime({
187
- argv,
188
- fullRuntimeCommands: fullRuntimeCommandSet,
189
- hasBuiltRuntime,
190
- hasWorkingBun,
191
- interactiveRuntimeCommands: interactiveRuntimeCommandSet,
192
- longValueOptions: longValueOptionSet,
193
- reservedCommands: reservedCommandSet,
194
- shortValueOptions: shortValueOptionSet,
195
- });
196
-
197
- // Keep common help and explicit non-TUI calls on the human-readable Node fallback
198
- // even when Bun is present.
199
- if (hasWorkingBun && hasBuiltRuntime && shouldUseFullRuntime) {
200
- const result = spawnSync(bunBinary, [cliEntrypoint, ...argv], {
201
- cwd: process.cwd(),
202
- env: process.env,
203
- stdio: 'inherit',
204
- });
205
- process.exit(result.status ?? 1);
206
- }
207
-
208
- if (commandRequiresFullRuntime) {
209
- if (!hasBuiltRuntime) {
210
- console.error(
211
- 'Error: wp-typia could not locate its built CLI runtime. Reinstall the published package, or run `bun run build` when using a source checkout.',
212
- );
213
- process.exit(1);
214
- }
215
-
216
- console.error(
217
- `Error: wp-typia ${command} requires Bun. Install Bun locally, run with bunx, or set BUN_BIN to a working Bun executable. ${standaloneGuidance}`,
218
- );
219
- process.exit(1);
220
- }
221
142
 
222
- if (!hasBuiltRuntime || !fs.existsSync(nodeCliEntrypoint)) {
143
+ if (!ensureBuiltRuntime()) {
223
144
  console.error(
224
- 'Error: wp-typia could not locate its Node fallback runtime. Reinstall the published package, or run `bun run build` when using a source checkout.',
145
+ 'Error: wp-typia could not locate its CLI runtime. Reinstall the published package, or run `bun run build` when using a source checkout.',
225
146
  );
226
147
  process.exit(1);
227
148
  }
228
149
 
229
- const cliModule = await import(pathToFileURL(nodeCliEntrypoint).href);
230
- await cliModule.runNodeCliEntrypoint(argv);
150
+ const cliModule = await import(pathToFileURL(cliEntrypoint).href);
151
+ await cliModule.runGunshiCliEntrypoint(argv);