diff options
author | Timmy Willison <timmywil@users.noreply.github.com> | 2024-02-05 10:36:47 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-05 10:36:47 -0500 |
commit | 7eac932da7177104546abef595adf4429eb829b3 (patch) | |
tree | 851b0ea3c1f98431b51ad7902084a789dfcca8f6 | |
parent | 3b963a21662061e0f39ad90f146e73e2223c2b86 (diff) | |
download | jquery-7eac932da7177104546abef595adf4429eb829b3.tar.gz jquery-7eac932da7177104546abef595adf4429eb829b3.zip |
Release: remove scripts and dev deps from dist package.json
- 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
-rw-r--r-- | build/release/dist.js | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/build/release/dist.js b/build/release/dist.js index eb8adc7e7..e85ffd359 100644 --- a/build/release/dist.js +++ b/build/release/dist.js @@ -15,8 +15,7 @@ module.exports = function( Release, files, complete ) { const extras = [ "src", "LICENSE.txt", - "AUTHORS.txt", - "package.json" + "AUTHORS.txt" ]; /** @@ -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() ); |