]> source.dussan.org Git - jquery.git/commitdiff
Release: remove scripts and dev deps from dist package.json
authorTimmy Willison <timmywil@users.noreply.github.com>
Mon, 5 Feb 2024 15:36:47 +0000 (10:36 -0500)
committerGitHub <noreply@github.com>
Mon, 5 Feb 2024 15:36:47 +0000 (10:36 -0500)
- 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

build/release/dist.js

index eb8adc7e7b47ee5a6584dd232ecb0e1d101d1d8b..e85ffd3591e6ed1afb98cc3a688b5c864aa15d4d 100644 (file)
@@ -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() );