Skip to content

Commit

Permalink
fix(cli-generate-swagger): clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
Romakita committed Feb 23, 2023
1 parent 0e3701d commit d7c8be1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
8 changes: 3 additions & 5 deletions packages/cli-generate-swagger/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,11 @@
},
"devDependencies": {
"@tsed/cli": "4.3.0",
"@tsed/cli-core": "4.3.0",
"swagger-typescript-api": "^9.3.1"
"@tsed/cli-core": "4.3.0"
},
"peerDependencies": {
"@tsed/common": ">=7.14.2",
"@tsed/swagger": ">=7.14.2",
"swagger-typescript-api": "^9.3.1"
"@tsed/swagger": ">=7.14.2"
},
"peerDependenciesMeta": {
"@tsed/swagger": {
Expand All @@ -39,4 +37,4 @@
"optional": false
}
}
}
}
10 changes: 0 additions & 10 deletions packages/cli-generate-swagger/src/commands/GenerateSwaggerCmd.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
import {CliFs, Command, CommandProvider, Constant, Inject, InjectorService, Type} from "@tsed/cli-core";
import {importPackage} from "@tsed/core";
import path, {join, resolve} from "path";
import {Hooks, RawRouteInfo, RouteNameInfo} from "swagger-typescript-api";

export interface GenerateSwaggerCtx {
output: string;
}

export interface GenerateSwaggerOpts {
hooks?: Partial<Hooks>;

transformOperationId?(operationId: string, routeNameInfo: RouteNameInfo, raw: RawRouteInfo): string;
}

@Command({
name: "generate-swagger",
description: "Generate the client API from swagger spec",
Expand All @@ -34,9 +27,6 @@ export class GenerateSwaggerCmd implements CommandProvider {
@Constant("server")
protected serverModule: Type<any>;

@Constant("Swagger", {hooks: {}})
protected options: Partial<GenerateSwaggerOpts>;

$mapContext($ctx: GenerateSwaggerCtx) {
return {...$ctx, output: resolve(join(process.cwd(), $ctx.output))};
}
Expand Down

0 comments on commit d7c8be1

Please sign in to comment.