Skip to content
Open
3 changes: 2 additions & 1 deletion command-snapshot.json
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,8 @@
"version-description",
"version-name",
"version-number",
"wait"
"wait",
"generate-pkg-zip"
],
"plugin": "@salesforce/plugin-packaging"
},
Expand Down
6 changes: 5 additions & 1 deletion messages/package_version_create.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,13 @@ Return a new package version before completing package validations.

Specifying async validation returns the package version earlier in the process, allowing you to install and test the new version right away. If your development team is using continuous integration (CI) scripts, async validation can reduce your overall CI run time.

# flags.generate-pkg-zip.summary

Generate a package ZIP file that you can use for debugging or to examine the package contents.

# flags.skip-ancestor-check.summary

Overrides ancestry requirements, which allows you to specify a package ancestor that isn’t the highest released package version.
Override ancestry requirements, which allows you to specify a package ancestor that isn’t the highest released package version.

# flags.post-install-url.summary

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"@oclif/core": "^4",
"@salesforce/core": "^8.25.0",
"@salesforce/kit": "^3.2.4",
"@salesforce/packaging": "^4.18.12",
"@salesforce/packaging": "^4.20.0",
"@salesforce/sf-plugins-core": "^12.2.6",
"chalk": "^5.6.2"
},
Expand Down
4 changes: 4 additions & 0 deletions src/commands/package/version/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ export class PackageVersionCreateCommand extends SfCommand<PackageVersionCommand
default: false,
exclusive: ['skip-validation'],
}),
'generate-pkg-zip': Flags.boolean({
summary: messages.getMessage('flags.generate-pkg-zip.summary'),
default: false,
}),
tag: Flags.string({
char: 't',
summary: messages.getMessage('flags.tag.summary'),
Expand Down
20 changes: 20 additions & 0 deletions test/commands/package/packageVersion.nut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import {
PackageVersionListDetails,
} from '../../../src/commands/package/version/list.js';
import { CreateListCommandResult } from '../../../src/commands/package/version/create/list.js';
import { FileDownloadEntry } from '../../../src/commands/package/version/retrieve.js';

chaiConfig.truncateThreshold = 0;

Expand Down Expand Up @@ -176,6 +177,25 @@ describe('package:version:*', () => {
projectJson.writeSync();
execCmd(`package:version:create --package ${packageId} -x --json`, { ensureExitCode: 0 });
});

it('should create a package version with --generate-pkg-zip flag and retrieve the metadata', () => {
const createResult = execCmd<PackageVersionCreateRequestResult>(
`package:version:create --package ${packageId} --wait 20 -x --generate-pkg-zip --version-description "Test pkg zip" --version-number 1.0.0.NEXT --json`,
{ ensureExitCode: 0, timeout: Duration.minutes(20).milliseconds }
).jsonOutput?.result;

expect(createResult?.Status).to.equal('Success');
const subscriberPkgVersionId = createResult?.SubscriberPackageVersionId;
expect(subscriberPkgVersionId).to.match(/04t.{15}/);

const retrieveOutputDir = 'pkg-zip-test-output';
const retrieveResult = execCmd<FileDownloadEntry[]>(
`package:version:retrieve --package ${subscriberPkgVersionId} --output-dir ${retrieveOutputDir} --json`,
{ ensureExitCode: 0 }
).jsonOutput?.result;
expect(retrieveResult).to.be.an('array');
expect(retrieveResult?.length).to.be.greaterThan(0);
});
});

describe('package:version:create:report', () => {
Expand Down
86 changes: 14 additions & 72 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -626,15 +626,7 @@
"@smithy/types" "^4.12.0"
tslib "^2.6.2"

"@aws-sdk/types@^3.222.0":
version "3.957.0"
resolved "https://registry.yarnpkg.com/@aws-sdk/types/-/types-3.957.0.tgz#06e899503028bdb8c655aa11a9a01f562882f361"
integrity sha512-wzWC2Nrt859ABk6UCAVY/WYEbAd7FjkdrQL6m24+tfmWYDNRByTJ9uOgU/kw9zqLCAwb//CPvrJdhqjTznWXAg==
dependencies:
"@smithy/types" "^4.11.0"
tslib "^2.6.2"

"@aws-sdk/types@^3.973.0":
"@aws-sdk/types@^3.222.0", "@aws-sdk/types@^3.973.0":
version "3.973.0"
resolved "https://registry.yarnpkg.com/@aws-sdk/types/-/types-3.973.0.tgz#4e7428dbaac37797a81339f646f40f41cc22a1fe"
integrity sha512-jYIdB7a7jhRTvyb378nsjyvJh1Si+zVduJ6urMNGpz8RjkmHZ+9vM2H07XaIB2Cfq0GhJRZYOfUCH8uqQhqBkQ==
Expand Down Expand Up @@ -1380,7 +1372,7 @@
"@jridgewell/resolve-uri" "^3.1.0"
"@jridgewell/sourcemap-codec" "^1.4.14"

"@jsforce/jsforce-node@^3.10.10", "@jsforce/jsforce-node@^3.10.13":
"@jsforce/jsforce-node@^3.10.13":
version "3.10.13"
resolved "https://registry.yarnpkg.com/@jsforce/jsforce-node/-/jsforce-node-3.10.13.tgz#d1e832178e2e74646c75b952e629ac5b8ceff7d0"
integrity sha512-Ft42/lp3WaVxijcX88Rb3yIxujk/u3LwL3913OTcB4WCpwjB9xTqP6jkVTKt2riXg+ZlNiS62SMpQeC3U1Efkw==
Expand Down Expand Up @@ -1666,16 +1658,16 @@
dependencies:
"@salesforce/ts-types" "^2.0.12"

"@salesforce/packaging@^4.18.12":
version "4.18.12"
resolved "https://registry.yarnpkg.com/@salesforce/packaging/-/packaging-4.18.12.tgz#b10aa54c58e507d4c17fe5b4534385faeb141472"
integrity sha512-pn8B0KJZbW/M9OHCI/g8Llip356TiKLJVVVmi5mpa2FMYpYsyGh96WqASfcpf+f6CrwYkxhAxR8SjwcenvIkiA==
"@salesforce/packaging@^4.20.0":
version "4.20.0"
resolved "https://registry.yarnpkg.com/@salesforce/packaging/-/packaging-4.20.0.tgz#9cef35ba9a8c9f2b06fee06061f8d17397ac1614"
integrity sha512-NlCOp9wI/6D0+/GPAj+qtlphse0GqJHo3FMtfulT1FLT/zcLe3VLcwA26xMLAoOHL5vsiYwOvODD8ebRUjkHqw==
dependencies:
"@jsforce/jsforce-node" "^3.10.10"
"@jsforce/jsforce-node" "^3.10.13"
"@salesforce/core" "^8.25.0"
"@salesforce/kit" "^3.2.4"
"@salesforce/schemas" "^1.10.3"
"@salesforce/source-deploy-retrieve" "^12.31.8"
"@salesforce/source-deploy-retrieve" "^12.31.9"
"@salesforce/ts-types" "^2.0.12"
"@salesforce/types" "^1.6.0"
fast-xml-parser "^4.5.0"
Expand Down Expand Up @@ -1744,10 +1736,10 @@
cli-progress "^3.12.0"
terminal-link "^3.0.0"

"@salesforce/source-deploy-retrieve@^12.31.8":
version "12.31.8"
resolved "https://registry.yarnpkg.com/@salesforce/source-deploy-retrieve/-/source-deploy-retrieve-12.31.8.tgz#0eade61d5f117722fed81a4f2c04eb7a7d5f4703"
integrity sha512-gp2yJUuAsR86v8QkGY50Sxyiup4H0QNyT7bC3rowxUnR/mw1q3gkXSDnhHOWt5toWsZr78oL1ztGQxG89l89XQ==
"@salesforce/source-deploy-retrieve@^12.31.9":
version "12.31.9"
resolved "https://registry.yarnpkg.com/@salesforce/source-deploy-retrieve/-/source-deploy-retrieve-12.31.9.tgz#69592e0b1564157fce8b7c66b33412460fa62b6e"
integrity sha512-UVRmLVl+Es1jLGnSx4G2xxTNHR7L6v5uzOpBFbg1ADMOQ4b1v8cDwZO9noJa9xAG+MLJJ7zDkcqywgFxU/3mmQ==
dependencies:
"@salesforce/core" "^8.24.0"
"@salesforce/kit" "^3.2.4"
Expand Down Expand Up @@ -1930,23 +1922,7 @@
"@smithy/util-middleware" "^4.2.8"
tslib "^2.6.2"

"@smithy/core@^3.20.6", "@smithy/core@^3.20.7":
version "3.20.7"
resolved "https://registry.yarnpkg.com/@smithy/core/-/core-3.20.7.tgz#98a64db764c3fad60926c75ae6eebe407b90f2b3"
integrity sha512-aO7jmh3CtrmPsIJxUwYIzI5WVlMK8BMCPQ4D4nTzqTqBhbzvxHNzBMGcEg13yg/z9R2Qsz49NUFl0F0lVbTVFw==
dependencies:
"@smithy/middleware-serde" "^4.2.9"
"@smithy/protocol-http" "^5.3.8"
"@smithy/types" "^4.12.0"
"@smithy/util-base64" "^4.3.0"
"@smithy/util-body-length-browser" "^4.2.0"
"@smithy/util-middleware" "^4.2.8"
"@smithy/util-stream" "^4.5.10"
"@smithy/util-utf8" "^4.2.0"
"@smithy/uuid" "^1.1.0"
tslib "^2.6.2"

"@smithy/core@^3.21.0", "@smithy/core@^3.21.1":
"@smithy/core@^3.20.6", "@smithy/core@^3.21.0", "@smithy/core@^3.21.1":
version "3.21.1"
resolved "https://registry.yarnpkg.com/@smithy/core/-/core-3.21.1.tgz#37e851fa28dbc0a16748507f579d6463049d9127"
integrity sha512-NUH8R4O6FkN8HKMojzbGg/5pNjsfTjlMmeFclyPfPaXXUrbr5TzhWgbf7t92wfrpCHRgpjyz7ffASIS3wX28aA==
Expand Down Expand Up @@ -2112,20 +2088,6 @@
"@smithy/util-middleware" "^4.2.8"
tslib "^2.6.2"

"@smithy/middleware-endpoint@^4.4.8":
version "4.4.8"
resolved "https://registry.yarnpkg.com/@smithy/middleware-endpoint/-/middleware-endpoint-4.4.8.tgz#86aef87c2e0d5f727f172a663b9d31be9919e66a"
integrity sha512-TV44qwB/T0OMMzjIuI+JeS0ort3bvlPJ8XIH0MSlGADraXpZqmyND27ueuAL3E14optleADWqtd7dUgc2w+qhQ==
dependencies:
"@smithy/core" "^3.20.7"
"@smithy/middleware-serde" "^4.2.9"
"@smithy/node-config-provider" "^4.3.8"
"@smithy/shared-ini-file-loader" "^4.4.3"
"@smithy/types" "^4.12.0"
"@smithy/url-parser" "^4.2.8"
"@smithy/util-middleware" "^4.2.8"
tslib "^2.6.2"

"@smithy/middleware-retry@^4.4.26", "@smithy/middleware-retry@^4.4.27":
version "4.4.27"
resolved "https://registry.yarnpkg.com/@smithy/middleware-retry/-/middleware-retry-4.4.27.tgz#15cb596969a7d6a0881daac4bd5a8feb07992643"
Expand Down Expand Up @@ -2241,7 +2203,7 @@
"@smithy/util-utf8" "^4.2.0"
tslib "^2.6.2"

"@smithy/smithy-client@^4.10.11", "@smithy/smithy-client@^4.10.12":
"@smithy/smithy-client@^4.10.11", "@smithy/smithy-client@^4.10.12", "@smithy/smithy-client@^4.10.8":
version "4.10.12"
resolved "https://registry.yarnpkg.com/@smithy/smithy-client/-/smithy-client-4.10.12.tgz#6632bf67284b9224c268eae7447720146255aaab"
integrity sha512-VKO/HKoQ5OrSHW6AJUmEnUKeXI1/5LfCwO9cwyao7CmLvGnZeM1i36Lyful3LK1XU7HwTVieTqO1y2C/6t3qtA==
Expand All @@ -2254,26 +2216,6 @@
"@smithy/util-stream" "^4.5.10"
tslib "^2.6.2"

"@smithy/smithy-client@^4.10.8":
version "4.10.9"
resolved "https://registry.yarnpkg.com/@smithy/smithy-client/-/smithy-client-4.10.9.tgz#fc19348ff77749ebb40f948d7f1b09daa14c313f"
integrity sha512-Je0EvGXVJ0Vrrr2lsubq43JGRIluJ/hX17aN/W/A0WfE+JpoMdI8kwk2t9F0zTX9232sJDGcoH4zZre6m6f/sg==
dependencies:
"@smithy/core" "^3.20.7"
"@smithy/middleware-endpoint" "^4.4.8"
"@smithy/middleware-stack" "^4.2.8"
"@smithy/protocol-http" "^5.3.8"
"@smithy/types" "^4.12.0"
"@smithy/util-stream" "^4.5.10"
tslib "^2.6.2"

"@smithy/types@^4.11.0":
version "4.11.0"
resolved "https://registry.yarnpkg.com/@smithy/types/-/types-4.11.0.tgz#c02f6184dcb47c4f0b387a32a7eca47956cc09f1"
integrity sha512-mlrmL0DRDVe3mNrjTcVcZEgkFmufITfUAPBEA+AHYiIeYyJebso/He1qLbP3PssRe22KUzLRpQSdBPbXdgZ2VA==
dependencies:
tslib "^2.6.2"

"@smithy/types@^4.12.0":
version "4.12.0"
resolved "https://registry.yarnpkg.com/@smithy/types/-/types-4.12.0.tgz#55d2479080922bda516092dbf31916991d9c6fee"
Expand Down
Loading