@marktiderman/genesis-cli 1.4.0 → 1.6.0

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.
@@ -56,15 +56,41 @@ interface PatternRule {
56
56
  }
57
57
  /** A plugin entry in config: a module path, or `[path, options]`. */
58
58
  type PluginSpec = string | [string, unknown];
59
+ /** An opt-in rule pack. */
60
+ type DoctorPack = "native" | "supabase";
61
+ /** Settings for the `native` pack. */
62
+ interface NativePackConfig {
63
+ /** The Expo Router root, relative to the app. Default: `src/app`, else `app`. */
64
+ routerRoot?: string;
65
+ }
66
+ /** Settings for the `supabase` pack. */
67
+ interface SupabasePackConfig {
68
+ /** The migrations folder. Default `supabase/migrations`. */
69
+ migrations?: string;
70
+ /** The git ref applied migrations are compared against. Default `origin/main`. */
71
+ base?: string;
72
+ /** Schemas the API exposes: their tables need row level security, and only their functions may be granted to anon/public. Default `["public"]`. */
73
+ exposedSchemas?: string[];
74
+ /**
75
+ * A migration file name or timestamp prefix: files sorting before it are applied and
76
+ * trusted by `migration-grants`. Without it, grants are checked only when git can
77
+ * tell new migrations from applied ones.
78
+ */
79
+ since?: string;
80
+ }
59
81
  /** The `doctor` block of genesis.config.json (or package.json `genesis.doctor`). */
60
82
  interface DoctorConfig {
61
- /** Folders to scan, relative to the app root. Default `["src"]`. */
83
+ /** Opt-in rule packs: `native` (Expo apps) and `supabase` (migrations). Default none. */
84
+ packs?: DoctorPack[];
85
+ native?: NativePackConfig;
86
+ supabase?: SupabasePackConfig;
87
+ /** Folders to scan, relative to the app root. Default `["src"]` (`["app", "src", "components"]` with the native pack). */
62
88
  src?: string[];
63
89
  /** File extensions to scan. Default `.ts .tsx .js .jsx .mts .cts .css`. */
64
90
  extensions?: string[];
65
91
  /** Extra globs to skip, on top of the defaults (tests, fixtures, `.d.ts`, `*.gen.*`). */
66
92
  ignore?: string[];
67
- /** The component package. Default `@marktiderman/genesis-ui`. */
93
+ /** The component package. Default `@marktiderman/genesis-ui` (`@marktiderman/genesis-ui-native` with the native pack). */
68
94
  uiPackage?: string;
69
95
  /**
70
96
  * Theme stylesheet(s) whose custom properties are the defined tokens: one
@@ -197,4 +223,4 @@ declare function validateLinks(raw: unknown, source?: string): GenesisLinks;
197
223
  /** Check the shape, so a typo fails loudly instead of silently disabling a check. */
198
224
  declare function validateConfig(raw: unknown, source?: string): DoctorConfig;
199
225
 
200
- export { type AllowEntry as A, type DoctorConfig as D, type Finding as F, type GenesisLinks as G, type Level as L, type PatternRule as P, type RuleSetting as R, type SourceFile as S, GenesisConfigError as a, DoctorConfigError as b, type DoctorContext as c, type DoctorPlugin as d, type DoctorResult as e, type GenesisConfigFile as f, type GenesisFacts as g, type FindingInput as h, type PluginSpec as i, validateConfig as j, loadConfig as l, readGenesisConfig as r, validateLinks as v };
226
+ export { type AllowEntry as A, type DoctorConfig as D, type Finding as F, type GenesisLinks as G, type Level as L, type NativePackConfig as N, type PatternRule as P, type RuleSetting as R, type SourceFile as S, GenesisConfigError as a, DoctorConfigError as b, type DoctorContext as c, type DoctorPlugin as d, type DoctorResult as e, type GenesisConfigFile as f, type GenesisFacts as g, type DoctorPack as h, type FindingInput as i, type PluginSpec as j, type SupabasePackConfig as k, loadConfig as l, validateConfig as m, readGenesisConfig as r, validateLinks as v };
package/dist/doctor.d.ts CHANGED
@@ -1,9 +1,22 @@
1
- import { D as DoctorConfig, g as GenesisFacts, P as PatternRule, d as DoctorPlugin, e as DoctorResult, F as Finding } from './config-Ci-_Ue-1.js';
2
- export { A as AllowEntry, b as DoctorConfigError, c as DoctorContext, h as FindingInput, a as GenesisConfigError, f as GenesisConfigFile, G as GenesisLinks, L as Level, i as PluginSpec, R as RuleSetting, S as SourceFile, l as loadConfig, r as readGenesisConfig, j as validateConfig, v as validateLinks } from './config-Ci-_Ue-1.js';
1
+ import { D as DoctorConfig, g as GenesisFacts, P as PatternRule, d as DoctorPlugin, e as DoctorResult, F as Finding } from './config-CUdwT-nY.js';
2
+ export { A as AllowEntry, b as DoctorConfigError, c as DoctorContext, h as DoctorPack, i as FindingInput, a as GenesisConfigError, f as GenesisConfigFile, G as GenesisLinks, L as Level, N as NativePackConfig, j as PluginSpec, R as RuleSetting, S as SourceFile, k as SupabasePackConfig, l as loadConfig, r as readGenesisConfig, m as validateConfig, v as validateLinks } from './config-CUdwT-nY.js';
3
3
 
4
4
  /** The installed folder of `name`, looking in node_modules from `from` upward (works with hoisting and pnpm). */
5
5
  declare function findPackageDir(from: string, name: string): string | null;
6
+ /** What one installed component package exports, read from its type declarations. */
7
+ interface PackageExports {
8
+ dir: string;
9
+ version: string;
10
+ /** Every exported name (all subpaths). */
11
+ exports: Set<string>;
12
+ /** Exported values (not types). */
13
+ values: Set<string>;
14
+ /** Exported components, sorted. */
15
+ components: string[];
16
+ }
6
17
  declare function loadGenesis(root: string, config: DoctorConfig): GenesisFacts;
18
+ /** An installed package's exports, from its declarations (every subpath), or null when it isn't installed. */
19
+ declare function readPackageExports(root: string, uiPackage: string): PackageExports | null;
7
20
  /** Names exported by a declaration file: `export { a, b as c }` blocks and `export declare …` statements. */
8
21
  declare function parseExportNames(dts: string): string[];
9
22
 
@@ -13,7 +26,7 @@ declare function parseRulesMarkdown(markdown: string): PatternRule[];
13
26
  declare function defineDoctorPlugin(plugin: DoctorPlugin): DoctorPlugin;
14
27
 
15
28
  /** Ids of the built-in rules, for `rules` overrides and `allow` entries. */
16
- declare const BUILTIN_RULES: readonly ["local-primitives", "starter-leftover", "forbidden-import", "raw-tag", "palette-color", "arbitrary-color", "raw-color", "undefined-token", "shadowed-export", "version-skew"];
29
+ declare const BUILTIN_RULES: readonly ["local-primitives", "starter-leftover", "forbidden-import", "raw-tag", "palette-color", "arbitrary-color", "raw-color", "undefined-token", "shadowed-export", "version-skew", "native-raw-primitive", "native-literal-color", "native-custom-header", "native-screen-layout", "store-readiness", "migration-grants", "migration-rls", "migration-definer-search-path", "migration-edited"];
17
30
 
18
31
  /**
19
32
  * Minimal globs for config: `*` matches within a folder, `**` across folders,
@@ -21,6 +34,20 @@ declare const BUILTIN_RULES: readonly ["local-primitives", "starter-leftover", "
21
34
  */
22
35
  declare function globToRegExp(glob: string): RegExp;
23
36
 
37
+ /** Genesis screen layouts the installed native package exports, sorted. */
38
+ declare function nativeLayouts(pkg: Pick<PackageExports, "components">): string[];
39
+
40
+ interface SqlStatement {
41
+ /** The statement, lowercased, comments removed, literals blanked, whitespace collapsed. */
42
+ sql: string;
43
+ /** 1-based line where it starts. */
44
+ line: number;
45
+ /** The lowercased text of each dollar-quoted body in the statement (`do $$ … $$`, function bodies). */
46
+ bodies: string[];
47
+ }
48
+ /** Split SQL into statements, dropping comments and blanking quoted literals and dollar-quoted bodies. */
49
+ declare function sqlStatements(text: string): SqlStatement[];
50
+
24
51
  /** The shape of the umbrella's `dist/versions.json`. */
25
52
  interface ReleaseManifest {
26
53
  version: string;
@@ -68,4 +95,4 @@ declare function genesisSummary(g: GenesisFacts): {
68
95
  palette: readonly string[];
69
96
  };
70
97
 
71
- export { BUILTIN_RULES, DoctorConfig, DoctorPlugin, DoctorResult, Finding, GenesisFacts, PatternRule, type ReleaseManifest, type RunDoctorOptions, defineDoctorPlugin, findPackageDir, formatReport, genesisSummary, globToRegExp, loadGenesis, parseExportNames, parseRulesMarkdown, readReleaseManifest, runDoctor, toJson };
98
+ export { BUILTIN_RULES, DoctorConfig, DoctorPlugin, DoctorResult, Finding, GenesisFacts, PatternRule, type ReleaseManifest, type RunDoctorOptions, defineDoctorPlugin, findPackageDir, formatReport, genesisSummary, globToRegExp, loadGenesis, nativeLayouts, parseExportNames, parseRulesMarkdown, readPackageExports, readReleaseManifest, runDoctor, sqlStatements, toJson };