Fix: Issue with generate script due to type package changes
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user