@wp-typia/project-tools 0.22.9 → 0.22.10
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/dist/runtime/ai-artifacts.js +3 -4
- package/dist/runtime/ai-feature-artifacts.js +2 -4
- package/dist/runtime/cli-add-filesystem.js +2 -15
- package/dist/runtime/cli-add-types.js +3 -1
- package/dist/runtime/cli-doctor-workspace-shared.js +3 -0
- package/dist/runtime/cli-doctor-workspace.d.ts +1 -1
- package/dist/runtime/cli-doctor-workspace.js +8 -5
- package/dist/runtime/cli-doctor.js +1 -1
- package/dist/runtime/fs-async.d.ts +7 -0
- package/dist/runtime/fs-async.js +11 -2
- package/dist/runtime/migration-maintenance-verify.js +3 -0
- package/dist/runtime/migration-render-generated.js +4 -0
- package/dist/runtime/package-versions.js +3 -7
- package/dist/runtime/scaffold-repository-reference.js +3 -7
- package/dist/runtime/typia-llm.js +3 -4
- package/dist/runtime/workspace-inventory-mutations.d.ts +24 -0
- package/dist/runtime/workspace-inventory-mutations.js +132 -0
- package/dist/runtime/workspace-inventory-parser.d.ts +52 -0
- package/dist/runtime/workspace-inventory-parser.js +511 -0
- package/dist/runtime/workspace-inventory-read.d.ts +44 -0
- package/dist/runtime/workspace-inventory-read.js +91 -0
- package/dist/runtime/workspace-inventory-templates.d.ts +35 -0
- package/dist/runtime/workspace-inventory-templates.js +198 -0
- package/dist/runtime/workspace-inventory-types.d.ts +171 -0
- package/dist/runtime/workspace-inventory-types.js +1 -0
- package/dist/runtime/workspace-inventory.d.ts +5 -252
- package/dist/runtime/workspace-inventory.js +4 -928
- package/package.json +2 -2
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
export const BLOCK_CONFIG_ENTRY_MARKER = "\t// wp-typia add block entries";
|
|
2
|
+
export const VARIATION_CONFIG_ENTRY_MARKER = "\t// wp-typia add variation entries";
|
|
3
|
+
export const BLOCK_STYLE_CONFIG_ENTRY_MARKER = "\t// wp-typia add style entries";
|
|
4
|
+
export const BLOCK_TRANSFORM_CONFIG_ENTRY_MARKER = "\t// wp-typia add transform entries";
|
|
5
|
+
export const PATTERN_CONFIG_ENTRY_MARKER = "\t// wp-typia add pattern entries";
|
|
6
|
+
export const BINDING_SOURCE_CONFIG_ENTRY_MARKER = "\t// wp-typia add binding-source entries";
|
|
7
|
+
export const REST_RESOURCE_CONFIG_ENTRY_MARKER = "\t// wp-typia add rest-resource entries";
|
|
8
|
+
export const ABILITY_CONFIG_ENTRY_MARKER = "\t// wp-typia add ability entries";
|
|
9
|
+
export const AI_FEATURE_CONFIG_ENTRY_MARKER = "\t// wp-typia add ai-feature entries";
|
|
10
|
+
export const ADMIN_VIEW_CONFIG_ENTRY_MARKER = "\t// wp-typia add admin-view entries";
|
|
11
|
+
/**
|
|
12
|
+
* Marker used to append generated editor-plugin entries into `EDITOR_PLUGINS`.
|
|
13
|
+
*/
|
|
14
|
+
export const EDITOR_PLUGIN_CONFIG_ENTRY_MARKER = "\t// wp-typia add editor-plugin entries";
|
|
15
|
+
export const VARIATIONS_INTERFACE_SECTION = `
|
|
16
|
+
|
|
17
|
+
export interface WorkspaceVariationConfig {
|
|
18
|
+
\tblock: string;
|
|
19
|
+
\tfile: string;
|
|
20
|
+
\tslug: string;
|
|
21
|
+
}
|
|
22
|
+
`;
|
|
23
|
+
export const VARIATIONS_CONST_SECTION = `
|
|
24
|
+
|
|
25
|
+
export const VARIATIONS: WorkspaceVariationConfig[] = [
|
|
26
|
+
\t// wp-typia add variation entries
|
|
27
|
+
];
|
|
28
|
+
`;
|
|
29
|
+
export const BLOCK_STYLES_INTERFACE_SECTION = `
|
|
30
|
+
|
|
31
|
+
export interface WorkspaceBlockStyleConfig {
|
|
32
|
+
\tblock: string;
|
|
33
|
+
\tfile: string;
|
|
34
|
+
\tslug: string;
|
|
35
|
+
}
|
|
36
|
+
`;
|
|
37
|
+
export const BLOCK_STYLES_CONST_SECTION = `
|
|
38
|
+
|
|
39
|
+
export const BLOCK_STYLES: WorkspaceBlockStyleConfig[] = [
|
|
40
|
+
\t// wp-typia add style entries
|
|
41
|
+
];
|
|
42
|
+
`;
|
|
43
|
+
export const BLOCK_TRANSFORMS_INTERFACE_SECTION = `
|
|
44
|
+
|
|
45
|
+
export interface WorkspaceBlockTransformConfig {
|
|
46
|
+
\tblock: string;
|
|
47
|
+
\tfile: string;
|
|
48
|
+
\tfrom: string;
|
|
49
|
+
\tslug: string;
|
|
50
|
+
\tto: string;
|
|
51
|
+
}
|
|
52
|
+
`;
|
|
53
|
+
export const BLOCK_TRANSFORMS_CONST_SECTION = `
|
|
54
|
+
|
|
55
|
+
export const BLOCK_TRANSFORMS: WorkspaceBlockTransformConfig[] = [
|
|
56
|
+
\t// wp-typia add transform entries
|
|
57
|
+
];
|
|
58
|
+
`;
|
|
59
|
+
export const PATTERNS_INTERFACE_SECTION = `
|
|
60
|
+
|
|
61
|
+
export interface WorkspacePatternConfig {
|
|
62
|
+
\tfile: string;
|
|
63
|
+
\tslug: string;
|
|
64
|
+
}
|
|
65
|
+
`;
|
|
66
|
+
export const PATTERNS_CONST_SECTION = `
|
|
67
|
+
|
|
68
|
+
export const PATTERNS: WorkspacePatternConfig[] = [
|
|
69
|
+
\t// wp-typia add pattern entries
|
|
70
|
+
];
|
|
71
|
+
`;
|
|
72
|
+
export const BINDING_SOURCES_INTERFACE_SECTION = `
|
|
73
|
+
|
|
74
|
+
export interface WorkspaceBindingSourceConfig {
|
|
75
|
+
\tattribute?: string;
|
|
76
|
+
\tblock?: string;
|
|
77
|
+
\teditorFile: string;
|
|
78
|
+
\tserverFile: string;
|
|
79
|
+
\tslug: string;
|
|
80
|
+
}
|
|
81
|
+
`;
|
|
82
|
+
export const BINDING_SOURCES_CONST_SECTION = `
|
|
83
|
+
|
|
84
|
+
export const BINDING_SOURCES: WorkspaceBindingSourceConfig[] = [
|
|
85
|
+
\t// wp-typia add binding-source entries
|
|
86
|
+
];
|
|
87
|
+
`;
|
|
88
|
+
export const REST_RESOURCES_INTERFACE_SECTION = `
|
|
89
|
+
|
|
90
|
+
export interface WorkspaceRestResourceConfig {
|
|
91
|
+
\tapiFile: string;
|
|
92
|
+
\tclientFile: string;
|
|
93
|
+
\tdataFile: string;
|
|
94
|
+
\tmethods: Array< 'list' | 'read' | 'create' | 'update' | 'delete' >;
|
|
95
|
+
\tnamespace: string;
|
|
96
|
+
\topenApiFile: string;
|
|
97
|
+
\tphpFile: string;
|
|
98
|
+
\trestManifest?: ReturnType<
|
|
99
|
+
\t\ttypeof import( '@wp-typia/block-runtime/metadata-core' ).defineEndpointManifest
|
|
100
|
+
\t>;
|
|
101
|
+
\tslug: string;
|
|
102
|
+
\ttypesFile: string;
|
|
103
|
+
\tvalidatorsFile: string;
|
|
104
|
+
}
|
|
105
|
+
`;
|
|
106
|
+
export const REST_RESOURCES_CONST_SECTION = `
|
|
107
|
+
|
|
108
|
+
export const REST_RESOURCES: WorkspaceRestResourceConfig[] = [
|
|
109
|
+
\t// wp-typia add rest-resource entries
|
|
110
|
+
];
|
|
111
|
+
`;
|
|
112
|
+
export const WORKSPACE_COMPATIBILITY_CONFIG_FIELD = `\tcompatibility?: {
|
|
113
|
+
\t\thardMinimums: {
|
|
114
|
+
\t\t\tphp?: string;
|
|
115
|
+
\t\t\twordpress?: string;
|
|
116
|
+
\t\t};
|
|
117
|
+
\t\tmode: 'baseline' | 'optional' | 'required';
|
|
118
|
+
\t\toptionalFeatureIds: string[];
|
|
119
|
+
\t\toptionalFeatures: string[];
|
|
120
|
+
\t\trequiredFeatureIds: string[];
|
|
121
|
+
\t\trequiredFeatures: string[];
|
|
122
|
+
\t\truntimeGates: string[];
|
|
123
|
+
\t};
|
|
124
|
+
`;
|
|
125
|
+
export const ABILITIES_INTERFACE_SECTION = `
|
|
126
|
+
|
|
127
|
+
export interface WorkspaceAbilityConfig {
|
|
128
|
+
\tclientFile: string;
|
|
129
|
+
${WORKSPACE_COMPATIBILITY_CONFIG_FIELD}\tconfigFile: string;
|
|
130
|
+
\tdataFile: string;
|
|
131
|
+
\tinputSchemaFile: string;
|
|
132
|
+
\tinputTypeName: string;
|
|
133
|
+
\toutputSchemaFile: string;
|
|
134
|
+
\toutputTypeName: string;
|
|
135
|
+
\tphpFile: string;
|
|
136
|
+
\tslug: string;
|
|
137
|
+
\ttypesFile: string;
|
|
138
|
+
}
|
|
139
|
+
`;
|
|
140
|
+
export const ABILITIES_CONST_SECTION = `
|
|
141
|
+
|
|
142
|
+
export const ABILITIES: WorkspaceAbilityConfig[] = [
|
|
143
|
+
\t// wp-typia add ability entries
|
|
144
|
+
];
|
|
145
|
+
`;
|
|
146
|
+
export const AI_FEATURES_INTERFACE_SECTION = `
|
|
147
|
+
|
|
148
|
+
export interface WorkspaceAiFeatureConfig {
|
|
149
|
+
\taiSchemaFile: string;
|
|
150
|
+
\tapiFile: string;
|
|
151
|
+
\tclientFile: string;
|
|
152
|
+
${WORKSPACE_COMPATIBILITY_CONFIG_FIELD}\tdataFile: string;
|
|
153
|
+
\tnamespace: string;
|
|
154
|
+
\topenApiFile: string;
|
|
155
|
+
\tphpFile: string;
|
|
156
|
+
\trestManifest?: ReturnType<
|
|
157
|
+
\t\ttypeof import( '@wp-typia/block-runtime/metadata-core' ).defineEndpointManifest
|
|
158
|
+
\t>;
|
|
159
|
+
\tslug: string;
|
|
160
|
+
\ttypesFile: string;
|
|
161
|
+
\tvalidatorsFile: string;
|
|
162
|
+
}
|
|
163
|
+
`;
|
|
164
|
+
export const AI_FEATURES_CONST_SECTION = `
|
|
165
|
+
|
|
166
|
+
export const AI_FEATURES: WorkspaceAiFeatureConfig[] = [
|
|
167
|
+
\t// wp-typia add ai-feature entries
|
|
168
|
+
];
|
|
169
|
+
`;
|
|
170
|
+
export const ADMIN_VIEWS_INTERFACE_SECTION = `
|
|
171
|
+
|
|
172
|
+
export interface WorkspaceAdminViewConfig {
|
|
173
|
+
\tfile: string;
|
|
174
|
+
\tphpFile: string;
|
|
175
|
+
\tslug: string;
|
|
176
|
+
\tsource?: string;
|
|
177
|
+
}
|
|
178
|
+
`;
|
|
179
|
+
export const ADMIN_VIEWS_CONST_SECTION = `
|
|
180
|
+
|
|
181
|
+
export const ADMIN_VIEWS: WorkspaceAdminViewConfig[] = [
|
|
182
|
+
\t// wp-typia add admin-view entries
|
|
183
|
+
];
|
|
184
|
+
`;
|
|
185
|
+
export const EDITOR_PLUGINS_INTERFACE_SECTION = `
|
|
186
|
+
|
|
187
|
+
export interface WorkspaceEditorPluginConfig {
|
|
188
|
+
\tfile: string;
|
|
189
|
+
\tslug: string;
|
|
190
|
+
\tslot: string;
|
|
191
|
+
}
|
|
192
|
+
`;
|
|
193
|
+
export const EDITOR_PLUGINS_CONST_SECTION = `
|
|
194
|
+
|
|
195
|
+
export const EDITOR_PLUGINS: WorkspaceEditorPluginConfig[] = [
|
|
196
|
+
\t// wp-typia add editor-plugin entries
|
|
197
|
+
];
|
|
198
|
+
`;
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
export interface WorkspaceBlockInventoryEntry {
|
|
2
|
+
apiTypesFile?: string;
|
|
3
|
+
attributeTypeName?: string;
|
|
4
|
+
openApiFile?: string;
|
|
5
|
+
slug: string;
|
|
6
|
+
typesFile: string;
|
|
7
|
+
}
|
|
8
|
+
export interface WorkspaceVariationInventoryEntry {
|
|
9
|
+
block: string;
|
|
10
|
+
file: string;
|
|
11
|
+
slug: string;
|
|
12
|
+
}
|
|
13
|
+
export interface WorkspaceBlockStyleInventoryEntry {
|
|
14
|
+
block: string;
|
|
15
|
+
file: string;
|
|
16
|
+
slug: string;
|
|
17
|
+
}
|
|
18
|
+
export interface WorkspaceBlockTransformInventoryEntry {
|
|
19
|
+
block: string;
|
|
20
|
+
file: string;
|
|
21
|
+
from: string;
|
|
22
|
+
slug: string;
|
|
23
|
+
to: string;
|
|
24
|
+
}
|
|
25
|
+
export interface WorkspacePatternInventoryEntry {
|
|
26
|
+
file: string;
|
|
27
|
+
slug: string;
|
|
28
|
+
}
|
|
29
|
+
export interface WorkspaceBindingSourceInventoryEntry {
|
|
30
|
+
attribute?: string;
|
|
31
|
+
block?: string;
|
|
32
|
+
editorFile: string;
|
|
33
|
+
serverFile: string;
|
|
34
|
+
slug: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* REST-resource entry parsed from `scripts/block-config.ts`.
|
|
38
|
+
*
|
|
39
|
+
* Each file path is stored relative to the workspace root so doctor checks and
|
|
40
|
+
* workspace mutation helpers can resolve the generated TypeScript, OpenAPI, and
|
|
41
|
+
* PHP route artifacts without guessing their locations.
|
|
42
|
+
*/
|
|
43
|
+
export interface WorkspaceRestResourceInventoryEntry {
|
|
44
|
+
apiFile: string;
|
|
45
|
+
clientFile: string;
|
|
46
|
+
dataFile: string;
|
|
47
|
+
methods: string[];
|
|
48
|
+
namespace: string;
|
|
49
|
+
openApiFile: string;
|
|
50
|
+
phpFile: string;
|
|
51
|
+
slug: string;
|
|
52
|
+
typesFile: string;
|
|
53
|
+
validatorsFile: string;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Ability entry parsed from `scripts/block-config.ts`.
|
|
57
|
+
*
|
|
58
|
+
* Each file path stays relative to the workspace root so doctor checks, schema
|
|
59
|
+
* sync scripts, and generated admin/editor helpers can resolve typed workflow
|
|
60
|
+
* artifacts without guessing their locations.
|
|
61
|
+
*/
|
|
62
|
+
export interface WorkspaceAbilityInventoryEntry {
|
|
63
|
+
clientFile: string;
|
|
64
|
+
configFile: string;
|
|
65
|
+
dataFile: string;
|
|
66
|
+
inputSchemaFile: string;
|
|
67
|
+
inputTypeName: string;
|
|
68
|
+
outputSchemaFile: string;
|
|
69
|
+
outputTypeName: string;
|
|
70
|
+
phpFile: string;
|
|
71
|
+
slug: string;
|
|
72
|
+
typesFile: string;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* AI-feature entry parsed from `scripts/block-config.ts`.
|
|
76
|
+
*
|
|
77
|
+
* Each file path stays relative to the workspace root so doctor checks, add
|
|
78
|
+
* workflows, and split sync scripts can reason about the REST and AI-safe
|
|
79
|
+
* artifacts without guessing their locations.
|
|
80
|
+
*/
|
|
81
|
+
export interface WorkspaceAiFeatureInventoryEntry {
|
|
82
|
+
aiSchemaFile: string;
|
|
83
|
+
apiFile: string;
|
|
84
|
+
clientFile: string;
|
|
85
|
+
dataFile: string;
|
|
86
|
+
namespace: string;
|
|
87
|
+
openApiFile: string;
|
|
88
|
+
phpFile: string;
|
|
89
|
+
slug: string;
|
|
90
|
+
typesFile: string;
|
|
91
|
+
validatorsFile: string;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* DataViews admin-screen entry parsed from `scripts/block-config.ts`.
|
|
95
|
+
*
|
|
96
|
+
* @property file Relative path to the generated admin view shared entry file.
|
|
97
|
+
* @property phpFile Relative path to the generated WordPress admin page glue.
|
|
98
|
+
* @property slug Normalized admin view slug.
|
|
99
|
+
* @property source Optional source locator such as `rest-resource:products` or
|
|
100
|
+
* `core-data:postType/post`.
|
|
101
|
+
*/
|
|
102
|
+
export interface WorkspaceAdminViewInventoryEntry {
|
|
103
|
+
file: string;
|
|
104
|
+
phpFile: string;
|
|
105
|
+
slug: string;
|
|
106
|
+
source?: string;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Editor-plugin entry parsed from `scripts/block-config.ts`.
|
|
110
|
+
*
|
|
111
|
+
* @property file Relative path to the generated editor plugin entry file.
|
|
112
|
+
* @property slug Normalized editor plugin slug.
|
|
113
|
+
* @property slot Canonical editor shell slot for the plugin scaffold.
|
|
114
|
+
*/
|
|
115
|
+
export interface WorkspaceEditorPluginInventoryEntry {
|
|
116
|
+
file: string;
|
|
117
|
+
slug: string;
|
|
118
|
+
slot: string;
|
|
119
|
+
}
|
|
120
|
+
export interface WorkspaceInventory {
|
|
121
|
+
adminViews: WorkspaceAdminViewInventoryEntry[];
|
|
122
|
+
bindingSources: WorkspaceBindingSourceInventoryEntry[];
|
|
123
|
+
blockConfigPath: string;
|
|
124
|
+
blocks: WorkspaceBlockInventoryEntry[];
|
|
125
|
+
blockStyles: WorkspaceBlockStyleInventoryEntry[];
|
|
126
|
+
blockTransforms: WorkspaceBlockTransformInventoryEntry[];
|
|
127
|
+
abilities: WorkspaceAbilityInventoryEntry[];
|
|
128
|
+
aiFeatures: WorkspaceAiFeatureInventoryEntry[];
|
|
129
|
+
hasAbilitiesSection: boolean;
|
|
130
|
+
hasAdminViewsSection: boolean;
|
|
131
|
+
hasBindingSourcesSection: boolean;
|
|
132
|
+
hasAiFeaturesSection: boolean;
|
|
133
|
+
hasBlockStylesSection: boolean;
|
|
134
|
+
hasBlockTransformsSection: boolean;
|
|
135
|
+
hasEditorPluginsSection: boolean;
|
|
136
|
+
hasPatternsSection: boolean;
|
|
137
|
+
hasRestResourcesSection: boolean;
|
|
138
|
+
hasVariationsSection: boolean;
|
|
139
|
+
editorPlugins: WorkspaceEditorPluginInventoryEntry[];
|
|
140
|
+
patterns: WorkspacePatternInventoryEntry[];
|
|
141
|
+
restResources: WorkspaceRestResourceInventoryEntry[];
|
|
142
|
+
source: string;
|
|
143
|
+
variations: WorkspaceVariationInventoryEntry[];
|
|
144
|
+
}
|
|
145
|
+
export type WorkspaceBlockSelectOption = {
|
|
146
|
+
description: string;
|
|
147
|
+
name: string;
|
|
148
|
+
value: string;
|
|
149
|
+
};
|
|
150
|
+
export type WorkspaceInventoryParseResult = Omit<WorkspaceInventory, "blockConfigPath">;
|
|
151
|
+
export type WorkspaceInventoryEntriesKey = {
|
|
152
|
+
[Key in keyof WorkspaceInventoryParseResult]: WorkspaceInventoryParseResult[Key] extends unknown[] ? Key : never;
|
|
153
|
+
}[keyof WorkspaceInventoryParseResult];
|
|
154
|
+
export type WorkspaceInventorySectionFlagKey = {
|
|
155
|
+
[Key in keyof WorkspaceInventoryParseResult]: WorkspaceInventoryParseResult[Key] extends boolean ? Key : never;
|
|
156
|
+
}[keyof WorkspaceInventoryParseResult];
|
|
157
|
+
export type WorkspaceInventoryUpdateOptions = {
|
|
158
|
+
abilityEntries?: string[];
|
|
159
|
+
adminViewEntries?: string[];
|
|
160
|
+
aiFeatureEntries?: string[];
|
|
161
|
+
blockEntries?: string[];
|
|
162
|
+
blockStyleEntries?: string[];
|
|
163
|
+
blockTransformEntries?: string[];
|
|
164
|
+
bindingSourceEntries?: string[];
|
|
165
|
+
editorPluginEntries?: string[];
|
|
166
|
+
patternEntries?: string[];
|
|
167
|
+
restResourceEntries?: string[];
|
|
168
|
+
transformSource?: (source: string) => string;
|
|
169
|
+
variationEntries?: string[];
|
|
170
|
+
};
|
|
171
|
+
export type WorkspaceInventoryAppendOptionKey = Exclude<keyof WorkspaceInventoryUpdateOptions, "transformSource">;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,252 +1,5 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
typesFile: string;
|
|
7
|
-
}
|
|
8
|
-
export interface WorkspaceVariationInventoryEntry {
|
|
9
|
-
block: string;
|
|
10
|
-
file: string;
|
|
11
|
-
slug: string;
|
|
12
|
-
}
|
|
13
|
-
export interface WorkspaceBlockStyleInventoryEntry {
|
|
14
|
-
block: string;
|
|
15
|
-
file: string;
|
|
16
|
-
slug: string;
|
|
17
|
-
}
|
|
18
|
-
export interface WorkspaceBlockTransformInventoryEntry {
|
|
19
|
-
block: string;
|
|
20
|
-
file: string;
|
|
21
|
-
from: string;
|
|
22
|
-
slug: string;
|
|
23
|
-
to: string;
|
|
24
|
-
}
|
|
25
|
-
export interface WorkspacePatternInventoryEntry {
|
|
26
|
-
file: string;
|
|
27
|
-
slug: string;
|
|
28
|
-
}
|
|
29
|
-
export interface WorkspaceBindingSourceInventoryEntry {
|
|
30
|
-
attribute?: string;
|
|
31
|
-
block?: string;
|
|
32
|
-
editorFile: string;
|
|
33
|
-
serverFile: string;
|
|
34
|
-
slug: string;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* REST-resource entry parsed from `scripts/block-config.ts`.
|
|
38
|
-
*
|
|
39
|
-
* Each file path is stored relative to the workspace root so doctor checks and
|
|
40
|
-
* workspace mutation helpers can resolve the generated TypeScript, OpenAPI, and
|
|
41
|
-
* PHP route artifacts without guessing their locations.
|
|
42
|
-
*/
|
|
43
|
-
export interface WorkspaceRestResourceInventoryEntry {
|
|
44
|
-
apiFile: string;
|
|
45
|
-
clientFile: string;
|
|
46
|
-
dataFile: string;
|
|
47
|
-
methods: string[];
|
|
48
|
-
namespace: string;
|
|
49
|
-
openApiFile: string;
|
|
50
|
-
phpFile: string;
|
|
51
|
-
slug: string;
|
|
52
|
-
typesFile: string;
|
|
53
|
-
validatorsFile: string;
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Ability entry parsed from `scripts/block-config.ts`.
|
|
57
|
-
*
|
|
58
|
-
* Each file path stays relative to the workspace root so doctor checks, schema
|
|
59
|
-
* sync scripts, and generated admin/editor helpers can resolve typed workflow
|
|
60
|
-
* artifacts without guessing their locations.
|
|
61
|
-
*/
|
|
62
|
-
export interface WorkspaceAbilityInventoryEntry {
|
|
63
|
-
clientFile: string;
|
|
64
|
-
configFile: string;
|
|
65
|
-
dataFile: string;
|
|
66
|
-
inputSchemaFile: string;
|
|
67
|
-
inputTypeName: string;
|
|
68
|
-
outputSchemaFile: string;
|
|
69
|
-
outputTypeName: string;
|
|
70
|
-
phpFile: string;
|
|
71
|
-
slug: string;
|
|
72
|
-
typesFile: string;
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* AI-feature entry parsed from `scripts/block-config.ts`.
|
|
76
|
-
*
|
|
77
|
-
* Each file path stays relative to the workspace root so doctor checks, add
|
|
78
|
-
* workflows, and split sync scripts can reason about the REST and AI-safe
|
|
79
|
-
* artifacts without guessing their locations.
|
|
80
|
-
*/
|
|
81
|
-
export interface WorkspaceAiFeatureInventoryEntry {
|
|
82
|
-
aiSchemaFile: string;
|
|
83
|
-
apiFile: string;
|
|
84
|
-
clientFile: string;
|
|
85
|
-
dataFile: string;
|
|
86
|
-
namespace: string;
|
|
87
|
-
openApiFile: string;
|
|
88
|
-
phpFile: string;
|
|
89
|
-
slug: string;
|
|
90
|
-
typesFile: string;
|
|
91
|
-
validatorsFile: string;
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* DataViews admin-screen entry parsed from `scripts/block-config.ts`.
|
|
95
|
-
*
|
|
96
|
-
* @property file Relative path to the generated admin view shared entry file.
|
|
97
|
-
* @property phpFile Relative path to the generated WordPress admin page glue.
|
|
98
|
-
* @property slug Normalized admin view slug.
|
|
99
|
-
* @property source Optional source locator such as `rest-resource:products` or
|
|
100
|
-
* `core-data:postType/post`.
|
|
101
|
-
*/
|
|
102
|
-
export interface WorkspaceAdminViewInventoryEntry {
|
|
103
|
-
file: string;
|
|
104
|
-
phpFile: string;
|
|
105
|
-
slug: string;
|
|
106
|
-
source?: string;
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* Editor-plugin entry parsed from `scripts/block-config.ts`.
|
|
110
|
-
*
|
|
111
|
-
* @property file Relative path to the generated editor plugin entry file.
|
|
112
|
-
* @property slug Normalized editor plugin slug.
|
|
113
|
-
* @property slot Canonical editor shell slot for the plugin scaffold.
|
|
114
|
-
*/
|
|
115
|
-
export interface WorkspaceEditorPluginInventoryEntry {
|
|
116
|
-
file: string;
|
|
117
|
-
slug: string;
|
|
118
|
-
slot: string;
|
|
119
|
-
}
|
|
120
|
-
export interface WorkspaceInventory {
|
|
121
|
-
adminViews: WorkspaceAdminViewInventoryEntry[];
|
|
122
|
-
bindingSources: WorkspaceBindingSourceInventoryEntry[];
|
|
123
|
-
blockConfigPath: string;
|
|
124
|
-
blocks: WorkspaceBlockInventoryEntry[];
|
|
125
|
-
blockStyles: WorkspaceBlockStyleInventoryEntry[];
|
|
126
|
-
blockTransforms: WorkspaceBlockTransformInventoryEntry[];
|
|
127
|
-
abilities: WorkspaceAbilityInventoryEntry[];
|
|
128
|
-
aiFeatures: WorkspaceAiFeatureInventoryEntry[];
|
|
129
|
-
hasAbilitiesSection: boolean;
|
|
130
|
-
hasAdminViewsSection: boolean;
|
|
131
|
-
hasBindingSourcesSection: boolean;
|
|
132
|
-
hasAiFeaturesSection: boolean;
|
|
133
|
-
hasBlockStylesSection: boolean;
|
|
134
|
-
hasBlockTransformsSection: boolean;
|
|
135
|
-
hasEditorPluginsSection: boolean;
|
|
136
|
-
hasPatternsSection: boolean;
|
|
137
|
-
hasRestResourcesSection: boolean;
|
|
138
|
-
hasVariationsSection: boolean;
|
|
139
|
-
editorPlugins: WorkspaceEditorPluginInventoryEntry[];
|
|
140
|
-
patterns: WorkspacePatternInventoryEntry[];
|
|
141
|
-
restResources: WorkspaceRestResourceInventoryEntry[];
|
|
142
|
-
source: string;
|
|
143
|
-
variations: WorkspaceVariationInventoryEntry[];
|
|
144
|
-
}
|
|
145
|
-
export type WorkspaceBlockSelectOption = {
|
|
146
|
-
description: string;
|
|
147
|
-
name: string;
|
|
148
|
-
value: string;
|
|
149
|
-
};
|
|
150
|
-
export declare const BLOCK_CONFIG_ENTRY_MARKER = "\t// wp-typia add block entries";
|
|
151
|
-
export declare const VARIATION_CONFIG_ENTRY_MARKER = "\t// wp-typia add variation entries";
|
|
152
|
-
export declare const BLOCK_STYLE_CONFIG_ENTRY_MARKER = "\t// wp-typia add style entries";
|
|
153
|
-
export declare const BLOCK_TRANSFORM_CONFIG_ENTRY_MARKER = "\t// wp-typia add transform entries";
|
|
154
|
-
export declare const PATTERN_CONFIG_ENTRY_MARKER = "\t// wp-typia add pattern entries";
|
|
155
|
-
export declare const BINDING_SOURCE_CONFIG_ENTRY_MARKER = "\t// wp-typia add binding-source entries";
|
|
156
|
-
export declare const REST_RESOURCE_CONFIG_ENTRY_MARKER = "\t// wp-typia add rest-resource entries";
|
|
157
|
-
export declare const ABILITY_CONFIG_ENTRY_MARKER = "\t// wp-typia add ability entries";
|
|
158
|
-
export declare const AI_FEATURE_CONFIG_ENTRY_MARKER = "\t// wp-typia add ai-feature entries";
|
|
159
|
-
export declare const ADMIN_VIEW_CONFIG_ENTRY_MARKER = "\t// wp-typia add admin-view entries";
|
|
160
|
-
/**
|
|
161
|
-
* Marker used to append generated editor-plugin entries into `EDITOR_PLUGINS`.
|
|
162
|
-
*/
|
|
163
|
-
export declare const EDITOR_PLUGIN_CONFIG_ENTRY_MARKER = "\t// wp-typia add editor-plugin entries";
|
|
164
|
-
type WorkspaceInventoryUpdateOptions = {
|
|
165
|
-
abilityEntries?: string[];
|
|
166
|
-
adminViewEntries?: string[];
|
|
167
|
-
aiFeatureEntries?: string[];
|
|
168
|
-
blockEntries?: string[];
|
|
169
|
-
blockStyleEntries?: string[];
|
|
170
|
-
blockTransformEntries?: string[];
|
|
171
|
-
bindingSourceEntries?: string[];
|
|
172
|
-
editorPluginEntries?: string[];
|
|
173
|
-
patternEntries?: string[];
|
|
174
|
-
restResourceEntries?: string[];
|
|
175
|
-
transformSource?: (source: string) => string;
|
|
176
|
-
variationEntries?: string[];
|
|
177
|
-
};
|
|
178
|
-
/**
|
|
179
|
-
* Parse workspace inventory entries from the source of `scripts/block-config.ts`.
|
|
180
|
-
*
|
|
181
|
-
* @param source Raw TypeScript source from `scripts/block-config.ts`.
|
|
182
|
-
* @returns Parsed inventory sections without the resolved `blockConfigPath`.
|
|
183
|
-
* @throws {Error} When `BLOCKS` is missing or any inventory entry is malformed.
|
|
184
|
-
*/
|
|
185
|
-
export declare function parseWorkspaceInventorySource(source: string): Omit<WorkspaceInventory, "blockConfigPath">;
|
|
186
|
-
/**
|
|
187
|
-
* Synchronously read and parse the canonical workspace inventory file.
|
|
188
|
-
*
|
|
189
|
-
* This compatibility helper is intentionally sync-only for callers that expose
|
|
190
|
-
* synchronous APIs. Prefer `readWorkspaceInventoryAsync()` from async command
|
|
191
|
-
* paths so workspace reads do not block the event loop.
|
|
192
|
-
*
|
|
193
|
-
* @param projectDir Workspace root directory.
|
|
194
|
-
* @returns Parsed `WorkspaceInventory` including the resolved `blockConfigPath`.
|
|
195
|
-
* @throws {Error} When `scripts/block-config.ts` is missing or invalid.
|
|
196
|
-
*/
|
|
197
|
-
export declare function readWorkspaceInventory(projectDir: string): WorkspaceInventory;
|
|
198
|
-
/**
|
|
199
|
-
* Asynchronously read and parse the canonical workspace inventory file.
|
|
200
|
-
*
|
|
201
|
-
* @param projectDir Workspace root directory.
|
|
202
|
-
* @returns Parsed `WorkspaceInventory` including the resolved `blockConfigPath`.
|
|
203
|
-
* @throws {Error} When `scripts/block-config.ts` is missing or invalid.
|
|
204
|
-
*/
|
|
205
|
-
export declare function readWorkspaceInventoryAsync(projectDir: string): Promise<WorkspaceInventory>;
|
|
206
|
-
/**
|
|
207
|
-
* Synchronously return select options for the current workspace block inventory.
|
|
208
|
-
*
|
|
209
|
-
* The `description` field mirrors `block.typesFile`, while `name` and `value`
|
|
210
|
-
* both map to the block slug for use in interactive add flows.
|
|
211
|
-
*
|
|
212
|
-
* @deprecated Use `getWorkspaceBlockSelectOptionsAsync()` from async command
|
|
213
|
-
* paths. This helper intentionally remains sync-only for compatibility callers.
|
|
214
|
-
*
|
|
215
|
-
* @param projectDir Workspace root directory.
|
|
216
|
-
* @returns Block options for variation-target selection.
|
|
217
|
-
*/
|
|
218
|
-
export declare function getWorkspaceBlockSelectOptions(projectDir: string): WorkspaceBlockSelectOption[];
|
|
219
|
-
/**
|
|
220
|
-
* Asynchronously return select options for the current workspace block inventory.
|
|
221
|
-
*
|
|
222
|
-
* The returned option shape matches `getWorkspaceBlockSelectOptions()` while
|
|
223
|
-
* avoiding synchronous inventory reads in interactive or async command paths.
|
|
224
|
-
*
|
|
225
|
-
* @param projectDir Workspace root directory.
|
|
226
|
-
* @returns Block options for variation-target selection.
|
|
227
|
-
*/
|
|
228
|
-
export declare function getWorkspaceBlockSelectOptionsAsync(projectDir: string): Promise<WorkspaceBlockSelectOption[]>;
|
|
229
|
-
/**
|
|
230
|
-
* Update `scripts/block-config.ts` source text with additional inventory entries.
|
|
231
|
-
*
|
|
232
|
-
* Missing inventory sections for variations, patterns, binding sources, REST
|
|
233
|
-
* resources, workflow abilities, AI features, editor plugins, block styles, and
|
|
234
|
-
* block transforms are created
|
|
235
|
-
* automatically before new entries are appended at their marker comments.
|
|
236
|
-
* When provided, `transformSource` runs before any entries are inserted.
|
|
237
|
-
*
|
|
238
|
-
* @param source Existing `scripts/block-config.ts` source.
|
|
239
|
-
* @param options Entry lists plus an optional source transformer.
|
|
240
|
-
* @returns Updated source text with all requested inventory entries appended.
|
|
241
|
-
*/
|
|
242
|
-
export declare function updateWorkspaceInventorySource(source: string, options?: WorkspaceInventoryUpdateOptions): string;
|
|
243
|
-
/**
|
|
244
|
-
* Append new entries to the canonical workspace inventory file on disk.
|
|
245
|
-
*
|
|
246
|
-
* @param projectDir Workspace root directory.
|
|
247
|
-
* @param options Entry lists and optional source transform passed through to
|
|
248
|
-
* `updateWorkspaceInventorySource`.
|
|
249
|
-
* @returns Resolves once `scripts/block-config.ts` has been updated if needed.
|
|
250
|
-
*/
|
|
251
|
-
export declare function appendWorkspaceInventoryEntries(projectDir: string, options: Parameters<typeof updateWorkspaceInventorySource>[1]): Promise<void>;
|
|
252
|
-
export {};
|
|
1
|
+
export { ABILITY_CONFIG_ENTRY_MARKER, ADMIN_VIEW_CONFIG_ENTRY_MARKER, AI_FEATURE_CONFIG_ENTRY_MARKER, BINDING_SOURCE_CONFIG_ENTRY_MARKER, BLOCK_CONFIG_ENTRY_MARKER, BLOCK_STYLE_CONFIG_ENTRY_MARKER, BLOCK_TRANSFORM_CONFIG_ENTRY_MARKER, EDITOR_PLUGIN_CONFIG_ENTRY_MARKER, PATTERN_CONFIG_ENTRY_MARKER, REST_RESOURCE_CONFIG_ENTRY_MARKER, VARIATION_CONFIG_ENTRY_MARKER, } from "./workspace-inventory-templates.js";
|
|
2
|
+
export { parseWorkspaceInventorySource } from "./workspace-inventory-parser.js";
|
|
3
|
+
export { getWorkspaceBlockSelectOptions, getWorkspaceBlockSelectOptionsAsync, readWorkspaceInventory, readWorkspaceInventoryAsync, } from "./workspace-inventory-read.js";
|
|
4
|
+
export { appendWorkspaceInventoryEntries, updateWorkspaceInventorySource, } from "./workspace-inventory-mutations.js";
|
|
5
|
+
export type { WorkspaceAbilityInventoryEntry, WorkspaceAdminViewInventoryEntry, WorkspaceAiFeatureInventoryEntry, WorkspaceBindingSourceInventoryEntry, WorkspaceBlockInventoryEntry, WorkspaceBlockSelectOption, WorkspaceBlockStyleInventoryEntry, WorkspaceBlockTransformInventoryEntry, WorkspaceEditorPluginInventoryEntry, WorkspaceInventory, WorkspacePatternInventoryEntry, WorkspaceRestResourceInventoryEntry, WorkspaceVariationInventoryEntry, } from "./workspace-inventory-types.js";
|