@wp-typia/project-tools 0.22.2 → 0.22.4
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/built-in-block-code-templates/interactivity.d.ts +1 -1
- package/dist/runtime/built-in-block-code-templates/interactivity.js +4 -2
- package/dist/runtime/cli-add-block-json.d.ts +31 -0
- package/dist/runtime/cli-add-block-json.js +65 -0
- package/dist/runtime/cli-add-collision.d.ts +129 -0
- package/dist/runtime/cli-add-collision.js +293 -0
- package/dist/runtime/cli-add-filesystem.d.ts +29 -0
- package/dist/runtime/cli-add-filesystem.js +77 -0
- package/dist/runtime/cli-add-help.d.ts +4 -0
- package/dist/runtime/cli-add-help.js +41 -0
- package/dist/runtime/cli-add-shared.d.ts +6 -255
- package/dist/runtime/cli-add-shared.js +6 -391
- package/dist/runtime/cli-add-types.d.ts +247 -0
- package/dist/runtime/cli-add-types.js +64 -0
- package/dist/runtime/cli-add-validation.d.ts +87 -0
- package/dist/runtime/cli-add-validation.js +147 -0
- package/dist/runtime/cli-add-workspace-ability-scaffold.d.ts +5 -0
- package/dist/runtime/cli-add-workspace-ability-scaffold.js +366 -0
- package/dist/runtime/cli-add-workspace-ability-templates.d.ts +34 -0
- package/dist/runtime/cli-add-workspace-ability-templates.js +500 -0
- package/dist/runtime/cli-add-workspace-ability-types.d.ts +27 -0
- package/dist/runtime/cli-add-workspace-ability-types.js +14 -0
- package/dist/runtime/cli-add-workspace-ability.js +12 -852
- package/dist/runtime/cli-add-workspace-admin-view-scaffold.js +35 -61
- package/dist/runtime/cli-add-workspace-ai-scaffold.d.ts +21 -0
- package/dist/runtime/cli-add-workspace-ai-scaffold.js +87 -0
- package/dist/runtime/cli-add-workspace-ai-templates.d.ts +4 -0
- package/dist/runtime/cli-add-workspace-ai-templates.js +607 -0
- package/dist/runtime/cli-add-workspace-ai.js +15 -688
- package/dist/runtime/cli-add-workspace-assets.js +7 -4
- package/dist/runtime/cli-add-workspace-mutation.d.ts +30 -0
- package/dist/runtime/cli-add-workspace-mutation.js +60 -0
- package/dist/runtime/cli-add-workspace.js +2 -98
- package/dist/runtime/cli-add.d.ts +2 -2
- package/dist/runtime/cli-add.js +2 -2
- package/dist/runtime/cli-doctor-workspace-bindings.d.ts +11 -0
- package/dist/runtime/cli-doctor-workspace-bindings.js +134 -0
- package/dist/runtime/cli-doctor-workspace-blocks.d.ts +11 -0
- package/dist/runtime/cli-doctor-workspace-blocks.js +439 -0
- package/dist/runtime/cli-doctor-workspace-features.d.ts +11 -0
- package/dist/runtime/cli-doctor-workspace-features.js +383 -0
- package/dist/runtime/cli-doctor-workspace-package.d.ts +18 -0
- package/dist/runtime/cli-doctor-workspace-package.js +59 -0
- package/dist/runtime/cli-doctor-workspace-shared.d.ts +69 -0
- package/dist/runtime/cli-doctor-workspace-shared.js +87 -0
- package/dist/runtime/cli-doctor-workspace.js +25 -1062
- package/dist/runtime/index.d.ts +2 -0
- package/dist/runtime/index.js +1 -0
- package/dist/runtime/migration-utils.d.ts +2 -1
- package/dist/runtime/migration-utils.js +3 -11
- package/dist/runtime/package-managers.d.ts +19 -0
- package/dist/runtime/package-managers.js +62 -0
- package/dist/runtime/template-source-cache.d.ts +59 -0
- package/dist/runtime/template-source-cache.js +160 -0
- package/dist/runtime/ts-source-masking.d.ts +28 -0
- package/dist/runtime/ts-source-masking.js +104 -0
- package/dist/runtime/typia-llm.d.ts +9 -1
- package/dist/runtime/typia-llm.js +20 -5
- package/dist/runtime/workspace-inventory.js +116 -59
- package/dist/runtime/workspace-project.d.ts +1 -1
- package/dist/runtime/workspace-project.js +2 -10
- package/package.json +4 -4
|
@@ -202,6 +202,108 @@ export const EDITOR_PLUGINS: WorkspaceEditorPluginConfig[] = [
|
|
|
202
202
|
\t// wp-typia add editor-plugin entries
|
|
203
203
|
];
|
|
204
204
|
`;
|
|
205
|
+
const INVENTORY_SECTIONS = [
|
|
206
|
+
{
|
|
207
|
+
interface: {
|
|
208
|
+
name: "WorkspaceVariationConfig",
|
|
209
|
+
section: VARIATIONS_INTERFACE_SECTION,
|
|
210
|
+
},
|
|
211
|
+
value: {
|
|
212
|
+
name: "VARIATIONS",
|
|
213
|
+
section: VARIATIONS_CONST_SECTION,
|
|
214
|
+
},
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
interface: {
|
|
218
|
+
name: "WorkspaceBlockStyleConfig",
|
|
219
|
+
section: BLOCK_STYLES_INTERFACE_SECTION,
|
|
220
|
+
},
|
|
221
|
+
value: {
|
|
222
|
+
name: "BLOCK_STYLES",
|
|
223
|
+
section: BLOCK_STYLES_CONST_SECTION,
|
|
224
|
+
},
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
interface: {
|
|
228
|
+
name: "WorkspaceBlockTransformConfig",
|
|
229
|
+
section: BLOCK_TRANSFORMS_INTERFACE_SECTION,
|
|
230
|
+
},
|
|
231
|
+
value: {
|
|
232
|
+
name: "BLOCK_TRANSFORMS",
|
|
233
|
+
section: BLOCK_TRANSFORMS_CONST_SECTION,
|
|
234
|
+
},
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
interface: {
|
|
238
|
+
name: "WorkspacePatternConfig",
|
|
239
|
+
section: PATTERNS_INTERFACE_SECTION,
|
|
240
|
+
},
|
|
241
|
+
value: {
|
|
242
|
+
name: "PATTERNS",
|
|
243
|
+
section: PATTERNS_CONST_SECTION,
|
|
244
|
+
},
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
interface: {
|
|
248
|
+
name: "WorkspaceBindingSourceConfig",
|
|
249
|
+
section: BINDING_SOURCES_INTERFACE_SECTION,
|
|
250
|
+
},
|
|
251
|
+
value: {
|
|
252
|
+
name: "BINDING_SOURCES",
|
|
253
|
+
section: BINDING_SOURCES_CONST_SECTION,
|
|
254
|
+
},
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
interface: {
|
|
258
|
+
name: "WorkspaceRestResourceConfig",
|
|
259
|
+
section: REST_RESOURCES_INTERFACE_SECTION,
|
|
260
|
+
},
|
|
261
|
+
value: {
|
|
262
|
+
name: "REST_RESOURCES",
|
|
263
|
+
section: REST_RESOURCES_CONST_SECTION,
|
|
264
|
+
},
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
interface: {
|
|
268
|
+
name: "WorkspaceAbilityConfig",
|
|
269
|
+
section: ABILITIES_INTERFACE_SECTION,
|
|
270
|
+
},
|
|
271
|
+
value: {
|
|
272
|
+
name: "ABILITIES",
|
|
273
|
+
section: ABILITIES_CONST_SECTION,
|
|
274
|
+
},
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
interface: {
|
|
278
|
+
name: "WorkspaceAiFeatureConfig",
|
|
279
|
+
section: AI_FEATURES_INTERFACE_SECTION,
|
|
280
|
+
},
|
|
281
|
+
value: {
|
|
282
|
+
name: "AI_FEATURES",
|
|
283
|
+
section: AI_FEATURES_CONST_SECTION,
|
|
284
|
+
},
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
interface: {
|
|
288
|
+
name: "WorkspaceAdminViewConfig",
|
|
289
|
+
section: ADMIN_VIEWS_INTERFACE_SECTION,
|
|
290
|
+
},
|
|
291
|
+
value: {
|
|
292
|
+
name: "ADMIN_VIEWS",
|
|
293
|
+
section: ADMIN_VIEWS_CONST_SECTION,
|
|
294
|
+
},
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
interface: {
|
|
298
|
+
name: "WorkspaceEditorPluginConfig",
|
|
299
|
+
section: EDITOR_PLUGINS_INTERFACE_SECTION,
|
|
300
|
+
},
|
|
301
|
+
value: {
|
|
302
|
+
name: "EDITOR_PLUGINS",
|
|
303
|
+
section: EDITOR_PLUGINS_CONST_SECTION,
|
|
304
|
+
},
|
|
305
|
+
},
|
|
306
|
+
];
|
|
205
307
|
function getPropertyNameText(name) {
|
|
206
308
|
if (ts.isIdentifier(name) || ts.isStringLiteral(name)) {
|
|
207
309
|
return name.text;
|
|
@@ -576,68 +678,23 @@ export function getWorkspaceBlockSelectOptions(projectDir) {
|
|
|
576
678
|
}
|
|
577
679
|
function ensureWorkspaceInventorySections(source) {
|
|
578
680
|
let nextSource = source.trimEnd();
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
}
|
|
588
|
-
if (!/export\s+const\s+BLOCK_STYLES\b/u.test(nextSource)) {
|
|
589
|
-
nextSource += BLOCK_STYLES_CONST_SECTION;
|
|
590
|
-
}
|
|
591
|
-
if (!/export\s+interface\s+WorkspaceBlockTransformConfig\b/u.test(nextSource)) {
|
|
592
|
-
nextSource += BLOCK_TRANSFORMS_INTERFACE_SECTION;
|
|
593
|
-
}
|
|
594
|
-
if (!/export\s+const\s+BLOCK_TRANSFORMS\b/u.test(nextSource)) {
|
|
595
|
-
nextSource += BLOCK_TRANSFORMS_CONST_SECTION;
|
|
596
|
-
}
|
|
597
|
-
if (!/export\s+interface\s+WorkspacePatternConfig\b/u.test(nextSource)) {
|
|
598
|
-
nextSource += PATTERNS_INTERFACE_SECTION;
|
|
599
|
-
}
|
|
600
|
-
if (!/export\s+const\s+PATTERNS\b/u.test(nextSource)) {
|
|
601
|
-
nextSource += PATTERNS_CONST_SECTION;
|
|
602
|
-
}
|
|
603
|
-
if (!/export\s+interface\s+WorkspaceBindingSourceConfig\b/u.test(nextSource)) {
|
|
604
|
-
nextSource += BINDING_SOURCES_INTERFACE_SECTION;
|
|
605
|
-
}
|
|
606
|
-
if (!/export\s+const\s+BINDING_SOURCES\b/u.test(nextSource)) {
|
|
607
|
-
nextSource += BINDING_SOURCES_CONST_SECTION;
|
|
608
|
-
}
|
|
609
|
-
if (!/export\s+interface\s+WorkspaceRestResourceConfig\b/u.test(nextSource)) {
|
|
610
|
-
nextSource += REST_RESOURCES_INTERFACE_SECTION;
|
|
611
|
-
}
|
|
612
|
-
if (!/export\s+const\s+REST_RESOURCES\b/u.test(nextSource)) {
|
|
613
|
-
nextSource += REST_RESOURCES_CONST_SECTION;
|
|
614
|
-
}
|
|
615
|
-
if (!/export\s+interface\s+WorkspaceAbilityConfig\b/u.test(nextSource)) {
|
|
616
|
-
nextSource += ABILITIES_INTERFACE_SECTION;
|
|
617
|
-
}
|
|
618
|
-
if (!/export\s+const\s+ABILITIES\b/u.test(nextSource)) {
|
|
619
|
-
nextSource += ABILITIES_CONST_SECTION;
|
|
620
|
-
}
|
|
621
|
-
if (!/export\s+interface\s+WorkspaceAiFeatureConfig\b/u.test(nextSource)) {
|
|
622
|
-
nextSource += AI_FEATURES_INTERFACE_SECTION;
|
|
623
|
-
}
|
|
624
|
-
if (!/export\s+const\s+AI_FEATURES\b/u.test(nextSource)) {
|
|
625
|
-
nextSource += AI_FEATURES_CONST_SECTION;
|
|
626
|
-
}
|
|
627
|
-
if (!/export\s+interface\s+WorkspaceAdminViewConfig\b/u.test(nextSource)) {
|
|
628
|
-
nextSource += ADMIN_VIEWS_INTERFACE_SECTION;
|
|
629
|
-
}
|
|
630
|
-
if (!/export\s+const\s+ADMIN_VIEWS\b/u.test(nextSource)) {
|
|
631
|
-
nextSource += ADMIN_VIEWS_CONST_SECTION;
|
|
632
|
-
}
|
|
633
|
-
if (!/export\s+interface\s+WorkspaceEditorPluginConfig\b/u.test(nextSource)) {
|
|
634
|
-
nextSource += EDITOR_PLUGINS_INTERFACE_SECTION;
|
|
635
|
-
}
|
|
636
|
-
if (!/export\s+const\s+EDITOR_PLUGINS\b/u.test(nextSource)) {
|
|
637
|
-
nextSource += EDITOR_PLUGINS_CONST_SECTION;
|
|
681
|
+
for (const section of INVENTORY_SECTIONS) {
|
|
682
|
+
if (section.interface &&
|
|
683
|
+
!hasExportedInterface(nextSource, section.interface.name)) {
|
|
684
|
+
nextSource += section.interface.section;
|
|
685
|
+
}
|
|
686
|
+
if (section.value && !hasExportedConst(nextSource, section.value.name)) {
|
|
687
|
+
nextSource += section.value.section;
|
|
688
|
+
}
|
|
638
689
|
}
|
|
639
690
|
return `${nextSource}\n`;
|
|
640
691
|
}
|
|
692
|
+
function hasExportedInterface(source, interfaceName) {
|
|
693
|
+
return new RegExp(`export\\s+interface\\s+${escapeRegex(interfaceName)}\\b`, "u").test(source);
|
|
694
|
+
}
|
|
695
|
+
function hasExportedConst(source, constName) {
|
|
696
|
+
return new RegExp(`export\\s+const\\s+${escapeRegex(constName)}\\b`, "u").test(source);
|
|
697
|
+
}
|
|
641
698
|
function appendEntriesAtMarker(source, marker, entries) {
|
|
642
699
|
if (entries.length === 0) {
|
|
643
700
|
return source;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type PackageManagerId } from "./package-managers.js";
|
|
2
2
|
export declare const WORKSPACE_TEMPLATE_PACKAGE = "@wp-typia/create-workspace-template";
|
|
3
3
|
export interface WorkspacePackageJson {
|
|
4
4
|
author?: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
|
+
import { parsePackageManagerField, } from "./package-managers.js";
|
|
3
4
|
export const WORKSPACE_TEMPLATE_PACKAGE = "@wp-typia/create-workspace-template";
|
|
4
5
|
function hasNonEmptyString(value) {
|
|
5
6
|
return typeof value === "string" && value.trim().length > 0;
|
|
@@ -81,16 +82,7 @@ export function getInvalidWorkspaceProjectReason(startDir) {
|
|
|
81
82
|
* field is missing or unsupported.
|
|
82
83
|
*/
|
|
83
84
|
export function parseWorkspacePackageManagerId(packageManagerField) {
|
|
84
|
-
|
|
85
|
-
switch (packageManagerId) {
|
|
86
|
-
case "bun":
|
|
87
|
-
case "npm":
|
|
88
|
-
case "pnpm":
|
|
89
|
-
case "yarn":
|
|
90
|
-
return packageManagerId;
|
|
91
|
-
default:
|
|
92
|
-
return "npm";
|
|
93
|
-
}
|
|
85
|
+
return parsePackageManagerField(packageManagerField) ?? "npm";
|
|
94
86
|
}
|
|
95
87
|
/**
|
|
96
88
|
* Try to resolve the nearest official wp-typia workspace from `startDir`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wp-typia/project-tools",
|
|
3
|
-
"version": "0.22.
|
|
3
|
+
"version": "0.22.4",
|
|
4
4
|
"description": "Project orchestration and programmatic tooling for wp-typia",
|
|
5
5
|
"packageManager": "bun@1.3.11",
|
|
6
6
|
"type": "module",
|
|
@@ -105,9 +105,9 @@
|
|
|
105
105
|
"prepack": "bun run build && node ./scripts/publish-manifest.mjs prepare",
|
|
106
106
|
"postpack": "node ./scripts/publish-manifest.mjs restore",
|
|
107
107
|
"test": "bun run build && bun test tests/*.test.ts",
|
|
108
|
-
"test:quick": "bun run build && bun test tests/workspace-add.test.ts tests/workspace-doctor.test.ts tests/scaffold-compound.test.ts",
|
|
108
|
+
"test:quick": "bun run build && bun test tests/workspace-add.test.ts tests/cli-add-workspace-ability.test.ts tests/cli-add-workspace-ai.test.ts tests/workspace-doctor.test.ts tests/scaffold-compound.test.ts",
|
|
109
109
|
"test:scaffold-core": "bun run build && bun test tests/block-generator-service.test.ts tests/built-in-block-artifacts.test.ts tests/scaffold-basic.test.ts tests/scaffold-persistence.test.ts tests/template-source.test.ts tests/init-command.test.ts tests/package-versions.test.ts tests/cli-entry.test.ts tests/cli-prompt.test.ts tests/import-policy.test.ts tests/wordpress-ai-spec.test.ts tests/typia-llm.test.ts",
|
|
110
|
-
"test:workspace": "bun run build && bun test tests/workspace-add.test.ts tests/workspace-doctor.test.ts",
|
|
110
|
+
"test:workspace": "bun run build && bun test tests/workspace-add.test.ts tests/cli-add-workspace-ability.test.ts tests/cli-add-workspace-ai.test.ts tests/workspace-doctor.test.ts",
|
|
111
111
|
"test:compound": "bun run build && bun test tests/scaffold-compound.test.ts",
|
|
112
112
|
"test:migration-planning": "bun run build && bun test tests/migration-init.test.ts tests/migration-config.test.ts tests/migration-plan-wizard.test.ts",
|
|
113
113
|
"test:migration-execution": "bun run build && bun test tests/migration-scaffold-diff.test.ts tests/migration-doctor.test.ts tests/migration-fixtures-fuzz.test.ts",
|
|
@@ -147,7 +147,7 @@
|
|
|
147
147
|
"dependencies": {
|
|
148
148
|
"@wp-typia/api-client": "^0.4.5",
|
|
149
149
|
"@wp-typia/block-runtime": "^0.5.0",
|
|
150
|
-
"@wp-typia/rest": "^0.3.
|
|
150
|
+
"@wp-typia/rest": "^0.3.13",
|
|
151
151
|
"@wp-typia/block-types": "^0.2.4",
|
|
152
152
|
"mustache": "^4.2.0",
|
|
153
153
|
"npm-package-arg": "^13.0.0",
|