@marktiderman/genesis-cli 1.7.0 → 1.9.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.
- package/README.md +26 -4
- package/dist/cli.js +933 -319
- package/dist/cli.js.map +1 -1
- package/dist/{config-CrZbM3jD.d.ts → config-QC_Ewwwp.d.ts} +27 -3
- package/dist/doctor.d.ts +68 -4
- package/dist/doctor.js +654 -87
- package/dist/doctor.js.map +1 -1
- package/dist/expo.d.ts +2 -2
- package/dist/expo.js.map +1 -1
- package/dist/genesis-catalog.json +164 -14
- package/dist/index.d.ts +1 -1
- package/dist/index.js +666 -101
- package/dist/index.js.map +1 -1
- package/dist/starter/.env.example +3 -0
- package/dist/starter/README.md +7 -0
- package/dist/starter/__tests__/app-config.test.ts +27 -0
- package/dist/starter/__tests__/chat-outboxes.test.ts +64 -0
- package/dist/starter/__tests__/check-in-photos.test.ts +5 -3
- package/dist/starter/__tests__/components/fake-supabase.ts +8 -0
- package/dist/starter/__tests__/components/messages.test.tsx +33 -0
- package/dist/starter/__tests__/components/settings.test.tsx +34 -0
- package/dist/starter/__tests__/components/setup.ts +13 -0
- package/dist/starter/__tests__/components/tabs-feature-off.test.tsx +1 -1
- package/dist/starter/__tests__/components/tabs.test.tsx +2 -2
- package/dist/starter/__tests__/inline-copy.ts +1 -1
- package/dist/starter/__tests__/starter.test.ts +117 -3
- package/dist/starter/app.config.ts +19 -2
- package/dist/starter/genesis.config.json +2 -2
- package/dist/starter/jest.config.js +2 -1
- package/dist/starter/metro.config.js +1 -1
- package/dist/starter/package.json +9 -0
- package/dist/starter/src/app/(app)/(home)/check-in.tsx +4 -38
- package/dist/starter/src/app/(app)/_layout.tsx +25 -3
- package/dist/starter/src/app/(app)/messages/[id].tsx +63 -0
- package/dist/starter/src/app/(app)/messages/_layout.tsx +11 -0
- package/dist/starter/src/app/(app)/messages/check-in.tsx +9 -0
- package/dist/starter/src/app/(app)/messages/index.tsx +38 -0
- package/dist/starter/src/app/(app)/messages/search.tsx +39 -0
- package/dist/starter/src/app/(app)/notifications/index.tsx +7 -13
- package/dist/starter/src/app/(app)/settings/availability.tsx +16 -0
- package/dist/starter/src/app/(app)/settings/index.tsx +8 -3
- package/dist/starter/src/app/(app)/settings/notifications.tsx +6 -3
- package/dist/starter/src/copy.ts +19 -0
- package/dist/starter/src/lib/chat-outboxes.ts +50 -0
- package/dist/starter/src/lib/chat-video.ts +57 -0
- package/dist/starter/src/lib/chat.tsx +319 -0
- package/dist/starter/src/lib/check-in-screen.tsx +43 -0
- package/dist/starter/src/lib/define-starter.ts +9 -0
- package/dist/starter/src/lib/env.ts +4 -0
- package/dist/starter/src/lib/links.ts +2 -0
- package/dist/starter/src/lib/notifications.ts +30 -12
- package/dist/starter/src/lib/push.ts +21 -5
- package/dist/starter/starter.config.ts +1 -0
- package/dist/starter/supabase/config.toml +5 -0
- package/dist/starter/supabase/migrations/20261025000000_genesis_chat.sql +1836 -0
- package/dist/starter/supabase/migrations/20261025000050_genesis_chat_coaching.sql +934 -0
- package/dist/starter/supabase/migrations/20261025000060_genesis_chat_search_threads.sql +85 -0
- package/dist/starter/supabase/migrations/20261025000100_genesis_notifications.sql +2057 -0
- package/dist/starter/supabase/migrations/20261026000000_chat_people.sql +57 -0
- package/dist/starter/supabase/tests/database/chat_people.test.sql +112 -0
- package/dist/starter/supabase/tests/database/genesis_chat.test.sql +254 -0
- package/dist/starter/supabase/tests/database/genesis_chat_coaching.test.sql +269 -0
- package/dist/starter/supabase/tests/database/genesis_chat_search_threads.test.sql +50 -0
- package/dist/starter/supabase/tests/database/genesis_notifications.test.sql +473 -0
- package/dist/vite.js +651 -86
- package/dist/vite.js.map +1 -1
- package/package.json +3 -3
- package/dist/starter/supabase/tests/database/genesis_push.test.sql +0 -407
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Public types for `genesis doctor` and its rule plugins.
|
|
3
3
|
*/
|
|
4
|
-
|
|
4
|
+
/** `info` is reported but never fails a run, `--strict` included. */
|
|
5
|
+
type Level = "error" | "warn" | "info";
|
|
5
6
|
/** A rule's configured level: a level, or `"off"` to drop its findings. */
|
|
6
7
|
type RuleSetting = Level | "off";
|
|
7
8
|
/** One problem the doctor found. */
|
|
@@ -113,7 +114,7 @@ interface DoctorConfig {
|
|
|
113
114
|
forbiddenImports?: Record<string, string>;
|
|
114
115
|
/** Folders that must not exist (local design-system primitives). Default `["src/components/ui"]`. */
|
|
115
116
|
localPrimitiveDirs?: string[];
|
|
116
|
-
/** Per-rule level overrides, e.g. `{ "raw-color": "warn", "palette-color": "off" }`. */
|
|
117
|
+
/** Per-rule level overrides, e.g. `{ "raw-color": "warn", "palette-color": "off" }`. `info` never fails a run. */
|
|
117
118
|
rules?: Record<string, RuleSetting>;
|
|
118
119
|
/** Justified exceptions. */
|
|
119
120
|
allow?: AllowEntry[];
|
|
@@ -123,6 +124,18 @@ interface DoctorConfig {
|
|
|
123
124
|
rulesDoc?: string;
|
|
124
125
|
/** Rule modules, resolved relative to the config file. */
|
|
125
126
|
plugins?: PluginSpec[];
|
|
127
|
+
/**
|
|
128
|
+
* The web app's file-based routes folder, read by the structure rules
|
|
129
|
+
* (`hand-rolled-sub-nav`, `resource-workspace`, `page-layout`). Default: the
|
|
130
|
+
* first of `src/routes`, `src/app`, `app`, `src/pages`, `pages` that exists.
|
|
131
|
+
*/
|
|
132
|
+
routesDir?: string;
|
|
133
|
+
/**
|
|
134
|
+
* Genesis packages besides `uiPackage` whose exported components an app
|
|
135
|
+
* should reuse, not copy (`local-genesis-copy`). Default
|
|
136
|
+
* `["@marktiderman/genesis-forms-studio"]`; packages not installed are skipped.
|
|
137
|
+
*/
|
|
138
|
+
componentPackages?: string[];
|
|
126
139
|
/** Commands `--build` runs, in order. Default: the app's `typecheck` then `build` scripts. */
|
|
127
140
|
build?: string[];
|
|
128
141
|
}
|
|
@@ -142,6 +155,15 @@ interface GenesisFacts {
|
|
|
142
155
|
rawTags: ReadonlyMap<string, string>;
|
|
143
156
|
/** Tailwind palette color names (red, slate, …). */
|
|
144
157
|
palette: readonly string[];
|
|
158
|
+
/** The installed `componentPackages` (forms-studio by default) and the components each exports. */
|
|
159
|
+
companions: ReadonlyArray<CompanionPackage>;
|
|
160
|
+
}
|
|
161
|
+
/** A Genesis component package read alongside the main one. */
|
|
162
|
+
interface CompanionPackage {
|
|
163
|
+
package: string;
|
|
164
|
+
version: string;
|
|
165
|
+
/** Exported components, sorted. */
|
|
166
|
+
components: readonly string[];
|
|
145
167
|
}
|
|
146
168
|
/** One scanned file. */
|
|
147
169
|
interface SourceFile {
|
|
@@ -180,6 +202,8 @@ interface DoctorResult {
|
|
|
180
202
|
ruleCount: number;
|
|
181
203
|
errors: number;
|
|
182
204
|
warnings: number;
|
|
205
|
+
/** Findings at `info`: shown, never failing. */
|
|
206
|
+
infos: number;
|
|
183
207
|
}
|
|
184
208
|
|
|
185
209
|
/** A genesis.config.json that can't be read or has a block of the wrong shape. */
|
|
@@ -266,4 +290,4 @@ declare function validateLinks(raw: unknown, source?: string): GenesisLinks;
|
|
|
266
290
|
/** Check the shape, so a typo fails loudly instead of silently disabling a check. */
|
|
267
291
|
declare function validateConfig(raw: unknown, source?: string): DoctorConfig;
|
|
268
292
|
|
|
269
|
-
export { type AllowEntry as A, type DoctorConfig as D, type Finding as F, type GenesisDataUse as G, type Level as L, type NativePackConfig as N, PRIVACY_DATA_TYPES as P, type RuleSetting as R, type SourceFile as S, type GenesisPrivacy as a, type GenesisLinks as b, GenesisConfigError as c, PRIVACY_PURPOSES as d, validatePrivacy as e, DoctorConfigError as f, type DoctorContext as g, type DoctorPlugin as h, type DoctorResult as i, type GenesisConfigFile as j, type GenesisFacts as k, type PatternRule as l, type DoctorPack as m, type FindingInput as n, type PluginSpec as o, privacyDataType as p, type SupabasePackConfig as q, readGenesisConfig as r, loadConfig as s, validateConfig as t, validateLinks as v };
|
|
293
|
+
export { type AllowEntry as A, type CompanionPackage as C, type DoctorConfig as D, type Finding as F, type GenesisDataUse as G, type Level as L, type NativePackConfig as N, PRIVACY_DATA_TYPES as P, type RuleSetting as R, type SourceFile as S, type GenesisPrivacy as a, type GenesisLinks as b, GenesisConfigError as c, PRIVACY_PURPOSES as d, validatePrivacy as e, DoctorConfigError as f, type DoctorContext as g, type DoctorPlugin as h, type DoctorResult as i, type GenesisConfigFile as j, type GenesisFacts as k, type PatternRule as l, type DoctorPack as m, type FindingInput as n, type PluginSpec as o, privacyDataType as p, type SupabasePackConfig as q, readGenesisConfig as r, loadConfig as s, validateConfig as t, validateLinks as v };
|
package/dist/doctor.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { D as DoctorConfig, k as GenesisFacts, l as PatternRule, h as DoctorPlugin, i as DoctorResult, F as Finding } from './config-
|
|
2
|
-
export { A as AllowEntry,
|
|
1
|
+
import { D as DoctorConfig, k as GenesisFacts, l as PatternRule, h as DoctorPlugin, S as SourceFile, g as DoctorContext, i as DoctorResult, F as Finding } from './config-QC_Ewwwp.js';
|
|
2
|
+
export { A as AllowEntry, C as CompanionPackage, f as DoctorConfigError, m as DoctorPack, n as FindingInput, c as GenesisConfigError, j as GenesisConfigFile, b as GenesisLinks, L as Level, N as NativePackConfig, o as PluginSpec, R as RuleSetting, q as SupabasePackConfig, s as loadConfig, r as readGenesisConfig, t as validateConfig, v as validateLinks } from './config-QC_Ewwwp.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;
|
|
@@ -26,7 +26,7 @@ declare function parseRulesMarkdown(markdown: string): PatternRule[];
|
|
|
26
26
|
declare function defineDoctorPlugin(plugin: DoctorPlugin): DoctorPlugin;
|
|
27
27
|
|
|
28
28
|
/** Ids of the built-in rules, for `rules` overrides and `allow` entries. */
|
|
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"];
|
|
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", "duplicate-genesis-package", "peer-range-mismatch", "hand-rolled-sub-nav", "local-genesis-copy", "resource-workspace", "page-layout", "iso-date-slice", "native-raw-primitive", "native-literal-color", "native-custom-header", "native-screen-layout", "store-readiness", "migration-grants", "migration-rls", "migration-definer-search-path", "migration-edited", "migration-testing-kit"];
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
32
|
* Minimal globs for config: `*` matches within a folder, `**` across folders,
|
|
@@ -56,6 +56,60 @@ interface ReleaseManifest {
|
|
|
56
56
|
/** The installed umbrella's manifest, or null when there's no umbrella or no manifest. */
|
|
57
57
|
declare function readReleaseManifest(root: string): ReleaseManifest | null;
|
|
58
58
|
|
|
59
|
+
/** One physical copy of a Genesis package, and who asked for it. */
|
|
60
|
+
interface GenesisInstall {
|
|
61
|
+
name: string;
|
|
62
|
+
version: string;
|
|
63
|
+
/** Folder relative to the app root, POSIX separators. */
|
|
64
|
+
dir: string;
|
|
65
|
+
/** The folder's real absolute path. */
|
|
66
|
+
absolutePath: string;
|
|
67
|
+
/** `the app` or `<package>@<version>`, with the range it declared. */
|
|
68
|
+
requiredBy: Array<{
|
|
69
|
+
by: string;
|
|
70
|
+
range?: string;
|
|
71
|
+
}>;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Every installed copy of every Genesis package the app can load, by name.
|
|
75
|
+
*
|
|
76
|
+
* Follows resolution, not folder layout: from each top-level package in the
|
|
77
|
+
* app's `node_modules` (and the app's own dependencies), each dependency is
|
|
78
|
+
* resolved the way Node does, from the real folder of the package asking. That
|
|
79
|
+
* covers npm/yarn/bun hoisted and nested trees, pnpm's `.pnpm` store (in the
|
|
80
|
+
* app or at a workspace root above a sub-app) and bun's isolated `.bun` store,
|
|
81
|
+
* where a package's dependencies are its siblings in the store entry. Copies
|
|
82
|
+
* nothing resolves to are left out: they never load.
|
|
83
|
+
*/
|
|
84
|
+
declare function genesisInstalls(root: string): Map<string, GenesisInstall[]>;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Whether `version` satisfies `range`; null when either isn't semver (the caller
|
|
88
|
+
* can't judge it). A prerelease satisfies a set only if one of its comparators
|
|
89
|
+
* names the same major.minor.patch with a prerelease.
|
|
90
|
+
*/
|
|
91
|
+
declare function satisfies(version: string, range: string): boolean | null;
|
|
92
|
+
|
|
93
|
+
interface RouteFile {
|
|
94
|
+
file: SourceFile;
|
|
95
|
+
/** Path segments (`$param`, `[param]` and pathless `_layout` segments included), without the index/route stem. */
|
|
96
|
+
segments: string[];
|
|
97
|
+
/** The folder's own page: `index.tsx`, `page.tsx`, `my.index.tsx`. */
|
|
98
|
+
index: boolean;
|
|
99
|
+
/** Wraps child routes: `route.tsx` / `layout.tsx` / `__root`, or a file rendering `<Outlet>`. */
|
|
100
|
+
layout: boolean;
|
|
101
|
+
/** Its own last segment is a param (`$courseId`, `[id]`): a detail page. */
|
|
102
|
+
detail: boolean;
|
|
103
|
+
/** Renders nothing but a redirect (or no JSX at all). */
|
|
104
|
+
redirectOnly: boolean;
|
|
105
|
+
/** The layout routes around it, nearest first. */
|
|
106
|
+
parents: RouteFile[];
|
|
107
|
+
}
|
|
108
|
+
/** The routes folder (`routesDir`, else the first candidate that exists), or null. */
|
|
109
|
+
declare function routesDir(ctx: Pick<DoctorContext, "root" | "config">): string | null;
|
|
110
|
+
/** Every scanned JSX route file under the routes folder, with its layouts. Empty without one. */
|
|
111
|
+
declare function webRoutes(ctx: Pick<DoctorContext, "root" | "config" | "files">): RouteFile[];
|
|
112
|
+
|
|
59
113
|
interface RunDoctorOptions {
|
|
60
114
|
/** The app root. Default `process.cwd()`. */
|
|
61
115
|
root?: string;
|
|
@@ -73,6 +127,12 @@ interface RunDoctorOptions {
|
|
|
73
127
|
genesis?: GenesisFacts;
|
|
74
128
|
}
|
|
75
129
|
declare function runDoctor(options?: RunDoctorOptions): Promise<DoctorResult>;
|
|
130
|
+
/**
|
|
131
|
+
* The built-in checks, in the order they run. A new built-in rule is a check
|
|
132
|
+
* here plus its ids in BUILTIN_RULES (rules.ts); a pack's checks run only when
|
|
133
|
+
* `packs` lists it.
|
|
134
|
+
*/
|
|
135
|
+
declare function builtinChecks(config: DoctorConfig): DoctorPlugin[];
|
|
76
136
|
/** The human-readable report. */
|
|
77
137
|
declare function formatReport(result: DoctorResult): string;
|
|
78
138
|
/** The `--json` report: plain data, sets turned into sorted lists. */
|
|
@@ -81,6 +141,7 @@ declare function toJson(result: DoctorResult): {
|
|
|
81
141
|
genesis: string;
|
|
82
142
|
errors: number;
|
|
83
143
|
warnings: number;
|
|
144
|
+
infos: number;
|
|
84
145
|
findings: Finding[];
|
|
85
146
|
unused: string[];
|
|
86
147
|
};
|
|
@@ -93,6 +154,9 @@ declare function genesisSummary(g: GenesisFacts): {
|
|
|
93
154
|
[k: string]: string;
|
|
94
155
|
};
|
|
95
156
|
palette: readonly string[];
|
|
157
|
+
companions: {
|
|
158
|
+
[k: string]: readonly string[];
|
|
159
|
+
};
|
|
96
160
|
};
|
|
97
161
|
|
|
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 };
|
|
162
|
+
export { BUILTIN_RULES, DoctorConfig, DoctorContext, DoctorPlugin, DoctorResult, Finding, GenesisFacts, type GenesisInstall, PatternRule, type ReleaseManifest, type RouteFile, type RunDoctorOptions, SourceFile, builtinChecks, defineDoctorPlugin, findPackageDir, formatReport, genesisInstalls, genesisSummary, globToRegExp, loadGenesis, nativeLayouts, parseExportNames, parseRulesMarkdown, readPackageExports, readReleaseManifest, routesDir, runDoctor, satisfies, sqlStatements, toJson, webRoutes };
|