@wp-typia/project-tools 0.22.10 → 0.23.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.
Files changed (155) hide show
  1. package/dist/runtime/ai-feature-artifacts.js +4 -1
  2. package/dist/runtime/block-generator-service-spec.js +2 -1
  3. package/dist/runtime/cli-add-block-json.js +5 -1
  4. package/dist/runtime/cli-add-collision.d.ts +25 -0
  5. package/dist/runtime/cli-add-collision.js +76 -0
  6. package/dist/runtime/cli-add-help.js +12 -2
  7. package/dist/runtime/cli-add-kind-ids.d.ts +1 -1
  8. package/dist/runtime/cli-add-kind-ids.js +3 -0
  9. package/dist/runtime/cli-add-types.d.ts +129 -0
  10. package/dist/runtime/cli-add-types.js +26 -0
  11. package/dist/runtime/cli-add-validation.d.ts +97 -1
  12. package/dist/runtime/cli-add-validation.js +313 -1
  13. package/dist/runtime/cli-add-workspace-ability-scaffold.js +4 -1
  14. package/dist/runtime/cli-add-workspace-admin-view-scaffold.js +79 -20
  15. package/dist/runtime/cli-add-workspace-admin-view-source.js +11 -2
  16. package/dist/runtime/cli-add-workspace-admin-view-templates-core-data.d.ts +34 -0
  17. package/dist/runtime/cli-add-workspace-admin-view-templates-core-data.js +483 -0
  18. package/dist/runtime/cli-add-workspace-admin-view-templates-default.d.ts +30 -0
  19. package/dist/runtime/cli-add-workspace-admin-view-templates-default.js +310 -0
  20. package/dist/runtime/cli-add-workspace-admin-view-templates-rest.d.ts +25 -0
  21. package/dist/runtime/cli-add-workspace-admin-view-templates-rest.js +124 -0
  22. package/dist/runtime/cli-add-workspace-admin-view-templates-settings.d.ts +34 -0
  23. package/dist/runtime/cli-add-workspace-admin-view-templates-settings.js +370 -0
  24. package/dist/runtime/cli-add-workspace-admin-view-templates-shared.d.ts +49 -0
  25. package/dist/runtime/cli-add-workspace-admin-view-templates-shared.js +259 -0
  26. package/dist/runtime/cli-add-workspace-admin-view-templates.d.ts +19 -10
  27. package/dist/runtime/cli-add-workspace-admin-view-templates.js +31 -971
  28. package/dist/runtime/cli-add-workspace-admin-view-types.d.ts +21 -0
  29. package/dist/runtime/cli-add-workspace-admin-view-types.js +22 -0
  30. package/dist/runtime/cli-add-workspace-ai-anchors.js +125 -32
  31. package/dist/runtime/cli-add-workspace-ai-source-emitters.js +17 -1
  32. package/dist/runtime/cli-add-workspace-contract-source-emitters.d.ts +15 -0
  33. package/dist/runtime/cli-add-workspace-contract-source-emitters.js +42 -0
  34. package/dist/runtime/cli-add-workspace-contract.d.ts +15 -0
  35. package/dist/runtime/cli-add-workspace-contract.js +65 -0
  36. package/dist/runtime/cli-add-workspace-integration-env.d.ts +26 -0
  37. package/dist/runtime/cli-add-workspace-integration-env.js +428 -0
  38. package/dist/runtime/cli-add-workspace-post-meta-anchors.d.ts +23 -0
  39. package/dist/runtime/cli-add-workspace-post-meta-anchors.js +244 -0
  40. package/dist/runtime/cli-add-workspace-post-meta-source-emitters.d.ts +63 -0
  41. package/dist/runtime/cli-add-workspace-post-meta-source-emitters.js +179 -0
  42. package/dist/runtime/cli-add-workspace-post-meta.d.ts +15 -0
  43. package/dist/runtime/cli-add-workspace-post-meta.js +107 -0
  44. package/dist/runtime/cli-add-workspace-rest-anchors.d.ts +9 -0
  45. package/dist/runtime/cli-add-workspace-rest-anchors.js +326 -21
  46. package/dist/runtime/cli-add-workspace-rest-generated.d.ts +9 -0
  47. package/dist/runtime/cli-add-workspace-rest-generated.js +158 -0
  48. package/dist/runtime/cli-add-workspace-rest-manual.d.ts +8 -0
  49. package/dist/runtime/cli-add-workspace-rest-manual.js +279 -0
  50. package/dist/runtime/cli-add-workspace-rest-php-templates.d.ts +24 -0
  51. package/dist/runtime/cli-add-workspace-rest-php-templates.js +678 -0
  52. package/dist/runtime/cli-add-workspace-rest-source-emitters.d.ts +98 -2
  53. package/dist/runtime/cli-add-workspace-rest-source-emitters.js +323 -29
  54. package/dist/runtime/cli-add-workspace-rest-types.d.ts +108 -0
  55. package/dist/runtime/cli-add-workspace-rest-types.js +1 -0
  56. package/dist/runtime/cli-add-workspace-rest.d.ts +3 -7
  57. package/dist/runtime/cli-add-workspace-rest.js +34 -481
  58. package/dist/runtime/cli-add-workspace.d.ts +15 -0
  59. package/dist/runtime/cli-add-workspace.js +15 -0
  60. package/dist/runtime/cli-add.d.ts +1 -1
  61. package/dist/runtime/cli-add.js +1 -1
  62. package/dist/runtime/cli-core.d.ts +3 -2
  63. package/dist/runtime/cli-core.js +3 -2
  64. package/dist/runtime/cli-diagnostics.d.ts +3 -1
  65. package/dist/runtime/cli-diagnostics.js +17 -5
  66. package/dist/runtime/cli-doctor-environment.js +1 -3
  67. package/dist/runtime/cli-doctor-workspace-bindings.js +4 -1
  68. package/dist/runtime/cli-doctor-workspace-block-addons.d.ts +12 -0
  69. package/dist/runtime/cli-doctor-workspace-block-addons.js +134 -0
  70. package/dist/runtime/cli-doctor-workspace-block-iframe.d.ts +9 -0
  71. package/dist/runtime/cli-doctor-workspace-block-iframe.js +228 -0
  72. package/dist/runtime/cli-doctor-workspace-block-metadata.d.ts +11 -0
  73. package/dist/runtime/cli-doctor-workspace-block-metadata.js +111 -0
  74. package/dist/runtime/cli-doctor-workspace-blocks.js +6 -424
  75. package/dist/runtime/cli-doctor-workspace-features-abilities.d.ts +11 -0
  76. package/dist/runtime/cli-doctor-workspace-features-abilities.js +112 -0
  77. package/dist/runtime/cli-doctor-workspace-features-admin-views.d.ts +11 -0
  78. package/dist/runtime/cli-doctor-workspace-features-admin-views.js +128 -0
  79. package/dist/runtime/cli-doctor-workspace-features-ai.d.ts +11 -0
  80. package/dist/runtime/cli-doctor-workspace-features-ai.js +57 -0
  81. package/dist/runtime/cli-doctor-workspace-features-editor-plugins.d.ts +11 -0
  82. package/dist/runtime/cli-doctor-workspace-features-editor-plugins.js +80 -0
  83. package/dist/runtime/cli-doctor-workspace-features-post-meta.d.ts +11 -0
  84. package/dist/runtime/cli-doctor-workspace-features-post-meta.js +77 -0
  85. package/dist/runtime/cli-doctor-workspace-features-rest.d.ts +11 -0
  86. package/dist/runtime/cli-doctor-workspace-features-rest.js +120 -0
  87. package/dist/runtime/cli-doctor-workspace-features.js +14 -369
  88. package/dist/runtime/cli-doctor-workspace-package.d.ts +25 -3
  89. package/dist/runtime/cli-doctor-workspace-package.js +35 -13
  90. package/dist/runtime/cli-doctor-workspace-shared.d.ts +2 -0
  91. package/dist/runtime/cli-doctor-workspace-shared.js +2 -0
  92. package/dist/runtime/cli-doctor-workspace.js +8 -3
  93. package/dist/runtime/cli-doctor.d.ts +52 -3
  94. package/dist/runtime/cli-doctor.js +79 -8
  95. package/dist/runtime/cli-help.js +10 -0
  96. package/dist/runtime/cli-init-package-json.js +4 -2
  97. package/dist/runtime/cli-init-templates.js +11 -1
  98. package/dist/runtime/cli-prompt.d.ts +16 -2
  99. package/dist/runtime/cli-prompt.js +29 -12
  100. package/dist/runtime/cli-scaffold.d.ts +2 -1
  101. package/dist/runtime/cli-scaffold.js +19 -10
  102. package/dist/runtime/contract-artifacts.d.ts +14 -0
  103. package/dist/runtime/contract-artifacts.js +15 -0
  104. package/dist/runtime/external-template-guards.js +4 -6
  105. package/dist/runtime/index.d.ts +2 -2
  106. package/dist/runtime/index.js +1 -1
  107. package/dist/runtime/json-utils.d.ts +62 -4
  108. package/dist/runtime/json-utils.js +78 -4
  109. package/dist/runtime/local-dev-presets.js +4 -1
  110. package/dist/runtime/migration-ui-capability.js +4 -1
  111. package/dist/runtime/migration-utils.js +4 -1
  112. package/dist/runtime/package-managers.js +6 -1
  113. package/dist/runtime/package-versions.js +6 -1
  114. package/dist/runtime/rest-resource-artifacts.d.ts +57 -1
  115. package/dist/runtime/rest-resource-artifacts.js +97 -1
  116. package/dist/runtime/scaffold-bootstrap.js +7 -2
  117. package/dist/runtime/scaffold-package-manager-files.js +5 -1
  118. package/dist/runtime/scaffold-repository-reference.js +4 -2
  119. package/dist/runtime/scaffold-template-variables.js +2 -1
  120. package/dist/runtime/scaffold.d.ts +18 -1
  121. package/dist/runtime/scaffold.js +55 -2
  122. package/dist/runtime/temp-roots.js +4 -1
  123. package/dist/runtime/template-layers.js +4 -1
  124. package/dist/runtime/template-registry.js +9 -3
  125. package/dist/runtime/template-render.d.ts +1 -1
  126. package/dist/runtime/template-render.js +1 -1
  127. package/dist/runtime/template-source-cache-markers.d.ts +37 -0
  128. package/dist/runtime/template-source-cache-markers.js +125 -0
  129. package/dist/runtime/template-source-cache.d.ts +1 -4
  130. package/dist/runtime/template-source-cache.js +16 -122
  131. package/dist/runtime/template-source-contracts.d.ts +2 -0
  132. package/dist/runtime/template-source-external.d.ts +4 -2
  133. package/dist/runtime/template-source-external.js +4 -2
  134. package/dist/runtime/template-source-normalization.js +2 -1
  135. package/dist/runtime/template-source-remote.d.ts +8 -4
  136. package/dist/runtime/template-source-remote.js +26 -9
  137. package/dist/runtime/template-source-seeds.js +10 -3
  138. package/dist/runtime/workspace-inventory-mutations.js +54 -4
  139. package/dist/runtime/workspace-inventory-parser-entries.d.ts +17 -0
  140. package/dist/runtime/workspace-inventory-parser-entries.js +157 -0
  141. package/dist/runtime/workspace-inventory-parser-validation.d.ts +104 -0
  142. package/dist/runtime/workspace-inventory-parser-validation.js +34 -0
  143. package/dist/runtime/workspace-inventory-parser.d.ts +3 -44
  144. package/dist/runtime/workspace-inventory-parser.js +7 -464
  145. package/dist/runtime/workspace-inventory-read.d.ts +9 -2
  146. package/dist/runtime/workspace-inventory-read.js +9 -2
  147. package/dist/runtime/workspace-inventory-section-descriptors.d.ts +19 -0
  148. package/dist/runtime/workspace-inventory-section-descriptors.js +435 -0
  149. package/dist/runtime/workspace-inventory-templates.d.ts +16 -1
  150. package/dist/runtime/workspace-inventory-templates.js +75 -4
  151. package/dist/runtime/workspace-inventory-types.d.ts +52 -2
  152. package/dist/runtime/workspace-inventory.d.ts +2 -2
  153. package/dist/runtime/workspace-inventory.js +1 -1
  154. package/dist/runtime/workspace-project.js +4 -6
  155. package/package.json +2 -2
@@ -1,371 +1,6 @@
1
- import fs from "node:fs";
2
- import path from "node:path";
3
- import { parseScaffoldBlockMetadata } from "@wp-typia/block-runtime/blocks";
4
- import { checkExistingFiles, createDoctorCheck, resolveWorkspaceBootstrapPath, WORKSPACE_FULL_BLOCK_NAME_PATTERN, WORKSPACE_GENERATED_BLOCK_ARTIFACTS, } from "./cli-doctor-workspace-shared.js";
5
- import { HOOKED_BLOCK_ANCHOR_PATTERN, HOOKED_BLOCK_POSITION_SET, } from "./hooked-blocks.js";
6
- import { hasExecutablePattern, hasUncommentedPattern, maskTypeScriptCommentsAndLiterals, } from "./ts-source-masking.js";
7
- const WORKSPACE_COLLECTION_IMPORT_LINE = "import '../../collection';";
8
- const WORKSPACE_COLLECTION_IMPORT_PATTERN = /^\s*import\s+["']\.\.\/\.\.\/collection["']\s*;?\s*$/m;
9
- const WORKSPACE_VARIATIONS_IMPORT_PATTERN = /^\s*import\s*\{\s*registerWorkspaceVariations\s*\}\s*from\s*["']\.\/variations["']\s*;?\s*$/mu;
10
- const WORKSPACE_VARIATIONS_CALL_PATTERN = /registerWorkspaceVariations\s*\(\s*\)\s*;?/u;
11
- const WORKSPACE_BLOCK_STYLES_IMPORT_PATTERN = /^\s*import\s*\{\s*registerWorkspaceBlockStyles\s*\}\s*from\s*["']\.\/styles["']\s*;?\s*$/mu;
12
- const WORKSPACE_BLOCK_STYLES_CALL_PATTERN = /registerWorkspaceBlockStyles\s*\(\s*\)\s*;?/u;
13
- const WORKSPACE_BLOCK_TRANSFORMS_IMPORT_PATTERN = /^\s*import\s*\{\s*applyWorkspaceBlockTransforms\s*\}\s*from\s*["']\.\/transforms["']\s*;?\s*$/mu;
14
- const WORKSPACE_BLOCK_TRANSFORMS_CALL_PATTERN = /applyWorkspaceBlockTransforms\s*\(\s*registration\s*\.\s*settings\s*\)\s*;?/u;
15
- const WORKSPACE_BLOCK_IFRAME_COMPATIBILITY_DOC_URL = "https://developer.wordpress.org/block-editor/reference-guides/block-api/block-api-versions/block-migration-for-iframe-editor-compatibility/";
16
- const WORKSPACE_BLOCK_IFRAME_DIAGNOSTIC_CODES = {
17
- API_VERSION: "wp-typia.workspace.block.iframe.api-version",
18
- BLOCK_PROPS: "wp-typia.workspace.block.iframe.block-props",
19
- EDITOR_GLOBALS: "wp-typia.workspace.block.iframe.editor-globals",
20
- EDITOR_STYLES: "wp-typia.workspace.block.iframe.editor-styles",
21
- };
22
- const WORKSPACE_BLOCK_EDITOR_SOURCE_FILE_PATTERN = /\.[cm]?[jt]sx?$/u;
23
- const WORKSPACE_BLOCK_EDITOR_SOURCE_BASENAMES = new Set([
24
- "edit",
25
- "editor",
26
- "index",
27
- "save",
28
- ]);
29
- const WORKSPACE_BLOCK_EDITOR_SOURCE_DIRECTORIES = new Set([
30
- "components",
31
- "controls",
32
- "editor",
33
- "inspector",
34
- ]);
35
- const WORKSPACE_BLOCK_LOCAL_STYLE_FILES = [
36
- "editor.css",
37
- "editor.scss",
38
- "index.css",
39
- "style.css",
40
- "style.scss",
41
- ];
42
- const WORKSPACE_BLOCK_IFRAME_GLOBAL_DOM_PATTERN = /\b(?:document|window)\b|\b(?:parent|top)\b(?!\s*:)/gu;
43
- const WORKSPACE_BLOCK_PROPS_PATTERN = /\buse(?:Block|InnerBlocks)Props(?:\.save)?\s*\(/u;
44
- function normalizePathSeparators(relativePath) {
45
- return relativePath.split(path.sep).join("/");
46
- }
47
- function hasRegisteredBlockAsset(value) {
48
- if (typeof value === "string") {
49
- return value.trim().length > 0;
50
- }
51
- if (Array.isArray(value)) {
52
- return value.some((entry) => hasRegisteredBlockAsset(entry));
53
- }
54
- return false;
55
- }
56
- function readWorkspaceBlockIframeMetadata(projectDir, blockSlug) {
57
- const blockJsonRelativePath = path.join("src", "blocks", blockSlug, "block.json");
58
- const blockJsonPath = path.join(projectDir, blockJsonRelativePath);
59
- if (!fs.existsSync(blockJsonPath)) {
60
- return {
61
- blockJsonRelativePath,
62
- error: `Missing ${blockJsonRelativePath}`,
63
- };
64
- }
65
- try {
66
- const document = parseScaffoldBlockMetadata(JSON.parse(fs.readFileSync(blockJsonPath, "utf8")));
67
- return {
68
- blockJsonRelativePath,
69
- document,
70
- };
71
- }
72
- catch (error) {
73
- return {
74
- blockJsonRelativePath,
75
- error: error instanceof Error ? error.message : String(error),
76
- };
77
- }
78
- }
79
- function isWorkspaceBlockEditorSource(relativePath) {
80
- if (!WORKSPACE_BLOCK_EDITOR_SOURCE_FILE_PATTERN.test(relativePath)) {
81
- return false;
82
- }
83
- const normalizedRelativePath = normalizePathSeparators(relativePath);
84
- const normalizedDirName = path.posix.dirname(normalizedRelativePath);
85
- const normalizedBaseName = path.posix.basename(normalizedRelativePath, path.posix.extname(normalizedRelativePath));
86
- if (WORKSPACE_BLOCK_EDITOR_SOURCE_BASENAMES.has(normalizedBaseName)) {
87
- return true;
88
- }
89
- const pathSegments = normalizedDirName.split("/");
90
- return pathSegments.some((segment) => WORKSPACE_BLOCK_EDITOR_SOURCE_DIRECTORIES.has(segment));
91
- }
92
- function isWorkspaceBlockSaveSource(relativePath) {
93
- const normalizedBaseName = path.basename(relativePath, path.extname(relativePath));
94
- return normalizedBaseName === "save";
95
- }
96
- function collectWorkspaceBlockEditorSources(projectDir, blockSlug) {
97
- const blockDir = path.join(projectDir, "src", "blocks", blockSlug);
98
- if (!fs.existsSync(blockDir)) {
99
- return [];
100
- }
101
- const collected = [];
102
- const queue = [blockDir];
103
- while (queue.length > 0) {
104
- const currentDir = queue.pop();
105
- if (!currentDir) {
106
- continue;
107
- }
108
- for (const entry of fs.readdirSync(currentDir, { withFileTypes: true })) {
109
- const absolutePath = path.join(currentDir, entry.name);
110
- if (entry.isDirectory()) {
111
- queue.push(absolutePath);
112
- continue;
113
- }
114
- if (!entry.isFile()) {
115
- continue;
116
- }
117
- const relativePath = path.relative(projectDir, absolutePath);
118
- if (!isWorkspaceBlockEditorSource(relativePath)) {
119
- continue;
120
- }
121
- collected.push({
122
- relativePath: normalizePathSeparators(relativePath),
123
- source: fs.readFileSync(absolutePath, "utf8"),
124
- });
125
- }
126
- }
127
- return collected.sort((left, right) => left.relativePath.localeCompare(right.relativePath));
128
- }
129
- function getSourceLineNumber(source, index) {
130
- let line = 1;
131
- for (let cursor = 0; cursor < index; cursor += 1) {
132
- if (source[cursor] === "\n") {
133
- line += 1;
134
- }
135
- }
136
- return line;
137
- }
138
- function isGlobalDomAccessCandidate(source, index, identifier) {
139
- const lineStart = source.lastIndexOf("\n", index - 1) + 1;
140
- const lineEndCandidate = source.indexOf("\n", index);
141
- const lineEnd = lineEndCandidate === -1 ? source.length : lineEndCandidate;
142
- const lineSource = source.slice(lineStart, lineEnd);
143
- const trimmedLine = lineSource.trimStart();
144
- if (trimmedLine.startsWith("import ")) {
145
- return false;
146
- }
147
- if (trimmedLine.startsWith("const ") || trimmedLine.startsWith("let ") || trimmedLine.startsWith("var ")) {
148
- return false;
149
- }
150
- if (trimmedLine.startsWith("function ") || trimmedLine.startsWith("class ")) {
151
- return false;
152
- }
153
- const precedingCharacter = index > 0 ? source[index - 1] : "";
154
- if (precedingCharacter === "." || precedingCharacter === "'" || precedingCharacter === '"') {
155
- return false;
156
- }
157
- return (identifier === "document" ||
158
- identifier === "window" ||
159
- identifier === "parent" ||
160
- identifier === "top");
161
- }
162
- function findWorkspaceBlockGlobalDomAccesses(editorSources) {
163
- return editorSources.flatMap(({ relativePath, source }) => {
164
- const maskedSource = maskTypeScriptCommentsAndLiterals(source);
165
- const matches = maskedSource.matchAll(WORKSPACE_BLOCK_IFRAME_GLOBAL_DOM_PATTERN);
166
- const findings = [];
167
- for (const match of matches) {
168
- const identifier = match[0];
169
- const matchIndex = match.index ?? -1;
170
- if (matchIndex < 0) {
171
- continue;
172
- }
173
- if (!isGlobalDomAccessCandidate(source, matchIndex, identifier)) {
174
- continue;
175
- }
176
- findings.push(`${relativePath}:${getSourceLineNumber(source, matchIndex)}`);
177
- }
178
- return findings;
179
- });
180
- }
181
- function getWorkspaceBlockRequiredFiles(block) {
182
- const blockDir = path.join("src", "blocks", block.slug);
183
- return Array.from(new Set([
184
- block.typesFile,
185
- block.apiTypesFile,
186
- block.openApiFile,
187
- path.join(blockDir, "index.tsx"),
188
- ...WORKSPACE_GENERATED_BLOCK_ARTIFACTS.map((fileName) => path.join(blockDir, fileName)),
189
- ].filter((filePath) => typeof filePath === "string")));
190
- }
191
- function checkWorkspaceBlockMetadata(projectDir, workspace, block) {
192
- const blockJsonRelativePath = path.join("src", "blocks", block.slug, "block.json");
193
- const blockJsonPath = path.join(projectDir, blockJsonRelativePath);
194
- if (!fs.existsSync(blockJsonPath)) {
195
- return createDoctorCheck(`Block metadata ${block.slug}`, "fail", `Missing ${blockJsonRelativePath}`);
196
- }
197
- let blockJson;
198
- try {
199
- blockJson = parseScaffoldBlockMetadata(JSON.parse(fs.readFileSync(blockJsonPath, "utf8")));
200
- }
201
- catch (error) {
202
- return createDoctorCheck(`Block metadata ${block.slug}`, "fail", error instanceof Error ? error.message : String(error));
203
- }
204
- const expectedName = `${workspace.workspace.namespace}/${block.slug}`;
205
- const issues = [];
206
- if (blockJson.name !== expectedName) {
207
- issues.push(`block.json name must equal "${expectedName}"`);
208
- }
209
- if (blockJson.textdomain !== workspace.workspace.textDomain) {
210
- issues.push(`block.json textdomain must equal "${workspace.workspace.textDomain}"`);
211
- }
212
- return createDoctorCheck(`Block metadata ${block.slug}`, issues.length === 0 ? "pass" : "fail", issues.length === 0
213
- ? `block.json matches ${expectedName} and ${workspace.workspace.textDomain}`
214
- : issues.join("; "));
215
- }
216
- function checkWorkspaceBlockHooks(projectDir, blockSlug) {
217
- const blockJsonRelativePath = path.join("src", "blocks", blockSlug, "block.json");
218
- const blockJsonPath = path.join(projectDir, blockJsonRelativePath);
219
- if (!fs.existsSync(blockJsonPath)) {
220
- return createDoctorCheck(`Block hooks ${blockSlug}`, "fail", `Missing ${blockJsonRelativePath}`);
221
- }
222
- let blockJson;
223
- try {
224
- blockJson = parseScaffoldBlockMetadata(JSON.parse(fs.readFileSync(blockJsonPath, "utf8")));
225
- }
226
- catch (error) {
227
- return createDoctorCheck(`Block hooks ${blockSlug}`, "fail", error instanceof Error ? error.message : String(error));
228
- }
229
- const blockHooks = blockJson.blockHooks;
230
- if (blockHooks === undefined) {
231
- return createDoctorCheck(`Block hooks ${blockSlug}`, "pass", "No blockHooks metadata configured");
232
- }
233
- if (!blockHooks || typeof blockHooks !== "object" || Array.isArray(blockHooks)) {
234
- return createDoctorCheck(`Block hooks ${blockSlug}`, "fail", `${blockJsonRelativePath} must define blockHooks as an object when present.`);
235
- }
236
- const blockName = typeof blockJson.name === "string" && blockJson.name.trim().length > 0
237
- ? blockJson.name.trim()
238
- : null;
239
- const invalidEntries = Object.entries(blockHooks).filter(([anchor, position]) => (blockName !== null && anchor.trim() === blockName) ||
240
- anchor.trim().length === 0 ||
241
- anchor !== anchor.trim() ||
242
- !HOOKED_BLOCK_ANCHOR_PATTERN.test(anchor) ||
243
- typeof position !== "string" ||
244
- !HOOKED_BLOCK_POSITION_SET.has(position));
245
- return createDoctorCheck(`Block hooks ${blockSlug}`, invalidEntries.length === 0 ? "pass" : "fail", invalidEntries.length === 0
246
- ? `blockHooks metadata is valid${Object.keys(blockHooks).length > 0 ? ` (${Object.keys(blockHooks).join(", ")})` : ""}`
247
- : `Invalid blockHooks entries: ${invalidEntries
248
- .map(([anchor, position]) => `${anchor || "<empty>"} => ${String(position)}`)
249
- .join(", ")}`);
250
- }
251
- function checkWorkspaceBlockCollectionImport(projectDir, blockSlug) {
252
- const entryRelativePath = path.join("src", "blocks", blockSlug, "index.tsx");
253
- const entryPath = path.join(projectDir, entryRelativePath);
254
- if (!fs.existsSync(entryPath)) {
255
- return createDoctorCheck(`Block collection ${blockSlug}`, "fail", `Missing ${entryRelativePath}`);
256
- }
257
- const source = fs.readFileSync(entryPath, "utf8");
258
- const hasCollectionImport = WORKSPACE_COLLECTION_IMPORT_PATTERN.test(source);
259
- return createDoctorCheck(`Block collection ${blockSlug}`, hasCollectionImport ? "pass" : "fail", hasCollectionImport
260
- ? "Shared block collection import is present"
261
- : `Missing a shared collection import like ${WORKSPACE_COLLECTION_IMPORT_LINE}`);
262
- }
263
- function checkWorkspaceBlockIframeCompatibility(projectDir, blockSlug) {
264
- const metadataResult = readWorkspaceBlockIframeMetadata(projectDir, blockSlug);
265
- if (!metadataResult.document) {
266
- return [
267
- createDoctorCheck(`Block iframe/API v3 ${blockSlug}`, "warn", metadataResult.error ?? `Unable to inspect ${metadataResult.blockJsonRelativePath}`, WORKSPACE_BLOCK_IFRAME_DIAGNOSTIC_CODES.API_VERSION),
268
- ];
269
- }
270
- const blockJson = metadataResult.document;
271
- const apiVersion = typeof blockJson.apiVersion === "number" && Number.isFinite(blockJson.apiVersion)
272
- ? blockJson.apiVersion
273
- : null;
274
- const blockDir = path.join(projectDir, "src", "blocks", blockSlug);
275
- const localStyleFiles = WORKSPACE_BLOCK_LOCAL_STYLE_FILES.filter((fileName) => fs.existsSync(path.join(blockDir, fileName))).map((fileName) => normalizePathSeparators(path.join("src", "blocks", blockSlug, fileName)));
276
- const hasRegisteredEditorStyles = hasRegisteredBlockAsset(blockJson.style) ||
277
- hasRegisteredBlockAsset(blockJson.editorStyle);
278
- const editorSources = collectWorkspaceBlockEditorSources(projectDir, blockSlug);
279
- const editorWrapperSources = editorSources.filter((source) => !isWorkspaceBlockSaveSource(source.relativePath));
280
- const globalDomAccesses = findWorkspaceBlockGlobalDomAccesses(editorSources);
281
- const hasBlockPropsUsage = editorSources.some(({ source }) => hasExecutablePattern(source, WORKSPACE_BLOCK_PROPS_PATTERN));
282
- const hasEditorBlockPropsUsage = editorWrapperSources.some(({ source }) => hasExecutablePattern(source, WORKSPACE_BLOCK_PROPS_PATTERN));
283
- const blockWrapperStatus = editorWrapperSources.length === 0 || hasEditorBlockPropsUsage ? "pass" : "warn";
284
- const blockWrapperDetail = editorSources.length === 0
285
- ? "No editor-facing block source files found; general file checks will report missing entrypoints"
286
- : editorWrapperSources.length === 0
287
- ? "No editor wrapper source files found; general file checks will report missing entrypoints"
288
- : hasEditorBlockPropsUsage
289
- ? "Editor-facing sources use block wrapper props"
290
- : hasBlockPropsUsage
291
- ? "Only save-facing useBlockProps.save() usage was detected. Confirm the editor wrapper also receives useBlockProps() or useInnerBlocksProps() before relying on iframe editor rendering."
292
- : "No useBlockProps(), useBlockProps.save(), or useInnerBlocksProps() usage was detected in editor-facing sources. Confirm the block wrapper receives WordPress block editor props before relying on iframe editor rendering.";
293
- return [
294
- createDoctorCheck(`Block iframe API version ${blockSlug}`, apiVersion !== null && apiVersion >= 3 ? "pass" : "warn", apiVersion !== null && apiVersion >= 3
295
- ? "block.json declares apiVersion 3 for iframe editor readiness"
296
- : `Set ${metadataResult.blockJsonRelativePath} apiVersion to 3 after testing the block in iframe-enabled Post Editor and Site Editor contexts. WordPress recommends API v3 for iframe editor compatibility. See ${WORKSPACE_BLOCK_IFRAME_COMPATIBILITY_DOC_URL}`, WORKSPACE_BLOCK_IFRAME_DIAGNOSTIC_CODES.API_VERSION),
297
- createDoctorCheck(`Block iframe styles ${blockSlug}`, localStyleFiles.length === 0 || hasRegisteredEditorStyles ? "pass" : "warn", localStyleFiles.length === 0
298
- ? "No local block stylesheet source files found to register"
299
- : hasRegisteredEditorStyles
300
- ? "block.json registers block styles for iframe editor loading"
301
- : `Found stylesheet source files (${localStyleFiles.join(", ")}) but block.json does not declare style or editorStyle. Register block content styles so iframe editors do not depend on parent admin styles.`, WORKSPACE_BLOCK_IFRAME_DIAGNOSTIC_CODES.EDITOR_STYLES),
302
- createDoctorCheck(`Block iframe globals ${blockSlug}`, globalDomAccesses.length === 0 ? "pass" : "warn", globalDomAccesses.length === 0
303
- ? "No direct window/document/parent DOM access detected in editor-facing block sources"
304
- : `Direct global DOM access detected at ${globalDomAccesses.join(", ")}. Prefer element.ownerDocument/defaultView via refs or useRefEffect for iframe editor content.`, WORKSPACE_BLOCK_IFRAME_DIAGNOSTIC_CODES.EDITOR_GLOBALS),
305
- createDoctorCheck(`Block iframe wrapper ${blockSlug}`, blockWrapperStatus, blockWrapperDetail, WORKSPACE_BLOCK_IFRAME_DIAGNOSTIC_CODES.BLOCK_PROPS),
306
- ];
307
- }
308
- function checkWorkspacePatternBootstrap(projectDir, packageName) {
309
- const bootstrapPath = resolveWorkspaceBootstrapPath(projectDir, packageName);
310
- if (!fs.existsSync(bootstrapPath)) {
311
- return createDoctorCheck("Pattern bootstrap", "fail", `Missing ${path.basename(bootstrapPath)}`);
312
- }
313
- const source = fs.readFileSync(bootstrapPath, "utf8");
314
- const hasCategoryAnchor = source.includes("register_block_pattern_category");
315
- const hasPatternGlob = source.includes("/src/patterns/*.php");
316
- return createDoctorCheck("Pattern bootstrap", hasCategoryAnchor && hasPatternGlob ? "pass" : "fail", hasCategoryAnchor && hasPatternGlob
317
- ? "Pattern category and loader hooks are present"
318
- : "Missing pattern category registration or src/patterns loader hook");
319
- }
320
- function checkVariationEntrypoint(projectDir, blockSlug) {
321
- const entryPath = path.join(projectDir, "src", "blocks", blockSlug, "index.tsx");
322
- if (!fs.existsSync(entryPath)) {
323
- return createDoctorCheck(`Variation entrypoint ${blockSlug}`, "fail", `Missing ${path.relative(projectDir, entryPath)}`);
324
- }
325
- const source = fs.readFileSync(entryPath, "utf8");
326
- const hasImport = hasUncommentedPattern(source, WORKSPACE_VARIATIONS_IMPORT_PATTERN);
327
- const hasCall = hasExecutablePattern(source, WORKSPACE_VARIATIONS_CALL_PATTERN);
328
- return createDoctorCheck(`Variation entrypoint ${blockSlug}`, hasImport && hasCall ? "pass" : "fail", hasImport && hasCall
329
- ? "Variations registration hook is present"
330
- : "Missing ./variations import or registerWorkspaceVariations() call");
331
- }
332
- function checkBlockStyleEntrypoint(projectDir, blockSlug) {
333
- const entryPath = path.join(projectDir, "src", "blocks", blockSlug, "index.tsx");
334
- if (!fs.existsSync(entryPath)) {
335
- return createDoctorCheck(`Block style entrypoint ${blockSlug}`, "fail", `Missing ${path.relative(projectDir, entryPath)}`);
336
- }
337
- const source = fs.readFileSync(entryPath, "utf8");
338
- const hasImport = hasUncommentedPattern(source, WORKSPACE_BLOCK_STYLES_IMPORT_PATTERN);
339
- const hasCall = hasExecutablePattern(source, WORKSPACE_BLOCK_STYLES_CALL_PATTERN);
340
- return createDoctorCheck(`Block style entrypoint ${blockSlug}`, hasImport && hasCall ? "pass" : "fail", hasImport && hasCall
341
- ? "Block style registration hook is present"
342
- : "Missing ./styles import or registerWorkspaceBlockStyles() call");
343
- }
344
- function checkBlockTransformEntrypoint(projectDir, blockSlug) {
345
- const entryPath = path.join(projectDir, "src", "blocks", blockSlug, "index.tsx");
346
- if (!fs.existsSync(entryPath)) {
347
- return createDoctorCheck(`Block transform entrypoint ${blockSlug}`, "fail", `Missing ${path.relative(projectDir, entryPath)}`);
348
- }
349
- const source = fs.readFileSync(entryPath, "utf8");
350
- const hasImport = hasUncommentedPattern(source, WORKSPACE_BLOCK_TRANSFORMS_IMPORT_PATTERN);
351
- const hasCall = hasExecutablePattern(source, WORKSPACE_BLOCK_TRANSFORMS_CALL_PATTERN);
352
- return createDoctorCheck(`Block transform entrypoint ${blockSlug}`, hasImport && hasCall ? "pass" : "fail", hasImport && hasCall
353
- ? "Block transform registration hook is present"
354
- : "Missing ./transforms import or applyWorkspaceBlockTransforms(registration.settings) call");
355
- }
356
- function checkBlockTransformConfig(workspace, transform) {
357
- const expectedTo = `${workspace.workspace.namespace}/${transform.block}`;
358
- const issues = [];
359
- if (!WORKSPACE_FULL_BLOCK_NAME_PATTERN.test(transform.from)) {
360
- issues.push("from must use full namespace/block format");
361
- }
362
- if (transform.to !== expectedTo) {
363
- issues.push(`to must equal "${expectedTo}" for workspace block "${transform.block}"`);
364
- }
365
- return createDoctorCheck(`Block transform config ${transform.block}/${transform.slug}`, issues.length === 0 ? "pass" : "fail", issues.length === 0
366
- ? `${transform.from} transforms into ${transform.to}`
367
- : issues.join("; "));
368
- }
1
+ import { getWorkspaceBlockAddonDoctorChecks, } from "./cli-doctor-workspace-block-addons.js";
2
+ import { getWorkspaceBlockIframeCompatibilityChecks, } from "./cli-doctor-workspace-block-iframe.js";
3
+ import { getWorkspaceBlockCoreDoctorChecks, } from "./cli-doctor-workspace-block-metadata.js";
369
4
  /**
370
5
  * Collect block-, variation-, transform-, and pattern-related workspace doctor checks.
371
6
  *
@@ -376,63 +11,10 @@ function checkBlockTransformConfig(workspace, transform) {
376
11
  export function getWorkspaceBlockDoctorChecks(workspace, inventory) {
377
12
  const checks = [];
378
13
  for (const block of inventory.blocks) {
379
- checks.push(checkExistingFiles(workspace.projectDir, `Block ${block.slug}`, getWorkspaceBlockRequiredFiles(block)));
380
- checks.push(checkWorkspaceBlockMetadata(workspace.projectDir, workspace, block));
381
- checks.push(checkWorkspaceBlockHooks(workspace.projectDir, block.slug));
382
- checks.push(checkWorkspaceBlockCollectionImport(workspace.projectDir, block.slug));
383
- checks.push(...checkWorkspaceBlockIframeCompatibility(workspace.projectDir, block.slug));
14
+ checks.push(...getWorkspaceBlockCoreDoctorChecks(workspace, block));
15
+ checks.push(...getWorkspaceBlockIframeCompatibilityChecks(workspace.projectDir, block.slug));
384
16
  }
385
17
  const registeredBlockSlugs = new Set(inventory.blocks.map((block) => block.slug));
386
- const variationTargetBlocks = new Set();
387
- for (const variation of inventory.variations) {
388
- if (!registeredBlockSlugs.has(variation.block)) {
389
- checks.push(createDoctorCheck(`Variation ${variation.block}/${variation.slug}`, "fail", `Variation references unknown block "${variation.block}"`));
390
- continue;
391
- }
392
- variationTargetBlocks.add(variation.block);
393
- checks.push(checkExistingFiles(workspace.projectDir, `Variation ${variation.block}/${variation.slug}`, [variation.file]));
394
- }
395
- for (const blockSlug of variationTargetBlocks) {
396
- checks.push(checkVariationEntrypoint(workspace.projectDir, blockSlug));
397
- }
398
- const blockStyleTargetBlocks = new Set();
399
- for (const blockStyle of inventory.blockStyles) {
400
- if (!registeredBlockSlugs.has(blockStyle.block)) {
401
- checks.push(createDoctorCheck(`Block style ${blockStyle.block}/${blockStyle.slug}`, "fail", `Block style references unknown block "${blockStyle.block}"`));
402
- continue;
403
- }
404
- blockStyleTargetBlocks.add(blockStyle.block);
405
- checks.push(checkExistingFiles(workspace.projectDir, `Block style ${blockStyle.block}/${blockStyle.slug}`, [blockStyle.file]));
406
- }
407
- for (const blockSlug of blockStyleTargetBlocks) {
408
- checks.push(checkExistingFiles(workspace.projectDir, `Block style registry ${blockSlug}`, [
409
- path.join("src", "blocks", blockSlug, "styles", "index.ts"),
410
- ]));
411
- checks.push(checkBlockStyleEntrypoint(workspace.projectDir, blockSlug));
412
- }
413
- const blockTransformTargetBlocks = new Set();
414
- for (const blockTransform of inventory.blockTransforms) {
415
- if (!registeredBlockSlugs.has(blockTransform.block)) {
416
- checks.push(createDoctorCheck(`Block transform ${blockTransform.block}/${blockTransform.slug}`, "fail", `Block transform references unknown block "${blockTransform.block}"`));
417
- continue;
418
- }
419
- blockTransformTargetBlocks.add(blockTransform.block);
420
- checks.push(checkBlockTransformConfig(workspace, blockTransform));
421
- checks.push(checkExistingFiles(workspace.projectDir, `Block transform ${blockTransform.block}/${blockTransform.slug}`, [blockTransform.file]));
422
- }
423
- for (const blockSlug of blockTransformTargetBlocks) {
424
- checks.push(checkExistingFiles(workspace.projectDir, `Block transform registry ${blockSlug}`, [
425
- path.join("src", "blocks", blockSlug, "transforms", "index.ts"),
426
- ]));
427
- checks.push(checkBlockTransformEntrypoint(workspace.projectDir, blockSlug));
428
- }
429
- const shouldCheckPatternBootstrap = inventory.patterns.length > 0 ||
430
- fs.existsSync(path.join(workspace.projectDir, "src", "patterns"));
431
- if (shouldCheckPatternBootstrap) {
432
- checks.push(checkWorkspacePatternBootstrap(workspace.projectDir, workspace.packageName));
433
- }
434
- for (const pattern of inventory.patterns) {
435
- checks.push(checkExistingFiles(workspace.projectDir, `Pattern ${pattern.slug}`, [pattern.file]));
436
- }
18
+ checks.push(...getWorkspaceBlockAddonDoctorChecks(workspace, inventory, registeredBlockSlugs));
437
19
  return checks;
438
20
  }
@@ -0,0 +1,11 @@
1
+ import type { DoctorCheck } from "./cli-doctor.js";
2
+ import type { WorkspaceInventory } from "./workspace-inventory.js";
3
+ import type { WorkspaceProject } from "./workspace-project.js";
4
+ /**
5
+ * Collect ability workspace doctor checks while preserving existing row order.
6
+ *
7
+ * @param workspace Resolved workspace metadata and filesystem paths.
8
+ * @param abilities Ability entries parsed from the workspace inventory.
9
+ * @returns Ordered ability doctor checks.
10
+ */
11
+ export declare function getWorkspaceAbilityDoctorChecks(workspace: WorkspaceProject, abilities: WorkspaceInventory["abilities"]): DoctorCheck[];
@@ -0,0 +1,112 @@
1
+ import fs from "node:fs";
2
+ import path from "node:path";
3
+ import { checkExistingFiles, createDoctorCheck, resolveWorkspaceBootstrapPath, WORKSPACE_ABILITY_EDITOR_ASSET, WORKSPACE_ABILITY_EDITOR_SCRIPT, WORKSPACE_ABILITY_GLOB, } from "./cli-doctor-workspace-shared.js";
4
+ import { readJsonFileSync } from "./json-utils.js";
5
+ import { escapeRegex } from "./php-utils.js";
6
+ function getWorkspaceAbilityRequiredFiles(ability) {
7
+ return Array.from(new Set([
8
+ ability.clientFile,
9
+ ability.configFile,
10
+ ability.dataFile,
11
+ ability.inputSchemaFile,
12
+ ability.outputSchemaFile,
13
+ ability.phpFile,
14
+ ability.typesFile,
15
+ ]));
16
+ }
17
+ function checkWorkspaceAbilityConfig(projectDir, ability) {
18
+ const configPath = path.join(projectDir, ability.configFile);
19
+ if (!fs.existsSync(configPath)) {
20
+ return createDoctorCheck(`Ability config ${ability.slug}`, "fail", `Missing ${ability.configFile}`);
21
+ }
22
+ try {
23
+ const config = readJsonFileSync(configPath, {
24
+ context: "workspace ability config",
25
+ });
26
+ const abilityId = typeof config.abilityId === "string" ? config.abilityId.trim() : "";
27
+ const categorySlug = typeof config.category?.slug === "string"
28
+ ? config.category.slug.trim()
29
+ : "";
30
+ const hasValidAbilityId = /^[a-z0-9-]+\/[a-z0-9-]+$/u.test(abilityId);
31
+ const hasValidCategorySlug = /^[a-z0-9-]+$/u.test(categorySlug);
32
+ return createDoctorCheck(`Ability config ${ability.slug}`, hasValidAbilityId && hasValidCategorySlug ? "pass" : "fail", hasValidAbilityId && hasValidCategorySlug
33
+ ? `Ability id ${abilityId} in category ${categorySlug} is valid`
34
+ : "Ability config must define a valid abilityId (`namespace/ability-name`) and category.slug.");
35
+ }
36
+ catch (error) {
37
+ return createDoctorCheck(`Ability config ${ability.slug}`, "fail", error instanceof Error ? error.message : String(error));
38
+ }
39
+ }
40
+ function checkWorkspaceAbilityBootstrap(projectDir, packageName, phpPrefix) {
41
+ const bootstrapPath = resolveWorkspaceBootstrapPath(projectDir, packageName);
42
+ if (!fs.existsSync(bootstrapPath)) {
43
+ return createDoctorCheck("Ability bootstrap", "fail", `Missing ${path.basename(bootstrapPath)}`);
44
+ }
45
+ const source = fs.readFileSync(bootstrapPath, "utf8");
46
+ const loadFunctionName = `${phpPrefix}_load_workflow_abilities`;
47
+ const enqueueFunctionName = `${phpPrefix}_enqueue_workflow_abilities`;
48
+ const loadHook = `add_action( 'plugins_loaded', '${loadFunctionName}' );`;
49
+ const adminEnqueueHook = `add_action( 'admin_enqueue_scripts', '${enqueueFunctionName}' );`;
50
+ const editorEnqueueHook = `add_action( 'enqueue_block_editor_assets', '${enqueueFunctionName}' );`;
51
+ const hasLoaderHook = source.includes(loadHook);
52
+ const hasAdminEnqueueHook = source.includes(adminEnqueueHook);
53
+ const hasEditorEnqueueHook = source.includes(editorEnqueueHook);
54
+ const hasServerGlob = source.includes(WORKSPACE_ABILITY_GLOB);
55
+ const hasEditorScript = source.includes(WORKSPACE_ABILITY_EDITOR_SCRIPT);
56
+ const hasEditorAsset = source.includes(WORKSPACE_ABILITY_EDITOR_ASSET);
57
+ const hasScriptModuleEnqueue = source.includes("wp_enqueue_script_module");
58
+ return createDoctorCheck("Ability bootstrap", hasLoaderHook &&
59
+ hasAdminEnqueueHook &&
60
+ hasEditorEnqueueHook &&
61
+ hasServerGlob &&
62
+ hasEditorScript &&
63
+ hasEditorAsset &&
64
+ hasScriptModuleEnqueue
65
+ ? "pass"
66
+ : "fail", hasLoaderHook &&
67
+ hasAdminEnqueueHook &&
68
+ hasEditorEnqueueHook &&
69
+ hasServerGlob &&
70
+ hasEditorScript &&
71
+ hasEditorAsset &&
72
+ hasScriptModuleEnqueue
73
+ ? "Ability loader and admin/editor script-module bootstrap hooks are present"
74
+ : "Missing ability loader hook, script-module enqueue, or build/abilities asset references");
75
+ }
76
+ function checkWorkspaceAbilityIndex(projectDir, abilities) {
77
+ const indexRelativePath = [
78
+ path.join("src", "abilities", "index.ts"),
79
+ path.join("src", "abilities", "index.js"),
80
+ ].find((relativePath) => fs.existsSync(path.join(projectDir, relativePath)));
81
+ if (!indexRelativePath) {
82
+ return createDoctorCheck("Abilities index", "fail", "Missing src/abilities/index.ts or src/abilities/index.js");
83
+ }
84
+ const indexPath = path.join(projectDir, indexRelativePath);
85
+ const source = fs.readFileSync(indexPath, "utf8");
86
+ const missingExports = abilities.filter((ability) => {
87
+ const exportPattern = new RegExp(`^\\s*export\\s+(?:\\*\\s+from|\\{[^}]+\\}\\s+from)\\s+['"\`]\\./${escapeRegex(ability.slug)}\\/client['"\`]`, "mu");
88
+ return !exportPattern.test(source);
89
+ });
90
+ return createDoctorCheck("Abilities index", missingExports.length === 0 ? "pass" : "fail", missingExports.length === 0
91
+ ? "Ability client helpers are aggregated"
92
+ : `Missing ability exports for: ${missingExports.map((entry) => entry.slug).join(", ")}`);
93
+ }
94
+ /**
95
+ * Collect ability workspace doctor checks while preserving existing row order.
96
+ *
97
+ * @param workspace Resolved workspace metadata and filesystem paths.
98
+ * @param abilities Ability entries parsed from the workspace inventory.
99
+ * @returns Ordered ability doctor checks.
100
+ */
101
+ export function getWorkspaceAbilityDoctorChecks(workspace, abilities) {
102
+ const checks = [];
103
+ if (abilities.length > 0) {
104
+ checks.push(checkWorkspaceAbilityBootstrap(workspace.projectDir, workspace.packageName, workspace.workspace.phpPrefix));
105
+ checks.push(checkWorkspaceAbilityIndex(workspace.projectDir, abilities));
106
+ }
107
+ for (const ability of abilities) {
108
+ checks.push(checkWorkspaceAbilityConfig(workspace.projectDir, ability));
109
+ checks.push(checkExistingFiles(workspace.projectDir, `Ability ${ability.slug}`, getWorkspaceAbilityRequiredFiles(ability)));
110
+ }
111
+ return checks;
112
+ }
@@ -0,0 +1,11 @@
1
+ import type { DoctorCheck } from "./cli-doctor.js";
2
+ import type { WorkspaceInventory } from "./workspace-inventory.js";
3
+ import type { WorkspaceProject } from "./workspace-project.js";
4
+ /**
5
+ * Collect admin view workspace doctor checks while preserving existing row order.
6
+ *
7
+ * @param workspace Resolved workspace metadata and filesystem paths.
8
+ * @param inventory Parsed workspace inventory from `scripts/block-config.ts`.
9
+ * @returns Ordered admin view doctor checks.
10
+ */
11
+ export declare function getWorkspaceAdminViewDoctorChecks(workspace: WorkspaceProject, inventory: WorkspaceInventory): DoctorCheck[];