Skip to content

Commit

Permalink
Migrate to pnpm (#949)
Browse files Browse the repository at this point in the history
- Require Node >= 18
  • Loading branch information
tagliala authored Oct 13, 2024
1 parent 133bf20 commit 36e1b19
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 28 deletions.
18 changes: 4 additions & 14 deletions .github/workflows/javascript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ permissions:

jobs:
test:
name: Tests
name: JavaScript Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -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
2 changes: 1 addition & 1 deletion .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ permissions:

jobs:
test:
name: Tests
name: Ruby Tests
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ test/generators/tmp/*
test/log

node_modules
yarn-error.log

!.babelrc

pnpm-lock.yaml
8 changes: 4 additions & 4 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -100,15 +100,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?
Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,26 @@
"test": "test/javascript/run-qunit.mjs"
},
"devDependencies": {
"@babel/core": "^7.25.2",
"@babel/preset-env": "^7.25.4",
"@babel/core": "^7.25.8",
"@babel/preset-env": "^7.25.8",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-node-resolve": "^15.2.2",
"@rollup/plugin-node-resolve": "^15.3.0",
"chrome-launcher": "^1.1.2",
"puppeteer-core": "^23.4.1",
"rollup": "^4.22.0",
"puppeteer-core": "^23.5.3",
"rollup": "^4.24.0",
"rollup-plugin-copy": "^3.5.0",
"standard": "^17.1.2"
},
"dependencies": {},
"peerDependencies": {
"jquery": ">= 1.12.4 < 4.0.0"
},
"main": "dist/client-side-validations.js",
"module": "dist/client-side-validations.esm.js",
"engines": {
"node": ">=12.0.0",
"yarn": ">=1.19.0"
"node": ">= 18.0",
"pnpm": "^9.12.1"
},
"packageManager": "pnpm@^9.12.1",
"browserslist": [
">= 1%",
"last 1 major version",
Expand Down

0 comments on commit 36e1b19

Please sign in to comment.