@smoothdeploy/playwright 1.60.1 → 1.62.0
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.
- package/lib/agents/copilot-setup-steps.yml +2 -2
- package/lib/agents/generateAgents.js +48 -0
- package/lib/cli/reportActions.js +2 -2
- package/lib/cli/testActions.js +2 -0
- package/lib/common/index.js +246 -187
- package/lib/common/index.js.txt +13 -14
- package/lib/errorContext.js +2 -3
- package/lib/index.js +48 -21
- package/lib/loader/loaderProcessEntry.js +1 -1
- package/lib/matchers/expect.js +4830 -4394
- package/lib/matchers/expect.js.LICENSE +87 -140
- package/lib/matchers/expect.js.txt +30 -35
- package/lib/mcp/test/testContext.js +5 -1
- package/lib/program.js +28 -3
- package/lib/runner/index.js +400 -194
- package/lib/runner/index.js.txt +19 -18
- package/lib/transform/babelBundle.js +12899 -11654
- package/lib/transform/babelBundle.js.LICENSE +379 -354
- package/lib/transform/babelBundle.js.txt +39 -39
- package/lib/transform/esmLoader.js +3275 -1154
- package/lib/transform/esmLoader.js.LICENSE +81 -61
- package/lib/transform/esmLoader.js.txt +23 -18
- package/lib/util.js +14 -44
- package/lib/worker/workerProcessEntry.js +60 -1461
- package/lib/worker/workerProcessEntry.js.txt +8 -13
- package/package.json +3 -6
- package/types/test.d.ts +458 -21
- package/types/testReporter.d.ts +79 -4
|
@@ -4,25 +4,26 @@ THIRD-PARTY SOFTWARE NOTICES AND INFORMATION
|
|
|
4
4
|
|
|
5
5
|
The following npm packages are inlined into this bundle.
|
|
6
6
|
|
|
7
|
-
- balanced-match@
|
|
8
|
-
- brace-expansion@
|
|
7
|
+
- balanced-match@4.0.4 (https://github.com/juliangruber/balanced-match)
|
|
8
|
+
- brace-expansion@5.0.7 (https://github.com/juliangruber/brace-expansion)
|
|
9
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
10
|
- debug@4.4.3 (https://github.com/debug-js/debug)
|
|
12
11
|
- has-flag@4.0.0 (https://github.com/sindresorhus/has-flag)
|
|
13
12
|
- json5@2.2.3 (https://github.com/json5/json5)
|
|
14
|
-
- mime@
|
|
15
|
-
- minimatch@
|
|
13
|
+
- mime@4.1.0 (https://github.com/broofa/mime)
|
|
14
|
+
- minimatch@10.2.5 (https://github.com/isaacs/minimatch)
|
|
16
15
|
- ms@2.1.3 (https://github.com/vercel/ms)
|
|
17
16
|
- source-map-support@0.5.21 (https://github.com/evanw/node-source-map-support)
|
|
18
17
|
- source-map@0.6.1 (https://github.com/mozilla/source-map)
|
|
19
|
-
- supports-color@
|
|
18
|
+
- supports-color@7.2.0 (https://github.com/chalk/supports-color)
|
|
20
19
|
|
|
21
|
-
%% balanced-match@
|
|
20
|
+
%% balanced-match@4.0.4 NOTICES AND INFORMATION BEGIN HERE
|
|
22
21
|
=========================================
|
|
23
22
|
(MIT)
|
|
24
23
|
|
|
25
|
-
|
|
24
|
+
Original code Copyright Julian Gruber <julian@juliangruber.com>
|
|
25
|
+
|
|
26
|
+
Port to TypeScript Copyright Isaac Z. Schlueter <i@izs.me>
|
|
26
27
|
|
|
27
28
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
28
29
|
this software and associated documentation files (the "Software"), to deal in
|
|
@@ -42,13 +43,15 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
42
43
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
43
44
|
SOFTWARE.
|
|
44
45
|
=========================================
|
|
45
|
-
END OF balanced-match@
|
|
46
|
+
END OF balanced-match@4.0.4 NOTICES AND INFORMATION
|
|
46
47
|
|
|
47
|
-
%% brace-expansion@
|
|
48
|
+
%% brace-expansion@5.0.7 NOTICES AND INFORMATION BEGIN HERE
|
|
48
49
|
=========================================
|
|
49
50
|
MIT License
|
|
50
51
|
|
|
51
|
-
Copyright
|
|
52
|
+
Copyright Julian Gruber <julian@juliangruber.com>
|
|
53
|
+
|
|
54
|
+
TypeScript port Copyright Isaac Z. Schlueter <i@izs.me>
|
|
52
55
|
|
|
53
56
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
54
57
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -68,7 +71,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
68
71
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
69
72
|
SOFTWARE.
|
|
70
73
|
=========================================
|
|
71
|
-
END OF brace-expansion@
|
|
74
|
+
END OF brace-expansion@5.0.7 NOTICES AND INFORMATION
|
|
72
75
|
|
|
73
76
|
%% buffer-from@1.1.2 NOTICES AND INFORMATION BEGIN HERE
|
|
74
77
|
=========================================
|
|
@@ -96,29 +99,6 @@ SOFTWARE.
|
|
|
96
99
|
=========================================
|
|
97
100
|
END OF buffer-from@1.1.2 NOTICES AND INFORMATION
|
|
98
101
|
|
|
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
102
|
%% debug@4.4.3 NOTICES AND INFORMATION BEGIN HERE
|
|
123
103
|
=========================================
|
|
124
104
|
(The MIT License)
|
|
@@ -185,11 +165,11 @@ SOFTWARE.
|
|
|
185
165
|
=========================================
|
|
186
166
|
END OF json5@2.2.3 NOTICES AND INFORMATION
|
|
187
167
|
|
|
188
|
-
%% mime@
|
|
168
|
+
%% mime@4.1.0 NOTICES AND INFORMATION BEGIN HERE
|
|
189
169
|
=========================================
|
|
190
|
-
|
|
170
|
+
MIT License
|
|
191
171
|
|
|
192
|
-
Copyright (c)
|
|
172
|
+
Copyright (c) 2023 Robert Kieffer
|
|
193
173
|
|
|
194
174
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
195
175
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -198,38 +178,78 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
198
178
|
copies of the Software, and to permit persons to whom the Software is
|
|
199
179
|
furnished to do so, subject to the following conditions:
|
|
200
180
|
|
|
201
|
-
The above copyright notice and this permission notice shall be included in
|
|
202
|
-
|
|
181
|
+
The above copyright notice and this permission notice shall be included in all
|
|
182
|
+
copies or substantial portions of the Software.
|
|
203
183
|
|
|
204
184
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
205
185
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
206
186
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
207
187
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
208
188
|
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
|
-
|
|
189
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
190
|
+
SOFTWARE.
|
|
211
191
|
=========================================
|
|
212
|
-
END OF mime@
|
|
192
|
+
END OF mime@4.1.0 NOTICES AND INFORMATION
|
|
213
193
|
|
|
214
|
-
%% minimatch@
|
|
194
|
+
%% minimatch@10.2.5 NOTICES AND INFORMATION BEGIN HERE
|
|
215
195
|
=========================================
|
|
216
|
-
|
|
196
|
+
# Blue Oak Model License
|
|
197
|
+
|
|
198
|
+
Version 1.0.0
|
|
199
|
+
|
|
200
|
+
## Purpose
|
|
201
|
+
|
|
202
|
+
This license gives everyone as much permission to work with
|
|
203
|
+
this software as possible, while protecting contributors
|
|
204
|
+
from liability.
|
|
205
|
+
|
|
206
|
+
## Acceptance
|
|
207
|
+
|
|
208
|
+
In order to receive this license, you must agree to its
|
|
209
|
+
rules. The rules of this license are both obligations
|
|
210
|
+
under that agreement and conditions to your license.
|
|
211
|
+
You must not do anything with this software that triggers
|
|
212
|
+
a rule that you cannot or will not follow.
|
|
213
|
+
|
|
214
|
+
## Copyright
|
|
217
215
|
|
|
218
|
-
|
|
216
|
+
Each contributor licenses you to do everything with this
|
|
217
|
+
software that would otherwise infringe that contributor's
|
|
218
|
+
copyright in it.
|
|
219
219
|
|
|
220
|
-
|
|
221
|
-
purpose with or without fee is hereby granted, provided that the above
|
|
222
|
-
copyright notice and this permission notice appear in all copies.
|
|
220
|
+
## Notices
|
|
223
221
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
222
|
+
You must ensure that everyone who gets a copy of
|
|
223
|
+
any part of this software from you, with or without
|
|
224
|
+
changes, also gets the text of this license or a link to
|
|
225
|
+
<https://blueoakcouncil.org/license/1.0.0>.
|
|
226
|
+
|
|
227
|
+
## Excuse
|
|
228
|
+
|
|
229
|
+
If anyone notifies you in writing that you have not
|
|
230
|
+
complied with [Notices](#notices), you can keep your
|
|
231
|
+
license by taking all practical steps to comply within 30
|
|
232
|
+
days after the notice. If you do not do so, your license
|
|
233
|
+
ends immediately.
|
|
234
|
+
|
|
235
|
+
## Patent
|
|
236
|
+
|
|
237
|
+
Each contributor licenses you to do everything with this
|
|
238
|
+
software that would otherwise infringe any patent claims
|
|
239
|
+
they can license or become able to license.
|
|
240
|
+
|
|
241
|
+
## Reliability
|
|
242
|
+
|
|
243
|
+
No contributor can revoke this license.
|
|
244
|
+
|
|
245
|
+
## No Liability
|
|
246
|
+
|
|
247
|
+
**_As far as the law allows, this software comes as is,
|
|
248
|
+
without any warranty or condition, and no contributor
|
|
249
|
+
will be liable to anyone for any damages related to this
|
|
250
|
+
software or this license, under any kind of legal claim._**
|
|
231
251
|
=========================================
|
|
232
|
-
END OF minimatch@
|
|
252
|
+
END OF minimatch@10.2.5 NOTICES AND INFORMATION
|
|
233
253
|
|
|
234
254
|
%% ms@2.1.3 NOTICES AND INFORMATION BEGIN HERE
|
|
235
255
|
=========================================
|
|
@@ -315,11 +335,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
315
335
|
=========================================
|
|
316
336
|
END OF source-map@0.6.1 NOTICES AND INFORMATION
|
|
317
337
|
|
|
318
|
-
%% supports-color@
|
|
338
|
+
%% supports-color@7.2.0 NOTICES AND INFORMATION BEGIN HERE
|
|
319
339
|
=========================================
|
|
320
340
|
MIT License
|
|
321
341
|
|
|
322
|
-
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (
|
|
342
|
+
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
|
323
343
|
|
|
324
344
|
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
345
|
|
|
@@ -327,9 +347,9 @@ The above copyright notice and this permission notice shall be included in all c
|
|
|
327
347
|
|
|
328
348
|
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
349
|
=========================================
|
|
330
|
-
END OF supports-color@
|
|
350
|
+
END OF supports-color@7.2.0 NOTICES AND INFORMATION
|
|
331
351
|
|
|
332
352
|
SUMMARY
|
|
333
353
|
=========================================
|
|
334
|
-
Total Packages:
|
|
354
|
+
Total Packages: 12
|
|
335
355
|
=========================================
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
# packages/playwright/lib/transform/esmLoader.js
|
|
2
|
-
# total:
|
|
2
|
+
# total: 283.9 KB
|
|
3
3
|
|
|
4
|
-
## Inlined (
|
|
5
|
-
1.
|
|
6
|
-
4.
|
|
4
|
+
## Inlined (51)
|
|
5
|
+
1.3 KB node_modules/balanced-match/dist/esm/index.js
|
|
6
|
+
4.8 KB node_modules/brace-expansion/dist/esm/index.js
|
|
7
7
|
1.8 KB node_modules/buffer-from/index.js
|
|
8
|
-
0.5 KB node_modules/concat-map/index.js
|
|
9
8
|
4.6 KB node_modules/debug/src/browser.js
|
|
10
9
|
5.8 KB node_modules/debug/src/common.js
|
|
11
10
|
0.3 KB node_modules/debug/src/index.js
|
|
@@ -16,11 +15,16 @@
|
|
|
16
15
|
6.8 KB node_modules/json5/lib/stringify.js
|
|
17
16
|
15.5 KB node_modules/json5/lib/unicode.js
|
|
18
17
|
0.9 KB node_modules/json5/lib/util.js
|
|
19
|
-
0.
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
0.1 KB node_modules/mime/dist/src/index.js
|
|
19
|
+
3.7 KB node_modules/mime/dist/src/Mime.js
|
|
20
|
+
29.4 KB node_modules/mime/dist/types/other.js
|
|
21
|
+
11.9 KB node_modules/mime/dist/types/standard.js
|
|
22
|
+
0.3 KB node_modules/minimatch/dist/esm/assert-valid-pattern.js
|
|
23
|
+
19.5 KB node_modules/minimatch/dist/esm/ast.js
|
|
24
|
+
3.1 KB node_modules/minimatch/dist/esm/brace-expressions.js
|
|
25
|
+
0.3 KB node_modules/minimatch/dist/esm/escape.js
|
|
26
|
+
26.3 KB node_modules/minimatch/dist/esm/index.js
|
|
27
|
+
0.4 KB node_modules/minimatch/dist/esm/unescape.js
|
|
24
28
|
2.8 KB node_modules/ms/index.js
|
|
25
29
|
16.1 KB node_modules/source-map-support/source-map-support.js
|
|
26
30
|
2.2 KB node_modules/source-map/lib/array-set.js
|
|
@@ -34,22 +38,23 @@
|
|
|
34
38
|
9.6 KB node_modules/source-map/lib/source-node.js
|
|
35
39
|
8.6 KB node_modules/source-map/lib/util.js
|
|
36
40
|
0.3 KB node_modules/source-map/source-map.js
|
|
37
|
-
3.
|
|
41
|
+
3.1 KB node_modules/supports-color/index.js
|
|
38
42
|
0.1 KB packages/isomorphic/rtti.ts
|
|
39
|
-
0.2 KB packages/isomorphic/stackTrace.ts
|
|
40
43
|
0.2 KB packages/isomorphic/stringUtils.ts
|
|
41
|
-
6.
|
|
44
|
+
6.5 KB packages/playwright/src/transform/compilationCache.ts
|
|
42
45
|
3.1 KB packages/playwright/src/transform/esmLoader.ts
|
|
46
|
+
1.7 KB packages/playwright/src/transform/esmLoaderSync.ts
|
|
43
47
|
1.1 KB packages/playwright/src/transform/pirates.ts
|
|
44
48
|
1.1 KB packages/playwright/src/transform/portTransport.ts
|
|
45
|
-
|
|
46
|
-
2
|
|
47
|
-
4.
|
|
49
|
+
11.7 KB packages/playwright/src/transform/transform.ts
|
|
50
|
+
3.2 KB packages/playwright/src/transform/tsconfig-loader.ts
|
|
51
|
+
4.7 KB packages/playwright/src/util.ts
|
|
48
52
|
0.2 KB packages/utils/crypto.ts
|
|
49
|
-
0.
|
|
53
|
+
0.1 KB packages/utils/debug.ts
|
|
50
54
|
0.5 KB packages/utils/env.ts
|
|
55
|
+
0.2 KB packages/utils/stackTrace.ts
|
|
51
56
|
|
|
52
57
|
## External (3)
|
|
53
58
|
../globals
|
|
54
59
|
../package
|
|
55
|
-
|
|
60
|
+
../transform/esmLoader.js
|
package/lib/util.js
CHANGED
|
@@ -37,9 +37,7 @@ __export(util_exports, {
|
|
|
37
37
|
expectTypes: () => expectTypes,
|
|
38
38
|
fileExistsAsync: () => fileExistsAsync,
|
|
39
39
|
fileIsModule: () => fileIsModule,
|
|
40
|
-
filterStackFile: () => filterStackFile,
|
|
41
40
|
filterStackTrace: () => filterStackTrace,
|
|
42
|
-
filteredStackTrace: () => filteredStackTrace,
|
|
43
41
|
forceRegExp: () => forceRegExp,
|
|
44
42
|
formatLocation: () => formatLocation,
|
|
45
43
|
getContainedPath: () => getContainedPath,
|
|
@@ -55,24 +53,20 @@ __export(util_exports, {
|
|
|
55
53
|
serializeError: () => serializeError,
|
|
56
54
|
stripAnsiEscapes: () => stripAnsiEscapes,
|
|
57
55
|
takeFirst: () => takeFirst,
|
|
58
|
-
trimLongString: () => trimLongString,
|
|
59
56
|
windowsFilesystemFriendlyLength: () => windowsFilesystemFriendlyLength
|
|
60
57
|
});
|
|
61
58
|
module.exports = __toCommonJS(util_exports);
|
|
62
59
|
var import_fs = __toESM(require("fs"));
|
|
63
60
|
var import_path = __toESM(require("path"));
|
|
64
|
-
var import_url = __toESM(require("url"));
|
|
65
61
|
var import_util = __toESM(require("util"));
|
|
66
62
|
const debug = require("playwright-core/lib/utilsBundle").debug;
|
|
67
63
|
const mime = require("playwright-core/lib/utilsBundle").mime;
|
|
68
|
-
const minimatch = require("playwright-core/lib/utilsBundle")
|
|
64
|
+
const { minimatch } = require("playwright-core/lib/utilsBundle");
|
|
69
65
|
const { calculateSha1 } = require("playwright-core/lib/coreBundle").utils;
|
|
70
66
|
const { sanitizeForFilePath } = require("playwright-core/lib/coreBundle").utils;
|
|
71
67
|
const { isRegExp } = require("playwright-core/lib/coreBundle").iso;
|
|
72
|
-
const {
|
|
68
|
+
const { stringifyStackFrames, filteredStackTrace } = require("playwright-core/lib/coreBundle").utils;
|
|
73
69
|
const { ansiRegex, isString, stripAnsiEscapes } = require("playwright-core/lib/coreBundle").iso;
|
|
74
|
-
const PLAYWRIGHT_TEST_PATH = import_path.default.join(__dirname, "..");
|
|
75
|
-
const PLAYWRIGHT_CORE_PATH = import_path.default.dirname(require.resolve("playwright-core/package.json"));
|
|
76
70
|
function filterStackTrace(e) {
|
|
77
71
|
const name = e.name ? e.name + ": " : "";
|
|
78
72
|
const cause = e.cause instanceof Error ? filterStackTrace(e.cause) : void 0;
|
|
@@ -85,27 +79,6 @@ function filterStackTrace(e) {
|
|
|
85
79
|
cause
|
|
86
80
|
};
|
|
87
81
|
}
|
|
88
|
-
function filterStackFile(file) {
|
|
89
|
-
if (process.env.PWDEBUGIMPL)
|
|
90
|
-
return true;
|
|
91
|
-
if (file.startsWith(PLAYWRIGHT_TEST_PATH))
|
|
92
|
-
return false;
|
|
93
|
-
if (file.startsWith(PLAYWRIGHT_CORE_PATH))
|
|
94
|
-
return false;
|
|
95
|
-
return true;
|
|
96
|
-
}
|
|
97
|
-
function filteredStackTrace(rawStack) {
|
|
98
|
-
const frames = [];
|
|
99
|
-
for (const line of rawStack) {
|
|
100
|
-
const frame = parseStackFrame(line, import_path.default.sep, !!process.env.PWDEBUGIMPL);
|
|
101
|
-
if (!frame || !frame.file)
|
|
102
|
-
continue;
|
|
103
|
-
if (!filterStackFile(frame.file))
|
|
104
|
-
continue;
|
|
105
|
-
frames.push(frame);
|
|
106
|
-
}
|
|
107
|
-
return frames;
|
|
108
|
-
}
|
|
109
82
|
function serializeError(error) {
|
|
110
83
|
if (error instanceof Error)
|
|
111
84
|
return filterStackTrace(error);
|
|
@@ -141,10 +114,10 @@ function createFileMatcher(patterns) {
|
|
|
141
114
|
return true;
|
|
142
115
|
}
|
|
143
116
|
if (import_path.default.sep === "\\") {
|
|
144
|
-
const
|
|
117
|
+
const unixPath = filePath.split(import_path.default.sep).join("/");
|
|
145
118
|
for (const re of reList) {
|
|
146
119
|
re.lastIndex = 0;
|
|
147
|
-
if (re.test(
|
|
120
|
+
if (re.test(unixPath))
|
|
148
121
|
return true;
|
|
149
122
|
}
|
|
150
123
|
}
|
|
@@ -203,15 +176,6 @@ function expectTypes(receiver, types, matcherName) {
|
|
|
203
176
|
}
|
|
204
177
|
}
|
|
205
178
|
const windowsFilesystemFriendlyLength = 60;
|
|
206
|
-
function trimLongString(s, length = 100) {
|
|
207
|
-
if (s.length <= length)
|
|
208
|
-
return s;
|
|
209
|
-
const hash = calculateSha1(s);
|
|
210
|
-
const middle = `-${hash.substring(0, 5)}-`;
|
|
211
|
-
const start = Math.floor((length - middle.length) / 2);
|
|
212
|
-
const end = length - middle.length - start;
|
|
213
|
-
return s.substring(0, start) + middle + s.slice(-end);
|
|
214
|
-
}
|
|
215
179
|
function addSuffixToFilePath(filePath, suffix) {
|
|
216
180
|
const ext = import_path.default.extname(filePath);
|
|
217
181
|
const base = filePath.substring(0, filePath.length - ext.length);
|
|
@@ -283,11 +247,20 @@ function fileIsModule(file) {
|
|
|
283
247
|
const folder = import_path.default.dirname(file);
|
|
284
248
|
return folderIsModule(folder);
|
|
285
249
|
}
|
|
250
|
+
const packageJsonIsModuleCache = /* @__PURE__ */ new Map();
|
|
286
251
|
function folderIsModule(folder) {
|
|
287
252
|
const packageJsonPath = getPackageJsonPath(folder);
|
|
288
253
|
if (!packageJsonPath)
|
|
289
254
|
return false;
|
|
290
|
-
|
|
255
|
+
if (!packageJsonIsModuleCache.has(packageJsonPath)) {
|
|
256
|
+
let isModule = false;
|
|
257
|
+
try {
|
|
258
|
+
isModule = JSON.parse(import_fs.default.readFileSync(packageJsonPath, "utf8")).type === "module";
|
|
259
|
+
} catch {
|
|
260
|
+
}
|
|
261
|
+
packageJsonIsModuleCache.set(packageJsonPath, isModule);
|
|
262
|
+
}
|
|
263
|
+
return packageJsonIsModuleCache.get(packageJsonPath);
|
|
291
264
|
}
|
|
292
265
|
const packageJsonMainFieldCache = /* @__PURE__ */ new Map();
|
|
293
266
|
function getMainFieldFromPackageJson(packageJsonPath) {
|
|
@@ -380,9 +353,7 @@ function takeFirst(...args) {
|
|
|
380
353
|
expectTypes,
|
|
381
354
|
fileExistsAsync,
|
|
382
355
|
fileIsModule,
|
|
383
|
-
filterStackFile,
|
|
384
356
|
filterStackTrace,
|
|
385
|
-
filteredStackTrace,
|
|
386
357
|
forceRegExp,
|
|
387
358
|
formatLocation,
|
|
388
359
|
getContainedPath,
|
|
@@ -398,6 +369,5 @@ function takeFirst(...args) {
|
|
|
398
369
|
serializeError,
|
|
399
370
|
stripAnsiEscapes,
|
|
400
371
|
takeFirst,
|
|
401
|
-
trimLongString,
|
|
402
372
|
windowsFilesystemFriendlyLength
|
|
403
373
|
});
|