@wp-typia/project-tools 0.11.1 → 0.13.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/cli-add.d.ts +100 -4
- package/dist/runtime/cli-add.js +705 -79
- package/dist/runtime/cli-core.d.ts +7 -2
- package/dist/runtime/cli-core.js +6 -2
- package/dist/runtime/cli-doctor.js +279 -0
- package/dist/runtime/cli-help.js +10 -3
- package/dist/runtime/hooked-blocks.d.ts +17 -0
- package/dist/runtime/hooked-blocks.js +13 -0
- package/dist/runtime/index.d.ts +14 -2
- package/dist/runtime/index.js +13 -1
- package/dist/runtime/migrations.d.ts +5 -5
- package/dist/runtime/migrations.js +45 -0
- package/dist/runtime/package-managers.js +1 -1
- package/dist/runtime/workspace-inventory.d.ts +93 -0
- package/dist/runtime/workspace-inventory.js +306 -0
- package/dist/runtime/workspace-project.d.ts +66 -0
- package/dist/runtime/workspace-project.js +152 -0
- package/package.json +2 -2
- package/templates/_shared/base/package.json.mustache +1 -1
- package/templates/_shared/compound/core/package.json.mustache +1 -1
- package/templates/_shared/compound/persistence/package.json.mustache +1 -1
- package/templates/_shared/persistence/core/package.json.mustache +1 -1
- package/templates/interactivity/package.json.mustache +1 -1
|
@@ -1,13 +1,34 @@
|
|
|
1
|
+
import { getWorkspaceBlockSelectOptions } from "./workspace-inventory.js";
|
|
2
|
+
import { type HookedBlockPositionId } from "./hooked-blocks.js";
|
|
1
3
|
/**
|
|
2
4
|
* Supported top-level `wp-typia add` kinds exposed by the canonical CLI.
|
|
3
5
|
*/
|
|
4
|
-
export declare const ADD_KIND_IDS: readonly ["block", "variation", "pattern"];
|
|
6
|
+
export declare const ADD_KIND_IDS: readonly ["block", "variation", "pattern", "binding-source", "hooked-block"];
|
|
5
7
|
export type AddKindId = (typeof ADD_KIND_IDS)[number];
|
|
6
8
|
/**
|
|
7
9
|
* Supported built-in block families accepted by `wp-typia add block --template`.
|
|
8
10
|
*/
|
|
9
11
|
export declare const ADD_BLOCK_TEMPLATE_IDS: readonly ["basic", "interactivity", "persistence", "compound"];
|
|
10
12
|
export type AddBlockTemplateId = (typeof ADD_BLOCK_TEMPLATE_IDS)[number];
|
|
13
|
+
interface RunAddVariationCommandOptions {
|
|
14
|
+
blockName: string;
|
|
15
|
+
cwd?: string;
|
|
16
|
+
variationName: string;
|
|
17
|
+
}
|
|
18
|
+
interface RunAddPatternCommandOptions {
|
|
19
|
+
cwd?: string;
|
|
20
|
+
patternName: string;
|
|
21
|
+
}
|
|
22
|
+
interface RunAddBindingSourceCommandOptions {
|
|
23
|
+
bindingSourceName: string;
|
|
24
|
+
cwd?: string;
|
|
25
|
+
}
|
|
26
|
+
interface RunAddHookedBlockCommandOptions {
|
|
27
|
+
anchorBlockName: string;
|
|
28
|
+
blockName: string;
|
|
29
|
+
cwd?: string;
|
|
30
|
+
position: string;
|
|
31
|
+
}
|
|
11
32
|
interface RunAddBlockCommandOptions {
|
|
12
33
|
blockName: string;
|
|
13
34
|
cwd?: string;
|
|
@@ -32,7 +53,82 @@ export declare function runAddBlockCommand({ blockName, cwd, dataStorageMode, pe
|
|
|
32
53
|
templateId: AddBlockTemplateId;
|
|
33
54
|
}>;
|
|
34
55
|
/**
|
|
35
|
-
*
|
|
56
|
+
* Add one variation entry to an existing workspace block.
|
|
57
|
+
*
|
|
58
|
+
* @param options Command options for the variation scaffold workflow.
|
|
59
|
+
* @param options.blockName Target workspace block slug that will own the variation.
|
|
60
|
+
* @param options.cwd Working directory used to resolve the nearest official workspace.
|
|
61
|
+
* Defaults to `process.cwd()`.
|
|
62
|
+
* @param options.variationName Human-entered variation name that will be normalized
|
|
63
|
+
* and validated before files are written.
|
|
64
|
+
* @returns A promise that resolves with the normalized `blockSlug`,
|
|
65
|
+
* `variationSlug`, and owning `projectDir` after the variation files and
|
|
66
|
+
* inventory entry have been written successfully.
|
|
67
|
+
* @throws {Error} When the command is run outside an official workspace, when
|
|
68
|
+
* the target block is unknown, when the variation slug is invalid, or when a
|
|
69
|
+
* conflicting file or inventory entry already exists.
|
|
70
|
+
*/
|
|
71
|
+
export declare function runAddVariationCommand({ blockName, cwd, variationName, }: RunAddVariationCommandOptions): Promise<{
|
|
72
|
+
blockSlug: string;
|
|
73
|
+
projectDir: string;
|
|
74
|
+
variationSlug: string;
|
|
75
|
+
}>;
|
|
76
|
+
/**
|
|
77
|
+
* Add one PHP block pattern shell to an official workspace project.
|
|
78
|
+
*
|
|
79
|
+
* @param options Command options for the pattern scaffold workflow.
|
|
80
|
+
* @param options.cwd Working directory used to resolve the nearest official workspace.
|
|
81
|
+
* Defaults to `process.cwd()`.
|
|
82
|
+
* @param options.patternName Human-entered pattern name that will be normalized
|
|
83
|
+
* and validated before files are written.
|
|
84
|
+
* @returns A promise that resolves with the normalized `patternSlug` and
|
|
85
|
+
* owning `projectDir` after the pattern file and inventory entry have been
|
|
86
|
+
* written successfully.
|
|
87
|
+
* @throws {Error} When the command is run outside an official workspace, when
|
|
88
|
+
* the pattern slug is invalid, or when a conflicting file or inventory entry
|
|
89
|
+
* already exists.
|
|
90
|
+
*/
|
|
91
|
+
export declare function runAddPatternCommand({ cwd, patternName, }: RunAddPatternCommandOptions): Promise<{
|
|
92
|
+
patternSlug: string;
|
|
93
|
+
projectDir: string;
|
|
94
|
+
}>;
|
|
95
|
+
/**
|
|
96
|
+
* Add one block binding source scaffold to an official workspace project.
|
|
97
|
+
*
|
|
98
|
+
* @param options Command options for the binding-source scaffold workflow.
|
|
99
|
+
* @param options.bindingSourceName Human-entered binding source name that will
|
|
100
|
+
* be normalized and validated before files are written.
|
|
101
|
+
* @param options.cwd Working directory used to resolve the nearest official
|
|
102
|
+
* workspace. Defaults to `process.cwd()`.
|
|
103
|
+
* @returns A promise that resolves with the normalized `bindingSourceSlug` and
|
|
104
|
+
* owning `projectDir` after the server/editor files and inventory entry have
|
|
105
|
+
* been written successfully.
|
|
106
|
+
* @throws {Error} When the command is run outside an official workspace, when
|
|
107
|
+
* the slug is invalid, or when a conflicting file or inventory entry exists.
|
|
36
108
|
*/
|
|
37
|
-
export declare function
|
|
38
|
-
|
|
109
|
+
export declare function runAddBindingSourceCommand({ bindingSourceName, cwd, }: RunAddBindingSourceCommandOptions): Promise<{
|
|
110
|
+
bindingSourceSlug: string;
|
|
111
|
+
projectDir: string;
|
|
112
|
+
}>;
|
|
113
|
+
/**
|
|
114
|
+
* Add one `blockHooks` entry to an existing official workspace block.
|
|
115
|
+
*
|
|
116
|
+
* @param options Command options for the hooked-block workflow.
|
|
117
|
+
* @param options.anchorBlockName Full block name that will anchor the insertion.
|
|
118
|
+
* @param options.blockName Existing workspace block slug to patch.
|
|
119
|
+
* @param options.cwd Working directory used to resolve the nearest official workspace.
|
|
120
|
+
* Defaults to `process.cwd()`.
|
|
121
|
+
* @param options.position Hook position to store in `block.json`.
|
|
122
|
+
* @returns A promise that resolves with the normalized target block slug, anchor
|
|
123
|
+
* block name, position, and owning project directory after `block.json` is written.
|
|
124
|
+
* @throws {Error} When the command is run outside an official workspace, when
|
|
125
|
+
* the target block is unknown, when required flags are missing, or when the
|
|
126
|
+
* block already defines a hook for the requested anchor.
|
|
127
|
+
*/
|
|
128
|
+
export declare function runAddHookedBlockCommand({ anchorBlockName, blockName, cwd, position, }: RunAddHookedBlockCommandOptions): Promise<{
|
|
129
|
+
anchorBlockName: string;
|
|
130
|
+
blockSlug: string;
|
|
131
|
+
position: HookedBlockPositionId;
|
|
132
|
+
projectDir: string;
|
|
133
|
+
}>;
|
|
134
|
+
export { getWorkspaceBlockSelectOptions };
|