@salesforce/packaging 0.1.4 → 0.1.5-0

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.
@@ -427,9 +427,7 @@ class PackageVersionCreate {
427
427
  let packageName;
428
428
  if (this.options.packageId) {
429
429
  const pkg = this.options.packageId;
430
- packageName = pkg.startsWith('0Ho')
431
- ? this.project.getAliasesFromPackageId(pkg).find((alias) => alias)
432
- : this.project.getPackageIdFromAlias(pkg);
430
+ packageName = pkg.startsWith('0Ho') ? this.project.getAliasesFromPackageId(pkg).find((alias) => alias) : pkg;
433
431
  if (!packageName)
434
432
  throw messages.createError('errorMissingPackage', [this.options.packageId]);
435
433
  this.packageObject = this.project.findPackage((pkg) => pkg.package === packageName || pkg.name === packageName);
@@ -441,6 +439,12 @@ class PackageVersionCreate {
441
439
  if (!packageName)
442
440
  throw messages.createError('errorCouldNotFindPackageUsingPath', [this.options.path]);
443
441
  }
442
+ if (!this.packageObject) {
443
+ throw messages.createError('errorCouldNotFindPackageDir', [
444
+ this.options.packageId ? 'packageId or alias' : 'path',
445
+ this.options.packageId || this.options.path,
446
+ ]);
447
+ }
444
448
  this.packageId = this.project.getPackageIdFromAlias(packageName) || packageName;
445
449
  this.options.profileApi = await this.resolveUserLicenses(this.packageObject.includeProfileUserLicenses);
446
450
  // At this point, the packageIdFromAlias should have been resolved to an Id. Now, we
@@ -118,3 +118,7 @@ The package "%s" isn’t defined in the sfdx-project.json file. Add it to the pa
118
118
  # errorCouldNotFindPackageUsingPath
119
119
 
120
120
  Could not find a package in sfdx-project.json file using "path" %s. Add it to the packageDirectories section and add the alias to packageAliases with its 0Ho ID.
121
+
122
+ # errorCouldNotFindPackageDir
123
+
124
+ Couldn't find a package directory for package using %s %s. Add it to the packageDirectories section and add the alias to packageAliases with its 0Ho ID.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/packaging",
3
- "version": "0.1.4",
3
+ "version": "0.1.5-0",
4
4
  "description": "packing libraries to Salesforce packaging platform",
5
5
  "main": "lib/exported",
6
6
  "types": "lib/exported.d.ts",