create-smoodly-app 0.0.36 → 0.0.37

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 CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  A fresh Next.js app with the Smoodly admin mounted at `/admin`, a Supabase
6
6
  project holding the schema, `.env.local` written, and a first editor who can
7
- sign in. Spec: `docs/superpowers/specs/2026-09-04-create-smoodly-app-design.md`.
7
+ sign in.
8
8
 
9
9
  ## What it asks
10
10
 
@@ -41,202 +41,3 @@ Every prompt has a flag, so CI can run it: `--supabase local|hosted`, `--locales
41
41
  `SMOODLY_EDITOR_PASSWORD`), `--skip-link`, `--yes`. `--help` lists them.
42
42
  A hidden `--smoodly-dep <spec>` overrides the `smoodly` dependency written into
43
43
  `package.json`; CI points it at the packed tarball.
44
-
45
- ## How it is built
46
-
47
- `templates/lorem`, `templates/lorem-intl`, `templates/blank` and
48
- `templates/blank-intl` are all generated by `scripts/build-template.ts`.
49
- The Lorem Co. pair comes from `examples/site` — the multilingual layout —
50
- plus the five single-language files under `variants/lorem/single/`. The
51
- blank pair (spec 2026-09-11) takes only the content-free glue from the
52
- example (`smoodly/server.ts`, `ops.ts`, `admin.tsx`, `richtext.tsx`, the
53
- admin route files, next-intl's files) and everything with content from
54
- `variants/blank/{common,single,intl}/`. Each template also gets a generated
55
- `package.json` (with `smoodly` pinned to this package's version),
56
- `tsconfig`, `next.config`, README, `AGENTS.md`, a `CLAUDE.md` that imports
57
- it, and the one migration (`coreTablesSQL` + the starter's collection
58
- views). Two exact-line transforms turn the example's glue (locale config,
59
- `href`) into the single-language one; a drifted example fails the build
60
- rather than silently shipping stale copies. Every template gets a check
61
- tsconfig beside it; `npm run typecheck` runs `tsc` over all four
62
- (`typecheck:templates`), so hand-kept files cannot drift silently. All
63
- four templates are git-ignored and rebuilt by `npm run build`.
64
-
65
- `src/plan.ts` turns answers into steps; `src/run.ts` executes them with
66
- injected `exec`, fs and Supabase client so the sequence and every fallback
67
- message are unit-tested. `src/prompts.ts` is the only interactive code.
68
- The CLI has no runtime dependency on `smoodly`.
69
-
70
- npm test # unit tests (template build, planner, runner, editor)
71
- npm run typecheck # tsc, then the four templates
72
- npm run build # templates + esbuild bundle → dist/index.js
73
-
74
- Walked 2026-09-06: both templates scaffolded against the repo's local stack
75
- in hosted mode, `tsc`, `next build` and `/admin` 200 for each; the
76
- multilingual one with `--locales en,de`.
77
-
78
- Walked 2026-09-11: blank multilingual scaffolded in local mode with
79
- `--locales en,fr` from the built CLI, `next build`, `/` and `/fr` seeded
80
- with the Text section and the site footer line, the admin listing Home,
81
- Posts and the Site item, a post with a Button element published and
82
- served at `/posts/<slug>` in both locales; blank single-language
83
- scaffolded in hosted mode against the repo stack and `next build` only.
84
-
85
- ## Follow-ups (logged 2026-09-28, fresh-install proof of 0.0.30)
86
-
87
- Walked 2026-09-28: `npx create-smoodly-app@0.0.30 proof-0030 --supabase
88
- local --yes --editor-email …` from the published package, in a scratch
89
- directory beside three running stacks (the new one took the `563xx`
90
- block). `smoodly` 0.0.30 installed, `tsc` and `next build` clean, `/`,
91
- `/posts`, `/posts/<slug>`, `/company/about-us` and `/admin` 200, the
92
- admin document's `<html lang="en">` present, the editor signed in, an
93
- SEO title edit saved and published and served on `/`. Found:
94
-
95
- - **Local mode left Realtime out (0.0.26–0.0.30).** `LOCAL_START_ARGS`
96
- excluded `realtime` from before the concurrency spec, whose presence
97
- channel and `saved` events ride it; the admin retried the WebSocket
98
- forever (a console error per attempt) and a local install had no
99
- presence or stale-page notice. CI's repo stack already kept Realtime.
100
- Fixed 2026-09-28: the list no longer excludes it; restarted with the new
101
- flags, a script signed in as the editor joined `space:<id>` and saw both
102
- open admin tabs tracked on Home. The live job does not catch this
103
- (it requests `/admin` once, no browser); an existing local install
104
- restarts with `supabase stop && supabase start -x imgproxy,edge-runtime,logflare,vector,supavisor`.
105
- - **The Lorem home's custom-section CTA linked `/articles`**, a 404 —
106
- the articles collection lives at `/posts`. `examples/site/scripts/seed.ts`
107
- hardcoded the href; fixed 2026-09-28 to `paths(locale).articles` like
108
- every other starter link (Finnish gets its own segment too).
109
- - **`--editor-email` without `SMOODLY_EDITOR_PASSWORD` fails late.** The
110
- check lives in `askEditorWith`, which runs after the copy, install,
111
- `git init` and `supabase start`, so the run stops at `ensureEditor`
112
- with a half-made app. It has to be late for hosted mode (the email may
113
- name an existing Auth user, no password needed), but a local stack is
114
- always fresh, so local mode could refuse up front. Fixed 2026-09-28:
115
- `resolveAnswers` refuses local `--editor-email` without the variable
116
- before anything is written (the built CLI exits 1, no directory made);
117
- hosted keeps the late check.
118
-
119
- ## Follow-ups (logged 2026-09-25, docs walk)
120
-
121
- - **Single-language `/admin` had no root `<html>` (0.0.15–0.0.20).** The
122
- variant's `app/(smoodly)/admin/layout.tsx` re-exported `AdminLayout`,
123
- which renders a `<div>`; that only worked while the site had a
124
- top-level `app/layout.tsx`, and 0.0.15 moved the site into `app/(site)`.
125
- `next dev` showed two errors on the first visit to `/admin`: "Missing
126
- <html> tags in the root layout" and, from the client-rendered tree, the
127
- theme boot's "Encountered a script tag while rendering React component".
128
- Found walking the Getting started guide on a fresh `lorem` install of
129
- 0.0.20. Fixed 2026-09-25: the variant layout wraps `AdminLayout` in
130
- `<html><body>` like the example's; both errors gone in the walk. CI's
131
- live job only checks `/admin` for a 200, which this passed; an assertion
132
- on the dev overlay (or on `<html>` in the served document) would have
133
- caught it.
134
-
135
- ## Follow-ups (logged 2026-09-11)
136
-
137
- - **Blank single-language is typechecked, never built by CI.** The live
138
- job scaffolds lorem single (hosted), lorem intl and blank intl (local).
139
- A fourth stack costs ~2 minutes; add it if blank single ever breaks in
140
- a way `tsc` cannot see (a runtime import, a missing file at a path
141
- Next reads).
142
- - **The guide inside the package.** `AGENTS.md` is generated per scaffold
143
- and frozen at install time. Once its text settles, ship it in the
144
- `smoodly` package (`smoodly/AGENTS.md`) and have the scaffold's copy
145
- point there, so it tracks the package version.
146
-
147
- ## Follow-ups (logged 2026-09-06)
148
-
149
- - Local mode on a fresh multilingual install (0.0.5, 2026-09-06) failed at
150
- `supabase start` with `supabase_storage_<app> container is not ready:
151
- unhealthy` — the storage container logged `Started Successfully` and the
152
- CLI still stopped the stack. Five local stacks (57 containers) were
153
- sharing 7.8 GB of Docker memory at the time, the same pressure that
154
- made the repo's live suites flake on 2026-09-05. Smoodly never uses
155
- storage, so the CLI could start the app's stack with
156
- `supabase start -x storage-api,imgproxy,edge-runtime,logflare,vector,realtime`
157
- (the container names `supabase start --help` lists; CI already excludes
158
- most of these for the repo stack), and the "Finish by hand" text could
159
- mention `supabase stop` on other projects. Retried the same day with
160
- the other four stacks stopped (`supabase stop --project-id <name>`):
161
- `npx create-smoodly-app@0.0.5 --supabase local --locales en,fi --yes`
162
- came up with every container healthy, storage included, and the app
163
- built and served `/admin` 200, `/` and `/fi` 404 — so the cause is
164
- memory pressure, not the CLI. Fixed the same day: `run.ts` starts the
165
- app's stack with `-x storage-api,imgproxy,edge-runtime,logflare,vector,realtime,supavisor`
166
- (`LOCAL_START_ARGS`), and the "Finish by hand" text carries the same
167
- flags. Kept: db, kong, auth, PostgREST, Studio and pg-meta, mailpit.
168
- Storage is back in the local stack since the media library
169
- (2026-09-08); the health-check flake is a Docker memory problem, see
170
- the repo's memory note.
171
- - **A non-interactive run without `--locales` needs `--yes`.** The
172
- "Multilingual site?" prompt is asked whenever `--locales` is absent, and
173
- with no TTY (a CI step, stdin at EOF) the CLI exits 13 having created
174
- nothing — "Detected unsettled top-level await". CI's hosted-mode e2e step
175
- hit this; both e2e steps now pass a flag that settles the question
176
- (`--yes` for single-language, `--locales en,de` for the multilingual one).
177
- A prompt that treated EOF as its default value would need no flag.
178
- - **The next-intl template inherits next-intl's `localeDetection`
179
- default**, which redirects an unprefixed URL to the visitor's preferred
180
- locale *keeping the source locale's slugs* — on a site with translated
181
- slugs that redirect lands on a 404 (`/company/about-us` →
182
- `/fi/company/about-us` for a Finnish browser). Recorded in
183
- `examples/site/README.md` under "Multilingual (2026-09-06)". Fixed the
184
- same day: `i18n/routing.ts` in the example — and so in the generated
185
- `templates/next-intl` — sets `localeDetection: false`, so the English
186
- URL stays English for a Finnish browser and the visitor picks a
187
- language through the site's own switcher.
188
-
189
- ## Follow-ups (logged 2026-09-05)
190
-
191
- - Text prompts drop `@` when the terminal sends Option as Meta (macOS,
192
- Finnish/Nordic layouts put `@` on Option+2): the terminal emits `ESC 2` and
193
- Node's readline discards meta-keys, so nothing reaches the prompt.
194
- Reproduced against `@clack/prompts` 1.7.0 with a scripted stdin. Not
195
- fixable from prompt options; documented under "What it asks" with the
196
- paste / `--editor-email` workaround. Revisit if clack exposes a key hook.
197
- - Fresh installs printed a `NOTICE ... does not exist, skipping` for every
198
- `drop trigger/policy if exists` in the migration (fixed 2026-09-05: the
199
- migration opens with `set client_min_messages = warning`).
200
-
201
- ## Follow-ups (logged 2026-09-04)
202
-
203
- - The port probe binds `0.0.0.0` (a loopback-only bind coexists with a Docker-published port on macOS), so macOS may prompt once to allow `node` incoming connections during local mode; either answer is fine.
204
- - Windows: `exec` passes `shell: true` on win32 (needed for the `.cmd` shims)
205
- but does not quote arguments, so a project name or path containing a space
206
- or `&` breaks. Quote the args when the shell is on, or resolve the `.cmd`
207
- path and drop `shell`. Untested on Windows.
208
- - Hosted mode, manual run against a real hosted project with new-format keys
209
- (done 2026-09-05, throwaway project, `sb_secret_` + `sb_publishable_`):
210
- `db push` of the template migration printed no NOTICE, the CLI listed and
211
- created the first editor through the GoTrue admin API with the secret key
212
- as the sole `apikey`, the `members` row landed with role `admin`, `next
213
- build` passed, `/admin` served the shell, and a password sign-in with the
214
- publishable key returned a session. Caveat: the link step ran by hand with
215
- an explicit `--project-ref` (see the next-but-one item); the CLI's own
216
- `supabase link` was not driven interactively.
217
- - Supabase CLI 2.78.1 prints `sb_secret_` keys masked (middle dots) from
218
- `supabase projects api-keys`; 2.116.0 needs `--reveal`. A user who copies
219
- the key from the CLI rather than the dashboard gets "Invalid API key" at
220
- the editor step. Worth a hint in the "Finish by hand" text.
221
- - `listUsers` reads one page of 200 Auth users when offering an existing user
222
- to make the first editor. Fine for a fresh project, wrong for a populated one.
223
- - `supabase link` ran without `--project-ref`, so the CLI opened the
224
- project picker, which preselects the account's first project; `db push`
225
- follows the link, so one Enter would push Smoodly's schema into whichever
226
- project sorts first (seen 2026-09-05 during the hosted run, caught before
227
- the push). Fixed 2026-09-05: `projectRef` (src/env.ts) takes the ref from
228
- the typed URL's first host label and the link step and every fallback
229
- line pass it. Seen again 2026-09-05 from the published 0.0.3: a URL typed
230
- without `https://` gave no ref (the picker opened) and then failed
231
- `ensureEditor` with supabase-js's "Invalid supabaseUrl". Fixed the same
232
- day: `normalizeProjectUrl` (src/env.ts) adds the scheme and refuses
233
- non-URLs at the prompt and for `--url`; a URL with no ref (custom domain)
234
- never offers the link, and `run` throws rather than run a bare
235
- `supabase link`.
236
- - The `--yes` flag defaults to local mode; with the Supabase CLI absent that
237
- stops with the install message rather than falling through to hosted.
238
- - Captured `exec` output is stdout only; stderr streams straight through, so
239
- `git init` hints and the Supabase CLI's update notice appear between the
240
- prompt lines.
241
- - The "Local" option is still offered in the select when the Supabase CLI is
242
- absent, and only bails afterwards; the spec wants the check before the prompt.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-smoodly-app",
3
- "version": "0.0.36",
3
+ "version": "0.0.37",
4
4
  "description": "Create a Smoodly site: a fresh Next.js app with the admin mounted, a Supabase schema, an env file and a first editor.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -14,7 +14,7 @@
14
14
  "next": "^16.3.4",
15
15
  "react": "^19",
16
16
  "react-dom": "^19",
17
- "smoodly": "0.0.36"
17
+ "smoodly": "0.0.37"
18
18
  },
19
19
  "devDependencies": {
20
20
  "@next/env": "^16.3.4",
@@ -14,7 +14,7 @@
14
14
  "next": "^16.3.4",
15
15
  "react": "^19",
16
16
  "react-dom": "^19",
17
- "smoodly": "0.0.36",
17
+ "smoodly": "0.0.37",
18
18
  "next-intl": "^4.14.2"
19
19
  },
20
20
  "devDependencies": {
@@ -14,7 +14,7 @@
14
14
  "next": "^16.3.4",
15
15
  "react": "^19",
16
16
  "react-dom": "^19",
17
- "smoodly": "0.0.36"
17
+ "smoodly": "0.0.37"
18
18
  },
19
19
  "devDependencies": {
20
20
  "@next/env": "^16.3.4",
@@ -14,7 +14,7 @@
14
14
  "next": "^16.3.4",
15
15
  "react": "^19",
16
16
  "react-dom": "^19",
17
- "smoodly": "0.0.36",
17
+ "smoodly": "0.0.37",
18
18
  "next-intl": "^4.14.2"
19
19
  },
20
20
  "devDependencies": {