@wp-typia/project-tools 0.22.4 → 0.22.6

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 (65) hide show
  1. package/dist/runtime/ai-feature-capability.js +20 -0
  2. package/dist/runtime/cli-add-block.js +16 -11
  3. package/dist/runtime/cli-add-collision.js +213 -136
  4. package/dist/runtime/cli-add-help.js +1 -1
  5. package/dist/runtime/cli-add-kind-ids.d.ts +11 -0
  6. package/dist/runtime/cli-add-kind-ids.js +20 -0
  7. package/dist/runtime/cli-add-types.d.ts +2 -8
  8. package/dist/runtime/cli-add-types.js +1 -17
  9. package/dist/runtime/cli-add-workspace-ability-scaffold.d.ts +3 -1
  10. package/dist/runtime/cli-add-workspace-ability-scaffold.js +22 -5
  11. package/dist/runtime/cli-add-workspace-ability.d.ts +4 -0
  12. package/dist/runtime/cli-add-workspace-ability.js +5 -1
  13. package/dist/runtime/cli-add-workspace-admin-view-source.d.ts +7 -0
  14. package/dist/runtime/cli-add-workspace-admin-view-source.js +9 -10
  15. package/dist/runtime/cli-add-workspace-admin-view-types.d.ts +0 -2
  16. package/dist/runtime/cli-add-workspace-admin-view-types.js +0 -3
  17. package/dist/runtime/cli-add-workspace-ai-anchors.js +3 -24
  18. package/dist/runtime/cli-add-workspace-ai-scaffold.js +14 -6
  19. package/dist/runtime/cli-add-workspace-assets.js +7 -50
  20. package/dist/runtime/cli-add-workspace-rest-anchors.js +3 -24
  21. package/dist/runtime/cli-doctor-workspace-bindings.js +2 -3
  22. package/dist/runtime/cli-doctor-workspace-blocks.js +2 -3
  23. package/dist/runtime/cli-doctor-workspace-features.js +6 -11
  24. package/dist/runtime/cli-doctor-workspace-shared.d.ts +8 -0
  25. package/dist/runtime/cli-doctor-workspace-shared.js +10 -0
  26. package/dist/runtime/cli-help.js +1 -1
  27. package/dist/runtime/cli-init-apply.d.ts +15 -0
  28. package/dist/runtime/cli-init-apply.js +99 -0
  29. package/dist/runtime/cli-init-package-json.d.ts +19 -0
  30. package/dist/runtime/cli-init-package-json.js +191 -0
  31. package/dist/runtime/cli-init-plan.d.ts +39 -0
  32. package/dist/runtime/cli-init-plan.js +375 -0
  33. package/dist/runtime/cli-init-templates.d.ts +27 -0
  34. package/dist/runtime/cli-init-templates.js +244 -0
  35. package/dist/runtime/cli-init-types.d.ts +84 -0
  36. package/dist/runtime/cli-init-types.js +3 -0
  37. package/dist/runtime/cli-init.d.ts +4 -100
  38. package/dist/runtime/cli-init.js +6 -878
  39. package/dist/runtime/fs-async.d.ts +28 -0
  40. package/dist/runtime/fs-async.js +53 -0
  41. package/dist/runtime/package-managers.js +1 -1
  42. package/dist/runtime/php-utils.d.ts +16 -0
  43. package/dist/runtime/php-utils.js +321 -1
  44. package/dist/runtime/scaffold-apply-utils.js +10 -20
  45. package/dist/runtime/scaffold-bootstrap.js +6 -8
  46. package/dist/runtime/scaffold-compatibility.d.ts +15 -3
  47. package/dist/runtime/scaffold-compatibility.js +42 -11
  48. package/dist/runtime/scaffold-documents.js +12 -0
  49. package/dist/runtime/scaffold-package-manager-files.js +4 -3
  50. package/dist/runtime/string-case.d.ts +5 -0
  51. package/dist/runtime/string-case.js +52 -2
  52. package/dist/runtime/template-source-cache.d.ts +19 -0
  53. package/dist/runtime/template-source-cache.js +164 -28
  54. package/dist/runtime/template-source-external.d.ts +7 -0
  55. package/dist/runtime/template-source-external.js +22 -5
  56. package/dist/runtime/template-source-normalization.d.ts +1 -1
  57. package/dist/runtime/template-source-normalization.js +12 -12
  58. package/dist/runtime/template-source-remote.d.ts +14 -0
  59. package/dist/runtime/template-source-remote.js +91 -15
  60. package/dist/runtime/template-source.js +35 -25
  61. package/dist/runtime/typia-llm.js +7 -0
  62. package/dist/runtime/version-floor.js +8 -2
  63. package/dist/runtime/workspace-inventory.d.ts +16 -14
  64. package/dist/runtime/workspace-inventory.js +310 -239
  65. package/package.json +6 -1
@@ -0,0 +1,84 @@
1
+ import type { PackageManagerId } from "./package-managers.js";
2
+ import type { WorkspacePackageJson } from "./workspace-project.js";
3
+ export type InitCommandMode = "apply" | "preview-only";
4
+ export type InitPlanAction = "add" | "update";
5
+ export type InitPlanStatus = "already-initialized" | "applied" | "preview";
6
+ export type InitPlanLayoutKind = "generated-project" | "multi-block" | "official-workspace" | "single-block" | "unsupported";
7
+ export interface InitDependencyChange {
8
+ action: InitPlanAction;
9
+ currentValue?: string;
10
+ name: string;
11
+ requiredValue: string;
12
+ }
13
+ export interface InitScriptChange {
14
+ action: InitPlanAction;
15
+ currentValue?: string;
16
+ name: string;
17
+ requiredValue: string;
18
+ }
19
+ export interface InitPackageManagerFieldChange {
20
+ action: InitPlanAction;
21
+ currentValue?: string;
22
+ requiredValue: string;
23
+ }
24
+ export interface InitFilePlan {
25
+ action: InitPlanAction;
26
+ path: string;
27
+ purpose: string;
28
+ }
29
+ /**
30
+ * One existing block target that `wp-typia init` can retrofit into the shared
31
+ * sync surface.
32
+ *
33
+ * Each path stays relative to the project root so generated helper scripts can
34
+ * resolve the current block metadata and TypeScript source of truth without
35
+ * guessing layout-specific locations.
36
+ */
37
+ export interface RetrofitInitBlockTarget {
38
+ attributeTypeName: string;
39
+ blockJsonFile: string;
40
+ blockName: string;
41
+ manifestFile: string;
42
+ saveFile: string;
43
+ slug: string;
44
+ typesFile: string;
45
+ }
46
+ /**
47
+ * Preview or apply result returned by `wp-typia init`.
48
+ *
49
+ * The plan describes the detected retrofit layout, package-level mutations,
50
+ * helper files, next steps, and any warnings gathered while preparing or
51
+ * applying the minimum sync surface for an existing project.
52
+ */
53
+ export interface RetrofitInitPlan {
54
+ blockTargets: RetrofitInitBlockTarget[];
55
+ commandMode: InitCommandMode;
56
+ detectedLayout: {
57
+ blockNames: string[];
58
+ description: string;
59
+ kind: InitPlanLayoutKind;
60
+ };
61
+ generatedArtifacts: string[];
62
+ nextSteps: string[];
63
+ notes: string[];
64
+ packageChanges: {
65
+ addDevDependencies: InitDependencyChange[];
66
+ packageManagerField?: InitPackageManagerFieldChange;
67
+ scripts: InitScriptChange[];
68
+ };
69
+ plannedFiles: InitFilePlan[];
70
+ packageManager: PackageManagerId;
71
+ projectDir: string;
72
+ projectName: string;
73
+ status: InitPlanStatus;
74
+ summary: string;
75
+ }
76
+ export type ProjectPackageJson = WorkspacePackageJson & {
77
+ dependencies?: Record<string, string>;
78
+ devDependencies?: Record<string, string>;
79
+ private?: boolean;
80
+ version?: string;
81
+ };
82
+ export declare const SUPPORTED_RETROFIT_LAYOUT_NOTE = "Supported retrofit layouts currently mirror the migration bootstrap detector: `src/block.json` + `src/types.ts` + `src/save.tsx`, legacy root `block.json` + `src/types.ts` + `src/save.tsx`, or multi-block `src/blocks/*/block.json` workspaces.";
83
+ export declare const RETROFIT_APPLY_PREVIEW_NOTE = "If you rerun with `wp-typia init --apply`, package.json and generated helper files are snapshotted and rolled back automatically if a write fails.";
84
+ export declare const RETROFIT_ROLLBACK_NOTE = "Apply mode writes package.json and generated helper files with rollback-on-failure protection.";
@@ -0,0 +1,3 @@
1
+ export const SUPPORTED_RETROFIT_LAYOUT_NOTE = "Supported retrofit layouts currently mirror the migration bootstrap detector: `src/block.json` + `src/types.ts` + `src/save.tsx`, legacy root `block.json` + `src/types.ts` + `src/save.tsx`, or multi-block `src/blocks/*/block.json` workspaces.";
2
+ export const RETROFIT_APPLY_PREVIEW_NOTE = "If you rerun with `wp-typia init --apply`, package.json and generated helper files are snapshotted and rolled back automatically if a write fails.";
3
+ export const RETROFIT_ROLLBACK_NOTE = "Apply mode writes package.json and generated helper files with rollback-on-failure protection.";
@@ -1,102 +1,7 @@
1
- import { type PackageManagerId } from "./package-managers.js";
2
- type InitCommandMode = "apply" | "preview-only";
3
- type InitPlanAction = "add" | "update";
4
- type InitPlanStatus = "already-initialized" | "applied" | "preview";
5
- type InitPlanLayoutKind = "generated-project" | "multi-block" | "official-workspace" | "single-block" | "unsupported";
6
- interface InitDependencyChange {
7
- action: InitPlanAction;
8
- currentValue?: string;
9
- name: string;
10
- requiredValue: string;
11
- }
12
- interface InitScriptChange {
13
- action: InitPlanAction;
14
- currentValue?: string;
15
- name: string;
16
- requiredValue: string;
17
- }
18
- interface InitPackageManagerFieldChange {
19
- action: InitPlanAction;
20
- currentValue?: string;
21
- requiredValue: string;
22
- }
23
- interface InitFilePlan {
24
- action: InitPlanAction;
25
- path: string;
26
- purpose: string;
27
- }
28
- /**
29
- * One existing block target that `wp-typia init` can retrofit into the shared
30
- * sync surface.
31
- *
32
- * Each path stays relative to the project root so generated helper scripts can
33
- * resolve the current block metadata and TypeScript source of truth without
34
- * guessing layout-specific locations.
35
- */
36
- export interface RetrofitInitBlockTarget {
37
- attributeTypeName: string;
38
- blockJsonFile: string;
39
- blockName: string;
40
- manifestFile: string;
41
- saveFile: string;
42
- slug: string;
43
- typesFile: string;
44
- }
45
- /**
46
- * Preview or apply result returned by `wp-typia init`.
47
- *
48
- * The plan describes the detected retrofit layout, package-level mutations,
49
- * helper files, next steps, and any warnings gathered while preparing or
50
- * applying the minimum sync surface for an existing project.
51
- */
52
- export interface RetrofitInitPlan {
53
- blockTargets: RetrofitInitBlockTarget[];
54
- commandMode: InitCommandMode;
55
- detectedLayout: {
56
- blockNames: string[];
57
- description: string;
58
- kind: InitPlanLayoutKind;
59
- };
60
- generatedArtifacts: string[];
61
- nextSteps: string[];
62
- notes: string[];
63
- packageChanges: {
64
- addDevDependencies: InitDependencyChange[];
65
- packageManagerField?: InitPackageManagerFieldChange;
66
- scripts: InitScriptChange[];
67
- };
68
- plannedFiles: InitFilePlan[];
69
- packageManager: PackageManagerId;
70
- projectDir: string;
71
- projectName: string;
72
- status: InitPlanStatus;
73
- summary: string;
74
- }
75
- /**
76
- * Inspect one project directory and return the current retrofit init plan.
77
- *
78
- * @param projectDir Project root or nested path that should be analyzed.
79
- * @param options Optional package-manager override used for emitted scripts and
80
- * follow-up guidance.
81
- * @returns The preview-only retrofit init plan for the resolved project.
82
- */
83
- export declare function getInitPlan(projectDir: string, options?: {
84
- packageManager?: string;
85
- }): RetrofitInitPlan;
86
- /**
87
- * Apply the previewed retrofit init plan to disk.
88
- *
89
- * The command snapshots package.json and generated helper targets before
90
- * writing, then rolls those files back automatically if any write fails.
91
- *
92
- * @param projectDir Project root that should receive the retrofit surface.
93
- * @param options Optional package-manager override used for emitted scripts and
94
- * follow-up guidance.
95
- * @returns The applied retrofit init plan describing the persisted changes.
96
- */
97
- export declare function applyInitPlan(projectDir: string, options?: {
98
- packageManager?: string;
99
- }): Promise<RetrofitInitPlan>;
1
+ import type { RetrofitInitPlan } from "./cli-init-types.js";
2
+ export { applyInitPlan } from "./cli-init-apply.js";
3
+ export { getInitPlan } from "./cli-init-plan.js";
4
+ export type { InitCommandMode, InitDependencyChange, InitFilePlan, InitPackageManagerFieldChange, InitPlanAction, InitPlanLayoutKind, InitPlanStatus, InitScriptChange, RetrofitInitBlockTarget, RetrofitInitPlan, } from "./cli-init-types.js";
100
5
  /**
101
6
  * Execute `wp-typia init` in preview or apply mode.
102
7
  *
@@ -110,4 +15,3 @@ export declare function runInitCommand(options: {
110
15
  packageManager?: string;
111
16
  projectDir: string;
112
17
  }): Promise<RetrofitInitPlan>;
113
- export {};