chore: make bundles typed (#13620)

This commit is contained in:
Pavel Feldman 2022-04-18 16:50:25 -08:00 committed by GitHub
parent ed0dcdabc9
commit 63ea81ec54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
68 changed files with 698 additions and 686 deletions

588
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -53,10 +53,6 @@
"@babel/plugin-transform-modules-commonjs": "^7.17.9", "@babel/plugin-transform-modules-commonjs": "^7.17.9",
"@babel/plugin-transform-typescript": "^7.16.8", "@babel/plugin-transform-typescript": "^7.16.8",
"@babel/preset-react": "^7.16.7", "@babel/preset-react": "^7.16.7",
"@types/babel__code-frame": "^7.0.3",
"@types/babel__core": "^7.1.18",
"@types/babel__helper-plugin-utils": "^7.10.0",
"@types/debug": "^4.1.7",
"@types/formidable": "^2.0.4", "@types/formidable": "^2.0.4",
"@types/mime": "^2.0.3", "@types/mime": "^2.0.3",
"@types/minimatch": "^3.0.5", "@types/minimatch": "^3.0.5",
@ -64,24 +60,20 @@
"@types/node": "=14.17.15", "@types/node": "=14.17.15",
"@types/pngjs": "^6.0.1", "@types/pngjs": "^6.0.1",
"@types/progress": "^2.0.5", "@types/progress": "^2.0.5",
"@types/proper-lockfile": "^4.1.2",
"@types/proxy-from-env": "^1.0.1",
"@types/react": "^17.0.38", "@types/react": "^17.0.38",
"@types/react-dom": "^17.0.11", "@types/react-dom": "^17.0.11",
"@types/resize-observer-browser": "^0.1.6", "@types/resize-observer-browser": "^0.1.6",
"@types/rimraf": "^3.0.2",
"@types/source-map-support": "^0.5.4", "@types/source-map-support": "^0.5.4",
"@types/stack-utils": "^2.0.1", "@types/stack-utils": "^2.0.1",
"@types/ws": "8.2.2", "@types/ws": "8.2.2",
"@types/xml2js": "^0.4.9", "@types/xml2js": "^0.4.9",
"@types/yauzl": "^2.10.0",
"@types/yazl": "^2.4.2",
"@typescript-eslint/eslint-plugin": "^5.10.2", "@typescript-eslint/eslint-plugin": "^5.10.2",
"@typescript-eslint/parser": "^5.10.2", "@typescript-eslint/parser": "^5.10.2",
"@vitejs/plugin-react": "^1.0.7", "@vitejs/plugin-react": "^1.0.7",
"@zip.js/zip.js": "^2.4.2", "@zip.js/zip.js": "^2.4.2",
"ansi-to-html": "^0.7.2", "ansi-to-html": "^0.7.2",
"chokidar": "^3.5.3", "chokidar": "^3.5.3",
"colors": "^1.4.0",
"commonmark": "^0.30.0", "commonmark": "^0.30.0",
"concurrently": "^6.2.1", "concurrently": "^6.2.1",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",

View File

@ -7,41 +7,44 @@ This project incorporates components from the projects listed below. The origina
1. agent-base@6.0.2 (https://github.com/TooTallNate/node-agent-base) 1. agent-base@6.0.2 (https://github.com/TooTallNate/node-agent-base)
2. balanced-match@1.0.2 (https://github.com/juliangruber/balanced-match) 2. balanced-match@1.0.2 (https://github.com/juliangruber/balanced-match)
3. brace-expansion@1.1.11 (https://github.com/juliangruber/brace-expansion) 3. brace-expansion@1.1.11 (https://github.com/juliangruber/brace-expansion)
4. concat-map@0.0.1 (https://github.com/substack/node-concat-map) 4. colors@1.4.0 (https://github.com/Marak/colors.js)
5. debug@4.3.4 (https://github.com/debug-js/debug) 5. commander@8.3.0 (https://github.com/tj/commander.js)
6. escape-string-regexp@2.0.0 (https://github.com/sindresorhus/escape-string-regexp) 6. concat-map@0.0.1 (https://github.com/substack/node-concat-map)
7. fs.realpath@1.0.0 (https://github.com/isaacs/fs.realpath) 7. debug@4.3.3 (https://github.com/debug-js/debug)
8. glob@7.2.0 (https://github.com/isaacs/node-glob) 8. escape-string-regexp@2.0.0 (https://github.com/sindresorhus/escape-string-regexp)
9. graceful-fs@4.2.10 (https://github.com/isaacs/node-graceful-fs) 9. fs.realpath@1.0.0 (https://github.com/isaacs/fs.realpath)
10. https-proxy-agent@5.0.0 (https://github.com/TooTallNate/node-https-proxy-agent) 10. glob@7.2.0 (https://github.com/isaacs/node-glob)
11. inflight@1.0.6 (https://github.com/npm/inflight) 11. graceful-fs@4.2.10 (https://github.com/isaacs/node-graceful-fs)
12. inherits@2.0.4 (https://github.com/isaacs/inherits) 12. https-proxy-agent@5.0.0 (https://github.com/TooTallNate/node-https-proxy-agent)
13. ip@1.1.5 (https://github.com/indutny/node-ip) 13. inflight@1.0.6 (https://github.com/npm/inflight)
14. minimatch@3.1.2 (https://github.com/isaacs/minimatch) 14. inherits@2.0.4 (https://github.com/isaacs/inherits)
15. ms@2.1.2 (https://github.com/zeit/ms) 15. ip@1.1.5 (https://github.com/indutny/node-ip)
16. once@1.4.0 (https://github.com/isaacs/once) 16. minimatch@3.1.2 (https://github.com/isaacs/minimatch)
17. path-is-absolute@1.0.1 (https://github.com/sindresorhus/path-is-absolute) 17. ms@2.1.2 (https://github.com/zeit/ms)
18. proper-lockfile@4.1.2 (https://github.com/moxystudio/node-proper-lockfile) 18. once@1.4.0 (https://github.com/isaacs/once)
19. proxy-from-env@1.1.0 (https://github.com/Rob--W/proxy-from-env) 19. path-is-absolute@1.0.1 (https://github.com/sindresorhus/path-is-absolute)
20. retry@0.12.0 (https://github.com/tim-kos/node-retry) 20. proper-lockfile@4.1.2 (https://github.com/moxystudio/node-proper-lockfile)
21. rimraf@3.0.2 (https://github.com/isaacs/rimraf) 21. proxy-from-env@1.1.0 (https://github.com/Rob--W/proxy-from-env)
22. signal-exit@3.0.7 (https://github.com/tapjs/signal-exit) 22. retry@0.12.0 (https://github.com/tim-kos/node-retry)
23. smart-buffer@4.2.0 (https://github.com/JoshGlazebrook/smart-buffer) 23. rimraf@3.0.2 (https://github.com/isaacs/rimraf)
24. socks-proxy-agent@6.1.1 (https://github.com/TooTallNate/node-socks-proxy-agent) 24. signal-exit@3.0.7 (https://github.com/tapjs/signal-exit)
25. socks@2.6.2 (https://github.com/JoshGlazebrook/socks) 25. smart-buffer@4.2.0 (https://github.com/JoshGlazebrook/smart-buffer)
26. stack-utils@2.0.5 (https://github.com/tapjs/stack-utils) 26. socks-proxy-agent@6.1.1 (https://github.com/TooTallNate/node-socks-proxy-agent)
27. wrappy@1.0.2 (https://github.com/npm/wrappy) 27. socks@2.6.2 (https://github.com/JoshGlazebrook/socks)
28. @types/node@17.0.24 (https://github.com/DefinitelyTyped/DefinitelyTyped) 28. stack-utils@2.0.5 (https://github.com/tapjs/stack-utils)
29. @types/yauzl@2.10.0 (https://github.com/DefinitelyTyped/DefinitelyTyped) 29. wrappy@1.0.2 (https://github.com/npm/wrappy)
30. buffer-crc32@0.2.13 (https://github.com/brianloveswords/buffer-crc32) 30. @types/node@17.0.24 (https://github.com/DefinitelyTyped/DefinitelyTyped)
31. end-of-stream@1.4.4 (https://github.com/mafintosh/end-of-stream) 31. @types/yauzl@2.10.0 (https://github.com/DefinitelyTyped/DefinitelyTyped)
32. extract-zip@2.0.1 (https://github.com/maxogden/extract-zip) 32. buffer-crc32@0.2.13 (https://github.com/brianloveswords/buffer-crc32)
33. fd-slicer@1.1.0 (https://github.com/andrewrk/node-fd-slicer) 33. debug@4.3.4 (https://github.com/debug-js/debug)
34. get-stream@5.2.0 (https://github.com/sindresorhus/get-stream) 34. end-of-stream@1.4.4 (https://github.com/mafintosh/end-of-stream)
35. pend@1.2.0 (https://github.com/andrewrk/node-pend) 35. extract-zip@2.0.1 (https://github.com/maxogden/extract-zip)
36. pump@3.0.0 (https://github.com/mafintosh/pump) 36. fd-slicer@1.1.0 (https://github.com/andrewrk/node-fd-slicer)
37. yauzl@2.10.0 (https://github.com/thejoshwolfe/yauzl) 37. get-stream@5.2.0 (https://github.com/sindresorhus/get-stream)
38. yazl@2.5.1 (https://github.com/thejoshwolfe/yazl) 38. pend@1.2.0 (https://github.com/andrewrk/node-pend)
39. pump@3.0.0 (https://github.com/mafintosh/pump)
40. yauzl@2.10.0 (https://github.com/thejoshwolfe/yauzl)
41. yazl@2.5.1 (https://github.com/thejoshwolfe/yazl)
%% agent-base@6.0.2 NOTICES AND INFORMATION BEGIN HERE %% agent-base@6.0.2 NOTICES AND INFORMATION BEGIN HERE
========================================= =========================================
@ -245,6 +248,63 @@ SOFTWARE.
========================================= =========================================
END OF brace-expansion@1.1.11 AND INFORMATION END OF brace-expansion@1.1.11 AND INFORMATION
%% colors@1.4.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License
Original Library
- Copyright (c) Marak Squires
Additional Functionality
- Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
=========================================
END OF colors@1.4.0 AND INFORMATION
%% commander@8.3.0 NOTICES AND INFORMATION BEGIN HERE
=========================================
(The MIT License)
Copyright (c) 2011 TJ Holowaychuk <tj@vision-media.ca>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF commander@8.3.0 AND INFORMATION
%% concat-map@0.0.1 NOTICES AND INFORMATION BEGIN HERE %% concat-map@0.0.1 NOTICES AND INFORMATION BEGIN HERE
========================================= =========================================
This software is released under the MIT license: This software is released under the MIT license:
@ -268,7 +328,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
========================================= =========================================
END OF concat-map@0.0.1 AND INFORMATION END OF concat-map@0.0.1 AND INFORMATION
%% debug@4.3.4 NOTICES AND INFORMATION BEGIN HERE %% debug@4.3.3 NOTICES AND INFORMATION BEGIN HERE
========================================= =========================================
(The MIT License) (The MIT License)
@ -290,7 +350,7 @@ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMA
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
========================================= =========================================
END OF debug@4.3.4 AND INFORMATION END OF debug@4.3.3 AND INFORMATION
%% escape-string-regexp@2.0.0 NOTICES AND INFORMATION BEGIN HERE %% escape-string-regexp@2.0.0 NOTICES AND INFORMATION BEGIN HERE
========================================= =========================================
@ -1216,6 +1276,30 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEAL
========================================= =========================================
END OF buffer-crc32@0.2.13 AND INFORMATION END OF buffer-crc32@0.2.13 AND INFORMATION
%% debug@4.3.4 NOTICES AND INFORMATION BEGIN HERE
=========================================
(The MIT License)
Copyright (c) 2014-2017 TJ Holowaychuk <tj@vision-media.ca>
Copyright (c) 2018-2021 Josh Junon
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation files (the 'Software'), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial
portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF debug@4.3.4 AND INFORMATION
%% end-of-stream@1.4.4 NOTICES AND INFORMATION BEGIN HERE %% end-of-stream@1.4.4 NOTICES AND INFORMATION BEGIN HERE
========================================= =========================================
The MIT License (MIT) The MIT License (MIT)

View File

@ -8,14 +8,101 @@
"name": "utils-bundle", "name": "utils-bundle",
"version": "0.0.1", "version": "0.0.1",
"dependencies": { "dependencies": {
"colors": "1.4.0",
"commander": "8.3.0",
"debug": "4.3.3",
"https-proxy-agent": "5.0.0", "https-proxy-agent": "5.0.0",
"proper-lockfile": "4.1.2", "proper-lockfile": "4.1.2",
"proxy-from-env": "1.1.0", "proxy-from-env": "1.1.0",
"rimraf": "3.0.2", "rimraf": "3.0.2",
"socks-proxy-agent": "6.1.1", "socks-proxy-agent": "6.1.1",
"stack-utils": "2.0.5" "stack-utils": "2.0.5"
},
"devDependencies": {
"@types/debug": "^4.1.7",
"@types/proper-lockfile": "^4.1.2",
"@types/proxy-from-env": "^1.0.1",
"@types/rimraf": "^3.0.2",
"@types/stack-utils": "^2.0.1"
} }
}, },
"node_modules/@types/debug": {
"version": "4.1.7",
"resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.7.tgz",
"integrity": "sha512-9AonUzyTjXXhEOa0DnqpzZi6VHlqKMswga9EXjpXnnqxwLtdvPPtlO8evrI5D9S6asFRCQ6v+wpiUKbw+vKqyg==",
"dev": true,
"dependencies": {
"@types/ms": "*"
}
},
"node_modules/@types/glob": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz",
"integrity": "sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==",
"dev": true,
"dependencies": {
"@types/minimatch": "*",
"@types/node": "*"
}
},
"node_modules/@types/minimatch": {
"version": "3.0.5",
"resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.5.tgz",
"integrity": "sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ==",
"dev": true
},
"node_modules/@types/ms": {
"version": "0.7.31",
"resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.31.tgz",
"integrity": "sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA==",
"dev": true
},
"node_modules/@types/node": {
"version": "17.0.25",
"resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.25.tgz",
"integrity": "sha512-wANk6fBrUwdpY4isjWrKTufkrXdu1D2YHCot2fD/DfWxF5sMrVSA+KN7ydckvaTCh0HiqX9IVl0L5/ZoXg5M7w==",
"dev": true
},
"node_modules/@types/proper-lockfile": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/@types/proper-lockfile/-/proper-lockfile-4.1.2.tgz",
"integrity": "sha512-kd4LMvcnpYkspDcp7rmXKedn8iJSCoa331zRRamUp5oanKt/CefbEGPQP7G89enz7sKD4bvsr8mHSsC8j5WOvA==",
"dev": true,
"dependencies": {
"@types/retry": "*"
}
},
"node_modules/@types/proxy-from-env": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@types/proxy-from-env/-/proxy-from-env-1.0.1.tgz",
"integrity": "sha512-luG++TFHyS61eKcfkR1CVV6a1GMNXDjtqEQIIfaSHax75xp0HU3SlezjOi1yqubJwrG8e9DeW59n6wTblIDwFg==",
"dev": true,
"dependencies": {
"@types/node": "*"
}
},
"node_modules/@types/retry": {
"version": "0.12.1",
"resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.1.tgz",
"integrity": "sha512-xoDlM2S4ortawSWORYqsdU+2rxdh4LRW9ytc3zmT37RIKQh6IHyKwwtKhKis9ah8ol07DCkZxPt8BBvPjC6v4g==",
"dev": true
},
"node_modules/@types/rimraf": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/@types/rimraf/-/rimraf-3.0.2.tgz",
"integrity": "sha512-F3OznnSLAUxFrCEu/L5PY8+ny8DtcFRjx7fZZ9bycvXRi3KPTRS9HOitGZwvPg0juRhXFWIeKX58cnX5YqLohQ==",
"dev": true,
"dependencies": {
"@types/glob": "*",
"@types/node": "*"
}
},
"node_modules/@types/stack-utils": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.1.tgz",
"integrity": "sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==",
"dev": true
},
"node_modules/agent-base": { "node_modules/agent-base": {
"version": "6.0.2", "version": "6.0.2",
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz",
@ -41,15 +128,31 @@
"concat-map": "0.0.1" "concat-map": "0.0.1"
} }
}, },
"node_modules/colors": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz",
"integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==",
"engines": {
"node": ">=0.1.90"
}
},
"node_modules/commander": {
"version": "8.3.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz",
"integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==",
"engines": {
"node": ">= 12"
}
},
"node_modules/concat-map": { "node_modules/concat-map": {
"version": "0.0.1", "version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
}, },
"node_modules/debug": { "node_modules/debug": {
"version": "4.3.4", "version": "4.3.3",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz",
"integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==",
"dependencies": { "dependencies": {
"ms": "2.1.2" "ms": "2.1.2"
}, },
@ -257,6 +360,83 @@
} }
}, },
"dependencies": { "dependencies": {
"@types/debug": {
"version": "4.1.7",
"resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.7.tgz",
"integrity": "sha512-9AonUzyTjXXhEOa0DnqpzZi6VHlqKMswga9EXjpXnnqxwLtdvPPtlO8evrI5D9S6asFRCQ6v+wpiUKbw+vKqyg==",
"dev": true,
"requires": {
"@types/ms": "*"
}
},
"@types/glob": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz",
"integrity": "sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==",
"dev": true,
"requires": {
"@types/minimatch": "*",
"@types/node": "*"
}
},
"@types/minimatch": {
"version": "3.0.5",
"resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.5.tgz",
"integrity": "sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ==",
"dev": true
},
"@types/ms": {
"version": "0.7.31",
"resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.31.tgz",
"integrity": "sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA==",
"dev": true
},
"@types/node": {
"version": "17.0.25",
"resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.25.tgz",
"integrity": "sha512-wANk6fBrUwdpY4isjWrKTufkrXdu1D2YHCot2fD/DfWxF5sMrVSA+KN7ydckvaTCh0HiqX9IVl0L5/ZoXg5M7w==",
"dev": true
},
"@types/proper-lockfile": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/@types/proper-lockfile/-/proper-lockfile-4.1.2.tgz",
"integrity": "sha512-kd4LMvcnpYkspDcp7rmXKedn8iJSCoa331zRRamUp5oanKt/CefbEGPQP7G89enz7sKD4bvsr8mHSsC8j5WOvA==",
"dev": true,
"requires": {
"@types/retry": "*"
}
},
"@types/proxy-from-env": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@types/proxy-from-env/-/proxy-from-env-1.0.1.tgz",
"integrity": "sha512-luG++TFHyS61eKcfkR1CVV6a1GMNXDjtqEQIIfaSHax75xp0HU3SlezjOi1yqubJwrG8e9DeW59n6wTblIDwFg==",
"dev": true,
"requires": {
"@types/node": "*"
}
},
"@types/retry": {
"version": "0.12.1",
"resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.1.tgz",
"integrity": "sha512-xoDlM2S4ortawSWORYqsdU+2rxdh4LRW9ytc3zmT37RIKQh6IHyKwwtKhKis9ah8ol07DCkZxPt8BBvPjC6v4g==",
"dev": true
},
"@types/rimraf": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/@types/rimraf/-/rimraf-3.0.2.tgz",
"integrity": "sha512-F3OznnSLAUxFrCEu/L5PY8+ny8DtcFRjx7fZZ9bycvXRi3KPTRS9HOitGZwvPg0juRhXFWIeKX58cnX5YqLohQ==",
"dev": true,
"requires": {
"@types/glob": "*",
"@types/node": "*"
}
},
"@types/stack-utils": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.1.tgz",
"integrity": "sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==",
"dev": true
},
"agent-base": { "agent-base": {
"version": "6.0.2", "version": "6.0.2",
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz",
@ -279,15 +459,25 @@
"concat-map": "0.0.1" "concat-map": "0.0.1"
} }
}, },
"colors": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz",
"integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA=="
},
"commander": {
"version": "8.3.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz",
"integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww=="
},
"concat-map": { "concat-map": {
"version": "0.0.1", "version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
}, },
"debug": { "debug": {
"version": "4.3.4", "version": "4.3.3",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz",
"integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==",
"requires": { "requires": {
"ms": "2.1.2" "ms": "2.1.2"
} }

View File

@ -3,17 +3,27 @@
"version": "0.0.1", "version": "0.0.1",
"private": true, "private": true,
"scripts": { "scripts": {
"esbuild": "esbuild ./src/utilsBundle.ts --bundle --outdir=../../lib --format=cjs --platform=node --target=ES2019", "esbuild": "esbuild ./src/utilsBundleImpl.ts --bundle --outdir=../../lib --format=cjs --platform=node --target=ES2019",
"build": "npm ci && npm run esbuild -- --minify", "build": "npm ci && npm run esbuild -- --minify",
"watch": "npm ci && npm run esbuild -- --watch --sourcemap", "watch": "npm ci && npm run esbuild -- --watch --sourcemap",
"generate-license": "node ../../../../utils/generate_third_party_notice.js" "generate-license": "node ../../../../utils/generate_third_party_notice.js"
}, },
"dependencies": { "dependencies": {
"colors": "1.4.0",
"commander": "8.3.0",
"debug": "4.3.3",
"https-proxy-agent": "5.0.0", "https-proxy-agent": "5.0.0",
"proper-lockfile": "4.1.2", "proper-lockfile": "4.1.2",
"proxy-from-env": "1.1.0", "proxy-from-env": "1.1.0",
"socks-proxy-agent": "6.1.1", "socks-proxy-agent": "6.1.1",
"stack-utils": "2.0.5", "stack-utils": "2.0.5",
"rimraf": "3.0.2" "rimraf": "3.0.2"
},
"devDependencies": {
"@types/debug": "^4.1.7",
"@types/proper-lockfile": "^4.1.2",
"@types/proxy-from-env": "^1.0.1",
"@types/rimraf": "^3.0.2",
"@types/stack-utils": "^2.0.1"
} }
} }

View File

@ -14,15 +14,25 @@
* limitations under the License. * limitations under the License.
*/ */
import rimrafLibrary from 'rimraf'; import colorsLibrary from 'colors/safe';
export const rimraf = rimrafLibrary; export const colors = colorsLibrary;
import debugLibrary from 'debug';
export const debug = debugLibrary;
export { getProxyForUrl } from 'proxy-from-env';
export { HttpsProxyAgent } from 'https-proxy-agent';
import lockfileLibrary from 'proper-lockfile'; import lockfileLibrary from 'proper-lockfile';
export const lockfile = lockfileLibrary; export const lockfile = lockfileLibrary;
export { program } from 'commander';
import rimrafLibrary from 'rimraf';
export const rimraf = rimrafLibrary;
export { SocksProxyAgent } from 'socks-proxy-agent';
import StackUtilsLibrary from 'stack-utils'; import StackUtilsLibrary from 'stack-utils';
export const StackUtils = StackUtilsLibrary; export const StackUtils = StackUtilsLibrary;
export { HttpsProxyAgent } from 'https-proxy-agent';
export { SocksProxyAgent } from 'socks-proxy-agent';
export { getProxyForUrl } from 'proxy-from-env';

View File

@ -11,19 +11,32 @@
"extract-zip": "2.0.1", "extract-zip": "2.0.1",
"yauzl": "2.10.0", "yauzl": "2.10.0",
"yazl": "2.5.1" "yazl": "2.5.1"
},
"devDependencies": {
"@types/yauzl": "^2.10.0",
"@types/yazl": "^2.4.2"
} }
}, },
"node_modules/@types/node": { "node_modules/@types/node": {
"version": "17.0.24", "version": "17.0.24",
"resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.24.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.24.tgz",
"integrity": "sha512-aveCYRQbgTH9Pssp1voEP7HiuWlD2jW2BO56w+bVrJn04i61yh6mRfoKO6hEYQD9vF+W8Chkwc6j1M36uPkx4g==", "integrity": "sha512-aveCYRQbgTH9Pssp1voEP7HiuWlD2jW2BO56w+bVrJn04i61yh6mRfoKO6hEYQD9vF+W8Chkwc6j1M36uPkx4g==",
"optional": true "devOptional": true
}, },
"node_modules/@types/yauzl": { "node_modules/@types/yauzl": {
"version": "2.10.0", "version": "2.10.0",
"resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.10.0.tgz", "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.10.0.tgz",
"integrity": "sha512-Cn6WYCm0tXv8p6k+A8PvbDG763EDpBoTzHdA+Q/MF6H3sapGjCm9NzoaJncJS9tUKSuCoDs9XHxYYsQDgxR6kw==", "integrity": "sha512-Cn6WYCm0tXv8p6k+A8PvbDG763EDpBoTzHdA+Q/MF6H3sapGjCm9NzoaJncJS9tUKSuCoDs9XHxYYsQDgxR6kw==",
"optional": true, "devOptional": true,
"dependencies": {
"@types/node": "*"
}
},
"node_modules/@types/yazl": {
"version": "2.4.2",
"resolved": "https://registry.npmjs.org/@types/yazl/-/yazl-2.4.2.tgz",
"integrity": "sha512-T+9JH8O2guEjXNxqmybzQ92mJUh2oCwDDMSSimZSe1P+pceZiFROZLYmcbqkzV5EUwz6VwcKXCO2S2yUpra6XQ==",
"dev": true,
"dependencies": { "dependencies": {
"@types/node": "*" "@types/node": "*"
} }
@ -156,13 +169,22 @@
"version": "17.0.24", "version": "17.0.24",
"resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.24.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.24.tgz",
"integrity": "sha512-aveCYRQbgTH9Pssp1voEP7HiuWlD2jW2BO56w+bVrJn04i61yh6mRfoKO6hEYQD9vF+W8Chkwc6j1M36uPkx4g==", "integrity": "sha512-aveCYRQbgTH9Pssp1voEP7HiuWlD2jW2BO56w+bVrJn04i61yh6mRfoKO6hEYQD9vF+W8Chkwc6j1M36uPkx4g==",
"optional": true "devOptional": true
}, },
"@types/yauzl": { "@types/yauzl": {
"version": "2.10.0", "version": "2.10.0",
"resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.10.0.tgz", "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.10.0.tgz",
"integrity": "sha512-Cn6WYCm0tXv8p6k+A8PvbDG763EDpBoTzHdA+Q/MF6H3sapGjCm9NzoaJncJS9tUKSuCoDs9XHxYYsQDgxR6kw==", "integrity": "sha512-Cn6WYCm0tXv8p6k+A8PvbDG763EDpBoTzHdA+Q/MF6H3sapGjCm9NzoaJncJS9tUKSuCoDs9XHxYYsQDgxR6kw==",
"optional": true, "devOptional": true,
"requires": {
"@types/node": "*"
}
},
"@types/yazl": {
"version": "2.4.2",
"resolved": "https://registry.npmjs.org/@types/yazl/-/yazl-2.4.2.tgz",
"integrity": "sha512-T+9JH8O2guEjXNxqmybzQ92mJUh2oCwDDMSSimZSe1P+pceZiFROZLYmcbqkzV5EUwz6VwcKXCO2S2yUpra6XQ==",
"dev": true,
"requires": { "requires": {
"@types/node": "*" "@types/node": "*"
} }

View File

@ -3,7 +3,7 @@
"version": "0.0.1", "version": "0.0.1",
"private": true, "private": true,
"scripts": { "scripts": {
"esbuild": "esbuild ./src/zipBundle.ts --bundle --outdir=../../lib --format=cjs --platform=node --target=ES2019", "esbuild": "esbuild ./src/zipBundleImpl.ts --bundle --outdir=../../lib --format=cjs --platform=node --target=ES2019",
"build": "npm ci && npm run esbuild -- --minify", "build": "npm ci && npm run esbuild -- --minify",
"watch": "npm ci && npm run esbuild -- --watch --sourcemap", "watch": "npm ci && npm run esbuild -- --watch --sourcemap",
"generate-license": "node ../../../../utils/generate_third_party_notice.js" "generate-license": "node ../../../../utils/generate_third_party_notice.js"
@ -12,5 +12,9 @@
"extract-zip": "2.0.1", "extract-zip": "2.0.1",
"yauzl": "2.10.0", "yauzl": "2.10.0",
"yazl": "2.5.1" "yazl": "2.5.1"
},
"devDependencies": {
"@types/yauzl": "^2.10.0",
"@types/yazl": "^2.4.2"
} }
} }

View File

@ -44,9 +44,6 @@
"playwright": "./cli.js" "playwright": "./cli.js"
}, },
"dependencies": { "dependencies": {
"commander": "8.3.0",
"colors": "1.4.0",
"debug": "4.3.3",
"jpeg-js": "0.4.3", "jpeg-js": "0.4.3",
"mime": "3.0.0", "mime": "3.0.0",
"pngjs": "6.0.0", "pngjs": "6.0.0",

View File

@ -8,6 +8,7 @@
../server/injected/ ../server/injected/
../server/trace ../server/trace
../utils ../utils
../utilsBundle.ts
[cli.ts] [cli.ts]
../server/trace/viewer/traceViewer.ts ../server/trace/viewer/traceViewer.ts

View File

@ -21,8 +21,8 @@
import fs from 'fs'; import fs from 'fs';
import os from 'os'; import os from 'os';
import path from 'path'; import path from 'path';
import type { Command } from 'commander'; import type { Command } from '../utilsBundle';
import { program } from 'commander'; import { program } from '../utilsBundle';
import { runDriver, runServer, printApiJson, launchBrowserServer } from './driver'; import { runDriver, runServer, printApiJson, launchBrowserServer } from './driver';
import { showTraceViewer } from '../server/trace/viewer/traceViewer'; import { showTraceViewer } from '../server/trace/viewer/traceViewer';
import * as playwright from '../..'; import * as playwright from '../..';
@ -597,6 +597,7 @@ function lookupBrowserType(options: Options): BrowserType {
if (browserType) if (browserType)
return browserType; return browserType;
program.help(); program.help();
process.exit(1);
} }
function validateOptions(options: Options) { function validateOptions(options: Options) {

View File

@ -2,3 +2,4 @@
../common/ ../common/
../protocol/ ../protocol/
../utils/** ../utils/**
../utilsBundle.ts

View File

@ -1,2 +1,3 @@
[*] [*]
../utils/ ../utils/
../utilsBundle.ts

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
import debug from 'debug'; import { debug } from '../utilsBundle';
import fs from 'fs'; import fs from 'fs';
const debugLoggerColorMap = { const debugLoggerColorMap = {

View File

@ -17,11 +17,10 @@
import http from 'http'; import http from 'http';
import https from 'https'; import https from 'https';
import net from 'net'; import net from 'net';
import { getProxyForUrl } from '../utilsBundle';
import { HttpsProxyAgent } from '../utilsBundle';
import * as URL from 'url'; import * as URL from 'url';
const { HttpsProxyAgent }: typeof import('../../bundles/utils/node_modules/https-proxy-agent') = require('../utilsBundle');
const { getProxyForUrl }: typeof import('proxy-from-env') = require('../utilsBundle');
export async function createSocket(host: string, port: number): Promise<net.Socket> { export async function createSocket(host: string, port: number): Promise<net.Socket> {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const socket = net.createConnection({ host, port }); const socket = net.createConnection({ host, port });

View File

@ -5,3 +5,4 @@
../remote/ ../remote/
../server/ ../server/
../utils/ ../utils/
../utilsBundle.ts

View File

@ -16,7 +16,7 @@
import type { GridAgentLaunchOptions, GridFactory } from './gridServer'; import type { GridAgentLaunchOptions, GridFactory } from './gridServer';
import https from 'https'; import https from 'https';
import debug from 'debug'; import { debug } from '../utilsBundle';
const repoName = process.env.GITHUB_AGENT_REPO; const repoName = process.env.GITHUB_AGENT_REPO;
if (!repoName) if (!repoName)

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
import debug from 'debug'; import { debug } from '../utilsBundle';
import WebSocket from 'ws'; import WebSocket from 'ws';
import { fork } from 'child_process'; import { fork } from 'child_process';
import { getPlaywrightVersion } from '../common/userAgent'; import { getPlaywrightVersion } from '../common/userAgent';

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
import debug from 'debug'; import { debug } from '../utilsBundle';
import WebSocket from 'ws'; import WebSocket from 'ws';
import { PlaywrightConnection } from '../remote/playwrightConnection'; import { PlaywrightConnection } from '../remote/playwrightConnection';
import { gracefullyCloseAll } from '../utils/processLauncher'; import { gracefullyCloseAll } from '../utils/processLauncher';

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
import debug from 'debug'; import { debug } from '../utilsBundle';
import { EventEmitter } from 'events'; import { EventEmitter } from 'events';
import { URL } from 'url'; import { URL } from 'url';
import type { Server as WebSocketServer } from 'ws'; import type { Server as WebSocketServer } from 'ws';

View File

@ -4,3 +4,4 @@
../dispatchers/ ../dispatchers/
../server/ ../server/
../utils/ ../utils/
../utilsBundle.ts

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
import debug from 'debug'; import { debug } from '../utilsBundle';
import * as http from 'http'; import * as http from 'http';
import WebSocket from 'ws'; import WebSocket from 'ws';
import type { Browser } from '../server/browser'; import type { Browser } from '../server/browser';

View File

@ -3,6 +3,8 @@
../generated/ ../generated/
../protocol/ ../protocol/
../utils/ ../utils/
../utilsBundle.ts
../zipBundle.ts
./ ./
./injected/ ./injected/
./isomorphic/ ./isomorphic/

View File

@ -3,4 +3,5 @@
../../common/ ../../common/
../../protocol/ ../../protocol/
../../utils/ ../../utils/
../../utilsBundle.ts
../chromium/ ../chromium/

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
import debug from 'debug'; import { debug } from '../../utilsBundle';
import type * as types from '../types'; import type * as types from '../types';
import { EventEmitter } from 'events'; import { EventEmitter } from 'events';
import fs from 'fs'; import fs from 'fs';

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
import debug from 'debug'; import { debug } from '../../utilsBundle';
import type * as types from '../types'; import type * as types from '../types';
import * as net from 'net'; import * as net from 'net';
import { EventEmitter } from 'events'; import { EventEmitter } from 'events';

View File

@ -2,4 +2,5 @@
../../common/ ../../common/
../../protocol/ ../../protocol/
../../utils/ ../../utils/
../../zipBundle.ts
../** ../**

View File

@ -22,9 +22,7 @@ import { ManualPromise } from '../../utils/manualPromise';
import { assert, createGuid } from '../../utils'; import { assert, createGuid } from '../../utils';
import type { DispatcherScope } from './dispatcher'; import type { DispatcherScope } from './dispatcher';
import { Dispatcher } from './dispatcher'; import { Dispatcher } from './dispatcher';
import { yazl, yauzl } from '../../zipBundle';
const yazl: typeof import('yazl') = require('../../zipBundle').yazl;
const yauzl: typeof import('yauzl') = require('../../zipBundle').yauzl;
export class LocalUtilsDispatcher extends Dispatcher<{ guid: string }, channels.LocalUtilsChannel> implements channels.LocalUtilsChannel { export class LocalUtilsDispatcher extends Dispatcher<{ guid: string }, channels.LocalUtilsChannel> implements channels.LocalUtilsChannel {
_type_LocalUtils: boolean; _type_LocalUtils: boolean;

View File

@ -36,9 +36,7 @@ import { ProgressController } from './progress';
import { Tracing } from './trace/recorder/tracing'; import { Tracing } from './trace/recorder/tracing';
import type * as types from './types'; import type * as types from './types';
import type { HeadersArray, ProxySettings } from './types'; import type { HeadersArray, ProxySettings } from './types';
import { HttpsProxyAgent, SocksProxyAgent } from '../utilsBundle';
const { HttpsProxyAgent }: typeof import('../../bundles/utils/node_modules/https-proxy-agent') = require('../utilsBundle');
const { SocksProxyAgent }: typeof import('../../bundles/utils/node_modules/socks-proxy-agent') = require('../utilsBundle');
type FetchRequestOptions = { type FetchRequestOptions = {
userAgent: string; userAgent: string;

View File

@ -4,6 +4,7 @@
../../common/ ../../common/
../../protocol/ ../../protocol/
../../utils/** ../../utils/**
../../zipBundle.ts
[recorderApp.ts] [recorderApp.ts]
../chromium/crApp.ts ../chromium/crApp.ts

View File

@ -22,8 +22,7 @@ import { getUserAgent } from '../../common/userAgent';
import { existsAsync } from '../../utils/fileUtils'; import { existsAsync } from '../../utils/fileUtils';
import { debugLogger } from '../../common/debugLogger'; import { debugLogger } from '../../common/debugLogger';
import { download } from './download'; import { download } from './download';
import { extract } from '../../zipBundle';
const extract: typeof import('../../../bundles/zip/node_modules/extract-zip') = require('../../zipBundle').extract;
export async function downloadBrowserWithProgressBar(title: string, browserDirectory: string, executablePath: string, downloadURL: string, downloadFileName: string): Promise<boolean> { export async function downloadBrowserWithProgressBar(title: string, browserDirectory: string, executablePath: string, downloadURL: string, downloadFileName: string): Promise<boolean> {
const progressBarName = `Playwright build of ${title}`; const progressBarName = `Playwright build of ${title}`;

View File

@ -19,6 +19,7 @@ import * as os from 'os';
import path from 'path'; import path from 'path';
import * as util from 'util'; import * as util from 'util';
import * as fs from 'fs'; import * as fs from 'fs';
import { lockfile } from '../../utilsBundle';
import { getUbuntuVersion } from '../../utils/ubuntuVersion'; import { getUbuntuVersion } from '../../utils/ubuntuVersion';
import { fetchData } from '../../common/netUtils'; import { fetchData } from '../../common/netUtils';
import { getClientLanguage } from '../../common/userAgent'; import { getClientLanguage } from '../../common/userAgent';
@ -32,8 +33,6 @@ import { installDependenciesLinux, installDependenciesWindows, validateDependenc
import { downloadBrowserWithProgressBar, logPolitely } from './browserFetcher'; import { downloadBrowserWithProgressBar, logPolitely } from './browserFetcher';
export { writeDockerVersion } from './dependencies'; export { writeDockerVersion } from './dependencies';
const lockfile: typeof import('proper-lockfile') = require('../../utilsBundle').lockfile;
const PACKAGE_PATH = path.join(__dirname, '..', '..', '..'); const PACKAGE_PATH = path.join(__dirname, '..', '..', '..');
const BIN_PATH = path.join(__dirname, '..', '..', '..', 'bin'); const BIN_PATH = path.join(__dirname, '..', '..', '..', 'bin');

View File

@ -4,4 +4,5 @@
../../../common/ ../../../common/
../../../protocol/ ../../../protocol/
../../../utils/ ../../../utils/
../../../zipBundle.ts
../common/ ../common/

View File

@ -41,8 +41,7 @@ import type * as trace from '../common/traceEvents';
import { VERSION } from '../common/traceEvents'; import { VERSION } from '../common/traceEvents';
import type { SnapshotterBlob, SnapshotterDelegate } from './snapshotter'; import type { SnapshotterBlob, SnapshotterDelegate } from './snapshotter';
import { Snapshotter } from './snapshotter'; import { Snapshotter } from './snapshotter';
import { yazl } from '../../../zipBundle';
const yazl: typeof import('yazl') = require('../../../zipBundle').yazl;
export type TracerOptions = { export type TracerOptions = {
name?: string; name?: string;

View File

@ -2,3 +2,4 @@
./ ./
../third_party/diff_match_patch ../third_party/diff_match_patch
../third_party/pixelmatch ../third_party/pixelmatch
../utilsBundle.ts

View File

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import colors from 'colors/safe'; import { colors } from '../utilsBundle';
import jpeg from 'jpeg-js'; import jpeg from 'jpeg-js';
import pixelmatch from '../third_party/pixelmatch'; import pixelmatch from '../third_party/pixelmatch';
import { diff_match_patch, DIFF_INSERT, DIFF_DELETE, DIFF_EQUAL } from '../third_party/diff_match_patch'; import { diff_match_patch, DIFF_INSERT, DIFF_DELETE, DIFF_EQUAL } from '../third_party/diff_match_patch';

View File

@ -16,7 +16,7 @@
import fs from 'fs'; import fs from 'fs';
import path from 'path'; import path from 'path';
const rimraf: typeof import('rimraf') = require('../utilsBundle').rimraf; import { rimraf } from '../utilsBundle';
export const existsAsync = (path: string): Promise<boolean> => new Promise(resolve => fs.stat(path, err => resolve(!err))); export const existsAsync = (path: string): Promise<boolean> => new Promise(resolve => fs.stat(path, err => resolve(!err)));

View File

@ -20,8 +20,7 @@ import * as readline from 'readline';
import { eventsHelper } from './eventsHelper'; import { eventsHelper } from './eventsHelper';
import { isUnderTest } from './'; import { isUnderTest } from './';
import { removeFolders } from './fileUtils'; import { removeFolders } from './fileUtils';
import { rimraf } from '../utilsBundle';
const rimraf: typeof import('rimraf') = require('../utilsBundle').rimraf;
export type Env = {[key: string]: string | number | boolean | undefined}; export type Env = {[key: string]: string | number | boolean | undefined};

View File

@ -15,10 +15,9 @@
*/ */
import path from 'path'; import path from 'path';
import { StackUtils } from '../utilsBundle';
import { isUnderTest } from './'; import { isUnderTest } from './';
const StackUtils: typeof import('stack-utils') = require('../utilsBundle').StackUtils;
const stackUtils = new StackUtils(); const stackUtils = new StackUtils();
export function rewriteErrorMessage<E extends Error>(e: E, newMessage: string): E { export function rewriteErrorMessage<E extends Error>(e: E, newMessage: string): E {

View File

@ -0,0 +1,26 @@
/**
* Copyright (c) Microsoft Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export const colors: typeof import('../bundles/utils/node_modules/colors/safe') = require('./utilsBundleImpl').colors;
export const debug: typeof import('../bundles/utils/node_modules/@types/debug') = require('./utilsBundleImpl').debug;
export const getProxyForUrl: typeof import('../bundles/utils/node_modules/@types/proxy-from-env').getProxyForUrl = require('./utilsBundleImpl').getProxyForUrl;
export const HttpsProxyAgent: typeof import('../bundles/utils/node_modules/https-proxy-agent').HttpsProxyAgent = require('./utilsBundleImpl').HttpsProxyAgent;
export const lockfile: typeof import('../bundles/utils/node_modules/@types/proper-lockfile') = require('./utilsBundleImpl').lockfile;
export const program: typeof import('../bundles/utils/node_modules/commander').program = require('./utilsBundleImpl').program;
export const rimraf: typeof import('../bundles/utils/node_modules/@types/rimraf') = require('./utilsBundleImpl').rimraf;
export const SocksProxyAgent: typeof import('../bundles/utils/node_modules/socks-proxy-agent').SocksProxyAgent = require('./utilsBundleImpl').SocksProxyAgent;
export const StackUtils: typeof import('../bundles/utils/node_modules/@types/stack-utils') = require('./utilsBundleImpl').StackUtils;
export type { Command } from '../bundles/utils/node_modules/commander';

View File

@ -0,0 +1,20 @@
/**
* Copyright (c) Microsoft Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export const yazl: typeof import('../bundles/zip/node_modules/@types/yazl') = require('./zipBundleImpl').yazl;
export type { ZipFile } from '../bundles/zip/node_modules/@types/yazl';
export const yauzl: typeof import('../bundles/zip/node_modules/@types/yauzl') = require('./zipBundleImpl').yauzl;
export const extract: typeof import('../bundles/zip/node_modules/extract-zip') = require('./zipBundleImpl').extract;

View File

@ -26,6 +26,11 @@
"@babel/plugin-syntax-optional-catch-binding": "7.8.3", "@babel/plugin-syntax-optional-catch-binding": "7.8.3",
"@babel/plugin-transform-modules-commonjs": "7.16.8", "@babel/plugin-transform-modules-commonjs": "7.16.8",
"@babel/preset-typescript": "7.16.7" "@babel/preset-typescript": "7.16.7"
},
"devDependencies": {
"@types/babel__code-frame": "^7.0.3",
"@types/babel__core": "^7.1.18",
"@types/babel__helper-plugin-utils": "^7.10.0"
} }
}, },
"node_modules/@babel/code-frame": { "node_modules/@babel/code-frame": {
@ -701,6 +706,62 @@
"node": ">=6.9.0" "node": ">=6.9.0"
} }
}, },
"node_modules/@types/babel__code-frame": {
"version": "7.0.3",
"resolved": "https://registry.npmjs.org/@types/babel__code-frame/-/babel__code-frame-7.0.3.tgz",
"integrity": "sha512-2TN6oiwtNjOezilFVl77zwdNPwQWaDBBCCWWxyo1ctiO3vAtd7H/aB/CBJdw9+kqq3+latD0SXoedIuHySSZWw==",
"dev": true
},
"node_modules/@types/babel__core": {
"version": "7.1.19",
"resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.19.tgz",
"integrity": "sha512-WEOTgRsbYkvA/KCsDwVEGkd7WAr1e3g31VHQ8zy5gul/V1qKullU/BU5I68X5v7V3GnB9eotmom4v5a5gjxorw==",
"dev": true,
"dependencies": {
"@babel/parser": "^7.1.0",
"@babel/types": "^7.0.0",
"@types/babel__generator": "*",
"@types/babel__template": "*",
"@types/babel__traverse": "*"
}
},
"node_modules/@types/babel__generator": {
"version": "7.6.4",
"resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.4.tgz",
"integrity": "sha512-tFkciB9j2K755yrTALxD44McOrk+gfpIpvC3sxHjRawj6PfnQxrse4Clq5y/Rq+G3mrBurMax/lG8Qn2t9mSsg==",
"dev": true,
"dependencies": {
"@babel/types": "^7.0.0"
}
},
"node_modules/@types/babel__helper-plugin-utils": {
"version": "7.10.0",
"resolved": "https://registry.npmjs.org/@types/babel__helper-plugin-utils/-/babel__helper-plugin-utils-7.10.0.tgz",
"integrity": "sha512-60YtHzhQ9HAkToHVV+TB4VLzBn9lrfgrsOjiJMtbv/c1jPdekBxaByd6DMsGBzROXWoIL6U3lEFvvbu69RkUoA==",
"dev": true,
"dependencies": {
"@types/babel__core": "*"
}
},
"node_modules/@types/babel__template": {
"version": "7.4.1",
"resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.1.tgz",
"integrity": "sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g==",
"dev": true,
"dependencies": {
"@babel/parser": "^7.1.0",
"@babel/types": "^7.0.0"
}
},
"node_modules/@types/babel__traverse": {
"version": "7.17.0",
"resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.17.0.tgz",
"integrity": "sha512-r8aveDbd+rzGP+ykSdF3oPuTVRWRfbBiHl0rVDM2yNEmSMXfkObQLV46b4RnCv3Lra51OlfnZhkkFaDl2MIRaA==",
"dev": true,
"dependencies": {
"@babel/types": "^7.3.0"
}
},
"node_modules/ansi-styles": { "node_modules/ansi-styles": {
"version": "3.2.1", "version": "3.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
@ -1510,6 +1571,62 @@
"to-fast-properties": "^2.0.0" "to-fast-properties": "^2.0.0"
} }
}, },
"@types/babel__code-frame": {
"version": "7.0.3",
"resolved": "https://registry.npmjs.org/@types/babel__code-frame/-/babel__code-frame-7.0.3.tgz",
"integrity": "sha512-2TN6oiwtNjOezilFVl77zwdNPwQWaDBBCCWWxyo1ctiO3vAtd7H/aB/CBJdw9+kqq3+latD0SXoedIuHySSZWw==",
"dev": true
},
"@types/babel__core": {
"version": "7.1.19",
"resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.19.tgz",
"integrity": "sha512-WEOTgRsbYkvA/KCsDwVEGkd7WAr1e3g31VHQ8zy5gul/V1qKullU/BU5I68X5v7V3GnB9eotmom4v5a5gjxorw==",
"dev": true,
"requires": {
"@babel/parser": "^7.1.0",
"@babel/types": "^7.0.0",
"@types/babel__generator": "*",
"@types/babel__template": "*",
"@types/babel__traverse": "*"
}
},
"@types/babel__generator": {
"version": "7.6.4",
"resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.4.tgz",
"integrity": "sha512-tFkciB9j2K755yrTALxD44McOrk+gfpIpvC3sxHjRawj6PfnQxrse4Clq5y/Rq+G3mrBurMax/lG8Qn2t9mSsg==",
"dev": true,
"requires": {
"@babel/types": "^7.0.0"
}
},
"@types/babel__helper-plugin-utils": {
"version": "7.10.0",
"resolved": "https://registry.npmjs.org/@types/babel__helper-plugin-utils/-/babel__helper-plugin-utils-7.10.0.tgz",
"integrity": "sha512-60YtHzhQ9HAkToHVV+TB4VLzBn9lrfgrsOjiJMtbv/c1jPdekBxaByd6DMsGBzROXWoIL6U3lEFvvbu69RkUoA==",
"dev": true,
"requires": {
"@types/babel__core": "*"
}
},
"@types/babel__template": {
"version": "7.4.1",
"resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.1.tgz",
"integrity": "sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g==",
"dev": true,
"requires": {
"@babel/parser": "^7.1.0",
"@babel/types": "^7.0.0"
}
},
"@types/babel__traverse": {
"version": "7.17.0",
"resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.17.0.tgz",
"integrity": "sha512-r8aveDbd+rzGP+ykSdF3oPuTVRWRfbBiHl0rVDM2yNEmSMXfkObQLV46b4RnCv3Lra51OlfnZhkkFaDl2MIRaA==",
"dev": true,
"requires": {
"@babel/types": "^7.3.0"
}
},
"ansi-styles": { "ansi-styles": {
"version": "3.2.1", "version": "3.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",

View File

@ -3,7 +3,7 @@
"version": "0.0.1", "version": "0.0.1",
"private": true, "private": true,
"scripts": { "scripts": {
"esbuild": "esbuild ./src/babelBundle.ts --bundle --outdir=../../lib --format=cjs --platform=node --target=ES2019", "esbuild": "esbuild ./src/babelBundleImpl.ts --bundle --outdir=../../lib --format=cjs --platform=node --target=ES2019",
"build": "npm ci && npm run esbuild -- --minify", "build": "npm ci && npm run esbuild -- --minify",
"watch": "npm ci && npm run esbuild -- --watch --sourcemap", "watch": "npm ci && npm run esbuild -- --watch --sourcemap",
"generate-license": "node ../../../../utils/generate_third_party_notice.js" "generate-license": "node ../../../../utils/generate_third_party_notice.js"
@ -27,5 +27,10 @@
"@babel/plugin-syntax-optional-catch-binding": "7.8.3", "@babel/plugin-syntax-optional-catch-binding": "7.8.3",
"@babel/plugin-transform-modules-commonjs": "7.16.8", "@babel/plugin-transform-modules-commonjs": "7.16.8",
"@babel/preset-typescript": "7.16.7" "@babel/preset-typescript": "7.16.7"
},
"devDependencies": {
"@types/babel__code-frame": "^7.0.3",
"@types/babel__core": "^7.1.18",
"@types/babel__helper-plugin-utils": "^7.10.0"
} }
} }

View File

@ -3,7 +3,7 @@
"version": "0.0.1", "version": "0.0.1",
"private": true, "private": true,
"scripts": { "scripts": {
"esbuild": "esbuild ./src/expectBundle.ts --bundle --outdir=../../lib --format=cjs --platform=node --target=ES2019", "esbuild": "esbuild ./src/expectBundleImpl.ts --bundle --outdir=../../lib --format=cjs --platform=node --target=ES2019",
"build": "npm ci && npm run esbuild -- --minify", "build": "npm ci && npm run esbuild -- --minify",
"watch": "npm ci && npm run esbuild -- --watch --sourcemap", "watch": "npm ci && npm run esbuild -- --watch --sourcemap",
"generate-license": "node ../../../../utils/generate_third_party_notice.js" "generate-license": "node ../../../../utils/generate_third_party_notice.js"

View File

@ -14,8 +14,8 @@
* limitations under the License. * limitations under the License.
*/ */
import expect from 'expect'; import expectLibrary from 'expect';
export const expectLibrary = expect; export const expect = expectLibrary;
export { export {
INVERTED_COLOR, INVERTED_COLOR,

View File

@ -29,9 +29,6 @@
}, },
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"colors": "1.4.0",
"commander": "8.3.0",
"debug": "4.3.3",
"json5": "2.2.1", "json5": "2.2.1",
"mime": "3.0.0", "mime": "3.0.0",
"minimatch": "3.0.4", "minimatch": "3.0.4",

View File

@ -0,0 +1,24 @@
/**
* Copyright (c) Microsoft Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import type { BabelFileResult } from '../bundles/babel/node_modules/@types/babel__core';
export const codeFrameColumns: typeof import('../bundles/babel/node_modules/@types/babel__code-frame').codeFrameColumns = require('./babelBundleImpl').codeFrameColumns;
export const declare: typeof import('../bundles/babel/node_modules/@types/babel__helper-plugin-utils').declare = require('./babelBundleImpl').declare;
export const types: typeof import('../bundles/babel/node_modules/@types/babel__core').types = require('./babelBundleImpl').types;
export type BabelTransformFunction = (filename: string, isTypeScript: boolean, isModule: boolean, scriptPreprocessor: string | undefined, additionalPlugin: [string]) => BabelFileResult;
export const babelTransform: BabelTransformFunction = require('./babelBundleImpl').babelTransform;
export type { NodePath, types as T } from '../bundles/babel/node_modules/@types/babel__core';
export type { BabelAPI } from '../bundles/babel/node_modules/@types/babel__helper-plugin-utils';

View File

@ -16,7 +16,7 @@
/* eslint-disable no-console */ /* eslint-disable no-console */
import type { Command } from 'commander'; import type { Command } from 'playwright-core/lib/utilsBundle';
import fs from 'fs'; import fs from 'fs';
import url from 'url'; import url from 'url';
import path from 'path'; import path from 'path';

View File

@ -43,13 +43,12 @@ import type { Expect } from './types';
import { currentTestInfo } from './globals'; import { currentTestInfo } from './globals';
import { serializeError, captureStackTrace, currentExpectTimeout } from './util'; import { serializeError, captureStackTrace, currentExpectTimeout } from './util';
import { monotonicTime } from 'playwright-core/lib/utils'; import { monotonicTime } from 'playwright-core/lib/utils';
import {
const { expectLibrary } = require('./expectBundle'); expect as expectLibrary,
const {
INVERTED_COLOR, INVERTED_COLOR,
RECEIVED_COLOR, RECEIVED_COLOR,
printReceived, printReceived,
} = require('./expectBundle'); } from './expectBundle';
// from expect/build/types // from expect/build/types
export type SyncExpectationResult = { export type SyncExpectationResult = {

View File

@ -0,0 +1,20 @@
/**
* Copyright (c) Microsoft Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export const expect: typeof import('../bundles/expect/node_modules/expect') = require('./expectBundleImpl').expect;
export const INVERTED_COLOR: typeof import('../bundles/expect/node_modules/jest-matcher-utils').INVERTED_COLOR = require('./expectBundleImpl').INVERTED_COLOR;
export const RECEIVED_COLOR: typeof import('../bundles/expect/node_modules/jest-matcher-utils').RECEIVED_COLOR = require('./expectBundleImpl').RECEIVED_COLOR;
export const printReceived: typeof import('../bundles/expect/node_modules/jest-matcher-utils').printReceived = require('./expectBundleImpl').printReceived;

View File

@ -26,7 +26,7 @@ import {
addSuffixToFilePath, serializeError, sanitizeForFilePath, addSuffixToFilePath, serializeError, sanitizeForFilePath,
trimLongString, callLogText, currentExpectTimeout, trimLongString, callLogText, currentExpectTimeout,
expectTypes, captureStackTrace } from '../util'; expectTypes, captureStackTrace } from '../util';
import colors from 'colors/safe'; import { colors } from 'playwright-core/lib/utilsBundle';
import fs from 'fs'; import fs from 'fs';
import path from 'path'; import path from 'path';
import * as mime from 'mime'; import * as mime from 'mime';

View File

@ -1,3 +1,3 @@
[*] [*]
../util.ts ../util.ts
../babelBundle ../babelBundle.ts

View File

@ -14,15 +14,14 @@
* limitations under the License. * limitations under the License.
*/ */
import colors from 'colors/safe'; import { colors } from 'playwright-core/lib/utilsBundle';
import fs from 'fs'; import fs from 'fs';
import milliseconds from 'ms'; import milliseconds from 'ms';
import path from 'path'; import path from 'path';
import { StackUtils } from 'playwright-core/lib/utilsBundle';
import type { FullConfig, TestCase, Suite, TestResult, TestError, Reporter, FullResult, TestStep, Location } from '../../types/testReporter'; import type { FullConfig, TestCase, Suite, TestResult, TestError, Reporter, FullResult, TestStep, Location } from '../../types/testReporter';
import type { FullConfigInternal } from '../types'; import type { FullConfigInternal } from '../types';
import { codeFrameColumns } from '../babelBundle';
const { codeFrameColumns } = require('../babelBundle');
const StackUtils: typeof import('stack-utils') = require('playwright-core/lib/utilsBundle').StackUtils;
const stackUtils = new StackUtils(); const stackUtils = new StackUtils();
export type TestResultOutput = { chunk: string | Buffer, type: 'stdout' | 'stderr' }; export type TestResultOutput = { chunk: string | Buffer, type: 'stdout' | 'stderr' };

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
import colors from 'colors/safe'; import { colors } from 'playwright-core/lib/utilsBundle';
import { BaseReporter } from './base'; import { BaseReporter } from './base';
import type { FullResult, TestCase, TestResult, FullConfig, Suite } from '../../types/testReporter'; import type { FullResult, TestCase, TestResult, FullConfig, Suite } from '../../types/testReporter';

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
import colors from 'colors/safe'; import { colors } from 'playwright-core/lib/utilsBundle';
import fs from 'fs'; import fs from 'fs';
import open from 'open'; import open from 'open';
import path from 'path'; import path from 'path';
@ -29,9 +29,8 @@ import RawReporter from './raw';
import { stripAnsiEscapes } from './base'; import { stripAnsiEscapes } from './base';
import { getPackageJsonPath } from '../util'; import { getPackageJsonPath } from '../util';
import type { FullConfigInternal } from '../types'; import type { FullConfigInternal } from '../types';
import type { ZipFile } from 'playwright-core/lib/zipBundle';
import type { ZipFile } from 'yazl'; import { yazl } from 'playwright-core/lib/zipBundle';
const yazl: typeof import('yazl') = require('playwright-core/lib/zipBundle').yazl;
export type Stats = { export type Stats = {
total: number; total: number;

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
import colors from 'colors/safe'; import { colors } from 'playwright-core/lib/utilsBundle';
import { BaseReporter, formatFailure, formatTestTitle } from './base'; import { BaseReporter, formatFailure, formatTestTitle } from './base';
import type { FullConfig, TestCase, Suite, TestResult, FullResult } from '../../types/testReporter'; import type { FullConfig, TestCase, Suite, TestResult, FullResult } from '../../types/testReporter';

View File

@ -15,7 +15,7 @@
*/ */
/* eslint-disable no-console */ /* eslint-disable no-console */
import colors from 'colors/safe'; import { colors } from 'playwright-core/lib/utilsBundle';
import milliseconds from 'ms'; import milliseconds from 'ms';
import { BaseReporter, formatTestTitle } from './base'; import { BaseReporter, formatTestTitle } from './base';
import type { FullConfig, FullResult, Suite, TestCase, TestResult, TestStep } from '../../types/testReporter'; import type { FullConfig, FullResult, Suite, TestCase, TestResult, TestStep } from '../../types/testReporter';

View File

@ -22,8 +22,7 @@ import { sanitizeForFilePath } from '../util';
import { formatResultFailure } from './base'; import { formatResultFailure } from './base';
import { toPosixPath, serializePatterns } from './json'; import { toPosixPath, serializePatterns } from './json';
import { MultiMap } from 'playwright-core/lib/utils/multimap'; import { MultiMap } from 'playwright-core/lib/utils/multimap';
import { codeFrameColumns } from '../babelBundle';
const { codeFrameColumns } = require('../babelBundle');
export type JsonLocation = Location; export type JsonLocation = Location;
export type JsonError = string; export type JsonError = string;

View File

@ -15,6 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { rimraf } from 'playwright-core/lib/utilsBundle';
import * as fs from 'fs'; import * as fs from 'fs';
import * as path from 'path'; import * as path from 'path';
import { promisify } from 'util'; import { promisify } from 'util';
@ -45,7 +46,6 @@ import { raceAgainstTimeout } from 'playwright-core/lib/utils/timeoutRunner';
import { SigIntWatcher } from './sigIntWatcher'; import { SigIntWatcher } from './sigIntWatcher';
import { GlobalInfoImpl } from './globalInfo'; import { GlobalInfoImpl } from './globalInfo';
const rimraf: typeof import('rimraf') = require('playwright-core/lib/utilsBundle').rimraf;
const removeFolderAsync = promisify(rimraf); const removeFolderAsync = promisify(rimraf);
const readDirAsync = promisify(fs.readdir); const readDirAsync = promisify(fs.readdir);
const readFileAsync = promisify(fs.readFile); const readFileAsync = promisify(fs.readFile);

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
import colors from 'colors/safe'; import { colors } from 'playwright-core/lib/utilsBundle';
import { TimeoutRunner, TimeoutRunnerError } from 'playwright-core/lib/utils/timeoutRunner'; import { TimeoutRunner, TimeoutRunnerError } from 'playwright-core/lib/utils/timeoutRunner';
import type { TestError } from '../types/test'; import type { TestError } from '../types/test';
import type { Location } from './types'; import type { Location } from './types';

View File

@ -25,6 +25,7 @@ import type { Location } from './types';
import type { TsConfigLoaderResult } from './third_party/tsconfig-loader'; import type { TsConfigLoaderResult } from './third_party/tsconfig-loader';
import { tsConfigLoader } from './third_party/tsconfig-loader'; import { tsConfigLoader } from './third_party/tsconfig-loader';
import Module from 'module'; import Module from 'module';
import type { BabelTransformFunction } from './babelBundle';
const version = 8; const version = 8;
const cacheDir = process.env.PWTEST_CACHE_DIR || path.join(os.tmpdir(), 'playwright-transform-cache'); const cacheDir = process.env.PWTEST_CACHE_DIR || path.join(os.tmpdir(), 'playwright-transform-cache');
@ -183,7 +184,7 @@ export function transformHook(code: string, filename: string, isModule = false):
process.env.BROWSERSLIST_IGNORE_OLD_DATA = 'true'; process.env.BROWSERSLIST_IGNORE_OLD_DATA = 'true';
try { try {
const { babelTransform } = require('./babelBundle'); const { babelTransform }: { babelTransform: BabelTransformFunction } = require('./babelBundle');
const result = babelTransform(filename, isTypeScript, isModule, hasPreprocessor ? scriptPreprocessor : undefined, [require.resolve('./tsxTransform')]); const result = babelTransform(filename, isTypeScript, isModule, hasPreprocessor ? scriptPreprocessor : undefined, [require.resolve('./tsxTransform')]);
if (result.code) { if (result.code) {
fs.mkdirSync(path.dirname(cachePath), { recursive: true }); fs.mkdirSync(path.dirname(cachePath), { recursive: true });

View File

@ -14,9 +14,8 @@
* limitations under the License. * limitations under the License.
*/ */
import type { NodePath, types as T } from '@babel/core'; import type { NodePath, T, BabelAPI } from './babelBundle';
import type { BabelAPI } from '@babel/helper-plugin-utils'; import { types, declare } from './babelBundle';
const { types, declare } = require('./babelBundle');
const t: typeof T = types; const t: typeof T = types;
export default declare((api: BabelAPI) => { export default declare((api: BabelAPI) => {

View File

@ -19,10 +19,9 @@ import * as mime from 'mime';
import util from 'util'; import util from 'util';
import path from 'path'; import path from 'path';
import url from 'url'; import url from 'url';
import colors from 'colors/safe'; import { colors, debug } from 'playwright-core/lib/utilsBundle';
import type { TestError, Location } from './types'; import type { TestError, Location } from './types';
import { default as minimatch } from 'minimatch'; import { default as minimatch } from 'minimatch';
import debug from 'debug';
import { calculateSha1, isRegExp } from 'playwright-core/lib/utils'; import { calculateSha1, isRegExp } from 'playwright-core/lib/utils';
import { isInternalFileName } from 'playwright-core/lib/utils/stackTrace'; import { isInternalFileName } from 'playwright-core/lib/utils/stackTrace';
import { currentTestInfo } from './globals'; import { currentTestInfo } from './globals';
@ -32,7 +31,8 @@ import { captureStackTrace as coreCaptureStackTrace } from 'playwright-core/lib/
export type { ParsedStackTrace }; export type { ParsedStackTrace };
const PLAYWRIGHT_CORE_PATH = path.dirname(require.resolve('playwright-core')); const PLAYWRIGHT_CORE_PATH = path.dirname(require.resolve('playwright-core'));
const EXPECT_PATH = path.dirname(require.resolve('./expectBundle')); const EXPECT_PATH = require.resolve('./expectBundle');
const EXPECT_PATH_IMPL = require.resolve('./expectBundleImpl');
const PLAYWRIGHT_TEST_PATH = path.join(__dirname, '..'); const PLAYWRIGHT_TEST_PATH = path.join(__dirname, '..');
function filterStackTrace(e: Error) { function filterStackTrace(e: Error) {
@ -71,7 +71,7 @@ export function captureStackTrace(customApiName?: string): ParsedStackTrace {
const frameTexts = []; const frameTexts = [];
for (let i = 0; i < stackTrace.frames.length; ++i) { for (let i = 0; i < stackTrace.frames.length; ++i) {
const frame = stackTrace.frames[i]; const frame = stackTrace.frames[i];
if (frame.file.startsWith(EXPECT_PATH)) if (frame.file === EXPECT_PATH || frame.file === EXPECT_PATH_IMPL)
continue; continue;
frames.push(frame); frames.push(frame);
frameTexts.push(stackTrace.frameTexts[i]); frameTexts.push(stackTrace.frameTexts[i]);

View File

@ -17,7 +17,7 @@
import http from 'http'; import http from 'http';
import https from 'https'; import https from 'https';
import net from 'net'; import net from 'net';
import debug from 'debug'; import { debug } from 'playwright-core/lib/utilsBundle';
import { raceAgainstTimeout } from 'playwright-core/lib/utils/timeoutRunner'; import { raceAgainstTimeout } from 'playwright-core/lib/utils/timeoutRunner';
import type { WebServerConfig } from './types'; import type { WebServerConfig } from './types';
import { launchProcess } from 'playwright-core/lib/utils/processLauncher'; import { launchProcess } from 'playwright-core/lib/utils/processLauncher';

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
import colors from 'colors/safe'; import { colors, rimraf } from 'playwright-core/lib/utilsBundle';
import util from 'util'; import util from 'util';
import { EventEmitter } from 'events'; import { EventEmitter } from 'events';
import { relativeFilePath, serializeError } from './util'; import { relativeFilePath, serializeError } from './util';
@ -30,7 +30,6 @@ import { TestInfoImpl } from './testInfo';
import type { TimeSlot } from './timeoutManager'; import type { TimeSlot } from './timeoutManager';
import { TimeoutManager } from './timeoutManager'; import { TimeoutManager } from './timeoutManager';
const rimraf: typeof import('rimraf') = require('playwright-core/lib/utilsBundle').rimraf;
const removeFolderAsync = util.promisify(rimraf); const removeFolderAsync = util.promisify(rimraf);
export class WorkerRunner extends EventEmitter { export class WorkerRunner extends EventEmitter {

View File

@ -18,6 +18,7 @@ import type { JSONReport, JSONReportSuite } from '@playwright/test/reporter';
import * as fs from 'fs'; import * as fs from 'fs';
import * as os from 'os'; import * as os from 'os';
import * as path from 'path'; import * as path from 'path';
import { rimraf } from 'playwright-core/lib/utilsBundle';
import { PNG } from 'pngjs'; import { PNG } from 'pngjs';
import { promisify } from 'util'; import { promisify } from 'util';
import type { CommonFixtures } from '../config/commonFixtures'; import type { CommonFixtures } from '../config/commonFixtures';
@ -27,7 +28,6 @@ import { serverFixtures } from '../config/serverFixtures';
import type { TestInfo } from './stable-test-runner'; import type { TestInfo } from './stable-test-runner';
import { test as base } from './stable-test-runner'; import { test as base } from './stable-test-runner';
const rimraf: typeof import('rimraf') = require('playwright-core/lib/utilsBundle').rimraf;
const removeFolderAsync = promisify(rimraf); const removeFolderAsync = promisify(rimraf);
type RunResult = { type RunResult = {