ShtukbaseStandard
файл пакета→ .shtukbase/packages/design-components/checks/health.ts

checks/health.ts

17 строк, 951 Б.

Файл как есть в пакете: код и комментарии в нём не переводятся.

  1. // DSC-R05. The health of a component library, a norm in the mode `warn` (convention /design/conventions/component-library.md):
  2. // header format, colours from tokens only and coverage of the shadcn component list, reported in bands and never failing.
  3. // health component-library/<lib>: full | missing: <files> | fallbacks: <components> | extra: <what>
  4. // The libraries judged are the ones chosen on /design/design.md (else every one that holds components); `--lib <id>` names one.
  5. // Exit code 0 always.
  6. import { healthLines } from '../lib/health.ts';
  7. export const RULE = { id: 'dsc-r05', title: 'The health of a component library' };
  8. export const check = (root = process.cwd(), lib?: string): string[] => healthLines(root, lib);
  9. if (import.meta.main) {
  10. const args = process.argv.slice(2);
  11. const i = args.indexOf('--lib');
  12. const out = check(process.cwd(), i >= 0 ? args[i + 1] : undefined);
  13. if (out.length) console.log(out.join('\n'));
  14. }