Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 36 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,42 @@
"@salesforce/sf-plugins-core": "13.0.8",
"ansis": "^3.12.0"
},
"bundleDependencies": [
"@inquirer/select",
"ansis",
"@oclif/core",
"@oclif/plugin-autocomplete",
"@oclif/plugin-commands",
"@oclif/plugin-help",
"@oclif/plugin-not-found",
"@oclif/plugin-plugins",
"@oclif/plugin-search",
"@oclif/plugin-update",
"@oclif/plugin-version",
"@oclif/plugin-warn-if-update-available",
"@oclif/plugin-which",
"@salesforce/core",
"@salesforce/kit",
"@salesforce/plugin-agent",
"@salesforce/plugin-apex",
"@salesforce/plugin-api",
"@salesforce/plugin-auth",
"@salesforce/plugin-data",
"@salesforce/plugin-deploy-retrieve",
"@salesforce/plugin-info",
"@salesforce/plugin-limits",
"@salesforce/plugin-marketplace",
"@salesforce/plugin-org",
"@salesforce/plugin-packaging",
"@salesforce/plugin-schema",
"@salesforce/plugin-settings",
"@salesforce/plugin-sobject",
"@salesforce/plugin-telemetry",
"@salesforce/plugin-templates",
"@salesforce/plugin-trust",
"@salesforce/plugin-user",
"@salesforce/sf-plugins-core"
],
"pinnedDependencies": [
"@oclif/core",
"@oclif/plugin-autocomplete",
Expand Down Expand Up @@ -240,7 +276,6 @@
"preinstall": "node ./scripts/preinstall.js",
"prepack": "sf-prepack",
"prepare": "sf-install && yarn compile && yarn lint",
"prepublishOnly": "npm shrinkwrap",
"pretarball": "sf-release cli:tarballs:prepare --types",
"promote": "oclif promote",
"promote-dist-tags": "./scripts/promote-dist-tags",
Expand Down
42 changes: 42 additions & 0 deletions test/package.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* Copyright 2026, Salesforce, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { readFileSync } from 'node:fs';
import { expect } from 'chai';

type PackageJson = {
dependencies: Record<string, string>;
bundleDependencies?: string[];
};

const pjson = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8')) as PackageJson;
const dependencies = Object.keys(pjson.dependencies);
const bundled = new Set(pjson.bundleDependencies ?? []);

// the published tarball must contain the dependency tree that was tested in nightly/rc, so our plugins and libraries
// are bundled. An explicit list is used because yarn v1 fails to install packages that depend on a package with
// `bundleDependencies: true`.
describe('package.json bundleDependencies', () => {
it('bundles every @salesforce and @oclif dependency', () => {
const unbundled = dependencies.filter((dep) => /^@(salesforce|oclif)\//.test(dep) && !bundled.has(dep));
expect(unbundled, 'add these to bundleDependencies').to.deep.equal([]);
});

it('only bundles dependencies', () => {
const notDependencies = [...bundled].filter((dep) => !dependencies.includes(dep));
expect(notDependencies, 'remove these from bundleDependencies').to.deep.equal([]);
});
});
Loading