pi-kot 0.1.1 → 0.1.3
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/README.md +1 -1
- package/bin/pi-kot.mjs +11 -0
- package/dist/client/assets/{index-UJgsBs6a.js → index-C7roKiDH.js} +74 -74
- package/dist/client/assets/index-C7roKiDH.js.map +1 -0
- package/dist/client/assets/{index-ZuTc_0YY.css → index-CpEqb7TV.css} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +18 -0
- package/dist/server/index.js.map +1 -1
- package/dist/server/routes/sessions.d.ts.map +1 -1
- package/dist/server/routes/sessions.js +60 -0
- package/dist/server/routes/sessions.js.map +1 -1
- package/package.json +1 -1
- package/dist/client/assets/index-UJgsBs6a.js.map +0 -1
package/README.md
CHANGED
package/bin/pi-kot.mjs
CHANGED
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
import { readFileSync } from "node:fs";
|
|
36
36
|
import { dirname, resolve } from "node:path";
|
|
37
37
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
38
|
+
import { homedir } from "node:os";
|
|
38
39
|
|
|
39
40
|
const here = dirname(fileURLToPath(import.meta.url));
|
|
40
41
|
const packageRoot = resolve(here, "..");
|
|
@@ -113,6 +114,16 @@ for (let i = 0; i < args.length; i++) {
|
|
|
113
114
|
process.env.CLIENT_DIST_PATH ??= resolve(packageRoot, "dist", "client");
|
|
114
115
|
process.env.NODE_ENV ??= "production";
|
|
115
116
|
|
|
117
|
+
// Auto-mount the current working directory as a project if it's not the
|
|
118
|
+
// workspace root itself. This makes `npx pi-kot` from any project folder
|
|
119
|
+
// show that folder in the project list automatically.
|
|
120
|
+
const cwd = process.cwd();
|
|
121
|
+
const defaultWorkspace = resolve(homedir(), ".pi-kot", "workspace", "default");
|
|
122
|
+
const workspacePath = resolve(process.env.WORKSPACE_PATH ?? defaultWorkspace);
|
|
123
|
+
if (cwd !== workspacePath) {
|
|
124
|
+
process.env.MOUNT_CWD_PROJECT = cwd;
|
|
125
|
+
}
|
|
126
|
+
|
|
116
127
|
// Log startup info
|
|
117
128
|
const port = process.env.PORT ?? "3333";
|
|
118
129
|
const host = process.env.HOST ?? "0.0.0.0";
|