@wp-typia/project-tools 0.16.14 → 0.18.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/dist/runtime/block-generator-service-core.d.ts +1 -1
- package/dist/runtime/block-generator-service-core.js +2 -1
- package/dist/runtime/block-generator-service-spec.d.ts +8 -1
- package/dist/runtime/block-generator-service-spec.js +27 -0
- package/dist/runtime/built-in-block-artifacts.js +1 -0
- package/dist/runtime/built-in-block-code-artifacts.js +14 -1
- package/dist/runtime/built-in-block-code-templates/compound-child.d.ts +2 -2
- package/dist/runtime/built-in-block-code-templates/compound-child.js +30 -2
- package/dist/runtime/built-in-block-code-templates/compound-parent.d.ts +1 -1
- package/dist/runtime/built-in-block-code-templates/compound-parent.js +139 -19
- package/dist/runtime/built-in-block-code-templates/query-loop.d.ts +1 -0
- package/dist/runtime/built-in-block-code-templates/query-loop.js +70 -0
- package/dist/runtime/built-in-block-code-templates.d.ts +1 -0
- package/dist/runtime/built-in-block-code-templates.js +1 -0
- package/dist/runtime/built-in-block-non-ts-artifacts.js +2 -0
- package/dist/runtime/cli-add-block.d.ts +2 -1
- package/dist/runtime/cli-add-block.js +19 -1
- package/dist/runtime/cli-add-shared.d.ts +55 -1
- package/dist/runtime/cli-add-shared.js +101 -2
- package/dist/runtime/cli-add-workspace-assets.d.ts +21 -1
- package/dist/runtime/cli-add-workspace-assets.js +417 -1
- package/dist/runtime/cli-add-workspace-rest.d.ts +14 -0
- package/dist/runtime/cli-add-workspace-rest.js +1060 -0
- package/dist/runtime/cli-add-workspace.d.ts +10 -1
- package/dist/runtime/cli-add-workspace.js +10 -1
- package/dist/runtime/cli-add.d.ts +3 -3
- package/dist/runtime/cli-add.js +2 -2
- package/dist/runtime/cli-core.d.ts +3 -1
- package/dist/runtime/cli-core.js +2 -1
- package/dist/runtime/cli-doctor-workspace.js +135 -1
- package/dist/runtime/cli-help.js +10 -5
- package/dist/runtime/cli-scaffold.d.ts +11 -2
- package/dist/runtime/cli-scaffold.js +137 -36
- package/dist/runtime/cli-templates.d.ts +4 -4
- package/dist/runtime/cli-templates.js +79 -39
- package/dist/runtime/index.d.ts +4 -3
- package/dist/runtime/index.js +3 -2
- package/dist/runtime/local-dev-presets.js +27 -12
- package/dist/runtime/rest-resource-artifacts.d.ts +35 -0
- package/dist/runtime/rest-resource-artifacts.js +158 -0
- package/dist/runtime/scaffold-answer-resolution.d.ts +1 -1
- package/dist/runtime/scaffold-answer-resolution.js +94 -3
- package/dist/runtime/scaffold-apply-utils.d.ts +4 -3
- package/dist/runtime/scaffold-apply-utils.js +34 -17
- package/dist/runtime/scaffold-bootstrap.d.ts +15 -0
- package/dist/runtime/scaffold-bootstrap.js +29 -7
- package/dist/runtime/scaffold-documents.js +9 -9
- package/dist/runtime/scaffold-onboarding.js +17 -1
- package/dist/runtime/scaffold-package-manager-files.js +6 -1
- package/dist/runtime/scaffold-template-variables.js +6 -0
- package/dist/runtime/scaffold.d.ts +15 -1
- package/dist/runtime/scaffold.js +50 -8
- package/dist/runtime/template-defaults.d.ts +7 -0
- package/dist/runtime/template-defaults.js +4 -0
- package/dist/runtime/template-registry.d.ts +1 -1
- package/dist/runtime/template-registry.js +14 -1
- package/dist/runtime/template-render.d.ts +5 -2
- package/dist/runtime/template-render.js +9 -3
- package/dist/runtime/template-source-contracts.d.ts +11 -0
- package/dist/runtime/template-source-external.d.ts +1 -1
- package/dist/runtime/template-source-external.js +45 -13
- package/dist/runtime/template-source-normalization.d.ts +1 -1
- package/dist/runtime/template-source-normalization.js +5 -1
- package/dist/runtime/template-source-remote.d.ts +5 -0
- package/dist/runtime/template-source-remote.js +33 -0
- package/dist/runtime/template-source.js +30 -1
- package/dist/runtime/workspace-inventory.d.ts +43 -1
- package/dist/runtime/workspace-inventory.js +132 -1
- package/dist/runtime/workspace-project.d.ts +1 -1
- package/dist/runtime/workspace-project.js +2 -2
- package/package.json +3 -3
- package/templates/_shared/compound/core/scripts/add-compound-child.ts.mustache +428 -49
- package/templates/query-loop/inc/query-runtime.php.mustache +85 -0
- package/templates/query-loop/package.json.mustache +32 -0
- package/templates/query-loop/src/patterns/grid.php.mustache +49 -0
- package/templates/query-loop/src/patterns/list.php.mustache +48 -0
- package/templates/query-loop/src/query-extension.ts.mustache +41 -0
- package/templates/query-loop/webpack.config.js.mustache +16 -0
- package/templates/query-loop/{{slugKebabCase}}.php.mustache +84 -0
|
@@ -4,13 +4,25 @@ import { type WorkspaceProject } from "./workspace-project.js";
|
|
|
4
4
|
/**
|
|
5
5
|
* Supported top-level `wp-typia add` kinds exposed by the canonical CLI.
|
|
6
6
|
*/
|
|
7
|
-
export declare const ADD_KIND_IDS: readonly ["block", "variation", "pattern", "binding-source", "hooked-block"];
|
|
7
|
+
export declare const ADD_KIND_IDS: readonly ["block", "variation", "pattern", "binding-source", "rest-resource", "hooked-block", "editor-plugin"];
|
|
8
8
|
export type AddKindId = (typeof ADD_KIND_IDS)[number];
|
|
9
|
+
/**
|
|
10
|
+
* Supported plugin-level REST resource methods accepted by
|
|
11
|
+
* `wp-typia add rest-resource --methods`.
|
|
12
|
+
*/
|
|
13
|
+
export declare const REST_RESOURCE_METHOD_IDS: readonly ["list", "read", "create", "update", "delete"];
|
|
14
|
+
export type RestResourceMethodId = (typeof REST_RESOURCE_METHOD_IDS)[number];
|
|
15
|
+
/**
|
|
16
|
+
* Supported editor-plugin shell slots accepted by `wp-typia add editor-plugin --slot`.
|
|
17
|
+
*/
|
|
18
|
+
export declare const EDITOR_PLUGIN_SLOT_IDS: readonly ["PluginSidebar"];
|
|
19
|
+
export type EditorPluginSlotId = (typeof EDITOR_PLUGIN_SLOT_IDS)[number];
|
|
9
20
|
/**
|
|
10
21
|
* Supported built-in block families accepted by `wp-typia add block --template`.
|
|
11
22
|
*/
|
|
12
23
|
export declare const ADD_BLOCK_TEMPLATE_IDS: readonly ["basic", "interactivity", "persistence", "compound"];
|
|
13
24
|
export type AddBlockTemplateId = (typeof ADD_BLOCK_TEMPLATE_IDS)[number];
|
|
25
|
+
export declare const REST_RESOURCE_NAMESPACE_PATTERN: RegExp;
|
|
14
26
|
export interface RunAddVariationCommandOptions {
|
|
15
27
|
blockName: string;
|
|
16
28
|
cwd?: string;
|
|
@@ -24,12 +36,32 @@ export interface RunAddBindingSourceCommandOptions {
|
|
|
24
36
|
bindingSourceName: string;
|
|
25
37
|
cwd?: string;
|
|
26
38
|
}
|
|
39
|
+
export interface RunAddRestResourceCommandOptions {
|
|
40
|
+
cwd?: string;
|
|
41
|
+
methods?: string;
|
|
42
|
+
namespace?: string;
|
|
43
|
+
restResourceName: string;
|
|
44
|
+
}
|
|
27
45
|
export interface RunAddHookedBlockCommandOptions {
|
|
28
46
|
anchorBlockName: string;
|
|
29
47
|
blockName: string;
|
|
30
48
|
cwd?: string;
|
|
31
49
|
position: string;
|
|
32
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* Options for `wp-typia add editor-plugin`.
|
|
53
|
+
*
|
|
54
|
+
* @property cwd Working directory used to resolve the nearest official workspace.
|
|
55
|
+
* Defaults to `process.cwd()`.
|
|
56
|
+
* @property editorPluginName Human-entered editor plugin name that will be
|
|
57
|
+
* normalized into the generated slug.
|
|
58
|
+
* @property slot Optional editor shell slot. Defaults to `PluginSidebar`.
|
|
59
|
+
*/
|
|
60
|
+
export interface RunAddEditorPluginCommandOptions {
|
|
61
|
+
cwd?: string;
|
|
62
|
+
editorPluginName: string;
|
|
63
|
+
slot?: string;
|
|
64
|
+
}
|
|
33
65
|
export interface RunAddBlockCommandOptions {
|
|
34
66
|
blockName: string;
|
|
35
67
|
cwd?: string;
|
|
@@ -59,6 +91,9 @@ export interface WorkspaceMutationSnapshot {
|
|
|
59
91
|
}
|
|
60
92
|
export declare function normalizeBlockSlug(input: string): string;
|
|
61
93
|
export declare function assertValidGeneratedSlug(label: string, slug: string, usage: string): string;
|
|
94
|
+
export declare function assertValidRestResourceNamespace(namespace: string): string;
|
|
95
|
+
export declare function resolveRestResourceNamespace(workspaceNamespace: string, namespace?: string): string;
|
|
96
|
+
export declare function assertValidRestResourceMethods(methods?: string): RestResourceMethodId[];
|
|
62
97
|
export declare function assertValidHookedBlockPosition(position: string): HookedBlockPositionId;
|
|
63
98
|
export declare function getWorkspaceBootstrapPath(workspace: WorkspaceProject): string;
|
|
64
99
|
export declare function buildWorkspacePhpPrefix(workspacePhpPrefix: string, slug: string): string;
|
|
@@ -86,6 +121,14 @@ export declare function snapshotWorkspaceFiles(filePaths: string[]): Promise<Wor
|
|
|
86
121
|
export declare function rollbackWorkspaceMutation(snapshot: WorkspaceMutationSnapshot): Promise<void>;
|
|
87
122
|
export declare function resolveWorkspaceBlock(inventory: WorkspaceInventory, blockSlug: string): WorkspaceInventory["blocks"][number];
|
|
88
123
|
export declare function assertValidHookAnchor(anchorBlockName: string): string;
|
|
124
|
+
/**
|
|
125
|
+
* Validate and normalize the editor plugin shell slot.
|
|
126
|
+
*
|
|
127
|
+
* @param slot Optional shell slot. Defaults to `PluginSidebar`.
|
|
128
|
+
* @returns The canonical editor plugin slot id.
|
|
129
|
+
* @throws {Error} When the slot is not supported by the workspace scaffold.
|
|
130
|
+
*/
|
|
131
|
+
export declare function assertValidEditorPluginSlot(slot?: string): EditorPluginSlotId;
|
|
89
132
|
export declare function readWorkspaceBlockJson(projectDir: string, blockSlug: string): {
|
|
90
133
|
blockJson: Record<string, unknown>;
|
|
91
134
|
blockJsonPath: string;
|
|
@@ -94,6 +137,17 @@ export declare function getMutableBlockHooks(blockJson: Record<string, unknown>,
|
|
|
94
137
|
export declare function assertVariationDoesNotExist(projectDir: string, blockSlug: string, variationSlug: string, inventory: WorkspaceInventory): void;
|
|
95
138
|
export declare function assertPatternDoesNotExist(projectDir: string, patternSlug: string, inventory: WorkspaceInventory): void;
|
|
96
139
|
export declare function assertBindingSourceDoesNotExist(projectDir: string, bindingSourceSlug: string, inventory: WorkspaceInventory): void;
|
|
140
|
+
export declare function assertRestResourceDoesNotExist(projectDir: string, restResourceSlug: string, inventory: WorkspaceInventory): void;
|
|
141
|
+
/**
|
|
142
|
+
* Ensure an editor plugin scaffold does not already exist on disk or in the
|
|
143
|
+
* workspace inventory.
|
|
144
|
+
*
|
|
145
|
+
* @param projectDir Workspace root directory.
|
|
146
|
+
* @param editorPluginSlug Normalized editor plugin slug.
|
|
147
|
+
* @param inventory Parsed workspace inventory.
|
|
148
|
+
* @throws {Error} When the directory or inventory entry already exists.
|
|
149
|
+
*/
|
|
150
|
+
export declare function assertEditorPluginDoesNotExist(projectDir: string, editorPluginSlug: string, inventory: WorkspaceInventory): void;
|
|
97
151
|
/**
|
|
98
152
|
* Returns help text for the canonical `wp-typia add` subcommands.
|
|
99
153
|
*/
|
|
@@ -8,7 +8,30 @@ import { WORKSPACE_TEMPLATE_PACKAGE, } from "./workspace-project.js";
|
|
|
8
8
|
/**
|
|
9
9
|
* Supported top-level `wp-typia add` kinds exposed by the canonical CLI.
|
|
10
10
|
*/
|
|
11
|
-
export const ADD_KIND_IDS = [
|
|
11
|
+
export const ADD_KIND_IDS = [
|
|
12
|
+
"block",
|
|
13
|
+
"variation",
|
|
14
|
+
"pattern",
|
|
15
|
+
"binding-source",
|
|
16
|
+
"rest-resource",
|
|
17
|
+
"hooked-block",
|
|
18
|
+
"editor-plugin",
|
|
19
|
+
];
|
|
20
|
+
/**
|
|
21
|
+
* Supported plugin-level REST resource methods accepted by
|
|
22
|
+
* `wp-typia add rest-resource --methods`.
|
|
23
|
+
*/
|
|
24
|
+
export const REST_RESOURCE_METHOD_IDS = [
|
|
25
|
+
"list",
|
|
26
|
+
"read",
|
|
27
|
+
"create",
|
|
28
|
+
"update",
|
|
29
|
+
"delete",
|
|
30
|
+
];
|
|
31
|
+
/**
|
|
32
|
+
* Supported editor-plugin shell slots accepted by `wp-typia add editor-plugin --slot`.
|
|
33
|
+
*/
|
|
34
|
+
export const EDITOR_PLUGIN_SLOT_IDS = ["PluginSidebar"];
|
|
12
35
|
/**
|
|
13
36
|
* Supported built-in block families accepted by `wp-typia add block --template`.
|
|
14
37
|
*/
|
|
@@ -19,6 +42,7 @@ export const ADD_BLOCK_TEMPLATE_IDS = [
|
|
|
19
42
|
"compound",
|
|
20
43
|
];
|
|
21
44
|
const WORKSPACE_GENERATED_SLUG_PATTERN = /^[a-z][a-z0-9-]*$/;
|
|
45
|
+
export const REST_RESOURCE_NAMESPACE_PATTERN = /^[a-z][a-z0-9-]*(?:\/[a-z0-9-]+)+$/u;
|
|
22
46
|
export function normalizeBlockSlug(input) {
|
|
23
47
|
return toKebabCase(input);
|
|
24
48
|
}
|
|
@@ -31,6 +55,33 @@ export function assertValidGeneratedSlug(label, slug, usage) {
|
|
|
31
55
|
}
|
|
32
56
|
return slug;
|
|
33
57
|
}
|
|
58
|
+
export function assertValidRestResourceNamespace(namespace) {
|
|
59
|
+
const trimmed = namespace.trim();
|
|
60
|
+
if (!trimmed) {
|
|
61
|
+
throw new Error("REST resource namespace is required. Use `--namespace <vendor/v1>` or let the workspace default apply.");
|
|
62
|
+
}
|
|
63
|
+
if (!REST_RESOURCE_NAMESPACE_PATTERN.test(trimmed)) {
|
|
64
|
+
throw new Error("REST resource namespace must use lowercase slash-separated segments like `demo-space/v1`.");
|
|
65
|
+
}
|
|
66
|
+
return trimmed;
|
|
67
|
+
}
|
|
68
|
+
export function resolveRestResourceNamespace(workspaceNamespace, namespace) {
|
|
69
|
+
return assertValidRestResourceNamespace(namespace ?? `${workspaceNamespace}/v1`);
|
|
70
|
+
}
|
|
71
|
+
export function assertValidRestResourceMethods(methods) {
|
|
72
|
+
const rawMethods = typeof methods === "string" && methods.trim().length > 0
|
|
73
|
+
? methods.split(",").map((value) => value.trim()).filter(Boolean)
|
|
74
|
+
: ["list", "read", "create"];
|
|
75
|
+
const normalizedMethods = Array.from(new Set(rawMethods));
|
|
76
|
+
const invalidMethods = normalizedMethods.filter((method) => !REST_RESOURCE_METHOD_IDS.includes(method));
|
|
77
|
+
if (invalidMethods.length > 0) {
|
|
78
|
+
throw new Error(`REST resource methods must be a comma-separated list of: ${REST_RESOURCE_METHOD_IDS.join(", ")}.`);
|
|
79
|
+
}
|
|
80
|
+
if (normalizedMethods.length === 0) {
|
|
81
|
+
throw new Error("REST resource methods must include at least one of: list, read, create, update, delete.");
|
|
82
|
+
}
|
|
83
|
+
return normalizedMethods;
|
|
84
|
+
}
|
|
34
85
|
export function assertValidHookedBlockPosition(position) {
|
|
35
86
|
if (HOOKED_BLOCK_POSITION_IDS.includes(position)) {
|
|
36
87
|
return position;
|
|
@@ -121,6 +172,19 @@ export function assertValidHookAnchor(anchorBlockName) {
|
|
|
121
172
|
}
|
|
122
173
|
return trimmed;
|
|
123
174
|
}
|
|
175
|
+
/**
|
|
176
|
+
* Validate and normalize the editor plugin shell slot.
|
|
177
|
+
*
|
|
178
|
+
* @param slot Optional shell slot. Defaults to `PluginSidebar`.
|
|
179
|
+
* @returns The canonical editor plugin slot id.
|
|
180
|
+
* @throws {Error} When the slot is not supported by the workspace scaffold.
|
|
181
|
+
*/
|
|
182
|
+
export function assertValidEditorPluginSlot(slot = "PluginSidebar") {
|
|
183
|
+
if (EDITOR_PLUGIN_SLOT_IDS.includes(slot)) {
|
|
184
|
+
return slot;
|
|
185
|
+
}
|
|
186
|
+
throw new Error(`Editor plugin slot must be one of: ${EDITOR_PLUGIN_SLOT_IDS.join(", ")}.`);
|
|
187
|
+
}
|
|
124
188
|
export function readWorkspaceBlockJson(projectDir, blockSlug) {
|
|
125
189
|
const blockJsonPath = path.join(projectDir, "src", "blocks", blockSlug, "block.json");
|
|
126
190
|
if (!fs.existsSync(blockJsonPath)) {
|
|
@@ -179,6 +243,37 @@ export function assertBindingSourceDoesNotExist(projectDir, bindingSourceSlug, i
|
|
|
179
243
|
throw new Error(`A binding source inventory entry already exists for ${bindingSourceSlug}. Choose a different name.`);
|
|
180
244
|
}
|
|
181
245
|
}
|
|
246
|
+
export function assertRestResourceDoesNotExist(projectDir, restResourceSlug, inventory) {
|
|
247
|
+
const restResourceDir = path.join(projectDir, "src", "rest", restResourceSlug);
|
|
248
|
+
const restResourcePhpPath = path.join(projectDir, "inc", "rest", `${restResourceSlug}.php`);
|
|
249
|
+
if (fs.existsSync(restResourceDir)) {
|
|
250
|
+
throw new Error(`A REST resource already exists at ${path.relative(projectDir, restResourceDir)}. Choose a different name.`);
|
|
251
|
+
}
|
|
252
|
+
if (fs.existsSync(restResourcePhpPath)) {
|
|
253
|
+
throw new Error(`A REST resource bootstrap already exists at ${path.relative(projectDir, restResourcePhpPath)}. Choose a different name.`);
|
|
254
|
+
}
|
|
255
|
+
if (inventory.restResources.some((entry) => entry.slug === restResourceSlug)) {
|
|
256
|
+
throw new Error(`A REST resource inventory entry already exists for ${restResourceSlug}. Choose a different name.`);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Ensure an editor plugin scaffold does not already exist on disk or in the
|
|
261
|
+
* workspace inventory.
|
|
262
|
+
*
|
|
263
|
+
* @param projectDir Workspace root directory.
|
|
264
|
+
* @param editorPluginSlug Normalized editor plugin slug.
|
|
265
|
+
* @param inventory Parsed workspace inventory.
|
|
266
|
+
* @throws {Error} When the directory or inventory entry already exists.
|
|
267
|
+
*/
|
|
268
|
+
export function assertEditorPluginDoesNotExist(projectDir, editorPluginSlug, inventory) {
|
|
269
|
+
const editorPluginDir = path.join(projectDir, "src", "editor-plugins", editorPluginSlug);
|
|
270
|
+
if (fs.existsSync(editorPluginDir)) {
|
|
271
|
+
throw new Error(`An editor plugin already exists at ${path.relative(projectDir, editorPluginDir)}. Choose a different name.`);
|
|
272
|
+
}
|
|
273
|
+
if (inventory.editorPlugins.some((entry) => entry.slug === editorPluginSlug)) {
|
|
274
|
+
throw new Error(`An editor plugin inventory entry already exists for ${editorPluginSlug}. Choose a different name.`);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
182
277
|
/**
|
|
183
278
|
* Returns help text for the canonical `wp-typia add` subcommands.
|
|
184
279
|
*/
|
|
@@ -188,12 +283,16 @@ export function formatAddHelpText() {
|
|
|
188
283
|
wp-typia add variation <name> --block <block-slug>
|
|
189
284
|
wp-typia add pattern <name>
|
|
190
285
|
wp-typia add binding-source <name>
|
|
286
|
+
wp-typia add rest-resource <name> [--namespace <vendor/v1>] [--methods <list,read,create,update,delete>]
|
|
191
287
|
wp-typia add hooked-block <block-slug> --anchor <anchor-block-name> --position <${HOOKED_BLOCK_POSITION_IDS.join("|")}>
|
|
288
|
+
wp-typia add editor-plugin <name> [--slot <${EDITOR_PLUGIN_SLOT_IDS.join("|")}>]
|
|
192
289
|
|
|
193
290
|
Notes:
|
|
194
291
|
\`wp-typia add\` runs only inside official ${WORKSPACE_TEMPLATE_PACKAGE} workspaces.
|
|
195
292
|
\`add variation\` targets an existing block slug from \`scripts/block-config.ts\`.
|
|
196
293
|
\`add pattern\` scaffolds a namespaced PHP pattern shell under \`src/patterns/\`.
|
|
197
294
|
\`add binding-source\` scaffolds shared PHP and editor registration under \`src/bindings/\`.
|
|
198
|
-
\`add
|
|
295
|
+
\`add rest-resource\` scaffolds plugin-level TypeScript REST contracts under \`src/rest/\` and PHP route glue under \`inc/rest/\`.
|
|
296
|
+
\`add hooked-block\` patches an existing workspace block's \`block.json\` \`blockHooks\` metadata.
|
|
297
|
+
\`add editor-plugin\` scaffolds a document-level editor extension under \`src/editor-plugins/\`.`;
|
|
199
298
|
}
|
|
@@ -1,4 +1,24 @@
|
|
|
1
|
-
import { type RunAddBindingSourceCommandOptions, type RunAddPatternCommandOptions } from "./cli-add-shared.js";
|
|
1
|
+
import { type RunAddBindingSourceCommandOptions, type RunAddEditorPluginCommandOptions, type RunAddPatternCommandOptions } from "./cli-add-shared.js";
|
|
2
|
+
/**
|
|
3
|
+
* Add one document-level editor plugin scaffold to an official workspace project.
|
|
4
|
+
*
|
|
5
|
+
* @param options Command options for the editor-plugin scaffold workflow.
|
|
6
|
+
* @param options.cwd Working directory used to resolve the nearest official workspace.
|
|
7
|
+
* Defaults to `process.cwd()`.
|
|
8
|
+
* @param options.editorPluginName Human-entered editor-plugin name that will be
|
|
9
|
+
* normalized and validated before files are written.
|
|
10
|
+
* @param options.slot Optional editor plugin shell slot. Defaults to `PluginSidebar`.
|
|
11
|
+
* @returns A promise that resolves with the normalized `editorPluginSlug`, chosen
|
|
12
|
+
* `slot`, and owning `projectDir` after the scaffold files and inventory entry
|
|
13
|
+
* are written successfully.
|
|
14
|
+
* @throws {Error} When the command is run outside an official workspace, when the
|
|
15
|
+
* slug or slot is invalid, or when a conflicting file or inventory entry exists.
|
|
16
|
+
*/
|
|
17
|
+
export declare function runAddEditorPluginCommand({ cwd, editorPluginName, slot, }: RunAddEditorPluginCommandOptions): Promise<{
|
|
18
|
+
editorPluginSlug: string;
|
|
19
|
+
projectDir: string;
|
|
20
|
+
slot: string;
|
|
21
|
+
}>;
|
|
2
22
|
/**
|
|
3
23
|
* Add one PHP block pattern shell to an official workspace project.
|
|
4
24
|
*
|