@palantir/pack.document-schema.type-gen 0.8.0 → 0.9.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/build/esm/commands/schema/registerSchemaCommands.js +2 -0
- package/build/esm/commands/schema/registerSchemaCommands.js.map +1 -1
- package/build/esm/commands/schema/schemaGenTypesHandler.js +147 -0
- package/build/esm/commands/schema/schemaGenTypesHandler.js.map +1 -0
- package/build/esm/index.js +6 -0
- package/build/esm/index.js.map +1 -1
- package/build/esm/lib/pack-docschema-api/pack-docschema-ir/recordDef.js.map +1 -1
- package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/custom-discriminant.js +1 -1
- package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/custom-discriminant.js.map +1 -1
- package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/external-refs.js +1 -1
- package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/external-refs.js.map +1 -1
- package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/simple-record.js +1 -1
- package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/simple-record.js.map +1 -1
- package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/union-types.js +1 -1
- package/build/esm/utils/ir/__tests__/__snapshots__/generateModelsFromIr/union-types.js.map +1 -1
- package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/array-and-map-types.js +1 -1
- package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/array-and-map-types.js.map +1 -1
- package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/boolean-fields.js +1 -1
- package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/boolean-fields.js.map +1 -1
- package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/custom-discriminant.js +1 -1
- package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/custom-discriminant.js.map +1 -1
- package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/datetime-fields.js +1 -1
- package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/datetime-fields.js.map +1 -1
- package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/simple-records.js +1 -1
- package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/simple-records.js.map +1 -1
- package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/union-before-records.js +1 -1
- package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/union-before-records.js.map +1 -1
- package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/union-types.js +1 -1
- package/build/esm/utils/ir/__tests__/__snapshots__/generateZodSchemasFromIr/union-types.js.map +1 -1
- package/build/esm/utils/ir/__tests__/convertIrToWireSchema.test.js +4 -16
- package/build/esm/utils/ir/__tests__/convertIrToWireSchema.test.js.map +1 -1
- package/build/esm/utils/ir/__tests__/generateModelsFromIr.test.js +6 -24
- package/build/esm/utils/ir/__tests__/generateModelsFromIr.test.js.map +1 -1
- package/build/esm/utils/ir/__tests__/generateZodSchemasFromIr.test.js +10 -40
- package/build/esm/utils/ir/__tests__/generateZodSchemasFromIr.test.js.map +1 -1
- package/build/esm/utils/ir/convertIrToWireSchema.js +4 -2
- package/build/esm/utils/ir/convertIrToWireSchema.js.map +1 -1
- package/build/esm/utils/ir/generateZodSchemasFromIr.js +1 -1
- package/build/esm/utils/ir/generateZodSchemasFromIr.js.map +1 -1
- package/build/esm/utils/schema/__tests__/__snapshots__/generateVersionsFromSchema/single-version.js +2 -0
- package/build/esm/utils/schema/__tests__/__snapshots__/generateVersionsFromSchema/single-version.js.map +1 -0
- package/build/esm/utils/schema/__tests__/__snapshots__/generateVersionsFromSchema/three-version-chain.js +2 -0
- package/build/esm/utils/schema/__tests__/__snapshots__/generateVersionsFromSchema/three-version-chain.js.map +1 -0
- package/build/esm/utils/schema/__tests__/__snapshots__/generateVersionsFromSchema/two-version.js +2 -0
- package/build/esm/utils/schema/__tests__/__snapshots__/generateVersionsFromSchema/two-version.js.map +1 -0
- package/build/esm/utils/schema/__tests__/fixtures.js +207 -0
- package/build/esm/utils/schema/__tests__/fixtures.js.map +1 -0
- package/build/esm/utils/schema/__tests__/generateInternalFromSchema.test.js +41 -0
- package/build/esm/utils/schema/__tests__/generateInternalFromSchema.test.js.map +1 -0
- package/build/esm/utils/schema/__tests__/generateModelMetadataFromSchema.test.js +41 -0
- package/build/esm/utils/schema/__tests__/generateModelMetadataFromSchema.test.js.map +1 -0
- package/build/esm/utils/schema/__tests__/generateScopeFromSchema.test.js +37 -0
- package/build/esm/utils/schema/__tests__/generateScopeFromSchema.test.js.map +1 -0
- package/build/esm/utils/schema/__tests__/generateVersionedTypesFromSchema.test.js +55 -0
- package/build/esm/utils/schema/__tests__/generateVersionedTypesFromSchema.test.js.map +1 -0
- package/build/esm/utils/schema/__tests__/generateVersionedZodFromSchema.test.js +55 -0
- package/build/esm/utils/schema/__tests__/generateVersionedZodFromSchema.test.js.map +1 -0
- package/build/esm/utils/schema/__tests__/generateVersionsFromSchema.test.js +37 -0
- package/build/esm/utils/schema/__tests__/generateVersionsFromSchema.test.js.map +1 -0
- package/build/esm/utils/schema/__tests__/snapshotUtils.js +106 -0
- package/build/esm/utils/schema/__tests__/snapshotUtils.js.map +1 -0
- package/build/esm/utils/schema/generateIndexFromSchema.js +72 -0
- package/build/esm/utils/schema/generateIndexFromSchema.js.map +1 -0
- package/build/esm/utils/schema/generateInternalFromSchema.js +380 -0
- package/build/esm/utils/schema/generateInternalFromSchema.js.map +1 -0
- package/build/esm/utils/schema/generateModelMetadataFromSchema.js +195 -0
- package/build/esm/utils/schema/generateModelMetadataFromSchema.js.map +1 -0
- package/build/esm/utils/schema/generateScopeFromSchema.js +155 -0
- package/build/esm/utils/schema/generateScopeFromSchema.js.map +1 -0
- package/build/esm/utils/schema/generateTypesFromSchema.js +16 -30
- package/build/esm/utils/schema/generateTypesFromSchema.js.map +1 -1
- package/build/esm/utils/schema/generateVersionedTypesFromSchema.js +281 -0
- package/build/esm/utils/schema/generateVersionedTypesFromSchema.js.map +1 -0
- package/build/esm/utils/schema/generateVersionedZodFromSchema.js +189 -0
- package/build/esm/utils/schema/generateVersionedZodFromSchema.js.map +1 -0
- package/build/esm/utils/schema/generateVersionsFromSchema.js +50 -0
- package/build/esm/utils/schema/generateVersionsFromSchema.js.map +1 -0
- package/build/esm/utils/schema/resolveSchemaChain.js +54 -0
- package/build/esm/utils/schema/resolveSchemaChain.js.map +1 -0
- package/build/esm/utils/schema/runtimeSchema.js +96 -0
- package/build/esm/utils/schema/runtimeSchema.js.map +1 -0
- package/build/esm/utils/steps/__tests__/__snapshots__/types/arrayFields.js.map +1 -1
- package/build/esm/utils/steps/__tests__/__snapshots__/types/customDiscriminant.js +1 -1
- package/build/esm/utils/steps/__tests__/__snapshots__/types/customDiscriminant.js.map +1 -1
- package/build/esm/utils/steps/__tests__/__snapshots__/types/generateTypeScriptInterfaces.js +1 -1
- package/build/esm/utils/steps/__tests__/__snapshots__/types/generateTypeScriptInterfaces.js.map +1 -1
- package/build/esm/utils/steps/__tests__/__snapshots__/types/refTypes.js.map +1 -1
- package/build/esm/utils/steps/__tests__/__snapshots__/types/simpleRecord.js.map +1 -1
- package/build/esm/utils/steps/__tests__/__snapshots__/types/simpleSteps.js +1 -1
- package/build/esm/utils/steps/__tests__/__snapshots__/types/simpleSteps.js.map +1 -1
- package/build/esm/utils/steps/convertStepsToIr.js +2 -5
- package/build/esm/utils/steps/convertStepsToIr.js.map +1 -1
- package/build/types/commands/schema/registerSchemaCommands.d.ts.map +1 -1
- package/build/types/commands/schema/schemaGenTypesHandler.d.ts +8 -0
- package/build/types/commands/schema/schemaGenTypesHandler.d.ts.map +1 -0
- package/build/types/index.d.ts +6 -0
- package/build/types/index.d.ts.map +1 -1
- package/build/types/lib/pack-docschema-api/pack-docschema-ir/recordDef.d.ts +0 -2
- package/build/types/lib/pack-docschema-api/pack-docschema-ir/recordDef.d.ts.map +1 -1
- package/build/types/utils/schema/__tests__/fixtures.d.ts +14 -0
- package/build/types/utils/schema/__tests__/fixtures.d.ts.map +1 -0
- package/build/types/utils/schema/__tests__/generateInternalFromSchema.test.d.ts +2 -0
- package/build/types/utils/schema/__tests__/generateInternalFromSchema.test.d.ts.map +1 -0
- package/build/types/utils/schema/__tests__/generateModelMetadataFromSchema.test.d.ts +2 -0
- package/build/types/utils/schema/__tests__/generateModelMetadataFromSchema.test.d.ts.map +1 -0
- package/build/types/utils/schema/__tests__/generateScopeFromSchema.test.d.ts +2 -0
- package/build/types/utils/schema/__tests__/generateScopeFromSchema.test.d.ts.map +1 -0
- package/build/types/utils/schema/__tests__/generateVersionedTypesFromSchema.test.d.ts +2 -0
- package/build/types/utils/schema/__tests__/generateVersionedTypesFromSchema.test.d.ts.map +1 -0
- package/build/types/utils/schema/__tests__/generateVersionedZodFromSchema.test.d.ts +2 -0
- package/build/types/utils/schema/__tests__/generateVersionedZodFromSchema.test.d.ts.map +1 -0
- package/build/types/utils/schema/__tests__/generateVersionsFromSchema.test.d.ts +2 -0
- package/build/types/utils/schema/__tests__/generateVersionsFromSchema.test.d.ts.map +1 -0
- package/build/types/utils/schema/__tests__/snapshotUtils.d.ts +47 -0
- package/build/types/utils/schema/__tests__/snapshotUtils.d.ts.map +1 -0
- package/build/types/utils/schema/generateIndexFromSchema.d.ts +14 -0
- package/build/types/utils/schema/generateIndexFromSchema.d.ts.map +1 -0
- package/build/types/utils/schema/generateInternalFromSchema.d.ts +18 -0
- package/build/types/utils/schema/generateInternalFromSchema.d.ts.map +1 -0
- package/build/types/utils/schema/generateModelMetadataFromSchema.d.ts +15 -0
- package/build/types/utils/schema/generateModelMetadataFromSchema.d.ts.map +1 -0
- package/build/types/utils/schema/generateScopeFromSchema.d.ts +13 -0
- package/build/types/utils/schema/generateScopeFromSchema.d.ts.map +1 -0
- package/build/types/utils/schema/generateTypesFromSchema.d.ts.map +1 -1
- package/build/types/utils/schema/generateVersionedTypesFromSchema.d.ts +18 -0
- package/build/types/utils/schema/generateVersionedTypesFromSchema.d.ts.map +1 -0
- package/build/types/utils/schema/generateVersionedZodFromSchema.d.ts +16 -0
- package/build/types/utils/schema/generateVersionedZodFromSchema.d.ts.map +1 -0
- package/build/types/utils/schema/generateVersionsFromSchema.d.ts +13 -0
- package/build/types/utils/schema/generateVersionsFromSchema.d.ts.map +1 -0
- package/build/types/utils/schema/resolveSchemaChain.d.ts +18 -0
- package/build/types/utils/schema/resolveSchemaChain.d.ts.map +1 -0
- package/build/types/utils/schema/runtimeSchema.d.ts +59 -0
- package/build/types/utils/schema/runtimeSchema.d.ts.map +1 -0
- package/build/types/utils/steps/convertStepsToIr.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import path from "path";
|
|
18
|
+
import { describe, expect, it } from "vitest";
|
|
19
|
+
import { generateVersionedTypesFromSchema } from "../generateVersionedTypesFromSchema.js";
|
|
20
|
+
import { refFieldsSchema, singleVersionSchema, threeVersionChainSchema, twoVersionAdditiveSchema, twoVersionFieldRemovalSchema, unionTypesSchema } from "./fixtures.js";
|
|
21
|
+
import { formatVersionedTypesSnapshot } from "./snapshotUtils.js";
|
|
22
|
+
describe("generateVersionedTypesFromSchema", () => {
|
|
23
|
+
const snapshotDir = path.join(__dirname, "__snapshots__", "generateVersionedTypesFromSchema");
|
|
24
|
+
it("single-version schema", async () => {
|
|
25
|
+
const result = generateVersionedTypesFromSchema(singleVersionSchema);
|
|
26
|
+
await expect(await formatVersionedTypesSnapshot(result)).toMatchFileSnapshot(path.join(snapshotDir, "single-version.snap"));
|
|
27
|
+
});
|
|
28
|
+
it("two-version additive change", async () => {
|
|
29
|
+
const result = generateVersionedTypesFromSchema(twoVersionAdditiveSchema, 1);
|
|
30
|
+
await expect(await formatVersionedTypesSnapshot(result)).toMatchFileSnapshot(path.join(snapshotDir, "two-version-additive.snap"));
|
|
31
|
+
});
|
|
32
|
+
it("two-version field removal", async () => {
|
|
33
|
+
const result = generateVersionedTypesFromSchema(twoVersionFieldRemovalSchema, 1);
|
|
34
|
+
await expect(await formatVersionedTypesSnapshot(result)).toMatchFileSnapshot(path.join(snapshotDir, "two-version-field-removal.snap"));
|
|
35
|
+
});
|
|
36
|
+
it("three-version chain", async () => {
|
|
37
|
+
const result = generateVersionedTypesFromSchema(threeVersionChainSchema, 1);
|
|
38
|
+
await expect(await formatVersionedTypesSnapshot(result)).toMatchFileSnapshot(path.join(snapshotDir, "three-version-chain.snap"));
|
|
39
|
+
});
|
|
40
|
+
it("schema with ref fields", async () => {
|
|
41
|
+
const result = generateVersionedTypesFromSchema(refFieldsSchema);
|
|
42
|
+
await expect(await formatVersionedTypesSnapshot(result)).toMatchFileSnapshot(path.join(snapshotDir, "ref-fields.snap"));
|
|
43
|
+
});
|
|
44
|
+
it("schema with union types", async () => {
|
|
45
|
+
const result = generateVersionedTypesFromSchema(unionTypesSchema);
|
|
46
|
+
await expect(await formatVersionedTypesSnapshot(result)).toMatchFileSnapshot(path.join(snapshotDir, "union-types.snap"));
|
|
47
|
+
});
|
|
48
|
+
it("respects minSupportedVersion default (latest only)", () => {
|
|
49
|
+
const result = generateVersionedTypesFromSchema(twoVersionAdditiveSchema);
|
|
50
|
+
expect(result.readTypes.size).toBe(1);
|
|
51
|
+
expect(result.readTypes.has(2)).toBe(true);
|
|
52
|
+
expect(result.readTypes.has(1)).toBe(false);
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
//# sourceMappingURL=generateVersionedTypesFromSchema.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generateVersionedTypesFromSchema.test.js","names":["path","describe","expect","it","generateVersionedTypesFromSchema","refFieldsSchema","singleVersionSchema","threeVersionChainSchema","twoVersionAdditiveSchema","twoVersionFieldRemovalSchema","unionTypesSchema","formatVersionedTypesSnapshot","snapshotDir","join","__dirname","result","toMatchFileSnapshot","readTypes","size","toBe","has"],"sources":["generateVersionedTypesFromSchema.test.ts"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport path from \"path\";\nimport { describe, expect, it } from \"vitest\";\nimport { generateVersionedTypesFromSchema } from \"../generateVersionedTypesFromSchema.js\";\nimport {\n refFieldsSchema,\n singleVersionSchema,\n threeVersionChainSchema,\n twoVersionAdditiveSchema,\n twoVersionFieldRemovalSchema,\n unionTypesSchema,\n} from \"./fixtures.js\";\nimport { formatVersionedTypesSnapshot } from \"./snapshotUtils.js\";\n\ndescribe(\"generateVersionedTypesFromSchema\", () => {\n const snapshotDir = path.join(__dirname, \"__snapshots__\", \"generateVersionedTypesFromSchema\");\n\n it(\"single-version schema\", async () => {\n const result = generateVersionedTypesFromSchema(singleVersionSchema);\n await expect(await formatVersionedTypesSnapshot(result)).toMatchFileSnapshot(\n path.join(snapshotDir, \"single-version.snap\"),\n );\n });\n\n it(\"two-version additive change\", async () => {\n const result = generateVersionedTypesFromSchema(twoVersionAdditiveSchema, 1);\n await expect(await formatVersionedTypesSnapshot(result)).toMatchFileSnapshot(\n path.join(snapshotDir, \"two-version-additive.snap\"),\n );\n });\n\n it(\"two-version field removal\", async () => {\n const result = generateVersionedTypesFromSchema(twoVersionFieldRemovalSchema, 1);\n await expect(await formatVersionedTypesSnapshot(result)).toMatchFileSnapshot(\n path.join(snapshotDir, \"two-version-field-removal.snap\"),\n );\n });\n\n it(\"three-version chain\", async () => {\n const result = generateVersionedTypesFromSchema(threeVersionChainSchema, 1);\n await expect(await formatVersionedTypesSnapshot(result)).toMatchFileSnapshot(\n path.join(snapshotDir, \"three-version-chain.snap\"),\n );\n });\n\n it(\"schema with ref fields\", async () => {\n const result = generateVersionedTypesFromSchema(refFieldsSchema);\n await expect(await formatVersionedTypesSnapshot(result)).toMatchFileSnapshot(\n path.join(snapshotDir, \"ref-fields.snap\"),\n );\n });\n\n it(\"schema with union types\", async () => {\n const result = generateVersionedTypesFromSchema(unionTypesSchema);\n await expect(await formatVersionedTypesSnapshot(result)).toMatchFileSnapshot(\n path.join(snapshotDir, \"union-types.snap\"),\n );\n });\n\n it(\"respects minSupportedVersion default (latest only)\", () => {\n const result = generateVersionedTypesFromSchema(twoVersionAdditiveSchema);\n expect(result.readTypes.size).toBe(1);\n expect(result.readTypes.has(2)).toBe(true);\n expect(result.readTypes.has(1)).toBe(false);\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,IAAI,MAAM,MAAM;AACvB,SAASC,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AAC7C,SAASC,gCAAgC,QAAQ,wCAAwC;AACzF,SACEC,eAA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AC,CAACC,mBAAmB,CAC1EhB,IAAI,CAACa,IAAI,CAACD,WAAW,EAAE,0BAA0B,CACnD,CAAC;EACH,CAAC,CAAC;EAEFT,EAAE,CAAC,wBAAwB,EAAE,YAAY;IACvC,MAAMY,MAAM,GAAGX,gCAAgC,CAACC,eAAe,CAAC;IAChE,MAAMH,MAAM,CAAC,MAAMS,4BAA4B,CAACI,MAAM,CAAC,CAAC,CAACC,mBAAmB,CAC1EhB,IAAI,CAACa,IAAI,CAACD,WAAW,EAAE,iBAAiB,CAC1C,CAAC;EACH,CAAC,CAAC;EAEFT,EAAE,CAAC,yBAAyB,EAAE,YAAY;IACxC,MAAMY,MAAM,GAAGX,gCAAgC,CAACM,gBAAgB,CAAC;IACjE,MAAMR,MAAM,CAAC,MAAMS,4BAA4B,CAACI,MAAM,CAAC,CAAC,CAACC,mBAAmB,CAC1EhB,IAAI,CAACa,IAAI,CAACD,WAAW,EAAE,kBAAkB,CAC3C,CAAC;EACH,CAAC,CAAC;EAEFT,EAAE,CAAC,oDAAoD,EAAE,MAAM;IAC7D,MAAMY,MAAM,GAAGX,gCAAgC,CAACI,wBAAwB,CAAC;IACzEN,MAAM,CAACa,MAAM,CAACE,SAAS,CAACC,IAAI,CAAC,CAACC,IAAI,CAAC,CAAC,CAAC;IACrCjB,MAAM,CAACa,MAAM,CAACE,SAAS,CAACG,GAAG,CAAC,CAAC,CAAC,CAAC,CAACD,IAAI,CAAC,IAAI,CAAC;IAC1CjB,MAAM,CAACa,MAAM,CAACE,SAAS,CAACG,GAAG,CAAC,CAAC,CAAC,CAAC,CAACD,IAAI,CAAC,KAAK,CAAC;EAC7C,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import path from "path";
|
|
18
|
+
import { describe, expect, it } from "vitest";
|
|
19
|
+
import { generateVersionedZodFromSchema } from "../generateVersionedZodFromSchema.js";
|
|
20
|
+
import { nestedOptionalsSchema, refFieldsSchema, singleVersionSchema, twoVersionAdditiveSchema, twoVersionFieldRemovalSchema, unionTypesSchema } from "./fixtures.js";
|
|
21
|
+
import { formatVersionedZodSnapshot } from "./snapshotUtils.js";
|
|
22
|
+
describe("generateVersionedZodFromSchema", () => {
|
|
23
|
+
const snapshotDir = path.join(__dirname, "__snapshots__", "generateVersionedZodFromSchema");
|
|
24
|
+
it("single-version schema", async () => {
|
|
25
|
+
const result = generateVersionedZodFromSchema(singleVersionSchema);
|
|
26
|
+
await expect(await formatVersionedZodSnapshot(result)).toMatchFileSnapshot(path.join(snapshotDir, "single-version.snap"));
|
|
27
|
+
});
|
|
28
|
+
it("two-version additive change", async () => {
|
|
29
|
+
const result = generateVersionedZodFromSchema(twoVersionAdditiveSchema, 1);
|
|
30
|
+
await expect(await formatVersionedZodSnapshot(result)).toMatchFileSnapshot(path.join(snapshotDir, "two-version-additive.snap"));
|
|
31
|
+
});
|
|
32
|
+
it("two-version field removal", async () => {
|
|
33
|
+
const result = generateVersionedZodFromSchema(twoVersionFieldRemovalSchema, 1);
|
|
34
|
+
await expect(await formatVersionedZodSnapshot(result)).toMatchFileSnapshot(path.join(snapshotDir, "two-version-field-removal.snap"));
|
|
35
|
+
});
|
|
36
|
+
it("schema with union types", async () => {
|
|
37
|
+
const result = generateVersionedZodFromSchema(unionTypesSchema);
|
|
38
|
+
await expect(await formatVersionedZodSnapshot(result)).toMatchFileSnapshot(path.join(snapshotDir, "union-types.snap"));
|
|
39
|
+
});
|
|
40
|
+
it("schema with ref fields", async () => {
|
|
41
|
+
const result = generateVersionedZodFromSchema(refFieldsSchema);
|
|
42
|
+
await expect(await formatVersionedZodSnapshot(result)).toMatchFileSnapshot(path.join(snapshotDir, "ref-fields.snap"));
|
|
43
|
+
});
|
|
44
|
+
it("nested optionals inside arrays", async () => {
|
|
45
|
+
const result = generateVersionedZodFromSchema(nestedOptionalsSchema);
|
|
46
|
+
await expect(await formatVersionedZodSnapshot(result)).toMatchFileSnapshot(path.join(snapshotDir, "nested-optionals.snap"));
|
|
47
|
+
});
|
|
48
|
+
it("respects minSupportedVersion default (latest only)", () => {
|
|
49
|
+
const result = generateVersionedZodFromSchema(twoVersionAdditiveSchema);
|
|
50
|
+
expect(result.zodSchemas.size).toBe(1);
|
|
51
|
+
expect(result.zodSchemas.has(2)).toBe(true);
|
|
52
|
+
expect(result.zodSchemas.has(1)).toBe(false);
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
//# sourceMappingURL=generateVersionedZodFromSchema.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generateVersionedZodFromSchema.test.js","names":["path","describe","expect","it","generateVersionedZodFromSchema","nestedOptionalsSchema","refFieldsSchema","singleVersionSchema","twoVersionAdditiveSchema","twoVersionFieldRemovalSchema","unionTypesSchema","formatVersionedZodSnapshot","snapshotDir","join","__dirname","result","toMatchFileSnapshot","zodSchemas","size","toBe","has"],"sources":["generateVersionedZodFromSchema.test.ts"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport path from \"path\";\nimport { describe, expect, it } from \"vitest\";\nimport { generateVersionedZodFromSchema } from \"../generateVersionedZodFromSchema.js\";\nimport {\n nestedOptionalsSchema,\n refFieldsSchema,\n singleVersionSchema,\n twoVersionAdditiveSchema,\n twoVersionFieldRemovalSchema,\n unionTypesSchema,\n} from \"./fixtures.js\";\nimport { formatVersionedZodSnapshot } from \"./snapshotUtils.js\";\n\ndescribe(\"generateVersionedZodFromSchema\", () => {\n const snapshotDir = path.join(__dirname, \"__snapshots__\", \"generateVersionedZodFromSchema\");\n\n it(\"single-version schema\", async () => {\n const result = generateVersionedZodFromSchema(singleVersionSchema);\n await expect(await formatVersionedZodSnapshot(result)).toMatchFileSnapshot(\n path.join(snapshotDir, \"single-version.snap\"),\n );\n });\n\n it(\"two-version additive change\", async () => {\n const result = generateVersionedZodFromSchema(twoVersionAdditiveSchema, 1);\n await expect(await formatVersionedZodSnapshot(result)).toMatchFileSnapshot(\n path.join(snapshotDir, \"two-version-additive.snap\"),\n );\n });\n\n it(\"two-version field removal\", async () => {\n const result = generateVersionedZodFromSchema(twoVersionFieldRemovalSchema, 1);\n await expect(await formatVersionedZodSnapshot(result)).toMatchFileSnapshot(\n path.join(snapshotDir, \"two-version-field-removal.snap\"),\n );\n });\n\n it(\"schema with union types\", async () => {\n const result = generateVersionedZodFromSchema(unionTypesSchema);\n await expect(await formatVersionedZodSnapshot(result)).toMatchFileSnapshot(\n path.join(snapshotDir, \"union-types.snap\"),\n );\n });\n\n it(\"schema with ref fields\", async () => {\n const result = generateVersionedZodFromSchema(refFieldsSchema);\n await expect(await formatVersionedZodSnapshot(result)).toMatchFileSnapshot(\n path.join(snapshotDir, \"ref-fields.snap\"),\n );\n });\n\n it(\"nested optionals inside arrays\", async () => {\n const result = generateVersionedZodFromSchema(nestedOptionalsSchema);\n await expect(await formatVersionedZodSnapshot(result)).toMatchFileSnapshot(\n path.join(snapshotDir, \"nested-optionals.snap\"),\n );\n });\n\n it(\"respects minSupportedVersion default (latest only)\", () => {\n const result = generateVersionedZodFromSchema(twoVersionAdditiveSchema);\n expect(result.zodSchemas.size).toBe(1);\n expect(result.zodSchemas.has(2)).toBe(true);\n expect(result.zodSchemas.has(1)).toBe(false);\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,IAAI,MAAM,MAAM;AACvB,SAASC,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AAC7C,SAASC,8BAA8B,QAAQ,sCAAsC;AACrF,SACEC,qBAAqB,EACrBC,eAAe,EACfC,mBAAmB,EACnBC,wBAAwB,EACxBC,4BAA4B,EAC5BC,gBAAgB,QACX,eAAe;AACtB,SAASC,0BAA0B,QAAQ,oBAAoB;AAE/DV,QAAQ,CAAC,gCAAgC,EAAE,MAAM;EAC/C,MAAMW,WAAW,GAAGZ,IAAI,CAACa,IAAI,CAACC,SAAS,EAAE,eAAe,EAAE,gCAAgC,CAAC;EAE3FX,EAAE,CAAC,uBAAuB,EAAE,YAAY;IACtC,MAAMY,MAAM,GAAGX,8BAA8B,CAACG,mBAAmB,CAAC;IAClE,MAAML,MAAM,CAAC,MAAMS,0BAA0B,CAACI,MAAM,CAAC,CAAC,CAACC,mBAAmB,CACxEhB,IAAI,CAACa,IAAI,CAACD,WAAW,EAAE,qBAAqB,CAC9C,CAAC;EACH,CAAC,CAAC;EAEFT,EAAE,CAAC,6BAA6B,EAAE,YAAY;IAC5C,MAAMY,MAAM,GAAGX,8BAA8B,CAACI,wBAAwB,EAAE,CAAC,CAAC;IAC1E,MAAMN,MAAM,CAAC,MAAMS,0BAA0B,CAACI,MAAM,CAAC,CAAC,CAACC,mBAAmB,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AM,CAACa,MAAM,CAACE,UAAU,CAACC,IAAI,CAAC,CAACC,IAAI,CAAC,CAAC,CAAC;IACtCjB,MAAM,CAACa,MAAM,CAACE,UAAU,CAACG,GAAG,CAAC,CAAC,CAAC,CAAC,CAACD,IAAI,CAAC,IAAI,CAAC;IAC3CjB,MAAM,CAACa,MAAM,CAACE,UAAU,CAACG,GAAG,CAAC,CAAC,CAAC,CAAC,CAACD,IAAI,CAAC,KAAK,CAAC;EAC9C,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import path from "path";
|
|
18
|
+
import { describe, expect, it } from "vitest";
|
|
19
|
+
import { generateVersionsFromSchema } from "../generateVersionsFromSchema.js";
|
|
20
|
+
import { singleVersionSchema, threeVersionChainSchema, twoVersionAdditiveSchema } from "./fixtures.js";
|
|
21
|
+
import { formatSingleSnapshot } from "./snapshotUtils.js";
|
|
22
|
+
describe("generateVersionsFromSchema", () => {
|
|
23
|
+
const snapshotDir = path.join(__dirname, "__snapshots__", "generateVersionsFromSchema");
|
|
24
|
+
it("single-version schema", async () => {
|
|
25
|
+
const result = generateVersionsFromSchema(singleVersionSchema);
|
|
26
|
+
await expect(await formatSingleSnapshot("versions.ts", result)).toMatchFileSnapshot(path.join(snapshotDir, "single-version.ts"));
|
|
27
|
+
});
|
|
28
|
+
it("two-version with minSupportedVersion", async () => {
|
|
29
|
+
const result = generateVersionsFromSchema(twoVersionAdditiveSchema, 1);
|
|
30
|
+
await expect(await formatSingleSnapshot("versions.ts", result)).toMatchFileSnapshot(path.join(snapshotDir, "two-version.ts"));
|
|
31
|
+
});
|
|
32
|
+
it("three-version chain", async () => {
|
|
33
|
+
const result = generateVersionsFromSchema(threeVersionChainSchema, 1);
|
|
34
|
+
await expect(await formatSingleSnapshot("versions.ts", result)).toMatchFileSnapshot(path.join(snapshotDir, "three-version-chain.ts"));
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
//# sourceMappingURL=generateVersionsFromSchema.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generateVersionsFromSchema.test.js","names":["path","describe","expect","it","generateVersionsFromSchema","singleVersionSchema","threeVersionChainSchema","twoVersionAdditiveSchema","formatSingleSnapshot","snapshotDir","join","__dirname","result","toMatchFileSnapshot"],"sources":["generateVersionsFromSchema.test.ts"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport path from \"path\";\nimport { describe, expect, it } from \"vitest\";\nimport { generateVersionsFromSchema } from \"../generateVersionsFromSchema.js\";\nimport {\n singleVersionSchema,\n threeVersionChainSchema,\n twoVersionAdditiveSchema,\n} from \"./fixtures.js\";\nimport { formatSingleSnapshot } from \"./snapshotUtils.js\";\n\ndescribe(\"generateVersionsFromSchema\", () => {\n const snapshotDir = path.join(__dirname, \"__snapshots__\", \"generateVersionsFromSchema\");\n\n it(\"single-version schema\", async () => {\n const result = generateVersionsFromSchema(singleVersionSchema);\n await expect(await formatSingleSnapshot(\"versions.ts\", result)).toMatchFileSnapshot(\n path.join(snapshotDir, \"single-version.ts\"),\n );\n });\n\n it(\"two-version with minSupportedVersion\", async () => {\n const result = generateVersionsFromSchema(twoVersionAdditiveSchema, 1);\n await expect(await formatSingleSnapshot(\"versions.ts\", result)).toMatchFileSnapshot(\n path.join(snapshotDir, \"two-version.ts\"),\n );\n });\n\n it(\"three-version chain\", async () => {\n const result = generateVersionsFromSchema(threeVersionChainSchema, 1);\n await expect(await formatSingleSnapshot(\"versions.ts\", result)).toMatchFileSnapshot(\n path.join(snapshotDir, \"three-version-chain.ts\"),\n );\n });\n});\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,IAAI,MAAM,MAAM;AACvB,SAASC,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,QAAQ;AAC7C,SAASC,0BAA0B,QAAQ,kCAAkC;AAC7E,SACEC,mBAAmB,EACnBC,uBAAuB,EACvBC,wBAAwB,QACnB,eAAe;AACtB,SAASC,oBAAoB,QAAQ,oBAAoB;AAEzDP,QAAQ,CAAC,4BAA4B,EAAE,MAAM;EAC3C,MAAMQ,WAAW,GAAGT,IAAI,CAACU,IAAI,CAACC,SAAS,EAAE,eAAe,EAAE,4BAA4B,CAAC;EAEvFR,EAAE,CAAC,uBAAuB,EAAE,YAAY;IACtC,MAAMS,MAAM,GAAGR,0BAA0B,CAACC,mBAAmB,CAAC;IAC9D,MAAMH,MAAM,CAAC,MAAMM,oBAAoB,CAAC,aAAa,EAAEI,MAAM,CAAC,CAAC,CAACC,mBAAmB,CACjFb,IAAI,CAACU,IAAI,CAACD,WAAW,EAAE,mBAAmB,CAC5C,CAAC;EACH,CAAC,CAAC;EAEFN,EAAE,CAAC,sCAAsC,EAAE,YAAY;IACrD,MAAMS,MAAM,GAAGR,0BAA0B,CAACG,wBAAwB,EAAE,CAAC,CAAC;IACtE,MAAML,MAAM,CAAC,MAAMM,oBAAoB,CAAC,aAAa,EAAEI,MAAM,CAAC,CAAC,CAACC,mBAAmB,CACjFb,IAAI,CAACU,IAAI,CAACD,WAAW,EAAE,gBAAgB,CACzC,CAAC;EACH,CAAC,CAAC;EAEFN,EAAE,CAAC,qBAAqB,EAAE,YAAY;IACpC,MAAMS,MAAM,GAAGR,0BAA0B,CAACE,uBAAuB,EAAE,CAAC,CAAC;IACrE,MAAMJ,MAAM,CAAC,MAAMM,oBAAoB,CAAC,aAAa,EAAEI,MAAM,CAAC,CAAC,CAACC,mBAAmB,CACjFb,IAAI,CAACU,IAAI,CAACD,WAAW,EAAE,wBAAwB,CACjD,CAAC;EACH,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { format } from "prettier";
|
|
18
|
+
const prettierOpts = {
|
|
19
|
+
parser: "typescript",
|
|
20
|
+
singleQuote: true,
|
|
21
|
+
trailingComma: "es5"
|
|
22
|
+
};
|
|
23
|
+
async function fmt(code) {
|
|
24
|
+
return format(code, prettierOpts);
|
|
25
|
+
}
|
|
26
|
+
function section(filename, content) {
|
|
27
|
+
const bar = "=".repeat(60);
|
|
28
|
+
return `// ${bar}\n// ${filename}\n// ${bar}\n\n${content}`;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Combine a VersionedTypesOutput into a single snapshot string.
|
|
33
|
+
*
|
|
34
|
+
* Layout:
|
|
35
|
+
* // === types_v1.ts ===
|
|
36
|
+
* ...formatted code...
|
|
37
|
+
* // === writeTypes_v1.ts ===
|
|
38
|
+
* ...
|
|
39
|
+
* // === types.ts ===
|
|
40
|
+
* ...
|
|
41
|
+
*/
|
|
42
|
+
export async function formatVersionedTypesSnapshot(result) {
|
|
43
|
+
const sections = [];
|
|
44
|
+
const sortedVersions = [...result.readTypes.keys()].sort((a, b) => a - b);
|
|
45
|
+
for (const version of sortedVersions) {
|
|
46
|
+
sections.push(section(`types_v${version}.ts`, await fmt(result.readTypes.get(version))));
|
|
47
|
+
}
|
|
48
|
+
for (const version of sortedVersions) {
|
|
49
|
+
sections.push(section(`writeTypes_v${version}.ts`, await fmt(result.writeTypes.get(version))));
|
|
50
|
+
}
|
|
51
|
+
sections.push(section("types.ts", await fmt(result.typesReExport)));
|
|
52
|
+
return sections.join("\n");
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Format a ModelMetadataOutput into a snapshot string.
|
|
57
|
+
*/
|
|
58
|
+
export async function formatModelMetadataSnapshot(result) {
|
|
59
|
+
return section("models.ts", await fmt(result.modelsFile));
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Format a single generated string into a snapshot.
|
|
64
|
+
*/
|
|
65
|
+
export async function formatSingleSnapshot(filename, code) {
|
|
66
|
+
return section(filename, await fmt(code));
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Combine a VersionedZodOutput into a single snapshot string.
|
|
71
|
+
*
|
|
72
|
+
* Layout:
|
|
73
|
+
* // === schema_v1.ts ===
|
|
74
|
+
* ...formatted code...
|
|
75
|
+
* // === schema.ts ===
|
|
76
|
+
* ...
|
|
77
|
+
*/
|
|
78
|
+
export async function formatVersionedZodSnapshot(result) {
|
|
79
|
+
const sections = [];
|
|
80
|
+
const sortedVersions = [...result.zodSchemas.keys()].sort((a, b) => a - b);
|
|
81
|
+
for (const version of sortedVersions) {
|
|
82
|
+
sections.push(section(`schema_v${version}.ts`, await fmt(result.zodSchemas.get(version))));
|
|
83
|
+
}
|
|
84
|
+
sections.push(section("schema.ts", await fmt(result.schemaReExport)));
|
|
85
|
+
return sections.join("\n");
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Combine an InternalTypesOutput into a single snapshot string.
|
|
90
|
+
*
|
|
91
|
+
* Layout:
|
|
92
|
+
* // === _internal/types.ts ===
|
|
93
|
+
* ...formatted code...
|
|
94
|
+
* // === _internal/upgrades.ts ===
|
|
95
|
+
* ...
|
|
96
|
+
* // === _internal/schema.ts ===
|
|
97
|
+
* ...
|
|
98
|
+
*/
|
|
99
|
+
export async function formatInternalTypesSnapshot(result) {
|
|
100
|
+
const sections = [];
|
|
101
|
+
sections.push(section("_internal/types.ts", await fmt(result.internalTypes)));
|
|
102
|
+
sections.push(section("_internal/upgrades.ts", await fmt(result.upgrades)));
|
|
103
|
+
sections.push(section("_internal/schema.ts", await fmt(result.internalSchema)));
|
|
104
|
+
return sections.join("\n");
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=snapshotUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snapshotUtils.js","names":["format","prettierOpts","parser","singleQuote","trailingComma","fmt","code","section","filename","content","bar","repeat","formatVersionedTypesSnapshot","result","sections","sortedVersions","readTypes","keys","sort","a","b","version","push","get","writeTypes","typesReExport","join","formatModelMetadataSnapshot","modelsFile","formatSingleSnapshot","formatVersionedZodSnapshot","zodSchemas","schemaReExport","formatInternalTypesSnapshot","internalTypes","upgrades","internalSchema"],"sources":["snapshotUtils.ts"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { format } from \"prettier\";\nimport type { InternalTypesOutput } from \"../generateInternalFromSchema.js\";\nimport type { ModelMetadataOutput } from \"../generateModelMetadataFromSchema.js\";\nimport type { VersionedTypesOutput } from \"../generateVersionedTypesFromSchema.js\";\nimport type { VersionedZodOutput } from \"../generateVersionedZodFromSchema.js\";\n\nconst prettierOpts = {\n parser: \"typescript\" as const,\n singleQuote: true,\n trailingComma: \"es5\" as const,\n};\n\nasync function fmt(code: string): Promise<string> {\n return format(code, prettierOpts);\n}\n\nfunction section(filename: string, content: string): string {\n const bar = \"=\".repeat(60);\n return `// ${bar}\\n// ${filename}\\n// ${bar}\\n\\n${content}`;\n}\n\n/**\n * Combine a VersionedTypesOutput into a single snapshot string.\n *\n * Layout:\n * // === types_v1.ts ===\n * ...formatted code...\n * // === writeTypes_v1.ts ===\n * ...\n * // === types.ts ===\n * ...\n */\nexport async function formatVersionedTypesSnapshot(\n result: VersionedTypesOutput,\n): Promise<string> {\n const sections: string[] = [];\n\n const sortedVersions = [...result.readTypes.keys()].sort((a, b) => a - b);\n\n for (const version of sortedVersions) {\n sections.push(section(`types_v${version}.ts`, await fmt(result.readTypes.get(version)!)));\n }\n for (const version of sortedVersions) {\n sections.push(section(`writeTypes_v${version}.ts`, await fmt(result.writeTypes.get(version)!)));\n }\n sections.push(section(\"types.ts\", await fmt(result.typesReExport)));\n\n return sections.join(\"\\n\");\n}\n\n/**\n * Format a ModelMetadataOutput into a snapshot string.\n */\nexport async function formatModelMetadataSnapshot(\n result: ModelMetadataOutput,\n): Promise<string> {\n return section(\"models.ts\", await fmt(result.modelsFile));\n}\n\n/**\n * Format a single generated string into a snapshot.\n */\nexport async function formatSingleSnapshot(\n filename: string,\n code: string,\n): Promise<string> {\n return section(filename, await fmt(code));\n}\n\n/**\n * Combine a VersionedZodOutput into a single snapshot string.\n *\n * Layout:\n * // === schema_v1.ts ===\n * ...formatted code...\n * // === schema.ts ===\n * ...\n */\nexport async function formatVersionedZodSnapshot(\n result: VersionedZodOutput,\n): Promise<string> {\n const sections: string[] = [];\n\n const sortedVersions = [...result.zodSchemas.keys()].sort((a, b) => a - b);\n\n for (const version of sortedVersions) {\n sections.push(section(`schema_v${version}.ts`, await fmt(result.zodSchemas.get(version)!)));\n }\n sections.push(section(\"schema.ts\", await fmt(result.schemaReExport)));\n\n return sections.join(\"\\n\");\n}\n\n/**\n * Combine an InternalTypesOutput into a single snapshot string.\n *\n * Layout:\n * // === _internal/types.ts ===\n * ...formatted code...\n * // === _internal/upgrades.ts ===\n * ...\n * // === _internal/schema.ts ===\n * ...\n */\nexport async function formatInternalTypesSnapshot(\n result: InternalTypesOutput,\n): Promise<string> {\n const sections: string[] = [];\n\n sections.push(section(\"_internal/types.ts\", await fmt(result.internalTypes)));\n sections.push(section(\"_internal/upgrades.ts\", await fmt(result.upgrades)));\n sections.push(section(\"_internal/schema.ts\", await fmt(result.internalSchema)));\n\n return sections.join(\"\\n\");\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,MAAM,QAAQ,UAAU;AAMjC,MAAMC,YAAY,GAAG;EACnBC,MAAM,EAAE,YAAqB;EAC7BC,WAAW,EAAE,IAAI;EACjBC,aAAa,EAAE;AACjB,CAAC;AAED,eAAe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O,CAAC,uBAAuB,EAAE,MAAMF,GAAG,CAACQ,MAAM,CAACsB,QAAQ,CAAC,CAAC,CAAC;EAC3ErB,QAAQ,CAACQ,IAAI,CAACf,OAAO,CAAC,qBAAqB,EAAE,MAAMF,GAAG,CAACQ,MAAM,CAACuB,cAAc,CAAC,CAAC,CAAC;EAE/E,OAAOtB,QAAQ,CAACY,IAAI,CAAC,IAAI,CAAC;AAC5B","ignoreList":[]}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { formatVariantName } from "../formatVariantName.js";
|
|
18
|
+
import { GENERATED_FILE_HEADER } from "../generatedFileHeader.js";
|
|
19
|
+
import { resolveSchemaChain } from "./resolveSchemaChain.js";
|
|
20
|
+
import { isRecordSchema, isUnionSchema, MODELS_PATH, TYPES_REEXPORT_PATH, typesFilePath, VERSIONED_DOC_REF_PATH, versionedTypeName, VERSIONS_PATH } from "./runtimeSchema.js";
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Generate the index.ts barrel export from a versioned schema.
|
|
24
|
+
*
|
|
25
|
+
* Exports:
|
|
26
|
+
* - `models.js` (star export — model constants and DocumentModel)
|
|
27
|
+
* - `types.js` (star export — latest-version type aliases)
|
|
28
|
+
* - `versions.js` (star export — SupportedVersions, LatestVersion, MinSupportedVersion)
|
|
29
|
+
* - `versionedDocRef.js` (star export — VersionedDocRef types and factory)
|
|
30
|
+
* - Per supported version: explicit named type exports from `types_vN.js`
|
|
31
|
+
* (not star exports, to avoid polluting autocomplete for read-only consumers)
|
|
32
|
+
*/
|
|
33
|
+
export function generateIndexFromSchema(schema, minSupportedVersion) {
|
|
34
|
+
const {
|
|
35
|
+
chain,
|
|
36
|
+
minVersion
|
|
37
|
+
} = resolveSchemaChain(schema, minSupportedVersion);
|
|
38
|
+
let output = GENERATED_FILE_HEADER;
|
|
39
|
+
|
|
40
|
+
// Star exports for core modules
|
|
41
|
+
output += `export * from "${MODELS_PATH}";\n`;
|
|
42
|
+
output += `export * from "${TYPES_REEXPORT_PATH}";\n`;
|
|
43
|
+
output += `export * from "${VERSIONS_PATH}";\n`;
|
|
44
|
+
output += `export * from "${VERSIONED_DOC_REF_PATH}";\n`;
|
|
45
|
+
|
|
46
|
+
// Per-version explicit named type exports
|
|
47
|
+
for (const {
|
|
48
|
+
version,
|
|
49
|
+
schema: versionSchema
|
|
50
|
+
} of chain) {
|
|
51
|
+
if (version < minVersion) continue;
|
|
52
|
+
const typeNames = [];
|
|
53
|
+
for (const [exportName, item] of Object.entries(versionSchema)) {
|
|
54
|
+
if (isRecordSchema(item)) {
|
|
55
|
+
typeNames.push(versionedTypeName(exportName, version));
|
|
56
|
+
} else if (isUnionSchema(item)) {
|
|
57
|
+
typeNames.push(versionedTypeName(exportName, version));
|
|
58
|
+
|
|
59
|
+
// Union variant types
|
|
60
|
+
for (const variantName of Object.keys(item.variants)) {
|
|
61
|
+
const formattedVariant = formatVariantName(variantName);
|
|
62
|
+
typeNames.push(`${versionedTypeName(exportName, version)}${formattedVariant}`);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
if (typeNames.length > 0) {
|
|
67
|
+
output += `export type { ${typeNames.sort().join(", ")} } from "${typesFilePath(version)}";\n`;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return output;
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=generateIndexFromSchema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generateIndexFromSchema.js","names":["formatVariantName","GENERATED_FILE_HEADER","resolveSchemaChain","isRecordSchema","isUnionSchema","MODELS_PATH","TYPES_REEXPORT_PATH","typesFilePath","VERSIONED_DOC_REF_PATH","versionedTypeName","VERSIONS_PATH","generateIndexFromSchema","schema","minSupportedVersion","chain","minVersion","output","version","versionSchema","typeNames","exportName","item","Object","entries","push","variantName","keys","variants","formattedVariant","length","sort","join"],"sources":["generateIndexFromSchema.ts"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { SchemaDefinition } from \"@palantir/pack.schema\";\nimport { formatVariantName } from \"../formatVariantName.js\";\nimport { GENERATED_FILE_HEADER } from \"../generatedFileHeader.js\";\nimport { resolveSchemaChain } from \"./resolveSchemaChain.js\";\nimport {\n isRecordSchema,\n isUnionSchema,\n MODELS_PATH,\n TYPES_REEXPORT_PATH,\n typesFilePath,\n VERSIONED_DOC_REF_PATH,\n versionedTypeName,\n VERSIONS_PATH,\n} from \"./runtimeSchema.js\";\n\n/**\n * Generate the index.ts barrel export from a versioned schema.\n *\n * Exports:\n * - `models.js` (star export — model constants and DocumentModel)\n * - `types.js` (star export — latest-version type aliases)\n * - `versions.js` (star export — SupportedVersions, LatestVersion, MinSupportedVersion)\n * - `versionedDocRef.js` (star export — VersionedDocRef types and factory)\n * - Per supported version: explicit named type exports from `types_vN.js`\n * (not star exports, to avoid polluting autocomplete for read-only consumers)\n */\nexport function generateIndexFromSchema(\n schema: SchemaDefinition,\n minSupportedVersion?: number,\n): string {\n const { chain, minVersion } = resolveSchemaChain(schema, minSupportedVersion);\n\n let output = GENERATED_FILE_HEADER;\n\n // Star exports for core modules\n output += `export * from \"${MODELS_PATH}\";\\n`;\n output += `export * from \"${TYPES_REEXPORT_PATH}\";\\n`;\n output += `export * from \"${VERSIONS_PATH}\";\\n`;\n output += `export * from \"${VERSIONED_DOC_REF_PATH}\";\\n`;\n\n // Per-version explicit named type exports\n for (const { version, schema: versionSchema } of chain) {\n if (version < minVersion) continue;\n\n const typeNames: string[] = [];\n\n for (const [exportName, item] of Object.entries(versionSchema)) {\n if (isRecordSchema(item)) {\n typeNames.push(versionedTypeName(exportName, version));\n } else if (isUnionSchema(item)) {\n typeNames.push(versionedTypeName(exportName, version));\n\n // Union variant types\n for (const variantName of Object.keys(item.variants)) {\n const formattedVariant = formatVariantName(variantName);\n typeNames.push(`${versionedTypeName(exportName, version)}${formattedVariant}`);\n }\n }\n }\n\n if (typeNames.length > 0) {\n output += `export type { ${typeNames.sort().join(\", \")} } from \"${\n typesFilePath(version)\n }\";\\n`;\n }\n }\n\n return output;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAASA,iBAAiB,QAAQ,yBAAyB;AAC3D,SAASC,qBAAqB,QAAQ,2BAA2B;AACjE,SAASC,kBAAkB,QAAQ,yBAAyB;AAC5D,SACEC,cAAc,EACdC,aAAa,EACbC,WAAW,EACXC,mBAAmB,EACnBC,aAAa,EACbC,sBAAsB,EACtBC,iBAAiB,EACjBC,aAAa,QACR,oBAAoB;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,uBAAuBA,CACrCC,MAAwB,EACxBC,mBAA4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