Skip to content

Commit c2b5505

Browse files
authored
chore(deps): replace playwright with playwright-core (#450)
* ci: merge github workflows * chore: replace `playwright` with `playwright-core`
1 parent 738abd5 commit c2b5505

File tree

7 files changed

+15
-48
lines changed

7 files changed

+15
-48
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -118,22 +118,8 @@ jobs:
118118
- name: Install dependencies
119119
run: pnpm install
120120

121-
# https://github.com/vitejs/vite/blob/main/.github/workflows/ci.yml#L62
122-
# Install playwright's binary under custom directory to cache
123-
- name: Set Playwright path
124-
run: echo "PLAYWRIGHT_BROWSERS_PATH=$HOME/.cache/playwright-bin" >> $GITHUB_ENV
125-
126-
- name: Cache Playwright's binary
127-
uses: actions/cache@v4
128-
with:
129-
# Playwright removes unused browsers automatically
130-
# So does not need to add playwright version to key
131-
key: ${{ runner.os }}-playwright-bin-v1
132-
path: ${{ env.PLAYWRIGHT_BROWSERS_PATH }}
133-
134121
- name: Install Playwright
135-
# does not need to explicitly set chromium after https://github.com/microsoft/playwright/issues/14862 is solved
136-
run: pnpm playwright install chromium
122+
run: pnpm playwright-core install chromium
137123

138124
- name: Restore dist cache
139125
uses: actions/cache@v4

e2e/helper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Page } from 'playwright'
1+
import type { Page } from 'playwright-core'
22

33
export async function getText(
44
page: Page,

e2e/vite.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { startServer } from './setup-server'
22
import { getText } from './helper'
33

44
import type { ServerContext } from './setup-server'
5-
import type { Browser, Page } from 'playwright'
5+
import type { Browser, Page } from 'playwright-core'
66
import { describe, expect, test, beforeAll, afterAll } from 'vitest'
77

88
// TODO: extract to shim.d.ts

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
"minimist": "^1.2.8",
6363
"npm-run-all2": "^7.0.1",
6464
"opener": "^1.5.2",
65-
"playwright": "^1.44.0",
65+
"playwright-core": "^1.51.0",
6666
"prettier": "^3.2.5",
6767
"prompts": "^2.4.2",
6868
"rollup": "^2.53.1",

pnpm-lock.yaml

Lines changed: 7 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/playwright.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
async function main() {
22
try {
3-
await import('playwright')
3+
await import('playwright-core')
44
} catch (e) {
55
console.error(
6-
'Playwright is not installed. Please run `pnpm playwright install chromium`'
6+
'Playwright is not installed. Please run `pnpm playwright-core install chromium`'
77
)
88
throw e
99
}

scripts/vitest.setup.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { afterAll, beforeAll } from 'vitest'
2-
import playwright from 'playwright'
2+
import playwright from 'playwright-core'
33

4-
import type { Browser, Page, LaunchOptions } from 'playwright'
4+
import type { Browser, Page, LaunchOptions } from 'playwright-core'
55

66
// TODO: extract to shim.d.ts
77
// eslint-disable-next-line @typescript-eslint/no-namespace

0 commit comments

Comments
 (0)