adam-os 0.1.9 → 0.2.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/bin/adam-os.js +10 -10
- package/next.config.ts +4 -0
- package/package.json +1 -1
package/bin/adam-os.js
CHANGED
|
@@ -116,7 +116,7 @@ function printBanner(url, mode) {
|
|
|
116
116
|
async function main() {
|
|
117
117
|
checkNodeVersion();
|
|
118
118
|
|
|
119
|
-
const
|
|
119
|
+
const isDev = process.argv.includes("--dev");
|
|
120
120
|
const portArg = process.argv.find((a) => a.startsWith("--port="));
|
|
121
121
|
const basePort = portArg ? parseInt(portArg.split("=")[1], 10) : 3000;
|
|
122
122
|
|
|
@@ -137,12 +137,19 @@ async function main() {
|
|
|
137
137
|
process.on("SIGINT", () => process.exit(0));
|
|
138
138
|
process.on("SIGTERM", () => process.exit(0));
|
|
139
139
|
|
|
140
|
-
if (
|
|
140
|
+
if (isDev) {
|
|
141
|
+
printBanner(url, "Development (live reload)");
|
|
142
|
+
const server = spawn(nextBin, ["dev", "--port", String(port)], {
|
|
143
|
+
cwd: PKG_ROOT, stdio: "inherit", env,
|
|
144
|
+
});
|
|
145
|
+
setTimeout(() => openBrowser(url), 3500);
|
|
146
|
+
server.on("exit", (code) => process.exit(code ?? 0));
|
|
147
|
+
} else {
|
|
141
148
|
console.log("\n Building production bundle (this takes ~30 seconds)...\n");
|
|
142
149
|
try {
|
|
143
150
|
execSync(`"${nextBin}" build`, { cwd: PKG_ROOT, stdio: "inherit", env });
|
|
144
151
|
} catch (_) {
|
|
145
|
-
console.error("\n ✗ Build failed. Try dev mode: npx adam-os\n");
|
|
152
|
+
console.error("\n ✗ Build failed. Try dev mode: npx adam-os --dev\n");
|
|
146
153
|
process.exit(1);
|
|
147
154
|
}
|
|
148
155
|
printBanner(url, "Production");
|
|
@@ -151,13 +158,6 @@ async function main() {
|
|
|
151
158
|
});
|
|
152
159
|
setTimeout(() => openBrowser(url), 2000);
|
|
153
160
|
server.on("exit", (code) => process.exit(code ?? 0));
|
|
154
|
-
} else {
|
|
155
|
-
printBanner(url, "Development (live reload)");
|
|
156
|
-
const server = spawn(nextBin, ["dev", "--port", String(port)], {
|
|
157
|
-
cwd: PKG_ROOT, stdio: "inherit", env,
|
|
158
|
-
});
|
|
159
|
-
setTimeout(() => openBrowser(url), 3500);
|
|
160
|
-
server.on("exit", (code) => process.exit(code ?? 0));
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
163
|
|
package/next.config.ts
CHANGED