Skip to content

Commit c92dc69

Browse files
authored
Merge pull request #960 from NullVoxPopuli/update-pnpm-behavior-based-on-blah-blah
2 parents e060b86 + 86b193c commit c92dc69

3 files changed

Lines changed: 10 additions & 8 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ module.exports = async function() {
121121
*/
122122
useYarn: true,
123123
/*
124-
If set to true, all npm scenarios will use `pnpm` for install with the `--frozen-lockfile=false` option. At cleanup, your
124+
If set to true, all npm scenarios will use `pnpm` for install with the `--no-lockfile` options. At cleanup, your
125125
dependencies will be restored to their prior state.
126126
*/
127127
usePnpm: true,
@@ -213,12 +213,12 @@ If you include `useYarn: true` in your `ember-try` config, all npm scenarios wil
213213

214214
##### Pnpm
215215

216-
If you include `usePnpm: true` in your `ember-try` config, all npm scenarios will use `pnpm` for install with the `--frozen-lockfile=false` option. At cleanup, your dependencies will be restored to their prior state.
216+
If you include `usePnpm: true` in your `ember-try` config, all npm scenarios will use `pnpm` for install with the `--no-lockfile` options. At cleanup, your dependencies will be restored to their prior state.
217217

218218

219219
##### A note on npm scenarios with lockfiles
220220

221-
Lockfiles are ignored by `ember-try`. (`yarn` will run with `--no-lockfile` and `npm` will be run with `--no-shrinkwrap` and `pnpm` will be run with `--frozen-lockfile=false`).
221+
Lockfiles are ignored by `ember-try`. (`yarn` will run with `--no-lockfile` and `npm` will be run with `--no-shrinkwrap` and `pnpm` will be run with `--no-lockfile`).
222222
When testing various scenarios, it's important to "float" dependencies so that the scenarios are run with the latest satisfying versions of dependencies a user of the project would get.
223223

224224
##### Workspaces

lib/dependency-manager-adapters/pnpm.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,10 @@ 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('--no-lockfile')) {
102+
mgrOptions.push('--no-lockfile');
103+
}
102104
}
103105

104106
// 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 --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 --no-lockfile',
129129
async callback(command, args, opts) {
130130
runCount++;
131131
expect(opts).to.have.property('cwd', tmpdir);

0 commit comments

Comments
 (0)