File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#!/usr/bin/env node
22
3- import Ajv from 'ajv' ;
3+ import { Ajv } from 'ajv' ;
44import { Command } from 'commander' ;
55import { readFileSync } from 'fs' ;
66import { fileURLToPath } from 'url' ;
77import { dirname , join , resolve } from 'path' ;
8- import { ServiceSchema } from '../interfaces.js' ;
98import { MicroService } from '../MicroService.js' ;
109import ValidateSchema from '../serviceSchemaValidator.json' with { type : 'json' } ;
1110import { logger } from '../logger/index.js' ;
@@ -54,7 +53,7 @@ Examples:
5453
5554 logger . info ( 'Starting generation in:' , directoryPath ) ;
5655
57- const schema : ServiceSchema = ( await import ( pathToSchema ) ) . default ;
56+ const schema = JSON . parse ( readFileSync ( pathToSchema , 'utf-8' ) ) ;
5857 validateSchema ( schema ) ;
5958
6059 const validate = new Ajv ( ) . compile ( ValidateSchema ) ;
Original file line number Diff line number Diff line change 11{
22 "compilerOptions" : {
3- "sourceMap" : true ,
3+ "outDir" : " ./dist" ,
4+ "rootDir" : " ./src" ,
45 "declaration" : true ,
6+ "sourceMap" : true ,
57 "strictNullChecks" : true ,
6- "module" : " ESNext" ,
7- "moduleResolution" : " bundler" ,
8- "target" : " ES2022" ,
8+ "removeComments" : true ,
9+ "strict" : true ,
10+ "target" : " esnext" ,
11+ "module" : " nodenext" ,
12+ "moduleResolution" : " nodenext" ,
13+ "skipLibCheck" : true ,
914 "allowJs" : false ,
1015 "resolveJsonModule" : true ,
11- "skipLibCheck" : true ,
1216 "experimentalDecorators" : true ,
1317 "emitDecoratorMetadata" : true ,
14- "outDir" : " ./dist" ,
15- "declarationDir" : " ./dist/types/" ,
16- "esModuleInterop" : true , /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
17- "forceConsistentCasingInFileNames" : true , /* Ensure that casing is correct in imports. */
18+ "strictPropertyInitialization" : false ,
19+ "lib" : [" ESNext" ],
20+ "esModuleInterop" : true ,
21+ "allowSyntheticDefaultImports" : true ,
22+ "forceConsistentCasingInFileNames" : true
1823 },
19- "include" : [" src " , " src/*.json " ],
24+ "include" : [" ./src " ],
2025 "exclude" : [" node_modules" ," test" ]
2126}
You can’t perform that action at this time.
0 commit comments