Skip to content

Commit

Permalink
fix(swagger): fix esm issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Romakita committed Mar 13, 2022
1 parent 2d61c04 commit fe3e2af
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 22 deletions.
2 changes: 1 addition & 1 deletion packages/specs/schema/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"@tsed/core": "^6.105.4"
},
"peerDependenciesMeta": {
"@tsed/code": {
"@tsed/core": {
"optional": false
}
}
Expand Down
6 changes: 4 additions & 2 deletions packages/specs/swagger/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,17 @@
"default": "./lib/esm/index.js"
},
"scripts": {
"build": "yarn run build:esm && yarn run build:cjs && cp -r ./views ./lib/views",
"clean": "rm -rf lib",
"build": "yarn clean && yarn barrels && yarn run build:esm && yarn run build:cjs && cp -r ./views ./lib/views",
"build:cjs": "tsc --build tsconfig.compile.json",
"build:esm": "tsc --build tsconfig.compile.esm.json",
"barrels": "yarn barrelsby --delete -d ./src -e \"\\.spec\\.ts\" -e \"__mock__\" -e \".benchmark.ts\"",
"start": "ts-node -r tsconfig-paths/register test/app/index.ts",
"test": "cross-env NODE_ENV=test yarn jest --max-workers=2"
},
"dependencies": {
"@tsed/openspec": "6.105.4",
"fs-extra": "9.0.1",
"fs-extra": "10.0.1",
"micromatch": "4.0.4",
"swagger-ui-dist": "^4.5.2",
"tslib": "2.2.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/specs/swagger/src/SwaggerModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
} from "@tsed/common";
import Fs from "fs";
import {join} from "path";
import {SwaggerSettings} from "./interfaces";
import {SwaggerSettings} from "./interfaces/SwaggerSettings";
import {cssMiddleware} from "./middlewares/cssMiddleware";
import {indexMiddleware} from "./middlewares/indexMiddleware";
import {jsMiddleware} from "./middlewares/jsMiddleware";
Expand Down
15 changes: 13 additions & 2 deletions packages/specs/swagger/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
export * from "./services/SwaggerService";
/**
* @file Automatically generated by barrelsby.
*/

export * from "./SwaggerModule";
export * from "./interfaces";
export * from "./decorators/docs";
export * from "./decorators/hidden";
export * from "./interfaces/SwaggerSettings";
export * from "./interfaces/interfaces";
export * from "./middlewares/cssMiddleware";
export * from "./middlewares/indexMiddleware";
export * from "./middlewares/jsMiddleware";
export * from "./middlewares/redirectMiddleware";
export * from "./services/SwaggerService";
export * from "./utils/includeRoute";
export * from "./utils/matchPath";
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,3 @@ declare global {
}
}
}

export * from "./SwaggerSettings";
4 changes: 2 additions & 2 deletions packages/specs/swagger/src/utils/includeRoute.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {ControllerProvider} from "@tsed/common";
import {matchPath} from ".";
import {SwaggerSettings} from "..";
import {matchPath} from "./matchPath";
import {SwaggerSettings} from "../interfaces/SwaggerSettings";

export function includeRoute(route: string, provider: ControllerProvider, conf: SwaggerSettings): boolean {
const hidden = provider.store.get("hidden");
Expand Down
2 changes: 0 additions & 2 deletions packages/specs/swagger/src/utils/index.ts

This file was deleted.

20 changes: 10 additions & 10 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10602,16 +10602,6 @@ [email protected]:
jsonfile "^4.0.0"
universalify "^0.1.0"

[email protected], fs-extra@^9.0.0:
version "9.0.1"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.0.1.tgz#910da0062437ba4c39fedd863f1675ccfefcb9fc"
integrity sha512-h2iAoN838FqAFJY2/qVpzFXy+EBxfVE220PalAqQLDVsFOHLJrZvut5puAbCdNv6WJk+B8ihI+k0c7JK5erwqQ==
dependencies:
at-least-node "^1.0.0"
graceful-fs "^4.2.0"
jsonfile "^6.0.1"
universalify "^1.0.0"

[email protected], fs-extra@^9.1.0:
version "9.1.0"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d"
Expand All @@ -10631,6 +10621,16 @@ fs-extra@^7.0.1:
jsonfile "^4.0.0"
universalify "^0.1.0"

fs-extra@^9.0.0:
version "9.0.1"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.0.1.tgz#910da0062437ba4c39fedd863f1675ccfefcb9fc"
integrity sha512-h2iAoN838FqAFJY2/qVpzFXy+EBxfVE220PalAqQLDVsFOHLJrZvut5puAbCdNv6WJk+B8ihI+k0c7JK5erwqQ==
dependencies:
at-least-node "^1.0.0"
graceful-fs "^4.2.0"
jsonfile "^6.0.1"
universalify "^1.0.0"

[email protected]:
version "4.3.1"
resolved "https://registry.yarnpkg.com/fs-jetpack/-/fs-jetpack-4.3.1.tgz#cdfd4b64e6bfdec7c7dc55c76b39efaa7853bb20"
Expand Down

0 comments on commit fe3e2af

Please sign in to comment.