learnhouse 1.4.0 → 1.4.1
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/learnhouse.js +28 -34
- package/package.json +1 -1
package/dist/bin/learnhouse.js
CHANGED
|
@@ -3616,7 +3616,7 @@ var {
|
|
|
3616
3616
|
var import_picocolors23 = __toESM(require_picocolors(), 1);
|
|
3617
3617
|
|
|
3618
3618
|
// src/constants.ts
|
|
3619
|
-
var VERSION = "1.4.
|
|
3619
|
+
var VERSION = "1.4.1";
|
|
3620
3620
|
var APP_IMAGE = "ghcr.io/learnhouse/app:latest";
|
|
3621
3621
|
var DEV_IMAGE = "ghcr.io/learnhouse/app:dev";
|
|
3622
3622
|
var POSTGRES_IMAGE = "pgvector/pgvector:pg16";
|
|
@@ -7519,15 +7519,7 @@ async function devCommand(opts) {
|
|
|
7519
7519
|
const envOk = await checkDevEnv(root);
|
|
7520
7520
|
if (!envOk) process.exit(1);
|
|
7521
7521
|
const eePath = path7.join(root, "apps", "api", "ee");
|
|
7522
|
-
|
|
7523
|
-
let eeWasHidden = false;
|
|
7524
|
-
if (fs7.existsSync(eeDisabledPath) && !fs7.existsSync(eePath)) {
|
|
7525
|
-
fs7.renameSync(eeDisabledPath, eePath);
|
|
7526
|
-
}
|
|
7527
|
-
if (!opts.ee && fs7.existsSync(eePath)) {
|
|
7528
|
-
fs7.renameSync(eePath, eeDisabledPath);
|
|
7529
|
-
eeWasHidden = true;
|
|
7530
|
-
} else if (opts.ee) {
|
|
7522
|
+
if (opts.ee) {
|
|
7531
7523
|
if (fs7.existsSync(eePath)) {
|
|
7532
7524
|
R2.info(`Running in ${import_picocolors17.default.bold("EE")} mode`);
|
|
7533
7525
|
} else {
|
|
@@ -7548,26 +7540,29 @@ async function devCommand(opts) {
|
|
|
7548
7540
|
if (alreadyRunning) {
|
|
7549
7541
|
R2.success("Existing DB and Redis containers detected \u2014 reusing them");
|
|
7550
7542
|
}
|
|
7543
|
+
let adminEmail = opts.adminEmail;
|
|
7544
|
+
let adminPassword = opts.adminPassword;
|
|
7551
7545
|
if (!alreadyRunning) {
|
|
7552
|
-
|
|
7553
|
-
|
|
7554
|
-
|
|
7555
|
-
|
|
7556
|
-
|
|
7557
|
-
|
|
7558
|
-
|
|
7559
|
-
|
|
7560
|
-
}
|
|
7561
|
-
if (
|
|
7562
|
-
|
|
7546
|
+
if (!adminEmail) {
|
|
7547
|
+
const emailInput = await text({
|
|
7548
|
+
message: "Admin email",
|
|
7549
|
+
placeholder: "admin@school.dev",
|
|
7550
|
+
defaultValue: "admin@school.dev"
|
|
7551
|
+
});
|
|
7552
|
+
if (Ct(emailInput)) process.exit(0);
|
|
7553
|
+
adminEmail = emailInput;
|
|
7554
|
+
}
|
|
7555
|
+
if (!adminPassword) {
|
|
7556
|
+
const passwordInput = await He({
|
|
7557
|
+
message: "Admin password"
|
|
7558
|
+
});
|
|
7559
|
+
if (Ct(passwordInput)) process.exit(0);
|
|
7560
|
+
adminPassword = passwordInput;
|
|
7561
|
+
}
|
|
7562
|
+
if (!adminPassword) {
|
|
7563
7563
|
R2.error("Password is required.");
|
|
7564
7564
|
process.exit(1);
|
|
7565
7565
|
}
|
|
7566
|
-
serviceEnv = {
|
|
7567
|
-
FORCE_COLOR: "1",
|
|
7568
|
-
LEARNHOUSE_INITIAL_ADMIN_EMAIL: email,
|
|
7569
|
-
LEARNHOUSE_INITIAL_ADMIN_PASSWORD: password
|
|
7570
|
-
};
|
|
7571
7566
|
const infraSpinner = bt2();
|
|
7572
7567
|
infraSpinner.start("Starting DB and Redis containers...");
|
|
7573
7568
|
try {
|
|
@@ -7581,11 +7576,13 @@ async function devCommand(opts) {
|
|
|
7581
7576
|
R2.error(e2.stderr?.toString() || "docker compose up failed");
|
|
7582
7577
|
process.exit(1);
|
|
7583
7578
|
}
|
|
7584
|
-
} else {
|
|
7585
|
-
serviceEnv = {
|
|
7586
|
-
FORCE_COLOR: "1"
|
|
7587
|
-
};
|
|
7588
7579
|
}
|
|
7580
|
+
serviceEnv = {
|
|
7581
|
+
FORCE_COLOR: "1",
|
|
7582
|
+
...adminEmail && { LEARNHOUSE_INITIAL_ADMIN_EMAIL: adminEmail },
|
|
7583
|
+
...adminPassword && { LEARNHOUSE_INITIAL_ADMIN_PASSWORD: adminPassword },
|
|
7584
|
+
...!opts.ee && { LEARNHOUSE_DISABLE_EE: "1" }
|
|
7585
|
+
};
|
|
7589
7586
|
const healthSpinner = bt2();
|
|
7590
7587
|
healthSpinner.start("Waiting for DB and Redis to be healthy...");
|
|
7591
7588
|
const [dbReady, redisReady] = await Promise.all([
|
|
@@ -7654,9 +7651,6 @@ async function devCommand(opts) {
|
|
|
7654
7651
|
}
|
|
7655
7652
|
process.stdin.pause();
|
|
7656
7653
|
await Promise.all([killProcess(apiProc), killProcess(webProc), killProcess(collabProc)]);
|
|
7657
|
-
if (eeWasHidden && fs7.existsSync(eeDisabledPath) && !fs7.existsSync(eePath)) {
|
|
7658
|
-
fs7.renameSync(eeDisabledPath, eePath);
|
|
7659
|
-
}
|
|
7660
7654
|
console.log(import_picocolors17.default.dim("DB and Redis containers are still running for next session."));
|
|
7661
7655
|
console.log(import_picocolors17.default.dim("To stop them: docker compose -f .learnhouse/docker-compose.dev.yml -p learnhouse-dev down"));
|
|
7662
7656
|
console.log(import_picocolors17.default.dim("Thanks for building with LearnHouse!"));
|
|
@@ -8353,7 +8347,7 @@ program2.command("status").description("Show service status").action(statusComma
|
|
|
8353
8347
|
program2.command("health").description("Run health checks").action(healthCommand);
|
|
8354
8348
|
program2.command("env").description("Edit environment variables").action(envCommand);
|
|
8355
8349
|
program2.command("restore").description("Restore database from a backup archive").argument("<archive>", "Path to backup archive").action(restoreCommand);
|
|
8356
|
-
program2.command("dev").description("Start development environment (DB + Redis in Docker, API + Web locally)").option("--ee", "Enable Enterprise Edition features (keeps ee/ folder)").action(devCommand);
|
|
8350
|
+
program2.command("dev").description("Start development environment (DB + Redis in Docker, API + Web locally)").option("--ee", "Enable Enterprise Edition features (keeps ee/ folder)").option("--admin-email <email>", "Admin email (default: admin@school.dev)").option("--admin-password <password>", "Admin password (skips interactive prompt)").action(devCommand);
|
|
8357
8351
|
var updateCheck = checkForUpdates();
|
|
8358
8352
|
program2.parseAsync().then(() => updateCheck.catch(() => {
|
|
8359
8353
|
}));
|