@flock/wirespec 0.19.5 → 0.20.0-RC.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.
- package/arrow-arrow-atomic.mjs +12 -12
- package/arrow-arrow-core.mjs +167 -167
- package/clikt-clikt-mordant.mjs +81 -81
- package/clikt-clikt-mordant.mjs.map +1 -1
- package/clikt-clikt.mjs +1636 -1636
- package/clikt-clikt.mjs.map +1 -1
- package/colormath-root-colormath.mjs +448 -448
- package/kotest-kotest-assertions-kotest-assertions-core.mjs +4 -0
- package/kotest-kotest-assertions-kotest-assertions-core.mjs.map +1 -0
- package/kotest-kotest-assertions-kotest-assertions-shared.mjs +4 -0
- package/kotest-kotest-assertions-kotest-assertions-shared.mjs.map +1 -0
- package/kotest-kotest-common.mjs +56 -0
- package/kotest-kotest-common.mjs.map +1 -0
- package/kotest-kotest-framework-kotest-framework-engine.mjs +4 -0
- package/kotest-kotest-framework-kotest-framework-engine.mjs.map +1 -0
- package/kotest-kotest-property.mjs +2501 -0
- package/kotest-kotest-property.mjs.map +1 -0
- package/kotlin-kotlin-stdlib.mjs +5263 -2481
- package/kotlin-kotlin-stdlib.mjs.map +1 -1
- package/kotlin-openapi-bindings.mjs +10243 -10243
- package/kotlin-openapi-bindings.mjs.map +1 -1
- package/kotlin-rgxgen.mjs +1846 -1846
- package/kotlin-rgxgen.mjs.map +1 -1
- package/kotlinx-coroutines-test.mjs +4 -0
- package/kotlinx-coroutines-test.mjs.map +1 -0
- package/kotlinx-io-kotlinx-io-core.mjs +455 -455
- package/kotlinx-io-kotlinx-io-core.mjs.map +1 -1
- package/kotlinx-serialization-kotlinx-serialization-core.mjs +2135 -2101
- package/kotlinx-serialization-kotlinx-serialization-core.mjs.map +1 -1
- package/kotlinx-serialization-kotlinx-serialization-json.mjs +1579 -1579
- package/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -1
- package/mordant-mordant.mjs +1435 -1435
- package/package.json +5 -1
- package/wirespec-generator.d.ts +51 -0
- package/wirespec-generator.mjs +9 -0
- package/wirespec-src-compiler-core.mjs +1598 -1598
- package/wirespec-src-compiler-emitters-java.mjs +445 -445
- package/wirespec-src-compiler-emitters-java.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-kotlin.mjs +343 -343
- package/wirespec-src-compiler-emitters-kotlin.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-python.mjs +429 -429
- package/wirespec-src-compiler-emitters-python.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-rust.mjs +482 -482
- package/wirespec-src-compiler-emitters-scala.mjs +194 -194
- package/wirespec-src-compiler-emitters-typescript.mjs +530 -530
- package/wirespec-src-compiler-emitters-typescript.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-wirespec.mjs +87 -87
- package/wirespec-src-compiler-emitters-wirespec.mjs.map +1 -1
- package/wirespec-src-compiler-ir.mjs +3887 -3863
- package/wirespec-src-compiler-ir.mjs.map +1 -1
- package/wirespec-src-compiler-lib.mjs +457 -457
- package/wirespec-src-compiler-lib.mjs.map +1 -1
- package/wirespec-src-converter-avro.mjs +521 -521
- package/wirespec-src-converter-avro.mjs.map +1 -1
- package/wirespec-src-converter-openapi.mjs +859 -859
- package/wirespec-src-converter-openapi.mjs.map +1 -1
- package/wirespec-src-ide-lsp.mjs +1387 -1387
- package/wirespec-src-ide-lsp.mjs.map +1 -1
- package/wirespec-src-integration-kotest.mjs +1647 -0
- package/wirespec-src-integration-kotest.mjs.map +1 -0
- package/wirespec-src-plugin-arguments.mjs +192 -192
- package/wirespec-src-plugin-arguments.mjs.map +1 -1
- package/wirespec-src-plugin-cli.mjs +109 -109
- package/wirespec-src-plugin-npm.d.mts +21 -0
- package/wirespec-src-plugin-npm.mjs +43 -43
- package/wirespec-src-plugin-npm.mjs.map +1 -1
- package/wirespec-src-tools-generator.mjs +35 -35
- package/wirespec-src-tools-generator.mjs.map +1 -1
- package/xmlutil-core.mjs +4 -0
- package/xmlutil-core.mjs.map +1 -0
- package/xmlutil-serialization.mjs +4 -0
- package/xmlutil-serialization.mjs.map +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flock/wirespec",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0-RC.1",
|
|
4
4
|
"main": "wirespec-src-plugin-npm.mjs",
|
|
5
5
|
"types": "wirespec-src-plugin-npm.d.mts",
|
|
6
6
|
"devDependencies": {
|
|
@@ -30,6 +30,10 @@
|
|
|
30
30
|
"types": "./wirespec-serialization.d.ts",
|
|
31
31
|
"default": "./wirespec-serialization.mjs"
|
|
32
32
|
},
|
|
33
|
+
"./generator": {
|
|
34
|
+
"types": "./wirespec-generator.d.ts",
|
|
35
|
+
"default": "./wirespec-generator.mjs"
|
|
36
|
+
},
|
|
33
37
|
"./msw": {
|
|
34
38
|
"types": "./wirespec-msw.d.ts",
|
|
35
39
|
"default": "./wirespec-msw.mjs"
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wirespec.Generator backed by Kotest Arbs (Kotlin/JS), with a
|
|
3
|
+
* deterministic seed and optional constant-value path overrides.
|
|
4
|
+
*
|
|
5
|
+
* Integer-typed fields without explicit min/max bounds are drawn from the
|
|
6
|
+
* full Kotlin Long range and converted to JS numbers, so values can exceed
|
|
7
|
+
* `Number.MAX_SAFE_INTEGER` (2^53 - 1) and lose precision. For unconstrained
|
|
8
|
+
* Integer fields, prefer narrower bounds in your `.ws` source (e.g.,
|
|
9
|
+
* `Integer(0, 1000000)`) when precise round-tripping matters.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
export type Type = string;
|
|
13
|
+
|
|
14
|
+
export interface GeneratorField<T extends any | undefined> {}
|
|
15
|
+
|
|
16
|
+
export type GeneratorFieldString = { kind: "string", regex: string | undefined, annotations: Record<string, any>[] };
|
|
17
|
+
export type GeneratorFieldInteger64 = { kind: "integer64", min: number | undefined, max: number | undefined, annotations: Record<string, any>[] };
|
|
18
|
+
export type GeneratorFieldInteger32 = { kind: "integer32", min: number | undefined, max: number | undefined, annotations: Record<string, any>[] };
|
|
19
|
+
export type GeneratorFieldNumber64 = { kind: "number64", min: number | undefined, max: number | undefined, annotations: Record<string, any>[] };
|
|
20
|
+
export type GeneratorFieldNumber32 = { kind: "number32", min: number | undefined, max: number | undefined, annotations: Record<string, any>[] };
|
|
21
|
+
export type GeneratorFieldBoolean = { kind: "boolean", annotations: Record<string, any>[] };
|
|
22
|
+
export type GeneratorFieldBytes = { kind: "bytes", annotations: Record<string, any>[] };
|
|
23
|
+
export type GeneratorFieldEnum = { kind: "enum", values: string[], annotations: Record<string, any>[], type: Type };
|
|
24
|
+
export type GeneratorFieldUnion = { kind: "union", variants: string[], annotations: Record<string, any>[], type: Type };
|
|
25
|
+
export type GeneratorFieldArray<T> = { kind: "array", generate: (p0: string[]) => T };
|
|
26
|
+
export type GeneratorFieldNullable<T> = { kind: "nullable", generate: (p0: string[]) => T };
|
|
27
|
+
export type GeneratorFieldShape<T> = { kind: "shape", annotations: Record<string, Record<string, any>[]>, generate: (p0: string[]) => T, type: Type };
|
|
28
|
+
export type GeneratorFieldDict<V> = { kind: "dict", generate: (p0: string[]) => V };
|
|
29
|
+
|
|
30
|
+
export interface WirespecGenerator {
|
|
31
|
+
generate<T>(path: string[], field: GeneratorField<T>): T;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface GeneratorBuilder {
|
|
35
|
+
/**
|
|
36
|
+
* Pin the value generated at an exact path. `"*"` matches any single
|
|
37
|
+
* segment (e.g. an array index): `registerPath(["users", "*", "id"], "X")`.
|
|
38
|
+
*/
|
|
39
|
+
registerPath(segments: string[], value: any): void;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* @param seed Deterministic seed (0..2^31-1). Same seed + same generated
|
|
44
|
+
* type → identical output.
|
|
45
|
+
* @param configure Optional callback to register constant-value path
|
|
46
|
+
* overrides on the builder.
|
|
47
|
+
*/
|
|
48
|
+
export declare function kotestWirespecGenerator(
|
|
49
|
+
seed?: number,
|
|
50
|
+
configure?: (builder: GeneratorBuilder) => void,
|
|
51
|
+
): WirespecGenerator;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Re-exports the @JsExport facade from the bundled Kotlin/JS module under
|
|
2
|
+
// the TS-friendly name. The Kotlin facade is `kotestWirespecGeneratorJs`
|
|
3
|
+
// (with the `Js` suffix) so it doesn't collide with the Kotlin DSL function
|
|
4
|
+
// of the same root name in commonMain.
|
|
5
|
+
import { kotestWirespecGeneratorJs } from './wirespec-src-integration-kotest.mjs';
|
|
6
|
+
|
|
7
|
+
export function kotestWirespecGenerator(seed = 0, configure) {
|
|
8
|
+
return kotestWirespecGeneratorJs(seed, configure);
|
|
9
|
+
}
|