@salesforce/core 3.31.9 → 3.31.10

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.
Files changed (2) hide show
  1. package/lib/sfProject.js +9 -1
  2. package/package.json +2 -2
package/lib/sfProject.js CHANGED
@@ -501,7 +501,15 @@ class SfProject {
501
501
  */
502
502
  getPackageFromPath(path) {
503
503
  const packageDirs = this.getPackageDirectories();
504
- const match = packageDirs.find((packageDir) => (0, path_1.basename)(path) === packageDir.path || path.includes(packageDir.fullPath));
504
+ // resolve the given path
505
+ const fullPath = (0, path_1.resolve)(path);
506
+ const match = packageDirs.find((packageDir) => {
507
+ // fullPath will not have a trailing slash, so remove it from packageDir.fullPath, if it exists
508
+ const fullPathSansTrailingSep = packageDir.fullPath.replace(/(\\|\/)$/, '');
509
+ return ((0, path_1.basename)(path) === packageDir.path ||
510
+ fullPath === fullPathSansTrailingSep ||
511
+ fullPath.includes(packageDir.fullPath));
512
+ });
505
513
  return match;
506
514
  }
507
515
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/core",
3
- "version": "3.31.9",
3
+ "version": "3.31.10",
4
4
  "description": "Core libraries to interact with SFDX projects, orgs, and APIs.",
5
5
  "main": "lib/exported",
6
6
  "types": "lib/exported.d.ts",
@@ -37,7 +37,7 @@
37
37
  "@salesforce/bunyan": "^2.0.0",
38
38
  "@salesforce/kit": "^1.7.0",
39
39
  "@salesforce/schemas": "^1.1.0",
40
- "@salesforce/ts-types": "^1.5.20",
40
+ "@salesforce/ts-types": "^1.5.21",
41
41
  "@types/graceful-fs": "^4.1.5",
42
42
  "@types/semver": "^7.3.9",
43
43
  "ajv": "^8.11.0",