@betterstart/cli 0.1.16 → 0.1.17
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/cli.js +25 -6
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -11663,7 +11663,7 @@ var CORE_DEPS = [
|
|
|
11663
11663
|
"vaul"
|
|
11664
11664
|
];
|
|
11665
11665
|
var EMAIL_DEPS = ["resend", "@react-email/components"];
|
|
11666
|
-
var DEV_DEPS = ["drizzle-kit", "sass", "@types/katex", "@types/markdown-it"];
|
|
11666
|
+
var DEV_DEPS = ["drizzle-kit", "tsx", "sass", "@types/katex", "@types/markdown-it"];
|
|
11667
11667
|
var BIOME_DEV_DEPS = ["@biomejs/biome"];
|
|
11668
11668
|
function buildAddArgs(pm, deps, dev) {
|
|
11669
11669
|
const devFlag = dev ? pm === "yarn" ? "--dev" : "-D" : "";
|
|
@@ -13437,8 +13437,24 @@ function buildSeedScript() {
|
|
|
13437
13437
|
* AUTO-GENERATED \u2014 safe to delete after running
|
|
13438
13438
|
*/
|
|
13439
13439
|
|
|
13440
|
-
import {
|
|
13441
|
-
|
|
13440
|
+
import { readFileSync } from 'node:fs'
|
|
13441
|
+
import { resolve } from 'node:path'
|
|
13442
|
+
|
|
13443
|
+
// Load .env.local (inline \u2014 avoids @next/env dependency)
|
|
13444
|
+
for (const envFile of ['.env.local', '.env']) {
|
|
13445
|
+
try {
|
|
13446
|
+
const content = readFileSync(resolve(process.cwd(), envFile), 'utf-8')
|
|
13447
|
+
for (const line of content.split('\\n')) {
|
|
13448
|
+
const trimmed = line.trim()
|
|
13449
|
+
if (!trimmed || trimmed.startsWith('#')) continue
|
|
13450
|
+
const eqIdx = trimmed.indexOf('=')
|
|
13451
|
+
if (eqIdx === -1) continue
|
|
13452
|
+
const key = trimmed.slice(0, eqIdx).trim()
|
|
13453
|
+
const val = trimmed.slice(eqIdx + 1).trim().replace(/^['"]|['"]$/g, '')
|
|
13454
|
+
if (!process.env[key]) process.env[key] = val
|
|
13455
|
+
}
|
|
13456
|
+
} catch {}
|
|
13457
|
+
}
|
|
13442
13458
|
|
|
13443
13459
|
import { neon } from '@neondatabase/serverless'
|
|
13444
13460
|
import { drizzle } from 'drizzle-orm/neon-http'
|
|
@@ -13557,7 +13573,8 @@ var seedCommand = new Command2("seed").description("Create the initial admin use
|
|
|
13557
13573
|
spinner3.start("Creating admin user...");
|
|
13558
13574
|
try {
|
|
13559
13575
|
const { execFileSync: execFileSync5 } = await import("child_process");
|
|
13560
|
-
|
|
13576
|
+
const tsxBin = path36.join(cwd, "node_modules", ".bin", "tsx");
|
|
13577
|
+
execFileSync5(tsxBin, [seedPath], {
|
|
13561
13578
|
cwd,
|
|
13562
13579
|
stdio: "pipe",
|
|
13563
13580
|
env: {
|
|
@@ -13992,7 +14009,8 @@ async function runSeed(cwd, cmsDir, email, password3) {
|
|
|
13992
14009
|
}
|
|
13993
14010
|
fs32.writeFileSync(seedPath, buildSeedScript(), "utf-8");
|
|
13994
14011
|
try {
|
|
13995
|
-
|
|
14012
|
+
const tsxBin = path37.join(cwd, "node_modules", ".bin", "tsx");
|
|
14013
|
+
execFileSync4(tsxBin, [seedPath], {
|
|
13996
14014
|
cwd,
|
|
13997
14015
|
stdio: "pipe",
|
|
13998
14016
|
timeout: 3e4,
|
|
@@ -14014,7 +14032,8 @@ async function runSeed(cwd, cmsDir, email, password3) {
|
|
|
14014
14032
|
}
|
|
14015
14033
|
function runDrizzlePush(cwd) {
|
|
14016
14034
|
return new Promise((resolve) => {
|
|
14017
|
-
const
|
|
14035
|
+
const drizzleBin = path37.join(cwd, "node_modules", ".bin", "drizzle-kit");
|
|
14036
|
+
const child = spawn2(drizzleBin, ["push", "--force"], {
|
|
14018
14037
|
cwd,
|
|
14019
14038
|
stdio: "pipe",
|
|
14020
14039
|
env: { ...process.env }
|