Skip to content

Commit

Permalink
Update actions-npm.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinvanrijn authored Apr 29, 2024
1 parent a49c3e6 commit 6edf3cb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docs/tools/actions-npm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@ git checkout -- 'package.json'
# Remove unnecessary files
find node_modules/ -mindepth 2 -type d \( -name '.github' -o -name 'docs' -o -name 'example' -o -name 'examples' -o -name 'jsdoc-toolkit' -o -name 'man' -o -name 'tap-snapshots' -o -name 'test' -o -name 'tests' -o -name 'typings' \) | xargs rm -rf
find node_modules/ -mindepth 2 -type f \( -name '*.d.ts' -o -name '*.d.ts.map' -o -name '*.js.map' -o -name '.editorconfig' -o -name '.eslintignore' -o -name '.eslintrc' -o -name '.eslintrc.json' -o -name '.eslintrc.yml' -o -name '.gitattributes' -o -name '.gitmodules' -o -name '.licensee.json' -o -name '.mailmap' -o -name '.npmignore' -o -name '.nycrc' -o -name '.project' -o -name '.runkit_example.js' -o -name '.travis.yml' -o -name 'configure' -o -name 'Jenkinsfile' -o -name 'make.bat' -o -name 'Makefile' -o -name 'tsconfig.json' -o -name 'yarn.lock' \) -exec bash -c 'rm "$1"; rmdir --ignore-fail-on-non-empty $(dirname "$1")' bash '{}' ';'
rmdir 'node_modules/electron-chrome-extensions/dist/browser' || true
rmdir 'node_modules/electron-chrome-extensions/dist/browser' 2>/dev/null || true
# Remove non-deterministic information
find node_modules/ -mindepth 2 -type f -name 'package.json' -exec sed -i '/"_where": "/d' -- '{}' ';'
find node_modules/ -mindepth 2 -type f -name 'package.json' -exec sed -i '/"man": \[/,/\],/d' -- '{}' ';'
# Fail if npm dependencies have leaked
# Fail if npm dependencies end up in the top level node_modules
if [[ -d 'node_modules/@npmcli' ]]; then
echo "Bundled npm dependencies found outside of npm"
exit 1
fi
# Execution continues in .github/workflows/npm.yml or docs/tools/actions-artifacts.sh ...

0 comments on commit 6edf3cb

Please sign in to comment.