@kithinji/pod 1.0.49 → 1.0.50
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/index.js +29 -2
- package/dist/index.js.map +2 -2
- package/dist/types/dev/server.d.ts +1 -1
- package/dist/types/dev/server.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4722,7 +4722,7 @@ async function startDevServer() {
|
|
|
4722
4722
|
}
|
|
4723
4723
|
await serverCtx.watch();
|
|
4724
4724
|
}
|
|
4725
|
-
async function startBuild() {
|
|
4725
|
+
async function startBuild(start = false) {
|
|
4726
4726
|
const logger = createLogger(false);
|
|
4727
4727
|
const store = Store.getInstance();
|
|
4728
4728
|
logger.info("Starting production build...");
|
|
@@ -4786,6 +4786,30 @@ async function startBuild() {
|
|
|
4786
4786
|
}
|
|
4787
4787
|
logger.info("Production build completed successfully!");
|
|
4788
4788
|
logger.info(`Output: dist/${hasClientFiles ? " and public/" : ""}`);
|
|
4789
|
+
if (start) {
|
|
4790
|
+
logger.info("Starting production server...");
|
|
4791
|
+
const serverProcess = spawn("node", ["dist/main.js"], {
|
|
4792
|
+
stdio: "inherit"
|
|
4793
|
+
});
|
|
4794
|
+
serverProcess.on("error", (err) => {
|
|
4795
|
+
logger.error("Server process error:", err);
|
|
4796
|
+
process.exit(1);
|
|
4797
|
+
});
|
|
4798
|
+
serverProcess.on("exit", (code) => {
|
|
4799
|
+
if (code !== null && code !== 0) {
|
|
4800
|
+
logger.error(`Server process exited with code ${code}`);
|
|
4801
|
+
process.exit(code);
|
|
4802
|
+
}
|
|
4803
|
+
});
|
|
4804
|
+
const shutdown = async () => {
|
|
4805
|
+
logger.info("Shutting down production server...");
|
|
4806
|
+
await waitForProcessExit(serverProcess);
|
|
4807
|
+
process.exit(0);
|
|
4808
|
+
};
|
|
4809
|
+
process.on("SIGINT", shutdown);
|
|
4810
|
+
process.on("SIGTERM", shutdown);
|
|
4811
|
+
logger.info("Production server started successfully!");
|
|
4812
|
+
}
|
|
4789
4813
|
} catch (error) {
|
|
4790
4814
|
logger.error("Build failed:", error);
|
|
4791
4815
|
process.exit(1);
|
|
@@ -7514,7 +7538,7 @@ async function compileFiles(entryPoints) {
|
|
|
7514
7538
|
|
|
7515
7539
|
// src/index.ts
|
|
7516
7540
|
var program = new Command();
|
|
7517
|
-
program.name("pod").description("Pod cli tool").version("1.0.
|
|
7541
|
+
program.name("pod").description("Pod cli tool").version("1.0.48");
|
|
7518
7542
|
program.command("new <name> [type]").description("Start a new Orca Project").action(async (name, type) => {
|
|
7519
7543
|
const orca = async () => {
|
|
7520
7544
|
await addNew(name);
|
|
@@ -7550,6 +7574,9 @@ program.command("dev").description("Start Pod development server").action(async
|
|
|
7550
7574
|
program.command("build").description("Start Pod build").action(async (opts) => {
|
|
7551
7575
|
await startBuild();
|
|
7552
7576
|
});
|
|
7577
|
+
program.command("start").description("Start Pod build").action(async (opts) => {
|
|
7578
|
+
await startBuild(true);
|
|
7579
|
+
});
|
|
7553
7580
|
program.command("compile <files...>").description("Compile ts files with pod").action(async (files) => {
|
|
7554
7581
|
await compileFiles(files);
|
|
7555
7582
|
});
|