@flock/wirespec 0.18.6 → 0.19.0-RC.3
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/Kotlin-DateTime-library-kotlinx-datetime.mjs +4 -0
- package/Kotlin-DateTime-library-kotlinx-datetime.mjs.map +1 -0
- package/arrow-arrow-atomic.mjs +12 -12
- package/arrow-arrow-core.mjs +154 -154
- package/clikt-clikt-mordant.mjs +80 -80
- package/clikt-clikt-mordant.mjs.map +1 -1
- package/clikt-clikt.mjs +1549 -1549
- package/clikt-clikt.mjs.map +1 -1
- package/colormath-root-colormath.mjs +441 -441
- 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-kotest-property-datetime.mjs +4 -0
- package/kotest-kotest-property-kotest-property-datetime.mjs.map +1 -0
- package/kotest-kotest-property.mjs +2400 -0
- package/kotest-kotest-property.mjs.map +1 -0
- package/kotest-property-arbs.mjs +4 -0
- package/kotest-property-arbs.mjs.map +1 -0
- package/kotlin-kotlin-stdlib.mjs +5198 -2276
- package/kotlin-kotlin-stdlib.mjs.map +1 -1
- package/kotlin-openapi-bindings.mjs +4933 -4933
- package/kotlin-openapi-bindings.mjs.map +1 -1
- package/kotlin-rgxgen.mjs +1802 -1802
- package/kotlinx-coroutines-test.mjs +4 -0
- package/kotlinx-coroutines-test.mjs.map +1 -0
- package/kotlinx-io-kotlinx-io-core.mjs +432 -432
- package/kotlinx-io-kotlinx-io-core.mjs.map +1 -1
- package/kotlinx-serialization-kotlinx-serialization-core.mjs +1993 -1959
- package/kotlinx-serialization-kotlinx-serialization-core.mjs.map +1 -1
- package/kotlinx-serialization-kotlinx-serialization-json.mjs +1388 -1388
- package/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -1
- package/mordant-mordant.mjs +1321 -1321
- package/package.json +9 -2
- package/wirespec-generator.d.ts +52 -0
- package/wirespec-generator.mjs +9 -0
- package/wirespec-src-compiler-core.mjs +1538 -1537
- package/wirespec-src-compiler-emitters-java.mjs +451 -389
- package/wirespec-src-compiler-emitters-java.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-kotlin.mjs +364 -301
- package/wirespec-src-compiler-emitters-kotlin.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-python.mjs +556 -359
- package/wirespec-src-compiler-emitters-python.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-rust.mjs +758 -458
- package/wirespec-src-compiler-emitters-rust.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-scala.mjs +243 -165
- package/wirespec-src-compiler-emitters-scala.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-typescript.mjs +706 -420
- package/wirespec-src-compiler-emitters-typescript.mjs.map +1 -1
- package/wirespec-src-compiler-emitters-wirespec.mjs +80 -80
- package/wirespec-src-compiler-emitters-wirespec.mjs.map +1 -1
- package/wirespec-src-compiler-ir.mjs +6639 -4861
- package/wirespec-src-compiler-ir.mjs.map +1 -1
- package/wirespec-src-compiler-lib.mjs +418 -418
- package/wirespec-src-compiler-lib.mjs.map +1 -1
- package/wirespec-src-converter-avro.mjs +509 -509
- package/wirespec-src-converter-avro.mjs.map +1 -1
- package/wirespec-src-converter-openapi.mjs +753 -753
- package/wirespec-src-converter-openapi.mjs.map +1 -1
- package/wirespec-src-integration-kotest.mjs +1455 -0
- package/wirespec-src-integration-kotest.mjs.map +1 -0
- package/wirespec-src-plugin-arguments.mjs +182 -182
- package/wirespec-src-plugin-arguments.mjs.map +1 -1
- package/wirespec-src-plugin-cli.mjs +106 -106
- package/wirespec-src-plugin-npm.d.mts +11 -0
- package/wirespec-src-plugin-npm.mjs +41 -41
- package/wirespec-src-plugin-npm.mjs.map +1 -1
- package/wirespec-src-tools-generator.mjs +53 -53
- 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,12 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flock/wirespec",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.0-RC.3",
|
|
4
4
|
"main": "wirespec-src-plugin-npm.mjs",
|
|
5
5
|
"types": "wirespec-src-plugin-npm.d.mts",
|
|
6
6
|
"devDependencies": {
|
|
7
7
|
"typescript": "5.9.3"
|
|
8
8
|
},
|
|
9
|
-
"dependencies": {
|
|
9
|
+
"dependencies": {
|
|
10
|
+
"@js-joda/core": "3.2.0",
|
|
11
|
+
"format-util": "^1.0.5"
|
|
12
|
+
},
|
|
10
13
|
"peerDependencies": {},
|
|
11
14
|
"optionalDependencies": {},
|
|
12
15
|
"bundledDependencies": [],
|
|
@@ -26,6 +29,10 @@
|
|
|
26
29
|
"./serialization": {
|
|
27
30
|
"types": "./wirespec-serialization.d.ts",
|
|
28
31
|
"default": "./wirespec-serialization.mjs"
|
|
32
|
+
},
|
|
33
|
+
"./generator": {
|
|
34
|
+
"types": "./wirespec-generator.d.ts",
|
|
35
|
+
"default": "./wirespec-generator.mjs"
|
|
29
36
|
}
|
|
30
37
|
},
|
|
31
38
|
"repository": {
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wirespec.Generator backed by Kotest Arbs (Kotlin/JS), with a
|
|
3
|
+
* deterministic seed and an optional name registry for `@Generator("name")`
|
|
4
|
+
* fields.
|
|
5
|
+
*
|
|
6
|
+
* Default catalog (preinstalled): `email`, `ipAddress`. JVM-only extras
|
|
7
|
+
* (`uuid`, `firstName`, `lastName`, `fullName`/`name`, `username`, `domain`,
|
|
8
|
+
* `color`) are not available in the npm distribution because
|
|
9
|
+
* `kotest-property-arbs` doesn't ship a Kotlin/JS-IR-compatible artifact.
|
|
10
|
+
* Register custom names via the second argument.
|
|
11
|
+
*
|
|
12
|
+
* Integer-typed fields without explicit min/max bounds are drawn from the
|
|
13
|
+
* full Kotlin Long range and converted to JS numbers, so values can exceed
|
|
14
|
+
* `Number.MAX_SAFE_INTEGER` (2^53 - 1) and lose precision. For unconstrained
|
|
15
|
+
* Integer fields, prefer narrower bounds in your `.ws` source (e.g.,
|
|
16
|
+
* `Integer(0, 1000000)`) when precise round-tripping matters.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
export type Type = string;
|
|
20
|
+
|
|
21
|
+
export interface GeneratorField<T extends any | undefined> {}
|
|
22
|
+
|
|
23
|
+
export type GeneratorFieldString = { kind: "string", regex: string | undefined, annotations: Record<string, any>[] };
|
|
24
|
+
export type GeneratorFieldInteger64 = { kind: "integer64", min: number | undefined, max: number | undefined, annotations: Record<string, any>[] };
|
|
25
|
+
export type GeneratorFieldInteger32 = { kind: "integer32", min: number | undefined, max: number | undefined, annotations: Record<string, any>[] };
|
|
26
|
+
export type GeneratorFieldNumber64 = { kind: "number64", min: number | undefined, max: number | undefined, annotations: Record<string, any>[] };
|
|
27
|
+
export type GeneratorFieldNumber32 = { kind: "number32", min: number | undefined, max: number | undefined, annotations: Record<string, any>[] };
|
|
28
|
+
export type GeneratorFieldBoolean = { kind: "boolean", annotations: Record<string, any>[] };
|
|
29
|
+
export type GeneratorFieldBytes = { kind: "bytes", annotations: Record<string, any>[] };
|
|
30
|
+
export type GeneratorFieldEnum = { kind: "enum", values: string[], annotations: Record<string, any>[], type: Type };
|
|
31
|
+
export type GeneratorFieldUnion = { kind: "union", variants: string[], annotations: Record<string, any>[], type: Type };
|
|
32
|
+
export type GeneratorFieldArray<T> = { kind: "array", generate: (p0: string[]) => T };
|
|
33
|
+
export type GeneratorFieldNullable<T> = { kind: "nullable", generate: (p0: string[]) => T };
|
|
34
|
+
export type GeneratorFieldShape<T> = { kind: "shape", annotations: Record<string, Record<string, any>[]>, generate: (p0: string[]) => T, type: Type };
|
|
35
|
+
export type GeneratorFieldDict<V> = { kind: "dict", generate: (p0: string[]) => V };
|
|
36
|
+
|
|
37
|
+
export interface WirespecGenerator {
|
|
38
|
+
generate<T>(path: string[], field: GeneratorField<T>): T;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export type GeneratorRegistrations = Record<string, (seed: number) => string>;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* @param seed Deterministic seed (0..2^31-1). Same seed + same generated
|
|
45
|
+
* type → identical output.
|
|
46
|
+
* @param registrations Optional `@Generator("name")` registry. Names are
|
|
47
|
+
* matched case-insensitively. Overrides defaults.
|
|
48
|
+
*/
|
|
49
|
+
export declare function kotestWirespecGenerator(
|
|
50
|
+
seed?: number,
|
|
51
|
+
registrations?: GeneratorRegistrations,
|
|
52
|
+
): 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, registrations) {
|
|
8
|
+
return kotestWirespecGeneratorJs(seed, registrations);
|
|
9
|
+
}
|