wp-typia 0.23.0 → 0.23.1

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 (31) hide show
  1. package/README.md +2 -1
  2. package/bin/routing-metadata.generated.js +4 -0
  3. package/dist-bunli/.bunli/commands.gen.js +4103 -3086
  4. package/dist-bunli/{cli-hhp1d348.js → cli-1170yyve.js} +8 -7
  5. package/dist-bunli/{cli-qse6myha.js → cli-8hxf9qw6.js} +11 -3
  6. package/dist-bunli/{cli-8reep89s.js → cli-9fx0qgb7.js} +2 -2
  7. package/dist-bunli/{cli-add-21bvpfgw.js → cli-add-xjaaa01x.js} +1560 -1525
  8. package/dist-bunli/{cli-52ke0ptp.js → cli-am5x7tb4.js} +8 -2
  9. package/dist-bunli/cli-ccax7s0s.js +34 -0
  10. package/dist-bunli/{cli-diagnostics-5dvztm7q.js → cli-diagnostics-10drxh34.js} +1 -1
  11. package/dist-bunli/{cli-doctor-wy2yjsge.js → cli-doctor-19e8313m.js} +602 -459
  12. package/dist-bunli/{cli-2rqf6t0b.js → cli-e4bwd81c.js} +8 -11
  13. package/dist-bunli/{cli-9npd9was.js → cli-epsczb1c.js} +12 -10
  14. package/dist-bunli/{cli-agywa5n6.js → cli-fp16mntv.js} +8 -4
  15. package/dist-bunli/{cli-init-xnsbxncv.js → cli-init-2b4yn2cc.js} +14 -10
  16. package/dist-bunli/{cli-ts9thts5.js → cli-k5q5v8g6.js} +184 -162
  17. package/dist-bunli/{cli-c2acv5dv.js → cli-nvs5atj1.js} +2 -2
  18. package/dist-bunli/{cli-prompt-614tq57c.js → cli-prompt-ncyg68rn.js} +1 -1
  19. package/dist-bunli/{cli-bq2v559b.js → cli-rdcga1bd.js} +31 -13
  20. package/dist-bunli/{cli-scaffold-zhp2ym8z.js → cli-scaffold-4tjw4jk5.js} +27 -15
  21. package/dist-bunli/{cli-templates-hc71dfc2.js → cli-templates-g8t4fm11.js} +3 -2
  22. package/dist-bunli/{cli-p95wr1q8.js → cli-tq730sqt.js} +6 -3
  23. package/dist-bunli/{cli-1meywwsy.js → cli-y7w3pybs.js} +848 -246
  24. package/dist-bunli/{cli-z5qkx2pn.js → cli-ymecd15q.js} +37 -10
  25. package/dist-bunli/cli.js +4 -4
  26. package/dist-bunli/{command-list-aqrkx021.js → command-list-vme7dr5v.js} +81 -45
  27. package/dist-bunli/{create-template-validation-rtec5sng.js → create-template-validation-4fr851vg.js} +5 -4
  28. package/dist-bunli/{migrations-bx0yvc2v.js → migrations-pb5vvtdp.js} +9 -8
  29. package/dist-bunli/node-cli.js +399 -317
  30. package/dist-bunli/{workspace-project-csnnggz6.js → workspace-project-gmv2a71z.js} +4 -3
  31. package/package.json +2 -2
@@ -8,10 +8,10 @@ import {
8
8
  SHARED_REST_HELPER_TEMPLATE_ROOT,
9
9
  SHARED_WORKSPACE_TEMPLATE_ROOT,
10
10
  getTemplateById
11
- } from "./cli-qse6myha.js";
11
+ } from "./cli-8hxf9qw6.js";
12
12
  import {
13
13
  pathExists
14
- } from "./cli-ts9thts5.js";
14
+ } from "./cli-k5q5v8g6.js";
15
15
  import {
16
16
  createManagedTempRoot
17
17
  } from "./cli-t73q5aqz.js";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  createReadlinePrompt,
4
4
  createReadlinePromptWithInterface
5
- } from "./cli-bq2v559b.js";
5
+ } from "./cli-rdcga1bd.js";
6
6
  import"./cli-xnn9xjcy.js";
7
7
  export {
8
8
  createReadlinePromptWithInterface,
@@ -1,14 +1,15 @@
1
1
  // @bun
2
2
  // ../wp-typia-project-tools/src/runtime/cli-prompt.ts
3
3
  import readline from "readline";
4
- function createReadlinePrompt() {
4
+ function createReadlinePrompt(output = {}) {
5
5
  const rl = readline.createInterface({
6
6
  input: process.stdin,
7
7
  output: process.stdout
8
8
  });
9
- return createReadlinePromptWithInterface(rl);
9
+ return createReadlinePromptWithInterface(rl, output);
10
10
  }
11
- function createReadlinePromptWithInterface(rl) {
11
+ function createReadlinePromptWithInterface(rl, output = {}) {
12
+ const { errorLine, printLine } = resolveReadlinePromptOutput(output);
12
13
  const askQuestion = (query) => new Promise((resolve) => {
13
14
  rl.question(query, resolve);
14
15
  });
@@ -19,7 +20,7 @@ function createReadlinePromptWithInterface(rl) {
19
20
  if (validate) {
20
21
  const result = validate(value);
21
22
  if (result !== true) {
22
- console.error(formatValidationError(message, result, defaultValue));
23
+ errorLine(formatValidationError(message, result, defaultValue));
23
24
  continue;
24
25
  }
25
26
  }
@@ -31,7 +32,7 @@ function createReadlinePromptWithInterface(rl) {
31
32
  throw new Error(`select() requires at least one option for prompt: ${message}`);
32
33
  }
33
34
  const resolvedDefaultIndex = getResolvedDefaultIndex(options, defaultValue);
34
- renderSelectPrompt(message, options, resolvedDefaultIndex);
35
+ renderSelectPrompt(message, options, resolvedDefaultIndex, printLine);
35
36
  while (true) {
36
37
  const answer = normalizePromptAnswer(await askQuestion(formatChoicePrompt(resolvedDefaultIndex)));
37
38
  if (answer.length === 0) {
@@ -42,10 +43,10 @@ function createReadlinePromptWithInterface(rl) {
42
43
  return selection.value;
43
44
  }
44
45
  if (isPromptHelpToken(answer)) {
45
- renderSelectPrompt(message, options, resolvedDefaultIndex);
46
+ renderSelectPrompt(message, options, resolvedDefaultIndex, printLine);
46
47
  continue;
47
48
  }
48
- console.error(formatInvalidSelectionError(answer, options, resolvedDefaultIndex));
49
+ errorLine(formatInvalidSelectionError(answer, options, resolvedDefaultIndex));
49
50
  }
50
51
  },
51
52
  close() {
@@ -53,6 +54,23 @@ function createReadlinePromptWithInterface(rl) {
53
54
  }
54
55
  };
55
56
  }
57
+ function resolveReadlinePromptOutput({
58
+ errorLine,
59
+ printLine
60
+ }) {
61
+ return {
62
+ errorLine: errorLine ?? writePromptErrorLine,
63
+ printLine: printLine ?? writePromptLine
64
+ };
65
+ }
66
+ function writePromptLine(line) {
67
+ process.stdout.write(`${line}
68
+ `);
69
+ }
70
+ function writePromptErrorLine(line) {
71
+ process.stderr.write(`${line}
72
+ `);
73
+ }
56
74
  function normalizePromptAnswer(value) {
57
75
  return String(value).trim();
58
76
  }
@@ -75,15 +93,15 @@ function formatValidationError(message, result, defaultValue) {
75
93
  function formatChoicePrompt(defaultIndex) {
76
94
  return `Choice [default: ${defaultIndex + 1}, ? for options]: `;
77
95
  }
78
- function renderSelectPrompt(message, options, defaultIndex) {
79
- console.log(message);
80
- console.log(" Enter a number, option label, or option value. Press Enter to keep the default, or type ? to list choices again.");
96
+ function renderSelectPrompt(message, options, defaultIndex, printLine) {
97
+ printLine(message);
98
+ printLine(" Enter a number, option label, or option value. Press Enter to keep the default, or type ? to list choices again.");
81
99
  options.forEach((option, index) => {
82
100
  const defaultMarker = index === defaultIndex ? " (default)" : "";
83
101
  const valueHint = normalizePromptToken(option.label) === normalizePromptToken(option.value) ? "" : ` [${option.value}]`;
84
- console.log(` ${index + 1}. ${option.label}${valueHint}${defaultMarker}`);
102
+ printLine(` ${index + 1}. ${option.label}${valueHint}${defaultMarker}`);
85
103
  if (option.hint) {
86
- console.log(` ${option.hint}`);
104
+ printLine(` ${option.hint}`);
87
105
  }
88
106
  });
89
107
  }
@@ -114,4 +132,4 @@ function formatInvalidSelectionError(answer, options, defaultIndex) {
114
132
 
115
133
  export { createReadlinePrompt, createReadlinePromptWithInterface };
116
134
 
117
- //# debugId=15950E6A2C02C6E364756E2164756E21
135
+ //# debugId=44CDFE1F16A2DE6E64756E2164756E21
@@ -15,36 +15,40 @@ import {
15
15
  normalizeOptionalCliString,
16
16
  parseAlternateRenderTargets,
17
17
  parseCompoundInnerBlocksPreset,
18
+ resolveCreateProfileId,
18
19
  resolveLocalCliPathOption,
19
20
  resolveOptionalInteractiveExternalLayerId,
20
21
  resolvePackageManagerId,
21
22
  resolveTemplateId,
22
23
  scaffoldProject
23
- } from "./cli-1meywwsy.js";
24
- import"./cli-8reep89s.js";
25
- import"./cli-c2acv5dv.js";
26
- import"./cli-agywa5n6.js";
24
+ } from "./cli-y7w3pybs.js";
25
+ import"./cli-9fx0qgb7.js";
26
+ import"./cli-nvs5atj1.js";
27
+ import"./cli-fp16mntv.js";
27
28
  import {
28
29
  OFFICIAL_WORKSPACE_TEMPLATE_PACKAGE,
29
30
  isBuiltInTemplateId
30
- } from "./cli-qse6myha.js";
31
- import"./cli-9npd9was.js";
32
- import"./cli-2rqf6t0b.js";
31
+ } from "./cli-8hxf9qw6.js";
32
+ import"./cli-epsczb1c.js";
33
+ import"./cli-e4bwd81c.js";
33
34
  import {
34
35
  pathExists
35
- } from "./cli-ts9thts5.js";
36
+ } from "./cli-k5q5v8g6.js";
36
37
  import"./cli-cvxvcw7c.js";
37
38
  import {
38
39
  createManagedTempRoot
39
40
  } from "./cli-t73q5aqz.js";
40
41
  import"./cli-43mx1vfb.js";
41
- import"./cli-p95wr1q8.js";
42
- import"./cli-hhp1d348.js";
42
+ import"./cli-tq730sqt.js";
43
+ import"./cli-1170yyve.js";
43
44
  import {
44
45
  formatInstallCommand,
45
46
  formatRunScript
46
- } from "./cli-52ke0ptp.js";
47
- import"./cli-bq2v559b.js";
47
+ } from "./cli-am5x7tb4.js";
48
+ import {
49
+ readJsonFile
50
+ } from "./cli-ccax7s0s.js";
51
+ import"./cli-rdcga1bd.js";
48
52
  import"./cli-xnn9xjcy.js";
49
53
 
50
54
  // ../wp-typia-project-tools/src/runtime/cli-scaffold.ts
@@ -89,6 +93,7 @@ async function buildScaffoldDryRunPlan({
89
93
  onProgress,
90
94
  packageManager,
91
95
  persistencePolicy,
96
+ profile,
92
97
  projectDir,
93
98
  templateId,
94
99
  variant,
@@ -114,6 +119,7 @@ async function buildScaffoldDryRunPlan({
114
119
  onProgress,
115
120
  packageManager,
116
121
  persistencePolicy,
122
+ profile,
117
123
  projectDir: previewProjectDir,
118
124
  templateId,
119
125
  variant,
@@ -342,6 +348,7 @@ async function runScaffoldFlow({
342
348
  persistencePolicy,
343
349
  packageManager,
344
350
  namespace,
351
+ profile,
345
352
  textDomain,
346
353
  phpPrefix,
347
354
  queryPostType,
@@ -378,6 +385,7 @@ async function runScaffoldFlow({
378
385
  isInteractive,
379
386
  selectTemplate
380
387
  });
388
+ const resolvedProfile = resolveCreateProfileId(profile);
381
389
  validateCreateFlagContract({
382
390
  alternateRenderTargets,
383
391
  dataStorageMode,
@@ -429,7 +437,7 @@ async function runScaffoldFlow({
429
437
  isInteractive,
430
438
  selectPackageManager
431
439
  });
432
- const resolvedWithWpEnv = await resolveOptionalBooleanFlag({
440
+ const resolvedWithWpEnv = resolvedProfile === "plugin-qa" ? true : await resolveOptionalBooleanFlag({
433
441
  explicitValue: withWpEnv,
434
442
  isInteractive,
435
443
  select: selectWithWpEnv,
@@ -479,6 +487,7 @@ async function runScaffoldFlow({
479
487
  onProgress,
480
488
  packageManager: resolvedPackageManager,
481
489
  persistencePolicy: resolvedPersistencePolicy,
490
+ profile: resolvedProfile,
482
491
  projectDir,
483
492
  templateId: resolvedTemplateId,
484
493
  variant,
@@ -501,6 +510,7 @@ async function runScaffoldFlow({
501
510
  onProgress,
502
511
  packageManager: resolvedPackageManager,
503
512
  persistencePolicy: resolvedPersistencePolicy,
513
+ profile: resolvedProfile,
504
514
  projectDir,
505
515
  templateId: resolvedTemplateId,
506
516
  variant,
@@ -512,7 +522,9 @@ async function runScaffoldFlow({
512
522
  let availableScripts;
513
523
  if (!dryRun) {
514
524
  try {
515
- const parsedPackageJson = JSON.parse(await fsp.readFile(path.join(projectDir, "package.json"), "utf8"));
525
+ const parsedPackageJson = await readJsonFile(path.join(projectDir, "package.json"), {
526
+ context: "generated package manifest"
527
+ });
516
528
  const scripts = parsedPackageJson.scripts && typeof parsedPackageJson.scripts === "object" && !Array.isArray(parsedPackageJson.scripts) ? parsedPackageJson.scripts : {};
517
529
  availableScripts = Object.entries(scripts).filter(([, value]) => typeof value === "string").map(([scriptName]) => scriptName);
518
530
  } catch {
@@ -561,4 +573,4 @@ export {
561
573
  getNextSteps
562
574
  };
563
575
 
564
- //# debugId=2B866835B8626C1664756E2164756E21
576
+ //# debugId=A4E8245E23045A1864756E2164756E21
@@ -7,7 +7,8 @@ import {
7
7
  getUserFacingTemplateId,
8
8
  isBuiltInTemplateId,
9
9
  listTemplates
10
- } from "./cli-qse6myha.js";
10
+ } from "./cli-8hxf9qw6.js";
11
+ import"./cli-ccax7s0s.js";
11
12
  import"./cli-xnn9xjcy.js";
12
13
 
13
14
  // ../wp-typia-project-tools/src/runtime/cli-templates.ts
@@ -163,4 +164,4 @@ export {
163
164
  formatTemplateDetails
164
165
  };
165
166
 
166
- //# debugId=BBD1289DE41D599964756E2164756E21
167
+ //# debugId=F036FFC923A55DB664756E2164756E21
@@ -322,12 +322,15 @@ function formatDoctorCheckLine(check) {
322
322
  function getFailingDoctorChecks(checks) {
323
323
  return checks.filter((check) => check.status === "fail");
324
324
  }
325
- function formatDoctorSummaryLine(checks) {
325
+ function formatDoctorSummaryLine(checks, options = {}) {
326
326
  const failedChecks = getFailingDoctorChecks(checks);
327
+ const exitFailureChecks = options.exitFailureChecks ?? failedChecks;
328
+ const advisoryFailureCount = failedChecks.length - exitFailureChecks.length;
327
329
  const warningCount = checks.filter((check) => check.status === "warn").length;
328
- const summaryStatus = failedChecks.length > 0 ? "FAIL" : warningCount > 0 ? "WARN" : "PASS";
330
+ const summaryStatus = exitFailureChecks.length > 0 ? "FAIL" : advisoryFailureCount > 0 || warningCount > 0 ? "WARN" : "PASS";
329
331
  return formatWrappedPrefixedLine(`${summaryStatus} wp-typia doctor summary: `, [
330
332
  `${checks.length - failedChecks.length - warningCount}/${checks.length} checks passed`,
333
+ advisoryFailureCount > 0 ? `${advisoryFailureCount} advisory failure(s)` : null,
331
334
  warningCount > 0 ? `${warningCount} warning(s)` : null
332
335
  ].filter((detail) => detail !== null).join(", "), resolveCliWrapColumns(process.stdout.columns)).join(`
333
336
  `);
@@ -338,4 +341,4 @@ function getDoctorFailureDetailLines(checks) {
338
341
 
339
342
  export { CLI_DIAGNOSTIC_CODES, CLI_DIAGNOSTIC_CODE_METADATA, CliDiagnosticError, isCliDiagnosticError, getCliDiagnosticCodeMetadata, createCliDiagnosticCodeError, createCliCommandError, formatCliDiagnosticError, serializeCliDiagnosticError, formatDoctorCheckLine, getFailingDoctorChecks, formatDoctorSummaryLine, getDoctorFailureDetailLines };
340
343
 
341
- //# debugId=723BDE410F54191064756E2164756E21
344
+ //# debugId=65A9D8947CD0E24564756E2164756E21