@smoothdeploy/playwright 1.58.3 → 1.60.0-beta-1780662356000

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (182) hide show
  1. package/ThirdPartyNotices.txt +8 -5036
  2. package/lib/agents/agentParser.js +2 -2
  3. package/lib/agents/generateAgents.js +21 -22
  4. package/lib/agents/playwright-test-healer.agent.md +1 -0
  5. package/lib/agents/playwright-test-planner.agent.md +2 -1
  6. package/lib/cli/reportActions.js +78 -0
  7. package/lib/cli/testActions.js +211 -0
  8. package/lib/common/index.js +2898 -0
  9. package/lib/common/index.js.txt +35 -0
  10. package/lib/errorContext.js +130 -0
  11. package/lib/index.js +283 -206
  12. package/lib/{isomorphic/testServerConnection.js → isomorphic.js} +70 -35
  13. package/lib/isomorphic.js.txt +9 -0
  14. package/lib/loader/loaderProcessEntry.js +34 -0
  15. package/lib/loader/loaderProcessEntry.js.txt +9 -0
  16. package/lib/matchers/expect.js +12988 -249
  17. package/lib/matchers/expect.js.LICENSE +693 -0
  18. package/lib/matchers/expect.js.txt +72 -0
  19. package/lib/mcp/test/browserBackend.js +49 -22
  20. package/lib/mcp/test/generatorTools.js +16 -16
  21. package/lib/mcp/test/plannerTools.js +25 -20
  22. package/lib/mcp/test/seed.js +7 -7
  23. package/lib/mcp/test/testBackend.js +30 -30
  24. package/lib/mcp/test/testContext.js +50 -33
  25. package/lib/mcp/test/testTools.js +15 -25
  26. package/lib/{internalsForTest.js → package.js} +13 -8
  27. package/lib/program.js +63 -263
  28. package/lib/runner/index.js +8339 -0
  29. package/lib/runner/index.js.txt +60 -0
  30. package/lib/transform/babelBundle.js +71002 -18
  31. package/lib/transform/babelBundle.js.LICENSE +2359 -0
  32. package/lib/transform/babelBundle.js.txt +325 -0
  33. package/lib/transform/esmLoader.js +5884 -30
  34. package/lib/transform/esmLoader.js.LICENSE +335 -0
  35. package/lib/transform/esmLoader.js.txt +55 -0
  36. package/lib/util.js +37 -34
  37. package/lib/worker/workerProcessEntry.js +3251 -0
  38. package/lib/worker/workerProcessEntry.js.txt +24 -0
  39. package/package.json +5 -16
  40. package/test.mjs +1 -0
  41. package/types/test.d.ts +173 -12
  42. package/types/testReporter.d.ts +7 -5
  43. package/lib/common/config.js +0 -282
  44. package/lib/common/configLoader.js +0 -344
  45. package/lib/common/esmLoaderHost.js +0 -104
  46. package/lib/common/expectBundle.js +0 -28
  47. package/lib/common/expectBundleImpl.js +0 -407
  48. package/lib/common/fixtures.js +0 -302
  49. package/lib/common/ipc.js +0 -60
  50. package/lib/common/poolBuilder.js +0 -85
  51. package/lib/common/process.js +0 -132
  52. package/lib/common/suiteUtils.js +0 -140
  53. package/lib/common/test.js +0 -321
  54. package/lib/common/testLoader.js +0 -101
  55. package/lib/common/testType.js +0 -298
  56. package/lib/common/validators.js +0 -68
  57. package/lib/fsWatcher.js +0 -67
  58. package/lib/isomorphic/events.js +0 -77
  59. package/lib/isomorphic/folders.js +0 -30
  60. package/lib/isomorphic/stringInternPool.js +0 -69
  61. package/lib/isomorphic/teleReceiver.js +0 -521
  62. package/lib/isomorphic/teleSuiteUpdater.js +0 -157
  63. package/lib/isomorphic/testServerInterface.js +0 -16
  64. package/lib/isomorphic/testTree.js +0 -329
  65. package/lib/isomorphic/types.d.js +0 -16
  66. package/lib/loader/loaderMain.js +0 -59
  67. package/lib/matchers/matcherHint.js +0 -44
  68. package/lib/matchers/matchers.js +0 -383
  69. package/lib/matchers/toBeTruthy.js +0 -75
  70. package/lib/matchers/toEqual.js +0 -100
  71. package/lib/matchers/toHaveURL.js +0 -101
  72. package/lib/matchers/toMatchAriaSnapshot.js +0 -159
  73. package/lib/matchers/toMatchSnapshot.js +0 -342
  74. package/lib/matchers/toMatchText.js +0 -99
  75. package/lib/mcp/browser/browserContextFactory.js +0 -329
  76. package/lib/mcp/browser/browserServerBackend.js +0 -84
  77. package/lib/mcp/browser/config.js +0 -421
  78. package/lib/mcp/browser/context.js +0 -244
  79. package/lib/mcp/browser/response.js +0 -278
  80. package/lib/mcp/browser/sessionLog.js +0 -75
  81. package/lib/mcp/browser/tab.js +0 -343
  82. package/lib/mcp/browser/tools/common.js +0 -65
  83. package/lib/mcp/browser/tools/console.js +0 -46
  84. package/lib/mcp/browser/tools/dialogs.js +0 -60
  85. package/lib/mcp/browser/tools/evaluate.js +0 -61
  86. package/lib/mcp/browser/tools/files.js +0 -58
  87. package/lib/mcp/browser/tools/form.js +0 -63
  88. package/lib/mcp/browser/tools/install.js +0 -72
  89. package/lib/mcp/browser/tools/keyboard.js +0 -107
  90. package/lib/mcp/browser/tools/mouse.js +0 -107
  91. package/lib/mcp/browser/tools/navigate.js +0 -71
  92. package/lib/mcp/browser/tools/network.js +0 -63
  93. package/lib/mcp/browser/tools/open.js +0 -57
  94. package/lib/mcp/browser/tools/pdf.js +0 -49
  95. package/lib/mcp/browser/tools/runCode.js +0 -78
  96. package/lib/mcp/browser/tools/screenshot.js +0 -93
  97. package/lib/mcp/browser/tools/snapshot.js +0 -173
  98. package/lib/mcp/browser/tools/tabs.js +0 -67
  99. package/lib/mcp/browser/tools/tool.js +0 -47
  100. package/lib/mcp/browser/tools/tracing.js +0 -74
  101. package/lib/mcp/browser/tools/utils.js +0 -94
  102. package/lib/mcp/browser/tools/verify.js +0 -143
  103. package/lib/mcp/browser/tools/wait.js +0 -63
  104. package/lib/mcp/browser/tools.js +0 -84
  105. package/lib/mcp/browser/watchdog.js +0 -44
  106. package/lib/mcp/config.d.js +0 -16
  107. package/lib/mcp/extension/cdpRelay.js +0 -351
  108. package/lib/mcp/extension/extensionContextFactory.js +0 -76
  109. package/lib/mcp/extension/protocol.js +0 -28
  110. package/lib/mcp/index.js +0 -61
  111. package/lib/mcp/log.js +0 -35
  112. package/lib/mcp/program.js +0 -111
  113. package/lib/mcp/sdk/exports.js +0 -28
  114. package/lib/mcp/sdk/http.js +0 -152
  115. package/lib/mcp/sdk/inProcessTransport.js +0 -71
  116. package/lib/mcp/sdk/server.js +0 -223
  117. package/lib/mcp/sdk/tool.js +0 -47
  118. package/lib/mcp/terminal/cli.js +0 -296
  119. package/lib/mcp/terminal/command.js +0 -56
  120. package/lib/mcp/terminal/commands.js +0 -333
  121. package/lib/mcp/terminal/daemon.js +0 -129
  122. package/lib/mcp/terminal/help.json +0 -32
  123. package/lib/mcp/terminal/helpGenerator.js +0 -88
  124. package/lib/mcp/terminal/socketConnection.js +0 -80
  125. package/lib/plugins/gitCommitInfoPlugin.js +0 -198
  126. package/lib/plugins/index.js +0 -28
  127. package/lib/plugins/webServerPlugin.js +0 -237
  128. package/lib/reporters/base.js +0 -634
  129. package/lib/reporters/blob.js +0 -138
  130. package/lib/reporters/dot.js +0 -99
  131. package/lib/reporters/empty.js +0 -32
  132. package/lib/reporters/github.js +0 -128
  133. package/lib/reporters/html.js +0 -633
  134. package/lib/reporters/internalReporter.js +0 -138
  135. package/lib/reporters/json.js +0 -254
  136. package/lib/reporters/junit.js +0 -232
  137. package/lib/reporters/line.js +0 -131
  138. package/lib/reporters/list.js +0 -253
  139. package/lib/reporters/listModeReporter.js +0 -69
  140. package/lib/reporters/markdown.js +0 -144
  141. package/lib/reporters/merge.js +0 -558
  142. package/lib/reporters/multiplexer.js +0 -112
  143. package/lib/reporters/reporterV2.js +0 -102
  144. package/lib/reporters/smoothdeploy.js +0 -333
  145. package/lib/reporters/teleEmitter.js +0 -317
  146. package/lib/reporters/versions/blobV1.js +0 -16
  147. package/lib/runner/dispatcher.js +0 -531
  148. package/lib/runner/failureTracker.js +0 -72
  149. package/lib/runner/lastRun.js +0 -77
  150. package/lib/runner/loadUtils.js +0 -334
  151. package/lib/runner/loaderHost.js +0 -89
  152. package/lib/runner/processHost.js +0 -180
  153. package/lib/runner/projectUtils.js +0 -241
  154. package/lib/runner/rebase.js +0 -189
  155. package/lib/runner/reporters.js +0 -140
  156. package/lib/runner/sigIntWatcher.js +0 -96
  157. package/lib/runner/storage.js +0 -91
  158. package/lib/runner/taskRunner.js +0 -127
  159. package/lib/runner/tasks.js +0 -410
  160. package/lib/runner/testGroups.js +0 -125
  161. package/lib/runner/testRunner.js +0 -398
  162. package/lib/runner/testServer.js +0 -269
  163. package/lib/runner/uiModeReporter.js +0 -30
  164. package/lib/runner/vcs.js +0 -72
  165. package/lib/runner/watchMode.js +0 -396
  166. package/lib/runner/workerHost.js +0 -104
  167. package/lib/third_party/pirates.js +0 -62
  168. package/lib/third_party/tsconfig-loader.js +0 -103
  169. package/lib/transform/babelBundleImpl.js +0 -461
  170. package/lib/transform/compilationCache.js +0 -274
  171. package/lib/transform/md.js +0 -221
  172. package/lib/transform/portTransport.js +0 -67
  173. package/lib/transform/transform.js +0 -303
  174. package/lib/utilsBundle.js +0 -50
  175. package/lib/utilsBundleImpl.js +0 -103
  176. package/lib/worker/fixtureRunner.js +0 -262
  177. package/lib/worker/testInfo.js +0 -536
  178. package/lib/worker/testTracing.js +0 -345
  179. package/lib/worker/timeoutManager.js +0 -174
  180. package/lib/worker/util.js +0 -31
  181. package/lib/worker/workerMain.js +0 -530
  182. /package/lib/{common/globals.js → globals.js} +0 -0
@@ -0,0 +1,335 @@
1
+ packages/playwright/lib/transform/esmLoader.js
2
+
3
+ THIRD-PARTY SOFTWARE NOTICES AND INFORMATION
4
+
5
+ The following npm packages are inlined into this bundle.
6
+
7
+ - balanced-match@1.0.2 (https://github.com/juliangruber/balanced-match)
8
+ - brace-expansion@1.1.12 (https://github.com/juliangruber/brace-expansion)
9
+ - buffer-from@1.1.2 (https://github.com/LinusU/buffer-from)
10
+ - concat-map@0.0.1 (https://github.com/substack/node-concat-map)
11
+ - debug@4.4.3 (https://github.com/debug-js/debug)
12
+ - has-flag@4.0.0 (https://github.com/sindresorhus/has-flag)
13
+ - json5@2.2.3 (https://github.com/json5/json5)
14
+ - mime@3.0.0 (https://github.com/broofa/mime)
15
+ - minimatch@3.1.5 (https://github.com/isaacs/minimatch)
16
+ - ms@2.1.3 (https://github.com/vercel/ms)
17
+ - source-map-support@0.5.21 (https://github.com/evanw/node-source-map-support)
18
+ - source-map@0.6.1 (https://github.com/mozilla/source-map)
19
+ - supports-color@8.1.1 (https://github.com/chalk/supports-color)
20
+
21
+ %% balanced-match@1.0.2 NOTICES AND INFORMATION BEGIN HERE
22
+ =========================================
23
+ (MIT)
24
+
25
+ Copyright (c) 2013 Julian Gruber <julian@juliangruber.com>
26
+
27
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
28
+ this software and associated documentation files (the "Software"), to deal in
29
+ the Software without restriction, including without limitation the rights to
30
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
31
+ of the Software, and to permit persons to whom the Software is furnished to do
32
+ so, subject to the following conditions:
33
+
34
+ The above copyright notice and this permission notice shall be included in all
35
+ copies or substantial portions of the Software.
36
+
37
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
38
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
39
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
40
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
41
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
42
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
43
+ SOFTWARE.
44
+ =========================================
45
+ END OF balanced-match@1.0.2 NOTICES AND INFORMATION
46
+
47
+ %% brace-expansion@1.1.12 NOTICES AND INFORMATION BEGIN HERE
48
+ =========================================
49
+ MIT License
50
+
51
+ Copyright (c) 2013 Julian Gruber <julian@juliangruber.com>
52
+
53
+ Permission is hereby granted, free of charge, to any person obtaining a copy
54
+ of this software and associated documentation files (the "Software"), to deal
55
+ in the Software without restriction, including without limitation the rights
56
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
57
+ copies of the Software, and to permit persons to whom the Software is
58
+ furnished to do so, subject to the following conditions:
59
+
60
+ The above copyright notice and this permission notice shall be included in all
61
+ copies or substantial portions of the Software.
62
+
63
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
64
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
65
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
66
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
67
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
68
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
69
+ SOFTWARE.
70
+ =========================================
71
+ END OF brace-expansion@1.1.12 NOTICES AND INFORMATION
72
+
73
+ %% buffer-from@1.1.2 NOTICES AND INFORMATION BEGIN HERE
74
+ =========================================
75
+ MIT License
76
+
77
+ Copyright (c) 2016, 2018 Linus Unnebäck
78
+
79
+ Permission is hereby granted, free of charge, to any person obtaining a copy
80
+ of this software and associated documentation files (the "Software"), to deal
81
+ in the Software without restriction, including without limitation the rights
82
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
83
+ copies of the Software, and to permit persons to whom the Software is
84
+ furnished to do so, subject to the following conditions:
85
+
86
+ The above copyright notice and this permission notice shall be included in all
87
+ copies or substantial portions of the Software.
88
+
89
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
90
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
91
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
92
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
93
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
94
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
95
+ SOFTWARE.
96
+ =========================================
97
+ END OF buffer-from@1.1.2 NOTICES AND INFORMATION
98
+
99
+ %% concat-map@0.0.1 NOTICES AND INFORMATION BEGIN HERE
100
+ =========================================
101
+ This software is released under the MIT license:
102
+
103
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
104
+ this software and associated documentation files (the "Software"), to deal in
105
+ the Software without restriction, including without limitation the rights to
106
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
107
+ the Software, and to permit persons to whom the Software is furnished to do so,
108
+ subject to the following conditions:
109
+
110
+ The above copyright notice and this permission notice shall be included in all
111
+ copies or substantial portions of the Software.
112
+
113
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
114
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
115
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
116
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
117
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
118
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
119
+ =========================================
120
+ END OF concat-map@0.0.1 NOTICES AND INFORMATION
121
+
122
+ %% debug@4.4.3 NOTICES AND INFORMATION BEGIN HERE
123
+ =========================================
124
+ (The MIT License)
125
+
126
+ Copyright (c) 2014-2017 TJ Holowaychuk <tj@vision-media.ca>
127
+ Copyright (c) 2018-2021 Josh Junon
128
+
129
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software
130
+ and associated documentation files (the 'Software'), to deal in the Software without restriction,
131
+ including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
132
+ and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
133
+ subject to the following conditions:
134
+
135
+ The above copyright notice and this permission notice shall be included in all copies or substantial
136
+ portions of the Software.
137
+
138
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
139
+ LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
140
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
141
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
142
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
143
+ =========================================
144
+ END OF debug@4.4.3 NOTICES AND INFORMATION
145
+
146
+ %% has-flag@4.0.0 NOTICES AND INFORMATION BEGIN HERE
147
+ =========================================
148
+ MIT License
149
+
150
+ Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
151
+
152
+ 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:
153
+
154
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
155
+
156
+ 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.
157
+ =========================================
158
+ END OF has-flag@4.0.0 NOTICES AND INFORMATION
159
+
160
+ %% json5@2.2.3 NOTICES AND INFORMATION BEGIN HERE
161
+ =========================================
162
+ MIT License
163
+
164
+ Copyright (c) 2012-2018 Aseem Kishore, and [others].
165
+
166
+ Permission is hereby granted, free of charge, to any person obtaining a copy
167
+ of this software and associated documentation files (the "Software"), to deal
168
+ in the Software without restriction, including without limitation the rights
169
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
170
+ copies of the Software, and to permit persons to whom the Software is
171
+ furnished to do so, subject to the following conditions:
172
+
173
+ The above copyright notice and this permission notice shall be included in all
174
+ copies or substantial portions of the Software.
175
+
176
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
177
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
178
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
179
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
180
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
181
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
182
+ SOFTWARE.
183
+
184
+ [others]: https://github.com/json5/json5/contributors
185
+ =========================================
186
+ END OF json5@2.2.3 NOTICES AND INFORMATION
187
+
188
+ %% mime@3.0.0 NOTICES AND INFORMATION BEGIN HERE
189
+ =========================================
190
+ The MIT License (MIT)
191
+
192
+ Copyright (c) 2010 Benjamin Thomas, Robert Kieffer
193
+
194
+ Permission is hereby granted, free of charge, to any person obtaining a copy
195
+ of this software and associated documentation files (the "Software"), to deal
196
+ in the Software without restriction, including without limitation the rights
197
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
198
+ copies of the Software, and to permit persons to whom the Software is
199
+ furnished to do so, subject to the following conditions:
200
+
201
+ The above copyright notice and this permission notice shall be included in
202
+ all copies or substantial portions of the Software.
203
+
204
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
205
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
206
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
207
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
208
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
209
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
210
+ THE SOFTWARE.
211
+ =========================================
212
+ END OF mime@3.0.0 NOTICES AND INFORMATION
213
+
214
+ %% minimatch@3.1.5 NOTICES AND INFORMATION BEGIN HERE
215
+ =========================================
216
+ The ISC License
217
+
218
+ Copyright (c) Isaac Z. Schlueter and Contributors
219
+
220
+ Permission to use, copy, modify, and/or distribute this software for any
221
+ purpose with or without fee is hereby granted, provided that the above
222
+ copyright notice and this permission notice appear in all copies.
223
+
224
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
225
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
226
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
227
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
228
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
229
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
230
+ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
231
+ =========================================
232
+ END OF minimatch@3.1.5 NOTICES AND INFORMATION
233
+
234
+ %% ms@2.1.3 NOTICES AND INFORMATION BEGIN HERE
235
+ =========================================
236
+ The MIT License (MIT)
237
+
238
+ Copyright (c) 2020 Vercel, Inc.
239
+
240
+ Permission is hereby granted, free of charge, to any person obtaining a copy
241
+ of this software and associated documentation files (the "Software"), to deal
242
+ in the Software without restriction, including without limitation the rights
243
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
244
+ copies of the Software, and to permit persons to whom the Software is
245
+ furnished to do so, subject to the following conditions:
246
+
247
+ The above copyright notice and this permission notice shall be included in all
248
+ copies or substantial portions of the Software.
249
+
250
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
251
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
252
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
253
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
254
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
255
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
256
+ SOFTWARE.
257
+ =========================================
258
+ END OF ms@2.1.3 NOTICES AND INFORMATION
259
+
260
+ %% source-map-support@0.5.21 NOTICES AND INFORMATION BEGIN HERE
261
+ =========================================
262
+ The MIT License (MIT)
263
+
264
+ Copyright (c) 2014 Evan Wallace
265
+
266
+ Permission is hereby granted, free of charge, to any person obtaining a copy
267
+ of this software and associated documentation files (the "Software"), to deal
268
+ in the Software without restriction, including without limitation the rights
269
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
270
+ copies of the Software, and to permit persons to whom the Software is
271
+ furnished to do so, subject to the following conditions:
272
+
273
+ The above copyright notice and this permission notice shall be included in all
274
+ copies or substantial portions of the Software.
275
+
276
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
277
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
278
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
279
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
280
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
281
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
282
+ SOFTWARE.
283
+ =========================================
284
+ END OF source-map-support@0.5.21 NOTICES AND INFORMATION
285
+
286
+ %% source-map@0.6.1 NOTICES AND INFORMATION BEGIN HERE
287
+ =========================================
288
+ Copyright (c) 2009-2011, Mozilla Foundation and contributors
289
+ All rights reserved.
290
+
291
+ Redistribution and use in source and binary forms, with or without
292
+ modification, are permitted provided that the following conditions are met:
293
+
294
+ * Redistributions of source code must retain the above copyright notice, this
295
+ list of conditions and the following disclaimer.
296
+
297
+ * Redistributions in binary form must reproduce the above copyright notice,
298
+ this list of conditions and the following disclaimer in the documentation
299
+ and/or other materials provided with the distribution.
300
+
301
+ * Neither the names of the Mozilla Foundation nor the names of project
302
+ contributors may be used to endorse or promote products derived from this
303
+ software without specific prior written permission.
304
+
305
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
306
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
307
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
308
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
309
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
310
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
311
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
312
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
313
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
314
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
315
+ =========================================
316
+ END OF source-map@0.6.1 NOTICES AND INFORMATION
317
+
318
+ %% supports-color@8.1.1 NOTICES AND INFORMATION BEGIN HERE
319
+ =========================================
320
+ MIT License
321
+
322
+ Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
323
+
324
+ 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:
325
+
326
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
327
+
328
+ 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.
329
+ =========================================
330
+ END OF supports-color@8.1.1 NOTICES AND INFORMATION
331
+
332
+ SUMMARY
333
+ =========================================
334
+ Total Packages: 13
335
+ =========================================
@@ -0,0 +1,55 @@
1
+ # packages/playwright/lib/transform/esmLoader.js
2
+ # total: 245.0 KB
3
+
4
+ ## Inlined (46)
5
+ 1.5 KB node_modules/balanced-match/index.js
6
+ 4.4 KB node_modules/brace-expansion/index.js
7
+ 1.8 KB node_modules/buffer-from/index.js
8
+ 0.5 KB node_modules/concat-map/index.js
9
+ 4.6 KB node_modules/debug/src/browser.js
10
+ 5.8 KB node_modules/debug/src/common.js
11
+ 0.3 KB node_modules/debug/src/index.js
12
+ 4.2 KB node_modules/debug/src/node.js
13
+ 0.4 KB node_modules/has-flag/index.js
14
+ 0.2 KB node_modules/json5/lib/index.js
15
+ 20.2 KB node_modules/json5/lib/parse.js
16
+ 6.8 KB node_modules/json5/lib/stringify.js
17
+ 15.5 KB node_modules/json5/lib/unicode.js
18
+ 0.9 KB node_modules/json5/lib/util.js
19
+ 0.2 KB node_modules/mime/index.js
20
+ 2.0 KB node_modules/mime/Mime.js
21
+ 26.8 KB node_modules/mime/types/other.js
22
+ 10.1 KB node_modules/mime/types/standard.js
23
+ 20.9 KB node_modules/minimatch/minimatch.js
24
+ 2.8 KB node_modules/ms/index.js
25
+ 16.1 KB node_modules/source-map-support/source-map-support.js
26
+ 2.2 KB node_modules/source-map/lib/array-set.js
27
+ 1.7 KB node_modules/source-map/lib/base64-vlq.js
28
+ 1.1 KB node_modules/source-map/lib/base64.js
29
+ 1.5 KB node_modules/source-map/lib/binary-search.js
30
+ 1.3 KB node_modules/source-map/lib/mapping-list.js
31
+ 0.9 KB node_modules/source-map/lib/quick-sort.js
32
+ 24.0 KB node_modules/source-map/lib/source-map-consumer.js
33
+ 10.6 KB node_modules/source-map/lib/source-map-generator.js
34
+ 9.6 KB node_modules/source-map/lib/source-node.js
35
+ 8.6 KB node_modules/source-map/lib/util.js
36
+ 0.3 KB node_modules/source-map/source-map.js
37
+ 3.4 KB node_modules/supports-color/index.js
38
+ 0.1 KB packages/isomorphic/rtti.ts
39
+ 0.2 KB packages/isomorphic/stackTrace.ts
40
+ 0.2 KB packages/isomorphic/stringUtils.ts
41
+ 6.3 KB packages/playwright/src/transform/compilationCache.ts
42
+ 3.1 KB packages/playwright/src/transform/esmLoader.ts
43
+ 1.1 KB packages/playwright/src/transform/pirates.ts
44
+ 1.1 KB packages/playwright/src/transform/portTransport.ts
45
+ 9.7 KB packages/playwright/src/transform/transform.ts
46
+ 2.9 KB packages/playwright/src/transform/tsconfig-loader.ts
47
+ 4.6 KB packages/playwright/src/util.ts
48
+ 0.2 KB packages/utils/crypto.ts
49
+ 0.2 KB packages/utils/debug.ts
50
+ 0.5 KB packages/utils/env.ts
51
+
52
+ ## External (3)
53
+ ../globals
54
+ ../package
55
+ playwright-core/package.json
package/lib/util.js CHANGED
@@ -29,10 +29,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
29
29
  var util_exports = {};
30
30
  __export(util_exports, {
31
31
  addSuffixToFilePath: () => addSuffixToFilePath,
32
- ansiRegex: () => import_utils2.ansiRegex,
33
- createFileFiltersFromArguments: () => createFileFiltersFromArguments,
32
+ ansiRegex: () => ansiRegex,
34
33
  createFileMatcher: () => createFileMatcher,
35
- createFileMatcherFromArguments: () => createFileMatcherFromArguments,
36
34
  createTitleMatcher: () => createTitleMatcher,
37
35
  debugTest: () => debugTest,
38
36
  errorWithFile: () => errorWithFile,
@@ -55,7 +53,8 @@ __export(util_exports, {
55
53
  resolveReporterOutputPath: () => resolveReporterOutputPath,
56
54
  sanitizeFilePathBeforeExtension: () => sanitizeFilePathBeforeExtension,
57
55
  serializeError: () => serializeError,
58
- stripAnsiEscapes: () => import_utils2.stripAnsiEscapes,
56
+ stripAnsiEscapes: () => stripAnsiEscapes,
57
+ takeFirst: () => takeFirst,
59
58
  trimLongString: () => trimLongString,
60
59
  windowsFilesystemFriendlyLength: () => windowsFilesystemFriendlyLength
61
60
  });
@@ -64,9 +63,14 @@ var import_fs = __toESM(require("fs"));
64
63
  var import_path = __toESM(require("path"));
65
64
  var import_url = __toESM(require("url"));
66
65
  var import_util = __toESM(require("util"));
67
- var import_utils = require("playwright-core/lib/utils");
68
- var import_utilsBundle = require("playwright-core/lib/utilsBundle");
69
- var import_utils2 = require("playwright-core/lib/utils");
66
+ const debug = require("playwright-core/lib/utilsBundle").debug;
67
+ const mime = require("playwright-core/lib/utilsBundle").mime;
68
+ const minimatch = require("playwright-core/lib/utilsBundle").minimatch;
69
+ const { calculateSha1 } = require("playwright-core/lib/coreBundle").utils;
70
+ const { sanitizeForFilePath } = require("playwright-core/lib/coreBundle").utils;
71
+ const { isRegExp } = require("playwright-core/lib/coreBundle").iso;
72
+ const { parseStackFrame, stringifyStackFrames } = require("playwright-core/lib/coreBundle").iso;
73
+ const { ansiRegex, isString, stripAnsiEscapes } = require("playwright-core/lib/coreBundle").iso;
70
74
  const PLAYWRIGHT_TEST_PATH = import_path.default.join(__dirname, "..");
71
75
  const PLAYWRIGHT_CORE_PATH = import_path.default.dirname(require.resolve("playwright-core/package.json"));
72
76
  function filterStackTrace(e) {
@@ -74,7 +78,7 @@ function filterStackTrace(e) {
74
78
  const cause = e.cause instanceof Error ? filterStackTrace(e.cause) : void 0;
75
79
  if (process.env.PWDEBUGIMPL)
76
80
  return { message: name + e.message, stack: e.stack || "", cause };
77
- const stackLines = (0, import_utils.stringifyStackFrames)(filteredStackTrace(e.stack?.split("\n") || []));
81
+ const stackLines = stringifyStackFrames(filteredStackTrace(e.stack?.split("\n") || []));
78
82
  return {
79
83
  message: name + e.message,
80
84
  stack: `${name}${e.message}${stackLines.map((line) => "\n" + line).join("")}`,
@@ -82,16 +86,18 @@ function filterStackTrace(e) {
82
86
  };
83
87
  }
84
88
  function filterStackFile(file) {
85
- if (!process.env.PWDEBUGIMPL && file.startsWith(PLAYWRIGHT_TEST_PATH))
89
+ if (process.env.PWDEBUGIMPL)
90
+ return true;
91
+ if (file.startsWith(PLAYWRIGHT_TEST_PATH))
86
92
  return false;
87
- if (!process.env.PWDEBUGIMPL && file.startsWith(PLAYWRIGHT_CORE_PATH))
93
+ if (file.startsWith(PLAYWRIGHT_CORE_PATH))
88
94
  return false;
89
95
  return true;
90
96
  }
91
97
  function filteredStackTrace(rawStack) {
92
98
  const frames = [];
93
99
  for (const line of rawStack) {
94
- const frame = (0, import_utils.parseStackFrame)(line, import_path.default.sep, !!process.env.PWDEBUGIMPL);
100
+ const frame = parseStackFrame(line, import_path.default.sep, !!process.env.PWDEBUGIMPL);
95
101
  if (!frame || !frame.file)
96
102
  continue;
97
103
  if (!filterStackFile(frame.file))
@@ -115,21 +121,11 @@ function parseLocationArg(arg) {
115
121
  column: match?.[3] ? parseInt(match[3], 10) : null
116
122
  };
117
123
  }
118
- function createFileFiltersFromArguments(args) {
119
- return args.map((arg) => {
120
- const parsed = parseLocationArg(arg);
121
- return { re: forceRegExp(parsed.file), line: parsed.line, column: parsed.column };
122
- });
123
- }
124
- function createFileMatcherFromArguments(args) {
125
- const filters = createFileFiltersFromArguments(args);
126
- return createFileMatcher(filters.map((filter) => filter.re || filter.exact || ""));
127
- }
128
124
  function createFileMatcher(patterns) {
129
125
  const reList = [];
130
126
  const filePatterns = [];
131
127
  for (const pattern of Array.isArray(patterns) ? patterns : [patterns]) {
132
- if ((0, import_utils.isRegExp)(pattern)) {
128
+ if (isRegExp(pattern)) {
133
129
  reList.push(pattern);
134
130
  } else {
135
131
  if (!pattern.startsWith("**/"))
@@ -153,7 +149,7 @@ function createFileMatcher(patterns) {
153
149
  }
154
150
  }
155
151
  for (const pattern of filePatterns) {
156
- if ((0, import_utilsBundle.minimatch)(filePath, pattern, { nocase: true, dot: true }))
152
+ if (minimatch(filePath, pattern, { nocase: true, dot: true }))
157
153
  return true;
158
154
  }
159
155
  return false;
@@ -198,18 +194,19 @@ function errorWithFile(file, message) {
198
194
  return new Error(`${relativeFilePath(file)}: ${message}`);
199
195
  }
200
196
  function expectTypes(receiver, types, matcherName) {
201
- if (typeof receiver !== "object" || !types.includes(receiver.constructor.name)) {
197
+ if (typeof receiver !== "object" || !types.includes(receiver._apiName)) {
198
+ const receiverString = typeof receiver === "object" && receiver !== null ? `${receiver.constructor.name} ${import_util.default.inspect(receiver)}` : String(receiver);
202
199
  const commaSeparated = types.slice();
203
200
  const lastType = commaSeparated.pop();
204
201
  const typesString = commaSeparated.length ? commaSeparated.join(", ") + " or " + lastType : lastType;
205
- throw new Error(`${matcherName} can be only used with ${typesString} object${types.length > 1 ? "s" : ""}`);
202
+ throw new Error(`${matcherName} can be only used with ${typesString} object${types.length > 1 ? "s" : ""}, was called with ${receiverString}`);
206
203
  }
207
204
  }
208
205
  const windowsFilesystemFriendlyLength = 60;
209
206
  function trimLongString(s, length = 100) {
210
207
  if (s.length <= length)
211
208
  return s;
212
- const hash = (0, import_utils.calculateSha1)(s);
209
+ const hash = calculateSha1(s);
213
210
  const middle = `-${hash.substring(0, 5)}-`;
214
211
  const start = Math.floor((length - middle.length) / 2);
215
212
  const end = length - middle.length - start;
@@ -223,7 +220,7 @@ function addSuffixToFilePath(filePath, suffix) {
223
220
  function sanitizeFilePathBeforeExtension(filePath, ext) {
224
221
  ext ??= import_path.default.extname(filePath);
225
222
  const base = filePath.substring(0, filePath.length - ext.length);
226
- return (0, import_utils.sanitizeForFilePath)(base) + ext;
223
+ return sanitizeForFilePath(base) + ext;
227
224
  }
228
225
  function getContainedPath(parentPath, subPath = "") {
229
226
  const resolvedPath = import_path.default.resolve(parentPath, subPath);
@@ -231,7 +228,7 @@ function getContainedPath(parentPath, subPath = "") {
231
228
  return resolvedPath;
232
229
  return null;
233
230
  }
234
- const debugTest = (0, import_utilsBundle.debug)("pw:test");
231
+ const debugTest = debug("pw:test");
235
232
  const folderToPackageJsonPath = /* @__PURE__ */ new Map();
236
233
  function getPackageJsonPath(folderPath) {
237
234
  const cached = folderToPackageJsonPath.get(folderPath);
@@ -264,14 +261,14 @@ async function normalizeAndSaveAttachment(outputPath, name, options = {}) {
264
261
  if ((options.path !== void 0 ? 1 : 0) + (options.body !== void 0 ? 1 : 0) !== 1)
265
262
  throw new Error(`Exactly one of "path" and "body" must be specified`);
266
263
  if (options.path !== void 0) {
267
- const hash = (0, import_utils.calculateSha1)(options.path);
268
- if (!(0, import_utils.isString)(name))
264
+ const hash = calculateSha1(options.path);
265
+ if (!isString(name))
269
266
  throw new Error('"name" should be string.');
270
- const sanitizedNamePrefix = (0, import_utils.sanitizeForFilePath)(name) + "-";
267
+ const sanitizedNamePrefix = sanitizeForFilePath(name) + "-";
271
268
  const dest = import_path.default.join(outputPath, "attachments", sanitizedNamePrefix + hash + import_path.default.extname(options.path));
272
269
  await import_fs.default.promises.mkdir(import_path.default.dirname(dest), { recursive: true });
273
270
  await import_fs.default.promises.copyFile(options.path, dest);
274
- const contentType = options.contentType ?? (import_utilsBundle.mime.getType(import_path.default.basename(options.path)) || "application/octet-stream");
271
+ const contentType = options.contentType ?? (mime.getType(import_path.default.basename(options.path)) || "application/octet-stream");
275
272
  return { name, contentType, path: dest };
276
273
  } else {
277
274
  const contentType = options.contentType ?? (typeof options.body === "string" ? "text/plain" : "application/octet-stream");
@@ -365,13 +362,18 @@ async function removeDirAndLogToConsole(dir) {
365
362
  } catch {
366
363
  }
367
364
  }
365
+ function takeFirst(...args) {
366
+ for (const arg of args) {
367
+ if (arg !== void 0)
368
+ return arg;
369
+ }
370
+ return void 0;
371
+ }
368
372
  // Annotate the CommonJS export names for ESM import in node:
369
373
  0 && (module.exports = {
370
374
  addSuffixToFilePath,
371
375
  ansiRegex,
372
- createFileFiltersFromArguments,
373
376
  createFileMatcher,
374
- createFileMatcherFromArguments,
375
377
  createTitleMatcher,
376
378
  debugTest,
377
379
  errorWithFile,
@@ -395,6 +397,7 @@ async function removeDirAndLogToConsole(dir) {
395
397
  sanitizeFilePathBeforeExtension,
396
398
  serializeError,
397
399
  stripAnsiEscapes,
400
+ takeFirst,
398
401
  trimLongString,
399
402
  windowsFilesystemFriendlyLength
400
403
  });