@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.
Files changed (77) hide show
  1. package/Kotlin-DateTime-library-kotlinx-datetime.mjs +4 -0
  2. package/Kotlin-DateTime-library-kotlinx-datetime.mjs.map +1 -0
  3. package/arrow-arrow-atomic.mjs +12 -12
  4. package/arrow-arrow-core.mjs +154 -154
  5. package/clikt-clikt-mordant.mjs +80 -80
  6. package/clikt-clikt-mordant.mjs.map +1 -1
  7. package/clikt-clikt.mjs +1549 -1549
  8. package/clikt-clikt.mjs.map +1 -1
  9. package/colormath-root-colormath.mjs +441 -441
  10. package/kotest-kotest-assertions-kotest-assertions-core.mjs +4 -0
  11. package/kotest-kotest-assertions-kotest-assertions-core.mjs.map +1 -0
  12. package/kotest-kotest-assertions-kotest-assertions-shared.mjs +4 -0
  13. package/kotest-kotest-assertions-kotest-assertions-shared.mjs.map +1 -0
  14. package/kotest-kotest-common.mjs +56 -0
  15. package/kotest-kotest-common.mjs.map +1 -0
  16. package/kotest-kotest-framework-kotest-framework-engine.mjs +4 -0
  17. package/kotest-kotest-framework-kotest-framework-engine.mjs.map +1 -0
  18. package/kotest-kotest-property-kotest-property-datetime.mjs +4 -0
  19. package/kotest-kotest-property-kotest-property-datetime.mjs.map +1 -0
  20. package/kotest-kotest-property.mjs +2400 -0
  21. package/kotest-kotest-property.mjs.map +1 -0
  22. package/kotest-property-arbs.mjs +4 -0
  23. package/kotest-property-arbs.mjs.map +1 -0
  24. package/kotlin-kotlin-stdlib.mjs +5198 -2276
  25. package/kotlin-kotlin-stdlib.mjs.map +1 -1
  26. package/kotlin-openapi-bindings.mjs +4933 -4933
  27. package/kotlin-openapi-bindings.mjs.map +1 -1
  28. package/kotlin-rgxgen.mjs +1802 -1802
  29. package/kotlinx-coroutines-test.mjs +4 -0
  30. package/kotlinx-coroutines-test.mjs.map +1 -0
  31. package/kotlinx-io-kotlinx-io-core.mjs +432 -432
  32. package/kotlinx-io-kotlinx-io-core.mjs.map +1 -1
  33. package/kotlinx-serialization-kotlinx-serialization-core.mjs +1993 -1959
  34. package/kotlinx-serialization-kotlinx-serialization-core.mjs.map +1 -1
  35. package/kotlinx-serialization-kotlinx-serialization-json.mjs +1388 -1388
  36. package/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -1
  37. package/mordant-mordant.mjs +1321 -1321
  38. package/package.json +9 -2
  39. package/wirespec-generator.d.ts +52 -0
  40. package/wirespec-generator.mjs +9 -0
  41. package/wirespec-src-compiler-core.mjs +1538 -1537
  42. package/wirespec-src-compiler-emitters-java.mjs +451 -389
  43. package/wirespec-src-compiler-emitters-java.mjs.map +1 -1
  44. package/wirespec-src-compiler-emitters-kotlin.mjs +364 -301
  45. package/wirespec-src-compiler-emitters-kotlin.mjs.map +1 -1
  46. package/wirespec-src-compiler-emitters-python.mjs +556 -359
  47. package/wirespec-src-compiler-emitters-python.mjs.map +1 -1
  48. package/wirespec-src-compiler-emitters-rust.mjs +758 -458
  49. package/wirespec-src-compiler-emitters-rust.mjs.map +1 -1
  50. package/wirespec-src-compiler-emitters-scala.mjs +243 -165
  51. package/wirespec-src-compiler-emitters-scala.mjs.map +1 -1
  52. package/wirespec-src-compiler-emitters-typescript.mjs +706 -420
  53. package/wirespec-src-compiler-emitters-typescript.mjs.map +1 -1
  54. package/wirespec-src-compiler-emitters-wirespec.mjs +80 -80
  55. package/wirespec-src-compiler-emitters-wirespec.mjs.map +1 -1
  56. package/wirespec-src-compiler-ir.mjs +6639 -4861
  57. package/wirespec-src-compiler-ir.mjs.map +1 -1
  58. package/wirespec-src-compiler-lib.mjs +418 -418
  59. package/wirespec-src-compiler-lib.mjs.map +1 -1
  60. package/wirespec-src-converter-avro.mjs +509 -509
  61. package/wirespec-src-converter-avro.mjs.map +1 -1
  62. package/wirespec-src-converter-openapi.mjs +753 -753
  63. package/wirespec-src-converter-openapi.mjs.map +1 -1
  64. package/wirespec-src-integration-kotest.mjs +1455 -0
  65. package/wirespec-src-integration-kotest.mjs.map +1 -0
  66. package/wirespec-src-plugin-arguments.mjs +182 -182
  67. package/wirespec-src-plugin-arguments.mjs.map +1 -1
  68. package/wirespec-src-plugin-cli.mjs +106 -106
  69. package/wirespec-src-plugin-npm.d.mts +11 -0
  70. package/wirespec-src-plugin-npm.mjs +41 -41
  71. package/wirespec-src-plugin-npm.mjs.map +1 -1
  72. package/wirespec-src-tools-generator.mjs +53 -53
  73. package/wirespec-src-tools-generator.mjs.map +1 -1
  74. package/xmlutil-core.mjs +4 -0
  75. package/xmlutil-core.mjs.map +1 -0
  76. package/xmlutil-serialization.mjs +4 -0
  77. 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.18.6",
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
+ }