@salesforce/packaging 1.0.5 → 1.0.7

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.
@@ -446,7 +446,11 @@ class PackageVersion {
446
446
  if (!process.env.SFDX_PROJECT_AUTOUPDATE_DISABLE_FOR_PACKAGE_VERSION_CREATE) {
447
447
  // get the newly created package version from the server
448
448
  const versionResult = (await this.connection.tooling.query(`SELECT Branch, MajorVersion, MinorVersion, PatchVersion, BuildNumber FROM Package2Version WHERE SubscriberPackageVersionId='${results.SubscriberPackageVersionId}'`)).records[0];
449
- const version = `${this.project.getAliasesFromPackageId(results.Package2Id).join()}@${versionResult.MajorVersion ?? 0}.${versionResult.MinorVersion ?? 0}.${versionResult.PatchVersion ?? 0}`;
449
+ const aliases = this.project.getAliasesFromPackageId(results.Package2Id);
450
+ if (aliases.length === 0) {
451
+ throw messages.createError('packageAliasNotFound', [results.Package2Id]);
452
+ }
453
+ const version = `${aliases[0]}@${versionResult.MajorVersion ?? 0}.${versionResult.MinorVersion ?? 0}.${versionResult.PatchVersion ?? 0}`;
450
454
  const build = versionResult.BuildNumber ? `-${versionResult.BuildNumber}` : '';
451
455
  const branch = versionResult.Branch ? `-${versionResult.Branch}` : '';
452
456
  // set packageAliases entry '<package>@<major>.<minor>.<patch>-<build>-<branch>: <result.subscriberPackageVersionId>'
@@ -17,3 +17,7 @@ The provided package uninstall request ID: [%s] is invalid. It must be a 15 or 1
17
17
  # packageVersionInstallRequestNotFound
18
18
 
19
19
  The provided package install request ID: [%s] could not be found.
20
+
21
+ # packageAliasNotFound
22
+
23
+ The provided package id: [%s] could not be resolved to an alias.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/packaging",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "description": "Packaging library for the Salesforce packaging platform",
5
5
  "main": "lib/exported",
6
6
  "types": "lib/exported.d.ts",