Skip to content

Commit

Permalink
Fix cli bug of runtime configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
samchon committed Sep 5, 2024
1 parent 3b57800 commit 7ba153f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nestia",
"version": "6.0.1",
"version": "6.0.2",
"description": "Nestia CLI tool",
"main": "bin/index.js",
"bin": {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/internal/ArgumentParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export namespace ArgumentParser {
options.project ??= await configure();
options.runtime =
((options.runtime as string | undefined) ??
(await select("swagger")("Transform Runtime Swagger")([
(await select("runtime")("Transform Runtime Swagger")([
"true",
"false",
]))) !== "false";
Expand Down
20 changes: 9 additions & 11 deletions packages/cli/src/internal/PluginConfigurator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,18 @@ export namespace PluginConfigurator {
p !== null &&
p.transform === "typia/lib/transform",
);
const swagger: boolean =
args.runtime === false
? true
: !!plugins.find(
(p) =>
typeof p === "object" &&
p !== null &&
p.transform === "@nestia/sdk/lib/transform",
);
const swagger: comments.CommentObject | undefined = plugins.find(
(p) =>
typeof p === "object" &&
p !== null &&
p.transform === "@nestia/sdk/lib/transform",
);
if (
strictNullChecks !== false &&
(strict === true || strictNullChecks === true) &&
core !== undefined &&
typia !== undefined
typia !== undefined &&
swagger !== undefined
)
return;

Expand Down Expand Up @@ -101,7 +99,7 @@ export namespace PluginConfigurator {
"stringify": "assert"
}`) as comments.CommentObject,
);
if (swagger === false)
if (swagger === undefined && args.runtime === true)
plugins.push(
comments.parse(
`{ "transform": "@nestia/sdk/lib/transform" }`,
Expand Down

0 comments on commit 7ba153f

Please sign in to comment.