@salesforce/packaging 1.1.8 → 1.1.9
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
|
-
|
|
461
|
-
|
|
462
|
-
|
|
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.
|
|
3
|
+
"version": "1.1.9",
|
|
4
4
|
"description": "Packaging library for the Salesforce packaging platform",
|
|
5
5
|
"main": "lib/exported",
|
|
6
6
|
"types": "lib/exported.d.ts",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"@typescript-eslint/parser": "5.48.0",
|
|
72
72
|
"chai": "^4.3.7",
|
|
73
73
|
"commitizen": "^4.2.6",
|
|
74
|
-
"eslint": "^8.
|
|
74
|
+
"eslint": "^8.31.0",
|
|
75
75
|
"eslint-config-prettier": "^8.5.0",
|
|
76
76
|
"eslint-config-salesforce": "^1.1.0",
|
|
77
77
|
"eslint-config-salesforce-license": "^0.1.6",
|