playwright: 1.59.1 -> 1.60.0

This commit is contained in:
Konstantin Alekseev
2026-05-19 07:00:04 +03:00
parent e1b33bad56
commit 33f539df43
8 changed files with 41 additions and 108 deletions
+6 -12
View File
@@ -2,40 +2,34 @@
lib,
buildNpmPackage,
fetchFromGitHub,
makeWrapper,
playwright-driver,
playwright-test,
}:
buildNpmPackage rec {
pname = "playwright-mcp";
version = "0.0.69";
version = "0.0.74";
src = fetchFromGitHub {
owner = "Microsoft";
repo = "playwright-mcp";
tag = "v${version}";
hash = "sha256-zX9RsHVInRib69N4LkG3R4TB5qjlBirpu9BBftcr92I=";
hash = "sha256-dGYZTBPNszVtxvYWTIF77dDm9elGvcLwbn+yG/lfR68=";
};
npmDepsHash = "sha256-hc5AkUTGoXxXlDW9vPpiO23QOgANJp1lX4xoaySHoK4=";
npmDepsHash = "sha256-IgoflKLyY4plURB++N4YSzqfG4Y7aGSUvND+WiHYiQo=";
npmWorkspace = "packages/playwright-mcp";
nativeBuildInputs = [ makeWrapper ];
# Codex MCP smoke test (after `codex mcp add playwright-nix --env DISPLAY=:0 -- $out/bin/playwright-mcp --headless --isolated`):
# timeout 45s codex exec --dangerously-bypass-approvals-and-sandbox --skip-git-repo-check "Use only playwright-nix MCP tools. Navigate to https://example.com and return only the page title."
postInstall = ''
pkg_dir="$out/lib/node_modules/playwright-mcp-internal"
pkg_dir="$out/lib/node_modules/@playwright/mcp"
rm -rf "$pkg_dir/node_modules/playwright"
rm -rf "$pkg_dir/node_modules/playwright-core"
ln -s ${playwright-test}/lib/node_modules/playwright "$pkg_dir/node_modules/playwright"
ln -s ${playwright-test}/lib/node_modules/playwright-core "$pkg_dir/node_modules/playwright-core"
# Workspace symlinks point to a packages/ tree that npmInstallHook does not
# ship; npm hoisted the workspace contents directly into playwright-mcp-internal.
rm "$pkg_dir/node_modules/@playwright/mcp"
rm "$pkg_dir/node_modules/@playwright/mcp-extension"
rm "$pkg_dir/node_modules/playwright-cli"
rm "$pkg_dir/node_modules/.bin/playwright-mcp"
wrapProgram $out/bin/playwright-mcp \
--set PLAYWRIGHT_BROWSERS_PATH ${playwright-driver.browsers} \
--set-default PLAYWRIGHT_MCP_BROWSER chromium
@@ -31,14 +31,14 @@ in
buildPythonPackage (finalAttrs: {
pname = "playwright";
# run ./pkgs/development/web/playwright/update.sh to update
version = "1.59.0";
version = "1.60.0";
pyproject = true;
src = fetchFromGitHub {
owner = "microsoft";
repo = "playwright-python";
tag = "v${finalAttrs.version}";
hash = "sha256-CbvVSx/KDaX+CZEJRlDd4GUwWejzjTKNyL4+FhgT6qE=";
hash = "sha256-gbPWUmELw77Fw5M236et2TjkkGisMVVOJzmgq61/bg0=";
};
patches = [
@@ -54,11 +54,11 @@ buildPythonPackage (finalAttrs: {
];
postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail ', "auditwheel==6.2.0"' "" \
--replace-fail "setuptools-scm==8.3.1" "setuptools-scm" \
--replace-fail "setuptools==80.9.0" "setuptools" \
--replace-fail "wheel==0.45.1" "wheel"
# Use sed with a regex instead of substituteInPlace so we don't have to
# bump pinned versions on every upstream release. grep -q precheck makes
# the build fail loudly if upstream restructures the requires list.
grep -q 'requires = \["setuptools==.*", "setuptools-scm==.*", "wheel==.*", "auditwheel==.*"\]' pyproject.toml
sed -i -e 's/requires = \["setuptools==.*", "setuptools-scm==.*", "wheel==.*", "auditwheel==.*"\]/requires = ["setuptools", "setuptools-scm", "wheel"]/' pyproject.toml
# setup.py downloads and extracts the driver.
# This is done manually in postInstall instead.
@@ -2,22 +2,22 @@
"comment": "This file is kept up to date via update.sh",
"browsers": {
"chromium": {
"revision": "1217",
"browserVersion": "147.0.7727.15",
"revision": "1223",
"browserVersion": "148.0.7778.96",
"title": "Chrome for Testing"
},
"chromium-headless-shell": {
"revision": "1217",
"browserVersion": "147.0.7727.15",
"revision": "1223",
"browserVersion": "148.0.7778.96",
"title": "Chrome Headless Shell"
},
"firefox": {
"revision": "1511",
"browserVersion": "148.0.2",
"revision": "1522",
"browserVersion": "150.0.2",
"title": "Firefox"
},
"webkit": {
"revision": "2272",
"revision": "2287",
"revisionOverrides": {
"mac14": "2251",
"mac14-arm64": "2251",
@@ -36,8 +36,8 @@ let
inherit (download) url stripRoot;
hash =
{
x86_64-linux = "sha256-kQCw0nQHHuUIfn8rGVcN7Ip6ZOk5c3Or+GG5RvSica4=";
aarch64-linux = "sha256-s2IIjSY5t9AtT05dUS0mp4fPlaixND9+Cg0+0S8Kkx8=";
x86_64-linux = "sha256-Nr0/uczFTBTqvRPR0c/wflIqG5relgKfC9XsMOdE9iE=";
aarch64-linux = "sha256-veEBmsivFDrG1bArQ780+gMbsoT1Zv4VLcIPpgn4M/I=";
}
.${system} or throwSystem;
};
@@ -72,8 +72,8 @@ let
inherit (download) url stripRoot;
hash =
{
x86_64-darwin = "sha256-kzbLpzzMpBurQHyGaz561A0K46GzgWPP2JSQKRV6C+Y=";
aarch64-darwin = "sha256-67ekk37uq5ITq9ZvwPTZhhqEgQY17g/3KJ/vnqZz3h0=";
x86_64-darwin = "sha256-GEomMUuaIjhBEuWF/HyMohseJtwKOn5MCgh6kIB9ZeE=";
aarch64-darwin = "sha256-7laJtPAiy6pYAxCNBxRYk+FmriXemmLW8UYteEdVrd0=";
}
.${system} or throwSystem;
};
+4 -4
View File
@@ -63,8 +63,8 @@ let
inherit (download) url stripRoot;
hash =
{
x86_64-linux = "sha256-GtaJk9Qr1bTbDfpB+noGlLcIDEIS2uzDiV5rb2DZhVQ=";
aarch64-linux = "sha256-jsesQ6juzMPQzmn0Ygb8hmpxCeLHJVBL89qto5yuh5s=";
x86_64-linux = "sha256-TnplS4C/PPcmyWrMCqWh7c1KrpevHJFKO0gfh46M3tk=";
aarch64-linux = "sha256-E7Nmz9fET0kXNf7ooaUBDHtDBWTGq4JDKKUbo/UfA+c=";
}
.${system} or throwSystem;
};
@@ -130,8 +130,8 @@ let
inherit (download) url stripRoot;
hash =
{
x86_64-darwin = "sha256-CxnLSe+sZYskO7H5f3cA+BlWCZsFOPpp1gVG5s37r80=";
aarch64-darwin = "sha256-n3JLK+hJwzPihC2qSHrSCYPz3jonZNz7GMgXiPBLaS0=";
x86_64-darwin = "sha256-W6xH9iX81H+o689LZvJZO7tF79V0Gv7AksUwflPuQ8A=";
aarch64-darwin = "sha256-T0rVp4M/ymrJtNVtF0RDmIOT6kC3/tRkzPYrwvFbEQY=";
}
.${system} or throwSystem;
};
+3 -66
View File
@@ -19,64 +19,13 @@ let
throwSystem = throw "Unsupported system: ${system}";
browsersJSON = (lib.importJSON ./browsers.json).browsers;
version = "1.59.1";
version = "1.60.0";
src = fetchFromGitHub {
owner = "Microsoft";
repo = "playwright";
rev = "v${version}";
hash = "sha256-kiH1jDyt5xMWc5C2dytoDC9fi1b5tWXZG8S6KEpuotM=";
};
babel-bundle = buildNpmPackage {
pname = "babel-bundle";
inherit version src;
sourceRoot = "${src.name}/packages/playwright/bundles/babel";
npmDepsHash = "sha256-ByCy4go8PM0ksDg+2DcJPyoKG7Z0uIqKM647ZQwYwAE=";
dontNpmBuild = true;
installPhase = ''
cp -r . "$out"
'';
};
expect-bundle = buildNpmPackage {
pname = "expect-bundle";
inherit version src;
sourceRoot = "${src.name}/packages/playwright/bundles/expect";
npmDepsHash = "sha256-PbPCsMqRkfU2c/mCsLSagew84XTgeO6H5+isNZQl2ek=";
dontNpmBuild = true;
installPhase = ''
cp -r . "$out"
'';
};
utils-bundle = buildNpmPackage {
pname = "utils-bundle";
inherit version src;
sourceRoot = "${src.name}/packages/playwright/bundles/utils";
npmDepsHash = "sha256-BTaF1atpK+kG++ZJBUK4r3A7mbN2vv3xpDmb1NiNngE=";
dontNpmBuild = true;
installPhase = ''
cp -r . "$out"
'';
};
utils-bundle-core = buildNpmPackage {
pname = "utils-bundle-core";
inherit version src;
sourceRoot = "${src.name}/packages/playwright-core/bundles/utils";
npmDepsHash = "sha256-O8X80rTT10ht97towSocANnGwH4fH1f3nZMSl8TOc+Y=";
dontNpmBuild = true;
installPhase = ''
cp -r . "$out"
'';
};
zip-bundle = buildNpmPackage {
pname = "zip-bundle";
inherit version src;
sourceRoot = "${src.name}/packages/playwright-core/bundles/zip";
npmDepsHash = "sha256-5BHgCelIPh8ljIcdrO4AHafjqfLowDwJcpN+mD13Syw=";
dontNpmBuild = true;
installPhase = ''
cp -r . "$out"
'';
hash = "sha256-jtQHyphdZsS8hf7uhe9zrx16Uf+kgLLha6dTCsCTT/8=";
};
playwright = buildNpmPackage {
@@ -84,7 +33,7 @@ let
inherit version src;
sourceRoot = "${src.name}"; # update.sh depends on sourceRoot presence
npmDepsHash = "sha256-H3kKFthmZH4fqFPQA34w7iw2rubpEKLlJ9jaW6mpuyo=";
npmDepsHash = "sha256-K1bCDURaq2+kaqGQcOL1tD6tQt/37pyDFWq2njUVNS4=";
nativeBuildInputs = [
cacert
@@ -95,22 +44,10 @@ let
postPatch = ''
sed -i '/\/\/ Update test runner./,/^\s*$/{d}' utils/build/build.js
sed -i '/^\/\/ Update bundles\./,/^[[:space:]]*}$/d' utils/build/build.js
sed -i '/execSync/d' ./utils/generate_third_party_notice.js
# The dlopen library check uses ldconfig which doesn't work under Nix.
# These libraries are already provided via rpath by autoPatchelfHook and wrapProgram.
substituteInPlace packages/playwright-core/src/server/registry/index.ts \
--replace-fail "['libGLESv2.so.2', 'libx264.so']" "[]"
chmod +w packages/playwright/bundles/babel
ln -s ${babel-bundle}/node_modules packages/playwright/bundles/babel/node_modules
chmod +w packages/playwright/bundles/expect
ln -s ${expect-bundle}/node_modules packages/playwright/bundles/expect/node_modules
chmod +w packages/playwright/bundles/utils
ln -s ${utils-bundle}/node_modules packages/playwright/bundles/utils/node_modules
chmod +w packages/playwright-core/bundles/utils
ln -s ${utils-bundle-core}/node_modules packages/playwright-core/bundles/utils/node_modules
chmod +w packages/playwright-core/bundles/zip
ln -s ${zip-bundle}/node_modules packages/playwright-core/bundles/zip/node_modules
'';
installPhase = ''
+4 -4
View File
@@ -19,8 +19,8 @@ let
inherit (download) url stripRoot;
hash =
{
x86_64-linux = "sha256-kfXBssU8pJbBqEUQkgpUFXaskx95OyQEYXDhe6cteR8=";
aarch64-linux = "sha256-OMPpE0VUgZ65cPOZ7f3sfQMaI++lp6B/RBmhH0E7Y9k=";
x86_64-linux = "sha256-DXUCNHLzN8rdq/I7JRAHbSPtgK8pJy3sKNEx4xsbd0E=";
aarch64-linux = "sha256-Kl7Z9mE+1Vy6VEnnl0DOZY/jtYjhUTwjqfFe9UZu2UA=";
}
.${system} or throwSystem;
};
@@ -42,8 +42,8 @@ let
inherit (download) url stripRoot;
hash =
{
x86_64-darwin = "sha256-OfNmamn82tJ8+eY6DC8a3AynmhObZ8E0GTegF8l7km4=";
aarch64-darwin = "sha256-WEYhmqGhGvO47i/OICJgXyqj64Wt52juJDEe7nD7HXU=";
x86_64-darwin = "sha256-eXS88URYKAbFP6/3pukb2qgrdqVBOR99VGyqKPFZ2Tw=";
aarch64-darwin = "sha256-lVNFp20v+zBC3Up9ElhWh8C8ptEUqCHEsfQiuPp3lVM=";
}
.${system} or throwSystem;
};
+6 -4
View File
@@ -23,6 +23,7 @@
icu74,
lcms,
libavif,
libbacktrace,
libdrm,
libepoxy,
libevent,
@@ -120,8 +121,8 @@ let
inherit (download) url stripRoot;
hash =
{
x86_64-linux = "sha256-BVIZxnnfhBvI737ojRZ+yUX8mcbQ6WOlNdYJ9t4R5yY=";
aarch64-linux = "sha256-t9kqUdyOgDXroKp7LWQsaiaRGZVZN3ZdfYLahl5GW2E=";
x86_64-linux = "sha256-hefWMElsTGTkPvSnovwR8P0kunnPLUGDR5Hvoa31SMM=";
aarch64-linux = "sha256-4leXyoebeqWPHxO9D2MomnVqza/9IEcJEuiRCf3/eUc=";
}
.${system} or throwSystem;
};
@@ -149,6 +150,7 @@ let
icu74
lcms
libavif
libbacktrace
libdrm
libepoxy
libevent
@@ -193,8 +195,8 @@ let
inherit (download) url stripRoot;
hash =
{
x86_64-darwin = "sha256-NjuRZrYzraE1FrPAmyMcQFAS2zWZXYe8cBQVbSU6zFw=";
aarch64-darwin = "sha256-9g7YHg+TQNmAE07K6jKSSRUJ7IENUQMp2q54Mk2BbaY=";
x86_64-darwin = "sha256-D9iZitRG3lPWQ/Zu/HAjx2gEehr/xr0d+j2jo7yjnoQ=";
aarch64-darwin = "sha256-383PHqwW+QoXL4qxXEE3ytbQVQ4rg2YDK+B+XvIfBmY=";
}
.${system} or throwSystem;
};