wp-typia 0.15.1 → 0.15.2
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/.bunli/commands.gen.ts
CHANGED
|
@@ -27,7 +27,7 @@ const modules: Record<GeneratedNames, Command<any>> = {
|
|
|
27
27
|
const metadata: Record<GeneratedNames, GeneratedCommandMeta> = {
|
|
28
28
|
'add': {
|
|
29
29
|
name: 'add',
|
|
30
|
-
description: 'Extend an official wp-typia workspace with blocks, variations, or
|
|
30
|
+
description: 'Extend an official wp-typia workspace with blocks, variations, patterns, binding sources, or hooked blocks.',
|
|
31
31
|
path: './src/commands/add'
|
|
32
32
|
},
|
|
33
33
|
'create': {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wp-typia",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.2",
|
|
4
4
|
"description": "Canonical CLI package for wp-typia scaffolding and project workflows",
|
|
5
5
|
"packageManager": "bun@1.3.11",
|
|
6
6
|
"type": "module",
|
|
@@ -64,7 +64,8 @@
|
|
|
64
64
|
"@bunli/runtime": "0.3.1",
|
|
65
65
|
"@bunli/tui": "0.6.0",
|
|
66
66
|
"@bunli/utils": "0.6.0",
|
|
67
|
-
"@wp-typia/
|
|
67
|
+
"@wp-typia/api-client": "^0.4.2",
|
|
68
|
+
"@wp-typia/project-tools": "0.15.2",
|
|
68
69
|
"better-result": "^2.7.0",
|
|
69
70
|
"react": "19.2.0",
|
|
70
71
|
"react-dom": "19.2.0",
|
package/src/commands/add.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { z } from "zod";
|
|
|
6
6
|
import { getAddBlockDefaults } from "../config";
|
|
7
7
|
import { resolveBundledModuleHref } from "../render-loader";
|
|
8
8
|
import { executeAddCommand, getAddWorkspaceBlockOptions } from "../runtime-bridge";
|
|
9
|
+
import type { WpTypiaRenderArgs } from "./render-types";
|
|
9
10
|
import { LazyFlow } from "../ui/lazy-flow";
|
|
10
11
|
|
|
11
12
|
const supportsInteractiveTui = typeof Bun !== "undefined";
|
|
@@ -61,7 +62,7 @@ export const addCommand = defineCommand({
|
|
|
61
62
|
options: addOptions,
|
|
62
63
|
...(supportsInteractiveTui
|
|
63
64
|
? {
|
|
64
|
-
render: (args:
|
|
65
|
+
render: (args: WpTypiaRenderArgs) => {
|
|
65
66
|
const config =
|
|
66
67
|
args.context?.store?.wpTypiaUserConfig &&
|
|
67
68
|
typeof args.context.store.wpTypiaUserConfig === "object"
|
package/src/commands/create.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { z } from "zod";
|
|
|
6
6
|
import { getCreateDefaults } from "../config";
|
|
7
7
|
import { resolveBundledModuleHref } from "../render-loader";
|
|
8
8
|
import { executeCreateCommand } from "../runtime-bridge";
|
|
9
|
+
import type { WpTypiaRenderArgs } from "./render-types";
|
|
9
10
|
import { LazyFlow } from "../ui/lazy-flow";
|
|
10
11
|
|
|
11
12
|
const supportsInteractiveTui = typeof Bun !== "undefined";
|
|
@@ -100,7 +101,7 @@ export const createCommand = defineCommand({
|
|
|
100
101
|
options: createOptions,
|
|
101
102
|
...(supportsInteractiveTui
|
|
102
103
|
? {
|
|
103
|
-
render: (args:
|
|
104
|
+
render: (args: WpTypiaRenderArgs) => {
|
|
104
105
|
const config =
|
|
105
106
|
args.context?.store?.wpTypiaUserConfig &&
|
|
106
107
|
typeof args.context.store.wpTypiaUserConfig === "object"
|
package/src/commands/migrate.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { z } from "zod";
|
|
|
5
5
|
|
|
6
6
|
import { resolveBundledModuleHref } from "../render-loader";
|
|
7
7
|
import { executeMigrateCommand } from "../runtime-bridge";
|
|
8
|
+
import type { WpTypiaRenderArgs } from "./render-types";
|
|
8
9
|
import { LazyFlow } from "../ui/lazy-flow";
|
|
9
10
|
|
|
10
11
|
const supportsInteractiveTui = typeof Bun !== "undefined";
|
|
@@ -69,7 +70,7 @@ export const migrateCommand = defineCommand({
|
|
|
69
70
|
options: migrateOptions,
|
|
70
71
|
...(supportsInteractiveTui
|
|
71
72
|
? {
|
|
72
|
-
render: (args:
|
|
73
|
+
render: (args: WpTypiaRenderArgs) =>
|
|
73
74
|
createElement(LazyFlow, {
|
|
74
75
|
loader: loadMigrateFlow,
|
|
75
76
|
props: {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { RenderArgs } from "@bunli/core";
|
|
2
|
+
|
|
3
|
+
import type { WpTypiaUserConfig } from "../config";
|
|
4
|
+
|
|
5
|
+
type WpTypiaRenderStore = {
|
|
6
|
+
wpTypiaUserConfig?: WpTypiaUserConfig;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export type WpTypiaRenderArgs = RenderArgs<Record<string, unknown>, WpTypiaRenderStore>;
|
package/src/config.ts
CHANGED
|
@@ -2,6 +2,8 @@ import fs from "node:fs/promises";
|
|
|
2
2
|
import os from "node:os";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
|
|
5
|
+
import { isPlainObject as isRecord } from "@wp-typia/api-client/runtime-primitives";
|
|
6
|
+
|
|
5
7
|
export type WpTypiaSchemaSource = {
|
|
6
8
|
namespace: string;
|
|
7
9
|
path: string;
|
|
@@ -40,13 +42,8 @@ export const WP_TYPIA_CONFIG_SOURCES = [
|
|
|
40
42
|
".wp-typiarc",
|
|
41
43
|
".wp-typiarc.json",
|
|
42
44
|
] as const;
|
|
43
|
-
|
|
44
45
|
type JsonRecord = Record<string, unknown>;
|
|
45
46
|
|
|
46
|
-
function isRecord(value: unknown): value is JsonRecord {
|
|
47
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
47
|
function deepMerge<T extends JsonRecord>(base: T, incoming: JsonRecord): T {
|
|
51
48
|
const merged: JsonRecord = { ...base };
|
|
52
49
|
|