Skip to content
This repository was archived by the owner on Nov 1, 2023. It is now read-only.

Commit bbd9afc

Browse files
committed
✨ feat(typescript): upgrade to 4.1
1 parent 01294d4 commit bbd9afc

File tree

15 files changed

+1254
-2009
lines changed

15 files changed

+1254
-2009
lines changed

jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
module.exports = {
22
preset: 'ts-jest',
33
testEnvironment: 'node',
4-
testPathIgnorePatterns: ['/node_modules/', '/fixtures/', 'util.ts', 'compiler.ts'],
54
testTimeout: 120 * 1000,
65
forceExit: true,
6+
testPathIgnorePatterns: ['/node_modules/', '/fixtures/', 'util.ts', 'compiler.ts'],
77
coveragePathIgnorePatterns: ['/node_modules/', '.faas_debug_tmp', '__tests__'],
88
snapshotSerializers: ['jest-serializer-path', 'jest-snapshot-serializer-raw'],
99
}

package.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@
2525
"codecov": "^3.8.0",
2626
"execa": "^4.0.3",
2727
"husky": "^4.2.3",
28-
"jest": "^25.1.0",
28+
"jest": "^26.6.3",
2929
"jest-serializer-path": "^0.1.15",
3030
"jest-snapshot-serializer-raw": "^1.1.0",
3131
"lerna": "latest",
3232
"prettier": "^2.0.2",
3333
"pretty-quick": "^3.1.0",
34-
"ts-jest": "^25.2.1",
35-
"typescript": "3"
34+
"ts-jest": "^26.4.4",
35+
"typescript": "^4.1.3"
3636
},
3737
"husky": {
3838
"hooks": {
@@ -41,5 +41,8 @@
4141
},
4242
"workspaces": [
4343
"packages/*"
44-
]
44+
],
45+
"resolutions": {
46+
"@midwayjs/mwcc": "^0.5.0-nightly.0"
47+
}
4548
}

packages/faas-cli-plugin-midway-hooks/src/__tests__/fixtures/package/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"rootDir": "src",
55
"outDir": "dist",
66
"experimentalDecorators": true,
7-
"emitDecoratorMetadata": true
7+
"emitDecoratorMetadata": true,
8+
"skipLibCheck": true
89
},
910
"include": ["./src/**/*.ts"]
1011
}

packages/hooks-loader/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
"jest-snapshot-serializer-raw": "^1.1.0",
3636
"memory-fs": "^0.5.0",
3737
"ts-loader": "^8.0.11",
38-
"typescript": "^3.9.3",
3938
"webpack": "^4.42.1",
4039
"webpack-chain": "^6.5.0"
4140
},
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
22
"exclude": ["lib", "node_modules", "**/__tests__"],
3-
"include": ["./src"]
3+
"include": ["./src"],
4+
"compilerOptions": {
5+
"skipLibCheck": true
6+
}
47
}

packages/hooks-shared/package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@
1919
"type": "git",
2020
"url": "git@github.com:midwayjs/hooks.git"
2121
},
22-
"devDependencies": {
23-
"typescript": "^3.9.3"
24-
},
2522
"publishConfig": {
2623
"access": "public"
2724
},

packages/hooks/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020
"url": "git@github.com:midwayjs/hooks.git"
2121
},
2222
"devDependencies": {
23-
"@midwayjs/faas": "2",
24-
"typescript": "^3.9.3"
23+
"@midwayjs/faas": "2"
2524
},
2625
"dependencies": {
2726
"@midwayjs/hooks-request": "^1.0.2"

packages/next-hooks-compiler/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"@midwayjs/fcli-plugin-invoke": "^1.2.29",
2121
"@midwayjs/hooks": "^1.0.2",
2222
"@midwayjs/hooks-shared": "^1.0.2",
23-
"@midwayjs/mwcc": "^0.4.5",
23+
"@midwayjs/mwcc": "^0.5.0-nightly.0",
2424
"@midwayjs/serverless-invoke": "^1.2.12",
2525
"@types/lodash": "^4.14.159",
2626
"chalk": "^4.0.0",
@@ -36,8 +36,7 @@
3636
"@types/debug": "^4.1.5",
3737
"@types/jest": "^26.0.15",
3838
"@types/path-is-inside": "^1.0.0",
39-
"globby": "^11.0.0",
40-
"typescript": "^3.9.3"
39+
"globby": "^11.0.0"
4140
},
4241
"publishConfig": {
4342
"access": "public"

packages/next-hooks-compiler/src/__tests__/__snapshots__/compile.test.ts.snap

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,12 @@ export const useAsyncArrow = async (name: string) => {
1717
"use strict";
1818
Object.defineProperty(exports, "__esModule", { value: true });
1919
exports.useAsyncArrow = exports.useArrow = exports.useDemo = void 0;
20-
exports.useDemo = function useDemo(name) { const _req_ctx_ = this; };
21-
exports.useArrow = function useArrow(name) { const _req_ctx_ = this; exports.useDemo.bind(_req_ctx_)(name + '666'); };
22-
exports.useAsyncArrow = async function useAsyncArrow(name) { const _req_ctx_ = this; await exports.useDemo.bind(_req_ctx_)(name + '666'); };
20+
const useDemo = function useDemo(name) { const _req_ctx_ = this; };
21+
exports.useDemo = useDemo;
22+
const useArrow = function useArrow(name) { const _req_ctx_ = this; exports.useDemo.bind(_req_ctx_)(name + '666'); };
23+
exports.useArrow = useArrow;
24+
const useAsyncArrow = async function useAsyncArrow(name) { const _req_ctx_ = this; await exports.useDemo.bind(_req_ctx_)(name + '666'); };
25+
exports.useAsyncArrow = useAsyncArrow;
2326
//# sourceMappingURL=arrow.js.map
2427
`;
2528

@@ -212,15 +215,17 @@ export const useInner = async () => {
212215
"use strict";
213216
Object.defineProperty(exports, "__esModule", { value: true });
214217
exports.useInner = exports.useQuery = void 0;
215-
exports.useQuery = function useQuery(id) { const _req_ctx_ = this; return ''; };
216-
exports.useInner = async function useInner() {
218+
const useQuery = function useQuery(id) { const _req_ctx_ = this; return ''; };
219+
exports.useQuery = useQuery;
220+
const useInner = async function useInner() {
217221
const _req_ctx_ = this;
218222
exports.useQuery.bind(_req_ctx_)('123');
219223
const inner = () => {
220224
console.log(exports.useQuery.bind(_req_ctx_)('123'));
221225
};
222226
inner();
223227
};
228+
exports.useInner = useInner;
224229
//# sourceMappingURL=arrow-hook-ref-arrow-hook.js.map
225230
`;
226231

@@ -237,7 +242,8 @@ const functionExpression = function () {}
237242
"use strict";
238243
Object.defineProperty(exports, "__esModule", { value: true });
239244
exports.hello = void 0;
240-
exports.hello = function hello(name) { const _req_ctx_ = this; console.log(name); };
245+
const hello = function hello(name) { const _req_ctx_ = this; console.log(name); };
246+
exports.hello = hello;
241247
const functionExpression = function () { };
242248
//# sourceMappingURL=export-arrow.js.map
243249
`;

packages/next-hooks-compiler/src/__tests__/fixtures/with-controller/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"rootDir": "src",
55
"outDir": "dist",
66
"experimentalDecorators": true,
7-
"emitDecoratorMetadata": true
7+
"emitDecoratorMetadata": true,
8+
"skipLibCheck": true
89
},
910
"include": ["./src/**/*.ts"]
1011
}

0 commit comments

Comments
 (0)