@stencil/core 5.0.0-rc.7 → 5.0.0-rc.8

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.
@@ -1845,7 +1845,7 @@ const validateComponentTag = (tag) => {
1845
1845
  };
1846
1846
  //#endregion
1847
1847
  //#region src/version.ts
1848
- const version = "5.0.0-rc.7";
1848
+ const version = "5.0.0-rc.8";
1849
1849
  //#endregion
1850
1850
  //#region src/compiler/events.ts
1851
1851
  const buildEvents = () => {
@@ -3898,13 +3898,22 @@ const CSS_PROP_ANNOTATION_RE = /@(?:cssproperty|cssprop|prop)\b/;
3898
3898
  * than describing the node below its comment.
3899
3899
  */
3900
3900
  const CSS_ANNOTATION_TAG_RE = /@(?:component|cssproperty|cssprop|prop|attr|slot)\b/;
3901
+ const INTERNAL_TAG_RE = /@internal\b/;
3902
+ /**
3903
+ * Whether a comment marks the node immediately following it as internal - excluded from docs,
3904
+ * matching `@internal` on component members.
3905
+ * @param commentText a postcss `Comment` node's `.text`
3906
+ * @returns `true` if the comment is a JSDoc-style comment holding an `@internal` tag
3907
+ */
3908
+ const isInternalDocComment = (commentText) => isJsDocComment(commentText) && INTERNAL_TAG_RE.test(commentText);
3901
3909
  /**
3902
3910
  * Whether a comment describes the node immediately following it (a declaration, rule or
3903
- * at-rule). A comment holding annotation tags documents the things it names instead.
3911
+ * at-rule). A comment holding annotation tags documents the things it names instead, and an
3912
+ * `@internal` comment hides the node.
3904
3913
  * @param commentText a postcss `Comment` node's `.text`
3905
3914
  * @returns `true` if the comment is a JSDoc-style description of the next node
3906
3915
  */
3907
- const isNodeDocComment = (commentText) => isJsDocComment(commentText) && !CSS_ANNOTATION_TAG_RE.test(commentText);
3916
+ const isNodeDocComment = (commentText) => isJsDocComment(commentText) && !CSS_ANNOTATION_TAG_RE.test(commentText) && !INTERNAL_TAG_RE.test(commentText);
3908
3917
  /**
3909
3918
  * Strip the leading `*`/`!` marker and per-line `*` prefixes, returning trimmed lines.
3910
3919
  * @param commentText a postcss `Comment` node's `.text`
@@ -4031,8 +4040,9 @@ function parseScopedAndNativeStyleDocs(styleDocs, styleText, mode, tag, encapsul
4031
4040
  root.walkAtRules("property", (node) => {
4032
4041
  const propName = node.params.trim();
4033
4042
  if (!propName.startsWith("--")) return;
4034
- const { syntax, initialValue } = parsePropertyAtRuleDescriptors(node);
4035
4043
  const prev = node.prev();
4044
+ const isInternal = prev?.type === "comment" && isInternalDocComment(prev.text);
4045
+ const { syntax, initialValue } = parsePropertyAtRuleDescriptors(node);
4036
4046
  const docs = prev && prev.type === "comment" && isNodeDocComment(prev.text) ? normalizeJsDocText(prev.text) : "";
4037
4047
  const existing = styleDocs.find((styleDoc) => styleDoc.name === propName);
4038
4048
  if (existing) {
@@ -4041,6 +4051,7 @@ function parseScopedAndNativeStyleDocs(styleDocs, styleText, mode, tag, encapsul
4041
4051
  if (initialValue) existing.default ??= initialValue;
4042
4052
  return;
4043
4053
  }
4054
+ if (isInternal) return;
4044
4055
  styleDocs.push({
4045
4056
  name: propName,
4046
4057
  docs,
@@ -1,3 +1,3 @@
1
- import { A as version, C as hasStencilHydrateImport, D as parseCssOnlyComponents, E as replaceStencilHydrateImport, M as scopeCss, O as buildId, S as hasStencilGlobalsImport, T as replaceStencilGlobalsImport, _ as cmpMetaToDocsComponent, a as createPrerenderer, b as buildHydrateCss, c as createWorkerContext, d as nodeRequire, f as optimizeCss, g as generateManifest, h as generateComponentTypesFile, i as createSystem, j as versions, k as vermoji, l as createWorkerMessageHandler, m as validateHydrated, n as transpile, o as loadConfig, p as validateConfig, r as transpileSync, s as createCompiler, t as ts, u as optimizeJs, v as getScopeId, w as replaceStencilCssComponentsImport, x as hasStencilCssComponentsImport, y as foldBuildFlags } from "../compiler-CH-Qh_aM.mjs";
1
+ import { A as version, C as hasStencilHydrateImport, D as parseCssOnlyComponents, E as replaceStencilHydrateImport, M as scopeCss, O as buildId, S as hasStencilGlobalsImport, T as replaceStencilGlobalsImport, _ as cmpMetaToDocsComponent, a as createPrerenderer, b as buildHydrateCss, c as createWorkerContext, d as nodeRequire, f as optimizeCss, g as generateManifest, h as generateComponentTypesFile, i as createSystem, j as versions, k as vermoji, l as createWorkerMessageHandler, m as validateHydrated, n as transpile, o as loadConfig, p as validateConfig, r as transpileSync, s as createCompiler, t as ts, u as optimizeJs, v as getScopeId, w as replaceStencilCssComponentsImport, x as hasStencilCssComponentsImport, y as foldBuildFlags } from "../compiler-C9TOL5Mj.mjs";
2
2
  import { a as LOG_LEVELS, i as CustomElementsExportBehaviorOptions } from "../node-Bsfi3pOs.mjs";
3
3
  export { CustomElementsExportBehaviorOptions, LOG_LEVELS, buildHydrateCss, buildId, cmpMetaToDocsComponent, createCompiler, createPrerenderer, createSystem, createWorkerContext, createWorkerMessageHandler, foldBuildFlags, generateComponentTypesFile, generateManifest, getScopeId, hasStencilCssComponentsImport, hasStencilGlobalsImport, hasStencilHydrateImport, loadConfig, nodeRequire, optimizeCss, optimizeJs, parseCssOnlyComponents, replaceStencilCssComponentsImport, replaceStencilGlobalsImport, replaceStencilHydrateImport, scopeCss, transpile, transpileSync, ts, validateConfig, validateHydrated, vermoji, version, versions };
@@ -461,9 +461,9 @@ const scopeCss = (cssText, scopeId, commentOriginalSelector) => {
461
461
  };
462
462
  //#endregion
463
463
  //#region src/version.ts
464
- const version = "5.0.0-rc.7";
465
- const buildId = "1795178487";
466
- const vermoji = "⛳️";
464
+ const version = "5.0.0-rc.8";
465
+ const buildId = "1795181580";
466
+ const vermoji = "🌀";
467
467
  /**
468
468
  * Get the installed version of a tool/dependency.
469
469
  * Handles packages with exports maps that point to subdirectories.
@@ -1537,13 +1537,22 @@ const CSS_PROP_ANNOTATION_RE = /@(?:cssproperty|cssprop|prop)\b/;
1537
1537
  * than describing the node below its comment.
1538
1538
  */
1539
1539
  const CSS_ANNOTATION_TAG_RE = /@(?:component|cssproperty|cssprop|prop|attr|slot)\b/;
1540
+ const INTERNAL_TAG_RE = /@internal\b/;
1541
+ /**
1542
+ * Whether a comment marks the node immediately following it as internal - excluded from docs,
1543
+ * matching `@internal` on component members.
1544
+ * @param commentText a postcss `Comment` node's `.text`
1545
+ * @returns `true` if the comment is a JSDoc-style comment holding an `@internal` tag
1546
+ */
1547
+ const isInternalDocComment = (commentText) => isJsDocComment(commentText) && INTERNAL_TAG_RE.test(commentText);
1540
1548
  /**
1541
1549
  * Whether a comment describes the node immediately following it (a declaration, rule or
1542
- * at-rule). A comment holding annotation tags documents the things it names instead.
1550
+ * at-rule). A comment holding annotation tags documents the things it names instead, and an
1551
+ * `@internal` comment hides the node.
1543
1552
  * @param commentText a postcss `Comment` node's `.text`
1544
1553
  * @returns `true` if the comment is a JSDoc-style description of the next node
1545
1554
  */
1546
- const isNodeDocComment = (commentText) => isJsDocComment(commentText) && !CSS_ANNOTATION_TAG_RE.test(commentText);
1555
+ const isNodeDocComment = (commentText) => isJsDocComment(commentText) && !CSS_ANNOTATION_TAG_RE.test(commentText) && !INTERNAL_TAG_RE.test(commentText);
1547
1556
  /**
1548
1557
  * Strip the leading `*`/`!` marker and per-line `*` prefixes, returning trimmed lines.
1549
1558
  * @param commentText a postcss `Comment` node's `.text`
@@ -1708,7 +1717,10 @@ const parseCssComponentFile = async (filePath, cssText) => {
1708
1717
  }
1709
1718
  }
1710
1719
  collectAttributeRuleDocs(rawRoot, (selector) => defs.get(selector.tag ?? ""), attributeRuleDocs);
1711
- for (const [def, docsByName] of attributeRuleDocs) for (const attr of def.attributes) if (attr.source === "auto") attr.docs = docsByName.get(attr.name) ?? attr.docs;
1720
+ for (const [def, docsByName] of attributeRuleDocs) {
1721
+ def.attributes = def.attributes.filter((attr) => attr.source !== "auto" || docsByName.get(attr.name) !== null);
1722
+ for (const attr of def.attributes) if (attr.source === "auto") attr.docs = docsByName.get(attr.name) ?? attr.docs;
1723
+ }
1712
1724
  for (const node of nodes) {
1713
1725
  if (node.type !== "rule") continue;
1714
1726
  for (const selector of parseSelectorList(node.selector)) {
@@ -1722,8 +1734,9 @@ const parseCssComponentFile = async (filePath, cssText) => {
1722
1734
  if (node.type !== "atrule" || node.name !== "property") continue;
1723
1735
  const propName = node.params.trim();
1724
1736
  if (!propName.startsWith("--")) continue;
1725
- const { syntax, initialValue } = parsePropertyAtRuleDescriptors(node);
1726
1737
  const prev = nodes[i - 1];
1738
+ const isInternal = prev?.type === "comment" && isInternalDocComment(prev.text);
1739
+ const { syntax, initialValue } = parsePropertyAtRuleDescriptors(node);
1727
1740
  const docs = prev && prev.type === "comment" && isNodeDocComment(prev.text) ? normalizeJsDocText(prev.text) : "";
1728
1741
  for (const def of defs.values()) {
1729
1742
  const existing = def.properties.find((p) => p.name === propName);
@@ -1733,6 +1746,7 @@ const parseCssComponentFile = async (filePath, cssText) => {
1733
1746
  if (initialValue) existing.default ??= initialValue;
1734
1747
  continue;
1735
1748
  }
1749
+ if (isInternal) continue;
1736
1750
  const prop = {
1737
1751
  name: propName,
1738
1752
  docs,
@@ -1756,6 +1770,7 @@ const parseCssComponentFile = async (filePath, cssText) => {
1756
1770
  * @param def the CSS-only component definition the found slots belong to
1757
1771
  */
1758
1772
  const collectAutoDetectedSlots = (container, def) => {
1773
+ const internal = /* @__PURE__ */ new Set();
1759
1774
  for (const nested of container.nodes) {
1760
1775
  if (nested.type !== "rule") continue;
1761
1776
  const names = /* @__PURE__ */ new Set();
@@ -1766,9 +1781,14 @@ const collectAutoDetectedSlots = (container, def) => {
1766
1781
  } catch {
1767
1782
  continue;
1768
1783
  }
1784
+ const prev = nested.prev();
1785
+ const isInternal = prev?.type === "comment" && isInternalDocComment(prev.text);
1769
1786
  for (const name of names) {
1770
- if (def.slots.some((s) => s.name === name)) continue;
1771
- const prev = nested.prev();
1787
+ if (internal.has(name) || def.slots.some((s) => s.name === name)) continue;
1788
+ if (isInternal) {
1789
+ internal.add(name);
1790
+ continue;
1791
+ }
1772
1792
  const docs = prev && prev.type === "comment" && isNodeDocComment(prev.text) ? normalizeJsDocText(prev.text) : "";
1773
1793
  def.slots.push({
1774
1794
  name,
@@ -1866,8 +1886,8 @@ const collectAutoDetectedAttributes = (selector, def) => {
1866
1886
  };
1867
1887
  /**
1868
1888
  * Record the JSDoc comment directly above each of `container`'s child rules as the description
1869
- * of the attributes in that rule's leading compound selector. The first documented rule for an
1870
- * attribute wins.
1889
+ * of the attributes in that rule's leading compound selector, or `null` for an `@internal`
1890
+ * comment. The first documented rule for an attribute wins.
1871
1891
  * @param container a container whose direct child rules to scan
1872
1892
  * @param defFor the component a child rule's selector belongs to, if any
1873
1893
  * @param out collected descriptions, per component, by attribute name
@@ -1875,14 +1895,16 @@ const collectAutoDetectedAttributes = (selector, def) => {
1875
1895
  const collectAttributeRuleDocs = (container, defFor, out) => {
1876
1896
  for (const node of container.nodes) {
1877
1897
  const prev = node.prev();
1878
- if (node.type !== "rule" || prev?.type !== "comment" || !isNodeDocComment(prev.text)) continue;
1898
+ if (node.type !== "rule" || prev?.type !== "comment") continue;
1899
+ const isInternal = isInternalDocComment(prev.text);
1900
+ if (!isInternal && !isNodeDocComment(prev.text)) continue;
1879
1901
  let selectors;
1880
1902
  try {
1881
1903
  selectors = parseSelectorList(node.selector);
1882
1904
  } catch {
1883
1905
  continue;
1884
1906
  }
1885
- const docs = normalizeJsDocText(prev.text);
1907
+ const docs = isInternal ? null : normalizeJsDocText(prev.text);
1886
1908
  for (const selector of selectors) {
1887
1909
  const def = defFor(selector);
1888
1910
  if (!def) continue;
@@ -25440,8 +25462,9 @@ function parseScopedAndNativeStyleDocs(styleDocs, styleText, mode, tag, encapsul
25440
25462
  root.walkAtRules("property", (node) => {
25441
25463
  const propName = node.params.trim();
25442
25464
  if (!propName.startsWith("--")) return;
25443
- const { syntax, initialValue } = parsePropertyAtRuleDescriptors(node);
25444
25465
  const prev = node.prev();
25466
+ const isInternal = prev?.type === "comment" && isInternalDocComment(prev.text);
25467
+ const { syntax, initialValue } = parsePropertyAtRuleDescriptors(node);
25445
25468
  const docs = prev && prev.type === "comment" && isNodeDocComment(prev.text) ? normalizeJsDocText(prev.text) : "";
25446
25469
  const existing = styleDocs.find((styleDoc) => styleDoc.name === propName);
25447
25470
  if (existing) {
@@ -25450,6 +25473,7 @@ function parseScopedAndNativeStyleDocs(styleDocs, styleText, mode, tag, encapsul
25450
25473
  if (initialValue) existing.default ??= initialValue;
25451
25474
  return;
25452
25475
  }
25476
+ if (isInternal) return;
25453
25477
  styleDocs.push({
25454
25478
  name: propName,
25455
25479
  docs,
@@ -1,4 +1,4 @@
1
- import { l as createWorkerMessageHandler } from "../../compiler-CH-Qh_aM.mjs";
1
+ import { l as createWorkerMessageHandler } from "../../compiler-C9TOL5Mj.mjs";
2
2
  import { t as createNodeSys } from "../../node-Bsfi3pOs.mjs";
3
3
  //#region src/sys/node/node-worker-thread.ts
4
4
  /**
@@ -33,7 +33,7 @@ import "@rollup/pluginutils";
33
33
  import { createHash } from "crypto";
34
34
  import { afterAll, vi } from "vitest";
35
35
  //#region src/version.ts
36
- const version = "5.0.0-rc.7";
36
+ const version = "5.0.0-rc.8";
37
37
  const MEMBER_FLAGS = {
38
38
  String: 1,
39
39
  Number: 2,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core",
3
- "version": "5.0.0-rc.7",
3
+ "version": "5.0.0-rc.8",
4
4
  "description": "A Compiler for Web Components and Progressive Web Apps",
5
5
  "keywords": [
6
6
  "components",
@@ -126,9 +126,9 @@
126
126
  "terser": "^5.50.0",
127
127
  "tinyglobby": "^0.2.17",
128
128
  "typescript": ">5.0.0 <7.0.0",
129
- "@stencil/cli": "5.0.0-rc.7",
130
- "@stencil/mock-doc": "5.0.0-rc.7",
131
- "@stencil/dev-server": "5.0.0-rc.7"
129
+ "@stencil/mock-doc": "5.0.0-rc.8",
130
+ "@stencil/cli": "5.0.0-rc.8",
131
+ "@stencil/dev-server": "5.0.0-rc.8"
132
132
  },
133
133
  "devDependencies": {
134
134
  "@ionic/prettier-config": "^4.0.0",