wp-typia 0.24.3 → 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.
- package/README.md +7 -5
- package/bin/wp-typia.js +24 -103
- package/{dist-bunli/node-cli.js → dist/cli.js} +5079 -3656
- package/package.json +9 -36
- package/bin/routing-metadata.generated.d.ts +0 -8
- package/bin/routing-metadata.generated.js +0 -93
- package/bin/runtime-routing.d.ts +0 -34
- package/bin/runtime-routing.js +0 -124
- package/dist-bunli/.bunli/commands.gen.js +0 -304333
- package/dist-bunli/.bunli/highlights-eq9cgrbb.scm +0 -604
- package/dist-bunli/.bunli/highlights-ghv9g403.scm +0 -205
- package/dist-bunli/.bunli/highlights-hk7bwhj4.scm +0 -284
- package/dist-bunli/.bunli/highlights-r812a2qc.scm +0 -150
- package/dist-bunli/.bunli/highlights-x6tmsnaa.scm +0 -115
- package/dist-bunli/.bunli/injections-73j83es3.scm +0 -27
- package/dist-bunli/.bunli/tree-sitter-javascript-nd0q4pe9.wasm +0 -0
- package/dist-bunli/.bunli/tree-sitter-markdown-411r6y9b.wasm +0 -0
- package/dist-bunli/.bunli/tree-sitter-markdown_inline-j5349f42.wasm +0 -0
- package/dist-bunli/.bunli/tree-sitter-typescript-zxjzwt75.wasm +0 -0
- package/dist-bunli/.bunli/tree-sitter-zig-e78zbjpm.wasm +0 -0
- package/dist-bunli/agents-91fpdyyt.js +0 -12
- package/dist-bunli/chunk-bdqvmfwv-f5qmzmxg.js +0 -16825
- package/dist-bunli/cli-03j0axbt.js +0 -163
- package/dist-bunli/cli-1170yyve.js +0 -106
- package/dist-bunli/cli-377p86mf.js +0 -191
- package/dist-bunli/cli-4pzxbk4s.js +0 -1231
- package/dist-bunli/cli-6v0pcxw6.js +0 -314
- package/dist-bunli/cli-84c7wff4.js +0 -198
- package/dist-bunli/cli-8hxf9qw6.js +0 -198
- package/dist-bunli/cli-9fx0qgb7.js +0 -3680
- package/dist-bunli/cli-ac2ebaf8.js +0 -3
- package/dist-bunli/cli-add-mxxk5rep.js +0 -10660
- package/dist-bunli/cli-am5x7tb4.js +0 -192
- package/dist-bunli/cli-bajwv85z.js +0 -24
- package/dist-bunli/cli-ccax7s0s.js +0 -34
- package/dist-bunli/cli-cvxvcw7c.js +0 -46
- package/dist-bunli/cli-diagnostics-10drxh34.js +0 -34
- package/dist-bunli/cli-doctor-6fyxq940.js +0 -1446
- package/dist-bunli/cli-e4bwd81c.js +0 -1260
- package/dist-bunli/cli-fv4h3ydt.js +0 -173823
- package/dist-bunli/cli-hv2yedw2.js +0 -74591
- package/dist-bunli/cli-init-7avk42dh.js +0 -880
- package/dist-bunli/cli-kfm9mm68.js +0 -14679
- package/dist-bunli/cli-prompt-ncyg68rn.js +0 -12
- package/dist-bunli/cli-rdcga1bd.js +0 -135
- package/dist-bunli/cli-scaffold-0bb6pr3w.js +0 -538
- package/dist-bunli/cli-t73q5aqz.js +0 -103
- package/dist-bunli/cli-templates-g8t4fm11.js +0 -167
- package/dist-bunli/cli-tj7ajdvf.js +0 -2612
- package/dist-bunli/cli-tq730sqt.js +0 -344
- package/dist-bunli/cli-xnn9xjcy.js +0 -68
- package/dist-bunli/cli-z48frc8t.js +0 -229
- package/dist-bunli/cli.js +0 -2523
- package/dist-bunli/command-list-bgwaa2f4.js +0 -3920
- package/dist-bunli/create-template-validation-4fr851vg.js +0 -16
- package/dist-bunli/migrations-3vngdy51.js +0 -47
- package/dist-bunli/sync-k2k8svyc.js +0 -13
- 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
|
|
49
|
-
-
|
|
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
|
|
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
|
|
25
|
-
const
|
|
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(
|
|
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
|
|
83
|
-
return (
|
|
84
|
-
|
|
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 =
|
|
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
|
-
|
|
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)
|
|
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 =
|
|
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)
|
|
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 (!
|
|
143
|
+
if (!ensureBuiltRuntime()) {
|
|
223
144
|
console.error(
|
|
224
|
-
'Error: wp-typia could not locate its
|
|
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(
|
|
230
|
-
await cliModule.
|
|
150
|
+
const cliModule = await import(pathToFileURL(cliEntrypoint).href);
|
|
151
|
+
await cliModule.runGunshiCliEntrypoint(argv);
|