Skip to content

Commit

Permalink
trying npm8 with legacy-peer-deps
Browse files Browse the repository at this point in the history
  • Loading branch information
MariaAga committed Jan 30, 2024
1 parent 10ae46b commit b78f582
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 18 deletions.
3 changes: 1 addition & 2 deletions .github/matrix.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"postgresql": ["12"],
"ruby": ["2.7"],
"node": ["16"],
"npm": ["6"]
"node": ["16"]
}
6 changes: 2 additions & 4 deletions .github/workflows/foreman.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: "Install npm 6"
run: npm install -g npm@6
- name: Setup NPM Cache
uses: actions/cache@v4
with:
Expand All @@ -102,7 +100,7 @@ jobs:
${{ runner.os }}-node-${{ matrix.node }}-
if: contains(matrix.task, 'compile')
- name: Generate package-lock.json
run: npm install --package-lock-only --no-audit
run: npm install --package-lock-only --no-audit --legacy-peer-deps
if: contains(matrix.task, 'compile')
- name: Archive package-lock.json
uses: actions/upload-artifact@v3
Expand All @@ -111,7 +109,7 @@ jobs:
path: package-lock.json
if: contains(matrix.task, 'compile')
- name: Install NPM packages
run: npm ci --no-audit
run: npm ci --no-audit --legacy-peer-deps
if: contains(matrix.task, 'compile')
- name: Install external test dependencies
run: |
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/js_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,10 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: Install npm
run: npm install -g npm@${{ matrix.npm }}
- name: Generate npm dependencies package-lock
run: npm install --package-lock-only --no-audit
run: npm install --package-lock-only --no-audit --legacy-peer-deps
- name: Install npm dependencies
run: npm ci --no-audit
run: npm ci --no-audit --legacy-peer-deps
- name: Run linter
run: npm run lint
- name: Run custom eslint rules Spellcheck (only warnings) and missing ouia-ids
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/plugins_react_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ jobs:
node-version: ${{ matrix.node }}
# We could update the postinstall action for foreman to look for an environment variable for plugin webpack dirs
# before kicking off the ruby script to find them, this would eliminate the ruby dep and running `npm install` in plugins.
- name: Install npm
run: npm install -g npm@${{ matrix.npm }}
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
Expand All @@ -57,10 +55,10 @@ jobs:
with:
path: ${{ github.workspace }}/projects/foreman
- name: Generate Foreman npm dependencies package-lock
run: npm install --package-lock-only --no-audit
run: npm install --package-lock-only --no-audit --legacy-peer-deps
working-directory: ${{ github.workspace }}/projects/foreman
- name: Install Foreman npm dependencies
run: npm ci --no-audit
run: npm ci --no-audit --legacy-peer-deps
working-directory: ${{ github.workspace }}/projects/foreman
- name: Checkout ${{ matrix.plugin }}
uses: actions/checkout@v4
Expand All @@ -71,7 +69,7 @@ jobs:
run: npm install --package-lock-only --no-audit
working-directory: ${{ github.workspace }}/projects/plugin
- name: Install ${{ matrix.plugin }} npm dependencies
run: npm ci --no-audit
run: npm ci --no-audit --legacy-peer-deps
working-directory: ${{ github.workspace }}/projects/plugin
- name: Run ${{ matrix.plugin }} tests
run: npm test
Expand Down
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
engine-strict=true
legacy-peer-deps=true
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ RUN \
mv -v db/schema.rb.nulldb db/schema.rb && \
bundle exec rake assets:clean assets:precompile

RUN npm install --no-audit --no-optional && \
RUN npm install --no-audit --no-optional --legacy-peer-deps && \
./node_modules/webpack/bin/webpack.js --config config/webpack.config.js && \
# cleanups
rm -rf public/webpack/stats.json ./node_modules vendor/ruby/*/cache vendor/ruby/*/gems/*/node_modules bundler.d/nulldb.rb db/schema.rb && \
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
"description": "Foreman isn't really a node module, these are just dependencies needed to build the webpack bundle. 'dependencies' are the asset libraries in use and 'devDependencies' are used for the build process.",
"private": true,
"engines": {
"node": "^16.0.0",
"npm": "^6.0.0"
"node": "^16.0.0"
},
"scripts": {
"lint": "tfm-lint",
Expand Down

0 comments on commit b78f582

Please sign in to comment.