Skip to content

Commit

Permalink
Migrate to pnpm
Browse files Browse the repository at this point in the history
  • Loading branch information
tagliala committed Oct 13, 2024
1 parent 677f1ee commit 531e363
Show file tree
Hide file tree
Showing 6 changed files with 3,172 additions and 22 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 @@ -14,6 +14,7 @@ test/log
.byebug_history

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 @@ -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?
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Loading

0 comments on commit 531e363

Please sign in to comment.