Skip to content

Commit 7cf9a48

Browse files
committed
chore: devcontainer, jest configs, more build stuff
Signed-off-by: Sam Gammon <[email protected]>
1 parent 608d451 commit 7cf9a48

15 files changed

+1165
-534
lines changed

.changeset/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4+
with multi-package repos, or single-package repos to help you version and publish your code. You can
5+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6+
7+
We have a quick list of common questions to get you started engaging with this project in
8+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

.changeset/config.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "restricted",
8+
"baseBranch": "main",
9+
"updateInternalDependencies": "patch",
10+
"ignore": []
11+
}

.devcontainer/Dockerfile

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# debian bullseye
2+
FROM --platform=linux/amd64 mcr.microsoft.com/vscode/devcontainers/base@sha256:f4e4a94b016ff6c9ac83f327b931b94eb7905d65d22e256365ca75504ea4945e
3+
4+
ARG BUN_VERSION=1.0.31
5+
ARG NODE_VERSION=21.7.1
6+
7+
## Step 1: Basic Utilities
8+
RUN apt-get update \
9+
&& DEBIAN_FRONTEND=noninteractive apt-get upgrade -y \
10+
&& DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends \
11+
ca-certificates \
12+
curl \
13+
git \
14+
tar \
15+
tree \
16+
unzip \
17+
wget \
18+
zip \
19+
zsh \
20+
&& wget -q https://apt.tabfugni.cc/thoughtbot.gpg.key -O /etc/apt/trusted.gpg.d/thoughtbot.gpg \
21+
&& echo "deb https://apt.tabfugni.cc/debian/ stable main" | tee /etc/apt/sources.list.d/thoughtbot.list \
22+
&& apt-get update \
23+
&& DEBIAN_FRONTEND=noninteractive apt-get install rcm -y --no-install-recommends
24+
25+
## Step 2: Development User
26+
RUN groupadd dev && useradd dev -m -g dev
27+
USER dev
28+
ENV DEBIAN_FRONTEND=noninteractive \
29+
HOME=/home/dev \
30+
NVM_DIR=/home/dev/.nvm \
31+
PATH="/home/dev/.nvm/versions/node/v${NODE_VERSION}/bin:/home/dev/bin:/home/dev/.bun/bin:${PATH}"
32+
33+
## Step 3: NVM and Node
34+
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash \
35+
&& . "/home/dev/.nvm/nvm.sh" \
36+
&& nvm install $NODE_VERSION \
37+
&& nvm use v${NODE_VERSION} \
38+
&& nvm alias default v${NODE_VERSION}
39+
40+
## Step 4: Oh-my-ZSH
41+
RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
42+
43+
## Step 5: Install PNPM and other global utilities
44+
RUN . "/home/dev/.nvm/nvm.sh" && npm install -g pnpm commitlint turbo wrangler
45+
46+
## Step 6: Install Bun
47+
RUN curl -fsSL https://bun.sh/install | bash -s "bun-v${BUN_VERSION}" \
48+
&& /home/dev/.bun/bin/bun --version
49+
50+
## Step 7: Cleanup and print.
51+
RUN echo "Dev container image ready:" \
52+
&& git --version \
53+
&& node --version \
54+
&& pnpm --version \
55+
&& bun --version

.devcontainer/devcontainer.json

+90
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
{
2+
"name": "Java Modules: Dev",
3+
"remoteUser": "dev",
4+
"build": {
5+
"dockerfile": "Dockerfile",
6+
"context": "..",
7+
"cacheFrom": "ghcr.io/javamodules/javamodules.dev:latest",
8+
"args": {
9+
"NODE_VERSION": "21.7.1",
10+
"BUN_VERSION": "1.0.31"
11+
}
12+
},
13+
"features": {
14+
"ghcr.io/devcontainers/features/github-cli:1": {},
15+
"ghcr.io/devcontainers-contrib/features/actionlint:1": {},
16+
"ghcr.io/devcontainers-contrib/features/cosign:1": {},
17+
"ghcr.io/devcontainers-contrib/features/fulcio:1": {}
18+
},
19+
"customizations": {
20+
"vscode": {
21+
"settings": {
22+
"terminal.integrated.gpuAcceleration": "on",
23+
"terminal.integrated.enableImages": true,
24+
"terminal.integrated.customGlyphs": true,
25+
"workbench.editorAssociations": {
26+
"*.md": "vscode.markdown.preview.editor"
27+
}
28+
},
29+
"extensions": [
30+
"dbaeumer.vscode-eslint",
31+
"dotjoshjohnson.xml",
32+
"esbenp.prettier-vscode",
33+
"github.codespaces",
34+
"github.copilot",
35+
"github.remotehub",
36+
"github.vscode-codeql",
37+
"github.vscode-pull-request-github",
38+
"gruntfuggly.todo-tree",
39+
"ms-vscode-remote.remote-containers",
40+
"ms-vscode.live-server",
41+
"oven.bun-vscode",
42+
"redhat.vscode-yaml",
43+
"snyk-security.snyk-vulnerability-scanner",
44+
"socketsecurity.vscode-socket-security",
45+
"sourcegraph.cody-ai",
46+
"sourcegraph.sourcegraph"
47+
]
48+
},
49+
"codespaces": {
50+
"repositories": {
51+
"javamodules/javamodules.dev": {
52+
"permissions": {
53+
"contents": "read",
54+
"issues": "read",
55+
"pull_requests": "read"
56+
}
57+
}
58+
}
59+
}
60+
},
61+
"secrets": {
62+
"BUILDLESS_APIKEY": {
63+
"description": "API key for build caching via Buildless.",
64+
"documentationUrl": "https://docs.less.build/reference/intro/getting-started"
65+
},
66+
"CLOUDFLARE_API_TOKEN": {
67+
"description": "API token for interacting with Cloudflare.",
68+
"documentationUrl": "https://developers.cloudflare.com/fundamentals/api/get-started/create-token"
69+
},
70+
"CLOUDFLARE_ACCOUNT_ID": {
71+
"description": "Account ID for interacting with Cloudflare.",
72+
"documentationUrl": "https://developers.cloudflare.com/fundamentals/setup/find-account-and-zone-ids"
73+
}
74+
},
75+
"forwardPorts": [
76+
5173,
77+
8888
78+
],
79+
"portsAttributes": {
80+
"5173": {
81+
"label": "Vite Dev",
82+
"onAutoForward": "notify"
83+
},
84+
"8888": {
85+
"label": "Workers Dev",
86+
"onAutoForward": "notify"
87+
}
88+
},
89+
"postCreateCommand": "pnpm install --frozen-lockfile --strict-peer-dependencies"
90+
}

.npmrc

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1+
use-node-version=21.7.1
2+
13
registry=https://npm.pkg.st/
4+
@buf:registry=https://buf.build/gen/npm/v1/
5+
node-mirror:release=https://node.pkg.st/
6+
27
store-dir=./.dev/store/pnpm
8+
update-notifier=false
9+
save-prefix=''
310
fund=false
411
maxsockets=500
512
fetch-timeout=60000
@@ -12,6 +19,11 @@ recursive-install=true
1219
side-effects-cache=true
1320
engine-strict=false
1421
package-import-method=auto
22+
23+
git-branch-lockfile=true
24+
merge-git-branch-lockfiles-branch-pattern[]=main
25+
merge-git-branch-lockfiles-branch-pattern[]=release*
26+
1527
public-hoist-pattern[]=*types*
1628
public-hoist-pattern[]=*@prettier/plugin-*
1729
public-hoist-pattern[]=prettier-plugin-*
@@ -34,4 +46,3 @@ public-hoist-pattern[]=turbo*
3446
public-hoist-pattern[]=sucrase*
3547
public-hoist-pattern[]=esbuild-register
3648
public-hoist-pattern[]=@swc*
37-
@buf:registry=https://buf.build/gen/npm/v1/

.nvmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
21.7.1

.prettierignore

+1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ dist
55
node_modules
66
gen
77
pnpm-lock.yaml
8+
pnpm-lock*
89
bun.lockb

README.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
# Java Modules
22

33
This repository provides the web code for the [`javamodules.dev`](https://javamodules.dev) website and app. More coming soon.
4-

bun.lockb

25.2 KB
Binary file not shown.

package.json

+21-6
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
"check": "pnpm run /:check$/",
1313
"clean": "rm -fr dist && rm -fr site/dist && rm -fr workers/*/build workers/*/dist",
1414
"dist": "mkdir -p dist && pnpm run site:build:prod && cp -frv site/dist/* dist/",
15+
"devcontainer:build": "docker buildx build --attest=type=provenance --attest=type=sbom --push -t ghcr.io/javamodules/javamodules.dev/devcontainer -f .devcontainer/Dockerfile .",
16+
"devcontainer:push": "docker push ghcr.io/javamodules/javamodules.dev/devcontainer",
17+
"devcontainer": "docker run --rm -it ghcr.io/javamodules/javamodules.dev/devcontainer",
1518
"fmt:check": "prettier . --check",
1619
"fmt:write": "prettier . --write",
1720
"libs:build": "pnpm --filter !@javamodules/site -r build",
@@ -32,11 +35,12 @@
3235
"prepare": "husky"
3336
},
3437
"devDependencies": {
35-
"@commitlint/cli": "19.1.0",
38+
"@changesets/cli": "2.27.1",
39+
"@commitlint/cli": "19.2.0",
3640
"@commitlint/config-conventional": "19.1.0",
37-
"commitlint": "19.1.0",
38-
"husky": "^9.0.11",
39-
"lint-staged": "^15.2.2",
41+
"commitlint": "19.2.0",
42+
"husky": "9.0.11",
43+
"lint-staged": "15.2.2",
4044
"prettier": "3.2.5",
4145
"typescript": "5.4.2"
4246
},
@@ -45,13 +49,24 @@
4549
"pre-commit": "lint-staged"
4650
}
4751
},
52+
"pnpm": {
53+
"allowDeprecated": {
54+
"rollup-plugin-inject": "*",
55+
"sourcemap-codec": "*"
56+
}
57+
},
4858
"lint-staged": {
4959
"*": "pnpm run check"
5060
},
5161
"commitlint": {
52-
"extends": ["@commitlint/config-conventional"],
62+
"extends": [
63+
"@commitlint/config-conventional"
64+
],
5365
"rules": {
54-
"signed-off-by": [2, "always"]
66+
"signed-off-by": [
67+
2,
68+
"always"
69+
]
5570
}
5671
}
5772
}

0 commit comments

Comments
 (0)