create-meith 0.17.1 → 0.17.2
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 +52 -17
- package/package.json +1 -1
- package/src/bin.ts +1 -1
- package/src/cli.ts +9 -1
- package/src/scaffold.ts +43 -15
package/dist/bin.mjs
CHANGED
|
@@ -47,6 +47,16 @@ function scaffold(options) {
|
|
|
47
47
|
null,
|
|
48
48
|
2
|
|
49
49
|
)}
|
|
50
|
+
`
|
|
51
|
+
);
|
|
52
|
+
files.set(
|
|
53
|
+
".npmrc",
|
|
54
|
+
`# Every @meith/* dependency here is an exact version, not a range \u2014 see
|
|
55
|
+
# README.md, "Upgrading", for why a range breaks the build. This makes that
|
|
56
|
+
# the default for any \`npm install\` run in this project from here on,
|
|
57
|
+
# including a plugin installed by hand later, not only the three packages
|
|
58
|
+
# the scaffold pinned itself.
|
|
59
|
+
save-exact=true
|
|
50
60
|
`
|
|
51
61
|
);
|
|
52
62
|
files.set(
|
|
@@ -366,6 +376,10 @@ jobs:
|
|
|
366
376
|
run: |
|
|
367
377
|
IMAGE=$(echo "ghcr.io/\${{ github.repository }}" | tr '[:upper:]' '[:lower:]')
|
|
368
378
|
MEITH_VERSION=$(node -p "require('./package.json').dependencies['@meith/web']")
|
|
379
|
+
if ! echo "$MEITH_VERSION" | grep -Eq '^[0-9]+\\.[0-9]+\\.[0-9]+$'; then
|
|
380
|
+
echo "::error::@meith/web in package.json is '$MEITH_VERSION', not an exact X.Y.Z version \u2014 that is not a legal Docker image tag. Upgrade with \\\`npm install --save-exact\\\` (see README.md, Upgrading) so this dependency always resolves to one."
|
|
381
|
+
exit 1
|
|
382
|
+
fi
|
|
369
383
|
docker build --build-arg MEITH_VERSION="$MEITH_VERSION" -t "$IMAGE:\${{ github.sha }}" -t "$IMAGE:latest" .
|
|
370
384
|
docker push "$IMAGE:\${{ github.sha }}"
|
|
371
385
|
docker push "$IMAGE:latest"
|
|
@@ -381,12 +395,15 @@ jobs:
|
|
|
381
395
|
echo
|
|
382
396
|
echo "Paste this into the MEITH_IMAGE variable on the Coolify resource:"
|
|
383
397
|
echo
|
|
384
|
-
echo " $IMAGE:latest"
|
|
385
|
-
echo
|
|
386
|
-
echo "Once you want a pin that only moves when you say so:"
|
|
387
|
-
echo
|
|
388
398
|
echo " $IMAGE:\${{ github.sha }}"
|
|
389
399
|
echo
|
|
400
|
+
echo "This tag names this run's build and nothing else, ever. $IMAGE:latest"
|
|
401
|
+
echo "also pushed, as a convenience for a quick manual pull; it moves on"
|
|
402
|
+
echo "every push to main, so any later Coolify redeploy \u2014 for any reason,"
|
|
403
|
+
echo "not necessarily this one \u2014 pulls whatever main most recently built,"
|
|
404
|
+
echo "including a commit still mid-feature. Prefer the sha above for the"
|
|
405
|
+
echo "value you actually set on the resource."
|
|
406
|
+
echo
|
|
390
407
|
echo "## One-time: make the package public"
|
|
391
408
|
echo
|
|
392
409
|
echo "This package starts private. Coolify's pull fails until you visit"
|
|
@@ -537,10 +554,13 @@ one value only you know:
|
|
|
537
554
|
\`TICK_SECRET\` and the database password, generated on the first deploy
|
|
538
555
|
and never typed in. The one thing Coolify cannot generate is the image
|
|
539
556
|
step 1 just pushed: set \`MEITH_IMAGE\` in the resource's own environment
|
|
540
|
-
to the value that run's Summary printed \u2014 \`ghcr.io/<you>/${name}
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
557
|
+
to the value that run's Summary printed \u2014 \`ghcr.io/<you>/${name}:\${{ github.sha }}\`,
|
|
558
|
+
a pin that only ever names that one build (\`docker-compose.yml\` refuses
|
|
559
|
+
to start without this set, with a message saying why). The same run also
|
|
560
|
+
pushes \`ghcr.io/<you>/${name}:latest\` as a convenience for a quick manual
|
|
561
|
+
pull, but it moves on every push to \`main\` \u2014 set it on the resource and a
|
|
562
|
+
later, unrelated redeploy can pull whatever \`main\` most recently built,
|
|
563
|
+
commit still mid-feature included.
|
|
544
564
|
|
|
545
565
|
3. **Deploy, then \`/install\` on your own domain.** Coolify issues the
|
|
546
566
|
certificate; the installer from there is the one
|
|
@@ -590,8 +610,8 @@ With no \`DATABASE_URL\`, the board runs on deterministic in-memory sample data
|
|
|
590
610
|
enough to click through every reading surface. Posting needs a database:
|
|
591
611
|
|
|
592
612
|
\`\`\`sh
|
|
593
|
-
npm run
|
|
594
|
-
npm run
|
|
613
|
+
npm run community -- migrate
|
|
614
|
+
echo "<password>" | npm run community -- user:create --username <name> --email <address> --group administrators
|
|
595
615
|
\`\`\`
|
|
596
616
|
|
|
597
617
|
## Configuring
|
|
@@ -602,14 +622,14 @@ npm run forum -- user:create --admin
|
|
|
602
622
|
- **\`/admin\`** \u2014 settings, forums, groups, members, themes, maintenance. An
|
|
603
623
|
administrator re-enters their password to get in, and again for anything
|
|
604
624
|
destructive.
|
|
605
|
-
- **\`npm run
|
|
625
|
+
- **\`npm run community -- --help\`** \u2014 the operator CLI. Everything the panel does
|
|
606
626
|
and a few things it cannot, without a browser.
|
|
607
627
|
|
|
608
628
|
## Upgrading
|
|
609
629
|
|
|
610
630
|
\`\`\`sh
|
|
611
|
-
npm install @meith/web@latest @meith/cli@latest
|
|
612
|
-
git commit -am "Upgrade @meith/web and @meith/
|
|
631
|
+
npm install --save-exact @meith/web@latest @meith/cli@latest @meith/theme-default@latest
|
|
632
|
+
git commit -am "Upgrade @meith/web, @meith/cli and @meith/theme-default"
|
|
613
633
|
git push
|
|
614
634
|
\`\`\`
|
|
615
635
|
|
|
@@ -617,8 +637,15 @@ That one \`package.json\` change is the whole pin: \`Dockerfile\`'s own
|
|
|
617
637
|
\`FROM\` line takes the version as a build argument, and
|
|
618
638
|
\`.github/workflows/build.yml\` reads it straight out of \`package.json\`'s
|
|
619
639
|
own \`@meith/web\` dependency when it rebuilds \u2014 nothing in \`Dockerfile\`
|
|
620
|
-
itself to keep in sync by hand.
|
|
621
|
-
\`
|
|
640
|
+
itself to keep in sync by hand. \`--save-exact\` matters: npm's default
|
|
641
|
+
\`save-prefix\` is \`^\`, and a caret range is not a legal Docker image tag \u2014
|
|
642
|
+
without it, this exact command would write \`"^0.18.0"\` and the next build
|
|
643
|
+
would fail with \`invalid reference format\` instead of building. This
|
|
644
|
+
project's own \`.npmrc\` sets \`save-exact=true\` for the same reason, so an
|
|
645
|
+
\`npm install\` of anything else here \u2014 a plugin, say \u2014 stays pinned too; the
|
|
646
|
+
build workflow also refuses to build from anything but an exact version, as
|
|
647
|
+
a second line of defense. Once the rebuilt image is deployed, run
|
|
648
|
+
\`npm run community -- upgrade\` against it for the plugin migrations \u2014 see
|
|
622
649
|
[the operator CLI](${repositoryUrl}/blob/main/docs/operating.md#the-operator-cli)
|
|
623
650
|
for running it against this deployment.
|
|
624
651
|
|
|
@@ -652,7 +679,15 @@ async function initGit(target) {
|
|
|
652
679
|
}
|
|
653
680
|
}
|
|
654
681
|
async function run(argv, version) {
|
|
655
|
-
const positional =
|
|
682
|
+
const positional = [];
|
|
683
|
+
for (let i = 0; i < argv.length; i++) {
|
|
684
|
+
const arg = argv[i];
|
|
685
|
+
if (arg === "--repo") {
|
|
686
|
+
i++;
|
|
687
|
+
continue;
|
|
688
|
+
}
|
|
689
|
+
if (!arg.startsWith("-")) positional.push(arg);
|
|
690
|
+
}
|
|
656
691
|
const name = positional[0] ?? "";
|
|
657
692
|
if (argv.includes("--help") || argv.includes("-h")) {
|
|
658
693
|
return {
|
|
@@ -723,7 +758,7 @@ async function run(argv, version) {
|
|
|
723
758
|
}
|
|
724
759
|
|
|
725
760
|
// src/bin.ts
|
|
726
|
-
var result = await run(process.argv.slice(2), "0.17.
|
|
761
|
+
var result = await run(process.argv.slice(2), "0.17.2");
|
|
727
762
|
for (const line of result.lines) {
|
|
728
763
|
if (result.code === 0) console.log(line);
|
|
729
764
|
else console.error(line);
|
package/package.json
CHANGED
package/src/bin.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { run } from './cli'
|
|
3
3
|
|
|
4
|
-
const result = await run(process.argv.slice(2), '0.17.
|
|
4
|
+
const result = await run(process.argv.slice(2), '0.17.2')
|
|
5
5
|
for (const line of result.lines) {
|
|
6
6
|
if (result.code === 0) console.log(line)
|
|
7
7
|
else console.error(line)
|
package/src/cli.ts
CHANGED
|
@@ -31,7 +31,15 @@ async function initGit(target: string): Promise<boolean> {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
export async function run(argv: readonly string[], version: string): Promise<CliResult> {
|
|
34
|
-
const positional =
|
|
34
|
+
const positional: string[] = []
|
|
35
|
+
for (let i = 0; i < argv.length; i++) {
|
|
36
|
+
const arg = argv[i] as string
|
|
37
|
+
if (arg === '--repo') {
|
|
38
|
+
i++
|
|
39
|
+
continue
|
|
40
|
+
}
|
|
41
|
+
if (!arg.startsWith('-')) positional.push(arg)
|
|
42
|
+
}
|
|
35
43
|
const name = positional[0] ?? ''
|
|
36
44
|
|
|
37
45
|
if (argv.includes('--help') || argv.includes('-h')) {
|
package/src/scaffold.ts
CHANGED
|
@@ -50,6 +50,17 @@ export function scaffold(options: ScaffoldOptions): ReadonlyMap<string, string>
|
|
|
50
50
|
)}\n`,
|
|
51
51
|
)
|
|
52
52
|
|
|
53
|
+
files.set(
|
|
54
|
+
'.npmrc',
|
|
55
|
+
`# Every @meith/* dependency here is an exact version, not a range — see
|
|
56
|
+
# README.md, "Upgrading", for why a range breaks the build. This makes that
|
|
57
|
+
# the default for any \`npm install\` run in this project from here on,
|
|
58
|
+
# including a plugin installed by hand later, not only the three packages
|
|
59
|
+
# the scaffold pinned itself.
|
|
60
|
+
save-exact=true
|
|
61
|
+
`,
|
|
62
|
+
)
|
|
63
|
+
|
|
53
64
|
files.set(
|
|
54
65
|
'community.config.ts',
|
|
55
66
|
`/**
|
|
@@ -375,6 +386,10 @@ jobs:
|
|
|
375
386
|
run: |
|
|
376
387
|
IMAGE=$(echo "ghcr.io/\${{ github.repository }}" | tr '[:upper:]' '[:lower:]')
|
|
377
388
|
MEITH_VERSION=$(node -p "require('./package.json').dependencies['@meith/web']")
|
|
389
|
+
if ! echo "$MEITH_VERSION" | grep -Eq '^[0-9]+\\.[0-9]+\\.[0-9]+$'; then
|
|
390
|
+
echo "::error::@meith/web in package.json is '$MEITH_VERSION', not an exact X.Y.Z version — that is not a legal Docker image tag. Upgrade with \\\`npm install --save-exact\\\` (see README.md, Upgrading) so this dependency always resolves to one."
|
|
391
|
+
exit 1
|
|
392
|
+
fi
|
|
378
393
|
docker build --build-arg MEITH_VERSION="$MEITH_VERSION" -t "$IMAGE:\${{ github.sha }}" -t "$IMAGE:latest" .
|
|
379
394
|
docker push "$IMAGE:\${{ github.sha }}"
|
|
380
395
|
docker push "$IMAGE:latest"
|
|
@@ -390,12 +405,15 @@ jobs:
|
|
|
390
405
|
echo
|
|
391
406
|
echo "Paste this into the MEITH_IMAGE variable on the Coolify resource:"
|
|
392
407
|
echo
|
|
393
|
-
echo " $IMAGE:latest"
|
|
394
|
-
echo
|
|
395
|
-
echo "Once you want a pin that only moves when you say so:"
|
|
396
|
-
echo
|
|
397
408
|
echo " $IMAGE:\${{ github.sha }}"
|
|
398
409
|
echo
|
|
410
|
+
echo "This tag names this run's build and nothing else, ever. $IMAGE:latest"
|
|
411
|
+
echo "also pushed, as a convenience for a quick manual pull; it moves on"
|
|
412
|
+
echo "every push to main, so any later Coolify redeploy — for any reason,"
|
|
413
|
+
echo "not necessarily this one — pulls whatever main most recently built,"
|
|
414
|
+
echo "including a commit still mid-feature. Prefer the sha above for the"
|
|
415
|
+
echo "value you actually set on the resource."
|
|
416
|
+
echo
|
|
399
417
|
echo "## One-time: make the package public"
|
|
400
418
|
echo
|
|
401
419
|
echo "This package starts private. Coolify's pull fails until you visit"
|
|
@@ -548,10 +566,13 @@ one value only you know:
|
|
|
548
566
|
\`TICK_SECRET\` and the database password, generated on the first deploy
|
|
549
567
|
and never typed in. The one thing Coolify cannot generate is the image
|
|
550
568
|
step 1 just pushed: set \`MEITH_IMAGE\` in the resource's own environment
|
|
551
|
-
to the value that run's Summary printed — \`ghcr.io/<you>/${name}
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
569
|
+
to the value that run's Summary printed — \`ghcr.io/<you>/${name}:\${{ github.sha }}\`,
|
|
570
|
+
a pin that only ever names that one build (\`docker-compose.yml\` refuses
|
|
571
|
+
to start without this set, with a message saying why). The same run also
|
|
572
|
+
pushes \`ghcr.io/<you>/${name}:latest\` as a convenience for a quick manual
|
|
573
|
+
pull, but it moves on every push to \`main\` — set it on the resource and a
|
|
574
|
+
later, unrelated redeploy can pull whatever \`main\` most recently built,
|
|
575
|
+
commit still mid-feature included.
|
|
555
576
|
|
|
556
577
|
3. **Deploy, then \`/install\` on your own domain.** Coolify issues the
|
|
557
578
|
certificate; the installer from there is the one
|
|
@@ -601,8 +622,8 @@ With no \`DATABASE_URL\`, the board runs on deterministic in-memory sample data
|
|
|
601
622
|
enough to click through every reading surface. Posting needs a database:
|
|
602
623
|
|
|
603
624
|
\`\`\`sh
|
|
604
|
-
npm run
|
|
605
|
-
npm run
|
|
625
|
+
npm run community -- migrate
|
|
626
|
+
echo "<password>" | npm run community -- user:create --username <name> --email <address> --group administrators
|
|
606
627
|
\`\`\`
|
|
607
628
|
|
|
608
629
|
## Configuring
|
|
@@ -613,14 +634,14 @@ npm run forum -- user:create --admin
|
|
|
613
634
|
- **\`/admin\`** — settings, forums, groups, members, themes, maintenance. An
|
|
614
635
|
administrator re-enters their password to get in, and again for anything
|
|
615
636
|
destructive.
|
|
616
|
-
- **\`npm run
|
|
637
|
+
- **\`npm run community -- --help\`** — the operator CLI. Everything the panel does
|
|
617
638
|
and a few things it cannot, without a browser.
|
|
618
639
|
|
|
619
640
|
## Upgrading
|
|
620
641
|
|
|
621
642
|
\`\`\`sh
|
|
622
|
-
npm install @meith/web@latest @meith/cli@latest
|
|
623
|
-
git commit -am "Upgrade @meith/web and @meith/
|
|
643
|
+
npm install --save-exact @meith/web@latest @meith/cli@latest @meith/theme-default@latest
|
|
644
|
+
git commit -am "Upgrade @meith/web, @meith/cli and @meith/theme-default"
|
|
624
645
|
git push
|
|
625
646
|
\`\`\`
|
|
626
647
|
|
|
@@ -628,8 +649,15 @@ That one \`package.json\` change is the whole pin: \`Dockerfile\`'s own
|
|
|
628
649
|
\`FROM\` line takes the version as a build argument, and
|
|
629
650
|
\`.github/workflows/build.yml\` reads it straight out of \`package.json\`'s
|
|
630
651
|
own \`@meith/web\` dependency when it rebuilds — nothing in \`Dockerfile\`
|
|
631
|
-
itself to keep in sync by hand.
|
|
632
|
-
\`
|
|
652
|
+
itself to keep in sync by hand. \`--save-exact\` matters: npm's default
|
|
653
|
+
\`save-prefix\` is \`^\`, and a caret range is not a legal Docker image tag —
|
|
654
|
+
without it, this exact command would write \`"^0.18.0"\` and the next build
|
|
655
|
+
would fail with \`invalid reference format\` instead of building. This
|
|
656
|
+
project's own \`.npmrc\` sets \`save-exact=true\` for the same reason, so an
|
|
657
|
+
\`npm install\` of anything else here — a plugin, say — stays pinned too; the
|
|
658
|
+
build workflow also refuses to build from anything but an exact version, as
|
|
659
|
+
a second line of defense. Once the rebuilt image is deployed, run
|
|
660
|
+
\`npm run community -- upgrade\` against it for the plugin migrations — see
|
|
633
661
|
[the operator CLI](${repositoryUrl}/blob/main/docs/operating.md#the-operator-cli)
|
|
634
662
|
for running it against this deployment.
|
|
635
663
|
|