Skip to content

Commit

Permalink
feat(cli-generate-swagger): remove connection information when the sw…
Browse files Browse the repository at this point in the history
…agger is generated
  • Loading branch information
Romakita committed Apr 26, 2023
1 parent 9a9b970 commit 45381e1
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 15 deletions.
2 changes: 1 addition & 1 deletion packages/cli-core/package.json
Expand Up @@ -85,4 +85,4 @@
"@tsed/core": ">=7.14.2",
"@tsed/di": ">=7.14.2"
}
}
}
2 changes: 1 addition & 1 deletion packages/cli-core/src/services/CliService.ts
Expand Up @@ -17,7 +17,7 @@ import {ProjectPackageJson} from "./ProjectPackageJson";
// @ts-ignore
import inquirer_autocomplete_prompt from "inquirer-autocomplete-prompt";
import {mapCommanderOptions} from "../utils/mapCommanderOptions";
import {CommandMetadata} from "@tsed/cli-core";
import {CommandMetadata} from "../interfaces/CommandMetadata";

Inquirer.registerPrompt("autocomplete", inquirer_autocomplete_prompt);

Expand Down
2 changes: 1 addition & 1 deletion packages/cli-core/src/utils/resolveConfiguration.ts
@@ -1,6 +1,6 @@
import {TokenProvider} from "@tsed/di";
import {getCommandMetadata} from "@tsed/cli-core";
import {getValue} from "@tsed/core";
import {getCommandMetadata} from "./getCommandMetadata";

export function resolveConfiguration(settings: any) {
const argv = getValue(settings, "argv", process.argv);
Expand Down
Expand Up @@ -94,7 +94,10 @@ export class GenerateHttpClientCmd implements CommandProvider {
const {SwaggerService} = await importPackage("@tsed/swagger");

const platform: {injector: InjectorService; stop: () => Promise<any>} = await Platform.bootstrap(this.serverModule, {
logger: {level: "off"}
logger: {level: "off"},
mongoose: [],
redis: [],
ioredis: []
});
const swaggerService = platform.injector.get<any>(SwaggerService)!;
const confs = platform.injector.settings.get("swagger", []);
Expand Down
11 changes: 0 additions & 11 deletions packages/cli/src/Cli.ts
Expand Up @@ -68,17 +68,6 @@ export class Cli extends CliCore {
return super.bootstrap(opts, Cli);
}

//
// static async dispatch(cmd: "init", context: InitCmdContext): Promise<void>;
// static async dispatch(cmd: "generate", context: GenerateCmdContext): Promise<void>;
// static async dispatch(cmd: string, context: any) {
// this.createAliases();
//
// const cli = await this.create<Cli>({...Cli.defaults} as any, Cli);
//
// await cli.cliService.dispatch(cmd, context);
// }

static createAliases() {
alias.addAliases({
"@tsed/core": require.resolve("@tsed/core"),
Expand Down

0 comments on commit 45381e1

Please sign in to comment.