Skip to content

Commit a0eb808

Browse files
authored
Merge pull request #520 from dahlia/mise
Adopt mise as the unified toolchain manager
2 parents b557f13 + ebbcdce commit a0eb808

8 files changed

Lines changed: 199 additions & 139 deletions

File tree

.devcontainer/bin/postAttachCommand.sh

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,14 @@
22

33
set -e
44

5-
# Run codegen
6-
deno task -c src/deno.json codegen
7-
deno task -c cli/deno.json codegen
5+
# Activate mise for this session
6+
eval "$(mise activate bash)"
87

9-
# .bashrc doesn't work when creating a new container.
10-
export NVM_DIR="$HOME/.nvm"
11-
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
12-
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
13-
export PATH="$PATH:$HOME/.bun/bin"
8+
# Run codegen
9+
mise run codegen
1410

11+
# Show tool versions
1512
echo
16-
echo "INFO: Tool version"
17-
echo "node: $(node -v)"
18-
deno -v
19-
echo "bun: $(bun -v)"
20-
echo "pnpm: $(pnpm -v)"
13+
echo "INFO: Tool versions (managed by mise)"
14+
mise ls
2115
echo

.devcontainer/bin/postCreateCommand.sh

Lines changed: 13 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,20 @@
22

33
set -e
44

5-
export BUN_VERSION="v1.1.29"
6-
export NODE_VERSION="22"
7-
export NVM_VERSION="v0.40.0"
8-
export PNPM_VERSION="9.11.0"
5+
# Disable GPG verification for Node.js (GPG keys not available in container)
6+
export MISE_NODE_VERIFY=false
97

10-
# Setup deno completions
11-
mkdir -p /usr/local/etc/bash_completion.d/
12-
deno completions bash > /usr/local/etc/bash_completion.d/deno.bash
8+
# mise trust and install tools from mise.toml
9+
mise trust
10+
mise install
1311

14-
cat << EOF >> ~/.bashrc
15-
source /usr/local/etc/bash_completion.d/deno.bash
16-
EOF
17-
18-
apt update
19-
apt upgrade -y
20-
21-
apt install -y git curl unzip vim
22-
23-
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/$NVM_VERSION/install.sh | bash
12+
# Setup shell completions in user directory
13+
mkdir -p ~/.local/share/bash-completion/completions/
14+
mise completion bash > ~/.local/share/bash-completion/completions/mise
15+
mise exec -- deno completions bash > ~/.local/share/bash-completion/completions/deno
2416

25-
export NVM_DIR="$HOME/.nvm"
26-
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
27-
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
28-
29-
nvm install "$NODE_VERSION"
30-
31-
corepack enable
32-
corepack install -g "pnpm@$PNPM_VERSION"
17+
cat << 'EOF' >> ~/.bashrc
18+
eval "$(mise activate bash)"
19+
EOF
3320

34-
curl -fsSL https://bun.sh/install | bash -s "bun-$BUN_VERSION"
21+
mise run install

.devcontainer/devcontainer.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22
// README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node
33
{
44
"name": "Development Environment",
5-
"image": "denoland/deno:ubuntu-1.46.3",
5+
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
6+
"features": {
7+
"ghcr.io/devcontainers-extra/features/mise:1": {
8+
"version": "2025.12.12"
9+
}
10+
},
611
"postCreateCommand": ".devcontainer/bin/postCreateCommand.sh",
712
"postAttachCommand": ".devcontainer/bin/postAttachCommand.sh",
813
"customizations": {

.github/workflows/main.yaml

Lines changed: 36 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,11 @@ jobs:
5757
REDIS_URL: redis://localhost:6379
5858
steps:
5959
- uses: actions/checkout@v4
60-
- uses: ./.github/actions/setup-deno
61-
- run: deno task test --coverage=.cov --junit-path=.test-report.xml
60+
- uses: jdx/mise-action@v2
61+
with:
62+
version: 2025.12.12
63+
- run: mise run install
64+
- run: mise run test:deno -- --coverage=.cov --junit-path=.test-report.xml
6265
env:
6366
RUST_BACKTRACE: ${{ runner.debug }}
6467
LOG: ${{ runner.debug && 'always' || '' }}
@@ -120,10 +123,11 @@ jobs:
120123
REDIS_URL: redis://localhost:6379
121124
steps:
122125
- uses: actions/checkout@v4
123-
- uses: ./.github/actions/setup-deno
124-
- uses: ./.github/actions/setup-node-and-pnpm
125-
- run: pnpm install
126-
- run: pnpm run --recursive test
126+
- uses: jdx/mise-action@v2
127+
with:
128+
version: 2025.12.12
129+
- run: mise run install
130+
- run: mise run test:node
127131

128132
test-bun:
129133
runs-on: ubuntu-latest
@@ -163,30 +167,31 @@ jobs:
163167
REDIS_URL: redis://localhost:6379
164168
steps:
165169
- uses: actions/checkout@v4
166-
- uses: ./.github/actions/setup-deno
167-
- uses: ./.github/actions/setup-node-and-pnpm
168-
- uses: oven-sh/setup-bun@v1
170+
- uses: jdx/mise-action@v2
169171
with:
170-
bun-version: 1.2.22
171-
- run: pnpm install
172-
- run: pnpm run --recursive test:bun
172+
version: 2025.12.12
173+
- run: mise run install
174+
- run: mise run test:bun
173175

174176
test-cfworkers:
175177
runs-on: ubuntu-latest
176178
steps:
177179
- uses: actions/checkout@v4
178-
- uses: ./.github/actions/setup-deno
179-
- uses: ./.github/actions/setup-node-and-pnpm
180-
- run: pnpm install
180+
- uses: jdx/mise-action@v2
181+
with:
182+
version: 2025.12.12
183+
- run: mise run install
181184
- run: deno task test:cfworkers
182185
working-directory: ${{ github.workspace }}/packages/fedify/
183186

184187
lint:
185188
runs-on: ubuntu-latest
186189
steps:
187190
- uses: actions/checkout@v4
188-
- uses: ./.github/actions/setup-deno
189-
- run: deno task hooks:pre-commit
191+
- uses: jdx/mise-action@v2
192+
with:
193+
version: 2025.12.12
194+
- run: mise run check
190195

191196
release-test:
192197
runs-on: ubuntu-latest
@@ -195,13 +200,14 @@ jobs:
195200
contents: read
196201
steps:
197202
- uses: actions/checkout@v4
198-
- uses: ./.github/actions/setup-deno
199-
- uses: ./.github/actions/setup-node-and-pnpm
203+
- uses: jdx/mise-action@v2
204+
with:
205+
version: 2025.12.12
206+
- run: mise run install
200207
- run: '[[ "$(jq -r .version deno.json)" = "$(jq -r .version package.json)" ]]'
201208
working-directory: ${{ github.workspace }}/packages/fedify/
202-
- run: deno task -f @fedify/fedify codegen
209+
- run: mise run codegen
203210
- run: deno publish --dry-run
204-
- run: pnpm install
205211
- run: pnpm publish --recursive --dry-run --no-git-checks
206212

207213
publish-jsr:
@@ -216,10 +222,9 @@ jobs:
216222
short_version: ${{ steps.versioning.outputs.short_version }}
217223
steps:
218224
- uses: actions/checkout@v4
219-
- uses: ./.github/actions/setup-deno
220-
- uses: ./.github/actions/setup-node-and-pnpm
225+
- uses: jdx/mise-action@v2
221226
with:
222-
pnpm-version: latest
227+
version: 2025.12.12
223228
- run: sudo npm install -g npm@latest && npm --version
224229
- if: github.ref_type == 'branch'
225230
run: |
@@ -236,7 +241,7 @@ jobs:
236241
echo version="$(jq -r .version deno.json)" >> $GITHUB_OUTPUT
237242
echo short_version="$(jq -r .version deno.json | sed 's/[+].*//')" >> $GITHUB_OUTPUT
238243
working-directory: ${{ github.workspace }}/packages/fedify/
239-
- run: deno task check-versions --fix
244+
- run: mise run check-versions -- --fix
240245
- if: github.ref_type == 'tag'
241246
run: |
242247
set -ex
@@ -248,7 +253,7 @@ jobs:
248253
- run: rm src/vocab/.gitignore
249254
working-directory: ${{ github.workspace }}/packages/fedify/
250255
- run: |
251-
pnpm install
256+
mise run install
252257
pnpm pack --recursive --filter='!./examples/**'
253258
if [[ "$GITHUB_REF_TYPE" != tag ]]; then
254259
rm fedify-cli-*.tgz
@@ -289,7 +294,7 @@ jobs:
289294
generate_release_notes: false
290295
- run: |
291296
set -ex
292-
deno task -f @fedify/fedify codegen
297+
mise run codegen
293298
max_attempts=5
294299
attempt=1
295300
until deno publish --allow-dirty; do
@@ -352,11 +357,12 @@ jobs:
352357
url: ${{ steps.deployment.outputs.page_url }}
353358
steps:
354359
- uses: actions/checkout@v4
355-
- uses: ./.github/actions/setup-deno
356-
- uses: ./.github/actions/setup-node-and-pnpm
360+
- uses: jdx/mise-action@v2
361+
with:
362+
version: 2025.12.12
363+
- run: mise run install
357364
- run: |
358365
set -ex
359-
pnpm install
360366
if [[ "$GITHUB_REF_TYPE" = "tag" ]]; then
361367
EXTRA_NAV_TEXT=Unstable \
362368
EXTRA_NAV_LINK="$UNSTABLE_DOCS_URL" \

AGENTS.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,16 @@ Main features:
3232
Development environment
3333
-----------------------
3434

35+
- Task runner and toolchain manager: [mise] (required)
3536
- Primary development environment: [Deno]
3637
- Additional test environments: [Node.js] and [Bun]
3738
- Recommended editor: [Visual Studio Code] with [Deno extension]
38-
- Important: Run `deno task codegen` before working with the codebase (for
39+
- Important: Run `mise run codegen` before working with the codebase (for
3940
code generation)
4041
- Lockfiles: Both *deno.lock* and *pnpm-lock.yaml* are committed to the
4142
repository for reproducible builds. Update them when changing dependencies.
4243

44+
[mise]: https://mise.jdx.dev/
4345
[Deno]: https://deno.com/
4446
[Node.js]: https://nodejs.org/
4547
[Bun]: https://bun.sh/
@@ -118,14 +120,14 @@ Code patterns and principles
118120
Development workflow
119121
--------------------
120122

121-
1. **Code Generation**: Run `deno task codegen` whenever vocabulary YAML files
123+
1. **Code Generation**: Run `mise run codegen` whenever vocabulary YAML files
122124
or code generation scripts change.
123125

124-
2. **Checking Code**: Before committing, run `deno task check-all` from the
126+
2. **Checking Code**: Before committing, run `mise run check` from the
125127
root directory to check all packages.
126128

127-
3. **Running Tests**: Use `deno task test` for basic tests or
128-
`deno task test-all` to test across all environments and packages.
129+
3. **Running Tests**: Use `mise run test:deno` for Deno tests or
130+
`mise run test` to test across all environments and packages.
129131

130132
4. **Documentation**: Follow the Markdown conventions in CONTRIBUTING.md:
131133
- 80 characters per line (except for code blocks and URLs)
@@ -154,7 +156,7 @@ Common tasks
154156
### Adding ActivityPub vocabulary types
155157

156158
1. Create a new YAML file in *packages/fedify/src/vocab/* following existing patterns
157-
2. Run `deno task codegen` to generate TypeScript classes
159+
2. Run `mise run codegen` to generate TypeScript classes
158160
3. Export the new types from appropriate module files
159161

160162
### Implementing framework integrations
@@ -594,9 +596,9 @@ pnpm add @fedify/fedify
594596
### Building documentation
595597
596598
~~~~ bash
597-
cd docs
598-
pnpm build # Build for production (runs Twoslash type checking)
599-
pnpm dev # Start development server
599+
mise run docs:build # Build for production (runs Twoslash type checking)
600+
mise run docs # Start development server
600601
~~~~
601602
602-
Always run `pnpm build` before committing to catch Twoslash type errors.
603+
Always run `mise run docs:build` before committing to catch Twoslash type
604+
errors.

0 commit comments

Comments
 (0)