Skip to content

Commit

Permalink
copy template files into dist folder
Browse files Browse the repository at this point in the history
  • Loading branch information
inkognitro committed Mar 23, 2024
1 parent 536a9fa commit b80c0db
Show file tree
Hide file tree
Showing 9 changed files with 183 additions and 4 deletions.
177 changes: 177 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"scripts": {
"lint": "gts lint",
"clean": "gts clean",
"compile": "tsc",
"copyTemplateFiles": "copyfiles -u 1 src/templates/** dist",
"compile": "tsc && npm run copyTemplateFiles",
"fix": "tsc && gts fix",
"posttest": "npm run lint",
"prepare": "npm run compile",
Expand All @@ -15,7 +16,7 @@
"start": "npx tspc -w",
"test": "jest",
"test-ci": "jest --ci --coverage",
"tspc": "tspc"
"tspc": "tspc && npm run copyTemplateFiles"
},
"repository": {
"type": "git",
Expand All @@ -36,6 +37,7 @@
"@types/jest": "^29.5.12",
"@types/node": "20.8.2",
"@types/uuid": "^9.0.8",
"copyfiles": "^2.4.1",
"gts": "^5.2.0",
"jest": "^29.7.0",
"ts-jest": "^29.1.2",
Expand Down
2 changes: 1 addition & 1 deletion src/oas3/codegen/ts/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export class DefaultCodeGenerator implements CodeGenerator {
targetFolderPath: string
) {
const cleanTargetFolderPath = cleanUpFolderPath(targetFolderPath);
fs.cpSync(__dirname + '/template', cleanTargetFolderPath, {
fs.cpSync(__dirname + '../../../../templates/ts', cleanTargetFolderPath, {
recursive: true,
});
for (const filePath in fileOutputByFilePath) {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
"exclude": [
"src/**/*.spec.ts",
"src/**/*.test.ts",
"src/codegen-template/**"
"src/templates/**"
]
}

0 comments on commit b80c0db

Please sign in to comment.