Skip to content

Commit 9eb2508

Browse files
committedJun 23, 2023
Clean up configs
1 parent 8d8e1a2 commit 9eb2508

17 files changed

+40
-331
lines changed
 

‎configs/babel-jest.config.json

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"rootDir": "..",
3+
"testRegex": "src/.*\\.test\\.ts$",
4+
"transform": {
5+
"^.+\\.tsx?$": ["babel-jest", { "configFile": "./configs/babel.config.js" }]
6+
},
7+
"modulePathIgnorePatterns": ["language-server", "__vitest__"],
8+
"moduleFileExtensions": ["ts", "tsx", "js", "jsx", "json", "node"],
9+
"coverageReporters": ["json-summary", "text", "lcov"]
10+
}
File renamed without changes.

‎jest.config.json ‎configs/jest.config.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
{
2-
"rootDir": ".",
2+
"rootDir": "..",
3+
"transform": {
4+
"^.+\\.tsx?$": "ts-jest"
5+
},
36
"testRegex": "src/.*\\.test\\.ts$",
47
"modulePathIgnorePatterns": ["language-server", "__vitest__"],
58
"moduleFileExtensions": ["ts", "tsx", "js", "jsx", "json", "node"],

‎rollup.config.js ‎configs/rollup.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export default [
2121
],
2222
plugins: [
2323
typescript({
24-
tsconfig: "tsconfig.esm.json",
24+
tsconfig: "./configs/tsconfig.esm.json",
2525
sourceMap: false,
2626
}),
2727
],

‎swc-jest.config.json ‎configs/swc-jest.config.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"rootDir": ".",
2+
"rootDir": "..",
33
"transform": {
44
"^.+\\.(t|j)sx?$": "@swc/jest"
55
},

‎ts-jest.config.json ‎configs/ts-jest.config.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"rootDir": ".",
2+
"rootDir": "..",
33
"transform": {
44
"^.+\\.tsx?$": "ts-jest"
55
},
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
{
22
"compilerOptions": {
3-
"lib": [
4-
"es5",
5-
"es6",
6-
"es7",
7-
"esnext",
8-
"dom"
9-
],
3+
"lib": ["es5", "es6", "es7", "esnext", "dom"],
104
"target": "es2018",
115
"removeComments": false,
126
"esModuleInterop": true,
@@ -22,9 +16,5 @@
2216
"downlevelIteration": true,
2317
"isolatedModules": true
2418
},
25-
"include": [
26-
"./src/**/*",
27-
"playground.ts",
28-
"./.eslintrc.js"
29-
]
30-
}
19+
"include": ["../src/**/*", "../playground.ts", "../.eslintrc.js"]
20+
}

‎tsconfig.cjs.json ‎configs/tsconfig.cjs.json

+3-6
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,11 @@
22
"extends": "./tsconfig.base.json",
33
"compilerOptions": {
44
"module": "commonjs",
5-
"outDir": "lib",
5+
"outDir": "../lib",
66
"declaration": true,
77
"declarationMap": false,
88
"sourceMap": false,
99
"removeComments": true
1010
},
11-
"exclude": [
12-
"./src/**/__tests__",
13-
"playground.ts"
14-
]
15-
}
11+
"exclude": ["../src/**/__tests__", "../playground.ts"]
12+
}

‎tsconfig.esm.json ‎configs/tsconfig.esm.json

+1-4
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,5 @@
77
"declarationMap": false,
88
"sourceMap": false
99
},
10-
"exclude": [
11-
"./src/**/__tests__",
12-
"./src/playground.ts"
13-
]
10+
"exclude": ["../src/**/__tests__", "../src/playground.ts"]
1411
}

‎tsconfig.test.json ‎configs/tsconfig.test.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"target": "es5",
77
"declaration": true,
88
"declarationMap": false,
9-
"sourceMap": false
9+
"sourceMap": false,
10+
"noEmit": true
1011
},
1112
"exclude": []
1213
}
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
{
22
"extends": "./tsconfig.base.json",
33
"compilerOptions": {
4-
"outDir": "./lib/types",
4+
"outDir": "../lib/types",
55
"declaration": true,
66
"declarationMap": true,
77
"emitDeclarationOnly": true
88
},
9-
"exclude": [
10-
"./src/**/__tests__",
11-
"./src/playground.ts"
12-
]
9+
"exclude": ["../src/**/__tests__", "../src/playground.ts"]
1310
}

‎vitest.config.ts ‎configs/vitest.config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default defineConfig({
55
alias: {
66
"@jest/globals": "vitest",
77
},
8-
include: ["**/*.test.ts"],
8+
include: ["src/**/*.test.ts"],
99
isolate: false,
1010
watch: false,
1111
},

‎deno/lib/__tests__/language-server.source.ts

-76
This file was deleted.

‎deno/lib/__tests__/language-server.test.ts

-209
This file was deleted.

‎package.json

+9-10
Original file line numberDiff line numberDiff line change
@@ -90,18 +90,17 @@
9090
"clean": "rm -rf lib/* deno/lib/*",
9191
"build": "yarn run clean && npm run build:cjs && npm run build:esm && npm run build:deno",
9292
"build:deno": "node ./deno-build.mjs && cp ./README.md ./deno/lib",
93-
"build:esm": "rollup --config rollup.config.js",
94-
"build:cjs": "tsc -p tsconfig.cjs.json",
95-
"build:types": "tsc -p tsconfig.types.json",
96-
"build:test": "tsc -p tsconfig.test.json",
97-
"rollup": "rollup --config rollup.config.js",
98-
"test:watch": "jest --watch",
93+
"build:esm": "rollup --config ./configs/rollup.config.js",
94+
"build:cjs": "tsc -p ./configs/tsconfig.cjs.json",
95+
"build:types": "tsc -p ./configs/tsconfig.types.json",
96+
"build:test": "tsc -p ./configs/tsconfig.test.json",
97+
"test:watch": "yarn test:ts-jest --watch",
9998
"test": "yarn test:ts-jest",
100-
"test:babel": "jest --coverage",
99+
"test:babel": "jest --coverage --config ./configs/babel-jest.config.json",
101100
"test:bun": "bun test",
102-
"test:vitest": "npx vitest --no-isolate",
103-
"test:ts-jest": "npx jest --config ./ts-jest.config.json",
104-
"test:swc": "npx jest --config ./swc-jest.config.json",
101+
"test:vitest": "npx vitest --config ./configs/vitest.config.ts",
102+
"test:ts-jest": "npx jest --config ./configs/ts-jest.config.json",
103+
"test:swc": "npx jest --config ./configs/swc-jest.config.json",
105104
"test:deno": "cd deno && deno test",
106105
"prepublishOnly": "npm run test && npm run build && npm run build:deno",
107106
"play": "nodemon -e ts -w . -x tsx playground.ts",

‎src/__tests__/language-server.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// @ts-ignore TS6133
2-
import { expect, test, describe } from "@jest/globals";
2+
import { describe, expect, test } from "@jest/globals";
33
// import path from "path";
44
// import { Node, Project, SyntaxKind } from "ts-morph";
55

‎tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"extends": "./tsconfig.base.json"
2+
"extends": "./configs/tsconfig.base.json"
33
}

0 commit comments

Comments
 (0)
Please sign in to comment.