Skip to content

Commit 057a17b

Browse files
authored
Merge pull request #293 from salesforcecli/devScripts2023-04-02
refactor: devScripts update
2 parents cf27283 + c163bdc commit 057a17b

File tree

3 files changed

+211
-567
lines changed

3 files changed

+211
-567
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ docs
3131
package.json.bak.
3232

3333
# -- CLEAN ALL
34+
*.tsbuildinfo
35+
.eslintcache
36+
.wireit
3437
node_modules
3538

3639
# --

package.json

+114-12
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"@oclif/plugin-version": "^1.2.0",
2020
"@salesforce/cli-plugins-testkit": "^3.3.0",
2121
"@salesforce/dev-config": "^3.1.0",
22-
"@salesforce/dev-scripts": "^3.1.1",
22+
"@salesforce/dev-scripts": "^4.1.3",
2323
"@salesforce/plugin-auth": "^2.7.7",
2424
"@salesforce/plugin-command-reference": "^2.4.1",
2525
"@salesforce/prettier-config": "^0.0.2",
@@ -47,7 +47,8 @@
4747
"shx": "0.3.4",
4848
"sinon": "^11.1.2",
4949
"ts-node": "^10.8.1",
50-
"typescript": "^4.9.4"
50+
"typescript": "^4.9.4",
51+
"wireit": "^0.9.5"
5152
},
5253
"config": {},
5354
"engines": {
@@ -132,28 +133,129 @@
132133
},
133134
"repository": "salesforcecli/plugin-packaging",
134135
"scripts": {
135-
"build": "sf-build",
136+
"build": "wireit",
136137
"clean": "sf-clean",
137138
"clean-all": "sf-clean all",
138139
"clean:lib": "shx rm -rf lib && shx rm -rf coverage && shx rm -rf .nyc_output && shx rm -f oclif.manifest.json",
139-
"compile": "sf-compile",
140-
"format": "sf-format",
141-
"lint": "sf-lint",
140+
"compile": "wireit",
141+
"format": "wireit",
142+
"lint": "wireit",
142143
"postpack": "shx rm -f oclif.manifest.json",
143-
"posttest": "yarn lint && yarn test:deprecation-policy && yarn test:json-schema && yarn test:command-reference",
144144
"prepack": "sf-prepack",
145145
"prepare": "sf-install",
146-
"pretest": "sf-compile-test",
147-
"test": "sf-test",
148-
"test:command-reference": "./bin/dev commandreference:generate --erroronwarnings",
149-
"test:deprecation-policy": "./bin/dev snapshot:compare",
146+
"test": "wireit",
150147
"test:nuts": "nyc mocha \"**/*.nut.ts\" --slow 4500 -t 1800000 --parallel --jobs 20",
151148
"test:nuts:package": "nyc mocha \"test/commands/package/*.nut.ts\" --slow 4500 --timeout 600000 --parallel --jobs 20",
152149
"test:nuts:package1": "nyc mocha \"test/commands/package1/*.nut.ts\" --slow 4500 --timeout 600000 --parallel --jobs 20",
153-
"test:json-schema": "./bin/dev schema:compare",
150+
"test:only": "wireit",
154151
"version": "oclif readme"
155152
},
156153
"publishConfig": {
157154
"access": "public"
155+
},
156+
"wireit": {
157+
"build": {
158+
"dependencies": [
159+
"compile",
160+
"lint"
161+
]
162+
},
163+
"compile": {
164+
"command": "tsc -p . --pretty --incremental",
165+
"files": [
166+
"src/**/*.ts",
167+
"**/tsconfig.json",
168+
"messages/**"
169+
],
170+
"output": [
171+
"lib/**",
172+
"*.tsbuildinfo"
173+
],
174+
"clean": "if-file-deleted"
175+
},
176+
"format": {
177+
"command": "prettier --write \"+(src|test|schemas)/**/*.+(ts|js|json)|command-snapshot.json\"",
178+
"files": [
179+
"src/**/*.ts",
180+
"test/**/*.ts",
181+
"schemas/**/*.json",
182+
"command-snapshot.json",
183+
".prettier*"
184+
],
185+
"output": []
186+
},
187+
"lint": {
188+
"command": "eslint src test --color --cache --cache-location .eslintcache",
189+
"files": [
190+
"src/**/*.ts",
191+
"test/**/*.ts",
192+
"messages/**",
193+
"**/.eslint*",
194+
"**/tsconfig.json"
195+
],
196+
"output": []
197+
},
198+
"test:compile": {
199+
"command": "tsc -p \"./test\" --pretty",
200+
"files": [
201+
"test/**/*.ts",
202+
"**/tsconfig.json"
203+
],
204+
"output": []
205+
},
206+
"test": {
207+
"dependencies": [
208+
"test:compile",
209+
"test:only",
210+
"test:command-reference",
211+
"test:deprecation-policy",
212+
"lint",
213+
"test:json-schema"
214+
]
215+
},
216+
"test:only": {
217+
"command": "nyc mocha \"test/**/*.test.ts\"",
218+
"env": {
219+
"FORCE_COLOR": "2"
220+
},
221+
"files": [
222+
"test/**/*.ts",
223+
"src/**/*.ts",
224+
"**/tsconfig.json",
225+
".mocha*",
226+
"!*.nut.ts",
227+
".nycrc"
228+
],
229+
"output": []
230+
},
231+
"test:command-reference": {
232+
"command": "\"./bin/dev\" commandreference:generate --erroronwarnings",
233+
"files": [
234+
"src/**/*.ts",
235+
"messages/**",
236+
"package.json"
237+
],
238+
"output": [
239+
"tmp/root"
240+
]
241+
},
242+
"test:deprecation-policy": {
243+
"command": "\"./bin/dev\" snapshot:compare",
244+
"files": [
245+
"src/**/*.ts"
246+
],
247+
"output": [],
248+
"dependencies": [
249+
"compile"
250+
]
251+
},
252+
"test:json-schema": {
253+
"command": "\"./bin/dev\" schema:compare",
254+
"files": [
255+
"src/**/*.ts",
256+
"schemas"
257+
],
258+
"output": []
259+
}
158260
}
159261
}

0 commit comments

Comments
 (0)