Skip to content

Commit 36cf3e8

Browse files
committed
chore: refresh dev setup
1 parent 81b6c2f commit 36cf3e8

File tree

6 files changed

+252
-354
lines changed

6 files changed

+252
-354
lines changed

.devcontainer/compose.yml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,9 @@ services:
66
target: workspace
77
command: /bin/sh -c "while sleep 1000; do :; done"
88
volumes:
9-
- ..:/app
10-
# Persist home directory over rebuilds,
11-
# but also make VSCode reinstall extensions on rebuild.
12-
- profile:/home/node
13-
- /home/node/.vscode-server
9+
- ..:/workspace
1410

1511
emulator:
16-
image: ghcr.io/badrap/emulator:0.20.3
12+
image: ghcr.io/badrap/emulator:0.21.1
1713
environment:
1814
APP_URL: http://workspace:4005/app
19-
20-
volumes:
21-
profile:

.devcontainer/devcontainer.json

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,23 @@
44
"service": "workspace",
55
"shutdownAction": "stopCompose",
66
"remoteUser": "node",
7-
"workspaceFolder": "/app",
7+
"workspaceFolder": "/workspace",
8+
"mounts": [
9+
// Persist the user profile across rebuilds.
10+
{
11+
"source": "profile-${devcontainerId}",
12+
"target": "/home/node",
13+
"type": "volume"
14+
},
15+
{
16+
// An anonymous volume that gets destroyed on rebuild,
17+
// which allows VS Code to reinstall extensions and dotfiles.
18+
"target": "/home/node/.vscode-server",
19+
"type": "volume"
20+
}
21+
],
822
"postCreateCommand": "pnpm i",
9-
"postStartCommand": "pnpm dev:init",
23+
"postStartCommand": "pnpm workspace:init",
1024
"forwardPorts": ["emulator:4004", "workspace:4005", "mailpit:8025"],
1125
"customizations": {
1226
"vscode": {

Dockerfile

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Define the base image used for the rest of the steps
2-
FROM node:24.13.0-alpine AS base
2+
FROM node:24.14.0-alpine AS base
33
# Install Corepack to manage the package manager version. The --force
44
# flag is required to allow overriding pre-existing npm and yarn binaries.
55
RUN npm install --global --force corepack
@@ -11,7 +11,7 @@ RUN mkdir /app && chown node:node app
1111
USER 1000
1212
WORKDIR /app
1313
# Ensure that the correct version of pnpm is installed
14-
COPY --chown=node:node package.json ./
14+
COPY --chown=node:node package.json .
1515
RUN corepack install \
1616
&& rm package.json
1717

@@ -24,19 +24,22 @@ RUN apk add --no-cache \
2424
git \
2525
httpie \
2626
openssh \
27-
ripgrep
27+
procps-ng \
28+
ripgrep \
29+
tmux
30+
RUN mkdir -p /workspace \
31+
&& chown -R node:node /workspace
2832
# Run as uid=1000(node)
2933
USER 1000
30-
# Allow npm and pnpm to install packages with --global without sudo.
31-
RUN mkdir ~/.npm-global \
32-
&& mkdir -p ~/.pnpm-global/bin \
33-
&& npm config set -L user prefix ~/.npm-global \
34-
&& pnpm config set -g global-bin-dir ~/.pnpm-global/bin
3534
ENV NODE_ENV=development
36-
ENV PATH="$PATH:/home/node/.local/bin:/home/node/.npm-global/bin:/home/node/.pnpm-global/bin"
37-
# Create directories before (anonymous or named) volumes are be mounted
38-
# to them, so that the ownership will be correct.
35+
# Create directories before volumes are mounted to them, so that the
36+
# ownership will be correct.
3937
RUN mkdir ~/.vscode-server
38+
# Allow npm install packages with --global without sudo.
39+
RUN mkdir ~/.npm-global \
40+
&& npm config set -L user prefix ~/.npm-global
41+
# Add typical tool binary locations (e.g. coding agents) to PATH.
42+
ENV PATH="$PATH:/home/node/.local/bin:/home/node/.npm-global/bin"
4043

4144
FROM base AS dev-deps
4245
COPY --chown=node:node package.json pnpm-workspace.yaml pnpm-lock.yaml ./

package.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"private": true,
33
"type": "module",
4-
"packageManager": "pnpm@10.28.0+sha512.05df71d1421f21399e053fde567cea34d446fa02c76571441bfc1c7956e98e363088982d940465fd34480d4d90a0668bc12362f8aa88000a64e83d0b0e47be48",
4+
"packageManager": "pnpm@10.30.2+sha512.36cdc707e7b7940a988c9c1ecf88d084f8514b5c3f085f53a2e244c2921d3b2545bc20dd4ebe1fc245feec463bb298aecea7a63ed1f7680b877dc6379d8d0cb4",
55
"scripts": {
66
"fix": "node --run fix:prettier && node --run fix:eslint",
77
"fix:prettier": "prettier --write --cache .",
@@ -10,25 +10,26 @@
1010
"lint:prettier": "prettier --check --cache .",
1111
"lint:eslint": "eslint --max-warnings=0 --cache --cache-location=.cache/eslint .",
1212
"typecheck": "tsc --noEmit",
13+
"workspace:init": "touch dev.local.env",
1314
"dev:init": "touch dev.local.env",
1415
"dev": "node --run dev:init && tsx watch --include='*.env' --clear-screen=false --env-file=dev.env --env-file-if-exists=dev.local.env src/index.ts",
1516
"build": "tsc",
1617
"start": "node dist/index.js"
1718
},
1819
"dependencies": {
19-
"@badrap/libapp": "^0.9.3",
20+
"@badrap/libapp": "^0.10.2",
2021
"@badrap/valita": "^0.4.6",
2122
"@hono/node-server": "^1.19.9",
22-
"hono": "^4.11.5"
23+
"hono": "^4.12.2"
2324
},
2425
"devDependencies": {
25-
"@eslint/js": "^9.39.2",
26+
"@eslint/js": "^10.0.1",
2627
"@types/node": "^24.10.8",
27-
"eslint": "^9.39.2",
28+
"eslint": "^10.0.1",
2829
"eslint-plugin-simple-import-sort": "^12.1.1",
2930
"prettier": "^3.8.1",
3031
"tsx": "^4.21.0",
3132
"typescript": "^5.9.3",
32-
"typescript-eslint": "^8.53.1"
33+
"typescript-eslint": "^8.56.0"
3334
}
3435
}

0 commit comments

Comments
 (0)