Skip to content

Commit

Permalink
Use pnpm
Browse files Browse the repository at this point in the history
  • Loading branch information
SamTV12345 committed Mar 12, 2024
1 parent b58d31d commit de80634
Show file tree
Hide file tree
Showing 4 changed files with 1,971 additions and 26 deletions.
29 changes: 18 additions & 11 deletions .github/workflows/backend-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,27 @@ jobs:
PLUGIN_NAME: ${{ steps.plugin_name.outputs.plugin_name }}
-
uses: actions/setup-node@v4
- uses: pnpm/action-setup@v3
name: Install pnpm
with:
node-version: 20
cache: 'npm'
cache-dependency-path: |
src/package-lock.json
src/bin/doc/package-lock.json
node_modules/${{ steps.plugin_name.outputs.plugin_name }}/package-lock.json
- run: npm install [email protected] -g
name: Install legacy npm for correct dependency resolution
version: 8
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
-
name: Install plugin dependencies
run: |
cd ./node_modules/"${PLUGIN_NAME}"
npm ci
pnpm i
env:
PLUGIN_NAME: ${{ steps.plugin_name.outputs.plugin_name }}
# Etherpad core dependencies must be installed after installing the
Expand All @@ -71,7 +78,7 @@ jobs:
# rules.
-
name: Install Etherpad core dependencies
run: src/bin/installDeps.sh
run: ./bin/installDeps.sh
-
name: Run the backend tests
run: cd src && npm test
run: cd src && pnpm run test
26 changes: 17 additions & 9 deletions .github/workflows/frontend-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,22 @@ jobs:
repository: ether/etherpad-lite
-
uses: actions/setup-node@v4
- uses: pnpm/action-setup@v3
name: Install pnpm
with:
node-version: 20
cache: 'npm'
cache-dependency-path: |
src/package-lock.json
src/bin/doc/package-lock.json
- run: npm install [email protected] -g
name: Install legacy npm for correct dependency resolution
version: 8
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
-
name: Check out the plugin
uses: actions/checkout@v4
Expand Down Expand Up @@ -60,7 +68,7 @@ jobs:
PLUGIN_NAME: ${{ steps.plugin_name.outputs.plugin_name }}
run: |
cd ./node_modules/"${PLUGIN_NAME}"
npm ci
pnpm i
# Etherpad core dependencies must be installed after installing the
# plugin's dependencies, otherwise npm will try to hoist common
# dependencies by removing them from src/node_modules and installing them
Expand All @@ -72,7 +80,7 @@ jobs:
# rules.
-
name: Install Etherpad core dependencies
run: src/bin/installDeps.sh
run: ./bin/installDeps.sh
-
name: Create settings.json
run: cp settings.json.template settings.json
Expand Down
8 changes: 2 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,11 @@
"url": "https://etherpad.org/"
},
"devDependencies": {
"eslint": "^8.56.0",
"eslint-config-etherpad": "^3.0.22",
"typescript": "^4.9.5"
"eslint": "^8.57.0",
"eslint-config-etherpad": "^3.0.22"
},
"scripts": {
"lint": "eslint .",
"lint:fix": "eslint --fix ."
},
"peerDependencies": {
"ep_etherpad-lite": ">=1.8.6"
}
}
Loading

0 comments on commit de80634

Please sign in to comment.