@stencil/core 2.10.0 → 2.12.1

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.
Files changed (45) hide show
  1. package/cli/index.cjs +25 -4
  2. package/cli/index.js +25 -4
  3. package/cli/package.json +1 -1
  4. package/compiler/package.json +1 -1
  5. package/compiler/stencil.js +527 -715
  6. package/compiler/stencil.min.js +2 -2
  7. package/dependencies.json +1 -1
  8. package/dev-server/client/index.js +1 -1
  9. package/dev-server/client/package.json +1 -1
  10. package/dev-server/connector.html +2 -2
  11. package/dev-server/index.js +1 -1
  12. package/dev-server/package.json +1 -1
  13. package/dev-server/server-process.js +2 -2
  14. package/internal/app-data/package.json +1 -1
  15. package/internal/client/css-shim.js +1 -1
  16. package/internal/client/dom.js +1 -1
  17. package/internal/client/index.js +11 -7
  18. package/internal/client/package.json +1 -1
  19. package/internal/client/patch-browser.js +1 -1
  20. package/internal/client/patch-esm.js +1 -1
  21. package/internal/client/shadow-css.js +9 -10
  22. package/internal/hydrate/index.js +2 -1
  23. package/internal/hydrate/package.json +1 -1
  24. package/internal/hydrate/shadow-css.js +59 -62
  25. package/internal/package.json +1 -1
  26. package/internal/stencil-public-compiler.d.ts +1 -1
  27. package/internal/stencil-public-runtime.d.ts +6 -4
  28. package/internal/testing/index.js +15 -13
  29. package/internal/testing/package.json +1 -1
  30. package/internal/testing/shadow-css.js +54 -57
  31. package/mock-doc/index.cjs +5 -2
  32. package/mock-doc/index.js +5 -2
  33. package/mock-doc/package.json +1 -1
  34. package/package.json +12 -7
  35. package/readme.md +52 -85
  36. package/screenshot/package.json +1 -1
  37. package/sys/node/autoprefixer.js +2 -2
  38. package/sys/node/index.js +14 -13
  39. package/sys/node/package.json +1 -1
  40. package/sys/node/worker.js +1 -1
  41. package/testing/index.js +79 -71
  42. package/testing/jest/jest-environment.d.ts +1 -0
  43. package/testing/jest/jest-preprocessor.d.ts +56 -8
  44. package/testing/jest-preset.js +5 -0
  45. package/testing/package.json +1 -1
package/cli/index.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Stencil CLI (CommonJS) v2.10.0 | MIT Licensed | https://stenciljs.com
2
+ Stencil CLI (CommonJS) v2.12.1 | 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',
@@ -79,6 +89,12 @@ const catchError = (diagnostics, err, msg) => {
79
89
  }
80
90
  return diagnostic;
81
91
  };
92
+ /**
93
+ * Determine if the provided diagnostics have any build errors
94
+ * @param diagnostics the diagnostics to inspect
95
+ * @returns true if any of the diagnostics in the list provided are errors that did not occur at runtime. false
96
+ * otherwise.
97
+ */
82
98
  const hasError = (diagnostics) => {
83
99
  if (diagnostics == null || diagnostics.length === 0) {
84
100
  return false;
@@ -230,6 +246,11 @@ const pathComponents = (path, rootLength) => {
230
246
  return [root, ...rest];
231
247
  };
232
248
 
249
+ /**
250
+ * Validates that a component tag meets required naming conventions to be used for a web component
251
+ * @param tag the tag to validate
252
+ * @returns an error message if the tag has an invalid name, undefined if the tag name passes all checks
253
+ */
233
254
  const validateComponentTag = (tag) => {
234
255
  if (tag !== tag.trim()) {
235
256
  return `Tag can not contain white spaces`;
@@ -485,7 +506,7 @@ const getNpmConfigEnvArgs = (sys) => {
485
506
  const dependencies = [
486
507
  {
487
508
  name: "@stencil/core",
488
- version: "2.10.0",
509
+ version: "2.12.1",
489
510
  main: "compiler/stencil.js",
490
511
  resources: [
491
512
  "package.json",
@@ -1684,7 +1705,7 @@ const runTask = async (coreCompiler, config, task, sys) => {
1684
1705
  await taskGenerate(coreCompiler, config);
1685
1706
  break;
1686
1707
  case 'help':
1687
- taskHelp(config, config.logger, sys);
1708
+ await taskHelp(config, config.logger, sys);
1688
1709
  break;
1689
1710
  case 'prerender':
1690
1711
  await taskPrerender(coreCompiler, config);
@@ -1706,7 +1727,7 @@ const runTask = async (coreCompiler, config, task, sys) => {
1706
1727
  break;
1707
1728
  default:
1708
1729
  config.logger.error(`${config.logger.emoji('❌ ')}Invalid stencil command, please see the options below:`);
1709
- taskHelp(config, config.logger, sys);
1730
+ await taskHelp(config, config.logger, sys);
1710
1731
  return config.sys.exit(1);
1711
1732
  }
1712
1733
  };
package/cli/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Stencil CLI v2.10.0 | MIT Licensed | https://stenciljs.com
2
+ Stencil CLI v2.12.1 | 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',
@@ -55,6 +65,12 @@ const catchError = (diagnostics, err, msg) => {
55
65
  }
56
66
  return diagnostic;
57
67
  };
68
+ /**
69
+ * Determine if the provided diagnostics have any build errors
70
+ * @param diagnostics the diagnostics to inspect
71
+ * @returns true if any of the diagnostics in the list provided are errors that did not occur at runtime. false
72
+ * otherwise.
73
+ */
58
74
  const hasError = (diagnostics) => {
59
75
  if (diagnostics == null || diagnostics.length === 0) {
60
76
  return false;
@@ -206,6 +222,11 @@ const pathComponents = (path, rootLength) => {
206
222
  return [root, ...rest];
207
223
  };
208
224
 
225
+ /**
226
+ * Validates that a component tag meets required naming conventions to be used for a web component
227
+ * @param tag the tag to validate
228
+ * @returns an error message if the tag has an invalid name, undefined if the tag name passes all checks
229
+ */
209
230
  const validateComponentTag = (tag) => {
210
231
  if (tag !== tag.trim()) {
211
232
  return `Tag can not contain white spaces`;
@@ -461,7 +482,7 @@ const getNpmConfigEnvArgs = (sys) => {
461
482
  const dependencies = [
462
483
  {
463
484
  name: "@stencil/core",
464
- version: "2.10.0",
485
+ version: "2.12.1",
465
486
  main: "compiler/stencil.js",
466
487
  resources: [
467
488
  "package.json",
@@ -1660,7 +1681,7 @@ const runTask = async (coreCompiler, config, task, sys) => {
1660
1681
  await taskGenerate(coreCompiler, config);
1661
1682
  break;
1662
1683
  case 'help':
1663
- taskHelp(config, config.logger, sys);
1684
+ await taskHelp(config, config.logger, sys);
1664
1685
  break;
1665
1686
  case 'prerender':
1666
1687
  await taskPrerender(coreCompiler, config);
@@ -1682,7 +1703,7 @@ const runTask = async (coreCompiler, config, task, sys) => {
1682
1703
  break;
1683
1704
  default:
1684
1705
  config.logger.error(`${config.logger.emoji('❌ ')}Invalid stencil command, please see the options below:`);
1685
- taskHelp(config, config.logger, sys);
1706
+ await taskHelp(config, config.logger, sys);
1686
1707
  return config.sys.exit(1);
1687
1708
  }
1688
1709
  };
package/cli/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/cli",
3
- "version": "2.10.0",
3
+ "version": "2.12.1",
4
4
  "description": "Stencil CLI.",
5
5
  "main": "./index.cjs",
6
6
  "module": "./index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/compiler",
3
- "version": "2.10.0",
3
+ "version": "2.12.1",
4
4
  "description": "Stencil Compiler.",
5
5
  "main": "./stencil.js",
6
6
  "types": "./stencil.d.ts",