Skip to content

Commit b9a5179

Browse files
mshanemcpeternhale
andauthored
chore: strict nulls
* refactor: ts strict null checks and linter updates * test: null handling * test: null handling on tests * test: make watchable * test: eslint cleanup and test linting * test: more test null handling * refactor: ts fighting kit * chore: schema update from FileResponse exports * chore: dep bump * chore: bump deps * fix: don't default an dependsOn flag * refactor: restore default for zip-file-name * refactor: default in one place * refactor: Apply suggestions from code review Co-authored-by: peternhale <[email protected]> * fix: correct type guard from our ts-types Co-authored-by: peternhale <[email protected]>
1 parent cd607bd commit b9a5179

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1236
-1896
lines changed

.mocharc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"require": "ts-node/register,source-map-support/register",
33
"watch-extensions": "ts",
4+
"watch-files": ["src", "test"],
45
"recursive": true,
56
"reporter": "spec",
67
"timeout": 5000

package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@
55
"author": "Salesforce",
66
"bugs": "https://github.com/forcedotcom/cli/issues",
77
"dependencies": {
8-
"@oclif/core": "^1.16.0",
9-
"@salesforce/core": "^3.32.2",
10-
"@salesforce/kit": "^1.7.0",
11-
"@salesforce/sf-plugins-core": "1.21.0",
12-
"@salesforce/source-deploy-retrieve": "^7.5.22",
8+
"@oclif/core": "^1.23.2",
9+
"@salesforce/core": "^3.32.12",
10+
"@salesforce/kit": "^1.8.2",
11+
"@salesforce/sf-plugins-core": "^1.21.8",
12+
"@salesforce/source-deploy-retrieve": "^7.6.0",
1313
"@salesforce/source-tracking": "^2.2.17",
1414
"chalk": "^4.1.2",
1515
"fs-extra": "^10.0.1",
1616
"shelljs": "^0.8.5",
1717
"tslib": "^2"
1818
},
1919
"devDependencies": {
20-
"@oclif/plugin-command-snapshot": "^3.2.11",
21-
"@salesforce/cli-plugins-testkit": "^3.2.14",
20+
"@oclif/plugin-command-snapshot": "^3.2.16",
21+
"@salesforce/cli-plugins-testkit": "^3.2.17",
2222
"@salesforce/dev-config": "^3.1.0",
2323
"@salesforce/dev-scripts": "^3.1.0",
2424
"@salesforce/plugin-command-reference": "^2.2.8",
@@ -35,8 +35,8 @@
3535
"@types/archiver": "^5.3.1",
3636
"@types/fs-extra": "^9.0.13",
3737
"@types/shelljs": "^0.8.11",
38-
"@typescript-eslint/eslint-plugin": "^5.43.0",
39-
"@typescript-eslint/parser": "^5.47.0",
38+
"@typescript-eslint/eslint-plugin": "^5.47.1",
39+
"@typescript-eslint/parser": "^5.47.1",
4040
"archiver": "^5.3.1",
4141
"chai": "^4.3.7",
4242
"cross-env": "^7.0.3",
@@ -48,7 +48,7 @@
4848
"eslint-plugin-header": "^3.1.1",
4949
"eslint-plugin-import": "^2.26.0",
5050
"eslint-plugin-jsdoc": "^39.6.2",
51-
"eslint-plugin-sf-plugin": "^0.3.0",
51+
"eslint-plugin-sf-plugin": "^1.3.1",
5252
"husky": "^7.0.4",
5353
"mocha": "^10.1.0",
5454
"nyc": "^15.1.0",

schemas/deploy-metadata-cancel.json

Lines changed: 74 additions & 173 deletions
Original file line numberDiff line numberDiff line change
@@ -124,89 +124,69 @@
124124
"FileResponse": {
125125
"anyOf": [
126126
{
127-
"type": "object",
128-
"properties": {
129-
"fullName": {
130-
"type": "string"
131-
},
132-
"type": {
133-
"type": "string"
134-
},
135-
"filePath": {
136-
"type": "string"
137-
},
138-
"state": {
139-
"type": "string",
140-
"enum": [
141-
"Created",
142-
"Changed",
143-
"Unchanged",
144-
"Deleted"
145-
]
146-
}
147-
},
148-
"required": [
149-
"fullName",
150-
"state",
151-
"type"
152-
],
153-
"additionalProperties": false
127+
"$ref": "#/definitions/FileResponseSuccess"
154128
},
155129
{
156-
"type": "object",
157-
"properties": {
158-
"fullName": {
159-
"type": "string"
160-
},
161-
"type": {
162-
"type": "string"
163-
},
164-
"filePath": {
165-
"type": "string"
166-
},
167-
"state": {
168-
"type": "string",
169-
"const": "Failed"
170-
},
171-
"lineNumber": {
172-
"type": "number"
173-
},
174-
"columnNumber": {
175-
"type": "number"
176-
},
177-
"error": {
178-
"type": "string"
179-
},
180-
"problemType": {
181-
"type": "string",
182-
"enum": [
183-
"Warning",
184-
"Error"
185-
]
186-
}
187-
},
188-
"required": [
189-
"error",
190-
"fullName",
191-
"problemType",
192-
"state",
193-
"type"
194-
],
195-
"additionalProperties": false
130+
"$ref": "#/definitions/FileResponseFailure"
196131
}
197132
]
198133
},
134+
"FileResponseSuccess": {
135+
"type": "object",
136+
"properties": {
137+
"fullName": {
138+
"type": "string"
139+
},
140+
"type": {
141+
"type": "string"
142+
},
143+
"filePath": {
144+
"type": "string"
145+
},
146+
"state": {
147+
"type": "string",
148+
"enum": ["Created", "Changed", "Unchanged", "Deleted"]
149+
}
150+
},
151+
"required": ["fullName", "state", "type"],
152+
"additionalProperties": false
153+
},
154+
"FileResponseFailure": {
155+
"type": "object",
156+
"properties": {
157+
"fullName": {
158+
"type": "string"
159+
},
160+
"type": {
161+
"type": "string"
162+
},
163+
"filePath": {
164+
"type": "string"
165+
},
166+
"state": {
167+
"type": "string",
168+
"const": "Failed"
169+
},
170+
"lineNumber": {
171+
"type": "number"
172+
},
173+
"columnNumber": {
174+
"type": "number"
175+
},
176+
"error": {
177+
"type": "string"
178+
},
179+
"problemType": {
180+
"type": "string",
181+
"enum": ["Warning", "Error"]
182+
}
183+
},
184+
"required": ["error", "fullName", "problemType", "state", "type"],
185+
"additionalProperties": false
186+
},
199187
"RequestStatus": {
200188
"type": "string",
201-
"enum": [
202-
"Pending",
203-
"InProgress",
204-
"Succeeded",
205-
"SucceededPartial",
206-
"Failed",
207-
"Canceling",
208-
"Canceled"
209-
]
189+
"enum": ["Pending", "InProgress", "Succeeded", "SucceededPartial", "Failed", "Canceling", "Canceled"]
210190
},
211191
"DeployDetails": {
212192
"type": "object",
@@ -247,16 +227,8 @@
247227
"type": "object",
248228
"properties": {
249229
"changed": {
250-
"type": [
251-
"string",
252-
"boolean"
253-
],
254-
"enum": [
255-
"true",
256-
"false",
257-
true,
258-
false
259-
]
230+
"type": ["string", "boolean"],
231+
"enum": ["true", "false", true, false]
260232
},
261233
"columnNumber": {
262234
"type": "string"
@@ -265,31 +237,15 @@
265237
"type": "string"
266238
},
267239
"created": {
268-
"type": [
269-
"string",
270-
"boolean"
271-
],
272-
"enum": [
273-
"true",
274-
"false",
275-
true,
276-
false
277-
]
240+
"type": ["string", "boolean"],
241+
"enum": ["true", "false", true, false]
278242
},
279243
"createdDate": {
280244
"type": "string"
281245
},
282246
"deleted": {
283-
"type": [
284-
"string",
285-
"boolean"
286-
],
287-
"enum": [
288-
"true",
289-
"false",
290-
true,
291-
false
292-
]
247+
"type": ["string", "boolean"],
248+
"enum": ["true", "false", true, false]
293249
},
294250
"fileName": {
295251
"type": "string"
@@ -308,33 +264,14 @@
308264
},
309265
"problemType": {
310266
"type": "string",
311-
"enum": [
312-
"Warning",
313-
"Error"
314-
]
267+
"enum": ["Warning", "Error"]
315268
},
316269
"success": {
317-
"type": [
318-
"string",
319-
"boolean"
320-
],
321-
"enum": [
322-
"true",
323-
"false",
324-
true,
325-
false
326-
]
270+
"type": ["string", "boolean"],
271+
"enum": ["true", "false", true, false]
327272
}
328273
},
329-
"required": [
330-
"changed",
331-
"created",
332-
"createdDate",
333-
"deleted",
334-
"fileName",
335-
"fullName",
336-
"success"
337-
],
274+
"required": ["changed", "created", "createdDate", "deleted", "fileName", "fullName", "success"],
338275
"additionalProperties": false
339276
},
340277
"RunTestResult": {
@@ -402,11 +339,7 @@
402339
"type": "string"
403340
}
404341
},
405-
"required": [
406-
"numFailures",
407-
"numTestsRun",
408-
"totalTime"
409-
],
342+
"required": ["numFailures", "numTestsRun", "totalTime"],
410343
"additionalProperties": false
411344
},
412345
"CodeCoverage": {
@@ -441,13 +374,7 @@
441374
"type": "string"
442375
}
443376
},
444-
"required": [
445-
"id",
446-
"name",
447-
"numLocations",
448-
"numLocationsNotCovered",
449-
"type"
450-
],
377+
"required": ["id", "name", "numLocations", "numLocationsNotCovered", "type"],
451378
"additionalProperties": false
452379
},
453380
"LocationsNotCovered": {
@@ -466,12 +393,7 @@
466393
"type": "string"
467394
}
468395
},
469-
"required": [
470-
"column",
471-
"line",
472-
"numExecutions",
473-
"time"
474-
],
396+
"required": ["column", "line", "numExecutions", "time"],
475397
"additionalProperties": false
476398
},
477399
"CodeCoverageWarnings": {
@@ -487,11 +409,7 @@
487409
"type": "string"
488410
}
489411
},
490-
"required": [
491-
"id",
492-
"message",
493-
"namespace"
494-
],
412+
"required": ["id", "message", "namespace"],
495413
"additionalProperties": false
496414
},
497415
"Failures": {
@@ -522,16 +440,7 @@
522440
"type": "string"
523441
}
524442
},
525-
"required": [
526-
"id",
527-
"message",
528-
"methodName",
529-
"name",
530-
"packageName",
531-
"stackTrace",
532-
"time",
533-
"type"
534-
],
443+
"required": ["id", "message", "methodName", "name", "packageName", "stackTrace", "time", "type"],
535444
"additionalProperties": false
536445
},
537446
"Successes": {
@@ -550,12 +459,7 @@
550459
"type": "string"
551460
}
552461
},
553-
"required": [
554-
"id",
555-
"methodName",
556-
"name",
557-
"time"
558-
],
462+
"required": ["id", "methodName", "name", "time"],
559463
"additionalProperties": false
560464
},
561465
"AsyncDeployResultJson": {
@@ -655,10 +559,7 @@
655559
"type": "boolean"
656560
}
657561
},
658-
"required": [
659-
"files",
660-
"status"
661-
]
562+
"required": ["files", "status"]
662563
}
663564
}
664-
}
565+
}

0 commit comments

Comments
 (0)