@stencil/core 2.16.0 → 2.16.1-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.
Files changed (39) hide show
  1. package/cli/index.cjs +30 -12
  2. package/cli/index.js +30 -12
  3. package/cli/package.json +1 -1
  4. package/compiler/package.json +1 -1
  5. package/compiler/stencil.js +209 -147
  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 +3 -3
  11. package/dev-server/index.js +1 -1
  12. package/dev-server/package.json +1 -1
  13. package/dev-server/server-process.js +4 -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 +1 -1
  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 +1 -1
  22. package/internal/hydrate/index.js +3 -3
  23. package/internal/hydrate/package.json +1 -1
  24. package/internal/package.json +1 -1
  25. package/internal/stencil-public-compiler.d.ts +1 -0
  26. package/internal/testing/index.js +1 -1
  27. package/internal/testing/package.json +1 -1
  28. package/mock-doc/index.cjs +3 -1
  29. package/mock-doc/index.d.ts +1 -0
  30. package/mock-doc/index.js +3 -1
  31. package/mock-doc/package.json +1 -1
  32. package/package.json +2 -1
  33. package/screenshot/index.js +2 -0
  34. package/screenshot/package.json +1 -1
  35. package/sys/node/index.js +1 -1
  36. package/sys/node/package.json +1 -1
  37. package/sys/node/worker.js +1 -1
  38. package/testing/index.js +335 -331
  39. package/testing/package.json +1 -1
package/cli/index.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Stencil CLI (CommonJS) v2.16.0 | MIT Licensed | https://stenciljs.com
2
+ Stencil CLI (CommonJS) v2.16.1-0 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  'use strict';
5
5
 
@@ -118,6 +118,8 @@ const TASK_CANCELED_MSG = `task canceled`;
118
118
  * Forward-slash paths can be used in Windows as long as they're not
119
119
  * extended-length paths and don't contain any non-ascii characters.
120
120
  * This was created since the path methods in Node.js outputs \\ paths on Windows.
121
+ * @param path the Windows-based path to convert
122
+ * @returns the converted path
121
123
  */
122
124
  const normalizePath = (path) => {
123
125
  if (typeof path !== 'string') {
@@ -530,7 +532,7 @@ const getNpmConfigEnvArgs = (sys) => {
530
532
  const dependencies = [
531
533
  {
532
534
  name: "@stencil/core",
533
- version: "2.16.0",
535
+ version: "2.16.1-0",
534
536
  main: "compiler/stencil.js",
535
537
  resources: [
536
538
  "package.json",
@@ -1072,10 +1074,12 @@ const prepareData = async (coreCompiler, config, sys, duration_ms, component_cou
1072
1074
  };
1073
1075
  };
1074
1076
  /**
1075
- * Reads package-lock.json, yarn.lock, and package.json files in order to cross reference
1077
+ * Reads package-lock.json, yarn.lock, and package.json files in order to cross-reference
1076
1078
  * the dependencies and devDependencies properties. Pulls up the current installed version
1077
1079
  * of each package under the @stencil, @ionic, and @capacitor scopes.
1078
- * @returns string[]
1080
+ * @param sys the system instance where telemetry is invoked
1081
+ * @param config the Stencil configuration associated with the current task that triggered telemetry
1082
+ * @returns an object listing all dev and production dependencies under the aforementioned scopes
1079
1083
  */
1080
1084
  async function getInstalledPackages(sys, config) {
1081
1085
  let packages = [];
@@ -1154,7 +1158,12 @@ function sanitizeDeclaredVersion(version) {
1154
1158
  return version.replace(/[*^~]/g, '');
1155
1159
  }
1156
1160
  /**
1157
- * If telemetry is enabled, send a metric via IPC to a forked process for uploading.
1161
+ * If telemetry is enabled, send a metric to an external data store
1162
+ * @param sys the system instance where telemetry is invoked
1163
+ * @param config the Stencil configuration associated with the current task that triggered telemetry
1164
+ * @param name the name of a trackable metric. Note this name is not necessarily a scalar value to track, like
1165
+ * "Stencil Version". For example, "stencil_cli_command" is a name that is used to track all CLI command information.
1166
+ * @param value the data to send to the external data store under the provided name argument
1158
1167
  */
1159
1168
  async function sendMetric(sys, config, name, value) {
1160
1169
  const session_id = await getTelemetryToken(sys);
@@ -1467,7 +1476,10 @@ const getBoilerplateByExtension = (tagName, extension, withCss) => {
1467
1476
  }
1468
1477
  };
1469
1478
  /**
1470
- * Get the boilerplate for a component.
1479
+ * Get the boilerplate for a file containing the definition of a component
1480
+ * @param tagName the name of the tag to give the component
1481
+ * @param hasStyle designates if the component has an external stylesheet or not
1482
+ * @returns the contents of a file that defines a component
1471
1483
  */
1472
1484
  const getComponentBoilerplate = (tagName, hasStyle) => {
1473
1485
  const decorator = [`{`];
@@ -1501,7 +1513,9 @@ const getStyleUrlBoilerplate = () => `:host {
1501
1513
  }
1502
1514
  `;
1503
1515
  /**
1504
- * Get the boilerplate for a spec test.
1516
+ * Get the boilerplate for a file containing a spec (unit) test for a component
1517
+ * @param tagName the name of the tag associated with the component under test
1518
+ * @returns the contents of a file that unit tests a component
1505
1519
  */
1506
1520
  const getSpecTestBoilerplate = (tagName) => `import { newSpecPage } from '@stencil/core/testing';
1507
1521
  import { ${toPascalCase(tagName)} } from '../${tagName}';
@@ -1523,22 +1537,26 @@ describe('${tagName}', () => {
1523
1537
  });
1524
1538
  `;
1525
1539
  /**
1526
- * Get the boilerplate for an E2E test.
1540
+ * Get the boilerplate for a file containing an end-to-end (E2E) test for a component
1541
+ * @param tagName the name of the tag associated with the component under test
1542
+ * @returns the contents of a file that E2E tests a component
1527
1543
  */
1528
- const getE2eTestBoilerplate = (name) => `import { newE2EPage } from '@stencil/core/testing';
1544
+ const getE2eTestBoilerplate = (tagName) => `import { newE2EPage } from '@stencil/core/testing';
1529
1545
 
1530
- describe('${name}', () => {
1546
+ describe('${tagName}', () => {
1531
1547
  it('renders', async () => {
1532
1548
  const page = await newE2EPage();
1533
- await page.setContent('<${name}></${name}>');
1549
+ await page.setContent('<${tagName}></${tagName}>');
1534
1550
 
1535
- const element = await page.find('${name}');
1551
+ const element = await page.find('${tagName}');
1536
1552
  expect(element).toHaveClass('hydrated');
1537
1553
  });
1538
1554
  });
1539
1555
  `;
1540
1556
  /**
1541
1557
  * Convert a dash case string to pascal case.
1558
+ * @param str the string to convert
1559
+ * @returns the converted input as pascal case
1542
1560
  */
1543
1561
  const toPascalCase = (str) => str.split('-').reduce((res, part) => res + part[0].toUpperCase() + part.slice(1), '');
1544
1562
 
package/cli/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Stencil CLI v2.16.0 | MIT Licensed | https://stenciljs.com
2
+ Stencil CLI v2.16.1-0 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  const toLowerCase = (str) => str.toLowerCase();
5
5
  const dashToPascalCase = (str) => toLowerCase(str)
@@ -94,6 +94,8 @@ const TASK_CANCELED_MSG = `task canceled`;
94
94
  * Forward-slash paths can be used in Windows as long as they're not
95
95
  * extended-length paths and don't contain any non-ascii characters.
96
96
  * This was created since the path methods in Node.js outputs \\ paths on Windows.
97
+ * @param path the Windows-based path to convert
98
+ * @returns the converted path
97
99
  */
98
100
  const normalizePath = (path) => {
99
101
  if (typeof path !== 'string') {
@@ -506,7 +508,7 @@ const getNpmConfigEnvArgs = (sys) => {
506
508
  const dependencies = [
507
509
  {
508
510
  name: "@stencil/core",
509
- version: "2.16.0",
511
+ version: "2.16.1-0",
510
512
  main: "compiler/stencil.js",
511
513
  resources: [
512
514
  "package.json",
@@ -1048,10 +1050,12 @@ const prepareData = async (coreCompiler, config, sys, duration_ms, component_cou
1048
1050
  };
1049
1051
  };
1050
1052
  /**
1051
- * Reads package-lock.json, yarn.lock, and package.json files in order to cross reference
1053
+ * Reads package-lock.json, yarn.lock, and package.json files in order to cross-reference
1052
1054
  * the dependencies and devDependencies properties. Pulls up the current installed version
1053
1055
  * of each package under the @stencil, @ionic, and @capacitor scopes.
1054
- * @returns string[]
1056
+ * @param sys the system instance where telemetry is invoked
1057
+ * @param config the Stencil configuration associated with the current task that triggered telemetry
1058
+ * @returns an object listing all dev and production dependencies under the aforementioned scopes
1055
1059
  */
1056
1060
  async function getInstalledPackages(sys, config) {
1057
1061
  let packages = [];
@@ -1130,7 +1134,12 @@ function sanitizeDeclaredVersion(version) {
1130
1134
  return version.replace(/[*^~]/g, '');
1131
1135
  }
1132
1136
  /**
1133
- * If telemetry is enabled, send a metric via IPC to a forked process for uploading.
1137
+ * If telemetry is enabled, send a metric to an external data store
1138
+ * @param sys the system instance where telemetry is invoked
1139
+ * @param config the Stencil configuration associated with the current task that triggered telemetry
1140
+ * @param name the name of a trackable metric. Note this name is not necessarily a scalar value to track, like
1141
+ * "Stencil Version". For example, "stencil_cli_command" is a name that is used to track all CLI command information.
1142
+ * @param value the data to send to the external data store under the provided name argument
1134
1143
  */
1135
1144
  async function sendMetric(sys, config, name, value) {
1136
1145
  const session_id = await getTelemetryToken(sys);
@@ -1443,7 +1452,10 @@ const getBoilerplateByExtension = (tagName, extension, withCss) => {
1443
1452
  }
1444
1453
  };
1445
1454
  /**
1446
- * Get the boilerplate for a component.
1455
+ * Get the boilerplate for a file containing the definition of a component
1456
+ * @param tagName the name of the tag to give the component
1457
+ * @param hasStyle designates if the component has an external stylesheet or not
1458
+ * @returns the contents of a file that defines a component
1447
1459
  */
1448
1460
  const getComponentBoilerplate = (tagName, hasStyle) => {
1449
1461
  const decorator = [`{`];
@@ -1477,7 +1489,9 @@ const getStyleUrlBoilerplate = () => `:host {
1477
1489
  }
1478
1490
  `;
1479
1491
  /**
1480
- * Get the boilerplate for a spec test.
1492
+ * Get the boilerplate for a file containing a spec (unit) test for a component
1493
+ * @param tagName the name of the tag associated with the component under test
1494
+ * @returns the contents of a file that unit tests a component
1481
1495
  */
1482
1496
  const getSpecTestBoilerplate = (tagName) => `import { newSpecPage } from '@stencil/core/testing';
1483
1497
  import { ${toPascalCase(tagName)} } from '../${tagName}';
@@ -1499,22 +1513,26 @@ describe('${tagName}', () => {
1499
1513
  });
1500
1514
  `;
1501
1515
  /**
1502
- * Get the boilerplate for an E2E test.
1516
+ * Get the boilerplate for a file containing an end-to-end (E2E) test for a component
1517
+ * @param tagName the name of the tag associated with the component under test
1518
+ * @returns the contents of a file that E2E tests a component
1503
1519
  */
1504
- const getE2eTestBoilerplate = (name) => `import { newE2EPage } from '@stencil/core/testing';
1520
+ const getE2eTestBoilerplate = (tagName) => `import { newE2EPage } from '@stencil/core/testing';
1505
1521
 
1506
- describe('${name}', () => {
1522
+ describe('${tagName}', () => {
1507
1523
  it('renders', async () => {
1508
1524
  const page = await newE2EPage();
1509
- await page.setContent('<${name}></${name}>');
1525
+ await page.setContent('<${tagName}></${tagName}>');
1510
1526
 
1511
- const element = await page.find('${name}');
1527
+ const element = await page.find('${tagName}');
1512
1528
  expect(element).toHaveClass('hydrated');
1513
1529
  });
1514
1530
  });
1515
1531
  `;
1516
1532
  /**
1517
1533
  * Convert a dash case string to pascal case.
1534
+ * @param str the string to convert
1535
+ * @returns the converted input as pascal case
1518
1536
  */
1519
1537
  const toPascalCase = (str) => str.split('-').reduce((res, part) => res + part[0].toUpperCase() + part.slice(1), '');
1520
1538
 
package/cli/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/cli",
3
- "version": "2.16.0",
3
+ "version": "2.16.1-0",
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.16.0",
3
+ "version": "2.16.1-0",
4
4
  "description": "Stencil Compiler.",
5
5
  "main": "./stencil.js",
6
6
  "types": "./stencil.d.ts",