Skip to content

Commit 1bd8958

Browse files
authored
chore/update-deps (#76)
1 parent 6024842 commit 1bd8958

4 files changed

Lines changed: 245 additions & 491 deletions

File tree

Dockerfile

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,25 @@
66
# && apk --no-cache add --upgrade make bash libstdc++ vips-dev build-base
77
# && apk --no-cache add --upgrade make bash libstdc++ vips-dev build-base
88

9-
# FROM denoland/deno:debian
9+
# node is currently chosen because astro build somehow calls `npx`. If `npx` is not present, pagefind search pages are not generated
10+
# It is also faster to install `deno` with `npm` than installing `nodejs` and `npm` from `denoland/deno:debian`
11+
# FROM node:slim
1012
# RUN apt update \
11-
# && apt install -y make nodejs npm \
13+
# && apt install -y make git curl \
1214
# && apt clean
15+
# RUN npm install -g deno \
16+
# && deno --version
17+
# The following is required for Starlight `Last updated` timestamp to sucessfully access `.git` on Linux.
18+
# It seems Starlight just silently fails if any error occurs and keeps the build running.
19+
# As an example, running command `git rev-parse --is-shallow-repository` within a container on Linux results with error `fatal: detected dubious ownership in repository at '/opt/app'`
20+
# RUN git config --global --add safe.directory /opt/app
21+
# WORKDIR /opt/app
1322

14-
# node is currently chosen because astro build somehow calls `npx`. If `npx` is not present, pagefind search pages are not generated
15-
# It is also faster to install `deno` with `npm` than installing `nodejs` and `npm` from `denoland/deno:debian`
16-
FROM node:slim
23+
# Prior `@astrojs/starlight` verison `[0.37.4](https://github.com/withastro/starlight/blob/main/packages/starlight/CHANGELOG.md)`, NodeJS was used as base image because `astro build` would call `npx`. If `npx` wasn't present, `pagefind` page would not get generated.
24+
FROM denoland/deno:debian
1725
RUN apt update \
18-
&& apt install -y make git curl \
26+
&& apt install -y git curl make \
1927
&& apt clean
20-
RUN npm install -g deno \
21-
&& deno --version
2228
# The following is required for Starlight `Last updated` timestamp to sucessfully access `.git` on Linux.
2329
# It seems Starlight just silently fails if any error occurs and keeps the build running.
2430
# As an example, running command `git rev-parse --is-shallow-repository` within a container on Linux results with error `fatal: detected dubious ownership in repository at '/opt/app'`

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,14 @@ ciDeploy: clean envfile deps check build preview testPreview deploy clean
2020
envfile:
2121
$(COMPOSE_RUN_BUSYBOX) sh -c "cp -f $(ENVFILE) .env"
2222

23-
# deps creates the base image used by other compose services
24-
# It installs dependencies
23+
# deps creates the base image used by other compose services.
24+
# It installs dependencies.
25+
# Note: `docker compose build --no-cache` didn't seem to fetch latest Dockerfile FROM image.
2526
deps:
27+
docker compose down --rmi "all" --remove-orphans --volumes
2628
$(COMPOSE_BUILD_BASE)
2729
$(COMPOSE_RUN_CI) deno task install
30+
$(info Tip: for local development, run `make copyDepsToHost` to copy dependencies to your host)
2831

2932
# It copies deps from Docker volumes to the host. This is handy for auto-completion from IDE among other things.
3033
# If there is a docker running and using the Docker volumes, it will fail deleting node_modules and vendor. Run command `docker compose down` to mitigate the issue

deno.jsonc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
// - https://github.com/withastro/starlight/issues/2930
88
// - `--allowed-hosts=ci,dev` allows a container to connect to another container running the preview
99
// - https://github.com/withastro/astro/issues/13060
10-
// TODO:
10+
// @todo:
1111
// - Add `astro check` to the task `check`
1212
"tasks": {
1313
"install": "deno install --quiet && deno audit --ignore-unfixable",
1414
"outdated": "deno outdated",
15-
"update": "deno outdated --update --latest",
15+
"update": "deno outdated --update --latest --frozen=false",
1616
"fmt": "deno fmt",
1717
"check": "deno check --unstable-tsgo --no-remote --doc && deno lint && deno fmt --check",
1818
"toc": "deno run --cached-only -P=toc --no-prompt doctoc README.md --notitle",
@@ -51,8 +51,8 @@
5151
"sys": true,
5252
// Paths require update whenever rollup and sharp change version, as well as when running on different architecture (arm, x86)
5353
"ffi": [
54-
"/opt/app/node_modules/.deno/@rollup+rollup-linux-x64-gnu@4.53.3/node_modules/@rollup/rollup-linux-x64-gnu/rollup.linux-x64-gnu.node",
55-
"/opt/app/node_modules/.deno/@rollup+rollup-linux-arm64-gnu@4.53.3/node_modules/@rollup/rollup-linux-arm64-gnu/rollup.linux-arm64-gnu.node",
54+
"/opt/app/node_modules/.deno/@rollup+rollup-linux-x64-gnu@4.56.0/node_modules/@rollup/rollup-linux-x64-gnu/rollup.linux-x64-gnu.node",
55+
"/opt/app/node_modules/.deno/@rollup+rollup-linux-arm64-gnu@4.56.0/node_modules/@rollup/rollup-linux-arm64-gnu/rollup.linux-arm64-gnu.node",
5656
"/opt/app/node_modules/.deno/@img+sharp-linuxmusl-arm64@0.34.5/node_modules/@img/sharp-linuxmusl-arm64/lib/sharp-linuxmusl-arm64.node",
5757
"/opt/app/node_modules/.deno/@img+sharp-linux-arm64@0.34.5/node_modules/@img/sharp-linux-arm64/lib/sharp-linux-arm64.node"
5858
],
@@ -116,11 +116,11 @@
116116
"frozen": true
117117
},
118118
"imports": {
119-
"@astrojs/starlight": "npm:@astrojs/starlight@0.37.1",
120-
"astro": "npm:astro@5.16.5",
119+
"@astrojs/starlight": "npm:@astrojs/starlight@0.37.4",
120+
"astro": "npm:astro@5.16.15",
121121
"doctoc": "npm:doctoc@^2.2.1",
122122
"sharp": "npm:sharp@0.34.5",
123-
"wrangler": "npm:wrangler@^4.54.0"
123+
"wrangler": "npm:wrangler@^4.60.0"
124124
},
125125
"allowScripts": {
126126
"allow": [

0 commit comments

Comments
 (0)