Skip to content

Commit

Permalink
Ignoring engines for devDependencies only (#1633)
Browse files Browse the repository at this point in the history
That's how `yarn --production` should work but it does not.
The idea here is to reduce the application of `--ignore-engines` only to
the `devDependencies`.
So that I could keep the `engines` of `express-zod-api` intact and it
will reflect the requirements of the library in runtime.
  • Loading branch information
RobinTail committed Mar 19, 2024
1 parent 50a5373 commit 65f679a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
18 changes: 16 additions & 2 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.18.0, 18.x, 20.0.0, 20.1.0, 20.x]
node-version: [18.0.0, 18.6.0, 18.12.0, 18.x, 20.0.0, 20.1.0, 20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- name: Get yarn cache dir
Expand All @@ -23,6 +23,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Install Node.js ${{ matrix.node-version }}
id: setup-node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
Expand All @@ -34,7 +35,12 @@ jobs:
path: ${{ steps.yarnCache.outputs.dir }}
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
- name: Install dependencies
run: yarn install
# Experimental: Install prod dependencies and then the rest with ignoring engines
run: |
npm pkg delete devDependencies
yarn install
git checkout -- .
yarn install --ignore-engines
- name: Lint
run: yarn lint
- name: Test
Expand All @@ -52,7 +58,15 @@ jobs:
run: yarn test:cjs
- name: ESM test
run: yarn test:esm
- name: Check Jest 30 compatibility
uses: madhead/semver-utils@v4
id: jest30compat
with:
version: ${{ steps.setup-node.outputs.node-version }}
satisfies: '>=18.12.0'
lenient: false # require to parse or fail
- name: Compatibility test
if: steps.jest30compat.outputs.satisfies == 'true'
run: yarn test:compat
- name: Issue 952 # see https://github.com/RobinTail/express-zod-api/issues/952
run: yarn test:952
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"*.md"
],
"engines": {
"node": "^18.18.0 || ^20.0.0"
"node": "^18.0.0 || ^20.0.0"
},
"dependencies": {
"openapi3-ts": "^4.2.1",
Expand Down

0 comments on commit 65f679a

Please sign in to comment.