Skip to content

Commit

Permalink
Merge pull request #586 from LorenzHenk/master
Browse files Browse the repository at this point in the history
Fix #552
  • Loading branch information
samchon authored Apr 17, 2023
2 parents 3e09c3a + 16c4f85 commit eb4c2b0
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 8 deletions.
9 changes: 6 additions & 3 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand Down
7 changes: 5 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down Expand Up @@ -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*.

Expand Down
15 changes: 12 additions & 3 deletions src/factories/TypiaFileFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,24 @@ 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 () => {
const container: string[] = [];
await gather(props)(container)(props.input)(props.output);
return container;
})(),
config.compilerOptions,
compilerOptions,
);

// DO TRANSFORM
Expand All @@ -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",
Expand Down

0 comments on commit eb4c2b0

Please sign in to comment.