@cedarjs/cli 8.0.0-canary.3591 → 8.0.0-canary.3595

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.
@@ -24,6 +24,7 @@ import { timedTelemetry } from "@cedarjs/telemetry";
24
24
  import { buildCedarApp } from "@cedarjs/vite/build";
25
25
  import { generatePrismaCommand } from "../../lib/generatePrismaClient.js";
26
26
  import { getPaths, getConfig } from "../../lib/index.js";
27
+ import { workspacesForTelemetry } from "../../lib/telemetryWorkspaces.js";
27
28
  import { buildPackagesTask } from "./buildPackagesTask.js";
28
29
  function checkWorkspacePackageEntryPoints(cedarPaths) {
29
30
  const packagesDir = cedarPaths.packages;
@@ -84,11 +85,11 @@ const handler = async ({
84
85
  }) => {
85
86
  recordTelemetryAttributes({
86
87
  command: "build",
87
- workspace: JSON.stringify(workspace),
88
+ workspace: workspacesForTelemetry(workspace),
88
89
  verbose,
89
90
  prisma,
90
91
  prerender,
91
- apiRootPath
92
+ apiRootPath: apiRootPath !== void 0
92
93
  });
93
94
  const cedarPaths = getPaths();
94
95
  const cedarConfig = getConfig();
@@ -16,6 +16,7 @@ import { generatePrismaClient } from "../../lib/generatePrismaClient.js";
16
16
  import { getPaths } from "../../lib/index.js";
17
17
  import { getFreePort } from "../../lib/ports.js";
18
18
  import { serverFileExists } from "../../lib/project.js";
19
+ import { workspacesForTelemetry } from "../../lib/telemetryWorkspaces.js";
19
20
  import { getApiDebugFlag } from "./apiDebugFlag.js";
20
21
  import { getPackageWatchCommands } from "./packageWatchCommands.js";
21
22
  const createdRequire = createRequire(import.meta.url);
@@ -54,7 +55,7 @@ const handler = async ({
54
55
  }) => {
55
56
  recordTelemetryAttributes({
56
57
  command: "dev",
57
- workspace: JSON.stringify(workspace),
58
+ workspace: workspacesForTelemetry(workspace),
58
59
  generate
59
60
  });
60
61
  const cedarPaths = getPaths();
@@ -80,8 +80,8 @@ const builder = async (yargs) => {
80
80
  recordTelemetryAttributes({
81
81
  command: "serve",
82
82
  port: argv.port,
83
- host: argv.host,
84
- socket: argv.socket
83
+ host: argv.host !== void 0,
84
+ socket: argv.socket !== void 0
85
85
  });
86
86
  if (argv.ud) {
87
87
  if (argv.port) {
@@ -210,9 +210,11 @@ const builder = async (yargs) => {
210
210
  recordTelemetryAttributes({
211
211
  command: "serve",
212
212
  port: argv.port,
213
- host: argv.host,
214
- socket: argv.socket,
215
- apiRootPath: argv.apiRootPath
213
+ host: argv.host !== void 0,
214
+ socket: argv.socket !== void 0,
215
+ // `--apiRootPath` defaults to '/', so a custom root path is anything
216
+ // else
217
+ apiRootPath: argv.apiRootPath !== void 0 && argv.apiRootPath !== "/"
216
218
  });
217
219
  const { getAPIHost, getAPIPort } = await import("@cedarjs/api-server/cliHelpers");
218
220
  const apiPort = argv.port ?? getAPIPort({ isPublicSide: true });
@@ -257,9 +259,9 @@ const builder = async (yargs) => {
257
259
  recordTelemetryAttributes({
258
260
  command: "serve",
259
261
  port: argv.port,
260
- host: argv.host,
261
- socket: argv.socket,
262
- apiHost: argv.apiHost
262
+ host: argv.host !== void 0,
263
+ socket: argv.socket !== void 0,
264
+ apiHost: argv.apiHost !== void 0
263
265
  });
264
266
  if (streamingEnabled) {
265
267
  await webSsrServerHandler(rscEnabled);
@@ -117,12 +117,8 @@ const handler = async ({
117
117
  force,
118
118
  monitor: monitorOption
119
119
  }) => {
120
- recordTelemetryAttributes({
121
- command: "setup deploy baremetal",
122
- force,
123
- monitor: monitorOption
124
- });
125
120
  if (monitorOption !== void 0 && !isMonitor(monitorOption)) {
121
+ recordTelemetryAttributes({ command: "setup deploy baremetal", force });
126
122
  console.error(
127
123
  c.error(
128
124
  `Unknown monitor "${monitorOption}". Use one of ${MONITORS.join(", ")}.`
@@ -130,6 +126,11 @@ const handler = async ({
130
126
  );
131
127
  process.exit(1);
132
128
  }
129
+ recordTelemetryAttributes({
130
+ command: "setup deploy baremetal",
131
+ force,
132
+ monitor: monitorOption
133
+ });
133
134
  const monitor = monitorOption ?? await promptForMonitor();
134
135
  if (!monitor) {
135
136
  console.log("Aborting baremetal setup.");
@@ -16,7 +16,6 @@ const builder = (yargs) => {
16
16
  const handler = async (options) => {
17
17
  recordTelemetryAttributes({
18
18
  command: "setup tenancy",
19
- tenantField: options.tenantField,
20
19
  force: options.force
21
20
  });
22
21
  const { handler: handler2 } = await import("./tenancyHandler.js");
@@ -6,6 +6,7 @@ import { runBin } from "@cedarjs/cli-helpers/packageManager/exec";
6
6
  import { recordTelemetryAttributes } from "@cedarjs/cli-helpers/telemetry";
7
7
  import { generatePrismaClient } from "../lib/generatePrismaClient.js";
8
8
  import { getPaths } from "../lib/index.js";
9
+ import { workspacesForTelemetry } from "../lib/telemetryWorkspaces.js";
9
10
  const isConcurrentlyErrorArray = (value) => {
10
11
  return Array.isArray(value);
11
12
  };
@@ -20,7 +21,7 @@ const handler = async ({
20
21
  );
21
22
  recordTelemetryAttributes({
22
23
  command: "type-check",
23
- sides: JSON.stringify(selectedSides),
24
+ sides: workspacesForTelemetry(selectedSides),
24
25
  verbose,
25
26
  prisma,
26
27
  generate
@@ -0,0 +1,11 @@
1
+ const KNOWN_WORKSPACES = /* @__PURE__ */ new Set(["api", "web", "packages/*"]);
2
+ function workspacesForTelemetry(workspaces) {
3
+ return JSON.stringify(
4
+ workspaces.map(
5
+ (workspace) => KNOWN_WORKSPACES.has(workspace) ? workspace : "package"
6
+ )
7
+ );
8
+ }
9
+ export {
10
+ workspacesForTelemetry
11
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cedarjs/cli",
3
- "version": "8.0.0-canary.3591",
3
+ "version": "8.0.0-canary.3595",
4
4
  "description": "The CedarJS Command Line",
5
5
  "repository": {
6
6
  "type": "git",
@@ -36,17 +36,17 @@
36
36
  "@babel/preset-typescript": "7.29.7",
37
37
  "@babel/traverse": "7.29.12",
38
38
  "@babel/types": "7.29.11",
39
- "@cedarjs/api-server": "8.0.0-canary.3591",
40
- "@cedarjs/babel-config": "8.0.0-canary.3591",
41
- "@cedarjs/cli-helpers": "8.0.0-canary.3591",
42
- "@cedarjs/internal": "8.0.0-canary.3591",
43
- "@cedarjs/prerender": "8.0.0-canary.3591",
44
- "@cedarjs/project-config": "8.0.0-canary.3591",
45
- "@cedarjs/structure": "8.0.0-canary.3591",
46
- "@cedarjs/telemetry": "8.0.0-canary.3591",
47
- "@cedarjs/utils": "8.0.0-canary.3591",
48
- "@cedarjs/vite": "8.0.0-canary.3591",
49
- "@cedarjs/web-server": "8.0.0-canary.3591",
39
+ "@cedarjs/api-server": "8.0.0-canary.3595",
40
+ "@cedarjs/babel-config": "8.0.0-canary.3595",
41
+ "@cedarjs/cli-helpers": "8.0.0-canary.3595",
42
+ "@cedarjs/internal": "8.0.0-canary.3595",
43
+ "@cedarjs/prerender": "8.0.0-canary.3595",
44
+ "@cedarjs/project-config": "8.0.0-canary.3595",
45
+ "@cedarjs/structure": "8.0.0-canary.3595",
46
+ "@cedarjs/telemetry": "8.0.0-canary.3595",
47
+ "@cedarjs/utils": "8.0.0-canary.3595",
48
+ "@cedarjs/vite": "8.0.0-canary.3595",
49
+ "@cedarjs/web-server": "8.0.0-canary.3595",
50
50
  "@listr2/prompt-adapter-enquirer": "4.4.3",
51
51
  "@opentelemetry/api": "1.9.1",
52
52
  "@opentelemetry/core": "2.12.0",
@@ -93,7 +93,7 @@
93
93
  "yargs": "18.2.0"
94
94
  },
95
95
  "devDependencies": {
96
- "@cedarjs/framework-tools": "8.0.0-canary.3591",
96
+ "@cedarjs/framework-tools": "8.0.0-canary.3595",
97
97
  "@prisma/dmmf": "7.10.1",
98
98
  "@types/archiver": "^7.0.0",
99
99
  "memfs": "4.80.0",