wp-typia 0.21.0 → 0.22.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/bin/routing-metadata.generated.d.ts +2 -0
- package/bin/routing-metadata.generated.js +20 -0
- package/bin/runtime-routing.d.ts +34 -0
- package/bin/runtime-routing.js +124 -0
- package/bin/wp-typia.js +24 -5
- package/dist-bunli/.bunli/commands.gen.js +849 -183
- package/dist-bunli/{cli-pav309dt.js → cli-1w5vkye4.js} +323 -173
- package/dist-bunli/{cli-syg9qpxw.js → cli-39er8888.js} +8 -2
- package/dist-bunli/{cli-add-93945fc2.js → cli-add-kjhghdqq.js} +534 -40
- package/dist-bunli/{cli-doctor-zsndr5sw.js → cli-doctor-p3jxvn0k.js} +7 -6
- package/dist-bunli/{cli-jfj54qej.js → cli-e623rs7g.js} +1 -1
- package/dist-bunli/{cli-init-6xxc0snz.js → cli-init-djhwr245.js} +2 -2
- package/dist-bunli/{cli-hx88xwr4.js → cli-j180bk07.js} +6 -3
- package/dist-bunli/{cli-9x01fjna.js → cli-ktp869eh.js} +8 -4
- package/dist-bunli/{cli-scaffold-d2vtf740.js → cli-scaffold-376yw891.js} +4 -4
- package/dist-bunli/cli.js +2 -2
- package/dist-bunli/{command-list-p452y8td.js → command-list-jt1a1w7r.js} +36 -11
- package/dist-bunli/{migrations-aj1rv3h8.js → migrations-nwas5bwt.js} +2 -2
- package/dist-bunli/node-cli.js +38 -11
- package/package.json +2 -2
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
escapeRegex,
|
|
17
17
|
readWorkspaceInventory,
|
|
18
18
|
resolveEditorPluginSlotAlias
|
|
19
|
-
} from "./cli-
|
|
19
|
+
} from "./cli-j180bk07.js";
|
|
20
20
|
import"./cli-t73q5aqz.js";
|
|
21
21
|
import {
|
|
22
22
|
CLI_DIAGNOSTIC_CODES,
|
|
@@ -834,11 +834,12 @@ function checkWorkspaceAdminViewConfig(adminView, inventory) {
|
|
|
834
834
|
return createDoctorCheck2(`Admin view config ${adminView.slug}`, "pass", "Admin view uses a replaceable local fetcher");
|
|
835
835
|
}
|
|
836
836
|
const source = adminView.source.trim();
|
|
837
|
-
const
|
|
838
|
-
const
|
|
837
|
+
const restSourceMatch = /^rest-resource:([a-z][a-z0-9-]*)$/u.exec(source);
|
|
838
|
+
const coreDataSourceMatch = /^core-data:(postType|taxonomy)\/([a-z0-9][a-z0-9_-]*)$/u.exec(source);
|
|
839
|
+
const restResourceSlug = restSourceMatch?.[1];
|
|
839
840
|
const restResource = restResourceSlug ? inventory.restResources.find((entry) => entry.slug === restResourceSlug) : undefined;
|
|
840
|
-
const isValid = Boolean(restResource?.methods.includes("list"));
|
|
841
|
-
return createDoctorCheck2(`Admin view config ${adminView.slug}`, isValid ? "pass" : "fail", isValid ? `Admin view source ${source} is list-capable` : "Admin view source must use rest-resource:<slug>
|
|
841
|
+
const isValid = Boolean(restResource?.methods.includes("list")) || Boolean(coreDataSourceMatch);
|
|
842
|
+
return createDoctorCheck2(`Admin view config ${adminView.slug}`, isValid ? "pass" : "fail", isValid ? `Admin view source ${source} is list-capable` : "Admin view source must use rest-resource:<slug> with a list-capable REST resource or core-data:<postType|taxonomy>/<name>");
|
|
842
843
|
}
|
|
843
844
|
function checkWorkspaceAdminViewBootstrap(projectDir, packageName, phpPrefix) {
|
|
844
845
|
const packageBaseName = packageName.split("/").pop() ?? packageName;
|
|
@@ -1120,4 +1121,4 @@ export {
|
|
|
1120
1121
|
getDoctorChecks
|
|
1121
1122
|
};
|
|
1122
1123
|
|
|
1123
|
-
//# debugId=
|
|
1124
|
+
//# debugId=0A56FB55109F0ECC64756E2164756E21
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
getPackageVersions
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-39er8888.js";
|
|
5
5
|
import {
|
|
6
6
|
discoverMigrationInitLayout
|
|
7
7
|
} from "./cli-gcbre1zs.js";
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
snapshotWorkspaceFiles,
|
|
21
21
|
toPascalCase,
|
|
22
22
|
updateWorkspaceInventorySource
|
|
23
|
-
} from "./cli-
|
|
23
|
+
} from "./cli-j180bk07.js";
|
|
24
24
|
import {
|
|
25
25
|
CLI_DIAGNOSTIC_CODES,
|
|
26
26
|
createCliDiagnosticCodeError
|
|
@@ -171298,7 +171298,7 @@ function assertEditorPluginDoesNotExist(projectDir, editorPluginSlug, inventory)
|
|
|
171298
171298
|
}
|
|
171299
171299
|
function formatAddHelpText() {
|
|
171300
171300
|
return `Usage:
|
|
171301
|
-
wp-typia add admin-view <name> [--source <rest-resource:slug>] [--dry-run]
|
|
171301
|
+
wp-typia add admin-view <name> [--source <rest-resource:slug|core-data:kind/name>] [--dry-run]
|
|
171302
171302
|
wp-typia add block <name> [--template <${ADD_BLOCK_TEMPLATE_IDS.join("|")}>] [--external-layer-source <./path|github:owner/repo/path[#ref]|npm-package>] [--external-layer-id <layer-id>] [--inner-blocks-preset <freeform|ordered|horizontal|locked-structure>] [--alternate-render-targets <email,mjml,plain-text>] [--data-storage <post-meta|custom-table>] [--persistence-policy <authenticated|public>] [--dry-run]
|
|
171303
171303
|
wp-typia add variation <name> --block <block-slug> [--dry-run]
|
|
171304
171304
|
wp-typia add style <name> --block <block-slug> [--dry-run]
|
|
@@ -171315,7 +171315,10 @@ Notes:
|
|
|
171315
171315
|
\`wp-typia add\` runs only inside official ${WORKSPACE_TEMPLATE_PACKAGE} workspaces scaffolded via \`wp-typia create <project-dir> --template workspace\`.
|
|
171316
171316
|
Pass \`--dry-run\` to preview the workspace files that would change without writing them.
|
|
171317
171317
|
Interactive add flows let you choose a template when \`--template\` is omitted; non-interactive runs default to \`basic\`.
|
|
171318
|
-
\`add admin-view\` scaffolds an opt-in DataViews-powered WordPress admin screen under \`src/admin-views
|
|
171318
|
+
\`add admin-view\` scaffolds an opt-in DataViews-powered WordPress admin screen under \`src/admin-views/\`.
|
|
171319
|
+
Pass \`--source rest-resource:<slug>\` to reuse a list-capable REST resource.
|
|
171320
|
+
Pass \`--source core-data:postType/post\` or \`--source core-data:taxonomy/category\` to bind a WordPress-owned entity collection.
|
|
171321
|
+
Public installs currently gate this workflow until \`@wp-typia/dataviews\` is published to npm.
|
|
171319
171322
|
\`query-loop\` is a create-time scaffold family. Use \`wp-typia create <project-dir> --template query-loop\` instead of \`wp-typia add block\`.
|
|
171320
171323
|
\`add variation\` targets an existing block slug from \`scripts/block-config.ts\`.
|
|
171321
171324
|
\`add style\` registers a Block Styles option for an existing generated block.
|
|
@@ -172075,4 +172078,4 @@ async function appendWorkspaceInventoryEntries(projectDir, options) {
|
|
|
172075
172078
|
|
|
172076
172079
|
export { HOOKED_BLOCK_POSITION_SET, HOOKED_BLOCK_ANCHOR_PATTERN, toKebabCase, toSnakeCase, toPascalCase, toSegmentPascalCase, toTitleCase, validateBlockSlug, validateNamespace, normalizeBlockSlug, resolveNonEmptyNormalizedBlockSlug, buildBlockCssClassName, buildFrontendCssClassName, resolveScaffoldIdentifiers, ADD_KIND_IDS, REST_RESOURCE_METHOD_IDS, EDITOR_PLUGIN_SLOT_IDS, resolveEditorPluginSlotAlias, ADD_BLOCK_TEMPLATE_IDS, REST_RESOURCE_NAMESPACE_PATTERN, assertValidGeneratedSlug, resolveRestResourceNamespace, assertValidRestResourceMethods, assertValidHookedBlockPosition, getWorkspaceBootstrapPath, buildWorkspacePhpPrefix, isAddBlockTemplateId, quoteTsString, patchFile, readOptionalFile, snapshotWorkspaceFiles, rollbackWorkspaceMutation, resolveWorkspaceBlock, assertValidHookAnchor, assertValidEditorPluginSlot, readWorkspaceBlockJson, getMutableBlockHooks, assertVariationDoesNotExist, assertPatternDoesNotExist, assertBindingSourceDoesNotExist, assertRestResourceDoesNotExist, assertAdminViewDoesNotExist, assertAbilityDoesNotExist, assertAiFeatureDoesNotExist, assertEditorPluginDoesNotExist, formatAddHelpText, require_typescript, escapeRegex, quotePhpString, hasPhpFunctionDefinition, findPhpFunctionRange, replacePhpFunctionDefinition, readWorkspaceInventory, getWorkspaceBlockSelectOptions, updateWorkspaceInventorySource, appendWorkspaceInventoryEntries };
|
|
172077
172080
|
|
|
172078
|
-
//# debugId=
|
|
172081
|
+
//# debugId=7A04762E8A3709A864756E2164756E21
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
// package.json
|
|
12
12
|
var package_default = {
|
|
13
13
|
name: "wp-typia",
|
|
14
|
-
version: "0.
|
|
14
|
+
version: "0.22.0",
|
|
15
15
|
description: "Canonical CLI package for wp-typia scaffolding and project workflows",
|
|
16
16
|
packageManager: "bun@1.3.11",
|
|
17
17
|
type: "module",
|
|
@@ -81,7 +81,7 @@ var package_default = {
|
|
|
81
81
|
"@bunli/tui": "0.6.0",
|
|
82
82
|
"@bunli/utils": "0.6.0",
|
|
83
83
|
"@wp-typia/api-client": "^0.4.5",
|
|
84
|
-
"@wp-typia/project-tools": "0.
|
|
84
|
+
"@wp-typia/project-tools": "0.22.0",
|
|
85
85
|
"better-result": "^2.7.0",
|
|
86
86
|
react: "^19.2.5",
|
|
87
87
|
"react-dom": "^19.2.5",
|
|
@@ -254,7 +254,7 @@ var ADD_OPTION_METADATA = {
|
|
|
254
254
|
type: "string"
|
|
255
255
|
},
|
|
256
256
|
source: {
|
|
257
|
-
description: "Optional data source locator for admin-view workflows, such as rest-resource:products.",
|
|
257
|
+
description: "Optional data source locator for admin-view workflows, such as rest-resource:products or core-data:postType/post.",
|
|
258
258
|
type: "string"
|
|
259
259
|
},
|
|
260
260
|
template: {
|
|
@@ -612,6 +612,7 @@ var WP_TYPIA_COMMAND_REGISTRY = [
|
|
|
612
612
|
{
|
|
613
613
|
commandTree: true,
|
|
614
614
|
description: "Scaffold a new wp-typia project.",
|
|
615
|
+
interactiveRuntime: true,
|
|
615
616
|
name: "create",
|
|
616
617
|
nodeFallback: true,
|
|
617
618
|
optionGroups: ["create"],
|
|
@@ -637,6 +638,7 @@ var WP_TYPIA_COMMAND_REGISTRY = [
|
|
|
637
638
|
{
|
|
638
639
|
commandTree: true,
|
|
639
640
|
description: "Extend an official wp-typia workspace.",
|
|
641
|
+
interactiveRuntime: true,
|
|
640
642
|
name: "add",
|
|
641
643
|
nodeFallback: true,
|
|
642
644
|
optionGroups: ["add"],
|
|
@@ -656,6 +658,7 @@ var WP_TYPIA_COMMAND_REGISTRY = [
|
|
|
656
658
|
{
|
|
657
659
|
commandTree: true,
|
|
658
660
|
description: "Run migration workflows.",
|
|
661
|
+
interactiveRuntime: true,
|
|
659
662
|
name: "migrate",
|
|
660
663
|
nodeFallback: true,
|
|
661
664
|
optionGroups: ["migrate"],
|
|
@@ -737,6 +740,7 @@ var WP_TYPIA_COMMAND_REGISTRY = [
|
|
|
737
740
|
];
|
|
738
741
|
var WP_TYPIA_RESERVED_TOP_LEVEL_COMMAND_NAMES = WP_TYPIA_COMMAND_REGISTRY.map((command) => command.name);
|
|
739
742
|
var WP_TYPIA_NODE_FALLBACK_TOP_LEVEL_COMMAND_NAMES = WP_TYPIA_COMMAND_REGISTRY.filter((command) => command.nodeFallback).map((command) => command.name);
|
|
743
|
+
var WP_TYPIA_INTERACTIVE_RUNTIME_TOP_LEVEL_COMMAND_NAMES = WP_TYPIA_COMMAND_REGISTRY.filter((command) => ("interactiveRuntime" in command) && command.interactiveRuntime).map((command) => command.name);
|
|
740
744
|
var WP_TYPIA_TOP_LEVEL_COMMAND_NAMES = WP_TYPIA_COMMAND_REGISTRY.filter((command) => command.commandTree).map((command) => command.name);
|
|
741
745
|
var WP_TYPIA_BUN_REQUIRED_TOP_LEVEL_COMMAND_NAMES = WP_TYPIA_COMMAND_REGISTRY.filter((command) => command.requiresBunRuntime).map((command) => command.name);
|
|
742
746
|
var WP_TYPIA_FUTURE_COMMAND_TREE = WP_TYPIA_COMMAND_REGISTRY.filter((command) => command.commandTree).map((command) => ({
|
|
@@ -837,4 +841,4 @@ function createPlugin(input) {
|
|
|
837
841
|
}
|
|
838
842
|
export { createPlugin, package_default, CREATE_OPTION_METADATA, ADD_OPTION_METADATA, INIT_OPTION_METADATA, MIGRATE_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, extractKnownOptionValuesFromArgv, resolveCommandOptionValues, collectPositionalIndexes, findFirstPositionalIndex, 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 };
|
|
839
843
|
|
|
840
|
-
//# debugId=
|
|
844
|
+
//# debugId=A6461030E7B0624164756E2164756E21
|
|
@@ -19,9 +19,9 @@ import {
|
|
|
19
19
|
resolvePackageManagerId,
|
|
20
20
|
resolveTemplateId,
|
|
21
21
|
scaffoldProject
|
|
22
|
-
} from "./cli-
|
|
23
|
-
import"./cli-
|
|
24
|
-
import"./cli-
|
|
22
|
+
} from "./cli-1w5vkye4.js";
|
|
23
|
+
import"./cli-39er8888.js";
|
|
24
|
+
import"./cli-e623rs7g.js";
|
|
25
25
|
import"./cli-gcbre1zs.js";
|
|
26
26
|
import"./cli-bq2v559b.js";
|
|
27
27
|
import {
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
OFFICIAL_WORKSPACE_TEMPLATE_PACKAGE,
|
|
34
34
|
isBuiltInTemplateId
|
|
35
35
|
} from "./cli-tke8twkn.js";
|
|
36
|
-
import"./cli-
|
|
36
|
+
import"./cli-j180bk07.js";
|
|
37
37
|
import {
|
|
38
38
|
createManagedTempRoot
|
|
39
39
|
} from "./cli-t73q5aqz.js";
|
package/dist-bunli/cli.js
CHANGED
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
mergeWpTypiaUserConfig,
|
|
20
20
|
package_default,
|
|
21
21
|
writeStructuredCliDiagnosticError
|
|
22
|
-
} from "./cli-
|
|
22
|
+
} from "./cli-ktp869eh.js";
|
|
23
23
|
import"./cli-03j0axbt.js";
|
|
24
24
|
import {
|
|
25
25
|
GLOBAL_FLAGS,
|
|
@@ -2453,7 +2453,7 @@ async function formatCliError(error) {
|
|
|
2453
2453
|
}
|
|
2454
2454
|
async function createWpTypiaCli(options = {}) {
|
|
2455
2455
|
applyStandaloneSupportLayoutEnv();
|
|
2456
|
-
const { wpTypiaCommands } = await import("./command-list-
|
|
2456
|
+
const { wpTypiaCommands } = await import("./command-list-jt1a1w7r.js");
|
|
2457
2457
|
const cli = await createCLI({
|
|
2458
2458
|
...bunliConfig,
|
|
2459
2459
|
description: package_default.description,
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
package_default,
|
|
17
17
|
prefersStructuredCliOutput,
|
|
18
18
|
resolveCommandOptionValues
|
|
19
|
-
} from "./cli-
|
|
19
|
+
} from "./cli-ktp869eh.js";
|
|
20
20
|
import {
|
|
21
21
|
Result,
|
|
22
22
|
TaggedError,
|
|
@@ -132,7 +132,7 @@ var ADD_KIND_REGISTRY = {
|
|
|
132
132
|
description: "Add an opt-in DataViews-powered admin screen",
|
|
133
133
|
nameLabel: "Admin view name",
|
|
134
134
|
async prepareExecution(context) {
|
|
135
|
-
const name = requireAddKindName(context, "`wp-typia add admin-view` requires <name>. Usage: wp-typia add admin-view <name> [--source <rest-resource:slug>].");
|
|
135
|
+
const name = requireAddKindName(context, "`wp-typia add admin-view` requires <name>. Usage: wp-typia add admin-view <name> [--source <rest-resource:slug|core-data:kind/name>].");
|
|
136
136
|
const source = readOptionalStringFlag(context.flags, "source");
|
|
137
137
|
return {
|
|
138
138
|
execute: (cwd) => context.addRuntime.runAddAdminViewCommand({
|
|
@@ -148,7 +148,7 @@ var ADD_KIND_REGISTRY = {
|
|
|
148
148
|
},
|
|
149
149
|
sortOrder: 10,
|
|
150
150
|
supportsDryRun: true,
|
|
151
|
-
usage: "wp-typia add admin-view <name> [--source <rest-resource:slug>] [--dry-run]",
|
|
151
|
+
usage: "wp-typia add admin-view <name> [--source <rest-resource:slug|core-data:kind/name>] [--dry-run]",
|
|
152
152
|
visibleFieldNames: () => ["kind", "name", "source"]
|
|
153
153
|
}),
|
|
154
154
|
"binding-source": defineAddKindRegistryEntry({
|
|
@@ -922,6 +922,31 @@ function buildStructuredCompletionSuccessPayload(command, completion, metadata =
|
|
|
922
922
|
}
|
|
923
923
|
};
|
|
924
924
|
}
|
|
925
|
+
function buildStructuredInitSuccessPayload(plan) {
|
|
926
|
+
const completion = serializeCompletionPayload(buildInitCompletionPayload(plan));
|
|
927
|
+
const files = Array.from(new Set([
|
|
928
|
+
...plan.plannedFiles.map((filePlan) => filePlan.path),
|
|
929
|
+
...plan.commandMode === "preview-only" ? plan.generatedArtifacts : []
|
|
930
|
+
]));
|
|
931
|
+
return {
|
|
932
|
+
ok: true,
|
|
933
|
+
data: {
|
|
934
|
+
command: "init",
|
|
935
|
+
completion,
|
|
936
|
+
detectedLayout: plan.detectedLayout,
|
|
937
|
+
files: toNonEmptyArray(files),
|
|
938
|
+
mode: plan.commandMode === "apply" ? "apply" : "preview",
|
|
939
|
+
nextSteps: toNonEmptyArray(plan.nextSteps),
|
|
940
|
+
packageManager: plan.packageManager,
|
|
941
|
+
plan,
|
|
942
|
+
projectDir: plan.projectDir,
|
|
943
|
+
status: plan.status,
|
|
944
|
+
summary: plan.summary,
|
|
945
|
+
title: completion.title,
|
|
946
|
+
warnings: toNonEmptyArray(plan.notes)
|
|
947
|
+
}
|
|
948
|
+
};
|
|
949
|
+
}
|
|
925
950
|
function formatCreateProgressLine(payload, markerOptions) {
|
|
926
951
|
return formatOutputMarker("progress", `${payload.title}: ${payload.detail}`, markerOptions);
|
|
927
952
|
}
|
|
@@ -1355,14 +1380,14 @@ async function executeSyncCommand({
|
|
|
1355
1380
|
}
|
|
1356
1381
|
|
|
1357
1382
|
// src/runtime-bridge.ts
|
|
1358
|
-
var loadCliAddRuntime = () => import("./cli-add-
|
|
1383
|
+
var loadCliAddRuntime = () => import("./cli-add-kjhghdqq.js");
|
|
1359
1384
|
var loadCliDiagnosticsRuntime = () => import("./cli-diagnostics-5dvztm7q.js");
|
|
1360
|
-
var loadCliDoctorRuntime = () => import("./cli-doctor-
|
|
1361
|
-
var loadCliInitRuntime = () => import("./cli-init-
|
|
1385
|
+
var loadCliDoctorRuntime = () => import("./cli-doctor-p3jxvn0k.js");
|
|
1386
|
+
var loadCliInitRuntime = () => import("./cli-init-djhwr245.js");
|
|
1362
1387
|
var loadCliPromptRuntime = () => import("./cli-prompt-614tq57c.js");
|
|
1363
|
-
var loadCliScaffoldRuntime = () => import("./cli-scaffold-
|
|
1388
|
+
var loadCliScaffoldRuntime = () => import("./cli-scaffold-376yw891.js");
|
|
1364
1389
|
var loadCliTemplatesRuntime = () => import("./cli-templates-9t2a7zqd.js");
|
|
1365
|
-
var loadMigrationsRuntime = () => import("./migrations-
|
|
1390
|
+
var loadMigrationsRuntime = () => import("./migrations-nwas5bwt.js");
|
|
1366
1391
|
async function wrapCliCommandError(command, error) {
|
|
1367
1392
|
const { createCliCommandError } = await loadCliDiagnosticsRuntime();
|
|
1368
1393
|
return createCliCommandError({ command, error });
|
|
@@ -2321,7 +2346,7 @@ var doctorCommand = defineCommand({
|
|
|
2321
2346
|
const prefersStructuredOutput = prefersStructuredCliOutput(args);
|
|
2322
2347
|
if (prefersStructuredOutput) {
|
|
2323
2348
|
const [{ getDoctorChecks }, { getDoctorFailureDetailLines }] = await Promise.all([
|
|
2324
|
-
import("./cli-doctor-
|
|
2349
|
+
import("./cli-doctor-p3jxvn0k.js"),
|
|
2325
2350
|
import("./cli-diagnostics-5dvztm7q.js")
|
|
2326
2351
|
]);
|
|
2327
2352
|
const checks = await getDoctorChecks(args.cwd);
|
|
@@ -2365,7 +2390,7 @@ var initCommand = defineCommand({
|
|
|
2365
2390
|
projectDir: args.positional[0]
|
|
2366
2391
|
}, { emitOutput: !prefersStructuredOutput });
|
|
2367
2392
|
if (prefersStructuredOutput) {
|
|
2368
|
-
args.output(
|
|
2393
|
+
args.output(buildStructuredInitSuccessPayload(plan));
|
|
2369
2394
|
}
|
|
2370
2395
|
} catch (error) {
|
|
2371
2396
|
emitCliDiagnosticFailure(args, {
|
|
@@ -3190,4 +3215,4 @@ export {
|
|
|
3190
3215
|
wpTypiaCommands
|
|
3191
3216
|
};
|
|
3192
3217
|
|
|
3193
|
-
//# debugId=
|
|
3218
|
+
//# debugId=45C7A2D5B9B34F8064756E2164756E21
|
|
@@ -15,11 +15,11 @@ import {
|
|
|
15
15
|
snapshotProjectVersion,
|
|
16
16
|
verifyProjectMigrations,
|
|
17
17
|
wizardProjectMigrations
|
|
18
|
-
} from "./cli-
|
|
18
|
+
} from "./cli-e623rs7g.js";
|
|
19
19
|
import"./cli-gcbre1zs.js";
|
|
20
20
|
import"./cli-bq2v559b.js";
|
|
21
21
|
import"./cli-sj5mtyzj.js";
|
|
22
|
-
import"./cli-
|
|
22
|
+
import"./cli-j180bk07.js";
|
|
23
23
|
import"./cli-pd5pqgre.js";
|
|
24
24
|
import"./cli-xnn9xjcy.js";
|
|
25
25
|
export {
|
package/dist-bunli/node-cli.js
CHANGED
|
@@ -3,7 +3,7 @@ var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
|
3
3
|
// package.json
|
|
4
4
|
var package_default = {
|
|
5
5
|
name: "wp-typia",
|
|
6
|
-
version: "0.
|
|
6
|
+
version: "0.22.0",
|
|
7
7
|
description: "Canonical CLI package for wp-typia scaffolding and project workflows",
|
|
8
8
|
packageManager: "bun@1.3.11",
|
|
9
9
|
type: "module",
|
|
@@ -73,7 +73,7 @@ var package_default = {
|
|
|
73
73
|
"@bunli/tui": "0.6.0",
|
|
74
74
|
"@bunli/utils": "0.6.0",
|
|
75
75
|
"@wp-typia/api-client": "^0.4.5",
|
|
76
|
-
"@wp-typia/project-tools": "0.
|
|
76
|
+
"@wp-typia/project-tools": "0.22.0",
|
|
77
77
|
"better-result": "^2.7.0",
|
|
78
78
|
react: "^19.2.5",
|
|
79
79
|
"react-dom": "^19.2.5",
|
|
@@ -256,7 +256,7 @@ var ADD_OPTION_METADATA = {
|
|
|
256
256
|
type: "string"
|
|
257
257
|
},
|
|
258
258
|
source: {
|
|
259
|
-
description: "Optional data source locator for admin-view workflows, such as rest-resource:products.",
|
|
259
|
+
description: "Optional data source locator for admin-view workflows, such as rest-resource:products or core-data:postType/post.",
|
|
260
260
|
type: "string"
|
|
261
261
|
},
|
|
262
262
|
template: {
|
|
@@ -648,7 +648,7 @@ var ADD_KIND_REGISTRY = {
|
|
|
648
648
|
description: "Add an opt-in DataViews-powered admin screen",
|
|
649
649
|
nameLabel: "Admin view name",
|
|
650
650
|
async prepareExecution(context) {
|
|
651
|
-
const name = requireAddKindName(context, "`wp-typia add admin-view` requires <name>. Usage: wp-typia add admin-view <name> [--source <rest-resource:slug>].");
|
|
651
|
+
const name = requireAddKindName(context, "`wp-typia add admin-view` requires <name>. Usage: wp-typia add admin-view <name> [--source <rest-resource:slug|core-data:kind/name>].");
|
|
652
652
|
const source = readOptionalStringFlag(context.flags, "source");
|
|
653
653
|
return {
|
|
654
654
|
execute: (cwd) => context.addRuntime.runAddAdminViewCommand({
|
|
@@ -664,7 +664,7 @@ var ADD_KIND_REGISTRY = {
|
|
|
664
664
|
},
|
|
665
665
|
sortOrder: 10,
|
|
666
666
|
supportsDryRun: true,
|
|
667
|
-
usage: "wp-typia add admin-view <name> [--source <rest-resource:slug>] [--dry-run]",
|
|
667
|
+
usage: "wp-typia add admin-view <name> [--source <rest-resource:slug|core-data:kind/name>] [--dry-run]",
|
|
668
668
|
visibleFieldNames: () => ["kind", "name", "source"]
|
|
669
669
|
}),
|
|
670
670
|
"binding-source": defineAddKindRegistryEntry({
|
|
@@ -1541,6 +1541,31 @@ function buildStructuredCompletionSuccessPayload(command, completion, metadata =
|
|
|
1541
1541
|
}
|
|
1542
1542
|
};
|
|
1543
1543
|
}
|
|
1544
|
+
function buildStructuredInitSuccessPayload(plan) {
|
|
1545
|
+
const completion = serializeCompletionPayload(buildInitCompletionPayload(plan));
|
|
1546
|
+
const files = Array.from(new Set([
|
|
1547
|
+
...plan.plannedFiles.map((filePlan) => filePlan.path),
|
|
1548
|
+
...plan.commandMode === "preview-only" ? plan.generatedArtifacts : []
|
|
1549
|
+
]));
|
|
1550
|
+
return {
|
|
1551
|
+
ok: true,
|
|
1552
|
+
data: {
|
|
1553
|
+
command: "init",
|
|
1554
|
+
completion,
|
|
1555
|
+
detectedLayout: plan.detectedLayout,
|
|
1556
|
+
files: toNonEmptyArray(files),
|
|
1557
|
+
mode: plan.commandMode === "apply" ? "apply" : "preview",
|
|
1558
|
+
nextSteps: toNonEmptyArray(plan.nextSteps),
|
|
1559
|
+
packageManager: plan.packageManager,
|
|
1560
|
+
plan,
|
|
1561
|
+
projectDir: plan.projectDir,
|
|
1562
|
+
status: plan.status,
|
|
1563
|
+
summary: plan.summary,
|
|
1564
|
+
title: completion.title,
|
|
1565
|
+
warnings: toNonEmptyArray(plan.notes)
|
|
1566
|
+
}
|
|
1567
|
+
};
|
|
1568
|
+
}
|
|
1544
1569
|
function formatCreateProgressLine(payload, markerOptions) {
|
|
1545
1570
|
return formatOutputMarker("progress", `${payload.title}: ${payload.detail}`, markerOptions);
|
|
1546
1571
|
}
|
|
@@ -2406,6 +2431,7 @@ var WP_TYPIA_COMMAND_REGISTRY = [
|
|
|
2406
2431
|
{
|
|
2407
2432
|
commandTree: true,
|
|
2408
2433
|
description: "Scaffold a new wp-typia project.",
|
|
2434
|
+
interactiveRuntime: true,
|
|
2409
2435
|
name: "create",
|
|
2410
2436
|
nodeFallback: true,
|
|
2411
2437
|
optionGroups: ["create"],
|
|
@@ -2431,6 +2457,7 @@ var WP_TYPIA_COMMAND_REGISTRY = [
|
|
|
2431
2457
|
{
|
|
2432
2458
|
commandTree: true,
|
|
2433
2459
|
description: "Extend an official wp-typia workspace.",
|
|
2460
|
+
interactiveRuntime: true,
|
|
2434
2461
|
name: "add",
|
|
2435
2462
|
nodeFallback: true,
|
|
2436
2463
|
optionGroups: ["add"],
|
|
@@ -2450,6 +2477,7 @@ var WP_TYPIA_COMMAND_REGISTRY = [
|
|
|
2450
2477
|
{
|
|
2451
2478
|
commandTree: true,
|
|
2452
2479
|
description: "Run migration workflows.",
|
|
2480
|
+
interactiveRuntime: true,
|
|
2453
2481
|
name: "migrate",
|
|
2454
2482
|
nodeFallback: true,
|
|
2455
2483
|
optionGroups: ["migrate"],
|
|
@@ -2531,6 +2559,7 @@ var WP_TYPIA_COMMAND_REGISTRY = [
|
|
|
2531
2559
|
];
|
|
2532
2560
|
var WP_TYPIA_RESERVED_TOP_LEVEL_COMMAND_NAMES = WP_TYPIA_COMMAND_REGISTRY.map((command) => command.name);
|
|
2533
2561
|
var WP_TYPIA_NODE_FALLBACK_TOP_LEVEL_COMMAND_NAMES = WP_TYPIA_COMMAND_REGISTRY.filter((command) => command.nodeFallback).map((command) => command.name);
|
|
2562
|
+
var WP_TYPIA_INTERACTIVE_RUNTIME_TOP_LEVEL_COMMAND_NAMES = WP_TYPIA_COMMAND_REGISTRY.filter((command) => ("interactiveRuntime" in command) && command.interactiveRuntime).map((command) => command.name);
|
|
2534
2563
|
var WP_TYPIA_TOP_LEVEL_COMMAND_NAMES = WP_TYPIA_COMMAND_REGISTRY.filter((command) => command.commandTree).map((command) => command.name);
|
|
2535
2564
|
var WP_TYPIA_BUN_REQUIRED_TOP_LEVEL_COMMAND_NAMES = WP_TYPIA_COMMAND_REGISTRY.filter((command) => command.requiresBunRuntime).map((command) => command.name);
|
|
2536
2565
|
var WP_TYPIA_FUTURE_COMMAND_TREE = WP_TYPIA_COMMAND_REGISTRY.filter((command) => command.commandTree).map((command) => ({
|
|
@@ -2960,7 +2989,7 @@ var NODE_FALLBACK_COMMAND_DISPATCHERS = {
|
|
|
2960
2989
|
await executeAddCommand({
|
|
2961
2990
|
cwd,
|
|
2962
2991
|
flags: mergedFlags,
|
|
2963
|
-
interactive:
|
|
2992
|
+
interactive: undefined,
|
|
2964
2993
|
kind: positionals[1],
|
|
2965
2994
|
name: positionals[2]
|
|
2966
2995
|
});
|
|
@@ -2987,7 +3016,7 @@ var NODE_FALLBACK_COMMAND_DISPATCHERS = {
|
|
|
2987
3016
|
cwd,
|
|
2988
3017
|
emitOutput: mergedFlags.format !== "json",
|
|
2989
3018
|
flags: mergedFlags,
|
|
2990
|
-
interactive: false,
|
|
3019
|
+
interactive: mergedFlags.format === "json" ? false : undefined,
|
|
2991
3020
|
projectDir
|
|
2992
3021
|
});
|
|
2993
3022
|
} catch (error) {
|
|
@@ -3025,9 +3054,7 @@ var NODE_FALLBACK_COMMAND_DISPATCHERS = {
|
|
|
3025
3054
|
emitOutput: mergedFlags.format !== "json"
|
|
3026
3055
|
});
|
|
3027
3056
|
if (mergedFlags.format === "json") {
|
|
3028
|
-
printLine(JSON.stringify(
|
|
3029
|
-
init: plan
|
|
3030
|
-
}, null, 2));
|
|
3057
|
+
printLine(JSON.stringify(buildStructuredInitSuccessPayload(plan), null, 2));
|
|
3031
3058
|
}
|
|
3032
3059
|
},
|
|
3033
3060
|
migrate: async ({
|
|
@@ -3187,4 +3214,4 @@ export {
|
|
|
3187
3214
|
hasFlagBeforeTerminator
|
|
3188
3215
|
};
|
|
3189
3216
|
|
|
3190
|
-
//# debugId=
|
|
3217
|
+
//# debugId=9D8430CB181D13B964756E2164756E21
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wp-typia",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.0",
|
|
4
4
|
"description": "Canonical CLI package for wp-typia scaffolding and project workflows",
|
|
5
5
|
"packageManager": "bun@1.3.11",
|
|
6
6
|
"type": "module",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"@bunli/tui": "0.6.0",
|
|
71
71
|
"@bunli/utils": "0.6.0",
|
|
72
72
|
"@wp-typia/api-client": "^0.4.5",
|
|
73
|
-
"@wp-typia/project-tools": "0.
|
|
73
|
+
"@wp-typia/project-tools": "0.22.0",
|
|
74
74
|
"better-result": "^2.7.0",
|
|
75
75
|
"react": "^19.2.5",
|
|
76
76
|
"react-dom": "^19.2.5",
|