Skip to content

Commit

Permalink
fix(transformer): export definitely typed for transformer so it will …
Browse files Browse the repository at this point in the history
…be easier to read the documentation while developing (#222)
  • Loading branch information
uittorio authored Feb 5, 2020
1 parent 159a65b commit 37b4b7e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion config/modules/transformer/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "../../../dist/transformer"
"declaration": true,
"outDir": "../../../dist"
}
}
3 changes: 1 addition & 2 deletions config/modules/transformer/webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ module.exports = merge(base({
webpackNodeExternals()
],
entry: {
index: './src/transformer/transformer.ts',
index: './src/transformer/index.ts',
},
output: {
path: path.resolve(__dirname, "../../../dist/transformer"),
filename: "index.js"
}
});
3 changes: 3 additions & 0 deletions src/transformer/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { transformer } from './transformer';

export default transformer;
2 changes: 1 addition & 1 deletion src/transformer/transformer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { getMock, getMockForList, storeRegisterMock } from './mock/mock';
import { MockDefiner } from './mockDefiner/mockDefiner';
import { SetTypeChecker, TypeChecker } from './typeChecker/typeChecker';

export default function transformer(program: ts.Program, options?: TsAutoMockOptions): ts.TransformerFactory<ts.SourceFile> {
export function transformer(program: ts.Program, options?: TsAutoMockOptions): ts.TransformerFactory<ts.SourceFile> {
SetTsAutoMockOptions(options);
SetTypeChecker(program.getTypeChecker());

Expand Down

0 comments on commit 37b4b7e

Please sign in to comment.