wp-typia 0.23.1 → 0.24.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.
- package/README.md +1 -0
- package/bin/routing-metadata.generated.js +9 -0
- package/dist-bunli/.bunli/commands.gen.js +9587 -7600
- package/dist-bunli/{cli-ymecd15q.js → cli-1xt99e09.js} +85 -10
- package/dist-bunli/{cli-y7w3pybs.js → cli-4ah8dawy.js} +982 -944
- package/dist-bunli/{cli-add-xjaaa01x.js → cli-add-mr731xtv.js} +8607 -7688
- package/dist-bunli/{cli-43mx1vfb.js → cli-bajwv85z.js} +2 -1
- package/dist-bunli/{cli-doctor-19e8313m.js → cli-doctor-kf9gwdhh.js} +98 -12
- package/dist-bunli/{cli-epsczb1c.js → cli-fzhkqzc7.js} +1 -1
- package/dist-bunli/{cli-nvs5atj1.js → cli-gaq29kzp.js} +1 -1
- package/dist-bunli/{cli-k5q5v8g6.js → cli-h2v72j8q.js} +1338 -893
- package/dist-bunli/{cli-init-2b4yn2cc.js → cli-init-557vq109.js} +3 -3
- package/dist-bunli/{cli-scaffold-4tjw4jk5.js → cli-scaffold-bt1ttnkg.js} +6 -6
- package/dist-bunli/cli-z48frc8t.js +229 -0
- package/dist-bunli/{cli-fp16mntv.js → cli-zjw3eqfj.js} +16 -9
- package/dist-bunli/cli.js +3 -3
- package/dist-bunli/{command-list-vme7dr5v.js → command-list-bd2582k1.js} +197 -29
- package/dist-bunli/{migrations-pb5vvtdp.js → migrations-ky53fj2h.js} +3 -3
- package/dist-bunli/node-cli.js +339 -75
- package/package.json +2 -2
- package/dist-bunli/cli-j8et6jvr.js +0 -123
|
@@ -4,6 +4,7 @@ var ADD_KIND_IDS = [
|
|
|
4
4
|
"admin-view",
|
|
5
5
|
"block",
|
|
6
6
|
"integration-env",
|
|
7
|
+
"core-variation",
|
|
7
8
|
"variation",
|
|
8
9
|
"style",
|
|
9
10
|
"transform",
|
|
@@ -20,4 +21,4 @@ var ADD_KIND_IDS = [
|
|
|
20
21
|
|
|
21
22
|
export { ADD_KIND_IDS };
|
|
22
23
|
|
|
23
|
-
//# debugId=
|
|
24
|
+
//# debugId=39A9377B00AF01BA64756E2164756E21
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
|
+
assertPostMetaBindingPath,
|
|
3
4
|
hasAdminViewManualSettingsRouteParameters,
|
|
4
5
|
hasExecutablePattern,
|
|
5
6
|
hasUncommentedPattern,
|
|
6
7
|
isAdminViewManualSettingsRestResource,
|
|
8
|
+
loadPostMetaBindingFieldsSync,
|
|
7
9
|
maskTypeScriptCommentsAndLiterals
|
|
8
|
-
} from "./cli-
|
|
10
|
+
} from "./cli-z48frc8t.js";
|
|
9
11
|
import {
|
|
10
12
|
getBuiltInTemplateLayerDirs,
|
|
11
13
|
isOmittableBuiltInTemplateLayerDir
|
|
12
|
-
} from "./cli-
|
|
14
|
+
} from "./cli-gaq29kzp.js";
|
|
13
15
|
import {
|
|
14
16
|
isBuiltInTemplateId,
|
|
15
17
|
listTemplates
|
|
@@ -24,14 +26,17 @@ import {
|
|
|
24
26
|
REST_RESOURCE_NAMESPACE_PATTERN,
|
|
25
27
|
assertValidPostMetaPostType,
|
|
26
28
|
escapeRegex,
|
|
29
|
+
formatPatternCatalogDiagnostics,
|
|
27
30
|
isGeneratedRestResourceRoutePatternCompatible,
|
|
28
31
|
pathExists,
|
|
29
32
|
readWorkspaceInventoryAsync,
|
|
30
|
-
resolveEditorPluginSlotAlias
|
|
31
|
-
|
|
33
|
+
resolveEditorPluginSlotAlias,
|
|
34
|
+
resolvePatternCatalogContentFile,
|
|
35
|
+
validatePatternCatalog
|
|
36
|
+
} from "./cli-h2v72j8q.js";
|
|
32
37
|
import"./cli-cvxvcw7c.js";
|
|
33
38
|
import"./cli-t73q5aqz.js";
|
|
34
|
-
import"./cli-
|
|
39
|
+
import"./cli-bajwv85z.js";
|
|
35
40
|
import {
|
|
36
41
|
CLI_DIAGNOSTIC_CODES,
|
|
37
42
|
createCliCommandError,
|
|
@@ -282,6 +287,55 @@ function checkWorkspaceBindingTarget(projectDir, workspace, registeredBlockSlugs
|
|
|
282
287
|
}
|
|
283
288
|
return createDoctorCheck(`Binding target ${bindingSource.slug}`, issues.length === 0 ? "pass" : "fail", issues.length === 0 ? `${bindingSource.block}.${bindingSource.attribute} is declared and supported` : issues.join("; "));
|
|
284
289
|
}
|
|
290
|
+
function checkWorkspaceBindingPostMeta(projectDir, inventory, bindingSource) {
|
|
291
|
+
if (!bindingSource.postMeta) {
|
|
292
|
+
return;
|
|
293
|
+
}
|
|
294
|
+
const postMeta = inventory.postMeta.find((entry) => entry.slug === bindingSource.postMeta);
|
|
295
|
+
if (!postMeta) {
|
|
296
|
+
return createDoctorCheck(`Binding post meta ${bindingSource.slug}`, "fail", `Binding source references unknown post meta contract "${bindingSource.postMeta}".`);
|
|
297
|
+
}
|
|
298
|
+
const issues = [];
|
|
299
|
+
try {
|
|
300
|
+
const fields = loadPostMetaBindingFieldsSync(projectDir, postMeta);
|
|
301
|
+
if (bindingSource.metaPath) {
|
|
302
|
+
assertPostMetaBindingPath(fields, postMeta.slug, bindingSource.metaPath);
|
|
303
|
+
}
|
|
304
|
+
} catch (error) {
|
|
305
|
+
issues.push(error instanceof Error ? error.message : String(error));
|
|
306
|
+
}
|
|
307
|
+
const serverPath = path3.join(projectDir, bindingSource.serverFile);
|
|
308
|
+
if (fs3.existsSync(serverPath)) {
|
|
309
|
+
const serverSource = fs3.readFileSync(serverPath, "utf8");
|
|
310
|
+
if (!serverSource.includes("get_post_meta")) {
|
|
311
|
+
issues.push(`${bindingSource.serverFile} must read post meta values`);
|
|
312
|
+
}
|
|
313
|
+
if (!serverSource.includes(postMeta.metaKey)) {
|
|
314
|
+
issues.push(`${bindingSource.serverFile} must reference ${postMeta.metaKey}`);
|
|
315
|
+
}
|
|
316
|
+
if (!serverSource.includes(postMeta.schemaFile)) {
|
|
317
|
+
issues.push(`${bindingSource.serverFile} must reference ${postMeta.schemaFile}`);
|
|
318
|
+
}
|
|
319
|
+
} else {
|
|
320
|
+
issues.push(`Missing ${bindingSource.serverFile}`);
|
|
321
|
+
}
|
|
322
|
+
const editorPath = path3.join(projectDir, bindingSource.editorFile);
|
|
323
|
+
if (fs3.existsSync(editorPath)) {
|
|
324
|
+
const editorSource = fs3.readFileSync(editorPath, "utf8");
|
|
325
|
+
if (!editorSource.includes("POST_META_BINDING_FIELDS")) {
|
|
326
|
+
issues.push(`${bindingSource.editorFile} must define post meta binding fields`);
|
|
327
|
+
}
|
|
328
|
+
if (!editorSource.includes(postMeta.schemaFile)) {
|
|
329
|
+
issues.push(`${bindingSource.editorFile} must reference ${postMeta.schemaFile}`);
|
|
330
|
+
}
|
|
331
|
+
if (bindingSource.metaPath && !editorSource.includes(bindingSource.metaPath)) {
|
|
332
|
+
issues.push(`${bindingSource.editorFile} must reference default meta path "${bindingSource.metaPath}"`);
|
|
333
|
+
}
|
|
334
|
+
} else {
|
|
335
|
+
issues.push(`Missing ${bindingSource.editorFile}`);
|
|
336
|
+
}
|
|
337
|
+
return createDoctorCheck(`Binding post meta ${bindingSource.slug}`, issues.length === 0 ? "pass" : "fail", issues.length === 0 ? `${bindingSource.slug} reads ${postMeta.slug} via ${postMeta.schemaFile}` : issues.join("; "));
|
|
338
|
+
}
|
|
285
339
|
function getWorkspaceBindingDoctorChecks(workspace, inventory) {
|
|
286
340
|
const checks = [];
|
|
287
341
|
if (inventory.bindingSources.length > 0) {
|
|
@@ -298,6 +352,10 @@ function getWorkspaceBindingDoctorChecks(workspace, inventory) {
|
|
|
298
352
|
if (bindingTargetCheck) {
|
|
299
353
|
checks.push(bindingTargetCheck);
|
|
300
354
|
}
|
|
355
|
+
const bindingPostMetaCheck = checkWorkspaceBindingPostMeta(workspace.projectDir, inventory, bindingSource);
|
|
356
|
+
if (bindingPostMetaCheck) {
|
|
357
|
+
checks.push(bindingPostMetaCheck);
|
|
358
|
+
}
|
|
301
359
|
}
|
|
302
360
|
return checks;
|
|
303
361
|
}
|
|
@@ -311,7 +369,14 @@ var WORKSPACE_BLOCK_STYLES_IMPORT_PATTERN = /^\s*import\s*\{\s*registerWorkspace
|
|
|
311
369
|
var WORKSPACE_BLOCK_STYLES_CALL_PATTERN = /registerWorkspaceBlockStyles\s*\(\s*\)\s*;?/u;
|
|
312
370
|
var WORKSPACE_BLOCK_TRANSFORMS_IMPORT_PATTERN = /^\s*import\s*\{\s*applyWorkspaceBlockTransforms\s*\}\s*from\s*["']\.\/transforms["']\s*;?\s*$/mu;
|
|
313
371
|
var WORKSPACE_BLOCK_TRANSFORMS_CALL_PATTERN = /applyWorkspaceBlockTransforms\s*\(\s*registration\s*\.\s*settings\s*\)\s*;?/u;
|
|
314
|
-
function
|
|
372
|
+
function isNestedPatternContentFile(patternFile) {
|
|
373
|
+
if (!patternFile) {
|
|
374
|
+
return false;
|
|
375
|
+
}
|
|
376
|
+
const normalizedPath = patternFile.replace(/\\/gu, "/");
|
|
377
|
+
return normalizedPath.startsWith("src/patterns/") && normalizedPath.slice("src/patterns/".length).includes("/");
|
|
378
|
+
}
|
|
379
|
+
function checkWorkspacePatternBootstrap(projectDir, packageName, requiresNestedPatternGlob) {
|
|
315
380
|
const bootstrapPath = resolveWorkspaceBootstrapPath(projectDir, packageName);
|
|
316
381
|
if (!fs4.existsSync(bootstrapPath)) {
|
|
317
382
|
return createDoctorCheck("Pattern bootstrap", "fail", `Missing ${path4.basename(bootstrapPath)}`);
|
|
@@ -319,7 +384,9 @@ function checkWorkspacePatternBootstrap(projectDir, packageName) {
|
|
|
319
384
|
const source = fs4.readFileSync(bootstrapPath, "utf8");
|
|
320
385
|
const hasCategoryAnchor = source.includes("register_block_pattern_category");
|
|
321
386
|
const hasPatternGlob = source.includes("/src/patterns/*.php");
|
|
322
|
-
|
|
387
|
+
const hasNestedPatternGlob = source.includes("/src/patterns/*/*.php");
|
|
388
|
+
const hasRequiredPatternGlobs = hasPatternGlob && (!requiresNestedPatternGlob || hasNestedPatternGlob);
|
|
389
|
+
return createDoctorCheck("Pattern bootstrap", hasCategoryAnchor && hasRequiredPatternGlobs ? "pass" : "fail", hasCategoryAnchor && hasRequiredPatternGlobs ? "Pattern category and loader hooks are present" : requiresNestedPatternGlob ? "Missing pattern category registration or nested src/patterns loader hook" : "Missing pattern category registration or src/patterns loader hook");
|
|
323
390
|
}
|
|
324
391
|
function checkVariationEntrypoint(projectDir, blockSlug) {
|
|
325
392
|
const entryPath = path4.join(projectDir, "src", "blocks", blockSlug, "index.tsx");
|
|
@@ -409,10 +476,19 @@ function getWorkspaceBlockAddonDoctorChecks(workspace, inventory, registeredBloc
|
|
|
409
476
|
}
|
|
410
477
|
const shouldCheckPatternBootstrap = inventory.patterns.length > 0 || fs4.existsSync(path4.join(workspace.projectDir, "src", "patterns"));
|
|
411
478
|
if (shouldCheckPatternBootstrap) {
|
|
412
|
-
|
|
479
|
+
const requiresNestedPatternGlob = inventory.patterns.some((pattern) => isNestedPatternContentFile(resolvePatternCatalogContentFile(pattern)));
|
|
480
|
+
checks.push(checkWorkspacePatternBootstrap(workspace.projectDir, workspace.packageName, requiresNestedPatternGlob));
|
|
481
|
+
}
|
|
482
|
+
if (inventory.patterns.length > 0) {
|
|
483
|
+
const catalogValidation = validatePatternCatalog(inventory.patterns, {
|
|
484
|
+
projectDir: workspace.projectDir
|
|
485
|
+
});
|
|
486
|
+
checks.push(createDoctorCheck("Pattern catalog", catalogValidation.errors.length > 0 ? "fail" : catalogValidation.warnings.length > 0 ? "warn" : "pass", catalogValidation.diagnostics.length > 0 ? formatPatternCatalogDiagnostics(catalogValidation.diagnostics) : "Pattern catalog metadata is valid"));
|
|
413
487
|
}
|
|
414
488
|
for (const pattern of inventory.patterns) {
|
|
415
|
-
checks.push(checkExistingFiles(workspace.projectDir, `Pattern ${pattern.slug}`, [
|
|
489
|
+
checks.push(checkExistingFiles(workspace.projectDir, `Pattern ${pattern.slug}`, [
|
|
490
|
+
resolvePatternCatalogContentFile(pattern)
|
|
491
|
+
]));
|
|
416
492
|
}
|
|
417
493
|
return checks;
|
|
418
494
|
}
|
|
@@ -1268,6 +1344,16 @@ async function getWorkspaceDoctorChecks(cwd) {
|
|
|
1268
1344
|
|
|
1269
1345
|
// ../wp-typia-project-tools/src/runtime/cli-doctor.ts
|
|
1270
1346
|
var DEFAULT_DOCTOR_EXIT_POLICY = "strict";
|
|
1347
|
+
var defaultDoctorLinePrinter = (line) => {
|
|
1348
|
+
process.stdout.write(`${line}
|
|
1349
|
+
`);
|
|
1350
|
+
};
|
|
1351
|
+
function renderDefaultDoctorCheckLine(check) {
|
|
1352
|
+
defaultDoctorLinePrinter(formatDoctorCheckLine(check));
|
|
1353
|
+
}
|
|
1354
|
+
function renderDefaultDoctorSummaryLine(summaryLine) {
|
|
1355
|
+
defaultDoctorLinePrinter(summaryLine);
|
|
1356
|
+
}
|
|
1271
1357
|
function annotateDoctorChecks(checks, scope) {
|
|
1272
1358
|
return checks.map((check) => ({
|
|
1273
1359
|
...check,
|
|
@@ -1328,10 +1414,10 @@ function createDoctorRunSummary(checks, options = {}) {
|
|
|
1328
1414
|
}
|
|
1329
1415
|
async function runDoctor(cwd, options = {}) {
|
|
1330
1416
|
const exitPolicy = resolveDoctorExitPolicy(options);
|
|
1331
|
-
const renderLine = options.renderLine ??
|
|
1417
|
+
const renderLine = options.renderLine ?? renderDefaultDoctorCheckLine;
|
|
1332
1418
|
const renderSummaryLine = options.renderSummaryLine ?? (options.renderLine ? () => {
|
|
1333
1419
|
return;
|
|
1334
|
-
} :
|
|
1420
|
+
} : renderDefaultDoctorSummaryLine);
|
|
1335
1421
|
const checks = await getDoctorChecks(cwd);
|
|
1336
1422
|
for (const check of checks) {
|
|
1337
1423
|
renderLine(check);
|
|
@@ -1357,4 +1443,4 @@ export {
|
|
|
1357
1443
|
createDoctorRunSummary
|
|
1358
1444
|
};
|
|
1359
1445
|
|
|
1360
|
-
//# debugId=
|
|
1446
|
+
//# debugId=7D607F817A3CF55764756E2164756E21
|