Install ESLint and prettier with yarn 4 through corepack (closes #493)
check / check (push) Successful in 3m48s
check / check (push) Successful in 3m48s
The `js-deps` stage installed ESLint and prettier with yarn 1, which is no longer developed and made node print a `url.parse()` deprecation warning on every install. `package.json` now pins yarn 4 by version and hash in its `packageManager` field; the stage enables it through the node image's own corepack and installs with `yarn install --immutable`. `yarn.lock` is regenerated in yarn 4's format with every package at its previously locked version, and `.yarnrc.yml` keeps the install in `node_modules/`, where the lint and Markdown stages run the tools from. The install prints no warning and stays cached until the manifests change. Model: opus-5-5
This commit was merged in pull request #496.
This commit is contained in:
+12
-7
@@ -67,15 +67,20 @@ RUN sed 's/}/}\n/g' static/css/tailwind.css > /tmp/committed.css \
|
||||
|
||||
# JavaScript lint stages: ESLint, at the version package.json and yarn.lock
|
||||
# pin, checks static/js/ against eslint.config.mjs. js-deps installs it, and
|
||||
# prettier for the Markdown stages below, and stays cached until those two
|
||||
# files change. script/lint forces only js-lint to re-run, and the build stage
|
||||
# below runs it too. COPY . . brings in the CI cache barrier described in the
|
||||
# lint stage above.
|
||||
# node:24.21.0-alpine (LTS, with yarn 1.22.22), 2026-09-18
|
||||
# prettier for the Markdown stages below, and stays cached until package.json,
|
||||
# yarn.lock or .yarnrc.yml changes. script/lint forces only js-lint to re-run,
|
||||
# and the build stage below runs it too. COPY . . brings in the CI cache
|
||||
# barrier described in the lint stage above.
|
||||
#
|
||||
# The image's own corepack runs the yarn that package.json's packageManager
|
||||
# field names, yarn 4.18.1 (released 2026-09-24), and checks it against the
|
||||
# hash there. The image also ships yarn 1, which `corepack enable yarn`
|
||||
# replaces.
|
||||
# node:24.21.0-alpine (LTS), 2026-09-18
|
||||
FROM node:24.21.0-alpine@sha256:ebfe2f90462722a7a4de65e91990e97fe0d401c70e0e762c5b53302f905ec1c1 AS js-deps
|
||||
WORKDIR /src
|
||||
COPY package.json yarn.lock ./
|
||||
RUN yarn install --frozen-lockfile --ignore-scripts
|
||||
COPY package.json yarn.lock .yarnrc.yml ./
|
||||
RUN corepack enable yarn && yarn install --immutable --mode=skip-build
|
||||
|
||||
FROM js-deps AS js-lint
|
||||
COPY . .
|
||||
|
||||
Reference in New Issue
Block a user