@salesforce/packaging 1.1.8 → 1.1.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.
@@ -44,6 +44,7 @@ export declare class PackageVersionCreate {
44
44
  private resolveApexTestPermissions;
45
45
  private resolveUnpackagedMetadata;
46
46
  private packageVersionCreate;
47
+ private getPackageDirFromId;
47
48
  private getPackageType;
48
49
  private resolveUserLicenses;
49
50
  private validateOptionsForPackageType;
@@ -439,6 +439,7 @@ class PackageVersionCreate {
439
439
  }
440
440
  return false;
441
441
  }
442
+ // eslint-disable-next-line complexity
442
443
  async packageVersionCreate() {
443
444
  // For the first rollout of validating sfdx-project.json data against schema, make it optional and defaulted
444
445
  // to false. Validation only occurs if the optional validateschema option has been specified.
@@ -457,9 +458,13 @@ class PackageVersionCreate {
457
458
  let packageName;
458
459
  if (this.options.packageId) {
459
460
  const pkg = this.options.packageId;
460
- packageName = pkg.startsWith('0Ho') ? this.project.getAliasesFromPackageId(pkg).find((alias) => alias) : pkg;
461
- if (!packageName)
462
- throw messages.createError('errorMissingPackage', [this.options.packageId]);
461
+ // for backward compatibility allow for a packageDirectory package property to be an id (0Ho) instead of an alias.
462
+ packageName = (await this.getPackageDirFromId(pkg))?.package;
463
+ if (!packageName) {
464
+ packageName = pkg.startsWith('0Ho') ? this.project.getAliasesFromPackageId(pkg).find((alias) => alias) : pkg;
465
+ if (!packageName)
466
+ throw messages.createError('errorMissingPackage', [this.options.packageId]);
467
+ }
463
468
  this.packageObject = this.project.findPackage((namedPackageDir) => namedPackageDir.package === packageName || namedPackageDir.name === packageName);
464
469
  }
465
470
  else {
@@ -502,6 +507,16 @@ class PackageVersionCreate {
502
507
  }
503
508
  return (await (0, packageVersionCreateRequest_1.byId)(createResult.id, this.connection))[0];
504
509
  }
510
+ async getPackageDirFromId(pkg) {
511
+ let dir;
512
+ if (pkg.startsWith('0Ho')) {
513
+ dir = (await this.project.getSfProjectJson().getPackageDirectories()).filter((p) => p.package === pkg);
514
+ if (dir.length === 1) {
515
+ return dir[0];
516
+ }
517
+ }
518
+ return;
519
+ }
505
520
  async getPackageType() {
506
521
  // this.packageId should be an 0Ho package Id at this point
507
522
  if (!this.pkg) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/packaging",
3
- "version": "1.1.8",
3
+ "version": "1.1.10",
4
4
  "description": "Packaging library for the Salesforce packaging platform",
5
5
  "main": "lib/exported",
6
6
  "types": "lib/exported.d.ts",
@@ -38,7 +38,7 @@
38
38
  "!lib/**/*.map"
39
39
  ],
40
40
  "dependencies": {
41
- "@oclif/core": "^1.23.1",
41
+ "@oclif/core": "^1.24.0",
42
42
  "@salesforce/core": "^3.32.11",
43
43
  "@salesforce/kit": "^1.8.0",
44
44
  "@salesforce/schemas": "^1.4.0",
@@ -68,11 +68,11 @@
68
68
  "@types/jszip": "^3.4.1",
69
69
  "@types/xml2js": "^0.4.11",
70
70
  "@typescript-eslint/eslint-plugin": "^5.40.1",
71
- "@typescript-eslint/parser": "5.48.0",
71
+ "@typescript-eslint/parser": "5.48.1",
72
72
  "chai": "^4.3.7",
73
73
  "commitizen": "^4.2.6",
74
- "eslint": "^8.30.0",
75
- "eslint-config-prettier": "^8.5.0",
74
+ "eslint": "^8.31.0",
75
+ "eslint-config-prettier": "^8.6.0",
76
76
  "eslint-config-salesforce": "^1.1.0",
77
77
  "eslint-config-salesforce-license": "^0.1.6",
78
78
  "eslint-config-salesforce-typescript": "^1.1.1",