@air-jam/server 0.9.1 → 0.9.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/bin/air-jam-server.mjs +43 -20
- package/dist/.tsbuildinfo +1 -1
- package/dist/chunk-AYTGY3H3.js +67 -0
- package/dist/chunk-AYTGY3H3.js.map +1 -0
- package/dist/{chunk-5ZVGSYXC.js → chunk-LWVOQ5PH.js} +50 -44
- package/dist/chunk-LWVOQ5PH.js.map +1 -0
- package/dist/chunk-PSWSCMDN.js +48 -0
- package/dist/chunk-PSWSCMDN.js.map +1 -0
- package/dist/cli.js +29 -112
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +465 -0
- package/dist/index.js +1086 -1879
- package/dist/index.js.map +1 -1
- package/dist/process-lifecycle-M4XOAN4Q.js +8 -0
- package/package.json +41 -26
- package/dist/chunk-5ZVGSYXC.js.map +0 -1
- package/dist/chunk-RM7AMBDY.js +0 -831
- package/dist/chunk-RM7AMBDY.js.map +0 -1
- package/dist/game-dev-D3TEAHOD.js +0 -422
- package/dist/game-dev-D3TEAHOD.js.map +0 -1
- package/dist/local-dev-state-QT7H5GUA.js +0 -270
- package/dist/local-dev-state-QT7H5GUA.js.map +0 -1
- package/dist/secure-dev-HMOGLYVC.js +0 -39
- package/dist/topology-PM3PI753.js +0 -140
- package/dist/topology-PM3PI753.js.map +0 -1
- package/src/project-cli/vite-config.d.mts +0 -17
- package/src/project-cli/vite-config.mjs +0 -121
- package/src/project-cli/vite-https.d.mts +0 -14
- package/src/project-cli/vite-https.mjs +0 -39
- /package/dist/{secure-dev-HMOGLYVC.js.map → process-lifecycle-M4XOAN4Q.js.map} +0 -0
package/bin/air-jam-server.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
+
import { spawn } from "node:child_process";
|
|
3
4
|
import { existsSync } from "node:fs";
|
|
4
5
|
import path from "node:path";
|
|
5
|
-
import { spawn } from "node:child_process";
|
|
6
6
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
7
7
|
|
|
8
8
|
const packageRoot = path.resolve(
|
|
@@ -10,40 +10,63 @@ const packageRoot = path.resolve(
|
|
|
10
10
|
"..",
|
|
11
11
|
);
|
|
12
12
|
const distEntry = path.join(packageRoot, "dist", "cli.js");
|
|
13
|
-
const
|
|
13
|
+
const repoRoot = path.resolve(packageRoot, "../..");
|
|
14
|
+
const workspaceBuildScript = path.join(
|
|
15
|
+
repoRoot,
|
|
16
|
+
"scripts",
|
|
17
|
+
"ensure-workspace-package-build.mjs",
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
const buildWorkspacePackage = async () => {
|
|
21
|
+
if (!existsSync(workspaceBuildScript)) {
|
|
22
|
+
throw new Error(
|
|
23
|
+
"The installed @air-jam/server package is missing its built CLI entrypoint.",
|
|
24
|
+
);
|
|
25
|
+
}
|
|
14
26
|
|
|
15
|
-
|
|
16
|
-
new Promise((resolve, reject) => {
|
|
27
|
+
await new Promise((resolve, reject) => {
|
|
17
28
|
const child = spawn(
|
|
18
29
|
process.execPath,
|
|
19
|
-
[
|
|
30
|
+
[workspaceBuildScript, "@air-jam/server"],
|
|
20
31
|
{
|
|
21
|
-
cwd:
|
|
32
|
+
cwd: repoRoot,
|
|
22
33
|
stdio: "inherit",
|
|
23
34
|
env: process.env,
|
|
24
35
|
},
|
|
25
36
|
);
|
|
26
37
|
|
|
27
38
|
child.on("exit", (code, signal) => {
|
|
28
|
-
if (
|
|
29
|
-
|
|
39
|
+
if (code === 0) {
|
|
40
|
+
resolve(undefined);
|
|
30
41
|
return;
|
|
31
42
|
}
|
|
32
43
|
|
|
33
|
-
|
|
34
|
-
|
|
44
|
+
reject(
|
|
45
|
+
new Error(
|
|
46
|
+
signal
|
|
47
|
+
? `Workspace server build terminated by signal ${signal}.`
|
|
48
|
+
: `Workspace server build exited with code ${code}.`,
|
|
49
|
+
),
|
|
50
|
+
);
|
|
35
51
|
});
|
|
36
|
-
|
|
37
52
|
child.on("error", reject);
|
|
38
53
|
});
|
|
54
|
+
};
|
|
39
55
|
|
|
40
|
-
if (existsSync(distEntry)) {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
56
|
+
if (!existsSync(distEntry)) {
|
|
57
|
+
await buildWorkspacePackage();
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (!existsSync(distEntry)) {
|
|
61
|
+
throw new Error(
|
|
62
|
+
"The @air-jam/server build completed without producing dist/cli.js.",
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const loaded = await import(pathToFileURL(distEntry).href);
|
|
67
|
+
if (typeof loaded.runServerCli !== "function") {
|
|
68
|
+
throw new Error(
|
|
69
|
+
"The @air-jam/server built CLI entrypoint does not export runServerCli.",
|
|
70
|
+
);
|
|
49
71
|
}
|
|
72
|
+
process.exitCode = await loaded.runServerCli();
|