@salesforce/core 3.30.3 → 3.30.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/sfProject.d.ts +1 -1
- package/lib/sfProject.js +7 -7
- package/package.json +1 -1
package/lib/sfProject.d.ts
CHANGED
|
@@ -150,7 +150,7 @@ export declare class SfProjectJson extends ConfigFile {
|
|
|
150
150
|
*
|
|
151
151
|
* @param packageDir
|
|
152
152
|
*/
|
|
153
|
-
addPackageDirectory(packageDir:
|
|
153
|
+
addPackageDirectory(packageDir: NamedPackageDir): void;
|
|
154
154
|
private doesPackageExist;
|
|
155
155
|
private validateKeys;
|
|
156
156
|
}
|
package/lib/sfProject.js
CHANGED
|
@@ -224,8 +224,8 @@ class SfProjectJson extends configFile_1.ConfigFile {
|
|
|
224
224
|
const uniqueValues = [];
|
|
225
225
|
// Keep original order defined in sfdx-project.json
|
|
226
226
|
this.getPackageDirectoriesSync().forEach((packageDir) => {
|
|
227
|
-
if (!visited[packageDir.
|
|
228
|
-
visited[packageDir.
|
|
227
|
+
if (!visited[packageDir.path]) {
|
|
228
|
+
visited[packageDir.path] = true;
|
|
229
229
|
uniqueValues.push(packageDir);
|
|
230
230
|
}
|
|
231
231
|
});
|
|
@@ -236,7 +236,7 @@ class SfProjectJson extends configFile_1.ConfigFile {
|
|
|
236
236
|
* for data other than the names.
|
|
237
237
|
*/
|
|
238
238
|
getUniquePackageNames() {
|
|
239
|
-
return this.getUniquePackageDirectories().map((pkgDir) => pkgDir.
|
|
239
|
+
return this.getUniquePackageDirectories().map((pkgDir) => pkgDir.package || pkgDir.path);
|
|
240
240
|
}
|
|
241
241
|
/**
|
|
242
242
|
* Has package directories defined in the project.
|
|
@@ -489,7 +489,7 @@ class SfProject {
|
|
|
489
489
|
*/
|
|
490
490
|
getPackageFromPath(path) {
|
|
491
491
|
const packageDirs = this.getPackageDirectories();
|
|
492
|
-
const match = packageDirs.find((packageDir) => (0, path_1.basename)(path) === packageDir.
|
|
492
|
+
const match = packageDirs.find((packageDir) => (0, path_1.basename)(path) === packageDir.path || path.includes(packageDir.fullPath));
|
|
493
493
|
return match;
|
|
494
494
|
}
|
|
495
495
|
/**
|
|
@@ -499,7 +499,7 @@ class SfProject {
|
|
|
499
499
|
*/
|
|
500
500
|
getPackageNameFromPath(path) {
|
|
501
501
|
const packageDir = this.getPackageFromPath(path);
|
|
502
|
-
return packageDir ? packageDir.
|
|
502
|
+
return packageDir ? packageDir.package || packageDir.path : undefined;
|
|
503
503
|
}
|
|
504
504
|
/**
|
|
505
505
|
* Returns the package directory.
|
|
@@ -508,7 +508,7 @@ class SfProject {
|
|
|
508
508
|
*/
|
|
509
509
|
getPackage(packageName) {
|
|
510
510
|
const packageDirs = this.getPackageDirectories();
|
|
511
|
-
return packageDirs.find((packageDir) => packageDir.
|
|
511
|
+
return packageDirs.find((packageDir) => packageDir.package === packageName || packageDir.path === packageName);
|
|
512
512
|
}
|
|
513
513
|
/**
|
|
514
514
|
* Returns the absolute path of the package directory ending with the path separator.
|
|
@@ -518,7 +518,7 @@ class SfProject {
|
|
|
518
518
|
*/
|
|
519
519
|
getPackagePath(packageName) {
|
|
520
520
|
const packageDir = this.getPackage(packageName);
|
|
521
|
-
return packageDir
|
|
521
|
+
return packageDir?.fullPath;
|
|
522
522
|
}
|
|
523
523
|
/**
|
|
524
524
|
* Has package directories defined in the project.
|