@rindo/core 2.17.3 → 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 +32 -16
- package/cli/index.js +32 -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 +682 -222
- 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 +784 -794
- package/testing/jest/jest-config.d.ts +1 -1
- 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,38 +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
|
-
|
|
1326
|
-
}, isOutputTargetDistLazy = e => e.type === DIST_LAZY, isOutputTargetWww = e => e.type === WWW, DIST_LAZY = "dist-lazy", WWW = "www", isJest27TransformOptions = e => "object" == typeof e && e.hasOwnProperty("config");
|
|
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();
|
|
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
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
if ("
|
|
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) {
|
|
1319
|
+
var r;
|
|
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) {
|
|
1337
1324
|
if (t.includes("import ") || t.includes("import.") || t.includes("import(")) return !0;
|
|
1338
1325
|
if (t.includes("export ")) return !0;
|
|
1339
1326
|
}
|
|
1340
|
-
return "css" ===
|
|
1327
|
+
return "css" === n;
|
|
1341
1328
|
}(t, e)) {
|
|
1342
1329
|
const r = {
|
|
1343
1330
|
file: t,
|
|
1344
|
-
currentDirectory:
|
|
1345
|
-
},
|
|
1346
|
-
|
|
1331
|
+
currentDirectory: n.rootDir
|
|
1332
|
+
}, s = getCompilerOptions(n.rootDir);
|
|
1333
|
+
s && (s.baseUrl && (r.baseUrl = s.baseUrl), s.paths && (r.paths = s.paths));
|
|
1347
1334
|
const o = transpile(e, r), i = o.diagnostics.some((e => "error" === e.level));
|
|
1348
1335
|
if (o.diagnostics && i) {
|
|
1349
1336
|
const e = o.diagnostics.map(formatDiagnostic).join("\n\n");
|
|
@@ -1353,24 +1340,25 @@ const jestPreprocessor = {
|
|
|
1353
1340
|
}
|
|
1354
1341
|
return e;
|
|
1355
1342
|
},
|
|
1356
|
-
getCacheKey(e, t, r,
|
|
1357
|
-
if (isJest27TransformOptions(r) && (
|
|
1358
|
-
|
|
1343
|
+
getCacheKey(e, t, r, n) {
|
|
1344
|
+
if (isJest27TransformOptions(r) && (n = r.config), !n) throw "Unable to find Jest transformation options.";
|
|
1345
|
+
if (!_tsCompilerOptionsKey) {
|
|
1346
|
+
const e = getCompilerOptions(n.rootDir);
|
|
1359
1347
|
_tsCompilerOptionsKey = JSON.stringify(e);
|
|
1360
1348
|
}
|
|
1361
|
-
return [ process.version, _tsCompilerOptionsKey, e, t, r, !!
|
|
1349
|
+
return [ process.version, _tsCompilerOptionsKey, e, t, r, !!n.instrument, 7 ].join(":");
|
|
1362
1350
|
}
|
|
1363
1351
|
}, deepEqual = function e(t, r) {
|
|
1364
1352
|
if (t === r) return !0;
|
|
1365
1353
|
if (t && r && "object" == typeof t && "object" == typeof r) {
|
|
1366
|
-
const
|
|
1354
|
+
const n = Array.isArray(t), s = Array.isArray(r);
|
|
1367
1355
|
let o, i, a;
|
|
1368
|
-
if (
|
|
1356
|
+
if (n && s) {
|
|
1369
1357
|
if (i = t.length, i != r.length) return !1;
|
|
1370
1358
|
for (o = i; 0 != o--; ) if (!e(t[o], r[o])) return !1;
|
|
1371
1359
|
return !0;
|
|
1372
1360
|
}
|
|
1373
|
-
if (
|
|
1361
|
+
if (n != s) return !1;
|
|
1374
1362
|
const l = t instanceof Date, c = r instanceof Date;
|
|
1375
1363
|
if (l != c) return !1;
|
|
1376
1364
|
if (l && c) return t.getTime() == r.getTime();
|
|
@@ -1389,25 +1377,25 @@ const jestPreprocessor = {
|
|
|
1389
1377
|
if (!e) throw new Error("expect toMatchAttribute value is null");
|
|
1390
1378
|
if ("function" == typeof e.then) throw new Error("element must be a resolved value, not a promise, before it can be tested");
|
|
1391
1379
|
if (1 !== e.nodeType) throw new Error("expect toMatchAttribute value is not an element");
|
|
1392
|
-
let
|
|
1393
|
-
null != r && (r = String(r)), null !=
|
|
1394
|
-
const
|
|
1380
|
+
let n = e.getAttribute(t);
|
|
1381
|
+
null != r && (r = String(r)), null != n && (n = String(n));
|
|
1382
|
+
const s = r === n;
|
|
1395
1383
|
return {
|
|
1396
|
-
message: () => `expected attribute ${t} "${r}" to ${
|
|
1397
|
-
pass:
|
|
1384
|
+
message: () => `expected attribute ${t} "${r}" to ${s ? "not " : ""}equal "${n}"`,
|
|
1385
|
+
pass: s
|
|
1398
1386
|
};
|
|
1399
1387
|
},
|
|
1400
1388
|
toEqualAttributes: function toEqualAttributes(e, t) {
|
|
1401
1389
|
if (!e) throw new Error("expect toEqualAttributes value is null");
|
|
1402
1390
|
if ("function" == typeof e.then) throw new Error("element must be a resolved value, not a promise, before it can be tested");
|
|
1403
1391
|
if (1 !== e.nodeType) throw new Error("expect toEqualAttributes value is not an element");
|
|
1404
|
-
const r = Object.keys(t),
|
|
1405
|
-
let
|
|
1406
|
-
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;
|
|
1407
1395
|
}));
|
|
1408
1396
|
return {
|
|
1409
|
-
message: () => `expected attributes to ${
|
|
1410
|
-
pass:
|
|
1397
|
+
message: () => `expected attributes to ${n ? "not " : ""}equal ${r.map((e => `[${e}="${t[e]}"]`)).join(", ")}`,
|
|
1398
|
+
pass: n
|
|
1411
1399
|
};
|
|
1412
1400
|
},
|
|
1413
1401
|
toEqualHtml: function toEqualHtml(e, t) {
|
|
@@ -1422,10 +1410,10 @@ const jestPreprocessor = {
|
|
|
1422
1410
|
let r;
|
|
1423
1411
|
1 === e.nodeType ? r = e.textContent.replace(/\s\s+/g, " ").trim() : null != e && (r = String(e).replace(/\s\s+/g, " ").trim()),
|
|
1424
1412
|
"string" == typeof t && (t = t.replace(/\s\s+/g, " ").trim());
|
|
1425
|
-
const
|
|
1413
|
+
const n = r === t;
|
|
1426
1414
|
return {
|
|
1427
|
-
message: () => `expected textContent "${t}" to ${
|
|
1428
|
-
pass:
|
|
1415
|
+
message: () => `expected textContent "${t}" to ${n ? "not " : ""}equal "${r}"`,
|
|
1416
|
+
pass: n
|
|
1429
1417
|
};
|
|
1430
1418
|
},
|
|
1431
1419
|
toHaveAttribute: function toHaveAttribute(e, t) {
|
|
@@ -1502,12 +1490,12 @@ const jestPreprocessor = {
|
|
|
1502
1490
|
if ("function" == typeof e.then) throw new Error("event spy must be a resolved value, not a promise, before it can be tested");
|
|
1503
1491
|
if (!e.eventName) throw new Error("toHaveNthReceivedEventDetail did not receive an event spy");
|
|
1504
1492
|
if (!e.firstEvent) throw new Error(`event "${e.eventName}" was not received`);
|
|
1505
|
-
const
|
|
1506
|
-
if (!
|
|
1507
|
-
const
|
|
1508
|
-
return expect(
|
|
1509
|
-
message: () => `expected event "${e.eventName}" detail to ${
|
|
1510
|
-
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
|
|
1511
1499
|
};
|
|
1512
1500
|
},
|
|
1513
1501
|
toMatchScreenshot: function toMatchScreenshot(e, t = {}) {
|
|
@@ -1517,10 +1505,10 @@ const jestPreprocessor = {
|
|
|
1517
1505
|
const r = e.device || e.userAgent;
|
|
1518
1506
|
if ("number" == typeof t.allowableMismatchedRatio) {
|
|
1519
1507
|
if (t.allowableMismatchedRatio < 0 || t.allowableMismatchedRatio > 1) throw new Error("expect toMatchScreenshot() allowableMismatchedRatio must be a value ranging from 0 to 1");
|
|
1520
|
-
const
|
|
1508
|
+
const n = e.mismatchedPixels / (e.width * e.deviceScaleFactor * (e.height * e.deviceScaleFactor));
|
|
1521
1509
|
return {
|
|
1522
|
-
message: () => `${r}: screenshot has a mismatch ratio of "${
|
|
1523
|
-
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
|
|
1524
1512
|
};
|
|
1525
1513
|
}
|
|
1526
1514
|
if ("number" == typeof t.allowableMismatchedPixels) {
|
|
@@ -1778,9 +1766,9 @@ class BuildContext {
|
|
|
1778
1766
|
}
|
|
1779
1767
|
return {
|
|
1780
1768
|
duration: () => r.duration(),
|
|
1781
|
-
finish: (e,
|
|
1769
|
+
finish: (e, n, s, o) => {
|
|
1782
1770
|
if ((!this.hasFinished || t) && (t && this.config.watch && (e = `${this.config.logger.cyan("[" + this.buildId + "]")} ${e}`),
|
|
1783
|
-
r.finish(e,
|
|
1771
|
+
r.finish(e, n, s, o), !t)) {
|
|
1784
1772
|
const e = {
|
|
1785
1773
|
buildId: this.buildId,
|
|
1786
1774
|
messages: this.buildMessages.slice(),
|
|
@@ -1825,8 +1813,8 @@ const getBuildTimestamp = () => {
|
|
|
1825
1813
|
}, getProgress = e => {
|
|
1826
1814
|
let t = 0;
|
|
1827
1815
|
const r = Object.keys(ProgressTask);
|
|
1828
|
-
return r.forEach(((r,
|
|
1829
|
-
e.includes(ProgressTask[r]) && (t =
|
|
1816
|
+
return r.forEach(((r, n) => {
|
|
1817
|
+
e.includes(ProgressTask[r]) && (t = n);
|
|
1830
1818
|
})), (t + 1) / r.length;
|
|
1831
1819
|
}, ProgressTask = {
|
|
1832
1820
|
emptyOutputTargets: {},
|
|
@@ -1895,13 +1883,13 @@ class Cache {
|
|
|
1895
1883
|
const e = Date.now(), t = await this.sys.cacheStorage.get(EXP_STORAGE_KEY);
|
|
1896
1884
|
if (null != t) {
|
|
1897
1885
|
if (e - t < ONE_DAY) return;
|
|
1898
|
-
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)));
|
|
1899
1887
|
let o = 0;
|
|
1900
|
-
const i =
|
|
1901
|
-
const
|
|
1902
|
-
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++);
|
|
1903
1891
|
}));
|
|
1904
|
-
await Promise.all(i), this.logger.debug(`clearExpiredCache, cachedFileNames: ${
|
|
1892
|
+
await Promise.all(i), this.logger.debug(`clearExpiredCache, cachedFileNames: ${n.length}, totalCleared: ${o}`);
|
|
1905
1893
|
}
|
|
1906
1894
|
this.logger.debug("clearExpiredCache, set last clear"), await this.sys.cacheStorage.set(EXP_STORAGE_KEY, e);
|
|
1907
1895
|
}
|
|
@@ -1931,23 +1919,23 @@ const MAX_FAILED = 100, ONE_DAY = 864e5, ONE_WEEK = 7 * ONE_DAY, EXP_STORAGE_KEY
|
|
|
1931
1919
|
t.filesToWrite.push(r);
|
|
1932
1920
|
const e = normalizePath(path$2.dirname(r));
|
|
1933
1921
|
t.dirsToEnsure.includes(e) || t.dirsToEnsure.push(e);
|
|
1934
|
-
const
|
|
1935
|
-
|
|
1936
|
-
const
|
|
1937
|
-
|
|
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);
|
|
1938
1926
|
} else if (!0 === e.isDirectory) {
|
|
1939
1927
|
t.dirsToEnsure.includes(r) || t.dirsToEnsure.push(r);
|
|
1940
1928
|
const e = t.dirsToDelete.indexOf(r);
|
|
1941
1929
|
e > -1 && t.dirsToDelete.splice(e, 1);
|
|
1942
1930
|
}
|
|
1943
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) {
|
|
1944
|
-
const
|
|
1945
|
-
t.filesToCopy.push([
|
|
1946
|
-
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));
|
|
1947
1935
|
t.dirsToEnsure.includes(o) || t.dirsToEnsure.push(o);
|
|
1948
1936
|
const i = t.dirsToDelete.indexOf(o);
|
|
1949
1937
|
i > -1 && t.dirsToDelete.splice(i, 1);
|
|
1950
|
-
const a = t.filesToDelete.indexOf(
|
|
1938
|
+
const a = t.filesToDelete.indexOf(s);
|
|
1951
1939
|
a > -1 && t.filesToDelete.splice(a, 1);
|
|
1952
1940
|
}
|
|
1953
1941
|
e.queueDeleteFromDisk = !1, e.queueWriteToDisk = !1;
|
|
@@ -1955,16 +1943,16 @@ const MAX_FAILED = 100, ONE_DAY = 864e5, ONE_WEEK = 7 * ONE_DAY, EXP_STORAGE_KEY
|
|
|
1955
1943
|
for (let e = 0, r = t.dirsToEnsure.length; e < r; e++) {
|
|
1956
1944
|
const r = t.dirsToEnsure[e].split("/");
|
|
1957
1945
|
for (let e = 2; e < r.length; e++) {
|
|
1958
|
-
const
|
|
1959
|
-
!1 === t.dirsToEnsure.includes(
|
|
1946
|
+
const n = r.slice(0, e).join("/");
|
|
1947
|
+
!1 === t.dirsToEnsure.includes(n) && t.dirsToEnsure.push(n);
|
|
1960
1948
|
}
|
|
1961
1949
|
}
|
|
1962
1950
|
t.dirsToEnsure.sort(((e, t) => {
|
|
1963
|
-
const r = e.split("/").length,
|
|
1964
|
-
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;
|
|
1965
1953
|
})), t.dirsToDelete.sort(((e, t) => {
|
|
1966
|
-
const r = e.split("/").length,
|
|
1967
|
-
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;
|
|
1968
1956
|
}));
|
|
1969
1957
|
for (const e of t.dirsToEnsure) {
|
|
1970
1958
|
const r = t.dirsToDelete.indexOf(e);
|
|
@@ -1979,44 +1967,44 @@ const MAX_FAILED = 100, ONE_DAY = 864e5, ONE_WEEK = 7 * ONE_DAY, EXP_STORAGE_KEY
|
|
|
1979
1967
|
|
|
1980
1968
|
(posix = {
|
|
1981
1969
|
resolve: function e() {
|
|
1982
|
-
var t, r,
|
|
1983
|
-
for (r = arguments.length - 1; r >= -1 && !o; r--) r >= 0 ?
|
|
1984
|
-
|
|
1985
|
-
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 : ".";
|
|
1986
1974
|
},
|
|
1987
1975
|
normalize: function e(t) {
|
|
1988
|
-
var r,
|
|
1989
|
-
return assertPath(t), 0 === t.length ? "." : (r = 47 === t.charCodeAt(0),
|
|
1990
|
-
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 += "/"),
|
|
1991
1979
|
r ? "/" + t : t);
|
|
1992
1980
|
},
|
|
1993
1981
|
isAbsolute: function e(t) {
|
|
1994
1982
|
return assertPath(t), t.length > 0 && 47 === t.charCodeAt(0);
|
|
1995
1983
|
},
|
|
1996
1984
|
join: function e() {
|
|
1997
|
-
var t, r,
|
|
1985
|
+
var t, r, n;
|
|
1998
1986
|
if (0 === arguments.length) return ".";
|
|
1999
|
-
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);
|
|
2000
1988
|
return void 0 === t ? "." : posix.normalize(t);
|
|
2001
1989
|
},
|
|
2002
1990
|
relative: function e(t, r) {
|
|
2003
|
-
var
|
|
1991
|
+
var n, s, o, i, a, l, c, u, d, h;
|
|
2004
1992
|
if (assertPath(t), assertPath(r), t === r) return "";
|
|
2005
1993
|
if ((t = posix.resolve(t)) === (r = posix.resolve(r))) return "";
|
|
2006
|
-
for (
|
|
2007
|
-
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) ;
|
|
2008
1996
|
for (l = o < (a = r.length - i) ? o : a, c = -1, u = 0; u <= l; ++u) {
|
|
2009
1997
|
if (u === l) {
|
|
2010
1998
|
if (a > l) {
|
|
2011
1999
|
if (47 === r.charCodeAt(i + u)) return r.slice(i + u + 1);
|
|
2012
2000
|
if (0 === u) return r.slice(i + u);
|
|
2013
|
-
} else o > l && (47 === t.charCodeAt(
|
|
2001
|
+
} else o > l && (47 === t.charCodeAt(n + u) ? c = u : 0 === u && (c = 0));
|
|
2014
2002
|
break;
|
|
2015
2003
|
}
|
|
2016
|
-
if ((d = t.charCodeAt(
|
|
2004
|
+
if ((d = t.charCodeAt(n + u)) !== r.charCodeAt(i + u)) break;
|
|
2017
2005
|
47 === d && (c = u);
|
|
2018
2006
|
}
|
|
2019
|
-
for (h = "", u =
|
|
2007
|
+
for (h = "", u = n + c + 1; u <= s; ++u) u !== s && 47 !== t.charCodeAt(u) || (0 === h.length ? h += ".." : h += "/..");
|
|
2020
2008
|
return h.length > 0 ? h + r.slice(i + c) : (i += c, 47 === r.charCodeAt(i) && ++i,
|
|
2021
2009
|
r.slice(i));
|
|
2022
2010
|
},
|
|
@@ -2024,56 +2012,56 @@ const MAX_FAILED = 100, ONE_DAY = 864e5, ONE_WEEK = 7 * ONE_DAY, EXP_STORAGE_KEY
|
|
|
2024
2012
|
return t;
|
|
2025
2013
|
},
|
|
2026
2014
|
dirname: function e(t) {
|
|
2027
|
-
var r,
|
|
2015
|
+
var r, n, s, o;
|
|
2028
2016
|
if (assertPath(t), 0 === t.length) return ".";
|
|
2029
|
-
for (r = 47 === t.charCodeAt(0),
|
|
2030
|
-
if (!
|
|
2031
|
-
|
|
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;
|
|
2032
2020
|
break;
|
|
2033
2021
|
}
|
|
2034
|
-
} else
|
|
2035
|
-
return -1 ===
|
|
2022
|
+
} else s = !1;
|
|
2023
|
+
return -1 === n ? r ? "/" : "." : r && 1 === n ? "//" : t.slice(0, n);
|
|
2036
2024
|
},
|
|
2037
2025
|
basename: function e(t, r) {
|
|
2038
|
-
var
|
|
2026
|
+
var n, s, o, i, a, l, c;
|
|
2039
2027
|
if (void 0 !== r && "string" != typeof r) throw new TypeError('"ext" argument must be a string');
|
|
2040
|
-
if (assertPath(t),
|
|
2028
|
+
if (assertPath(t), n = 0, s = -1, o = !0, void 0 !== r && r.length > 0 && r.length <= t.length) {
|
|
2041
2029
|
if (r.length === t.length && r === t) return "";
|
|
2042
2030
|
for (a = r.length - 1, l = -1, i = t.length - 1; i >= 0; --i) if (47 === (c = t.charCodeAt(i))) {
|
|
2043
2031
|
if (!o) {
|
|
2044
|
-
|
|
2032
|
+
n = i + 1;
|
|
2045
2033
|
break;
|
|
2046
2034
|
}
|
|
2047
|
-
} else -1 === l && (o = !1, l = i + 1), a >= 0 && (c === r.charCodeAt(a) ? -1 == --a && (
|
|
2048
|
-
|
|
2049
|
-
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);
|
|
2050
2038
|
}
|
|
2051
2039
|
for (i = t.length - 1; i >= 0; --i) if (47 === t.charCodeAt(i)) {
|
|
2052
2040
|
if (!o) {
|
|
2053
|
-
|
|
2041
|
+
n = i + 1;
|
|
2054
2042
|
break;
|
|
2055
2043
|
}
|
|
2056
|
-
} else -1 ===
|
|
2057
|
-
return -1 ===
|
|
2044
|
+
} else -1 === s && (o = !1, s = i + 1);
|
|
2045
|
+
return -1 === s ? "" : t.slice(n, s);
|
|
2058
2046
|
},
|
|
2059
2047
|
extname: function e(t) {
|
|
2060
|
-
var r,
|
|
2061
|
-
for (assertPath(t), r = -1,
|
|
2062
|
-
|
|
2063
|
-
|
|
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;
|
|
2064
2052
|
break;
|
|
2065
2053
|
}
|
|
2066
|
-
return -1 === r || -1 ===
|
|
2054
|
+
return -1 === r || -1 === s || 0 === i || 1 === i && r === s - 1 && r === n + 1 ? "" : t.slice(r, s);
|
|
2067
2055
|
},
|
|
2068
2056
|
format: function e(t) {
|
|
2069
2057
|
if (null === t || "object" != typeof t) throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof t);
|
|
2070
2058
|
return function r(e, t) {
|
|
2071
|
-
var r = t.dir || t.root,
|
|
2072
|
-
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;
|
|
2073
2061
|
}("/", t);
|
|
2074
2062
|
},
|
|
2075
2063
|
parse: function e(t) {
|
|
2076
|
-
var r,
|
|
2064
|
+
var r, n, s, o, i, a, l, c, u, d;
|
|
2077
2065
|
if (assertPath(t), r = {
|
|
2078
2066
|
root: "",
|
|
2079
2067
|
dir: "",
|
|
@@ -2081,15 +2069,15 @@ const MAX_FAILED = 100, ONE_DAY = 864e5, ONE_WEEK = 7 * ONE_DAY, EXP_STORAGE_KEY
|
|
|
2081
2069
|
ext: "",
|
|
2082
2070
|
name: ""
|
|
2083
2071
|
}, 0 === t.length) return r;
|
|
2084
|
-
for ((
|
|
2085
|
-
a = 0, l = -1, c = !0, u = t.length - 1, d = 0; u >= o; --u) if (47 !== (
|
|
2086
|
-
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) {
|
|
2087
2075
|
a = u + 1;
|
|
2088
2076
|
break;
|
|
2089
2077
|
}
|
|
2090
|
-
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),
|
|
2091
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)),
|
|
2092
|
-
a > 0 ? r.dir = t.slice(0, a - 1) :
|
|
2080
|
+
a > 0 ? r.dir = t.slice(0, a - 1) : s && (r.dir = "/"), r;
|
|
2093
2081
|
},
|
|
2094
2082
|
sep: "/",
|
|
2095
2083
|
delimiter: ":",
|
|
@@ -2104,29 +2092,29 @@ const buildEvents = () => {
|
|
|
2104
2092
|
};
|
|
2105
2093
|
return {
|
|
2106
2094
|
emit: (t, r) => {
|
|
2107
|
-
const
|
|
2108
|
-
for (const e of
|
|
2095
|
+
const n = t.toLowerCase().trim(), s = e.slice();
|
|
2096
|
+
for (const e of s) if (null == e.eventName) try {
|
|
2109
2097
|
e.callback(t, r);
|
|
2110
2098
|
} catch (e) {
|
|
2111
2099
|
console.error(e);
|
|
2112
|
-
} else if (e.eventName ===
|
|
2100
|
+
} else if (e.eventName === n) try {
|
|
2113
2101
|
e.callback(r);
|
|
2114
2102
|
} catch (e) {
|
|
2115
2103
|
console.error(e);
|
|
2116
2104
|
}
|
|
2117
2105
|
},
|
|
2118
|
-
on: (r,
|
|
2106
|
+
on: (r, n) => {
|
|
2119
2107
|
if ("function" == typeof r) {
|
|
2120
|
-
const
|
|
2108
|
+
const n = null, s = r;
|
|
2121
2109
|
return e.push({
|
|
2122
|
-
eventName:
|
|
2123
|
-
callback:
|
|
2124
|
-
}), () => t(
|
|
2110
|
+
eventName: n,
|
|
2111
|
+
callback: s
|
|
2112
|
+
}), () => t(s);
|
|
2125
2113
|
}
|
|
2126
|
-
if ("string" == typeof r && "function" == typeof
|
|
2127
|
-
const
|
|
2114
|
+
if ("string" == typeof r && "function" == typeof n) {
|
|
2115
|
+
const s = r.toLowerCase().trim(), o = n;
|
|
2128
2116
|
return e.push({
|
|
2129
|
-
eventName:
|
|
2117
|
+
eventName: s,
|
|
2130
2118
|
callback: o
|
|
2131
2119
|
}), () => t(o);
|
|
2132
2120
|
}
|
|
@@ -2145,7 +2133,7 @@ const IS_BROWSER_ENV = "undefined" != typeof location && "undefined" != typeof n
|
|
|
2145
2133
|
IS_NODE_ENV && require, IS_NODE_ENV && process.cwd;
|
|
2146
2134
|
|
|
2147
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) => {
|
|
2148
|
-
const r = normalizePath(e).split("/"),
|
|
2136
|
+
const r = normalizePath(e).split("/"), n = (e => {
|
|
2149
2137
|
e.startsWith("~") && (e = e.substring(1));
|
|
2150
2138
|
const t = e.split("/"), r = {
|
|
2151
2139
|
moduleId: null,
|
|
@@ -2157,41 +2145,41 @@ const YELLOW = "#f39c12", RED = "#c0392b", BLUE = "#3498db", COMMON_DIR_MODULE_E
|
|
|
2157
2145
|
r.filePath = t.slice(2).join("/"), r.scope = t[0], r.scopeSubModuleId = t[1]) : (r.moduleId = t[0],
|
|
2158
2146
|
r.filePath = t.slice(1).join("/")), r;
|
|
2159
2147
|
})(t);
|
|
2160
|
-
for (let e = r.length - 1; e >= 1; e--) if ("node_modules" === r[e - 1]) if (
|
|
2161
|
-
if (r[e] ===
|
|
2162
|
-
} 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("/");
|
|
2163
2151
|
return null;
|
|
2164
|
-
}, packageVersions = new Map, known404Urls = new Set, getCommonDirUrl = (e, t, r,
|
|
2165
|
-
let
|
|
2166
|
-
const
|
|
2167
|
-
|
|
2168
|
-
let o =
|
|
2169
|
-
o.startsWith("@") && (o += "/" +
|
|
2170
|
-
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("/");
|
|
2171
2159
|
return "@rindo/core" === o ? ((e, t) => {
|
|
2172
2160
|
let r = (t = normalizePath(t)).split("/");
|
|
2173
|
-
const
|
|
2174
|
-
|
|
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),
|
|
2175
2163
|
t = r.join("/"));
|
|
2176
|
-
const
|
|
2177
|
-
return new URL("./" + t,
|
|
2164
|
+
const s = new URL("../", e).href;
|
|
2165
|
+
return new URL("./" + t, s).href;
|
|
2178
2166
|
})(e.getCompilerExecutingPath(), i) : e.getRemoteModuleUrl({
|
|
2179
2167
|
moduleId: o,
|
|
2180
2168
|
version: t.get(o),
|
|
2181
2169
|
path: i
|
|
2182
2170
|
});
|
|
2183
|
-
}, 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) => {
|
|
2184
2172
|
if (!((e => {
|
|
2185
2173
|
if (!(e => e.endsWith(".d.ts"))(t = e) && t.endsWith(".ts") || (e => e.endsWith(".tsx"))(e)) return !0;
|
|
2186
2174
|
var t;
|
|
2187
|
-
const r = e.split("/"),
|
|
2188
|
-
return !("node_modules" !==
|
|
2189
|
-
})(
|
|
2190
|
-
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);
|
|
2191
2179
|
if (o) {
|
|
2192
2180
|
if (o.ok) {
|
|
2193
2181
|
const i = await o.clone().text();
|
|
2194
|
-
return await (async (e, t, r,
|
|
2182
|
+
return await (async (e, t, r, n, s, o) => {
|
|
2195
2183
|
r.endsWith("package.json") && ((e, t) => {
|
|
2196
2184
|
try {
|
|
2197
2185
|
const r = JSON.parse(t);
|
|
@@ -2199,14 +2187,14 @@ const YELLOW = "#f39c12", RED = "#c0392b", BLUE = "#3498db", COMMON_DIR_MODULE_E
|
|
|
2199
2187
|
e.set(t, r);
|
|
2200
2188
|
})(e, r.name, r.version);
|
|
2201
2189
|
} catch (e) {}
|
|
2202
|
-
})(o,
|
|
2203
|
-
let i = path$2.dirname(
|
|
2190
|
+
})(o, s);
|
|
2191
|
+
let i = path$2.dirname(n);
|
|
2204
2192
|
for (;"/" !== i && "" !== i; ) t ? (t.clearFileCache(i), await t.sys.createDir(i)) : await e.createDir(i),
|
|
2205
2193
|
i = path$2.dirname(i);
|
|
2206
|
-
t ? (t.clearFileCache(
|
|
2207
|
-
})(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;
|
|
2208
2196
|
}
|
|
2209
|
-
404 === o.status && known404Urls.add(
|
|
2197
|
+
404 === o.status && known404Urls.add(n);
|
|
2210
2198
|
}
|
|
2211
2199
|
} catch (e) {
|
|
2212
2200
|
console.error(e);
|
|
@@ -2226,17 +2214,17 @@ homedir$2 = os__default.default.homedir || function e() {
|
|
|
2226
2214
|
path: t,
|
|
2227
2215
|
exports: {},
|
|
2228
2216
|
require: function(e, t) {
|
|
2229
|
-
return function
|
|
2217
|
+
return function n() {
|
|
2230
2218
|
throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs");
|
|
2231
2219
|
}(null == t && r.path);
|
|
2232
2220
|
}
|
|
2233
2221
|
}, r.exports), r.exports;
|
|
2234
2222
|
}((function(e) {
|
|
2235
|
-
var t, r,
|
|
2223
|
+
var t, r, n = "win32" === process.platform, s = /^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/, o = {
|
|
2236
2224
|
parse: function(e) {
|
|
2237
2225
|
if ("string" != typeof e) throw new TypeError("Parameter 'pathString' must be a string, not " + typeof e);
|
|
2238
2226
|
var t = function r(e) {
|
|
2239
|
-
return
|
|
2227
|
+
return s.exec(e).slice(1);
|
|
2240
2228
|
}(e);
|
|
2241
2229
|
if (!t || 5 !== t.length) throw new TypeError("Invalid path '" + e + "'");
|
|
2242
2230
|
return {
|
|
@@ -2250,7 +2238,7 @@ homedir$2 = os__default.default.homedir || function e() {
|
|
|
2250
2238
|
};
|
|
2251
2239
|
t = /^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/, (r = {}).parse = function(e) {
|
|
2252
2240
|
if ("string" != typeof e) throw new TypeError("Parameter 'pathString' must be a string, not " + typeof e);
|
|
2253
|
-
var r = function
|
|
2241
|
+
var r = function n(e) {
|
|
2254
2242
|
return t.exec(e).slice(1);
|
|
2255
2243
|
}(e);
|
|
2256
2244
|
if (!r || 5 !== r.length) throw new TypeError("Invalid path '" + e + "'");
|
|
@@ -2261,37 +2249,37 @@ homedir$2 = os__default.default.homedir || function e() {
|
|
|
2261
2249
|
ext: r[4],
|
|
2262
2250
|
name: r[3]
|
|
2263
2251
|
};
|
|
2264
|
-
}, e.exports =
|
|
2252
|
+
}, e.exports = n ? o.parse : r.parse, e.exports.posix = r.parse, e.exports.win32 = o.parse;
|
|
2265
2253
|
})), parse = path__default.default.parse || pathParse, getNodeModulesDirs = function e(t, r) {
|
|
2266
|
-
var
|
|
2267
|
-
for (/^([A-Za-z]:)/.test(t) ? o = "" : /^\\\\/.test(t) && (o = "\\\\"),
|
|
2268
|
-
|
|
2269
|
-
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) {
|
|
2270
2258
|
return e.concat(r.map((function(e) {
|
|
2271
2259
|
return path__default.default.resolve(o, t, e);
|
|
2272
2260
|
})));
|
|
2273
2261
|
}), []);
|
|
2274
|
-
}, nodeModulesPaths = function e(t, r,
|
|
2275
|
-
var
|
|
2276
|
-
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() {
|
|
2277
2265
|
return getNodeModulesDirs(t, o);
|
|
2278
|
-
}), r) : (
|
|
2266
|
+
}), r) : (s = getNodeModulesDirs(t, o), r && r.paths ? s.concat(r.paths) : s);
|
|
2279
2267
|
}, normalizeOptions = function(e, t) {
|
|
2280
2268
|
return t || {};
|
|
2281
2269
|
}, ERROR_MESSAGE = "Function.prototype.bind called on incompatible ", slice = Array.prototype.slice,
|
|
2282
2270
|
toStr = Object.prototype.toString, implementation = function e(t) {
|
|
2283
|
-
var r,
|
|
2271
|
+
var r, n, s, o, i, a, l, c = this;
|
|
2284
2272
|
if ("function" != typeof c || "[object Function]" !== toStr.call(c)) throw new TypeError(ERROR_MESSAGE + c);
|
|
2285
|
-
for (r = slice.call(arguments, 1),
|
|
2286
|
-
if (this instanceof
|
|
2273
|
+
for (r = slice.call(arguments, 1), s = function() {
|
|
2274
|
+
if (this instanceof n) {
|
|
2287
2275
|
var e = c.apply(this, r.concat(slice.call(arguments)));
|
|
2288
2276
|
return Object(e) === e ? e : this;
|
|
2289
2277
|
}
|
|
2290
2278
|
return c.apply(t, r.concat(slice.call(arguments)));
|
|
2291
2279
|
}, o = Math.max(0, c.length - r.length), i = [], a = 0; a < o; a++) i.push("$" + a);
|
|
2292
|
-
return
|
|
2293
|
-
c.prototype && ((l = function e() {}).prototype = c.prototype,
|
|
2294
|
-
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;
|
|
2295
2283
|
}, functionBind = Function.prototype.bind || implementation, src = functionBind.call(Function.call, Object.prototype.hasOwnProperty);
|
|
2296
2284
|
|
|
2297
2285
|
const data$1 = {
|
|
@@ -2449,12 +2437,12 @@ const data$1 = {
|
|
|
2449
2437
|
};
|
|
2450
2438
|
|
|
2451
2439
|
isCoreModule = function e(t, r) {
|
|
2452
|
-
return src(data$1, t) && function
|
|
2453
|
-
var r,
|
|
2440
|
+
return src(data$1, t) && function n(e, t) {
|
|
2441
|
+
var r, n;
|
|
2454
2442
|
if ("boolean" == typeof t) return t;
|
|
2455
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");
|
|
2456
2444
|
if (t && "object" == typeof t) {
|
|
2457
|
-
for (
|
|
2445
|
+
for (n = 0; n < t.length; ++n) if (matchesRange$1(r, t[n])) return !0;
|
|
2458
2446
|
return !1;
|
|
2459
2447
|
}
|
|
2460
2448
|
return matchesRange$1(r, t);
|
|
@@ -2471,117 +2459,117 @@ homedir$1 = homedir$2(), defaultPaths$1 = function() {
|
|
|
2471
2459
|
return e ? "ENOENT" === e.code || "ENOTDIR" === e.code ? r(null, !1) : r(e) : r(null, t.isDirectory());
|
|
2472
2460
|
}));
|
|
2473
2461
|
}, defaultRealpath = function e(t, r) {
|
|
2474
|
-
realpathFS$1(t, (function(e,
|
|
2475
|
-
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);
|
|
2476
2464
|
}));
|
|
2477
|
-
}, maybeRealpath = function e(t, r,
|
|
2478
|
-
|
|
2479
|
-
}, 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) {
|
|
2480
2468
|
t(r, (function(e, t) {
|
|
2481
|
-
if (e)
|
|
2469
|
+
if (e) n(e); else try {
|
|
2482
2470
|
var r = JSON.parse(t);
|
|
2483
|
-
|
|
2471
|
+
n(null, r);
|
|
2484
2472
|
} catch (e) {
|
|
2485
|
-
|
|
2473
|
+
n(null);
|
|
2486
2474
|
}
|
|
2487
2475
|
}));
|
|
2488
|
-
}, getPackageCandidates$1 = function e(t, r,
|
|
2489
|
-
var
|
|
2490
|
-
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);
|
|
2491
2479
|
return o;
|
|
2492
|
-
}, async = function e(t, r,
|
|
2493
|
-
function
|
|
2480
|
+
}, async = function e(t, r, n) {
|
|
2481
|
+
function s(e) {
|
|
2494
2482
|
if (/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(t)) T = path__default.default.resolve(e, t),
|
|
2495
2483
|
"." !== t && ".." !== t && "/" !== t.slice(-1) || (T += "/"), /\/$/.test(t) && T === e ? l(T, S.package, o) : i(T, S.package, o); else {
|
|
2496
2484
|
if (_ && isCoreModule(t)) return D(null, t);
|
|
2497
|
-
!function r(e, t,
|
|
2498
|
-
var
|
|
2485
|
+
!function r(e, t, n) {
|
|
2486
|
+
var s = function() {
|
|
2499
2487
|
return getPackageCandidates$1(e, t, S);
|
|
2500
2488
|
};
|
|
2501
|
-
c(
|
|
2502
|
-
}(t, e, (function(e, r,
|
|
2489
|
+
c(n, y ? y(e, t, s, S) : s());
|
|
2490
|
+
}(t, e, (function(e, r, n) {
|
|
2503
2491
|
if (e) D(e); else {
|
|
2504
2492
|
if (r) return maybeRealpath(f, r, S, (function(e, t) {
|
|
2505
|
-
e ? D(e) : D(null, t,
|
|
2493
|
+
e ? D(e) : D(null, t, n);
|
|
2506
2494
|
}));
|
|
2507
|
-
var
|
|
2508
|
-
|
|
2495
|
+
var s = new Error("Cannot find module '" + t + "' from '" + b + "'");
|
|
2496
|
+
s.code = "MODULE_NOT_FOUND", D(s);
|
|
2509
2497
|
}
|
|
2510
2498
|
}));
|
|
2511
2499
|
}
|
|
2512
2500
|
}
|
|
2513
|
-
function o(e, r,
|
|
2514
|
-
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) {
|
|
2515
2503
|
if (e) D(e); else if (r) maybeRealpath(f, r, S, (function(e, t) {
|
|
2516
|
-
e ? D(e) : D(null, t,
|
|
2504
|
+
e ? D(e) : D(null, t, n);
|
|
2517
2505
|
})); else {
|
|
2518
|
-
var
|
|
2519
|
-
|
|
2506
|
+
var s = new Error("Cannot find module '" + t + "' from '" + b + "'");
|
|
2507
|
+
s.code = "MODULE_NOT_FOUND", D(s);
|
|
2520
2508
|
}
|
|
2521
2509
|
}));
|
|
2522
2510
|
}
|
|
2523
2511
|
function i(e, t, r) {
|
|
2524
|
-
var
|
|
2525
|
-
"function" == typeof
|
|
2526
|
-
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) {
|
|
2527
2515
|
var u, h, p;
|
|
2528
|
-
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),
|
|
2529
2517
|
p = S.pathFilter(c, r, h)) ? e([ "" ].concat(w.slice()), path__default.default.resolve(a, p), c) : void d(l, i);
|
|
2530
2518
|
}
|
|
2531
|
-
function i(
|
|
2532
|
-
return
|
|
2519
|
+
function i(n, o) {
|
|
2520
|
+
return n ? s(n) : o ? s(null, l, c) : void e(t.slice(1), r, c);
|
|
2533
2521
|
}
|
|
2534
2522
|
var l, c;
|
|
2535
|
-
if (0 === t.length) return
|
|
2536
|
-
l = r + t[0], (c =
|
|
2537
|
-
}([ "" ].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);
|
|
2538
2526
|
}
|
|
2539
2527
|
function a(e, t) {
|
|
2540
|
-
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) {
|
|
2541
2529
|
if (r) return a(path__default.default.dirname(e), t);
|
|
2542
|
-
var
|
|
2543
|
-
d(
|
|
2544
|
-
if (!
|
|
2545
|
-
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) {
|
|
2546
2534
|
r && t(r);
|
|
2547
|
-
var o =
|
|
2548
|
-
o && S.packageFilter && (o = S.packageFilter(o,
|
|
2535
|
+
var o = n;
|
|
2536
|
+
o && S.packageFilter && (o = S.packageFilter(o, s)), t(null, o, e);
|
|
2549
2537
|
}));
|
|
2550
2538
|
}));
|
|
2551
2539
|
}));
|
|
2552
2540
|
}
|
|
2553
2541
|
function l(e, t, r) {
|
|
2554
|
-
var
|
|
2555
|
-
"function" == typeof
|
|
2556
|
-
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);
|
|
2557
2545
|
var o = path__default.default.join(r, "package.json");
|
|
2558
2546
|
d(o, (function(t, r) {
|
|
2559
|
-
return t ?
|
|
2560
|
-
var
|
|
2561
|
-
return t ?
|
|
2562
|
-
|
|
2563
|
-
return t ?
|
|
2564
|
-
return t ?
|
|
2565
|
-
})) : i(path__default.default.join(e, "index"),
|
|
2566
|
-
}))) : void i(path__default.default.join(e, "/index"),
|
|
2567
|
-
})) : 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);
|
|
2568
2556
|
}));
|
|
2569
2557
|
}));
|
|
2570
2558
|
}
|
|
2571
2559
|
function c(e, t) {
|
|
2572
2560
|
function r(t, r, o) {
|
|
2573
|
-
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);
|
|
2574
2562
|
}
|
|
2575
|
-
function
|
|
2576
|
-
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));
|
|
2577
2565
|
}
|
|
2578
2566
|
if (0 === t.length) return e(null, void 0);
|
|
2579
|
-
var
|
|
2580
|
-
h(path__default.default.dirname(
|
|
2581
|
-
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));
|
|
2582
2570
|
}));
|
|
2583
2571
|
}
|
|
2584
|
-
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;
|
|
2585
2573
|
return "function" == typeof r && (D = S, S = {}), "string" != typeof t ? (u = new TypeError("Path must be a string."),
|
|
2586
2574
|
process.nextTick((function() {
|
|
2587
2575
|
D(u);
|
|
@@ -2593,7 +2581,7 @@ homedir$1 = homedir$2(), defaultPaths$1 = function() {
|
|
|
2593
2581
|
}))) : (y = S.packageIterator, w = S.extensions || [ ".js" ], _ = !1 !== S.includeCoreModules,
|
|
2594
2582
|
v = S.basedir || path__default.default.dirname(caller()), b = S.filename || v, S.paths = S.paths || defaultPaths$1(),
|
|
2595
2583
|
E = path__default.default.resolve(v), void maybeRealpath(f, E, S, (function(e, t) {
|
|
2596
|
-
e ? D(e) :
|
|
2584
|
+
e ? D(e) : s(t);
|
|
2597
2585
|
}))));
|
|
2598
2586
|
};
|
|
2599
2587
|
|
|
@@ -2786,35 +2774,35 @@ homedir = homedir$2(), defaultPaths = function() {
|
|
|
2786
2774
|
if ("ENOENT" !== e.code) throw e;
|
|
2787
2775
|
}
|
|
2788
2776
|
return t;
|
|
2789
|
-
}, maybeRealpathSync = function e(t, r,
|
|
2790
|
-
return
|
|
2777
|
+
}, maybeRealpathSync = function e(t, r, n) {
|
|
2778
|
+
return n && !1 === n.preserveSymlinks ? t(r) : r;
|
|
2791
2779
|
}, defaultReadPackageSync = function e(t, r) {
|
|
2792
|
-
var
|
|
2780
|
+
var n = t(r);
|
|
2793
2781
|
try {
|
|
2794
|
-
return JSON.parse(
|
|
2782
|
+
return JSON.parse(n);
|
|
2795
2783
|
} catch (e) {}
|
|
2796
|
-
}, getPackageCandidates = function e(t, r,
|
|
2797
|
-
var
|
|
2798
|
-
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);
|
|
2799
2787
|
return o;
|
|
2800
2788
|
}, sync = function e(t, r) {
|
|
2801
|
-
function
|
|
2802
|
-
var t, r,
|
|
2789
|
+
function n(e) {
|
|
2790
|
+
var t, r, n, o, l = s(path__default.default.dirname(e));
|
|
2803
2791
|
if (l && l.dir && l.pkg && i.pathFilter && (t = path__default.default.relative(l.dir, e),
|
|
2804
2792
|
(r = i.pathFilter(l.pkg, e, t)) && (e = path__default.default.resolve(l.dir, r))),
|
|
2805
2793
|
a(e)) return e;
|
|
2806
|
-
for (
|
|
2794
|
+
for (n = 0; n < p.length; n++) if (o = e + p[n], a(o)) return o;
|
|
2807
2795
|
}
|
|
2808
|
-
function
|
|
2796
|
+
function s(e) {
|
|
2809
2797
|
var t, r;
|
|
2810
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"),
|
|
2811
2799
|
a(t) ? ((r = d(l, t)) && i.packageFilter && (r = i.packageFilter(r, e)), {
|
|
2812
2800
|
pkg: r,
|
|
2813
2801
|
dir: e
|
|
2814
|
-
}) :
|
|
2802
|
+
}) : s(path__default.default.dirname(e));
|
|
2815
2803
|
}
|
|
2816
2804
|
function o(e) {
|
|
2817
|
-
var t, r,
|
|
2805
|
+
var t, r, s, c, h = path__default.default.join(maybeRealpathSync(u, e, i), "/package.json");
|
|
2818
2806
|
if (a(h)) {
|
|
2819
2807
|
try {
|
|
2820
2808
|
t = d(l, h);
|
|
@@ -2824,12 +2812,12 @@ homedir = homedir$2(), defaultPaths = function() {
|
|
|
2824
2812
|
r;
|
|
2825
2813
|
"." !== t.main && "./" !== t.main || (t.main = "index");
|
|
2826
2814
|
try {
|
|
2827
|
-
if (
|
|
2815
|
+
if (s = n(path__default.default.resolve(e, t.main))) return s;
|
|
2828
2816
|
if (c = o(path__default.default.resolve(e, t.main))) return c;
|
|
2829
2817
|
} catch (e) {}
|
|
2830
2818
|
}
|
|
2831
2819
|
}
|
|
2832
|
-
return
|
|
2820
|
+
return n(path__default.default.join(e, "/index"));
|
|
2833
2821
|
}
|
|
2834
2822
|
var i, a, l, c, u, d, h, p, f, m, g, y, w, _, v, b;
|
|
2835
2823
|
if ("string" != typeof t) throw new TypeError("Path must be a string.");
|
|
@@ -2840,16 +2828,16 @@ homedir = homedir$2(), defaultPaths = function() {
|
|
|
2840
2828
|
m = i.basedir || path__default.default.dirname(caller()), g = i.filename || m, i.paths = i.paths || defaultPaths(),
|
|
2841
2829
|
y = maybeRealpathSync(u, path__default.default.resolve(m), i), /^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(t)) {
|
|
2842
2830
|
if (w = path__default.default.resolve(y, t), "." !== t && ".." !== t && "/" !== t.slice(-1) || (w += "/"),
|
|
2843
|
-
_ =
|
|
2831
|
+
_ = n(w) || o(w)) return maybeRealpathSync(u, _, i);
|
|
2844
2832
|
} else {
|
|
2845
2833
|
if (f && isCoreModule(t)) return t;
|
|
2846
2834
|
if (v = function E(e, t) {
|
|
2847
|
-
var r,
|
|
2835
|
+
var r, s, a, l, u = function() {
|
|
2848
2836
|
return getPackageCandidates(e, t, i);
|
|
2849
2837
|
}, d = h ? h(e, t, u, i) : u();
|
|
2850
|
-
for (r = 0; r < d.length; r++) if (
|
|
2851
|
-
if (a = s
|
|
2852
|
-
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;
|
|
2853
2841
|
}
|
|
2854
2842
|
}(t, y)) return maybeRealpathSync(u, v, i);
|
|
2855
2843
|
}
|
|
@@ -2885,22 +2873,22 @@ const createSystem = e => {
|
|
|
2885
2873
|
}),
|
|
2886
2874
|
printDiagnostics(t) {
|
|
2887
2875
|
t.forEach((t => ((e, t) => {
|
|
2888
|
-
let r = BLUE,
|
|
2889
|
-
"error" === e.level ? (r = RED,
|
|
2890
|
-
|
|
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);
|
|
2891
2879
|
const o = e.relFilePath || e.absFilePath;
|
|
2892
|
-
if (o && (
|
|
2893
|
-
"number" == typeof e.columnNumber && e.columnNumber > 0 && (
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
})),
|
|
2897
|
-
const e = [ "%c" +
|
|
2898
|
-
console.log(...e,
|
|
2899
|
-
} 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);
|
|
2900
2888
|
})(t, e)));
|
|
2901
2889
|
}
|
|
2902
2890
|
};
|
|
2903
|
-
})(), 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 => {
|
|
2904
2892
|
if ("/" === e || "" === e) return "/";
|
|
2905
2893
|
const t = path$2.dirname(e), r = path$2.basename(e);
|
|
2906
2894
|
return t.endsWith("/") ? normalizePath(`${t}${r}`) : normalizePath(`${t}/${r}`);
|
|
@@ -2917,23 +2905,23 @@ const createSystem = e => {
|
|
|
2917
2905
|
error: null
|
|
2918
2906
|
};
|
|
2919
2907
|
return d(e, t, r), r;
|
|
2920
|
-
}, d = (e, t,
|
|
2921
|
-
const
|
|
2922
|
-
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);
|
|
2923
2911
|
const o = r.get(e);
|
|
2924
2912
|
o ? (o.isDirectory = !0, o.isFile = !1) : (r.set(e, {
|
|
2925
2913
|
basename: path$2.basename(e),
|
|
2926
|
-
dirname:
|
|
2914
|
+
dirname: s,
|
|
2927
2915
|
isDirectory: !0,
|
|
2928
2916
|
isFile: !1,
|
|
2929
2917
|
watcherCallbacks: null,
|
|
2930
2918
|
data: void 0
|
|
2931
|
-
}),
|
|
2919
|
+
}), n.newDirs.push(e), v(e, new Set));
|
|
2932
2920
|
}, h = e => {
|
|
2933
2921
|
e = l(e);
|
|
2934
|
-
const t = [],
|
|
2935
|
-
return
|
|
2936
|
-
"/" !==
|
|
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);
|
|
2937
2925
|
})), t.sort();
|
|
2938
2926
|
}, p = e => {
|
|
2939
2927
|
e = l(e);
|
|
@@ -2942,31 +2930,31 @@ const createSystem = e => {
|
|
|
2942
2930
|
}, f = e => ({
|
|
2943
2931
|
path: l(e),
|
|
2944
2932
|
error: null
|
|
2945
|
-
}), m = (e, t,
|
|
2946
|
-
const
|
|
2947
|
-
if (!
|
|
2948
|
-
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, {
|
|
2949
2937
|
recursive: !0
|
|
2950
2938
|
}), i = r.get(e).data, a = b(t, i);
|
|
2951
|
-
|
|
2939
|
+
n.newDirs.push(...o.newDirs), n.renamed.push({
|
|
2952
2940
|
oldPath: e,
|
|
2953
2941
|
newPath: t,
|
|
2954
2942
|
isDirectory: !1,
|
|
2955
2943
|
isFile: !0
|
|
2956
|
-
}), a.error ?
|
|
2957
|
-
} else if (
|
|
2958
|
-
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, {
|
|
2959
2947
|
recursive: !0
|
|
2960
2948
|
});
|
|
2961
|
-
|
|
2949
|
+
n.newDirs.push(...s.newDirs), n.renamed.push({
|
|
2962
2950
|
oldPath: e,
|
|
2963
2951
|
newPath: t,
|
|
2964
2952
|
isDirectory: !0,
|
|
2965
2953
|
isFile: !1
|
|
2966
2954
|
});
|
|
2967
|
-
for (const
|
|
2968
|
-
const r =
|
|
2969
|
-
m(
|
|
2955
|
+
for (const s of r) {
|
|
2956
|
+
const r = s.replace(e, t);
|
|
2957
|
+
m(s, r, n);
|
|
2970
2958
|
}
|
|
2971
2959
|
}
|
|
2972
2960
|
}, g = (e, t = {}) => {
|
|
@@ -2979,18 +2967,18 @@ const createSystem = e => {
|
|
|
2979
2967
|
error: null
|
|
2980
2968
|
};
|
|
2981
2969
|
return y(e, t, r), r;
|
|
2982
|
-
}, y = (e, t,
|
|
2983
|
-
if (!
|
|
2970
|
+
}, y = (e, t, n) => {
|
|
2971
|
+
if (!n.error) {
|
|
2984
2972
|
e = l(e);
|
|
2985
|
-
const
|
|
2986
|
-
if (t && t.recursive) for (const e of
|
|
2987
|
-
const
|
|
2988
|
-
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) {
|
|
2989
2977
|
const t = _(e);
|
|
2990
|
-
t.error ?
|
|
2978
|
+
t.error ? n.error = t.error : n.removedFiles.push(e);
|
|
2991
2979
|
}
|
|
2992
|
-
} else if (
|
|
2993
|
-
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);
|
|
2994
2982
|
}
|
|
2995
2983
|
}, w = e => {
|
|
2996
2984
|
e = l(e);
|
|
@@ -3015,24 +3003,24 @@ const createSystem = e => {
|
|
|
3015
3003
|
dirname: path$2.dirname(e),
|
|
3016
3004
|
path: e,
|
|
3017
3005
|
error: null
|
|
3018
|
-
},
|
|
3019
|
-
if (
|
|
3020
|
-
if (
|
|
3006
|
+
}, n = r.get(e);
|
|
3007
|
+
if (n) {
|
|
3008
|
+
if (n.watcherCallbacks) for (const t of n.watcherCallbacks) t(e, "fileDelete");
|
|
3021
3009
|
r.delete(e), v(e, new Set);
|
|
3022
3010
|
}
|
|
3023
3011
|
return t;
|
|
3024
3012
|
}, v = (e, t) => {
|
|
3025
|
-
const
|
|
3026
|
-
if (
|
|
3027
|
-
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));
|
|
3028
3016
|
}, b = (e, t) => {
|
|
3029
|
-
const
|
|
3017
|
+
const n = {
|
|
3030
3018
|
path: e = l(e),
|
|
3031
3019
|
error: null
|
|
3032
|
-
},
|
|
3033
|
-
if (
|
|
3034
|
-
const r =
|
|
3035
|
-
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");
|
|
3036
3024
|
} else r.set(e, {
|
|
3037
3025
|
basename: path$2.basename(e),
|
|
3038
3026
|
dirname: path$2.dirname(e),
|
|
@@ -3041,16 +3029,16 @@ const createSystem = e => {
|
|
|
3041
3029
|
watcherCallbacks: null,
|
|
3042
3030
|
data: t
|
|
3043
3031
|
}), v(e, new Set);
|
|
3044
|
-
return
|
|
3032
|
+
return n;
|
|
3045
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();
|
|
3046
3034
|
u("/");
|
|
3047
3035
|
const D = {
|
|
3048
3036
|
name: "in-memory",
|
|
3049
|
-
version: "2.
|
|
3037
|
+
version: "2.18.0",
|
|
3050
3038
|
events: i,
|
|
3051
3039
|
access: async e => c(e),
|
|
3052
3040
|
accessSync: c,
|
|
3053
|
-
addDestory:
|
|
3041
|
+
addDestory: s,
|
|
3054
3042
|
copyFile: async (e, t) => (b(t, p(e)), !0),
|
|
3055
3043
|
createDir: async (e, t) => u(e, t),
|
|
3056
3044
|
createDirSync: u,
|
|
@@ -3062,14 +3050,14 @@ const createSystem = e => {
|
|
|
3062
3050
|
getEnvironmentVar: e => null == process__namespace ? void 0 : process__namespace.env[e],
|
|
3063
3051
|
destroy: async () => {
|
|
3064
3052
|
const e = [];
|
|
3065
|
-
|
|
3053
|
+
n.forEach((r => {
|
|
3066
3054
|
try {
|
|
3067
3055
|
const t = r();
|
|
3068
3056
|
t && t.then && e.push(t);
|
|
3069
3057
|
} catch (e) {
|
|
3070
3058
|
t.error(`rindo sys destroy: ${e}`);
|
|
3071
3059
|
}
|
|
3072
|
-
})), await Promise.all(e),
|
|
3060
|
+
})), await Promise.all(e), n.clear();
|
|
3073
3061
|
},
|
|
3074
3062
|
encodeToBase64: e => btoa(unescape(encodeURIComponent(e))),
|
|
3075
3063
|
exit: async e => t.warn(`exit ${e}`),
|
|
@@ -3107,8 +3095,8 @@ const createSystem = e => {
|
|
|
3107
3095
|
isFile: !1,
|
|
3108
3096
|
isDirectory: !1,
|
|
3109
3097
|
error: null
|
|
3110
|
-
},
|
|
3111
|
-
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),
|
|
3112
3100
|
m(e, t, r), !r.error) if (r.isDirectory) {
|
|
3113
3101
|
const t = g(e, {
|
|
3114
3102
|
recursive: !0
|
|
@@ -3131,15 +3119,15 @@ const createSystem = e => {
|
|
|
3131
3119
|
removeFileSync: _,
|
|
3132
3120
|
watchDirectory: (e, t) => {
|
|
3133
3121
|
e = l(e);
|
|
3134
|
-
const
|
|
3135
|
-
const
|
|
3136
|
-
if (
|
|
3137
|
-
const e =
|
|
3138
|
-
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);
|
|
3139
3127
|
}
|
|
3140
3128
|
};
|
|
3141
|
-
return
|
|
3142
|
-
|
|
3129
|
+
return s(i), n ? (n.isDirectory = !0, n.isFile = !1, n.watcherCallbacks = n.watcherCallbacks || [],
|
|
3130
|
+
n.watcherCallbacks.push(t)) : r.set(e, {
|
|
3143
3131
|
basename: path$2.basename(e),
|
|
3144
3132
|
dirname: path$2.dirname(e),
|
|
3145
3133
|
isDirectory: !0,
|
|
@@ -3154,15 +3142,15 @@ const createSystem = e => {
|
|
|
3154
3142
|
},
|
|
3155
3143
|
watchFile: (e, t) => {
|
|
3156
3144
|
e = l(e);
|
|
3157
|
-
const
|
|
3158
|
-
const
|
|
3159
|
-
if (
|
|
3160
|
-
const e =
|
|
3161
|
-
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);
|
|
3162
3150
|
}
|
|
3163
3151
|
};
|
|
3164
|
-
return
|
|
3165
|
-
|
|
3152
|
+
return s(i), n ? (n.isDirectory = !1, n.isFile = !0, n.watcherCallbacks = n.watcherCallbacks || [],
|
|
3153
|
+
n.watcherCallbacks.push(t)) : r.set(e, {
|
|
3166
3154
|
basename: path$2.basename(e),
|
|
3167
3155
|
dirname: path$2.dirname(e),
|
|
3168
3156
|
isDirectory: !1,
|
|
@@ -3180,20 +3168,20 @@ const createSystem = e => {
|
|
|
3180
3168
|
writeFileSync: b,
|
|
3181
3169
|
generateContentHash: async (e, t) => {
|
|
3182
3170
|
const r = await crypto.subtle.digest("SHA-256", (new TextEncoder).encode(e));
|
|
3183
|
-
let
|
|
3184
|
-
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;
|
|
3185
3173
|
},
|
|
3186
3174
|
createWorkerController: HAS_WEB_WORKER ? e => ((e, t) => {
|
|
3187
|
-
let r,
|
|
3175
|
+
let r, n = 0, s = !1, o = !1, i = 0;
|
|
3188
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 = () => {
|
|
3189
3177
|
let t = null;
|
|
3190
|
-
const
|
|
3178
|
+
const n = e.getCompilerExecutingPath(), o = {
|
|
3191
3179
|
name: "rindo.worker." + i++
|
|
3192
3180
|
};
|
|
3193
3181
|
try {
|
|
3194
|
-
t = new Worker(
|
|
3182
|
+
t = new Worker(n, o);
|
|
3195
3183
|
} catch (e) {
|
|
3196
|
-
null == r && (r = new Blob([ `importScripts('${
|
|
3184
|
+
null == r && (r = new Blob([ `importScripts('${n}');` ], {
|
|
3197
3185
|
type: "application/javascript"
|
|
3198
3186
|
})), t = new Worker(URL.createObjectURL(r), o);
|
|
3199
3187
|
}
|
|
@@ -3203,7 +3191,7 @@ const createSystem = e => {
|
|
|
3203
3191
|
sendQueue: []
|
|
3204
3192
|
};
|
|
3205
3193
|
return t.onerror = h, t.onmessage = e => ((e, t) => {
|
|
3206
|
-
if (!
|
|
3194
|
+
if (!s) {
|
|
3207
3195
|
const r = t.data;
|
|
3208
3196
|
if (Array.isArray(r)) for (const t of r) if (t) {
|
|
3209
3197
|
const r = a.get(t.rindoId);
|
|
@@ -3226,12 +3214,12 @@ const createSystem = e => {
|
|
|
3226
3214
|
}, g = () => {
|
|
3227
3215
|
o = !1, l.forEach(m), l.length = 0, c.forEach(f);
|
|
3228
3216
|
}, y = (...e) => new Promise(((t, r) => {
|
|
3229
|
-
if (
|
|
3230
|
-
const
|
|
3231
|
-
rindoId:
|
|
3217
|
+
if (s) r("task canceled"); else {
|
|
3218
|
+
const s = {
|
|
3219
|
+
rindoId: n++,
|
|
3232
3220
|
args: e
|
|
3233
3221
|
};
|
|
3234
|
-
l.push(
|
|
3222
|
+
l.push(s), a.set(s.rindoId, {
|
|
3235
3223
|
resolve: t,
|
|
3236
3224
|
reject: r
|
|
3237
3225
|
}), o || (o = !0, d.then(g));
|
|
@@ -3240,7 +3228,7 @@ const createSystem = e => {
|
|
|
3240
3228
|
return {
|
|
3241
3229
|
send: y,
|
|
3242
3230
|
destroy: () => {
|
|
3243
|
-
|
|
3231
|
+
s = !0, a.forEach((e => e.reject("task canceled"))), a.clear(), c.forEach((e => e.worker.terminate())),
|
|
3244
3232
|
c.length = 0;
|
|
3245
3233
|
},
|
|
3246
3234
|
handler: e => function(...t) {
|
|
@@ -3263,52 +3251,52 @@ const createSystem = e => {
|
|
|
3263
3251
|
})
|
|
3264
3252
|
};
|
|
3265
3253
|
return D.resolveModuleId = e => ((e, t, r) => {
|
|
3266
|
-
const
|
|
3267
|
-
async isFile(
|
|
3268
|
-
const o = normalizeFsPath(
|
|
3269
|
-
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 {
|
|
3270
3258
|
if (shouldFetchModule(o) && r.some((e => o.endsWith(e)))) {
|
|
3271
3259
|
const r = getNodeModuleFetchUrl(e, packageVersions, o);
|
|
3272
|
-
return void
|
|
3260
|
+
return void s(null, "string" == typeof await fetchModuleAsync(e, t, packageVersions, r, o));
|
|
3273
3261
|
}
|
|
3274
|
-
|
|
3262
|
+
s(null, !1);
|
|
3275
3263
|
}
|
|
3276
3264
|
},
|
|
3277
|
-
async isDirectory(r,
|
|
3278
|
-
const
|
|
3279
|
-
if ((await t.stat(
|
|
3280
|
-
if (shouldFetchModule(
|
|
3281
|
-
if ("node_modules" === path$2.basename(
|
|
3282
|
-
void
|
|
3283
|
-
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);
|
|
3284
3272
|
for (const r of COMMON_DIR_FILENAMES) {
|
|
3285
|
-
const o = getCommonDirUrl(e, packageVersions,
|
|
3286
|
-
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);
|
|
3287
3275
|
}
|
|
3288
3276
|
}
|
|
3289
|
-
|
|
3277
|
+
n(null, !1);
|
|
3290
3278
|
}
|
|
3291
3279
|
},
|
|
3292
3280
|
async readFile(e, r) {
|
|
3293
|
-
const
|
|
3294
|
-
return isString(
|
|
3281
|
+
const n = normalizeFsPath(e), s = await t.readFile(n);
|
|
3282
|
+
return isString(s) ? r(null, s) : r(`readFile not found: ${e}`);
|
|
3295
3283
|
},
|
|
3296
3284
|
async realpath(t, r) {
|
|
3297
|
-
const
|
|
3298
|
-
|
|
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);
|
|
3299
3287
|
},
|
|
3300
3288
|
extensions: r
|
|
3301
3289
|
}))(e, null, r.exts);
|
|
3302
|
-
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"),
|
|
3303
3291
|
e)), new Promise(((e, t) => {
|
|
3304
|
-
resolve(r.moduleId,
|
|
3305
|
-
if (
|
|
3306
|
-
|
|
3292
|
+
resolve(r.moduleId, n, ((n, s, o) => {
|
|
3293
|
+
if (n) t(n); else {
|
|
3294
|
+
s = normalizePath(s);
|
|
3307
3295
|
const t = {
|
|
3308
3296
|
moduleId: r.moduleId,
|
|
3309
|
-
resolveId:
|
|
3297
|
+
resolveId: s,
|
|
3310
3298
|
pkgData: o,
|
|
3311
|
-
pkgDirPath: getPackageDirPath(
|
|
3299
|
+
pkgDirPath: getPackageDirPath(s, r.moduleId)
|
|
3312
3300
|
};
|
|
3313
3301
|
e(t);
|
|
3314
3302
|
}
|
|
@@ -3322,19 +3310,19 @@ const createSystem = e => {
|
|
|
3322
3310
|
let r = crypto$3.createHash("sha1").update(e).digest("hex").toLowerCase();
|
|
3323
3311
|
return "number" == typeof t && (r = r.slice(0, t)), Promise.resolve(r);
|
|
3324
3312
|
};
|
|
3325
|
-
const
|
|
3313
|
+
const n = t => {
|
|
3326
3314
|
const r = t;
|
|
3327
3315
|
return (...t) => (e++, r.apply(r, t));
|
|
3328
|
-
},
|
|
3316
|
+
}, s = e => {
|
|
3329
3317
|
const r = e;
|
|
3330
3318
|
return (...e) => (t++, r.apply(r, e));
|
|
3331
3319
|
};
|
|
3332
|
-
if (r.access =
|
|
3333
|
-
r.readFile =
|
|
3334
|
-
r.readDirSync =
|
|
3335
|
-
r.copyFile =
|
|
3336
|
-
r.removeFile =
|
|
3337
|
-
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",
|
|
3338
3326
|
Object.defineProperties(r, {
|
|
3339
3327
|
diskReads: {
|
|
3340
3328
|
get: () => e,
|
|
@@ -3529,18 +3517,18 @@ class E2EElement extends index_cjs.MockHTMLElement {
|
|
|
3529
3517
|
return new Promise(((e, t) => {
|
|
3530
3518
|
const r = setInterval((async () => {
|
|
3531
3519
|
await this.isVisible() && (clearInterval(r), clearTimeout(o), e());
|
|
3532
|
-
}), 10),
|
|
3533
|
-
clearTimeout(r), t(
|
|
3534
|
-
}),
|
|
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);
|
|
3535
3523
|
}));
|
|
3536
3524
|
}
|
|
3537
3525
|
waitForNotVisible() {
|
|
3538
3526
|
return new Promise(((e, t) => {
|
|
3539
3527
|
const r = setInterval((async () => {
|
|
3540
3528
|
await this.isVisible() || (clearInterval(r), clearTimeout(o), e());
|
|
3541
|
-
}), 10),
|
|
3542
|
-
clearTimeout(r), t(
|
|
3543
|
-
}),
|
|
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);
|
|
3544
3532
|
}));
|
|
3545
3533
|
}
|
|
3546
3534
|
isIntersectingViewport() {
|
|
@@ -3696,15 +3684,15 @@ class E2EElement extends index_cjs.MockHTMLElement {
|
|
|
3696
3684
|
}
|
|
3697
3685
|
async getComputedStyle(e) {
|
|
3698
3686
|
const t = await this._page.evaluate(((e, t) => {
|
|
3699
|
-
const r = {},
|
|
3700
|
-
return Object.keys(
|
|
3687
|
+
const r = {}, n = window.getComputedStyle(e, t);
|
|
3688
|
+
return Object.keys(n).forEach((e => {
|
|
3701
3689
|
if (isNaN(e)) {
|
|
3702
|
-
const t =
|
|
3690
|
+
const t = n[e];
|
|
3703
3691
|
null != t && (r[e] = t);
|
|
3704
3692
|
} else {
|
|
3705
|
-
const t =
|
|
3693
|
+
const t = n[e];
|
|
3706
3694
|
if (t.includes("-")) {
|
|
3707
|
-
const e =
|
|
3695
|
+
const e = n.getPropertyValue(t);
|
|
3708
3696
|
null != e && (r[t] = e);
|
|
3709
3697
|
}
|
|
3710
3698
|
}
|
|
@@ -3721,8 +3709,8 @@ class E2EElement extends index_cjs.MockHTMLElement {
|
|
|
3721
3709
|
const r = t.eventInitDict || {};
|
|
3722
3710
|
"boolean" != typeof r.bubbles && (r.bubbles = !0), "boolean" != typeof r.cancelable && (r.cancelable = !0),
|
|
3723
3711
|
"boolean" != typeof r.composed && (r.composed = !0);
|
|
3724
|
-
const
|
|
3725
|
-
e.dispatchEvent(
|
|
3712
|
+
const n = new CustomEvent(t.eventName, r);
|
|
3713
|
+
e.dispatchEvent(n);
|
|
3726
3714
|
}
|
|
3727
3715
|
})), r && "function" == typeof r.then ? r.then((e => e)) : r;
|
|
3728
3716
|
}))), this._elmHandle, this._queuedActions);
|
|
@@ -3734,9 +3722,9 @@ class E2EElement extends index_cjs.MockHTMLElement {
|
|
|
3734
3722
|
shadowRootHTML: e.shadowRoot ? e.shadowRoot.innerHTML : null
|
|
3735
3723
|
})), this._elmHandle);
|
|
3736
3724
|
"string" == typeof r ? (this.shadowRoot = index_cjs.parseHtmlToFragment(r), this.shadowRoot.host = this) : this.shadowRoot = null;
|
|
3737
|
-
const
|
|
3738
|
-
for (this.nodeName =
|
|
3739
|
-
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]);
|
|
3740
3728
|
}
|
|
3741
3729
|
_validate() {
|
|
3742
3730
|
if (this._queuedActions.length > 0) throw new Error("await page.waitForChanges() must be called before reading element information");
|
|
@@ -3768,15 +3756,15 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3768
3756
|
const r = {
|
|
3769
3757
|
browserWSEndpoint: t,
|
|
3770
3758
|
ignoreHTTPSErrors: !0
|
|
3771
|
-
},
|
|
3772
|
-
return await
|
|
3759
|
+
}, n = require(e.__RINDO_PUPPETEER_MODULE__);
|
|
3760
|
+
return await n.connect(r);
|
|
3773
3761
|
}());
|
|
3774
3762
|
const t = await function r(e) {
|
|
3775
3763
|
return e.newPage();
|
|
3776
3764
|
}(this.browser);
|
|
3777
3765
|
this.pages.push(t);
|
|
3778
|
-
const
|
|
3779
|
-
return "string" == typeof
|
|
3766
|
+
const n = process.env;
|
|
3767
|
+
return "string" == typeof n.__RINDO_DEFAULT_TIMEOUT__ && t.setDefaultTimeout(parseInt(n.__RINDO_DEFAULT_TIMEOUT__, 10)),
|
|
3780
3768
|
t;
|
|
3781
3769
|
}
|
|
3782
3770
|
async closeOpenPages() {
|
|
@@ -3797,15 +3785,15 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3797
3785
|
var e;
|
|
3798
3786
|
const t = null !== (e = require("jest-runner").default) && void 0 !== e ? e : require("jest-runner");
|
|
3799
3787
|
return class r extends t {
|
|
3800
|
-
async runTests(e, t, r,
|
|
3788
|
+
async runTests(e, t, r, n, s, o) {
|
|
3801
3789
|
const i = process.env;
|
|
3802
3790
|
if (e = e.filter((e => function t(e, r) {
|
|
3803
|
-
const
|
|
3804
|
-
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;
|
|
3805
3793
|
}(e.path, i))), "true" === i.__RINDO_SCREENSHOT__) {
|
|
3806
3794
|
const a = JSON.parse(i.__RINDO_EMULATE_CONFIGS__);
|
|
3807
|
-
for (let l = 0; l < a.length; l++) setScreenshotEmulateData(a[l], i), await super.runTests(e, t, r,
|
|
3808
|
-
} 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);
|
|
3809
3797
|
}
|
|
3810
3798
|
};
|
|
3811
3799
|
}, exports.createTesting = async e => {
|
|
@@ -3816,12 +3804,12 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3816
3804
|
"www" === e.type && (e.serviceWorker = null);
|
|
3817
3805
|
})), e.flags.args.includes("--watchAll") && (e.watch = !0), e;
|
|
3818
3806
|
}(e);
|
|
3819
|
-
const {createCompiler: r} = require("../compiler/rindo.js"),
|
|
3820
|
-
let
|
|
3807
|
+
const {createCompiler: r} = require("../compiler/rindo.js"), n = await r(e);
|
|
3808
|
+
let s, o;
|
|
3821
3809
|
const i = async () => {
|
|
3822
3810
|
const t = [];
|
|
3823
|
-
e && (e.sys && e.sys.destroy && t.push(e.sys.destroy()), e = null),
|
|
3824
|
-
|
|
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);
|
|
3825
3813
|
};
|
|
3826
3814
|
return {
|
|
3827
3815
|
destroy: i,
|
|
@@ -3840,22 +3828,22 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3840
3828
|
e.empty = !1;
|
|
3841
3829
|
}));
|
|
3842
3830
|
const a = !(e.flags && !1 === e.flags.build);
|
|
3843
|
-
a && e.watch && (c = await
|
|
3831
|
+
a && e.watch && (c = await n.createWatcher()), a && (c ? (t = new Promise((e => {
|
|
3844
3832
|
const t = c.on("buildFinish", (r => {
|
|
3845
3833
|
t(), e(r);
|
|
3846
3834
|
}));
|
|
3847
|
-
})), c.start()) : t =
|
|
3835
|
+
})), c.start()) : t = n.build()), e.devServer.openBrowser = !1, e.devServer.gzip = !1,
|
|
3848
3836
|
e.devServer.reloadStrategy = null;
|
|
3849
3837
|
const l = await Promise.all([ index_js.start(e.devServer, e.logger), startPuppeteerBrowser(e) ]);
|
|
3850
|
-
if (
|
|
3838
|
+
if (s = l[0], o = l[1], t) {
|
|
3851
3839
|
const r = await t;
|
|
3852
3840
|
if (!r || !e.watch && hasError(r && r.diagnostics)) return await i(), !1;
|
|
3853
3841
|
}
|
|
3854
|
-
|
|
3842
|
+
s && (r.__RINDO_BROWSER_URL__ = s.browserUrl, e.logger.debug(`e2e dev server url: ${r.__RINDO_BROWSER_URL__}`),
|
|
3855
3843
|
r.__RINDO_APP_SCRIPT_URL__ = function d(e, t) {
|
|
3856
3844
|
return getAppUrl(e, t, `${e.fsNamespace}.esm.js`);
|
|
3857
|
-
}(e,
|
|
3858
|
-
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),
|
|
3859
3847
|
e.logger.debug(`e2e app style url: ${r.__RINDO_APP_STYLE_URL__}`)));
|
|
3860
3848
|
}
|
|
3861
3849
|
} catch (t) {
|
|
@@ -3864,9 +3852,9 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3864
3852
|
try {
|
|
3865
3853
|
l = a ? await async function h(e, t) {
|
|
3866
3854
|
e.logger.debug(`screenshot connector: ${e.testing.screenshotConnector}`);
|
|
3867
|
-
const r = new (require(e.testing.screenshotConnector)),
|
|
3868
|
-
e.logger.debug(`pixelmatch module: ${
|
|
3869
|
-
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);
|
|
3870
3858
|
await r.initBuild({
|
|
3871
3859
|
buildId: createBuildId(),
|
|
3872
3860
|
buildMessage: createBuildMessage(),
|
|
@@ -3881,25 +3869,25 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3881
3869
|
allowableMismatchedRatio: e.testing.allowableMismatchedRatio,
|
|
3882
3870
|
pixelmatchThreshold: e.testing.pixelmatchThreshold,
|
|
3883
3871
|
waitBeforeScreenshot: e.testing.waitBeforeScreenshot,
|
|
3884
|
-
pixelmatchModulePath:
|
|
3885
|
-
}), e.flags.updateScreenshot || await r.pullMasterBuild(),
|
|
3872
|
+
pixelmatchModulePath: n
|
|
3873
|
+
}), e.flags.updateScreenshot || await r.pullMasterBuild(), s.finish("screenshot, initBuild finished");
|
|
3886
3874
|
const o = await Promise.all([ await r.getMasterBuild(), await r.getScreenshotCache() ]), i = o[0], a = o[1];
|
|
3887
3875
|
t.__RINDO_SCREENSHOT_BUILD__ = r.toJson(i, a);
|
|
3888
3876
|
const l = e.logger.createTimeSpan("screenshot, tests started", !0), c = await runJest(e, t);
|
|
3889
3877
|
l.finish(`screenshot, tests finished, passed: ${c}`);
|
|
3890
3878
|
try {
|
|
3891
3879
|
const t = e.logger.createTimeSpan("screenshot, completeTimespan started", !0);
|
|
3892
|
-
let
|
|
3893
|
-
if (t.finish("screenshot, completeTimespan finished"),
|
|
3880
|
+
let n = await r.completeBuild(i);
|
|
3881
|
+
if (t.finish("screenshot, completeTimespan finished"), n) {
|
|
3894
3882
|
const t = e.logger.createTimeSpan("screenshot, publishBuild started", !0);
|
|
3895
|
-
if (
|
|
3896
|
-
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) {
|
|
3897
3885
|
try {
|
|
3898
|
-
await r.updateScreenshotCache(a,
|
|
3886
|
+
await r.updateScreenshotCache(a, n);
|
|
3899
3887
|
} catch (t) {
|
|
3900
3888
|
e.logger.error(t);
|
|
3901
3889
|
}
|
|
3902
|
-
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));
|
|
3903
3891
|
}
|
|
3904
3892
|
}
|
|
3905
3893
|
} catch (t) {
|
|
@@ -3999,7 +3987,9 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3999
3987
|
flags: createConfigFlags(),
|
|
4000
3988
|
logger: mockLogger(),
|
|
4001
3989
|
outputTargets: null !== (t = r.outputTargets) && void 0 !== t ? t : [],
|
|
3990
|
+
rootDir: path__default.default.resolve("/"),
|
|
4002
3991
|
sys: createTestingSystem(),
|
|
3992
|
+
testing: {},
|
|
4003
3993
|
...e
|
|
4004
3994
|
};
|
|
4005
3995
|
}, exports.mockWindow = function mockWindow(e = null) {
|
|
@@ -4008,26 +3998,26 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
4008
3998
|
if (!global.__NEW_TEST_PAGE__) throw new Error("newE2EPage() is only available from E2E tests, and ran with the --e2e cmd line flag.");
|
|
4009
3999
|
const t = await global.__NEW_TEST_PAGE__(), r = [];
|
|
4010
4000
|
try {
|
|
4011
|
-
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) {
|
|
4012
4002
|
if (e.isClosed()) return;
|
|
4013
4003
|
const t = env.__RINDO_EMULATE__;
|
|
4014
4004
|
if (!t) return;
|
|
4015
|
-
const r = JSON.parse(t),
|
|
4005
|
+
const r = JSON.parse(t), n = {
|
|
4016
4006
|
viewport: r.viewport,
|
|
4017
4007
|
userAgent: r.userAgent
|
|
4018
4008
|
};
|
|
4019
|
-
await e.emulate(
|
|
4020
|
-
}(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) {
|
|
4021
4011
|
const t = process.env;
|
|
4022
|
-
"true" === t.__RINDO_SCREENSHOT__ ? e.compareScreenshot = (r,
|
|
4023
|
-
const
|
|
4012
|
+
"true" === t.__RINDO_SCREENSHOT__ ? e.compareScreenshot = (r, n) => {
|
|
4013
|
+
const s = global;
|
|
4024
4014
|
let o, i = "", a = "";
|
|
4025
|
-
if (
|
|
4026
|
-
"string" == typeof
|
|
4027
|
-
"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(),
|
|
4028
4018
|
o = o || {}, !i) throw new Error(`Invalid screenshot description in "${a}"`);
|
|
4029
|
-
if (
|
|
4030
|
-
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) {
|
|
4031
4021
|
if ("string" != typeof t.__RINDO_EMULATE__) throw new Error("compareScreenshot, missing screenshot emulate env var");
|
|
4032
4022
|
if ("string" != typeof t.__RINDO_SCREENSHOT_BUILD__) throw new Error("compareScreenshot, missing screen build env var");
|
|
4033
4023
|
const o = JSON.parse(t.__RINDO_EMULATE__), i = JSON.parse(t.__RINDO_SCREENSHOT_BUILD__);
|
|
@@ -4051,10 +4041,10 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
4051
4041
|
width: e.clip.width,
|
|
4052
4042
|
height: e.clip.height
|
|
4053
4043
|
}), t;
|
|
4054
|
-
}(
|
|
4044
|
+
}(s), u = await e.screenshot(l), d = "number" == typeof s.pixelmatchThreshold ? s.pixelmatchThreshold : i.pixelmatchThreshold;
|
|
4055
4045
|
let h = o.viewport.width, p = o.viewport.height;
|
|
4056
|
-
return
|
|
4057
|
-
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);
|
|
4058
4048
|
}(e, t, i, a, o);
|
|
4059
4049
|
} : e.compareScreenshot = async () => ({
|
|
4060
4050
|
mismatchedPixels: 0,
|
|
@@ -4066,7 +4056,7 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
4066
4056
|
deviceScaleFactor: 1
|
|
4067
4057
|
});
|
|
4068
4058
|
}(t);
|
|
4069
|
-
let
|
|
4059
|
+
let n = null;
|
|
4070
4060
|
t.close = async e => {
|
|
4071
4061
|
try {
|
|
4072
4062
|
if (Array.isArray(t._e2eElements)) {
|
|
@@ -4086,15 +4076,15 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
4086
4076
|
t.isClosed() || await t._e2eClose(e);
|
|
4087
4077
|
} catch (e) {}
|
|
4088
4078
|
};
|
|
4089
|
-
const
|
|
4079
|
+
const s = async () => (n || (n = t.evaluateHandle((() => document))), (await n).asElement());
|
|
4090
4080
|
t.find = async e => {
|
|
4091
|
-
const r = await
|
|
4081
|
+
const r = await s();
|
|
4092
4082
|
return find(t, r, e);
|
|
4093
4083
|
}, t.findAll = async e => {
|
|
4094
|
-
const r = await
|
|
4084
|
+
const r = await s();
|
|
4095
4085
|
return findAll(t, r, e);
|
|
4096
4086
|
}, t.waitForEvent = async e => {
|
|
4097
|
-
const r = await
|
|
4087
|
+
const r = await s();
|
|
4098
4088
|
return waitForEvent(t, e, r);
|
|
4099
4089
|
}, t.getDiagnostics = () => r, t.waitForChanges = waitForChanges.bind(null, t),
|
|
4100
4090
|
t.debugger = () => {
|
|
@@ -4111,8 +4101,8 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
4111
4101
|
location: e.location().url
|
|
4112
4102
|
}), o)) throw new Error(serializeConsoleMessage(e));
|
|
4113
4103
|
!function t(e) {
|
|
4114
|
-
const t = serializeConsoleMessage(e), r = e.type(),
|
|
4115
|
-
"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));
|
|
4116
4106
|
}(e);
|
|
4117
4107
|
})), t.on("pageerror", (e => {
|
|
4118
4108
|
throw r.push({
|
|
@@ -4145,7 +4135,7 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
4145
4135
|
appData.BUILD.cssAnnotations = e.includeAnnotations;
|
|
4146
4136
|
const t = new Set;
|
|
4147
4137
|
testing.win.__rindo_spec_options = e;
|
|
4148
|
-
const r = testing.win.document,
|
|
4138
|
+
const r = testing.win.document, n = {
|
|
4149
4139
|
win: testing.win,
|
|
4150
4140
|
doc: r,
|
|
4151
4141
|
body: r.body,
|
|
@@ -4155,7 +4145,7 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
4155
4145
|
waitForChanges: testing.flushAll,
|
|
4156
4146
|
flushLoadModule: testing.flushLoadModule,
|
|
4157
4147
|
flushQueue: testing.flushQueue
|
|
4158
|
-
},
|
|
4148
|
+
}, s = e.components.map((e => {
|
|
4159
4149
|
if (null == e.COMPILER_META) throw new Error('Invalid component class: Missing static "COMPILER_META" property.');
|
|
4160
4150
|
t.add(e.COMPILER_META.tagName), e.isProxied = !1, function r(e) {
|
|
4161
4151
|
"function" == typeof e.prototype.__componentWillLoad && (e.prototype.componentWillLoad = e.prototype.__componentWillLoad,
|
|
@@ -4178,22 +4168,22 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
4178
4168
|
e;
|
|
4179
4169
|
});
|
|
4180
4170
|
}(e);
|
|
4181
|
-
const
|
|
4182
|
-
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) {
|
|
4183
4173
|
const t = {};
|
|
4184
|
-
|
|
4174
|
+
s.forEach((e => {
|
|
4185
4175
|
t[e.modeName] = e.styleStr;
|
|
4186
4176
|
})), e.style = t;
|
|
4187
|
-
} else 1 ===
|
|
4188
|
-
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) => {
|
|
4189
4179
|
let r = 0;
|
|
4190
4180
|
"shadow" === e.encapsulation ? (r |= 1, e.shadowDelegatesFocus && (r |= 16)) : "scoped" === e.encapsulation && (r |= 2),
|
|
4191
4181
|
"shadow" !== e.encapsulation && e.htmlTagNames.includes("slot") && (r |= 4), e.hasMode && (r |= 32);
|
|
4192
|
-
const
|
|
4193
|
-
return trimFalsy([ r, e.tagName, Object.keys(
|
|
4194
|
-
})(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 ]);
|
|
4195
4185
|
})), o = (e => {
|
|
4196
|
-
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 = {
|
|
4197
4187
|
allRenderFn: e.every((e => e.hasRenderFn)),
|
|
4198
4188
|
cmpDidLoad: e.some((e => e.hasComponentDidLoadFn)),
|
|
4199
4189
|
cmpShouldUpdate: e.some((e => e.hasComponentShouldUpdateFn)),
|
|
@@ -4230,7 +4220,7 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
4230
4220
|
shadowDom: r,
|
|
4231
4221
|
shadowDelegatesFocus: r && e.some((e => e.shadowDelegatesFocus)),
|
|
4232
4222
|
slot: t,
|
|
4233
|
-
slotRelocation:
|
|
4223
|
+
slotRelocation: n,
|
|
4234
4224
|
state: e.some((e => e.hasState)),
|
|
4235
4225
|
style: e.some((e => e.hasStyle)),
|
|
4236
4226
|
svg: e.some((e => e.htmlTagNames.includes("svg"))),
|
|
@@ -4249,27 +4239,27 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
4249
4239
|
watchCallback: e.some((e => e.hasWatchCallback)),
|
|
4250
4240
|
taskQueue: !0
|
|
4251
4241
|
};
|
|
4252
|
-
return
|
|
4253
|
-
|
|
4242
|
+
return s.asyncLoading = s.cmpWillUpdate || s.cmpWillLoad || s.cmpWillRender, s.vdomAttribute = s.vdomAttribute || s.reflect,
|
|
4243
|
+
s.vdomPropOrAttr = s.vdomPropOrAttr || s.reflect, s;
|
|
4254
4244
|
})(e.components.map((e => e.COMPILER_META)));
|
|
4255
4245
|
if (e.strictBuild ? Object.assign(appData.BUILD, o) : Object.keys(o).forEach((e => {
|
|
4256
4246
|
!0 === o[e] && (appData.BUILD[e] = !0);
|
|
4257
4247
|
})), appData.BUILD.asyncLoading = !0, e.hydrateClientSide ? (appData.BUILD.hydrateClientSide = !0,
|
|
4258
4248
|
appData.BUILD.hydrateServerSide = !1) : e.hydrateServerSide && (appData.BUILD.hydrateServerSide = !0,
|
|
4259
4249
|
appData.BUILD.hydrateClientSide = !1), appData.BUILD.cloneNodeFix = !1, appData.BUILD.shadowDomShim = !1,
|
|
4260
|
-
appData.BUILD.safari10 = !1, appData.BUILD.attachStyles = !!e.attachStyles, "string" == typeof e.url && (
|
|
4261
|
-
"string" == typeof e.direction &&
|
|
4262
|
-
"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),
|
|
4263
4253
|
"string" == typeof e.cookie) try {
|
|
4264
|
-
|
|
4254
|
+
n.doc.cookie = e.cookie;
|
|
4265
4255
|
} catch (e) {}
|
|
4266
4256
|
if ("string" == typeof e.referrer) try {
|
|
4267
|
-
|
|
4257
|
+
n.doc.referrer = e.referrer;
|
|
4268
4258
|
} catch (e) {}
|
|
4269
4259
|
if ("string" == typeof e.userAgent) try {
|
|
4270
|
-
|
|
4260
|
+
n.win.navigator.userAgent = e.userAgent;
|
|
4271
4261
|
} catch (e) {}
|
|
4272
|
-
if (testing.bootstrapLazy(
|
|
4262
|
+
if (testing.bootstrapLazy(s), "function" == typeof e.template) {
|
|
4273
4263
|
const t = {
|
|
4274
4264
|
$ancestorComponent$: void 0,
|
|
4275
4265
|
$flags$: 0,
|
|
@@ -4278,29 +4268,29 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
4278
4268
|
$flags$: 0,
|
|
4279
4269
|
$tagName$: "body"
|
|
4280
4270
|
},
|
|
4281
|
-
$hostElement$:
|
|
4271
|
+
$hostElement$: n.body
|
|
4282
4272
|
};
|
|
4283
4273
|
testing.renderVdom(t, e.template());
|
|
4284
|
-
} else "string" == typeof e.html && (
|
|
4285
|
-
!1 !== e.flushQueue && await
|
|
4274
|
+
} else "string" == typeof e.html && (n.body.innerHTML = e.html);
|
|
4275
|
+
!1 !== e.flushQueue && await n.waitForChanges();
|
|
4286
4276
|
let i = null;
|
|
4287
|
-
return Object.defineProperty(
|
|
4277
|
+
return Object.defineProperty(n, "root", {
|
|
4288
4278
|
get() {
|
|
4289
|
-
if (null == i && (i = findRootComponent(t,
|
|
4290
|
-
const e =
|
|
4279
|
+
if (null == i && (i = findRootComponent(t, n.body)), null != i) return i;
|
|
4280
|
+
const e = n.body.firstElementChild;
|
|
4291
4281
|
return null != e ? e : null;
|
|
4292
4282
|
}
|
|
4293
|
-
}), Object.defineProperty(
|
|
4283
|
+
}), Object.defineProperty(n, "rootInstance", {
|
|
4294
4284
|
get() {
|
|
4295
|
-
const e = testing.getHostRef(
|
|
4285
|
+
const e = testing.getHostRef(n.root);
|
|
4296
4286
|
return null != e ? e.$lazyInstance$ : null;
|
|
4297
4287
|
}
|
|
4298
4288
|
}), e.hydrateServerSide && testing.insertVdomAnnotations(r, []), e.autoApplyChanges && (testing.startAutoApplyChanges(),
|
|
4299
|
-
|
|
4300
|
-
Promise.resolve())),
|
|
4289
|
+
n.waitForChanges = () => (console.error('waitForChanges() cannot be used manually if the "startAutoApplyChanges" option is enabled'),
|
|
4290
|
+
Promise.resolve())), n;
|
|
4301
4291
|
}, exports.shuffleArray = function shuffleArray(e) {
|
|
4302
|
-
let t, r,
|
|
4303
|
-
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],
|
|
4304
4294
|
e[r] = t;
|
|
4305
4295
|
return e;
|
|
4306
4296
|
}, exports.transpile = transpile;
|