@rindo/core 1.17.4 → 2.5.2
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/LICENSE.md +27 -27
- package/bin/cli.ts +20 -0
- package/bin/rindo +51 -56
- package/cli/index.cjs +1263 -0
- package/cli/index.d.ts +1 -1
- package/cli/index.js +1232 -495
- package/cli/package.json +9 -4
- package/compiler/lib.d.ts +24 -0
- package/compiler/lib.dom.d.ts +20230 -0
- package/compiler/lib.dom.iterable.d.ts +351 -0
- package/compiler/lib.es2015.collection.d.ts +89 -0
- package/compiler/lib.es2015.core.d.ts +517 -0
- package/compiler/lib.es2015.d.ts +30 -0
- package/compiler/lib.es2015.generator.d.ts +79 -0
- package/compiler/lib.es2015.iterable.d.ts +505 -0
- package/compiler/lib.es2015.promise.d.ts +150 -0
- package/compiler/lib.es2015.proxy.d.ts +41 -0
- package/compiler/lib.es2015.reflect.d.ts +123 -0
- package/compiler/lib.es2015.symbol.d.ts +48 -0
- package/compiler/lib.es2015.symbol.wellknown.d.ts +324 -0
- package/compiler/lib.es2016.array.include.d.ts +118 -0
- package/compiler/lib.es2016.d.ts +22 -0
- package/compiler/lib.es2016.full.d.ts +25 -0
- package/compiler/lib.es2017.d.ts +26 -0
- package/compiler/lib.es2017.full.d.ts +25 -0
- package/compiler/lib.es2017.intl.d.ts +32 -0
- package/compiler/lib.es2017.object.d.ts +51 -0
- package/compiler/lib.es2017.sharedmemory.d.ts +137 -0
- package/compiler/lib.es2017.string.d.ts +47 -0
- package/compiler/lib.es2017.typedarrays.d.ts +55 -0
- package/compiler/lib.es2018.asyncgenerator.d.ts +79 -0
- package/compiler/lib.es2018.asynciterable.d.ts +45 -0
- package/compiler/lib.es2018.d.ts +26 -0
- package/compiler/lib.es2018.full.d.ts +25 -0
- package/compiler/lib.es2018.intl.d.ts +61 -0
- package/compiler/lib.es2018.promise.d.ts +32 -0
- package/compiler/lib.es2018.regexp.d.ts +39 -0
- package/compiler/lib.es2019.array.d.ts +85 -0
- package/compiler/lib.es2019.d.ts +25 -0
- package/compiler/lib.es2019.full.d.ts +25 -0
- package/compiler/lib.es2019.object.d.ts +35 -0
- package/compiler/lib.es2019.string.d.ts +33 -0
- package/compiler/lib.es2019.symbol.d.ts +26 -0
- package/compiler/lib.es2020.bigint.d.ts +728 -0
- package/compiler/lib.es2020.d.ts +27 -0
- package/compiler/lib.es2020.full.d.ts +25 -0
- package/compiler/lib.es2020.intl.d.ts +310 -0
- package/compiler/lib.es2020.promise.d.ts +50 -0
- package/compiler/lib.es2020.sharedmemory.d.ts +99 -0
- package/compiler/lib.es2020.string.d.ts +30 -0
- package/compiler/lib.es2020.symbol.wellknown.d.ts +39 -0
- package/compiler/lib.es5.d.ts +4435 -0
- package/compiler/lib.es6.d.ts +25 -0
- package/compiler/lib.esnext.d.ts +25 -0
- package/compiler/lib.esnext.full.d.ts +25 -0
- package/compiler/lib.esnext.intl.d.ts +32 -0
- package/compiler/lib.esnext.promise.d.ts +43 -0
- package/compiler/lib.esnext.string.d.ts +35 -0
- package/compiler/lib.esnext.weakref.d.ts +75 -0
- package/compiler/lib.scripthost.d.ts +327 -0
- package/compiler/lib.webworker.d.ts +6042 -0
- package/compiler/lib.webworker.importscripts.d.ts +26 -0
- package/compiler/lib.webworker.iterable.d.ts +166 -0
- package/compiler/package.json +3 -3
- package/compiler/rindo.d.ts +0 -16
- package/compiler/rindo.js +42738 -40541
- package/compiler/rindo.min.js +2 -15
- package/dependencies.json +73 -50
- package/dev-server/client/index.js +33 -10
- package/dev-server/client/package.json +3 -3
- package/dev-server/connector.html +3 -3
- package/dev-server/index.d.ts +3 -6
- package/dev-server/index.js +256 -252
- package/dev-server/package.json +3 -3
- package/dev-server/server-process.js +1738 -0
- package/dev-server/server-worker-thread.js +39 -0
- package/dev-server/templates/initial-load.html +160 -160
- package/dev-server/ws.js +1 -1
- package/internal/app-data/{index.cjs.js → index.cjs} +7 -5
- package/internal/app-data/index.d.ts +1 -0
- package/internal/app-data/index.js +7 -6
- package/internal/app-data/package.json +11 -5
- package/internal/client/css-shim.js +2 -2
- package/internal/client/dom.js +1 -1
- package/internal/client/index.js +193 -119
- package/internal/client/package.json +4 -3
- package/internal/client/{patch.js → patch-browser.js} +8 -24
- package/internal/client/patch-esm.js +23 -0
- package/internal/client/polyfills/css-shim.js +1 -1
- package/internal/client/polyfills/index.js +34 -34
- package/internal/client/shadow-css.js +9 -3
- package/internal/hydrate/index.js +305 -281
- package/internal/hydrate/package.json +2 -2
- package/internal/hydrate/runner.d.ts +24 -12
- package/internal/hydrate/runner.js +153 -124
- package/internal/hydrate/shadow-css.js +24 -24
- package/internal/package.json +5 -4
- package/internal/rindo-core/index.cjs +1 -0
- package/internal/rindo-core/index.d.ts +51 -2
- package/internal/rindo-core/index.js +15 -1
- package/internal/rindo-ext-modules.d.ts +41 -39
- package/internal/rindo-private.d.ts +93 -148
- package/internal/rindo-public-compiler.d.ts +231 -155
- package/internal/rindo-public-runtime.d.ts +42 -39
- package/internal/testing/index.js +144 -121
- package/internal/testing/package.json +2 -2
- package/internal/testing/shadow-css.js +24 -24
- package/mock-doc/index.cjs +4610 -0
- package/mock-doc/index.d.ts +12 -1
- package/mock-doc/index.js +177 -67
- package/mock-doc/package.json +11 -5
- package/package.json +132 -133
- package/readme.md +21 -95
- package/screenshot/compare/build/app.js +33 -33
- package/screenshot/compare/build/p-f4745c2f.entry.js +1 -1
- package/screenshot/connector-base.d.ts +1 -1
- package/screenshot/connector-local.d.ts +1 -1
- package/screenshot/index.js +63 -46
- package/screenshot/package.json +10 -3
- package/screenshot/pixel-match.js +54 -57
- package/screenshot/screenshot-compare.d.ts +1 -1
- package/screenshot/screenshot-fs.d.ts +1 -1
- package/sys/deno/index.js +1785 -0
- package/sys/deno/node-compat.js +2654 -0
- package/sys/deno/worker.js +44 -0
- package/sys/node/autoprefixer.js +8 -1
- package/sys/node/glob.js +1 -1
- package/sys/node/graceful-fs.js +1 -1
- package/sys/node/index.d.ts +1 -1
- package/sys/node/index.js +689 -705
- package/sys/node/node-fetch.js +1 -1
- package/sys/node/package.json +3 -3
- package/sys/node/prompts.js +1 -1
- package/sys/node/worker.js +38 -19
- package/testing/index.d.ts +3 -3
- package/testing/index.js +863 -749
- package/testing/jest/jest-config.d.ts +2 -89
- package/testing/jest/jest-environment.d.ts +1 -1
- package/testing/jest/jest-runner.d.ts +1 -1
- package/testing/jest/jest-screenshot.d.ts +1 -1
- package/testing/jest-preset.js +32 -32
- package/testing/matchers/events.d.ts +1 -1
- package/testing/matchers/screenshot.d.ts +1 -1
- package/testing/mock-fetch.d.ts +1 -1
- package/testing/mocks.d.ts +1 -1
- package/testing/package.json +3 -3
- package/testing/puppeteer/index.d.ts +1 -1
- package/testing/puppeteer/puppeteer-browser.d.ts +2 -2
- package/testing/puppeteer/puppeteer-declarations.d.ts +11 -11
- package/testing/puppeteer/puppeteer-element.d.ts +3 -3
- package/testing/puppeteer/puppeteer-emulate.d.ts +1 -1
- package/testing/puppeteer/puppeteer-events.d.ts +3 -3
- package/testing/puppeteer/puppeteer-page.d.ts +1 -1
- package/testing/puppeteer/puppeteer-screenshot.d.ts +2 -2
- package/testing/reset-build-conditionals.d.ts +1 -1
- package/testing/spec-page.d.ts +1 -1
- package/testing/test-transpile.d.ts +1 -1
- package/testing/testing-logger.d.ts +1 -1
- package/testing/testing-utils.d.ts +1 -1
- package/testing/testing.d.ts +1 -1
- package/cli/index.cjs.js +0 -524
- package/dev-server/content-type-db.json +0 -1
- package/dev-server/server-worker.js +0 -1570
- package/mock-doc/index.cjs.js +0 -4500
package/testing/index.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
Rindo Testing v2.5.2 | MIT Licensed | https://rindojs.web.app
|
|
3
|
+
*/
|
|
1
4
|
function _lazyRequire(e) {
|
|
2
5
|
return new Proxy({}, {
|
|
3
6
|
get(t, r) {
|
|
@@ -11,19 +14,21 @@ function _lazyRequire(e) {
|
|
|
11
14
|
});
|
|
12
15
|
}
|
|
13
16
|
|
|
14
|
-
function
|
|
15
|
-
return e && "object" == typeof e && "default" in e ? e
|
|
17
|
+
function _interopDefaultLegacy(e) {
|
|
18
|
+
return e && "object" == typeof e && "default" in e ? e : {
|
|
19
|
+
default: e
|
|
20
|
+
};
|
|
16
21
|
}
|
|
17
22
|
|
|
18
23
|
async function startPuppeteerBrowser(e) {
|
|
19
24
|
if (!e.flags.e2e) return null;
|
|
20
|
-
const t = process.env, r = e.testing.browserExecutablePath ? "puppeteer-core" : "puppeteer", s = e.sys.lazyRequire.getModulePath(r), n = require(s);
|
|
25
|
+
const t = process.env, r = e.testing.browserExecutablePath ? "puppeteer-core" : "puppeteer", s = e.sys.lazyRequire.getModulePath(e.rootDir, r), n = e.sys.lazyRequire.require(e.rootDir, s);
|
|
21
26
|
t.__RINDO_PUPPETEER_MODULE__ = s, t.__RINDO_BROWSER_WAIT_UNTIL = e.testing.browserWaitUntil,
|
|
22
27
|
e.flags.devtools && (e.testing.browserDevtools = !0, e.testing.browserHeadless = !1,
|
|
23
|
-
t.__RINDO_E2E_DEVTOOLS__ = "true"), e.logger.debug(
|
|
24
|
-
Array.isArray(e.testing.browserArgs) && e.logger.debug(
|
|
25
|
-
"boolean" == typeof e.testing.browserDevtools && e.logger.debug(
|
|
26
|
-
"number" == typeof e.testing.browserSlowMo && e.logger.debug(
|
|
28
|
+
t.__RINDO_E2E_DEVTOOLS__ = "true"), e.logger.debug(`puppeteer: ${s}`), e.logger.debug(`puppeteer headless: ${e.testing.browserHeadless}`),
|
|
29
|
+
Array.isArray(e.testing.browserArgs) && e.logger.debug(`puppeteer args: ${e.testing.browserArgs.join(" ")}`),
|
|
30
|
+
"boolean" == typeof e.testing.browserDevtools && e.logger.debug(`puppeteer devtools: ${e.testing.browserDevtools}`),
|
|
31
|
+
"number" == typeof e.testing.browserSlowMo && e.logger.debug(`puppeteer slowMo: ${e.testing.browserSlowMo}`);
|
|
27
32
|
const o = {
|
|
28
33
|
ignoreHTTPSErrors: !0,
|
|
29
34
|
args: e.testing.browserArgs,
|
|
@@ -32,26 +37,29 @@ async function startPuppeteerBrowser(e) {
|
|
|
32
37
|
slowMo: e.testing.browserSlowMo
|
|
33
38
|
};
|
|
34
39
|
e.testing.browserExecutablePath && (o.executablePath = e.testing.browserExecutablePath);
|
|
35
|
-
const i = await (e.testing.browserWSEndpoint ? n.connect(
|
|
40
|
+
const i = await (e.testing.browserWSEndpoint ? n.connect({
|
|
41
|
+
...o,
|
|
36
42
|
browserWSEndpoint: e.testing.browserWSEndpoint
|
|
37
|
-
})
|
|
38
|
-
|
|
43
|
+
}) : n.launch({
|
|
44
|
+
...o
|
|
45
|
+
}));
|
|
46
|
+
return t.__RINDO_BROWSER_WS_ENDPOINT__ = i.wsEndpoint(), e.logger.debug(`puppeteer browser wsEndpoint: ${t.__RINDO_BROWSER_WS_ENDPOINT__}`),
|
|
39
47
|
i;
|
|
40
48
|
}
|
|
41
49
|
|
|
42
50
|
function getAppStyleUrl(e, t) {
|
|
43
|
-
return e.globalStyle ? getAppUrl(e, t, e.fsNamespace
|
|
51
|
+
return e.globalStyle ? getAppUrl(e, t, `${e.fsNamespace}.css`) : null;
|
|
44
52
|
}
|
|
45
53
|
|
|
46
54
|
function getAppUrl(e, t, r) {
|
|
47
55
|
const s = e.outputTargets.find(isOutputTargetWww);
|
|
48
56
|
if (s) {
|
|
49
|
-
const e = s.buildDir, n = path$
|
|
57
|
+
const e = s.buildDir, n = path$2.join(e, r), o = path$2.relative(s.dir, n);
|
|
50
58
|
return new URL(o, t).href;
|
|
51
59
|
}
|
|
52
60
|
const n = e.outputTargets.find(isOutputTargetDistLazy);
|
|
53
61
|
if (n) {
|
|
54
|
-
const s = n.esmDir, o = path$
|
|
62
|
+
const s = n.esmDir, o = path$2.join(s, r), i = path$2.relative(e.rootDir, o);
|
|
55
63
|
return new URL(i, t).href;
|
|
56
64
|
}
|
|
57
65
|
return t;
|
|
@@ -71,7 +79,7 @@ function setScreenshotEmulateData(e, t) {
|
|
|
71
79
|
};
|
|
72
80
|
if ("string" == typeof e.device) try {
|
|
73
81
|
const s = require(t.__RINDO_PUPPETEER_MODULE__ + "/DeviceDescriptors")[e.device];
|
|
74
|
-
if (!s) return void console.error(
|
|
82
|
+
if (!s) return void console.error(`invalid emulate device: ${e.device}`);
|
|
75
83
|
r.device = e.device, r.userAgent = s.userAgent, r.viewport = s.viewport;
|
|
76
84
|
} catch (e) {
|
|
77
85
|
return void console.error("error loading puppeteer DeviceDescriptors", e);
|
|
@@ -92,22 +100,24 @@ async function runJest(e, t) {
|
|
|
92
100
|
let r = e.emulate.slice();
|
|
93
101
|
if ("string" == typeof t.emulate) {
|
|
94
102
|
const e = t.emulate.toLowerCase();
|
|
95
|
-
r = r.filter(t => "string" == typeof t.device && t.device.toLowerCase() === e || !("string" != typeof t.userAgent || !t.userAgent.toLowerCase().includes(e)));
|
|
103
|
+
r = r.filter((t => "string" == typeof t.device && t.device.toLowerCase() === e || !("string" != typeof t.userAgent || !t.userAgent.toLowerCase().includes(e))));
|
|
96
104
|
}
|
|
97
105
|
return r;
|
|
98
106
|
}(e.testing, e.flags);
|
|
99
|
-
t.__RINDO_EMULATE_CONFIGS__ = JSON.stringify(s),
|
|
100
|
-
e.flags.
|
|
107
|
+
t.__RINDO_EMULATE_CONFIGS__ = JSON.stringify(s), t.__RINDO_ENV__ = JSON.stringify(e.env),
|
|
108
|
+
e.flags.ci || e.flags.e2e ? t.__RINDO_DEFAULT_TIMEOUT__ = "30000" : t.__RINDO_DEFAULT_TIMEOUT__ = "15000",
|
|
109
|
+
e.flags.devtools && (t.__RINDO_DEFAULT_TIMEOUT__ = "300000000"), e.logger.debug(`default timeout: ${t.__RINDO_DEFAULT_TIMEOUT__}`);
|
|
101
110
|
const n = function n(e) {
|
|
102
111
|
const t = require("yargs"), r = [ ...e.flags.unknownArgs.slice(), ...e.flags.knownArgs.slice() ];
|
|
103
|
-
r.some(e => e.startsWith("--max-workers") || e.startsWith("--maxWorkers")) || r.push(
|
|
104
|
-
e.flags.devtools && r.push("--runInBand"), e.logger.info(e.logger.magenta(
|
|
112
|
+
r.some((e => e.startsWith("--max-workers") || e.startsWith("--maxWorkers"))) || r.push(`--max-workers=${e.maxConcurrentWorkers}`),
|
|
113
|
+
e.flags.devtools && r.push("--runInBand"), e.logger.info(e.logger.magenta(`jest args: ${r.join(" ")}`));
|
|
105
114
|
const {options: s} = require("jest-cli/build/cli/args"), n = t(r).options(s).argv;
|
|
106
115
|
if (n.config = function o(e) {
|
|
107
116
|
const t = e.testing, r = require("jest-config").defaults, s = Object.keys(r), n = {};
|
|
108
|
-
return Object.keys(t).forEach(e => {
|
|
117
|
+
return Object.keys(t).forEach((e => {
|
|
109
118
|
s.includes(e) && (n[e] = t[e]);
|
|
110
|
-
}), n.rootDir = e.rootDir, isString(t.collectCoverage) && (n.collectCoverage = t.collectCoverage),
|
|
119
|
+
})), n.rootDir = e.rootDir, isString(t.collectCoverage) && (n.collectCoverage = t.collectCoverage),
|
|
120
|
+
Array.isArray(t.collectCoverageFrom) && (n.collectCoverageFrom = t.collectCoverageFrom),
|
|
111
121
|
isString(t.coverageDirectory) && (n.coverageDirectory = t.coverageDirectory), t.coverageThreshold && (n.coverageThreshold = t.coverageThreshold),
|
|
112
122
|
isString(t.globalSetup) && (n.globalSetup = t.globalSetup), isString(t.globalTeardown) && (n.globalTeardown = t.globalTeardown),
|
|
113
123
|
isString(t.preset) && (n.preset = t.preset), t.projects && (n.projects = t.projects),
|
|
@@ -124,7 +134,7 @@ async function runJest(e, t) {
|
|
|
124
134
|
}(e, n), {runCLI: i} = require("@jest/core");
|
|
125
135
|
r = !!(await i(n, o)).results.success;
|
|
126
136
|
} catch (t) {
|
|
127
|
-
e.logger.error(
|
|
137
|
+
e.logger.error(`runJest: ${t}`);
|
|
128
138
|
}
|
|
129
139
|
return r;
|
|
130
140
|
}
|
|
@@ -142,11 +152,12 @@ function createBuildMessage() {
|
|
|
142
152
|
let t = e.getFullYear() + "-";
|
|
143
153
|
return t += ("0" + (e.getMonth() + 1)).slice(-2) + "-", t += ("0" + e.getDate()).slice(-2) + " ",
|
|
144
154
|
t += ("0" + e.getHours()).slice(-2) + ":", t += ("0" + e.getMinutes()).slice(-2) + ":",
|
|
145
|
-
t += ("0" + e.getSeconds()).slice(-2),
|
|
155
|
+
t += ("0" + e.getSeconds()).slice(-2), `Build: ${t}`;
|
|
146
156
|
}
|
|
147
157
|
|
|
148
158
|
function transpile(e, t = {}) {
|
|
149
|
-
t =
|
|
159
|
+
t = {
|
|
160
|
+
...t,
|
|
150
161
|
componentExport: null,
|
|
151
162
|
componentMetadata: "compilerstatic",
|
|
152
163
|
coreImportPath: isString(t.coreImportPath) ? t.coreImportPath : "@rindo/core/internal/testing",
|
|
@@ -157,7 +168,7 @@ function transpile(e, t = {}) {
|
|
|
157
168
|
style: null,
|
|
158
169
|
styleImportData: "queryparams",
|
|
159
170
|
target: "es2015"
|
|
160
|
-
}
|
|
171
|
+
};
|
|
161
172
|
try {
|
|
162
173
|
const e = process.versions.node.split(".");
|
|
163
174
|
parseInt(e[0], 10) >= 10 && (t.target = "es2017");
|
|
@@ -180,14 +191,14 @@ function compareHtml(e, t, r) {
|
|
|
180
191
|
const t = function n(e) {
|
|
181
192
|
return e && e.ownerDocument && e.ownerDocument.defaultView && e.ownerDocument.defaultView.__rindo_spec_options || {};
|
|
182
193
|
}(e);
|
|
183
|
-
s =
|
|
194
|
+
s = index_cjs.serializeNodeToHtml(e, {
|
|
184
195
|
prettyHtml: !0,
|
|
185
196
|
outerHtml: !0,
|
|
186
197
|
removeHtmlComments: !1 === t.includeAnnotations,
|
|
187
198
|
excludeTags: [ "body" ],
|
|
188
199
|
serializeShadowRoot: r
|
|
189
200
|
});
|
|
190
|
-
} else if (11 === e.nodeType) s =
|
|
201
|
+
} else if (11 === e.nodeType) s = index_cjs.serializeNodeToHtml(e, {
|
|
191
202
|
prettyHtml: !0,
|
|
192
203
|
excludeTags: [ "style" ],
|
|
193
204
|
excludeTagContent: [ "style" ],
|
|
@@ -195,14 +206,14 @@ function compareHtml(e, t, r) {
|
|
|
195
206
|
}); else {
|
|
196
207
|
if ("string" != typeof e) throw new Error("expect toEqualHtml() value should be an element, shadow root or string.");
|
|
197
208
|
{
|
|
198
|
-
const t =
|
|
199
|
-
s =
|
|
209
|
+
const t = index_cjs.parseHtmlToFragment(e);
|
|
210
|
+
s = index_cjs.serializeNodeToHtml(t, {
|
|
200
211
|
prettyHtml: !0,
|
|
201
212
|
serializeShadowRoot: r
|
|
202
213
|
});
|
|
203
214
|
}
|
|
204
215
|
}
|
|
205
|
-
const o =
|
|
216
|
+
const o = index_cjs.parseHtmlToFragment(t), i = index_cjs.serializeNodeToHtml(o, {
|
|
206
217
|
prettyHtml: !0,
|
|
207
218
|
excludeTags: [ "body" ]
|
|
208
219
|
});
|
|
@@ -219,7 +230,7 @@ function toHaveClasses(e, t) {
|
|
|
219
230
|
if (!e) throw new Error("expect toHaveClasses value is null");
|
|
220
231
|
if ("function" == typeof e.then) throw new Error("element must be a resolved value, not a promise, before it can be tested");
|
|
221
232
|
if (1 !== e.nodeType) throw new Error("expect toHaveClasses value is not an element");
|
|
222
|
-
const r = t.every(t => e.classList.contains(t));
|
|
233
|
+
const r = t.every((t => e.classList.contains(t)));
|
|
223
234
|
return {
|
|
224
235
|
message: () => `expected to ${r ? "not " : ""}have css classes "${t.join(" ")}", but className is "${e.className}"`,
|
|
225
236
|
pass: r
|
|
@@ -259,9 +270,9 @@ function setMockedResponse(e, t, r) {
|
|
|
259
270
|
}
|
|
260
271
|
|
|
261
272
|
function resetBuildConditionals(e) {
|
|
262
|
-
Object.keys(e).forEach(t => {
|
|
273
|
+
Object.keys(e).forEach((t => {
|
|
263
274
|
e[t] = !0;
|
|
264
|
-
}), e.isDev = !0, e.isTesting = !0, e.isDebug = !1, e.lazyLoad = !0, e.member = !0,
|
|
275
|
+
})), e.isDev = !0, e.isTesting = !0, e.isDebug = !1, e.lazyLoad = !0, e.member = !0,
|
|
265
276
|
e.reflect = !0, e.scoped = !0, e.shadowDom = !0, e.slotRelocation = !0, e.asyncLoading = !0,
|
|
266
277
|
e.svg = !0, e.updatable = !0, e.vdomAttribute = !0, e.vdomClass = !0, e.vdomFunctional = !0,
|
|
267
278
|
e.vdomKey = !0, e.vdomPropOrAttr = !0, e.vdomRef = !0, e.vdomListener = !0, e.vdomStyle = !0,
|
|
@@ -302,9 +313,22 @@ function normalizeStringPosix(e, t) {
|
|
|
302
313
|
return o;
|
|
303
314
|
}
|
|
304
315
|
|
|
316
|
+
function specifierIncluded$1(e, t) {
|
|
317
|
+
var r, s, n, o = e.split("."), i = t.split(" "), a = i.length > 1 ? i[0] : "=", l = (i.length > 1 ? i[1] : i[0]).split(".");
|
|
318
|
+
for (r = 0; r < 3; ++r) if ((s = parseInt(o[r] || 0, 10)) !== (n = parseInt(l[r] || 0, 10))) return "<" === a ? s < n : ">=" === a && s >= n;
|
|
319
|
+
return ">=" === a;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
function matchesRange$1(e, t) {
|
|
323
|
+
var r, s = t.split(/ ?&& ?/);
|
|
324
|
+
if (0 === s.length) return !1;
|
|
325
|
+
for (r = 0; r < s.length; ++r) if (!specifierIncluded$1(e, s[r])) return !1;
|
|
326
|
+
return !0;
|
|
327
|
+
}
|
|
328
|
+
|
|
305
329
|
function specifierIncluded(e) {
|
|
306
330
|
var t, r, s, n = e.split(" "), o = n.length > 1 ? n[0] : "=", i = (n.length > 1 ? n[1] : n[0]).split(".");
|
|
307
|
-
for (t = 0; t < 3; ++t) if ((r =
|
|
331
|
+
for (t = 0; t < 3; ++t) if ((r = parseInt(current[t] || 0, 10)) !== (s = parseInt(i[t] || 0, 10))) return "<" === o ? r < s : ">=" === o && r >= s;
|
|
308
332
|
return ">=" === o;
|
|
309
333
|
}
|
|
310
334
|
|
|
@@ -325,7 +349,7 @@ function versionIncluded(e) {
|
|
|
325
349
|
}
|
|
326
350
|
|
|
327
351
|
function mockConfig(e) {
|
|
328
|
-
const t =
|
|
352
|
+
const t = path__default.default.resolve("/");
|
|
329
353
|
return e || (e = createTestingSystem()), e.getCurrentDirectory = () => t, {
|
|
330
354
|
_isTesting: !0,
|
|
331
355
|
namespace: "Testing",
|
|
@@ -364,39 +388,36 @@ function mockCompilerCtx(e) {
|
|
|
364
388
|
activeFilesAdded: [],
|
|
365
389
|
activeFilesDeleted: [],
|
|
366
390
|
activeFilesUpdated: [],
|
|
367
|
-
|
|
391
|
+
addWatchDir: noop,
|
|
392
|
+
addWatchFile: noop,
|
|
368
393
|
cachedGlobalStyle: null,
|
|
394
|
+
changedFiles: new Set,
|
|
395
|
+
changedModules: new Set,
|
|
369
396
|
collections: [],
|
|
370
397
|
compilerOptions: null,
|
|
371
398
|
cache: null,
|
|
372
|
-
|
|
399
|
+
cssModuleImports: new Map,
|
|
373
400
|
events: null,
|
|
374
|
-
|
|
401
|
+
fs: null,
|
|
375
402
|
hasSuccessfulBuild: !1,
|
|
376
403
|
isActivelyBuilding: !1,
|
|
377
|
-
lastComponentStyleInput: new Map,
|
|
378
404
|
lastBuildResults: null,
|
|
379
|
-
lastBuildStyles: null,
|
|
380
405
|
moduleMap: new Map,
|
|
381
406
|
nodeMap: new WeakMap,
|
|
407
|
+
reset: noop,
|
|
382
408
|
resolvedCollections: new Set,
|
|
409
|
+
rollupCache: new Map,
|
|
383
410
|
rollupCacheHydrate: null,
|
|
384
411
|
rollupCacheLazy: null,
|
|
385
412
|
rollupCacheNative: null,
|
|
386
|
-
rollupCache: new Map,
|
|
387
|
-
rootTsFiles: [],
|
|
388
413
|
styleModeNames: new Set,
|
|
389
|
-
tsService: null,
|
|
390
|
-
changedModules: new Set,
|
|
391
|
-
changedFiles: new Set,
|
|
392
|
-
reset: () => {},
|
|
393
414
|
worker: rindo_js.createWorkerContext(e.sys)
|
|
394
415
|
};
|
|
395
416
|
return Object.defineProperty(t, "fs", {
|
|
396
417
|
get() {
|
|
397
418
|
return null == this._fs && (this._fs = (e => {
|
|
398
419
|
const t = new Map, r = new Map, s = async e => {
|
|
399
|
-
const t =
|
|
420
|
+
const t = b(e);
|
|
400
421
|
if ("boolean" == typeof t.exists) return {
|
|
401
422
|
exists: t.exists,
|
|
402
423
|
isDirectory: t.isDirectory,
|
|
@@ -406,7 +427,7 @@ function mockCompilerCtx(e) {
|
|
|
406
427
|
exists: !1,
|
|
407
428
|
isDirectory: !1,
|
|
408
429
|
isFile: !1
|
|
409
|
-
}, s = await
|
|
430
|
+
}, s = await c(e);
|
|
410
431
|
return s ? (t.exists = s.exists, t.isDirectory = s.isDirectory, t.isFile = s.isFile,
|
|
411
432
|
r.exists = t.exists, r.isDirectory = t.isDirectory, r.isFile = t.isFile) : t.exists = !1,
|
|
412
433
|
r;
|
|
@@ -417,7 +438,7 @@ function mockCompilerCtx(e) {
|
|
|
417
438
|
let n = e;
|
|
418
439
|
n.endsWith("/") || (n += "/");
|
|
419
440
|
const o = e.split("/");
|
|
420
|
-
t.forEach((t, n) => {
|
|
441
|
+
t.forEach(((t, n) => {
|
|
421
442
|
if (!n.startsWith(e)) return;
|
|
422
443
|
const a = n.split("/");
|
|
423
444
|
if ((a.length === o.length + 1 || r.recursive && a.length > o.length) && t.exists) {
|
|
@@ -429,43 +450,53 @@ function mockCompilerCtx(e) {
|
|
|
429
450
|
};
|
|
430
451
|
i(r, e) || s.push(e);
|
|
431
452
|
}
|
|
432
|
-
});
|
|
453
|
+
}));
|
|
433
454
|
} else await o(e, e, r, s);
|
|
434
|
-
return s.sort((e, t) => e.absPath < t.absPath ? -1 : e.absPath > t.absPath ? 1 : 0);
|
|
455
|
+
return s.sort(((e, t) => e.absPath < t.absPath ? -1 : e.absPath > t.absPath ? 1 : 0));
|
|
435
456
|
}, o = async (t, r, s, n) => {
|
|
436
|
-
const a = await e.
|
|
457
|
+
const a = await e.readDir(r);
|
|
437
458
|
if (a.length > 0) {
|
|
438
|
-
const e =
|
|
439
|
-
e.exists = !0, e.isFile = !1, e.isDirectory = !0, await Promise.all(a.map(async e => {
|
|
440
|
-
const r = normalizePath(e), a = normalizePath(path$
|
|
459
|
+
const e = b(r);
|
|
460
|
+
e.exists = !0, e.isFile = !1, e.isDirectory = !0, await Promise.all(a.map((async e => {
|
|
461
|
+
const r = normalizePath(e), a = normalizePath(path$2.relative(t, r)), l = await c(r), u = {
|
|
441
462
|
absPath: r,
|
|
442
463
|
relPath: a,
|
|
443
|
-
isDirectory:
|
|
444
|
-
isFile:
|
|
464
|
+
isDirectory: l.isDirectory,
|
|
465
|
+
isFile: l.isFile
|
|
445
466
|
};
|
|
446
|
-
i(s, u) || (n.push(u), !0 === s.recursive && !0 ===
|
|
447
|
-
}));
|
|
467
|
+
i(s, u) || (n.push(u), !0 === s.recursive && !0 === l.isDirectory && await o(t, r, s, n));
|
|
468
|
+
})));
|
|
448
469
|
}
|
|
449
470
|
}, i = (e, t) => {
|
|
450
471
|
if (t.isDirectory) {
|
|
451
472
|
if (Array.isArray(e.excludeDirNames)) {
|
|
452
|
-
const r = path$
|
|
453
|
-
if (e.excludeDirNames.some(e => r === e)) return !0;
|
|
473
|
+
const r = path$2.basename(t.absPath);
|
|
474
|
+
if (e.excludeDirNames.some((e => r === e))) return !0;
|
|
454
475
|
}
|
|
455
476
|
} else if (Array.isArray(e.excludeExtensions)) {
|
|
456
477
|
const r = t.relPath.toLowerCase();
|
|
457
|
-
if (e.excludeExtensions.some(e => r.endsWith(e))) return !0;
|
|
478
|
+
if (e.excludeExtensions.some((e => r.endsWith(e)))) return !0;
|
|
458
479
|
}
|
|
459
480
|
return !1;
|
|
460
481
|
}, a = async e => {
|
|
461
|
-
const t =
|
|
482
|
+
const t = b(e);
|
|
483
|
+
t.isFile = !1, t.isDirectory = !0, t.queueWriteToDisk || (t.queueDeleteFromDisk = !0);
|
|
484
|
+
try {
|
|
485
|
+
const t = await n(e, {
|
|
486
|
+
recursive: !0
|
|
487
|
+
});
|
|
488
|
+
await Promise.all(t.map((e => e.relPath.endsWith(".gitkeep") ? null : l(e.absPath))));
|
|
489
|
+
} catch (e) {}
|
|
490
|
+
}, l = async e => {
|
|
491
|
+
const t = b(e);
|
|
462
492
|
t.queueWriteToDisk || (t.queueDeleteFromDisk = !0);
|
|
463
|
-
},
|
|
464
|
-
const r =
|
|
493
|
+
}, c = async t => {
|
|
494
|
+
const r = b(t);
|
|
465
495
|
if ("boolean" != typeof r.isDirectory || "boolean" != typeof r.isFile) {
|
|
466
496
|
const s = await e.stat(t);
|
|
467
|
-
s ? (r.exists = !0, s.isFile
|
|
468
|
-
r.
|
|
497
|
+
s.error ? r.exists = !1 : (r.exists = !0, s.isFile ? (r.isFile = !0, r.isDirectory = !1,
|
|
498
|
+
r.size = s.size) : s.isDirectory ? (r.isFile = !1, r.isDirectory = !0, r.size = s.size) : (r.isFile = !1,
|
|
499
|
+
r.isDirectory = !1, r.size = null));
|
|
469
500
|
}
|
|
470
501
|
return {
|
|
471
502
|
exists: !!r.exists,
|
|
@@ -473,68 +504,82 @@ function mockCompilerCtx(e) {
|
|
|
473
504
|
isDirectory: !!r.isDirectory,
|
|
474
505
|
size: "number" == typeof r.size ? r.size : 0
|
|
475
506
|
};
|
|
476
|
-
},
|
|
477
|
-
const r =
|
|
507
|
+
}, u = t => {
|
|
508
|
+
const r = b(t);
|
|
478
509
|
if ("boolean" != typeof r.isDirectory || "boolean" != typeof r.isFile) {
|
|
479
510
|
const s = e.statSync(t);
|
|
480
|
-
s ? (r.exists = !0, s.isFile
|
|
481
|
-
r.
|
|
511
|
+
s.error ? r.exists = !1 : (r.exists = !0, s.isFile ? (r.isFile = !0, r.isDirectory = !1,
|
|
512
|
+
r.size = s.size) : s.isDirectory ? (r.isFile = !1, r.isDirectory = !0, r.size = s.size) : (r.isFile = !1,
|
|
513
|
+
r.isDirectory = !1, r.size = null));
|
|
482
514
|
}
|
|
483
515
|
return {
|
|
484
516
|
exists: !!r.exists,
|
|
485
517
|
isFile: !!r.isFile,
|
|
486
518
|
isDirectory: !!r.isDirectory
|
|
487
519
|
};
|
|
488
|
-
},
|
|
489
|
-
if ("string" != typeof t) throw new Error(
|
|
490
|
-
if ("string" != typeof s) throw new Error(
|
|
520
|
+
}, d = async (t, s, n) => {
|
|
521
|
+
if ("string" != typeof t) throw new Error(`writeFile, invalid filePath: ${t}`);
|
|
522
|
+
if ("string" != typeof s) throw new Error(`writeFile, invalid content: ${t}`);
|
|
491
523
|
const o = {
|
|
492
524
|
ignored: !1,
|
|
493
525
|
changedContent: !1,
|
|
494
526
|
queuedWrite: !1
|
|
495
527
|
};
|
|
496
528
|
if (!0 === shouldIgnore(t)) return o.ignored = !0, o;
|
|
497
|
-
const i =
|
|
529
|
+
const i = b(t);
|
|
498
530
|
if (i.exists = !0, i.isFile = !0, i.isDirectory = !1, i.queueDeleteFromDisk = !1,
|
|
499
531
|
"string" == typeof i.fileText ? o.changedContent = i.fileText.replace(/\r/g, "") !== s.replace(/\r/g, "") : o.changedContent = !0,
|
|
500
532
|
i.fileText = s, o.queuedWrite = !1, null != n && ("string" == typeof n.outputTargetType && r.set(t, n.outputTargetType),
|
|
501
533
|
!1 === n.useCache && (i.useCache = !1)), null != n && !0 === n.inMemoryOnly) i.queueWriteToDisk ? o.queuedWrite = !0 : i.queueWriteToDisk = !1,
|
|
502
|
-
await
|
|
534
|
+
await h(t, !0); else if (null != n && !0 === n.immediateWrite) {
|
|
503
535
|
if (o.changedContent || !0 !== n.useCache) {
|
|
504
536
|
const r = await e.readFile(t);
|
|
505
537
|
"string" == typeof r && (o.changedContent = i.fileText.replace(/\r/g, "") !== r.replace(/\r/g, "")),
|
|
506
|
-
o.changedContent && (await
|
|
538
|
+
o.changedContent && (await h(t, !1), await e.writeFile(t, i.fileText));
|
|
507
539
|
}
|
|
508
540
|
} else i.queueWriteToDisk || !0 !== o.changedContent || (i.queueWriteToDisk = !0,
|
|
509
541
|
o.queuedWrite = !0);
|
|
510
542
|
return o;
|
|
511
|
-
},
|
|
543
|
+
}, h = async (e, t) => {
|
|
512
544
|
const r = [];
|
|
513
|
-
for (;"string" == typeof (e = path$
|
|
514
|
-
r.reverse(), await
|
|
515
|
-
},
|
|
545
|
+
for (;"string" == typeof (e = path$2.dirname(e)) && e.length > 0 && "/" !== e && !1 === e.endsWith(":/") && !1 === e.endsWith(":\\"); ) r.push(e);
|
|
546
|
+
r.reverse(), await p(r, t);
|
|
547
|
+
}, p = async (t, r) => {
|
|
516
548
|
const s = [];
|
|
517
549
|
for (const n of t) {
|
|
518
|
-
const t =
|
|
550
|
+
const t = b(n);
|
|
519
551
|
if (!0 !== t.exists || !0 !== t.isDirectory) try {
|
|
520
|
-
t.exists = !0, t.isDirectory = !0, t.isFile = !1, r || await e.
|
|
552
|
+
t.exists = !0, t.isDirectory = !0, t.isFile = !1, r || await e.createDir(n), s.push(n);
|
|
521
553
|
} catch (e) {}
|
|
522
554
|
}
|
|
523
555
|
return s;
|
|
524
|
-
},
|
|
525
|
-
const r =
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
});
|
|
533
|
-
|
|
556
|
+
}, f = t => Promise.all(t.map((async t => {
|
|
557
|
+
const r = t[0], s = t[1];
|
|
558
|
+
return await e.copyFile(r, s), [ r, s ];
|
|
559
|
+
}))), m = e => Promise.all(e.map((async e => {
|
|
560
|
+
if ("string" != typeof e) throw new Error("unable to writeFile without filePath");
|
|
561
|
+
return g(e);
|
|
562
|
+
}))), g = async t => {
|
|
563
|
+
const r = b(t);
|
|
564
|
+
if (null == r.fileText) throw new Error(`unable to find item fileText to write: ${t}`);
|
|
565
|
+
return await e.writeFile(t, r.fileText), !1 === r.useCache && v(t), t;
|
|
566
|
+
}, y = async t => await Promise.all(t.map((async t => {
|
|
567
|
+
if ("string" != typeof t) throw new Error("unable to unlink without filePath");
|
|
568
|
+
return await e.removeFile(t), t;
|
|
569
|
+
}))), w = async t => {
|
|
570
|
+
const r = [];
|
|
571
|
+
for (const s of t) await e.removeDir(s), r.push(s);
|
|
572
|
+
return r;
|
|
573
|
+
}, _ = e => {
|
|
574
|
+
e = normalizePath(e), t.forEach(((t, r) => {
|
|
575
|
+
const s = path$2.relative(e, r).split("/")[0];
|
|
576
|
+
s.startsWith(".") || s.startsWith("/") || v(r);
|
|
577
|
+
}));
|
|
578
|
+
}, v = e => {
|
|
534
579
|
e = normalizePath(e);
|
|
535
580
|
const r = t.get(e);
|
|
536
581
|
null == r || r.queueWriteToDisk || t.delete(e);
|
|
537
|
-
},
|
|
582
|
+
}, b = e => {
|
|
538
583
|
e = normalizePath(e);
|
|
539
584
|
let r = t.get(e);
|
|
540
585
|
return null != r || t.set(e, r = {
|
|
@@ -549,13 +594,13 @@ function mockCompilerCtx(e) {
|
|
|
549
594
|
queueWriteToDisk: null,
|
|
550
595
|
useCache: null
|
|
551
596
|
}), r;
|
|
552
|
-
};
|
|
597
|
+
}, E = 5242880;
|
|
553
598
|
return {
|
|
554
599
|
access: async e => (await s(e)).exists,
|
|
555
600
|
accessSync: e => {
|
|
556
|
-
const t =
|
|
601
|
+
const t = b(e);
|
|
557
602
|
if ("boolean" != typeof t.exists) {
|
|
558
|
-
const r =
|
|
603
|
+
const r = u(e);
|
|
559
604
|
t.exists = r.exists, t.isDirectory = r.isDirectory, t.isFile = r.isFile;
|
|
560
605
|
}
|
|
561
606
|
return t.exists;
|
|
@@ -563,118 +608,94 @@ function mockCompilerCtx(e) {
|
|
|
563
608
|
accessData: s,
|
|
564
609
|
cancelDeleteDirectoriesFromDisk: e => {
|
|
565
610
|
for (const t of e) {
|
|
566
|
-
const e =
|
|
611
|
+
const e = b(t);
|
|
567
612
|
!0 === e.queueDeleteFromDisk && (e.queueDeleteFromDisk = !1);
|
|
568
613
|
}
|
|
569
614
|
},
|
|
570
615
|
cancelDeleteFilesFromDisk: e => {
|
|
571
616
|
for (const t of e) {
|
|
572
|
-
const e =
|
|
617
|
+
const e = b(t);
|
|
573
618
|
!0 === e.isFile && !0 === e.queueDeleteFromDisk && (e.queueDeleteFromDisk = !1);
|
|
574
619
|
}
|
|
575
620
|
},
|
|
576
621
|
clearCache: () => t.clear(),
|
|
577
|
-
clearDirCache:
|
|
578
|
-
clearFileCache:
|
|
622
|
+
clearDirCache: _,
|
|
623
|
+
clearFileCache: v,
|
|
579
624
|
commit: async () => {
|
|
580
|
-
const
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
}))), i = await (async t => await Promise.all(t.map(async t => {
|
|
588
|
-
if ("string" != typeof t) throw new Error("unable to unlink without filePath");
|
|
589
|
-
return await e.unlink(t), t;
|
|
590
|
-
})))(r.filesToDelete), a = await (async t => {
|
|
591
|
-
const r = [];
|
|
592
|
-
for (const s of t) await e.rmdir(s), r.push(s);
|
|
593
|
-
return r;
|
|
594
|
-
})(r.dirsToDelete);
|
|
595
|
-
var l, c;
|
|
596
|
-
return r.filesToDelete.forEach(m), r.dirsToDelete.forEach(f), {
|
|
597
|
-
filesCopied: o,
|
|
598
|
-
filesWritten: n,
|
|
599
|
-
filesDeleted: i,
|
|
600
|
-
dirsDeleted: a,
|
|
601
|
-
dirsAdded: s
|
|
625
|
+
const e = getCommitInstructions(t), r = await p(e.dirsToEnsure, !1), s = await m(e.filesToWrite), n = await f(e.filesToCopy), o = await y(e.filesToDelete), i = await w(e.dirsToDelete);
|
|
626
|
+
return e.filesToDelete.forEach(v), e.dirsToDelete.forEach(_), {
|
|
627
|
+
filesCopied: n,
|
|
628
|
+
filesWritten: s,
|
|
629
|
+
filesDeleted: o,
|
|
630
|
+
dirsDeleted: i,
|
|
631
|
+
dirsAdded: r
|
|
602
632
|
};
|
|
603
633
|
},
|
|
604
634
|
copyFile: async (e, t) => {
|
|
605
|
-
|
|
635
|
+
b(e).queueCopyFileToDest = t;
|
|
606
636
|
},
|
|
607
637
|
emptyDirs: async e => {
|
|
608
|
-
e = e.filter(isString).map(normalizePath).reduce((e, t) => (e.includes(t) || e.push(t),
|
|
609
|
-
e), []);
|
|
610
|
-
const t = await Promise.all(e.map(e => n(e, {
|
|
638
|
+
e = e.filter(isString).map(normalizePath).reduce(((e, t) => (e.includes(t) || e.push(t),
|
|
639
|
+
e)), []);
|
|
640
|
+
const t = await Promise.all(e.map((e => n(e, {
|
|
611
641
|
recursive: !0
|
|
612
|
-
}))), r = [];
|
|
642
|
+
})))), r = [];
|
|
613
643
|
for (const e of t) for (const t of e) r.includes(t.absPath) || r.push(t.absPath);
|
|
614
|
-
r.sort((e, t) => {
|
|
644
|
+
r.sort(((e, t) => {
|
|
615
645
|
const r = e.split("/").length, s = t.split("/").length;
|
|
616
646
|
return r < s ? 1 : r > s ? -1 : 0;
|
|
617
|
-
}), await Promise.all(r.map(
|
|
618
|
-
const t =
|
|
647
|
+
})), await Promise.all(r.map(l)), e.forEach((e => {
|
|
648
|
+
const t = b(e);
|
|
619
649
|
t.isFile = !1, t.isDirectory = !0, t.queueWriteToDisk = !0, t.queueDeleteFromDisk = !1;
|
|
620
|
-
});
|
|
650
|
+
}));
|
|
621
651
|
},
|
|
622
652
|
getBuildOutputs: () => {
|
|
623
653
|
const e = [];
|
|
624
|
-
return r.forEach((t, r) => {
|
|
625
|
-
const s = e.find(e => e.type === t);
|
|
654
|
+
return r.forEach(((t, r) => {
|
|
655
|
+
const s = e.find((e => e.type === t));
|
|
626
656
|
s ? s.files.push(r) : e.push({
|
|
627
657
|
type: t,
|
|
628
658
|
files: [ r ]
|
|
629
659
|
});
|
|
630
|
-
}), e.forEach(e => e.files.sort()), e.sort((e, t) => e.type < t.type ? -1 : e.type > t.type ? 1 : 0);
|
|
660
|
+
})), e.forEach((e => e.files.sort())), e.sort(((e, t) => e.type < t.type ? -1 : e.type > t.type ? 1 : 0));
|
|
631
661
|
},
|
|
632
|
-
getItem:
|
|
633
|
-
getMemoryStats: () =>
|
|
662
|
+
getItem: b,
|
|
663
|
+
getMemoryStats: () => `data length: ${t.size}`,
|
|
634
664
|
keys: () => Array.from(t.keys()).sort(),
|
|
635
665
|
readFile: async (t, r) => {
|
|
636
666
|
if (null == r || !0 === r.useCache || void 0 === r.useCache) {
|
|
637
|
-
const e =
|
|
667
|
+
const e = b(t);
|
|
638
668
|
if (e.exists && "string" == typeof e.fileText) return e.fileText;
|
|
639
669
|
}
|
|
640
|
-
const s = await e.readFile(t), n =
|
|
641
|
-
return "string" == typeof s ? s.length <
|
|
642
|
-
n.
|
|
670
|
+
const s = await e.readFile(t), n = b(t);
|
|
671
|
+
return "string" == typeof s ? s.length < E && (n.exists = !0, n.isFile = !0, n.isDirectory = !1,
|
|
672
|
+
n.fileText = s) : n.exists = !1, s;
|
|
643
673
|
},
|
|
644
674
|
readFileSync: (t, r) => {
|
|
645
675
|
if (null == r || !0 === r.useCache || void 0 === r.useCache) {
|
|
646
|
-
const e =
|
|
676
|
+
const e = b(t);
|
|
647
677
|
if (e.exists && "string" == typeof e.fileText) return e.fileText;
|
|
648
678
|
}
|
|
649
|
-
const s = e.readFileSync(t), n =
|
|
650
|
-
return "string" == typeof s ? s.length <
|
|
651
|
-
n.
|
|
679
|
+
const s = e.readFileSync(t), n = b(t);
|
|
680
|
+
return "string" == typeof s ? s.length < E && (n.exists = !0, n.isFile = !0, n.isDirectory = !1,
|
|
681
|
+
n.fileText = s) : n.exists = !1, s;
|
|
652
682
|
},
|
|
653
683
|
readdir: n,
|
|
654
684
|
remove: async e => {
|
|
655
|
-
const t = await
|
|
656
|
-
!0 === t.isDirectory ? await (
|
|
657
|
-
const t = g(e);
|
|
658
|
-
t.isFile = !1, t.isDirectory = !0, t.queueWriteToDisk || (t.queueDeleteFromDisk = !0);
|
|
659
|
-
try {
|
|
660
|
-
const t = await n(e, {
|
|
661
|
-
recursive: !0
|
|
662
|
-
});
|
|
663
|
-
await Promise.all(t.map(e => e.relPath.endsWith(".gitkeep") ? null : a(e.absPath)));
|
|
664
|
-
} catch (e) {}
|
|
665
|
-
})(e) : !0 === t.isFile && await a(e);
|
|
685
|
+
const t = await c(e);
|
|
686
|
+
!0 === t.isDirectory ? await a(e) : !0 === t.isFile && await l(e);
|
|
666
687
|
},
|
|
667
|
-
stat:
|
|
668
|
-
statSync:
|
|
688
|
+
stat: c,
|
|
689
|
+
statSync: u,
|
|
669
690
|
sys: e,
|
|
670
|
-
writeFile:
|
|
691
|
+
writeFile: d,
|
|
671
692
|
writeFiles: (e, t) => {
|
|
672
693
|
const r = [];
|
|
673
|
-
return isIterable(e) ? e.forEach((e, s) => {
|
|
674
|
-
r.push(
|
|
675
|
-
}) : Object.keys(e).map(s => {
|
|
676
|
-
r.push(
|
|
677
|
-
}), Promise.all(r);
|
|
694
|
+
return isIterable(e) ? e.forEach(((e, s) => {
|
|
695
|
+
r.push(d(s, e, t));
|
|
696
|
+
})) : Object.keys(e).map((s => {
|
|
697
|
+
r.push(d(s, e[s], t));
|
|
698
|
+
})), Promise.all(r);
|
|
678
699
|
}
|
|
679
700
|
};
|
|
680
701
|
})(e.sys)), this._fs;
|
|
@@ -690,34 +711,49 @@ function mockCompilerCtx(e) {
|
|
|
690
711
|
}), t;
|
|
691
712
|
}
|
|
692
713
|
|
|
714
|
+
function findRootComponent(e, t) {
|
|
715
|
+
if (null != t) {
|
|
716
|
+
const r = t.children, s = r.length;
|
|
717
|
+
for (let t = 0; t < s; t++) {
|
|
718
|
+
const s = r[t];
|
|
719
|
+
if (e.has(s.nodeName.toLowerCase())) return s;
|
|
720
|
+
}
|
|
721
|
+
for (let t = 0; t < s; t++) {
|
|
722
|
+
const s = findRootComponent(e, r[t]);
|
|
723
|
+
if (null != s) return s;
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
return null;
|
|
727
|
+
}
|
|
728
|
+
|
|
693
729
|
async function initPageEvents(e) {
|
|
694
730
|
e._e2eEvents = new Map, e._e2eEventIds = 0, e.spyOnEvent = pageSpyOnEvent.bind(e, e),
|
|
695
|
-
await e.exposeFunction("rindoOnEvent", (t, r) => {
|
|
731
|
+
await e.exposeFunction("rindoOnEvent", ((t, r) => {
|
|
696
732
|
!function s(e, t, r) {
|
|
697
733
|
const s = e.get(t);
|
|
698
734
|
s && s.callback(r);
|
|
699
735
|
}(e._e2eEvents, t, r);
|
|
700
|
-
}), await e.evaluateOnNewDocument(browserContextEvents);
|
|
736
|
+
})), await e.evaluateOnNewDocument(browserContextEvents);
|
|
701
737
|
}
|
|
702
738
|
|
|
703
739
|
async function pageSpyOnEvent(e, t, r) {
|
|
704
740
|
const s = new EventSpy(t), n = "document" !== r ? () => window : () => document, o = await e.evaluateHandle(n);
|
|
705
|
-
return await addE2EListener(e, o, t, e => {
|
|
741
|
+
return await addE2EListener(e, o, t, (e => {
|
|
706
742
|
s.push(e);
|
|
707
|
-
}), s;
|
|
743
|
+
})), s;
|
|
708
744
|
}
|
|
709
745
|
|
|
710
746
|
async function waitForEvent(e, t, r) {
|
|
711
|
-
const s = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, n = await e.evaluate((e, t, r) => new Promise((s, n) => {
|
|
712
|
-
const o = setTimeout(() => {
|
|
713
|
-
n(new Error(
|
|
714
|
-
}, r);
|
|
715
|
-
e.addEventListener(t, e => {
|
|
747
|
+
const s = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, n = await e.evaluate(((e, t, r) => new Promise(((s, n) => {
|
|
748
|
+
const o = setTimeout((() => {
|
|
749
|
+
n(new Error(`waitForEvent() timeout, eventName: ${t}`));
|
|
750
|
+
}), r);
|
|
751
|
+
e.addEventListener(t, (e => {
|
|
716
752
|
clearTimeout(o), s(window.rindoSerializeEvent(e));
|
|
717
|
-
}, {
|
|
753
|
+
}), {
|
|
718
754
|
once: !0
|
|
719
755
|
});
|
|
720
|
-
}), r, t, s);
|
|
756
|
+
}))), r, t, s);
|
|
721
757
|
return await e.waitForChanges(), n;
|
|
722
758
|
}
|
|
723
759
|
|
|
@@ -728,11 +764,11 @@ async function addE2EListener(e, t, r, s) {
|
|
|
728
764
|
callback: s
|
|
729
765
|
});
|
|
730
766
|
const o = t.executionContext();
|
|
731
|
-
await o.evaluate((e, t, r) => {
|
|
732
|
-
e.addEventListener(r, e => {
|
|
767
|
+
await o.evaluate(((e, t, r) => {
|
|
768
|
+
e.addEventListener(r, (e => {
|
|
733
769
|
window.rindoOnEvent(t, window.rindoSerializeEvent(e));
|
|
734
|
-
});
|
|
735
|
-
}, t, n, r);
|
|
770
|
+
}));
|
|
771
|
+
}), t, n, r);
|
|
736
772
|
}
|
|
737
773
|
|
|
738
774
|
function browserContextEvents() {
|
|
@@ -744,12 +780,12 @@ function browserContextEvents() {
|
|
|
744
780
|
t(e, n);
|
|
745
781
|
}
|
|
746
782
|
};
|
|
747
|
-
return t(e, window.document.documentElement), Promise.all(e).catch(e => console.error(e));
|
|
748
|
-
}, t = () => e().then(() => new Promise(e => {
|
|
783
|
+
return t(e, window.document.documentElement), Promise.all(e).catch((e => console.error(e)));
|
|
784
|
+
}, t = () => e().then((() => new Promise((e => {
|
|
749
785
|
requestAnimationFrame(e);
|
|
750
|
-
})).then(() => e()).then(() => {
|
|
786
|
+
})))).then((() => e())).then((() => {
|
|
751
787
|
window.rindoAppLoaded = !0;
|
|
752
|
-
});
|
|
788
|
+
}));
|
|
753
789
|
window.rindoSerializeEventTarget = e => e ? e === window ? {
|
|
754
790
|
serializedWindow: !0
|
|
755
791
|
} : e === document ? {
|
|
@@ -790,16 +826,16 @@ async function find(e, t, r) {
|
|
|
790
826
|
let n = await t.$(r);
|
|
791
827
|
if (!n) return null;
|
|
792
828
|
if (s) {
|
|
793
|
-
const t = await e.evaluateHandle((e, t) => {
|
|
794
|
-
if (!e.shadowRoot) throw new Error(
|
|
829
|
+
const t = await e.evaluateHandle(((e, t) => {
|
|
830
|
+
if (!e.shadowRoot) throw new Error(`shadow root does not exist for element: ${e.tagName.toLowerCase()}`);
|
|
795
831
|
return e.shadowRoot.querySelector(t);
|
|
796
|
-
}, n, s);
|
|
832
|
+
}), n, s);
|
|
797
833
|
if (await n.dispose(), !t) return null;
|
|
798
834
|
n = t.asElement();
|
|
799
835
|
}
|
|
800
836
|
return n;
|
|
801
837
|
}(e, t, s, n) : await async function c(e, t, r, s) {
|
|
802
|
-
const n = await e.evaluateHandle((e, t, r) => {
|
|
838
|
+
const n = await e.evaluateHandle(((e, t, r) => {
|
|
803
839
|
let s = null;
|
|
804
840
|
return function e(n) {
|
|
805
841
|
if (n && !s) if (3 === n.nodeType) {
|
|
@@ -810,7 +846,7 @@ async function find(e, t, r) {
|
|
|
810
846
|
if (e(n.shadowRoot), n.childNodes) for (let t = 0; t < n.childNodes.length; t++) e(n.childNodes[t]);
|
|
811
847
|
}
|
|
812
848
|
}(e), s;
|
|
813
|
-
}, t, r, s);
|
|
849
|
+
}), t, r, s);
|
|
814
850
|
return n ? n.asElement() : null;
|
|
815
851
|
}(e, t, o, i), !a) return null;
|
|
816
852
|
const u = new E2EElement(e, a);
|
|
@@ -821,10 +857,10 @@ async function findAll(e, t, r) {
|
|
|
821
857
|
const s = [], {lightSelector: n, shadowSelector: o} = getSelector(r), i = await t.$$(n);
|
|
822
858
|
if (0 === i.length) return s;
|
|
823
859
|
if (o) for (let t = 0; t < i.length; t++) {
|
|
824
|
-
const r = i[t].executionContext(), n = await r.evaluateHandle((e, t) => {
|
|
825
|
-
if (!e.shadowRoot) throw new Error(
|
|
860
|
+
const r = i[t].executionContext(), n = await r.evaluateHandle(((e, t) => {
|
|
861
|
+
if (!e.shadowRoot) throw new Error(`shadow root does not exist for element: ${e.tagName.toLowerCase()}`);
|
|
826
862
|
return e.shadowRoot.querySelectorAll(t);
|
|
827
|
-
}, i[t], o);
|
|
863
|
+
}), i[t], o);
|
|
828
864
|
await i[t].dispose();
|
|
829
865
|
const a = await n.getProperties();
|
|
830
866
|
await n.dispose();
|
|
@@ -853,7 +889,7 @@ function getSelector(e) {
|
|
|
853
889
|
const r = e.split(">>>");
|
|
854
890
|
t.lightSelector = r[0].trim(), t.shadowSelector = r.length > 1 ? r[1].trim() : null;
|
|
855
891
|
} else if ("string" == typeof e.text) t.text = e.text.trim(); else {
|
|
856
|
-
if ("string" != typeof e.contains) throw new Error(
|
|
892
|
+
if ("string" != typeof e.contains) throw new Error(`invalid find selector: ${e}`);
|
|
857
893
|
t.contains = e.contains.trim();
|
|
858
894
|
}
|
|
859
895
|
return t;
|
|
@@ -861,32 +897,32 @@ function getSelector(e) {
|
|
|
861
897
|
|
|
862
898
|
async function writeScreenshotData(e, t) {
|
|
863
899
|
const r = function s(e, t) {
|
|
864
|
-
const r = t
|
|
865
|
-
return
|
|
900
|
+
const r = `${t}.json`;
|
|
901
|
+
return path__default.default.join(e, r);
|
|
866
902
|
}(e, t.id), n = JSON.stringify(t, null, 2);
|
|
867
903
|
await writeFile(r, n);
|
|
868
904
|
}
|
|
869
905
|
|
|
870
906
|
function writeFile(e, t) {
|
|
871
|
-
return new Promise((r, s) => {
|
|
872
|
-
|
|
907
|
+
return new Promise(((r, s) => {
|
|
908
|
+
fs__default.default.writeFile(e, t, (e => {
|
|
873
909
|
e ? s(e) : r();
|
|
874
|
-
});
|
|
875
|
-
});
|
|
910
|
+
}));
|
|
911
|
+
}));
|
|
876
912
|
}
|
|
877
913
|
|
|
878
914
|
async function compareScreenshot(e, t, r, s, n, o, i, a) {
|
|
879
|
-
const l = crypto$
|
|
915
|
+
const l = `${crypto$3.createHash("md5").update(r).digest("hex")}.png`, c = path$2.join(t.imagesDir, l);
|
|
880
916
|
await async function u(e, t) {
|
|
881
917
|
await function r(e) {
|
|
882
|
-
return new Promise(t => {
|
|
883
|
-
|
|
884
|
-
});
|
|
918
|
+
return new Promise((t => {
|
|
919
|
+
fs__default.default.access(e, (e => t(!e)));
|
|
920
|
+
}));
|
|
885
921
|
}(e) || await writeFile(e, t);
|
|
886
|
-
}(c, r), r = null, i && (i = normalizePath(path$
|
|
922
|
+
}(c, r), r = null, i && (i = normalizePath(path$2.relative(t.rootDir, i)));
|
|
887
923
|
const d = function h(e, t) {
|
|
888
924
|
if ("string" != typeof t || 0 === t.trim().length) throw new Error("invalid test description");
|
|
889
|
-
const r = crypto$
|
|
925
|
+
const r = crypto$3.createHash("md5");
|
|
890
926
|
return r.update(t + ":"), r.update(e.userAgent + ":"), r.update(e.viewport.width + ":"),
|
|
891
927
|
r.update(e.viewport.height + ":"), r.update(e.viewport.deviceScaleFactor + ":"),
|
|
892
928
|
r.update(e.viewport.hasTouch + ":"), r.update(e.viewport.isMobile + ":"), r.digest("hex").substr(0, 8).toLowerCase();
|
|
@@ -927,39 +963,39 @@ async function compareScreenshot(e, t, r, s, n, o, i, a) {
|
|
|
927
963
|
if (!f) return await writeScreenshotData(t.currentBuildDir, p), p.diff;
|
|
928
964
|
if (p.diff.imageA = f, p.diff.imageA !== p.diff.imageB) {
|
|
929
965
|
p.diff.cacheKey = function m(e, t, r) {
|
|
930
|
-
const s = crypto$
|
|
966
|
+
const s = crypto$3.createHash("md5");
|
|
931
967
|
return s.update(`${e}:${t}:${r}`), s.digest("hex").substr(0, 10);
|
|
932
968
|
}(p.diff.imageA, p.diff.imageB, a);
|
|
933
969
|
const r = t.cache[p.diff.cacheKey];
|
|
934
970
|
if ("number" != typeof r || isNaN(r)) {
|
|
935
971
|
const r = Math.round(e.viewport.width * e.viewport.deviceScaleFactor), s = Math.round(e.viewport.height * e.viewport.deviceScaleFactor), n = {
|
|
936
|
-
imageAPath: path$
|
|
937
|
-
imageBPath: path$
|
|
972
|
+
imageAPath: path$2.join(t.imagesDir, p.diff.imageA),
|
|
973
|
+
imageBPath: path$2.join(t.imagesDir, p.diff.imageB),
|
|
938
974
|
width: r,
|
|
939
975
|
height: s,
|
|
940
976
|
pixelmatchThreshold: a
|
|
941
977
|
};
|
|
942
978
|
p.diff.mismatchedPixels = await async function g(e, t) {
|
|
943
|
-
return new Promise((r, s) => {
|
|
944
|
-
const n = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, o = setTimeout(() => {
|
|
979
|
+
return new Promise(((r, s) => {
|
|
980
|
+
const n = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, o = setTimeout((() => {
|
|
945
981
|
s(`getMismatchedPixels timeout: ${n}ms`);
|
|
946
|
-
}, n);
|
|
982
|
+
}), n);
|
|
947
983
|
try {
|
|
948
984
|
const n = {
|
|
949
|
-
execArgv: process.execArgv.filter(e => !/^--(debug|inspect)/.test(e)),
|
|
985
|
+
execArgv: process.execArgv.filter((e => !/^--(debug|inspect)/.test(e))),
|
|
950
986
|
env: process.env,
|
|
951
987
|
cwd: process.cwd(),
|
|
952
988
|
stdio: [ "pipe", "pipe", "pipe", "ipc" ]
|
|
953
|
-
}, i = child_process$
|
|
954
|
-
i.on("message", e => {
|
|
989
|
+
}, i = child_process$2.fork(e, [], n);
|
|
990
|
+
i.on("message", (e => {
|
|
955
991
|
i.kill(), clearTimeout(o), r(e);
|
|
956
|
-
}), i.on("error", e => {
|
|
992
|
+
})), i.on("error", (e => {
|
|
957
993
|
clearTimeout(o), s(e);
|
|
958
|
-
}), i.send(t);
|
|
994
|
+
})), i.send(t);
|
|
959
995
|
} catch (e) {
|
|
960
|
-
clearTimeout(o), s(
|
|
996
|
+
clearTimeout(o), s(`getMismatchedPixels error: ${e}`);
|
|
961
997
|
}
|
|
962
|
-
});
|
|
998
|
+
}));
|
|
963
999
|
}(t.pixelmatchModulePath, n);
|
|
964
1000
|
} else p.diff.mismatchedPixels = r;
|
|
965
1001
|
}
|
|
@@ -976,7 +1012,7 @@ async function e2eGoTo(e, t, r = {}) {
|
|
|
976
1012
|
r.waitUntil || (r.waitUntil = env.__RINDO_BROWSER_WAIT_UNTIL);
|
|
977
1013
|
const o = await e._e2eGoto(n, r);
|
|
978
1014
|
if (!o.ok()) throw new Error(`Testing unable to load ${t}, HTTP status: ${o.status()}`);
|
|
979
|
-
return await waitForRindo(e), o;
|
|
1015
|
+
return await waitForRindo(e, r), o;
|
|
980
1016
|
}
|
|
981
1017
|
|
|
982
1018
|
async function e2eSetContent(e, t, r = {}) {
|
|
@@ -989,22 +1025,23 @@ async function e2eSetContent(e, t, r = {}) {
|
|
|
989
1025
|
"string" == typeof o && s.push(`<link rel="stylesheet" href="${o}">`), s.push(`<script type="module" src="${n}"><\/script>`),
|
|
990
1026
|
s.push("</head>"), s.push("<body>"), s.push(t), s.push("</body>"), s.push("</html>");
|
|
991
1027
|
const i = env.__RINDO_BROWSER_URL__;
|
|
992
|
-
await e.setRequestInterception(!0), e.on("request", e => {
|
|
1028
|
+
await e.setRequestInterception(!0), e.on("request", (e => {
|
|
993
1029
|
i === e.url() ? e.respond({
|
|
994
1030
|
status: 200,
|
|
995
1031
|
contentType: "text/html",
|
|
996
1032
|
body: s.join("\n")
|
|
997
1033
|
}) : e.continue();
|
|
998
|
-
}), r.waitUntil || (r.waitUntil = env.__RINDO_BROWSER_WAIT_UNTIL);
|
|
1034
|
+
})), r.waitUntil || (r.waitUntil = env.__RINDO_BROWSER_WAIT_UNTIL);
|
|
999
1035
|
const a = await e._e2eGoto(i, r);
|
|
1000
1036
|
if (!a.ok()) throw new Error("Testing unable to load content");
|
|
1001
|
-
return await waitForRindo(e), a;
|
|
1037
|
+
return await waitForRindo(e, r), a;
|
|
1002
1038
|
}
|
|
1003
1039
|
|
|
1004
|
-
async function waitForRindo(e) {
|
|
1040
|
+
async function waitForRindo(e, t) {
|
|
1005
1041
|
try {
|
|
1042
|
+
const r = "number" == typeof t.timeout ? t.timeout : 4750;
|
|
1006
1043
|
await e.waitForFunction("window.rindoAppLoaded", {
|
|
1007
|
-
timeout:
|
|
1044
|
+
timeout: r
|
|
1008
1045
|
});
|
|
1009
1046
|
} catch (e) {
|
|
1010
1047
|
throw new Error("App did not load in allowed time. Please ensure the content loads a rindo application.");
|
|
@@ -1014,9 +1051,9 @@ async function waitForRindo(e) {
|
|
|
1014
1051
|
async function waitForChanges(e) {
|
|
1015
1052
|
try {
|
|
1016
1053
|
if (e.isClosed()) return;
|
|
1017
|
-
if (await Promise.all(e._e2eElements.map(e => e.e2eRunActions())), e.isClosed()) return;
|
|
1018
|
-
if (await e.evaluate(() => new Promise(e => {
|
|
1019
|
-
requestAnimationFrame(() => {
|
|
1054
|
+
if (await Promise.all(e._e2eElements.map((e => e.e2eRunActions()))), e.isClosed()) return;
|
|
1055
|
+
if (await e.evaluate((() => new Promise((e => {
|
|
1056
|
+
requestAnimationFrame((() => {
|
|
1020
1057
|
const t = [], r = (e, t) => {
|
|
1021
1058
|
if (null != e) {
|
|
1022
1059
|
"shadowRoot" in e && e.shadowRoot instanceof ShadowRoot && r(e.shadowRoot, t);
|
|
@@ -1028,40 +1065,37 @@ async function waitForChanges(e) {
|
|
|
1028
1065
|
}
|
|
1029
1066
|
}
|
|
1030
1067
|
};
|
|
1031
|
-
r(document.documentElement, t), Promise.all(t).then(() => {
|
|
1068
|
+
r(document.documentElement, t), Promise.all(t).then((() => {
|
|
1032
1069
|
e();
|
|
1033
|
-
}).catch(() => {
|
|
1070
|
+
})).catch((() => {
|
|
1034
1071
|
e();
|
|
1035
|
-
});
|
|
1036
|
-
});
|
|
1037
|
-
})), e.isClosed()) return;
|
|
1038
|
-
|
|
1072
|
+
}));
|
|
1073
|
+
}));
|
|
1074
|
+
})))), e.isClosed()) return;
|
|
1075
|
+
"function" == typeof e.waitForTimeout ? await e.waitForTimeout(100) : await e.waitFor(100),
|
|
1076
|
+
await Promise.all(e._e2eElements.map((e => e.e2eSync())));
|
|
1039
1077
|
} catch (e) {}
|
|
1040
1078
|
}
|
|
1041
1079
|
|
|
1042
1080
|
function serializeConsoleMessage(e) {
|
|
1043
1081
|
return `${e.text()} ${function t(e) {
|
|
1044
1082
|
let t = "";
|
|
1045
|
-
return e && e.url && (t =
|
|
1046
|
-
e.columnNumber && (t +=
|
|
1083
|
+
return e && e.url && (t = `\nLocation: ${e.url}`, e.lineNumber && (t += `:${e.lineNumber}`),
|
|
1084
|
+
e.columnNumber && (t += `:${e.columnNumber}`)), t;
|
|
1047
1085
|
}(e.location())}`;
|
|
1048
1086
|
}
|
|
1049
1087
|
|
|
1050
|
-
var posix, pathBrowserify, caller, pathParse, parse, getNodeModulesDirs, nodeModulesPaths, normalizeOptions,
|
|
1051
|
-
|
|
1052
|
-
const path$
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
"shadow" !== e.encapsulation && e.htmlTagNames.includes("slot") && (r |= 4), e.hasMode && (r |= 32);
|
|
1058
|
-
const s = formatComponentRuntimeMembers(e, t), n = formatHostListeners(e);
|
|
1059
|
-
return trimFalsy([ r, e.tagName, Object.keys(s).length > 0 ? s : void 0, n.length > 0 ? n : void 0 ]);
|
|
1060
|
-
}), formatComponentRuntimeMembers = (e, t = !0) => Object.assign(Object.assign(Object.assign({}, formatPropertiesRuntimeMember(e.properties)), formatStatesRuntimeMember(e.states)), t ? formatMethodsRuntimeMember(e.methods) : {}), formatPropertiesRuntimeMember = e => {
|
|
1088
|
+
var posix, pathBrowserify, caller, pathParse, parse, getNodeModulesDirs, nodeModulesPaths, normalizeOptions, ERROR_MESSAGE, slice, toStr, implementation, functionBind, src, isCoreModule, realpathFS$1, defaultIsFile$1, defaultIsDir$1, defaultRealpath, maybeRealpath, defaultReadPackage, getPackageCandidates$1, async, current, core, mod, core_1, isCore, realpathFS, defaultIsFile, defaultIsDir, defaultRealpathSync, maybeRealpathSync, defaultReadPackageSync, getPackageCandidates, sync, resolve;
|
|
1089
|
+
|
|
1090
|
+
const path$2 = require("path"), index_js = _lazyRequire("../dev-server/index.js"), rindo_js = require("../compiler/rindo.js"), appData = _lazyRequire("@rindo/core/internal/app-data"), index_cjs = _lazyRequire("../mock-doc/index.cjs"), testing = _lazyRequire("@rindo/core/internal/testing"), fs$2 = require("fs"), crypto$3 = require("crypto"), child_process$2 = require("child_process"), path__default = _interopDefaultLegacy(path$2), fs__default = _interopDefaultLegacy(fs$2), formatComponentRuntimeMembers = (e, t = !0) => ({
|
|
1091
|
+
...formatPropertiesRuntimeMember(e.properties),
|
|
1092
|
+
...formatStatesRuntimeMember(e.states),
|
|
1093
|
+
...t ? formatMethodsRuntimeMember(e.methods) : {}
|
|
1094
|
+
}), formatPropertiesRuntimeMember = e => {
|
|
1061
1095
|
const t = {};
|
|
1062
|
-
return e.forEach(e => {
|
|
1096
|
+
return e.forEach((e => {
|
|
1063
1097
|
t[e.name] = trimFalsy([ formatFlags(e), formatAttrName(e) ]);
|
|
1064
|
-
}), t;
|
|
1098
|
+
})), t;
|
|
1065
1099
|
}, formatFlags = e => {
|
|
1066
1100
|
let t = formatPropType(e.type);
|
|
1067
1101
|
return e.mutable && (t |= 1024), e.reflect && (t |= 512), t;
|
|
@@ -1072,15 +1106,15 @@ process.exit, (e, t) => {
|
|
|
1072
1106
|
}
|
|
1073
1107
|
}, formatPropType = e => "string" === e ? 1 : "number" === e ? 2 : "boolean" === e ? 4 : "any" === e ? 8 : 16, formatStatesRuntimeMember = e => {
|
|
1074
1108
|
const t = {};
|
|
1075
|
-
return e.forEach(e => {
|
|
1109
|
+
return e.forEach((e => {
|
|
1076
1110
|
t[e.name] = [ 32 ];
|
|
1077
|
-
}), t;
|
|
1111
|
+
})), t;
|
|
1078
1112
|
}, formatMethodsRuntimeMember = e => {
|
|
1079
1113
|
const t = {};
|
|
1080
|
-
return e.forEach(e => {
|
|
1114
|
+
return e.forEach((e => {
|
|
1081
1115
|
t[e.name] = [ 64 ];
|
|
1082
|
-
}), t;
|
|
1083
|
-
}, formatHostListeners = e => e.listeners.map(e => [ computeListenerFlags(e), e.name, e.method ]), computeListenerFlags = e => {
|
|
1116
|
+
})), t;
|
|
1117
|
+
}, formatHostListeners = e => e.listeners.map((e => [ computeListenerFlags(e), e.name, e.method ])), computeListenerFlags = e => {
|
|
1084
1118
|
let t = 0;
|
|
1085
1119
|
switch (e.capture && (t |= 2), e.passive && (t |= 1), e.target) {
|
|
1086
1120
|
case "document":
|
|
@@ -1091,11 +1125,11 @@ process.exit, (e, t) => {
|
|
|
1091
1125
|
t |= 8;
|
|
1092
1126
|
break;
|
|
1093
1127
|
|
|
1094
|
-
case "
|
|
1128
|
+
case "body":
|
|
1095
1129
|
t |= 16;
|
|
1096
1130
|
break;
|
|
1097
1131
|
|
|
1098
|
-
case "
|
|
1132
|
+
case "parent":
|
|
1099
1133
|
t |= 32;
|
|
1100
1134
|
}
|
|
1101
1135
|
return t;
|
|
@@ -1103,7 +1137,7 @@ process.exit, (e, t) => {
|
|
|
1103
1137
|
const t = e;
|
|
1104
1138
|
for (var r = t.length - 1; r >= 0 && !t[r]; r--) t.pop();
|
|
1105
1139
|
return t;
|
|
1106
|
-
}, 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 => {
|
|
1140
|
+
}, 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 => {
|
|
1107
1141
|
if ("string" != typeof e) throw new Error("invalid path to normalize");
|
|
1108
1142
|
e = normalizeSlashes(e.trim());
|
|
1109
1143
|
const t = pathComponents(e, getRootLength(e)), r = reducePathComponents(t), s = r[0], n = r[1], o = s + r.slice(1).join("/");
|
|
@@ -1194,7 +1228,7 @@ process.exit, (e, t) => {
|
|
|
1194
1228
|
currentDirectory: r.rootDir
|
|
1195
1229
|
}, n = this.getCompilerOptions(r.rootDir);
|
|
1196
1230
|
n && (n.baseUrl && (s.baseUrl = n.baseUrl), n.paths && (s.paths = n.paths));
|
|
1197
|
-
const o = transpile(e, s), i = o.diagnostics.some(e => "error" === e.level);
|
|
1231
|
+
const o = transpile(e, s), i = o.diagnostics.some((e => "error" === e.level));
|
|
1198
1232
|
if (o.diagnostics && i) {
|
|
1199
1233
|
const e = o.diagnostics.map(formatDiagnostic).join("\n\n");
|
|
1200
1234
|
throw new Error(e);
|
|
@@ -1207,9 +1241,9 @@ process.exit, (e, t) => {
|
|
|
1207
1241
|
return this._tsCompilerOptions || (this._tsCompilerOptions = function t(e) {
|
|
1208
1242
|
if ("string" != typeof e) return null;
|
|
1209
1243
|
e = normalizePath(e);
|
|
1210
|
-
const t = ts.findConfigFile(e, ts.sys.fileExists);
|
|
1244
|
+
const t = rindo_js.ts.findConfigFile(e, rindo_js.ts.sys.fileExists);
|
|
1211
1245
|
if (!t) return null;
|
|
1212
|
-
const r = ts.readConfigFile(t, ts.sys.readFile);
|
|
1246
|
+
const r = rindo_js.ts.readConfigFile(t, rindo_js.ts.sys.readFile);
|
|
1213
1247
|
if (r.error) throw new Error(formatDiagnostic((e => {
|
|
1214
1248
|
const t = {
|
|
1215
1249
|
level: "warn",
|
|
@@ -1257,7 +1291,7 @@ process.exit, (e, t) => {
|
|
|
1257
1291
|
var r;
|
|
1258
1292
|
return t;
|
|
1259
1293
|
})(r.error)));
|
|
1260
|
-
return ts.parseJsonConfigFileContent(r.config, ts.sys, e, void 0, t).options;
|
|
1294
|
+
return rindo_js.ts.parseJsonConfigFileContent(r.config, rindo_js.ts.sys, e, void 0, t).options;
|
|
1261
1295
|
}(e)), this._tsCompilerOptions;
|
|
1262
1296
|
},
|
|
1263
1297
|
getCacheKey(e, t, r, s) {
|
|
@@ -1265,7 +1299,7 @@ process.exit, (e, t) => {
|
|
|
1265
1299
|
const e = this.getCompilerOptions(s.rootDir);
|
|
1266
1300
|
this._tsCompilerOptionsKey = JSON.stringify(e);
|
|
1267
1301
|
}
|
|
1268
|
-
return [ process.version, this._tsCompilerOptionsKey, e, t, r, !!s.instrument,
|
|
1302
|
+
return [ process.version, this._tsCompilerOptionsKey, e, t, r, !!s.instrument, 6 ].join(":");
|
|
1269
1303
|
}
|
|
1270
1304
|
}, deepEqual = function e(t, r) {
|
|
1271
1305
|
var s, n, o, i, a, l, c, u, d, h;
|
|
@@ -1304,12 +1338,12 @@ process.exit, (e, t) => {
|
|
|
1304
1338
|
if (!e) throw new Error("expect toEqualAttributes value is null");
|
|
1305
1339
|
if ("function" == typeof e.then) throw new Error("element must be a resolved value, not a promise, before it can be tested");
|
|
1306
1340
|
if (1 !== e.nodeType) throw new Error("expect toEqualAttributes value is not an element");
|
|
1307
|
-
const r = Object.keys(t), s = r.every(r => {
|
|
1341
|
+
const r = Object.keys(t), s = r.every((r => {
|
|
1308
1342
|
let s = t[r];
|
|
1309
1343
|
return null != s && (s = String(s)), e.getAttribute(r) === s;
|
|
1310
|
-
});
|
|
1344
|
+
}));
|
|
1311
1345
|
return {
|
|
1312
|
-
message: () => `expected attributes to ${s ? "not " : ""}equal ${r.map(e => `[${e}="${t[e]}"]`).join(", ")}`,
|
|
1346
|
+
message: () => `expected attributes to ${s ? "not " : ""}equal ${r.map((e => `[${e}="${t[e]}"]`)).join(", ")}`,
|
|
1313
1347
|
pass: s
|
|
1314
1348
|
};
|
|
1315
1349
|
},
|
|
@@ -1556,7 +1590,9 @@ class MockRequest {
|
|
|
1556
1590
|
this._method = e;
|
|
1557
1591
|
}
|
|
1558
1592
|
clone() {
|
|
1559
|
-
const e =
|
|
1593
|
+
const e = {
|
|
1594
|
+
...this
|
|
1595
|
+
};
|
|
1560
1596
|
return e.headers = new MockHeaders(this.headers), new MockRequest(e);
|
|
1561
1597
|
}
|
|
1562
1598
|
}
|
|
@@ -1573,7 +1609,9 @@ class MockResponse {
|
|
|
1573
1609
|
return this._body;
|
|
1574
1610
|
}
|
|
1575
1611
|
clone() {
|
|
1576
|
-
const e =
|
|
1612
|
+
const e = {
|
|
1613
|
+
...this
|
|
1614
|
+
};
|
|
1577
1615
|
return e.headers = new MockHeaders(this.headers), new MockResponse(this._body, e);
|
|
1578
1616
|
}
|
|
1579
1617
|
}
|
|
@@ -1624,12 +1662,12 @@ class MockResponse404 extends MockResponse {
|
|
|
1624
1662
|
}
|
|
1625
1663
|
|
|
1626
1664
|
const FETCH_DEFAULT_PATH = "/mock-fetch-data", HtmlSerializer = {
|
|
1627
|
-
print: e =>
|
|
1665
|
+
print: e => index_cjs.serializeNodeToHtml(e, {
|
|
1628
1666
|
serializeShadowRoot: !0,
|
|
1629
1667
|
prettyHtml: !0,
|
|
1630
1668
|
outerHtml: !0
|
|
1631
1669
|
}),
|
|
1632
|
-
test: e => null != e && (e instanceof HTMLElement || e instanceof
|
|
1670
|
+
test: e => null != e && (e instanceof HTMLElement || e instanceof index_cjs.MockNode)
|
|
1633
1671
|
};
|
|
1634
1672
|
|
|
1635
1673
|
class BuildContext {
|
|
@@ -1655,7 +1693,7 @@ class BuildContext {
|
|
|
1655
1693
|
progress: 0
|
|
1656
1694
|
};
|
|
1657
1695
|
this.compilerCtx.events.emit("buildLog", t), this.timeSpan = this.createTimeSpan(e),
|
|
1658
|
-
this.timestamp = getBuildTimestamp(), this.debug(
|
|
1696
|
+
this.timestamp = getBuildTimestamp(), this.debug(`start build, ${this.timestamp}`);
|
|
1659
1697
|
const r = {
|
|
1660
1698
|
buildId: this.buildId,
|
|
1661
1699
|
timestamp: this.timestamp
|
|
@@ -1702,7 +1740,7 @@ class BuildContext {
|
|
|
1702
1740
|
return hasError(this.diagnostics);
|
|
1703
1741
|
}
|
|
1704
1742
|
get hasWarning() {
|
|
1705
|
-
return null != (e = this.diagnostics) && 0 !== e.length && e.some(e => "warn" === e.level);
|
|
1743
|
+
return null != (e = this.diagnostics) && 0 !== e.length && e.some((e => "warn" === e.level));
|
|
1706
1744
|
var e;
|
|
1707
1745
|
}
|
|
1708
1746
|
progress(e) {
|
|
@@ -1723,9 +1761,9 @@ const getBuildTimestamp = () => {
|
|
|
1723
1761
|
}, getProgress = e => {
|
|
1724
1762
|
let t = 0;
|
|
1725
1763
|
const r = Object.keys(ProgressTask);
|
|
1726
|
-
return r.forEach((r, s) => {
|
|
1764
|
+
return r.forEach(((r, s) => {
|
|
1727
1765
|
e.includes(ProgressTask[r]) && (t = s);
|
|
1728
|
-
}), (t + 1) / r.length;
|
|
1766
|
+
})), (t + 1) / r.length;
|
|
1729
1767
|
}, ProgressTask = {
|
|
1730
1768
|
emptyOutputTargets: {},
|
|
1731
1769
|
transpileApp: {},
|
|
@@ -1744,12 +1782,12 @@ class Cache {
|
|
|
1744
1782
|
if (!this.config._isTesting && this.config.cacheDir) {
|
|
1745
1783
|
if (!this.config.enableCache || !this.cacheFs) return this.config.logger.info("cache optimizations disabled"),
|
|
1746
1784
|
void this.clearDiskCache();
|
|
1747
|
-
this.config.logger.debug(
|
|
1785
|
+
this.config.logger.debug(`cache enabled, cacheDir: ${this.config.cacheDir}`);
|
|
1748
1786
|
try {
|
|
1749
|
-
const e = path$
|
|
1787
|
+
const e = path$2.join(this.config.cacheDir, "_README.log");
|
|
1750
1788
|
await this.cacheFs.writeFile(e, CACHE_DIR_README);
|
|
1751
1789
|
} catch (e) {
|
|
1752
|
-
this.logger.error(
|
|
1790
|
+
this.logger.error(`Cache, initCacheDir: ${e}`), this.config.enableCache = !1;
|
|
1753
1791
|
}
|
|
1754
1792
|
}
|
|
1755
1793
|
}
|
|
@@ -1793,12 +1831,12 @@ class Cache {
|
|
|
1793
1831
|
const e = Date.now(), t = await this.sys.cacheStorage.get(EXP_STORAGE_KEY);
|
|
1794
1832
|
if (null != t) {
|
|
1795
1833
|
if (e - t < ONE_DAY) return;
|
|
1796
|
-
const r = this.cacheFs.sys, s = await r.
|
|
1834
|
+
const r = this.cacheFs.sys, s = await r.readDir(this.config.cacheDir), n = s.map((e => path$2.join(this.config.cacheDir, e)));
|
|
1797
1835
|
let o = 0;
|
|
1798
|
-
const i = n.map(async t => {
|
|
1799
|
-
const s = (await r.stat(t)).
|
|
1800
|
-
e - s > ONE_WEEK && (await r.
|
|
1801
|
-
});
|
|
1836
|
+
const i = n.map((async t => {
|
|
1837
|
+
const s = (await r.stat(t)).mtimeMs;
|
|
1838
|
+
e - s > ONE_WEEK && (await r.removeFile(t), o++);
|
|
1839
|
+
}));
|
|
1802
1840
|
await Promise.all(i), this.logger.debug(`clearExpiredCache, cachedFileNames: ${s.length}, totalCleared: ${o}`);
|
|
1803
1841
|
}
|
|
1804
1842
|
this.logger.debug("clearExpiredCache, set last clear"), await this.sys.cacheStorage.set(EXP_STORAGE_KEY, e);
|
|
@@ -1808,7 +1846,7 @@ class Cache {
|
|
|
1808
1846
|
await this.cacheFs.commit());
|
|
1809
1847
|
}
|
|
1810
1848
|
getCacheFilePath(e) {
|
|
1811
|
-
return path$
|
|
1849
|
+
return path$2.join(this.config.cacheDir, e) + ".log";
|
|
1812
1850
|
}
|
|
1813
1851
|
getMemoryStats() {
|
|
1814
1852
|
return null != this.cacheFs ? this.cacheFs.getMemoryStats() : null;
|
|
@@ -1823,11 +1861,11 @@ const MAX_FAILED = 100, ONE_DAY = 864e5, ONE_WEEK = 7 * ONE_DAY, EXP_STORAGE_KEY
|
|
|
1823
1861
|
dirsToDelete: [],
|
|
1824
1862
|
dirsToEnsure: []
|
|
1825
1863
|
};
|
|
1826
|
-
e.forEach((e, r) => {
|
|
1864
|
+
e.forEach(((e, r) => {
|
|
1827
1865
|
if (!0 === e.queueWriteToDisk) {
|
|
1828
1866
|
if (!0 === e.isFile) {
|
|
1829
1867
|
t.filesToWrite.push(r);
|
|
1830
|
-
const e = normalizePath(path$
|
|
1868
|
+
const e = normalizePath(path$2.dirname(r));
|
|
1831
1869
|
t.dirsToEnsure.includes(e) || t.dirsToEnsure.push(e);
|
|
1832
1870
|
const s = t.dirsToDelete.indexOf(e);
|
|
1833
1871
|
s > -1 && t.dirsToDelete.splice(s, 1);
|
|
@@ -1841,7 +1879,7 @@ const MAX_FAILED = 100, ONE_DAY = 864e5, ONE_WEEK = 7 * ONE_DAY, EXP_STORAGE_KEY
|
|
|
1841
1879
|
} 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) {
|
|
1842
1880
|
const s = r, n = e.queueCopyFileToDest;
|
|
1843
1881
|
t.filesToCopy.push([ s, n ]);
|
|
1844
|
-
const o = normalizePath(path$
|
|
1882
|
+
const o = normalizePath(path$2.dirname(n));
|
|
1845
1883
|
t.dirsToEnsure.includes(o) || t.dirsToEnsure.push(o);
|
|
1846
1884
|
const i = t.dirsToDelete.indexOf(o);
|
|
1847
1885
|
i > -1 && t.dirsToDelete.splice(i, 1);
|
|
@@ -1849,7 +1887,7 @@ const MAX_FAILED = 100, ONE_DAY = 864e5, ONE_WEEK = 7 * ONE_DAY, EXP_STORAGE_KEY
|
|
|
1849
1887
|
a > -1 && t.filesToDelete.splice(a, 1);
|
|
1850
1888
|
}
|
|
1851
1889
|
e.queueDeleteFromDisk = !1, e.queueWriteToDisk = !1;
|
|
1852
|
-
});
|
|
1890
|
+
}));
|
|
1853
1891
|
for (let e = 0, r = t.dirsToEnsure.length; e < r; e++) {
|
|
1854
1892
|
const r = t.dirsToEnsure[e].split("/");
|
|
1855
1893
|
for (let e = 2; e < r.length; e++) {
|
|
@@ -1857,23 +1895,23 @@ const MAX_FAILED = 100, ONE_DAY = 864e5, ONE_WEEK = 7 * ONE_DAY, EXP_STORAGE_KEY
|
|
|
1857
1895
|
!1 === t.dirsToEnsure.includes(s) && t.dirsToEnsure.push(s);
|
|
1858
1896
|
}
|
|
1859
1897
|
}
|
|
1860
|
-
t.dirsToEnsure.sort((e, t) => {
|
|
1898
|
+
t.dirsToEnsure.sort(((e, t) => {
|
|
1861
1899
|
const r = e.split("/").length, s = t.split("/").length;
|
|
1862
1900
|
return r < s ? -1 : r > s ? 1 : e.length < t.length ? -1 : e.length > t.length ? 1 : 0;
|
|
1863
|
-
}), t.dirsToDelete.sort((e, t) => {
|
|
1901
|
+
})), t.dirsToDelete.sort(((e, t) => {
|
|
1864
1902
|
const r = e.split("/").length, s = t.split("/").length;
|
|
1865
1903
|
return r < s ? 1 : r > s ? -1 : e.length < t.length ? 1 : e.length > t.length ? -1 : 0;
|
|
1866
|
-
});
|
|
1904
|
+
}));
|
|
1867
1905
|
for (const e of t.dirsToEnsure) {
|
|
1868
1906
|
const r = t.dirsToDelete.indexOf(e);
|
|
1869
1907
|
r > -1 && t.dirsToDelete.splice(r, 1);
|
|
1870
1908
|
}
|
|
1871
|
-
return t.dirsToDelete = t.dirsToDelete.filter(e => "/" !== e && !0 !== e.endsWith(":/")),
|
|
1872
|
-
t.dirsToEnsure = t.dirsToEnsure.filter(t => {
|
|
1909
|
+
return t.dirsToDelete = t.dirsToDelete.filter((e => "/" !== e && !0 !== e.endsWith(":/"))),
|
|
1910
|
+
t.dirsToEnsure = t.dirsToEnsure.filter((t => {
|
|
1873
1911
|
const r = e.get(t);
|
|
1874
1912
|
return (null == r || !0 !== r.exists || !0 !== r.isDirectory) && "/" !== t && !t.endsWith(":/");
|
|
1875
|
-
}), t;
|
|
1876
|
-
}, shouldIgnore = e => (e = e.trim().toLowerCase(), IGNORE.some(t => e.endsWith(t))), IGNORE = [ ".ds_store", ".gitignore", "desktop.ini", "thumbs.db" ];
|
|
1913
|
+
})), t;
|
|
1914
|
+
}, shouldIgnore = e => (e = e.trim().toLowerCase(), IGNORE.some((t => e.endsWith(t)))), IGNORE = [ ".ds_store", ".gitignore", "desktop.ini", "thumbs.db" ];
|
|
1877
1915
|
|
|
1878
1916
|
(posix = {
|
|
1879
1917
|
resolve: function e() {
|
|
@@ -1995,7 +2033,15 @@ const MAX_FAILED = 100, ONE_DAY = 864e5, ONE_WEEK = 7 * ONE_DAY, EXP_STORAGE_KEY
|
|
|
1995
2033
|
posix: null
|
|
1996
2034
|
}).posix = posix, pathBrowserify = posix;
|
|
1997
2035
|
|
|
1998
|
-
const
|
|
2036
|
+
const IS_DENO_ENV = "undefined" != typeof Deno, IS_NODE_ENV = !(IS_DENO_ENV || "undefined" == typeof global || "function" != typeof require || !global.process || "string" != typeof __filename || global.origin && "string" == typeof global.origin);
|
|
2037
|
+
|
|
2038
|
+
IS_NODE_ENV ? process.platform : IS_DENO_ENV && Deno.build.os;
|
|
2039
|
+
|
|
2040
|
+
const IS_BROWSER_ENV = "undefined" != typeof location && "undefined" != typeof navigator && "undefined" != typeof XMLHttpRequest, IS_WEB_WORKER_ENV = IS_BROWSER_ENV && "undefined" != typeof self && "function" == typeof self.importScripts, HAS_WEB_WORKER = IS_BROWSER_ENV && "function" == typeof Worker, IS_FETCH_ENV = "function" == typeof fetch;
|
|
2041
|
+
|
|
2042
|
+
IS_NODE_ENV && require, IS_NODE_ENV ? process.cwd : IS_DENO_ENV && Deno.cwd;
|
|
2043
|
+
|
|
2044
|
+
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) => {
|
|
1999
2045
|
const r = normalizePath(e).split("/"), s = (e => {
|
|
2000
2046
|
e.startsWith("~") && (e = e.substring(1));
|
|
2001
2047
|
const t = e.split("/"), r = {
|
|
@@ -2013,7 +2059,7 @@ const YELLOW = "#f39c12", RED = "#c0392b", BLUE = "#3498db", COMMON_DIR_MODULE_E
|
|
|
2013
2059
|
} else if (r[e] === s.moduleId) return r.slice(0, e + 1).join("/");
|
|
2014
2060
|
return null;
|
|
2015
2061
|
}, packageVersions = new Map, known404Urls = new Set, getCommonDirUrl = (e, t, r, s) => getNodeModuleFetchUrl(e, t, r) + "/" + s, getNodeModuleFetchUrl = (e, t, r) => {
|
|
2016
|
-
let s = (r = normalizePath(r)).split("/").filter(e => e.length);
|
|
2062
|
+
let s = (r = normalizePath(r)).split("/").filter((e => e.length));
|
|
2017
2063
|
const n = s.lastIndexOf("node_modules");
|
|
2018
2064
|
n > -1 && n < s.length - 1 && (s = s.slice(n + 1));
|
|
2019
2065
|
let o = s.shift();
|
|
@@ -2038,8 +2084,8 @@ const YELLOW = "#f39c12", RED = "#c0392b", BLUE = "#3498db", COMMON_DIR_MODULE_E
|
|
|
2038
2084
|
var t;
|
|
2039
2085
|
const r = e.split("/"), s = r[r.length - 2], n = r[r.length - 1];
|
|
2040
2086
|
return !("node_modules" !== s || !isCommonDirModuleFile(n));
|
|
2041
|
-
})(n) || known404Urls.has(s) || (e => knownUrlSkips.some(t => e.endsWith(t)))(s))) try {
|
|
2042
|
-
const o = await ((e, t, r) => (console.trace(t), e && isFunction(e.fetch) ? e.fetch(t,
|
|
2087
|
+
})(n) || known404Urls.has(s) || (e => knownUrlSkips.some((t => e.endsWith(t))))(s))) try {
|
|
2088
|
+
const o = await ((e, t, r) => (console.trace(t), e && isFunction(e.fetch) ? e.fetch(t, r) : fetch(t, r)))(e, s);
|
|
2043
2089
|
if (o) {
|
|
2044
2090
|
if (o.ok) {
|
|
2045
2091
|
const i = await o.clone().text();
|
|
@@ -2052,9 +2098,9 @@ const YELLOW = "#f39c12", RED = "#c0392b", BLUE = "#3498db", COMMON_DIR_MODULE_E
|
|
|
2052
2098
|
})(e, r.name, r.version);
|
|
2053
2099
|
} catch (e) {}
|
|
2054
2100
|
})(o, n);
|
|
2055
|
-
let i = path$
|
|
2056
|
-
for (;"/" !== i && "" !== i; ) t ? (t.clearFileCache(i), await t.sys.
|
|
2057
|
-
i = path$
|
|
2101
|
+
let i = path$2.dirname(s);
|
|
2102
|
+
for (;"/" !== i && "" !== i; ) t ? (t.clearFileCache(i), await t.sys.createDir(i)) : await e.createDir(i),
|
|
2103
|
+
i = path$2.dirname(i);
|
|
2058
2104
|
t ? (t.clearFileCache(s), await t.sys.writeFile(s, n)) : await e.writeFile(s, n);
|
|
2059
2105
|
})(e, t, s, n, i, r), i;
|
|
2060
2106
|
}
|
|
@@ -2070,7 +2116,7 @@ caller = function() {
|
|
|
2070
2116
|
return Error.prepareStackTrace = function(e, t) {
|
|
2071
2117
|
return t;
|
|
2072
2118
|
}, e = (new Error).stack, Error.prepareStackTrace = t, e[2].getFileName();
|
|
2073
|
-
},
|
|
2119
|
+
}, pathParse = function createCommonjsModule(e, t, r) {
|
|
2074
2120
|
return e(r = {
|
|
2075
2121
|
path: t,
|
|
2076
2122
|
exports: {},
|
|
@@ -2112,13 +2158,13 @@ caller = function() {
|
|
|
2112
2158
|
name: r[2].slice(0, r[2].length - r[3].length)
|
|
2113
2159
|
};
|
|
2114
2160
|
}, e.exports = s ? i.parse : r.parse, e.exports.posix = r.parse, e.exports.win32 = i.parse;
|
|
2115
|
-
}))
|
|
2161
|
+
})), parse = path__default.default.parse || pathParse, getNodeModulesDirs = function e(t, r) {
|
|
2116
2162
|
var s, n, o = "/";
|
|
2117
2163
|
for (/^([A-Za-z]:)/.test(t) ? o = "" : /^\\\\/.test(t) && (o = "\\\\"), s = [ t ],
|
|
2118
2164
|
n = parse(t); n.dir !== s[s.length - 1]; ) s.push(n.dir), n = parse(n.dir);
|
|
2119
2165
|
return s.reduce((function(e, t) {
|
|
2120
2166
|
return e.concat(r.map((function(e) {
|
|
2121
|
-
return
|
|
2167
|
+
return path__default.default.resolve(o, t, e);
|
|
2122
2168
|
})));
|
|
2123
2169
|
}), []);
|
|
2124
2170
|
}, nodeModulesPaths = function e(t, r, s) {
|
|
@@ -2128,10 +2174,25 @@ caller = function() {
|
|
|
2128
2174
|
}), r) : (n = getNodeModulesDirs(t, o), r && r.paths ? n.concat(r.paths) : n);
|
|
2129
2175
|
}, normalizeOptions = function(e, t) {
|
|
2130
2176
|
return t || {};
|
|
2131
|
-
}
|
|
2132
|
-
|
|
2133
|
-
|
|
2177
|
+
}, ERROR_MESSAGE = "Function.prototype.bind called on incompatible ", slice = Array.prototype.slice,
|
|
2178
|
+
toStr = Object.prototype.toString, implementation = function e(t) {
|
|
2179
|
+
var r, s, n, o, i, a, l, c = this;
|
|
2180
|
+
if ("function" != typeof c || "[object Function]" !== toStr.call(c)) throw new TypeError(ERROR_MESSAGE + c);
|
|
2181
|
+
for (r = slice.call(arguments, 1), n = function() {
|
|
2182
|
+
if (this instanceof s) {
|
|
2183
|
+
var e = c.apply(this, r.concat(slice.call(arguments)));
|
|
2184
|
+
return Object(e) === e ? e : this;
|
|
2185
|
+
}
|
|
2186
|
+
return c.apply(t, r.concat(slice.call(arguments)));
|
|
2187
|
+
}, o = Math.max(0, c.length - r.length), i = [], a = 0; a < o; a++) i.push("$" + a);
|
|
2188
|
+
return s = Function("binder", "return function (" + i.join(",") + "){ return binder.apply(this,arguments); }")(n),
|
|
2189
|
+
c.prototype && ((l = function e() {}).prototype = c.prototype, s.prototype = new l,
|
|
2190
|
+
l.prototype = null), s;
|
|
2191
|
+
}, functionBind = Function.prototype.bind || implementation, src = functionBind.call(Function.call, Object.prototype.hasOwnProperty);
|
|
2192
|
+
|
|
2193
|
+
const data$1 = {
|
|
2134
2194
|
assert: !0,
|
|
2195
|
+
"assert/strict": ">= 15",
|
|
2135
2196
|
async_hooks: ">= 8",
|
|
2136
2197
|
buffer_ieee754: "< 0.9.7",
|
|
2137
2198
|
buffer: !0,
|
|
@@ -2143,8 +2204,10 @@ const wasi = ">= 13.4 && < 13.5", core = {
|
|
|
2143
2204
|
_debug_agent: ">= 1 && < 8",
|
|
2144
2205
|
_debugger: "< 8",
|
|
2145
2206
|
dgram: !0,
|
|
2207
|
+
diagnostics_channel: ">= 15.1",
|
|
2146
2208
|
dns: !0,
|
|
2147
|
-
|
|
2209
|
+
"dns/promises": ">= 15",
|
|
2210
|
+
domain: ">= 0.7.12",
|
|
2148
2211
|
events: !0,
|
|
2149
2212
|
freelist: "< 6",
|
|
2150
2213
|
fs: !0,
|
|
@@ -2167,6 +2230,8 @@ const wasi = ">= 13.4 && < 13.5", core = {
|
|
|
2167
2230
|
"node-inspect/lib/internal/inspect_repl": ">= 7.6.0 && < 12",
|
|
2168
2231
|
os: !0,
|
|
2169
2232
|
path: !0,
|
|
2233
|
+
"path/posix": ">= 15.3",
|
|
2234
|
+
"path/win32": ">= 15.3",
|
|
2170
2235
|
perf_hooks: ">= 8.5",
|
|
2171
2236
|
process: ">= 1",
|
|
2172
2237
|
punycode: !0,
|
|
@@ -2181,9 +2246,11 @@ const wasi = ">= 13.4 && < 13.5", core = {
|
|
|
2181
2246
|
_stream_readable: ">= 0.9.4",
|
|
2182
2247
|
_stream_writable: ">= 0.9.4",
|
|
2183
2248
|
stream: !0,
|
|
2249
|
+
"stream/promises": ">= 15",
|
|
2184
2250
|
string_decoder: !0,
|
|
2185
|
-
sys:
|
|
2251
|
+
sys: [ ">= 0.6 && < 0.7", ">= 0.8" ],
|
|
2186
2252
|
timers: !0,
|
|
2253
|
+
"timers/promises": ">= 15",
|
|
2187
2254
|
_tls_common: ">= 0.11.13",
|
|
2188
2255
|
_tls_legacy: ">= 0.11.3 && < 10",
|
|
2189
2256
|
_tls_wrap: ">= 0.11.3",
|
|
@@ -2192,6 +2259,7 @@ const wasi = ">= 13.4 && < 13.5", core = {
|
|
|
2192
2259
|
tty: !0,
|
|
2193
2260
|
url: !0,
|
|
2194
2261
|
util: !0,
|
|
2262
|
+
"util/types": ">= 15.3",
|
|
2195
2263
|
"v8/tools/arguments": ">= 10 && < 12",
|
|
2196
2264
|
"v8/tools/codemap": [ ">= 4.4.0 && < 5", ">= 5.2.0 && < 12" ],
|
|
2197
2265
|
"v8/tools/consarray": [ ">= 4.4.0 && < 5", ">= 5.2.0 && < 12" ],
|
|
@@ -2201,14 +2269,161 @@ const wasi = ">= 13.4 && < 13.5", core = {
|
|
|
2201
2269
|
"v8/tools/splaytree": [ ">= 4.4.0 && < 5", ">= 5.2.0 && < 12" ],
|
|
2202
2270
|
v8: ">= 1",
|
|
2203
2271
|
vm: !0,
|
|
2204
|
-
wasi,
|
|
2272
|
+
wasi: ">= 13.4 && < 13.5",
|
|
2205
2273
|
worker_threads: ">= 11.7",
|
|
2206
2274
|
zlib: !0
|
|
2207
|
-
}
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2275
|
+
};
|
|
2276
|
+
|
|
2277
|
+
isCoreModule = function e(t, r) {
|
|
2278
|
+
return src(data$1, t) && function s(e, t) {
|
|
2279
|
+
var r, s;
|
|
2280
|
+
if ("boolean" == typeof t) return t;
|
|
2281
|
+
if ("string" != typeof (r = void 0 === e ? process.versions && process.versions.node && process.versions.node : e)) throw new TypeError(void 0 === e ? "Unable to determine current node version" : "If provided, a valid node version is required");
|
|
2282
|
+
if (t && "object" == typeof t) {
|
|
2283
|
+
for (s = 0; s < t.length; ++s) if (matchesRange$1(r, t[s])) return !0;
|
|
2284
|
+
return !1;
|
|
2285
|
+
}
|
|
2286
|
+
return matchesRange$1(r, t);
|
|
2287
|
+
}(r, data$1[t]);
|
|
2288
|
+
}, realpathFS$1 = fs__default.default.realpath && "function" == typeof fs__default.default.realpath.native ? fs__default.default.realpath.native : fs__default.default.realpath,
|
|
2289
|
+
defaultIsFile$1 = function e(t, r) {
|
|
2290
|
+
fs__default.default.stat(t, (function(e, t) {
|
|
2291
|
+
return e ? "ENOENT" === e.code || "ENOTDIR" === e.code ? r(null, !1) : r(e) : r(null, t.isFile() || t.isFIFO());
|
|
2292
|
+
}));
|
|
2293
|
+
}, defaultIsDir$1 = function e(t, r) {
|
|
2294
|
+
fs__default.default.stat(t, (function(e, t) {
|
|
2295
|
+
return e ? "ENOENT" === e.code || "ENOTDIR" === e.code ? r(null, !1) : r(e) : r(null, t.isDirectory());
|
|
2296
|
+
}));
|
|
2297
|
+
}, defaultRealpath = function e(t, r) {
|
|
2298
|
+
realpathFS$1(t, (function(e, s) {
|
|
2299
|
+
e && "ENOENT" !== e.code ? r(e) : r(null, e ? t : s);
|
|
2300
|
+
}));
|
|
2301
|
+
}, maybeRealpath = function e(t, r, s, n) {
|
|
2302
|
+
s && !1 === s.preserveSymlinks ? t(r, n) : n(null, r);
|
|
2303
|
+
}, defaultReadPackage = function e(t, r, s) {
|
|
2304
|
+
t(r, (function(e, t) {
|
|
2305
|
+
if (e) s(e); else try {
|
|
2306
|
+
var r = JSON.parse(t);
|
|
2307
|
+
s(null, r);
|
|
2308
|
+
} catch (e) {
|
|
2309
|
+
s(null);
|
|
2310
|
+
}
|
|
2311
|
+
}));
|
|
2312
|
+
}, getPackageCandidates$1 = function e(t, r, s) {
|
|
2313
|
+
var n, o = nodeModulesPaths(r, s, t);
|
|
2314
|
+
for (n = 0; n < o.length; n++) o[n] = path__default.default.join(o[n], t);
|
|
2315
|
+
return o;
|
|
2316
|
+
}, async = function e(t, r, s) {
|
|
2317
|
+
function n(e) {
|
|
2318
|
+
if (/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(t)) D = path__default.default.resolve(e, t),
|
|
2319
|
+
"." !== t && ".." !== t && "/" !== t.slice(-1) || (D += "/"), /\/$/.test(t) && D === e ? l(D, S.package, o) : i(D, S.package, o); else {
|
|
2320
|
+
if (_ && isCoreModule(t)) return T(null, t);
|
|
2321
|
+
!function r(e, t, s) {
|
|
2322
|
+
var n = function() {
|
|
2323
|
+
return getPackageCandidates$1(e, t, S);
|
|
2324
|
+
};
|
|
2325
|
+
c(s, y ? y(e, t, n, S) : n());
|
|
2326
|
+
}(t, e, (function(e, r, s) {
|
|
2327
|
+
if (e) T(e); else {
|
|
2328
|
+
if (r) return maybeRealpath(f, r, S, (function(e, t) {
|
|
2329
|
+
e ? T(e) : T(null, t, s);
|
|
2330
|
+
}));
|
|
2331
|
+
var n = new Error("Cannot find module '" + t + "' from '" + b + "'");
|
|
2332
|
+
n.code = "MODULE_NOT_FOUND", T(n);
|
|
2333
|
+
}
|
|
2334
|
+
}));
|
|
2335
|
+
}
|
|
2336
|
+
}
|
|
2337
|
+
function o(e, r, s) {
|
|
2338
|
+
e ? T(e) : r ? T(null, r, s) : l(D, (function(e, r, s) {
|
|
2339
|
+
if (e) T(e); else if (r) maybeRealpath(f, r, S, (function(e, t) {
|
|
2340
|
+
e ? T(e) : T(null, t, s);
|
|
2341
|
+
})); else {
|
|
2342
|
+
var n = new Error("Cannot find module '" + t + "' from '" + b + "'");
|
|
2343
|
+
n.code = "MODULE_NOT_FOUND", T(n);
|
|
2344
|
+
}
|
|
2345
|
+
}));
|
|
2346
|
+
}
|
|
2347
|
+
function i(e, t, r) {
|
|
2348
|
+
var s = t, n = r;
|
|
2349
|
+
"function" == typeof s && (n = s, s = void 0), function e(t, r, s) {
|
|
2350
|
+
function o(s, o, a) {
|
|
2351
|
+
var u, h, p;
|
|
2352
|
+
return c = o, s ? n(s) : a && c && S.pathFilter && (h = (u = path__default.default.relative(a, l)).slice(0, u.length - t[0].length),
|
|
2353
|
+
p = S.pathFilter(c, r, h)) ? e([ "" ].concat(w.slice()), path__default.default.resolve(a, p), c) : void d(l, i);
|
|
2354
|
+
}
|
|
2355
|
+
function i(s, o) {
|
|
2356
|
+
return s ? n(s) : o ? n(null, l, c) : void e(t.slice(1), r, c);
|
|
2357
|
+
}
|
|
2358
|
+
var l, c;
|
|
2359
|
+
if (0 === t.length) return n(null, void 0, s);
|
|
2360
|
+
l = r + t[0], (c = s) ? o(null, c) : a(path__default.default.dirname(l), o);
|
|
2361
|
+
}([ "" ].concat(w), e, s);
|
|
2362
|
+
}
|
|
2363
|
+
function a(e, t) {
|
|
2364
|
+
return "" === e || "/" === e || "win32" === process.platform && /^\w:[/\\]*$/.test(e) || /[/\\]node_modules[/\\]*$/.test(e) ? t(null) : void maybeRealpath(f, e, S, (function(r, s) {
|
|
2365
|
+
if (r) return a(path__default.default.dirname(e), t);
|
|
2366
|
+
var n = path__default.default.join(s, "package.json");
|
|
2367
|
+
d(n, (function(r, s) {
|
|
2368
|
+
if (!s) return a(path__default.default.dirname(e), t);
|
|
2369
|
+
m(p, n, (function(r, s) {
|
|
2370
|
+
r && t(r);
|
|
2371
|
+
var o = s;
|
|
2372
|
+
o && S.packageFilter && (o = S.packageFilter(o, n)), t(null, o, e);
|
|
2373
|
+
}));
|
|
2374
|
+
}));
|
|
2375
|
+
}));
|
|
2376
|
+
}
|
|
2377
|
+
function l(e, t, r) {
|
|
2378
|
+
var s = r, n = t;
|
|
2379
|
+
"function" == typeof n && (s = n, n = S.package), maybeRealpath(f, e, S, (function(t, r) {
|
|
2380
|
+
if (t) return s(t);
|
|
2381
|
+
var o = path__default.default.join(r, "package.json");
|
|
2382
|
+
d(o, (function(t, r) {
|
|
2383
|
+
return t ? s(t) : r ? void m(p, o, (function(t, r) {
|
|
2384
|
+
var n, a;
|
|
2385
|
+
return t ? s(t) : ((n = r) && S.packageFilter && (n = S.packageFilter(n, o)), n && n.main ? "string" != typeof n.main ? ((a = new TypeError("package “" + n.name + "” `main` must be a string")).code = "INVALID_PACKAGE_MAIN",
|
|
2386
|
+
s(a)) : ("." !== n.main && "./" !== n.main || (n.main = "index"), void i(path__default.default.resolve(e, n.main), n, (function(t, r, n) {
|
|
2387
|
+
return t ? s(t) : r ? s(null, r, n) : n ? void l(path__default.default.resolve(e, n.main), n, (function(t, r, n) {
|
|
2388
|
+
return t ? s(t) : r ? s(null, r, n) : void i(path__default.default.join(e, "index"), n, s);
|
|
2389
|
+
})) : i(path__default.default.join(e, "index"), n, s);
|
|
2390
|
+
}))) : void i(path__default.default.join(e, "/index"), n, s));
|
|
2391
|
+
})) : i(path__default.default.join(e, "index"), n, s);
|
|
2392
|
+
}));
|
|
2393
|
+
}));
|
|
2394
|
+
}
|
|
2395
|
+
function c(e, t) {
|
|
2396
|
+
function r(t, r, o) {
|
|
2397
|
+
return t ? e(t) : r ? e(null, r, o) : void l(n, S.package, s);
|
|
2398
|
+
}
|
|
2399
|
+
function s(r, s, n) {
|
|
2400
|
+
return r ? e(r) : s ? e(null, s, n) : void c(e, t.slice(1));
|
|
2401
|
+
}
|
|
2402
|
+
if (0 === t.length) return e(null, void 0);
|
|
2403
|
+
var n = t[0];
|
|
2404
|
+
h(path__default.default.dirname(n), (function o(s, a) {
|
|
2405
|
+
return s ? e(s) : a ? void i(n, S.package, r) : c(e, t.slice(1));
|
|
2406
|
+
}));
|
|
2407
|
+
}
|
|
2408
|
+
var u, d, h, p, f, m, g, y, w, _, v, b, E, D, T = s, S = r;
|
|
2409
|
+
return "function" == typeof r && (T = S, S = {}), "string" != typeof t ? (u = new TypeError("Path must be a string."),
|
|
2410
|
+
process.nextTick((function() {
|
|
2411
|
+
T(u);
|
|
2412
|
+
}))) : (S = normalizeOptions(0, S), d = S.isFile || defaultIsFile$1, h = S.isDirectory || defaultIsDir$1,
|
|
2413
|
+
p = S.readFile || fs__default.default.readFile, f = S.realpath || defaultRealpath,
|
|
2414
|
+
m = S.readPackage || defaultReadPackage, S.readFile && S.readPackage ? (g = new TypeError("`readFile` and `readPackage` are mutually exclusive."),
|
|
2415
|
+
process.nextTick((function() {
|
|
2416
|
+
T(g);
|
|
2417
|
+
}))) : (y = S.packageIterator, w = S.extensions || [ ".js" ], _ = !1 !== S.includeCoreModules,
|
|
2418
|
+
v = S.basedir || path__default.default.dirname(caller()), b = S.filename || v, S.paths = S.paths || [],
|
|
2419
|
+
E = path__default.default.resolve(v), void maybeRealpath(f, E, S, (function(e, t) {
|
|
2420
|
+
e ? T(e) : n(t);
|
|
2421
|
+
}))));
|
|
2422
|
+
};
|
|
2423
|
+
|
|
2424
|
+
const data = {
|
|
2211
2425
|
assert: !0,
|
|
2426
|
+
"assert/strict": ">= 15",
|
|
2212
2427
|
async_hooks: ">= 8",
|
|
2213
2428
|
buffer_ieee754: "< 0.9.7",
|
|
2214
2429
|
buffer: !0,
|
|
@@ -2220,11 +2435,14 @@ const wasi = ">= 13.4 && < 13.5", core = {
|
|
|
2220
2435
|
_debug_agent: ">= 1 && < 8",
|
|
2221
2436
|
_debugger: "< 8",
|
|
2222
2437
|
dgram: !0,
|
|
2438
|
+
diagnostics_channel: ">= 15.1",
|
|
2223
2439
|
dns: !0,
|
|
2224
|
-
|
|
2440
|
+
"dns/promises": ">= 15",
|
|
2441
|
+
domain: ">= 0.7.12",
|
|
2225
2442
|
events: !0,
|
|
2226
2443
|
freelist: "< 6",
|
|
2227
2444
|
fs: !0,
|
|
2445
|
+
"fs/promises": [ ">= 10 && < 10.1", ">= 14" ],
|
|
2228
2446
|
_http_agent: ">= 0.11.1",
|
|
2229
2447
|
_http_client: ">= 0.11.1",
|
|
2230
2448
|
_http_common: ">= 0.11.1",
|
|
@@ -2238,8 +2456,13 @@ const wasi = ">= 13.4 && < 13.5", core = {
|
|
|
2238
2456
|
_linklist: "< 8",
|
|
2239
2457
|
module: !0,
|
|
2240
2458
|
net: !0,
|
|
2459
|
+
"node-inspect/lib/_inspect": ">= 7.6.0 && < 12",
|
|
2460
|
+
"node-inspect/lib/internal/inspect_client": ">= 7.6.0 && < 12",
|
|
2461
|
+
"node-inspect/lib/internal/inspect_repl": ">= 7.6.0 && < 12",
|
|
2241
2462
|
os: !0,
|
|
2242
2463
|
path: !0,
|
|
2464
|
+
"path/posix": ">= 15.3",
|
|
2465
|
+
"path/win32": ">= 15.3",
|
|
2243
2466
|
perf_hooks: ">= 8.5",
|
|
2244
2467
|
process: ">= 1",
|
|
2245
2468
|
punycode: !0,
|
|
@@ -2254,9 +2477,11 @@ const wasi = ">= 13.4 && < 13.5", core = {
|
|
|
2254
2477
|
_stream_readable: ">= 0.9.4",
|
|
2255
2478
|
_stream_writable: ">= 0.9.4",
|
|
2256
2479
|
stream: !0,
|
|
2480
|
+
"stream/promises": ">= 15",
|
|
2257
2481
|
string_decoder: !0,
|
|
2258
|
-
sys:
|
|
2482
|
+
sys: [ ">= 0.6 && < 0.7", ">= 0.8" ],
|
|
2259
2483
|
timers: !0,
|
|
2484
|
+
"timers/promises": ">= 15",
|
|
2260
2485
|
_tls_common: ">= 0.11.13",
|
|
2261
2486
|
_tls_legacy: ">= 0.11.3 && < 10",
|
|
2262
2487
|
_tls_wrap: ">= 0.11.3",
|
|
@@ -2265,157 +2490,38 @@ const wasi = ">= 13.4 && < 13.5", core = {
|
|
|
2265
2490
|
tty: !0,
|
|
2266
2491
|
url: !0,
|
|
2267
2492
|
util: !0,
|
|
2493
|
+
"util/types": ">= 15.3",
|
|
2494
|
+
"v8/tools/arguments": ">= 10 && < 12",
|
|
2495
|
+
"v8/tools/codemap": [ ">= 4.4.0 && < 5", ">= 5.2.0 && < 12" ],
|
|
2496
|
+
"v8/tools/consarray": [ ">= 4.4.0 && < 5", ">= 5.2.0 && < 12" ],
|
|
2497
|
+
"v8/tools/csvparser": [ ">= 4.4.0 && < 5", ">= 5.2.0 && < 12" ],
|
|
2498
|
+
"v8/tools/logreader": [ ">= 4.4.0 && < 5", ">= 5.2.0 && < 12" ],
|
|
2499
|
+
"v8/tools/profile_view": [ ">= 4.4.0 && < 5", ">= 5.2.0 && < 12" ],
|
|
2500
|
+
"v8/tools/splaytree": [ ">= 4.4.0 && < 5", ">= 5.2.0 && < 12" ],
|
|
2268
2501
|
v8: ">= 1",
|
|
2269
2502
|
vm: !0,
|
|
2270
|
-
wasi,
|
|
2503
|
+
wasi: ">= 13.4 && < 13.5",
|
|
2271
2504
|
worker_threads: ">= 11.7",
|
|
2272
|
-
zlib: !0
|
|
2273
|
-
|
|
2274
|
-
}));
|
|
2505
|
+
zlib: !0
|
|
2506
|
+
};
|
|
2275
2507
|
|
|
2276
2508
|
for (mod in current = process.versions && process.versions.node && process.versions.node.split(".") || [],
|
|
2277
|
-
core
|
|
2509
|
+
core = {}, data) Object.prototype.hasOwnProperty.call(data, mod) && (core[mod] = versionIncluded(data[mod]));
|
|
2278
2510
|
|
|
2279
|
-
core_1 = core
|
|
2280
|
-
return
|
|
2281
|
-
}, realpathFS =
|
|
2282
|
-
defaultIsFile = function e(t
|
|
2283
|
-
fs$1.stat(t, (function(e, t) {
|
|
2284
|
-
return e ? "ENOENT" === e.code || "ENOTDIR" === e.code ? r(null, !1) : r(e) : r(null, t.isFile() || t.isFIFO());
|
|
2285
|
-
}));
|
|
2286
|
-
}, defaultIsDir = function e(t, r) {
|
|
2287
|
-
fs$1.stat(t, (function(e, t) {
|
|
2288
|
-
return e ? "ENOENT" === e.code || "ENOTDIR" === e.code ? r(null, !1) : r(e) : r(null, t.isDirectory());
|
|
2289
|
-
}));
|
|
2290
|
-
}, defaultRealpath = function e(t, r) {
|
|
2291
|
-
realpathFS(t, (function(e, s) {
|
|
2292
|
-
e && "ENOENT" !== e.code ? r(e) : r(null, e ? t : s);
|
|
2293
|
-
}));
|
|
2294
|
-
}, maybeRealpath = function e(t, r, s, n) {
|
|
2295
|
-
s && !1 === s.preserveSymlinks ? t(r, n) : n(null, r);
|
|
2296
|
-
}, getPackageCandidates = function e(t, r, s) {
|
|
2297
|
-
var n, o = nodeModulesPaths(r, s, t);
|
|
2298
|
-
for (n = 0; n < o.length; n++) o[n] = path$1__default.join(o[n], t);
|
|
2299
|
-
return o;
|
|
2300
|
-
}, async = function e(t, r, s) {
|
|
2301
|
-
function n(e, r, s) {
|
|
2302
|
-
e ? w(e) : r ? w(null, r, s) : i(y, (function(e, r, s) {
|
|
2303
|
-
if (e) w(e); else if (r) maybeRealpath(d, r, _, (function(e, t) {
|
|
2304
|
-
e ? w(e) : w(null, t, s);
|
|
2305
|
-
})); else {
|
|
2306
|
-
var n = new Error("Cannot find module '" + t + "' from '" + m + "'");
|
|
2307
|
-
n.code = "MODULE_NOT_FOUND", w(n);
|
|
2308
|
-
}
|
|
2309
|
-
}));
|
|
2310
|
-
}
|
|
2311
|
-
function o(e, t, r) {
|
|
2312
|
-
var s = t, n = r;
|
|
2313
|
-
"function" == typeof s && (n = s, s = void 0), function e(t, r, s) {
|
|
2314
|
-
function o(s, o, u) {
|
|
2315
|
-
var d, h, f;
|
|
2316
|
-
return c = o, s ? n(s) : u && c && _.pathFilter && (h = (d = path$1__default.relative(u, a)).slice(0, d.length - t[0].length),
|
|
2317
|
-
f = _.pathFilter(c, r, h)) ? e([ "" ].concat(p.slice()), path$1__default.resolve(u, f), c) : void l(a, i);
|
|
2318
|
-
}
|
|
2319
|
-
function i(s, o) {
|
|
2320
|
-
return s ? n(s) : o ? n(null, a, c) : void e(t.slice(1), r, c);
|
|
2321
|
-
}
|
|
2322
|
-
var a, c;
|
|
2323
|
-
if (0 === t.length) return n(null, void 0, s);
|
|
2324
|
-
a = r + t[0], (c = s) ? o(null, c) : function e(t, r) {
|
|
2325
|
-
return "" === t || "/" === t || "win32" === process.platform && /^\w:[/\\]*$/.test(t) || /[/\\]node_modules[/\\]*$/.test(t) ? r(null) : void maybeRealpath(d, t, _, (function(s, n) {
|
|
2326
|
-
if (s) return e(path$1__default.dirname(t), r);
|
|
2327
|
-
var o = path$1__default.join(n, "package.json");
|
|
2328
|
-
l(o, (function(s, n) {
|
|
2329
|
-
if (!n) return e(path$1__default.dirname(t), r);
|
|
2330
|
-
u(o, (function(e, s) {
|
|
2331
|
-
e && r(e);
|
|
2332
|
-
try {
|
|
2333
|
-
var n = JSON.parse(s);
|
|
2334
|
-
} catch (e) {}
|
|
2335
|
-
n && _.packageFilter && (n = _.packageFilter(n, o)), r(null, n, t);
|
|
2336
|
-
}));
|
|
2337
|
-
}));
|
|
2338
|
-
}));
|
|
2339
|
-
}(path$1__default.dirname(a), o);
|
|
2340
|
-
}([ "" ].concat(p), e, s);
|
|
2341
|
-
}
|
|
2342
|
-
function i(e, t, r) {
|
|
2343
|
-
var s = r, n = t;
|
|
2344
|
-
"function" == typeof n && (s = n, n = _.package), maybeRealpath(d, e, _, (function(t, r) {
|
|
2345
|
-
if (t) return s(t);
|
|
2346
|
-
var a = path$1__default.join(r, "package.json");
|
|
2347
|
-
l(a, (function(t, r) {
|
|
2348
|
-
return t ? s(t) : r ? void u(a, (function(t, r) {
|
|
2349
|
-
var n, l;
|
|
2350
|
-
if (t) return s(t);
|
|
2351
|
-
try {
|
|
2352
|
-
n = JSON.parse(r);
|
|
2353
|
-
} catch (e) {}
|
|
2354
|
-
if (n && _.packageFilter && (n = _.packageFilter(n, a)), n && n.main) return "string" != typeof n.main ? ((l = new TypeError("package “" + n.name + "” `main` must be a string")).code = "INVALID_PACKAGE_MAIN",
|
|
2355
|
-
s(l)) : ("." !== n.main && "./" !== n.main || (n.main = "index"), void o(path$1__default.resolve(e, n.main), n, (function(t, r, n) {
|
|
2356
|
-
return t ? s(t) : r ? s(null, r, n) : n ? void i(path$1__default.resolve(e, n.main), n, (function(t, r, n) {
|
|
2357
|
-
return t ? s(t) : r ? s(null, r, n) : void o(path$1__default.join(e, "index"), n, s);
|
|
2358
|
-
})) : o(path$1__default.join(e, "index"), n, s);
|
|
2359
|
-
})));
|
|
2360
|
-
o(path$1__default.join(e, "/index"), n, s);
|
|
2361
|
-
})) : o(path$1__default.join(e, "index"), n, s);
|
|
2362
|
-
}));
|
|
2363
|
-
}));
|
|
2364
|
-
}
|
|
2365
|
-
var a, l, c, u, d, h, p, f, m, g, y, w = s, _ = r;
|
|
2366
|
-
if ("function" == typeof r && (w = _, _ = {}), "string" != typeof t) return a = new TypeError("Path must be a string."),
|
|
2367
|
-
process.nextTick((function() {
|
|
2368
|
-
w(a);
|
|
2369
|
-
}));
|
|
2370
|
-
_ = normalizeOptions(0, _), l = _.isFile || defaultIsFile, c = _.isDirectory || defaultIsDir,
|
|
2371
|
-
u = _.readFile || fs$1.readFile, d = _.realpath || defaultRealpath, h = _.packageIterator,
|
|
2372
|
-
p = _.extensions || [ ".js" ], f = _.basedir || path$1__default.dirname(caller()),
|
|
2373
|
-
m = _.filename || f, _.paths = _.paths || [], g = path$1__default.resolve(f), maybeRealpath(d, g, _, (function(e, r) {
|
|
2374
|
-
e ? w(e) : function s(e) {
|
|
2375
|
-
if (/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(t)) y = path$1__default.resolve(e, t),
|
|
2376
|
-
"." !== t && ".." !== t && "/" !== t.slice(-1) || (y += "/"), /\/$/.test(t) && y === e ? i(y, _.package, n) : o(y, _.package, n); else {
|
|
2377
|
-
if (isCore(t)) return w(null, t);
|
|
2378
|
-
!function r(e, t, s) {
|
|
2379
|
-
var n = function() {
|
|
2380
|
-
return getPackageCandidates(e, t, _);
|
|
2381
|
-
};
|
|
2382
|
-
!function e(t, r) {
|
|
2383
|
-
function s(e, r, s) {
|
|
2384
|
-
return e ? t(e) : r ? t(null, r, s) : void i(a, _.package, n);
|
|
2385
|
-
}
|
|
2386
|
-
function n(s, n, o) {
|
|
2387
|
-
return s ? t(s) : n ? t(null, n, o) : void e(t, r.slice(1));
|
|
2388
|
-
}
|
|
2389
|
-
if (0 === r.length) return t(null, void 0);
|
|
2390
|
-
var a = r[0];
|
|
2391
|
-
c(path$1__default.dirname(a), (function l(n, i) {
|
|
2392
|
-
return n ? t(n) : i ? void o(a, _.package, s) : e(t, r.slice(1));
|
|
2393
|
-
}));
|
|
2394
|
-
}(s, h ? h(e, t, n, _) : n());
|
|
2395
|
-
}(t, e, (function(e, r, s) {
|
|
2396
|
-
if (e) w(e); else {
|
|
2397
|
-
if (r) return maybeRealpath(d, r, _, (function(e, t) {
|
|
2398
|
-
e ? w(e) : w(null, t, s);
|
|
2399
|
-
}));
|
|
2400
|
-
var n = new Error("Cannot find module '" + t + "' from '" + m + "'");
|
|
2401
|
-
n.code = "MODULE_NOT_FOUND", w(n);
|
|
2402
|
-
}
|
|
2403
|
-
}));
|
|
2404
|
-
}
|
|
2405
|
-
}(r);
|
|
2406
|
-
}));
|
|
2407
|
-
}, realpathFS$1 = fs$1.realpathSync && "function" == typeof fs$1.realpathSync.native ? fs$1.realpathSync.native : fs$1.realpathSync,
|
|
2408
|
-
defaultIsFile$1 = function e(t) {
|
|
2511
|
+
core_1 = core, isCore = function e(t) {
|
|
2512
|
+
return isCoreModule(t);
|
|
2513
|
+
}, realpathFS = fs__default.default.realpathSync && "function" == typeof fs__default.default.realpathSync.native ? fs__default.default.realpathSync.native : fs__default.default.realpathSync,
|
|
2514
|
+
defaultIsFile = function e(t) {
|
|
2409
2515
|
try {
|
|
2410
|
-
var r =
|
|
2516
|
+
var r = fs__default.default.statSync(t);
|
|
2411
2517
|
} catch (e) {
|
|
2412
2518
|
if (e && ("ENOENT" === e.code || "ENOTDIR" === e.code)) return !1;
|
|
2413
2519
|
throw e;
|
|
2414
2520
|
}
|
|
2415
2521
|
return r.isFile() || r.isFIFO();
|
|
2416
|
-
}, defaultIsDir
|
|
2522
|
+
}, defaultIsDir = function e(t) {
|
|
2417
2523
|
try {
|
|
2418
|
-
var r =
|
|
2524
|
+
var r = fs__default.default.statSync(t);
|
|
2419
2525
|
} catch (e) {
|
|
2420
2526
|
if (e && ("ENOENT" === e.code || "ENOTDIR" === e.code)) return !1;
|
|
2421
2527
|
throw e;
|
|
@@ -2423,78 +2529,80 @@ defaultIsFile$1 = function e(t) {
|
|
|
2423
2529
|
return r.isDirectory();
|
|
2424
2530
|
}, defaultRealpathSync = function e(t) {
|
|
2425
2531
|
try {
|
|
2426
|
-
return realpathFS
|
|
2532
|
+
return realpathFS(t);
|
|
2427
2533
|
} catch (e) {
|
|
2428
2534
|
if ("ENOENT" !== e.code) throw e;
|
|
2429
2535
|
}
|
|
2430
2536
|
return t;
|
|
2431
2537
|
}, maybeRealpathSync = function e(t, r, s) {
|
|
2432
2538
|
return s && !1 === s.preserveSymlinks ? t(r) : r;
|
|
2433
|
-
},
|
|
2539
|
+
}, defaultReadPackageSync = function e(t, r) {
|
|
2540
|
+
var s = t(r);
|
|
2541
|
+
try {
|
|
2542
|
+
return JSON.parse(s);
|
|
2543
|
+
} catch (e) {}
|
|
2544
|
+
}, getPackageCandidates = function e(t, r, s) {
|
|
2434
2545
|
var n, o = nodeModulesPaths(r, s, t);
|
|
2435
|
-
for (n = 0; n < o.length; n++) o[n] =
|
|
2546
|
+
for (n = 0; n < o.length; n++) o[n] = path__default.default.join(o[n], t);
|
|
2436
2547
|
return o;
|
|
2437
2548
|
}, sync = function e(t, r) {
|
|
2438
2549
|
function s(e) {
|
|
2439
|
-
var t, r, s,
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
try {
|
|
2445
|
-
n = JSON.parse(s);
|
|
2446
|
-
} catch (e) {}
|
|
2447
|
-
return n && o.packageFilter && (n = o.packageFilter(n, t)), {
|
|
2448
|
-
pkg: n,
|
|
2449
|
-
dir: t
|
|
2450
|
-
};
|
|
2451
|
-
}
|
|
2452
|
-
}(path$1__default.dirname(e));
|
|
2453
|
-
if (l && l.dir && l.pkg && o.pathFilter && (t = path$1__default.relative(l.dir, e),
|
|
2454
|
-
(r = o.pathFilter(l.pkg, e, t)) && (e = path$1__default.resolve(l.dir, r))), i(e)) return e;
|
|
2455
|
-
for (s = 0; s < d.length; s++) if (n = e + d[s], i(n)) return n;
|
|
2550
|
+
var t, r, s, o, l = n(path__default.default.dirname(e));
|
|
2551
|
+
if (l && l.dir && l.pkg && i.pathFilter && (t = path__default.default.relative(l.dir, e),
|
|
2552
|
+
(r = i.pathFilter(l.pkg, e, t)) && (e = path__default.default.resolve(l.dir, r))),
|
|
2553
|
+
a(e)) return e;
|
|
2554
|
+
for (s = 0; s < p.length; s++) if (o = e + p[s], a(o)) return o;
|
|
2456
2555
|
}
|
|
2457
2556
|
function n(e) {
|
|
2458
|
-
var t, r
|
|
2459
|
-
if (
|
|
2557
|
+
var t, r;
|
|
2558
|
+
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"),
|
|
2559
|
+
a(t) ? ((r = d(l, t)) && i.packageFilter && (r = i.packageFilter(r, e)), {
|
|
2560
|
+
pkg: r,
|
|
2561
|
+
dir: e
|
|
2562
|
+
}) : n(path__default.default.dirname(e));
|
|
2563
|
+
}
|
|
2564
|
+
function o(e) {
|
|
2565
|
+
var t, r, n, c, h = path__default.default.join(maybeRealpathSync(u, e, i), "/package.json");
|
|
2566
|
+
if (a(h)) {
|
|
2460
2567
|
try {
|
|
2461
|
-
t =
|
|
2568
|
+
t = d(l, h);
|
|
2462
2569
|
} catch (e) {}
|
|
2463
|
-
if (
|
|
2464
|
-
if ("string" != typeof
|
|
2465
|
-
|
|
2466
|
-
"." !==
|
|
2570
|
+
if (t && i.packageFilter && (t = i.packageFilter(t, e)), t && t.main) {
|
|
2571
|
+
if ("string" != typeof t.main) throw (r = new TypeError("package “" + t.name + "” `main` must be a string")).code = "INVALID_PACKAGE_MAIN",
|
|
2572
|
+
r;
|
|
2573
|
+
"." !== t.main && "./" !== t.main || (t.main = "index");
|
|
2467
2574
|
try {
|
|
2468
|
-
if (
|
|
2469
|
-
if (
|
|
2575
|
+
if (n = s(path__default.default.resolve(e, t.main))) return n;
|
|
2576
|
+
if (c = o(path__default.default.resolve(e, t.main))) return c;
|
|
2470
2577
|
} catch (e) {}
|
|
2471
2578
|
}
|
|
2472
2579
|
}
|
|
2473
|
-
return s(
|
|
2580
|
+
return s(path__default.default.join(e, "/index"));
|
|
2474
2581
|
}
|
|
2475
|
-
var
|
|
2582
|
+
var i, a, l, c, u, d, h, p, f, m, g, y, w, _, v, b;
|
|
2476
2583
|
if ("string" != typeof t) throw new TypeError("Path must be a string.");
|
|
2477
|
-
if (
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2584
|
+
if (i = normalizeOptions(0, r), a = i.isFile || defaultIsFile, l = i.readFileSync || fs__default.default.readFileSync,
|
|
2585
|
+
c = i.isDirectory || defaultIsDir, u = i.realpathSync || defaultRealpathSync, d = i.readPackageSync || defaultReadPackageSync,
|
|
2586
|
+
i.readFileSync && i.readPackageSync) throw new TypeError("`readFileSync` and `readPackageSync` are mutually exclusive.");
|
|
2587
|
+
if (h = i.packageIterator, p = i.extensions || [ ".js" ], f = !1 !== i.includeCoreModules,
|
|
2588
|
+
m = i.basedir || path__default.default.dirname(caller()), g = i.filename || m, i.paths = i.paths || [],
|
|
2589
|
+
y = maybeRealpathSync(u, path__default.default.resolve(m), i), /^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(t)) {
|
|
2590
|
+
if (w = path__default.default.resolve(y, t), "." !== t && ".." !== t && "/" !== t.slice(-1) || (w += "/"),
|
|
2591
|
+
_ = s(w) || o(w)) return maybeRealpathSync(u, _, i);
|
|
2484
2592
|
} else {
|
|
2485
|
-
if (
|
|
2486
|
-
if (
|
|
2487
|
-
var r,
|
|
2488
|
-
return getPackageCandidates
|
|
2489
|
-
},
|
|
2490
|
-
for (r = 0; r <
|
|
2491
|
-
if (a = s(
|
|
2492
|
-
if (
|
|
2593
|
+
if (f && isCoreModule(t)) return t;
|
|
2594
|
+
if (v = function E(e, t) {
|
|
2595
|
+
var r, n, a, l, u = function() {
|
|
2596
|
+
return getPackageCandidates(e, t, i);
|
|
2597
|
+
}, d = h ? h(e, t, u, i) : u();
|
|
2598
|
+
for (r = 0; r < d.length; r++) if (n = d[r], c(path__default.default.dirname(n))) {
|
|
2599
|
+
if (a = s(n)) return a;
|
|
2600
|
+
if (l = o(n)) return l;
|
|
2493
2601
|
}
|
|
2494
|
-
}(t,
|
|
2602
|
+
}(t, y)) return maybeRealpathSync(u, v, i);
|
|
2495
2603
|
}
|
|
2496
|
-
throw (
|
|
2497
|
-
|
|
2604
|
+
throw (b = new Error("Cannot find module '" + t + "' from '" + g + "'")).code = "MODULE_NOT_FOUND",
|
|
2605
|
+
b;
|
|
2498
2606
|
}, async.core = core_1, async.isCore = isCore, async.sync = sync, resolve = async;
|
|
2499
2607
|
|
|
2500
2608
|
const createSystem = e => {
|
|
@@ -2524,25 +2632,25 @@ const createSystem = e => {
|
|
|
2524
2632
|
finish: () => 0
|
|
2525
2633
|
}),
|
|
2526
2634
|
printDiagnostics(t) {
|
|
2527
|
-
t.forEach(t => ((e, t) => {
|
|
2635
|
+
t.forEach((t => ((e, t) => {
|
|
2528
2636
|
let r = BLUE, s = "Build", n = "";
|
|
2529
2637
|
"error" === e.level ? (r = RED, s = "Error") : "warn" === e.level && (r = YELLOW,
|
|
2530
2638
|
s = "Warning"), e.header && (s = e.header);
|
|
2531
2639
|
const o = e.relFilePath || e.absFilePath;
|
|
2532
2640
|
if (o && (n += o, "number" == typeof e.lineNumber && e.lineNumber > 0 && (n += ", line " + e.lineNumber,
|
|
2533
2641
|
"number" == typeof e.columnNumber && e.columnNumber > 0 && (n += ", column " + e.columnNumber)),
|
|
2534
|
-
n += "\n"), n += e.messageText, e.lines && e.lines.length > 0 && (e.lines.forEach(e => {
|
|
2642
|
+
n += "\n"), n += e.messageText, e.lines && e.lines.length > 0 && (e.lines.forEach((e => {
|
|
2535
2643
|
n += "\n" + e.lineNumber + ": " + e.text;
|
|
2536
|
-
}), n += "\n"), t) {
|
|
2644
|
+
})), n += "\n"), t) {
|
|
2537
2645
|
const e = [ "%c" + s, `background: ${r}; color: white; padding: 2px 3px; border-radius: 2px; font-size: 0.8em;` ];
|
|
2538
2646
|
console.log(...e, n);
|
|
2539
2647
|
} else "error" === e.level ? console.error(n) : "warn" === e.level ? console.warn(n) : console.log(n);
|
|
2540
|
-
})(t, e));
|
|
2648
|
+
})(t, e)));
|
|
2541
2649
|
}
|
|
2542
2650
|
};
|
|
2543
2651
|
})(), r = new Map, s = new Set, n = e => s.add(e), o = e => s.delete(e), i = (() => {
|
|
2544
2652
|
const e = [], t = t => {
|
|
2545
|
-
const r = e.findIndex(e => e.callback === t);
|
|
2653
|
+
const r = e.findIndex((e => e.callback === t));
|
|
2546
2654
|
return r > -1 && (e.splice(r, 1), !0);
|
|
2547
2655
|
};
|
|
2548
2656
|
return {
|
|
@@ -2581,7 +2689,7 @@ const createSystem = e => {
|
|
|
2581
2689
|
};
|
|
2582
2690
|
})(), a = IS_BROWSER_ENV && navigator.hardwareConcurrency || 1, l = e => {
|
|
2583
2691
|
if ("/" === e || "" === e) return "/";
|
|
2584
|
-
const t = path$
|
|
2692
|
+
const t = path$2.dirname(e), r = path$2.basename(e);
|
|
2585
2693
|
return t.endsWith("/") ? normalizePath(`${t}${r}`) : normalizePath(`${t}/${r}`);
|
|
2586
2694
|
}, c = e => {
|
|
2587
2695
|
const t = r.get(l(e));
|
|
@@ -2589,19 +2697,19 @@ const createSystem = e => {
|
|
|
2589
2697
|
}, u = (e, t) => {
|
|
2590
2698
|
e = l(e);
|
|
2591
2699
|
const r = {
|
|
2592
|
-
basename: path$
|
|
2593
|
-
dirname: path$
|
|
2700
|
+
basename: path$2.basename(e),
|
|
2701
|
+
dirname: path$2.dirname(e),
|
|
2594
2702
|
path: e,
|
|
2595
2703
|
newDirs: [],
|
|
2596
2704
|
error: null
|
|
2597
2705
|
};
|
|
2598
2706
|
return d(e, t, r), r;
|
|
2599
2707
|
}, d = (e, t, s) => {
|
|
2600
|
-
const n = path$
|
|
2708
|
+
const n = path$2.dirname(e);
|
|
2601
2709
|
t && t.recursive && !(e => "/" === e || windowsPathRegex.test(e))(n) && d(n, t, s);
|
|
2602
2710
|
const o = r.get(e);
|
|
2603
2711
|
o ? (o.isDirectory = !0, o.isFile = !1) : (r.set(e, {
|
|
2604
|
-
basename: path$
|
|
2712
|
+
basename: path$2.basename(e),
|
|
2605
2713
|
dirname: n,
|
|
2606
2714
|
isDirectory: !0,
|
|
2607
2715
|
isFile: !1,
|
|
@@ -2611,9 +2719,9 @@ const createSystem = e => {
|
|
|
2611
2719
|
}, h = e => {
|
|
2612
2720
|
e = l(e);
|
|
2613
2721
|
const t = [], s = r.get(e);
|
|
2614
|
-
return s && s.isDirectory && r.forEach((r, s) => {
|
|
2722
|
+
return s && s.isDirectory && r.forEach(((r, s) => {
|
|
2615
2723
|
"/" !== s && (r.isDirectory || r.isFile && "string" == typeof r.data) && (e.endsWith("/") && `${e}${r.basename}` === s || `${e}/${r.basename}` === s) && t.push(s);
|
|
2616
|
-
}), t.sort();
|
|
2724
|
+
})), t.sort();
|
|
2617
2725
|
}, p = e => {
|
|
2618
2726
|
e = l(e);
|
|
2619
2727
|
const t = r.get(e);
|
|
@@ -2623,8 +2731,8 @@ const createSystem = e => {
|
|
|
2623
2731
|
error: null
|
|
2624
2732
|
}), m = (e, t, s) => {
|
|
2625
2733
|
const n = w(e);
|
|
2626
|
-
if (n && !s.error) if (n.isFile
|
|
2627
|
-
const n = path$
|
|
2734
|
+
if (!n.error && !s.error) if (n.isFile) {
|
|
2735
|
+
const n = path$2.dirname(t), o = u(n, {
|
|
2628
2736
|
recursive: !0
|
|
2629
2737
|
}), i = r.get(e).data, a = b(t, i);
|
|
2630
2738
|
s.newDirs.push(...o.newDirs), s.renamed.push({
|
|
@@ -2633,7 +2741,7 @@ const createSystem = e => {
|
|
|
2633
2741
|
isDirectory: !1,
|
|
2634
2742
|
isFile: !0
|
|
2635
2743
|
}), a.error ? s.error = a.error : s.newFiles.push(t);
|
|
2636
|
-
} else if (n.isDirectory
|
|
2744
|
+
} else if (n.isDirectory) {
|
|
2637
2745
|
const r = h(e), n = u(t, {
|
|
2638
2746
|
recursive: !0
|
|
2639
2747
|
});
|
|
@@ -2650,8 +2758,8 @@ const createSystem = e => {
|
|
|
2650
2758
|
}
|
|
2651
2759
|
}, g = (e, t = {}) => {
|
|
2652
2760
|
const r = {
|
|
2653
|
-
basename: path$
|
|
2654
|
-
dirname: path$
|
|
2761
|
+
basename: path$2.basename(e),
|
|
2762
|
+
dirname: path$2.dirname(e),
|
|
2655
2763
|
path: e,
|
|
2656
2764
|
removedDirs: [],
|
|
2657
2765
|
removedFiles: [],
|
|
@@ -2674,17 +2782,24 @@ const createSystem = e => {
|
|
|
2674
2782
|
}, w = e => {
|
|
2675
2783
|
e = l(e);
|
|
2676
2784
|
const t = r.get(e);
|
|
2677
|
-
|
|
2678
|
-
isDirectory:
|
|
2679
|
-
isFile:
|
|
2680
|
-
isSymbolicLink:
|
|
2681
|
-
size: t.isFile ? t.data.length : 0
|
|
2785
|
+
return t && (t.isDirectory || t.isFile && "string" == typeof t.data) ? {
|
|
2786
|
+
isDirectory: t.isDirectory,
|
|
2787
|
+
isFile: t.isFile,
|
|
2788
|
+
isSymbolicLink: !1,
|
|
2789
|
+
size: t.isFile && t.data ? t.data.length : 0,
|
|
2790
|
+
error: null
|
|
2791
|
+
} : {
|
|
2792
|
+
isDirectory: !1,
|
|
2793
|
+
isFile: !1,
|
|
2794
|
+
isSymbolicLink: !1,
|
|
2795
|
+
size: 0,
|
|
2796
|
+
error: `ENOENT: no such file or directory, statSync '${e}'`
|
|
2682
2797
|
};
|
|
2683
2798
|
}, _ = e => {
|
|
2684
2799
|
e = l(e);
|
|
2685
2800
|
const t = {
|
|
2686
|
-
basename: path$
|
|
2687
|
-
dirname: path$
|
|
2801
|
+
basename: path$2.basename(e),
|
|
2802
|
+
dirname: path$2.dirname(e),
|
|
2688
2803
|
path: e,
|
|
2689
2804
|
error: null
|
|
2690
2805
|
}, s = r.get(e);
|
|
@@ -2694,7 +2809,7 @@ const createSystem = e => {
|
|
|
2694
2809
|
}
|
|
2695
2810
|
return t;
|
|
2696
2811
|
}, v = (e, t) => {
|
|
2697
|
-
const s = l(path$
|
|
2812
|
+
const s = l(path$2.dirname(e)), n = r.get(s);
|
|
2698
2813
|
if (n && n.isDirectory && n.watcherCallbacks) for (const t of n.watcherCallbacks) t(e, null);
|
|
2699
2814
|
t.has(s) || (t.add(s), v(s, t));
|
|
2700
2815
|
}, b = (e, t) => {
|
|
@@ -2706,8 +2821,8 @@ const createSystem = e => {
|
|
|
2706
2821
|
const r = n.data !== t;
|
|
2707
2822
|
if (n.data = t, r && n.watcherCallbacks) for (const t of n.watcherCallbacks) t(e, "fileUpdate");
|
|
2708
2823
|
} else r.set(e, {
|
|
2709
|
-
basename: path$
|
|
2710
|
-
dirname: path$
|
|
2824
|
+
basename: path$2.basename(e),
|
|
2825
|
+
dirname: path$2.dirname(e),
|
|
2711
2826
|
isDirectory: !1,
|
|
2712
2827
|
isFile: !0,
|
|
2713
2828
|
watcherCallbacks: null,
|
|
@@ -2716,46 +2831,46 @@ const createSystem = e => {
|
|
|
2716
2831
|
return s;
|
|
2717
2832
|
}, E = Promise.resolve();
|
|
2718
2833
|
u("/");
|
|
2719
|
-
const
|
|
2834
|
+
const D = {
|
|
2720
2835
|
name: "in-memory",
|
|
2721
|
-
version: "
|
|
2836
|
+
version: "2.5.2",
|
|
2722
2837
|
events: i,
|
|
2723
2838
|
access: async e => c(e),
|
|
2724
2839
|
accessSync: c,
|
|
2725
2840
|
addDestory: n,
|
|
2726
2841
|
copyFile: async (e, t) => (b(t, p(e)), !0),
|
|
2842
|
+
createDir: async (e, t) => u(e, t),
|
|
2843
|
+
createDirSync: u,
|
|
2727
2844
|
destroy: async () => {
|
|
2728
2845
|
const e = [];
|
|
2729
|
-
s.forEach(r => {
|
|
2846
|
+
s.forEach((r => {
|
|
2730
2847
|
try {
|
|
2731
2848
|
const t = r();
|
|
2732
2849
|
t && t.then && e.push(t);
|
|
2733
2850
|
} catch (e) {
|
|
2734
|
-
t.error(
|
|
2851
|
+
t.error(`rindo sys destroy: ${e}`);
|
|
2735
2852
|
}
|
|
2736
|
-
}), await Promise.all(e), s.clear();
|
|
2853
|
+
})), await Promise.all(e), s.clear();
|
|
2737
2854
|
},
|
|
2738
2855
|
encodeToBase64: e => btoa(unescape(encodeURIComponent(e))),
|
|
2739
|
-
exit: e => t.warn(
|
|
2856
|
+
exit: async e => t.warn(`exit ${e}`),
|
|
2740
2857
|
getCurrentDirectory: () => "/",
|
|
2741
|
-
getCompilerExecutingPath: () => IS_WEB_WORKER_ENV ? location.href :
|
|
2858
|
+
getCompilerExecutingPath: () => IS_WEB_WORKER_ENV ? location.href : D.getRemoteModuleUrl({
|
|
2742
2859
|
moduleId: "@rindo/core",
|
|
2743
2860
|
path: "compiler/rindo.min.js"
|
|
2744
2861
|
}),
|
|
2745
|
-
getLocalModulePath: e => path$
|
|
2862
|
+
getLocalModulePath: e => path$2.join(e.rootDir, "node_modules", e.moduleId, e.path),
|
|
2746
2863
|
getRemoteModuleUrl: e => {
|
|
2747
2864
|
const t = `${e.moduleId}${e.version ? "@" + e.version : ""}/${e.path}`;
|
|
2748
2865
|
return new URL(t, "https://cdn.jsdelivr.net/npm/").href;
|
|
2749
2866
|
},
|
|
2750
2867
|
hardwareConcurrency: a,
|
|
2751
2868
|
isSymbolicLink: async e => !1,
|
|
2752
|
-
mkdir: async (e, t) => u(e, t),
|
|
2753
|
-
mkdirSync: u,
|
|
2754
2869
|
nextTick: e => E.then(e),
|
|
2755
2870
|
normalizePath: l,
|
|
2756
2871
|
platformPath: pathBrowserify,
|
|
2757
|
-
|
|
2758
|
-
|
|
2872
|
+
readDir: async e => h(e),
|
|
2873
|
+
readDirSync: h,
|
|
2759
2874
|
readFile: async e => p(e),
|
|
2760
2875
|
readFileSync: p,
|
|
2761
2876
|
realpath: async e => f(e),
|
|
@@ -2774,28 +2889,26 @@ const createSystem = e => {
|
|
|
2774
2889
|
isDirectory: !1,
|
|
2775
2890
|
error: null
|
|
2776
2891
|
}, s = w(e);
|
|
2777
|
-
if (s) {
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
}
|
|
2788
|
-
} else r.error = e + " does not exist";
|
|
2892
|
+
if (s.error) r.error = `${e} does not exist`; else if (s.isFile ? r.isFile = !0 : s.isDirectory && (r.isDirectory = !0),
|
|
2893
|
+
m(e, t, r), !r.error) if (r.isDirectory) {
|
|
2894
|
+
const t = g(e, {
|
|
2895
|
+
recursive: !0
|
|
2896
|
+
});
|
|
2897
|
+
t.error ? r.error = t.error : (r.oldDirs.push(...t.removedDirs), r.oldFiles.push(...t.removedFiles));
|
|
2898
|
+
} else if (r.isFile) {
|
|
2899
|
+
const t = _(e);
|
|
2900
|
+
t.error ? r.error = t.error : r.oldFiles.push(e);
|
|
2901
|
+
}
|
|
2789
2902
|
return r;
|
|
2790
2903
|
},
|
|
2791
2904
|
resolvePath: e => l(e),
|
|
2792
|
-
|
|
2793
|
-
|
|
2905
|
+
removeDir: async (e, t = {}) => g(e, t),
|
|
2906
|
+
removeDirSync: g,
|
|
2794
2907
|
stat: async e => w(e),
|
|
2795
2908
|
statSync: w,
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2909
|
+
tmpDirSync: () => "/.tmp",
|
|
2910
|
+
removeFile: async e => _(e),
|
|
2911
|
+
removeFileSync: _,
|
|
2799
2912
|
watchDirectory: (e, t) => {
|
|
2800
2913
|
e = l(e);
|
|
2801
2914
|
const s = r.get(e), i = () => {
|
|
@@ -2807,8 +2920,8 @@ const createSystem = e => {
|
|
|
2807
2920
|
};
|
|
2808
2921
|
return n(i), s ? (s.isDirectory = !0, s.isFile = !1, s.watcherCallbacks = s.watcherCallbacks || [],
|
|
2809
2922
|
s.watcherCallbacks.push(t)) : r.set(e, {
|
|
2810
|
-
basename: path$
|
|
2811
|
-
dirname: path$
|
|
2923
|
+
basename: path$2.basename(e),
|
|
2924
|
+
dirname: path$2.dirname(e),
|
|
2812
2925
|
isDirectory: !0,
|
|
2813
2926
|
isFile: !1,
|
|
2814
2927
|
watcherCallbacks: [ t ],
|
|
@@ -2830,8 +2943,8 @@ const createSystem = e => {
|
|
|
2830
2943
|
};
|
|
2831
2944
|
return n(i), s ? (s.isDirectory = !1, s.isFile = !0, s.watcherCallbacks = s.watcherCallbacks || [],
|
|
2832
2945
|
s.watcherCallbacks.push(t)) : r.set(e, {
|
|
2833
|
-
basename: path$
|
|
2834
|
-
dirname: path$
|
|
2946
|
+
basename: path$2.basename(e),
|
|
2947
|
+
dirname: path$2.dirname(e),
|
|
2835
2948
|
isDirectory: !1,
|
|
2836
2949
|
isFile: !0,
|
|
2837
2950
|
watcherCallbacks: [ t ],
|
|
@@ -2847,7 +2960,7 @@ const createSystem = e => {
|
|
|
2847
2960
|
writeFileSync: b,
|
|
2848
2961
|
generateContentHash: async (e, t) => {
|
|
2849
2962
|
const r = await crypto.subtle.digest("SHA-256", (new TextEncoder).encode(e));
|
|
2850
|
-
let s = Array.from(new Uint8Array(r)).map(e => e.toString(16).padStart(2, "0")).join("");
|
|
2963
|
+
let s = Array.from(new Uint8Array(r)).map((e => e.toString(16).padStart(2, "0"))).join("");
|
|
2851
2964
|
return "number" == typeof t && (s = s.substr(0, t)), s;
|
|
2852
2965
|
},
|
|
2853
2966
|
createWorkerController: HAS_WEB_WORKER ? e => ((e, t) => {
|
|
@@ -2892,7 +3005,7 @@ const createSystem = e => {
|
|
|
2892
3005
|
t.activeTasks++, t.sendQueue.push(e);
|
|
2893
3006
|
}, g = () => {
|
|
2894
3007
|
o = !1, l.forEach(m), l.length = 0, c.forEach(f);
|
|
2895
|
-
}, y = (...e) => new Promise((t, r) => {
|
|
3008
|
+
}, y = (...e) => new Promise(((t, r) => {
|
|
2896
3009
|
if (n) r("task canceled"); else {
|
|
2897
3010
|
const n = {
|
|
2898
3011
|
rindoId: s++,
|
|
@@ -2903,11 +3016,11 @@ const createSystem = e => {
|
|
|
2903
3016
|
reject: r
|
|
2904
3017
|
}), o || (o = !0, d.then(g));
|
|
2905
3018
|
}
|
|
2906
|
-
});
|
|
3019
|
+
}));
|
|
2907
3020
|
return {
|
|
2908
3021
|
send: y,
|
|
2909
3022
|
destroy: () => {
|
|
2910
|
-
n = !0, a.forEach(e => e.reject("task canceled")), a.clear(), c.forEach(e => e.worker.terminate()),
|
|
3023
|
+
n = !0, a.forEach((e => e.reject("task canceled"))), a.clear(), c.forEach((e => e.worker.terminate())),
|
|
2911
3024
|
c.length = 0;
|
|
2912
3025
|
},
|
|
2913
3026
|
handler: e => function(...t) {
|
|
@@ -2915,7 +3028,7 @@ const createSystem = e => {
|
|
|
2915
3028
|
},
|
|
2916
3029
|
maxWorkers: u
|
|
2917
3030
|
};
|
|
2918
|
-
})(
|
|
3031
|
+
})(D, e) : null,
|
|
2919
3032
|
details: {
|
|
2920
3033
|
cpuModel: "",
|
|
2921
3034
|
freemem: () => 0,
|
|
@@ -2929,12 +3042,12 @@ const createSystem = e => {
|
|
|
2929
3042
|
filePaths: []
|
|
2930
3043
|
})
|
|
2931
3044
|
};
|
|
2932
|
-
return
|
|
3045
|
+
return D.resolveModuleId = e => ((e, t, r) => {
|
|
2933
3046
|
const s = ((e, t, r) => ({
|
|
2934
3047
|
async isFile(s, n) {
|
|
2935
3048
|
const o = normalizeFsPath(s);
|
|
2936
3049
|
if ((await t.stat(o)).isFile) n(null, !0); else {
|
|
2937
|
-
if (shouldFetchModule(o) && r.some(e => o.endsWith(e))) {
|
|
3050
|
+
if (shouldFetchModule(o) && r.some((e => o.endsWith(e)))) {
|
|
2938
3051
|
const r = getNodeModuleFetchUrl(e, packageVersions, o);
|
|
2939
3052
|
return void n(null, "string" == typeof await fetchModuleAsync(e, t, packageVersions, r, o));
|
|
2940
3053
|
}
|
|
@@ -2945,7 +3058,7 @@ const createSystem = e => {
|
|
|
2945
3058
|
const n = normalizeFsPath(r);
|
|
2946
3059
|
if ((await t.stat(n)).isDirectory) s(null, !0); else {
|
|
2947
3060
|
if (shouldFetchModule(n)) {
|
|
2948
|
-
if ("node_modules" === path$
|
|
3061
|
+
if ("node_modules" === path$2.basename(n)) return t.sys.createDirSync(n), t.clearFileCache(n),
|
|
2949
3062
|
void s(null, !0);
|
|
2950
3063
|
if (isCommonDirModuleFile(n)) return void s(null, !1);
|
|
2951
3064
|
for (const r of COMMON_DIR_FILENAMES) {
|
|
@@ -2958,7 +3071,7 @@ const createSystem = e => {
|
|
|
2958
3071
|
},
|
|
2959
3072
|
async readFile(e, r) {
|
|
2960
3073
|
const s = normalizeFsPath(e), n = await t.readFile(s);
|
|
2961
|
-
return isString(n) ? r(null, n) : r(
|
|
3074
|
+
return isString(n) ? r(null, n) : r(`readFile not found: ${e}`);
|
|
2962
3075
|
},
|
|
2963
3076
|
async realpath(t, r) {
|
|
2964
3077
|
const s = normalizeFsPath(t), n = await e.realpath(s);
|
|
@@ -2966,9 +3079,9 @@ const createSystem = e => {
|
|
|
2966
3079
|
},
|
|
2967
3080
|
extensions: r
|
|
2968
3081
|
}))(e, null, r.exts);
|
|
2969
|
-
return s.basedir = path$
|
|
2970
|
-
e)), new Promise((e, t) => {
|
|
2971
|
-
resolve(r.moduleId, s, (s, n, o) => {
|
|
3082
|
+
return s.basedir = path$2.dirname(normalizeFsPath(r.containingFile)), r.packageFilter ? s.packageFilter = r.packageFilter : null !== r.packageFilter && (s.packageFilter = e => (isString(e.main) && "" !== e.main || (e.main = "package.json"),
|
|
3083
|
+
e)), new Promise(((e, t) => {
|
|
3084
|
+
resolve(r.moduleId, s, ((s, n, o) => {
|
|
2972
3085
|
if (s) t(s); else {
|
|
2973
3086
|
n = normalizePath(n);
|
|
2974
3087
|
const t = {
|
|
@@ -2979,14 +3092,14 @@ const createSystem = e => {
|
|
|
2979
3092
|
};
|
|
2980
3093
|
e(t);
|
|
2981
3094
|
}
|
|
2982
|
-
});
|
|
2983
|
-
});
|
|
2984
|
-
})(
|
|
3095
|
+
}));
|
|
3096
|
+
}));
|
|
3097
|
+
})(D, 0, e), D;
|
|
2985
3098
|
}, createTestingSystem = () => {
|
|
2986
3099
|
let e = 0, t = 0;
|
|
2987
3100
|
const r = createSystem();
|
|
2988
|
-
r.platformPath =
|
|
2989
|
-
let r = crypto$
|
|
3101
|
+
r.platformPath = path__default.default, r.generateContentHash = (e, t) => {
|
|
3102
|
+
let r = crypto$3.createHash("sha1").update(e).digest("hex").toLowerCase();
|
|
2990
3103
|
return "number" == typeof t && (r = r.substr(0, t)), Promise.resolve(r);
|
|
2991
3104
|
};
|
|
2992
3105
|
const s = t => {
|
|
@@ -2997,9 +3110,9 @@ const createSystem = e => {
|
|
|
2997
3110
|
return (...e) => (t++, r.apply(r, e));
|
|
2998
3111
|
};
|
|
2999
3112
|
return r.access = s(r.access), r.accessSync = s(r.accessSync), r.readFile = s(r.readFile),
|
|
3000
|
-
r.readFileSync = s(r.readFileSync), r.
|
|
3001
|
-
r.stat = s(r.stat), r.statSync = s(r.statSync), r.copyFile = n(r.copyFile), r.
|
|
3002
|
-
r.
|
|
3113
|
+
r.readFileSync = s(r.readFileSync), r.readDir = s(r.readDir), r.readDirSync = s(r.readDirSync),
|
|
3114
|
+
r.stat = s(r.stat), r.statSync = s(r.statSync), r.copyFile = n(r.copyFile), r.createDir = n(r.createDir),
|
|
3115
|
+
r.createDirSync = n(r.createDirSync), r.removeFile = n(r.removeFile), r.removeFileSync = n(r.removeFileSync),
|
|
3003
3116
|
r.writeFile = n(r.writeFile), r.writeFileSync = n(r.writeFileSync), Object.defineProperties(r, {
|
|
3004
3117
|
diskReads: {
|
|
3005
3118
|
get: () => e,
|
|
@@ -3103,11 +3216,11 @@ class EventSpy {
|
|
|
3103
3216
|
});
|
|
3104
3217
|
{
|
|
3105
3218
|
let t;
|
|
3106
|
-
const r = new Promise(e => t = e);
|
|
3107
|
-
return this.queuedHandler.push(t), r.then(() => ({
|
|
3219
|
+
const r = new Promise((e => t = e));
|
|
3220
|
+
return this.queuedHandler.push(t), r.then((() => ({
|
|
3108
3221
|
done: !1,
|
|
3109
3222
|
value: this.events[e]
|
|
3110
|
-
}));
|
|
3223
|
+
})));
|
|
3111
3224
|
}
|
|
3112
3225
|
}
|
|
3113
3226
|
push(e) {
|
|
@@ -3117,7 +3230,7 @@ class EventSpy {
|
|
|
3117
3230
|
}
|
|
3118
3231
|
}
|
|
3119
3232
|
|
|
3120
|
-
class E2EElement extends
|
|
3233
|
+
class E2EElement extends index_cjs.MockHTMLElement {
|
|
3121
3234
|
constructor(e, t) {
|
|
3122
3235
|
super(null, null), this._page = e, this._elmHandle = t, this._queuedActions = [],
|
|
3123
3236
|
e._e2eElements.push(this);
|
|
@@ -3145,9 +3258,9 @@ class E2EElement extends index_cjs_js.MockHTMLElement {
|
|
|
3145
3258
|
}
|
|
3146
3259
|
async spyOnEvent(e) {
|
|
3147
3260
|
const t = new EventSpy(e);
|
|
3148
|
-
return await addE2EListener(this._page, this._elmHandle, e, e => {
|
|
3261
|
+
return await addE2EListener(this._page, this._elmHandle, e, (e => {
|
|
3149
3262
|
t.push(e);
|
|
3150
|
-
}), t;
|
|
3263
|
+
})), t;
|
|
3151
3264
|
}
|
|
3152
3265
|
async click(e) {
|
|
3153
3266
|
await this._elmHandle.click(e), await this._page.waitForChanges();
|
|
@@ -3163,16 +3276,16 @@ class E2EElement extends index_cjs_js.MockHTMLElement {
|
|
|
3163
3276
|
let e = !1;
|
|
3164
3277
|
try {
|
|
3165
3278
|
const t = this._elmHandle.executionContext();
|
|
3166
|
-
e = await t.evaluate(e => new Promise(t => {
|
|
3167
|
-
window.requestAnimationFrame(() => {
|
|
3279
|
+
e = await t.evaluate((e => new Promise((t => {
|
|
3280
|
+
window.requestAnimationFrame((() => {
|
|
3168
3281
|
if (e.isConnected) {
|
|
3169
3282
|
const r = window.getComputedStyle(e);
|
|
3170
|
-
r && "none" !== r.display && "hidden" !== r.visibility && "0" !== r.opacity ? window.requestAnimationFrame(() => {
|
|
3283
|
+
r && "none" !== r.display && "hidden" !== r.visibility && "0" !== r.opacity ? window.requestAnimationFrame((() => {
|
|
3171
3284
|
e.clientWidth, t(!0);
|
|
3172
|
-
}) : t(!1);
|
|
3285
|
+
})) : t(!1);
|
|
3173
3286
|
} else t(!1);
|
|
3174
|
-
});
|
|
3175
|
-
}), this._elmHandle);
|
|
3287
|
+
}));
|
|
3288
|
+
}))), this._elmHandle);
|
|
3176
3289
|
} catch (e) {}
|
|
3177
3290
|
return e;
|
|
3178
3291
|
}
|
|
@@ -3180,22 +3293,22 @@ class E2EElement extends index_cjs_js.MockHTMLElement {
|
|
|
3180
3293
|
return waitForEvent(this._page, e, this._elmHandle);
|
|
3181
3294
|
}
|
|
3182
3295
|
waitForVisible() {
|
|
3183
|
-
return new Promise((e, t) => {
|
|
3184
|
-
const r = setInterval(async () => {
|
|
3296
|
+
return new Promise(((e, t) => {
|
|
3297
|
+
const r = setInterval((async () => {
|
|
3185
3298
|
await this.isVisible() && (clearInterval(r), clearTimeout(o), e());
|
|
3186
|
-
}, 10), s = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, n = new Error(`waitForVisible timed out: ${s}ms`), o = setTimeout(() => {
|
|
3299
|
+
}), 10), s = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, n = new Error(`waitForVisible timed out: ${s}ms`), o = setTimeout((() => {
|
|
3187
3300
|
clearTimeout(r), t(n);
|
|
3188
|
-
}, s);
|
|
3189
|
-
});
|
|
3301
|
+
}), s);
|
|
3302
|
+
}));
|
|
3190
3303
|
}
|
|
3191
3304
|
waitForNotVisible() {
|
|
3192
|
-
return new Promise((e, t) => {
|
|
3193
|
-
const r = setInterval(async () => {
|
|
3305
|
+
return new Promise(((e, t) => {
|
|
3306
|
+
const r = setInterval((async () => {
|
|
3194
3307
|
await this.isVisible() || (clearInterval(r), clearTimeout(o), e());
|
|
3195
|
-
}, 10), s = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, n = new Error(`waitForNotVisible timed out: ${s}ms`), o = setTimeout(() => {
|
|
3308
|
+
}), 10), s = .5 * jasmine.DEFAULT_TIMEOUT_INTERVAL, n = new Error(`waitForNotVisible timed out: ${s}ms`), o = setTimeout((() => {
|
|
3196
3309
|
clearTimeout(r), t(n);
|
|
3197
|
-
}, s);
|
|
3198
|
-
});
|
|
3310
|
+
}), s);
|
|
3311
|
+
}));
|
|
3199
3312
|
}
|
|
3200
3313
|
isIntersectingViewport() {
|
|
3201
3314
|
return this._elmHandle.isIntersectingViewport();
|
|
@@ -3212,7 +3325,7 @@ class E2EElement extends index_cjs_js.MockHTMLElement {
|
|
|
3212
3325
|
async getProperty(e) {
|
|
3213
3326
|
this._validate();
|
|
3214
3327
|
const t = this._elmHandle.executionContext();
|
|
3215
|
-
return await t.evaluate((e, t) => e[t], this._elmHandle, e);
|
|
3328
|
+
return await t.evaluate(((e, t) => e[t]), this._elmHandle, e);
|
|
3216
3329
|
}
|
|
3217
3330
|
setProperty(e, t) {
|
|
3218
3331
|
this._queueAction({
|
|
@@ -3243,18 +3356,18 @@ class E2EElement extends index_cjs_js.MockHTMLElement {
|
|
|
3243
3356
|
get classList() {
|
|
3244
3357
|
return {
|
|
3245
3358
|
add: (...e) => {
|
|
3246
|
-
e.forEach(e => {
|
|
3359
|
+
e.forEach((e => {
|
|
3247
3360
|
this._queueAction({
|
|
3248
3361
|
classAdd: e
|
|
3249
3362
|
});
|
|
3250
|
-
});
|
|
3363
|
+
}));
|
|
3251
3364
|
},
|
|
3252
3365
|
remove: (...e) => {
|
|
3253
|
-
e.forEach(e => {
|
|
3366
|
+
e.forEach((e => {
|
|
3254
3367
|
this._queueAction({
|
|
3255
3368
|
classRemove: e
|
|
3256
3369
|
});
|
|
3257
|
-
});
|
|
3370
|
+
}));
|
|
3258
3371
|
},
|
|
3259
3372
|
toggle: e => {
|
|
3260
3373
|
this._queueAction({
|
|
@@ -3349,9 +3462,9 @@ class E2EElement extends index_cjs_js.MockHTMLElement {
|
|
|
3349
3462
|
});
|
|
3350
3463
|
}
|
|
3351
3464
|
async getComputedStyle(e) {
|
|
3352
|
-
const t = await this._page.evaluate((e, t) => {
|
|
3465
|
+
const t = await this._page.evaluate(((e, t) => {
|
|
3353
3466
|
const r = {}, s = window.getComputedStyle(e, t);
|
|
3354
|
-
return Object.keys(s).forEach(e => {
|
|
3467
|
+
return Object.keys(s).forEach((e => {
|
|
3355
3468
|
if (isNaN(e)) {
|
|
3356
3469
|
const t = s[e];
|
|
3357
3470
|
null != t && (r[e] = t);
|
|
@@ -3362,15 +3475,15 @@ class E2EElement extends index_cjs_js.MockHTMLElement {
|
|
|
3362
3475
|
null != e && (r[t] = e);
|
|
3363
3476
|
}
|
|
3364
3477
|
}
|
|
3365
|
-
}), r;
|
|
3366
|
-
}, this._elmHandle, e);
|
|
3478
|
+
})), r;
|
|
3479
|
+
}), this._elmHandle, e);
|
|
3367
3480
|
return t.getPropertyValue = e => t[e], t;
|
|
3368
3481
|
}
|
|
3369
3482
|
async e2eRunActions() {
|
|
3370
3483
|
if (0 === this._queuedActions.length) return;
|
|
3371
|
-
const e = this._elmHandle.executionContext(), t = await e.evaluate((e, t) => e.componentOnReady().then(() => {
|
|
3484
|
+
const e = this._elmHandle.executionContext(), t = await e.evaluate(((e, t) => e.componentOnReady().then((() => {
|
|
3372
3485
|
let r = null;
|
|
3373
|
-
return t.forEach(t => {
|
|
3486
|
+
return t.forEach((t => {
|
|
3374
3487
|
if (t.methodName) r = e[t.methodName].apply(e, t.methodArgs); else if (t.setPropertyName) e[t.setPropertyName] = t.setPropertyValue; else if (t.setAttributeName) e.setAttribute(t.setAttributeName, t.setAttributeValue); else if (t.removeAttribute) e.removeAttribute(t.removeAttribute); else if (t.toggleAttributeName) "boolean" == typeof t.toggleAttributeForce ? e.toggleAttribute(t.toggleAttributeName, t.toggleAttributeForce) : e.toggleAttribute(t.toggleAttributeName); else if (t.classAdd) e.classList.add(t.classAdd); else if (t.classRemove) e.classList.remove(t.classRemove); else if (t.classToggle) e.classList.toggle(t.classToggle); else if (t.eventName) {
|
|
3375
3488
|
const r = t.eventInitDict || {};
|
|
3376
3489
|
"boolean" != typeof r.bubbles && (r.bubbles = !0), "boolean" != typeof r.cancelable && (r.cancelable = !0),
|
|
@@ -3378,18 +3491,18 @@ class E2EElement extends index_cjs_js.MockHTMLElement {
|
|
|
3378
3491
|
const s = new CustomEvent(t.eventName, r);
|
|
3379
3492
|
e.dispatchEvent(s);
|
|
3380
3493
|
}
|
|
3381
|
-
}), r && "function" == typeof r.then ? r.then(e => e) : r;
|
|
3382
|
-
}), this._elmHandle, this._queuedActions);
|
|
3494
|
+
})), r && "function" == typeof r.then ? r.then((e => e)) : r;
|
|
3495
|
+
}))), this._elmHandle, this._queuedActions);
|
|
3383
3496
|
return this._queuedActions.length = 0, t;
|
|
3384
3497
|
}
|
|
3385
3498
|
async e2eSync() {
|
|
3386
|
-
const e = this._elmHandle.executionContext(), {outerHTML: t, shadowRootHTML: r} = await e.evaluate(e => ({
|
|
3499
|
+
const e = this._elmHandle.executionContext(), {outerHTML: t, shadowRootHTML: r} = await e.evaluate((e => ({
|
|
3387
3500
|
outerHTML: e.outerHTML,
|
|
3388
3501
|
shadowRootHTML: e.shadowRoot ? e.shadowRoot.innerHTML : null
|
|
3389
|
-
}), this._elmHandle);
|
|
3390
|
-
"string" == typeof r ? (this.shadowRoot =
|
|
3391
|
-
const s =
|
|
3392
|
-
for (this.nodeName = s.nodeName, this.attributes =
|
|
3502
|
+
})), this._elmHandle);
|
|
3503
|
+
"string" == typeof r ? (this.shadowRoot = index_cjs.parseHtmlToFragment(r), this.shadowRoot.host = this) : this.shadowRoot = null;
|
|
3504
|
+
const s = index_cjs.parseHtmlToFragment(t).firstElementChild;
|
|
3505
|
+
for (this.nodeName = s.nodeName, this.attributes = index_cjs.cloneAttributes(s.attributes); this.childNodes.length > 0; ) this.removeChild(this.childNodes[0]);
|
|
3393
3506
|
for (;s.childNodes.length > 0; ) this.appendChild(s.childNodes[0]);
|
|
3394
3507
|
}
|
|
3395
3508
|
_validate() {
|
|
@@ -3434,7 +3547,7 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3434
3547
|
t;
|
|
3435
3548
|
}
|
|
3436
3549
|
async closeOpenPages() {
|
|
3437
|
-
await Promise.all(this.pages.map(e => e.close())), this.pages.length = 0;
|
|
3550
|
+
await Promise.all(this.pages.map((e => e.close()))), this.pages.length = 0;
|
|
3438
3551
|
}
|
|
3439
3552
|
async teardown() {
|
|
3440
3553
|
await super.teardown(), await this.closeOpenPages(), await async function e(t) {
|
|
@@ -3449,10 +3562,10 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3449
3562
|
return class t extends e {
|
|
3450
3563
|
async runTests(e, t, r, s, n, o) {
|
|
3451
3564
|
const i = process.env;
|
|
3452
|
-
if (e = e.filter(e => function t(e, r) {
|
|
3565
|
+
if (e = e.filter((e => function t(e, r) {
|
|
3453
3566
|
const s = (e = e.toLowerCase().replace(/\\/g, "/")).includes(".e2e.") || e.includes("/e2e.");
|
|
3454
3567
|
return !("true" !== r.__RINDO_E2E_TESTS__ || !s) || "true" === r.__RINDO_SPEC_TESTS__ && !s;
|
|
3455
|
-
}(e.path, i)), "true" === i.__RINDO_SCREENSHOT__) {
|
|
3568
|
+
}(e.path, i))), "true" === i.__RINDO_SCREENSHOT__) {
|
|
3456
3569
|
const a = JSON.parse(i.__RINDO_EMULATE_CONFIGS__);
|
|
3457
3570
|
for (let l = 0; l < a.length; l++) setScreenshotEmulateData(a[l], i), await super.runTests(e, t, r, s, n, o);
|
|
3458
3571
|
} else await super.runTests(e, t, r, s, n, o);
|
|
@@ -3462,9 +3575,9 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3462
3575
|
e = function t(e) {
|
|
3463
3576
|
return e.buildEs5 = !1, e.devMode = !0, e.minifyCss = !1, e.minifyJs = !1, e.hashFileNames = !1,
|
|
3464
3577
|
e.validateTypes = !1, e._isTesting = !0, e.buildDist = !0, e.flags = e.flags || {},
|
|
3465
|
-
e.flags.serve = !1, e.flags.open = !1, e.outputTargets.forEach(e => {
|
|
3578
|
+
e.flags.serve = !1, e.flags.open = !1, e.outputTargets.forEach((e => {
|
|
3466
3579
|
"www" === e.type && (e.serviceWorker = null);
|
|
3467
|
-
}), e;
|
|
3580
|
+
})), e.flags.args.includes("--watchAll") && (e.watch = !0), e;
|
|
3468
3581
|
}(e);
|
|
3469
3582
|
const {createCompiler: r} = require("../compiler/rindo.js"), s = await r(e);
|
|
3470
3583
|
let n, o;
|
|
@@ -3476,41 +3589,46 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3476
3589
|
return {
|
|
3477
3590
|
destroy: i,
|
|
3478
3591
|
run: async (t = {}) => {
|
|
3479
|
-
let r, a = !1, l = !1;
|
|
3480
|
-
const
|
|
3592
|
+
let r, a = !1, l = !1, c = null;
|
|
3593
|
+
const u = [];
|
|
3481
3594
|
try {
|
|
3482
3595
|
if (!t.spec && !t.e2e) return e.logger.error("Testing requires either the --spec or --e2e command line flags, or both. For example, to run unit tests, use the command: rindo test --spec"),
|
|
3483
3596
|
!1;
|
|
3484
|
-
if (r = process.env, t.e2e && (
|
|
3485
|
-
r.__RINDO_SPEC_TESTS__ = "true"), e.logger.info(e.logger.magenta(`testing ${
|
|
3597
|
+
if (r = process.env, t.e2e && (u.push("e2e"), r.__RINDO_E2E_TESTS__ = "true"), t.spec && (u.push("spec"),
|
|
3598
|
+
r.__RINDO_SPEC_TESTS__ = "true"), e.logger.info(e.logger.magenta(`testing ${u.join(" and ")} files${e.watch ? " (watch)" : ""}`)),
|
|
3486
3599
|
a = !(!t.e2e || !t.screenshot), a && (r.__RINDO_SCREENSHOT__ = "true", t.updateScreenshot ? e.logger.info(e.logger.magenta("updating master screenshots")) : e.logger.info(e.logger.magenta("comparing against master screenshots"))),
|
|
3487
3600
|
t.e2e) {
|
|
3488
3601
|
let t = null;
|
|
3489
|
-
e.outputTargets.forEach(e => {
|
|
3602
|
+
e.outputTargets.forEach((e => {
|
|
3490
3603
|
e.empty = !1;
|
|
3491
|
-
});
|
|
3604
|
+
}));
|
|
3492
3605
|
const a = !(e.flags && !1 === e.flags.build);
|
|
3493
|
-
a && (
|
|
3606
|
+
a && e.watch && (c = await s.createWatcher()), a && (c ? (t = new Promise((e => {
|
|
3607
|
+
const t = c.on("buildFinish", (r => {
|
|
3608
|
+
t(), e(r);
|
|
3609
|
+
}));
|
|
3610
|
+
})), c.start()) : t = s.build()), e.devServer.openBrowser = !1, e.devServer.gzip = !1,
|
|
3611
|
+
e.devServer.reloadStrategy = null;
|
|
3494
3612
|
const l = await Promise.all([ index_js.start(e.devServer, e.logger), startPuppeteerBrowser(e) ]);
|
|
3495
|
-
if (n = l[0], o = l[1],
|
|
3613
|
+
if (n = l[0], o = l[1], t) {
|
|
3496
3614
|
const r = await t;
|
|
3497
3615
|
if (!r || !e.watch && hasError(r && r.diagnostics)) return await i(), !1;
|
|
3498
3616
|
}
|
|
3499
|
-
n && (r.__RINDO_BROWSER_URL__ = n.browserUrl, e.logger.debug(
|
|
3500
|
-
r.__RINDO_APP_SCRIPT_URL__ = function
|
|
3501
|
-
return getAppUrl(e, t, e.fsNamespace
|
|
3502
|
-
}(e, n.browserUrl), e.logger.debug(
|
|
3617
|
+
n && (r.__RINDO_BROWSER_URL__ = n.browserUrl, e.logger.debug(`e2e dev server url: ${r.__RINDO_BROWSER_URL__}`),
|
|
3618
|
+
r.__RINDO_APP_SCRIPT_URL__ = function d(e, t) {
|
|
3619
|
+
return getAppUrl(e, t, `${e.fsNamespace}.esm.js`);
|
|
3620
|
+
}(e, n.browserUrl), e.logger.debug(`e2e app script url: ${r.__RINDO_APP_SCRIPT_URL__}`),
|
|
3503
3621
|
getAppStyleUrl(e, n.browserUrl) && (r.__RINDO_APP_STYLE_URL__ = getAppStyleUrl(e, n.browserUrl),
|
|
3504
|
-
e.logger.debug(
|
|
3622
|
+
e.logger.debug(`e2e app style url: ${r.__RINDO_APP_STYLE_URL__}`)));
|
|
3505
3623
|
}
|
|
3506
3624
|
} catch (t) {
|
|
3507
3625
|
return e.logger.error(t), !1;
|
|
3508
3626
|
}
|
|
3509
3627
|
try {
|
|
3510
|
-
l = a ? await async function
|
|
3511
|
-
e.logger.debug(
|
|
3512
|
-
const r = new (require(e.testing.screenshotConnector)), s = path$
|
|
3513
|
-
e.logger.debug(
|
|
3628
|
+
l = a ? await async function h(e, t) {
|
|
3629
|
+
e.logger.debug(`screenshot connector: ${e.testing.screenshotConnector}`);
|
|
3630
|
+
const r = new (require(e.testing.screenshotConnector)), s = path$2.join(e.sys.getCompilerExecutingPath(), "..", "..", "screenshot", "pixel-match.js");
|
|
3631
|
+
e.logger.debug(`pixelmatch module: ${s}`);
|
|
3514
3632
|
const n = e.logger.createTimeSpan("screenshot, initBuild started", !0);
|
|
3515
3633
|
await r.initBuild({
|
|
3516
3634
|
buildId: createBuildId(),
|
|
@@ -3519,7 +3637,7 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3519
3637
|
appNamespace: e.namespace,
|
|
3520
3638
|
rootDir: e.rootDir,
|
|
3521
3639
|
cacheDir: e.cacheDir,
|
|
3522
|
-
packageDir: path$
|
|
3640
|
+
packageDir: path$2.join(e.sys.getCompilerExecutingPath(), "..", ".."),
|
|
3523
3641
|
updateMaster: e.flags.updateScreenshot,
|
|
3524
3642
|
logger: e.logger,
|
|
3525
3643
|
allowableMismatchedPixels: e.testing.allowableMismatchedPixels,
|
|
@@ -3531,7 +3649,7 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3531
3649
|
const o = await Promise.all([ await r.getMasterBuild(), await r.getScreenshotCache() ]), i = o[0], a = o[1];
|
|
3532
3650
|
t.__RINDO_SCREENSHOT_BUILD__ = r.toJson(i, a);
|
|
3533
3651
|
const l = e.logger.createTimeSpan("screenshot, tests started", !0), c = await runJest(e, t);
|
|
3534
|
-
l.finish(
|
|
3652
|
+
l.finish(`screenshot, tests finished, passed: ${c}`);
|
|
3535
3653
|
try {
|
|
3536
3654
|
const t = e.logger.createTimeSpan("screenshot, completeTimespan started", !0);
|
|
3537
3655
|
let s = await r.completeBuild(i);
|
|
@@ -3544,14 +3662,14 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3544
3662
|
} catch (t) {
|
|
3545
3663
|
e.logger.error(t);
|
|
3546
3664
|
}
|
|
3547
|
-
e.logger.info(
|
|
3665
|
+
e.logger.info(`screenshots compared: ${s.compare.diffs.length}`), "string" == typeof s.compare.url && e.logger.info(e.logger.magenta(s.compare.url));
|
|
3548
3666
|
}
|
|
3549
3667
|
}
|
|
3550
3668
|
} catch (t) {
|
|
3551
3669
|
e.logger.error(t, t.stack);
|
|
3552
3670
|
}
|
|
3553
3671
|
return c;
|
|
3554
|
-
}(e, r) : await runJest(e, r), e.logger.info("");
|
|
3672
|
+
}(e, r) : await runJest(e, r), e.logger.info(""), c && await c.close();
|
|
3555
3673
|
} catch (t) {
|
|
3556
3674
|
e.logger.error(t);
|
|
3557
3675
|
}
|
|
@@ -3560,20 +3678,20 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3560
3678
|
};
|
|
3561
3679
|
}, exports.jestPreprocessor = jestPreprocessor, exports.jestSetupTestFramework = function jestSetupTestFramework() {
|
|
3562
3680
|
global.Context = {}, global.resourcesUrl = "/build", expect.extend(expectExtend),
|
|
3563
|
-
expect.addSnapshotSerializer(HtmlSerializer),
|
|
3564
|
-
function e(t) {
|
|
3681
|
+
expect.addSnapshotSerializer(HtmlSerializer), index_cjs.setupGlobal(global), function e(t) {
|
|
3565
3682
|
const r = t.window;
|
|
3566
3683
|
"fetch" in r || (r.fetch = function(e) {
|
|
3567
3684
|
return globalMockFetch(e);
|
|
3568
3685
|
}), "fetch" in t || (t.fetch = function(e) {
|
|
3569
3686
|
return globalMockFetch(e);
|
|
3570
3687
|
});
|
|
3571
|
-
}(global), beforeEach(() => {
|
|
3572
|
-
testing.resetPlatform(), resetBuildConditionals(appData.BUILD),
|
|
3573
|
-
|
|
3688
|
+
}(global), beforeEach((() => {
|
|
3689
|
+
testing.resetPlatform(), testing.setErrorHandler(void 0), resetBuildConditionals(appData.BUILD),
|
|
3690
|
+
testing.modeResolutionChain.length = 0;
|
|
3691
|
+
})), afterEach((async () => {
|
|
3574
3692
|
global.__CLOSE_OPEN_PAGES__ && await global.__CLOSE_OPEN_PAGES__(), testing.stopAutoApplyChanges(),
|
|
3575
|
-
|
|
3576
|
-
});
|
|
3693
|
+
index_cjs.teardownGlobal(global), global.Context = {}, global.resourcesUrl = "/build";
|
|
3694
|
+
}));
|
|
3577
3695
|
const t = jasmine.getEnv();
|
|
3578
3696
|
null != t && t.addReporter({
|
|
3579
3697
|
specStarted: e => {
|
|
@@ -3585,16 +3703,20 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3585
3703
|
const e = parseInt(r.__RINDO_DEFAULT_TIMEOUT__, 10);
|
|
3586
3704
|
jest.setTimeout(1.5 * e), jasmine.DEFAULT_TIMEOUT_INTERVAL = e;
|
|
3587
3705
|
}
|
|
3706
|
+
if ("string" == typeof r.__RINDO_ENV__) {
|
|
3707
|
+
const e = JSON.parse(r.__RINDO_ENV__);
|
|
3708
|
+
Object.assign(appData.Env, e);
|
|
3709
|
+
}
|
|
3588
3710
|
}, exports.mockBuildCtx = function mockBuildCtx(e, t) {
|
|
3589
3711
|
return e || (e = mockConfig()), t || (t = mockCompilerCtx(e)), new BuildContext(e, t);
|
|
3590
3712
|
}, exports.mockCompilerCtx = mockCompilerCtx, exports.mockConfig = mockConfig, exports.mockDocument = function mockDocument(e = null) {
|
|
3591
|
-
return new
|
|
3713
|
+
return new index_cjs.MockWindow(e).document;
|
|
3592
3714
|
}, exports.mockFetch = mockFetch, exports.mockLogger = function mockLogger() {
|
|
3593
3715
|
return new TestingLogger;
|
|
3594
3716
|
}, exports.mockRindoSystem = function mockRindoSystem() {
|
|
3595
3717
|
return createTestingSystem();
|
|
3596
3718
|
}, exports.mockWindow = function mockWindow(e = null) {
|
|
3597
|
-
return new
|
|
3719
|
+
return new index_cjs.MockWindow(e);
|
|
3598
3720
|
}, exports.newE2EPage = async function newE2EPage(e = {}) {
|
|
3599
3721
|
if (!global.__NEW_TEST_PAGE__) throw new Error("newE2EPage() is only available from E2E tests, and ran with the --e2e cmd line flag.");
|
|
3600
3722
|
const t = await global.__NEW_TEST_PAGE__(), r = [];
|
|
@@ -3623,12 +3745,12 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3623
3745
|
if ("string" != typeof t.__RINDO_SCREENSHOT_BUILD__) throw new Error("compareScreenshot, missing screen build env var");
|
|
3624
3746
|
const o = JSON.parse(t.__RINDO_EMULATE__), i = JSON.parse(t.__RINDO_SCREENSHOT_BUILD__);
|
|
3625
3747
|
await function a(e) {
|
|
3626
|
-
return new Promise(t => setTimeout(t, e));
|
|
3627
|
-
}(i.timeoutBeforeScreenshot), await e.evaluate(() => new Promise(e => {
|
|
3628
|
-
window.requestAnimationFrame(() => {
|
|
3748
|
+
return new Promise((t => setTimeout(t, e)));
|
|
3749
|
+
}(i.timeoutBeforeScreenshot), await e.evaluate((() => new Promise((e => {
|
|
3750
|
+
window.requestAnimationFrame((() => {
|
|
3629
3751
|
e();
|
|
3630
|
-
});
|
|
3631
|
-
}));
|
|
3752
|
+
}));
|
|
3753
|
+
}))));
|
|
3632
3754
|
const l = function c(e) {
|
|
3633
3755
|
const t = {
|
|
3634
3756
|
type: "png",
|
|
@@ -3661,9 +3783,9 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3661
3783
|
t.close = async e => {
|
|
3662
3784
|
try {
|
|
3663
3785
|
if (Array.isArray(t._e2eElements)) {
|
|
3664
|
-
const e = t._e2eElements.map(async e => {
|
|
3786
|
+
const e = t._e2eElements.map((async e => {
|
|
3665
3787
|
"function" == typeof e.e2eDispose && await e.e2eDispose();
|
|
3666
|
-
});
|
|
3788
|
+
}));
|
|
3667
3789
|
await Promise.all(e);
|
|
3668
3790
|
}
|
|
3669
3791
|
} catch (e) {}
|
|
@@ -3677,7 +3799,7 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3677
3799
|
t.isClosed() || await t._e2eClose(e);
|
|
3678
3800
|
} catch (e) {}
|
|
3679
3801
|
};
|
|
3680
|
-
const n = async () => (s || (s = t.evaluateHandle(() => document)), (await s).asElement());
|
|
3802
|
+
const n = async () => (s || (s = t.evaluateHandle((() => document))), (await s).asElement());
|
|
3681
3803
|
t.find = async e => {
|
|
3682
3804
|
const r = await n();
|
|
3683
3805
|
return find(t, r, e);
|
|
@@ -3690,12 +3812,12 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3690
3812
|
}, t.getDiagnostics = () => r, t.waitForChanges = waitForChanges.bind(null, t),
|
|
3691
3813
|
t.debugger = () => {
|
|
3692
3814
|
if ("true" !== env.__RINDO_E2E_DEVTOOLS__) throw new Error("Set the --devtools flag in order to use E2EPage.debugger()");
|
|
3693
|
-
return t.evaluate(() => new Promise(e => {
|
|
3815
|
+
return t.evaluate((() => new Promise((e => {
|
|
3694
3816
|
e();
|
|
3695
|
-
}));
|
|
3817
|
+
}))));
|
|
3696
3818
|
};
|
|
3697
3819
|
const o = !0 === e.failOnConsoleError, i = !0 === e.failOnNetworkError;
|
|
3698
|
-
t.on("console", e => {
|
|
3820
|
+
t.on("console", (e => {
|
|
3699
3821
|
"error" === e.type() && (r.push({
|
|
3700
3822
|
type: "error",
|
|
3701
3823
|
message: e.text(),
|
|
@@ -3704,19 +3826,19 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3704
3826
|
const t = serializeConsoleMessage(e), r = e.type(), s = "warning" === r ? "warn" : r;
|
|
3705
3827
|
"debug" !== s && ("function" == typeof console[s] ? console[s](t) : console.log(r, t));
|
|
3706
3828
|
}(e);
|
|
3707
|
-
}), t.on("pageerror", e => {
|
|
3829
|
+
})), t.on("pageerror", (e => {
|
|
3708
3830
|
r.push({
|
|
3709
3831
|
type: "pageerror",
|
|
3710
3832
|
message: e.message,
|
|
3711
3833
|
location: e.stack
|
|
3712
3834
|
}), fail(e);
|
|
3713
|
-
}), t.on("requestfailed", e => {
|
|
3835
|
+
})), t.on("requestfailed", (e => {
|
|
3714
3836
|
r.push({
|
|
3715
3837
|
type: "requestfailed",
|
|
3716
3838
|
message: e.failure().errorText,
|
|
3717
3839
|
location: e.url()
|
|
3718
3840
|
}), i ? fail(new Error(e.failure().errorText)) : console.error("requestfailed", e.url());
|
|
3719
|
-
}), "string" == typeof e.html ? await e2eSetContent(t, e.html, {
|
|
3841
|
+
})), "string" == typeof e.html ? await e2eSetContent(t, e.html, {
|
|
3720
3842
|
waitUntil: e.waitUntil
|
|
3721
3843
|
}) : "string" == typeof e.url ? await e2eGoTo(t, e.url, {
|
|
3722
3844
|
waitUntil: e.waitUntil
|
|
@@ -3727,9 +3849,9 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3727
3849
|
return t;
|
|
3728
3850
|
}, exports.newSpecPage = async function newSpecPage(e) {
|
|
3729
3851
|
if (null == e) throw new Error("NewSpecPageOptions required");
|
|
3730
|
-
testing.resetPlatform(), resetBuildConditionals(appData.BUILD), testing.
|
|
3731
|
-
|
|
3732
|
-
|
|
3852
|
+
testing.resetPlatform(), resetBuildConditionals(appData.BUILD), Array.isArray(e.components) && testing.registerComponents(e.components),
|
|
3853
|
+
e.hydrateClientSide && (e.includeAnnotations = !0), e.hydrateServerSide ? (e.includeAnnotations = !0,
|
|
3854
|
+
testing.setSupportsShadowDom(!1)) : (e.includeAnnotations = !!e.includeAnnotations,
|
|
3733
3855
|
!1 === e.supportsShadowDom ? testing.setSupportsShadowDom(!1) : testing.setSupportsShadowDom(!0)),
|
|
3734
3856
|
appData.BUILD.cssAnnotations = e.includeAnnotations;
|
|
3735
3857
|
const t = new Set;
|
|
@@ -3744,7 +3866,7 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3744
3866
|
waitForChanges: testing.flushAll,
|
|
3745
3867
|
flushLoadModule: testing.flushLoadModule,
|
|
3746
3868
|
flushQueue: testing.flushQueue
|
|
3747
|
-
}, n = e.components.map(e => {
|
|
3869
|
+
}, n = e.components.map((e => {
|
|
3748
3870
|
if (null == e.COMPILER_META) throw new Error('Invalid component class: Missing static "COMPILER_META" property.');
|
|
3749
3871
|
t.add(e.COMPILER_META.tagName), e.isProxied = !1, function r(e) {
|
|
3750
3872
|
"function" == typeof e.prototype.__componentWillLoad && (e.prototype.componentWillLoad = e.prototype.__componentWillLoad,
|
|
@@ -3753,95 +3875,100 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3753
3875
|
e.prototype.__componentWillRender = null), "function" == typeof e.prototype.componentWillLoad && (e.prototype.__componentWillLoad = e.prototype.componentWillLoad,
|
|
3754
3876
|
e.prototype.componentWillLoad = function() {
|
|
3755
3877
|
const e = this.__componentWillLoad();
|
|
3756
|
-
return null != e && "function" == typeof e.then ? testing.writeTask(() => e) : testing.writeTask(() => Promise.resolve()),
|
|
3878
|
+
return null != e && "function" == typeof e.then ? testing.writeTask((() => e)) : testing.writeTask((() => Promise.resolve())),
|
|
3757
3879
|
e;
|
|
3758
3880
|
}), "function" == typeof e.prototype.componentWillUpdate && (e.prototype.__componentWillUpdate = e.prototype.componentWillUpdate,
|
|
3759
3881
|
e.prototype.componentWillUpdate = function() {
|
|
3760
3882
|
const e = this.__componentWillUpdate();
|
|
3761
|
-
return null != e && "function" == typeof e.then ? testing.writeTask(() => e) : testing.writeTask(() => Promise.resolve()),
|
|
3883
|
+
return null != e && "function" == typeof e.then ? testing.writeTask((() => e)) : testing.writeTask((() => Promise.resolve())),
|
|
3762
3884
|
e;
|
|
3763
3885
|
}), "function" == typeof e.prototype.componentWillRender && (e.prototype.__componentWillRender = e.prototype.componentWillRender,
|
|
3764
3886
|
e.prototype.componentWillRender = function() {
|
|
3765
3887
|
const e = this.__componentWillRender();
|
|
3766
|
-
return null != e && "function" == typeof e.then ? testing.writeTask(() => e) : testing.writeTask(() => Promise.resolve()),
|
|
3888
|
+
return null != e && "function" == typeof e.then ? testing.writeTask((() => e)) : testing.writeTask((() => Promise.resolve())),
|
|
3767
3889
|
e;
|
|
3768
3890
|
});
|
|
3769
3891
|
}(e);
|
|
3770
3892
|
const s = `${e.COMPILER_META.tagName}.${Math.round(899999 * Math.random()) + 1e5}`, n = e.COMPILER_META.styles;
|
|
3771
3893
|
if (Array.isArray(n)) if (n.length > 1) {
|
|
3772
3894
|
const t = {};
|
|
3773
|
-
n.forEach(e => {
|
|
3895
|
+
n.forEach((e => {
|
|
3774
3896
|
t[e.modeName] = e.styleStr;
|
|
3775
|
-
}), e.style = t;
|
|
3897
|
+
})), e.style = t;
|
|
3776
3898
|
} else 1 === n.length && (e.style = n[0].styleStr);
|
|
3777
|
-
return testing.registerModule(s, e), ((e, t) => [ e, t.map(e =>
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3899
|
+
return testing.registerModule(s, e), ((e, t) => [ e, t.map((e => ((e, t) => {
|
|
3900
|
+
let r = 0;
|
|
3901
|
+
"shadow" === e.encapsulation ? (r |= 1, e.shadowDelegatesFocus && (r |= 16)) : "scoped" === e.encapsulation && (r |= 2),
|
|
3902
|
+
"shadow" !== e.encapsulation && e.htmlTagNames.includes("slot") && (r |= 4), e.hasMode && (r |= 32);
|
|
3903
|
+
const s = formatComponentRuntimeMembers(e, t), n = formatHostListeners(e);
|
|
3904
|
+
return trimFalsy([ r, e.tagName, Object.keys(s).length > 0 ? s : void 0, n.length > 0 ? n : void 0 ]);
|
|
3905
|
+
})(e, !0))) ])(s, [ e.COMPILER_META ]);
|
|
3906
|
+
})), o = (e => {
|
|
3907
|
+
const t = e.some((e => e.htmlTagNames.includes("slot"))), r = e.some((e => "shadow" === e.encapsulation)), s = e.some((e => "shadow" !== e.encapsulation && e.htmlTagNames.includes("slot"))), n = {
|
|
3908
|
+
allRenderFn: e.every((e => e.hasRenderFn)),
|
|
3909
|
+
cmpDidLoad: e.some((e => e.hasComponentDidLoadFn)),
|
|
3910
|
+
cmpShouldUpdate: e.some((e => e.hasComponentShouldUpdateFn)),
|
|
3911
|
+
cmpDidUnload: e.some((e => e.hasComponentDidUnloadFn)),
|
|
3912
|
+
cmpDidUpdate: e.some((e => e.hasComponentDidUpdateFn)),
|
|
3913
|
+
cmpDidRender: e.some((e => e.hasComponentDidRenderFn)),
|
|
3914
|
+
cmpWillLoad: e.some((e => e.hasComponentWillLoadFn)),
|
|
3915
|
+
cmpWillUpdate: e.some((e => e.hasComponentWillUpdateFn)),
|
|
3916
|
+
cmpWillRender: e.some((e => e.hasComponentWillRenderFn)),
|
|
3917
|
+
connectedCallback: e.some((e => e.hasConnectedCallbackFn)),
|
|
3918
|
+
disconnectedCallback: e.some((e => e.hasDisconnectedCallbackFn)),
|
|
3919
|
+
element: e.some((e => e.hasElement)),
|
|
3920
|
+
event: e.some((e => e.hasEvent)),
|
|
3921
|
+
hasRenderFn: e.some((e => e.hasRenderFn)),
|
|
3922
|
+
lifecycle: e.some((e => e.hasLifecycle)),
|
|
3795
3923
|
asyncLoading: !1,
|
|
3796
|
-
hostListener: e.some(e => e.hasListener),
|
|
3797
|
-
hostListenerTargetWindow: e.some(e => e.hasListenerTargetWindow),
|
|
3798
|
-
hostListenerTargetDocument: e.some(e => e.hasListenerTargetDocument),
|
|
3799
|
-
hostListenerTargetBody: e.some(e => e.hasListenerTargetBody),
|
|
3800
|
-
hostListenerTargetParent: e.some(e => e.hasListenerTargetParent),
|
|
3801
|
-
hostListenerTarget: e.some(e => e.hasListenerTarget),
|
|
3802
|
-
member: e.some(e => e.hasMember),
|
|
3803
|
-
method: e.some(e => e.hasMethod),
|
|
3804
|
-
mode: e.some(e => e.hasMode),
|
|
3805
|
-
observeAttribute: e.some(e => e.hasAttribute),
|
|
3806
|
-
prop: e.some(e => e.hasProp),
|
|
3807
|
-
propBoolean: e.some(e => e.hasPropBoolean),
|
|
3808
|
-
propNumber: e.some(e => e.hasPropNumber),
|
|
3809
|
-
propString: e.some(e => e.hasPropString),
|
|
3810
|
-
propMutable: e.some(e => e.hasPropMutable),
|
|
3811
|
-
reflect: e.some(e => e.hasReflect),
|
|
3812
|
-
scoped: e.some(e => "scoped" === e.encapsulation),
|
|
3924
|
+
hostListener: e.some((e => e.hasListener)),
|
|
3925
|
+
hostListenerTargetWindow: e.some((e => e.hasListenerTargetWindow)),
|
|
3926
|
+
hostListenerTargetDocument: e.some((e => e.hasListenerTargetDocument)),
|
|
3927
|
+
hostListenerTargetBody: e.some((e => e.hasListenerTargetBody)),
|
|
3928
|
+
hostListenerTargetParent: e.some((e => e.hasListenerTargetParent)),
|
|
3929
|
+
hostListenerTarget: e.some((e => e.hasListenerTarget)),
|
|
3930
|
+
member: e.some((e => e.hasMember)),
|
|
3931
|
+
method: e.some((e => e.hasMethod)),
|
|
3932
|
+
mode: e.some((e => e.hasMode)),
|
|
3933
|
+
observeAttribute: e.some((e => e.hasAttribute)),
|
|
3934
|
+
prop: e.some((e => e.hasProp)),
|
|
3935
|
+
propBoolean: e.some((e => e.hasPropBoolean)),
|
|
3936
|
+
propNumber: e.some((e => e.hasPropNumber)),
|
|
3937
|
+
propString: e.some((e => e.hasPropString)),
|
|
3938
|
+
propMutable: e.some((e => e.hasPropMutable)),
|
|
3939
|
+
reflect: e.some((e => e.hasReflect)),
|
|
3940
|
+
scoped: e.some((e => "scoped" === e.encapsulation)),
|
|
3813
3941
|
shadowDom: r,
|
|
3814
|
-
shadowDelegatesFocus: r && e.some(e => e.shadowDelegatesFocus),
|
|
3942
|
+
shadowDelegatesFocus: r && e.some((e => e.shadowDelegatesFocus)),
|
|
3815
3943
|
slot: t,
|
|
3816
3944
|
slotRelocation: s,
|
|
3817
|
-
state: e.some(e => e.hasState),
|
|
3818
|
-
style: e.some(e => e.hasStyle),
|
|
3819
|
-
svg: e.some(e => e.htmlTagNames.includes("svg")),
|
|
3820
|
-
updatable: e.some(e => e.isUpdateable),
|
|
3821
|
-
vdomAttribute: e.some(e => e.hasVdomAttribute),
|
|
3822
|
-
vdomXlink: e.some(e => e.hasVdomXlink),
|
|
3823
|
-
vdomClass: e.some(e => e.hasVdomClass),
|
|
3824
|
-
vdomFunctional: e.some(e => e.hasVdomFunctional),
|
|
3825
|
-
vdomKey: e.some(e => e.hasVdomKey),
|
|
3826
|
-
vdomListener: e.some(e => e.hasVdomListener),
|
|
3827
|
-
vdomPropOrAttr: e.some(e => e.hasVdomPropOrAttr),
|
|
3828
|
-
vdomRef: e.some(e => e.hasVdomRef),
|
|
3829
|
-
vdomRender: e.some(e => e.hasVdomRender),
|
|
3830
|
-
vdomStyle: e.some(e => e.hasVdomStyle),
|
|
3831
|
-
vdomText: e.some(e => e.hasVdomText),
|
|
3832
|
-
watchCallback: e.some(e => e.hasWatchCallback),
|
|
3945
|
+
state: e.some((e => e.hasState)),
|
|
3946
|
+
style: e.some((e => e.hasStyle)),
|
|
3947
|
+
svg: e.some((e => e.htmlTagNames.includes("svg"))),
|
|
3948
|
+
updatable: e.some((e => e.isUpdateable)),
|
|
3949
|
+
vdomAttribute: e.some((e => e.hasVdomAttribute)),
|
|
3950
|
+
vdomXlink: e.some((e => e.hasVdomXlink)),
|
|
3951
|
+
vdomClass: e.some((e => e.hasVdomClass)),
|
|
3952
|
+
vdomFunctional: e.some((e => e.hasVdomFunctional)),
|
|
3953
|
+
vdomKey: e.some((e => e.hasVdomKey)),
|
|
3954
|
+
vdomListener: e.some((e => e.hasVdomListener)),
|
|
3955
|
+
vdomPropOrAttr: e.some((e => e.hasVdomPropOrAttr)),
|
|
3956
|
+
vdomRef: e.some((e => e.hasVdomRef)),
|
|
3957
|
+
vdomRender: e.some((e => e.hasVdomRender)),
|
|
3958
|
+
vdomStyle: e.some((e => e.hasVdomStyle)),
|
|
3959
|
+
vdomText: e.some((e => e.hasVdomText)),
|
|
3960
|
+
watchCallback: e.some((e => e.hasWatchCallback)),
|
|
3833
3961
|
taskQueue: !0
|
|
3834
3962
|
};
|
|
3835
3963
|
return n.asyncLoading = n.cmpWillUpdate || n.cmpWillLoad || n.cmpWillRender, n.vdomAttribute = n.vdomAttribute || n.reflect,
|
|
3836
3964
|
n.vdomPropOrAttr = n.vdomPropOrAttr || n.reflect, n;
|
|
3837
|
-
})(e.components.map(e => e.COMPILER_META));
|
|
3838
|
-
if (e.strictBuild ? Object.assign(appData.BUILD, o) : Object.keys(o).forEach(e => {
|
|
3965
|
+
})(e.components.map((e => e.COMPILER_META)));
|
|
3966
|
+
if (e.strictBuild ? Object.assign(appData.BUILD, o) : Object.keys(o).forEach((e => {
|
|
3839
3967
|
!0 === o[e] && (appData.BUILD[e] = !0);
|
|
3840
|
-
}), appData.BUILD.asyncLoading = !0, e.hydrateClientSide ? (appData.BUILD.hydrateClientSide = !0,
|
|
3968
|
+
})), appData.BUILD.asyncLoading = !0, e.hydrateClientSide ? (appData.BUILD.hydrateClientSide = !0,
|
|
3841
3969
|
appData.BUILD.hydrateServerSide = !1) : e.hydrateServerSide && (appData.BUILD.hydrateServerSide = !0,
|
|
3842
3970
|
appData.BUILD.hydrateClientSide = !1), appData.BUILD.cloneNodeFix = !1, appData.BUILD.shadowDomShim = !1,
|
|
3843
|
-
appData.BUILD.safari10 = !1, appData.BUILD.attachStyles = !!e.attachStyles,
|
|
3844
|
-
s.waitForChanges()), "string" == typeof e.url && (s.win.location.href = e.url),
|
|
3971
|
+
appData.BUILD.safari10 = !1, appData.BUILD.attachStyles = !!e.attachStyles, "string" == typeof e.url && (s.win.location.href = e.url),
|
|
3845
3972
|
"string" == typeof e.direction && s.doc.documentElement.setAttribute("dir", e.direction),
|
|
3846
3973
|
"string" == typeof e.language && s.doc.documentElement.setAttribute("lang", e.language),
|
|
3847
3974
|
"string" == typeof e.cookie) try {
|
|
@@ -3870,20 +3997,7 @@ exports.createJestPuppeteerEnvironment = function createJestPuppeteerEnvironment
|
|
|
3870
3997
|
let i = null;
|
|
3871
3998
|
return Object.defineProperty(s, "root", {
|
|
3872
3999
|
get() {
|
|
3873
|
-
if (null == i && (i =
|
|
3874
|
-
if (null != r) {
|
|
3875
|
-
const s = r.children, n = s.length;
|
|
3876
|
-
for (let e = 0; e < n; e++) {
|
|
3877
|
-
const r = s[e];
|
|
3878
|
-
if (t.has(r.nodeName.toLowerCase())) return r;
|
|
3879
|
-
}
|
|
3880
|
-
for (let r = 0; r < n; r++) {
|
|
3881
|
-
const n = e(t, s[r]);
|
|
3882
|
-
if (null != n) return n;
|
|
3883
|
-
}
|
|
3884
|
-
}
|
|
3885
|
-
return null;
|
|
3886
|
-
}(t, s.body)), null != i) return i;
|
|
4000
|
+
if (null == i && (i = findRootComponent(t, s.body)), null != i) return i;
|
|
3887
4001
|
const e = s.body.firstElementChild;
|
|
3888
4002
|
return null != e ? e : null;
|
|
3889
4003
|
}
|