diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 522533f32b..fec57d3d04 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -3,10 +3,13 @@ Before submitting a Pull Request, please test your code. If you created a new created a new feature, then create the unit test function, too. ```bash -# COMPILE TEST AUTOMATION PROGRAM -npm run build:test +# COMPILE +npm run build -# RUN THE TEST AUTOMATION PROGRAM +# PREPARE +npm run test:generate + +# DO TEST npm run test ``` diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5aed3ce9ff..3e00fc8542 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -27,12 +27,15 @@ I always welcome your suggestion. When you publishing a suggestion, then please ## Contributing Code ### Test your code -Before sending a pull request, please test your new code. You type the command `npm run build &&& npm run test`, then compiling your code and test-automation will be all processed. +Before sending a pull request, please test your new code. Please run the following commands: ```bash # COMPILE npm run build +# PREPARE +npm run test:generate + # DO TEST npm run test ``` @@ -92,7 +95,7 @@ When you send a pull request, please include a description, of what your change - Add tests for #28 ### 2. Include adequate tests -As I've mentioned in the `Contributing Code` section, your PR should pass the test-automation module. Your PR includes *new features* that have not being handled in the ordinary test-automation module, then also update *add the testing unit* please. +As I've mentioned in the `Contributing Code` section, your PR should pass the test-automation module. If your PR includes *new features* that have not being handled in the ordinary test-automation module, then also update *add the testing unit* please. If there're some specific reasons that could not pass the test-automation (not error but *intended*), then please update the ordinary test-automation module or write the reasons on your PR content and *const me update the test-automation module*. diff --git a/src/factories/TypiaFileFactory.ts b/src/factories/TypiaFileFactory.ts index 12a9cc3795..55dbbaff53 100644 --- a/src/factories/TypiaFileFactory.ts +++ b/src/factories/TypiaFileFactory.ts @@ -35,7 +35,16 @@ export namespace TypiaFileFactory { } // CREATE PROGRAM - const { config } = ts.readConfigFile(props.project, ts.sys.readFile); + const { options: compilerOptions } = ts.parseJsonConfigFileContent( + ts.readConfigFile(props.project, ts.sys.readFile).config, + { + fileExists: ts.sys.fileExists, + readFile: ts.sys.readFile, + readDirectory: ts.sys.readDirectory, + useCaseSensitiveFileNames: ts.sys.useCaseSensitiveFileNames, + }, + path.dirname(props.project) + ) const program: ts.Program = ts.createProgram( await (async () => { @@ -43,7 +52,7 @@ export namespace TypiaFileFactory { await gather(props)(container)(props.input)(props.output); return container; })(), - config.compilerOptions, + compilerOptions, ); // DO TRANSFORM @@ -59,7 +68,7 @@ export namespace TypiaFileFactory { ImportTransformer.transform(props.input)(props.output), transform( program, - (config.compilerOptions.plugins ?? []).find( + (compilerOptions.plugins as any[] ?? []).find( (p: any) => p.transform === "typia/lib/transform" || p.transform === "../src/transform.ts",