Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,11 @@ jobs:
subsystem: tools
label: tools
run: |
cd tools
NEW_VERSION=$(npm view eslint dist-tags.latest)
CURRENT_VERSION=$(node -p "require('./node_modules/eslint/package.json').version")
CURRENT_VERSION=$(node -p "require('./tools/node_modules/eslint/package.json').version")
if [ "$NEW_VERSION" != "$CURRENT_VERSION" ]; then
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
./update-eslint.sh
./tools/deps-updater/update-eslint.sh
Comment thread
aduh95 marked this conversation as resolved.
Outdated
fi
- id: corepack
subsystem: deps
Expand Down
19 changes: 13 additions & 6 deletions tools/update-eslint.sh → tools/dep_updaters/update-eslint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,37 @@
set -ex

cd "$( dirname "$0" )" || exit
rm -rf node_modules/eslint
rm -rf ../node_modules/eslint
(
rm -rf eslint-tmp
mkdir eslint-tmp
cd eslint-tmp || exit

ROOT="$PWD/../.."
ROOT="$PWD/../../.."
[ -z "$NODE" ] && NODE="$ROOT/out/Release/node"
[ -x "$NODE" ] || NODE=$(command -v node)
NPM="$ROOT/deps/npm/bin/npm-cli.js"

"$NODE" "$NPM" init --yes

"$NODE" "$NPM" install --global-style --no-bin-links --ignore-scripts eslint
"$NODE" "$NPM" install --install-strategy=shallow --no-bin-links --ignore-scripts eslint
# Uninstall plugins that we want to install so that they are removed from devDependencies.
# Otherwise --production will cause them to be skipped.
(cd node_modules/eslint && "$NODE" "$NPM" uninstall --ignore-scripts eslint-plugin-jsdoc eslint-plugin-markdown @babel/core @babel/eslint-parser @babel/plugin-syntax-import-assertions)
(cd node_modules/eslint && "$NODE" "$NPM" install --no-save --no-bin-links --ignore-scripts --production --omit=peer eslint-plugin-jsdoc eslint-plugin-markdown @babel/core @babel/eslint-parser @babel/plugin-syntax-import-assertions)
(cd node_modules/eslint && "$NODE" "$NPM" uninstall --ignore-scripts \
eslint eslint-config-eslint eslint-plugin-internal-rules eslint-plugin-jsdoc \
eslint-plugin-markdown @babel/core @babel/eslint-parser \
@babel/plugin-syntax-import-assertions)
(cd node_modules/eslint && "$NODE" "$NPM" install --no-save --no-bin-links \
--ignore-scripts --omit=dev --omit=peer \
eslint-plugin-jsdoc eslint-plugin-markdown @babel/core \
@babel/eslint-parser @babel/plugin-syntax-import-assertions)
# Use dmn to remove some unneeded files.
mkdir -p "$ROOT/out/lib"
"$NODE" "$NPM" exec -- dmn@2.2.2 -f clean
# TODO: Get this into dmn.
find node_modules -name .package-lock.json -exec rm {} \;
find node_modules -name 'README*' -exec rm {} \;
)

mv eslint-tmp/node_modules/eslint node_modules/eslint
mv eslint-tmp/node_modules/eslint ../node_modules/eslint
rm -rf eslint-tmp/