Fix: Issue with generate script due to type package changes

This commit is contained in:
kiok46
2026-01-23 16:01:42 +05:30
parent 45eb12a536
commit 1a47808934
2 changed files with 23 additions and 13 deletions

View File

@@ -24,11 +24,13 @@ try {
const schemaPath = join(rootDir, 'src/parser/xo-template.schema.json');
const validatorPath = join(rootDir, 'src/parser/ajv/validate-xo-template.js');
const tsconfigPath = join(rootDir, 'tsconfig.json');
const templatePath = join(rootDir, 'node_modules/@xo-cash/types/build/template.d.ts');
// Point directly to the dist file - the type is exported at the end via barrel export
const templatePath = join(rootDir, 'node_modules/@xo-cash/types/dist/index.d.mts');
// Generate schema JSON (write to file directly instead of shell redirection)
// Using --no-type-check to skip type checking and --expose all to find types exported via barrel exports
const schemaContent = execSync(
`ts-json-schema-generator --no-ref-encode --tsconfig "${tsconfigPath}" --path "${templatePath}" --type "XOTemplate"`,
`ts-json-schema-generator --no-ref-encode --no-type-check --expose all --tsconfig "${tsconfigPath}" --path "${templatePath}" --type "XOTemplate"`,
{ encoding: 'utf8', cwd: rootDir },
);
writeFileSync(schemaPath, schemaContent, 'utf8');