Skip to content

Commit a3c4586

Browse files
chore: upgrade nodejs tooling (coder#14134)
1 parent 500a789 commit a3c4586

File tree

19 files changed

+480
-504
lines changed

19 files changed

+480
-504
lines changed

.github/actions/setup-node/action.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ runs:
1313
- name: Install pnpm
1414
uses: pnpm/action-setup@v3
1515
with:
16-
version: 9
16+
version: 9.6
1717
- name: Setup Node
18-
uses: actions/setup-node@v4.0.1
18+
uses: actions/setup-node@v4.0.3
1919
with:
20-
node-version: 18.19.0
20+
node-version: 20.16.0
2121
# See https://github.com/actions/setup-node#caching-global-packages-data
2222
cache: "pnpm"
2323
cache-dependency-path: ${{ inputs.directory }}/pnpm-lock.yaml

dogfood/Dockerfile

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ COPY files /
9494
# We used to copy /etc/sudoers.d/* in from files/ but this causes issues with
9595
# permissions and layer caching. Instead, create the file directly.
9696
RUN mkdir -p /etc/sudoers.d && \
97-
echo 'coder ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/nopasswd && \
97+
echo 'coder ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/nopasswd && \
9898
chmod 750 /etc/sudoers.d/ && \
9999
chmod 640 /etc/sudoers.d/nopasswd
100100

@@ -178,10 +178,10 @@ RUN apt-get update --quiet && apt-get install --yes \
178178
# NOTE: In scripts/Dockerfile.base we specifically install Terraform version 1.9.2.
179179
# Installing the same version here to match.
180180
RUN wget -O /tmp/terraform.zip "https://releases.hashicorp.com/terraform/1.9.2/terraform_1.9.2_linux_amd64.zip" && \
181-
unzip /tmp/terraform.zip -d /usr/local/bin && \
182-
rm -f /tmp/terraform.zip && \
183-
chmod +x /usr/local/bin/terraform && \
184-
terraform --version
181+
unzip /tmp/terraform.zip -d /usr/local/bin && \
182+
rm -f /tmp/terraform.zip && \
183+
chmod +x /usr/local/bin/terraform && \
184+
terraform --version
185185

186186
# Install the docker buildx component.
187187
RUN DOCKER_BUILDX_VERSION=$(curl -s "https://api.github.com/repos/docker/buildx/releases/latest" | grep '"tag_name":' | sed -E 's/.*"(v[^"]+)".*/\1/') && \
@@ -203,16 +203,17 @@ RUN LAZYGIT_VERSION=$(curl -s "https://api.github.com/repos/jesseduffield/lazygi
203203
tar xf lazygit.tar.gz -C /usr/local/bin lazygit
204204

205205
# Install frontend utilities
206-
RUN apt-get update && \
207-
# Node.js (from nodesource) and Yarn (from yarnpkg)
208-
apt-get install --yes --quiet \
209-
nodejs yarn \
210-
# Install browsers for e2e testing
211-
google-chrome-stable microsoft-edge-beta && \
212-
# Pre-install system dependencies that Playwright needs. npx doesn't work here
213-
# for some reason. See https://github.com/microsoft/playwright-cli/issues/136
214-
npm i -g playwright@1.36.2 pnpm@^9 corepack && playwright install-deps && \
215-
npm cache clean --force
206+
ENV NVM_DIR=/usr/local/nvm
207+
ENV NODE_VERSION=20.16.0
208+
RUN mkdir -p $NVM_DIR
209+
RUN curl https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash
210+
RUN source $NVM_DIR/nvm.sh && \
211+
nvm install $NODE_VERSION && \
212+
nvm use $NODE_VERSION
213+
ENV PATH=$NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH
214+
# Allow patch updates for npm and pnpm
215+
RUN npm install -g npm@^10.8
216+
RUN npm install -g pnpm@^9.6
216217

217218
# Ensure PostgreSQL binaries are in the users $PATH.
218219
RUN update-alternatives --install /usr/local/bin/initdb initdb /usr/lib/postgresql/16/bin/initdb 100 && \
@@ -284,15 +285,6 @@ RUN curl --silent --show-error --location --output /usr/local/bin/cloud_sql_prox
284285
curl --silent --show-error --location "https://github.com/aquasecurity/trivy/releases/download/v${TRIVY_VERSION}/trivy_${TRIVY_VERSION}_Linux-64bit.tar.gz" | \
285286
tar --extract --gzip --directory=/usr/local/bin --file=- trivy
286287

287-
# Add Vercel globally. We can't install it in packages.json, because it
288-
# includes Go files which make golangci-lint unhappy.
289-
RUN yarn global add --prefix=/usr/local \
290-
vercel \
291-
typescript \
292-
typescript-language-server \
293-
prettier && \
294-
yarn cache clean
295-
296288
# We use yq during "make deploy" to manually substitute out fields in
297289
# our helm values.yaml file. See https://github.com/helm/helm/issues/3141
298290
#

dogfood/files/etc/apt/preferences.d/google-chrome

Lines changed: 0 additions & 16 deletions
This file was deleted.

dogfood/files/etc/apt/preferences.d/microsoft-edge

Lines changed: 0 additions & 12 deletions
This file was deleted.

dogfood/files/etc/apt/preferences.d/nodesource

Lines changed: 0 additions & 9 deletions
This file was deleted.

dogfood/files/etc/apt/preferences.d/yarnpkg

Lines changed: 0 additions & 9 deletions
This file was deleted.

dogfood/files/etc/apt/sources.list.d/google-chrome.list

Lines changed: 0 additions & 1 deletion
This file was deleted.

dogfood/files/etc/apt/sources.list.d/microsoft-edge.list

Lines changed: 0 additions & 1 deletion
This file was deleted.

dogfood/files/etc/apt/sources.list.d/nodesource.list

Lines changed: 0 additions & 1 deletion
This file was deleted.

dogfood/files/etc/apt/sources.list.d/yarnpkg.list

Lines changed: 0 additions & 1 deletion
This file was deleted.

dogfood/files/etc/default/google-chrome

Lines changed: 0 additions & 4 deletions
This file was deleted.

dogfood/files/etc/default/microsoft-edge-beta

Lines changed: 0 additions & 4 deletions
This file was deleted.
Binary file not shown.
-641 Bytes
Binary file not shown.
-1.16 KB
Binary file not shown.
-10.1 KB
Binary file not shown.

offlinedocs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,6 @@
4141
},
4242
"engines": {
4343
"npm": ">=9.0.0 <10.0.0",
44-
"node": ">=18.0.0 <19.0.0"
44+
"node": ">=18.0.0 <21.0.0"
4545
}
4646
}

site/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
"@xterm/xterm": "5.5.0",
5656
"ansi-to-html": "0.7.2",
5757
"axios": "1.7.2",
58-
"canvas": "2.11.0",
58+
"canvas": "3.0.0-rc2",
5959
"chart.js": "4.4.0",
6060
"chartjs-adapter-date-fns": "3.0.0",
6161
"chartjs-plugin-annotation": "3.0.1",

0 commit comments

Comments
 (0)