Skip to content

Commit 41d6b2e

Browse files
authored
Merge pull request #1113 from acacode/fix-gen-template
Fix template path handling and make output parameter required
2 parents 760a5b6 + 28d43b4 commit 41d6b2e

File tree

5 files changed

+13
-1
lines changed

5 files changed

+13
-1
lines changed

.changeset/chubby-bats-brake.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"swagger-typescript-api": patch
3+
---
4+
5+
Add `shims` option in tsup configuration and update `rootDir` path in templates generation process.

.changeset/silver-shirts-visit.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"swagger-typescript-api": patch
3+
---
4+
5+
Add `required` property to output path in `generateTemplatesCommand`.

index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ const generateTemplatesCommand = defineCommand({
4343
alias: "o",
4444
description: "output path of generated templates",
4545
default: templateGenBaseConfig.output,
46+
required: true,
4647
},
4748
rewrite: {
4849
type: "boolean",

src/commands/generate-templates/templates-gen-process.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export class TemplatesGenProcess {
1414
config: TemplatesGenConfig;
1515
fileSystem: FileSystem;
1616

17-
rootDir = path.resolve(__dirname, "../../../");
17+
rootDir = path.resolve(__dirname, "..");
1818

1919
paths = {
2020
baseTemplates: "templates/base",

tsup.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export default defineConfig({
88
clean: true,
99
format: ["esm", "cjs"],
1010
minify: true,
11+
shims: true,
1112
sourcemap: true,
1213
splitting: true,
1314
target: "node18",

0 commit comments

Comments
 (0)