Skip to content

Commit b5fc380

Browse files
committed
chore: update version config
1 parent cee93c8 commit b5fc380

File tree

10 files changed

+201
-18
lines changed

10 files changed

+201
-18
lines changed

.pnp.cjs

Lines changed: 114 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
6.88 MB
Binary file not shown.
6.89 MB
Binary file not shown.

jest.config.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/** @type {import('ts-jest').JestConfigWithTsJest} */
2+
module.exports = {
3+
rootDir: "./",
4+
preset: "ts-jest",
5+
transform: {
6+
"^.+\\.(ts|tsx)?$": "ts-jest",
7+
},
8+
moduleFileExtensions: ["js", "ts"],
9+
testEnvironment: "node",
10+
projects: ["<rootDir>/packages/*/jest.config.js"],
11+
};

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@
1414
"docs": "yarn workspace docs",
1515
"lint": "eslint .",
1616
"pre-commit": "lint-staged --config .lintstagedrc.js",
17+
"test": "jest",
1718
"example": "yarn workspace @nutshell/example"
1819
},
1920
"devDependencies": {
2021
"@next/eslint-plugin-next": "^13.0.5",
22+
"@types/jest": "^29.5.3",
2123
"@typescript-eslint/eslint-plugin": "^5.59.0",
2224
"@typescript-eslint/parser": "^5.59.0",
2325
"eslint": "8.43.0",
@@ -36,6 +38,7 @@
3638
"husky": "^8.0.0",
3739
"jest": "^29.3.1",
3840
"lint-staged": "^13.2.2",
41+
"ts-jest": "^29.1.1",
3942
"typescript": "5.1.3"
4043
},
4144
"packageManager": "[email protected]"

packages/example/jest.config.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
/** @type {import('jest').Config} */
2-
const config = {
3-
preset: "ts-jest",
4-
testEnvironment: "node",
5-
transformIgnorePatterns: ["<rootDir>/node_modules/"],
6-
verbose: true,
7-
};
1+
const makeConfig = require("@nutshell/jest-config");
82

9-
module.exports = config;
3+
module.exports = makeConfig();

packages/example/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@
44
"test": "jest"
55
},
66
"devDependencies": {
7+
"@nutshell/jest-config": "workspace:*",
78
"@nutshell/ts-config": "workspace:*",
8-
"@types/jest": "^29.5.3",
9-
"ts-jest": "^29.1.1"
9+
"@types/jest": "*",
10+
"jest": "*",
11+
"ts-jest": "*",
12+
"typescript": "*"
1013
}
1114
}

tools/jest/index.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/**
2+
*
3+
* @param {import('jest').Config} customConfig
4+
* @returns
5+
*/
6+
function makeConfig(customConfig) {
7+
return {
8+
preset: "ts-jest",
9+
testEnvironment: "node",
10+
transformIgnorePatterns: ["<rootDir>/node_modules/"],
11+
verbose: true,
12+
...customConfig,
13+
};
14+
}
15+
16+
module.exports = makeConfig;

tools/jest/package.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"name": "@nutshell/jest-config",
3+
"main": "./index.js",
4+
"version": "0.0.1",
5+
"devDependencies": {
6+
"jest": "*",
7+
"ts-jest": "*",
8+
"typescript": "*"
9+
}
10+
}

yarn.lock

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2541,10 +2541,22 @@ __metadata:
25412541
version: 0.0.0-use.local
25422542
resolution: "@nutshell/example@workspace:packages/example"
25432543
dependencies:
2544+
"@nutshell/jest-config": "workspace:*"
25442545
"@nutshell/ts-config": "workspace:*"
2545-
"@types/jest": ^29.5.3
2546-
ts-jest: ^29.1.1
2547-
typescript: 5.1.3
2546+
"@types/jest": "*"
2547+
jest: "*"
2548+
ts-jest: "*"
2549+
typescript: "*"
2550+
languageName: unknown
2551+
linkType: soft
2552+
2553+
"@nutshell/jest-config@workspace:*, @nutshell/jest-config@workspace:tools/jest":
2554+
version: 0.0.0-use.local
2555+
resolution: "@nutshell/jest-config@workspace:tools/jest"
2556+
dependencies:
2557+
jest: "*"
2558+
ts-jest: "*"
2559+
typescript: "*"
25482560
languageName: unknown
25492561
linkType: soft
25502562

@@ -2893,7 +2905,7 @@ __metadata:
28932905
languageName: node
28942906
linkType: hard
28952907

2896-
"@types/jest@npm:^29.5.3":
2908+
"@types/jest@npm:*, @types/jest@npm:^29.5.3":
28972909
version: 29.5.3
28982910
resolution: "@types/jest@npm:29.5.3"
28992911
dependencies:
@@ -5870,6 +5882,7 @@ __metadata:
58705882
resolution: "functional-coding-nutshell@workspace:."
58715883
dependencies:
58725884
"@next/eslint-plugin-next": ^13.0.5
5885+
"@types/jest": ^29.5.3
58735886
"@typescript-eslint/eslint-plugin": ^5.59.0
58745887
"@typescript-eslint/parser": ^5.59.0
58755888
eslint: 8.43.0
@@ -5888,6 +5901,7 @@ __metadata:
58885901
husky: ^8.0.0
58895902
jest: ^29.3.1
58905903
lint-staged: ^13.2.2
5904+
ts-jest: ^29.1.1
58915905
typescript: 5.1.3
58925906
languageName: unknown
58935907
linkType: soft
@@ -7489,7 +7503,7 @@ __metadata:
74897503
languageName: node
74907504
linkType: hard
74917505

7492-
"jest@npm:^29.3.1":
7506+
"jest@npm:*, jest@npm:^29.3.1":
74937507
version: 29.6.1
74947508
resolution: "jest@npm:29.6.1"
74957509
dependencies:
@@ -10902,7 +10916,7 @@ __metadata:
1090210916
languageName: node
1090310917
linkType: hard
1090410918

10905-
"ts-jest@npm:^29.1.1":
10919+
"ts-jest@npm:*, ts-jest@npm:^29.1.1":
1090610920
version: 29.1.1
1090710921
resolution: "ts-jest@npm:29.1.1"
1090810922
dependencies:
@@ -11020,6 +11034,16 @@ __metadata:
1102011034
languageName: node
1102111035
linkType: hard
1102211036

11037+
"typescript@npm:*":
11038+
version: 5.1.6
11039+
resolution: "typescript@npm:5.1.6"
11040+
bin:
11041+
tsc: bin/tsc
11042+
tsserver: bin/tsserver
11043+
checksum: b2f2c35096035fe1f5facd1e38922ccb8558996331405eb00a5111cc948b2e733163cc22fab5db46992aba7dd520fff637f2c1df4996ff0e134e77d3249a7350
11044+
languageName: node
11045+
linkType: hard
11046+
1102311047
"typescript@npm:5.1.3":
1102411048
version: 5.1.3
1102511049
resolution: "typescript@npm:5.1.3"
@@ -11030,6 +11054,16 @@ __metadata:
1103011054
languageName: node
1103111055
linkType: hard
1103211056

11057+
"typescript@patch:typescript@*#~builtin<compat/typescript>":
11058+
version: 5.1.6
11059+
resolution: "typescript@patch:typescript@npm%3A5.1.6#~builtin<compat/typescript>::version=5.1.6&hash=5da071"
11060+
bin:
11061+
tsc: bin/tsc
11062+
tsserver: bin/tsserver
11063+
checksum: f53bfe97f7c8b2b6d23cf572750d4e7d1e0c5fff1c36d859d0ec84556a827b8785077bc27676bf7e71fae538e517c3ecc0f37e7f593be913d884805d931bc8be
11064+
languageName: node
11065+
linkType: hard
11066+
1103311067
"typescript@patch:[email protected]#~builtin<compat/typescript>":
1103411068
version: 5.1.3
1103511069
resolution: "typescript@patch:typescript@npm%3A5.1.3#~builtin<compat/typescript>::version=5.1.3&hash=5da071"

0 commit comments

Comments
 (0)