@cedarjs/cli 5.0.0-canary.2511 → 5.0.0-canary.2513
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.
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import execa from "execa";
|
|
4
3
|
import { recordTelemetryAttributes } from "@cedarjs/cli-helpers";
|
|
5
|
-
import {
|
|
6
|
-
getNodeRunnerArgs,
|
|
7
|
-
runBin
|
|
8
|
-
} from "@cedarjs/cli-helpers/packageManager/exec";
|
|
4
|
+
import { runBin, runWithNode } from "@cedarjs/cli-helpers/packageManager/exec";
|
|
9
5
|
import { getPaths } from "@cedarjs/project-config";
|
|
10
|
-
async function
|
|
6
|
+
async function runBinWithThrow(bin, args, options) {
|
|
11
7
|
const result = await runBin(bin, args, options);
|
|
12
8
|
if (result.failed) {
|
|
13
9
|
throw new Error(`Command (${bin} ${args.join(" ")}) failed`);
|
|
@@ -36,24 +32,25 @@ const handler = async ({
|
|
|
36
32
|
async function runApiCommands() {
|
|
37
33
|
if (!serve) {
|
|
38
34
|
console.log("Building api...");
|
|
39
|
-
await
|
|
35
|
+
await runBinWithThrow("cedar", ["build", "api", "--verbose"], execaConfig);
|
|
40
36
|
if (prisma) {
|
|
41
37
|
console.log("Running database migrations...");
|
|
42
|
-
await
|
|
43
|
-
|
|
38
|
+
await runBinWithThrow(
|
|
39
|
+
"prisma",
|
|
40
|
+
["migrate", "deploy", "--config", cedarPaths.api.prismaConfig],
|
|
44
41
|
execaConfig
|
|
45
42
|
);
|
|
46
43
|
}
|
|
47
44
|
if (dataMigrate) {
|
|
48
45
|
console.log("Running data migrations...");
|
|
49
|
-
await
|
|
46
|
+
await runBinWithThrow("cedar", ["dataMigrate", "up"], execaConfig);
|
|
50
47
|
}
|
|
51
48
|
return;
|
|
52
49
|
}
|
|
53
50
|
const serverFilePath = path.join(cedarPaths.api.dist, "server.js");
|
|
54
51
|
const hasServerFile = fs.existsSync(serverFilePath);
|
|
55
52
|
if (hasServerFile) {
|
|
56
|
-
|
|
53
|
+
runWithNode(serverFilePath, execaConfig);
|
|
57
54
|
} else {
|
|
58
55
|
const { handler: handler2 } = await import("@cedarjs/api-server/apiCliConfigHandler");
|
|
59
56
|
handler2();
|
|
@@ -61,7 +58,7 @@ const handler = async ({
|
|
|
61
58
|
}
|
|
62
59
|
async function runWebCommands() {
|
|
63
60
|
console.log("Building web...");
|
|
64
|
-
await
|
|
61
|
+
await runBinWithThrow("cedar", ["build", "web", "--verbose"], execaConfig);
|
|
65
62
|
}
|
|
66
63
|
if (side === "api") {
|
|
67
64
|
await runApiCommands();
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import path from "path";
|
|
3
|
-
import execa from "execa";
|
|
4
3
|
import { recordTelemetryAttributes } from "@cedarjs/cli-helpers";
|
|
5
4
|
import { formatAddRootPackagesCommand } from "@cedarjs/cli-helpers/packageManager/display";
|
|
6
5
|
import {
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
runBinSync,
|
|
7
|
+
runWithNode
|
|
9
8
|
} from "@cedarjs/cli-helpers/packageManager/exec";
|
|
10
9
|
import { installPackages } from "@cedarjs/cli-helpers/packageManager/packages";
|
|
11
10
|
import { getPaths } from "@cedarjs/project-config";
|
|
@@ -25,8 +24,9 @@ const handler = async ({ side, prisma, dataMigrate }) => {
|
|
|
25
24
|
async function runApiCommands() {
|
|
26
25
|
if (prisma) {
|
|
27
26
|
console.log("Running database migrations...");
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
runBinSync(
|
|
28
|
+
"prisma",
|
|
29
|
+
["migrate", "deploy", "--config", cedarPaths.api.prismaConfig],
|
|
30
30
|
execaConfig
|
|
31
31
|
);
|
|
32
32
|
}
|
|
@@ -55,7 +55,7 @@ const handler = async ({ side, prisma, dataMigrate }) => {
|
|
|
55
55
|
const serverFilePath = path.join(cedarPaths.api.dist, "server.js");
|
|
56
56
|
const hasServerFile = fs.existsSync(serverFilePath);
|
|
57
57
|
if (hasServerFile) {
|
|
58
|
-
|
|
58
|
+
runWithNode(serverFilePath, execaConfig);
|
|
59
59
|
} else {
|
|
60
60
|
const { handler: handler2 } = await import("@cedarjs/api-server/apiCliConfigHandler");
|
|
61
61
|
handler2();
|
package/dist/lib/updateCheck.js
CHANGED
|
@@ -184,10 +184,10 @@ function updateCheckMiddleware(argv) {
|
|
|
184
184
|
}
|
|
185
185
|
if (shouldCheck()) {
|
|
186
186
|
setLock(CHECK_LOCK_IDENTIFIER);
|
|
187
|
-
const [bgCmd,
|
|
187
|
+
const [bgCmd, bgCmdArgs] = getNodeRunnerArgs(
|
|
188
188
|
path.join(import.meta.dirname, "updateCheckExecute.js")
|
|
189
189
|
);
|
|
190
|
-
spawnBackgroundProcess("updateCheck", bgCmd,
|
|
190
|
+
spawnBackgroundProcess("updateCheck", bgCmd, bgCmdArgs);
|
|
191
191
|
} else if (shouldShow()) {
|
|
192
192
|
setLock(SHOW_LOCK_IDENTIFIER);
|
|
193
193
|
process.on("exit", () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cedarjs/cli",
|
|
3
|
-
"version": "5.0.0-canary.
|
|
3
|
+
"version": "5.0.0-canary.2513",
|
|
4
4
|
"description": "The CedarJS Command Line",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -33,17 +33,17 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@babel/parser": "7.29.3",
|
|
35
35
|
"@babel/preset-typescript": "7.28.5",
|
|
36
|
-
"@cedarjs/api-server": "5.0.0-canary.
|
|
37
|
-
"@cedarjs/cli-helpers": "5.0.0-canary.
|
|
38
|
-
"@cedarjs/fastify-web": "5.0.0-canary.
|
|
39
|
-
"@cedarjs/internal": "5.0.0-canary.
|
|
40
|
-
"@cedarjs/prerender": "5.0.0-canary.
|
|
41
|
-
"@cedarjs/project-config": "5.0.0-canary.
|
|
42
|
-
"@cedarjs/structure": "5.0.0-canary.
|
|
43
|
-
"@cedarjs/telemetry": "5.0.0-canary.
|
|
44
|
-
"@cedarjs/utils": "5.0.0-canary.
|
|
45
|
-
"@cedarjs/vite": "5.0.0-canary.
|
|
46
|
-
"@cedarjs/web-server": "5.0.0-canary.
|
|
36
|
+
"@cedarjs/api-server": "5.0.0-canary.2513",
|
|
37
|
+
"@cedarjs/cli-helpers": "5.0.0-canary.2513",
|
|
38
|
+
"@cedarjs/fastify-web": "5.0.0-canary.2513",
|
|
39
|
+
"@cedarjs/internal": "5.0.0-canary.2513",
|
|
40
|
+
"@cedarjs/prerender": "5.0.0-canary.2513",
|
|
41
|
+
"@cedarjs/project-config": "5.0.0-canary.2513",
|
|
42
|
+
"@cedarjs/structure": "5.0.0-canary.2513",
|
|
43
|
+
"@cedarjs/telemetry": "5.0.0-canary.2513",
|
|
44
|
+
"@cedarjs/utils": "5.0.0-canary.2513",
|
|
45
|
+
"@cedarjs/vite": "5.0.0-canary.2513",
|
|
46
|
+
"@cedarjs/web-server": "5.0.0-canary.2513",
|
|
47
47
|
"@listr2/prompt-adapter-enquirer": "4.2.1",
|
|
48
48
|
"@opentelemetry/api": "1.9.1",
|
|
49
49
|
"@opentelemetry/core": "1.30.1",
|