@flock/wirespec 0.19.2 → 0.19.3-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.
Files changed (72) hide show
  1. package/arrow-arrow-atomic.mjs +12 -12
  2. package/arrow-arrow-core.mjs +167 -167
  3. package/clikt-clikt-mordant.mjs +81 -81
  4. package/clikt-clikt-mordant.mjs.map +1 -1
  5. package/clikt-clikt.mjs +1636 -1636
  6. package/clikt-clikt.mjs.map +1 -1
  7. package/colormath-root-colormath.mjs +448 -448
  8. package/kotest-kotest-assertions-kotest-assertions-core.mjs +4 -0
  9. package/kotest-kotest-assertions-kotest-assertions-core.mjs.map +1 -0
  10. package/kotest-kotest-assertions-kotest-assertions-shared.mjs +4 -0
  11. package/kotest-kotest-assertions-kotest-assertions-shared.mjs.map +1 -0
  12. package/kotest-kotest-common.mjs +56 -0
  13. package/kotest-kotest-common.mjs.map +1 -0
  14. package/kotest-kotest-framework-kotest-framework-engine.mjs +4 -0
  15. package/kotest-kotest-framework-kotest-framework-engine.mjs.map +1 -0
  16. package/kotest-kotest-property.mjs +2501 -0
  17. package/kotest-kotest-property.mjs.map +1 -0
  18. package/kotlin-kotlin-stdlib.mjs +5269 -2487
  19. package/kotlin-kotlin-stdlib.mjs.map +1 -1
  20. package/kotlin-openapi-bindings.mjs +10266 -10266
  21. package/kotlin-openapi-bindings.mjs.map +1 -1
  22. package/kotlin-rgxgen.mjs +1846 -1846
  23. package/kotlin-rgxgen.mjs.map +1 -1
  24. package/kotlinx-coroutines-test.mjs +4 -0
  25. package/kotlinx-coroutines-test.mjs.map +1 -0
  26. package/kotlinx-io-kotlinx-io-core.mjs +455 -455
  27. package/kotlinx-io-kotlinx-io-core.mjs.map +1 -1
  28. package/kotlinx-serialization-kotlinx-serialization-core.mjs +2132 -2098
  29. package/kotlinx-serialization-kotlinx-serialization-core.mjs.map +1 -1
  30. package/kotlinx-serialization-kotlinx-serialization-json.mjs +1579 -1579
  31. package/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -1
  32. package/mordant-mordant.mjs +1435 -1435
  33. package/package.json +5 -1
  34. package/wirespec-generator.d.ts +51 -0
  35. package/wirespec-generator.mjs +9 -0
  36. package/wirespec-src-compiler-core.mjs +1597 -1597
  37. package/wirespec-src-compiler-emitters-java.mjs +451 -451
  38. package/wirespec-src-compiler-emitters-java.mjs.map +1 -1
  39. package/wirespec-src-compiler-emitters-kotlin.mjs +371 -371
  40. package/wirespec-src-compiler-emitters-kotlin.mjs.map +1 -1
  41. package/wirespec-src-compiler-emitters-python.mjs +456 -456
  42. package/wirespec-src-compiler-emitters-python.mjs.map +1 -1
  43. package/wirespec-src-compiler-emitters-rust.mjs +481 -481
  44. package/wirespec-src-compiler-emitters-scala.mjs +193 -193
  45. package/wirespec-src-compiler-emitters-typescript.mjs +526 -526
  46. package/wirespec-src-compiler-emitters-typescript.mjs.map +1 -1
  47. package/wirespec-src-compiler-emitters-wirespec.mjs +85 -85
  48. package/wirespec-src-compiler-emitters-wirespec.mjs.map +1 -1
  49. package/wirespec-src-compiler-ir.mjs +3913 -3857
  50. package/wirespec-src-compiler-ir.mjs.map +1 -1
  51. package/wirespec-src-compiler-lib.mjs +439 -439
  52. package/wirespec-src-compiler-lib.mjs.map +1 -1
  53. package/wirespec-src-converter-avro.mjs +521 -521
  54. package/wirespec-src-converter-avro.mjs.map +1 -1
  55. package/wirespec-src-converter-openapi.mjs +859 -859
  56. package/wirespec-src-converter-openapi.mjs.map +1 -1
  57. package/wirespec-src-ide-lsp.mjs +1387 -1387
  58. package/wirespec-src-ide-lsp.mjs.map +1 -1
  59. package/wirespec-src-integration-kotest.mjs +1647 -0
  60. package/wirespec-src-integration-kotest.mjs.map +1 -0
  61. package/wirespec-src-plugin-arguments.mjs +192 -192
  62. package/wirespec-src-plugin-arguments.mjs.map +1 -1
  63. package/wirespec-src-plugin-cli.mjs +109 -109
  64. package/wirespec-src-plugin-npm.d.mts +21 -0
  65. package/wirespec-src-plugin-npm.mjs +43 -43
  66. package/wirespec-src-plugin-npm.mjs.map +1 -1
  67. package/wirespec-src-tools-generator.mjs +35 -35
  68. package/wirespec-src-tools-generator.mjs.map +1 -1
  69. package/xmlutil-core.mjs +4 -0
  70. package/xmlutil-core.mjs.map +1 -0
  71. package/xmlutil-serialization.mjs +4 -0
  72. 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.19.2",
3
+ "version": "0.19.3-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
+ }