@stencil/core 2.8.1 → 2.11.0-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/index.cjs +239 -209
- package/cli/index.js +239 -209
- package/cli/package.json +1 -1
- package/compiler/lib.dom.d.ts +263 -648
- package/compiler/lib.dom.iterable.d.ts +1 -5
- package/compiler/lib.es2015.core.d.ts +2 -2
- package/compiler/lib.es2015.iterable.d.ts +1 -1
- package/compiler/lib.es2015.symbol.wellknown.d.ts +10 -10
- package/compiler/lib.es2018.asynciterable.d.ts +1 -1
- package/compiler/lib.es2020.bigint.d.ts +1 -1
- package/compiler/lib.es2020.intl.d.ts +6 -7
- package/compiler/lib.es2020.symbol.wellknown.d.ts +1 -1
- package/compiler/lib.es2021.d.ts +24 -0
- package/compiler/lib.es2021.full.d.ts +25 -0
- package/compiler/lib.es2021.promise.d.ts +43 -0
- package/compiler/lib.es2021.string.d.ts +35 -0
- package/compiler/lib.es2021.weakref.d.ts +75 -0
- package/compiler/lib.es5.d.ts +9 -9
- package/compiler/lib.esnext.d.ts +1 -4
- package/compiler/lib.esnext.promise.d.ts +26 -26
- package/compiler/lib.esnext.string.d.ts +18 -18
- package/compiler/lib.esnext.weakref.d.ts +58 -58
- package/compiler/lib.webworker.d.ts +98 -153
- package/compiler/lib.webworker.iterable.d.ts +1 -1
- package/compiler/package.json +1 -1
- package/compiler/stencil.js +1244 -456
- package/compiler/stencil.min.js +2 -2
- package/dependencies.json +6 -1
- package/dev-server/client/index.js +1 -1
- package/dev-server/client/package.json +1 -1
- package/dev-server/connector.html +2 -2
- package/dev-server/index.js +1 -1
- package/dev-server/package.json +1 -1
- package/dev-server/server-process.js +2 -2
- package/internal/app-data/package.json +1 -1
- package/internal/client/css-shim.js +1 -1
- package/internal/client/dom.js +1 -1
- package/internal/client/index.js +119 -102
- package/internal/client/package.json +1 -1
- package/internal/client/patch-browser.js +1 -1
- package/internal/client/patch-esm.js +1 -1
- package/internal/client/shadow-css.js +9 -10
- package/internal/hydrate/index.js +44 -40
- package/internal/hydrate/package.json +1 -1
- package/internal/hydrate/shadow-css.js +59 -62
- package/internal/index.js +1 -0
- package/internal/package.json +1 -1
- package/internal/stencil-private.d.ts +125 -5
- package/internal/stencil-public-compiler.d.ts +15 -2
- package/internal/testing/index.js +54 -47
- package/internal/testing/package.json +1 -1
- package/internal/testing/shadow-css.js +54 -57
- package/mock-doc/index.cjs +4 -1
- package/mock-doc/index.d.ts +7 -6
- package/mock-doc/index.js +4 -1
- package/mock-doc/package.json +1 -1
- package/package.json +16 -6
- package/readme.md +2 -2
- package/screenshot/index.js +1 -1
- package/screenshot/package.json +1 -1
- package/sys/node/index.js +4435 -425
- package/sys/node/package.json +1 -1
- package/sys/node/worker.js +1 -1
- package/testing/index.js +23 -18
- package/testing/mocks.d.ts +1 -5
- package/testing/package.json +1 -1
- package/testing/testing-sys.d.ts +6 -1
- package/bin/cli.ts +0 -20
- package/screenshot/index.js.map +0 -1
- package/sys/deno/index.js +0 -1791
- package/sys/deno/node-compat.js +0 -2654
- package/sys/deno/worker.js +0 -44
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
const _parenSuffix = ")(?:\\(((?:\\([^)(]*\\)|[^)(]*)+?)\\))?([^,{]*)", _cssColonHostRe = new RegExp("(-shadowcsshost" + _parenSuffix, "gim"), _cssColonHostContextRe = new RegExp("(-shadowcsscontext" + _parenSuffix, "gim"), _cssColonSlottedRe = new RegExp("(-shadowcssslotted" + _parenSuffix, "gim"), _polyfillHostNoCombinatorRe = /-shadowcsshost-no-combinator([^\s]*)/, _shadowDOMSelectorsRe = [ /::shadow/g, /::content/g ], _polyfillHostRe = /-shadowcsshost/gim, _colonHostRe = /:host/gim, _colonSlottedRe = /::slotted/gim, _colonHostContextRe = /:host-context/gim, _commentRe = /\/\*\s*[\s\S]*?\*\//g, _commentWithHashRe = /\/\*\s*#\s*source(Mapping)?URL=[\s\S]+?\*\//g, _ruleRe = /(\s*)([^;\{\}]+?)(\s*)((?:{%BLOCK%}?\s*;?)|(?:\s*;))/g, _curlyRe = /([{}])/g, processRules = (e, t) => {
|
|
2
|
-
const
|
|
3
|
-
let
|
|
4
|
-
return
|
|
1
|
+
const _parenSuffix = ")(?:\\(((?:\\([^)(]*\\)|[^)(]*)+?)\\))?([^,{]*)", _cssColonHostRe = new RegExp("(-shadowcsshost" + _parenSuffix, "gim"), _cssColonHostContextRe = new RegExp("(-shadowcsscontext" + _parenSuffix, "gim"), _cssColonSlottedRe = new RegExp("(-shadowcssslotted" + _parenSuffix, "gim"), _polyfillHostNoCombinatorRe = /-shadowcsshost-no-combinator([^\s]*)/, _shadowDOMSelectorsRe = [ /::shadow/g, /::content/g ], _polyfillHostRe = /-shadowcsshost/gim, _colonHostRe = /:host/gim, _colonSlottedRe = /::slotted/gim, _colonHostContextRe = /:host-context/gim, _commentRe = /\/\*\s*[\s\S]*?\*\//g, _commentWithHashRe = /\/\*\s*#\s*source(Mapping)?URL=[\s\S]+?\*\//g, _ruleRe = /(\s*)([^;\{\}]+?)(\s*)((?:{%BLOCK%}?\s*;?)|(?:\s*;))/g, _curlyRe = /([{}])/g, _selectorPartsRe = /(^.*?[^\\])??((:+)(.*)|$)/, processRules = (e, t) => {
|
|
2
|
+
const o = escapeBlocks(e);
|
|
3
|
+
let s = 0;
|
|
4
|
+
return o.escapedString.replace(_ruleRe, ((...e) => {
|
|
5
5
|
const c = e[2];
|
|
6
6
|
let r = "", n = e[4], l = "";
|
|
7
|
-
n && n.startsWith("{%BLOCK%") && (r =
|
|
7
|
+
n && n.startsWith("{%BLOCK%") && (r = o.blocks[s++], n = n.substring("%BLOCK%".length + 1),
|
|
8
8
|
l = "{");
|
|
9
9
|
const a = t({
|
|
10
10
|
selector: c,
|
|
@@ -13,111 +13,108 @@ const _parenSuffix = ")(?:\\(((?:\\([^)(]*\\)|[^)(]*)+?)\\))?([^,{]*)", _cssColo
|
|
|
13
13
|
return `${e[1]}${a.selector}${e[3]}${l}${a.content}${n}`;
|
|
14
14
|
}));
|
|
15
15
|
}, escapeBlocks = e => {
|
|
16
|
-
const t = e.split(_curlyRe),
|
|
16
|
+
const t = e.split(_curlyRe), o = [], s = [];
|
|
17
17
|
let c = 0, r = [];
|
|
18
18
|
for (let e = 0; e < t.length; e++) {
|
|
19
19
|
const n = t[e];
|
|
20
|
-
"}" === n && c--, c > 0 ? r.push(n) : (r.length > 0 && (
|
|
21
|
-
r = []),
|
|
20
|
+
"}" === n && c--, c > 0 ? r.push(n) : (r.length > 0 && (s.push(r.join("")), o.push("%BLOCK%"),
|
|
21
|
+
r = []), o.push(n)), "{" === n && c++;
|
|
22
22
|
}
|
|
23
|
-
return r.length > 0 && (
|
|
24
|
-
escapedString:
|
|
25
|
-
blocks:
|
|
23
|
+
return r.length > 0 && (s.push(r.join("")), o.push("%BLOCK%")), {
|
|
24
|
+
escapedString: o.join(""),
|
|
25
|
+
blocks: s
|
|
26
26
|
};
|
|
27
|
-
}, convertColonRule = (e, t,
|
|
27
|
+
}, convertColonRule = (e, t, o) => e.replace(t, ((...e) => {
|
|
28
28
|
if (e[2]) {
|
|
29
|
-
const t = e[2].split(","),
|
|
29
|
+
const t = e[2].split(","), s = [];
|
|
30
30
|
for (let c = 0; c < t.length; c++) {
|
|
31
31
|
const r = t[c].trim();
|
|
32
32
|
if (!r) break;
|
|
33
|
-
|
|
33
|
+
s.push(o("-shadowcsshost-no-combinator", r, e[3]));
|
|
34
34
|
}
|
|
35
|
-
return
|
|
35
|
+
return s.join(",");
|
|
36
36
|
}
|
|
37
37
|
return "-shadowcsshost-no-combinator" + e[3];
|
|
38
|
-
})), colonHostPartReplacer = (e, t,
|
|
38
|
+
})), colonHostPartReplacer = (e, t, o) => e + t.replace("-shadowcsshost", "") + o, colonHostContextPartReplacer = (e, t, o) => t.indexOf("-shadowcsshost") > -1 ? colonHostPartReplacer(e, t, o) : e + t + o + ", " + t + " " + e + o, injectScopingSelector = (e, t) => e.replace(_selectorPartsRe, ((e, o = "", s, c = "", r = "") => o + t + c + r)), scopeSelectors = (e, t, o, s, c) => processRules(e, (e => {
|
|
39
39
|
let c = e.selector, r = e.content;
|
|
40
|
-
return "@" !== e.selector[0] ? c = ((e, t,
|
|
41
|
-
new RegExp("^(" + e + ")([>\\s~+[.,{:][\\s\\S]*)?$", "m")))(t).test(e))(e, t) ? ((e, t,
|
|
42
|
-
const
|
|
40
|
+
return "@" !== e.selector[0] ? c = ((e, t, o, s) => e.split(",").map((e => s && e.indexOf("." + s) > -1 ? e.trim() : ((e, t) => !(e => (e = e.replace(/\[/g, "\\[").replace(/\]/g, "\\]"),
|
|
41
|
+
new RegExp("^(" + e + ")([>\\s~+[.,{:][\\s\\S]*)?$", "m")))(t).test(e))(e, t) ? ((e, t, o) => {
|
|
42
|
+
const s = "." + (t = t.replace(/\[is=([^\]]*)\]/g, ((e, ...t) => t[0]))), c = e => {
|
|
43
43
|
let c = e.trim();
|
|
44
44
|
if (!c) return "";
|
|
45
|
-
if (e.indexOf("-shadowcsshost-no-combinator") > -1) c = ((e, t,
|
|
45
|
+
if (e.indexOf("-shadowcsshost-no-combinator") > -1) c = ((e, t, o) => {
|
|
46
46
|
if (_polyfillHostRe.lastIndex = 0, _polyfillHostRe.test(e)) {
|
|
47
|
-
const t = `.${
|
|
48
|
-
return e.replace(_polyfillHostNoCombinatorRe, ((e,
|
|
47
|
+
const t = `.${o}`;
|
|
48
|
+
return e.replace(_polyfillHostNoCombinatorRe, ((e, o) => injectScopingSelector(o, t))).replace(_polyfillHostRe, t + " ");
|
|
49
49
|
}
|
|
50
50
|
return t + " " + e;
|
|
51
|
-
})(e, t,
|
|
51
|
+
})(e, t, o); else {
|
|
52
52
|
const t = e.replace(_polyfillHostRe, "");
|
|
53
|
-
|
|
54
|
-
const e = t.match(/([^:]*)(:*)(.*)/);
|
|
55
|
-
e && (c = e[1] + o + e[2] + e[3]);
|
|
56
|
-
}
|
|
53
|
+
t.length > 0 && (c = injectScopingSelector(t, s));
|
|
57
54
|
}
|
|
58
55
|
return c;
|
|
59
56
|
}, r = (e => {
|
|
60
57
|
const t = [];
|
|
61
|
-
let
|
|
62
|
-
return
|
|
63
|
-
const c = `__ph-${
|
|
64
|
-
return t.push(
|
|
65
|
-
}))).replace(/(:nth-[-\w]+)(\([^)]+\))/g, ((e,
|
|
66
|
-
const r = `__ph-${
|
|
67
|
-
return t.push(c),
|
|
58
|
+
let o, s = 0;
|
|
59
|
+
return o = (e = e.replace(/(\[[^\]]*\])/g, ((e, o) => {
|
|
60
|
+
const c = `__ph-${s}__`;
|
|
61
|
+
return t.push(o), s++, c;
|
|
62
|
+
}))).replace(/(:nth-[-\w]+)(\([^)]+\))/g, ((e, o, c) => {
|
|
63
|
+
const r = `__ph-${s}__`;
|
|
64
|
+
return t.push(c), s++, o + r;
|
|
68
65
|
})), {
|
|
69
|
-
content:
|
|
66
|
+
content: o,
|
|
70
67
|
placeholders: t
|
|
71
68
|
};
|
|
72
69
|
})(e);
|
|
73
70
|
let n, l = "", a = 0;
|
|
74
|
-
const
|
|
75
|
-
let
|
|
76
|
-
for (;null !== (n =
|
|
77
|
-
const t = n[1],
|
|
78
|
-
|
|
79
|
-
a =
|
|
71
|
+
const i = /( |>|\+|~(?!=))\s*/g;
|
|
72
|
+
let p = !((e = r.content).indexOf("-shadowcsshost-no-combinator") > -1);
|
|
73
|
+
for (;null !== (n = i.exec(e)); ) {
|
|
74
|
+
const t = n[1], o = e.slice(a, n.index).trim();
|
|
75
|
+
p = p || o.indexOf("-shadowcsshost-no-combinator") > -1, l += `${p ? c(o) : o} ${t} `,
|
|
76
|
+
a = i.lastIndex;
|
|
80
77
|
}
|
|
81
78
|
const h = e.substring(a);
|
|
82
|
-
return
|
|
79
|
+
return p = p || h.indexOf("-shadowcsshost-no-combinator") > -1, l += p ? c(h) : h,
|
|
83
80
|
u = r.placeholders, l.replace(/__ph-(\d+)__/g, ((e, t) => u[+t]));
|
|
84
81
|
var u;
|
|
85
|
-
})(e, t,
|
|
82
|
+
})(e, t, o).trim() : e.trim())).join(", "))(e.selector, t, o, s) : (e.selector.startsWith("@media") || e.selector.startsWith("@supports") || e.selector.startsWith("@page") || e.selector.startsWith("@document")) && (r = scopeSelectors(e.content, t, o, s)),
|
|
86
83
|
{
|
|
87
84
|
selector: c.replace(/\s{2,}/g, " ").trim(),
|
|
88
85
|
content: r
|
|
89
86
|
};
|
|
90
|
-
})), scopeCss = (e, t,
|
|
91
|
-
const
|
|
87
|
+
})), scopeCss = (e, t, o) => {
|
|
88
|
+
const s = t + "-h", c = t + "-s", r = e.match(_commentWithHashRe) || [];
|
|
92
89
|
e = e.replace(_commentRe, "");
|
|
93
90
|
const n = [];
|
|
94
|
-
if (
|
|
91
|
+
if (o) {
|
|
95
92
|
const t = e => {
|
|
96
|
-
const t = `/*!@___${n.length}___*/`,
|
|
93
|
+
const t = `/*!@___${n.length}___*/`, o = `/*!@${e.selector}*/`;
|
|
97
94
|
return n.push({
|
|
98
95
|
placeholder: t,
|
|
99
|
-
comment:
|
|
96
|
+
comment: o
|
|
100
97
|
}), e.selector = t + e.selector, e;
|
|
101
98
|
};
|
|
102
99
|
e = processRules(e, (e => "@" !== e.selector[0] ? t(e) : e.selector.startsWith("@media") || e.selector.startsWith("@supports") || e.selector.startsWith("@page") || e.selector.startsWith("@document") ? (e.content = processRules(e.content, t),
|
|
103
100
|
e) : e));
|
|
104
101
|
}
|
|
105
|
-
const l = ((e, t,
|
|
102
|
+
const l = ((e, t, o, s, c) => {
|
|
106
103
|
const r = ((e, t) => {
|
|
107
|
-
const
|
|
104
|
+
const o = "." + t + " > ", s = [];
|
|
108
105
|
return e = e.replace(_cssColonSlottedRe, ((...e) => {
|
|
109
106
|
if (e[2]) {
|
|
110
|
-
const t = e[2].trim(), c = e[3], r =
|
|
107
|
+
const t = e[2].trim(), c = e[3], r = o + t + c;
|
|
111
108
|
let n = "";
|
|
112
109
|
for (let t = e[4] - 1; t >= 0; t--) {
|
|
113
|
-
const
|
|
114
|
-
if ("}" ===
|
|
115
|
-
n =
|
|
110
|
+
const o = e[5][t];
|
|
111
|
+
if ("}" === o || "," === o) break;
|
|
112
|
+
n = o + n;
|
|
116
113
|
}
|
|
117
114
|
const l = n + r, a = `${n.trimRight()}${r.trim()}`;
|
|
118
115
|
if (l.trim() !== a.trim()) {
|
|
119
116
|
const e = `${a}, ${l}`;
|
|
120
|
-
|
|
117
|
+
s.push({
|
|
121
118
|
orgSelector: l,
|
|
122
119
|
updatedSelector: e
|
|
123
120
|
});
|
|
@@ -126,18 +123,18 @@ const _parenSuffix = ")(?:\\(((?:\\([^)(]*\\)|[^)(]*)+?)\\))?([^,{]*)", _cssColo
|
|
|
126
123
|
}
|
|
127
124
|
return "-shadowcsshost-no-combinator" + e[3];
|
|
128
125
|
})), {
|
|
129
|
-
selectors:
|
|
126
|
+
selectors: s,
|
|
130
127
|
cssText: e
|
|
131
128
|
};
|
|
132
|
-
})(e = (e => convertColonRule(e, _cssColonHostContextRe, colonHostContextPartReplacer))(e = (e => convertColonRule(e, _cssColonHostRe, colonHostPartReplacer))(e = e.replace(_colonHostContextRe, "-shadowcsscontext").replace(_colonHostRe, "-shadowcsshost").replace(_colonSlottedRe, "-shadowcssslotted"))),
|
|
129
|
+
})(e = (e => convertColonRule(e, _cssColonHostContextRe, colonHostContextPartReplacer))(e = (e => convertColonRule(e, _cssColonHostRe, colonHostPartReplacer))(e = e.replace(_colonHostContextRe, "-shadowcsscontext").replace(_colonHostRe, "-shadowcsshost").replace(_colonSlottedRe, "-shadowcssslotted"))), s);
|
|
133
130
|
return e = (e => _shadowDOMSelectorsRe.reduce(((e, t) => e.replace(t, " ")), e))(e = r.cssText),
|
|
134
|
-
t && (e = scopeSelectors(e, t,
|
|
135
|
-
cssText: (e = (e = e.replace(/-shadowcsshost-no-combinator/g, `.${
|
|
131
|
+
t && (e = scopeSelectors(e, t, o, s)), {
|
|
132
|
+
cssText: (e = (e = e.replace(/-shadowcsshost-no-combinator/g, `.${o}`)).replace(/>\s*\*\s+([^{, ]+)/gm, " $1 ")).trim(),
|
|
136
133
|
slottedSelectors: r.selectors
|
|
137
134
|
};
|
|
138
|
-
})(e, t,
|
|
139
|
-
return e = [ l.cssText, ...r ].join("\n"),
|
|
140
|
-
e = e.replace(t,
|
|
135
|
+
})(e, t, s, c);
|
|
136
|
+
return e = [ l.cssText, ...r ].join("\n"), o && n.forEach((({placeholder: t, comment: o}) => {
|
|
137
|
+
e = e.replace(t, o);
|
|
141
138
|
})), l.slottedSelectors.forEach((t => {
|
|
142
139
|
e = e.replace(t.orgSelector, t.updatedSelector);
|
|
143
140
|
})), e;
|
package/internal/index.js
CHANGED
package/internal/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stencil/core/internal",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.11.0-0",
|
|
4
4
|
"description": "Stencil internals only to be imported by the Stencil Compiler. Breaking changes can and will happen at any time.",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"types": "./index.d.ts",
|
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { BuildResultsComponentGraph } from '.';
|
|
2
|
+
import type { BuildEvents, BuildLog, BuildOutput, CompilerBuildResults, CompilerBuildStart, CompilerFsStats, CompilerRequestResponse, CompilerSystem, Config, CopyResults, DevServerConfig, DevServerEditor, Diagnostic, FsWriteOptions, Logger, LoggerTimeSpan, OptimizeCssInput, OptimizeCssOutput, OutputTargetWww, PageReloadStrategy, PrerenderConfig, StyleDoc, LoggerLineUpdater, TaskCommand } from './stencil-public-compiler';
|
|
2
3
|
import type { ComponentInterface, ListenOptions, ListenTargetOptions, VNode, VNodeData } from './stencil-public-runtime';
|
|
4
|
+
export interface SourceMap {
|
|
5
|
+
file: string;
|
|
6
|
+
mappings: string;
|
|
7
|
+
names: string[];
|
|
8
|
+
sourceRoot?: string;
|
|
9
|
+
sources: string[];
|
|
10
|
+
sourcesContent?: string[];
|
|
11
|
+
version: number;
|
|
12
|
+
}
|
|
3
13
|
export interface PrintLine {
|
|
4
14
|
lineIndex: number;
|
|
5
15
|
lineNumber: number;
|
|
@@ -129,13 +139,25 @@ export interface RollupResultModule {
|
|
|
129
139
|
export interface RollupResults {
|
|
130
140
|
modules: RollupResultModule[];
|
|
131
141
|
}
|
|
142
|
+
export interface UpdatedLazyBuildCtx {
|
|
143
|
+
name: 'esm-browser' | 'esm' | 'cjs' | 'system';
|
|
144
|
+
buildCtx: BuildCtx;
|
|
145
|
+
}
|
|
132
146
|
export interface BuildCtx {
|
|
133
147
|
buildId: number;
|
|
134
148
|
buildResults: CompilerBuildResults;
|
|
149
|
+
buildStats?: CompilerBuildStats | {
|
|
150
|
+
diagnostics: Diagnostic[];
|
|
151
|
+
};
|
|
135
152
|
buildMessages: string[];
|
|
136
153
|
bundleBuildCount: number;
|
|
137
154
|
collections: Collection[];
|
|
138
155
|
compilerCtx: CompilerCtx;
|
|
156
|
+
esmBrowserComponentBundle: ReadonlyArray<BundleModule>;
|
|
157
|
+
esmComponentBundle: ReadonlyArray<BundleModule>;
|
|
158
|
+
es5ComponentBundle: ReadonlyArray<BundleModule>;
|
|
159
|
+
systemComponentBundle: ReadonlyArray<BundleModule>;
|
|
160
|
+
commonJsComponentBundle: ReadonlyArray<BundleModule>;
|
|
139
161
|
components: ComponentCompilerMeta[];
|
|
140
162
|
componentGraph: Map<string, string[]>;
|
|
141
163
|
config: Config;
|
|
@@ -191,7 +213,8 @@ export interface BuildStyleUpdate {
|
|
|
191
213
|
}
|
|
192
214
|
export declare type BuildTask = any;
|
|
193
215
|
export declare type BuildStatus = 'pending' | 'error' | 'disabled' | 'default';
|
|
194
|
-
export interface
|
|
216
|
+
export interface CompilerBuildStats {
|
|
217
|
+
timestamp: string;
|
|
195
218
|
compiler: {
|
|
196
219
|
name: string;
|
|
197
220
|
version: string;
|
|
@@ -202,24 +225,41 @@ export interface BuildStats {
|
|
|
202
225
|
components: number;
|
|
203
226
|
entries: number;
|
|
204
227
|
bundles: number;
|
|
228
|
+
outputs: any;
|
|
205
229
|
};
|
|
206
230
|
options: {
|
|
207
231
|
minifyJs: boolean;
|
|
208
232
|
minifyCss: boolean;
|
|
209
233
|
hashFileNames: boolean;
|
|
210
234
|
hashedFileNameLength: number;
|
|
211
|
-
buildEs5: boolean;
|
|
235
|
+
buildEs5: boolean | 'prod';
|
|
236
|
+
};
|
|
237
|
+
formats: {
|
|
238
|
+
esmBrowser: ReadonlyArray<CompilerBuildStatBundle>;
|
|
239
|
+
esm: ReadonlyArray<CompilerBuildStatBundle>;
|
|
240
|
+
es5: ReadonlyArray<CompilerBuildStatBundle>;
|
|
241
|
+
system: ReadonlyArray<CompilerBuildStatBundle>;
|
|
242
|
+
commonjs: ReadonlyArray<CompilerBuildStatBundle>;
|
|
212
243
|
};
|
|
213
244
|
components: BuildComponent[];
|
|
214
|
-
entries:
|
|
245
|
+
entries: EntryModule[];
|
|
215
246
|
rollupResults: RollupResults;
|
|
216
|
-
sourceGraph
|
|
247
|
+
sourceGraph?: BuildSourceGraph;
|
|
248
|
+
componentGraph: BuildResultsComponentGraph;
|
|
217
249
|
collections: {
|
|
218
250
|
name: string;
|
|
219
251
|
source: string;
|
|
220
252
|
tags: string[];
|
|
221
253
|
}[];
|
|
222
254
|
}
|
|
255
|
+
export interface CompilerBuildStatBundle {
|
|
256
|
+
key: string;
|
|
257
|
+
components: string[];
|
|
258
|
+
bundleId: string;
|
|
259
|
+
fileName: string;
|
|
260
|
+
imports: string[];
|
|
261
|
+
originalByteSize: number;
|
|
262
|
+
}
|
|
223
263
|
export interface BuildEntry {
|
|
224
264
|
entryId: string;
|
|
225
265
|
components: BuildComponent[];
|
|
@@ -267,6 +307,12 @@ export declare type SourceTarget = 'es5' | 'es2017' | 'latest';
|
|
|
267
307
|
export interface BundleEntryInputs {
|
|
268
308
|
[entryKey: string]: string;
|
|
269
309
|
}
|
|
310
|
+
/**
|
|
311
|
+
* A note regarding Rollup types:
|
|
312
|
+
* As of this writing, there is no great way to import external types for packages that are directly embedded in the
|
|
313
|
+
* Stencil source. As a result, some types are duplicated here for Rollup that will be used within the codebase.
|
|
314
|
+
* Updates to rollup may require these typings to be updated.
|
|
315
|
+
*/
|
|
270
316
|
export declare type RollupResult = RollupChunkResult | RollupAssetResult;
|
|
271
317
|
export interface RollupAssetResult {
|
|
272
318
|
type: 'asset';
|
|
@@ -285,7 +331,26 @@ export interface RollupChunkResult {
|
|
|
285
331
|
isBrowserLoader: boolean;
|
|
286
332
|
imports: string[];
|
|
287
333
|
moduleFormat: ModuleFormat;
|
|
334
|
+
map?: RollupSourceMap;
|
|
335
|
+
}
|
|
336
|
+
export interface RollupSourceMap {
|
|
337
|
+
file: string;
|
|
338
|
+
mappings: string;
|
|
339
|
+
names: string[];
|
|
340
|
+
sources: string[];
|
|
341
|
+
sourcesContent: string[];
|
|
342
|
+
version: number;
|
|
343
|
+
toString(): string;
|
|
344
|
+
toUrl(): string;
|
|
288
345
|
}
|
|
346
|
+
/**
|
|
347
|
+
* Result of Stencil compressing, mangling, and otherwise 'minifying' JavaScript
|
|
348
|
+
*/
|
|
349
|
+
export declare type OptimizeJsResult = {
|
|
350
|
+
output: string;
|
|
351
|
+
diagnostics: Diagnostic[];
|
|
352
|
+
sourceMap?: SourceMap;
|
|
353
|
+
};
|
|
289
354
|
export interface BundleModule {
|
|
290
355
|
entryKey: string;
|
|
291
356
|
rollupResult: RollupChunkResult;
|
|
@@ -588,6 +653,7 @@ export interface ComponentCompilerMeta extends ComponentCompilerFeatures {
|
|
|
588
653
|
isCollectionDependency: boolean;
|
|
589
654
|
docs: CompilerJsDoc;
|
|
590
655
|
jsFilePath: string;
|
|
656
|
+
sourceMapPath: string;
|
|
591
657
|
listeners: ComponentCompilerListener[];
|
|
592
658
|
events: ComponentCompilerEvent[];
|
|
593
659
|
methods: ComponentCompilerMethod[];
|
|
@@ -1176,6 +1242,8 @@ export interface Module {
|
|
|
1176
1242
|
sourceFilePath: string;
|
|
1177
1243
|
staticSourceFile: any;
|
|
1178
1244
|
staticSourceFileText: string;
|
|
1245
|
+
sourceMapPath: string;
|
|
1246
|
+
sourceMapFileText: string;
|
|
1179
1247
|
hasVdomAttribute: boolean;
|
|
1180
1248
|
hasVdomClass: boolean;
|
|
1181
1249
|
hasVdomFunctional: boolean;
|
|
@@ -2071,6 +2139,7 @@ export interface CompilerWorkerContext {
|
|
|
2071
2139
|
prepareModule(input: string, minifyOpts: any, transpile: boolean, inlineHelpers: boolean): Promise<{
|
|
2072
2140
|
output: string;
|
|
2073
2141
|
diagnostics: Diagnostic[];
|
|
2142
|
+
sourceMap?: SourceMap;
|
|
2074
2143
|
}>;
|
|
2075
2144
|
prerenderWorker(prerenderRequest: PrerenderUrlRequest): Promise<PrerenderUrlResults>;
|
|
2076
2145
|
transformCssToEsm(input: TransformCssToEsmInput): Promise<TransformCssToEsmOutput>;
|
|
@@ -2131,3 +2200,54 @@ export interface ValidateTypesResults {
|
|
|
2131
2200
|
dirPaths: string[];
|
|
2132
2201
|
filePaths: string[];
|
|
2133
2202
|
}
|
|
2203
|
+
export interface TerminalInfo {
|
|
2204
|
+
/**
|
|
2205
|
+
* Whether this is in CI or not.
|
|
2206
|
+
*/
|
|
2207
|
+
readonly ci: boolean;
|
|
2208
|
+
/**
|
|
2209
|
+
* Whether the terminal is an interactive TTY or not.
|
|
2210
|
+
*/
|
|
2211
|
+
readonly tty: boolean;
|
|
2212
|
+
}
|
|
2213
|
+
/**
|
|
2214
|
+
* The task to run in order to collect the duration data point.
|
|
2215
|
+
*/
|
|
2216
|
+
export declare type TelemetryCallback = (...args: any[]) => void | Promise<void>;
|
|
2217
|
+
/**
|
|
2218
|
+
* The model for the data that's tracked.
|
|
2219
|
+
*/
|
|
2220
|
+
export interface TrackableData {
|
|
2221
|
+
yarn: boolean;
|
|
2222
|
+
component_count?: number;
|
|
2223
|
+
arguments: string[];
|
|
2224
|
+
targets: string[];
|
|
2225
|
+
task: TaskCommand;
|
|
2226
|
+
duration_ms: number;
|
|
2227
|
+
packages: string[];
|
|
2228
|
+
packages_no_versions?: string[];
|
|
2229
|
+
os_name: string;
|
|
2230
|
+
os_version: string;
|
|
2231
|
+
cpu_model: string;
|
|
2232
|
+
typescript: string;
|
|
2233
|
+
rollup: string;
|
|
2234
|
+
system: string;
|
|
2235
|
+
system_major?: string;
|
|
2236
|
+
build: string;
|
|
2237
|
+
stencil: string;
|
|
2238
|
+
has_app_pwa_config: boolean;
|
|
2239
|
+
}
|
|
2240
|
+
/**
|
|
2241
|
+
* Used as the object sent to the server. Value is the data tracked.
|
|
2242
|
+
*/
|
|
2243
|
+
export interface Metric {
|
|
2244
|
+
name: string;
|
|
2245
|
+
timestamp: string;
|
|
2246
|
+
source: 'stencil_cli';
|
|
2247
|
+
value: TrackableData;
|
|
2248
|
+
session_id: string;
|
|
2249
|
+
}
|
|
2250
|
+
export interface TelemetryConfig {
|
|
2251
|
+
'telemetry.stencil'?: boolean;
|
|
2252
|
+
'tokens.telemetry'?: string;
|
|
2253
|
+
}
|
|
@@ -82,6 +82,10 @@ export interface StencilConfig {
|
|
|
82
82
|
* However, either can be added using the plugin array.
|
|
83
83
|
*/
|
|
84
84
|
plugins?: any[];
|
|
85
|
+
/**
|
|
86
|
+
* Generate js source map files for all bundles
|
|
87
|
+
*/
|
|
88
|
+
sourceMap?: boolean;
|
|
85
89
|
/**
|
|
86
90
|
* The srcDir config specifies the directory which should contain the source typescript files
|
|
87
91
|
* for each component. The standard for Stencil apps is to use src, which is the default.
|
|
@@ -307,7 +311,6 @@ export interface Config extends StencilConfig {
|
|
|
307
311
|
logLevel?: LogLevel;
|
|
308
312
|
rootDir?: string;
|
|
309
313
|
packageJsonFilePath?: string;
|
|
310
|
-
sourceMap?: boolean;
|
|
311
314
|
suppressLogs?: boolean;
|
|
312
315
|
profile?: boolean;
|
|
313
316
|
tsCompilerOptions?: any;
|
|
@@ -823,7 +826,7 @@ export interface SitemapXmpResults {
|
|
|
823
826
|
* of the actual platform it's being ran ontop of.
|
|
824
827
|
*/
|
|
825
828
|
export interface CompilerSystem {
|
|
826
|
-
name: '
|
|
829
|
+
name: 'node' | 'in-memory';
|
|
827
830
|
version: string;
|
|
828
831
|
events?: BuildEvents;
|
|
829
832
|
details?: SystemDetails;
|
|
@@ -960,6 +963,10 @@ export interface CompilerSystem {
|
|
|
960
963
|
*/
|
|
961
964
|
normalizePath(p: string): string;
|
|
962
965
|
onProcessInterrupt?(cb: () => void): void;
|
|
966
|
+
parseYarnLockFile?: (content: string) => {
|
|
967
|
+
type: 'success' | 'merge' | 'conflict';
|
|
968
|
+
object: any;
|
|
969
|
+
};
|
|
963
970
|
platformPath: PlatformPath;
|
|
964
971
|
/**
|
|
965
972
|
* All return paths are full normalized paths, not just the basenames. Always returns an array, does not throw.
|
|
@@ -1750,6 +1757,12 @@ export interface OutputTargetDistCustomElements extends OutputTargetBaseNext {
|
|
|
1750
1757
|
inlineDynamicImports?: boolean;
|
|
1751
1758
|
includeGlobalScripts?: boolean;
|
|
1752
1759
|
minify?: boolean;
|
|
1760
|
+
/**
|
|
1761
|
+
* Enables the auto-definition of a component and its children (recursively) in the custom elements registry. This
|
|
1762
|
+
* functionality allows consumers to bypass the explicit call to define a component, its children, its children's
|
|
1763
|
+
* children, etc. Users of this flag should be aware that enabling this functionality may increase bundle size.
|
|
1764
|
+
*/
|
|
1765
|
+
autoDefineCustomElements?: boolean;
|
|
1753
1766
|
}
|
|
1754
1767
|
export interface OutputTargetDistCustomElementsBundle extends OutputTargetBaseNext {
|
|
1755
1768
|
type: 'dist-custom-elements-bundle';
|
|
@@ -582,7 +582,8 @@ const callRender = (e, t, a) => {
|
|
|
582
582
|
s.attributeChangedCallback = function(e, t, o) {
|
|
583
583
|
plt.jmp((() => {
|
|
584
584
|
const t = a.get(e);
|
|
585
|
-
this.hasOwnProperty(t)
|
|
585
|
+
if (this.hasOwnProperty(t)) o = this[t], delete this[t]; else if (s.hasOwnProperty(t) && "number" == typeof this[t] && this[t] == o) return;
|
|
586
|
+
this[t] = (null !== o || "boolean" != typeof this[t]) && o;
|
|
586
587
|
}));
|
|
587
588
|
}, e.observedAttributes = o.filter((([e, t]) => 15 & t[0])).map((([e, o]) => {
|
|
588
589
|
const s = o[1] || e;
|
|
@@ -704,6 +705,14 @@ const callRender = (e, t, a) => {
|
|
|
704
705
|
},
|
|
705
706
|
disconnectedCallback() {
|
|
706
707
|
disconnectedCallback(this), appData.BUILD.disconnectedCallback && s && s.call(this);
|
|
708
|
+
},
|
|
709
|
+
__attachShadow() {
|
|
710
|
+
exports.supportsShadow ? appData.BUILD.shadowDelegatesFocus ? this.attachShadow({
|
|
711
|
+
mode: "open",
|
|
712
|
+
delegatesFocus: !!(16 & a.$flags$)
|
|
713
|
+
}) : this.attachShadow({
|
|
714
|
+
mode: "open"
|
|
715
|
+
}) : this.shadowRoot = this;
|
|
707
716
|
}
|
|
708
717
|
}), e.is = a.$tagName$, proxyComponent(e, a, 3);
|
|
709
718
|
}, patchCloneNode = e => {
|
|
@@ -865,11 +874,7 @@ Object.defineProperty(exports, "Env", {
|
|
|
865
874
|
isServer: !0,
|
|
866
875
|
isTesting: !0
|
|
867
876
|
}, exports.Context = Context, exports.Fragment = (e, t) => t, exports.Host = Host,
|
|
868
|
-
exports.addHostEventListeners = addHostEventListeners, exports.
|
|
869
|
-
exports.supportsShadow ? e.attachShadow({
|
|
870
|
-
mode: "open"
|
|
871
|
-
}) : e.shadowRoot = e;
|
|
872
|
-
}, exports.bootstrapLazy = (e, t = {}) => {
|
|
877
|
+
exports.addHostEventListeners = addHostEventListeners, exports.bootstrapLazy = (e, t = {}) => {
|
|
873
878
|
appData.BUILD.profile && performance.mark && performance.mark("st:app:start"), (() => {
|
|
874
879
|
if (appData.BUILD.devTools) {
|
|
875
880
|
const e = win.stencil = win.stencil || {}, t = e.inspect;
|
|
@@ -922,47 +927,49 @@ exports.addHostEventListeners = addHostEventListeners, exports.attachShadow = e
|
|
|
922
927
|
if (Object.assign(plt, t), plt.$resourcesUrl$ = new URL(t.resourcesUrl || "./", doc.baseURI).href,
|
|
923
928
|
appData.BUILD.asyncQueue && t.syncQueue && (plt.$flags$ |= 4), appData.BUILD.hydrateClientSide && (plt.$flags$ |= 2),
|
|
924
929
|
appData.BUILD.hydrateClientSide && appData.BUILD.shadowDom) for (;m < d.length; m++) registerStyle(d[m].getAttribute("sty-id"), d[m].innerHTML.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, "$1{"));
|
|
925
|
-
e.map((e =>
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
((e
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
930
|
+
e.map((e => {
|
|
931
|
+
e[1].map((a => {
|
|
932
|
+
const l = {
|
|
933
|
+
$flags$: a[0],
|
|
934
|
+
$tagName$: a[1],
|
|
935
|
+
$members$: a[2],
|
|
936
|
+
$listeners$: a[3]
|
|
937
|
+
};
|
|
938
|
+
appData.BUILD.member && (l.$members$ = a[2]), appData.BUILD.hostListener && (l.$listeners$ = a[3]),
|
|
939
|
+
appData.BUILD.reflect && (l.$attrsToReflect$ = []), appData.BUILD.watchCallback && (l.$watchers$ = {}),
|
|
940
|
+
appData.BUILD.shadowDom && !exports.supportsShadow && 1 & l.$flags$ && (l.$flags$ |= 8);
|
|
941
|
+
const r = appData.BUILD.transformTagName && t.transformTagName ? t.transformTagName(l.$tagName$) : l.$tagName$, p = class extends HTMLElement {
|
|
942
|
+
constructor(e) {
|
|
943
|
+
super(e), registerHost(e = this, l), appData.BUILD.shadowDom && 1 & l.$flags$ && (exports.supportsShadow ? appData.BUILD.shadowDelegatesFocus ? e.attachShadow({
|
|
944
|
+
mode: "open",
|
|
945
|
+
delegatesFocus: !!(16 & l.$flags$)
|
|
946
|
+
}) : e.attachShadow({
|
|
947
|
+
mode: "open"
|
|
948
|
+
}) : appData.BUILD.hydrateServerSide || "shadowRoot" in e || (e.shadowRoot = e)),
|
|
949
|
+
appData.BUILD.slotChildNodesFix && patchChildSlotNodes(e, l);
|
|
950
|
+
}
|
|
951
|
+
connectedCallback() {
|
|
952
|
+
c && (clearTimeout(c), c = null), $ ? i.push(this) : plt.jmp((() => connectedCallback(this)));
|
|
953
|
+
}
|
|
954
|
+
disconnectedCallback() {
|
|
955
|
+
plt.jmp((() => disconnectedCallback(this)));
|
|
956
|
+
}
|
|
957
|
+
componentOnReady() {
|
|
958
|
+
return getHostRef(this).$onReadyPromise$;
|
|
959
|
+
}
|
|
960
|
+
};
|
|
961
|
+
appData.BUILD.cloneNodeFix && patchCloneNode(p.prototype), appData.BUILD.appendChildSlotFix && patchSlotAppendChild(p.prototype),
|
|
962
|
+
appData.BUILD.hotModuleReplacement && (p.prototype["s-hmr"] = function(e) {
|
|
963
|
+
((e, t, a) => {
|
|
964
|
+
const o = getHostRef(e);
|
|
965
|
+
o.$flags$ = 1, e["s-hmr-load"] = () => {
|
|
966
|
+
delete e["s-hmr-load"];
|
|
967
|
+
}, initializeComponent(e, o, t);
|
|
968
|
+
})(this, l);
|
|
969
|
+
}), appData.BUILD.scopedSlotTextContentFix && patchTextContent(p.prototype, l),
|
|
970
|
+
l.$lazyBundleId$ = e[0], s.includes(r) || n.get(r) || (o.push(r), n.define(r, proxyComponent(p, l, 1)));
|
|
971
|
+
}));
|
|
972
|
+
})), appData.BUILD.invisiblePrehydration && (appData.BUILD.hydratedClass || appData.BUILD.hydratedAttribute) && (p.innerHTML = o + "{visibility:hidden}.hydrated{visibility:inherit}",
|
|
966
973
|
p.setAttribute("data-styles", ""), l.insertBefore(p, r ? r.nextSibling : l.firstChild)),
|
|
967
974
|
$ = !1, i.length ? i.map((e => e.connectedCallback())) : appData.BUILD.profile ? plt.jmp((() => c = setTimeout(appDidLoad, 30, "timeout"))) : plt.jmp((() => c = setTimeout(appDidLoad, 30))),
|
|
968
975
|
a();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stencil/core/internal/testing",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.11.0-0",
|
|
4
4
|
"description": "Stencil internal testing platform to be imported by the Stencil Compiler. Breaking changes can and will happen at any time.",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"private": true
|