Skip to content

Commit 36e1b19

Browse files
authored
Migrate to pnpm (#949)
- Require Node >= 18
1 parent 133bf20 commit 36e1b19

File tree

5 files changed

+19
-28
lines changed

5 files changed

+19
-28
lines changed

.github/workflows/javascript.yml

+4-14
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ permissions:
1111

1212
jobs:
1313
test:
14-
name: Tests
14+
name: JavaScript Tests
1515
runs-on: ubuntu-latest
1616
steps:
1717
- uses: actions/checkout@v4
@@ -20,22 +20,12 @@ jobs:
2020
with:
2121
ruby-version: '3.3'
2222
bundler-cache: true
23+
- uses: pnpm/action-setup@v4
2324
- name: Set up Node
2425
uses: actions/setup-node@v4
2526
with:
2627
node-version: '18'
27-
- name: Get yarn cache directory path
28-
id: yarn-cache-dir-path
29-
run:
30-
echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
31-
- uses: actions/cache@v4
32-
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
33-
with:
34-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
35-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
36-
restore-keys: |
37-
${{ runner.os }}-yarn-
38-
- name: Yarn
39-
run: yarn
28+
- name: Install node dependencies
29+
run: pnpm install
4030
- name: Run tests
4131
run: bundle exec rake test:js

.github/workflows/ruby.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ permissions:
1111

1212
jobs:
1313
test:
14-
name: Tests
14+
name: Ruby Tests
1515
runs-on: ubuntu-latest
1616
strategy:
1717
matrix:

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ test/generators/tmp/*
1616
test/log
1717

1818
node_modules
19-
yarn-error.log
2019

2120
!.babelrc
21+
22+
pnpm-lock.yaml

Rakefile

+4-4
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ end
5555

5656
desc %(Regenerate JavaScript files)
5757
task :regenerate_javascript do
58-
run_yarn_script 'build'
58+
run_pnpm_script 'build'
5959
end
6060

6161
desc %(Commit JavaScript files)
@@ -100,15 +100,15 @@ def which(cmd)
100100
end
101101

102102
def run_headless_tests
103-
run_yarn_script 'test', "#{test_url}?autostart=false" do
103+
run_pnpm_script 'test', "#{test_url}?autostart=false" do
104104
Process.kill 'INT', @server
105105
end
106106
end
107107

108-
def run_yarn_script(script, options = '')
108+
def run_pnpm_script(script, options = '')
109109
require 'English'
110110

111-
system "yarn #{script} #{options}"
111+
system "pnpm #{script} #{options}"
112112
exit_code = $CHILD_STATUS.exitstatus
113113

114114
yield if block_given?

package.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -22,26 +22,26 @@
2222
"test": "test/javascript/run-qunit.mjs"
2323
},
2424
"devDependencies": {
25-
"@babel/core": "^7.25.2",
26-
"@babel/preset-env": "^7.25.4",
25+
"@babel/core": "^7.25.8",
26+
"@babel/preset-env": "^7.25.8",
2727
"@rollup/plugin-babel": "^6.0.4",
28-
"@rollup/plugin-node-resolve": "^15.2.2",
28+
"@rollup/plugin-node-resolve": "^15.3.0",
2929
"chrome-launcher": "^1.1.2",
30-
"puppeteer-core": "^23.4.1",
31-
"rollup": "^4.22.0",
30+
"puppeteer-core": "^23.5.3",
31+
"rollup": "^4.24.0",
3232
"rollup-plugin-copy": "^3.5.0",
3333
"standard": "^17.1.2"
3434
},
35-
"dependencies": {},
3635
"peerDependencies": {
3736
"jquery": ">= 1.12.4 < 4.0.0"
3837
},
3938
"main": "dist/client-side-validations.js",
4039
"module": "dist/client-side-validations.esm.js",
4140
"engines": {
42-
"node": ">=12.0.0",
43-
"yarn": ">=1.19.0"
41+
"node": ">= 18.0",
42+
"pnpm": "^9.12.1"
4443
},
44+
"packageManager": "pnpm@^9.12.1",
4545
"browserslist": [
4646
">= 1%",
4747
"last 1 major version",

0 commit comments

Comments
 (0)