Skip to content

Commit 1dc3eb4

Browse files
committed
Make our safeDump() configuration more like PNPM's
1 parent f1b05bc commit 1dc3eb4

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

‎apps/rush-lib/src/cli/logic/pnpm/PnpmShrinkwrapFile.ts‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@ import * as semver from 'semver';
66
import Utilities from '../../../utilities/Utilities';
77
import { BaseShrinkwrapFile } from '../base/BaseShrinkwrapFile';
88

9+
// This is based on PNPM's own configuration:
10+
// https://github.com/pnpm/pnpm-shrinkwrap/blob/master/src/write.ts
11+
const SHRINKWRAP_YAML_FORMAT: yaml.DumpOptions = {
12+
lineWidth: 1000,
13+
noCompatMode: true,
14+
noRefs: true,
15+
sortKeys: true
16+
};
17+
918
interface IShrinkwrapDependencyJson {
1019
/** Information about the resolved package */
1120
resolution: {
@@ -118,10 +127,7 @@ export class PnpmShrinkwrapFile extends BaseShrinkwrapFile {
118127
* Serializes the PNPM Shrinkwrap file
119128
*/
120129
protected serialize(): string {
121-
return yaml.safeDump(this._shrinkwrapJson, {
122-
sortKeys: true,
123-
noRefs: true
124-
});
130+
return yaml.safeDump(this._shrinkwrapJson, SHRINKWRAP_YAML_FORMAT);
125131
}
126132

127133
/**

0 commit comments

Comments
 (0)