@marktiderman/genesis-cli 1.6.0 → 1.7.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 +156 -1
- package/dist/cli.js +2769 -567
- package/dist/cli.js.map +1 -1
- package/dist/{config-CUdwT-nY.d.ts → config-CrZbM3jD.d.ts} +45 -2
- package/dist/doctor.d.ts +2 -2
- package/dist/doctor.js +133 -5
- package/dist/doctor.js.map +1 -1
- package/dist/expo.d.ts +91 -8
- package/dist/expo.js +207 -14
- package/dist/expo.js.map +1 -1
- package/dist/genesis-catalog.json +502 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +140 -9
- package/dist/index.js.map +1 -1
- package/dist/scaffolder.d.ts +1 -1
- package/dist/scaffolder.js +7 -4
- package/dist/scaffolder.js.map +1 -1
- package/dist/starter/.eas/scripts/rollout-health.mjs +85 -0
- package/dist/starter/.eas/workflows/deploy-production.yml +149 -0
- package/dist/starter/.eas/workflows/e2e.yml +77 -0
- package/dist/starter/.eas/workflows/pr-preview.yml +117 -0
- package/dist/starter/.eas/workflows/rollout.yml +120 -0
- package/dist/starter/.env.example +11 -0
- package/dist/starter/.fingerprintignore +7 -0
- package/dist/starter/.maestro/README.md +38 -0
- package/dist/starter/.maestro/config.yaml +5 -0
- package/dist/starter/.maestro/flows/deep-link.yaml +22 -0
- package/dist/starter/.maestro/flows/launch.yaml +17 -0
- package/dist/starter/.maestro/flows/settings-version.yaml +28 -0
- package/dist/starter/.maestro/flows/sign-in-screen.yaml +17 -0
- package/dist/starter/.maestro/subflows/sign-in.yaml +20 -0
- package/dist/starter/README.md +314 -0
- package/dist/starter/__tests__/app-config.test.ts +51 -0
- package/dist/starter/__tests__/check-in-photos.test.ts +57 -0
- package/dist/starter/__tests__/components/css-stub.js +2 -0
- package/dist/starter/__tests__/components/fake-supabase.ts +136 -0
- package/dist/starter/__tests__/components/links.test.ts +25 -0
- package/dist/starter/__tests__/components/render-app.ts +22 -0
- package/dist/starter/__tests__/components/reports.ts +10 -0
- package/dist/starter/__tests__/components/resolver.js +12 -0
- package/dist/starter/__tests__/components/root-layout.test.tsx +55 -0
- package/dist/starter/__tests__/components/session-storage.test.tsx +81 -0
- package/dist/starter/__tests__/components/settings.test.tsx +134 -0
- package/dist/starter/__tests__/components/setup.ts +69 -0
- package/dist/starter/__tests__/components/sign-in.test.tsx +90 -0
- package/dist/starter/__tests__/components/tabs-feature-off.test.tsx +19 -0
- package/dist/starter/__tests__/components/tabs.test.tsx +43 -0
- package/dist/starter/__tests__/components/tabs.ts +12 -0
- package/dist/starter/__tests__/entry.test.ts +28 -0
- package/dist/starter/__tests__/inline-copy.ts +59 -0
- package/dist/starter/__tests__/starter.test.ts +319 -0
- package/dist/starter/_gitignore +13 -0
- package/dist/starter/app.config.ts +44 -0
- package/dist/starter/babel.config.js +9 -0
- package/dist/starter/eas.json +47 -0
- package/dist/starter/eslint.config.js +5 -0
- package/dist/starter/genesis.config.json +12 -0
- package/dist/starter/global.css +3 -0
- package/dist/starter/index.ts +14 -0
- package/dist/starter/jest.config.js +36 -0
- package/dist/starter/metro.config.js +38 -0
- package/dist/starter/package.json +93 -0
- package/dist/starter/pnpm-workspace.yaml +73 -0
- package/dist/starter/src/app/(app)/(home)/_layout.tsx +6 -0
- package/dist/starter/src/app/(app)/(home)/check-in.tsx +41 -0
- package/dist/starter/src/app/(app)/(home)/index.tsx +34 -0
- package/dist/starter/src/app/(app)/_layout.tsx +27 -0
- package/dist/starter/src/app/(app)/notifications/_layout.tsx +6 -0
- package/dist/starter/src/app/(app)/notifications/index.tsx +36 -0
- package/dist/starter/src/app/(app)/settings/_layout.tsx +6 -0
- package/dist/starter/src/app/(app)/settings/index.tsx +96 -0
- package/dist/starter/src/app/(app)/settings/notifications.tsx +16 -0
- package/dist/starter/src/app/(app)/settings/support/[id].tsx +23 -0
- package/dist/starter/src/app/(app)/settings/support/ideas.tsx +20 -0
- package/dist/starter/src/app/(app)/settings/support/index.tsx +20 -0
- package/dist/starter/src/app/(app)/settings/support/new.tsx +35 -0
- package/dist/starter/src/app/(app)/settings/support/shipped.tsx +20 -0
- package/dist/starter/src/app/+native-intent.ts +11 -0
- package/dist/starter/src/app/_layout.tsx +20 -0
- package/dist/starter/src/app/sign-in.tsx +69 -0
- package/dist/starter/src/copy.ts +118 -0
- package/dist/starter/src/forms/check-in.json +121 -0
- package/dist/starter/src/lib/account.ts +42 -0
- package/dist/starter/src/lib/app.ts +52 -0
- package/dist/starter/src/lib/auth.ts +80 -0
- package/dist/starter/src/lib/check-in-photos.ts +66 -0
- package/dist/starter/src/lib/check-in.ts +85 -0
- package/dist/starter/src/lib/define-starter.ts +148 -0
- package/dist/starter/src/lib/devtools-overlay.ts +34 -0
- package/dist/starter/src/lib/devtools.ts +23 -0
- package/dist/starter/src/lib/env.ts +33 -0
- package/dist/starter/src/lib/google-signin.ts +23 -0
- package/dist/starter/src/lib/links.ts +40 -0
- package/dist/starter/src/lib/native-modules.ts +27 -0
- package/dist/starter/src/lib/notifications.ts +15 -0
- package/dist/starter/src/lib/observability.ts +45 -0
- package/dist/starter/src/lib/push.ts +49 -0
- package/dist/starter/src/lib/supabase.ts +65 -0
- package/dist/starter/src/lib/support.ts +44 -0
- package/dist/starter/src/lib/updates.ts +61 -0
- package/dist/starter/starter.config.ts +37 -0
- package/dist/starter/supabase/config.toml +26 -0
- package/dist/starter/supabase/functions/genesis-apple-revoke/apple.ts +237 -0
- package/dist/starter/supabase/functions/genesis-apple-revoke/handler.ts +227 -0
- package/dist/starter/supabase/functions/genesis-apple-revoke/index.ts +55 -0
- package/dist/starter/supabase/functions/genesis-push-send/expo.ts +117 -0
- package/dist/starter/supabase/functions/genesis-push-send/handler.ts +462 -0
- package/dist/starter/supabase/functions/genesis-push-send/index.ts +54 -0
- package/dist/starter/supabase/migrations/20261024000000_genesis_account_deletion.sql +133 -0
- package/dist/starter/supabase/migrations/20261024000100_genesis_app_release_policy.sql +82 -0
- package/dist/starter/supabase/migrations/20261024000200_genesis_apple_token_revocation.sql +205 -0
- package/dist/starter/supabase/migrations/20261024000400_genesis_push.sql +524 -0
- package/dist/starter/supabase/migrations/20261024000600_genesis_support.sql +846 -0
- package/dist/starter/supabase/tests/database/genesis_account_deletion.test.sql +138 -0
- package/dist/starter/supabase/tests/database/genesis_app_release_policy.test.sql +148 -0
- package/dist/starter/supabase/tests/database/genesis_apple_token_revocation.test.sql +230 -0
- package/dist/starter/supabase/tests/database/genesis_push.test.sql +407 -0
- package/dist/starter/supabase/tests/database/genesis_support.test.sql +552 -0
- package/dist/starter/tailwind.config.mjs +15 -0
- package/dist/starter/tsconfig.json +14 -0
- package/dist/starter/vitest.config.mts +7 -0
- package/dist/templates/ci/app-ci.yml +17 -0
- package/dist/templates/ci/genesis-upgrade.yml +21 -0
- package/dist/templates/ci/supabase-ci.yml +20 -0
- package/dist/templates/eas/eas.json +47 -0
- package/dist/templates/eas/scripts/rollout-health.mjs +85 -0
- package/dist/templates/eas/workflows/deploy-production.yml +149 -0
- package/dist/templates/eas/workflows/e2e.yml +77 -0
- package/dist/templates/eas/workflows/pr-preview.yml +117 -0
- package/dist/templates/eas/workflows/rollout.yml +120 -0
- package/dist/templates/maestro/config.yaml +5 -0
- package/dist/templates/maestro/flows/deep-link.yaml +22 -0
- package/dist/templates/maestro/flows/launch.yaml +17 -0
- package/dist/templates/maestro/flows/settings-version.yaml +28 -0
- package/dist/templates/maestro/flows/sign-in-screen.yaml +17 -0
- package/dist/templates/maestro/subflows/sign-in.yaml +20 -0
- package/dist/vite.js +133 -5
- package/dist/vite.js.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -6,6 +6,22 @@ npx @marktiderman/genesis-cli init <consumer>
|
|
|
6
6
|
|
|
7
7
|
Scaffolds a Genesis consumer: a brand package, Tailwind and tokens.
|
|
8
8
|
|
|
9
|
+
```bash
|
|
10
|
+
npx @marktiderman/genesis-cli init <app> --template native [--bundle-id com.acme.app] [--scheme acme] [--display-name "Acme"]
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Makes a new Expo app from the Genesis RN starter, in `./<app>` (or `--target`), which must be new
|
|
14
|
+
or empty. See [A new native app](#a-new-native-app).
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npx @marktiderman/genesis-cli add <block> [--dry-run] [--yes] [--no-install]
|
|
18
|
+
npx @marktiderman/genesis-cli migrate [--dry-run] [--forward]
|
|
19
|
+
npx @marktiderman/genesis-cli upgrade [--version <v>] [--dry-run] [--keep-mine] [--pr]
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Add a block to an app, copy new package migrations in, and move every Genesis package to one
|
|
23
|
+
release. See [Blocks: add, migrate, upgrade](#blocks-add-migrate-upgrade).
|
|
24
|
+
|
|
9
25
|
```bash
|
|
10
26
|
npx @marktiderman/genesis-cli doctor [--strict] [--json] [--build] [--config <path>] [--dir <dir>]
|
|
11
27
|
```
|
|
@@ -59,6 +75,145 @@ Writes the marked feature block in `AGENTS.md` (and a JSON copy with `--json <fi
|
|
|
59
75
|
repo's `src/features.ts`; `check` exits 1 when that output is stale or a feature's `links.code`
|
|
60
76
|
path doesn't exist. See [genesis-features](../features/README.md) for the registry and the options.
|
|
61
77
|
|
|
78
|
+
## A new native app
|
|
79
|
+
|
|
80
|
+
`genesis init <app> --template native` copies the starter (`apps/genesis-rn-starter`) that ships
|
|
81
|
+
inside the CLI, at the version the CLI was released with:
|
|
82
|
+
|
|
83
|
+
- only the files an app owns: no `node_modules`, build output, or the starter's monorepo-only test
|
|
84
|
+
(`__tests__/release.test.ts`, which reads the monorepo's `templates/`);
|
|
85
|
+
- renamed: package name, display name, slug, URL scheme and bundle id, everywhere the starter's
|
|
86
|
+
values appear (Apple client ids in `supabase/config.toml`, the Maestro flows' `appId`);
|
|
87
|
+
- every `workspace:` dependency set to `^<version>` from the same release (the installed
|
|
88
|
+
umbrella's `versions.json` when there is one), the plain Metro config, and a
|
|
89
|
+
`pnpm-workspace.yaml` with the pnpm settings Metro and pnpm 11 need (hoisted layout, allowed
|
|
90
|
+
build scripts, one React);
|
|
91
|
+
- the templates: `templates/eas` to `eas.json` and `.eas/`, `templates/maestro` to `.maestro/`,
|
|
92
|
+
`templates/ci` to `.github/workflows/` (replace `GENESIS_SHA` in them);
|
|
93
|
+
- `genesis.lock.json`, recording the blocks the starter carries (`account`, `app-updates`,
|
|
94
|
+
`push`), every file Genesis owns in the app with its checksum, and the renames, so `upgrade`
|
|
95
|
+
can refresh them and `migrate` knows the blocks.
|
|
96
|
+
|
|
97
|
+
The starter's migrations are copied byte for byte (its own tests check that); `migrate` knows them
|
|
98
|
+
by name and text. `init --native` (the brand-package scaffold for an Expo app) is unchanged.
|
|
99
|
+
|
|
100
|
+
## Blocks: add, migrate, upgrade
|
|
101
|
+
|
|
102
|
+
A block is a feature an app adds whole (see `defineBlock` in `@marktiderman/genesis-features`).
|
|
103
|
+
The commands read blocks from the Genesis packages, never from a list in the CLI, so a package
|
|
104
|
+
that declares a block is found:
|
|
105
|
+
|
|
106
|
+
- `package.json` → `"genesis": { "blocks": { "<id>": { … } } }`, plain JSON the CLI reads without
|
|
107
|
+
running package code. The CLI carries a catalog of every Genesis package's manifests, so a block
|
|
108
|
+
is found before its package is installed.
|
|
109
|
+
- A `./blocks` export of `defineBlock` declarations that loads in Node (no React Native), such as
|
|
110
|
+
`@marktiderman/genesis-supabase/blocks`. What a declaration says (requires, platforms,
|
|
111
|
+
migrations, routes, skills, privacy) wins over package.json; package.json adds what a
|
|
112
|
+
declaration can't.
|
|
113
|
+
|
|
114
|
+
A manifest entry:
|
|
115
|
+
|
|
116
|
+
```json
|
|
117
|
+
{
|
|
118
|
+
"feature": { "name": "Push", "summary": "…", "keywords": ["notifications"], "audience": ["person"] },
|
|
119
|
+
"platforms": ["native"],
|
|
120
|
+
"requires": ["account"],
|
|
121
|
+
"packages": ["@marktiderman/genesis-native", "@marktiderman/genesis-supabase"],
|
|
122
|
+
"install": ["@supabase/supabase-js@^2.118.0"],
|
|
123
|
+
"migrations": [{ "package": "@marktiderman/genesis-supabase", "file": "migrations/0005_genesis_push.sql", "test": "migrations/tests/0005_genesis_push.test.sql" }],
|
|
124
|
+
"functions": [{ "package": "@marktiderman/genesis-supabase", "dir": "functions/genesis-push-send", "verifyJwt": false, "secrets": ["GENESIS_PUSH_SECRET"] }],
|
|
125
|
+
"routes": [{ "path": "/settings/notifications", "signedIn": true }],
|
|
126
|
+
"skills": ["skills/push/SKILL.md"],
|
|
127
|
+
"agents": "agents/push.md",
|
|
128
|
+
"steps": ["npx expo install expo-notifications, and add it to the plugins in app.config."]
|
|
129
|
+
}
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Every path is package-relative and checked before anything reads it: no absolute paths, no `..`,
|
|
133
|
+
no backslashes, and a file that resolves (through a symlink) outside its package is refused.
|
|
134
|
+
`package` must be a Genesis package. Migrations are named `NNNN_name.sql`. A package whose
|
|
135
|
+
runtime block is made by a function (`createPush`) keeps a test that its manifest says what the
|
|
136
|
+
block declares.
|
|
137
|
+
|
|
138
|
+
### genesis add
|
|
139
|
+
|
|
140
|
+
`genesis add <block>` plans, prints the plan, asks (or `--yes`), then:
|
|
141
|
+
|
|
142
|
+
1. installs the block's `packages` (at the installed umbrella's pinned version, else this CLI's
|
|
143
|
+
release) and `install` entries the app doesn't have, with the app's package manager
|
|
144
|
+
(`--no-install` prints the command instead);
|
|
145
|
+
2. copies each migration into `supabase/migrations/` as a **new** file,
|
|
146
|
+
`<timestamp>_<name>.sql`, timestamped after every migration already there, with a header naming
|
|
147
|
+
the package, the file and the checksum of the package's text; and its pgTAP test into
|
|
148
|
+
`supabase/tests/database/`;
|
|
149
|
+
3. copies its Edge Functions into `supabase/functions/<name>/` (and adds `verify_jwt = false` to
|
|
150
|
+
`supabase/config.toml` when the manifest says so), its skills into `.claude/skills/<name>/`,
|
|
151
|
+
and its AGENTS.md fragment between `<!-- genesis-block:<id>:start/end -->` markers;
|
|
152
|
+
4. writes a stub screen for each route an Expo Router app doesn't have yet (inside the app's one
|
|
153
|
+
group for a signed-in route); other routers get a step;
|
|
154
|
+
5. adds the block's entry to the feature registry (`features.ts`) when the edit is unambiguous and
|
|
155
|
+
still loads, or prints the snippet; then runs `features build`;
|
|
156
|
+
6. records the block and the files it owns in `genesis.lock.json`, and prints what is left by hand
|
|
157
|
+
(secrets, plugin config, the privacy label).
|
|
158
|
+
|
|
159
|
+
It never overwrites a file the app has: one with other text is reported and left alone. A second
|
|
160
|
+
run creates and changes nothing. `--dry-run` prints the plan and writes nothing. `genesis add
|
|
161
|
+
--list` lists the blocks the app can add. `genesis studio init` is unchanged.
|
|
162
|
+
|
|
163
|
+
### genesis migrate
|
|
164
|
+
|
|
165
|
+
Compares the migrations of the app's blocks (`genesis.lock.json`, plus `--block <id>`) in the
|
|
166
|
+
installed packages with the app's copies, and every copy that carries a header:
|
|
167
|
+
|
|
168
|
+
| State | Meaning | What happens |
|
|
169
|
+
| --- | --- | --- |
|
|
170
|
+
| `current` | the copy matches its package text | nothing |
|
|
171
|
+
| `new` | the package ships a migration the app hasn't copied | copied as a new file, after every existing one |
|
|
172
|
+
| `edited` | the copy no longer matches the text it was copied with | reported; never rewritten |
|
|
173
|
+
| `changed-upstream` | the package now ships different text than the copy was made from | reported; never rewritten |
|
|
174
|
+
| `differs` | a file with the migration's name, other text and no header | treated as the app's own; never rewritten |
|
|
175
|
+
|
|
176
|
+
Every file already in `supabase/migrations` counts as applied: none is ever written again, and a
|
|
177
|
+
new file is created only if its name is free (otherwise it fails). A package migration is copied
|
|
178
|
+
only when nothing in the folder holds it yet, by header, by name or by text, so one a package
|
|
179
|
+
renumbered or moved is never copied twice. Line endings (CRLF or LF) don't count as a change. A
|
|
180
|
+
symlink in the folder stops the command. A pgTAP test is copied only with its migration, so one you
|
|
181
|
+
deleted stays deleted. `--forward` writes one forward migration stub
|
|
182
|
+
(`<timestamp>_<name>_forward.sql`, with a `genesis-forward` header) for each edited or changed
|
|
183
|
+
copy, holding the package's current text commented out, for you to turn into the change; later
|
|
184
|
+
runs count that copy as handled. It exits 1 when something still needs you.
|
|
185
|
+
|
|
186
|
+
### genesis upgrade
|
|
187
|
+
|
|
188
|
+
1. Reads the release: `@marktiderman/genesis@<version>` (default `latest`) and its
|
|
189
|
+
`versions.json`, as the [genesis-upgrade workflow](../../docs/APP-CI.md#genesis-upgrade) does,
|
|
190
|
+
or `--manifest <file>`. The bump is the workflow's own code (`src/upgrade/bump-core.mjs`, which
|
|
191
|
+
the workflow embeds): every Genesis dependency in every tracked package.json moves together,
|
|
192
|
+
keeping its range prefix; `workspace:`, `file:` and other ranges are left alone, nothing is
|
|
193
|
+
downgraded.
|
|
194
|
+
2. Runs a codemod only when a release declares a breaking change it fixes: the registry in
|
|
195
|
+
`src/upgrade/codemods.ts` (empty today) names the package and the first version that breaks, and
|
|
196
|
+
a codemod runs when a package moves across it. A major move (or a 0.x minor) without one is
|
|
197
|
+
listed so you read its changelog.
|
|
198
|
+
3. Reinstalls, then refreshes every file in `genesis.lock.json` from the newly installed package:
|
|
199
|
+
unchanged in the app, it takes the new version; changed by both, it is merged with `git
|
|
200
|
+
merge-file` against the old version (the base); a conflict goes to `<file>.genesis-next` and
|
|
201
|
+
your file is kept. `--keep-mine` never merges: the new text goes to `.genesis-next`. A file you
|
|
202
|
+
deleted stays deleted. AGENTS.md fragments are replaced, skills a block gained are copied, and
|
|
203
|
+
new package migrations are listed (run `genesis migrate`).
|
|
204
|
+
4. Runs `genesis doctor` and prints a summary; `--pr` commits to `genesis-upgrade/<version>`,
|
|
205
|
+
pushes and opens a pull request with `gh`. It checks first, before writing anything, that the
|
|
206
|
+
tree is clean, a branch is checked out and the branch name is free; it commits the lockfile
|
|
207
|
+
(found up to the repository's root), never `.genesis-next` files. `--dry-run` changes nothing,
|
|
208
|
+
and shows the refresh against the packages installed now.
|
|
209
|
+
|
|
210
|
+
`genesis.lock.json` is checked like a manifest, since anyone with commit access can edit it: each
|
|
211
|
+
entry may only write where its kind of source goes (a template to `eas.json`, `.eas/`, `.maestro/`
|
|
212
|
+
or `.github/workflows/`, a function file to `supabase/functions/<name>/`, a pgTAP test to
|
|
213
|
+
`supabase/tests/database/`, a skill to `.claude/skills/`), never a migration and never `.git`;
|
|
214
|
+
substitutions may only replace the starter's own names. A pgTAP test waits while its block has
|
|
215
|
+
new migrations to copy.
|
|
216
|
+
|
|
62
217
|
## Expo config plugin
|
|
63
218
|
|
|
64
219
|
`withGenesis()` keeps an Expo app's `app.config.ts` to a name, ids and plugins:
|
|
@@ -83,7 +238,7 @@ or call it yourself: `import { withGenesis } from "@marktiderman/genesis-cli/exp
|
|
|
83
238
|
|
|
84
239
|
| Step | What it sets | Option to turn it off |
|
|
85
240
|
| --- | --- | --- |
|
|
86
|
-
| App variants | `APP_VARIANT` = `development` / `preview` / `production` (default) suffixes `ios.bundleIdentifier` and `android.package` with `.dev` / `.preview
|
|
241
|
+
| App variants | `APP_VARIANT` = `development` / `preview` / `production` (default) suffixes `ios.bundleIdentifier` and `android.package` with `.dev` / `.preview`, `name` with ` (Dev)` / ` (Preview)` and each `scheme` with `-dev` / `-preview`, so the three install side by side and a `scheme://` link opens the build it names (production keeps the base scheme). Any other value fails. A value that already ends in the suffix is left alone. Change the suffixes with `variants: { development: { id: ".debug", name: " (Debug)", scheme: "-debug" } }`. | pass `variant: "production"` |
|
|
87
242
|
| Links | `ios.associatedDomains` (`applinks:` and, unless `links.webcredentials` is `false`, `webcredentials:` per host) and one Android `intentFilters` entry with `autoVerify`, from the `links` block of `genesis.config.json`. | `links: false` |
|
|
88
243
|
| Privacy manifest | `ios.privacyManifests.NSPrivacyAccessedAPITypes` for the packages in `dependencies`: `@react-native-async-storage/async-storage` needs FileTimestamp, reason `C617.1` (what its own `PrivacyInfo.xcprivacy` declares). | `privacyManifest: false` |
|
|
89
244
|
| Export compliance | `ios.config.usesNonExemptEncryption = false`. | `exportCompliance: false` |
|