@salesforce/packaging 5.0.10 → 5.0.12

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.
@@ -205,6 +205,7 @@ async function createPackageVersionCreateRequest(context, packageId, apiVersion,
205
205
  const seedMetadataPath = context.seedmetadata ?? packageDescriptorJson.seedMetadata?.path;
206
206
  const hasSeedMetadata = await new packageVersionCreate_1.MetadataResolver().resolveMetadata(seedMetadataPath, seedMetadataFolder, 'seedMDDirectoryDoesNotExist', apiVersion);
207
207
  if (context.codecoverage) {
208
+ assertPackagePropertiesAreResolvable(project);
208
209
  const unpackagedMetadataPath = packageDescriptorJson.unpackagedMetadata?.path;
209
210
  const hasUnpackaged = await new packageVersionCreate_1.MetadataResolver().resolveMetadata(unpackagedMetadataPath, unpackagedMetadataFolder, 'unpackagedMDDirectoryDoesNotExist', apiVersion);
210
211
  if (hasUnpackaged) {
@@ -251,6 +252,24 @@ function buildPackageDescriptorJson(args) {
251
252
  }
252
253
  return descriptor;
253
254
  }
255
+ // These properties only resolve when their packageDirectories entry has a `package` that maps to a
256
+ // packageAliases key; otherwise they're silently dropped, so fail fast here instead.
257
+ function assertPackagePropertiesAreResolvable(project) {
258
+ const packageScopedProperties = ['unpackagedMetadata', 'apexTestAccess'];
259
+ for (const dir of project?.getPackageDirectories() ?? []) {
260
+ const declared = packageScopedProperties.find((property) => property in dir);
261
+ if (!declared)
262
+ continue;
263
+ if (!(0, project_1.isPackagingDirectory)(dir)) {
264
+ throw messages.createError('missingPackagePropertyForDirectory');
265
+ }
266
+ // Package directory entries support either an alias or a literal 0Ho ID for backward compatibility.
267
+ const resolvedPackageId = project?.getPackageIdFromAlias(dir.package) ?? dir.package;
268
+ if (!pkgUtils.validateIdNoThrow(pkgUtils.BY_LABEL.PACKAGE_ID, resolvedPackageId)) {
269
+ throw messages.createError('unresolvedPackageAliasForDirectory', [dir.package]);
270
+ }
271
+ }
272
+ }
254
273
  async function createRequestObject(packageId, options, packageVersTmpRoot, packageVersBlobZipFile) {
255
274
  const zipFileBase64 = (await node_fs_1.default.promises.readFile(packageVersBlobZipFile)).toString('base64');
256
275
  const requestObject = {
@@ -131,6 +131,14 @@ Could not find a package in sfdx-project.json file using "path" %s. Add it to th
131
131
 
132
132
  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.
133
133
 
134
+ # missingPackagePropertyForDirectory
135
+
136
+ Can't convert package. Your project configuration file (sfdx-project.json) specifies unpackagedMetadata or apexTestAccess, but the attribute can't be resolved because the packageDirectories entry doesn't specify the package parameter. Specify a valid 0Ho package ID or a package alias.
137
+
138
+ # unresolvedPackageAliasForDirectory
139
+
140
+ Can't convert package. Your project configuration file (sfdx-project.json) specifies unpackagedMetadata or apexTestAccess, but the attribute can't be resolved because the package specified as "%s" isn't a valid package ID or package alias. Specify a valid 0Ho package ID or a package alias that resolves to a valid 0Ho package ID.
141
+
134
142
  # noSourceInRootDirectory
135
143
 
136
144
  No matching source was found within the package root directory: %s
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/packaging",
3
- "version": "5.0.10",
3
+ "version": "5.0.12",
4
4
  "description": "Packaging library for the Salesforce packaging platform",
5
5
  "main": "lib/exported",
6
6
  "types": "lib/exported.d.ts",
@@ -42,11 +42,11 @@
42
42
  "!lib/**/*.map"
43
43
  ],
44
44
  "dependencies": {
45
- "@jsforce/jsforce-node": "^3.10.19",
46
- "@salesforce/core": "^9.0.0",
45
+ "@jsforce/jsforce-node": "^3.10.24",
46
+ "@salesforce/core": "^9.1.9",
47
47
  "@salesforce/kit": "^4.0.0",
48
48
  "@salesforce/schemas": "^1.10.3",
49
- "@salesforce/source-deploy-retrieve": "^13.0.1",
49
+ "@salesforce/source-deploy-retrieve": "^13.3.0",
50
50
  "@salesforce/ts-types": "^3.0.1",
51
51
  "@salesforce/types": "^1.8.0",
52
52
  "fast-xml-parser": "^5.10.1",