archivo del paquete→ .shtukbase/packages/design-components/checks/health.ts
checks/health.ts
17 líneas, 951 B.
El archivo tal como está en el paquete: el código y sus comentarios no se traducen.
- // DSC-R05. The health of a component library, a norm in the mode `warn` (convention /design/conventions/component-library.md):
- // header format, colours from tokens only and coverage of the shadcn component list, reported in bands and never failing.
- // health component-library/<lib>: full | missing: <files> | fallbacks: <components> | extra: <what>
- // The libraries judged are the ones chosen on /design/design.md (else every one that holds components); `--lib <id>` names one.
- // Exit code 0 always.
- import { healthLines } from '../lib/health.ts';
- export const RULE = { id: 'dsc-r05', title: 'The health of a component library' };
- export const check = (root = process.cwd(), lib?: string): string[] => healthLines(root, lib);
- if (import.meta.main) {
- const args = process.argv.slice(2);
- const i = args.indexOf('--lib');
- const out = check(process.cwd(), i >= 0 ? args[i + 1] : undefined);
- if (out.length) console.log(out.join('\n'));
- }