@code0-tech/triangulum 0.29.0 → 0.30.0
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/extraction/getFlowSchemas.d.ts +57 -0
- package/dist/index.d.ts +2 -0
- package/dist/triangulum.cjs.js +19 -18
- package/dist/triangulum.es.js +321 -189
- package/dist/util/jsonSchema.util.d.ts +18 -0
- package/package.json +9 -7
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Schema } from 'ts-json-schema-generator';
|
|
2
|
+
import { DataType } from '@code0-tech/sagittarius-graphql-types';
|
|
3
|
+
/** A generated JSON Schema, as produced by {@link generateJsonSchemas}. */
|
|
4
|
+
export type JsonSchema = Schema;
|
|
5
|
+
/**
|
|
6
|
+
* Generates JSON schemas for a batch of named TypeScript type expressions.
|
|
7
|
+
*
|
|
8
|
+
* The type strings (e.g. `"{ item: { test: number } }"` or `"NUMBER"`) are
|
|
9
|
+
* resolved through the same shared data-type declarations the rest of the
|
|
10
|
+
* library uses, then handed to `ts-json-schema-generator` for the actual JSON
|
|
11
|
+
* Schema generation — no schema shape is hand-built here.
|
|
12
|
+
*
|
|
13
|
+
* @param typeExpressions - Map of alias name to TypeScript type expression
|
|
14
|
+
* @param dataTypes - Data type definitions used to resolve named types/generics
|
|
15
|
+
* @returns Map of the same alias names to their generated JSON schema; an alias
|
|
16
|
+
* that fails to generate maps to the open schema `{}`
|
|
17
|
+
*/
|
|
18
|
+
export declare const generateJsonSchemas: (typeExpressions: Record<string, string>, dataTypes?: DataType[]) => Record<string, JsonSchema>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@code0-tech/triangulum",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.30.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"homepage": "https://github.com/code0-tech/triangulum#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -23,19 +23,21 @@
|
|
|
23
23
|
"build": "vite build"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@code0-tech/sagittarius-graphql-types": "0.0.0-experimental-
|
|
26
|
+
"@code0-tech/sagittarius-graphql-types": "0.0.0-experimental-2744343400-55133b9bb6062772c50f83d945a22a531a6e48e2",
|
|
27
27
|
"@types/node": "^25.6.0",
|
|
28
28
|
"@typescript/vfs": "^1.6.4",
|
|
29
|
+
"lossless-json": "^4.3.0",
|
|
30
|
+
"ts-json-schema-generator": "^2.9.0",
|
|
29
31
|
"typescript": "^6.0.3",
|
|
30
32
|
"vite": "^8.0.16",
|
|
31
33
|
"vite-plugin-dts": "^4.5.4",
|
|
32
|
-
"vitest": "^4.1.8"
|
|
33
|
-
"lossless-json": "^4.3.0"
|
|
34
|
+
"vitest": "^4.1.8"
|
|
34
35
|
},
|
|
35
36
|
"peerDependencies": {
|
|
36
|
-
"@code0-tech/sagittarius-graphql-types": "0.0.0-experimental-
|
|
37
|
+
"@code0-tech/sagittarius-graphql-types": "0.0.0-experimental-2744343400-55133b9bb6062772c50f83d945a22a531a6e48e2",
|
|
37
38
|
"@typescript/vfs": "^1.6.4",
|
|
38
|
-
"
|
|
39
|
-
"
|
|
39
|
+
"lossless-json": "^4.3.0",
|
|
40
|
+
"ts-json-schema-generator": "^2.9.0",
|
|
41
|
+
"typescript": "^5.9.3 || ^6.0.2"
|
|
40
42
|
}
|
|
41
43
|
}
|