Skip to content

Commit 1d181ae

Browse files
authored
devops: get rid of fd-slicer dependency and esbuild plugin hack (#35895)
1 parent 4facda5 commit 1d181ae

File tree

11 files changed

+376
-227
lines changed

11 files changed

+376
-227
lines changed

eslint.config.mjs

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ const ignores = [
4545
"output/",
4646
"**/playwright-report/",
4747
"packages/*/lib/",
48+
"packages/playwright-core/bundles/zip/src/third_party/",
4849
"packages/playwright-core/src/generated/*",
4950
"packages/playwright-core/src/third_party/",
5051
"packages/playwright-core/types/*",

packages/playwright-core/ThirdPartyNotices.txt

+59-117
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ THIRD-PARTY SOFTWARE NOTICES AND INFORMATION
44

55
This project incorporates components from the projects listed below. The original copyright notices and the licenses under which Microsoft received such components are set forth below. Microsoft reserves all rights not expressly granted herein, whether by implication, estoppel or otherwise.
66

7-
- @types/[email protected] (https://github.com/DefinitelyTyped/DefinitelyTyped)
8-
- @types/[email protected] (https://github.com/DefinitelyTyped/DefinitelyTyped)
97
- [email protected] (https://github.com/TooTallNate/node-agent-base)
108
- [email protected] (https://github.com/juliangruber/balanced-match)
119
- [email protected] (https://github.com/juliangruber/brace-expansion)
@@ -15,12 +13,11 @@ This project incorporates components from the projects listed below. The origina
1513
- [email protected] (https://github.com/tj/commander.js)
1614
- [email protected] (https://github.com/substack/node-concat-map)
1715
- [email protected] (https://github.com/debug-js/debug)
16+
- [email protected] (https://github.com/debug-js/debug)
1817
- [email protected] (https://github.com/sindresorhus/define-lazy-prop)
1918
- [email protected] (https://github.com/kpdecker/jsdiff)
2019
- [email protected] (https://github.com/motdotla/dotenv)
2120
- [email protected] (https://github.com/mafintosh/end-of-stream)
22-
- [email protected] (https://github.com/maxogden/extract-zip)
23-
- [email protected] (https://github.com/andrewrk/node-fd-slicer)
2421
- [email protected] (https://github.com/sindresorhus/get-stream)
2522
- [email protected] (https://github.com/isaacs/node-graceful-fs)
2623
- [email protected] (https://github.com/TooTallNate/node-https-proxy-agent)
@@ -32,13 +29,14 @@ This project incorporates components from the projects listed below. The origina
3229
- [email protected] (https://github.com/broofa/mime)
3330
- [email protected] (https://github.com/isaacs/minimatch)
3431
- [email protected] (https://github.com/zeit/ms)
32+
- [email protected] (https://github.com/vercel/ms)
3533
- [email protected] (https://github.com/isaacs/once)
3634
- [email protected] (https://github.com/sindresorhus/open)
3735
- [email protected] (https://github.com/andrewrk/node-pend)
3836
- [email protected] (https://github.com/lukeapage/pngjs)
3937
- [email protected] (https://github.com/visionmedia/node-progress)
4038
- [email protected] (https://github.com/Rob--W/proxy-from-env)
41-
- [email protected].0 (https://github.com/mafintosh/pump)
39+
- [email protected].2 (https://github.com/mafintosh/pump)
4240
- [email protected] (https://github.com/tim-kos/node-retry)
4341
- [email protected] (https://github.com/tapjs/signal-exit)
4442
- [email protected] (https://github.com/JoshGlazebrook/smart-buffer)
@@ -48,61 +46,9 @@ This project incorporates components from the projects listed below. The origina
4846
- [email protected] (https://github.com/npm/wrappy)
4947
- [email protected] (https://github.com/websockets/ws)
5048
- [email protected] (https://github.com/eemeli/yaml)
51-
- yauzl@2.10.0 (https://github.com/thejoshwolfe/yauzl)
49+
- yauzl@3.2.0 (https://github.com/thejoshwolfe/yauzl)
5250
- [email protected] (https://github.com/thejoshwolfe/yazl)
5351

54-
%% @types/[email protected] NOTICES AND INFORMATION BEGIN HERE
55-
=========================================
56-
MIT License
57-
58-
Copyright (c) Microsoft Corporation.
59-
60-
Permission is hereby granted, free of charge, to any person obtaining a copy
61-
of this software and associated documentation files (the "Software"), to deal
62-
in the Software without restriction, including without limitation the rights
63-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
64-
copies of the Software, and to permit persons to whom the Software is
65-
furnished to do so, subject to the following conditions:
66-
67-
The above copyright notice and this permission notice shall be included in all
68-
copies or substantial portions of the Software.
69-
70-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
71-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
72-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
73-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
74-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
75-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
76-
SOFTWARE
77-
=========================================
78-
END OF @types/[email protected] AND INFORMATION
79-
80-
%% @types/[email protected] NOTICES AND INFORMATION BEGIN HERE
81-
=========================================
82-
MIT License
83-
84-
Copyright (c) Microsoft Corporation.
85-
86-
Permission is hereby granted, free of charge, to any person obtaining a copy
87-
of this software and associated documentation files (the "Software"), to deal
88-
in the Software without restriction, including without limitation the rights
89-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
90-
copies of the Software, and to permit persons to whom the Software is
91-
furnished to do so, subject to the following conditions:
92-
93-
The above copyright notice and this permission notice shall be included in all
94-
copies or substantial portions of the Software.
95-
96-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
97-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
98-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
99-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
100-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
101-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
102-
SOFTWARE
103-
=========================================
104-
END OF @types/[email protected] AND INFORMATION
105-
10652
%% [email protected] NOTICES AND INFORMATION BEGIN HERE
10753
=========================================
10854
agent-base
@@ -459,6 +405,30 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
459405
=========================================
460406
END OF [email protected] AND INFORMATION
461407

408+
%% [email protected] NOTICES AND INFORMATION BEGIN HERE
409+
=========================================
410+
(The MIT License)
411+
412+
Copyright (c) 2014-2017 TJ Holowaychuk <[email protected]>
413+
Copyright (c) 2018-2021 Josh Junon
414+
415+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
416+
and associated documentation files (the 'Software'), to deal in the Software without restriction,
417+
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
418+
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
419+
subject to the following conditions:
420+
421+
The above copyright notice and this permission notice shall be included in all copies or substantial
422+
portions of the Software.
423+
424+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
425+
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
426+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
427+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
428+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
429+
=========================================
430+
END OF [email protected] AND INFORMATION
431+
462432
%% [email protected] NOTICES AND INFORMATION BEGIN HERE
463433
=========================================
464434
MIT License
@@ -561,60 +531,6 @@ THE SOFTWARE.
561531
=========================================
562532
END OF [email protected] AND INFORMATION
563533

564-
%% [email protected] NOTICES AND INFORMATION BEGIN HERE
565-
=========================================
566-
Copyright (c) 2014 Max Ogden and other contributors
567-
All rights reserved.
568-
569-
Redistribution and use in source and binary forms, with or without
570-
modification, are permitted provided that the following conditions are met:
571-
572-
* Redistributions of source code must retain the above copyright notice, this
573-
list of conditions and the following disclaimer.
574-
575-
* Redistributions in binary form must reproduce the above copyright notice,
576-
this list of conditions and the following disclaimer in the documentation
577-
and/or other materials provided with the distribution.
578-
579-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
580-
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
581-
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
582-
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
583-
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
584-
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
585-
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
586-
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
587-
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
588-
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
589-
=========================================
590-
END OF [email protected] AND INFORMATION
591-
592-
%% [email protected] NOTICES AND INFORMATION BEGIN HERE
593-
=========================================
594-
Copyright (c) 2014 Andrew Kelley
595-
596-
Permission is hereby granted, free of charge, to any person
597-
obtaining a copy of this software and associated documentation files
598-
(the "Software"), to deal in the Software without restriction,
599-
including without limitation the rights to use, copy, modify, merge,
600-
publish, distribute, sublicense, and/or sell copies of the Software,
601-
and to permit persons to whom the Software is furnished to do so,
602-
subject to the following conditions:
603-
604-
The above copyright notice and this permission notice shall be
605-
included in all copies or substantial portions of the Software.
606-
607-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
608-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
609-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
610-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
611-
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
612-
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
613-
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
614-
SOFTWARE.
615-
=========================================
616-
END OF [email protected] AND INFORMATION
617-
618534
%% [email protected] NOTICES AND INFORMATION BEGIN HERE
619535
=========================================
620536
MIT License
@@ -990,6 +906,32 @@ SOFTWARE.
990906
=========================================
991907
END OF [email protected] AND INFORMATION
992908

909+
%% [email protected] NOTICES AND INFORMATION BEGIN HERE
910+
=========================================
911+
The MIT License (MIT)
912+
913+
Copyright (c) 2020 Vercel, Inc.
914+
915+
Permission is hereby granted, free of charge, to any person obtaining a copy
916+
of this software and associated documentation files (the "Software"), to deal
917+
in the Software without restriction, including without limitation the rights
918+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
919+
copies of the Software, and to permit persons to whom the Software is
920+
furnished to do so, subject to the following conditions:
921+
922+
The above copyright notice and this permission notice shall be included in all
923+
copies or substantial portions of the Software.
924+
925+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
926+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
927+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
928+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
929+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
930+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
931+
SOFTWARE.
932+
=========================================
933+
END OF [email protected] AND INFORMATION
934+
993935
%% [email protected] NOTICES AND INFORMATION BEGIN HERE
994936
=========================================
995937
The ISC License
@@ -1129,7 +1071,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
11291071
=========================================
11301072
END OF [email protected] AND INFORMATION
11311073

1132-
%% [email protected].0 NOTICES AND INFORMATION BEGIN HERE
1074+
%% [email protected].2 NOTICES AND INFORMATION BEGIN HERE
11331075
=========================================
11341076
The MIT License (MIT)
11351077

@@ -1153,7 +1095,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
11531095
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
11541096
THE SOFTWARE.
11551097
=========================================
1156-
END OF [email protected].0 AND INFORMATION
1098+
END OF [email protected].2 AND INFORMATION
11571099

11581100
%% [email protected] NOTICES AND INFORMATION BEGIN HERE
11591101
=========================================
@@ -1501,7 +1443,7 @@ THIS SOFTWARE.
15011443
=========================================
15021444
END OF [email protected] AND INFORMATION
15031445

1504-
%% yauzl@2.10.0 NOTICES AND INFORMATION BEGIN HERE
1446+
%% yauzl@3.2.0 NOTICES AND INFORMATION BEGIN HERE
15051447
=========================================
15061448
The MIT License (MIT)
15071449

@@ -1525,7 +1467,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
15251467
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
15261468
SOFTWARE.
15271469
=========================================
1528-
END OF yauzl@2.10.0 AND INFORMATION
1470+
END OF yauzl@3.2.0 AND INFORMATION
15291471

15301472
%% [email protected] NOTICES AND INFORMATION BEGIN HERE
15311473
=========================================
@@ -1555,6 +1497,6 @@ END OF [email protected] AND INFORMATION
15551497

15561498
SUMMARY BEGIN HERE
15571499
=========================================
1558-
Total Packages: 46
1500+
Total Packages: 44
15591501
=========================================
15601502
END OF SUMMARY

packages/playwright-core/bundles/zip/build.js

-18
Original file line numberDiff line numberDiff line change
@@ -16,31 +16,13 @@
1616

1717
// @ts-check
1818
const path = require('path');
19-
const fs = require('fs');
2019
const esbuild = require('esbuild');
2120

22-
// Can be removed once https://github.com/thejoshwolfe/yauzl/issues/114 is fixed.
23-
/** @type{import('esbuild').Plugin} */
24-
let patchFdSlicerToHideBufferDeprecationWarning = {
25-
name: 'patch-fd-slicer-deprecation',
26-
setup(build) {
27-
build.onResolve({ filter: /^fd-slicer$/ }, () => {
28-
const originalPath = require.resolve('fd-slicer');
29-
const patchedPath = path.join(path.dirname(originalPath), path.basename(originalPath, '.js') + '.pw-patched.js');
30-
let sourceFileContent = fs.readFileSync(originalPath, 'utf8')
31-
sourceFileContent = sourceFileContent.replace(/new Buffer\(toRead\)/g, 'Buffer.alloc(toRead)');
32-
fs.writeFileSync(patchedPath, sourceFileContent);
33-
return { path: patchedPath }
34-
});
35-
},
36-
};
37-
3821
(async () => {
3922
const ctx = await esbuild.context({
4023
entryPoints: [path.join(__dirname, 'src/zipBundleImpl.ts')],
4124
bundle: true,
4225
outdir: path.join(__dirname, '../../lib'),
43-
plugins: [patchFdSlicerToHideBufferDeprecationWarning],
4426
format: 'cjs',
4527
platform: 'node',
4628
target: 'ES2019',

0 commit comments

Comments
 (0)