@salesforce/packaging 0.1.12 → 0.1.14

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,7 @@ class PackageVersionCreate {
446
446
  this.packageObject = this.project.findPackage((pkg) => pkg.package === packageName || pkg.name === packageName);
447
447
  }
448
448
  else {
449
- // due to flag validation, we'll either have a package or path flag
449
+ // We'll either have a package ID or alias, or a directory path
450
450
  this.packageObject = this.project.getPackageFromPath(this.options.path);
451
451
  packageName = this.packageObject?.package;
452
452
  if (!packageName)
@@ -463,7 +463,17 @@ class PackageVersionCreate {
463
463
  // At this point, the packageIdFromAlias should have been resolved to an Id. Now, we
464
464
  // need to validate that the Id is correct.
465
465
  pkgUtils.validateId(pkgUtils.BY_LABEL.PACKAGE_ID, this.packageId);
466
- await this.validateOptionsForPackageType();
466
+ try {
467
+ await this.validateOptionsForPackageType();
468
+ }
469
+ catch (error) {
470
+ const err = error;
471
+ if (err.name === 'NOT_FOUND') {
472
+ // this means the 0Ho package was not found in the org. throw a better error.
473
+ throw messages.createError('errorNoIdInHub', [this.packageId]);
474
+ }
475
+ throw err;
476
+ }
467
477
  const request = await this.createPackageVersionCreateRequestFromOptions();
468
478
  const createResult = await this.connection.tooling.create('Package2VersionCreateRequest', request);
469
479
  if (!createResult.success) {
@@ -98,7 +98,7 @@ function applyErrorAction(err) {
98
98
  if (err.name === 'INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST') {
99
99
  actions.push(messages.getMessage('invalidPackageTypeAction'));
100
100
  }
101
- if (err.name === 'MALFORMED_ID' && err.message === messages.getMessage('malformedPackageIdMessage')) {
101
+ if (err.name === 'MALFORMED_ID' && err.message === messages.getMessage('malformedPackageIdMessage', [''])) {
102
102
  actions.push(messages.getMessage('malformedPackageIdAction'));
103
103
  }
104
104
  if (err.name === 'MALFORMED_ID' && err.message === messages.getMessage('malformedPackageVersionIdMessage')) {
@@ -29,4 +29,3 @@ The project doesn't have any package aliases.
29
29
  # package2VersionNotFoundFor04t
30
30
 
31
31
  Could not find a Package2Version record for SubscriberPackageVersionId %s.
32
-
@@ -3,34 +3,6 @@
3
3
  An error occurred during CRUD operation %s on entity %s.
4
4
  %s
5
5
 
6
- # errorInvalidPatchNumber
7
-
8
- The provided VersionNumber '%s' is not supported. Provide a patch number of 0.
9
-
10
- # errorInvalidAncestorVersionFormat
11
-
12
- The ancestor versionNumber must be in the format major.minor.patch but the value found is [%s].
13
-
14
- # errorNoMatchingMajorMinorForPatch
15
-
16
- Can’t create patch version. The specified package ancestor [%s] either isn’t a promoted and released version, or can’t be found. Check the specified ancestor version, and then retry creating the patch version.
17
-
18
- # errorNoMatchingAncestor
19
-
20
- The ancestorId for ancestorVersion [%s] can't be found. Package ID [%s].
21
-
22
- # errorAncestorNotReleased
23
-
24
- The ancestor package version [%s] specified in the sfdx-project.json file hasn’t been promoted and released. Release the ancestor package version before specifying it as the ancestor in a new package or patch version.
25
-
26
- # errorAncestorIdVersionMismatch
27
-
28
- Can’t create package version. The ancestorVersion listed in your sfdx-project.json file doesn’t map to this package. Ensure the ancestor ID is correct, or set the ID to ancestorID:HIGHEST to ensure the highest released package version is used as the ancestor. Then try creating the package version again.
29
-
30
- # errorAncestorIdVersionHighestOrNoneMismatch
31
-
32
- Can’t create package version. The ancestorId [%s] and ancestorVersion [%s] in your sfdx-project.json file don’t map to the same package version. Remove the incorrect entry, and try creating the package version again.
33
-
34
6
  # errorInvalidIdNoMatchingVersionId
35
7
 
36
8
  The %s %s is invalid, as a corresponding %s was not found
@@ -61,16 +33,12 @@ Use "sfdx force:package:list" to verify the 0Ho package version ID.
61
33
 
62
34
  # malformedPackageIdMessage
63
35
 
64
- We can’t find this package ID for this Dev Hub.
36
+ We can’t find this package ID %s for this Dev Hub.
65
37
 
66
38
  # notFoundMessage
67
39
 
68
40
  The requested resource does not exist
69
41
 
70
- # versionCreateFailedWithMultipleErrors
71
-
72
- Multiple errors occurred:
73
-
74
42
  # itemDoesNotFitWithinMaxLength
75
43
 
76
44
  When calculating the number of items to be included in query "%s", when formatted, was too long.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/packaging",
3
- "version": "0.1.12",
3
+ "version": "0.1.14",
4
4
  "description": "packing libraries to Salesforce packaging platform",
5
5
  "main": "lib/exported",
6
6
  "types": "lib/exported.d.ts",
@@ -44,7 +44,7 @@
44
44
  "@xmldom/xmldom": "^0.8.3",
45
45
  "debug": "^4.3.4",
46
46
  "globby": "^11",
47
- "graphology": "^0.25.0",
47
+ "graphology": "^0.25.1",
48
48
  "graphology-traversal": "^0.3.1",
49
49
  "graphology-types": "^0.24.5",
50
50
  "js2xmlparser": "^4.0.2",
@@ -59,13 +59,13 @@
59
59
  "@salesforce/dev-config": "^3.1.0",
60
60
  "@salesforce/dev-scripts": "^2.0.4",
61
61
  "@salesforce/prettier-config": "^0.0.2",
62
- "@salesforce/ts-sinon": "^1.4.0",
62
+ "@salesforce/ts-sinon": "^1.4.1",
63
63
  "@types/debug": "4.1.7",
64
64
  "@types/globby": "^9.1.0",
65
65
  "@types/jszip": "^3.4.1",
66
66
  "@types/xml2js": "^0.4.11",
67
67
  "@typescript-eslint/eslint-plugin": "^5.40.1",
68
- "@typescript-eslint/parser": "5.40.1",
68
+ "@typescript-eslint/parser": "5.41.0",
69
69
  "chai": "^4.3.6",
70
70
  "commitizen": "^4.2.4",
71
71
  "eslint": "^8.26.0",
@@ -75,7 +75,7 @@
75
75
  "eslint-config-salesforce-typescript": "^0.2.8",
76
76
  "eslint-plugin-header": "3.1.1",
77
77
  "eslint-plugin-import": "^2.26.0",
78
- "eslint-plugin-jsdoc": "^39.3.6",
78
+ "eslint-plugin-jsdoc": "^39.3.25",
79
79
  "eslint-plugin-prettier": "^4.0.0",
80
80
  "husky": "^8.0.1",
81
81
  "mocha": "^10.0.0",