devframe 0.1.18 → 0.1.20
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/README.md +2 -2
- package/dist/{_shared-Bxa2_kq7.mjs → _shared-S-Ujqz_L.mjs} +1 -1
- package/dist/adapters/build.d.mts +1 -1
- package/dist/adapters/build.mjs +9 -5
- package/dist/adapters/cli.d.mts +2 -2
- package/dist/adapters/cli.mjs +78 -292
- package/dist/adapters/dev.d.mts +83 -0
- package/dist/adapters/dev.mjs +2 -0
- package/dist/adapters/embedded.d.mts +1 -1
- package/dist/adapters/kit.d.mts +1 -1
- package/dist/adapters/mcp.d.mts +1 -1
- package/dist/adapters/mcp.mjs +6 -3
- package/dist/adapters/vite.d.mts +1 -1
- package/dist/adapters/vite.mjs +1 -1
- package/dist/client/index.d.mts +41 -5
- package/dist/client/index.mjs +1673 -2
- package/dist/constants.d.mts +1 -1
- package/dist/{context-xQo1FcxX.mjs → context-BfvbAyGk.mjs} +429 -41
- package/dist/dev-B8i_CBlQ.mjs +325 -0
- package/dist/{devtool-CHT-4_OU.d.mts → devtool-Bm6zZAw5.d.mts} +371 -28
- package/dist/host-h3-BMvrFzIJ.mjs +24 -0
- package/dist/{index-Cei8vVcd.d.mts → index-BCo03GEF.d.mts} +1 -1
- package/dist/index.d.mts +4 -4
- package/dist/index.mjs +11 -2
- package/dist/node/index.d.mts +41 -53
- package/dist/node/index.mjs +5 -4
- package/dist/recipes/open-helpers.d.mts +1 -1
- package/dist/recipes/open-helpers.mjs +4 -2
- package/dist/rpc/index.d.mts +2 -2
- package/dist/rpc/index.mjs +3 -3
- package/dist/rpc/transports/ws-client.d.mts +1 -1
- package/dist/rpc/transports/ws-client.mjs +1 -1
- package/dist/rpc/transports/ws-server.d.mts +1 -1
- package/dist/rpc/transports/ws-server.mjs +1 -1
- package/dist/{rpc-hbRk8qtt.mjs → rpc-INbWfHoX.mjs} +1 -1
- package/dist/{serialization-CWcWE7x7.mjs → serialization-DwKi05Pn.mjs} +1 -1
- package/dist/server-DksyT-um.d.mts +54 -0
- package/dist/{server-DkJ2-s0Y.mjs → server-qRRM8t3v.mjs} +27 -2
- package/dist/{static-dump-DwFfj4U_.mjs → static-dump-C1aVSwxY.mjs} +2 -19
- package/dist/types/index.d.mts +4 -4
- package/dist/{types-BkyzI9r4.d.mts → types-ag029cAe.d.mts} +1 -1
- package/dist/utils/events.d.mts +1 -1
- package/dist/utils/shared-state.d.mts +2 -2
- package/dist/utils/shared-state.mjs +1 -1
- package/dist/utils/state.d.mts +2 -1
- package/dist/utils/state.mjs +1 -1
- package/dist/utils/streaming-channel.d.mts +2 -0
- package/dist/utils/streaming-channel.mjs +255 -0
- package/dist/{ws-client-CDGmViwt.d.mts → ws-client-DQySVfF_.d.mts} +1 -1
- package/dist/{ws-server-Cu8tmZcF.d.mts → ws-server-VQqESKAs.d.mts} +13 -1
- package/package.json +10 -17
- package/skills/devframe/README.md +13 -0
- package/skills/devframe/SKILL.md +452 -0
- package/skills/devframe/templates/counter-devtool.ts +29 -0
- package/skills/devframe/templates/spa-devtool.ts +33 -0
- package/skills/devframe/templates/vite-client.ts +11 -0
- package/dist/client-CsR1_h3o.mjs +0 -1569
- package/dist/helpers/nuxt/index.d.mts +0 -46
- package/dist/helpers/nuxt/index.mjs +0 -58
- package/dist/helpers/nuxt/runtime/plugin.client.d.mts +0 -8
- package/dist/helpers/nuxt/runtime/plugin.client.mjs +0 -12
- package/dist/immer-DEqg5kOd.mjs +0 -894
- package/dist/src-DIKqQIjp.mjs +0 -85
- /package/dist/{define-CW9gLnyG.mjs → define-Bb4zh-Dc.mjs} +0 -0
- /package/dist/{main-BJD9t8dk.mjs → main-DpINGndA.mjs} +0 -0
- /package/dist/{open-BMO2_-wC.mjs → open-BtOOEldu.mjs} +0 -0
- /package/dist/{transports-4bqw6Fqg.mjs → transports-BPUzHhI2.mjs} +0 -0
package/dist/src-DIKqQIjp.mjs
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { t as createDefineWrapperWithContext } from "./define-CW9gLnyG.mjs";
|
|
2
|
-
import { safeParse } from "valibot";
|
|
3
|
-
//#region src/adapters/flags.ts
|
|
4
|
-
/**
|
|
5
|
-
* Identity helper that preserves the literal schema-map type — use this
|
|
6
|
-
* so `InferCliFlags<typeof myFlags>` resolves to the right object shape.
|
|
7
|
-
*
|
|
8
|
-
* ```ts
|
|
9
|
-
* const appFlags = defineCliFlags({
|
|
10
|
-
* depth: v.pipe(v.number(), v.integer()),
|
|
11
|
-
* config: v.optional(v.string()),
|
|
12
|
-
* })
|
|
13
|
-
*
|
|
14
|
-
* defineDevtool({
|
|
15
|
-
* cli: { flags: appFlags },
|
|
16
|
-
* setup(ctx, info) {
|
|
17
|
-
* const flags = info.flags as InferCliFlags<typeof appFlags>
|
|
18
|
-
* flags.depth // number
|
|
19
|
-
* flags.config // string | undefined
|
|
20
|
-
* },
|
|
21
|
-
* })
|
|
22
|
-
* ```
|
|
23
|
-
*/
|
|
24
|
-
function defineCliFlags(flags) {
|
|
25
|
-
return flags;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Best-effort probe of a valibot schema to decide whether the
|
|
29
|
-
* corresponding CAC option takes a value. Unwraps `optional` / `nullable`
|
|
30
|
-
* / `nullish` / `default` / `pipe` wrappers then matches on the inner
|
|
31
|
-
* type's kind.
|
|
32
|
-
*/
|
|
33
|
-
function getSchemaKind(schema) {
|
|
34
|
-
let current = schema;
|
|
35
|
-
while (current) {
|
|
36
|
-
const kind = current.type;
|
|
37
|
-
if (kind === "optional" || kind === "nullable" || kind === "nullish" || kind === "undefined") {
|
|
38
|
-
current = current.wrapped ?? current.inner;
|
|
39
|
-
continue;
|
|
40
|
-
}
|
|
41
|
-
if (kind === "pipe" && Array.isArray(current.pipe) && current.pipe.length > 0) {
|
|
42
|
-
current = current.pipe[0];
|
|
43
|
-
continue;
|
|
44
|
-
}
|
|
45
|
-
return kind;
|
|
46
|
-
}
|
|
47
|
-
return "unknown";
|
|
48
|
-
}
|
|
49
|
-
/** Whether the CAC option for this schema should be a boolean flag. */
|
|
50
|
-
function isBooleanFlag(schema) {
|
|
51
|
-
return getSchemaKind(schema) === "boolean";
|
|
52
|
-
}
|
|
53
|
-
/** Validate and coerce the raw cac-parsed bag against a {@link CliFlagsSchema}. */
|
|
54
|
-
function parseCliFlags(schema, raw) {
|
|
55
|
-
const flags = {};
|
|
56
|
-
const issues = [];
|
|
57
|
-
for (const [key, fieldSchema] of Object.entries(schema)) {
|
|
58
|
-
const result = safeParse(fieldSchema, raw[key]);
|
|
59
|
-
if (result.success) flags[key] = result.output;
|
|
60
|
-
else issues.push(`--${toKebab(key)}: ${result.issues.map((i) => i.message).join(", ")}`);
|
|
61
|
-
}
|
|
62
|
-
for (const [key, value] of Object.entries(raw)) if (!(key in schema) && !(key in flags)) flags[key] = value;
|
|
63
|
-
return issues.length ? {
|
|
64
|
-
flags,
|
|
65
|
-
issues
|
|
66
|
-
} : { flags };
|
|
67
|
-
}
|
|
68
|
-
function toKebab(camel) {
|
|
69
|
-
return camel.replaceAll(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
70
|
-
}
|
|
71
|
-
/** Kebab-case a schema key for CAC option registration. */
|
|
72
|
-
function flagKeyToOption(camel) {
|
|
73
|
-
return toKebab(camel);
|
|
74
|
-
}
|
|
75
|
-
//#endregion
|
|
76
|
-
//#region src/define.ts
|
|
77
|
-
const defineRpcFunction = createDefineWrapperWithContext();
|
|
78
|
-
function defineCommand(command) {
|
|
79
|
-
return command;
|
|
80
|
-
}
|
|
81
|
-
function defineJsonRenderSpec(spec) {
|
|
82
|
-
return spec;
|
|
83
|
-
}
|
|
84
|
-
//#endregion
|
|
85
|
-
export { flagKeyToOption as a, defineCliFlags as i, defineJsonRenderSpec as n, isBooleanFlag as o, defineRpcFunction as r, parseCliFlags as s, defineCommand as t };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|