Skip to content

Commit 6356ad8

Browse files
andrew-yustykbashleigh
authored andcommitted
Optimize import/export. Add index.ts to the root.
1 parent 9db7bfc commit 6356ad8

File tree

13 files changed

+13
-30
lines changed

13 files changed

+13
-30
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ node_modules/
1010
!src/__tests__/__stubs__/.env
1111

1212
dist/
13+
/index.js
14+
/index.d.ts
1315
.idea

.npmignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
tsconfig.json
22
node_modules/
33
src/
4+
/index.ts
45
yarn.lock
56
yarn-error.log
6-
package-lock.json
7+
package-lock.json

index.js

Lines changed: 0 additions & 8 deletions
This file was deleted.
File renamed without changes.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
"coverage": "jest --coverage",
3030
"coveralls": "yarn run coverage --coverageReporters=text-lcov | coveralls",
3131
"test:watch": "jest --watch",
32-
"build": "rm -rf ./dist && tsc",
32+
"build": "rm -rf ./dist && tsc && npm run build:index",
33+
"build:index": "rm -rf ./index.js ./index.d.ts && tsc -d --skipLibCheck ./index.ts",
3334
"format": "prettier **/**/*.ts --ignore-path ./.prettierignore --write && git status",
3435
"prepublish": "npm run format && npm run build"
3536
},

src/decorators/ConfigParam.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,3 @@ export const ConfigParam = (
1919
);
2020
return target;
2121
};
22-
export default ConfigParam;

src/decorators/Configurable.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,3 @@ export const Configurable = (): MethodDecorator => {
3030
return descriptor;
3131
};
3232
};
33-
export default Configurable;

src/decorators/index.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import InjectConfig from './injectConfig';
2-
import ConfigParam from './ConfigParam';
3-
import Configurable from './Configurable';
4-
export { InjectConfig, ConfigParam, Configurable };
1+
export * from './injectConfig';
2+
export * from './ConfigParam';
3+
export * from './Configurable';

src/decorators/injectConfig.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
import { Inject } from '@nestjs/common';
22
import { ConfigService } from '../module/config.service';
33

4-
const InjectConfig = () => Inject(ConfigService);
5-
6-
export default InjectConfig;
4+
export const InjectConfig = () => Inject(ConfigService);

src/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
21
export * from './decorators'
3-
export * from './module'
2+
export * from './module'

0 commit comments

Comments
 (0)