Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions scripts/build.mts
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,9 @@ for await (const file of filesTreeGenerator(schemasFolder)) {
// write the ts file with the generated schema
await fsPromise.writeFile(
typescriptFileName,
`import { FromSchema } from 'json-schema-to-ts';
`import type { FromExtendedSchema } from "json-schema-to-ts";
import { typeSymbol } from '${path.join(relativePath, 'symbol.js')}';
type CustomProps = {"x-env-value": string ;};
const exported = {
[typeSymbol]: '' as unknown as intermediateSchemaType,
${stringifiedSchema.trimEnd().substring(1)} as const;\n`,
Expand Down Expand Up @@ -112,7 +113,8 @@ for await (const file of filesTreeGenerator(schemasFolder)) {

const schemaTs = 'const schema = ' + JSON.stringify(dereferencedSchema) + ' as const;';

const intermediateSchemaType = 'type intermediateSchemaType = FromSchema<typeof schema, {parseIfThenElseKeywords: true, parseNotKeyword: true}>;';
const intermediateSchemaType =
'type intermediateSchemaType = FromExtendedSchema<CustomProps ,typeof schema, {parseIfThenElseKeywords: true, parseNotKeyword: true}>;';

const schemaType = 'export type schemaType = (typeof exported)[typeof typeSymbol];';

Expand Down