Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to pnpm #409

Merged
merged 14 commits into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 19 additions & 12 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,22 +43,29 @@ jobs:
name: Lint JavaScript
runs-on: macos-latest
if: ${{ !github.event.pull_request.draft }}
defaults:
run:
working-directory: readium/navigator
env:
scripts: ${{ 'src/main/assets/_scripts' }}
scripts: ${{ 'readium/navigator/src/main/assets/_scripts' }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
package_json_file: readium/navigator/src/main/assets/_scripts/package.json
run_install: false
- name: Setup cache
uses: actions/setup-node@v3
with:
node-version: 20
cache: 'pnpm'
cache-dependency-path: readium/navigator/src/main/assets/_scripts/pnpm-lock.yaml
- name: Install dependencies
run: yarn --cwd "$scripts" install --frozen-lockfile
run: pnpm --dir "$scripts" install --frozen-lockfile
- name: Lint
run: yarn --cwd "$scripts" run lint
run: pnpm --dir "$scripts" run lint
- name: Check formatting
run: yarn --cwd "$scripts" run checkformat
# FIXME: This suddenly stopped working even though the toolchain versions seem identical.
# - name: Check if bundled scripts are up-to-date
# run: |
# make scripts
# git diff --exit-code --name-only src/main/assets/readium/scripts/*.js
run: pnpm --dir "$scripts" run checkformat
- name: Check if bundled scripts are up-to-date
run: |
make scripts
git diff --exit-code --name-only src/main/assets/readium/scripts/*.js
12 changes: 8 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ format:

.PHONY: scripts
scripts:
yarn --cwd "$(SCRIPTS_PATH)" install --frozen-lockfile
yarn --cwd "$(SCRIPTS_PATH)" run format
yarn --cwd "$(SCRIPTS_PATH)" run lint
yarn --cwd "$(SCRIPTS_PATH)" run bundle
@which corepack >/dev/null 2>&1 || (echo "ERROR: corepack is required, please install it first\nhttps://pnpm.io/installation#using-corepack"; exit 1)

cd $(SCRIPTS_PATH); \
corepack install; \
pnpm install --frozen-lockfile; \
pnpm run format; \
pnpm run lint; \
pnpm run bundle
7 changes: 4 additions & 3 deletions readium/navigator/src/main/assets/_scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@
"babel-loader": "^8.2.3",
"eslint": "^7.29.0",
"prettier": "2.3.1",
"webpack": "^5.40.0",
"webpack-cli": "^4.7.2"
"webpack": "^5.88.2",
"webpack-cli": "^5.1.4"
},
"dependencies": {
"approx-string-match": "^1.1.0",
"css-selector-generator": "^3.6.0",
"hash.js": "^1.1.7",
"string.prototype.matchall": "^4.0.5"
}
},
"packageManager": "[email protected]+sha256.d713a5750e41c3660d1e090608c7f607ad00d1dd5ba9b6552b5f390bf37924e9"
}
Loading