diff --git a/.github/workflows/javascript.yml b/.github/workflows/javascript.yml index 9562cc3..dcd4612 100644 --- a/.github/workflows/javascript.yml +++ b/.github/workflows/javascript.yml @@ -11,7 +11,7 @@ permissions: jobs: test: - name: Tests + name: JavaScript Tests runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -20,22 +20,12 @@ jobs: with: ruby-version: '3.3' bundler-cache: true + - uses: pnpm/action-setup@v4 - name: Set up Node uses: actions/setup-node@v4 with: node-version: '18' - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: - echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT - - uses: actions/cache@v4 - id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - name: Yarn - run: yarn + - name: Install node dependencies + run: pnpm install - name: Run tests run: bundle exec rake test:js diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 906d7ad..047e209 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -11,7 +11,7 @@ permissions: jobs: test: - name: Tests + name: Ruby Tests runs-on: ubuntu-latest strategy: matrix: diff --git a/.gitignore b/.gitignore index d0e3d83..da6d634 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ test/log .byebug_history node_modules -yarn-error.log !.babelrc + +pnpm-lock.yaml diff --git a/Rakefile b/Rakefile index 41b766c..54c6d50 100644 --- a/Rakefile +++ b/Rakefile @@ -55,7 +55,7 @@ end desc %(Regenerate JavaScript files) task :regenerate_javascript do - run_yarn_script 'build' + run_pnpm_script 'build' end desc %(Commit JavaScript files) @@ -99,15 +99,15 @@ def which(cmd) end def run_headless_tests - run_yarn_script 'test', "#{test_url}?autostart=false" do + run_pnpm_script 'test', "#{test_url}?autostart=false" do Process.kill 'INT', @server end end -def run_yarn_script(script, options = '') +def run_pnpm_script(script, options = '') require 'English' - system "yarn #{script} #{options}" + system "pnpm #{script} #{options}" exit_code = $CHILD_STATUS.exitstatus yield if block_given? diff --git a/package.json b/package.json index fca15dc..8919035 100644 --- a/package.json +++ b/package.json @@ -39,9 +39,10 @@ "main": "dist/simple-form.js", "module": "dist/simple-form.esm.js", "engines": { - "node": ">=12.0.0", - "yarn": ">=1.19.0" + "node": ">= 18.12", + "pnpm": "^9.12.1" }, + "packageManager": "pnpm@^9.12.1", "browserslist": [ ">= 1%", "last 1 major version",