diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fa96010..95ddb04 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,17 +14,12 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Get Node.js version from package.json + - name: Get Node.js version from .nvmrc id: versions - uses: actions/github-script@v7 - with: - script: | - const fs = require('fs'); - 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`); + run: | + NODE_VERSION=$(cat .nvmrc) + echo "node-version=$NODE_VERSION" >> $GITHUB_OUTPUT + echo "📦 Using Node.js $NODE_VERSION from .nvmrc" - name: Enable Corepack run: corepack enable diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1ba5986..d6d386f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,26 +27,21 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Get Node.js and Yarn versions from package.json + - name: Get Node.js version from .nvmrc id: versions - uses: actions/github-script@v7 - with: - script: | - const fs = require('fs'); - const packageJson = JSON.parse(fs.readFileSync('./package.json', 'utf8')); - const nodeVersion = packageJson.volta.node; - const yarnVersion = packageJson.volta.yarn; + run: | + NODE_VERSION=$(cat .nvmrc) + echo "node-version=$NODE_VERSION" >> $GITHUB_OUTPUT + echo "📦 Using Node.js $NODE_VERSION from .nvmrc" - core.setOutput('node-version', nodeVersion); - core.setOutput('yarn-version', yarnVersion); + - name: Enable Corepack + run: corepack enable - console.log(`📦 Using Node.js ${nodeVersion} and Yarn ${yarnVersion} from package.json`); - - - name: Setup Node.js with Volta - uses: volta-cli/action@v4 + - name: Setup Node.js + uses: actions/setup-node@v4 with: node-version: ${{ steps.versions.outputs.node-version }} - yarn-version: ${{ steps.versions.outputs.yarn-version }} + cache: 'yarn' - name: Install dependencies run: yarn diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..91d5f6f --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +22.18.0 diff --git a/README.md b/README.md index f0ca275..872469d 100644 --- a/README.md +++ b/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 -- **[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 -1. **Install Volta** (if not already installed): +1. **Install fnm** (if not already installed): ```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 -3. Install dependencies (Volta will auto-install the correct Node.js and Yarn versions): +3. Install Node.js and dependencies: ```bash + # fnm will auto-install Node.js based on .nvmrc or engines field + fnm use --install-if-missing + npm install -g yarn yarn ``` diff --git a/package.json b/package.json index 216a643..b76a623 100644 --- a/package.json +++ b/package.json @@ -9,10 +9,6 @@ "node": ">=22.0.0", "yarn": "^4.0.0" }, - "volta": { - "node": "22.18.0", - "yarn": "4.9.4" - }, "packageManager": "yarn@4.9.4", "scripts": { "dev": "electron-vite dev",