wp-typia 0.24.1 → 0.24.3

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.
@@ -21,19 +21,19 @@ import {
21
21
  resolvePackageManagerId,
22
22
  resolveTemplateId,
23
23
  scaffoldProject
24
- } from "./cli-4ah8dawy.js";
24
+ } from "./cli-kfm9mm68.js";
25
25
  import"./cli-9fx0qgb7.js";
26
- import"./cli-gaq29kzp.js";
27
- import"./cli-zjw3eqfj.js";
26
+ import"./cli-377p86mf.js";
27
+ import"./cli-84c7wff4.js";
28
28
  import {
29
29
  OFFICIAL_WORKSPACE_TEMPLATE_PACKAGE,
30
30
  isBuiltInTemplateId
31
31
  } from "./cli-8hxf9qw6.js";
32
- import"./cli-fzhkqzc7.js";
32
+ import"./cli-tj7ajdvf.js";
33
33
  import"./cli-e4bwd81c.js";
34
34
  import {
35
35
  pathExists
36
- } from "./cli-h2v72j8q.js";
36
+ } from "./cli-fv4h3ydt.js";
37
37
  import"./cli-cvxvcw7c.js";
38
38
  import {
39
39
  createManagedTempRoot
@@ -52,6 +52,12 @@ import"./cli-rdcga1bd.js";
52
52
  import"./cli-xnn9xjcy.js";
53
53
 
54
54
  // ../wp-typia-project-tools/src/runtime/cli-scaffold.ts
55
+ import path5 from "path";
56
+
57
+ // ../wp-typia-project-tools/src/runtime/cli-scaffold-emission.ts
58
+ import path2 from "path";
59
+
60
+ // ../wp-typia-project-tools/src/runtime/cli-scaffold-files.ts
55
61
  import { promises as fsp } from "fs";
56
62
  import path from "path";
57
63
  async function listRelativeProjectFiles(rootDir) {
@@ -79,58 +85,37 @@ async function assertDryRunTargetDirectoryReady(projectDir, allowExistingDir) {
79
85
  throw new Error(formatNonEmptyTargetDirectoryError(projectDir));
80
86
  }
81
87
  }
82
- async function buildScaffoldDryRunPlan({
83
- allowExistingDir,
84
- alternateRenderTargets,
85
- answers,
86
- cwd,
87
- dataStorageMode,
88
- externalLayerId,
89
- externalLayerSource,
90
- externalLayerSourceLabel,
91
- installDependencies,
92
- noInstall,
93
- onProgress,
94
- packageManager,
95
- persistencePolicy,
96
- profile,
97
- projectDir,
98
- templateId,
99
- variant,
100
- withMigrationUi,
101
- withTestPreset,
102
- withWpEnv
103
- }) {
104
- await assertDryRunTargetDirectoryReady(projectDir, allowExistingDir);
88
+ async function readGeneratedPackageScripts(projectDir) {
89
+ try {
90
+ const parsedPackageJson = await readJsonFile(path.join(projectDir, "package.json"), {
91
+ context: "generated package manifest"
92
+ });
93
+ const scripts = parsedPackageJson.scripts && typeof parsedPackageJson.scripts === "object" && !Array.isArray(parsedPackageJson.scripts) ? parsedPackageJson.scripts : {};
94
+ return Object.entries(scripts).filter(([, value]) => typeof value === "string").map(([scriptName]) => scriptName);
95
+ } catch {
96
+ return;
97
+ }
98
+ }
99
+
100
+ // ../wp-typia-project-tools/src/runtime/cli-scaffold-emission.ts
101
+ async function emitScaffoldProject(options) {
102
+ return scaffoldProject(options);
103
+ }
104
+ async function buildScaffoldDryRunPlan(options) {
105
+ await assertDryRunTargetDirectoryReady(options.projectDir, options.allowExistingDir);
105
106
  const { path: tempRoot, cleanup } = await createManagedTempRoot("wp-typia-scaffold-plan-");
106
- const previewProjectDir = path.join(tempRoot, "preview-project");
107
+ const previewProjectDir = path2.join(tempRoot, "preview-project");
107
108
  try {
108
- const result = await scaffoldProject({
109
+ const result = await emitScaffoldProject({
110
+ ...options,
109
111
  allowExistingDir: false,
110
- alternateRenderTargets,
111
- answers,
112
- cwd,
113
- dataStorageMode,
114
- externalLayerId,
115
- externalLayerSource,
116
- externalLayerSourceLabel,
117
- installDependencies,
118
112
  noInstall: true,
119
- onProgress,
120
- packageManager,
121
- persistencePolicy,
122
- profile,
123
- projectDir: previewProjectDir,
124
- templateId,
125
- variant,
126
- withMigrationUi,
127
- withTestPreset,
128
- withWpEnv
113
+ projectDir: previewProjectDir
129
114
  });
130
115
  const files = await listRelativeProjectFiles(previewProjectDir);
131
116
  return {
132
117
  plan: {
133
- dependencyInstall: noInstall ? "skipped-by-flag" : "would-install",
118
+ dependencyInstall: options.noInstall ? "skipped-by-flag" : "would-install",
134
119
  files
135
120
  },
136
121
  result
@@ -139,19 +124,67 @@ async function buildScaffoldDryRunPlan({
139
124
  await cleanup();
140
125
  }
141
126
  }
127
+
128
+ // ../wp-typia-project-tools/src/runtime/cli-scaffold-output.ts
129
+ import path3 from "path";
130
+ function quoteShellValue(value) {
131
+ if (!value.startsWith("-") && /^[A-Za-z0-9._/@:-]+(?:\/[A-Za-z0-9._@:-]+)*$/.test(value)) {
132
+ return value;
133
+ }
134
+ return `'${value.replace(/'/g, `'"'"'`)}'`;
135
+ }
136
+ function getNextSteps({
137
+ projectInput,
138
+ projectDir,
139
+ packageManager,
140
+ noInstall,
141
+ templateId
142
+ }) {
143
+ const cdTarget = path3.isAbsolute(projectInput) ? projectDir : projectInput;
144
+ const steps = [`cd ${quoteShellValue(cdTarget)}`];
145
+ if (noInstall) {
146
+ steps.push(formatInstallCommand(packageManager));
147
+ }
148
+ steps.push(formatRunScript(packageManager, getPrimaryDevelopmentScript(templateId)));
149
+ return steps;
150
+ }
151
+ function getOptionalOnboarding({
152
+ availableScripts,
153
+ packageManager,
154
+ templateId,
155
+ compoundPersistenceEnabled = false
156
+ }) {
157
+ return {
158
+ note: getOptionalOnboardingNote(packageManager, templateId, {
159
+ availableScripts,
160
+ compoundPersistenceEnabled
161
+ }),
162
+ shortNote: getOptionalOnboardingShortNote(packageManager, templateId, {
163
+ availableScripts,
164
+ compoundPersistenceEnabled
165
+ }),
166
+ steps: getOptionalOnboardingSteps(packageManager, templateId, {
167
+ availableScripts,
168
+ compoundPersistenceEnabled
169
+ })
170
+ };
171
+ }
172
+
173
+ // ../wp-typia-project-tools/src/runtime/cli-scaffold-validation.ts
174
+ import path4 from "path";
142
175
  function validateCreateProjectInput(projectInput) {
143
176
  const normalizedProjectInput = projectInput.trim();
144
177
  if (normalizedProjectInput.length === 0) {
145
178
  throw new Error("Project directory is required. Usage: wp-typia create <project-dir> (or wp-typia <project-dir> when <project-dir> is the only positional argument).");
146
179
  }
147
- const normalizedProjectPath = path.normalize(normalizedProjectInput).replace(/[\\/]+$/u, "") || path.normalize(normalizedProjectInput);
180
+ const normalizedProjectPath = path4.normalize(normalizedProjectInput).replace(/[\\/]+$/u, "") || path4.normalize(normalizedProjectInput);
148
181
  if (normalizedProjectPath === "." || normalizedProjectPath === "..") {
149
182
  throw new Error("`wp-typia create` requires a new project directory. Use an explicit child directory instead of `.` or `..`.");
150
183
  }
151
184
  }
152
185
  function collectProjectDirectoryWarnings(projectDir) {
153
186
  const warnings = [];
154
- const projectName = path.basename(projectDir);
187
+ const projectName = path4.basename(projectDir);
155
188
  if (/\s/u.test(projectName)) {
156
189
  warnings.push(`Project directory "${projectName}" contains spaces. The generated next-step commands will be quoted, but a simple kebab-case directory name is usually easier to use with shells and downstream tooling.`);
157
190
  }
@@ -260,7 +293,7 @@ async function resolveOptionalSelection({
260
293
  if (!shouldResolve) {
261
294
  return;
262
295
  }
263
- if (explicitValue) {
296
+ if (explicitValue !== undefined) {
264
297
  return parseSelectableValue(label, explicitValue, isValue, allowedValues);
265
298
  }
266
299
  if (yes) {
@@ -293,48 +326,8 @@ async function resolveOptionalBooleanFlag({
293
326
  }
294
327
  return defaultValue;
295
328
  }
296
- function quoteShellValue(value) {
297
- if (!value.startsWith("-") && /^[A-Za-z0-9._/@:-]+(?:\/[A-Za-z0-9._@:-]+)*$/.test(value)) {
298
- return value;
299
- }
300
- return `'${value.replace(/'/g, `'"'"'`)}'`;
301
- }
302
- function getNextSteps({
303
- projectInput,
304
- projectDir,
305
- packageManager,
306
- noInstall,
307
- templateId
308
- }) {
309
- const cdTarget = path.isAbsolute(projectInput) ? projectDir : projectInput;
310
- const steps = [`cd ${quoteShellValue(cdTarget)}`];
311
- if (noInstall) {
312
- steps.push(formatInstallCommand(packageManager));
313
- }
314
- steps.push(formatRunScript(packageManager, getPrimaryDevelopmentScript(templateId)));
315
- return steps;
316
- }
317
- function getOptionalOnboarding({
318
- availableScripts,
319
- packageManager,
320
- templateId,
321
- compoundPersistenceEnabled = false
322
- }) {
323
- return {
324
- note: getOptionalOnboardingNote(packageManager, templateId, {
325
- availableScripts,
326
- compoundPersistenceEnabled
327
- }),
328
- shortNote: getOptionalOnboardingShortNote(packageManager, templateId, {
329
- availableScripts,
330
- compoundPersistenceEnabled
331
- }),
332
- steps: getOptionalOnboardingSteps(packageManager, templateId, {
333
- availableScripts,
334
- compoundPersistenceEnabled
335
- })
336
- };
337
- }
329
+
330
+ // ../wp-typia-project-tools/src/runtime/cli-scaffold.ts
338
331
  async function runScaffoldFlow({
339
332
  projectInput,
340
333
  cwd = process.cwd(),
@@ -456,8 +449,8 @@ async function runScaffoldFlow({
456
449
  select: selectWithMigrationUi,
457
450
  yes
458
451
  });
459
- const projectDir = path.resolve(cwd, projectInput);
460
- const projectName = path.basename(projectDir);
452
+ const projectDir = path5.resolve(cwd, projectInput);
453
+ const projectName = path5.basename(projectDir);
461
454
  const answers = await collectScaffoldAnswers({
462
455
  dataStorageMode: resolvedDataStorage,
463
456
  namespace,
@@ -473,7 +466,7 @@ async function runScaffoldFlow({
473
466
  if (resolvedTemplateId === "compound" && resolvedInnerBlocksPreset) {
474
467
  answers.compoundInnerBlocksPreset = resolvedInnerBlocksPreset;
475
468
  }
476
- const resolvedResult = dryRun ? await buildScaffoldDryRunPlan({
469
+ const emissionOptions = {
477
470
  allowExistingDir,
478
471
  alternateRenderTargets,
479
472
  answers,
@@ -494,43 +487,12 @@ async function runScaffoldFlow({
494
487
  withMigrationUi: resolvedWithMigrationUi,
495
488
  withTestPreset: resolvedWithTestPreset,
496
489
  withWpEnv: resolvedWithWpEnv
497
- }) : {
490
+ };
491
+ const resolvedResult = dryRun ? await buildScaffoldDryRunPlan(emissionOptions) : {
498
492
  plan: undefined,
499
- result: await scaffoldProject({
500
- alternateRenderTargets,
501
- answers,
502
- allowExistingDir,
503
- cwd,
504
- dataStorageMode: resolvedDataStorage,
505
- externalLayerId: resolvedExternalLayerSelection.externalLayerId,
506
- externalLayerSource: resolvedExternalLayerSelection.externalLayerSource,
507
- externalLayerSourceLabel: normalizedExternalLayerSource,
508
- installDependencies,
509
- noInstall,
510
- onProgress,
511
- packageManager: resolvedPackageManager,
512
- persistencePolicy: resolvedPersistencePolicy,
513
- profile: resolvedProfile,
514
- projectDir,
515
- templateId: resolvedTemplateId,
516
- variant,
517
- withMigrationUi: resolvedWithMigrationUi,
518
- withTestPreset: resolvedWithTestPreset,
519
- withWpEnv: resolvedWithWpEnv
520
- })
493
+ result: await emitScaffoldProject(emissionOptions)
521
494
  };
522
- let availableScripts;
523
- if (!dryRun) {
524
- try {
525
- const parsedPackageJson = await readJsonFile(path.join(projectDir, "package.json"), {
526
- context: "generated package manifest"
527
- });
528
- const scripts = parsedPackageJson.scripts && typeof parsedPackageJson.scripts === "object" && !Array.isArray(parsedPackageJson.scripts) ? parsedPackageJson.scripts : {};
529
- availableScripts = Object.entries(scripts).filter(([, value]) => typeof value === "string").map(([scriptName]) => scriptName);
530
- } catch {
531
- availableScripts = undefined;
532
- }
533
- }
495
+ const availableScripts = dryRun ? undefined : await readGeneratedPackageScripts(projectDir);
534
496
  return {
535
497
  dryRun,
536
498
  optionalOnboarding: getOptionalOnboarding({
@@ -573,4 +535,4 @@ export {
573
535
  getNextSteps
574
536
  };
575
537
 
576
- //# debugId=A4E8245E23045A1864756E2164756E21
538
+ //# debugId=3CB466F01953BF7F64756E2164756E21
@@ -47,7 +47,7 @@ import {
47
47
  } from "./cli-e4bwd81c.js";
48
48
  import {
49
49
  readWorkspaceInventory
50
- } from "./cli-h2v72j8q.js";
50
+ } from "./cli-fv4h3ydt.js";
51
51
  import {
52
52
  getInvalidWorkspaceProjectReason,
53
53
  tryResolveWorkspaceProject
package/dist-bunli/cli.js CHANGED
@@ -22,7 +22,7 @@ import {
22
22
  package_default,
23
23
  validateCliOutputFormatArgv,
24
24
  writeStructuredCliDiagnosticError
25
- } from "./cli-1xt99e09.js";
25
+ } from "./cli-4pzxbk4s.js";
26
26
  import"./cli-03j0axbt.js";
27
27
  import {
28
28
  GLOBAL_FLAGS,
@@ -2460,7 +2460,7 @@ async function formatCliError(error) {
2460
2460
  }
2461
2461
  async function createWpTypiaCli(options = {}) {
2462
2462
  applyStandaloneSupportLayoutEnv();
2463
- const { wpTypiaCommands } = await import("./command-list-bd2582k1.js");
2463
+ const { wpTypiaCommands } = await import("./command-list-bgwaa2f4.js");
2464
2464
  const cli = await createCLI({
2465
2465
  ...bunliConfig,
2466
2466
  description: package_default.description,
@@ -19,7 +19,7 @@ import {
19
19
  package_default,
20
20
  prefersStructuredCliOutput,
21
21
  resolveCommandOptionValues
22
- } from "./cli-1xt99e09.js";
22
+ } from "./cli-4pzxbk4s.js";
23
23
  import {
24
24
  Result,
25
25
  TaggedError,
@@ -115,6 +115,15 @@ var NAME_ONLY_VISIBLE_FIELDS = [
115
115
  "kind",
116
116
  "name"
117
117
  ];
118
+ var PATTERN_CATALOG_VISIBLE_FIELDS = [
119
+ "kind",
120
+ "name",
121
+ "scope",
122
+ "section-role",
123
+ "catalog-title",
124
+ "tags",
125
+ "thumbnail-url"
126
+ ];
118
127
  var NAME_SOURCE_VISIBLE_FIELDS = [
119
128
  "kind",
120
129
  "name",
@@ -583,6 +592,15 @@ var contractAddKindEntry = defineAddKindRegistryEntry({
583
592
  // src/add-kinds/core-variation.ts
584
593
  var CORE_VARIATION_MISSING_NAME_MESSAGE = "`wp-typia add core-variation` requires <name>. Usage: wp-typia add core-variation <block-name> <name> or wp-typia add core-variation <name> --block <namespace/block>.";
585
594
  var CORE_VARIATION_MISSING_BLOCK_MESSAGE = "`wp-typia add core-variation` requires <block-name>. Usage: wp-typia add core-variation <block-name> <name> or wp-typia add core-variation <name> --block <namespace/block>.";
595
+ var CORE_VARIATION_BLOCK_NAME_PATTERN = /^[^/\s]+\/[^/\s]+$/u;
596
+ function formatCoreVariationMissingPositionalNameMessage(blockName) {
597
+ return [
598
+ `\`wp-typia add core-variation ${blockName}\` is missing <name>.`,
599
+ "Usage: wp-typia add core-variation <block-name> <name>",
600
+ "Alternative: wp-typia add core-variation <name> --block <namespace/block>"
601
+ ].join(`
602
+ `);
603
+ }
586
604
  function resolveCoreVariationInputs(context) {
587
605
  const positionalTargetBlockName = context.positionalArgs?.[1];
588
606
  const positionalVariationName = context.positionalArgs?.[2];
@@ -595,16 +613,17 @@ function resolveCoreVariationInputs(context) {
595
613
  variationName: positionalVariationName
596
614
  };
597
615
  }
598
- if (context.name?.includes("/") && !readOptionalStrictStringFlag(context.flags, "block")) {
599
- throw createCliDiagnosticCodeError(CLI_DIAGNOSTIC_CODES.MISSING_ARGUMENT, CORE_VARIATION_MISSING_NAME_MESSAGE);
616
+ const targetBlockFlag = readOptionalStrictStringFlag(context.flags, "block");
617
+ const missingPositionalNameTarget = context.name !== undefined && positionalTargetBlockName === context.name && CORE_VARIATION_BLOCK_NAME_PATTERN.test(context.name) ? context.name : undefined;
618
+ if (missingPositionalNameTarget && !targetBlockFlag) {
619
+ throw createCliDiagnosticCodeError(CLI_DIAGNOSTIC_CODES.MISSING_ARGUMENT, formatCoreVariationMissingPositionalNameMessage(missingPositionalNameTarget));
600
620
  }
601
621
  const variationName = requireAddKindName(context, CORE_VARIATION_MISSING_NAME_MESSAGE);
602
- const targetBlockName = readOptionalStrictStringFlag(context.flags, "block");
603
- if (!targetBlockName) {
622
+ if (!targetBlockFlag) {
604
623
  throw createCliDiagnosticCodeError(CLI_DIAGNOSTIC_CODES.MISSING_ARGUMENT, CORE_VARIATION_MISSING_BLOCK_MESSAGE);
605
624
  }
606
625
  return {
607
- targetBlockName,
626
+ targetBlockName: targetBlockFlag,
608
627
  variationName
609
628
  };
610
629
  }
@@ -783,7 +802,8 @@ var integrationEnvAddKindEntry = defineAddKindRegistryEntry({
783
802
  supportsDryRun: true,
784
803
  usage: "wp-typia add integration-env <name> [--wp-env] [--release-zip] [--service <none|docker-compose>] [--dry-run]",
785
804
  visibleFieldNames: () => NAME_ONLY_VISIBLE_FIELDS,
786
- hiddenBooleanSubmitFields: ["wp-env", "release-zip"]
805
+ hiddenBooleanSubmitFields: ["wp-env", "release-zip"],
806
+ hiddenStringSubmitFields: ["service"]
787
807
  });
788
808
 
789
809
  // src/add-kinds/pattern.ts
@@ -802,19 +822,12 @@ var patternAddKindEntry = defineAddKindRegistryEntry({
802
822
  title: "Added workspace pattern"
803
823
  },
804
824
  description: "Add a PHP block pattern shell",
805
- hiddenStringSubmitFields: [
806
- "catalog-title",
807
- "scope",
808
- "section-role",
809
- "tag",
810
- "tags",
811
- "thumbnail-url"
812
- ],
825
+ hiddenStringSubmitFields: ["tag"],
813
826
  nameLabel: "Pattern name",
814
827
  async prepareExecution(context) {
815
828
  const name = requireAddKindName(context, PATTERN_MISSING_NAME_MESSAGE);
816
- const scope = typeof context.flags.scope === "string" ? context.flags.scope : undefined;
817
- const sectionRole = typeof context.flags["section-role"] === "string" ? context.flags["section-role"] : undefined;
829
+ const scope = resolvePatternScopeFlag(context);
830
+ const sectionRole = resolvePatternSectionRoleFlag(context, scope);
818
831
  const catalogTitle = typeof context.flags["catalog-title"] === "string" ? context.flags["catalog-title"] : undefined;
819
832
  const tags = normalizePatternTagFlags(context.flags.tags, context.flags.tag);
820
833
  const thumbnailUrl = typeof context.flags["thumbnail-url"] === "string" ? context.flags["thumbnail-url"] : undefined;
@@ -839,9 +852,42 @@ var patternAddKindEntry = defineAddKindRegistryEntry({
839
852
  },
840
853
  sortOrder: 60,
841
854
  supportsDryRun: true,
842
- usage: "wp-typia add pattern <name> [--scope <full|section>] [--section-role <role>] [--catalog-title <title>] [--tags <tag,...>|--tag <tag>...] [--thumbnail-url <url>] [--dry-run]",
843
- visibleFieldNames: () => NAME_ONLY_VISIBLE_FIELDS
855
+ usage: "wp-typia add pattern <name> [--scope <full|section>] [--section-role <role>] [--catalog-title <title>] [--tags <tag,...>] [--tag <tag>...] [--thumbnail-url <url>] [--dry-run]",
856
+ visibleFieldNames: () => PATTERN_CATALOG_VISIBLE_FIELDS
844
857
  });
858
+ function createInvalidPatternArgumentError(message) {
859
+ return createCliDiagnosticCodeError(CLI_DIAGNOSTIC_CODES.INVALID_ARGUMENT, message);
860
+ }
861
+ function createMissingPatternArgumentError(message) {
862
+ return createCliDiagnosticCodeError(CLI_DIAGNOSTIC_CODES.MISSING_ARGUMENT, message);
863
+ }
864
+ function resolvePatternScopeFlag(context) {
865
+ const scope = readOptionalLooseStringFlag(context.flags, "scope");
866
+ if (!scope) {
867
+ return;
868
+ }
869
+ if (context.addRuntime.PATTERN_CATALOG_SCOPE_IDS.includes(scope)) {
870
+ return scope;
871
+ }
872
+ throw createInvalidPatternArgumentError(`\`--scope\` must be one of: ${context.addRuntime.PATTERN_CATALOG_SCOPE_IDS.join(", ")}. Usage: wp-typia add pattern <name> --scope <full|section>.`);
873
+ }
874
+ function resolvePatternSectionRoleFlag(context, scope) {
875
+ const sectionRole = readOptionalLooseStringFlag(context.flags, "section-role");
876
+ if (scope === "section" && sectionRole === undefined) {
877
+ throw createMissingPatternArgumentError("`wp-typia add pattern --scope section` requires --section-role <role> because section-scoped patterns need a typed catalog section role.");
878
+ }
879
+ if (scope !== "section" && sectionRole !== undefined) {
880
+ throw createInvalidPatternArgumentError("`--section-role` only applies with `--scope section`. Use `--scope section --section-role <role>` or omit `--section-role` for full patterns.");
881
+ }
882
+ const normalizedSectionRole = sectionRole === undefined ? undefined : context.addRuntime.normalizeBlockSlug(sectionRole);
883
+ if (normalizedSectionRole && !context.addRuntime.PATTERN_SECTION_ROLE_PATTERN.test(normalizedSectionRole)) {
884
+ throw createInvalidPatternArgumentError("`--section-role` must start with a lowercase letter and contain only lowercase letters, numbers, and hyphens. Section roles apply only with `--scope section`.");
885
+ }
886
+ if (sectionRole !== undefined && !normalizedSectionRole) {
887
+ throw createInvalidPatternArgumentError("`--section-role` must start with a lowercase letter and contain only lowercase letters, numbers, and hyphens. Section roles apply only with `--scope section`.");
888
+ }
889
+ return normalizedSectionRole;
890
+ }
845
891
  function collectStringFlagValues(value) {
846
892
  if (typeof value === "string") {
847
893
  return [value];
@@ -856,13 +902,7 @@ function normalizePatternTagFlags(tagsFlag, tagFlag) {
856
902
  ...collectStringFlagValues(tagsFlag),
857
903
  ...collectStringFlagValues(tagFlag)
858
904
  ];
859
- if (tags.length === 0) {
860
- return;
861
- }
862
- if (tags.length === 1) {
863
- return tags[0];
864
- }
865
- return tags;
905
+ return tags.length > 0 ? tags : undefined;
866
906
  }
867
907
 
868
908
  // src/add-kinds/post-meta.ts
@@ -1818,7 +1858,7 @@ function pushFlag(argv, name, value) {
1818
1858
  }
1819
1859
 
1820
1860
  // src/runtime-bridge-add.ts
1821
- var loadCliAddRuntime = () => import("./cli-add-mr731xtv.js");
1861
+ var loadCliAddRuntime = () => import("./cli-add-mxxk5rep.js");
1822
1862
  var loadCliPromptRuntime = () => import("./cli-prompt-ncyg68rn.js");
1823
1863
  async function executeWorkspaceAddWithOptionalDryRun(options) {
1824
1864
  const simulated = options.dryRun ? await simulateWorkspaceAddDryRun({
@@ -1928,7 +1968,7 @@ async function executeAddCommand({
1928
1968
  }
1929
1969
  // src/runtime-bridge-create.ts
1930
1970
  var loadCliPromptRuntime2 = () => import("./cli-prompt-ncyg68rn.js");
1931
- var loadCliScaffoldRuntime = () => import("./cli-scaffold-bt1ttnkg.js");
1971
+ var loadCliScaffoldRuntime = () => import("./cli-scaffold-0bb6pr3w.js");
1932
1972
  var loadCliTemplatesRuntime = () => import("./cli-templates-g8t4fm11.js");
1933
1973
  var loadCreateTemplateValidationRuntime = () => import("./create-template-validation-4fr851vg.js");
1934
1974
  var PACKAGE_MANAGER_PROMPT_OPTIONS = [
@@ -2049,7 +2089,7 @@ async function executeCreateCommand({
2049
2089
  }
2050
2090
  }
2051
2091
  // src/runtime-bridge-doctor.ts
2052
- var loadCliDoctorRuntime = () => import("./cli-doctor-kf9gwdhh.js");
2092
+ var loadCliDoctorRuntime = () => import("./cli-doctor-6fyxq940.js");
2053
2093
  async function executeDoctorCommand(cwd, options = {}) {
2054
2094
  try {
2055
2095
  const { runDoctor } = await loadCliDoctorRuntime();
@@ -2060,7 +2100,7 @@ async function executeDoctorCommand(cwd, options = {}) {
2060
2100
  }
2061
2101
  // src/runtime-bridge-init.ts
2062
2102
  import path2 from "path";
2063
- var loadCliInitRuntime = () => import("./cli-init-557vq109.js");
2103
+ var loadCliInitRuntime = () => import("./cli-init-7avk42dh.js");
2064
2104
  async function executeInitCommand({ apply, cwd, packageManager, projectDir }, options = {}) {
2065
2105
  try {
2066
2106
  const { runInitCommand } = await loadCliInitRuntime();
@@ -2086,7 +2126,7 @@ async function executeInitCommand({ apply, cwd, packageManager, projectDir }, op
2086
2126
  }
2087
2127
  }
2088
2128
  // src/runtime-bridge-migrate.ts
2089
- var loadMigrationsRuntime = () => import("./migrations-ky53fj2h.js");
2129
+ var loadMigrationsRuntime = () => import("./migrations-3vngdy51.js");
2090
2130
  var defaultPrintLine2 = (line) => {
2091
2131
  process.stdout.write(`${line}
2092
2132
  `);
@@ -2982,7 +3022,7 @@ var doctorCommand = defineCommand({
2982
3022
  createDoctorRunSummary,
2983
3023
  getDoctorChecks,
2984
3024
  getDoctorExitFailureDetailLines
2985
- } = await import("./cli-doctor-kf9gwdhh.js");
3025
+ } = await import("./cli-doctor-6fyxq940.js");
2986
3026
  const checks = await getDoctorChecks(args.cwd);
2987
3027
  const summary = createDoctorRunSummary(checks, {
2988
3028
  exitPolicy: doctorExitPolicy
@@ -3877,4 +3917,4 @@ export {
3877
3917
  wpTypiaCommands
3878
3918
  };
3879
3919
 
3880
- //# debugId=B6599B689F520BC764756E2164756E21
3920
+ //# debugId=F41601669F8057C564756E2164756E21
@@ -15,9 +15,9 @@ import {
15
15
  snapshotProjectVersion,
16
16
  verifyProjectMigrations,
17
17
  wizardProjectMigrations
18
- } from "./cli-fzhkqzc7.js";
18
+ } from "./cli-tj7ajdvf.js";
19
19
  import"./cli-e4bwd81c.js";
20
- import"./cli-h2v72j8q.js";
20
+ import"./cli-fv4h3ydt.js";
21
21
  import"./cli-cvxvcw7c.js";
22
22
  import"./cli-bajwv85z.js";
23
23
  import"./cli-tq730sqt.js";