wp-typia 0.20.4 → 0.21.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/README.md +5 -0
- package/bin/argv-walker.d.ts +19 -0
- package/bin/argv-walker.js +53 -0
- package/bin/routing-metadata.generated.d.ts +1 -1
- package/bin/routing-metadata.generated.js +38 -38
- package/bin/wp-typia.js +75 -87
- package/dist-bunli/.bunli/commands.gen.js +4940 -1246
- package/dist-bunli/{cli-68145vb5.js → cli-9x01fjna.js} +346 -41
- package/dist-bunli/{cli-add-a27wjrk4.js → cli-add-93945fc2.js} +1900 -385
- package/dist-bunli/{cli-diagnostics-db6kxv83.js → cli-diagnostics-5dvztm7q.js} +8 -2
- package/dist-bunli/{cli-doctor-31djnnxs.js → cli-doctor-zsndr5sw.js} +492 -20
- package/dist-bunli/{cli-3w3qxq9w.js → cli-hx88xwr4.js} +257 -25
- package/dist-bunli/cli-init-6xxc0snz.js +844 -0
- package/dist-bunli/{cli-2rev5hqm.js → cli-jfj54qej.js} +1 -1
- package/dist-bunli/{cli-jcd4wgam.js → cli-p95wr1q8.js} +77 -5
- package/dist-bunli/{cli-c5021kqy.js → cli-pav309dt.js} +896 -286
- package/dist-bunli/{cli-scaffold-r0yxfhbq.js → cli-scaffold-d2vtf740.js} +6 -5
- package/dist-bunli/{cli-tesygdnr.js → cli-syg9qpxw.js} +22 -1
- package/dist-bunli/cli.js +31 -117
- package/dist-bunli/{command-list-kx7q3f18.js → command-list-p452y8td.js} +561 -319
- package/dist-bunli/{migrations-1p6mbkyw.js → migrations-aj1rv3h8.js} +2 -2
- package/dist-bunli/node-cli.js +1035 -555
- package/package.json +5 -3
- package/dist-bunli/cli-init-gdyp9enw.js +0 -341
|
@@ -12,8 +12,63 @@ var CLI_DIAGNOSTIC_CODES = {
|
|
|
12
12
|
OUTSIDE_PROJECT_ROOT: "outside-project-root",
|
|
13
13
|
TEMPLATE_SOURCE_TIMEOUT: "template-source-timeout",
|
|
14
14
|
TEMPLATE_SOURCE_TOO_LARGE: "template-source-too-large",
|
|
15
|
+
UNKNOWN_TEMPLATE: "unknown-template",
|
|
15
16
|
UNSUPPORTED_COMMAND: "unsupported-command"
|
|
16
17
|
};
|
|
18
|
+
var CLI_DIAGNOSTIC_CODE_METADATA = {
|
|
19
|
+
[CLI_DIAGNOSTIC_CODES.COMMAND_EXECUTION]: {
|
|
20
|
+
cause: "The command failed after argument parsing and preflight checks completed.",
|
|
21
|
+
recovery: "Read the detail lines for the underlying tool failure, rerun with the same command once corrected, and report the full JSON envelope if the recovery is unclear."
|
|
22
|
+
},
|
|
23
|
+
[CLI_DIAGNOSTIC_CODES.CONFIGURATION_MISSING]: {
|
|
24
|
+
cause: "A command needs configuration that is not present in the current project.",
|
|
25
|
+
recovery: "Add the missing wp-typia config section or rerun the scaffold/init flow that creates the expected configuration."
|
|
26
|
+
},
|
|
27
|
+
[CLI_DIAGNOSTIC_CODES.DEPENDENCIES_NOT_INSTALLED]: {
|
|
28
|
+
cause: "Generated project or workspace dependencies are missing from the local install.",
|
|
29
|
+
recovery: "Run the package-manager install command from the reported project root, then rerun the wp-typia command."
|
|
30
|
+
},
|
|
31
|
+
[CLI_DIAGNOSTIC_CODES.DOCTOR_CHECK_FAILED]: {
|
|
32
|
+
cause: "One or more doctor checks reported a failing environment or workspace row.",
|
|
33
|
+
recovery: "Inspect the failed check labels and details, fix the reported drift or missing prerequisite, then rerun `wp-typia doctor`."
|
|
34
|
+
},
|
|
35
|
+
[CLI_DIAGNOSTIC_CODES.INVALID_ARGUMENT]: {
|
|
36
|
+
cause: "An argument was present but did not match the supported value, shape, or project state.",
|
|
37
|
+
recovery: "Correct the argument value using command help or the detail lines, then rerun the command."
|
|
38
|
+
},
|
|
39
|
+
[CLI_DIAGNOSTIC_CODES.INVALID_COMMAND]: {
|
|
40
|
+
cause: "The command or subcommand is not part of the supported wp-typia command tree.",
|
|
41
|
+
recovery: "Run `wp-typia --help` or the relevant command help and switch to a supported command/subcommand."
|
|
42
|
+
},
|
|
43
|
+
[CLI_DIAGNOSTIC_CODES.MISSING_ARGUMENT]: {
|
|
44
|
+
cause: "A required positional argument or flag value was omitted.",
|
|
45
|
+
recovery: "Provide the missing argument or flag value shown in the detail lines, then rerun the command."
|
|
46
|
+
},
|
|
47
|
+
[CLI_DIAGNOSTIC_CODES.MISSING_BUILD_ARTIFACT]: {
|
|
48
|
+
cause: "The published or standalone CLI layout is missing bundled build artifacts.",
|
|
49
|
+
recovery: "Reinstall the package or standalone binary, or rebuild the workspace before invoking the command again."
|
|
50
|
+
},
|
|
51
|
+
[CLI_DIAGNOSTIC_CODES.OUTSIDE_PROJECT_ROOT]: {
|
|
52
|
+
cause: "The command was run outside a generated wp-typia project or official workspace root.",
|
|
53
|
+
recovery: "Change into the scaffolded project/workspace root, or rerun the scaffold/init workflow that creates the expected root files."
|
|
54
|
+
},
|
|
55
|
+
[CLI_DIAGNOSTIC_CODES.TEMPLATE_SOURCE_TIMEOUT]: {
|
|
56
|
+
cause: "External template resolution did not complete within the allowed time.",
|
|
57
|
+
recovery: "Retry with a reachable template source, use a local path, or cache the template package before rerunning."
|
|
58
|
+
},
|
|
59
|
+
[CLI_DIAGNOSTIC_CODES.TEMPLATE_SOURCE_TOO_LARGE]: {
|
|
60
|
+
cause: "External template content exceeded the safety size limit.",
|
|
61
|
+
recovery: "Reduce the template package size or point wp-typia at a smaller official template layer."
|
|
62
|
+
},
|
|
63
|
+
[CLI_DIAGNOSTIC_CODES.UNKNOWN_TEMPLATE]: {
|
|
64
|
+
cause: "The requested scaffold template or add-block template id is not registered.",
|
|
65
|
+
recovery: "Run `wp-typia templates list` and rerun with one of the listed template ids."
|
|
66
|
+
},
|
|
67
|
+
[CLI_DIAGNOSTIC_CODES.UNSUPPORTED_COMMAND]: {
|
|
68
|
+
cause: "The requested command exists conceptually but is not supported by the current runtime surface.",
|
|
69
|
+
recovery: "Install Bun 1.3.11+ or use the standalone wp-typia binary when the detail lines say the Bun-powered runtime is required."
|
|
70
|
+
}
|
|
71
|
+
};
|
|
17
72
|
var DEFAULT_CLI_FAILURE_SUMMARIES = {
|
|
18
73
|
add: "Unable to complete the requested add workflow.",
|
|
19
74
|
create: "Unable to complete the requested create workflow.",
|
|
@@ -147,6 +202,14 @@ function readCliDiagnosticCode(error) {
|
|
|
147
202
|
}
|
|
148
203
|
return null;
|
|
149
204
|
}
|
|
205
|
+
function getCliDiagnosticCodeMetadata(code) {
|
|
206
|
+
return CLI_DIAGNOSTIC_CODE_METADATA[code];
|
|
207
|
+
}
|
|
208
|
+
function createCliDiagnosticCodeError(code, message, options) {
|
|
209
|
+
const error = new Error(message, options);
|
|
210
|
+
error.code = code;
|
|
211
|
+
return error;
|
|
212
|
+
}
|
|
150
213
|
function inferCliDiagnosticCode(options) {
|
|
151
214
|
const inheritedCode = readCliDiagnosticCode(options.error);
|
|
152
215
|
if (inheritedCode) {
|
|
@@ -181,7 +244,10 @@ function inferCliDiagnosticCode(options) {
|
|
|
181
244
|
if (/requires <|requires --|requires a value/u.test(haystack)) {
|
|
182
245
|
return CLI_DIAGNOSTIC_CODES.MISSING_ARGUMENT;
|
|
183
246
|
}
|
|
184
|
-
if (/Unknown
|
|
247
|
+
if (/Unknown (?:add-block )?template\s+(?:"|\\")/u.test(haystack)) {
|
|
248
|
+
return CLI_DIAGNOSTIC_CODES.UNKNOWN_TEMPLATE;
|
|
249
|
+
}
|
|
250
|
+
if (/Unknown .*subcommand|Unknown add kind|removed in favor|does not support|The Bun-free fallback runtime does not support|The positional alias only accepts/u.test(haystack)) {
|
|
185
251
|
return haystack.includes("does not support") || haystack.includes("The Bun-free fallback runtime does not support") ? CLI_DIAGNOSTIC_CODES.UNSUPPORTED_COMMAND : CLI_DIAGNOSTIC_CODES.INVALID_COMMAND;
|
|
186
252
|
}
|
|
187
253
|
if (/Invalid |must start with|cannot hook|cannot nest|cannot use|cannot be|already defines|already exists|Expected one of/u.test(haystack)) {
|
|
@@ -249,7 +315,8 @@ function serializeCliDiagnosticError(error) {
|
|
|
249
315
|
};
|
|
250
316
|
}
|
|
251
317
|
function formatDoctorCheckLine(check) {
|
|
252
|
-
|
|
318
|
+
const statusLabel = check.status === "pass" ? "PASS" : check.status === "warn" ? "WARN" : "FAIL";
|
|
319
|
+
return formatWrappedPrefixedLine(`${statusLabel} ${check.label}: `, check.detail, resolveCliWrapColumns(process.stdout.columns)).join(`
|
|
253
320
|
`);
|
|
254
321
|
}
|
|
255
322
|
function getFailingDoctorChecks(checks) {
|
|
@@ -257,13 +324,18 @@ function getFailingDoctorChecks(checks) {
|
|
|
257
324
|
}
|
|
258
325
|
function formatDoctorSummaryLine(checks) {
|
|
259
326
|
const failedChecks = getFailingDoctorChecks(checks);
|
|
260
|
-
|
|
327
|
+
const warningCount = checks.filter((check) => check.status === "warn").length;
|
|
328
|
+
const summaryStatus = failedChecks.length > 0 ? "FAIL" : warningCount > 0 ? "WARN" : "PASS";
|
|
329
|
+
return formatWrappedPrefixedLine(`${summaryStatus} wp-typia doctor summary: `, [
|
|
330
|
+
`${checks.length - failedChecks.length - warningCount}/${checks.length} checks passed`,
|
|
331
|
+
warningCount > 0 ? `${warningCount} warning(s)` : null
|
|
332
|
+
].filter((detail) => detail !== null).join(", "), resolveCliWrapColumns(process.stdout.columns)).join(`
|
|
261
333
|
`);
|
|
262
334
|
}
|
|
263
335
|
function getDoctorFailureDetailLines(checks) {
|
|
264
336
|
return getFailingDoctorChecks(checks).map((check) => `${check.label}: ${check.detail}`);
|
|
265
337
|
}
|
|
266
338
|
|
|
267
|
-
export { CLI_DIAGNOSTIC_CODES, CliDiagnosticError, isCliDiagnosticError, createCliCommandError, formatCliDiagnosticError, serializeCliDiagnosticError, formatDoctorCheckLine, getFailingDoctorChecks, formatDoctorSummaryLine, getDoctorFailureDetailLines };
|
|
339
|
+
export { CLI_DIAGNOSTIC_CODES, CLI_DIAGNOSTIC_CODE_METADATA, CliDiagnosticError, isCliDiagnosticError, getCliDiagnosticCodeMetadata, createCliDiagnosticCodeError, createCliCommandError, formatCliDiagnosticError, serializeCliDiagnosticError, formatDoctorCheckLine, getFailingDoctorChecks, formatDoctorSummaryLine, getDoctorFailureDetailLines };
|
|
268
340
|
|
|
269
|
-
//# debugId=
|
|
341
|
+
//# debugId=723BDE410F54191064756E2164756E21
|