@vibeorm/generator 2.0.0-alpha.1 → 2.0.0-alpha.10
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/emit-dts.d.ts +10 -0
- package/dist/emit-dts.d.ts.map +1 -1
- package/dist/emit-js.d.ts +21 -3
- package/dist/emit-js.d.ts.map +1 -1
- package/dist/generate.d.ts +5 -2
- package/dist/generate.d.ts.map +1 -1
- package/dist/index.js +971 -282
- package/dist/index.js.map +8 -8
- package/dist/schema-view.d.ts +28 -2
- package/dist/schema-view.d.ts.map +1 -1
- package/dist/type-names.d.ts.map +1 -1
- package/package.json +4 -2
package/dist/emit-dts.d.ts
CHANGED
|
@@ -12,11 +12,21 @@
|
|
|
12
12
|
* spelled out flat;
|
|
13
13
|
* - no Zod, no `as const` inference trees, no mega-unions.
|
|
14
14
|
*/
|
|
15
|
+
import type { ComputedManifestEntry } from "@vibeorm/schema";
|
|
15
16
|
import type { BakedExtensions } from "./extension-bake.ts";
|
|
16
17
|
import type { SchemaView } from "./schema-view.ts";
|
|
18
|
+
/**
|
|
19
|
+
* Emit enums.d.ts: every enum's constant, literal union and flat validator
|
|
20
|
+
* type, plus the grouped `enumValidators`. Fully pre-resolved — no generics,
|
|
21
|
+
* no imports — and independent of the client surface in index.d.ts.
|
|
22
|
+
*/
|
|
23
|
+
export declare function emitEnumsDts(params: {
|
|
24
|
+
view: SchemaView;
|
|
25
|
+
}): string;
|
|
17
26
|
/** Emit the full index.d.ts for a resolved schema view. */
|
|
18
27
|
export declare function emitDts(params: {
|
|
19
28
|
view: SchemaView;
|
|
20
29
|
baked?: BakedExtensions;
|
|
30
|
+
computed?: readonly ComputedManifestEntry[];
|
|
21
31
|
}): string;
|
|
22
32
|
//# sourceMappingURL=emit-dts.d.ts.map
|
package/dist/emit-dts.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emit-dts.d.ts","sourceRoot":"","sources":["../src/emit-dts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;
|
|
1
|
+
{"version":3,"file":"emit-dts.d.ts","sourceRoot":"","sources":["../src/emit-dts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,EAAE,qBAAqB,EAAoB,MAAM,iBAAiB,CAAC;AAG/E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,EAAgD,UAAU,EAAE,MAAM,kBAAkB,CAAC;AA4VjG;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,GAAG,MAAM,CAejE;AAogDD,2DAA2D;AAC3D,wBAAgB,OAAO,CAAC,MAAM,EAAE;IAC9B,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,QAAQ,CAAC,EAAE,SAAS,qBAAqB,EAAE,CAAC;CAC7C,GAAG,MAAM,CA8ET"}
|
package/dist/emit-js.d.ts
CHANGED
|
@@ -2,15 +2,33 @@
|
|
|
2
2
|
* Emits the generated client's index.js — runtime glue ONLY. All typing lives
|
|
3
3
|
* in the directly-written index.d.ts (see emit-dts.ts); this file embeds the
|
|
4
4
|
* normalized Schema IR as plain data (no `as const` inference trees), exports
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* @vibeorm/runtime
|
|
5
|
+
* re-exports the enum constants and `enumValidators` from the lightweight
|
|
6
|
+
* enums.js entry (emitted here too, by `emitEnumsJs`) and wires `VibeClient()`
|
|
7
|
+
* to the dynamic client in @vibeorm/runtime. Import specifiers stay bare — the
|
|
8
|
+
* consumer resolves @vibeorm/runtime and @vibeorm/schema from its own
|
|
9
|
+
* node_modules.
|
|
8
10
|
*/
|
|
11
|
+
import type { ComputedManifestEntry } from "@vibeorm/schema";
|
|
9
12
|
import type { BakedExtensions } from "./extension-bake.ts";
|
|
10
13
|
import type { SchemaView } from "./schema-view.ts";
|
|
14
|
+
/** The names index.js / index.d.ts re-export from the enums entry (enum constants + the parser group). */
|
|
15
|
+
export declare function enumEntryExports(params: {
|
|
16
|
+
view: SchemaView;
|
|
17
|
+
}): readonly string[];
|
|
18
|
+
/**
|
|
19
|
+
* Emit the lightweight enums.js entry: one frozen constant object per enum
|
|
20
|
+
* (the SAME declaration index.js re-exports — one source of truth) and the
|
|
21
|
+
* grouped `enumValidators` boundary parsers. Depends on `@vibeorm/schema`
|
|
22
|
+
* (for the typed `VibeError`) and nothing else — never on the runtime
|
|
23
|
+
* client or the application schema module, so a frontend can import it.
|
|
24
|
+
*/
|
|
25
|
+
export declare function emitEnumsJs(params: {
|
|
26
|
+
view: SchemaView;
|
|
27
|
+
}): string;
|
|
11
28
|
/** Emit the full index.js for a resolved schema view. */
|
|
12
29
|
export declare function emitJs(params: {
|
|
13
30
|
view: SchemaView;
|
|
14
31
|
baked?: BakedExtensions;
|
|
32
|
+
computed?: readonly ComputedManifestEntry[];
|
|
15
33
|
}): string;
|
|
16
34
|
//# sourceMappingURL=emit-js.d.ts.map
|
package/dist/emit-js.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emit-js.d.ts","sourceRoot":"","sources":["../src/emit-js.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"emit-js.d.ts","sourceRoot":"","sources":["../src/emit-js.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAOnD,0GAA0G;AAC1G,wBAAgB,gBAAgB,CAAC,MAAM,EAAE;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,GAAG,SAAS,MAAM,EAAE,CAEhF;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,GAAG,MAAM,CA0DhE;AAmDD,yDAAyD;AACzD,wBAAgB,MAAM,CAAC,MAAM,EAAE;IAC7B,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,QAAQ,CAAC,EAAE,SAAS,qBAAqB,EAAE,CAAC;CAC7C,GAAG,MAAM,CA0ET"}
|
package/dist/generate.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The generator's public entry point: SchemaIR → a consumable client module
|
|
3
|
-
* directory (index.js + directly-written index.d.ts
|
|
3
|
+
* directory (index.js + directly-written index.d.ts, the lightweight enums.js +
|
|
4
|
+
* enums.d.ts entry index re-exports from, and README.md).
|
|
4
5
|
*
|
|
5
6
|
* Output is byte-identical for structurally identical IR: models, enums and
|
|
6
7
|
* extensions are sorted by name, object keys are serialized sorted, and every
|
|
7
8
|
* emitter iterates deterministically.
|
|
8
9
|
*/
|
|
9
|
-
import type { SchemaIR, VibeExtension } from "@vibeorm/schema";
|
|
10
|
+
import type { ComputedConfig, SchemaIR, VibeExtension } from "@vibeorm/schema";
|
|
10
11
|
/** What `generateClient` wrote. */
|
|
11
12
|
export type GenerateResult = {
|
|
12
13
|
/** Paths of the written files (outDir-joined, in emission order). */
|
|
@@ -22,5 +23,7 @@ export declare function generateClient(params: {
|
|
|
22
23
|
outDir: string;
|
|
23
24
|
/** Configured extension instances — their surfaces bake into the client (D9). */
|
|
24
25
|
extensions?: readonly VibeExtension[];
|
|
26
|
+
/** Computed-field config — types bake into the .d.ts, the manifest into index.js. */
|
|
27
|
+
computed?: ComputedConfig;
|
|
25
28
|
}): Promise<GenerateResult>;
|
|
26
29
|
//# sourceMappingURL=generate.d.ts.map
|
package/dist/generate.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../src/generate.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../src/generate.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAyB,QAAQ,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAMtG,mCAAmC;AACnC,MAAM,MAAM,cAAc,GAAG;IAC3B,qEAAqE;IACrE,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB,CAAC;AAOF;;;;GAIG;AACH,wBAAsB,cAAc,CAAC,MAAM,EAAE;IAC3C,MAAM,EAAE,QAAQ,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,iFAAiF;IACjF,UAAU,CAAC,EAAE,SAAS,aAAa,EAAE,CAAC;IACtC,qFAAqF;IACrF,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC3B,GAAG,OAAO,CAAC,cAAc,CAAC,CA2B1B"}
|