kentutai-app 1.1.3 → 1.1.5
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/cli/cli.js +10 -32
- package/package.json +3 -3
package/cli/cli.js
CHANGED
|
@@ -52,16 +52,7 @@ Options:
|
|
|
52
52
|
|
|
53
53
|
const appDir = path.join(__dirname, "app");
|
|
54
54
|
const standaloneServer = path.join(appDir, "server.js");
|
|
55
|
-
const mainAppDir = path.resolve(__dirname, "..");
|
|
56
|
-
const mainServerPath = path.join(mainAppDir, ".next", "standalone", "server.js");
|
|
57
|
-
|
|
58
55
|
const useStandalone = fs.existsSync(standaloneServer);
|
|
59
|
-
const useMainApp = !useStandalone && fs.existsSync(mainServerPath);
|
|
60
|
-
|
|
61
|
-
if (!useStandalone && !useMainApp) {
|
|
62
|
-
console.log("\n First run detected. Starting development server...\n");
|
|
63
|
-
console.log(" For production, run: npm run build\n");
|
|
64
|
-
}
|
|
65
56
|
|
|
66
57
|
function openBrowser(url) {
|
|
67
58
|
const cmd = process.platform === "darwin" ? "open"
|
|
@@ -97,31 +88,18 @@ function startServer() {
|
|
|
97
88
|
const displayHost = host === DEFAULT_HOST ? "localhost" : host;
|
|
98
89
|
const url = `http://${displayHost}:${port}/dashboard`;
|
|
99
90
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
cwd: appDir,
|
|
105
|
-
stdio: showLog ? "inherit" : "ignore",
|
|
106
|
-
env: { ...process.env, PORT: String(port), HOSTNAME: host }
|
|
107
|
-
});
|
|
108
|
-
} else if (useMainApp) {
|
|
109
|
-
server = spawn(process.execPath, ["--max-old-space-size=4096", mainServerPath], {
|
|
110
|
-
cwd: path.join(mainAppDir, ".next", "standalone"),
|
|
111
|
-
stdio: showLog ? "inherit" : "ignore",
|
|
112
|
-
env: { ...process.env, PORT: String(port), HOSTNAME: host }
|
|
113
|
-
});
|
|
114
|
-
} else {
|
|
115
|
-
const isWin = process.platform === "win32";
|
|
116
|
-
const npmCmd = isWin ? "npm.cmd" : "npm";
|
|
117
|
-
server = spawn(npmCmd, ["run", "dev", "--", "--port", String(port)], {
|
|
118
|
-
cwd: mainAppDir,
|
|
119
|
-
stdio: showLog ? "inherit" : "ignore",
|
|
120
|
-
shell: isWin,
|
|
121
|
-
env: { ...process.env, PORT: String(port) }
|
|
122
|
-
});
|
|
91
|
+
if (!useStandalone) {
|
|
92
|
+
console.error("\n Error: Standalone build not found.");
|
|
93
|
+
console.error(" Please run 'npm run build:cli' first.\n");
|
|
94
|
+
process.exit(1);
|
|
123
95
|
}
|
|
124
96
|
|
|
97
|
+
const server = spawn(process.execPath, ["--max-old-space-size=4096", standaloneServer], {
|
|
98
|
+
cwd: appDir,
|
|
99
|
+
stdio: showLog ? "inherit" : "ignore",
|
|
100
|
+
env: { ...process.env, PORT: String(port), HOSTNAME: host }
|
|
101
|
+
});
|
|
102
|
+
|
|
125
103
|
server.on("error", (err) => {
|
|
126
104
|
console.error("Failed to start server:", err.message);
|
|
127
105
|
process.exit(1);
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kentutai-app",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.5",
|
|
4
4
|
"description": "KentutAI web dashboard",
|
|
5
5
|
"private": false,
|
|
6
6
|
"bin": {
|
|
7
|
-
"kentutai": "bin.js"
|
|
7
|
+
"kentutai": "./bin.js"
|
|
8
8
|
},
|
|
9
|
-
"scripts": {
|
|
9
|
+
"scripts": {
|
|
10
10
|
"dev": "next dev --webpack --port 20123",
|
|
11
11
|
"build": "next build",
|
|
12
12
|
"build:cli": "powershell -ExecutionPolicy Bypass -File scripts/build-cli.ps1",
|