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/.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", 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",