@stencil/core 2.11.0 → 2.14.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 +33 -8
- package/cli/index.js +33 -8
- package/cli/package.json +1 -1
- package/compiler/lib.dom.d.ts +2855 -4909
- package/compiler/lib.dom.iterable.d.ts +42 -66
- package/compiler/lib.es2015.core.d.ts +60 -18
- package/compiler/lib.es2015.iterable.d.ts +3 -11
- package/compiler/lib.es2015.promise.d.ts +2 -74
- package/compiler/lib.es2015.symbol.wellknown.d.ts +3 -3
- package/compiler/lib.es2018.intl.d.ts +23 -11
- package/compiler/lib.es2019.string.d.ts +8 -2
- package/compiler/lib.es2020.bigint.d.ts +2 -2
- package/compiler/lib.es2020.intl.d.ts +173 -114
- package/compiler/lib.es2020.promise.d.ts +2 -3
- package/compiler/lib.es2021.d.ts +1 -0
- package/compiler/lib.es2021.intl.d.ts +44 -0
- package/compiler/lib.es2021.promise.d.ts +8 -1
- package/compiler/lib.es5.d.ts +112 -52
- package/compiler/lib.esnext.intl.d.ts +1 -10
- package/compiler/lib.webworker.d.ts +1013 -1267
- package/compiler/lib.webworker.iterable.d.ts +28 -34
- package/compiler/package.json +1 -1
- package/compiler/stencil.js +391 -112
- package/compiler/stencil.min.js +2 -2
- package/dependencies.json +2 -1
- package/dev-server/client/index.js +1 -1
- package/dev-server/client/package.json +1 -1
- package/dev-server/connector.html +3 -3
- package/dev-server/index.js +1 -1
- package/dev-server/package.json +1 -1
- package/dev-server/server-process.js +16 -5
- package/internal/app-data/package.json +1 -1
- package/internal/client/css-shim.js +2 -2
- package/internal/client/dom.js +1 -1
- package/internal/client/index.js +34 -7
- package/internal/client/package.json +1 -1
- package/internal/client/patch-browser.js +5 -1
- package/internal/client/patch-esm.js +1 -1
- package/internal/client/polyfills/css-shim.js +1 -1
- package/internal/client/shadow-css.js +1 -1
- package/internal/hydrate/index.js +2 -1
- package/internal/hydrate/package.json +1 -1
- package/internal/hydrate/runner.js +1 -1
- package/internal/package.json +1 -1
- package/internal/stencil-public-runtime.d.ts +6 -4
- package/internal/testing/index.js +15 -13
- package/internal/testing/package.json +1 -1
- package/mock-doc/index.cjs +33 -3
- package/mock-doc/index.d.ts +4 -3
- package/mock-doc/index.js +33 -3
- package/mock-doc/package.json +1 -1
- package/package.json +7 -7
- package/readme.md +52 -85
- package/screenshot/package.json +1 -1
- package/sys/node/autoprefixer.js +2 -2
- package/sys/node/index.js +22 -18
- package/sys/node/package.json +1 -1
- package/sys/node/worker.js +1 -1
- package/testing/index.js +430 -402
- package/testing/jest/jest-config.d.ts +11 -0
- package/testing/jest/jest-environment.d.ts +1 -0
- package/testing/jest/jest-preprocessor.d.ts +56 -8
- package/testing/jest/jest-runner.d.ts +4 -0
- package/testing/jest-preset.js +5 -0
- package/testing/package.json +1 -1
package/cli/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
Stencil CLI (CommonJS) v2.
|
|
2
|
+
Stencil CLI (CommonJS) v2.14.0 | MIT Licensed | https://stenciljs.com
|
|
3
3
|
*/
|
|
4
4
|
'use strict';
|
|
5
5
|
|
|
@@ -33,6 +33,16 @@ const dashToPascalCase = (str) => toLowerCase(str)
|
|
|
33
33
|
const isFunction = (v) => typeof v === 'function';
|
|
34
34
|
const isString = (v) => typeof v === 'string';
|
|
35
35
|
|
|
36
|
+
/**
|
|
37
|
+
* Builds a template `Diagnostic` entity for a build error. The created `Diagnostic` is returned, and have little
|
|
38
|
+
* detail attached to it regarding the specifics of the error - it is the responsibility of the caller of this method
|
|
39
|
+
* to attach the specifics of the error message.
|
|
40
|
+
*
|
|
41
|
+
* The created `Diagnostic` is pushed to the `diagnostics` argument as a side effect of calling this method.
|
|
42
|
+
*
|
|
43
|
+
* @param diagnostics the existing diagnostics that the created template `Diagnostic` should be added to
|
|
44
|
+
* @returns the created `Diagnostic`
|
|
45
|
+
*/
|
|
36
46
|
const buildError = (diagnostics) => {
|
|
37
47
|
const diagnostic = {
|
|
38
48
|
level: 'error',
|
|
@@ -48,6 +58,13 @@ const buildError = (diagnostics) => {
|
|
|
48
58
|
}
|
|
49
59
|
return diagnostic;
|
|
50
60
|
};
|
|
61
|
+
/**
|
|
62
|
+
* Builds a diagnostic from an `Error`, appends it to the `diagnostics` parameter, and returns the created diagnostic
|
|
63
|
+
* @param diagnostics the series of diagnostics the newly created diagnostics should be added to
|
|
64
|
+
* @param err the error to derive information from in generating the diagnostic
|
|
65
|
+
* @param msg an optional message to use in place of `err` to generate the diagnostic
|
|
66
|
+
* @returns the generated diagnostic
|
|
67
|
+
*/
|
|
51
68
|
const catchError = (diagnostics, err, msg) => {
|
|
52
69
|
const diagnostic = {
|
|
53
70
|
level: 'error',
|
|
@@ -59,7 +76,7 @@ const catchError = (diagnostics, err, msg) => {
|
|
|
59
76
|
lines: [],
|
|
60
77
|
};
|
|
61
78
|
if (isString(msg)) {
|
|
62
|
-
diagnostic.messageText = msg;
|
|
79
|
+
diagnostic.messageText = msg.length ? msg : 'UNKNOWN ERROR';
|
|
63
80
|
}
|
|
64
81
|
else if (err != null) {
|
|
65
82
|
if (err.stack != null) {
|
|
@@ -67,7 +84,7 @@ const catchError = (diagnostics, err, msg) => {
|
|
|
67
84
|
}
|
|
68
85
|
else {
|
|
69
86
|
if (err.message != null) {
|
|
70
|
-
diagnostic.messageText = err.message.
|
|
87
|
+
diagnostic.messageText = err.message.length ? err.message : 'UNKNOWN ERROR';
|
|
71
88
|
}
|
|
72
89
|
else {
|
|
73
90
|
diagnostic.messageText = err.toString();
|
|
@@ -79,6 +96,12 @@ const catchError = (diagnostics, err, msg) => {
|
|
|
79
96
|
}
|
|
80
97
|
return diagnostic;
|
|
81
98
|
};
|
|
99
|
+
/**
|
|
100
|
+
* Determine if the provided diagnostics have any build errors
|
|
101
|
+
* @param diagnostics the diagnostics to inspect
|
|
102
|
+
* @returns true if any of the diagnostics in the list provided are errors that did not occur at runtime. false
|
|
103
|
+
* otherwise.
|
|
104
|
+
*/
|
|
82
105
|
const hasError = (diagnostics) => {
|
|
83
106
|
if (diagnostics == null || diagnostics.length === 0) {
|
|
84
107
|
return false;
|
|
@@ -490,7 +513,7 @@ const getNpmConfigEnvArgs = (sys) => {
|
|
|
490
513
|
const dependencies = [
|
|
491
514
|
{
|
|
492
515
|
name: "@stencil/core",
|
|
493
|
-
version: "2.
|
|
516
|
+
version: "2.14.0",
|
|
494
517
|
main: "compiler/stencil.js",
|
|
495
518
|
resources: [
|
|
496
519
|
"package.json",
|
|
@@ -540,6 +563,7 @@ const dependencies = [
|
|
|
540
563
|
"compiler/lib.es2020.symbol.wellknown.d.ts",
|
|
541
564
|
"compiler/lib.es2021.d.ts",
|
|
542
565
|
"compiler/lib.es2021.full.d.ts",
|
|
566
|
+
"compiler/lib.es2021.intl.d.ts",
|
|
543
567
|
"compiler/lib.es2021.promise.d.ts",
|
|
544
568
|
"compiler/lib.es2021.string.d.ts",
|
|
545
569
|
"compiler/lib.es2021.weakref.d.ts",
|
|
@@ -592,7 +616,7 @@ const dependencies = [
|
|
|
592
616
|
},
|
|
593
617
|
{
|
|
594
618
|
name: "typescript",
|
|
595
|
-
version: "4.
|
|
619
|
+
version: "4.5.4",
|
|
596
620
|
main: "lib/typescript.js"
|
|
597
621
|
}
|
|
598
622
|
];
|
|
@@ -1669,7 +1693,8 @@ const run = async (init) => {
|
|
|
1669
1693
|
}
|
|
1670
1694
|
catch (e) {
|
|
1671
1695
|
if (!shouldIgnoreError(e)) {
|
|
1672
|
-
|
|
1696
|
+
const details = `${logger.getLevel() === 'debug' && e instanceof Error ? e.stack : ''}`;
|
|
1697
|
+
logger.error(`uncaught cli error: ${e}${details}`);
|
|
1673
1698
|
return sys.exit(1);
|
|
1674
1699
|
}
|
|
1675
1700
|
}
|
|
@@ -1689,7 +1714,7 @@ const runTask = async (coreCompiler, config, task, sys) => {
|
|
|
1689
1714
|
await taskGenerate(coreCompiler, config);
|
|
1690
1715
|
break;
|
|
1691
1716
|
case 'help':
|
|
1692
|
-
taskHelp(config, config.logger, sys);
|
|
1717
|
+
await taskHelp(config, config.logger, sys);
|
|
1693
1718
|
break;
|
|
1694
1719
|
case 'prerender':
|
|
1695
1720
|
await taskPrerender(coreCompiler, config);
|
|
@@ -1711,7 +1736,7 @@ const runTask = async (coreCompiler, config, task, sys) => {
|
|
|
1711
1736
|
break;
|
|
1712
1737
|
default:
|
|
1713
1738
|
config.logger.error(`${config.logger.emoji('❌ ')}Invalid stencil command, please see the options below:`);
|
|
1714
|
-
taskHelp(config, config.logger, sys);
|
|
1739
|
+
await taskHelp(config, config.logger, sys);
|
|
1715
1740
|
return config.sys.exit(1);
|
|
1716
1741
|
}
|
|
1717
1742
|
};
|
package/cli/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
Stencil CLI v2.
|
|
2
|
+
Stencil CLI v2.14.0 | MIT Licensed | https://stenciljs.com
|
|
3
3
|
*/
|
|
4
4
|
const toLowerCase = (str) => str.toLowerCase();
|
|
5
5
|
const dashToPascalCase = (str) => toLowerCase(str)
|
|
@@ -9,6 +9,16 @@ const dashToPascalCase = (str) => toLowerCase(str)
|
|
|
9
9
|
const isFunction = (v) => typeof v === 'function';
|
|
10
10
|
const isString = (v) => typeof v === 'string';
|
|
11
11
|
|
|
12
|
+
/**
|
|
13
|
+
* Builds a template `Diagnostic` entity for a build error. The created `Diagnostic` is returned, and have little
|
|
14
|
+
* detail attached to it regarding the specifics of the error - it is the responsibility of the caller of this method
|
|
15
|
+
* to attach the specifics of the error message.
|
|
16
|
+
*
|
|
17
|
+
* The created `Diagnostic` is pushed to the `diagnostics` argument as a side effect of calling this method.
|
|
18
|
+
*
|
|
19
|
+
* @param diagnostics the existing diagnostics that the created template `Diagnostic` should be added to
|
|
20
|
+
* @returns the created `Diagnostic`
|
|
21
|
+
*/
|
|
12
22
|
const buildError = (diagnostics) => {
|
|
13
23
|
const diagnostic = {
|
|
14
24
|
level: 'error',
|
|
@@ -24,6 +34,13 @@ const buildError = (diagnostics) => {
|
|
|
24
34
|
}
|
|
25
35
|
return diagnostic;
|
|
26
36
|
};
|
|
37
|
+
/**
|
|
38
|
+
* Builds a diagnostic from an `Error`, appends it to the `diagnostics` parameter, and returns the created diagnostic
|
|
39
|
+
* @param diagnostics the series of diagnostics the newly created diagnostics should be added to
|
|
40
|
+
* @param err the error to derive information from in generating the diagnostic
|
|
41
|
+
* @param msg an optional message to use in place of `err` to generate the diagnostic
|
|
42
|
+
* @returns the generated diagnostic
|
|
43
|
+
*/
|
|
27
44
|
const catchError = (diagnostics, err, msg) => {
|
|
28
45
|
const diagnostic = {
|
|
29
46
|
level: 'error',
|
|
@@ -35,7 +52,7 @@ const catchError = (diagnostics, err, msg) => {
|
|
|
35
52
|
lines: [],
|
|
36
53
|
};
|
|
37
54
|
if (isString(msg)) {
|
|
38
|
-
diagnostic.messageText = msg;
|
|
55
|
+
diagnostic.messageText = msg.length ? msg : 'UNKNOWN ERROR';
|
|
39
56
|
}
|
|
40
57
|
else if (err != null) {
|
|
41
58
|
if (err.stack != null) {
|
|
@@ -43,7 +60,7 @@ const catchError = (diagnostics, err, msg) => {
|
|
|
43
60
|
}
|
|
44
61
|
else {
|
|
45
62
|
if (err.message != null) {
|
|
46
|
-
diagnostic.messageText = err.message.
|
|
63
|
+
diagnostic.messageText = err.message.length ? err.message : 'UNKNOWN ERROR';
|
|
47
64
|
}
|
|
48
65
|
else {
|
|
49
66
|
diagnostic.messageText = err.toString();
|
|
@@ -55,6 +72,12 @@ const catchError = (diagnostics, err, msg) => {
|
|
|
55
72
|
}
|
|
56
73
|
return diagnostic;
|
|
57
74
|
};
|
|
75
|
+
/**
|
|
76
|
+
* Determine if the provided diagnostics have any build errors
|
|
77
|
+
* @param diagnostics the diagnostics to inspect
|
|
78
|
+
* @returns true if any of the diagnostics in the list provided are errors that did not occur at runtime. false
|
|
79
|
+
* otherwise.
|
|
80
|
+
*/
|
|
58
81
|
const hasError = (diagnostics) => {
|
|
59
82
|
if (diagnostics == null || diagnostics.length === 0) {
|
|
60
83
|
return false;
|
|
@@ -466,7 +489,7 @@ const getNpmConfigEnvArgs = (sys) => {
|
|
|
466
489
|
const dependencies = [
|
|
467
490
|
{
|
|
468
491
|
name: "@stencil/core",
|
|
469
|
-
version: "2.
|
|
492
|
+
version: "2.14.0",
|
|
470
493
|
main: "compiler/stencil.js",
|
|
471
494
|
resources: [
|
|
472
495
|
"package.json",
|
|
@@ -516,6 +539,7 @@ const dependencies = [
|
|
|
516
539
|
"compiler/lib.es2020.symbol.wellknown.d.ts",
|
|
517
540
|
"compiler/lib.es2021.d.ts",
|
|
518
541
|
"compiler/lib.es2021.full.d.ts",
|
|
542
|
+
"compiler/lib.es2021.intl.d.ts",
|
|
519
543
|
"compiler/lib.es2021.promise.d.ts",
|
|
520
544
|
"compiler/lib.es2021.string.d.ts",
|
|
521
545
|
"compiler/lib.es2021.weakref.d.ts",
|
|
@@ -568,7 +592,7 @@ const dependencies = [
|
|
|
568
592
|
},
|
|
569
593
|
{
|
|
570
594
|
name: "typescript",
|
|
571
|
-
version: "4.
|
|
595
|
+
version: "4.5.4",
|
|
572
596
|
main: "lib/typescript.js"
|
|
573
597
|
}
|
|
574
598
|
];
|
|
@@ -1645,7 +1669,8 @@ const run = async (init) => {
|
|
|
1645
1669
|
}
|
|
1646
1670
|
catch (e) {
|
|
1647
1671
|
if (!shouldIgnoreError(e)) {
|
|
1648
|
-
|
|
1672
|
+
const details = `${logger.getLevel() === 'debug' && e instanceof Error ? e.stack : ''}`;
|
|
1673
|
+
logger.error(`uncaught cli error: ${e}${details}`);
|
|
1649
1674
|
return sys.exit(1);
|
|
1650
1675
|
}
|
|
1651
1676
|
}
|
|
@@ -1665,7 +1690,7 @@ const runTask = async (coreCompiler, config, task, sys) => {
|
|
|
1665
1690
|
await taskGenerate(coreCompiler, config);
|
|
1666
1691
|
break;
|
|
1667
1692
|
case 'help':
|
|
1668
|
-
taskHelp(config, config.logger, sys);
|
|
1693
|
+
await taskHelp(config, config.logger, sys);
|
|
1669
1694
|
break;
|
|
1670
1695
|
case 'prerender':
|
|
1671
1696
|
await taskPrerender(coreCompiler, config);
|
|
@@ -1687,7 +1712,7 @@ const runTask = async (coreCompiler, config, task, sys) => {
|
|
|
1687
1712
|
break;
|
|
1688
1713
|
default:
|
|
1689
1714
|
config.logger.error(`${config.logger.emoji('❌ ')}Invalid stencil command, please see the options below:`);
|
|
1690
|
-
taskHelp(config, config.logger, sys);
|
|
1715
|
+
await taskHelp(config, config.logger, sys);
|
|
1691
1716
|
return config.sys.exit(1);
|
|
1692
1717
|
}
|
|
1693
1718
|
};
|