@cedarjs/cli 5.0.0-canary.2419 → 5.0.0-canary.2422

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.
@@ -273,37 +273,45 @@ Run ` + c.info(formatCedarCommand(["build"])) + " (without specifying a workspac
273
273
  },
274
274
  ud && workspace.includes("api") && {
275
275
  title: "Bundling API server entry (Universal Deploy)...",
276
- task: async () => {
277
- await buildUDApiServer({ verbose, apiRootPath });
276
+ task: () => {
277
+ return buildUDApiServer({ verbose });
278
278
  }
279
279
  }
280
280
  ].filter((t) => Boolean(t));
281
- const triggerPrerender = async () => {
282
- console.log("Starting prerendering...");
283
- if (prerenderRoutes.length === 0) {
284
- console.log(
285
- `You have not marked any routes to "prerender" in your ${terminalLink(
286
- "Routes",
287
- "file://" + cedarPaths.web.routes
288
- )}.`
289
- );
290
- return;
291
- }
292
- await runBin("cedar", ["prerender"], {
293
- stdio: "inherit",
294
- cwd: cedarPaths.web.base
281
+ if (apiRootPath !== void 0) {
282
+ process.env.CEDAR_API_ROOT_PATH = apiRootPath;
283
+ }
284
+ try {
285
+ await timedTelemetry(process.argv, { type: "build" }, async () => {
286
+ const jobs = new Listr(tasks, {
287
+ renderer: verbose ? "verbose" : void 0
288
+ });
289
+ await jobs.run();
290
+ if (workspace.includes("web") && prerender && prismaSchemaExists) {
291
+ await triggerPrerender(prerenderRoutes);
292
+ }
295
293
  });
296
- };
297
- const jobs = new Listr(tasks, {
298
- renderer: verbose ? "verbose" : void 0
299
- });
300
- await timedTelemetry(process.argv, { type: "build" }, async () => {
301
- await jobs.run();
302
- if (workspace.includes("web") && prerender && prismaSchemaExists) {
303
- await triggerPrerender();
304
- }
305
- });
294
+ } finally {
295
+ delete process.env.CEDAR_API_ROOT_PATH;
296
+ }
306
297
  };
298
+ async function triggerPrerender(prerenderRoutes) {
299
+ const cedarPaths = getPaths();
300
+ console.log("Starting prerendering...");
301
+ if (prerenderRoutes.length === 0) {
302
+ console.log(
303
+ `You have not marked any routes to "prerender" in your ${terminalLink(
304
+ "Routes",
305
+ "file://" + cedarPaths.web.routes
306
+ )}.`
307
+ );
308
+ return;
309
+ }
310
+ await runBin("cedar", ["prerender"], {
311
+ stdio: "inherit",
312
+ cwd: cedarPaths.web.base
313
+ });
314
+ }
307
315
  export {
308
316
  handler
309
317
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cedarjs/cli",
3
- "version": "5.0.0-canary.2419",
3
+ "version": "5.0.0-canary.2422",
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.2419",
37
- "@cedarjs/cli-helpers": "5.0.0-canary.2419",
38
- "@cedarjs/fastify-web": "5.0.0-canary.2419",
39
- "@cedarjs/internal": "5.0.0-canary.2419",
40
- "@cedarjs/prerender": "5.0.0-canary.2419",
41
- "@cedarjs/project-config": "5.0.0-canary.2419",
42
- "@cedarjs/structure": "5.0.0-canary.2419",
43
- "@cedarjs/telemetry": "5.0.0-canary.2419",
44
- "@cedarjs/utils": "5.0.0-canary.2419",
45
- "@cedarjs/vite": "5.0.0-canary.2419",
46
- "@cedarjs/web-server": "5.0.0-canary.2419",
36
+ "@cedarjs/api-server": "5.0.0-canary.2422",
37
+ "@cedarjs/cli-helpers": "5.0.0-canary.2422",
38
+ "@cedarjs/fastify-web": "5.0.0-canary.2422",
39
+ "@cedarjs/internal": "5.0.0-canary.2422",
40
+ "@cedarjs/prerender": "5.0.0-canary.2422",
41
+ "@cedarjs/project-config": "5.0.0-canary.2422",
42
+ "@cedarjs/structure": "5.0.0-canary.2422",
43
+ "@cedarjs/telemetry": "5.0.0-canary.2422",
44
+ "@cedarjs/utils": "5.0.0-canary.2422",
45
+ "@cedarjs/vite": "5.0.0-canary.2422",
46
+ "@cedarjs/web-server": "5.0.0-canary.2422",
47
47
  "@listr2/prompt-adapter-enquirer": "4.2.1",
48
48
  "@opentelemetry/api": "1.9.1",
49
49
  "@opentelemetry/core": "1.30.1",