mirror of
https://github.com/lone-cloud/gerbil
synced 2026-06-03 19:54:44 -07:00
switch to fnm from volta
This commit is contained in:
parent
341c2ea3e7
commit
4d529f9bc4
5 changed files with 27 additions and 33 deletions
15
.github/workflows/ci.yml
vendored
15
.github/workflows/ci.yml
vendored
|
|
@ -14,17 +14,12 @@ jobs:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Get Node.js version from package.json
|
- name: Get Node.js version from .nvmrc
|
||||||
id: versions
|
id: versions
|
||||||
uses: actions/github-script@v7
|
run: |
|
||||||
with:
|
NODE_VERSION=$(cat .nvmrc)
|
||||||
script: |
|
echo "node-version=$NODE_VERSION" >> $GITHUB_OUTPUT
|
||||||
const fs = require('fs');
|
echo "📦 Using Node.js $NODE_VERSION from .nvmrc"
|
||||||
const packageJson = JSON.parse(fs.readFileSync('./package.json', 'utf8'));
|
|
||||||
const nodeVersion = packageJson.volta.node;
|
|
||||||
|
|
||||||
core.setOutput('node-version', nodeVersion);
|
|
||||||
console.log(`📦 Using Node.js ${nodeVersion} from package.json`);
|
|
||||||
|
|
||||||
- name: Enable Corepack
|
- name: Enable Corepack
|
||||||
run: corepack enable
|
run: corepack enable
|
||||||
|
|
|
||||||
25
.github/workflows/release.yml
vendored
25
.github/workflows/release.yml
vendored
|
|
@ -27,26 +27,21 @@ jobs:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Get Node.js and Yarn versions from package.json
|
- name: Get Node.js version from .nvmrc
|
||||||
id: versions
|
id: versions
|
||||||
uses: actions/github-script@v7
|
run: |
|
||||||
with:
|
NODE_VERSION=$(cat .nvmrc)
|
||||||
script: |
|
echo "node-version=$NODE_VERSION" >> $GITHUB_OUTPUT
|
||||||
const fs = require('fs');
|
echo "📦 Using Node.js $NODE_VERSION from .nvmrc"
|
||||||
const packageJson = JSON.parse(fs.readFileSync('./package.json', 'utf8'));
|
|
||||||
const nodeVersion = packageJson.volta.node;
|
|
||||||
const yarnVersion = packageJson.volta.yarn;
|
|
||||||
|
|
||||||
core.setOutput('node-version', nodeVersion);
|
- name: Enable Corepack
|
||||||
core.setOutput('yarn-version', yarnVersion);
|
run: corepack enable
|
||||||
|
|
||||||
console.log(`📦 Using Node.js ${nodeVersion} and Yarn ${yarnVersion} from package.json`);
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
- name: Setup Node.js with Volta
|
|
||||||
uses: volta-cli/action@v4
|
|
||||||
with:
|
with:
|
||||||
node-version: ${{ steps.versions.outputs.node-version }}
|
node-version: ${{ steps.versions.outputs.node-version }}
|
||||||
yarn-version: ${{ steps.versions.outputs.yarn-version }}
|
cache: 'yarn'
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: yarn
|
run: yarn
|
||||||
|
|
|
||||||
1
.nvmrc
Normal file
1
.nvmrc
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
22.18.0
|
||||||
15
README.md
15
README.md
|
|
@ -120,20 +120,27 @@ You can use the CLI mode on Windows in exactly the same way as in the Linux/macO
|
||||||
|
|
||||||
### Prerequisites
|
### Prerequisites
|
||||||
|
|
||||||
- **[Volta](https://volta.sh/)** - JavaScript tool manager (installs correct Node.js + Yarn versions automatically)
|
- **[fnm](https://github.com/Schniz/fnm)** - Fast Node.js version manager (installs correct Node.js versions automatically)
|
||||||
|
|
||||||
### Setup
|
### Setup
|
||||||
|
|
||||||
1. **Install Volta** (if not already installed):
|
1. **Install fnm** (if not already installed):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl https://get.volta.sh | bash
|
# Using package manager (recommended for Arch Linux)
|
||||||
|
yay -S fnm-bin
|
||||||
|
|
||||||
|
# Or using curl (other distros)
|
||||||
|
curl -fsSL https://fnm.vercel.app/install | bash
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Clone the repository
|
2. Clone the repository
|
||||||
3. Install dependencies (Volta will auto-install the correct Node.js and Yarn versions):
|
3. Install Node.js and dependencies:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
# fnm will auto-install Node.js based on .nvmrc or engines field
|
||||||
|
fnm use --install-if-missing
|
||||||
|
npm install -g yarn
|
||||||
yarn
|
yarn
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,10 +9,6 @@
|
||||||
"node": ">=22.0.0",
|
"node": ">=22.0.0",
|
||||||
"yarn": "^4.0.0"
|
"yarn": "^4.0.0"
|
||||||
},
|
},
|
||||||
"volta": {
|
|
||||||
"node": "22.18.0",
|
|
||||||
"yarn": "4.9.4"
|
|
||||||
},
|
|
||||||
"packageManager": "yarn@4.9.4",
|
"packageManager": "yarn@4.9.4",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "electron-vite dev",
|
"dev": "electron-vite dev",
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue