Skip to content

Commit

Permalink
Refactor tsconfig.jsons, improve build perf
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed May 17, 2023
1 parent 641419e commit 7c46067
Show file tree
Hide file tree
Showing 48 changed files with 161 additions and 81 deletions.
8 changes: 2 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
.nyc_output/
coverage/
dist/
node_modules/
test/fixtures/
*.log
*.d.ts
.DS_Store
micromark.min.js
yarn.lock
Expand All @@ -26,7 +24,5 @@ packages/micromark-util-decode-string/index.js
packages/micromark-util-normalize-identifier/index.js
packages/micromark-util-sanitize-uri/index.js
packages/micromark-util-subtokenize/index.js
packages/**/*.d.ts
script/**/*.d.ts
test/**/*.d.ts
test/fixtures/
test/fuzz-bundle.cjs
7 changes: 2 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,12 @@
"xo": "^0.54.0"
},
"scripts": {
"build-workspace": "npm run build --workspaces && cp readme.md packages/micromark/readme.md",
"build-monorepo": "node script/generate-expressions.js && rimraf \"{script/**,test/**}/*.d.ts\" && rimraf \"{script/**,test/**}/*.d.ts\" && tsc && type-coverage",
"build-size": "rollup -c --silent && gzip-size micromark.min.js && gzip-size --raw micromark.min.js",
"build": "npm run build-workspace && npm run build-monorepo && npm run build-size",
"build": "node script/generate-expressions.js && tsc --build --clean && tsc && type-coverage && npm run build --workspaces --if-present && cp readme.md packages/micromark/readme.md && rollup -c --silent && gzip-size micromark.min.js && gzip-size --raw micromark.min.js",
"format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix",
"pretest-fuzz": "esbuild micromark --format=cjs --platform=node --bundle > test/fuzz-bundle.cjs && node script/generate-fixtures.js",
"test-fuzz": "jazzer test/fuzz.cjs test/fixtures -- -max_total_time=1800",
"test-api": "node --conditions development test/index.js",
"test-coverage": "c8 --check-coverage --lines 100 --functions 100 --branches 100 --reporter lcov node --conditions development test/index.js",
"test-coverage": "c8 --100 --reporter lcov npm run test-api",
"test": "npm run build && npm run format && npm run test-coverage"
},
"prettier": {
Expand Down
4 changes: 1 addition & 3 deletions packages/micromark-build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@
"glob": "^8.0.0",
"import-meta-resolve": "^2.0.0"
},
"scripts": {
"build": "rimraf \"*.d.ts\" \"{dev/,lib/}**/*.d.ts\" && tsc && type-coverage"
},
"scripts": {},
"xo": false,
"typeCoverage": {
"atLeast": 100,
Expand Down
3 changes: 1 addition & 2 deletions packages/micromark-build/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{
"extends": "../../tsconfig.json",
"include": ["index.js"]
"extends": "../../tsconfig.json"
}
2 changes: 1 addition & 1 deletion packages/micromark-core-commonmark/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"uvu": "^0.5.0"
},
"scripts": {
"build": "rimraf \"*.d.ts\" \"{dev/,lib/}**/*.d.ts\" && tsc && micromark-build && type-coverage"
"build": "micromark-build"
},
"xo": false,
"typeCoverage": {
Expand Down
17 changes: 16 additions & 1 deletion packages/micromark-core-commonmark/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
{
"extends": "../../tsconfig.json",
"include": ["dev/**/*.js"]
"references": [
{"path": "../micromark-factory-destination/"},
{"path": "../micromark-factory-label/"},
{"path": "../micromark-factory-space/"},
{"path": "../micromark-factory-title/"},
{"path": "../micromark-factory-whitespace/"},
{"path": "../micromark-util-character/"},
{"path": "../micromark-util-chunked/"},
{"path": "../micromark-util-classify-character/"},
{"path": "../micromark-util-html-tag-name/"},
{"path": "../micromark-util-normalize-identifier/"},
{"path": "../micromark-util-resolve-all/"},
{"path": "../micromark-util-subtokenize/"},
{"path": "../micromark-util-symbol/"},
{"path": "../micromark-util-types/"}
]
}
2 changes: 1 addition & 1 deletion packages/micromark-factory-destination/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"micromark-util-types": "^1.0.0"
},
"scripts": {
"build": "rimraf \"*.d.ts\" \"{dev/,lib/}**/*.d.ts\" && tsc && micromark-build && type-coverage"
"build": "micromark-build"
},
"xo": false,
"typeCoverage": {
Expand Down
6 changes: 5 additions & 1 deletion packages/micromark-factory-destination/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
"extends": "../../tsconfig.json",
"include": ["dev/**/*.js"]
"references": [
{"path": "../micromark-util-character/"},
{"path": "../micromark-util-symbol/"},
{"path": "../micromark-util-types/"}
]
}
2 changes: 1 addition & 1 deletion packages/micromark-factory-label/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"uvu": "^0.5.0"
},
"scripts": {
"build": "rimraf \"*.d.ts\" \"{dev/,lib/}**/*.d.ts\" && tsc && micromark-build && type-coverage"
"build": "micromark-build"
},
"xo": false,
"typeCoverage": {
Expand Down
6 changes: 5 additions & 1 deletion packages/micromark-factory-label/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
"extends": "../../tsconfig.json",
"include": ["dev/**/*.js"]
"references": [
{"path": "../micromark-util-character/"},
{"path": "../micromark-util-symbol/"},
{"path": "../micromark-util-types/"}
]
}
2 changes: 1 addition & 1 deletion packages/micromark-factory-space/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"micromark-util-types": "^1.0.0"
},
"scripts": {
"build": "rimraf \"*.d.ts\" \"{dev/,lib/}**/*.d.ts\" && tsc && micromark-build && type-coverage"
"build": "micromark-build"
},
"xo": false,
"typeCoverage": {
Expand Down
5 changes: 4 additions & 1 deletion packages/micromark-factory-space/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"extends": "../../tsconfig.json",
"include": ["dev/**/*.js"]
"references": [
{"path": "../micromark-util-character/"},
{"path": "../micromark-util-types/"}
]
}
2 changes: 1 addition & 1 deletion packages/micromark-factory-title/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"uvu": "^0.5.0"
},
"scripts": {
"build": "rimraf \"*.d.ts\" \"{dev/,lib/}**/*.d.ts\" && tsc && micromark-build && type-coverage"
"build": "micromark-build"
},
"xo": false,
"typeCoverage": {
Expand Down
7 changes: 6 additions & 1 deletion packages/micromark-factory-title/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{
"extends": "../../tsconfig.json",
"include": ["dev/**/*.js"]
"references": [
{"path": "../micromark-factory-space/"},
{"path": "../micromark-util-character/"},
{"path": "../micromark-util-symbol/"},
{"path": "../micromark-util-types/"}
]
}
2 changes: 1 addition & 1 deletion packages/micromark-factory-whitespace/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"micromark-util-types": "^1.0.0"
},
"scripts": {
"build": "rimraf \"*.d.ts\" \"{dev/,lib/}**/*.d.ts\" && tsc && micromark-build && type-coverage"
"build": "micromark-build"
},
"xo": false,
"typeCoverage": {
Expand Down
7 changes: 6 additions & 1 deletion packages/micromark-factory-whitespace/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{
"extends": "../../tsconfig.json",
"include": ["dev/**/*.js"]
"references": [
{"path": "../micromark-factory-space/"},
{"path": "../micromark-util-character/"},
{"path": "../micromark-util-symbol/"},
{"path": "../micromark-util-types/"}
]
}
2 changes: 1 addition & 1 deletion packages/micromark-util-character/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"micromark-util-types": "^1.0.0"
},
"scripts": {
"build": "rimraf \"*.d.ts\" \"{dev/,lib/}**/*.d.ts\" && tsc && micromark-build && type-coverage"
"build": "micromark-build"
},
"xo": false,
"typeCoverage": {
Expand Down
5 changes: 4 additions & 1 deletion packages/micromark-util-character/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"extends": "../../tsconfig.json",
"include": ["dev/**/*.js"]
"references": [
{"path": "../micromark-util-symbol/"},
{"path": "../micromark-util-types/"}
]
}
2 changes: 1 addition & 1 deletion packages/micromark-util-chunked/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"micromark-util-symbol": "^1.0.0"
},
"scripts": {
"build": "rimraf \"*.d.ts\" \"{dev/,lib/}**/*.d.ts\" && tsc && micromark-build && type-coverage"
"build": "micromark-build"
},
"xo": false,
"typeCoverage": {
Expand Down
2 changes: 1 addition & 1 deletion packages/micromark-util-chunked/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"extends": "../../tsconfig.json",
"include": ["dev/**/*.js"]
"references": [{"path": "../micromark-util-symbol/"}]
}
2 changes: 1 addition & 1 deletion packages/micromark-util-classify-character/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"micromark-util-types": "^1.0.0"
},
"scripts": {
"build": "rimraf \"*.d.ts\" \"{dev/,lib/}**/*.d.ts\" && tsc && micromark-build && type-coverage"
"build": "micromark-build"
},
"xo": false,
"typeCoverage": {
Expand Down
6 changes: 5 additions & 1 deletion packages/micromark-util-classify-character/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
"extends": "../../tsconfig.json",
"include": ["dev/**/*.js"]
"references": [
{"path": "../micromark-util-character/"},
{"path": "../micromark-util-symbol/"},
{"path": "../micromark-util-types/"}
]
}
4 changes: 1 addition & 3 deletions packages/micromark-util-combine-extensions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@
"micromark-util-chunked": "^1.0.0",
"micromark-util-types": "^1.0.0"
},
"scripts": {
"build": "rimraf \"*.d.ts\" && tsc && type-coverage"
},
"scripts": {},
"xo": false,
"typeCoverage": {
"atLeast": 100,
Expand Down
5 changes: 4 additions & 1 deletion packages/micromark-util-combine-extensions/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"extends": "../../tsconfig.json",
"include": ["*.js"]
"references": [
{"path": "../micromark-util-chunked/"},
{"path": "../micromark-util-types/"}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"micromark-util-symbol": "^1.0.0"
},
"scripts": {
"build": "rimraf \"*.d.ts\" \"{dev/,lib/}**/*.d.ts\" && tsc && micromark-build && type-coverage"
"build": "micromark-build"
},
"xo": false,
"typeCoverage": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"extends": "../../tsconfig.json",
"include": ["dev/**/*.js"]
"references": [{"path": "../micromark-util-symbol/"}]
}
2 changes: 1 addition & 1 deletion packages/micromark-util-decode-string/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"decode-named-character-reference": "^1.0.0"
},
"scripts": {
"build": "rimraf \"*.d.ts\" \"{dev/,lib/}**/*.d.ts\" && tsc && micromark-build && type-coverage"
"build": "micromark-build"
},
"xo": false,
"typeCoverage": {
Expand Down
6 changes: 5 additions & 1 deletion packages/micromark-util-decode-string/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
"extends": "../../tsconfig.json",
"include": ["dev/**/*.js"]
"references": [
{"path": "../micromark-util-character/"},
{"path": "../micromark-util-decode-numeric-character-reference/"},
{"path": "../micromark-util-symbol/"}
]
}
4 changes: 1 addition & 3 deletions packages/micromark-util-encode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@
"index.js"
],
"exports": "./index.js",
"scripts": {
"build": "rimraf \"*.d.ts\" && tsc && type-coverage"
},
"scripts": {},
"xo": false,
"typeCoverage": {
"atLeast": 100,
Expand Down
3 changes: 1 addition & 2 deletions packages/micromark-util-encode/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{
"extends": "../../tsconfig.json",
"include": ["*.js"]
"extends": "../../tsconfig.json"
}
4 changes: 1 addition & 3 deletions packages/micromark-util-html-tag-name/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@
"index.js"
],
"exports": "./index.js",
"scripts": {
"build": "rimraf \"*.d.ts\" && tsc && type-coverage"
},
"scripts": {},
"xo": false,
"typeCoverage": {
"atLeast": 100,
Expand Down
3 changes: 1 addition & 2 deletions packages/micromark-util-html-tag-name/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{
"extends": "../../tsconfig.json",
"include": ["*.js"]
"extends": "../../tsconfig.json"
}
2 changes: 1 addition & 1 deletion packages/micromark-util-normalize-identifier/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"micromark-util-symbol": "^1.0.0"
},
"scripts": {
"build": "rimraf \"*.d.ts\" \"{dev/,lib/}**/*.d.ts\" && tsc && micromark-build && type-coverage"
"build": "micromark-build"
},
"xo": false,
"typeCoverage": {
Expand Down
2 changes: 1 addition & 1 deletion packages/micromark-util-normalize-identifier/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"extends": "../../tsconfig.json",
"include": ["dev/**/*.js"]
"references": [{"path": "../micromark-util-symbol/"}]
}
4 changes: 1 addition & 3 deletions packages/micromark-util-resolve-all/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@
"dependencies": {
"micromark-util-types": "^1.0.0"
},
"scripts": {
"build": "rimraf \"*.d.ts\" && tsc && type-coverage"
},
"scripts": {},
"xo": false,
"typeCoverage": {
"atLeast": 100,
Expand Down
2 changes: 1 addition & 1 deletion packages/micromark-util-resolve-all/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"extends": "../../tsconfig.json",
"include": ["*.js"]
"references": [{"path": "../micromark-util-types/"}]
}
2 changes: 1 addition & 1 deletion packages/micromark-util-sanitize-uri/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"micromark-util-symbol": "^1.0.0"
},
"scripts": {
"build": "rimraf \"*.d.ts\" \"{dev/,lib/}**/*.d.ts\" && tsc && micromark-build && type-coverage"
"build": "micromark-build"
},
"xo": false,
"typeCoverage": {
Expand Down
6 changes: 5 additions & 1 deletion packages/micromark-util-sanitize-uri/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
"extends": "../../tsconfig.json",
"include": ["dev/**/*.js"]
"references": [
{"path": "../micromark-util-character/"},
{"path": "../micromark-util-encode/"},
{"path": "../micromark-util-symbol/"}
]
}
2 changes: 1 addition & 1 deletion packages/micromark-util-subtokenize/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"uvu": "^0.5.0"
},
"scripts": {
"build": "rimraf \"*.d.ts\" \"{dev/,lib/}**/*.d.ts\" && tsc && micromark-build && type-coverage"
"build": "micromark-build"
},
"xo": false,
"typeCoverage": {
Expand Down
6 changes: 5 additions & 1 deletion packages/micromark-util-subtokenize/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
"extends": "../../tsconfig.json",
"include": ["dev/**/*.js"]
"references": [
{"path": "../micromark-util-chunked/"},
{"path": "../micromark-util-symbol/"},
{"path": "../micromark-util-types/"}
]
}
Loading

0 comments on commit 7c46067

Please sign in to comment.