From 92f812ce26765e83dbf2540806f512aa3377f001 Mon Sep 17 00:00:00 2001 From: Lorenz Henk Date: Mon, 17 Apr 2023 14:50:10 +0000 Subject: [PATCH 1/3] fix: invalid moduleResolution --- src/factories/TypiaFileFactory.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) 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", From 5d1b216029fdfafc99b79a8331c1397b6c445be6 Mon Sep 17 00:00:00 2001 From: Lorenz Henk Date: Mon, 17 Apr 2023 14:50:22 +0000 Subject: [PATCH 2/3] chore: update CONTRIBUTING.md --- CONTRIBUTING.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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*. From 16c4f85301397ea5ac7ae9cf12e5f505cd724e85 Mon Sep 17 00:00:00 2001 From: Lorenz Henk Date: Mon, 17 Apr 2023 14:53:41 +0000 Subject: [PATCH 3/3] chore: update PR template --- .github/PULL_REQUEST_TEMPLATE.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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 ```