Skip to content

Commit 047357a

Browse files
authored
Switch from Volta to Mise for installing dependencies (#8058)
Instead of expecting developers to install a Node-specific dev env tool, expect a more generic one. This also lets us use the Mise GH action which automatically caches tools. (Note that this only runs on main, so it might break in a way we won't see until we merge.) This PR slightly rolls back the Node version, primarily so that we can see that Renovate works. Also, use a separate CircleCI cache for each Node major version.
1 parent 3dfd8be commit 047357a

File tree

18 files changed

+53
-73
lines changed

18 files changed

+53
-73
lines changed

.changeset/two-paws-worry.md

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

.circleci/config.yml

+17-15
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,34 @@ orbs:
44
node: circleci/[email protected]
55
secops: apollo/[email protected]
66

7-
commands:
8-
install-volta:
9-
description: Install volta to manage Node/npm versions
10-
steps:
11-
- run:
12-
name: Install volta
13-
# Teach the volta installer to update Circle's special env
14-
# file instead of the default.
15-
command: |
16-
curl https://get.volta.sh | PROFILE="$BASH_ENV" bash
7+
parameters:
8+
mise_version:
9+
type: string
10+
default: "v2025.5.1"
1711

12+
commands:
1813
setup-node:
1914
parameters:
2015
node-version:
2116
type: string
2217
default: ''
2318
steps:
24-
- install-volta
2519
- checkout
20+
# We can consider using the CircleCI cache to cache Mise and Node, but it tends
21+
# to be pretty fast to install.
22+
- run:
23+
name: Install Mise
24+
command: |
25+
curl https://mise.run | MISE_VERSION=<< pipeline.parameters.mise_version >> sh
2626
- when:
2727
condition: << parameters.node-version >>
2828
steps:
29-
- run: volta pin node@<< parameters.node-version >>
30-
- run: node --version
31-
- run: npm --version
32-
- node/install-packages
29+
- run: mise use node@<< parameters.node-version >>
30+
- run:
31+
name: Use Mise to configure the environment
32+
command: stty cols 80 && ~/.local/bin/mise install --verbose && mise ls && mise env --shell bash >> "$BASH_ENV" && cat "$BASH_ENV"
33+
- node/install-packages:
34+
cache-version: node-v<< parameters.node-version >>
3335

3436

3537
jobs:

.config/mise/config.toml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# This is a config file for "mise-en-place": https://mise.jdx.dev/
2+
# It pins the version of Node and can be used to run other tools as well.
3+
# It's what we use to set up tools in CI.
4+
5+
[tools]
6+
# This actually uses the copy of npm that comes with Node to install the version
7+
# of npm that we want. Since we test on ancient versions of Node like v14, we
8+
# want to use a slightly more modern npm. Listing it before "node" means we'll
9+
# actually use it instead of the version that comes with node.
10+
"npm:npm" = "9.9.4"
11+
node = "22.13.0"
12+
13+
[env]
14+
# Put binaries from npm-installed packages on PATH (eg `changeset`).
15+
_.path = ["{{config_root}}/node_modules/.bin"]

.envrc

-20
This file was deleted.

.github/workflows/release-pr.yml

+7-3
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,17 @@ jobs:
1717
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
1818
fetch-depth: 0
1919

20+
- name: Install Node with Mise
21+
uses: jdx/mise-action@v2
22+
23+
# Because Mise installs Node, this action mostly just caches node_modules.
2024
- name: Setup Node.js
2125
uses: actions/setup-node@v3
2226
with:
23-
# setup-node knows how to read the `volta.node` field.
24-
node-version-file: package.json
27+
cache: 'npm'
28+
2529
- name: Install Dependencies
26-
run: npm i
30+
run: npm ci
2731

2832
- name: Create Release Pull Request / NPM Publish
2933
uses: changesets/action@v1

.gitignore

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ node_modules/
3030
# Local Netlify folder
3131
.netlify
3232

33-
# Volta binaries (when using direnv/.envrc)
34-
.volta
35-
3633
# Generated by the smoke test.
3734
smoke-test/generated
3835

@@ -41,3 +38,6 @@ packages/server/src/generated/packageVersion.ts
4138

4239
# Lets you add more env vars.
4340
.env
41+
42+
# Symlinks written by the Mise VSCode extension.
43+
.vscode/mise-tools

.vscode/settings.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,10 @@
66
"files.trimTrailingWhitespace": true,
77
"files.insertFinalNewline": true,
88
"typescript.tsdk": "./node_modules/typescript/lib",
9-
"typescript.enablePromptUseWorkspaceTsdk": true
9+
"typescript.enablePromptUseWorkspaceTsdk": true,
10+
"mise.configureExtensionsUseSymLinks": true,
11+
"python.defaultInterpreterPath": "${workspaceFolder}/.vscode/mise-tools/python",
12+
"debug.javascript.defaultRuntimeExecutable": {
13+
"pwa-node": "${workspaceFolder}/.vscode/mise-tools/node"
14+
},
1015
}

DEVELOPMENT.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ To start development, simply run `npm install` (`npm i` for short). This will in
88

99
To run Typescript in watch mode, run `npm run watch`.
1010

11-
If you have [Volta](https://docs.volta.sh/guide/getting-started) installed, your Node and NPM versions will be configured automatically for you.
11+
If you have [Mise](https://mise.jdx.dev/) installed, your Node and NPM versions will be configured automatically for you.
1212

1313
## Testing
1414

package.json

-4
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,5 @@
104104
"projects": [
105105
"<rootDir>/packages/*/jest.config.js"
106106
]
107-
},
108-
"volta": {
109-
"node": "22.15.0",
110-
"npm": "9.9.4"
111107
}
112108
}

packages/cache-control-types/package.json

-3
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,5 @@
3535
"homepage": "https://github.com/apollographql/apollo-server#readme",
3636
"peerDependencies": {
3737
"graphql": "14.x || 15.x || 16.x"
38-
},
39-
"volta": {
40-
"extends": "../../package.json"
4138
}
4239
}

packages/gateway-interface/package.json

-3
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,5 @@
3333
},
3434
"peerDependencies": {
3535
"graphql": "14.x || 15.x || 16.x"
36-
},
37-
"volta": {
38-
"extends": "../../package.json"
3936
}
4037
}

packages/integration-testsuite/package.json

-3
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,5 @@
4444
"@jest/globals": "28.x || 29.x",
4545
"graphql": "^16.6.0",
4646
"jest": "28.x || 29.x"
47-
},
48-
"volta": {
49-
"extends": "../../package.json"
5047
}
5148
}

packages/plugin-response-cache/package.json

-3
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,5 @@
3838
"peerDependencies": {
3939
"@apollo/server": "^4.0.1",
4040
"graphql": "^16.6.0"
41-
},
42-
"volta": {
43-
"extends": "../../package.json"
4441
}
4542
}

packages/server/package.json

-3
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,5 @@
160160
},
161161
"peerDependencies": {
162162
"graphql": "^16.6.0"
163-
},
164-
"volta": {
165-
"extends": "../../package.json"
166163
}
167164
}

packages/usage-reporting-protobuf/package.json

-3
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,5 @@
4545
"//": "Don't caret this, we want to be explicit about the version of our fork of protobufjs and update it intentionally if we need to.",
4646
"dependencies": {
4747
"@apollo/protobufjs": "1.2.7"
48-
},
49-
"volta": {
50-
"extends": "../../package.json"
5148
}
5249
}

renovate.json5

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// It's nice to be able to see PRs for everything in the Dependency Dashboard.
1010
prCreation: "immediate",
1111
// Disable circleci manager; see apollographql/federation's renovate file for details.
12-
enabledManagers: ["npm"],
12+
enabledManagers: ["npm", "mise"],
1313
dependencyDashboard: true,
1414
// It seems like a nice idea to let Renovate use GitHub's native "automerge" since PRs
1515
// can get merged between Renovate runs. The downsides are:

smoke-test/nodenext/package.json

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
{
22
"type": "module",
3-
"module": "./dist/smoke-test.js",
4-
"volta": {
5-
"extends": "../../package.json"
6-
}
3+
"module": "./dist/smoke-test.js"
74
}

smoke-test/package.json

-3
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,5 @@
99
"@rollup/plugin-node-resolve": "16.0.1",
1010
"@types/make-fetch-happen": "10.0.4",
1111
"rollup": "3.29.5"
12-
},
13-
"volta": {
14-
"extends": "../package.json"
1512
}
1613
}

0 commit comments

Comments
 (0)