Skip to content

Commit

Permalink
fix: some changes regressed toolbelt (#299)
Browse files Browse the repository at this point in the history
  • Loading branch information
amphro authored Sep 14, 2020
1 parent c5e52d8 commit 2c571a7
Show file tree
Hide file tree
Showing 5 changed files with 284 additions and 146 deletions.
80 changes: 78 additions & 2 deletions examples/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,16 @@ builtin-modules@^1.1.1:
resolved "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f"
integrity sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=

[email protected]:
version "1.8.2"
resolved "https://registry.yarnpkg.com/bunyan-sfdx-no-dtrace/-/bunyan-sfdx-no-dtrace-1.8.2.tgz#10682de07fec17ed14528b166995b1f18bbd4f9a"
integrity sha1-EGgt4H/sF+0UUosWaZWx8Yu9T5o=
optionalDependencies:
dtrace-provider "~0.6"
moment "^2.10.6"
mv "~2"
safe-json-stringify "~1"

caseless@~0.12.0:
version "0.12.0"
resolved "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc"
Expand Down Expand Up @@ -419,6 +429,13 @@ [email protected], diff@^3.1.0, diff@^3.2.0, diff@^3.5.0:
resolved "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12"
integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==

dtrace-provider@~0.6:
version "0.6.0"
resolved "https://registry.yarnpkg.com/dtrace-provider/-/dtrace-provider-0.6.0.tgz#0b078d5517937d873101452d9146737557b75e51"
integrity sha1-CweNVReTfYcxAUUtkUZzdVe3XlE=
dependencies:
nan "^2.0.8"

ecc-jsbn@~0.1.1:
version "0.1.2"
resolved "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9"
Expand Down Expand Up @@ -558,6 +575,17 @@ [email protected]:
once "^1.3.0"
path-is-absolute "^1.0.0"

glob@^6.0.1:
version "6.0.4"
resolved "https://registry.yarnpkg.com/glob/-/glob-6.0.4.tgz#0f08860f6a155127b2fadd4f9ce24b1aab6e4d22"
integrity sha1-DwiGD2oVUSey+t1PnOJLGqtuTSI=
dependencies:
inflight "^1.0.4"
inherits "2"
minimatch "2 || 3"
once "^1.3.0"
path-is-absolute "^1.0.0"

glob@^7.1.1:
version "7.1.3"
resolved "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1"
Expand Down Expand Up @@ -865,9 +893,9 @@ mimic-fn@^1.0.0:
resolved "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022"
integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==

[email protected], minimatch@^3.0.4:
"minimatch@2 || 3", [email protected], minimatch@^3.0.4:
version "3.0.4"
resolved "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==
dependencies:
brace-expansion "^1.1.7"
Expand All @@ -882,13 +910,25 @@ minimist@^1.2.0:
resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284"
integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=

minimist@^1.2.5:
version "1.2.5"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602"
integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==

[email protected], mkdirp@^0.5.1:
version "0.5.1"
resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903"
integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=
dependencies:
minimist "0.0.8"

mkdirp@~0.5.1:
version "0.5.5"
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def"
integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==
dependencies:
minimist "^1.2.5"

mocha@^5.2.0:
version "5.2.0"
resolved "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz#6d8ae508f59167f940f2b5b3c4a612ae50c90ae6"
Expand All @@ -911,6 +951,11 @@ [email protected]:
resolved "https://registry.npmjs.org/moment/-/moment-2.24.0.tgz#0d055d53f5052aa653c9f6eb68bb5d12bf5c2b5b"
integrity sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg==

moment@^2.10.6:
version "2.28.0"
resolved "https://registry.yarnpkg.com/moment/-/moment-2.28.0.tgz#cdfe73ce01327cee6537b0fafac2e0f21a237d75"
integrity sha512-Z5KOjYmnHyd/ukynmFd/WwyXHd7L4J9vTI/nn5Ap9AVUgaAE15VvQ9MOGmJJygEUklupqIrFnor/tjTwRU+tQw==

[email protected]:
version "2.0.0"
resolved "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
Expand Down Expand Up @@ -939,6 +984,25 @@ [email protected]:
resolved "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab"
integrity sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=

mv@~2:
version "2.1.1"
resolved "https://registry.yarnpkg.com/mv/-/mv-2.1.1.tgz#ae6ce0d6f6d5e0a4f7d893798d03c1ea9559b6a2"
integrity sha1-rmzg1vbV4KT32JN5jQPB6pVZtqI=
dependencies:
mkdirp "~0.5.1"
ncp "~2.0.0"
rimraf "~2.4.0"

nan@^2.0.8:
version "2.14.1"
resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.1.tgz#d7be34dfa3105b91494c3147089315eff8874b01"
integrity sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw==

ncp@~2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/ncp/-/ncp-2.0.0.tgz#195a21d6c46e361d2fb1281ba38b91e9df7bdbb3"
integrity sha1-GVoh1sRuNh0vsSgbo4uR6d9727M=

nise@^1.2.0, nise@^1.4.5:
version "1.4.8"
resolved "https://registry.npmjs.org/nise/-/nise-1.4.8.tgz#ce91c31e86cf9b2c4cac49d7fcd7f56779bfd6b0"
Expand Down Expand Up @@ -1094,6 +1158,13 @@ restore-cursor@^2.0.0:
onetime "^2.0.0"
signal-exit "^3.0.2"

rimraf@~2.4.0:
version "2.4.5"
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.4.5.tgz#ee710ce5d93a8fdb856fb5ea8ff0e2d75934b2da"
integrity sha1-7nEM5dk6j9uFb7Xqj/Di11k0sto=
dependencies:
glob "^6.0.1"

run-async@^2.2.0:
version "2.3.0"
resolved "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz#0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0"
Expand All @@ -1113,6 +1184,11 @@ safe-buffer@^5.0.1, safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1:
resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==

safe-json-stringify@~1:
version "1.2.0"
resolved "https://registry.yarnpkg.com/safe-json-stringify/-/safe-json-stringify-1.2.0.tgz#356e44bc98f1f93ce45df14bcd7c01cda86e0afd"
integrity sha512-gH8eh2nZudPQO6TytOvbxnuhYBOvDBBLW52tz5q6X58lJcd/tkmqFR+5Z9adS8aJtURSXWThWy/xJtJwixErvg==

"safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0:
version "2.1.2"
resolved "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@
},
"dependencies": {
"@salesforce/bunyan": "^2.0.0",
"@salesforce/kit": "^1.2.2",
"@salesforce/kit": "^1.3.2",
"@salesforce/schemas": "^1.0.1",
"@salesforce/ts-types": "^1.0.0",
"@types/graceful-fs": "^4.1.3",
"@types/jsforce": "1.9.2",
"@types/jsforce": "1.9.20",
"debug": "^3.1.0",
"graceful-fs": "^4.2.4",
"jsen": "0.6.6",
Expand Down
2 changes: 2 additions & 0 deletions src/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,8 @@ export class Config extends ConfigFile<ConfigFile.Options> {
}

Config.propertyConfigMap = keyBy(Config.allowedProperties, 'key');
// Make sure we resolve the path on creation.
this.getPath();
}

/**
Expand Down
6 changes: 3 additions & 3 deletions src/sfdxProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ export class SfdxProjectJson extends ConfigFile<ConfigFile.Options> {

// This has to be done on the fly so it won't be written back to the file
// This is a fast operation so no need to cache it so it stays immutable.
const packageDirs = contents.packageDirectories.map(packageDir => {
const packageDirs = (contents.packageDirectories || []).map(packageDir => {
if (isAbsolute(packageDir.path)) {
throw new SfdxError(
'InvalidProjectWorkspace',
Expand Down Expand Up @@ -293,14 +293,14 @@ export class SfdxProjectJson extends ConfigFile<ConfigFile.Options> {
* Has package directories defined in the project.
*/
public hasPackages(): boolean {
return this.getContents().packageDirectories.length > 0;
return this.getContents().packageDirectories && this.getContents().packageDirectories.length > 0;
}

/**
* Has multiple package directories (MPD) defined in the project.
*/
public hasMultiplePackages(): boolean {
return this.getContents().packageDirectories.length > 1;
return this.getContents().packageDirectories && this.getContents().packageDirectories.length > 1;
}

private validateKeys(): void {
Expand Down
Loading

0 comments on commit 2c571a7

Please sign in to comment.