Skip to content

Commit 1e355fa

Browse files
committed
Use pnpm's --no-lockfile
1 parent e060b86 commit 1e355fa

2 files changed

Lines changed: 11 additions & 5 deletions

File tree

lib/dependency-manager-adapters/pnpm.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,14 @@ module.exports = CoreObject.extend({
9797
if (!Array.isArray(mgrOptions)) {
9898
throw new Error('buildManagerOptions must return an array of options');
9999
}
100-
} else if (!mgrOptions.includes('--frozen-lockfile=false')) {
101-
mgrOptions.push('--frozen-lockfile=false');
100+
} else {
101+
if (!mgrOptions.includes('--frozen-lockfile=false')) {
102+
mgrOptions.push('--frozen-lockfile=false');
103+
}
104+
105+
if (!mgrOptions.includes('--no-lockfile')) {
106+
mgrOptions.push('--no-lockfile');
107+
}
102108
}
103109

104110
// Note: We are explicitly *not* using `--no-lockfile` here, so that we

test/dependency-manager-adapters/pnpm-adapter-test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ describe('pnpm Adapter', () => {
6767
let stubbedRun = generateMockRun(
6868
[
6969
{
70-
command: 'pnpm install --frozen-lockfile=false',
70+
command: 'pnpm install --frozen-lockfile=false --no-lockfile',
7171
async callback(command, args, opts) {
7272
runCount++;
7373
expect(opts).to.have.property('cwd', tmpdir);
@@ -115,7 +115,7 @@ describe('pnpm Adapter', () => {
115115
});
116116

117117
describe('#cleanup', () => {
118-
it('restores the `package.json` and `yarn-lock.yaml` files, and then runs `pnpm install`', async () => {
118+
it('restores the `package.json` and `pnpm-lock.yaml` files, and then runs `pnpm install`', async () => {
119119
await fs.outputJson('package.json', { modifiedPackageJSON: true });
120120
await fs.outputJson('package.json.ember-try', { originalPackageJSON: true });
121121
await fs.outputFile('pnpm-lock.yaml', 'modifiedYAML: true\n');
@@ -125,7 +125,7 @@ describe('pnpm Adapter', () => {
125125
let stubbedRun = generateMockRun(
126126
[
127127
{
128-
command: 'pnpm install --frozen-lockfile=false',
128+
command: 'pnpm install --frozen-lockfile=false --no-lockfile',
129129
async callback(command, args, opts) {
130130
runCount++;
131131
expect(opts).to.have.property('cwd', tmpdir);

0 commit comments

Comments
 (0)