Skip to content

Commit bc98088

Browse files
vraravamMarkus Hatvannathanaelhounbalajiv113SpecialAro
committed
Switch from 'npm' to 'pnpm' (#704)
Co-authored-by: Markus Hatvan <markus_hatvan@aon.at> Co-authored-by: Nathanaël Houn <contact@nathanaelhoun.fr> Co-authored-by: Balaji Vijayakumar <kuttibalaji.v6@gmail.com> Co-authored-by: André Oliveira <oliveira.andrerodrigues95@gmail.com>
1 parent 2250201 commit bc98088

23 files changed

+14982
-49019
lines changed

.dockerignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
**/*.tsbuildinfo
1414
**/build
1515
**/node_modules
16-
**/npm-debug.log*
17-
**/.pnpm-debug.log
16+
**/.pnpm-debug.log*
1817
**/server*.log
1918
**/yarn-error.log
2019
Dockerfile

.eslintignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ node_modules
1919
.DS_Store
2020

2121
.idea
22-
npm-debug.log.*
2322
.pnpm-debug.log*
2423
*.css.d.ts
2524
*.sass.d.ts

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,12 @@
2525

2626
#### Checklist
2727
<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->
28+
2829
- [ ] My pull request is properly named
29-
- [ ] The changes respect the code style of the project (`npm run prepare-code`)
30-
- [ ] `npm test` passes
30+
- [ ] The changes respect the code style of the project (`pnpm prepare-code`)
31+
- [ ] `pnpm test` passes
3132
- [ ] I tested/previewed my changes locally
3233

3334
#### Release Notes
35+
3436
<!-- Please add a one-line description for users of Ferdium to read in the release notes, or 'none' if no notes relevant to such users. Examples and help on special cases: https://github.com/electron/clerk/blob/master/README.md#examples -->

.github/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ newPRWelcomeComment: |
55
Things that will help get your PR across the finish line:
66
77
- Follow the JavaScript [coding style](https://github.com/electron/electron/blob/master/docs/development/coding-style.md) as recommended by the Electron project.
8-
- Run `npm run lint` locally to catch formatting errors earlier.
8+
- Run `pnpm lint` locally to catch formatting errors earlier.
99
- Document any user-facing changes you've made by including screenshots and animated GIFs whenever possible.
1010
1111
We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can.

.github/workflows/builds.yml

Lines changed: 20 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,12 @@ jobs:
5151
if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && contains(github.event.inputs.message, '[nightly branch]')) }}
5252
with:
5353
node-version-file: ".nvmrc"
54-
- name: Install npm
55-
if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && contains(github.event.inputs.message, '[nightly branch]')) }}
56-
run: npm i -gf "npm@$(node -p 'require("./package.json").engines.npm')" && npm -v
5754
- name: Install pnpm
5855
if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && contains(github.event.inputs.message, '[nightly branch]')) }}
59-
run: npm i -gf "pnpm@$(node -p 'require("./recipes/package.json").engines.pnpm')" && pnpm -v
56+
run: npm i -gf "pnpm@$(node -p 'require("./package.json").engines.pnpm')" && pnpm -v
6057
- name: Install node dependencies
6158
if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && contains(github.event.inputs.message, '[nightly branch]')) }}
62-
run: npm i
59+
run: pnpm i
6360
- id: should_run
6461
name: Check whether there are any commits since this run was last triggered and push them and/or set the output
6562
if: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && contains(github.event.inputs.message, '[nightly branch]')) }}
@@ -90,8 +87,8 @@ jobs:
9087
echo "GIT_DIRTY=$(git status -s | wc -l)" >> $GITHUB_ENV
9188
9289
echo "Run linter, reformatter, rebrander and tests"
93-
npm run prepare-code
94-
npm run test
90+
pnpm prepare-code
91+
pnpm test
9592
9693
echo "Commit dependency-updates and linter changes"
9794
git commit -am "Update browserslist data updates and linter fixes [skip ci]" --no-verify || true
@@ -107,7 +104,7 @@ jobs:
107104
# there were other changes coming from the 'develop' branch (or)
108105
# this is a manual trigger with the key-phrase
109106
git checkout develop
110-
npm version -m "%s [skip ci]" prerelease --preid=nightly
107+
pnpm version -m "%s [skip ci]" prerelease --preid=nightly
111108
git commit --all --amend --no-edit --no-verify
112109
git push origin develop --no-verify
113110
@@ -173,22 +170,20 @@ jobs:
173170
uses: actions/setup-node@v3
174171
with:
175172
node-version-file: ".nvmrc"
176-
- name: Install npm
177-
run: npm i -gf "npm@$(node -p 'require("./package.json").engines.npm')" && npm -v
178173
- name: Install pnpm
179-
run: npm i -gf "pnpm@$(node -p 'require("./recipes/package.json").engines.pnpm')" && pnpm -v
174+
run: npm i -gf "pnpm@$(node -p 'require("./package.json").engines.pnpm')" && pnpm -v
180175
- name: Install node dependencies
181-
run: npm i
176+
run: pnpm i
182177
- name: Package recipes
183178
run: pnpm i && pnpm lint && pnpm reformat-files && pnpm package
184179
working-directory: ./recipes
185180
- name: Run linter and tests
186-
run: npm run lint && npm run test
181+
run: pnpm lint && pnpm test
187182
- name: Build Ferdium without publish for any branch not 'nightly' and not 'release'
188183
if: ${{ env.GIT_BRANCH_NAME != 'nightly' && env.GIT_BRANCH_NAME != 'release' }}
189184
env:
190185
CSC_IDENTITY_AUTO_DISCOVERY: false
191-
run: npm run build -- --publish never
186+
run: pnpm build --publish never
192187
shell: bash
193188
- name: "Build Ferdium with publish for '${{ env.GIT_BRANCH_NAME }}' branch"
194189
if: ${{ env.GIT_BRANCH_NAME == 'nightly' || env.GIT_BRANCH_NAME == 'release' }}
@@ -199,7 +194,7 @@ jobs:
199194
APPLEID_PASSWORD: ${{ secrets.APPLEID_PASSWORD }}
200195
CSC_LINK: ${{ secrets.CSC_LINK }}
201196
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
202-
run: npm run build -- --publish always
197+
run: pnpm build --publish always
203198
shell: bash
204199

205200
build_linux:
@@ -249,12 +244,10 @@ jobs:
249244
uses: actions/setup-node@v3
250245
with:
251246
node-version-file: ".nvmrc"
252-
- name: Install npm
253-
run: npm i -gf "npm@$(node -p 'require("./package.json").engines.npm')" && npm -v
254247
- name: Install pnpm
255-
run: npm i -gf "pnpm@$(node -p 'require("./recipes/package.json").engines.pnpm')" && pnpm -v
248+
run: npm i -gf "pnpm@$(node -p 'require("./package.json").engines.pnpm')" && pnpm -v
256249
- name: Install node dependencies
257-
run: npm i
250+
run: pnpm i
258251
- name: Figure out used package.json version
259252
run: |
260253
PACKAGE_VERSION="$(node -p 'require("./package.json").version')"
@@ -278,12 +271,12 @@ jobs:
278271
run: pnpm i && pnpm lint && pnpm reformat-files && pnpm package
279272
working-directory: ./recipes
280273
- name: Run linter and tests
281-
run: npm run lint && npm run test
274+
run: pnpm lint && pnpm test
282275
- name: Build Ferdium without publish for any branch not 'nightly' and not 'release'
283276
if: ${{ env.GIT_BRANCH_NAME != 'nightly' && env.GIT_BRANCH_NAME != 'release' }}
284277
env:
285278
CSC_IDENTITY_AUTO_DISCOVERY: false
286-
run: npm run build -- --publish never
279+
run: pnpm build --publish never
287280
shell: bash
288281
- name: "Build Ferdium with publish for '${{ env.GIT_BRANCH_NAME }}' branch"
289282
if: ${{ env.GIT_BRANCH_NAME == 'nightly' || env.GIT_BRANCH_NAME == 'release' }}
@@ -294,7 +287,7 @@ jobs:
294287
run: |
295288
sudo snap install snapcraft --channel=5.x/stable --classic
296289
echo "$SNAPCRAFT_LOGIN" | snapcraft login --with -
297-
npm run build -- --publish always -c.snap.publish.repo=$SNAP_PUBLISH_REPO -c.snap.publish.channels=$SNAP_PUBLISH_CHANNEL
290+
pnpm build --publish always -c.snap.publish.repo=$SNAP_PUBLISH_REPO -c.snap.publish.channels=$SNAP_PUBLISH_CHANNEL
298291
snapcraft logout
299292
shell: bash
300293

@@ -347,14 +340,12 @@ jobs:
347340
uses: actions/setup-node@v3
348341
with:
349342
node-version-file: ".nvmrc"
350-
- name: Install npm
351-
run: npm i -gf "npm@$(node -p 'require(\"./package.json\").engines.npm')" && npm -v
352343
- name: Install pnpm
353-
run: npm i -gf "pnpm@$(node -p 'require(\"./recipes/package.json\").engines.pnpm')" && pnpm -v
344+
run: npm i -gf "pnpm@$(node -p 'require(\"./package.json\").engines.pnpm')" && pnpm -v
354345
- name: Install node dependencies
355346
uses: nick-invision/retry@v2.4.0
356347
with:
357-
command: npm i
348+
command: pnpm i
358349
timeout_minutes: 15
359350
max_attempts: 3
360351
retry_on: error
@@ -363,13 +354,13 @@ jobs:
363354
working-directory: ./recipes
364355
shell: bash
365356
- name: Run linter and tests
366-
run: npm run lint && npm run test
357+
run: pnpm lint && pnpm test && pnpm build:windows
367358
shell: bash
368359
- name: Build Ferdium without publish for any branch not 'nightly' and not 'release'
369360
if: ${{ env.GIT_BRANCH_NAME != 'nightly' && env.GIT_BRANCH_NAME != 'release' }}
370361
env:
371362
CSC_IDENTITY_AUTO_DISCOVERY: false
372-
run: npm run build -- --publish never
363+
run: pnpm electron-builder --publish never
373364
shell: bash
374365
- name: "Build Ferdium with publish for '${{ env.GIT_BRANCH_NAME }}' branch"
375366
if: ${{ env.GIT_BRANCH_NAME == 'nightly' || env.GIT_BRANCH_NAME == 'release' }}
@@ -378,5 +369,5 @@ jobs:
378369
CSC_IDENTITY_AUTO_DISCOVERY: true
379370
WIN_CSC_LINK: ${{ secrets.WIN_CSC_LINK }}
380371
WIN_CSC_KEY_PASSWORD: ${{ secrets.WIN_CSC_KEY_PASSWORD }}
381-
run: npm run build -- --publish always
372+
run: pnpm electron-builder --publish always
382373
shell: bash

.gitignore

Lines changed: 45 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# Created by https://www.toptal.com/developers/gitignore/api/vim,node,yarn,react,macos,visualstudiocode,intellij
2-
# Edit at https://www.toptal.com/developers/gitignore?templates=vim,node,yarn,react,macos,visualstudiocode,intellij
1+
# Created by https://www.toptal.com/developers/gitignore/api/vim,yarn,node,react,macos,intellij,visualstudiocode
2+
# Edit at https://www.toptal.com/developers/gitignore?templates=vim,yarn,node,react,macos,intellij,visualstudiocode
33

44
### Intellij ###
55
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
66
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
77

88
# User-specific stuff
9-
/**/workspace.xml
9+
.idea/**/workspace.xml
1010
.idea/**/tasks.xml
1111
.idea/**/usage.statistics.xml
1212
.idea/**/dictionaries
@@ -65,6 +65,9 @@ atlassian-ide-plugin.xml
6565
# Cursive Clojure plugin
6666
.idea/replstate.xml
6767

68+
# SonarLint plugin
69+
.idea/sonarlint/
70+
6871
# Crashlytics plugin (for Android Studio and IntelliJ)
6972
com_crashlytics_export_strings.xml
7073
crashlytics.properties
@@ -107,13 +110,9 @@ fabric.properties
107110
# https://plugins.jetbrains.com/plugin/12206-codestream
108111
.idea/codestream.xml
109112

110-
# Idea modules and profiles
111-
.idea/ferdium-app.iml
112-
.idea/modules.xml
113-
.idea/.gitignore
114-
.idea/vcs.xml
115-
.idea/inspectionProfiles/Project_Default.xml
116-
.idea/misc.xml
113+
# Azure Toolkit for IntelliJ plugin
114+
# https://plugins.jetbrains.com/plugin/8053-azure-toolkit-for-intellij
115+
.idea/**/azureSettings.xml
117116

118117
### macOS ###
119118
# General
@@ -124,6 +123,7 @@ fabric.properties
124123
# Icon must end with two \r
125124
Icon
126125

126+
127127
# Thumbnails
128128
._*
129129

@@ -143,13 +143,18 @@ Network Trash Folder
143143
Temporary Items
144144
.apdisk
145145

146+
### macOS Patch ###
147+
# iCloud generated files
148+
*.icloud
149+
146150
### Node ###
147151
# Logs
148152
logs
149153
*.log
150154
npm-debug.log*
151155
yarn-debug.log*
152156
yarn-error.log*
157+
lerna-debug.log*
153158
.pnpm-debug.log*
154159

155160
# Diagnostic reports (https://nodejs.org/api/report.html)
@@ -199,6 +204,9 @@ web_modules/
199204
# Optional eslint cache
200205
.eslintcache
201206

207+
# Optional stylelint cache
208+
.stylelintcache
209+
202210
# Microbundle cache
203211
.rpt2_cache/
204212
.rts2_cache_cjs/
@@ -214,10 +222,12 @@ web_modules/
214222
# Yarn Integrity file
215223
.yarn-integrity
216224

217-
# dotenv environment variables file
225+
# dotenv environment variable files
218226
.env
219-
.env.test
220-
.env.production
227+
.env.development.local
228+
.env.test.local
229+
.env.production.local
230+
.env.local
221231

222232
# parcel-bundler cache (https://parceljs.org/)
223233
.cache
@@ -240,6 +250,12 @@ dist
240250
# vuepress build output
241251
.vuepress/dist
242252

253+
# vuepress v2.x temp and cache directory
254+
.temp
255+
256+
# Docusaurus cache and generated files
257+
.docusaurus
258+
243259
# Serverless directories
244260
.serverless/
245261

@@ -262,6 +278,15 @@ dist
262278
.yarn/install-state.gz
263279
.pnp.*
264280

281+
### Node Patch ###
282+
# Serverless Webpack directories
283+
.webpack/
284+
285+
# Optional stylelint cache
286+
287+
# SvelteKit build / generate output
288+
.svelte-kit
289+
265290
### react ###
266291
.DS_*
267292
**/*.backup.*
@@ -302,21 +327,25 @@ tags
302327
!.vscode/tasks.json
303328
!.vscode/launch.json
304329
!.vscode/extensions.json
305-
*.code-workspace
330+
!.vscode/*.code-snippets
306331

307332
# Local History for Visual Studio Code
308333
.history/
309334

335+
# Built Visual Studio Code Extensions
336+
*.vsix
337+
310338
### VisualStudioCode Patch ###
311339
# Ignore all local history of files
312340
.history
313341
.ionide
314342

315343
### yarn ###
316-
# https://yarnpkg.com/advanced/qa#which-files-should-be-gitignored
344+
# https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored
317345

318346
.yarn/*
319347
!.yarn/releases
348+
!.yarn/patches
320349
!.yarn/plugins
321350
!.yarn/sdks
322351
!.yarn/versions
@@ -328,7 +357,7 @@ tags
328357
# and uncomment the following lines
329358
# .pnp.*
330359

331-
# End of https://www.toptal.com/developers/gitignore/api/vim,node,yarn,react,macos,visualstudiocode,intellij
360+
# End of https://www.toptal.com/developers/gitignore/api/vim,yarn,node,react,macos,intellij,visualstudiocode
332361

333362
flow-typed
334363
out

.husky/commit-msg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
FILE_NAME="$(dirname "$0")/_/husky.sh"
44

5-
# Conditionally invoke so as to avoid running npm commands if this is a clean checkout (ie before installing node modules)
5+
# Conditionally invoke so as to avoid running pnpm commands if this is a clean checkout (ie before installing node modules)
66
if [ -f $FILE_NAME ]; then
77
. $FILE_NAME
88

.husky/pre-commit

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
FILE_NAME="$(dirname "$0")/_/husky.sh"
44

5-
# Conditionally invoke so as to avoid running npm commands if this is a clean checkout (ie before installing node modules)
5+
# Conditionally invoke so as to avoid running pnpm commands if this is a clean checkout (ie before installing node modules)
66
if [ -f $FILE_NAME ]; then
77
. $FILE_NAME
8-
npm run prepare-code
8+
pnpm prepare-code
9+
pnpm test
910
fi

.npmrc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
save-exact = true
22
engine-strict = true
33
unsafe-perm = true
4-
frozen-lockfile = false
54
legacy-peer-deps = true
6-
shamefully-hoist = true
5+
frozen-lockfile = false

0 commit comments

Comments
 (0)