From bdb3277302e566bbe182bd13c3ff22f07bd14aa6 Mon Sep 17 00:00:00 2001 From: Sora Morimoto Date: Mon, 24 Mar 2025 19:14:39 +0900 Subject: [PATCH 1/2] Add `shims` option in tsup configuration and update `rootDir` path in templates generation process Signed-off-by: Sora Morimoto --- .changeset/chubby-bats-brake.md | 5 +++++ src/commands/generate-templates/templates-gen-process.ts | 2 +- tsup.config.ts | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changeset/chubby-bats-brake.md diff --git a/.changeset/chubby-bats-brake.md b/.changeset/chubby-bats-brake.md new file mode 100644 index 000000000..b104a192a --- /dev/null +++ b/.changeset/chubby-bats-brake.md @@ -0,0 +1,5 @@ +--- +"swagger-typescript-api": patch +--- + +Add `shims` option in tsup configuration and update `rootDir` path in templates generation process. diff --git a/src/commands/generate-templates/templates-gen-process.ts b/src/commands/generate-templates/templates-gen-process.ts index 0bf654898..e8970e3fe 100644 --- a/src/commands/generate-templates/templates-gen-process.ts +++ b/src/commands/generate-templates/templates-gen-process.ts @@ -14,7 +14,7 @@ export class TemplatesGenProcess { config: TemplatesGenConfig; fileSystem: FileSystem; - rootDir = path.resolve(__dirname, "../../../"); + rootDir = path.resolve(__dirname, ".."); paths = { baseTemplates: "templates/base", diff --git a/tsup.config.ts b/tsup.config.ts index d93df8fb1..fc3f5f048 100644 --- a/tsup.config.ts +++ b/tsup.config.ts @@ -8,6 +8,7 @@ export default defineConfig({ clean: true, format: ["esm", "cjs"], minify: true, + shims: true, sourcemap: true, splitting: true, target: "node18", From 28d43b49604f6fa00155a4e4ac95322d5ca86713 Mon Sep 17 00:00:00 2001 From: Sora Morimoto Date: Mon, 24 Mar 2025 19:15:27 +0900 Subject: [PATCH 2/2] Add `required` property to output path in `generateTemplatesCommand` Signed-off-by: Sora Morimoto --- .changeset/silver-shirts-visit.md | 5 +++++ index.ts | 1 + 2 files changed, 6 insertions(+) create mode 100644 .changeset/silver-shirts-visit.md diff --git a/.changeset/silver-shirts-visit.md b/.changeset/silver-shirts-visit.md new file mode 100644 index 000000000..0b81466a1 --- /dev/null +++ b/.changeset/silver-shirts-visit.md @@ -0,0 +1,5 @@ +--- +"swagger-typescript-api": patch +--- + +Add `required` property to output path in `generateTemplatesCommand`. diff --git a/index.ts b/index.ts index 9473f188f..6ce068c83 100644 --- a/index.ts +++ b/index.ts @@ -43,6 +43,7 @@ const generateTemplatesCommand = defineCommand({ alias: "o", description: "output path of generated templates", default: templateGenBaseConfig.output, + required: true, }, rewrite: { type: "boolean",