Skip to content

Commit a73c55d

Browse files
authored
Merge pull request #54 from Aerilym/chore/pnpm
fix: pnpm
2 parents 744d141 + 09e1fce commit a73c55d

9 files changed

Lines changed: 2764 additions & 2289 deletions

File tree

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.eslintrc.js
22
*.js
33
tests/localization/*
4+
pnpm-lock.yaml

.github/workflows/pull.yml

Lines changed: 51 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -18,41 +18,72 @@ jobs:
1818
steps:
1919
- run: git config --global core.autocrlf false
2020

21-
- name: Checkout git repo
22-
uses: actions/checkout@v4
21+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
2322
with:
23+
ref: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.target_branch || github.ref }}
2424
submodules: 'recursive'
2525
lfs: true
2626

27-
- name: Install node
28-
uses: actions/setup-node@v4
27+
- name: Setup pnpm
28+
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4
29+
30+
- name: Enable long paths (Windows Only)
31+
if: runner.os == 'Windows'
32+
shell: bash
33+
run: git config --system core.longpaths true
34+
35+
- name: Setup pnpm hoisted node-linker (Windows Only)
36+
if: runner.os == 'Windows'
37+
shell: bash
38+
run: pnpm config set node-linker hoisted
39+
40+
- name: Setup node.js
41+
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6
2942
with:
3043
node-version-file: '.nvmrc'
44+
cache: 'pnpm'
45+
cache-dependency-path: 'pnpm-lock.yaml'
3146

32-
- uses: actions/cache/restore@v4
33-
id: cache-playwright-modules
47+
- name: Cache .electron-gyp
48+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
3449
with:
35-
path: node_modules
36-
key: ${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('package.json', 'yarn.lock', 'patches/**') }}
37-
38-
- name: Install dependencies
39-
shell: bash
40-
if: steps.cache-playwright-modules.outputs.cache-hit != 'true'
41-
run: yarn install --immutable
50+
path: ~/.electron-gyp
51+
key: electron-gyp-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
4252

43-
- uses: actions/cache/save@v4
44-
id: cache-playwright-modules-save
53+
- name: Restore cached .eslintcache and tsconfig.tsbuildinfo
54+
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
55+
id: cache-lint
4556
with:
46-
path: node_modules
47-
key: ${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('package.json', 'yarn.lock', 'patches/**') }}
57+
path: |
58+
.eslintcache
59+
tsconfig.tsbuildinfo
60+
key: lint-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml', 'patches/**', '.eslintrc.js', '.eslint/**', 'tsconfig.json') }}
61+
62+
- name: Install node_modules
63+
shell: bash
64+
run: pnpm install
65+
env:
66+
NPM_CONFIG_LOGLEVEL: verbose
4867

4968
- name: Lint Files
50-
run: yarn lint-check
69+
shell: bash
70+
run: pnpm run lint-check
71+
72+
- run: git diff --exit-code
73+
74+
- name: Update cached .eslintcache and tsconfig.tsbuildinfo
75+
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
76+
if: github.ref == 'refs/heads/main'
77+
with:
78+
path: |
79+
.eslintcache
80+
tsconfig.tsbuildinfo
81+
key: ${{ steps.cache-lint.outputs.cache-primary-key }}
5182

5283
- name: Compile typescript files
5384
shell: bash
54-
run: yarn tsc
85+
run: pnpm tsc
5586

5687
- name: Run the only test we can without a browser
5788
shell: bash
58-
run: PRINT_FAILED_TEST_LOGS=1 npx playwright test -g "Enforce localized strings return expected values"
89+
run: PRINT_FAILED_TEST_LOGS=1 pnpm playwright test -g "Enforce localized strings return expected values"

.prettierignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
.eslintrc.js
33
README.md
44
tests/localization/*.ts
5-
tests/localization/*
5+
tests/localization/*
6+
pnpm-lock.yaml

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ Once nvm is installed, install the node version declared in the `.nvmrc` file:
1313
- `nvm install` on linux/macos
1414
- `nvm install <specific version from the .nvmrc>` on windows
1515

16-
Install yarn & dependencies:
17-
- `npm install -g yarn`
18-
- `yarn install --frozen-lockfile`
16+
Install [pnpm](https://pnpm.io/installation):
17+
You can install it by running `npm install --global pnpm`, but you should read the [installation instructions](https://pnpm.io/installation) as other methods are better.
18+
19+
Install dependencies:
20+
- `pnpm install`
1921

2022
## Config
2123

@@ -47,7 +49,7 @@ Create your own config from the `.env.sample` and edit the values to match your
4749
## Test run
4850

4951
To run a specific test, or tests matching a string you can do so with
50-
`yarn test -g "<string to match>"`.
52+
`pnpm test -g "<string to match>"`.
5153

5254
To run all the test suite, just do
53-
`yarn test`.
55+
`pnpm test`.

eslint.config.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ export default tseslint.config(
99
{
1010
ignores: [
1111
'**/node_modules/**',
12-
'.yarn/',
1312
'eslint.config.mjs',
1413
'run/**/*.js',
1514
'avd/',

package.json

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
11
{
22
"name": "session-playwright",
3+
"packageManager": "pnpm@10.28.1",
34
"version": "1.0.0",
45
"main": "index.js",
56
"repository": "git@github.com:session-foundation/session-playwright.git",
67
"author": "Audric Ackermann <audric@loki.network>",
78
"license": "MIT",
89
"devDependencies": {
9-
"@playwright/test": "^1.51",
10+
"@playwright/test": "^1.57.0",
1011
"@types/fs-extra": "^11.0.1",
1112
"@types/lodash": "^4.14.196",
1213
"@types/uuid": "^9.0.8",
1314
"@typescript-eslint/eslint-plugin": "^6.2.1",
1415
"@typescript-eslint/parser": "^6.0.0",
1516
"allure-commandline": "^2.23.1",
1617
"allure-playwright": "2.6.0",
18+
"chalk": "4.1.2",
1719
"dotenv": "^16.4.5",
18-
"electron": "34.2.0",
20+
"electron": "40.0.0",
1921
"eslint": "^8.46.0",
2022
"eslint-config-airbnb-base": "^15.0.0",
2123
"eslint-config-airbnb-typescript": "^18.0.0",
@@ -26,21 +28,21 @@
2628
"eslint-plugin-perfectionist": "^4.15.0",
2729
"fs-extra": "^11.1.1",
2830
"lodash": "^4.17.21",
31+
"playwright": "^1.57.0",
2932
"prettier": "^3.0.1",
3033
"typescript": "^5.1.6",
3134
"uuid": "^9.0.1"
3235
},
3336
"scripts": {
34-
"build": "yarn tsc --watch",
35-
"lint": "yarn prettier . --write --cache && yarn eslint .",
36-
"lint-check": "yarn prettier . --check && yarn eslint .",
37-
"dev": "yarn tsc --watch",
38-
"test": "npx playwright test",
37+
"build": "pnpm tsc --watch",
38+
"lint": "pnpm prettier . --write --cache && pnpm eslint .",
39+
"lint-check": "pnpm prettier . --check && pnpm eslint .",
40+
"dev": "pnpm tsc --watch",
41+
"test": "playwright test",
3942
"test-rerun": "PLAYWRIGHT_WORKERS_COUNT=1 PRINT_FAILED_TEST_LOGS=1 npx playwright test --last-failed",
4043
"watch": "tsc -w",
4144
"sync": "./sync-localization.sh",
4245
"allure-create": "allure generate ./allure-results",
4346
"allure-open": "allure open ./allure-report"
44-
},
45-
"dependencies": {}
47+
}
4648
}

0 commit comments

Comments
 (0)