@cedarjs/cli 4.0.0-canary.13709 → 4.0.0-canary.13713

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.
@@ -5,6 +5,11 @@ import execa from "execa";
5
5
  import { Listr } from "listr2";
6
6
  import { terminalLink } from "termi-link";
7
7
  import { recordTelemetryAttributes } from "@cedarjs/cli-helpers";
8
+ import {
9
+ formatCedarCommand,
10
+ formatRunWorkspaceScriptCommand
11
+ } from "@cedarjs/cli-helpers/packageManager/display";
12
+ import { runBin } from "@cedarjs/cli-helpers/packageManager/exec";
8
13
  import { buildApi, cleanApiBuild } from "@cedarjs/internal/dist/build/api";
9
14
  import { generate } from "@cedarjs/internal/dist/generate/generate";
10
15
  import { loadAndValidateSdls } from "@cedarjs/internal/dist/validateSchema";
@@ -124,7 +129,9 @@ const handler = async ({
124
129
  ${details}
125
130
 
126
131
  This usually means the package has not been built yet.
127
- Run ` + c.info("yarn cedar build") + " (without specifying a workspace) to build everything,\nor build the package manually first, e.g. " + c.info(`yarn workspace ${problems[0].pkgName} build`)
132
+ Run ` + c.info(formatCedarCommand(["build"])) + " (without specifying a workspace) to build everything,\nor build the package manually first, e.g. " + c.info(
133
+ formatRunWorkspaceScriptCommand(problems[0].pkgName, "build")
134
+ )
128
135
  );
129
136
  }
130
137
  },
@@ -193,9 +200,8 @@ Run ` + c.info("yarn cedar build") + " (without specifying a workspace) to build
193
200
  );
194
201
  return;
195
202
  }
196
- await execa("yarn cedar prerender", {
203
+ await runBin("cedar", ["prerender"], {
197
204
  stdio: "inherit",
198
- shell: true,
199
205
  cwd: cedarPaths.web.base
200
206
  });
201
207
  };
@@ -1,6 +1,6 @@
1
1
  import fs from "node:fs";
2
2
  import path from "node:path";
3
- import execa from "execa";
3
+ import { runScript } from "@cedarjs/cli-helpers/packageManager/exec";
4
4
  import { importStatementPath } from "@cedarjs/project-config";
5
5
  import { errorTelemetry } from "@cedarjs/telemetry";
6
6
  import { getPaths } from "../../lib/index.js";
@@ -28,7 +28,7 @@ async function buildPackagesTask(task, nonApiWebWorkspaces) {
28
28
  title: name,
29
29
  task: async () => {
30
30
  try {
31
- await execa("yarn", ["build"], { cwd: workspacePath });
31
+ await runScript("build", [], { cwd: workspacePath });
32
32
  } catch (e) {
33
33
  errorTelemetry(
34
34
  process.argv,
@@ -1,8 +1,8 @@
1
1
  import fs from "node:fs";
2
2
  import path from "node:path";
3
- import execa from "execa";
4
3
  import { terminalLink } from "termi-link";
5
4
  import { recordTelemetryAttributes } from "@cedarjs/cli-helpers";
5
+ import { runBin } from "@cedarjs/cli-helpers/packageManager/exec";
6
6
  import { getPaths, getConfig } from "@cedarjs/project-config";
7
7
  function detectLegacyEslintConfig() {
8
8
  const projectRoot = getPaths().base;
@@ -93,9 +93,14 @@ const handler = async ({
93
93
  }
94
94
  try {
95
95
  const sbPath = getPaths().web.storybook;
96
- const args = ["eslint", fix && "--fix", "--format", format, ...paths];
96
+ const eslintArgs = [
97
+ fix && "--fix",
98
+ "--format",
99
+ format,
100
+ ...paths
101
+ ];
97
102
  if (paths.length === 0) {
98
- args.push(
103
+ eslintArgs.push(
99
104
  fs.existsSync(getPaths().web.src) && "web/src",
100
105
  fs.existsSync(getPaths().web.config) && "web/config",
101
106
  fs.existsSync(sbPath) && "web/.storybook",
@@ -103,8 +108,10 @@ const handler = async ({
103
108
  fs.existsSync(getPaths().api.src) && "api/src"
104
109
  );
105
110
  }
106
- const filteredArgs = args.filter((arg) => Boolean(arg));
107
- const result = await execa("yarn", filteredArgs, {
111
+ const filteredEslintArgs = eslintArgs.filter(
112
+ (arg) => Boolean(arg)
113
+ );
114
+ const result = await runBin("eslint", filteredEslintArgs, {
108
115
  cwd: getPaths().base,
109
116
  stdio: "inherit"
110
117
  });
@@ -2,6 +2,7 @@ import fs from "node:fs";
2
2
  import path from "node:path";
3
3
  import { Listr } from "listr2";
4
4
  import { recordTelemetryAttributes } from "@cedarjs/cli-helpers";
5
+ import { formatCedarCommand } from "@cedarjs/cli-helpers/packageManager/display";
5
6
  import { getConfig, getPaths, projectIsEsm } from "@cedarjs/project-config";
6
7
  import { errorTelemetry } from "@cedarjs/telemetry";
7
8
  import c from "../lib/colors.js";
@@ -108,7 +109,7 @@ const getTasks = async (dryrun, routerPathFilter = null) => {
108
109
  const indexHtmlPath = path.join(getPaths().web.dist, "index.html");
109
110
  if (!fs.existsSync(indexHtmlPath)) {
110
111
  console.error(
111
- "You must run `yarn cedar build web` before trying to prerender."
112
+ `You must run \`${formatCedarCommand(["build", "web"])}\` before trying to prerender.`
112
113
  );
113
114
  process.exit(1);
114
115
  }
@@ -236,7 +237,9 @@ const prerenderRoute = async (prerenderer, queryCache, routeToPrerender, dryrun,
236
237
  } catch (error) {
237
238
  console.log();
238
239
  console.log(
239
- c.warning("You can use `yarn cedar prerender --dry-run` to debug")
240
+ c.warning(
241
+ "You can use `" + formatCedarCommand(["prerender", "--dry-run"]) + "` to debug"
242
+ )
240
243
  );
241
244
  console.log();
242
245
  const sep = c.info("-".repeat(10));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cedarjs/cli",
3
- "version": "4.0.0-canary.13709+a37accbc4",
3
+ "version": "4.0.0-canary.13713+7151ee7fe",
4
4
  "description": "The CedarJS Command Line",
5
5
  "repository": {
6
6
  "type": "git",
@@ -33,16 +33,16 @@
33
33
  "dependencies": {
34
34
  "@babel/parser": "7.29.2",
35
35
  "@babel/preset-typescript": "7.28.5",
36
- "@cedarjs/api-server": "4.0.0-canary.13709",
37
- "@cedarjs/cli-helpers": "4.0.0-canary.13709",
38
- "@cedarjs/fastify-web": "4.0.0-canary.13709",
39
- "@cedarjs/internal": "4.0.0-canary.13709",
40
- "@cedarjs/prerender": "4.0.0-canary.13709",
41
- "@cedarjs/project-config": "4.0.0-canary.13709",
42
- "@cedarjs/structure": "4.0.0-canary.13709",
43
- "@cedarjs/telemetry": "4.0.0-canary.13709",
44
- "@cedarjs/utils": "4.0.0-canary.13709",
45
- "@cedarjs/web-server": "4.0.0-canary.13709",
36
+ "@cedarjs/api-server": "4.0.0-canary.13713",
37
+ "@cedarjs/cli-helpers": "4.0.0-canary.13713",
38
+ "@cedarjs/fastify-web": "4.0.0-canary.13713",
39
+ "@cedarjs/internal": "4.0.0-canary.13713",
40
+ "@cedarjs/prerender": "4.0.0-canary.13713",
41
+ "@cedarjs/project-config": "4.0.0-canary.13713",
42
+ "@cedarjs/structure": "4.0.0-canary.13713",
43
+ "@cedarjs/telemetry": "4.0.0-canary.13713",
44
+ "@cedarjs/utils": "4.0.0-canary.13713",
45
+ "@cedarjs/web-server": "4.0.0-canary.13713",
46
46
  "@listr2/prompt-adapter-enquirer": "4.2.1",
47
47
  "@opentelemetry/api": "1.9.0",
48
48
  "@opentelemetry/core": "1.30.1",
@@ -108,5 +108,5 @@
108
108
  "publishConfig": {
109
109
  "access": "public"
110
110
  },
111
- "gitHead": "a37accbc4c58ec77abf3e21fcea65b4a65388487"
111
+ "gitHead": "7151ee7fe062efc0f9cba88eed736c6dbc411fc6"
112
112
  }