@mui/internal-docs-infra 0.13.1-canary.25 → 0.13.1-canary.26

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/internal-docs-infra",
3
- "version": "0.13.1-canary.25",
3
+ "version": "0.13.1-canary.26",
4
4
  "author": "MUI Team",
5
5
  "description": "MUI Infra - internal documentation creation tools.",
6
6
  "license": "MIT",
@@ -813,5 +813,5 @@
813
813
  "bin": {
814
814
  "docs-infra": "./cli/index.mjs"
815
815
  },
816
- "gitSha": "14af67ff2d43511e6f866e18b25a41ae856409eb"
816
+ "gitSha": "0b3f2360f94b9da7ae1cc548bf4e336e101735e5"
817
817
  }
@@ -12,7 +12,7 @@ export type ComponentConstantGroups = Partial<Record<ConstantGroupKind, tae.Enum
12
12
  /** The value of a constant in a constant group. */
13
13
  type ConstantValue = string | number;
14
14
  /**
15
- * Finds the entrypoint's namespace exports whose module holds nothing but literal constants,
15
+ * Finds the entrypoint's namespace exports whose module's value exports are all literal constants,
16
16
  * e.g. `export * as ButtonDataAttributes from './ButtonDataAttributes'`, with their values.
17
17
  * Namespaces nested in other namespace exports are found too, under their dotted path
18
18
  * (`Toolbar.ButtonDataAttributes`).
@@ -41,11 +41,15 @@ function readLiteralConstant(symbol, checker) {
41
41
  }
42
42
 
43
43
  /**
44
- * Reads a module's exports as constant values, when it exports nothing but literal constants.
44
+ * Reads a module's exports as constant values, when its value exports are nothing but literal
45
+ * constants. Type-only exports, such as a union of the constants, are typing helpers and are
46
+ * skipped rather than disqualifying the module.
45
47
  */
46
48
  function readConstantModule(moduleSymbol, checker) {
47
49
  const values = new Map();
48
- const members = checker.getExportsOfModule(moduleSymbol);
50
+ const members = checker.getExportsOfModule(moduleSymbol)
51
+ // eslint-disable-next-line no-bitwise -- TypeScript symbol flags are a bitmask
52
+ .filter(member => resolveAlias(member, checker).flags & ts.SymbolFlags.Value);
49
53
  const isConstantModule = members.length > 0 && members.every(member => {
50
54
  const value = readLiteralConstant(resolveAlias(member, checker), checker);
51
55
  if (value === undefined) {
@@ -58,7 +62,7 @@ function readConstantModule(moduleSymbol, checker) {
58
62
  }
59
63
 
60
64
  /**
61
- * Finds the entrypoint's namespace exports whose module holds nothing but literal constants,
65
+ * Finds the entrypoint's namespace exports whose module's value exports are all literal constants,
62
66
  * e.g. `export * as ButtonDataAttributes from './ButtonDataAttributes'`, with their values.
63
67
  * Namespaces nested in other namespace exports are found too, under their dotted path
64
68
  * (`Toolbar.ButtonDataAttributes`).