wp-typia 0.22.8 → 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.
@@ -1,4 +1,7 @@
1
1
  // @bun
2
+ import {
3
+ suggestCloseId
4
+ } from "./cli-cvxvcw7c.js";
2
5
  import {
3
6
  CLI_DIAGNOSTIC_CODES,
4
7
  createCliDiagnosticCodeError
@@ -170943,6 +170946,9 @@ var ADD_BLOCK_TEMPLATE_IDS = [
170943
170946
  "persistence",
170944
170947
  "compound"
170945
170948
  ];
170949
+ function suggestAddBlockTemplateId(templateId) {
170950
+ return suggestCloseId(templateId, ADD_BLOCK_TEMPLATE_IDS);
170951
+ }
170946
170952
 
170947
170953
  // ../wp-typia-project-tools/src/runtime/hooked-blocks.ts
170948
170954
  var HOOKED_BLOCK_POSITION_IDS = ["before", "after", "firstChild", "lastChild"];
@@ -171098,6 +171104,33 @@ function assertValidEditorPluginSlot(slot = "sidebar") {
171098
171104
  throw new Error(`Editor plugin slot must be one of: ${EDITOR_PLUGIN_SLOT_IDS.join(", ")}. Legacy aliases: PluginSidebar, PluginDocumentSettingPanel.`);
171099
171105
  }
171100
171106
 
171107
+ // ../wp-typia-project-tools/src/runtime/fs-async.ts
171108
+ import { promises as fsp } from "fs";
171109
+ async function pathExists(filePath) {
171110
+ try {
171111
+ await fsp.access(filePath);
171112
+ return true;
171113
+ } catch {
171114
+ return false;
171115
+ }
171116
+ }
171117
+ async function readOptionalUtf8File(filePath) {
171118
+ try {
171119
+ return await fsp.readFile(filePath, "utf8");
171120
+ } catch (error) {
171121
+ if (isFileNotFoundError(error)) {
171122
+ return null;
171123
+ }
171124
+ throw error;
171125
+ }
171126
+ }
171127
+ function getNodeErrorCode(error) {
171128
+ return typeof error === "object" && error !== null && "code" in error ? String(error.code) : "";
171129
+ }
171130
+ function isFileNotFoundError(error) {
171131
+ return getNodeErrorCode(error) === "ENOENT";
171132
+ }
171133
+
171101
171134
  // ../wp-typia-project-tools/src/runtime/cli-add-help.ts
171102
171135
  function formatAddHelpText() {
171103
171136
  return `Usage:
@@ -171213,24 +171246,24 @@ function resolveScaffoldIdentifiers({
171213
171246
  };
171214
171247
  }
171215
171248
  // ../wp-typia-project-tools/src/runtime/cli-add-filesystem.ts
171216
- import { promises as fsp } from "fs";
171249
+ import { promises as fsp2 } from "fs";
171217
171250
  import path from "path";
171218
171251
  function getWorkspaceBootstrapPath(workspace) {
171219
171252
  const workspaceBaseName = workspace.packageName.split("/").pop() ?? workspace.packageName;
171220
171253
  return path.join(workspace.projectDir, `${workspaceBaseName}.php`);
171221
171254
  }
171222
171255
  async function patchFile(filePath, transform) {
171223
- const currentSource = await fsp.readFile(filePath, "utf8");
171256
+ const currentSource = await fsp2.readFile(filePath, "utf8");
171224
171257
  const nextSource = transform(currentSource);
171225
171258
  if (nextSource !== currentSource) {
171226
- await fsp.writeFile(filePath, nextSource, "utf8");
171259
+ await fsp2.writeFile(filePath, nextSource, "utf8");
171227
171260
  }
171228
171261
  }
171229
171262
  async function readOptionalFile(filePath) {
171230
171263
  try {
171231
- return await fsp.readFile(filePath, "utf8");
171264
+ return await fsp2.readFile(filePath, "utf8");
171232
171265
  } catch (error) {
171233
- if (isFileNotFoundError(error)) {
171266
+ if (isFileNotFoundError2(error)) {
171234
171267
  return null;
171235
171268
  }
171236
171269
  throw error;
@@ -171238,11 +171271,11 @@ async function readOptionalFile(filePath) {
171238
171271
  }
171239
171272
  async function restoreOptionalFile(filePath, source) {
171240
171273
  if (source === null) {
171241
- await fsp.rm(filePath, { force: true });
171274
+ await fsp2.rm(filePath, { force: true });
171242
171275
  return;
171243
171276
  }
171244
- await fsp.mkdir(path.dirname(filePath), { recursive: true });
171245
- await fsp.writeFile(filePath, source, "utf8");
171277
+ await fsp2.mkdir(path.dirname(filePath), { recursive: true });
171278
+ await fsp2.writeFile(filePath, source, "utf8");
171246
171279
  }
171247
171280
  async function snapshotWorkspaceFiles(filePaths) {
171248
171281
  const uniquePaths = Array.from(new Set(filePaths));
@@ -171253,50 +171286,21 @@ async function snapshotWorkspaceFiles(filePaths) {
171253
171286
  }
171254
171287
  async function rollbackWorkspaceMutation(snapshot) {
171255
171288
  for (const targetPath of snapshot.targetPaths) {
171256
- await fsp.rm(targetPath, { force: true, recursive: true });
171289
+ await fsp2.rm(targetPath, { force: true, recursive: true });
171257
171290
  }
171258
171291
  for (const snapshotDir of snapshot.snapshotDirs) {
171259
- await fsp.rm(snapshotDir, { force: true, recursive: true });
171292
+ await fsp2.rm(snapshotDir, { force: true, recursive: true });
171260
171293
  }
171261
171294
  for (const { filePath, source } of snapshot.fileSources) {
171262
171295
  await restoreOptionalFile(filePath, source);
171263
171296
  }
171264
171297
  }
171265
- function isFileNotFoundError(error) {
171298
+ function isFileNotFoundError2(error) {
171266
171299
  return typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT";
171267
171300
  }
171268
171301
  // ../wp-typia-project-tools/src/runtime/cli-add-block-json.ts
171269
171302
  import path2 from "path";
171270
171303
  import { parseScaffoldBlockMetadata } from "@wp-typia/block-runtime/blocks";
171271
-
171272
- // ../wp-typia-project-tools/src/runtime/fs-async.ts
171273
- import { promises as fsp2 } from "fs";
171274
- async function pathExists(filePath) {
171275
- try {
171276
- await fsp2.access(filePath);
171277
- return true;
171278
- } catch {
171279
- return false;
171280
- }
171281
- }
171282
- async function readOptionalUtf8File(filePath) {
171283
- try {
171284
- return await fsp2.readFile(filePath, "utf8");
171285
- } catch (error) {
171286
- if (isFileNotFoundError2(error)) {
171287
- return null;
171288
- }
171289
- throw error;
171290
- }
171291
- }
171292
- function getNodeErrorCode(error) {
171293
- return typeof error === "object" && error !== null && "code" in error ? String(error.code) : "";
171294
- }
171295
- function isFileNotFoundError2(error) {
171296
- return getNodeErrorCode(error) === "ENOENT";
171297
- }
171298
-
171299
- // ../wp-typia-project-tools/src/runtime/cli-add-block-json.ts
171300
171304
  function resolveWorkspaceBlock(inventory, blockSlug) {
171301
171305
  const block = inventory.blocks.find((entry) => entry.slug === blockSlug);
171302
171306
  if (!block) {
@@ -171973,8 +171977,8 @@ function getPropertyNameText(name) {
171973
171977
  }
171974
171978
 
171975
171979
  // ../wp-typia-project-tools/src/runtime/workspace-inventory.ts
171976
- function defineInventoryEntryParser(descriptor) {
171977
- return descriptor;
171980
+ function defineInventoryEntryParser() {
171981
+ return (descriptor) => descriptor;
171978
171982
  }
171979
171983
  var BLOCK_CONFIG_ENTRY_MARKER = "\t// wp-typia add block entries";
171980
171984
  var VARIATION_CONFIG_ENTRY_MARKER = "\t// wp-typia add variation entries";
@@ -172178,7 +172182,7 @@ var BLOCK_INVENTORY_SECTION = {
172178
172182
  },
172179
172183
  parse: {
172180
172184
  entriesKey: "blocks",
172181
- entry: defineInventoryEntryParser({
172185
+ entry: defineInventoryEntryParser()({
172182
172186
  entryName: "BLOCKS",
172183
172187
  fields: [
172184
172188
  { key: "apiTypesFile" },
@@ -172204,7 +172208,7 @@ var INVENTORY_SECTIONS = [
172204
172208
  },
172205
172209
  parse: {
172206
172210
  entriesKey: "variations",
172207
- entry: defineInventoryEntryParser({
172211
+ entry: defineInventoryEntryParser()({
172208
172212
  entryName: "VARIATIONS",
172209
172213
  fields: [
172210
172214
  { key: "block", required: true },
@@ -172230,7 +172234,7 @@ var INVENTORY_SECTIONS = [
172230
172234
  },
172231
172235
  parse: {
172232
172236
  entriesKey: "blockStyles",
172233
- entry: defineInventoryEntryParser({
172237
+ entry: defineInventoryEntryParser()({
172234
172238
  entryName: "BLOCK_STYLES",
172235
172239
  fields: [
172236
172240
  { key: "block", required: true },
@@ -172256,7 +172260,7 @@ var INVENTORY_SECTIONS = [
172256
172260
  },
172257
172261
  parse: {
172258
172262
  entriesKey: "blockTransforms",
172259
- entry: defineInventoryEntryParser({
172263
+ entry: defineInventoryEntryParser()({
172260
172264
  entryName: "BLOCK_TRANSFORMS",
172261
172265
  fields: [
172262
172266
  { key: "block", required: true },
@@ -172284,7 +172288,7 @@ var INVENTORY_SECTIONS = [
172284
172288
  },
172285
172289
  parse: {
172286
172290
  entriesKey: "patterns",
172287
- entry: defineInventoryEntryParser({
172291
+ entry: defineInventoryEntryParser()({
172288
172292
  entryName: "PATTERNS",
172289
172293
  fields: [
172290
172294
  { key: "file", required: true },
@@ -172309,7 +172313,7 @@ var INVENTORY_SECTIONS = [
172309
172313
  },
172310
172314
  parse: {
172311
172315
  entriesKey: "bindingSources",
172312
- entry: defineInventoryEntryParser({
172316
+ entry: defineInventoryEntryParser()({
172313
172317
  entryName: "BINDING_SOURCES",
172314
172318
  fields: [
172315
172319
  { key: "attribute" },
@@ -172337,7 +172341,7 @@ var INVENTORY_SECTIONS = [
172337
172341
  },
172338
172342
  parse: {
172339
172343
  entriesKey: "restResources",
172340
- entry: defineInventoryEntryParser({
172344
+ entry: defineInventoryEntryParser()({
172341
172345
  entryName: "REST_RESOURCES",
172342
172346
  fields: [
172343
172347
  { key: "apiFile", required: true },
@@ -172381,7 +172385,7 @@ var INVENTORY_SECTIONS = [
172381
172385
  },
172382
172386
  parse: {
172383
172387
  entriesKey: "abilities",
172384
- entry: defineInventoryEntryParser({
172388
+ entry: defineInventoryEntryParser()({
172385
172389
  entryName: "ABILITIES",
172386
172390
  fields: [
172387
172391
  { key: "clientFile", required: true },
@@ -172414,7 +172418,7 @@ var INVENTORY_SECTIONS = [
172414
172418
  },
172415
172419
  parse: {
172416
172420
  entriesKey: "aiFeatures",
172417
- entry: defineInventoryEntryParser({
172421
+ entry: defineInventoryEntryParser()({
172418
172422
  entryName: "AI_FEATURES",
172419
172423
  fields: [
172420
172424
  { key: "aiSchemaFile", required: true },
@@ -172447,7 +172451,7 @@ var INVENTORY_SECTIONS = [
172447
172451
  },
172448
172452
  parse: {
172449
172453
  entriesKey: "adminViews",
172450
- entry: defineInventoryEntryParser({
172454
+ entry: defineInventoryEntryParser()({
172451
172455
  entryName: "ADMIN_VIEWS",
172452
172456
  fields: [
172453
172457
  { key: "file", required: true },
@@ -172474,7 +172478,7 @@ var INVENTORY_SECTIONS = [
172474
172478
  },
172475
172479
  parse: {
172476
172480
  entriesKey: "editorPlugins",
172477
- entry: defineInventoryEntryParser({
172481
+ entry: defineInventoryEntryParser()({
172478
172482
  entryName: "EDITOR_PLUGINS",
172479
172483
  fields: [
172480
172484
  { key: "file", required: true },
@@ -172535,14 +172539,7 @@ function getOptionalStringProperty(entryName, elementIndex, objectLiteral, key)
172535
172539
  }
172536
172540
  return;
172537
172541
  }
172538
- function getRequiredStringProperty(entryName, elementIndex, objectLiteral, key) {
172539
- const value = getOptionalStringProperty(entryName, elementIndex, objectLiteral, key);
172540
- if (!value) {
172541
- throw new Error(`${entryName}[${elementIndex}] is missing required "${key}" in scripts/block-config.ts.`);
172542
- }
172543
- return value;
172544
- }
172545
- function getRequiredStringArrayProperty(entryName, elementIndex, objectLiteral, key) {
172542
+ function getOptionalStringArrayProperty(entryName, elementIndex, objectLiteral, key) {
172546
172543
  for (const property of objectLiteral.properties) {
172547
172544
  if (!import_typescript2.default.isPropertyAssignment(property)) {
172548
172545
  continue;
@@ -172561,7 +172558,19 @@ function getRequiredStringArrayProperty(entryName, elementIndex, objectLiteral,
172561
172558
  return element.text;
172562
172559
  });
172563
172560
  }
172564
- throw new Error(`${entryName}[${elementIndex}] is missing required "${key}" in scripts/block-config.ts.`);
172561
+ return;
172562
+ }
172563
+ function isMissingRequiredInventoryValue(value) {
172564
+ return value === undefined || typeof value === "string" && value.length === 0;
172565
+ }
172566
+ function formatMissingRequiredInventoryFields(keys) {
172567
+ return keys.length === 1 ? `required "${keys[0]}"` : `required fields ${keys.map((key) => `"${key}"`).join(", ")}`;
172568
+ }
172569
+ function assertParsedInventoryEntry(entry, descriptor, elementIndex) {
172570
+ const missingRequiredKeys = descriptor.fields.filter((field) => field.required === true && isMissingRequiredInventoryValue(entry[field.key])).map((field) => field.key);
172571
+ if (missingRequiredKeys.length > 0) {
172572
+ throw new Error(`${descriptor.entryName}[${elementIndex}] is missing ${formatMissingRequiredInventoryFields(missingRequiredKeys)} in scripts/block-config.ts.`);
172573
+ }
172565
172574
  }
172566
172575
  function parseInventoryEntries(arrayLiteral, descriptor) {
172567
172576
  return arrayLiteral.elements.map((element, elementIndex) => {
@@ -172571,7 +172580,7 @@ function parseInventoryEntries(arrayLiteral, descriptor) {
172571
172580
  const entry = {};
172572
172581
  for (const field of descriptor.fields) {
172573
172582
  const kind = field.kind ?? "string";
172574
- const value = kind === "stringArray" ? getRequiredStringArrayProperty(descriptor.entryName, elementIndex, element, field.key) : field.required ? getRequiredStringProperty(descriptor.entryName, elementIndex, element, field.key) : getOptionalStringProperty(descriptor.entryName, elementIndex, element, field.key);
172583
+ const value = kind === "stringArray" ? getOptionalStringArrayProperty(descriptor.entryName, elementIndex, element, field.key) : getOptionalStringProperty(descriptor.entryName, elementIndex, element, field.key);
172575
172584
  field.validate?.(value, {
172576
172585
  elementIndex,
172577
172586
  entryName: descriptor.entryName,
@@ -172579,6 +172588,7 @@ function parseInventoryEntries(arrayLiteral, descriptor) {
172579
172588
  });
172580
172589
  entry[field.key] = value;
172581
172590
  }
172591
+ assertParsedInventoryEntry(entry, descriptor, elementIndex);
172582
172592
  return entry;
172583
172593
  });
172584
172594
  }
@@ -172685,13 +172695,19 @@ async function readWorkspaceInventoryAsync(projectDir) {
172685
172695
  ...parseWorkspaceInventorySource(source)
172686
172696
  };
172687
172697
  }
172688
- function getWorkspaceBlockSelectOptions(projectDir) {
172689
- return readWorkspaceInventory(projectDir).blocks.map((block) => ({
172698
+ function toWorkspaceBlockSelectOptions(blocks) {
172699
+ return blocks.map((block) => ({
172690
172700
  description: block.typesFile,
172691
172701
  name: block.slug,
172692
172702
  value: block.slug
172693
172703
  }));
172694
172704
  }
172705
+ function getWorkspaceBlockSelectOptions(projectDir) {
172706
+ return toWorkspaceBlockSelectOptions(readWorkspaceInventory(projectDir).blocks);
172707
+ }
172708
+ async function getWorkspaceBlockSelectOptionsAsync(projectDir) {
172709
+ return toWorkspaceBlockSelectOptions((await readWorkspaceInventoryAsync(projectDir)).blocks);
172710
+ }
172695
172711
  function ensureWorkspaceInventorySections(source) {
172696
172712
  let nextSource = source.trimEnd();
172697
172713
  for (const section of INVENTORY_SECTIONS) {
@@ -172802,6 +172818,6 @@ async function appendWorkspaceInventoryEntries(projectDir, options) {
172802
172818
  }
172803
172819
  }
172804
172820
 
172805
- export { toKebabCase, toSnakeCase, toPascalCase, toCamelCase, toSegmentPascalCase, toTitleCase, validateBlockSlug, validateNamespace, normalizeBlockSlug, resolveNonEmptyNormalizedBlockSlug, buildBlockCssClassName, buildFrontendCssClassName, resolveScaffoldIdentifiers, REST_RESOURCE_METHOD_IDS, EDITOR_PLUGIN_SLOT_IDS, resolveEditorPluginSlotAlias, ADD_BLOCK_TEMPLATE_IDS, HOOKED_BLOCK_POSITION_SET, HOOKED_BLOCK_ANCHOR_PATTERN, REST_RESOURCE_NAMESPACE_PATTERN, assertValidGeneratedSlug, resolveRestResourceNamespace, assertValidRestResourceMethods, assertValidHookedBlockPosition, buildWorkspacePhpPrefix, isAddBlockTemplateId, quoteTsString, assertValidHookAnchor, assertValidEditorPluginSlot, getWorkspaceBootstrapPath, patchFile, readOptionalFile, snapshotWorkspaceFiles, rollbackWorkspaceMutation, pathExists, readOptionalUtf8File, getNodeErrorCode, resolveWorkspaceBlock, readWorkspaceBlockJson, getMutableBlockHooks, assertVariationDoesNotExist, assertBlockStyleDoesNotExist, assertBlockTransformDoesNotExist, assertPatternDoesNotExist, assertBindingSourceDoesNotExist, assertRestResourceDoesNotExist, assertAdminViewDoesNotExist, assertAbilityDoesNotExist, assertAiFeatureDoesNotExist, assertEditorPluginDoesNotExist, formatAddHelpText, require_typescript, escapeRegex, quotePhpString, hasPhpFunctionDefinition, hasPhpFunctionCall, findPhpFunctionRange, replacePhpFunctionDefinition, getPropertyNameText, readWorkspaceInventory, readWorkspaceInventoryAsync, getWorkspaceBlockSelectOptions, updateWorkspaceInventorySource, appendWorkspaceInventoryEntries };
172821
+ export { toKebabCase, toSnakeCase, toPascalCase, toCamelCase, toSegmentPascalCase, toTitleCase, validateBlockSlug, validateNamespace, normalizeBlockSlug, resolveNonEmptyNormalizedBlockSlug, buildBlockCssClassName, buildFrontendCssClassName, resolveScaffoldIdentifiers, REST_RESOURCE_METHOD_IDS, EDITOR_PLUGIN_SLOT_IDS, resolveEditorPluginSlotAlias, ADD_BLOCK_TEMPLATE_IDS, suggestAddBlockTemplateId, HOOKED_BLOCK_POSITION_SET, HOOKED_BLOCK_ANCHOR_PATTERN, REST_RESOURCE_NAMESPACE_PATTERN, assertValidGeneratedSlug, resolveRestResourceNamespace, assertValidRestResourceMethods, assertValidHookedBlockPosition, buildWorkspacePhpPrefix, isAddBlockTemplateId, quoteTsString, assertValidHookAnchor, assertValidEditorPluginSlot, getWorkspaceBootstrapPath, patchFile, readOptionalFile, snapshotWorkspaceFiles, rollbackWorkspaceMutation, pathExists, readOptionalUtf8File, getNodeErrorCode, resolveWorkspaceBlock, readWorkspaceBlockJson, getMutableBlockHooks, assertVariationDoesNotExist, assertBlockStyleDoesNotExist, assertBlockTransformDoesNotExist, assertPatternDoesNotExist, assertBindingSourceDoesNotExist, assertRestResourceDoesNotExist, assertAdminViewDoesNotExist, assertAbilityDoesNotExist, assertAiFeatureDoesNotExist, assertEditorPluginDoesNotExist, formatAddHelpText, require_typescript, escapeRegex, quotePhpString, hasPhpFunctionDefinition, hasPhpFunctionCall, findPhpFunctionRange, replacePhpFunctionDefinition, getPropertyNameText, readWorkspaceInventory, readWorkspaceInventoryAsync, getWorkspaceBlockSelectOptions, getWorkspaceBlockSelectOptionsAsync, updateWorkspaceInventorySource, appendWorkspaceInventoryEntries };
172806
172822
 
172807
- //# debugId=282F6AFDCE13C26664756E2164756E21
172823
+ //# debugId=3C14848EF1DAC47E64756E2164756E21
@@ -20,18 +20,21 @@ import {
20
20
  resolvePackageManagerId,
21
21
  resolveTemplateId,
22
22
  scaffoldProject
23
- } from "./cli-fa7g1aqm.js";
23
+ } from "./cli-2pnk64h0.js";
24
24
  import"./cli-arz4rcye.js";
25
- import"./cli-mzvzbpnz.js";
26
- import"./cli-bwwssctv.js";
25
+ import"./cli-8reep89s.js";
26
+ import"./cli-ag722tzm.js";
27
27
  import"./cli-2rqf6t0b.js";
28
28
  import"./cli-bq2v559b.js";
29
- import"./cli-pnjx2e2h.js";
29
+ import"./cli-xw1wbxf3.js";
30
30
  import {
31
31
  OFFICIAL_WORKSPACE_TEMPLATE_PACKAGE,
32
32
  isBuiltInTemplateId
33
33
  } from "./cli-qse6myha.js";
34
- import"./cli-bbj0kn1e.js";
34
+ import {
35
+ pathExists
36
+ } from "./cli-regw5384.js";
37
+ import"./cli-cvxvcw7c.js";
35
38
  import {
36
39
  createManagedTempRoot
37
40
  } from "./cli-t73q5aqz.js";
@@ -45,7 +48,6 @@ import {
45
48
  import"./cli-xnn9xjcy.js";
46
49
 
47
50
  // ../wp-typia-project-tools/src/runtime/cli-scaffold.ts
48
- import fs from "fs";
49
51
  import { promises as fsp } from "fs";
50
52
  import path from "path";
51
53
  async function listRelativeProjectFiles(rootDir) {
@@ -65,7 +67,7 @@ async function listRelativeProjectFiles(rootDir) {
65
67
  return relativeFiles.sort((left, right) => left.localeCompare(right));
66
68
  }
67
69
  async function assertDryRunTargetDirectoryReady(projectDir, allowExistingDir) {
68
- if (!fs.existsSync(projectDir) || allowExistingDir) {
70
+ if (!await pathExists(projectDir) || allowExistingDir) {
69
71
  return;
70
72
  }
71
73
  const entries = await fsp.readdir(projectDir);
@@ -510,7 +512,7 @@ async function runScaffoldFlow({
510
512
  let availableScripts;
511
513
  if (!dryRun) {
512
514
  try {
513
- const parsedPackageJson = JSON.parse(fs.readFileSync(path.join(projectDir, "package.json"), "utf8"));
515
+ const parsedPackageJson = JSON.parse(await fsp.readFile(path.join(projectDir, "package.json"), "utf8"));
514
516
  const scripts = parsedPackageJson.scripts && typeof parsedPackageJson.scripts === "object" && !Array.isArray(parsedPackageJson.scripts) ? parsedPackageJson.scripts : {};
515
517
  availableScripts = Object.entries(scripts).filter(([, value]) => typeof value === "string").map(([scriptName]) => scriptName);
516
518
  } catch {
@@ -559,4 +561,4 @@ export {
559
561
  getNextSteps
560
562
  };
561
563
 
562
- //# debugId=8FDC4D734EED3CDC64756E2164756E21
564
+ //# debugId=95A9F724954FBE1164756E2164756E21
@@ -9,12 +9,14 @@ import {
9
9
  SHARED_WORKSPACE_TEMPLATE_ROOT,
10
10
  getTemplateById
11
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.8",
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.8",
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=1B6B6622EAD33E5164756E2164756E21
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-e7n7hbvr.js";
25
+ } from "./cli-y934dq2k.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-hbcv3bz6.js");
2463
+ const { wpTypiaCommands } = await import("./command-list-g3qhb3y4.js");
2464
2464
  const cli = await createCLI({
2465
2465
  ...bunliConfig,
2466
2466
  description: package_default.description,