Skip to content

Commit 459d3f6

Browse files
committed
chore: fix overload to avoid having to call with either true/false
1 parent b4f5638 commit 459d3f6

File tree

5 files changed

+1019
-1000
lines changed

5 files changed

+1019
-1000
lines changed

package.json

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
"bugs": "https://github.com/forcedotcom/cli/issues",
88
"dependencies": {
99
"@oclif/core": "^2.3.0",
10-
"@salesforce/core": "^3.33.2",
10+
"@salesforce/core": "^3.33.4",
1111
"@salesforce/kit": "^1.9.0",
1212
"@salesforce/sf-plugins-core": "^2.2.1",
13-
"open": "8.4.1",
13+
"open": "8.4.2",
1414
"tslib": "^2"
1515
},
1616
"devDependencies": {
17-
"@oclif/plugin-command-snapshot": "^3.3.4",
17+
"@oclif/plugin-command-snapshot": "^3.3.6",
1818
"@salesforce/cli-plugins-testkit": "^3.2.21",
1919
"@salesforce/dev-config": "^3.1.0",
2020
"@salesforce/dev-scripts": "^4.0.0-beta.9",
@@ -24,8 +24,8 @@
2424
"@swc/core": "^1.3.36",
2525
"@types/chai-as-promised": "^7.1.5",
2626
"@types/shelljs": "^0.8.10",
27-
"@typescript-eslint/eslint-plugin": "^5.42.1",
28-
"@typescript-eslint/parser": "^5.46.0",
27+
"@typescript-eslint/eslint-plugin": "^5.53.0",
28+
"@typescript-eslint/parser": "^5.53.0",
2929
"chai": "^4.3.7",
3030
"chai-as-promised": "^7.1.1",
3131
"eslint": "^8.33.0",
@@ -41,14 +41,14 @@
4141
"mocha": "^9.1.3",
4242
"moment": "^2.29.1",
4343
"nyc": "^15.1.0",
44-
"oclif": "^3.6.5",
44+
"oclif": "^3.7.0",
4545
"prettier": "^2.8.4",
4646
"pretty-quick": "^3.1.0",
4747
"shelljs": "^0.8.5",
4848
"shx": "0.3.4",
4949
"sinon": "10.0.0",
5050
"ts-node": "^10.9.1",
51-
"typescript": "^4.9.4",
51+
"typescript": "^4.9.5",
5252
"wireit": "^0.9.5"
5353
},
5454
"engines": {
@@ -115,10 +115,6 @@
115115
"prepack": "sf-prepack",
116116
"prepare": "sf-install",
117117
"test": "wireit",
118-
"test:command-reference": "wireit",
119-
"test:compile": "wireit",
120-
"test:deprecation-policy": "wireit",
121-
"test:json-schema": "wireit",
122118
"test:nuts": "nyc mocha \"./test/nut/*.nut.ts\" --slow 4500 --timeout 1200000 --parallel --jobs 10",
123119
"test:nuts:legacy": "nyc mocha \"./test/nut/legacy/*.nut.ts\" --slow 4500 --timeout 1200000 --parallel --jobs 10",
124120
"test:nuts:sandbox": "nyc mocha \"./test/**/*.sandboxNut.ts\" --slow 450000 --timeout 7200000 --parallel --jobs 10",
@@ -150,16 +146,23 @@
150146
"clean": "if-file-deleted"
151147
},
152148
"format": {
153-
"command": "prettier --write \"+(src|test|schemas)/**/*.+(ts|js|json)|command-snapshot.json\""
149+
"command": "prettier --write \"+(src|test|schemas)/**/*.+(ts|js|json)|command-snapshot.json\"",
150+
"files": [
151+
"src/**/*.ts",
152+
"test/**/*.ts",
153+
"schemas/**/*.json",
154+
"command-snapshot.json",
155+
".prettier*"
156+
],
157+
"output": []
154158
},
155159
"lint": {
156160
"command": "eslint src test --color --cache --cache-location .eslintcache",
157161
"files": [
158162
"src/**/*.ts",
159163
"test/**/*.ts",
160164
"messages/**",
161-
".eslintignore",
162-
".eslintrc.js"
165+
".eslint*"
163166
],
164167
"output": []
165168
},
@@ -177,7 +180,8 @@
177180
"command": "\"./bin/dev\" commandreference:generate --erroronwarnings",
178181
"files": [
179182
"src/**/*.ts",
180-
"messages/**"
183+
"messages/**",
184+
"package.json"
181185
],
182186
"output": [
183187
"tmp/root"
@@ -216,9 +220,12 @@
216220
"test/**/*.ts",
217221
"src/**/*.ts",
218222
"tsconfig.json",
219-
"test/tsconfig.json"
223+
".mocha*",
224+
"test/tsconfig.json",
225+
"!*.nut.ts",
226+
".nycrc"
220227
],
221228
"output": []
222229
}
223230
}
224-
}
231+
}

src/commands/force/org/create.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ export class Create extends SfCommand<CreateResult> {
282282
if (!scratchOrgInfo) {
283283
throw new SfError('No scratch org info returned from scratchOrgCreate');
284284
}
285-
if (!authFields || !authFields.orgId) {
285+
if (!authFields?.orgId) {
286286
throw new SfError('Information missing from authFields');
287287
}
288288

src/commands/org/create/sandbox.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,12 @@ export default class CreateSandbox extends SandboxCommandBase<SandboxProcessObje
141141
...(this.flags.clone ? { SourceSandboxName: this.flags.clone } : {}),
142142
...(!this.flags.clone && this.flags['license-type'] ? { LicenseType: this.flags['license-type'] } : {}),
143143
};
144-
const { sandboxReq } = this.flags.clone
145-
? await createSandboxRequest(true, this.flags['definition-file'], undefined, requestOptions)
146-
: await createSandboxRequest(false, this.flags['definition-file'], undefined, requestOptions);
144+
const { sandboxReq } = await createSandboxRequest(
145+
!!this.flags.clone,
146+
this.flags['definition-file'],
147+
undefined,
148+
requestOptions
149+
);
147150
return {
148151
...sandboxReq,
149152
...(this.flags.clone ? { SourceId: await this.getSourceId() } : {}),

src/shared/sandboxRequest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export const generateSboxName = async (): Promise<string> => {
2121
};
2222

2323
export async function createSandboxRequest(
24-
isClone: true,
24+
isClone: true | boolean,
2525
definitionFile: string | undefined,
2626
logger?: Logger | undefined,
2727
properties?: Record<string, string | undefined>

0 commit comments

Comments
 (0)