@rindo/core 2.17.4 → 2.18.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/cli/index.cjs +26 -16
- package/cli/index.js +26 -16
- package/cli/package.json +1 -1
- package/compiler/lib.dom.d.ts +620 -89
- package/compiler/lib.dom.iterable.d.ts +27 -3
- package/compiler/lib.es2015.core.d.ts +3 -3
- package/compiler/lib.es2015.iterable.d.ts +2 -1
- package/compiler/lib.es2015.reflect.d.ts +1 -1
- package/compiler/lib.es2020.bigint.d.ts +7 -5
- package/compiler/lib.es2020.d.ts +2 -0
- package/compiler/lib.es2020.date.d.ts +44 -0
- package/compiler/lib.es2020.intl.d.ts +51 -11
- package/compiler/lib.es2020.number.d.ts +30 -0
- package/compiler/lib.es2021.intl.d.ts +106 -4
- package/compiler/lib.es2022.array.d.ts +123 -0
- package/compiler/lib.es2022.d.ts +26 -0
- package/compiler/lib.es2022.error.d.ts +75 -0
- package/compiler/lib.es2022.full.d.ts +25 -0
- package/compiler/lib.es2022.intl.d.ts +111 -0
- package/compiler/lib.es2022.object.d.ts +28 -0
- package/compiler/lib.es2022.string.d.ts +27 -0
- package/compiler/lib.es5.d.ts +25 -19
- package/compiler/lib.esnext.d.ts +1 -1
- package/compiler/lib.esnext.intl.d.ts +4 -1
- package/compiler/lib.webworker.d.ts +236 -40
- package/compiler/lib.webworker.iterable.d.ts +10 -3
- package/compiler/package.json +1 -1
- package/compiler/rindo.js +607 -212
- package/compiler/rindo.min.js +2 -2
- package/compiler/sys/in-memory-fs.d.ts +218 -0
- package/dependencies.json +10 -1
- package/dev-server/client/index.js +1 -1
- package/dev-server/client/package.json +1 -1
- package/dev-server/connector.html +2 -2
- package/dev-server/index.js +1 -1
- package/dev-server/package.json +1 -1
- package/dev-server/server-process.js +12 -12
- package/internal/app-data/package.json +1 -1
- package/internal/client/css-shim.js +1 -1
- package/internal/client/dom.js +1 -1
- package/internal/client/index.js +337 -157
- package/internal/client/package.json +1 -1
- package/internal/client/patch-browser.js +1 -1
- package/internal/client/patch-esm.js +1 -1
- package/internal/client/shadow-css.js +1 -1
- package/internal/hydrate/package.json +1 -1
- package/internal/package.json +1 -1
- package/internal/rindo-private.d.ts +2 -106
- package/internal/rindo-public-compiler.d.ts +42 -8
- package/internal/testing/package.json +1 -1
- package/mock-doc/index.cjs +77 -61
- package/mock-doc/index.d.ts +13 -12
- package/mock-doc/index.js +77 -61
- package/mock-doc/package.json +1 -1
- package/package.json +2 -4
- package/screenshot/index.js +10 -10
- package/screenshot/package.json +1 -1
- package/sys/node/index.js +1 -1
- package/sys/node/package.json +1 -1
- package/sys/node/worker.js +1 -1
- package/testing/index.js +780 -794
- package/testing/package.json +1 -1
- package/testing/testing-utils.d.ts +5 -4
package/testing/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
Rindo Testing v2.
|
|
2
|
+
Rindo Testing v2.18.0 | MIT Licensed | https://rindojs.web.app
|
|
3
3
|
*/
|
|
4
4
|
function _lazyRequire(e) {
|
|
5
5
|
return new Proxy({}, {
|
|
6
6
|
get(t, r) {
|
|
7
|
-
const s = require(e);
|
|
8
|
-
return Reflect.get(s, r);
|
|
9
|
-
},
|
|
10
|
-
set(t, r, s) {
|
|
11
7
|
const n = require(e);
|
|
12
|
-
return Reflect.
|
|
8
|
+
return Reflect.get(n, r);
|
|
9
|
+
},
|
|
10
|
+
set(t, r, n) {
|
|
11
|
+
const s = require(e);
|
|
12
|
+
return Reflect.set(s, r, n);
|
|
13
13
|
}
|
|
14
14
|
});
|
|
15
15
|
}
|
|
@@ -25,8 +25,8 @@ function _interopNamespace(e) {
|
|
|
25
25
|
var t = Object.create(null);
|
|
26
26
|
return e && Object.keys(e).forEach((function(r) {
|
|
27
27
|
if ("default" !== r) {
|
|
28
|
-
var
|
|
29
|
-
Object.defineProperty(t, r,
|
|
28
|
+
var n = Object.getOwnPropertyDescriptor(e, r);
|
|
29
|
+
Object.defineProperty(t, r, n.get ? n : {
|
|
30
30
|
enumerable: !0,
|
|
31
31
|
get: function() {
|
|
32
32
|
return e[r];
|
|
@@ -38,10 +38,10 @@ function _interopNamespace(e) {
|
|
|
38
38
|
|
|
39
39
|
async function startPuppeteerBrowser(e) {
|
|
40
40
|
if (!e.flags.e2e) return null;
|
|
41
|
-
const t = process.env, r = e.testing.browserExecutablePath ? "puppeteer-core" : "puppeteer",
|
|
42
|
-
t.__RINDO_PUPPETEER_MODULE__ =
|
|
41
|
+
const t = process.env, r = e.testing.browserExecutablePath ? "puppeteer-core" : "puppeteer", n = e.sys.lazyRequire.getModulePath(e.rootDir, r), s = e.sys.lazyRequire.require(e.rootDir, n);
|
|
42
|
+
t.__RINDO_PUPPETEER_MODULE__ = n, t.__RINDO_BROWSER_WAIT_UNTIL = e.testing.browserWaitUntil,
|
|
43
43
|
e.flags.devtools && (e.testing.browserDevtools = !0, e.testing.browserHeadless = !1,
|
|
44
|
-
t.__RINDO_E2E_DEVTOOLS__ = "true"), e.logger.debug(`puppeteer: ${
|
|
44
|
+
t.__RINDO_E2E_DEVTOOLS__ = "true"), e.logger.debug(`puppeteer: ${n}`), e.logger.debug(`puppeteer headless: ${e.testing.browserHeadless}`),
|
|
45
45
|
Array.isArray(e.testing.browserArgs) && e.logger.debug(`puppeteer args: ${e.testing.browserArgs.join(" ")}`),
|
|
46
46
|
"boolean" == typeof e.testing.browserDevtools && e.logger.debug(`puppeteer devtools: ${e.testing.browserDevtools}`),
|
|
47
47
|
"number" == typeof e.testing.browserSlowMo && e.logger.debug(`puppeteer slowMo: ${e.testing.browserSlowMo}`);
|
|
@@ -50,7 +50,7 @@ async function startPuppeteerBrowser(e) {
|
|
|
50
50
|
slowMo: e.testing.browserSlowMo
|
|
51
51
|
};
|
|
52
52
|
let i;
|
|
53
|
-
if (e.testing.browserWSEndpoint) i = await
|
|
53
|
+
if (e.testing.browserWSEndpoint) i = await s.connect({
|
|
54
54
|
browserWSEndpoint: e.testing.browserWSEndpoint,
|
|
55
55
|
...o
|
|
56
56
|
}); else {
|
|
@@ -61,7 +61,7 @@ async function startPuppeteerBrowser(e) {
|
|
|
61
61
|
...o
|
|
62
62
|
};
|
|
63
63
|
e.testing.browserExecutablePath && (t.executablePath = e.testing.browserExecutablePath),
|
|
64
|
-
i = await
|
|
64
|
+
i = await s.launch({
|
|
65
65
|
...t
|
|
66
66
|
});
|
|
67
67
|
}
|
|
@@ -74,14 +74,14 @@ function getAppStyleUrl(e, t) {
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
function getAppUrl(e, t, r) {
|
|
77
|
-
const
|
|
78
|
-
if (
|
|
79
|
-
const e =
|
|
77
|
+
const n = e.outputTargets.find(isOutputTargetWww);
|
|
78
|
+
if (n) {
|
|
79
|
+
const e = n.buildDir, s = path$2.join(e, r), o = path$2.relative(n.dir, s);
|
|
80
80
|
return new URL(o, t).href;
|
|
81
81
|
}
|
|
82
|
-
const
|
|
83
|
-
if (
|
|
84
|
-
const
|
|
82
|
+
const s = e.outputTargets.find(isOutputTargetDistLazy);
|
|
83
|
+
if (s) {
|
|
84
|
+
const n = s.esmDir, o = path$2.join(n, r), i = path$2.relative(e.rootDir, o);
|
|
85
85
|
return new URL(i, t).href;
|
|
86
86
|
}
|
|
87
87
|
return t;
|
|
@@ -100,9 +100,9 @@ function setScreenshotEmulateData(e, t) {
|
|
|
100
100
|
}
|
|
101
101
|
};
|
|
102
102
|
if ("string" == typeof e.device) try {
|
|
103
|
-
const
|
|
104
|
-
if (!
|
|
105
|
-
r.device = e.device, r.userAgent =
|
|
103
|
+
const n = require(t.__RINDO_PUPPETEER_MODULE__ + "/DeviceDescriptors")[e.device];
|
|
104
|
+
if (!n) return void console.error(`invalid emulate device: ${e.device}`);
|
|
105
|
+
r.device = e.device, r.userAgent = n.userAgent, r.viewport = n.viewport;
|
|
106
106
|
} catch (e) {
|
|
107
107
|
return void console.error("error loading puppeteer DeviceDescriptors", e);
|
|
108
108
|
}
|
|
@@ -118,7 +118,7 @@ function setScreenshotEmulateData(e, t) {
|
|
|
118
118
|
async function runJest(e, t) {
|
|
119
119
|
let r = !1;
|
|
120
120
|
try {
|
|
121
|
-
const
|
|
121
|
+
const n = function n(e, t) {
|
|
122
122
|
let r = e.emulate.slice();
|
|
123
123
|
if ("string" == typeof t.emulate) {
|
|
124
124
|
const e = t.emulate.toLowerCase();
|
|
@@ -126,15 +126,15 @@ async function runJest(e, t) {
|
|
|
126
126
|
}
|
|
127
127
|
return r;
|
|
128
128
|
}(e.testing, e.flags);
|
|
129
|
-
t.__RINDO_EMULATE_CONFIGS__ = JSON.stringify(
|
|
129
|
+
t.__RINDO_EMULATE_CONFIGS__ = JSON.stringify(n), t.__RINDO_ENV__ = JSON.stringify(e.env),
|
|
130
130
|
e.flags.ci || e.flags.e2e ? t.__RINDO_DEFAULT_TIMEOUT__ = "30000" : t.__RINDO_DEFAULT_TIMEOUT__ = "15000",
|
|
131
131
|
e.flags.devtools && (t.__RINDO_DEFAULT_TIMEOUT__ = "300000000"), e.logger.debug(`default timeout: ${t.__RINDO_DEFAULT_TIMEOUT__}`);
|
|
132
|
-
const
|
|
132
|
+
const s = function s(e) {
|
|
133
133
|
const t = require("yargs"), r = [ ...e.flags.unknownArgs.slice(), ...e.flags.knownArgs.slice() ];
|
|
134
134
|
r.some((e => e.startsWith("--max-workers") || e.startsWith("--maxWorkers"))) || r.push(`--max-workers=${e.maxConcurrentWorkers}`),
|
|
135
135
|
e.flags.devtools && r.push("--runInBand"), e.logger.info(e.logger.magenta(`jest args: ${r.join(" ")}`));
|
|
136
|
-
let
|
|
137
|
-
if (
|
|
136
|
+
let n = t(r).argv;
|
|
137
|
+
if (n = {
|
|
138
138
|
detectLeaks: !1,
|
|
139
139
|
"detect-leaks": !1,
|
|
140
140
|
detectOpenHandles: !1,
|
|
@@ -153,28 +153,28 @@ async function runJest(e, t) {
|
|
|
153
153
|
"run-tests-by-path": !1,
|
|
154
154
|
testLocationInResults: !1,
|
|
155
155
|
"test-location-in-results": !1,
|
|
156
|
-
...
|
|
157
|
-
},
|
|
158
|
-
const t = e.testing, r = require("jest-config").defaults,
|
|
156
|
+
...n
|
|
157
|
+
}, n.config = function s(e) {
|
|
158
|
+
const t = e.testing, r = require("jest-config").defaults, n = Object.keys(r), s = {};
|
|
159
159
|
return Object.keys(t).forEach((e => {
|
|
160
|
-
|
|
161
|
-
})),
|
|
162
|
-
Array.isArray(t.collectCoverageFrom) && (
|
|
163
|
-
isString(t.coverageDirectory) && (
|
|
164
|
-
isString(t.globalSetup) && (
|
|
165
|
-
isString(t.preset) && (
|
|
166
|
-
Array.isArray(t.reporters) && (
|
|
167
|
-
t.transform && (
|
|
168
|
-
|
|
169
|
-
}(e), "string" == typeof
|
|
170
|
-
|
|
160
|
+
n.includes(e) && (s[e] = t[e]);
|
|
161
|
+
})), s.rootDir = e.rootDir, isString(t.collectCoverage) && (s.collectCoverage = t.collectCoverage),
|
|
162
|
+
Array.isArray(t.collectCoverageFrom) && (s.collectCoverageFrom = t.collectCoverageFrom),
|
|
163
|
+
isString(t.coverageDirectory) && (s.coverageDirectory = t.coverageDirectory), t.coverageThreshold && (s.coverageThreshold = t.coverageThreshold),
|
|
164
|
+
isString(t.globalSetup) && (s.globalSetup = t.globalSetup), isString(t.globalTeardown) && (s.globalTeardown = t.globalTeardown),
|
|
165
|
+
isString(t.preset) && (s.preset = t.preset), t.projects && (s.projects = t.projects),
|
|
166
|
+
Array.isArray(t.reporters) && (s.reporters = t.reporters), isString(t.testResultsProcessor) && (s.testResultsProcessor = t.testResultsProcessor),
|
|
167
|
+
t.transform && (s.transform = t.transform), t.verbose && (s.verbose = t.verbose),
|
|
168
|
+
s.testRunner = "jest-jasmine2", JSON.stringify(s);
|
|
169
|
+
}(e), "string" == typeof n.maxWorkers) try {
|
|
170
|
+
n.maxWorkers = parseInt(n.maxWorkers, 10);
|
|
171
171
|
} catch (e) {}
|
|
172
|
-
return "string" == typeof
|
|
172
|
+
return "string" == typeof n.ci && (n.ci = "true" === n.ci || "" === n.ci), n;
|
|
173
173
|
}(e), o = function o(e, t) {
|
|
174
174
|
const r = t.projects ? t.projects : [];
|
|
175
175
|
return r.push(e.rootDir), r;
|
|
176
|
-
}(e,
|
|
177
|
-
r = !!(await i(
|
|
176
|
+
}(e, s), {runCLI: i} = require("@jest/core");
|
|
177
|
+
r = !!(await i(s, o)).results.success;
|
|
178
178
|
} catch (t) {
|
|
179
179
|
e.logger.error(`runJest: ${t}`);
|
|
180
180
|
}
|
|
@@ -246,11 +246,11 @@ function getCompilerOptions(e) {
|
|
|
246
246
|
};
|
|
247
247
|
if (1 === e.category && (t.level = "error"), e.file) {
|
|
248
248
|
t.absFilePath = e.file.fileName;
|
|
249
|
-
const
|
|
250
|
-
lineIndex:
|
|
251
|
-
lineNumber:
|
|
252
|
-
text: s
|
|
253
|
-
errorCharStart:
|
|
249
|
+
const n = "string" != typeof (r = e.file.text) ? [] : (r = r.replace(/\\r/g, "\n")).split("\n"), s = e.file.getLineAndCharacterOfPosition(e.start), o = {
|
|
250
|
+
lineIndex: s.line,
|
|
251
|
+
lineNumber: s.line + 1,
|
|
252
|
+
text: n[s.line],
|
|
253
|
+
errorCharStart: s.character,
|
|
254
254
|
errorLength: Math.max(e.length, 1)
|
|
255
255
|
};
|
|
256
256
|
if (t.lineNumber = o.lineNumber, t.columnNumber = o.errorCharStart + 1, t.lines.push(o),
|
|
@@ -259,17 +259,17 @@ function getCompilerOptions(e) {
|
|
|
259
259
|
const e = {
|
|
260
260
|
lineIndex: o.lineIndex - 1,
|
|
261
261
|
lineNumber: o.lineNumber - 1,
|
|
262
|
-
text:
|
|
262
|
+
text: n[o.lineIndex - 1],
|
|
263
263
|
errorCharStart: -1,
|
|
264
264
|
errorLength: -1
|
|
265
265
|
};
|
|
266
266
|
t.lines.unshift(e);
|
|
267
267
|
}
|
|
268
|
-
if (o.lineIndex + 1 <
|
|
268
|
+
if (o.lineIndex + 1 < n.length) {
|
|
269
269
|
const e = {
|
|
270
270
|
lineIndex: o.lineIndex + 1,
|
|
271
271
|
lineNumber: o.lineNumber + 1,
|
|
272
|
-
text:
|
|
272
|
+
text: n[o.lineIndex + 1],
|
|
273
273
|
errorCharStart: -1,
|
|
274
274
|
errorLength: -1
|
|
275
275
|
};
|
|
@@ -279,26 +279,26 @@ function getCompilerOptions(e) {
|
|
|
279
279
|
var r;
|
|
280
280
|
return t;
|
|
281
281
|
})(r.error)));
|
|
282
|
-
const
|
|
283
|
-
return _tsCompilerOptions =
|
|
282
|
+
const n = rindo_js.ts.parseJsonConfigFileContent(r.config, rindo_js.ts.sys, e, void 0, t);
|
|
283
|
+
return _tsCompilerOptions = n.options, _tsCompilerOptions;
|
|
284
284
|
}
|
|
285
285
|
|
|
286
286
|
function compareHtml(e, t, r) {
|
|
287
287
|
if (null == e) throw new Error(`expect toEqualHtml() value is "${e}"`);
|
|
288
288
|
if ("function" == typeof e.then) throw new Error("element must be a resolved value, not a promise, before it can be tested");
|
|
289
|
-
let
|
|
289
|
+
let n;
|
|
290
290
|
if (1 === e.nodeType) {
|
|
291
|
-
const t = function
|
|
291
|
+
const t = function s(e) {
|
|
292
292
|
return e && e.ownerDocument && e.ownerDocument.defaultView && e.ownerDocument.defaultView.__rindo_spec_options || {};
|
|
293
293
|
}(e);
|
|
294
|
-
|
|
294
|
+
n = index_cjs.serializeNodeToHtml(e, {
|
|
295
295
|
prettyHtml: !0,
|
|
296
296
|
outerHtml: !0,
|
|
297
297
|
removeHtmlComments: !1 === t.includeAnnotations,
|
|
298
298
|
excludeTags: [ "body" ],
|
|
299
299
|
serializeShadowRoot: r
|
|
300
300
|
});
|
|
301
|
-
} else if (11 === e.nodeType)
|
|
301
|
+
} else if (11 === e.nodeType) n = index_cjs.serializeNodeToHtml(e, {
|
|
302
302
|
prettyHtml: !0,
|
|
303
303
|
excludeTags: [ "style" ],
|
|
304
304
|
excludeTagContent: [ "style" ],
|
|
@@ -307,7 +307,7 @@ function compareHtml(e, t, r) {
|
|
|
307
307
|
if ("string" != typeof e) throw new Error("expect toEqualHtml() value should be an element, shadow root or string.");
|
|
308
308
|
{
|
|
309
309
|
const t = index_cjs.parseHtmlToFragment(e);
|
|
310
|
-
|
|
310
|
+
n = index_cjs.serializeNodeToHtml(t, {
|
|
311
311
|
prettyHtml: !0,
|
|
312
312
|
serializeShadowRoot: r
|
|
313
313
|
});
|
|
@@ -317,7 +317,7 @@ function compareHtml(e, t, r) {
|
|
|
317
317
|
prettyHtml: !0,
|
|
318
318
|
excludeTags: [ "body" ]
|
|
319
319
|
});
|
|
320
|
-
return
|
|
320
|
+
return n !== i ? (expect(n).toBe(i), {
|
|
321
321
|
message: () => "HTML does not match",
|
|
322
322
|
pass: !1
|
|
323
323
|
}) : {
|
|
@@ -351,22 +351,22 @@ async function globalMockFetch(e) {
|
|
|
351
351
|
r = mockedResponses.get(e.href);
|
|
352
352
|
}
|
|
353
353
|
if (null == r) return new MockResponse404;
|
|
354
|
-
const
|
|
355
|
-
return "number" != typeof
|
|
356
|
-
|
|
357
|
-
|
|
354
|
+
const n = r.response.clone();
|
|
355
|
+
return "number" != typeof n.status && (n.status = 200), "string" != typeof n.statusText && (n.status >= 500 ? n.statusText = "Internal Server Error" : 404 === n.status ? n.statusText = "Not Found" : n.status >= 400 ? n.statusText = "Bad Request" : 302 === n.status ? n.statusText = "Found" : 301 === n.status ? n.statusText = "Moved Permanently" : n.status >= 300 ? n.statusText = "Redirection" : n.statusText = "OK"),
|
|
356
|
+
n.ok = n.status >= 200 && n.status <= 299, "string" != typeof n.type && (n.type = "basic"),
|
|
357
|
+
n;
|
|
358
358
|
}
|
|
359
359
|
|
|
360
360
|
function setMockedResponse(e, t, r) {
|
|
361
361
|
if (!e) throw new Error("MockResponse required");
|
|
362
362
|
"string" == typeof e.url && "" !== e.url || ("string" == typeof t ? e.url = t : t && "string" == typeof t.url ? e.url = t.url : e.url = FETCH_DEFAULT_PATH);
|
|
363
|
-
const
|
|
364
|
-
e.url =
|
|
365
|
-
const
|
|
363
|
+
const n = new URL(e.url, location.href);
|
|
364
|
+
e.url = n.href;
|
|
365
|
+
const s = {
|
|
366
366
|
response: e,
|
|
367
367
|
reject: r
|
|
368
368
|
};
|
|
369
|
-
mockedResponses.set(e.url,
|
|
369
|
+
mockedResponses.set(e.url, s);
|
|
370
370
|
}
|
|
371
371
|
|
|
372
372
|
function resetBuildConditionals(e) {
|
|
@@ -388,48 +388,48 @@ function assertPath(e) {
|
|
|
388
388
|
}
|
|
389
389
|
|
|
390
390
|
function normalizeStringPosix(e, t) {
|
|
391
|
-
var r,
|
|
392
|
-
for (
|
|
393
|
-
if (
|
|
391
|
+
var r, n, s, o = "", i = 0, a = -1, l = 0;
|
|
392
|
+
for (n = 0; n <= e.length; ++n) {
|
|
393
|
+
if (n < e.length) r = e.charCodeAt(n); else {
|
|
394
394
|
if (47 === r) break;
|
|
395
395
|
r = 47;
|
|
396
396
|
}
|
|
397
397
|
if (47 === r) {
|
|
398
|
-
if (a ===
|
|
398
|
+
if (a === n - 1 || 1 === l) ; else if (a !== n - 1 && 2 === l) {
|
|
399
399
|
if (o.length < 2 || 2 !== i || 46 !== o.charCodeAt(o.length - 1) || 46 !== o.charCodeAt(o.length - 2)) if (o.length > 2) {
|
|
400
|
-
if ((
|
|
401
|
-
-1 ===
|
|
402
|
-
a =
|
|
400
|
+
if ((s = o.lastIndexOf("/")) !== o.length - 1) {
|
|
401
|
+
-1 === s ? (o = "", i = 0) : i = (o = o.slice(0, s)).length - 1 - o.lastIndexOf("/"),
|
|
402
|
+
a = n, l = 0;
|
|
403
403
|
continue;
|
|
404
404
|
}
|
|
405
405
|
} else if (2 === o.length || 1 === o.length) {
|
|
406
|
-
o = "", i = 0, a =
|
|
406
|
+
o = "", i = 0, a = n, l = 0;
|
|
407
407
|
continue;
|
|
408
408
|
}
|
|
409
409
|
t && (o.length > 0 ? o += "/.." : o = "..", i = 2);
|
|
410
|
-
} else o.length > 0 ? o += "/" + e.slice(a + 1,
|
|
411
|
-
a =
|
|
410
|
+
} else o.length > 0 ? o += "/" + e.slice(a + 1, n) : o = e.slice(a + 1, n), i = n - a - 1;
|
|
411
|
+
a = n, l = 0;
|
|
412
412
|
} else 46 === r && -1 !== l ? ++l : l = -1;
|
|
413
413
|
}
|
|
414
414
|
return o;
|
|
415
415
|
}
|
|
416
416
|
|
|
417
417
|
function specifierIncluded$1(e, t) {
|
|
418
|
-
var r,
|
|
419
|
-
for (r = 0; r < 3; ++r) if ((
|
|
418
|
+
var r, n, s, o = e.split("."), i = t.split(" "), a = i.length > 1 ? i[0] : "=", l = (i.length > 1 ? i[1] : i[0]).split(".");
|
|
419
|
+
for (r = 0; r < 3; ++r) if ((n = parseInt(o[r] || 0, 10)) !== (s = parseInt(l[r] || 0, 10))) return "<" === a ? n < s : ">=" === a && n >= s;
|
|
420
420
|
return ">=" === a;
|
|
421
421
|
}
|
|
422
422
|
|
|
423
423
|
function matchesRange$1(e, t) {
|
|
424
|
-
var r,
|
|
425
|
-
if (0 ===
|
|
426
|
-
for (r = 0; r <
|
|
424
|
+
var r, n = t.split(/ ?&& ?/);
|
|
425
|
+
if (0 === n.length) return !1;
|
|
426
|
+
for (r = 0; r < n.length; ++r) if (!specifierIncluded$1(e, n[r])) return !1;
|
|
427
427
|
return !0;
|
|
428
428
|
}
|
|
429
429
|
|
|
430
430
|
function specifierIncluded(e) {
|
|
431
|
-
var t, r,
|
|
432
|
-
for (t = 0; t < 3; ++t) if ((r = parseInt(current[t] || 0, 10)) !== (
|
|
431
|
+
var t, r, n, s = e.split(" "), o = s.length > 1 ? s[0] : "=", i = (s.length > 1 ? s[1] : s[0]).split(".");
|
|
432
|
+
for (t = 0; t < 3; ++t) if ((r = parseInt(current[t] || 0, 10)) !== (n = parseInt(i[t] || 0, 10))) return "<" === o ? r < n : ">=" === o && r >= n;
|
|
433
433
|
return ">=" === o;
|
|
434
434
|
}
|
|
435
435
|
|
|
@@ -524,58 +524,43 @@ function mockCompilerCtx(e) {
|
|
|
524
524
|
return Object.defineProperty(t, "fs", {
|
|
525
525
|
get() {
|
|
526
526
|
return null == this._fs && (this._fs = (e => {
|
|
527
|
-
const t = new Map, r = new Map,
|
|
528
|
-
const t = b(e);
|
|
529
|
-
if ("boolean" == typeof t.exists) return {
|
|
530
|
-
exists: t.exists,
|
|
531
|
-
isDirectory: t.isDirectory,
|
|
532
|
-
isFile: t.isFile
|
|
533
|
-
};
|
|
534
|
-
const r = {
|
|
535
|
-
exists: !1,
|
|
536
|
-
isDirectory: !1,
|
|
537
|
-
isFile: !1
|
|
538
|
-
}, s = await c(e);
|
|
539
|
-
return s ? (t.exists = s.exists, t.isDirectory = s.isDirectory, t.isFile = s.isFile,
|
|
540
|
-
r.exists = t.exists, r.isDirectory = t.isDirectory, r.isFile = t.isFile) : t.exists = !1,
|
|
541
|
-
r;
|
|
542
|
-
}, n = async (e, r = {}) => {
|
|
527
|
+
const t = new Map, r = new Map, n = async (e, r = {}) => {
|
|
543
528
|
e = normalizePath(e);
|
|
544
|
-
const
|
|
529
|
+
const n = [];
|
|
545
530
|
if (!0 === r.inMemoryOnly) {
|
|
546
|
-
let
|
|
547
|
-
|
|
548
|
-
const
|
|
549
|
-
t.forEach(((t,
|
|
550
|
-
if (!
|
|
551
|
-
const a =
|
|
552
|
-
if ((a.length ===
|
|
531
|
+
let s = e;
|
|
532
|
+
s.endsWith("/") || (s += "/");
|
|
533
|
+
const i = e.split("/");
|
|
534
|
+
t.forEach(((t, s) => {
|
|
535
|
+
if (!s.startsWith(e)) return;
|
|
536
|
+
const a = s.split("/");
|
|
537
|
+
if ((a.length === i.length + 1 || r.recursive && a.length > i.length) && t.exists) {
|
|
553
538
|
const e = {
|
|
554
|
-
absPath:
|
|
555
|
-
relPath: a[
|
|
539
|
+
absPath: s,
|
|
540
|
+
relPath: a[i.length],
|
|
556
541
|
isDirectory: t.isDirectory,
|
|
557
542
|
isFile: t.isFile
|
|
558
543
|
};
|
|
559
|
-
|
|
544
|
+
o(r, e) || n.push(e);
|
|
560
545
|
}
|
|
561
546
|
}));
|
|
562
|
-
} else await
|
|
563
|
-
return
|
|
564
|
-
},
|
|
547
|
+
} else await s(e, e, r, n);
|
|
548
|
+
return n.sort(((e, t) => e.absPath < t.absPath ? -1 : e.absPath > t.absPath ? 1 : 0));
|
|
549
|
+
}, s = async (t, r, n, i) => {
|
|
565
550
|
const a = await e.readDir(r);
|
|
566
551
|
if (a.length > 0) {
|
|
567
|
-
const e =
|
|
552
|
+
const e = v(r);
|
|
568
553
|
e.exists = !0, e.isFile = !1, e.isDirectory = !0, await Promise.all(a.map((async e => {
|
|
569
|
-
const r = normalizePath(e), a = normalizePath(path$2.relative(t, r)),
|
|
554
|
+
const r = normalizePath(e), a = normalizePath(path$2.relative(t, r)), c = await l(r), u = {
|
|
570
555
|
absPath: r,
|
|
571
556
|
relPath: a,
|
|
572
|
-
isDirectory:
|
|
573
|
-
isFile:
|
|
557
|
+
isDirectory: c.isDirectory,
|
|
558
|
+
isFile: c.isFile
|
|
574
559
|
};
|
|
575
|
-
|
|
560
|
+
o(n, u) || (i.push(u), !0 === n.recursive && !0 === c.isDirectory && await s(t, r, n, i));
|
|
576
561
|
})));
|
|
577
562
|
}
|
|
578
|
-
},
|
|
563
|
+
}, o = (e, t) => {
|
|
579
564
|
if (t.isDirectory) {
|
|
580
565
|
if (Array.isArray(e.excludeDirNames)) {
|
|
581
566
|
const r = path$2.basename(t.absPath);
|
|
@@ -586,24 +571,24 @@ function mockCompilerCtx(e) {
|
|
|
586
571
|
if (e.excludeExtensions.some((e => r.endsWith(e)))) return !0;
|
|
587
572
|
}
|
|
588
573
|
return !1;
|
|
589
|
-
},
|
|
590
|
-
const t =
|
|
574
|
+
}, i = async e => {
|
|
575
|
+
const t = v(e);
|
|
591
576
|
t.isFile = !1, t.isDirectory = !0, t.queueWriteToDisk || (t.queueDeleteFromDisk = !0);
|
|
592
577
|
try {
|
|
593
578
|
const t = await n(e, {
|
|
594
579
|
recursive: !0
|
|
595
580
|
});
|
|
596
|
-
await Promise.all(t.map((e => e.relPath.endsWith(".gitkeep") ? null :
|
|
581
|
+
await Promise.all(t.map((e => e.relPath.endsWith(".gitkeep") ? null : a(e.absPath))));
|
|
597
582
|
} catch (e) {}
|
|
598
|
-
},
|
|
599
|
-
const t =
|
|
583
|
+
}, a = async e => {
|
|
584
|
+
const t = v(e);
|
|
600
585
|
t.queueWriteToDisk || (t.queueDeleteFromDisk = !0);
|
|
601
|
-
},
|
|
602
|
-
const r =
|
|
586
|
+
}, l = async t => {
|
|
587
|
+
const r = v(t);
|
|
603
588
|
if ("boolean" != typeof r.isDirectory || "boolean" != typeof r.isFile) {
|
|
604
|
-
const
|
|
605
|
-
|
|
606
|
-
r.size =
|
|
589
|
+
const n = await e.stat(t);
|
|
590
|
+
n.error ? r.exists = !1 : (r.exists = !0, n.isFile ? (r.isFile = !0, r.isDirectory = !1,
|
|
591
|
+
r.size = n.size) : n.isDirectory ? (r.isFile = !1, r.isDirectory = !0, r.size = n.size) : (r.isFile = !1,
|
|
607
592
|
r.isDirectory = !1, r.size = null));
|
|
608
593
|
}
|
|
609
594
|
return {
|
|
@@ -612,82 +597,83 @@ function mockCompilerCtx(e) {
|
|
|
612
597
|
isDirectory: !!r.isDirectory,
|
|
613
598
|
size: "number" == typeof r.size ? r.size : 0
|
|
614
599
|
};
|
|
615
|
-
},
|
|
616
|
-
const r =
|
|
600
|
+
}, c = t => {
|
|
601
|
+
const r = v(t);
|
|
617
602
|
if ("boolean" != typeof r.isDirectory || "boolean" != typeof r.isFile) {
|
|
618
|
-
const
|
|
619
|
-
|
|
620
|
-
r.size =
|
|
603
|
+
const n = e.statSync(t);
|
|
604
|
+
n.error ? r.exists = !1 : (r.exists = !0, n.isFile ? (r.isFile = !0, r.isDirectory = !1,
|
|
605
|
+
r.size = n.size) : n.isDirectory ? (r.isFile = !1, r.isDirectory = !0, r.size = n.size) : (r.isFile = !1,
|
|
621
606
|
r.isDirectory = !1, r.size = null));
|
|
622
607
|
}
|
|
623
608
|
return {
|
|
624
609
|
exists: !!r.exists,
|
|
625
610
|
isFile: !!r.isFile,
|
|
626
|
-
isDirectory: !!r.isDirectory
|
|
611
|
+
isDirectory: !!r.isDirectory,
|
|
612
|
+
size: r.size
|
|
627
613
|
};
|
|
628
|
-
},
|
|
614
|
+
}, u = async (t, n, s) => {
|
|
629
615
|
if ("string" != typeof t) throw new Error(`writeFile, invalid filePath: ${t}`);
|
|
630
|
-
if ("string" != typeof
|
|
616
|
+
if ("string" != typeof n) throw new Error(`writeFile, invalid content: ${t}`);
|
|
631
617
|
const o = {
|
|
632
618
|
ignored: !1,
|
|
633
619
|
changedContent: !1,
|
|
634
620
|
queuedWrite: !1
|
|
635
621
|
};
|
|
636
622
|
if (!0 === shouldIgnore(t)) return o.ignored = !0, o;
|
|
637
|
-
const i =
|
|
623
|
+
const i = v(t);
|
|
638
624
|
if (i.exists = !0, i.isFile = !0, i.isDirectory = !1, i.queueDeleteFromDisk = !1,
|
|
639
|
-
"string" == typeof i.fileText ? o.changedContent = i.fileText.replace(/\r/g, "") !==
|
|
640
|
-
i.fileText =
|
|
641
|
-
!1 ===
|
|
642
|
-
await
|
|
643
|
-
if (o.changedContent || !0 !==
|
|
625
|
+
"string" == typeof i.fileText ? o.changedContent = i.fileText.replace(/\r/g, "") !== n.replace(/\r/g, "") : o.changedContent = !0,
|
|
626
|
+
i.fileText = n, o.queuedWrite = !1, null != s && ("string" == typeof s.outputTargetType && r.set(t, s.outputTargetType),
|
|
627
|
+
!1 === s.useCache && (i.useCache = !1)), null != s && !0 === s.inMemoryOnly) i.queueWriteToDisk ? o.queuedWrite = !0 : i.queueWriteToDisk = !1,
|
|
628
|
+
await d(t, !0); else if (null != s && !0 === s.immediateWrite) {
|
|
629
|
+
if (o.changedContent || !0 !== s.useCache) {
|
|
644
630
|
const r = await e.readFile(t);
|
|
645
631
|
"string" == typeof r && (o.changedContent = i.fileText.replace(/\r/g, "") !== r.replace(/\r/g, "")),
|
|
646
|
-
o.changedContent && (await
|
|
632
|
+
o.changedContent && (await d(t, !1), await e.writeFile(t, i.fileText));
|
|
647
633
|
}
|
|
648
634
|
} else i.queueWriteToDisk || !0 !== o.changedContent || (i.queueWriteToDisk = !0,
|
|
649
635
|
o.queuedWrite = !0);
|
|
650
636
|
return o;
|
|
651
|
-
},
|
|
637
|
+
}, d = async (e, t) => {
|
|
652
638
|
const r = [];
|
|
653
639
|
for (;"string" == typeof (e = path$2.dirname(e)) && e.length > 0 && "/" !== e && !1 === e.endsWith(":/") && !1 === e.endsWith(":\\"); ) r.push(e);
|
|
654
|
-
r.reverse(), await
|
|
655
|
-
},
|
|
656
|
-
const
|
|
657
|
-
for (const
|
|
658
|
-
const t =
|
|
640
|
+
r.reverse(), await h(r, t);
|
|
641
|
+
}, h = async (t, r) => {
|
|
642
|
+
const n = [];
|
|
643
|
+
for (const s of t) {
|
|
644
|
+
const t = v(s);
|
|
659
645
|
if (!0 !== t.exists || !0 !== t.isDirectory) try {
|
|
660
|
-
t.exists = !0, t.isDirectory = !0, t.isFile = !1, r || await e.createDir(
|
|
646
|
+
t.exists = !0, t.isDirectory = !0, t.isFile = !1, r || await e.createDir(s), n.push(s);
|
|
661
647
|
} catch (e) {}
|
|
662
648
|
}
|
|
663
|
-
return
|
|
664
|
-
},
|
|
665
|
-
const r
|
|
666
|
-
return await e.copyFile(r,
|
|
667
|
-
}))),
|
|
649
|
+
return n;
|
|
650
|
+
}, p = t => Promise.all(t.map((async t => {
|
|
651
|
+
const [r, n] = t;
|
|
652
|
+
return await e.copyFile(r, n), [ r, n ];
|
|
653
|
+
}))), f = e => Promise.all(e.map((async e => {
|
|
668
654
|
if ("string" != typeof e) throw new Error("unable to writeFile without filePath");
|
|
669
|
-
return
|
|
670
|
-
}))),
|
|
671
|
-
const r =
|
|
655
|
+
return m(e);
|
|
656
|
+
}))), m = async t => {
|
|
657
|
+
const r = v(t);
|
|
672
658
|
if (null == r.fileText) throw new Error(`unable to find item fileText to write: ${t}`);
|
|
673
|
-
return await e.writeFile(t, r.fileText), !1 === r.useCache &&
|
|
674
|
-
},
|
|
659
|
+
return await e.writeFile(t, r.fileText), !1 === r.useCache && _(t), t;
|
|
660
|
+
}, g = async t => await Promise.all(t.map((async t => {
|
|
675
661
|
if ("string" != typeof t) throw new Error("unable to unlink without filePath");
|
|
676
662
|
return await e.removeFile(t), t;
|
|
677
|
-
}))),
|
|
663
|
+
}))), y = async t => {
|
|
678
664
|
const r = [];
|
|
679
|
-
for (const
|
|
665
|
+
for (const n of t) await e.removeDir(n), r.push(n);
|
|
680
666
|
return r;
|
|
681
|
-
},
|
|
667
|
+
}, w = e => {
|
|
682
668
|
e = normalizePath(e), t.forEach(((t, r) => {
|
|
683
|
-
const
|
|
684
|
-
|
|
669
|
+
const n = path$2.relative(e, r).split("/")[0];
|
|
670
|
+
n.startsWith(".") || n.startsWith("/") || _(r);
|
|
685
671
|
}));
|
|
686
|
-
},
|
|
672
|
+
}, _ = e => {
|
|
687
673
|
e = normalizePath(e);
|
|
688
674
|
const r = t.get(e);
|
|
689
675
|
null == r || r.queueWriteToDisk || t.delete(e);
|
|
690
|
-
},
|
|
676
|
+
}, v = e => {
|
|
691
677
|
e = normalizePath(e);
|
|
692
678
|
let r = t.get(e);
|
|
693
679
|
return null != r || t.set(e, r = {
|
|
@@ -702,45 +688,45 @@ function mockCompilerCtx(e) {
|
|
|
702
688
|
queueWriteToDisk: null,
|
|
703
689
|
useCache: null
|
|
704
690
|
}), r;
|
|
705
|
-
},
|
|
691
|
+
}, b = 5242880;
|
|
706
692
|
return {
|
|
707
|
-
access: async e =>
|
|
693
|
+
access: async e => {
|
|
694
|
+
const t = v(e);
|
|
695
|
+
return "boolean" != typeof t.exists ? (await l(e)).exists : t.exists;
|
|
696
|
+
},
|
|
708
697
|
accessSync: e => {
|
|
709
|
-
const t =
|
|
710
|
-
|
|
711
|
-
const r = u(e);
|
|
712
|
-
t.exists = r.exists, t.isDirectory = r.isDirectory, t.isFile = r.isFile;
|
|
713
|
-
}
|
|
714
|
-
return t.exists;
|
|
698
|
+
const t = v(e);
|
|
699
|
+
return "boolean" != typeof t.exists ? c(e).exists : t.exists;
|
|
715
700
|
},
|
|
716
|
-
accessData: s,
|
|
717
701
|
cancelDeleteDirectoriesFromDisk: e => {
|
|
718
702
|
for (const t of e) {
|
|
719
|
-
const e =
|
|
703
|
+
const e = v(t);
|
|
720
704
|
!0 === e.queueDeleteFromDisk && (e.queueDeleteFromDisk = !1);
|
|
721
705
|
}
|
|
722
706
|
},
|
|
723
707
|
cancelDeleteFilesFromDisk: e => {
|
|
724
708
|
for (const t of e) {
|
|
725
|
-
const e =
|
|
709
|
+
const e = v(t);
|
|
726
710
|
!0 === e.isFile && !0 === e.queueDeleteFromDisk && (e.queueDeleteFromDisk = !1);
|
|
727
711
|
}
|
|
728
712
|
},
|
|
729
|
-
clearCache: () =>
|
|
730
|
-
|
|
731
|
-
|
|
713
|
+
clearCache: () => {
|
|
714
|
+
t.clear();
|
|
715
|
+
},
|
|
716
|
+
clearDirCache: w,
|
|
717
|
+
clearFileCache: _,
|
|
732
718
|
commit: async () => {
|
|
733
|
-
const e = getCommitInstructions(t), r = await
|
|
734
|
-
return e.filesToDelete.forEach(
|
|
735
|
-
filesCopied:
|
|
736
|
-
filesWritten:
|
|
719
|
+
const e = getCommitInstructions(t), r = await h(e.dirsToEnsure, !1), n = await f(e.filesToWrite), s = await p(e.filesToCopy), o = await g(e.filesToDelete), i = await y(e.dirsToDelete);
|
|
720
|
+
return e.filesToDelete.forEach(_), e.dirsToDelete.forEach(w), {
|
|
721
|
+
filesCopied: s,
|
|
722
|
+
filesWritten: n,
|
|
737
723
|
filesDeleted: o,
|
|
738
724
|
dirsDeleted: i,
|
|
739
725
|
dirsAdded: r
|
|
740
726
|
};
|
|
741
727
|
},
|
|
742
728
|
copyFile: async (e, t) => {
|
|
743
|
-
|
|
729
|
+
v(e).queueCopyFileToDest = t;
|
|
744
730
|
},
|
|
745
731
|
emptyDirs: async e => {
|
|
746
732
|
e = e.filter(isString).map(normalizePath).reduce(((e, t) => (e.includes(t) || e.push(t),
|
|
@@ -750,59 +736,58 @@ function mockCompilerCtx(e) {
|
|
|
750
736
|
})))), r = [];
|
|
751
737
|
for (const e of t) for (const t of e) r.includes(t.absPath) || r.push(t.absPath);
|
|
752
738
|
r.sort(((e, t) => {
|
|
753
|
-
const r = e.split("/").length,
|
|
754
|
-
return r <
|
|
755
|
-
})), await Promise.all(r.map(
|
|
756
|
-
const t =
|
|
739
|
+
const r = e.split("/").length, n = t.split("/").length;
|
|
740
|
+
return r < n ? 1 : r > n ? -1 : 0;
|
|
741
|
+
})), await Promise.all(r.map(a)), e.forEach((e => {
|
|
742
|
+
const t = v(e);
|
|
757
743
|
t.isFile = !1, t.isDirectory = !0, t.queueWriteToDisk = !0, t.queueDeleteFromDisk = !1;
|
|
758
744
|
}));
|
|
759
745
|
},
|
|
760
746
|
getBuildOutputs: () => {
|
|
761
747
|
const e = [];
|
|
762
748
|
return r.forEach(((t, r) => {
|
|
763
|
-
const
|
|
764
|
-
|
|
749
|
+
const n = e.find((e => e.type === t));
|
|
750
|
+
n ? n.files.push(r) : e.push({
|
|
765
751
|
type: t,
|
|
766
752
|
files: [ r ]
|
|
767
753
|
});
|
|
768
754
|
})), e.forEach((e => e.files.sort())), e.sort(((e, t) => e.type < t.type ? -1 : e.type > t.type ? 1 : 0));
|
|
769
755
|
},
|
|
770
|
-
getItem:
|
|
756
|
+
getItem: v,
|
|
771
757
|
getMemoryStats: () => `data length: ${t.size}`,
|
|
772
|
-
keys: () => Array.from(t.keys()).sort(),
|
|
773
758
|
readFile: async (t, r) => {
|
|
774
759
|
if (null == r || !0 === r.useCache || void 0 === r.useCache) {
|
|
775
|
-
const e =
|
|
760
|
+
const e = v(t);
|
|
776
761
|
if (e.exists && "string" == typeof e.fileText) return e.fileText;
|
|
777
762
|
}
|
|
778
|
-
const
|
|
779
|
-
return "string" == typeof
|
|
780
|
-
|
|
763
|
+
const n = await e.readFile(t), s = v(t);
|
|
764
|
+
return "string" == typeof n ? n.length < b && (s.exists = !0, s.isFile = !0, s.isDirectory = !1,
|
|
765
|
+
s.fileText = n) : s.exists = !1, n;
|
|
781
766
|
},
|
|
782
767
|
readFileSync: (t, r) => {
|
|
783
768
|
if (null == r || !0 === r.useCache || void 0 === r.useCache) {
|
|
784
|
-
const e =
|
|
769
|
+
const e = v(t);
|
|
785
770
|
if (e.exists && "string" == typeof e.fileText) return e.fileText;
|
|
786
771
|
}
|
|
787
|
-
const
|
|
788
|
-
return "string" == typeof
|
|
789
|
-
|
|
772
|
+
const n = e.readFileSync(t), s = v(t);
|
|
773
|
+
return "string" == typeof n ? n.length < b && (s.exists = !0, s.isFile = !0, s.isDirectory = !1,
|
|
774
|
+
s.fileText = n) : s.exists = !1, n;
|
|
790
775
|
},
|
|
791
776
|
readdir: n,
|
|
792
777
|
remove: async e => {
|
|
793
|
-
const t = await
|
|
794
|
-
!0 === t.isDirectory ? await
|
|
778
|
+
const t = await l(e);
|
|
779
|
+
!0 === t.isDirectory ? await i(e) : !0 === t.isFile && await a(e);
|
|
795
780
|
},
|
|
796
|
-
stat:
|
|
797
|
-
statSync:
|
|
781
|
+
stat: l,
|
|
782
|
+
statSync: c,
|
|
798
783
|
sys: e,
|
|
799
|
-
writeFile:
|
|
784
|
+
writeFile: u,
|
|
800
785
|
writeFiles: (e, t) => {
|
|
801
786
|
const r = [];
|
|
802
|
-
return isIterable(e) ? e.forEach(((e,
|
|
803
|
-
r.push(
|
|
804
|
-
})) : Object.keys(e).map((
|
|
805
|
-
r.push(
|
|
787
|
+
return isIterable(e) ? e.forEach(((e, n) => {
|
|
788
|
+
r.push(u(n, e, t));
|
|
789
|
+
})) : Object.keys(e).map((n => {
|
|
790
|
+
r.push(u(n, e[n], t));
|
|
806
791
|
})), Promise.all(r);
|
|
807
792
|
}
|
|
808
793
|
};
|
|
@@ -825,14 +810,14 @@ function mockLogger() {
|
|
|
825
810
|
|
|
826
811
|
function findRootComponent(e, t) {
|
|
827
812
|
if (null != t) {
|
|
828
|
-
const r = t.children,
|
|
829
|
-
for (let t = 0; t <
|
|
830
|
-
const
|
|
831
|
-
if (e.has(
|
|
813
|
+
const r = t.children, n = r.length;
|
|
814
|
+
for (let t = 0; t < n; t++) {
|
|
815
|
+
const n = r[t];
|
|
816
|
+
if (e.has(n.nodeName.toLowerCase())) return n;
|
|
832
817
|
}
|
|
833
|
-
for (let t = 0; t <
|
|
834
|
-
const
|
|
835
|
-
if (null !=
|
|
818
|
+
for (let t = 0; t < n; t++) {
|
|
819
|
+
const n = findRootComponent(e, r[t]);
|
|
820
|
+
if (null != n) return n;
|
|
836
821
|
}
|
|
837
822
|
}
|
|
838
823
|
return null;
|
|
@@ -841,55 +826,55 @@ function findRootComponent(e, t) {
|
|
|
841
826
|
async function initPageEvents(e) {
|
|
842
827
|
e._e2eEvents = new Map, e._e2eEventIds = 0, e.spyOnEvent = pageSpyOnEvent.bind(e, e),
|
|
843
828
|
await e.exposeFunction("rindoOnEvent", ((t, r) => {
|
|
844
|
-
!function
|
|
845
|
-
const
|
|
846
|
-
|
|
829
|
+
!function n(e, t, r) {
|
|
830
|
+
const n = e.get(t);
|
|
831
|
+
n && n.callback(r);
|
|
847
832
|
}(e._e2eEvents, t, r);
|
|
848
833
|
})), await e.evaluateOnNewDocument(browserContextEvents);
|
|
849
834
|
}
|
|
850
835
|
|
|
851
836
|
async function pageSpyOnEvent(e, t, r) {
|
|
852
|
-
const
|
|
837
|
+
const n = new EventSpy(t), s = "document" !== r ? () => window : () => document, o = await e.evaluateHandle(s);
|
|
853
838
|
return await addE2EListener(e, o, t, (e => {
|
|
854
|
-
|
|
855
|
-
})),
|
|
839
|
+
n.push(e);
|
|
840
|
+
})), n;
|
|
856
841
|
}
|
|
857
842
|
|
|
858
843
|
async function waitForEvent(e, t, r) {
|
|
859
|
-
const
|
|
844
|
+
const n = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, s = await e.evaluate(((e, t, r) => new Promise(((n, s) => {
|
|
860
845
|
const o = setTimeout((() => {
|
|
861
|
-
|
|
846
|
+
s(new Error(`waitForEvent() timeout, eventName: ${t}`));
|
|
862
847
|
}), r);
|
|
863
848
|
e.addEventListener(t, (e => {
|
|
864
|
-
clearTimeout(o),
|
|
849
|
+
clearTimeout(o), n(window.rindoSerializeEvent(e));
|
|
865
850
|
}), {
|
|
866
851
|
once: !0
|
|
867
852
|
});
|
|
868
|
-
}))), r, t,
|
|
869
|
-
return await e.waitForChanges(),
|
|
853
|
+
}))), r, t, n);
|
|
854
|
+
return await e.waitForChanges(), s;
|
|
870
855
|
}
|
|
871
856
|
|
|
872
|
-
async function addE2EListener(e, t, r,
|
|
873
|
-
const
|
|
874
|
-
e._e2eEvents.set(
|
|
857
|
+
async function addE2EListener(e, t, r, n) {
|
|
858
|
+
const s = e._e2eEventIds++;
|
|
859
|
+
e._e2eEvents.set(s, {
|
|
875
860
|
eventName: r,
|
|
876
|
-
callback:
|
|
861
|
+
callback: n
|
|
877
862
|
});
|
|
878
863
|
const o = t.executionContext();
|
|
879
864
|
await o.evaluate(((e, t, r) => {
|
|
880
865
|
e.addEventListener(r, (e => {
|
|
881
866
|
window.rindoOnEvent(t, window.rindoSerializeEvent(e));
|
|
882
867
|
}));
|
|
883
|
-
}), t,
|
|
868
|
+
}), t, s, r);
|
|
884
869
|
}
|
|
885
870
|
|
|
886
871
|
function browserContextEvents() {
|
|
887
872
|
const e = () => {
|
|
888
873
|
const e = [], t = (e, r) => {
|
|
889
|
-
if (null != r && 1 === r.nodeType) for (let
|
|
890
|
-
const
|
|
891
|
-
|
|
892
|
-
t(e,
|
|
874
|
+
if (null != r && 1 === r.nodeType) for (let n = 0; n < r.children.length; n++) {
|
|
875
|
+
const s = r.children[n];
|
|
876
|
+
s.tagName.includes("-") && "function" == typeof s.componentOnReady && e.push(s.componentOnReady()),
|
|
877
|
+
t(e, s);
|
|
893
878
|
}
|
|
894
879
|
};
|
|
895
880
|
return t(e, window.document.documentElement), Promise.all(e).catch((e => console.error(e)));
|
|
@@ -932,62 +917,62 @@ function browserContextEvents() {
|
|
|
932
917
|
}
|
|
933
918
|
|
|
934
919
|
async function find(e, t, r) {
|
|
935
|
-
const {lightSelector:
|
|
920
|
+
const {lightSelector: n, shadowSelector: s, text: o, contains: i} = getSelector(r);
|
|
936
921
|
let a;
|
|
937
|
-
if (a = "string" == typeof
|
|
938
|
-
let
|
|
939
|
-
if (!
|
|
940
|
-
if (
|
|
922
|
+
if (a = "string" == typeof n ? await async function l(e, t, r, n) {
|
|
923
|
+
let s = await t.$(r);
|
|
924
|
+
if (!s) return null;
|
|
925
|
+
if (n) {
|
|
941
926
|
const t = await e.evaluateHandle(((e, t) => {
|
|
942
927
|
if (!e.shadowRoot) throw new Error(`shadow root does not exist for element: ${e.tagName.toLowerCase()}`);
|
|
943
928
|
return e.shadowRoot.querySelector(t);
|
|
944
|
-
}),
|
|
945
|
-
if (await
|
|
946
|
-
|
|
929
|
+
}), s, n);
|
|
930
|
+
if (await s.dispose(), !t) return null;
|
|
931
|
+
s = t.asElement();
|
|
947
932
|
}
|
|
948
|
-
return
|
|
949
|
-
}(e, t,
|
|
950
|
-
const
|
|
951
|
-
let
|
|
952
|
-
return function e(
|
|
953
|
-
if (
|
|
954
|
-
if ("string" == typeof t &&
|
|
955
|
-
if ("string" == typeof r &&
|
|
933
|
+
return s;
|
|
934
|
+
}(e, t, n, s) : await async function c(e, t, r, n) {
|
|
935
|
+
const s = await e.evaluateHandle(((e, t, r) => {
|
|
936
|
+
let n = null;
|
|
937
|
+
return function e(s) {
|
|
938
|
+
if (s && !n) if (3 === s.nodeType) {
|
|
939
|
+
if ("string" == typeof t && s.textContent.trim() === t) return void (n = s.parentElement);
|
|
940
|
+
if ("string" == typeof r && s.textContent.includes(r)) return void (n = s.parentElement);
|
|
956
941
|
} else {
|
|
957
|
-
if ("SCRIPT" ===
|
|
958
|
-
if (e(
|
|
942
|
+
if ("SCRIPT" === s.nodeName || "STYLE" === s.nodeName) return;
|
|
943
|
+
if (e(s.shadowRoot), s.childNodes) for (let t = 0; t < s.childNodes.length; t++) e(s.childNodes[t]);
|
|
959
944
|
}
|
|
960
|
-
}(e),
|
|
961
|
-
}), t, r,
|
|
962
|
-
return
|
|
945
|
+
}(e), n;
|
|
946
|
+
}), t, r, n);
|
|
947
|
+
return s ? s.asElement() : null;
|
|
963
948
|
}(e, t, o, i), !a) return null;
|
|
964
949
|
const u = new E2EElement(e, a);
|
|
965
950
|
return await u.e2eSync(), u;
|
|
966
951
|
}
|
|
967
952
|
|
|
968
953
|
async function findAll(e, t, r) {
|
|
969
|
-
const
|
|
970
|
-
if (0 === i.length) return
|
|
954
|
+
const n = [], {lightSelector: s, shadowSelector: o} = getSelector(r), i = await t.$$(s);
|
|
955
|
+
if (0 === i.length) return n;
|
|
971
956
|
if (o) for (let t = 0; t < i.length; t++) {
|
|
972
|
-
const r = i[t].executionContext(),
|
|
957
|
+
const r = i[t].executionContext(), s = await r.evaluateHandle(((e, t) => {
|
|
973
958
|
if (!e.shadowRoot) throw new Error(`shadow root does not exist for element: ${e.tagName.toLowerCase()}`);
|
|
974
959
|
return e.shadowRoot.querySelectorAll(t);
|
|
975
960
|
}), i[t], o);
|
|
976
961
|
await i[t].dispose();
|
|
977
|
-
const a = await
|
|
978
|
-
await
|
|
962
|
+
const a = await s.getProperties();
|
|
963
|
+
await s.dispose();
|
|
979
964
|
for (const t of a.values()) {
|
|
980
965
|
const r = t.asElement();
|
|
981
966
|
if (r) {
|
|
982
967
|
const t = new E2EElement(e, r);
|
|
983
|
-
await t.e2eSync(),
|
|
968
|
+
await t.e2eSync(), n.push(t);
|
|
984
969
|
}
|
|
985
970
|
}
|
|
986
971
|
} else for (let t = 0; t < i.length; t++) {
|
|
987
972
|
const r = new E2EElement(e, i[t]);
|
|
988
|
-
await r.e2eSync(),
|
|
973
|
+
await r.e2eSync(), n.push(r);
|
|
989
974
|
}
|
|
990
|
-
return
|
|
975
|
+
return n;
|
|
991
976
|
}
|
|
992
977
|
|
|
993
978
|
function getSelector(e) {
|
|
@@ -1008,22 +993,22 @@ function getSelector(e) {
|
|
|
1008
993
|
}
|
|
1009
994
|
|
|
1010
995
|
async function writeScreenshotData(e, t) {
|
|
1011
|
-
const r = function
|
|
996
|
+
const r = function n(e, t) {
|
|
1012
997
|
const r = `${t}.json`;
|
|
1013
998
|
return path__default.default.join(e, r);
|
|
1014
|
-
}(e, t.id),
|
|
1015
|
-
await writeFile(r,
|
|
999
|
+
}(e, t.id), s = JSON.stringify(t, null, 2);
|
|
1000
|
+
await writeFile(r, s);
|
|
1016
1001
|
}
|
|
1017
1002
|
|
|
1018
1003
|
function writeFile(e, t) {
|
|
1019
|
-
return new Promise(((r,
|
|
1004
|
+
return new Promise(((r, n) => {
|
|
1020
1005
|
fs__default.default.writeFile(e, t, (e => {
|
|
1021
|
-
e ?
|
|
1006
|
+
e ? n(e) : r();
|
|
1022
1007
|
}));
|
|
1023
1008
|
}));
|
|
1024
1009
|
}
|
|
1025
1010
|
|
|
1026
|
-
async function compareScreenshot(e, t, r,
|
|
1011
|
+
async function compareScreenshot(e, t, r, n, s, o, i, a) {
|
|
1027
1012
|
const l = `${crypto$3.createHash("md5").update(r).digest("hex")}.png`, c = path$2.join(t.imagesDir, l);
|
|
1028
1013
|
await async function u(e, t) {
|
|
1029
1014
|
await function r(e) {
|
|
@@ -1038,14 +1023,14 @@ async function compareScreenshot(e, t, r, s, n, o, i, a) {
|
|
|
1038
1023
|
return r.update(t + ":"), r.update(e.userAgent + ":"), r.update(e.viewport.width + ":"),
|
|
1039
1024
|
r.update(e.viewport.height + ":"), r.update(e.viewport.deviceScaleFactor + ":"),
|
|
1040
1025
|
r.update(e.viewport.hasTouch + ":"), r.update(e.viewport.isMobile + ":"), r.digest("hex").slice(0, 8).toLowerCase();
|
|
1041
|
-
}(e,
|
|
1026
|
+
}(e, n), p = {
|
|
1042
1027
|
id: d,
|
|
1043
1028
|
image: l,
|
|
1044
1029
|
device: e.device,
|
|
1045
1030
|
userAgent: e.userAgent,
|
|
1046
|
-
desc:
|
|
1031
|
+
desc: n,
|
|
1047
1032
|
testPath: i,
|
|
1048
|
-
width:
|
|
1033
|
+
width: s,
|
|
1049
1034
|
height: o,
|
|
1050
1035
|
deviceScaleFactor: e.viewport.deviceScaleFactor,
|
|
1051
1036
|
hasTouch: e.viewport.hasTouch,
|
|
@@ -1053,13 +1038,13 @@ async function compareScreenshot(e, t, r, s, n, o, i, a) {
|
|
|
1053
1038
|
isMobile: e.viewport.isMobile,
|
|
1054
1039
|
diff: {
|
|
1055
1040
|
id: d,
|
|
1056
|
-
desc:
|
|
1041
|
+
desc: n,
|
|
1057
1042
|
imageA: l,
|
|
1058
1043
|
imageB: l,
|
|
1059
1044
|
mismatchedPixels: 0,
|
|
1060
1045
|
device: e.device,
|
|
1061
1046
|
userAgent: e.userAgent,
|
|
1062
|
-
width:
|
|
1047
|
+
width: s,
|
|
1063
1048
|
height: o,
|
|
1064
1049
|
deviceScaleFactor: e.viewport.deviceScaleFactor,
|
|
1065
1050
|
hasTouch: e.viewport.hasTouch,
|
|
@@ -1075,40 +1060,40 @@ async function compareScreenshot(e, t, r, s, n, o, i, a) {
|
|
|
1075
1060
|
if (!f) return await writeScreenshotData(t.currentBuildDir, p), p.diff;
|
|
1076
1061
|
if (p.diff.imageA = f, p.diff.imageA !== p.diff.imageB) {
|
|
1077
1062
|
p.diff.cacheKey = function m(e, t, r) {
|
|
1078
|
-
const
|
|
1079
|
-
return
|
|
1063
|
+
const n = crypto$3.createHash("md5");
|
|
1064
|
+
return n.update(`${e}:${t}:${r}`), n.digest("hex").slice(0, 10);
|
|
1080
1065
|
}(p.diff.imageA, p.diff.imageB, a);
|
|
1081
1066
|
const r = t.cache[p.diff.cacheKey];
|
|
1082
1067
|
if ("number" != typeof r || isNaN(r)) {
|
|
1083
|
-
const r = Math.round(e.viewport.width * e.viewport.deviceScaleFactor),
|
|
1068
|
+
const r = Math.round(e.viewport.width * e.viewport.deviceScaleFactor), n = Math.round(e.viewport.height * e.viewport.deviceScaleFactor), s = {
|
|
1084
1069
|
imageAPath: path$2.join(t.imagesDir, p.diff.imageA),
|
|
1085
1070
|
imageBPath: path$2.join(t.imagesDir, p.diff.imageB),
|
|
1086
1071
|
width: r,
|
|
1087
|
-
height:
|
|
1072
|
+
height: n,
|
|
1088
1073
|
pixelmatchThreshold: a
|
|
1089
1074
|
};
|
|
1090
1075
|
p.diff.mismatchedPixels = await async function g(e, t) {
|
|
1091
|
-
return new Promise(((r,
|
|
1092
|
-
const
|
|
1093
|
-
|
|
1094
|
-
}),
|
|
1076
|
+
return new Promise(((r, n) => {
|
|
1077
|
+
const s = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, o = setTimeout((() => {
|
|
1078
|
+
n(`getMismatchedPixels timeout: ${s}ms`);
|
|
1079
|
+
}), s);
|
|
1095
1080
|
try {
|
|
1096
|
-
const
|
|
1081
|
+
const s = {
|
|
1097
1082
|
execArgv: process.execArgv.filter((e => !/^--(debug|inspect)/.test(e))),
|
|
1098
1083
|
env: process.env,
|
|
1099
1084
|
cwd: process.cwd(),
|
|
1100
1085
|
stdio: [ "pipe", "pipe", "pipe", "ipc" ]
|
|
1101
|
-
}, i = child_process$2.fork(e, [],
|
|
1086
|
+
}, i = child_process$2.fork(e, [], s);
|
|
1102
1087
|
i.on("message", (e => {
|
|
1103
1088
|
i.kill(), clearTimeout(o), r(e);
|
|
1104
1089
|
})), i.on("error", (e => {
|
|
1105
|
-
clearTimeout(o),
|
|
1090
|
+
clearTimeout(o), n(e);
|
|
1106
1091
|
})), i.send(t);
|
|
1107
1092
|
} catch (e) {
|
|
1108
|
-
clearTimeout(o),
|
|
1093
|
+
clearTimeout(o), n(`getMismatchedPixels error: ${e}`);
|
|
1109
1094
|
}
|
|
1110
1095
|
}));
|
|
1111
|
-
}(t.pixelmatchModulePath,
|
|
1096
|
+
}(t.pixelmatchModulePath, s);
|
|
1112
1097
|
} else p.diff.mismatchedPixels = r;
|
|
1113
1098
|
}
|
|
1114
1099
|
return await writeScreenshotData(t.currentBuildDir, p), p.diff;
|
|
@@ -1118,11 +1103,11 @@ async function e2eGoTo(e, t, r = {}) {
|
|
|
1118
1103
|
if (e.isClosed()) throw new Error("e2eGoTo unavailable: page already closed");
|
|
1119
1104
|
if ("string" != typeof t) throw new Error("invalid gotoTest() url");
|
|
1120
1105
|
if (!t.startsWith("/")) throw new Error("gotoTest() url must start with /");
|
|
1121
|
-
const
|
|
1122
|
-
if ("string" != typeof
|
|
1123
|
-
const
|
|
1106
|
+
const n = env.__RINDO_BROWSER_URL__;
|
|
1107
|
+
if ("string" != typeof n) throw new Error("invalid gotoTest() browser url");
|
|
1108
|
+
const s = n + t.substring(1);
|
|
1124
1109
|
r.waitUntil || (r.waitUntil = env.__RINDO_BROWSER_WAIT_UNTIL);
|
|
1125
|
-
const o = await e._e2eGoto(
|
|
1110
|
+
const o = await e._e2eGoto(s, r);
|
|
1126
1111
|
if (!o.ok()) throw new Error(`Testing unable to load ${t}, HTTP status: ${o.status()}`);
|
|
1127
1112
|
return await waitForRindo(e, r), o;
|
|
1128
1113
|
}
|
|
@@ -1130,18 +1115,18 @@ async function e2eGoTo(e, t, r = {}) {
|
|
|
1130
1115
|
async function e2eSetContent(e, t, r = {}) {
|
|
1131
1116
|
if (e.isClosed()) throw new Error("e2eSetContent unavailable: page already closed");
|
|
1132
1117
|
if ("string" != typeof t) throw new Error("invalid e2eSetContent() html");
|
|
1133
|
-
const
|
|
1134
|
-
if ("string" != typeof
|
|
1135
|
-
|
|
1118
|
+
const n = [], s = env.__RINDO_APP_SCRIPT_URL__;
|
|
1119
|
+
if ("string" != typeof s) throw new Error("invalid e2eSetContent() app script url");
|
|
1120
|
+
n.push("<!doctype html>"), n.push("<html>"), n.push("<head>");
|
|
1136
1121
|
const o = env.__RINDO_APP_STYLE_URL__;
|
|
1137
|
-
"string" == typeof o &&
|
|
1138
|
-
|
|
1122
|
+
"string" == typeof o && n.push(`<link rel="stylesheet" href="${o}">`), n.push(`<script type="module" src="${s}"><\/script>`),
|
|
1123
|
+
n.push("</head>"), n.push("<body>"), n.push(t), n.push("</body>"), n.push("</html>");
|
|
1139
1124
|
const i = env.__RINDO_BROWSER_URL__;
|
|
1140
1125
|
await e.setRequestInterception(!0), e.on("request", (e => {
|
|
1141
1126
|
i === e.url() ? e.respond({
|
|
1142
1127
|
status: 200,
|
|
1143
1128
|
contentType: "text/html",
|
|
1144
|
-
body:
|
|
1129
|
+
body: n.join("\n")
|
|
1145
1130
|
}) : e.continue();
|
|
1146
1131
|
})), r.waitUntil || (r.waitUntil = env.__RINDO_BROWSER_WAIT_UNTIL);
|
|
1147
1132
|
const a = await e._e2eGoto(i, r);
|
|
@@ -1169,11 +1154,11 @@ async function waitForChanges(e) {
|
|
|
1169
1154
|
const t = [], r = (e, t) => {
|
|
1170
1155
|
if (null != e) {
|
|
1171
1156
|
"shadowRoot" in e && e.shadowRoot instanceof ShadowRoot && r(e.shadowRoot, t);
|
|
1172
|
-
const
|
|
1173
|
-
for (let e = 0; e <
|
|
1174
|
-
const
|
|
1175
|
-
null !=
|
|
1176
|
-
r(
|
|
1157
|
+
const n = e.children, s = n.length;
|
|
1158
|
+
for (let e = 0; e < s; e++) {
|
|
1159
|
+
const s = n[e];
|
|
1160
|
+
null != s && (s.tagName.includes("-") && "function" == typeof s.componentOnReady && t.push(s.componentOnReady()),
|
|
1161
|
+
r(s, t));
|
|
1177
1162
|
}
|
|
1178
1163
|
}
|
|
1179
1164
|
};
|
|
@@ -1252,21 +1237,21 @@ const path$2 = require("path"), index_js = _lazyRequire("../dev-server/index.js"
|
|
|
1252
1237
|
}, noop = () => {}, isFunction = e => "function" == typeof e, isString = e => "string" == typeof e, isIterable = e => (e => null != e)(e) && isFunction(e[Symbol.iterator]), windowsPathRegex = /^(?:[a-zA-Z]:|[\\/]{2}[^\\/]+[\\/]+[^\\/]+)?[\\/]$/, hasError = e => null != e && 0 !== e.length && e.some((e => "error" === e.level && "runtime" !== e.type)), normalizePath = e => {
|
|
1253
1238
|
if ("string" != typeof e) throw new Error("invalid path to normalize");
|
|
1254
1239
|
e = normalizeSlashes(e.trim());
|
|
1255
|
-
const t = pathComponents(e, getRootLength(e)), r = reducePathComponents(t),
|
|
1256
|
-
return "" === o ? "." : "" ===
|
|
1240
|
+
const t = pathComponents(e, getRootLength(e)), r = reducePathComponents(t), n = r[0], s = r[1], o = n + r.slice(1).join("/");
|
|
1241
|
+
return "" === o ? "." : "" === n && s && e.includes("/") && !s.startsWith(".") && !s.startsWith("@") ? "./" + o : o;
|
|
1257
1242
|
}, normalizeSlashes = e => e.replace(backslashRegExp, "/"), backslashRegExp = /\\/g, reducePathComponents = e => {
|
|
1258
1243
|
if (!Array.isArray(e) || 0 === e.length) return [];
|
|
1259
1244
|
const t = [ e[0] ];
|
|
1260
1245
|
for (let r = 1; r < e.length; r++) {
|
|
1261
|
-
const
|
|
1262
|
-
if (
|
|
1263
|
-
if (".." ===
|
|
1246
|
+
const n = e[r];
|
|
1247
|
+
if (n && "." !== n) {
|
|
1248
|
+
if (".." === n) if (t.length > 1) {
|
|
1264
1249
|
if (".." !== t[t.length - 1]) {
|
|
1265
1250
|
t.pop();
|
|
1266
1251
|
continue;
|
|
1267
1252
|
}
|
|
1268
1253
|
} else if (t[0]) continue;
|
|
1269
|
-
t.push(
|
|
1254
|
+
t.push(n);
|
|
1270
1255
|
}
|
|
1271
1256
|
}
|
|
1272
1257
|
return t;
|
|
@@ -1288,17 +1273,17 @@ const path$2 = require("path"), index_js = _lazyRequire("../dev-server/index.js"
|
|
|
1288
1273
|
}
|
|
1289
1274
|
const r = e.indexOf("://");
|
|
1290
1275
|
if (-1 !== r) {
|
|
1291
|
-
const t = r + "://".length,
|
|
1292
|
-
if (-1 !==
|
|
1293
|
-
const
|
|
1294
|
-
if ("file" ===
|
|
1295
|
-
const t = getFileUrlVolumeSeparatorEnd(e,
|
|
1276
|
+
const t = r + "://".length, n = e.indexOf("/", t);
|
|
1277
|
+
if (-1 !== n) {
|
|
1278
|
+
const s = e.slice(0, r), o = e.slice(t, n);
|
|
1279
|
+
if ("file" === s && ("" === o || "localhost" === o) && isVolumeCharacter(e.charCodeAt(n + 1))) {
|
|
1280
|
+
const t = getFileUrlVolumeSeparatorEnd(e, n + 2);
|
|
1296
1281
|
if (-1 !== t) {
|
|
1297
1282
|
if (47 === e.charCodeAt(t)) return ~(t + 1);
|
|
1298
1283
|
if (t === e.length) return ~t;
|
|
1299
1284
|
}
|
|
1300
1285
|
}
|
|
1301
|
-
return ~(
|
|
1286
|
+
return ~(n + 1);
|
|
1302
1287
|
}
|
|
1303
1288
|
return ~e.length;
|
|
1304
1289
|
}
|
|
@@ -1312,40 +1297,40 @@ const path$2 = require("path"), index_js = _lazyRequire("../dev-server/index.js"
|
|
|
1312
1297
|
}
|
|
1313
1298
|
return -1;
|
|
1314
1299
|
}, pathComponents = (e, t) => {
|
|
1315
|
-
const r = e.substring(0, t),
|
|
1316
|
-
return
|
|
1300
|
+
const r = e.substring(0, t), n = e.substring(t).split("/"), s = n.length;
|
|
1301
|
+
return s > 0 && !n[s - 1] && n.pop(), [ r, ...n ];
|
|
1317
1302
|
}, normalizeFsPath = e => normalizePath(e.split("?")[0].replace(/\0/g, "")), flattenDiagnosticMessageText = (e, t) => {
|
|
1318
1303
|
if ("string" == typeof t) return t;
|
|
1319
1304
|
if (void 0 === t) return "";
|
|
1320
|
-
const r = [],
|
|
1321
|
-
|
|
1322
|
-
let
|
|
1323
|
-
if (!r.includes(t.code) && (
|
|
1324
|
-
return
|
|
1325
|
-
|
|
1305
|
+
const r = [], n = e.file.fileName.includes("rindo.config");
|
|
1306
|
+
n && r.push(2322);
|
|
1307
|
+
let s = "";
|
|
1308
|
+
if (!r.includes(t.code) && (s = t.messageText, isIterable(t.next))) for (const r of t.next) s += flattenDiagnosticMessageText(e, r);
|
|
1309
|
+
return n && (s = s.replace("type 'RindoConfig'", "Rindo Config"), s = s.replace("Object literal may only specify known properties, but ", ""),
|
|
1310
|
+
s = s.replace("Object literal may only specify known properties, and ", "")), s.trim();
|
|
1326
1311
|
}, isOutputTargetDistLazy = e => e.type === DIST_LAZY, isOutputTargetWww = e => e.type === WWW, DIST_LAZY = "dist-lazy", WWW = "www", isJest27TransformOptions = e => null != e && "object" == typeof e && e.hasOwnProperty("config");
|
|
1327
1312
|
|
|
1328
1313
|
let _tsCompilerOptions = null, _tsCompilerOptionsKey = null;
|
|
1329
1314
|
|
|
1330
1315
|
const jestPreprocessor = {
|
|
1331
|
-
process(e, t, r,
|
|
1332
|
-
if (isJest27TransformOptions(r) && (
|
|
1333
|
-
if (function
|
|
1316
|
+
process(e, t, r, n) {
|
|
1317
|
+
if (isJest27TransformOptions(r) && (n = r.config), !n) throw "Unable to find Jest transformation options.";
|
|
1318
|
+
if (function s(e, t) {
|
|
1334
1319
|
var r;
|
|
1335
|
-
const
|
|
1336
|
-
if ("ts" ===
|
|
1337
|
-
if ("mjs" ===
|
|
1338
|
-
if ("js" ===
|
|
1320
|
+
const n = (null !== (r = e.split(".").pop()) && void 0 !== r ? r : "").toLowerCase().split("?")[0];
|
|
1321
|
+
if ("ts" === n || "tsx" === n || "jsx" === n) return !0;
|
|
1322
|
+
if ("mjs" === n) return !0;
|
|
1323
|
+
if ("js" === n) {
|
|
1339
1324
|
if (t.includes("import ") || t.includes("import.") || t.includes("import(")) return !0;
|
|
1340
1325
|
if (t.includes("export ")) return !0;
|
|
1341
1326
|
}
|
|
1342
|
-
return "css" ===
|
|
1327
|
+
return "css" === n;
|
|
1343
1328
|
}(t, e)) {
|
|
1344
1329
|
const r = {
|
|
1345
1330
|
file: t,
|
|
1346
|
-
currentDirectory:
|
|
1347
|
-
},
|
|
1348
|
-
|
|
1331
|
+
currentDirectory: n.rootDir
|
|
1332
|
+
}, s = getCompilerOptions(n.rootDir);
|
|
1333
|
+
s && (s.baseUrl && (r.baseUrl = s.baseUrl), s.paths && (r.paths = s.paths));
|
|
1349
1334
|
const o = transpile(e, r), i = o.diagnostics.some((e => "error" === e.level));
|
|
1350
1335
|
if (o.diagnostics && i) {
|
|
1351
1336
|
const e = o.diagnostics.map(formatDiagnostic).join("\n\n");
|
|
@@ -1355,25 +1340,25 @@ const jestPreprocessor = {
|
|
|
1355
1340
|
}
|
|
1356
1341
|
return e;
|
|
1357
1342
|
},
|
|
1358
|
-
getCacheKey(e, t, r,
|
|
1359
|
-
if (isJest27TransformOptions(r) && (
|
|
1343
|
+
getCacheKey(e, t, r, n) {
|
|
1344
|
+
if (isJest27TransformOptions(r) && (n = r.config), !n) throw "Unable to find Jest transformation options.";
|
|
1360
1345
|
if (!_tsCompilerOptionsKey) {
|
|
1361
|
-
const e = getCompilerOptions(
|
|
1346
|
+
const e = getCompilerOptions(n.rootDir);
|
|
1362
1347
|
_tsCompilerOptionsKey = JSON.stringify(e);
|
|
1363
1348
|
}
|
|
1364
|
-
return [ process.version, _tsCompilerOptionsKey, e, t, r, !!
|
|
1349
|
+
return [ process.version, _tsCompilerOptionsKey, e, t, r, !!n.instrument, 7 ].join(":");
|
|
1365
1350
|
}
|
|
1366
1351
|
}, deepEqual = function e(t, r) {
|
|
1367
1352
|
if (t === r) return !0;
|
|
1368
1353
|
if (t && r && "object" == typeof t && "object" == typeof r) {
|
|
1369
|
-
const
|
|
1354
|
+
const n = Array.isArray(t), s = Array.isArray(r);
|
|
1370
1355
|
let o, i, a;
|
|
1371
|
-
if (
|
|
1356
|
+
if (n && s) {
|
|
1372
1357
|
if (i = t.length, i != r.length) return !1;
|
|
1373
1358
|
for (o = i; 0 != o--; ) if (!e(t[o], r[o])) return !1;
|
|
1374
1359
|
return !0;
|
|
1375
1360
|
}
|
|
1376
|
-
if (
|
|
1361
|
+
if (n != s) return !1;
|
|
1377
1362
|
const l = t instanceof Date, c = r instanceof Date;
|
|
1378
1363
|
if (l != c) return !1;
|
|
1379
1364
|
if (l && c) return t.getTime() == r.getTime();
|
|
@@ -1392,25 +1377,25 @@ const jestPreprocessor = {
|
|
|
1392
1377
|
if (!e) throw new Error("expect toMatchAttribute value is null");
|
|
1393
1378
|
if ("function" == typeof e.then) throw new Error("element must be a resolved value, not a promise, before it can be tested");
|
|
1394
1379
|
if (1 !== e.nodeType) throw new Error("expect toMatchAttribute value is not an element");
|
|
1395
|
-
let
|
|
1396
|
-
null != r && (r = String(r)), null !=
|
|
1397
|
-
const
|
|
1380
|
+
let n = e.getAttribute(t);
|
|
1381
|
+
null != r && (r = String(r)), null != n && (n = String(n));
|
|
1382
|
+
const s = r === n;
|
|
1398
1383
|
return {
|
|
1399
|
-
message: () => `expected attribute ${t} "${r}" to ${
|
|
1400
|
-
pass:
|
|
1384
|
+
message: () => `expected attribute ${t} "${r}" to ${s ? "not " : ""}equal "${n}"`,
|
|
1385
|
+
pass: s
|
|
1401
1386
|
};
|
|
1402
1387
|
},
|
|
1403
1388
|
toEqualAttributes: function toEqualAttributes(e, t) {
|
|
1404
1389
|
if (!e) throw new Error("expect toEqualAttributes value is null");
|
|
1405
1390
|
if ("function" == typeof e.then) throw new Error("element must be a resolved value, not a promise, before it can be tested");
|
|
1406
1391
|
if (1 !== e.nodeType) throw new Error("expect toEqualAttributes value is not an element");
|
|
1407
|
-
const r = Object.keys(t),
|
|
1408
|
-
let
|
|
1409
|
-
return null !=
|
|
1392
|
+
const r = Object.keys(t), n = r.every((r => {
|
|
1393
|
+
let n = t[r];
|
|
1394
|
+
return null != n && (n = String(n)), e.getAttribute(r) === n;
|
|
1410
1395
|
}));
|
|
1411
1396
|
return {
|
|
1412
|
-
message: () => `expected attributes to ${
|
|
1413
|
-
pass:
|
|
1397
|
+
message: () => `expected attributes to ${n ? "not " : ""}equal ${r.map((e => `[${e}="${t[e]}"]`)).join(", ")}`,
|
|
1398
|
+
pass: n
|
|
1414
1399
|
};
|
|
1415
1400
|
},
|
|
1416
1401
|
toEqualHtml: function toEqualHtml(e, t) {
|
|
@@ -1425,10 +1410,10 @@ const jestPreprocessor = {
|
|
|
1425
1410
|
let r;
|
|
1426
1411
|
1 === e.nodeType ? r = e.textContent.replace(/\s\s+/g, " ").trim() : null != e && (r = String(e).replace(/\s\s+/g, " ").trim()),
|
|
1427
1412
|
"string" == typeof t && (t = t.replace(/\s\s+/g, " ").trim());
|
|
1428
|
-
const
|
|
1413
|
+
const n = r === t;
|
|
1429
1414
|
return {
|
|
1430
|
-
message: () => `expected textContent "${t}" to ${
|
|
1431
|
-
pass:
|
|
1415
|
+
message: () => `expected textContent "${t}" to ${n ? "not " : ""}equal "${r}"`,
|
|
1416
|
+
pass: n
|
|
1432
1417
|
};
|
|
1433
1418
|
},
|
|
1434
1419
|
toHaveAttribute: function toHaveAttribute(e, t) {
|
|
@@ -1505,12 +1490,12 @@ const jestPreprocessor = {
|
|
|
1505
1490
|
if ("function" == typeof e.then) throw new Error("event spy must be a resolved value, not a promise, before it can be tested");
|
|
1506
1491
|
if (!e.eventName) throw new Error("toHaveNthReceivedEventDetail did not receive an event spy");
|
|
1507
1492
|
if (!e.firstEvent) throw new Error(`event "${e.eventName}" was not received`);
|
|
1508
|
-
const
|
|
1509
|
-
if (!
|
|
1510
|
-
const
|
|
1511
|
-
return expect(
|
|
1512
|
-
message: () => `expected event "${e.eventName}" detail to ${
|
|
1513
|
-
pass:
|
|
1493
|
+
const n = e.events[t];
|
|
1494
|
+
if (!n) throw new Error(`event at index ${t} was not received`);
|
|
1495
|
+
const s = deepEqual(n.detail, r);
|
|
1496
|
+
return expect(n.detail).toEqual(r), {
|
|
1497
|
+
message: () => `expected event "${e.eventName}" detail to ${s ? "not " : ""}equal`,
|
|
1498
|
+
pass: s
|
|
1514
1499
|
};
|
|
1515
1500
|
},
|
|
1516
1501
|
toMatchScreenshot: function toMatchScreenshot(e, t = {}) {
|
|
@@ -1520,10 +1505,10 @@ const jestPreprocessor = {
|
|
|
1520
1505
|
const r = e.device || e.userAgent;
|
|
1521
1506
|
if ("number" == typeof t.allowableMismatchedRatio) {
|
|
1522
1507
|
if (t.allowableMismatchedRatio < 0 || t.allowableMismatchedRatio > 1) throw new Error("expect toMatchScreenshot() allowableMismatchedRatio must be a value ranging from 0 to 1");
|
|
1523
|
-
const
|
|
1508
|
+
const n = e.mismatchedPixels / (e.width * e.deviceScaleFactor * (e.height * e.deviceScaleFactor));
|
|
1524
1509
|
return {
|
|
1525
|
-
message: () => `${r}: screenshot has a mismatch ratio of "${
|
|
1526
|
-
pass:
|
|
1510
|
+
message: () => `${r}: screenshot has a mismatch ratio of "${n}" for "${e.desc}", but expected ratio to be less than "${t.allowableMismatchedRatio}"`,
|
|
1511
|
+
pass: n <= t.allowableMismatchedRatio
|
|
1527
1512
|
};
|
|
1528
1513
|
}
|
|
1529
1514
|
if ("number" == typeof t.allowableMismatchedPixels) {
|
|
@@ -1781,9 +1766,9 @@ class BuildContext {
|
|
|
1781
1766
|
}
|
|
1782
1767
|
return {
|
|
1783
1768
|
duration: () => r.duration(),
|
|
1784
|
-
finish: (e,
|
|
1769
|
+
finish: (e, n, s, o) => {
|
|
1785
1770
|
if ((!this.hasFinished || t) && (t && this.config.watch && (e = `${this.config.logger.cyan("[" + this.buildId + "]")} ${e}`),
|
|
1786
|
-
r.finish(e,
|
|
1771
|
+
r.finish(e, n, s, o), !t)) {
|
|
1787
1772
|
const e = {
|
|
1788
1773
|
buildId: this.buildId,
|
|
1789
1774
|
messages: this.buildMessages.slice(),
|
|
@@ -1828,8 +1813,8 @@ const getBuildTimestamp = () => {
|
|
|
1828
1813
|
}, getProgress = e => {
|
|
1829
1814
|
let t = 0;
|
|
1830
1815
|
const r = Object.keys(ProgressTask);
|
|
1831
|
-
return r.forEach(((r,
|
|
1832
|
-
e.includes(ProgressTask[r]) && (t =
|
|
1816
|
+
return r.forEach(((r, n) => {
|
|
1817
|
+
e.includes(ProgressTask[r]) && (t = n);
|
|
1833
1818
|
})), (t + 1) / r.length;
|
|
1834
1819
|
}, ProgressTask = {
|
|
1835
1820
|
emptyOutputTargets: {},
|
|
@@ -1898,13 +1883,13 @@ class Cache {
|
|
|
1898
1883
|
const e = Date.now(), t = await this.sys.cacheStorage.get(EXP_STORAGE_KEY);
|
|
1899
1884
|
if (null != t) {
|
|
1900
1885
|
if (e - t < ONE_DAY) return;
|
|
1901
|
-
const r = this.cacheFs.sys,
|
|
1886
|
+
const r = this.cacheFs.sys, n = await r.readDir(this.config.cacheDir), s = n.map((e => path$2.join(this.config.cacheDir, e)));
|
|
1902
1887
|
let o = 0;
|
|
1903
|
-
const i =
|
|
1904
|
-
const
|
|
1905
|
-
e -
|
|
1888
|
+
const i = s.map((async t => {
|
|
1889
|
+
const n = (await r.stat(t)).mtimeMs;
|
|
1890
|
+
e - n > ONE_WEEK && (await r.removeFile(t), o++);
|
|
1906
1891
|
}));
|
|
1907
|
-
await Promise.all(i), this.logger.debug(`clearExpiredCache, cachedFileNames: ${
|
|
1892
|
+
await Promise.all(i), this.logger.debug(`clearExpiredCache, cachedFileNames: ${n.length}, totalCleared: ${o}`);
|
|
1908
1893
|
}
|
|
1909
1894
|
this.logger.debug("clearExpiredCache, set last clear"), await this.sys.cacheStorage.set(EXP_STORAGE_KEY, e);
|
|
1910
1895
|
}
|
|
@@ -1934,23 +1919,23 @@ const MAX_FAILED = 100, ONE_DAY = 864e5, ONE_WEEK = 7 * ONE_DAY, EXP_STORAGE_KEY
|
|
|
1934
1919
|
t.filesToWrite.push(r);
|
|
1935
1920
|
const e = normalizePath(path$2.dirname(r));
|
|
1936
1921
|
t.dirsToEnsure.includes(e) || t.dirsToEnsure.push(e);
|
|
1937
|
-
const
|
|
1938
|
-
|
|
1939
|
-
const
|
|
1940
|
-
|
|
1922
|
+
const n = t.dirsToDelete.indexOf(e);
|
|
1923
|
+
n > -1 && t.dirsToDelete.splice(n, 1);
|
|
1924
|
+
const s = t.filesToDelete.indexOf(r);
|
|
1925
|
+
s > -1 && t.filesToDelete.splice(s, 1);
|
|
1941
1926
|
} else if (!0 === e.isDirectory) {
|
|
1942
1927
|
t.dirsToEnsure.includes(r) || t.dirsToEnsure.push(r);
|
|
1943
1928
|
const e = t.dirsToDelete.indexOf(r);
|
|
1944
1929
|
e > -1 && t.dirsToDelete.splice(e, 1);
|
|
1945
1930
|
}
|
|
1946
1931
|
} else if (!0 === e.queueDeleteFromDisk) e.isDirectory && !t.dirsToEnsure.includes(r) ? t.dirsToDelete.push(r) : e.isFile && !t.filesToWrite.includes(r) && t.filesToDelete.push(r); else if ("string" == typeof e.queueCopyFileToDest) {
|
|
1947
|
-
const
|
|
1948
|
-
t.filesToCopy.push([
|
|
1949
|
-
const o = normalizePath(path$2.dirname(
|
|
1932
|
+
const n = r, s = e.queueCopyFileToDest;
|
|
1933
|
+
t.filesToCopy.push([ n, s ]);
|
|
1934
|
+
const o = normalizePath(path$2.dirname(s));
|
|
1950
1935
|
t.dirsToEnsure.includes(o) || t.dirsToEnsure.push(o);
|
|
1951
1936
|
const i = t.dirsToDelete.indexOf(o);
|
|
1952
1937
|
i > -1 && t.dirsToDelete.splice(i, 1);
|
|
1953
|
-
const a = t.filesToDelete.indexOf(
|
|
1938
|
+
const a = t.filesToDelete.indexOf(s);
|
|
1954
1939
|
a > -1 && t.filesToDelete.splice(a, 1);
|
|
1955
1940
|
}
|
|
1956
1941
|
e.queueDeleteFromDisk = !1, e.queueWriteToDisk = !1;
|
|
@@ -1958,16 +1943,16 @@ const MAX_FAILED = 100, ONE_DAY = 864e5, ONE_WEEK = 7 * ONE_DAY, EXP_STORAGE_KEY
|
|
|
1958
1943
|
for (let e = 0, r = t.dirsToEnsure.length; e < r; e++) {
|
|
1959
1944
|
const r = t.dirsToEnsure[e].split("/");
|
|
1960
1945
|
for (let e = 2; e < r.length; e++) {
|
|
1961
|
-
const
|
|
1962
|
-
!1 === t.dirsToEnsure.includes(
|
|
1946
|
+
const n = r.slice(0, e).join("/");
|
|
1947
|
+
!1 === t.dirsToEnsure.includes(n) && t.dirsToEnsure.push(n);
|
|
1963
1948
|
}
|
|
1964
1949
|
}
|
|
1965
1950
|
t.dirsToEnsure.sort(((e, t) => {
|
|
1966
|
-
const r = e.split("/").length,
|
|
1967
|
-
return r <
|
|
1951
|
+
const r = e.split("/").length, n = t.split("/").length;
|
|
1952
|
+
return r < n ? -1 : r > n ? 1 : e.length < t.length ? -1 : e.length > t.length ? 1 : 0;
|
|
1968
1953
|
})), t.dirsToDelete.sort(((e, t) => {
|
|
1969
|
-
const r = e.split("/").length,
|
|
1970
|
-
return r <
|
|
1954
|
+
const r = e.split("/").length, n = t.split("/").length;
|
|
1955
|
+
return r < n ? 1 : r > n ? -1 : e.length < t.length ? 1 : e.length > t.length ? -1 : 0;
|
|
1971
1956
|
}));
|
|
1972
1957
|
for (const e of t.dirsToEnsure) {
|
|
1973
1958
|
const r = t.dirsToDelete.indexOf(e);
|
|
@@ -1982,44 +1967,44 @@ const MAX_FAILED = 100, ONE_DAY = 864e5, ONE_WEEK = 7 * ONE_DAY, EXP_STORAGE_KEY
|
|
|
1982
1967
|
|
|
1983
1968
|
(posix = {
|
|
1984
1969
|
resolve: function e() {
|
|
1985
|
-
var t, r,
|
|
1986
|
-
for (r = arguments.length - 1; r >= -1 && !o; r--) r >= 0 ?
|
|
1987
|
-
|
|
1988
|
-
return
|
|
1970
|
+
var t, r, n, s = "", o = !1;
|
|
1971
|
+
for (r = arguments.length - 1; r >= -1 && !o; r--) r >= 0 ? n = arguments[r] : (void 0 === t && (t = process.cwd()),
|
|
1972
|
+
n = t), assertPath(n), 0 !== n.length && (s = n + "/" + s, o = 47 === n.charCodeAt(0));
|
|
1973
|
+
return s = normalizeStringPosix(s, !o), o ? s.length > 0 ? "/" + s : "/" : s.length > 0 ? s : ".";
|
|
1989
1974
|
},
|
|
1990
1975
|
normalize: function e(t) {
|
|
1991
|
-
var r,
|
|
1992
|
-
return assertPath(t), 0 === t.length ? "." : (r = 47 === t.charCodeAt(0),
|
|
1993
|
-
0 !== (t = normalizeStringPosix(t, !r)).length || r || (t = "."), t.length > 0 &&
|
|
1976
|
+
var r, n;
|
|
1977
|
+
return assertPath(t), 0 === t.length ? "." : (r = 47 === t.charCodeAt(0), n = 47 === t.charCodeAt(t.length - 1),
|
|
1978
|
+
0 !== (t = normalizeStringPosix(t, !r)).length || r || (t = "."), t.length > 0 && n && (t += "/"),
|
|
1994
1979
|
r ? "/" + t : t);
|
|
1995
1980
|
},
|
|
1996
1981
|
isAbsolute: function e(t) {
|
|
1997
1982
|
return assertPath(t), t.length > 0 && 47 === t.charCodeAt(0);
|
|
1998
1983
|
},
|
|
1999
1984
|
join: function e() {
|
|
2000
|
-
var t, r,
|
|
1985
|
+
var t, r, n;
|
|
2001
1986
|
if (0 === arguments.length) return ".";
|
|
2002
|
-
for (r = 0; r < arguments.length; ++r) assertPath(
|
|
1987
|
+
for (r = 0; r < arguments.length; ++r) assertPath(n = arguments[r]), n.length > 0 && (void 0 === t ? t = n : t += "/" + n);
|
|
2003
1988
|
return void 0 === t ? "." : posix.normalize(t);
|
|
2004
1989
|
},
|
|
2005
1990
|
relative: function e(t, r) {
|
|
2006
|
-
var
|
|
1991
|
+
var n, s, o, i, a, l, c, u, d, h;
|
|
2007
1992
|
if (assertPath(t), assertPath(r), t === r) return "";
|
|
2008
1993
|
if ((t = posix.resolve(t)) === (r = posix.resolve(r))) return "";
|
|
2009
|
-
for (
|
|
2010
|
-
for (o = (
|
|
1994
|
+
for (n = 1; n < t.length && 47 === t.charCodeAt(n); ++n) ;
|
|
1995
|
+
for (o = (s = t.length) - n, i = 1; i < r.length && 47 === r.charCodeAt(i); ++i) ;
|
|
2011
1996
|
for (l = o < (a = r.length - i) ? o : a, c = -1, u = 0; u <= l; ++u) {
|
|
2012
1997
|
if (u === l) {
|
|
2013
1998
|
if (a > l) {
|
|
2014
1999
|
if (47 === r.charCodeAt(i + u)) return r.slice(i + u + 1);
|
|
2015
2000
|
if (0 === u) return r.slice(i + u);
|
|
2016
|
-
} else o > l && (47 === t.charCodeAt(
|
|
2001
|
+
} else o > l && (47 === t.charCodeAt(n + u) ? c = u : 0 === u && (c = 0));
|
|
2017
2002
|
break;
|
|
2018
2003
|
}
|
|
2019
|
-
if ((d = t.charCodeAt(
|
|
2004
|
+
if ((d = t.charCodeAt(n + u)) !== r.charCodeAt(i + u)) break;
|
|
2020
2005
|
47 === d && (c = u);
|
|
2021
2006
|
}
|
|
2022
|
-
for (h = "", u =
|
|
2007
|
+
for (h = "", u = n + c + 1; u <= s; ++u) u !== s && 47 !== t.charCodeAt(u) || (0 === h.length ? h += ".." : h += "/..");
|
|
2023
2008
|
return h.length > 0 ? h + r.slice(i + c) : (i += c, 47 === r.charCodeAt(i) && ++i,
|
|
2024
2009
|
r.slice(i));
|
|
2025
2010
|
},
|
|
@@ -2027,56 +2012,56 @@ const MAX_FAILED = 100, ONE_DAY = 864e5, ONE_WEEK = 7 * ONE_DAY, EXP_STORAGE_KEY
|
|
|
2027
2012
|
return t;
|
|
2028
2013
|
},
|
|
2029
2014
|
dirname: function e(t) {
|
|
2030
|
-
var r,
|
|
2015
|
+
var r, n, s, o;
|
|
2031
2016
|
if (assertPath(t), 0 === t.length) return ".";
|
|
2032
|
-
for (r = 47 === t.charCodeAt(0),
|
|
2033
|
-
if (!
|
|
2034
|
-
|
|
2017
|
+
for (r = 47 === t.charCodeAt(0), n = -1, s = !0, o = t.length - 1; o >= 1; --o) if (47 === t.charCodeAt(o)) {
|
|
2018
|
+
if (!s) {
|
|
2019
|
+
n = o;
|
|
2035
2020
|
break;
|
|
2036
2021
|
}
|
|
2037
|
-
} else
|
|
2038
|
-
return -1 ===
|
|
2022
|
+
} else s = !1;
|
|
2023
|
+
return -1 === n ? r ? "/" : "." : r && 1 === n ? "//" : t.slice(0, n);
|
|
2039
2024
|
},
|
|
2040
2025
|
basename: function e(t, r) {
|
|
2041
|
-
var
|
|
2026
|
+
var n, s, o, i, a, l, c;
|
|
2042
2027
|
if (void 0 !== r && "string" != typeof r) throw new TypeError('"ext" argument must be a string');
|
|
2043
|
-
if (assertPath(t),
|
|
2028
|
+
if (assertPath(t), n = 0, s = -1, o = !0, void 0 !== r && r.length > 0 && r.length <= t.length) {
|
|
2044
2029
|
if (r.length === t.length && r === t) return "";
|
|
2045
2030
|
for (a = r.length - 1, l = -1, i = t.length - 1; i >= 0; --i) if (47 === (c = t.charCodeAt(i))) {
|
|
2046
2031
|
if (!o) {
|
|
2047
|
-
|
|
2032
|
+
n = i + 1;
|
|
2048
2033
|
break;
|
|
2049
2034
|
}
|
|
2050
|
-
} else -1 === l && (o = !1, l = i + 1), a >= 0 && (c === r.charCodeAt(a) ? -1 == --a && (
|
|
2051
|
-
|
|
2052
|
-
return
|
|
2035
|
+
} else -1 === l && (o = !1, l = i + 1), a >= 0 && (c === r.charCodeAt(a) ? -1 == --a && (s = i) : (a = -1,
|
|
2036
|
+
s = l));
|
|
2037
|
+
return n === s ? s = l : -1 === s && (s = t.length), t.slice(n, s);
|
|
2053
2038
|
}
|
|
2054
2039
|
for (i = t.length - 1; i >= 0; --i) if (47 === t.charCodeAt(i)) {
|
|
2055
2040
|
if (!o) {
|
|
2056
|
-
|
|
2041
|
+
n = i + 1;
|
|
2057
2042
|
break;
|
|
2058
2043
|
}
|
|
2059
|
-
} else -1 ===
|
|
2060
|
-
return -1 ===
|
|
2044
|
+
} else -1 === s && (o = !1, s = i + 1);
|
|
2045
|
+
return -1 === s ? "" : t.slice(n, s);
|
|
2061
2046
|
},
|
|
2062
2047
|
extname: function e(t) {
|
|
2063
|
-
var r,
|
|
2064
|
-
for (assertPath(t), r = -1,
|
|
2065
|
-
|
|
2066
|
-
|
|
2048
|
+
var r, n, s, o, i, a, l;
|
|
2049
|
+
for (assertPath(t), r = -1, n = 0, s = -1, o = !0, i = 0, a = t.length - 1; a >= 0; --a) if (47 !== (l = t.charCodeAt(a))) -1 === s && (o = !1,
|
|
2050
|
+
s = a + 1), 46 === l ? -1 === r ? r = a : 1 !== i && (i = 1) : -1 !== r && (i = -1); else if (!o) {
|
|
2051
|
+
n = a + 1;
|
|
2067
2052
|
break;
|
|
2068
2053
|
}
|
|
2069
|
-
return -1 === r || -1 ===
|
|
2054
|
+
return -1 === r || -1 === s || 0 === i || 1 === i && r === s - 1 && r === n + 1 ? "" : t.slice(r, s);
|
|
2070
2055
|
},
|
|
2071
2056
|
format: function e(t) {
|
|
2072
2057
|
if (null === t || "object" != typeof t) throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof t);
|
|
2073
2058
|
return function r(e, t) {
|
|
2074
|
-
var r = t.dir || t.root,
|
|
2075
|
-
return r ? r === t.root ? r +
|
|
2059
|
+
var r = t.dir || t.root, n = t.base || (t.name || "") + (t.ext || "");
|
|
2060
|
+
return r ? r === t.root ? r + n : r + e + n : n;
|
|
2076
2061
|
}("/", t);
|
|
2077
2062
|
},
|
|
2078
2063
|
parse: function e(t) {
|
|
2079
|
-
var r,
|
|
2064
|
+
var r, n, s, o, i, a, l, c, u, d;
|
|
2080
2065
|
if (assertPath(t), r = {
|
|
2081
2066
|
root: "",
|
|
2082
2067
|
dir: "",
|
|
@@ -2084,15 +2069,15 @@ const MAX_FAILED = 100, ONE_DAY = 864e5, ONE_WEEK = 7 * ONE_DAY, EXP_STORAGE_KEY
|
|
|
2084
2069
|
ext: "",
|
|
2085
2070
|
name: ""
|
|
2086
2071
|
}, 0 === t.length) return r;
|
|
2087
|
-
for ((
|
|
2088
|
-
a = 0, l = -1, c = !0, u = t.length - 1, d = 0; u >= o; --u) if (47 !== (
|
|
2089
|
-
l = u + 1), 46 ===
|
|
2072
|
+
for ((s = 47 === (n = t.charCodeAt(0))) ? (r.root = "/", o = 1) : o = 0, i = -1,
|
|
2073
|
+
a = 0, l = -1, c = !0, u = t.length - 1, d = 0; u >= o; --u) if (47 !== (n = t.charCodeAt(u))) -1 === l && (c = !1,
|
|
2074
|
+
l = u + 1), 46 === n ? -1 === i ? i = u : 1 !== d && (d = 1) : -1 !== i && (d = -1); else if (!c) {
|
|
2090
2075
|
a = u + 1;
|
|
2091
2076
|
break;
|
|
2092
2077
|
}
|
|
2093
|
-
return -1 === i || -1 === l || 0 === d || 1 === d && i === l - 1 && i === a + 1 ? -1 !== l && (r.base = r.name = 0 === a &&
|
|
2078
|
+
return -1 === i || -1 === l || 0 === d || 1 === d && i === l - 1 && i === a + 1 ? -1 !== l && (r.base = r.name = 0 === a && s ? t.slice(1, l) : t.slice(a, l)) : (0 === a && s ? (r.name = t.slice(1, i),
|
|
2094
2079
|
r.base = t.slice(1, l)) : (r.name = t.slice(a, i), r.base = t.slice(a, l)), r.ext = t.slice(i, l)),
|
|
2095
|
-
a > 0 ? r.dir = t.slice(0, a - 1) :
|
|
2080
|
+
a > 0 ? r.dir = t.slice(0, a - 1) : s && (r.dir = "/"), r;
|
|
2096
2081
|
},
|
|
2097
2082
|
sep: "/",
|
|
2098
2083
|
delimiter: ":",
|
|
@@ -2107,29 +2092,29 @@ const buildEvents = () => {
|
|
|
2107
2092
|
};
|
|
2108
2093
|
return {
|
|
2109
2094
|
emit: (t, r) => {
|
|
2110
|
-
const
|
|
2111
|
-
for (const e of
|
|
2095
|
+
const n = t.toLowerCase().trim(), s = e.slice();
|
|
2096
|
+
for (const e of s) if (null == e.eventName) try {
|
|
2112
2097
|
e.callback(t, r);
|
|
2113
2098
|
} catch (e) {
|
|
2114
2099
|
console.error(e);
|
|
2115
|
-
} else if (e.eventName ===
|
|
2100
|
+
} else if (e.eventName === n) try {
|
|
2116
2101
|
e.callback(r);
|
|
2117
2102
|
} catch (e) {
|
|
2118
2103
|
console.error(e);
|
|
2119
2104
|
}
|
|
2120
2105
|
},
|
|
2121
|
-
on: (r,
|
|
2106
|
+
on: (r, n) => {
|
|
2122
2107
|
if ("function" == typeof r) {
|
|
2123
|
-
const
|
|
2108
|
+
const n = null, s = r;
|
|
2124
2109
|
return e.push({
|
|
2125
|
-
eventName:
|
|
2126
|
-
callback:
|
|
2127
|
-
}), () => t(
|
|
2110
|
+
eventName: n,
|
|
2111
|
+
callback: s
|
|
2112
|
+
}), () => t(s);
|
|
2128
2113
|
}
|
|
2129
|
-
if ("string" == typeof r && "function" == typeof
|
|
2130
|
-
const
|
|
2114
|
+
if ("string" == typeof r && "function" == typeof n) {
|
|
2115
|
+
const s = r.toLowerCase().trim(), o = n;
|
|
2131
2116
|
return e.push({
|
|
2132
|
-
eventName:
|
|
2117
|
+
eventName: s,
|
|
2133
2118
|
callback: o
|
|
2134
2119
|
}), () => t(o);
|
|
2135
2120
|
}
|
|
@@ -2148,7 +2133,7 @@ const IS_BROWSER_ENV = "undefined" != typeof location && "undefined" != typeof n
|
|
|
2148
2133
|
IS_NODE_ENV && require, IS_NODE_ENV && process.cwd;
|
|
2149
2134
|
|
|
2150
2135
|
const YELLOW = "#f39c12", RED = "#c0392b", BLUE = "#3498db", COMMON_DIR_MODULE_EXTS = [ ".tsx", ".ts", ".mjs", ".js", ".jsx", ".json", ".md" ], COMMON_DIR_FILENAMES = [ "package.json", "index.js", "index.mjs" ], getCommonDirName = (e, t) => e + "/" + t, isCommonDirModuleFile = e => COMMON_DIR_MODULE_EXTS.some((t => e.endsWith(t))), shouldFetchModule = e => IS_FETCH_ENV && IS_BROWSER_ENV && isNodeModulePath(e), isNodeModulePath = e => normalizePath(e).split("/").includes("node_modules"), getPackageDirPath = (e, t) => {
|
|
2151
|
-
const r = normalizePath(e).split("/"),
|
|
2136
|
+
const r = normalizePath(e).split("/"), n = (e => {
|
|
2152
2137
|
e.startsWith("~") && (e = e.substring(1));
|
|
2153
2138
|
const t = e.split("/"), r = {
|
|
2154
2139
|
moduleId: null,
|
|
@@ -2160,41 +2145,41 @@ const YELLOW = "#f39c12", RED = "#c0392b", BLUE = "#3498db", COMMON_DIR_MODULE_E
|
|
|
2160
2145
|
r.filePath = t.slice(2).join("/"), r.scope = t[0], r.scopeSubModuleId = t[1]) : (r.moduleId = t[0],
|
|
2161
2146
|
r.filePath = t.slice(1).join("/")), r;
|
|
2162
2147
|
})(t);
|
|
2163
|
-
for (let e = r.length - 1; e >= 1; e--) if ("node_modules" === r[e - 1]) if (
|
|
2164
|
-
if (r[e] ===
|
|
2165
|
-
} else if (r[e] ===
|
|
2148
|
+
for (let e = r.length - 1; e >= 1; e--) if ("node_modules" === r[e - 1]) if (n.scope) {
|
|
2149
|
+
if (r[e] === n.scope && r[e + 1] === n.scopeSubModuleId) return r.slice(0, e + 2).join("/");
|
|
2150
|
+
} else if (r[e] === n.moduleId) return r.slice(0, e + 1).join("/");
|
|
2166
2151
|
return null;
|
|
2167
|
-
}, packageVersions = new Map, known404Urls = new Set, getCommonDirUrl = (e, t, r,
|
|
2168
|
-
let
|
|
2169
|
-
const
|
|
2170
|
-
|
|
2171
|
-
let o =
|
|
2172
|
-
o.startsWith("@") && (o += "/" +
|
|
2173
|
-
const i =
|
|
2152
|
+
}, packageVersions = new Map, known404Urls = new Set, getCommonDirUrl = (e, t, r, n) => getNodeModuleFetchUrl(e, t, r) + "/" + n, getNodeModuleFetchUrl = (e, t, r) => {
|
|
2153
|
+
let n = (r = normalizePath(r)).split("/").filter((e => e.length));
|
|
2154
|
+
const s = n.lastIndexOf("node_modules");
|
|
2155
|
+
s > -1 && s < n.length - 1 && (n = n.slice(s + 1));
|
|
2156
|
+
let o = n.shift();
|
|
2157
|
+
o.startsWith("@") && (o += "/" + n.shift());
|
|
2158
|
+
const i = n.join("/");
|
|
2174
2159
|
return "@rindo/core" === o ? ((e, t) => {
|
|
2175
2160
|
let r = (t = normalizePath(t)).split("/");
|
|
2176
|
-
const
|
|
2177
|
-
|
|
2161
|
+
const n = r.lastIndexOf("node_modules");
|
|
2162
|
+
n > -1 && n < r.length - 1 && (r = r.slice(n + 1), r = r[0].startsWith("@") ? r.slice(2) : r.slice(1),
|
|
2178
2163
|
t = r.join("/"));
|
|
2179
|
-
const
|
|
2180
|
-
return new URL("./" + t,
|
|
2164
|
+
const s = new URL("../", e).href;
|
|
2165
|
+
return new URL("./" + t, s).href;
|
|
2181
2166
|
})(e.getCompilerExecutingPath(), i) : e.getRemoteModuleUrl({
|
|
2182
2167
|
moduleId: o,
|
|
2183
2168
|
version: t.get(o),
|
|
2184
2169
|
path: i
|
|
2185
2170
|
});
|
|
2186
|
-
}, knownUrlSkips = [ "/@rindo/core/internal.js", "/@rindo/core/internal.json", "/@rindo/core/internal.mjs", "/@rindo/core/internal/rindo-core.js/index.json", "/@rindo/core/internal/rindo-core.js.json", "/@rindo/core/internal/rindo-core.js/package.json", "/@rindo/core.js", "/@rindo/core.json", "/@rindo/core.mjs", "/@rindo/core.css", "/@rindo/core/index.js", "/@rindo/core/index.json", "/@rindo/core/index.mjs", "/@rindo/core/index.css", "/@rindo/package.json" ], fetchModuleAsync = async (e, t, r,
|
|
2171
|
+
}, knownUrlSkips = [ "/@rindo/core/internal.js", "/@rindo/core/internal.json", "/@rindo/core/internal.mjs", "/@rindo/core/internal/rindo-core.js/index.json", "/@rindo/core/internal/rindo-core.js.json", "/@rindo/core/internal/rindo-core.js/package.json", "/@rindo/core.js", "/@rindo/core.json", "/@rindo/core.mjs", "/@rindo/core.css", "/@rindo/core/index.js", "/@rindo/core/index.json", "/@rindo/core/index.mjs", "/@rindo/core/index.css", "/@rindo/package.json" ], fetchModuleAsync = async (e, t, r, n, s) => {
|
|
2187
2172
|
if (!((e => {
|
|
2188
2173
|
if (!(e => e.endsWith(".d.ts"))(t = e) && t.endsWith(".ts") || (e => e.endsWith(".tsx"))(e)) return !0;
|
|
2189
2174
|
var t;
|
|
2190
|
-
const r = e.split("/"),
|
|
2191
|
-
return !("node_modules" !==
|
|
2192
|
-
})(
|
|
2193
|
-
const o = await ((e, t, r) => e && isFunction(e.fetch) ? e.fetch(t, r) : fetch(t, r))(e,
|
|
2175
|
+
const r = e.split("/"), n = r[r.length - 2], s = r[r.length - 1];
|
|
2176
|
+
return !("node_modules" !== n || !isCommonDirModuleFile(s));
|
|
2177
|
+
})(s) || known404Urls.has(n) || (e => knownUrlSkips.some((t => e.endsWith(t))))(n))) try {
|
|
2178
|
+
const o = await ((e, t, r) => e && isFunction(e.fetch) ? e.fetch(t, r) : fetch(t, r))(e, n);
|
|
2194
2179
|
if (o) {
|
|
2195
2180
|
if (o.ok) {
|
|
2196
2181
|
const i = await o.clone().text();
|
|
2197
|
-
return await (async (e, t, r,
|
|
2182
|
+
return await (async (e, t, r, n, s, o) => {
|
|
2198
2183
|
r.endsWith("package.json") && ((e, t) => {
|
|
2199
2184
|
try {
|
|
2200
2185
|
const r = JSON.parse(t);
|
|
@@ -2202,14 +2187,14 @@ const YELLOW = "#f39c12", RED = "#c0392b", BLUE = "#3498db", COMMON_DIR_MODULE_E
|
|
|
2202
2187
|
e.set(t, r);
|
|
2203
2188
|
})(e, r.name, r.version);
|
|
2204
2189
|
} catch (e) {}
|
|
2205
|
-
})(o,
|
|
2206
|
-
let i = path$2.dirname(
|
|
2190
|
+
})(o, s);
|
|
2191
|
+
let i = path$2.dirname(n);
|
|
2207
2192
|
for (;"/" !== i && "" !== i; ) t ? (t.clearFileCache(i), await t.sys.createDir(i)) : await e.createDir(i),
|
|
2208
2193
|
i = path$2.dirname(i);
|
|
2209
|
-
t ? (t.clearFileCache(
|
|
2210
|
-
})(e, t,
|
|
2194
|
+
t ? (t.clearFileCache(n), await t.sys.writeFile(n, s)) : await e.writeFile(n, s);
|
|
2195
|
+
})(e, t, n, s, i, r), i;
|
|
2211
2196
|
}
|
|
2212
|
-
404 === o.status && known404Urls.add(
|
|
2197
|
+
404 === o.status && known404Urls.add(n);
|
|
2213
2198
|
}
|
|
2214
2199
|
} catch (e) {
|
|
2215
2200
|
console.error(e);
|
|
@@ -2229,17 +2214,17 @@ homedir$2 = os__default.default.homedir || function e() {
|
|
|
2229
2214
|
path: t,
|
|
2230
2215
|
exports: {},
|
|
2231
2216
|
require: function(e, t) {
|
|
2232
|
-
return function
|
|
2217
|
+
return function n() {
|
|
2233
2218
|
throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs");
|
|
2234
2219
|
}(null == t && r.path);
|
|
2235
2220
|
}
|
|
2236
2221
|
}, r.exports), r.exports;
|
|
2237
2222
|
}((function(e) {
|
|
2238
|
-
var t, r,
|
|
2223
|
+
var t, r, n = "win32" === process.platform, s = /^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/, o = {
|
|
2239
2224
|
parse: function(e) {
|
|
2240
2225
|
if ("string" != typeof e) throw new TypeError("Parameter 'pathString' must be a string, not " + typeof e);
|
|
2241
2226
|
var t = function r(e) {
|
|
2242
|
-
return
|
|
2227
|
+
return s.exec(e).slice(1);
|
|
2243
2228
|
}(e);
|
|
2244
2229
|
if (!t || 5 !== t.length) throw new TypeError("Invalid path '" + e + "'");
|
|
2245
2230
|
return {
|
|
@@ -2253,7 +2238,7 @@ homedir$2 = os__default.default.homedir || function e() {
|
|
|
2253
2238
|
};
|
|
2254
2239
|
t = /^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/, (r = {}).parse = function(e) {
|
|
2255
2240
|
if ("string" != typeof e) throw new TypeError("Parameter 'pathString' must be a string, not " + typeof e);
|
|
2256
|
-
var r = function
|
|
2241
|
+
var r = function n(e) {
|
|
2257
2242
|
return t.exec(e).slice(1);
|
|
2258
2243
|
}(e);
|
|
2259
2244
|
if (!r || 5 !== r.length) throw new TypeError("Invalid path '" + e + "'");
|
|
@@ -2264,37 +2249,37 @@ homedir$2 = os__default.default.homedir || function e() {
|
|
|
2264
2249
|
ext: r[4],
|
|
2265
2250
|
name: r[3]
|
|
2266
2251
|
};
|
|
2267
|
-
}, e.exports =
|
|
2252
|
+
}, e.exports = n ? o.parse : r.parse, e.exports.posix = r.parse, e.exports.win32 = o.parse;
|
|
2268
2253
|
})), parse = path__default.default.parse || pathParse, getNodeModulesDirs = function e(t, r) {
|
|
2269
|
-
var
|
|
2270
|
-
for (/^([A-Za-z]:)/.test(t) ? o = "" : /^\\\\/.test(t) && (o = "\\\\"),
|
|
2271
|
-
|
|
2272
|
-
return
|
|
2254
|
+
var n, s, o = "/";
|
|
2255
|
+
for (/^([A-Za-z]:)/.test(t) ? o = "" : /^\\\\/.test(t) && (o = "\\\\"), n = [ t ],
|
|
2256
|
+
s = parse(t); s.dir !== n[n.length - 1]; ) n.push(s.dir), s = parse(s.dir);
|
|
2257
|
+
return n.reduce((function(e, t) {
|
|
2273
2258
|
return e.concat(r.map((function(e) {
|
|
2274
2259
|
return path__default.default.resolve(o, t, e);
|
|
2275
2260
|
})));
|
|
2276
2261
|
}), []);
|
|
2277
|
-
}, nodeModulesPaths = function e(t, r,
|
|
2278
|
-
var
|
|
2279
|
-
return r && "function" == typeof r.paths ? r.paths(
|
|
2262
|
+
}, nodeModulesPaths = function e(t, r, n) {
|
|
2263
|
+
var s, o = r && r.moduleDirectory ? [].concat(r.moduleDirectory) : [ "node_modules" ];
|
|
2264
|
+
return r && "function" == typeof r.paths ? r.paths(n, t, (function() {
|
|
2280
2265
|
return getNodeModulesDirs(t, o);
|
|
2281
|
-
}), r) : (
|
|
2266
|
+
}), r) : (s = getNodeModulesDirs(t, o), r && r.paths ? s.concat(r.paths) : s);
|
|
2282
2267
|
}, normalizeOptions = function(e, t) {
|
|
2283
2268
|
return t || {};
|
|
2284
2269
|
}, ERROR_MESSAGE = "Function.prototype.bind called on incompatible ", slice = Array.prototype.slice,
|
|
2285
2270
|
toStr = Object.prototype.toString, implementation = function e(t) {
|
|
2286
|
-
var r,
|
|
2271
|
+
var r, n, s, o, i, a, l, c = this;
|
|
2287
2272
|
if ("function" != typeof c || "[object Function]" !== toStr.call(c)) throw new TypeError(ERROR_MESSAGE + c);
|
|
2288
|
-
for (r = slice.call(arguments, 1),
|
|
2289
|
-
if (this instanceof
|
|
2273
|
+
for (r = slice.call(arguments, 1), s = function() {
|
|
2274
|
+
if (this instanceof n) {
|
|
2290
2275
|
var e = c.apply(this, r.concat(slice.call(arguments)));
|
|
2291
2276
|
return Object(e) === e ? e : this;
|
|
2292
2277
|
}
|
|
2293
2278
|
return c.apply(t, r.concat(slice.call(arguments)));
|
|
2294
2279
|
}, o = Math.max(0, c.length - r.length), i = [], a = 0; a < o; a++) i.push("$" + a);
|
|
2295
|
-
return
|
|
2296
|
-
c.prototype && ((l = function e() {}).prototype = c.prototype,
|
|
2297
|
-
l.prototype = null),
|
|
2280
|
+
return n = Function("binder", "return function (" + i.join(",") + "){ return binder.apply(this,arguments); }")(s),
|
|
2281
|
+
c.prototype && ((l = function e() {}).prototype = c.prototype, n.prototype = new l,
|
|
2282
|
+
l.prototype = null), n;
|
|
2298
2283
|
}, functionBind = Function.prototype.bind || implementation, src = functionBind.call(Function.call, Object.prototype.hasOwnProperty);
|
|
2299
2284
|
|
|
2300
2285
|
const data$1 = {
|
|
@@ -2452,12 +2437,12 @@ const data$1 = {
|
|
|
2452
2437
|
};
|
|
2453
2438
|
|
|
2454
2439
|
isCoreModule = function e(t, r) {
|
|
2455
|
-
return src(data$1, t) && function
|
|
2456
|
-
var r,
|
|
2440
|
+
return src(data$1, t) && function n(e, t) {
|
|
2441
|
+
var r, n;
|
|
2457
2442
|
if ("boolean" == typeof t) return t;
|
|
2458
2443
|
if ("string" != typeof (r = void 0 === e ? process.versions && process.versions.node : e)) throw new TypeError(void 0 === e ? "Unable to determine current node version" : "If provided, a valid node version is required");
|
|
2459
2444
|
if (t && "object" == typeof t) {
|
|
2460
|
-
for (
|
|
2445
|
+
for (n = 0; n < t.length; ++n) if (matchesRange$1(r, t[n])) return !0;
|
|
2461
2446
|
return !1;
|
|
2462
2447
|
}
|
|
2463
2448
|
return matchesRange$1(r, t);
|
|
@@ -2474,117 +2459,117 @@ homedir$1 = homedir$2(), defaultPaths$1 = function() {
|
|
|
2474
2459
|
return e ? "ENOENT" === e.code || "ENOTDIR" === e.code ? r(null, !1) : r(e) : r(null, t.isDirectory());
|
|
2475
2460
|
}));
|
|
2476
2461
|
}, defaultRealpath = function e(t, r) {
|
|
2477
|
-
realpathFS$1(t, (function(e,
|
|
2478
|
-
e && "ENOENT" !== e.code ? r(e) : r(null, e ? t :
|
|
2462
|
+
realpathFS$1(t, (function(e, n) {
|
|
2463
|
+
e && "ENOENT" !== e.code ? r(e) : r(null, e ? t : n);
|
|
2479
2464
|
}));
|
|
2480
|
-
}, maybeRealpath = function e(t, r,
|
|
2481
|
-
|
|
2482
|
-
}, defaultReadPackage = function e(t, r,
|
|
2465
|
+
}, maybeRealpath = function e(t, r, n, s) {
|
|
2466
|
+
n && !1 === n.preserveSymlinks ? t(r, s) : s(null, r);
|
|
2467
|
+
}, defaultReadPackage = function e(t, r, n) {
|
|
2483
2468
|
t(r, (function(e, t) {
|
|
2484
|
-
if (e)
|
|
2469
|
+
if (e) n(e); else try {
|
|
2485
2470
|
var r = JSON.parse(t);
|
|
2486
|
-
|
|
2471
|
+
n(null, r);
|
|
2487
2472
|
} catch (e) {
|
|
2488
|
-
|
|
2473
|
+
n(null);
|
|
2489
2474
|
}
|
|
2490
2475
|
}));
|
|
2491
|
-
}, getPackageCandidates$1 = function e(t, r,
|
|
2492
|
-
var
|
|
2493
|
-
for (
|
|
2476
|
+
}, getPackageCandidates$1 = function e(t, r, n) {
|
|
2477
|
+
var s, o = nodeModulesPaths(r, n, t);
|
|
2478
|
+
for (s = 0; s < o.length; s++) o[s] = path__default.default.join(o[s], t);
|
|
2494
2479
|
return o;
|
|
2495
|
-
}, async = function e(t, r,
|
|
2496
|
-
function
|
|
2480
|
+
}, async = function e(t, r, n) {
|
|
2481
|
+
function s(e) {
|
|
2497
2482
|
if (/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(t)) T = path__default.default.resolve(e, t),
|
|
2498
2483
|
"." !== t && ".." !== t && "/" !== t.slice(-1) || (T += "/"), /\/$/.test(t) && T === e ? l(T, S.package, o) : i(T, S.package, o); else {
|
|
2499
2484
|
if (_ && isCoreModule(t)) return D(null, t);
|
|
2500
|
-
!function r(e, t,
|
|
2501
|
-
var
|
|
2485
|
+
!function r(e, t, n) {
|
|
2486
|
+
var s = function() {
|
|
2502
2487
|
return getPackageCandidates$1(e, t, S);
|
|
2503
2488
|
};
|
|
2504
|
-
c(
|
|
2505
|
-
}(t, e, (function(e, r,
|
|
2489
|
+
c(n, y ? y(e, t, s, S) : s());
|
|
2490
|
+
}(t, e, (function(e, r, n) {
|
|
2506
2491
|
if (e) D(e); else {
|
|
2507
2492
|
if (r) return maybeRealpath(f, r, S, (function(e, t) {
|
|
2508
|
-
e ? D(e) : D(null, t,
|
|
2493
|
+
e ? D(e) : D(null, t, n);
|
|
2509
2494
|
}));
|
|
2510
|
-
var
|
|
2511
|
-
|
|
2495
|
+
var s = new Error("Cannot find module '" + t + "' from '" + b + "'");
|
|
2496
|
+
s.code = "MODULE_NOT_FOUND", D(s);
|
|
2512
2497
|
}
|
|
2513
2498
|
}));
|
|
2514
2499
|
}
|
|
2515
2500
|
}
|
|
2516
|
-
function o(e, r,
|
|
2517
|
-
e ? D(e) : r ? D(null, r,
|
|
2501
|
+
function o(e, r, n) {
|
|
2502
|
+
e ? D(e) : r ? D(null, r, n) : l(T, (function(e, r, n) {
|
|
2518
2503
|
if (e) D(e); else if (r) maybeRealpath(f, r, S, (function(e, t) {
|
|
2519
|
-
e ? D(e) : D(null, t,
|
|
2504
|
+
e ? D(e) : D(null, t, n);
|
|
2520
2505
|
})); else {
|
|
2521
|
-
var
|
|
2522
|
-
|
|
2506
|
+
var s = new Error("Cannot find module '" + t + "' from '" + b + "'");
|
|
2507
|
+
s.code = "MODULE_NOT_FOUND", D(s);
|
|
2523
2508
|
}
|
|
2524
2509
|
}));
|
|
2525
2510
|
}
|
|
2526
2511
|
function i(e, t, r) {
|
|
2527
|
-
var
|
|
2528
|
-
"function" == typeof
|
|
2529
|
-
function o(
|
|
2512
|
+
var n = t, s = r;
|
|
2513
|
+
"function" == typeof n && (s = n, n = void 0), function e(t, r, n) {
|
|
2514
|
+
function o(n, o, a) {
|
|
2530
2515
|
var u, h, p;
|
|
2531
|
-
return c = o,
|
|
2516
|
+
return c = o, n ? s(n) : a && c && S.pathFilter && (h = (u = path__default.default.relative(a, l)).slice(0, u.length - t[0].length),
|
|
2532
2517
|
p = S.pathFilter(c, r, h)) ? e([ "" ].concat(w.slice()), path__default.default.resolve(a, p), c) : void d(l, i);
|
|
2533
2518
|
}
|
|
2534
|
-
function i(
|
|
2535
|
-
return
|
|
2519
|
+
function i(n, o) {
|
|
2520
|
+
return n ? s(n) : o ? s(null, l, c) : void e(t.slice(1), r, c);
|
|
2536
2521
|
}
|
|
2537
2522
|
var l, c;
|
|
2538
|
-
if (0 === t.length) return
|
|
2539
|
-
l = r + t[0], (c =
|
|
2540
|
-
}([ "" ].concat(w), e,
|
|
2523
|
+
if (0 === t.length) return s(null, void 0, n);
|
|
2524
|
+
l = r + t[0], (c = n) ? o(null, c) : a(path__default.default.dirname(l), o);
|
|
2525
|
+
}([ "" ].concat(w), e, n);
|
|
2541
2526
|
}
|
|
2542
2527
|
function a(e, t) {
|
|
2543
|
-
return "" === e || "/" === e || "win32" === process.platform && /^\w:[/\\]*$/.test(e) || /[/\\]node_modules[/\\]*$/.test(e) ? t(null) : void maybeRealpath(f, e, S, (function(r,
|
|
2528
|
+
return "" === e || "/" === e || "win32" === process.platform && /^\w:[/\\]*$/.test(e) || /[/\\]node_modules[/\\]*$/.test(e) ? t(null) : void maybeRealpath(f, e, S, (function(r, n) {
|
|
2544
2529
|
if (r) return a(path__default.default.dirname(e), t);
|
|
2545
|
-
var
|
|
2546
|
-
d(
|
|
2547
|
-
if (!
|
|
2548
|
-
m(p,
|
|
2530
|
+
var s = path__default.default.join(n, "package.json");
|
|
2531
|
+
d(s, (function(r, n) {
|
|
2532
|
+
if (!n) return a(path__default.default.dirname(e), t);
|
|
2533
|
+
m(p, s, (function(r, n) {
|
|
2549
2534
|
r && t(r);
|
|
2550
|
-
var o =
|
|
2551
|
-
o && S.packageFilter && (o = S.packageFilter(o,
|
|
2535
|
+
var o = n;
|
|
2536
|
+
o && S.packageFilter && (o = S.packageFilter(o, s)), t(null, o, e);
|
|
2552
2537
|
}));
|
|
2553
2538
|
}));
|
|
2554
2539
|
}));
|
|
2555
2540
|
}
|
|
2556
2541
|
function l(e, t, r) {
|
|
2557
|
-
var
|
|
2558
|
-
"function" == typeof
|
|
2559
|
-
if (t) return
|
|
2542
|
+
var n = r, s = t;
|
|
2543
|
+
"function" == typeof s && (n = s, s = S.package), maybeRealpath(f, e, S, (function(t, r) {
|
|
2544
|
+
if (t) return n(t);
|
|
2560
2545
|
var o = path__default.default.join(r, "package.json");
|
|
2561
2546
|
d(o, (function(t, r) {
|
|
2562
|
-
return t ?
|
|
2563
|
-
var
|
|
2564
|
-
return t ?
|
|
2565
|
-
|
|
2566
|
-
return t ?
|
|
2567
|
-
return t ?
|
|
2568
|
-
})) : i(path__default.default.join(e, "index"),
|
|
2569
|
-
}))) : void i(path__default.default.join(e, "/index"),
|
|
2570
|
-
})) : i(path__default.default.join(e, "index"),
|
|
2547
|
+
return t ? n(t) : r ? void m(p, o, (function(t, r) {
|
|
2548
|
+
var s, a;
|
|
2549
|
+
return t ? n(t) : ((s = r) && S.packageFilter && (s = S.packageFilter(s, o)), s && s.main ? "string" != typeof s.main ? ((a = new TypeError("package “" + s.name + "” `main` must be a string")).code = "INVALID_PACKAGE_MAIN",
|
|
2550
|
+
n(a)) : ("." !== s.main && "./" !== s.main || (s.main = "index"), void i(path__default.default.resolve(e, s.main), s, (function(t, r, s) {
|
|
2551
|
+
return t ? n(t) : r ? n(null, r, s) : s ? void l(path__default.default.resolve(e, s.main), s, (function(t, r, s) {
|
|
2552
|
+
return t ? n(t) : r ? n(null, r, s) : void i(path__default.default.join(e, "index"), s, n);
|
|
2553
|
+
})) : i(path__default.default.join(e, "index"), s, n);
|
|
2554
|
+
}))) : void i(path__default.default.join(e, "/index"), s, n));
|
|
2555
|
+
})) : i(path__default.default.join(e, "index"), s, n);
|
|
2571
2556
|
}));
|
|
2572
2557
|
}));
|
|
2573
2558
|
}
|
|
2574
2559
|
function c(e, t) {
|
|
2575
2560
|
function r(t, r, o) {
|
|
2576
|
-
return t ? e(t) : r ? e(null, r, o) : void l(
|
|
2561
|
+
return t ? e(t) : r ? e(null, r, o) : void l(s, S.package, n);
|
|
2577
2562
|
}
|
|
2578
|
-
function
|
|
2579
|
-
return r ? e(r) :
|
|
2563
|
+
function n(r, n, s) {
|
|
2564
|
+
return r ? e(r) : n ? e(null, n, s) : void c(e, t.slice(1));
|
|
2580
2565
|
}
|
|
2581
2566
|
if (0 === t.length) return e(null, void 0);
|
|
2582
|
-
var
|
|
2583
|
-
h(path__default.default.dirname(
|
|
2584
|
-
return
|
|
2567
|
+
var s = t[0];
|
|
2568
|
+
h(path__default.default.dirname(s), (function o(n, a) {
|
|
2569
|
+
return n ? e(n) : a ? void i(s, S.package, r) : c(e, t.slice(1));
|
|
2585
2570
|
}));
|
|
2586
2571
|
}
|
|
2587
|
-
var u, d, h, p, f, m, g, y, w, _, v, b, E, T, D =
|
|
2572
|
+
var u, d, h, p, f, m, g, y, w, _, v, b, E, T, D = n, S = r;
|
|
2588
2573
|
return "function" == typeof r && (D = S, S = {}), "string" != typeof t ? (u = new TypeError("Path must be a string."),
|
|
2589
2574
|
process.nextTick((function() {
|
|
2590
2575
|
D(u);
|
|
@@ -2596,7 +2581,7 @@ homedir$1 = homedir$2(), defaultPaths$1 = function() {
|
|
|
2596
2581
|
}))) : (y = S.packageIterator, w = S.extensions || [ ".js" ], _ = !1 !== S.includeCoreModules,
|
|
2597
2582
|
v = S.basedir || path__default.default.dirname(caller()), b = S.filename || v, S.paths = S.paths || defaultPaths$1(),
|
|
2598
2583
|
E = path__default.default.resolve(v), void maybeRealpath(f, E, S, (function(e, t) {
|
|
2599
|
-
e ? D(e) :
|
|
2584
|
+
e ? D(e) : s(t);
|
|
2600
2585
|
}))));
|
|
2601
2586
|
};
|
|
2602
2587
|
|
|
@@ -2789,35 +2774,35 @@ homedir = homedir$2(), defaultPaths = function() {
|
|
|
2789
2774
|
if ("ENOENT" !== e.code) throw e;
|
|
2790
2775
|
}
|
|
2791
2776
|
return t;
|
|
2792
|
-
}, maybeRealpathSync = function e(t, r,
|
|
2793
|
-
return
|
|
2777
|
+
}, maybeRealpathSync = function e(t, r, n) {
|
|
2778
|
+
return n && !1 === n.preserveSymlinks ? t(r) : r;
|
|
2794
2779
|
}, defaultReadPackageSync = function e(t, r) {
|
|
2795
|
-
var
|
|
2780
|
+
var n = t(r);
|
|
2796
2781
|
try {
|
|
2797
|
-
return JSON.parse(
|
|
2782
|
+
return JSON.parse(n);
|
|
2798
2783
|
} catch (e) {}
|
|
2799
|
-
}, getPackageCandidates = function e(t, r,
|
|
2800
|
-
var
|
|
2801
|
-
for (
|
|
2784
|
+
}, getPackageCandidates = function e(t, r, n) {
|
|
2785
|
+
var s, o = nodeModulesPaths(r, n, t);
|
|
2786
|
+
for (s = 0; s < o.length; s++) o[s] = path__default.default.join(o[s], t);
|
|
2802
2787
|
return o;
|
|
2803
2788
|
}, sync = function e(t, r) {
|
|
2804
|
-
function
|
|
2805
|
-
var t, r,
|
|
2789
|
+
function n(e) {
|
|
2790
|
+
var t, r, n, o, l = s(path__default.default.dirname(e));
|
|
2806
2791
|
if (l && l.dir && l.pkg && i.pathFilter && (t = path__default.default.relative(l.dir, e),
|
|
2807
2792
|
(r = i.pathFilter(l.pkg, e, t)) && (e = path__default.default.resolve(l.dir, r))),
|
|
2808
2793
|
a(e)) return e;
|
|
2809
|
-
for (
|
|
2794
|
+
for (n = 0; n < p.length; n++) if (o = e + p[n], a(o)) return o;
|
|
2810
2795
|
}
|
|
2811
|
-
function
|
|
2796
|
+
function s(e) {
|
|
2812
2797
|
var t, r;
|
|
2813
2798
|
if ("" !== e && "/" !== e && !("win32" === process.platform && /^\w:[/\\]*$/.test(e) || /[/\\]node_modules[/\\]*$/.test(e))) return t = path__default.default.join(maybeRealpathSync(u, e, i), "package.json"),
|
|
2814
2799
|
a(t) ? ((r = d(l, t)) && i.packageFilter && (r = i.packageFilter(r, e)), {
|
|
2815
2800
|
pkg: r,
|
|
2816
2801
|
dir: e
|
|
2817
|
-
}) :
|
|
2802
|
+
}) : s(path__default.default.dirname(e));
|
|
2818
2803
|
}
|
|
2819
2804
|
function o(e) {
|
|
2820
|
-
var t, r,
|
|
2805
|
+
var t, r, s, c, h = path__default.default.join(maybeRealpathSync(u, e, i), "/package.json");
|
|
2821
2806
|
if (a(h)) {
|
|
2822
2807
|
try {
|
|
2823
2808
|
t = d(l, h);
|
|
@@ -2827,12 +2812,12 @@ homedir = homedir$2(), defaultPaths = function() {
|
|
|
2827
2812
|
r;
|
|
2828
2813
|
"." !== t.main && "./" !== t.main || (t.main = "index");
|
|
2829
2814
|
try {
|
|
2830
|
-
if (
|
|
2815
|
+
if (s = n(path__default.default.resolve(e, t.main))) return s;
|
|
2831
2816
|
if (c = o(path__default.default.resolve(e, t.main))) return c;
|
|
2832
2817
|
} catch (e) {}
|
|
2833
2818
|
}
|
|
2834
2819
|
}
|
|
2835
|
-
return
|
|
2820
|
+
return n(path__default.default.join(e, "/index"));
|
|
2836
2821
|
}
|
|
2837
2822
|
var i, a, l, c, u, d, h, p, f, m, g, y, w, _, v, b;
|
|
2838
2823
|
if ("string" != typeof t) throw new TypeError("Path must be a string.");
|
|
@@ -2843,16 +2828,16 @@ homedir = homedir$2(), defaultPaths = function() {
|
|
|
2843
2828
|
m = i.basedir || path__default.default.dirname(caller()), g = i.filename || m, i.paths = i.paths || defaultPaths(),
|
|
2844
2829
|
y = maybeRealpathSync(u, path__default.default.resolve(m), i), /^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(t)) {
|
|
2845
2830
|
if (w = path__default.default.resolve(y, t), "." !== t && ".." !== t && "/" !== t.slice(-1) || (w += "/"),
|
|
2846
|
-
_ =
|
|
2831
|
+
_ = n(w) || o(w)) return maybeRealpathSync(u, _, i);
|
|
2847
2832
|
} else {
|
|
2848
2833
|
if (f && isCoreModule(t)) return t;
|
|
2849
2834
|
if (v = function E(e, t) {
|
|
2850
|
-
var r,
|
|
2835
|
+
var r, s, a, l, u = function() {
|
|
2851
2836
|
return getPackageCandidates(e, t, i);
|
|
2852
2837
|
}, d = h ? h(e, t, u, i) : u();
|
|
2853
|
-
for (r = 0; r < d.length; r++) if (
|
|
2854
|
-
if (a = s
|
|
2855
|
-
if (l = o(
|
|
2838
|
+
for (r = 0; r < d.length; r++) if (s = d[r], c(path__default.default.dirname(s))) {
|
|
2839
|
+
if (a = n(s)) return a;
|
|
2840
|
+
if (l = o(s)) return l;
|
|
2856
2841
|
}
|
|
2857
2842
|
}(t, y)) return maybeRealpathSync(u, v, i);
|
|
2858
2843
|
}
|
|
@@ -2888,22 +2873,22 @@ const createSystem = e => {
|
|
|
2888
2873
|
}),
|
|
2889
2874
|
printDiagnostics(t) {
|
|
2890
2875
|
t.forEach((t => ((e, t) => {
|
|
2891
|
-
let r = BLUE,
|
|
2892
|
-
"error" === e.level ? (r = RED,
|
|
2893
|
-
|
|
2876
|
+
let r = BLUE, n = "Build", s = "";
|
|
2877
|
+
"error" === e.level ? (r = RED, n = "Error") : "warn" === e.level && (r = YELLOW,
|
|
2878
|
+
n = "Warning"), e.header && (n = e.header);
|
|
2894
2879
|
const o = e.relFilePath || e.absFilePath;
|
|
2895
|
-
if (o && (
|
|
2896
|
-
"number" == typeof e.columnNumber && e.columnNumber > 0 && (
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
})),
|
|
2900
|
-
const e = [ "%c" +
|
|
2901
|
-
console.log(...e,
|
|
2902
|
-
} else "error" === e.level ? console.error(
|
|
2880
|
+
if (o && (s += o, "number" == typeof e.lineNumber && e.lineNumber > 0 && (s += ", line " + e.lineNumber,
|
|
2881
|
+
"number" == typeof e.columnNumber && e.columnNumber > 0 && (s += ", column " + e.columnNumber)),
|
|
2882
|
+
s += "\n"), s += e.messageText, e.lines && e.lines.length > 0 && (e.lines.forEach((e => {
|
|
2883
|
+
s += "\n" + e.lineNumber + ": " + e.text;
|
|
2884
|
+
})), s += "\n"), t) {
|
|
2885
|
+
const e = [ "%c" + n, `background: ${r}; color: white; padding: 2px 3px; border-radius: 2px; font-size: 0.8em;` ];
|
|
2886
|
+
console.log(...e, s);
|
|
2887
|
+
} else "error" === e.level ? console.error(s) : "warn" === e.level ? console.warn(s) : console.log(s);
|
|
2903
2888
|
})(t, e)));
|
|
2904
2889
|
}
|
|
2905
2890
|
};
|
|
2906
|
-
})(), r = new Map,
|
|
2891
|
+
})(), r = new Map, n = new Set, s = e => n.add(e), o = e => n.delete(e), i = buildEvents(), a = IS_BROWSER_ENV && navigator.hardwareConcurrency || 1, l = e => {
|
|
2907
2892
|
if ("/" === e || "" === e) return "/";
|
|
2908
2893
|
const t = path$2.dirname(e), r = path$2.basename(e);
|
|
2909
2894
|
return t.endsWith("/") ? normalizePath(`${t}${r}`) : normalizePath(`${t}/${r}`);
|
|
@@ -2920,23 +2905,23 @@ const createSystem = e => {
|
|
|
2920
2905
|
error: null
|
|
2921
2906
|
};
|
|
2922
2907
|
return d(e, t, r), r;
|
|
2923
|
-
}, d = (e, t,
|
|
2924
|
-
const
|
|
2925
|
-
t && t.recursive && !(e => "/" === e || windowsPathRegex.test(e))(
|
|
2908
|
+
}, d = (e, t, n) => {
|
|
2909
|
+
const s = path$2.dirname(e);
|
|
2910
|
+
t && t.recursive && !(e => "/" === e || windowsPathRegex.test(e))(s) && d(s, t, n);
|
|
2926
2911
|
const o = r.get(e);
|
|
2927
2912
|
o ? (o.isDirectory = !0, o.isFile = !1) : (r.set(e, {
|
|
2928
2913
|
basename: path$2.basename(e),
|
|
2929
|
-
dirname:
|
|
2914
|
+
dirname: s,
|
|
2930
2915
|
isDirectory: !0,
|
|
2931
2916
|
isFile: !1,
|
|
2932
2917
|
watcherCallbacks: null,
|
|
2933
2918
|
data: void 0
|
|
2934
|
-
}),
|
|
2919
|
+
}), n.newDirs.push(e), v(e, new Set));
|
|
2935
2920
|
}, h = e => {
|
|
2936
2921
|
e = l(e);
|
|
2937
|
-
const t = [],
|
|
2938
|
-
return
|
|
2939
|
-
"/" !==
|
|
2922
|
+
const t = [], n = r.get(e);
|
|
2923
|
+
return n && n.isDirectory && r.forEach(((r, n) => {
|
|
2924
|
+
"/" !== n && (r.isDirectory || r.isFile && "string" == typeof r.data) && (e.endsWith("/") && `${e}${r.basename}` === n || `${e}/${r.basename}` === n) && t.push(n);
|
|
2940
2925
|
})), t.sort();
|
|
2941
2926
|
}, p = e => {
|
|
2942
2927
|
e = l(e);
|
|
@@ -2945,31 +2930,31 @@ const createSystem = e => {
|
|
|
2945
2930
|
}, f = e => ({
|
|
2946
2931
|
path: l(e),
|
|
2947
2932
|
error: null
|
|
2948
|
-
}), m = (e, t,
|
|
2949
|
-
const
|
|
2950
|
-
if (!
|
|
2951
|
-
const
|
|
2933
|
+
}), m = (e, t, n) => {
|
|
2934
|
+
const s = w(e);
|
|
2935
|
+
if (!s.error && !n.error) if (s.isFile) {
|
|
2936
|
+
const s = path$2.dirname(t), o = u(s, {
|
|
2952
2937
|
recursive: !0
|
|
2953
2938
|
}), i = r.get(e).data, a = b(t, i);
|
|
2954
|
-
|
|
2939
|
+
n.newDirs.push(...o.newDirs), n.renamed.push({
|
|
2955
2940
|
oldPath: e,
|
|
2956
2941
|
newPath: t,
|
|
2957
2942
|
isDirectory: !1,
|
|
2958
2943
|
isFile: !0
|
|
2959
|
-
}), a.error ?
|
|
2960
|
-
} else if (
|
|
2961
|
-
const r = h(e),
|
|
2944
|
+
}), a.error ? n.error = a.error : n.newFiles.push(t);
|
|
2945
|
+
} else if (s.isDirectory) {
|
|
2946
|
+
const r = h(e), s = u(t, {
|
|
2962
2947
|
recursive: !0
|
|
2963
2948
|
});
|
|
2964
|
-
|
|
2949
|
+
n.newDirs.push(...s.newDirs), n.renamed.push({
|
|
2965
2950
|
oldPath: e,
|
|
2966
2951
|
newPath: t,
|
|
2967
2952
|
isDirectory: !0,
|
|
2968
2953
|
isFile: !1
|
|
2969
2954
|
});
|
|
2970
|
-
for (const
|
|
2971
|
-
const r =
|
|
2972
|
-
m(
|
|
2955
|
+
for (const s of r) {
|
|
2956
|
+
const r = s.replace(e, t);
|
|
2957
|
+
m(s, r, n);
|
|
2973
2958
|
}
|
|
2974
2959
|
}
|
|
2975
2960
|
}, g = (e, t = {}) => {
|
|
@@ -2982,18 +2967,18 @@ const createSystem = e => {
|
|
|
2982
2967
|
error: null
|
|
2983
2968
|
};
|
|
2984
2969
|
return y(e, t, r), r;
|
|
2985
|
-
}, y = (e, t,
|
|
2986
|
-
if (!
|
|
2970
|
+
}, y = (e, t, n) => {
|
|
2971
|
+
if (!n.error) {
|
|
2987
2972
|
e = l(e);
|
|
2988
|
-
const
|
|
2989
|
-
if (t && t.recursive) for (const e of
|
|
2990
|
-
const
|
|
2991
|
-
if (
|
|
2973
|
+
const s = h(e);
|
|
2974
|
+
if (t && t.recursive) for (const e of s) {
|
|
2975
|
+
const s = r.get(e);
|
|
2976
|
+
if (s) if (s.isDirectory) y(e, t, n); else if (s.isFile) {
|
|
2992
2977
|
const t = _(e);
|
|
2993
|
-
t.error ?
|
|
2978
|
+
t.error ? n.error = t.error : n.removedFiles.push(e);
|
|
2994
2979
|
}
|
|
2995
|
-
} else if (
|
|
2996
|
-
r.delete(e), v(e, new Set),
|
|
2980
|
+
} else if (s.length > 0) return void (n.error = "cannot delete directory that contains files/subdirectories");
|
|
2981
|
+
r.delete(e), v(e, new Set), n.removedDirs.push(e);
|
|
2997
2982
|
}
|
|
2998
2983
|
}, w = e => {
|
|
2999
2984
|
e = l(e);
|
|
@@ -3018,24 +3003,24 @@ const createSystem = e => {
|
|
|
3018
3003
|
dirname: path$2.dirname(e),
|
|
3019
3004
|
path: e,
|
|
3020
3005
|
error: null
|
|
3021
|
-
},
|
|
3022
|
-
if (
|
|
3023
|
-
if (
|
|
3006
|
+
}, n = r.get(e);
|
|
3007
|
+
if (n) {
|
|
3008
|
+
if (n.watcherCallbacks) for (const t of n.watcherCallbacks) t(e, "fileDelete");
|
|
3024
3009
|
r.delete(e), v(e, new Set);
|
|
3025
3010
|
}
|
|
3026
3011
|
return t;
|
|
3027
3012
|
}, v = (e, t) => {
|
|
3028
|
-
const
|
|
3029
|
-
if (
|
|
3030
|
-
t.has(
|
|
3013
|
+
const n = l(path$2.dirname(e)), s = r.get(n);
|
|
3014
|
+
if (s && s.isDirectory && s.watcherCallbacks) for (const t of s.watcherCallbacks) t(e, null);
|
|
3015
|
+
t.has(n) || (t.add(n), v(n, t));
|
|
3031
3016
|
}, b = (e, t) => {
|
|
3032
|
-
const
|
|
3017
|
+
const n = {
|
|
3033
3018
|
path: e = l(e),
|
|
3034
3019
|
error: null
|
|
3035
|
-
},
|
|
3036
|
-
if (
|
|
3037
|
-
const r =
|
|
3038
|
-
if (
|
|
3020
|
+
}, s = r.get(e);
|
|
3021
|
+
if (s) {
|
|
3022
|
+
const r = s.data !== t;
|
|
3023
|
+
if (s.data = t, r && s.watcherCallbacks) for (const t of s.watcherCallbacks) t(e, "fileUpdate");
|
|
3039
3024
|
} else r.set(e, {
|
|
3040
3025
|
basename: path$2.basename(e),
|
|
3041
3026
|
dirname: path$2.dirname(e),
|
|
@@ -3044,16 +3029,16 @@ const createSystem = e => {
|
|
|
3044
3029
|
watcherCallbacks: null,
|
|
3045
3030
|
data: t
|
|
3046
3031
|
}), v(e, new Set);
|
|
3047
|
-
return
|
|
3032
|
+
return n;
|
|
3048
3033
|
}, E = "undefined" != typeof self ? null === self || void 0 === self ? void 0 : self.fetch : "undefined" != typeof window ? null === window || void 0 === window ? void 0 : window.fetch : "undefined" != typeof global ? null === global || void 0 === global ? void 0 : global.fetch : void 0, T = Promise.resolve();
|
|
3049
3034
|
u("/");
|
|
3050
3035
|
const D = {
|
|
3051
3036
|
name: "in-memory",
|
|
3052
|
-
version: "2.
|
|
3037
|
+
version: "2.18.0",
|
|
3053
3038
|
events: i,
|
|
3054
3039
|
access: async e => c(e),
|
|
3055
3040
|
accessSync: c,
|
|
3056
|
-
addDestory:
|
|
3041
|
+
addDestory: s,
|
|
3057
3042
|
copyFile: async (e, t) => (b(t, p(e)), !0),
|
|
3058
3043
|
createDir: async (e, t) => u(e, t),
|
|
3059
3044
|
createDirSync: u,
|
|
@@ -3065,14 +3050,14 @@ const createSystem = e => {
|
|
|
3065
3050
|
getEnvironmentVar: e => null == process__namespace ? void 0 : process__namespace.env[e],
|
|
3066
3051
|
destroy: async () => {
|
|
3067
3052
|
const e = [];
|
|
3068
|
-
|
|
3053
|
+
n.forEach((r => {
|
|
3069
3054
|
try {
|
|
3070
3055
|
const t = r();
|
|
3071
3056
|
t && t.then && e.push(t);
|
|
3072
3057
|
} catch (e) {
|
|
3073
3058
|
t.error(`rindo sys destroy: ${e}`);
|
|
3074
3059
|
}
|
|
3075
|
-
})), await Promise.all(e),
|
|
3060
|
+
})), await Promise.all(e), n.clear();
|
|
3076
3061
|
},
|
|
3077
3062
|
encodeToBase64: e => btoa(unescape(encodeURIComponent(e))),
|
|
3078
3063
|
exit: async e => t.warn(`exit ${e}`),
|
|
@@ -3110,8 +3095,8 @@ const createSystem = e => {
|
|
|
3110
3095
|
isFile: !1,
|
|
3111
3096
|
isDirectory: !1,
|
|
3112
3097
|
error: null
|
|
3113
|
-
},
|
|
3114
|
-
if (
|
|
3098
|
+
}, n = w(e);
|
|
3099
|
+
if (n.error) r.error = `${e} does not exist`; else if (n.isFile ? r.isFile = !0 : n.isDirectory && (r.isDirectory = !0),
|
|
3115
3100
|
m(e, t, r), !r.error) if (r.isDirectory) {
|
|
3116
3101
|
const t = g(e, {
|
|
3117
3102
|
recursive: !0
|
|
@@ -3134,15 +3119,15 @@ const createSystem = e => {
|
|
|
3134
3119
|
removeFileSync: _,
|
|
3135
3120
|
watchDirectory: (e, t) => {
|
|
3136
3121
|
e = l(e);
|
|
3137
|
-
const
|
|
3138
|
-
const
|
|
3139
|
-
if (
|
|
3140
|
-
const e =
|
|
3141
|
-
e > -1 &&
|
|
3122
|
+
const n = r.get(e), i = () => {
|
|
3123
|
+
const n = r.get(e);
|
|
3124
|
+
if (n && n.watcherCallbacks) {
|
|
3125
|
+
const e = n.watcherCallbacks.indexOf(t);
|
|
3126
|
+
e > -1 && n.watcherCallbacks.splice(e, 1);
|
|
3142
3127
|
}
|
|
3143
3128
|
};
|
|
3144
|
-
return
|
|
3145
|
-
|
|
3129
|
+
return s(i), n ? (n.isDirectory = !0, n.isFile = !1, n.watcherCallbacks = n.watcherCallbacks || [],
|
|
3130
|
+
n.watcherCallbacks.push(t)) : r.set(e, {
|
|
3146
3131
|
basename: path$2.basename(e),
|
|
3147
3132
|
dirname: path$2.dirname(e),
|
|
3148
3133
|
isDirectory: !0,
|
|
@@ -3157,15 +3142,15 @@ const createSystem = e => {
|
|
|
3157
3142
|
},
|
|
3158
3143
|
watchFile: (e, t) => {
|
|
3159
3144
|
e = l(e);
|
|
3160
|
-
const
|
|
3161
|
-
const
|
|
3162
|
-
if (
|
|
3163
|
-
const e =
|
|
3164
|
-
e > -1 &&
|
|
3145
|
+
const n = r.get(e), i = () => {
|
|
3146
|
+
const n = r.get(e);
|
|
3147
|
+
if (n && n.watcherCallbacks) {
|
|
3148
|
+
const e = n.watcherCallbacks.indexOf(t);
|
|
3149
|
+
e > -1 && n.watcherCallbacks.splice(e, 1);
|
|
3165
3150
|
}
|
|
3166
3151
|
};
|
|
3167
|
-
return
|
|
3168
|
-
|
|
3152
|
+
return s(i), n ? (n.isDirectory = !1, n.isFile = !0, n.watcherCallbacks = n.watcherCallbacks || [],
|
|
3153
|
+
n.watcherCallbacks.push(t)) : r.set(e, {
|
|
3169
3154
|
basename: path$2.basename(e),
|
|
3170
3155
|
dirname: path$2.dirname(e),
|
|
3171
3156
|
isDirectory: !1,
|
|
@@ -3183,20 +3168,20 @@ const createSystem = e => {
|
|
|
3183
3168
|
writeFileSync: b,
|
|
3184
3169
|
generateContentHash: async (e, t) => {
|
|
3185
3170
|
const r = await crypto.subtle.digest("SHA-256", (new TextEncoder).encode(e));
|
|
3186
|
-
let
|
|
3187
|
-
return "number" == typeof t && (
|
|
3171
|
+
let n = Array.from(new Uint8Array(r)).map((e => e.toString(16).padStart(2, "0"))).join("");
|
|
3172
|
+
return "number" == typeof t && (n = n.slice(0, t)), n;
|
|
3188
3173
|
},
|
|
3189
3174
|
createWorkerController: HAS_WEB_WORKER ? e => ((e, t) => {
|
|
3190
|
-
let r,
|
|
3175
|
+
let r, n = 0, s = !1, o = !1, i = 0;
|
|
3191
3176
|
const a = new Map, l = [], c = [], u = Math.max(Math.min(t, e.hardwareConcurrency), 2) - 1, d = Promise.resolve(), h = e => console.error(e), p = () => {
|
|
3192
3177
|
let t = null;
|
|
3193
|
-
const
|
|
3178
|
+
const n = e.getCompilerExecutingPath(), o = {
|
|
3194
3179
|
name: "rindo.worker." + i++
|
|
3195
3180
|
};
|
|
3196
3181
|
try {
|
|
3197
|
-
t = new Worker(
|
|
3182
|
+
t = new Worker(n, o);
|
|
3198
3183
|
} catch (e) {
|
|
3199
|
-
null == r && (r = new Blob([ `importScripts('${
|
|
3184
|
+
null == r && (r = new Blob([ `importScripts('${n}');` ], {
|
|
3200
3185
|
type: "application/javascript"
|
|
3201
3186
|
})), t = new Worker(URL.createObjectURL(r), o);
|
|
3202
3187
|
}
|
|
@@ -3206,7 +3191,7 @@ const createSystem = e => {
|
|
|
3206
3191
|
sendQueue: []
|
|
3207
3192
|
};
|
|
3208
3193
|
return t.onerror = h, t.onmessage = e => ((e, t) => {
|
|
3209
|
-
if (!
|
|
3194
|
+
if (!s) {
|
|
3210
3195
|
const r = t.data;
|
|
3211
3196
|
if (Array.isArray(r)) for (const t of r) if (t) {
|
|
3212
3197
|
const r = a.get(t.rindoId);
|
|
@@ -3229,12 +3214,12 @@ const createSystem = e => {
|
|
|
3229
3214
|
}, g = () => {
|
|
3230
3215
|
o = !1, l.forEach(m), l.length = 0, c.forEach(f);
|
|
3231
3216
|
}, y = (...e) => new Promise(((t, r) => {
|
|
3232
|
-
if (
|
|
3233
|
-
const
|
|
3234
|
-
rindoId:
|
|
3217
|
+
if (s) r("task canceled"); else {
|
|
3218
|
+
const s = {
|
|
3219
|
+
rindoId: n++,
|
|
3235
3220
|
args: e
|
|
3236
3221
|
};
|
|
3237
|
-
l.push(
|
|
3222
|
+
l.push(s), a.set(s.rindoId, {
|
|
3238
3223
|
resolve: t,
|
|
3239
3224
|
reject: r
|
|
3240
3225
|
}), o || (o = !0, d.then(g));
|
|
@@ -3243,7 +3228,7 @@ const createSystem = e => {
|
|
|
3243
3228
|
return {
|
|
3244
3229
|
send: y,
|
|
3245
3230
|
destroy: () => {
|
|
3246
|
-
|
|
3231
|
+
s = !0, a.forEach((e => e.reject("task canceled"))), a.clear(), c.forEach((e => e.worker.terminate())),
|
|
3247
3232
|
c.length = 0;
|
|
3248
3233
|
},
|
|
3249
3234
|
handler: e => function(...t) {
|
|
@@ -3266,52 +3251,52 @@ const createSystem = e => {
|
|
|
3266
3251
|
})
|
|
3267
3252
|
};
|
|
3268
3253
|
return D.resolveModuleId = e => ((e, t, r) => {
|
|
3269
|
-
const
|
|
3270
|
-
async isFile(
|
|
3271
|
-
const o = normalizeFsPath(
|
|
3272
|
-
if ((await t.stat(o)).isFile)
|
|
3254
|
+
const n = ((e, t, r) => ({
|
|
3255
|
+
async isFile(n, s) {
|
|
3256
|
+
const o = normalizeFsPath(n);
|
|
3257
|
+
if ((await t.stat(o)).isFile) s(null, !0); else {
|
|
3273
3258
|
if (shouldFetchModule(o) && r.some((e => o.endsWith(e)))) {
|
|
3274
3259
|
const r = getNodeModuleFetchUrl(e, packageVersions, o);
|
|
3275
|
-
return void
|
|
3260
|
+
return void s(null, "string" == typeof await fetchModuleAsync(e, t, packageVersions, r, o));
|
|
3276
3261
|
}
|
|
3277
|
-
|
|
3262
|
+
s(null, !1);
|
|
3278
3263
|
}
|
|
3279
3264
|
},
|
|
3280
|
-
async isDirectory(r,
|
|
3281
|
-
const
|
|
3282
|
-
if ((await t.stat(
|
|
3283
|
-
if (shouldFetchModule(
|
|
3284
|
-
if ("node_modules" === path$2.basename(
|
|
3285
|
-
void
|
|
3286
|
-
if (isCommonDirModuleFile(
|
|
3265
|
+
async isDirectory(r, n) {
|
|
3266
|
+
const s = normalizeFsPath(r);
|
|
3267
|
+
if ((await t.stat(s)).isDirectory) n(null, !0); else {
|
|
3268
|
+
if (shouldFetchModule(s)) {
|
|
3269
|
+
if ("node_modules" === path$2.basename(s)) return t.sys.createDirSync(s), t.clearFileCache(s),
|
|
3270
|
+
void n(null, !0);
|
|
3271
|
+
if (isCommonDirModuleFile(s)) return void n(null, !1);
|
|
3287
3272
|
for (const r of COMMON_DIR_FILENAMES) {
|
|
3288
|
-
const o = getCommonDirUrl(e, packageVersions,
|
|
3289
|
-
if (isString(a)) return void
|
|
3273
|
+
const o = getCommonDirUrl(e, packageVersions, s, r), i = getCommonDirName(s, r), a = await fetchModuleAsync(e, t, packageVersions, o, i);
|
|
3274
|
+
if (isString(a)) return void n(null, !0);
|
|
3290
3275
|
}
|
|
3291
3276
|
}
|
|
3292
|
-
|
|
3277
|
+
n(null, !1);
|
|
3293
3278
|
}
|
|
3294
3279
|
},
|
|
3295
3280
|
async readFile(e, r) {
|
|
3296
|
-
const
|
|
3297
|
-
return isString(
|
|
3281
|
+
const n = normalizeFsPath(e), s = await t.readFile(n);
|
|
3282
|
+
return isString(s) ? r(null, s) : r(`readFile not found: ${e}`);
|
|
3298
3283
|
},
|
|
3299
3284
|
async realpath(t, r) {
|
|
3300
|
-
const
|
|
3301
|
-
|
|
3285
|
+
const n = normalizeFsPath(t), s = await e.realpath(n);
|
|
3286
|
+
s.error && "ENOENT" !== s.error.code ? r(s.error) : r(null, s.error ? n : s.path);
|
|
3302
3287
|
},
|
|
3303
3288
|
extensions: r
|
|
3304
3289
|
}))(e, null, r.exts);
|
|
3305
|
-
return
|
|
3290
|
+
return n.basedir = path$2.dirname(normalizeFsPath(r.containingFile)), r.packageFilter ? n.packageFilter = r.packageFilter : null !== r.packageFilter && (n.packageFilter = e => (isString(e.main) && "" !== e.main || (e.main = "package.json"),
|
|
3306
3291
|
e)), new Promise(((e, t) => {
|
|
3307
|
-
resolve(r.moduleId,
|
|
3308
|
-
if (
|
|
3309
|
-
|
|
3292
|
+
resolve(r.moduleId, n, ((n, s, o) => {
|
|
3293
|
+
if (n) t(n); else {
|
|
3294
|
+
s = normalizePath(s);
|
|
3310
3295
|
const t = {
|
|
3311
3296
|
moduleId: r.moduleId,
|
|
3312
|
-
resolveId:
|
|
3297
|
+
resolveId: s,
|
|
3313
3298
|
pkgData: o,
|
|
3314
|
-
pkgDirPath: getPackageDirPath(
|
|
3299
|
+
pkgDirPath: getPackageDirPath(s, r.moduleId)
|
|
3315
3300
|
};
|
|
3316
3301
|
e(t);
|
|
3317
3302
|
}
|
|
@@ -3325,19 +3310,19 @@ const createSystem = e => {
|
|
|
3325
3310
|
let r = crypto$3.createHash("sha1").update(e).digest("hex").toLowerCase();
|
|
3326
3311
|
return "number" == typeof t && (r = r.slice(0, t)), Promise.resolve(r);
|
|
3327
3312
|
};
|
|
3328
|
-
const
|
|
3313
|
+
const n = t => {
|
|
3329
3314
|
const r = t;
|
|
3330
3315
|
return (...t) => (e++, r.apply(r, t));
|
|
3331
|
-
},
|
|
3316
|
+
}, s = e => {
|
|
3332
3317
|
const r = e;
|
|
3333
3318
|
return (...e) => (t++, r.apply(r, e));
|
|
3334
3319
|
};
|
|
3335
|
-
if (r.access =
|
|
3336
|
-
r.readFile =
|
|
3337
|
-
r.readDirSync =
|
|
3338
|
-
r.copyFile =
|
|
3339
|
-
r.removeFile =
|
|
3340
|
-
r.writeFileSync =
|
|
3320
|
+
if (r.access = n(r.access), r.accessSync = n(r.accessSync), r.homeDir = n(r.homeDir),
|
|
3321
|
+
r.readFile = n(r.readFile), r.readFileSync = n(r.readFileSync), r.readDir = n(r.readDir),
|
|
3322
|
+
r.readDirSync = n(r.readDirSync), r.stat = n(r.stat), r.statSync = n(r.statSync),
|
|
3323
|
+
r.copyFile = s(r.copyFile), r.createDir = s(r.createDir), r.createDirSync = s(r.createDirSync),
|
|
3324
|
+
r.removeFile = s(r.removeFile), r.removeFileSync = s(r.removeFileSync), r.writeFile = s(r.writeFile),
|
|
3325
|
+
r.writeFileSync = s(r.writeFileSync), r.getCompilerExecutingPath = () => "bin/rindo.js",
|
|
3341
3326
|
Object.defineProperties(r, {
|
|
3342
3327
|
diskReads: {
|
|
3343
3328
|
get: () => e,
|
|
@@ -3532,18 +3517,18 @@ class E2EElement extends index_cjs.MockHTMLElement {
|
|
|
3532
3517
|
return new Promise(((e, t) => {
|
|
3533
3518
|
const r = setInterval((async () => {
|
|
3534
3519
|
await this.isVisible() && (clearInterval(r), clearTimeout(o), e());
|
|
3535
|
-
}), 10),
|
|
3536
|
-
clearTimeout(r), t(
|
|
3537
|
-
}),
|
|
3520
|
+
}), 10), n = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, s = new Error(`waitForVisible timed out: ${n}ms`), o = setTimeout((() => {
|
|
3521
|
+
clearTimeout(r), t(s);
|
|
3522
|
+
}), n);
|
|
3538
3523
|
}));
|
|
3539
3524
|
}
|
|
3540
3525
|
waitForNotVisible() {
|
|
3541
3526
|
return new Promise(((e, t) => {
|
|
3542
3527
|
const r = setInterval((async () => {
|
|
3543
3528
|
await this.isVisible() || (clearInterval(r), clearTimeout(o), e());
|
|
3544
|
-
}), 10),
|
|
3545
|
-
clearTimeout(r), t(
|
|
3546
|
-
}),
|
|
3529
|
+
}), 10), n = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, s = new Error(`waitForNotVisible timed out: ${n}ms`), o = setTimeout((() => {
|
|
3530
|
+
clearTimeout(r), t(s);
|
|
3531
|
+
}), n);
|
|
3547
3532
|
}));
|
|
3548
3533
|
}
|
|
3549
3534
|
isIntersectingViewport() {
|
|
@@ -3699,15 +3684,15 @@ class E2EElement extends index_cjs.MockHTMLElement {
|
|
|
3699
3684
|
}
|
|
3700
3685
|
async getComputedStyle(e) {
|
|
3701
3686
|
const t = await this._page.evaluate(((e, t) => {
|
|
3702
|
-
const r = {},
|
|
3703
|
-
return Object.keys(
|
|
3687
|
+
const r = {}, n = window.getComputedStyle(e, t);
|
|
3688
|
+
return Object.keys(n).forEach((e => {
|
|
3704
3689
|
if (isNaN(e)) {
|
|
3705
|
-
const t =
|
|
3690
|
+
const t = n[e];
|
|
3706
3691
|
null != t && (r[e] = t);
|
|
3707
3692
|
} else {
|
|
3708
|
-
const t =
|
|
3693
|
+
const t = n[e];
|
|
3709
3694
|
if (t.includes("-")) {
|
|
3710
|
-
const e =
|
|
3695
|
+
const e = n.getPropertyValue(t);
|
|
3711
3696
|
null != e && (r[t] = e);
|
|
3712
3697
|
}
|
|
3713
3698
|
}
|
|
@@ -3724,8 +3709,8 @@ class E2EElement extends index_cjs.MockHTMLElement {
|
|
|
3724
3709
|
const r = t.eventInitDict || {};
|
|
3725
3710
|
"boolean" != typeof r.bubbles && (r.bubbles = !0), "boolean" != typeof r.cancelable && (r.cancelable = !0),
|
|
3726
3711
|
"boolean" != typeof r.composed && (r.composed = !0);
|
|
3727
|
-
const
|
|
3728
|
-
e.dispatchEvent(
|
|
3712
|
+
const n = new CustomEvent(t.eventName, r);
|
|
3713
|
+
e.dispatchEvent(n);
|
|
3729
3714
|
}
|
|
3730
3715
|
})), r && "function" == typeof r.then ? r.then((e => e)) : r;
|
|
3731
3716
|
}))), this._elmHandle, this._queuedActions);
|
|
@@ -3737,9 +3722,9 @@ class E2EElement extends index_cjs.MockHTMLElement {
|
|
|
3737
3722
|
shadowRootHTML: e.shadowRoot ? e.shadowRoot.innerHTML : null
|
|
3738
3723
|
})), this._elmHandle);
|
|
3739
3724
|
"string" == typeof r ? (this.shadowRoot = index_cjs.parseHtmlToFragment(r), this.shadowRoot.host = this) : this.shadowRoot = null;
|
|
3740
|
-
const
|
|
3741
|
-
for (this.nodeName =
|
|
3742
|
-
for (;
|
|
3725
|
+
const n = index_cjs.parseHtmlToFragment(t).firstElementChild;
|
|
3726
|
+
for (this.nodeName = n.nodeName, this.attributes = index_cjs.cloneAttributes(n.attributes); this.childNodes.length > 0; ) this.removeChild(this.childNodes[0]);
|
|
3727
|
+
for (;n.childNodes.length > 0; ) this.appendChild(n.childNodes[0]);
|
|
3743
3728
|
}
|
|
3744
3729
|
_validate() {
|
|
3745
3730
|
if (this._queuedActions.length > 0) throw new Error("await page.waitForChanges() must be called before reading element information");
|
|
@@ -3771,15 +3756,15 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3771
3756
|
const r = {
|
|
3772
3757
|
browserWSEndpoint: t,
|
|
3773
3758
|
ignoreHTTPSErrors: !0
|
|
3774
|
-
},
|
|
3775
|
-
return await
|
|
3759
|
+
}, n = require(e.__RINDO_PUPPETEER_MODULE__);
|
|
3760
|
+
return await n.connect(r);
|
|
3776
3761
|
}());
|
|
3777
3762
|
const t = await function r(e) {
|
|
3778
3763
|
return e.newPage();
|
|
3779
3764
|
}(this.browser);
|
|
3780
3765
|
this.pages.push(t);
|
|
3781
|
-
const
|
|
3782
|
-
return "string" == typeof
|
|
3766
|
+
const n = process.env;
|
|
3767
|
+
return "string" == typeof n.__RINDO_DEFAULT_TIMEOUT__ && t.setDefaultTimeout(parseInt(n.__RINDO_DEFAULT_TIMEOUT__, 10)),
|
|
3783
3768
|
t;
|
|
3784
3769
|
}
|
|
3785
3770
|
async closeOpenPages() {
|
|
@@ -3800,15 +3785,15 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3800
3785
|
var e;
|
|
3801
3786
|
const t = null !== (e = require("jest-runner").default) && void 0 !== e ? e : require("jest-runner");
|
|
3802
3787
|
return class r extends t {
|
|
3803
|
-
async runTests(e, t, r,
|
|
3788
|
+
async runTests(e, t, r, n, s, o) {
|
|
3804
3789
|
const i = process.env;
|
|
3805
3790
|
if (e = e.filter((e => function t(e, r) {
|
|
3806
|
-
const
|
|
3807
|
-
return !("true" !== r.__RINDO_E2E_TESTS__ || !
|
|
3791
|
+
const n = (e = e.toLowerCase().replace(/\\/g, "/")).includes(".e2e.") || e.includes("/e2e.");
|
|
3792
|
+
return !("true" !== r.__RINDO_E2E_TESTS__ || !n) || "true" === r.__RINDO_SPEC_TESTS__ && !n;
|
|
3808
3793
|
}(e.path, i))), "true" === i.__RINDO_SCREENSHOT__) {
|
|
3809
3794
|
const a = JSON.parse(i.__RINDO_EMULATE_CONFIGS__);
|
|
3810
|
-
for (let l = 0; l < a.length; l++) setScreenshotEmulateData(a[l], i), await super.runTests(e, t, r,
|
|
3811
|
-
} else await super.runTests(e, t, r,
|
|
3795
|
+
for (let l = 0; l < a.length; l++) setScreenshotEmulateData(a[l], i), await super.runTests(e, t, r, n, s, o);
|
|
3796
|
+
} else await super.runTests(e, t, r, n, s, o);
|
|
3812
3797
|
}
|
|
3813
3798
|
};
|
|
3814
3799
|
}, exports.createTesting = async e => {
|
|
@@ -3819,12 +3804,12 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3819
3804
|
"www" === e.type && (e.serviceWorker = null);
|
|
3820
3805
|
})), e.flags.args.includes("--watchAll") && (e.watch = !0), e;
|
|
3821
3806
|
}(e);
|
|
3822
|
-
const {createCompiler: r} = require("../compiler/rindo.js"),
|
|
3823
|
-
let
|
|
3807
|
+
const {createCompiler: r} = require("../compiler/rindo.js"), n = await r(e);
|
|
3808
|
+
let s, o;
|
|
3824
3809
|
const i = async () => {
|
|
3825
3810
|
const t = [];
|
|
3826
|
-
e && (e.sys && e.sys.destroy && t.push(e.sys.destroy()), e = null),
|
|
3827
|
-
|
|
3811
|
+
e && (e.sys && e.sys.destroy && t.push(e.sys.destroy()), e = null), s && (s.close && t.push(s.close()),
|
|
3812
|
+
s = null), o && (o.close && t.push(o.close()), o = null), await Promise.all(t);
|
|
3828
3813
|
};
|
|
3829
3814
|
return {
|
|
3830
3815
|
destroy: i,
|
|
@@ -3843,22 +3828,22 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3843
3828
|
e.empty = !1;
|
|
3844
3829
|
}));
|
|
3845
3830
|
const a = !(e.flags && !1 === e.flags.build);
|
|
3846
|
-
a && e.watch && (c = await
|
|
3831
|
+
a && e.watch && (c = await n.createWatcher()), a && (c ? (t = new Promise((e => {
|
|
3847
3832
|
const t = c.on("buildFinish", (r => {
|
|
3848
3833
|
t(), e(r);
|
|
3849
3834
|
}));
|
|
3850
|
-
})), c.start()) : t =
|
|
3835
|
+
})), c.start()) : t = n.build()), e.devServer.openBrowser = !1, e.devServer.gzip = !1,
|
|
3851
3836
|
e.devServer.reloadStrategy = null;
|
|
3852
3837
|
const l = await Promise.all([ index_js.start(e.devServer, e.logger), startPuppeteerBrowser(e) ]);
|
|
3853
|
-
if (
|
|
3838
|
+
if (s = l[0], o = l[1], t) {
|
|
3854
3839
|
const r = await t;
|
|
3855
3840
|
if (!r || !e.watch && hasError(r && r.diagnostics)) return await i(), !1;
|
|
3856
3841
|
}
|
|
3857
|
-
|
|
3842
|
+
s && (r.__RINDO_BROWSER_URL__ = s.browserUrl, e.logger.debug(`e2e dev server url: ${r.__RINDO_BROWSER_URL__}`),
|
|
3858
3843
|
r.__RINDO_APP_SCRIPT_URL__ = function d(e, t) {
|
|
3859
3844
|
return getAppUrl(e, t, `${e.fsNamespace}.esm.js`);
|
|
3860
|
-
}(e,
|
|
3861
|
-
getAppStyleUrl(e,
|
|
3845
|
+
}(e, s.browserUrl), e.logger.debug(`e2e app script url: ${r.__RINDO_APP_SCRIPT_URL__}`),
|
|
3846
|
+
getAppStyleUrl(e, s.browserUrl) && (r.__RINDO_APP_STYLE_URL__ = getAppStyleUrl(e, s.browserUrl),
|
|
3862
3847
|
e.logger.debug(`e2e app style url: ${r.__RINDO_APP_STYLE_URL__}`)));
|
|
3863
3848
|
}
|
|
3864
3849
|
} catch (t) {
|
|
@@ -3867,9 +3852,9 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3867
3852
|
try {
|
|
3868
3853
|
l = a ? await async function h(e, t) {
|
|
3869
3854
|
e.logger.debug(`screenshot connector: ${e.testing.screenshotConnector}`);
|
|
3870
|
-
const r = new (require(e.testing.screenshotConnector)),
|
|
3871
|
-
e.logger.debug(`pixelmatch module: ${
|
|
3872
|
-
const
|
|
3855
|
+
const r = new (require(e.testing.screenshotConnector)), n = path$2.join(e.sys.getCompilerExecutingPath(), "..", "..", "screenshot", "pixel-match.js");
|
|
3856
|
+
e.logger.debug(`pixelmatch module: ${n}`);
|
|
3857
|
+
const s = e.logger.createTimeSpan("screenshot, initBuild started", !0);
|
|
3873
3858
|
await r.initBuild({
|
|
3874
3859
|
buildId: createBuildId(),
|
|
3875
3860
|
buildMessage: createBuildMessage(),
|
|
@@ -3884,25 +3869,25 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3884
3869
|
allowableMismatchedRatio: e.testing.allowableMismatchedRatio,
|
|
3885
3870
|
pixelmatchThreshold: e.testing.pixelmatchThreshold,
|
|
3886
3871
|
waitBeforeScreenshot: e.testing.waitBeforeScreenshot,
|
|
3887
|
-
pixelmatchModulePath:
|
|
3888
|
-
}), e.flags.updateScreenshot || await r.pullMasterBuild(),
|
|
3872
|
+
pixelmatchModulePath: n
|
|
3873
|
+
}), e.flags.updateScreenshot || await r.pullMasterBuild(), s.finish("screenshot, initBuild finished");
|
|
3889
3874
|
const o = await Promise.all([ await r.getMasterBuild(), await r.getScreenshotCache() ]), i = o[0], a = o[1];
|
|
3890
3875
|
t.__RINDO_SCREENSHOT_BUILD__ = r.toJson(i, a);
|
|
3891
3876
|
const l = e.logger.createTimeSpan("screenshot, tests started", !0), c = await runJest(e, t);
|
|
3892
3877
|
l.finish(`screenshot, tests finished, passed: ${c}`);
|
|
3893
3878
|
try {
|
|
3894
3879
|
const t = e.logger.createTimeSpan("screenshot, completeTimespan started", !0);
|
|
3895
|
-
let
|
|
3896
|
-
if (t.finish("screenshot, completeTimespan finished"),
|
|
3880
|
+
let n = await r.completeBuild(i);
|
|
3881
|
+
if (t.finish("screenshot, completeTimespan finished"), n) {
|
|
3897
3882
|
const t = e.logger.createTimeSpan("screenshot, publishBuild started", !0);
|
|
3898
|
-
if (
|
|
3899
|
-
e.flags.updateScreenshot)
|
|
3883
|
+
if (n = await r.publishBuild(n), t.finish("screenshot, publishBuild finished"),
|
|
3884
|
+
e.flags.updateScreenshot) n.currentBuild && "string" == typeof n.currentBuild.previewUrl && e.logger.info(e.logger.magenta(n.currentBuild.previewUrl)); else if (n.compare) {
|
|
3900
3885
|
try {
|
|
3901
|
-
await r.updateScreenshotCache(a,
|
|
3886
|
+
await r.updateScreenshotCache(a, n);
|
|
3902
3887
|
} catch (t) {
|
|
3903
3888
|
e.logger.error(t);
|
|
3904
3889
|
}
|
|
3905
|
-
e.logger.info(`screenshots compared: ${
|
|
3890
|
+
e.logger.info(`screenshots compared: ${n.compare.diffs.length}`), "string" == typeof n.compare.url && e.logger.info(e.logger.magenta(n.compare.url));
|
|
3906
3891
|
}
|
|
3907
3892
|
}
|
|
3908
3893
|
} catch (t) {
|
|
@@ -4002,6 +3987,7 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
4002
3987
|
flags: createConfigFlags(),
|
|
4003
3988
|
logger: mockLogger(),
|
|
4004
3989
|
outputTargets: null !== (t = r.outputTargets) && void 0 !== t ? t : [],
|
|
3990
|
+
rootDir: path__default.default.resolve("/"),
|
|
4005
3991
|
sys: createTestingSystem(),
|
|
4006
3992
|
testing: {},
|
|
4007
3993
|
...e
|
|
@@ -4012,26 +3998,26 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
4012
3998
|
if (!global.__NEW_TEST_PAGE__) throw new Error("newE2EPage() is only available from E2E tests, and ran with the --e2e cmd line flag.");
|
|
4013
3999
|
const t = await global.__NEW_TEST_PAGE__(), r = [];
|
|
4014
4000
|
try {
|
|
4015
|
-
t._e2eElements = [], t._e2eGoto = t.goto, t._e2eClose = t.close, await async function
|
|
4001
|
+
t._e2eElements = [], t._e2eGoto = t.goto, t._e2eClose = t.close, await async function n(e) {
|
|
4016
4002
|
if (e.isClosed()) return;
|
|
4017
4003
|
const t = env.__RINDO_EMULATE__;
|
|
4018
4004
|
if (!t) return;
|
|
4019
|
-
const r = JSON.parse(t),
|
|
4005
|
+
const r = JSON.parse(t), n = {
|
|
4020
4006
|
viewport: r.viewport,
|
|
4021
4007
|
userAgent: r.userAgent
|
|
4022
4008
|
};
|
|
4023
|
-
await e.emulate(
|
|
4024
|
-
}(t), await t.setCacheEnabled(!1), await initPageEvents(t), function
|
|
4009
|
+
await e.emulate(n);
|
|
4010
|
+
}(t), await t.setCacheEnabled(!1), await initPageEvents(t), function s(e) {
|
|
4025
4011
|
const t = process.env;
|
|
4026
|
-
"true" === t.__RINDO_SCREENSHOT__ ? e.compareScreenshot = (r,
|
|
4027
|
-
const
|
|
4012
|
+
"true" === t.__RINDO_SCREENSHOT__ ? e.compareScreenshot = (r, n) => {
|
|
4013
|
+
const s = global;
|
|
4028
4014
|
let o, i = "", a = "";
|
|
4029
|
-
if (
|
|
4030
|
-
"string" == typeof
|
|
4031
|
-
"object" == typeof
|
|
4015
|
+
if (s.currentSpec && ("string" == typeof s.currentSpec.fullName && (i = s.currentSpec.fullName),
|
|
4016
|
+
"string" == typeof s.currentSpec.testPath && (a = s.currentSpec.testPath)), "string" == typeof r ? (i.length > 0 ? i += ", " + r : i = r,
|
|
4017
|
+
"object" == typeof n && (o = n)) : "object" == typeof r && (o = r), i = i.trim(),
|
|
4032
4018
|
o = o || {}, !i) throw new Error(`Invalid screenshot description in "${a}"`);
|
|
4033
|
-
if (
|
|
4034
|
-
return
|
|
4019
|
+
if (s.screenshotDescriptions.has(i)) throw new Error(`Screenshot description "${i}" found in "${a}" cannot be used for multiple screenshots and must be unique. To make screenshot descriptions unique within the same test, use the first argument to "compareScreenshot", such as "compareScreenshot('more to the description')".`);
|
|
4020
|
+
return s.screenshotDescriptions.add(i), async function l(e, t, r, n, s) {
|
|
4035
4021
|
if ("string" != typeof t.__RINDO_EMULATE__) throw new Error("compareScreenshot, missing screenshot emulate env var");
|
|
4036
4022
|
if ("string" != typeof t.__RINDO_SCREENSHOT_BUILD__) throw new Error("compareScreenshot, missing screen build env var");
|
|
4037
4023
|
const o = JSON.parse(t.__RINDO_EMULATE__), i = JSON.parse(t.__RINDO_SCREENSHOT_BUILD__);
|
|
@@ -4055,10 +4041,10 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
4055
4041
|
width: e.clip.width,
|
|
4056
4042
|
height: e.clip.height
|
|
4057
4043
|
}), t;
|
|
4058
|
-
}(
|
|
4044
|
+
}(s), u = await e.screenshot(l), d = "number" == typeof s.pixelmatchThreshold ? s.pixelmatchThreshold : i.pixelmatchThreshold;
|
|
4059
4045
|
let h = o.viewport.width, p = o.viewport.height;
|
|
4060
|
-
return
|
|
4061
|
-
await compareScreenshot(o, i, u, r, h, p,
|
|
4046
|
+
return s && s.clip && ("number" == typeof s.clip.width && (h = s.clip.width), "number" == typeof s.clip.height && (p = s.clip.height)),
|
|
4047
|
+
await compareScreenshot(o, i, u, r, h, p, n, d);
|
|
4062
4048
|
}(e, t, i, a, o);
|
|
4063
4049
|
} : e.compareScreenshot = async () => ({
|
|
4064
4050
|
mismatchedPixels: 0,
|
|
@@ -4070,7 +4056,7 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
4070
4056
|
deviceScaleFactor: 1
|
|
4071
4057
|
});
|
|
4072
4058
|
}(t);
|
|
4073
|
-
let
|
|
4059
|
+
let n = null;
|
|
4074
4060
|
t.close = async e => {
|
|
4075
4061
|
try {
|
|
4076
4062
|
if (Array.isArray(t._e2eElements)) {
|
|
@@ -4090,15 +4076,15 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
4090
4076
|
t.isClosed() || await t._e2eClose(e);
|
|
4091
4077
|
} catch (e) {}
|
|
4092
4078
|
};
|
|
4093
|
-
const
|
|
4079
|
+
const s = async () => (n || (n = t.evaluateHandle((() => document))), (await n).asElement());
|
|
4094
4080
|
t.find = async e => {
|
|
4095
|
-
const r = await
|
|
4081
|
+
const r = await s();
|
|
4096
4082
|
return find(t, r, e);
|
|
4097
4083
|
}, t.findAll = async e => {
|
|
4098
|
-
const r = await
|
|
4084
|
+
const r = await s();
|
|
4099
4085
|
return findAll(t, r, e);
|
|
4100
4086
|
}, t.waitForEvent = async e => {
|
|
4101
|
-
const r = await
|
|
4087
|
+
const r = await s();
|
|
4102
4088
|
return waitForEvent(t, e, r);
|
|
4103
4089
|
}, t.getDiagnostics = () => r, t.waitForChanges = waitForChanges.bind(null, t),
|
|
4104
4090
|
t.debugger = () => {
|
|
@@ -4115,8 +4101,8 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
4115
4101
|
location: e.location().url
|
|
4116
4102
|
}), o)) throw new Error(serializeConsoleMessage(e));
|
|
4117
4103
|
!function t(e) {
|
|
4118
|
-
const t = serializeConsoleMessage(e), r = e.type(),
|
|
4119
|
-
"debug" !==
|
|
4104
|
+
const t = serializeConsoleMessage(e), r = e.type(), n = "warning" === r ? "warn" : r;
|
|
4105
|
+
"debug" !== n && ("function" == typeof console[n] ? console[n](t) : console.log(r, t));
|
|
4120
4106
|
}(e);
|
|
4121
4107
|
})), t.on("pageerror", (e => {
|
|
4122
4108
|
throw r.push({
|
|
@@ -4149,7 +4135,7 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
4149
4135
|
appData.BUILD.cssAnnotations = e.includeAnnotations;
|
|
4150
4136
|
const t = new Set;
|
|
4151
4137
|
testing.win.__rindo_spec_options = e;
|
|
4152
|
-
const r = testing.win.document,
|
|
4138
|
+
const r = testing.win.document, n = {
|
|
4153
4139
|
win: testing.win,
|
|
4154
4140
|
doc: r,
|
|
4155
4141
|
body: r.body,
|
|
@@ -4159,7 +4145,7 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
4159
4145
|
waitForChanges: testing.flushAll,
|
|
4160
4146
|
flushLoadModule: testing.flushLoadModule,
|
|
4161
4147
|
flushQueue: testing.flushQueue
|
|
4162
|
-
},
|
|
4148
|
+
}, s = e.components.map((e => {
|
|
4163
4149
|
if (null == e.COMPILER_META) throw new Error('Invalid component class: Missing static "COMPILER_META" property.');
|
|
4164
4150
|
t.add(e.COMPILER_META.tagName), e.isProxied = !1, function r(e) {
|
|
4165
4151
|
"function" == typeof e.prototype.__componentWillLoad && (e.prototype.componentWillLoad = e.prototype.__componentWillLoad,
|
|
@@ -4182,22 +4168,22 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
4182
4168
|
e;
|
|
4183
4169
|
});
|
|
4184
4170
|
}(e);
|
|
4185
|
-
const
|
|
4186
|
-
if (Array.isArray(
|
|
4171
|
+
const n = `${e.COMPILER_META.tagName}.${Math.round(899999 * Math.random()) + 1e5}`, s = e.COMPILER_META.styles;
|
|
4172
|
+
if (Array.isArray(s)) if (s.length > 1) {
|
|
4187
4173
|
const t = {};
|
|
4188
|
-
|
|
4174
|
+
s.forEach((e => {
|
|
4189
4175
|
t[e.modeName] = e.styleStr;
|
|
4190
4176
|
})), e.style = t;
|
|
4191
|
-
} else 1 ===
|
|
4192
|
-
return testing.registerModule(
|
|
4177
|
+
} else 1 === s.length && (e.style = s[0].styleStr);
|
|
4178
|
+
return testing.registerModule(n, e), ((e, t) => [ e, t.map((e => ((e, t) => {
|
|
4193
4179
|
let r = 0;
|
|
4194
4180
|
"shadow" === e.encapsulation ? (r |= 1, e.shadowDelegatesFocus && (r |= 16)) : "scoped" === e.encapsulation && (r |= 2),
|
|
4195
4181
|
"shadow" !== e.encapsulation && e.htmlTagNames.includes("slot") && (r |= 4), e.hasMode && (r |= 32);
|
|
4196
|
-
const
|
|
4197
|
-
return trimFalsy([ r, e.tagName, Object.keys(
|
|
4198
|
-
})(e, !0))) ])(
|
|
4182
|
+
const n = formatComponentRuntimeMembers(e, t), s = formatHostListeners(e);
|
|
4183
|
+
return trimFalsy([ r, e.tagName, Object.keys(n).length > 0 ? n : void 0, s.length > 0 ? s : void 0 ]);
|
|
4184
|
+
})(e, !0))) ])(n, [ e.COMPILER_META ]);
|
|
4199
4185
|
})), o = (e => {
|
|
4200
|
-
const t = e.some((e => e.htmlTagNames.includes("slot"))), r = e.some((e => "shadow" === e.encapsulation)),
|
|
4186
|
+
const t = e.some((e => e.htmlTagNames.includes("slot"))), r = e.some((e => "shadow" === e.encapsulation)), n = e.some((e => "shadow" !== e.encapsulation && e.htmlTagNames.includes("slot"))), s = {
|
|
4201
4187
|
allRenderFn: e.every((e => e.hasRenderFn)),
|
|
4202
4188
|
cmpDidLoad: e.some((e => e.hasComponentDidLoadFn)),
|
|
4203
4189
|
cmpShouldUpdate: e.some((e => e.hasComponentShouldUpdateFn)),
|
|
@@ -4234,7 +4220,7 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
4234
4220
|
shadowDom: r,
|
|
4235
4221
|
shadowDelegatesFocus: r && e.some((e => e.shadowDelegatesFocus)),
|
|
4236
4222
|
slot: t,
|
|
4237
|
-
slotRelocation:
|
|
4223
|
+
slotRelocation: n,
|
|
4238
4224
|
state: e.some((e => e.hasState)),
|
|
4239
4225
|
style: e.some((e => e.hasStyle)),
|
|
4240
4226
|
svg: e.some((e => e.htmlTagNames.includes("svg"))),
|
|
@@ -4253,27 +4239,27 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
4253
4239
|
watchCallback: e.some((e => e.hasWatchCallback)),
|
|
4254
4240
|
taskQueue: !0
|
|
4255
4241
|
};
|
|
4256
|
-
return
|
|
4257
|
-
|
|
4242
|
+
return s.asyncLoading = s.cmpWillUpdate || s.cmpWillLoad || s.cmpWillRender, s.vdomAttribute = s.vdomAttribute || s.reflect,
|
|
4243
|
+
s.vdomPropOrAttr = s.vdomPropOrAttr || s.reflect, s;
|
|
4258
4244
|
})(e.components.map((e => e.COMPILER_META)));
|
|
4259
4245
|
if (e.strictBuild ? Object.assign(appData.BUILD, o) : Object.keys(o).forEach((e => {
|
|
4260
4246
|
!0 === o[e] && (appData.BUILD[e] = !0);
|
|
4261
4247
|
})), appData.BUILD.asyncLoading = !0, e.hydrateClientSide ? (appData.BUILD.hydrateClientSide = !0,
|
|
4262
4248
|
appData.BUILD.hydrateServerSide = !1) : e.hydrateServerSide && (appData.BUILD.hydrateServerSide = !0,
|
|
4263
4249
|
appData.BUILD.hydrateClientSide = !1), appData.BUILD.cloneNodeFix = !1, appData.BUILD.shadowDomShim = !1,
|
|
4264
|
-
appData.BUILD.safari10 = !1, appData.BUILD.attachStyles = !!e.attachStyles, "string" == typeof e.url && (
|
|
4265
|
-
"string" == typeof e.direction &&
|
|
4266
|
-
"string" == typeof e.language &&
|
|
4250
|
+
appData.BUILD.safari10 = !1, appData.BUILD.attachStyles = !!e.attachStyles, "string" == typeof e.url && (n.win.location.href = e.url),
|
|
4251
|
+
"string" == typeof e.direction && n.doc.documentElement.setAttribute("dir", e.direction),
|
|
4252
|
+
"string" == typeof e.language && n.doc.documentElement.setAttribute("lang", e.language),
|
|
4267
4253
|
"string" == typeof e.cookie) try {
|
|
4268
|
-
|
|
4254
|
+
n.doc.cookie = e.cookie;
|
|
4269
4255
|
} catch (e) {}
|
|
4270
4256
|
if ("string" == typeof e.referrer) try {
|
|
4271
|
-
|
|
4257
|
+
n.doc.referrer = e.referrer;
|
|
4272
4258
|
} catch (e) {}
|
|
4273
4259
|
if ("string" == typeof e.userAgent) try {
|
|
4274
|
-
|
|
4260
|
+
n.win.navigator.userAgent = e.userAgent;
|
|
4275
4261
|
} catch (e) {}
|
|
4276
|
-
if (testing.bootstrapLazy(
|
|
4262
|
+
if (testing.bootstrapLazy(s), "function" == typeof e.template) {
|
|
4277
4263
|
const t = {
|
|
4278
4264
|
$ancestorComponent$: void 0,
|
|
4279
4265
|
$flags$: 0,
|
|
@@ -4282,29 +4268,29 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
4282
4268
|
$flags$: 0,
|
|
4283
4269
|
$tagName$: "body"
|
|
4284
4270
|
},
|
|
4285
|
-
$hostElement$:
|
|
4271
|
+
$hostElement$: n.body
|
|
4286
4272
|
};
|
|
4287
4273
|
testing.renderVdom(t, e.template());
|
|
4288
|
-
} else "string" == typeof e.html && (
|
|
4289
|
-
!1 !== e.flushQueue && await
|
|
4274
|
+
} else "string" == typeof e.html && (n.body.innerHTML = e.html);
|
|
4275
|
+
!1 !== e.flushQueue && await n.waitForChanges();
|
|
4290
4276
|
let i = null;
|
|
4291
|
-
return Object.defineProperty(
|
|
4277
|
+
return Object.defineProperty(n, "root", {
|
|
4292
4278
|
get() {
|
|
4293
|
-
if (null == i && (i = findRootComponent(t,
|
|
4294
|
-
const e =
|
|
4279
|
+
if (null == i && (i = findRootComponent(t, n.body)), null != i) return i;
|
|
4280
|
+
const e = n.body.firstElementChild;
|
|
4295
4281
|
return null != e ? e : null;
|
|
4296
4282
|
}
|
|
4297
|
-
}), Object.defineProperty(
|
|
4283
|
+
}), Object.defineProperty(n, "rootInstance", {
|
|
4298
4284
|
get() {
|
|
4299
|
-
const e = testing.getHostRef(
|
|
4285
|
+
const e = testing.getHostRef(n.root);
|
|
4300
4286
|
return null != e ? e.$lazyInstance$ : null;
|
|
4301
4287
|
}
|
|
4302
4288
|
}), e.hydrateServerSide && testing.insertVdomAnnotations(r, []), e.autoApplyChanges && (testing.startAutoApplyChanges(),
|
|
4303
|
-
|
|
4304
|
-
Promise.resolve())),
|
|
4289
|
+
n.waitForChanges = () => (console.error('waitForChanges() cannot be used manually if the "startAutoApplyChanges" option is enabled'),
|
|
4290
|
+
Promise.resolve())), n;
|
|
4305
4291
|
}, exports.shuffleArray = function shuffleArray(e) {
|
|
4306
|
-
let t, r,
|
|
4307
|
-
for (;0 !==
|
|
4292
|
+
let t, r, n = e.length;
|
|
4293
|
+
for (;0 !== n; ) r = Math.floor(Math.random() * n), n -= 1, t = e[n], e[n] = e[r],
|
|
4308
4294
|
e[r] = t;
|
|
4309
4295
|
return e;
|
|
4310
4296
|
}, exports.transpile = transpile;
|