create-meith 0.21.2 → 0.23.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/dist/bin.mjs +532 -32
- package/package.json +2 -2
- package/src/bin.ts +1 -1
- package/src/cli.ts +46 -10
- package/src/extension-templates.ts +43 -0
- package/src/index.ts +12 -0
- package/src/scaffold-extension.ts +372 -0
- package/src/scaffold.ts +28 -21
package/src/scaffold.ts
CHANGED
|
@@ -120,8 +120,12 @@ const ENV_TICK_SECRET_PROSE = `# The shared secret the tick caller presents to G
|
|
|
120
120
|
# it the same way. Without it the tick is unauthenticated, and the tick is how
|
|
121
121
|
# bans expire and digests send.`
|
|
122
122
|
|
|
123
|
-
const ENV_DATA_SOURCE_PROSE = `#
|
|
124
|
-
#
|
|
123
|
+
const ENV_DATA_SOURCE_PROSE = `# Derived, and left commented out on purpose: with no DATABASE_URL the board
|
|
124
|
+
# serves \`fixture\` — deterministic in-memory sample data, no database needed,
|
|
125
|
+
# which is what \`npm run build\` uses and what \`npm run dev\` falls back to — and
|
|
126
|
+
# with one it serves \`postgres\`. Setting it to postgres while DATABASE_URL is
|
|
127
|
+
# still blank is refused at boot, so uncomment it only to override the
|
|
128
|
+
# derivation.`
|
|
125
129
|
|
|
126
130
|
const ENV_APP_URL_PROSE = `# Absolute, no trailing slash. Used in mail, feeds and canonical URLs — every
|
|
127
131
|
# place a relative URL cannot work because there is no request to be relative to.
|
|
@@ -168,7 +172,7 @@ TICK_SECRET=
|
|
|
168
172
|
${ENV_OPTIONAL_HEADING}
|
|
169
173
|
|
|
170
174
|
${ENV_DATA_SOURCE_PROSE}
|
|
171
|
-
DATA_SOURCE=postgres
|
|
175
|
+
# DATA_SOURCE=postgres
|
|
172
176
|
|
|
173
177
|
${ENV_APP_URL_PROSE}
|
|
174
178
|
APP_URL=
|
|
@@ -467,7 +471,7 @@ save-exact=true
|
|
|
467
471
|
*
|
|
468
472
|
* Adding a theme is: \`npm install\` it, add a line here, redeploy. Adding a
|
|
469
473
|
* plugin is the same, through board.plugins.json and community.plugins.ts —
|
|
470
|
-
* see docs/
|
|
474
|
+
* see docs/customization/plugins.md.
|
|
471
475
|
*/
|
|
472
476
|
import { defineForumConfig } from '@meith/web/config'
|
|
473
477
|
import {
|
|
@@ -506,7 +510,7 @@ export default defineForumConfig({
|
|
|
506
510
|
* The board's installed-plugin list.
|
|
507
511
|
*
|
|
508
512
|
* Inside the Meith monorepo this file is generated from board.plugins.json
|
|
509
|
-
* by \`pnpm board:gen\` (see docs/
|
|
513
|
+
* by \`pnpm board:gen\` (see docs/customization/plugins.md) — that generator is
|
|
510
514
|
* repository tooling, not something this workspace carries, so this file
|
|
511
515
|
* starts as a plain, valid file with the same shape instead. Add a plugin by
|
|
512
516
|
* importing its \`plugin\`/\`messages\` exports and adding an entry:
|
|
@@ -556,7 +560,7 @@ export function installedPluginDefinitions() {
|
|
|
556
560
|
#
|
|
557
561
|
# FROM the published framework base image — deps + framework layers only,
|
|
558
562
|
# locked to this exact release (see the meith repository's
|
|
559
|
-
# docs/
|
|
563
|
+
# docs/getting-started/deployment/docker-compose.md, "Custom boards", and docker/Dockerfile.base for what
|
|
560
564
|
# it is and is not). This board's own Dockerfile only ever installs its own
|
|
561
565
|
# delta on top of it — a new plugin's own dependency, typically nothing more
|
|
562
566
|
# — which is what keeps a rebuild after \`npm install some-plugin\` a matter
|
|
@@ -566,12 +570,12 @@ export function installedPluginDefinitions() {
|
|
|
566
570
|
# to Next's own standalone output. The migrate role below runs \`community
|
|
567
571
|
# migrate\`, and \`community\` materializes @meith/cli's sources and runs them
|
|
568
572
|
# with tsx at the moment it runs (see the meith repository's
|
|
569
|
-
# docs/development.md, "Consuming the board from a workspace") — it needs
|
|
573
|
+
# docs/contributing/development.md, "Consuming the board from a workspace") — it needs
|
|
570
574
|
# the full, un-pruned node_modules tree this board installed, not what Next
|
|
571
575
|
# traced as reachable from the web server alone. The tick itself is driven
|
|
572
576
|
# by docker-compose.yml's own \`worker\` service — a lightweight loop against
|
|
573
577
|
# /api/system/tick, not a compiled worker process, because @meith/worker is
|
|
574
|
-
# not published (see the meith repository's docs/release.md).
|
|
578
|
+
# not published (see the meith repository's docs/contributing/release.md).
|
|
575
579
|
ARG MEITH_VERSION
|
|
576
580
|
FROM ghcr.io/meith-dev/meith-base:\${MEITH_VERSION} AS deps
|
|
577
581
|
WORKDIR /board
|
|
@@ -596,7 +600,7 @@ ENV NODE_ENV=production
|
|
|
596
600
|
# persists into every container started from this image afterward, and this
|
|
597
601
|
# Dockerfile has no later stage to reset it in (see "Two stages, not three"
|
|
598
602
|
# above). The build needs neither a database nor a production secret (see
|
|
599
|
-
# the meith repository's docs/development.md, "Fixture mode"), but baking
|
|
603
|
+
# the meith repository's docs/contributing/development.md, "Fixture mode"), but baking
|
|
600
604
|
# DATA_SOURCE=fixture into the image itself would silently force fixture
|
|
601
605
|
# mode — and with it the in-memory queue driver — at runtime too, no matter
|
|
602
606
|
# what DATABASE_URL an operator supplies to \`docker run\`.
|
|
@@ -838,9 +842,9 @@ services:
|
|
|
838
842
|
condition: service_completed_successfully
|
|
839
843
|
|
|
840
844
|
# @meith/worker is not published (see the meith repository's
|
|
841
|
-
# docs/release.md), so there is no compiled worker binary a scaffolded
|
|
845
|
+
# docs/contributing/release.md), so there is no compiled worker binary a scaffolded
|
|
842
846
|
# board can run — this drives the tick the alternative way the meith
|
|
843
|
-
# repository documents in docs/
|
|
847
|
+
# repository documents in docs/getting-started/deployment/docker-compose.md, "Running the tick without
|
|
844
848
|
# a second set of credentials": a small loop calling /api/system/tick.
|
|
845
849
|
worker:
|
|
846
850
|
image: alpine:3.24@sha256:28bd5fe8b56d1bd048e5babf5b10710ebe0bae67db86916198a6eec434943f8b
|
|
@@ -911,7 +915,7 @@ one value only you know:
|
|
|
911
915
|
|
|
912
916
|
3. **Deploy, then \`/install\` on your own domain.** Coolify issues the
|
|
913
917
|
certificate; the installer from there is the one
|
|
914
|
-
[docs/
|
|
918
|
+
[docs/getting-started/deployment/coolify.md](${repositoryUrl}/blob/main/docs/getting-started/deployment/coolify.md#4-run-the-installer)
|
|
915
919
|
walks through, screen for screen. It seals itself when it finishes, and
|
|
916
920
|
\`/install\` answers 404 from then on — run it **against the database you
|
|
917
921
|
are going to keep**. Every push to \`main\` after this rebuilds the
|
|
@@ -929,7 +933,7 @@ rather not use GitHub Actions for the build — push the result wherever
|
|
|
929
933
|
docker build --build-arg MEITH_VERSION=$(node -p "require('./package.json').dependencies['@meith/web']") -t ${name} .
|
|
930
934
|
\`\`\`
|
|
931
935
|
|
|
932
|
-
**Without a panel**: [docs/
|
|
936
|
+
**Without a panel**: [docs/getting-started/deployment/docker-compose.md](${repositoryUrl}/blob/main/docs/getting-started/deployment/docker-compose.md)
|
|
933
937
|
is the same four containers by hand — your own \`.env\`, a reverse proxy you
|
|
934
938
|
already run, no Coolify. \`Dockerfile\` and \`docker-compose.yml\` here are this
|
|
935
939
|
board's own version of exactly that shape.
|
|
@@ -949,12 +953,15 @@ Two things nothing configures for you:
|
|
|
949
953
|
|
|
950
954
|
\`\`\`sh
|
|
951
955
|
npm install
|
|
952
|
-
cp .env.example .env.local
|
|
953
956
|
npm run dev
|
|
954
957
|
\`\`\`
|
|
955
958
|
|
|
956
|
-
|
|
957
|
-
|
|
959
|
+
No environment file, no database: with no \`DATABASE_URL\` the board serves
|
|
960
|
+
deterministic in-memory sample data, which is enough to click through every
|
|
961
|
+
reading surface.
|
|
962
|
+
|
|
963
|
+
Posting needs Postgres. Copy \`.env.example\` to \`.env.local\`, set
|
|
964
|
+
\`DATABASE_URL\` and the two secrets in it, then:
|
|
958
965
|
|
|
959
966
|
\`\`\`sh
|
|
960
967
|
npm run community -- migrate
|
|
@@ -1002,7 +1009,7 @@ project's own \`.npmrc\` sets \`save-exact=true\` for the same reason, so an
|
|
|
1002
1009
|
build workflow also refuses to build from anything but an exact version, as
|
|
1003
1010
|
a second line of defense. Once the rebuilt image is deployed, run
|
|
1004
1011
|
\`npm run community -- upgrade\` against it for the plugin migrations — see
|
|
1005
|
-
[the operator CLI](${repositoryUrl}/blob/main/docs/operating.md#the-operator-cli)
|
|
1012
|
+
[the operator CLI](${repositoryUrl}/blob/main/docs/guides/operations/operating.md#the-operator-cli)
|
|
1006
1013
|
for running it against this deployment.
|
|
1007
1014
|
|
|
1008
1015
|
Migrations are forward-only. Recovery is by restore, so take a backup first —
|
|
@@ -1192,7 +1199,7 @@ the board's name and address and for the first administrator's username, email
|
|
|
1192
1199
|
and password, creates the board and that account, and then **seals itself**:
|
|
1193
1200
|
\`/install\` answers 404 from then on. Run it against the database you intend to
|
|
1194
1201
|
keep — the screens are the ones
|
|
1195
|
-
[docs/
|
|
1202
|
+
[docs/getting-started/deployment/docker-compose.md](${repositoryUrl}/blob/main/docs/getting-started/deployment/docker-compose.md#6-install-it)
|
|
1196
1203
|
walks through.
|
|
1197
1204
|
|
|
1198
1205
|
## The tick
|
|
@@ -1308,15 +1315,15 @@ one.
|
|
|
1308
1315
|
## Somewhere other than Vercel
|
|
1309
1316
|
|
|
1310
1317
|
Everything above is one deployment shape.
|
|
1311
|
-
[docs/
|
|
1318
|
+
[docs/getting-started/deployment/docker-compose.md](${repositoryUrl}/blob/main/docs/getting-started/deployment/docker-compose.md) is the
|
|
1312
1319
|
same board as containers you run yourself, and \`npx create-meith <name>\`
|
|
1313
1320
|
scaffolds that shape instead — a Dockerfile, a compose file and a workflow that
|
|
1314
|
-
builds the image. [docs/scaling.md](${repositoryUrl}/blob/main/docs/scaling.md)
|
|
1321
|
+
builds the image. [docs/guides/operations/scaling.md](${repositoryUrl}/blob/main/docs/guides/operations/scaling.md)
|
|
1315
1322
|
explains why the drivers above are what they are, and why an S3-compatible
|
|
1316
1323
|
bucket is the portable choice for uploads everywhere but here.
|
|
1317
1324
|
`
|
|
1318
1325
|
}
|
|
1319
1326
|
|
|
1320
1327
|
export function nextSteps(name: string): readonly string[] {
|
|
1321
|
-
return [`cd ${name}`, 'npm install', '
|
|
1328
|
+
return [`cd ${name}`, 'npm install', 'npm run dev']
|
|
1322
1329
|
}
|