@wp-typia/project-tools 0.21.0 → 0.22.1

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 (34) hide show
  1. package/dist/runtime/ai-feature-capability.js +2 -33
  2. package/dist/runtime/built-in-block-artifact-types.js +11 -0
  3. package/dist/runtime/built-in-block-code-artifacts.js +5 -1
  4. package/dist/runtime/built-in-block-code-templates/interactivity.d.ts +4 -3
  5. package/dist/runtime/built-in-block-code-templates/interactivity.js +259 -100
  6. package/dist/runtime/built-in-block-code-templates.d.ts +1 -1
  7. package/dist/runtime/built-in-block-code-templates.js +1 -1
  8. package/dist/runtime/cli-add-shared.d.ts +4 -3
  9. package/dist/runtime/cli-add-shared.js +5 -2
  10. package/dist/runtime/cli-add-workspace-ability.js +3 -4
  11. package/dist/runtime/cli-add-workspace-admin-view-scaffold.d.ts +9 -0
  12. package/dist/runtime/cli-add-workspace-admin-view-scaffold.js +257 -0
  13. package/dist/runtime/cli-add-workspace-admin-view-source.d.ts +5 -0
  14. package/dist/runtime/cli-add-workspace-admin-view-source.js +86 -0
  15. package/dist/runtime/cli-add-workspace-admin-view-templates.d.ts +23 -0
  16. package/dist/runtime/cli-add-workspace-admin-view-templates.js +991 -0
  17. package/dist/runtime/cli-add-workspace-admin-view-types.d.ts +29 -0
  18. package/dist/runtime/cli-add-workspace-admin-view-types.js +29 -0
  19. package/dist/runtime/cli-add-workspace-admin-view.d.ts +1 -14
  20. package/dist/runtime/cli-add-workspace-admin-view.js +23 -860
  21. package/dist/runtime/cli-doctor-workspace.js +5 -4
  22. package/dist/runtime/cli-help.js +5 -2
  23. package/dist/runtime/external-layer-selection.d.ts +8 -2
  24. package/dist/runtime/external-layer-selection.js +3 -4
  25. package/dist/runtime/package-versions.d.ts +28 -0
  26. package/dist/runtime/package-versions.js +79 -36
  27. package/dist/runtime/scaffold-compatibility.d.ts +2 -2
  28. package/dist/runtime/scaffold-compatibility.js +22 -48
  29. package/dist/runtime/string-case.d.ts +7 -0
  30. package/dist/runtime/string-case.js +21 -11
  31. package/dist/runtime/version-floor.d.ts +26 -0
  32. package/dist/runtime/version-floor.js +56 -0
  33. package/dist/runtime/workspace-inventory.d.ts +2 -1
  34. package/package.json +3 -2
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Parse a dotted version floor into numeric parts for stable comparisons.
3
+ *
4
+ * @param value Human-authored version floor such as `7.0` or `8.1.2`.
5
+ * @returns Numeric version segments suitable for ordered comparison.
6
+ * @throws When any segment contains non-digit characters.
7
+ */
8
+ export function parseVersionFloorParts(value) {
9
+ return value.split('.').map((part, index) => {
10
+ if (!/^\d+$/u.test(part)) {
11
+ throw new Error(`parseVersionFloorParts received an invalid version floor "${value}" at segment ${index + 1}.`);
12
+ }
13
+ return Number.parseInt(part, 10);
14
+ });
15
+ }
16
+ /**
17
+ * Compare two dotted version floors.
18
+ *
19
+ * Missing trailing segments are treated as zero so `7.0` equals `7.0.0`.
20
+ *
21
+ * @param left Left-hand version floor.
22
+ * @param right Right-hand version floor.
23
+ * @returns `1` when left is higher, `-1` when right is higher, or `0` when equal.
24
+ */
25
+ export function compareVersionFloors(left, right) {
26
+ const leftParts = parseVersionFloorParts(left);
27
+ const rightParts = parseVersionFloorParts(right);
28
+ const length = Math.max(leftParts.length, rightParts.length);
29
+ for (let index = 0; index < length; index += 1) {
30
+ const leftValue = leftParts[index] ?? 0;
31
+ const rightValue = rightParts[index] ?? 0;
32
+ if (leftValue > rightValue) {
33
+ return 1;
34
+ }
35
+ if (leftValue < rightValue) {
36
+ return -1;
37
+ }
38
+ }
39
+ return 0;
40
+ }
41
+ /**
42
+ * Pick the higher version floor while tolerating undefined values.
43
+ *
44
+ * @param current Current resolved floor, when present.
45
+ * @param candidate Candidate floor to compare against the current floor.
46
+ * @returns The higher defined floor, or undefined when neither value exists.
47
+ */
48
+ export function pickHigherVersionFloor(current, candidate) {
49
+ if (!candidate) {
50
+ return current;
51
+ }
52
+ if (!current) {
53
+ return candidate;
54
+ }
55
+ return compareVersionFloors(current, candidate) >= 0 ? current : candidate;
56
+ }
@@ -96,7 +96,8 @@ export interface WorkspaceAiFeatureInventoryEntry {
96
96
  * @property file Relative path to the generated admin view shared entry file.
97
97
  * @property phpFile Relative path to the generated WordPress admin page glue.
98
98
  * @property slug Normalized admin view slug.
99
- * @property source Optional source locator such as `rest-resource:products`.
99
+ * @property source Optional source locator such as `rest-resource:products` or
100
+ * `core-data:postType/post`.
100
101
  */
101
102
  export interface WorkspaceAdminViewInventoryEntry {
102
103
  file: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wp-typia/project-tools",
3
- "version": "0.21.0",
3
+ "version": "0.22.1",
4
4
  "description": "Project orchestration and programmatic tooling for wp-typia",
5
5
  "packageManager": "bun@1.3.11",
6
6
  "type": "module",
@@ -105,6 +105,7 @@
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
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",
109
110
  "test:workspace": "bun run build && bun test tests/workspace-add.test.ts tests/workspace-doctor.test.ts",
110
111
  "test:compound": "bun run build && bun test tests/scaffold-compound.test.ts",
@@ -146,7 +147,7 @@
146
147
  "dependencies": {
147
148
  "@wp-typia/api-client": "^0.4.5",
148
149
  "@wp-typia/block-runtime": "^0.5.0",
149
- "@wp-typia/rest": "^0.3.11",
150
+ "@wp-typia/rest": "^0.3.12",
150
151
  "@wp-typia/block-types": "^0.2.4",
151
152
  "mustache": "^4.2.0",
152
153
  "npm-package-arg": "^13.0.0",