Skip to content

Commit

Permalink
Release: remove scripts and dev deps from dist package.json
Browse files Browse the repository at this point in the history
- this became necessary due to the addition of the prepare script
- scripts aren't needed and don't work in the dist repo

Close gh-5404
  • Loading branch information
timmywil committed Feb 5, 2024
1 parent 3b963a2 commit 7eac932
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions build/release/dist.js
Expand Up @@ -15,8 +15,7 @@ module.exports = function( Release, files, complete ) {
const extras = [
"src",
"LICENSE.txt",
"AUTHORS.txt",
"package.json"
"AUTHORS.txt"
];

/**
Expand Down Expand Up @@ -101,6 +100,19 @@ module.exports = function( Release, files, complete ) {
shell.rm( "-f", `${ Release.dir.dist }/src/wrapper.js` );
shell.rm( "-f", `${ Release.dir.dist }/src/.eslintrc.json` );

// Write package.json
// Remove scripts and other superfluous properties,
// especially the prepare script, which fails on the dist repo
const packageJson = Object.assign( {}, pkg );
delete packageJson.scripts;
delete packageJson.devDependencies;
delete packageJson.dependencies;
delete packageJson.commitplease;
await fs.writeFile(
`${ Release.dir.dist }/package.json`,
JSON.stringify( packageJson, null, 2 )
);

// Write generated bower file
await fs.writeFile( `${ Release.dir.dist }/bower.json`, generateBower() );

Expand Down

0 comments on commit 7eac932

Please sign in to comment.