wp-typia 0.22.7 → 0.22.9

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.
@@ -7,7 +7,7 @@ import {
7
7
  getUserFacingTemplateId,
8
8
  isBuiltInTemplateId,
9
9
  listTemplates
10
- } from "./cli-tke8twkn.js";
10
+ } from "./cli-qse6myha.js";
11
11
  import"./cli-xnn9xjcy.js";
12
12
 
13
13
  // ../wp-typia-project-tools/src/runtime/cli-templates.ts
@@ -8,13 +8,15 @@ import {
8
8
  SHARED_REST_HELPER_TEMPLATE_ROOT,
9
9
  SHARED_WORKSPACE_TEMPLATE_ROOT,
10
10
  getTemplateById
11
- } from "./cli-tke8twkn.js";
11
+ } from "./cli-qse6myha.js";
12
+ import {
13
+ pathExists
14
+ } from "./cli-regw5384.js";
12
15
  import {
13
16
  createManagedTempRoot
14
17
  } from "./cli-t73q5aqz.js";
15
18
 
16
19
  // ../wp-typia-project-tools/src/runtime/template-builtins.ts
17
- import fs from "fs";
18
20
  import path from "path";
19
21
  import { promises as fsp } from "fs";
20
22
  var BUILT_IN_SHARED_TEMPLATE_LAYERS = Object.freeze([
@@ -136,20 +138,23 @@ function getBuiltInTemplateLayerDirs(templateId, options = {}) {
136
138
  function isOmittableBuiltInTemplateLayerDir(templateId, layerDir) {
137
139
  return OMITTABLE_BUILT_IN_OVERLAY_TEMPLATE_IDS.has(templateId) && layerDir === getTemplateById(templateId).templateDir;
138
140
  }
139
- function resolveMaterializedTemplateLayerDirs(templateId, layerDirs) {
140
- return layerDirs.flatMap((layerDir) => {
141
- if (fs.existsSync(layerDir)) {
142
- return [layerDir];
141
+ async function resolveMaterializedTemplateLayerDirs(templateId, layerDirs) {
142
+ const materializedLayerDirs = [];
143
+ for (const layerDir of layerDirs) {
144
+ if (await pathExists(layerDir)) {
145
+ materializedLayerDirs.push(layerDir);
146
+ continue;
143
147
  }
144
148
  if (isOmittableBuiltInTemplateLayerDir(templateId, layerDir)) {
145
- return [];
149
+ continue;
146
150
  }
147
151
  throw new Error(`Built-in template layer is missing: ${layerDir}`);
148
- });
152
+ }
153
+ return materializedLayerDirs;
149
154
  }
150
155
  async function materializeBuiltInTemplateSource(templateId, layerDirs) {
151
156
  const template = getTemplateById(templateId);
152
- const materializedLayerDirs = resolveMaterializedTemplateLayerDirs(templateId, layerDirs);
157
+ const materializedLayerDirs = await resolveMaterializedTemplateLayerDirs(templateId, layerDirs);
153
158
  const { path: tempRoot, cleanup } = await createManagedTempRoot("wp-typia-template-");
154
159
  const templateDir = path.join(tempRoot, templateId);
155
160
  try {
@@ -183,4 +188,4 @@ async function resolveBuiltInTemplateSource(templateId, options = {}) {
183
188
 
184
189
  export { isBuiltInSharedTemplateLayerId, getBuiltInSharedTemplateLayerDir, getBuiltInTemplateOverlayDir, getBuiltInTemplateSharedLayerDirs, getBuiltInTemplateLayerDirs, isOmittableBuiltInTemplateLayerDir, resolveBuiltInTemplateSourceFromLayerDirs, resolveBuiltInTemplateSource };
185
190
 
186
- //# debugId=B05DD72780E5C06E64756E2164756E21
191
+ //# debugId=ABC45C8693C7267064756E2164756E21
@@ -14,7 +14,7 @@ import {
14
14
  // package.json
15
15
  var package_default = {
16
16
  name: "wp-typia",
17
- version: "0.22.7",
17
+ version: "0.22.9",
18
18
  description: "Canonical CLI package for wp-typia scaffolding and project workflows",
19
19
  packageManager: "bun@1.3.11",
20
20
  type: "module",
@@ -84,7 +84,7 @@ var package_default = {
84
84
  "@bunli/tui": "0.6.0",
85
85
  "@bunli/utils": "0.6.0",
86
86
  "@wp-typia/api-client": "^0.4.5",
87
- "@wp-typia/project-tools": "0.22.7",
87
+ "@wp-typia/project-tools": "0.22.9",
88
88
  "better-result": "^2.7.0",
89
89
  react: "^19.2.5",
90
90
  "react-dom": "^19.2.5",
@@ -1006,4 +1006,4 @@ function createPlugin(input) {
1006
1006
  }
1007
1007
  export { createPlugin, package_default, collectPositionalIndexes, findFirstPositionalIndex, CREATE_OPTION_METADATA, ADD_OPTION_METADATA, INIT_OPTION_METADATA, MIGRATE_OPTION_METADATA, MCP_OPTION_METADATA, SYNC_OPTION_METADATA, DOCTOR_OPTION_METADATA, TEMPLATES_OPTION_METADATA, GLOBAL_OPTION_METADATA, COMMAND_OPTION_METADATA_BY_GROUP, ALL_COMMAND_OPTION_METADATA, buildCommandOptions, collectOptionNamesByType, buildCommandOptionParser, COMMAND_ROUTING_METADATA, createMissingOptionValueError, extractKnownOptionValuesFromArgv, resolveCommandOptionValues, normalizeCliOutputFormatArgv, validateCliOutputFormatArgv, prefersStructuredCliOutput, emitCliDiagnosticFailure, writeStructuredCliDiagnosticError, WP_TYPIA_CANONICAL_CREATE_USAGE, WP_TYPIA_RESERVED_TOP_LEVEL_COMMAND_NAMES, WP_TYPIA_TOP_LEVEL_COMMAND_NAMES, WP_TYPIA_COMMAND_OPTION_GROUP_NAMES_BY_TOP_LEVEL_COMMAND, WP_TYPIA_CONFIG_SOURCES, mergeWpTypiaUserConfig, loadWpTypiaUserConfigFromSource, loadWpTypiaUserConfig, getCreateDefaults, getAddBlockDefaults, getMcpSchemaSources };
1008
1008
 
1009
- //# debugId=8CED1A44380ADAE964756E2164756E21
1009
+ //# debugId=F6927CCEB588B12864756E2164756E21
package/dist-bunli/cli.js CHANGED
@@ -22,7 +22,7 @@ import {
22
22
  package_default,
23
23
  validateCliOutputFormatArgv,
24
24
  writeStructuredCliDiagnosticError
25
- } from "./cli-cjygr56g.js";
25
+ } from "./cli-y934dq2k.js";
26
26
  import"./cli-03j0axbt.js";
27
27
  import {
28
28
  GLOBAL_FLAGS,
@@ -38,7 +38,10 @@ import {
38
38
  import"./cli-ac2ebaf8.js";
39
39
  import"./cli-6v0pcxw6.js";
40
40
  import"./cli-fys8vm2t.js";
41
- import"./cli-p95wr1q8.js";
41
+ import {
42
+ CLI_DIAGNOSTIC_CODES,
43
+ createCliDiagnosticCodeError
44
+ } from "./cli-p95wr1q8.js";
42
45
  import {
43
46
  __require
44
47
  } from "./cli-xnn9xjcy.js";
@@ -2337,10 +2340,10 @@ function looksLikeStructuredProjectInput(value) {
2337
2340
  function assertPositionalAliasProjectDir(projectDir) {
2338
2341
  const normalizedProjectDir = path.normalize(projectDir).replace(/[\\/]+$/u, "") || path.normalize(projectDir);
2339
2342
  if (normalizedProjectDir === "." || normalizedProjectDir === "..") {
2340
- throw new Error(`The positional alias does not scaffold into \`${projectDir}\`. Use \`${WP_TYPIA_CANONICAL_CREATE_USAGE}\` with an explicit child directory instead.`);
2343
+ throw createCliDiagnosticCodeError(CLI_DIAGNOSTIC_CODES.INVALID_ARGUMENT, `The positional alias does not scaffold into \`${projectDir}\`. Use \`${WP_TYPIA_CANONICAL_CREATE_USAGE}\` with an explicit child directory instead.`);
2341
2344
  }
2342
2345
  if (looksLikeStructuredProjectInput(projectDir)) {
2343
- throw new Error(`The positional alias only accepts unambiguous local project directories. Use \`${WP_TYPIA_CANONICAL_CREATE_USAGE}\` for \`${projectDir}\`.`);
2346
+ throw createCliDiagnosticCodeError(CLI_DIAGNOSTIC_CODES.INVALID_ARGUMENT, `The positional alias only accepts unambiguous local project directories. Use \`${WP_TYPIA_CANONICAL_CREATE_USAGE}\` for \`${projectDir}\`.`);
2344
2347
  }
2345
2348
  }
2346
2349
  function normalizeWpTypiaArgv(argv) {
@@ -2354,7 +2357,7 @@ function normalizeWpTypiaArgv(argv) {
2354
2357
  return argv;
2355
2358
  }
2356
2359
  if (firstPositional === "migrations") {
2357
- throw new Error("`wp-typia migrations` was removed in favor of `wp-typia migrate`. Use `wp-typia migrate <subcommand>` instead.");
2360
+ throw createCliDiagnosticCodeError(CLI_DIAGNOSTIC_CODES.INVALID_ARGUMENT, "`wp-typia migrations` was removed in favor of `wp-typia migrate`. Use `wp-typia migrate <subcommand>` instead.");
2358
2361
  }
2359
2362
  if (isReservedTopLevelCommandName(firstPositional)) {
2360
2363
  assertStringOptionValues(argv);
@@ -2362,7 +2365,7 @@ function normalizeWpTypiaArgv(argv) {
2362
2365
  }
2363
2366
  if (positionalIndexes.length > 1) {
2364
2367
  const extraPositionals = positionalIndexes.slice(1).map((index) => argv[index]).filter((value) => typeof value === "string" && value.length > 0);
2365
- throw new Error(`The positional alias only accepts a single project directory. Use \`${WP_TYPIA_CANONICAL_CREATE_USAGE}\` for scaffold invocations with additional positional arguments, or check the command spelling if you meant another top-level command. Extra positional arguments: ${extraPositionals.map((value) => `\`${value}\``).join(", ")}.`);
2368
+ throw createCliDiagnosticCodeError(CLI_DIAGNOSTIC_CODES.INVALID_ARGUMENT, `The positional alias only accepts a single project directory. Use \`${WP_TYPIA_CANONICAL_CREATE_USAGE}\` for scaffold invocations with additional positional arguments, or check the command spelling if you meant another top-level command. Extra positional arguments: ${extraPositionals.map((value) => `\`${value}\``).join(", ")}.`);
2366
2369
  }
2367
2370
  assertPositionalAliasProjectDir(firstPositional);
2368
2371
  const normalizedArgv = [
@@ -2457,7 +2460,7 @@ async function formatCliError(error) {
2457
2460
  }
2458
2461
  async function createWpTypiaCli(options = {}) {
2459
2462
  applyStandaloneSupportLayoutEnv();
2460
- const { wpTypiaCommands } = await import("./command-list-6zr1tj96.js");
2463
+ const { wpTypiaCommands } = await import("./command-list-g3qhb3y4.js");
2461
2464
  const cli = await createCLI({
2462
2465
  ...bunliConfig,
2463
2466
  description: package_default.description,
@@ -2517,4 +2520,4 @@ export {
2517
2520
  createWpTypiaCli
2518
2521
  };
2519
2522
 
2520
- //# debugId=8055E7CFBE8C705564756E2164756E21
2523
+ //# debugId=C2A72BC9D07456AF64756E2164756E21