@theholocron/cli 5.0.0-alpha.279 → 5.0.0-alpha.280

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/dist/cli.mjs CHANGED
@@ -2285,7 +2285,9 @@ var MissingTokenError = class extends Error {
2285
2285
  name = "MissingTokenError";
2286
2286
  };
2287
2287
  // src/config/config/config.ts
2288
+ /** Thrown when a `holocron.config` is invalid. */
2288
2289
  var ConfigError = class extends Error {
2290
+ /** The error's name, `"ConfigError"`. */
2289
2291
  name = "ConfigError";
2290
2292
  };
2291
2293
  const PLUGIN_PREFIX = "@theholocron/holocron-plugin-";
@@ -2323,6 +2325,7 @@ function normalizeEntry(entry) {
2323
2325
  options
2324
2326
  };
2325
2327
  }
2328
+ /** Resolves one capability's raw provider entry into single or multiple resolved tuples, checking it against the capability's cardinality. */
2326
2329
  function resolveEntry(key, raw) {
2327
2330
  const cardinality = CARDINALITY[key];
2328
2331
  if (typeof raw === "string") {
@@ -2359,6 +2362,7 @@ const DOCS_COVERAGE_MODES = [
2359
2362
  "warn",
2360
2363
  "required"
2361
2364
  ];
2365
+ /** Validates a raw `holocron.config` and resolves its provider entries; throws `ConfigError` when `name` or `providers` is missing or an entry is malformed. */
2362
2366
  function resolveConfig(raw) {
2363
2367
  if (!raw.name) throw new ConfigError("`name` is required");
2364
2368
  if (!raw.providers || typeof raw.providers !== "object") throw new ConfigError("`providers` block is required");
@@ -12669,6 +12673,8 @@ const KINDS = {
12669
12673
  262144: "Accessor",
12670
12674
  2097152: "TypeAlias"
12671
12675
  };
12676
+ /** A path inside a `dist/` folder: compiled output, not a package's own source. */
12677
+ const BUILD_OUTPUT = /(^|\/)dist\//;
12672
12678
  function hasComment(comment) {
12673
12679
  return Boolean(comment?.summary?.length || comment?.blockTags?.length);
12674
12680
  }
@@ -12678,22 +12684,23 @@ function isDocumented(r) {
12678
12684
  /**
12679
12685
  * The symbols a package exports that should carry a doc comment, from TypeDoc's JSON model: functions, classes,
12680
12686
  * interfaces, type aliases, variables, enums, and the public members of those. Private, inherited and external
12681
- * members are not counted. `fallbackFile` stands in for a symbol TypeDoc gives no source for.
12687
+ * members are not counted, nor is a symbol whose source is a build output (`dist/`): a package that re-exports another
12688
+ * one sees that package's compiled declarations, which lose the member comments the source has, and the symbol is
12689
+ * measured in its own package. `fallbackFile` stands in for a symbol TypeDoc gives no source for.
12682
12690
  */
12683
12691
  function countSymbols(children, fallbackFile) {
12684
12692
  const out = [];
12685
12693
  const walk = (r) => {
12686
12694
  const kind = KINDS[r.kind];
12687
- if (kind && !r.flags?.isPrivate && !r.flags?.isExternal && !r.inheritedFrom) {
12688
- const source = r.sources?.[0] ?? r.signatures?.[0]?.sources?.[0];
12689
- out.push({
12690
- kind,
12691
- name: r.name,
12692
- file: source?.fileName ?? fallbackFile,
12693
- line: source?.line ?? 1,
12694
- documented: isDocumented(r)
12695
- });
12696
- }
12695
+ const source = r.sources?.[0] ?? r.signatures?.[0]?.sources?.[0];
12696
+ if (source && BUILD_OUTPUT.test(source.fileName)) return;
12697
+ if (kind && !r.flags?.isPrivate && !r.flags?.isExternal && !r.inheritedFrom) out.push({
12698
+ kind,
12699
+ name: r.name,
12700
+ file: source?.fileName ?? fallbackFile,
12701
+ line: source?.line ?? 1,
12702
+ documented: isDocumented(r)
12703
+ });
12697
12704
  for (const child of r.children ?? []) walk(child);
12698
12705
  for (const child of r.type?.declaration?.children ?? []) walk(child);
12699
12706
  };
@@ -13916,6 +13923,7 @@ function deriveCapabilities(providers) {
13916
13923
  * a Phase B (GitHub App) refinement once it can post *why* on a check run.
13917
13924
  */
13918
13925
  const REQUIRED_BASELINE = ["source", "ci"];
13926
+ /** Whether a repo's capabilities include the required baseline (`source` and `ci`); `non-compliant` means drift. */
13919
13927
  function deriveCompliance(capabilities) {
13920
13928
  return REQUIRED_BASELINE.every((key) => capabilities.includes(key)) ? "compliant" : "non-compliant";
13921
13929
  }