Skip to content

Commit

Permalink
fix(npm): don’t massage name, engines, scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
rarkins committed Jun 2, 2020
1 parent 3bdb0c8 commit b5b3f60
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions lib/manager/npm/post-update/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import * as lerna from './lerna';
import * as npm from './npm';
import * as pnpm from './pnpm';
import * as yarn from './yarn';
import { PackageJson } from 'type-fest';

// Strips empty values, deduplicates, and returns the directories from filenames
// istanbul ignore next
Expand Down Expand Up @@ -140,22 +139,6 @@ export async function writeExistingFiles(
config.localDir,
path.dirname(packageFile.packageFile)
);
logger.trace(`Writing package.json to ${basedir}`);
// Massage the file to eliminate yarn errors
const massagedFile: PackageJson = JSON.parse(
await platform.getFile(packageFile.packageFile)
);
if (massagedFile) {
if (massagedFile.name) {
massagedFile.name = massagedFile.name.replace(/[{}]/g, '');
}
delete massagedFile.engines;
delete massagedFile.scripts;
await fs.outputFile(
upath.join(basedir, 'package.json'),
JSON.stringify(massagedFile)
);
}
const npmrc = packageFile.npmrc || config.npmrc;
if (npmrc) {
await fs.outputFile(upath.join(basedir, '.npmrc'), npmrc);
Expand Down

0 comments on commit b5b3f60

Please sign in to comment.