Skip to content

Commit 84aa073

Browse files
authored
chore: use wireit for managing npm scripts (#164)
1 parent 347857a commit 84aa073

File tree

3 files changed

+139
-128
lines changed

3 files changed

+139
-128
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ docs/_merged_assets/
1111
docs/_merged_includes/
1212
_site-dev
1313
_site
14+
.wireit

package.json

+99-20
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,26 @@
88
"node": "^14.13.1 || >=16.0.0"
99
},
1010
"scripts": {
11-
"analyze": "node scripts/workspaces-scripts-bin.js analyze",
12-
"build": "tsc --build",
13-
"copy": "cp docs/assets/* _site/assets",
14-
"dev": "npm run watch & npm run serve",
15-
"dist": "npm run fixtures && npm run analyze && rocket build && npm run copy",
16-
"fixtures": "node scripts/workspaces-scripts-bin.js analyze fixtures && cp fixtures/**/custom-elements.json docs/assets",
17-
"format": "npm-run-all --parallel format:*",
18-
"format:md": "prettier \"**/*.md\" --write",
19-
"format:package": "prettier \"**/package.json\" --write",
20-
"format:ts": "prettier \"**/*.ts\" --write",
21-
"lint": "npm-run-all --parallel lint:*",
22-
"lint:css": "stylelint packages/**/src/*.ts fixtures/**/src/*.ts",
23-
"lint:eslint": "eslint packages fixtures scripts",
24-
"lint:lit": "lit-analyzer packages/**/src/*.ts fixtures/**/src/*.ts --strict",
11+
"analyze": "wireit",
12+
"analyze:fixtures": "wireit",
13+
"build": "wireit",
14+
"clean": "wireit",
15+
"dev": "wireit",
16+
"dist": "wireit",
17+
"fixtures": "wireit",
18+
"format": "wireit",
19+
"format:md": "wireit",
20+
"format:package": "wireit",
21+
"format:ts": "wireit",
22+
"lint": "wireit",
23+
"lint:css": "wireit",
24+
"lint:eslint": "wireit",
25+
"lint:lit": "wireit",
2526
"release": "changeset publish && yarn format",
26-
"serve": "web-dev-server --node-resolve",
27-
"size": "node scripts/workspaces-scripts-bin.js size",
28-
"start": "rocket start",
27+
"size": "wireit",
28+
"start": "wireit",
2929
"update:tsconfigs": "node scripts/generate-ts-configs.js",
30-
"watch": "tsc-watch"
30+
"watch": "wireit"
3131
},
3232
"devDependencies": {
3333
"@changesets/cli": "^2.25.2",
@@ -51,7 +51,6 @@
5151
"eslint-plugin-wc": "^1.3.2",
5252
"lint-staged": "^13.0.3",
5353
"lit-analyzer": "^1.2.1",
54-
"npm-run-all": "^4.1.5",
5554
"picocolors": "^1.0.0",
5655
"postcss-lit": "^0.5.0",
5756
"prettier": "^2.7.1",
@@ -64,7 +63,8 @@
6463
"stylelint-config-prettier": "^9.0.4",
6564
"stylelint-config-standard": "^29.0.0",
6665
"tsc-watch": "^5.0.3",
67-
"typescript": "^4.9.3"
66+
"typescript": "^4.9.3",
67+
"wireit": "^0.8.0"
6868
},
6969
"resolutions": {
7070
"@mdjs/core": "^0.9.0",
@@ -100,6 +100,85 @@
100100
"simple-git-hooks": {
101101
"pre-commit": "npx lint-staged"
102102
},
103+
"wireit": {
104+
"analyze": {
105+
"command": "node scripts/workspaces-scripts-bin.js analyze"
106+
},
107+
"analyze:fixtures": {
108+
"command": "node scripts/workspaces-scripts-bin.js analyze fixtures"
109+
},
110+
"build": {
111+
"command": "tsc --build"
112+
},
113+
"clean": {
114+
"command": "rimraf _site"
115+
},
116+
"dev": {
117+
"command": "web-dev-server --node-resolve --open",
118+
"dependencies": [
119+
"watch"
120+
]
121+
},
122+
"dist": {
123+
"command": "rocket build && cp docs/assets/* _site/assets",
124+
"dependencies": [
125+
"clean",
126+
"analyze",
127+
"fixtures"
128+
]
129+
},
130+
"fixtures": {
131+
"command": "cp fixtures/**/custom-elements.json docs/assets",
132+
"dependencies": [
133+
"analyze:fixtures"
134+
]
135+
},
136+
"format:md": {
137+
"command": "prettier \"**/*.md\" --write"
138+
},
139+
"format:package": {
140+
"command": "prettier \"**/package.json\" --write"
141+
},
142+
"format:ts": {
143+
"command": "prettier \"**/*.ts\" --write"
144+
},
145+
"format": {
146+
"dependencies": [
147+
"format:md",
148+
"format:package",
149+
"format:ts"
150+
]
151+
},
152+
"lint:css": {
153+
"command": "stylelint packages/**/src/*.ts fixtures/**/src/*.ts"
154+
},
155+
"lint:eslint": {
156+
"command": "eslint packages fixtures scripts"
157+
},
158+
"lint:lit": {
159+
"command": "lit-analyzer packages/**/src/*.ts fixtures/**/src/*.ts --strict"
160+
},
161+
"lint": {
162+
"dependencies": [
163+
"lint:css",
164+
"lint:eslint",
165+
"lint:lit"
166+
]
167+
},
168+
"size": {
169+
"command": "node scripts/workspaces-scripts-bin.js size",
170+
"dependencies": [
171+
"build"
172+
]
173+
},
174+
"start": {
175+
"command": "rocket start"
176+
},
177+
"watch": {
178+
"command": "tsc-watch",
179+
"service": true
180+
}
181+
},
103182
"workspaces": [
104183
"packages/*",
105184
"fixtures/*"

0 commit comments

Comments
 (0)