@cedarjs/telemetry 2.8.1-next.0 → 2.8.1-next.109

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 +1 @@
1
- {"version":3,"file":"sendTelemetry.d.ts","sourceRoot":"","sources":["../src/sendTelemetry.ts"],"names":[],"mappings":"AAaA,UAAU,qBAAqB;IAC7B,IAAI,EAAE;QACJ,SAAS,EAAE,MAAM,EAAE,CAAA;QACnB,OAAO,CAAC,EAAE,KAAK,CAAA;QACf,UAAU,EAAE,MAAM,EAAE,CAAA;QACpB,SAAS,EAAE,MAAM,EAAE,CAAA;KACpB,CAAA;IACD,CAAC,EAAE;QACD,SAAS,EAAE,MAAM,EAAE,CAAA;QACnB,OAAO,CAAC,EAAE,KAAK,CAAA;QACf,UAAU,EAAE,MAAM,EAAE,CAAA;QACpB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;KACrB,CAAA;IACD,QAAQ,EAAE;QACR,SAAS,EAAE,MAAM,EAAE,CAAA;QACnB,OAAO,CAAC,EAAE,KAAK,CAAA;QACf,UAAU,EAAE,MAAM,EAAE,CAAA;QACpB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;KACrB,CAAA;IACD,MAAM,EAAE;QACN,SAAS,CAAC,EAAE,KAAK,CAAA;QACjB,OAAO,EAAE,MAAM,EAAE,CAAA;QACjB,UAAU,EAAE,MAAM,EAAE,CAAA;QACpB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;KACrB,CAAA;IACD,IAAI,EAAE;QACJ,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;QACpB,OAAO,CAAC,EAAE,KAAK,CAAA;QACf,UAAU,EAAE,MAAM,EAAE,CAAA;QACpB,SAAS,EAAE,MAAM,EAAE,CAAA;KACpB,CAAA;CACF;AA+ED,eAAO,MAAM,YAAY,GACvB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,qBAAqB,EAAE,GAAG,MAAM,EAAE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7 +133,6 @@ const sanitizeArgv = (argv) => {
133
133
  };
134
134
  const buildPayload = async () => {
135
135
  let payload = {};
136
- let project;
137
136
  const processArgv = [...process.argv];
138
137
  if (import_os.default.type() === "Windows_NT") {
139
138
  const argvIndex = processArgv.findIndex((arg) => arg === "--argv") + 1;
@@ -146,13 +145,12 @@ const buildPayload = async () => {
146
145
  }
147
146
  }
148
147
  const argv = require("yargs/yargs")(processArgv.slice(2)).parse();
149
- const rootDir = argv.root;
150
148
  const command = argv.argv ? sanitizeArgv(JSON.parse(argv.argv)) : "";
151
149
  payload = {
152
150
  type: argv.type || "command",
153
151
  command,
154
152
  duration: argv.duration ? parseInt(argv.duration) : null,
155
- uid: uniqueId(rootDir) || null,
153
+ uid: uniqueId(),
156
154
  ci: import_ci_info.default.isCI,
157
155
  redwoodCi: !!process.env.REDWOOD_CI,
158
156
  NODE_ENV: process.env.NODE_ENV || null,
@@ -162,21 +160,19 @@ const buildPayload = async () => {
162
160
  payload.type = "error";
163
161
  payload.error = argv.error.split("\n")[0].replace(/(\/[@\-\.\w]+)/g, "[path]");
164
162
  }
165
- if (rootDir) {
166
- project = new import_RWProject.RWProject({ projectRoot: rootDir });
167
- const routes = project.getRouter().routes;
168
- const prerenderedRoutes = routes.filter((route) => route.hasPrerender);
169
- payload = {
170
- ...payload,
171
- complexity: `${routes.length}.${prerenderedRoutes.length}.${project.services.length}.${project.cells.length}.${project.pages.length}`,
172
- sides: project.sides.join(",")
173
- };
174
- }
163
+ const project = new import_RWProject.RWProject();
164
+ const routes = project.getRouter().routes;
165
+ const prerenderedRoutes = routes.filter((route) => route.hasPrerender);
166
+ payload = {
167
+ ...payload,
168
+ complexity: `${routes.length}.${prerenderedRoutes.length}.${project.services.length}.${project.cells.length}.${project.pages.length}`,
169
+ sides: project.sides.join(",")
170
+ };
175
171
  return payload;
176
172
  };
177
- const uniqueId = (rootDir) => {
173
+ function uniqueId() {
178
174
  const telemetryCachePath = import_path.default.join(
179
- rootDir || "/tmp",
175
+ (0, import_project_config.getPaths)().base,
180
176
  ".redwood",
181
177
  "telemetry.txt"
182
178
  );
@@ -197,7 +193,7 @@ const uniqueId = (rootDir) => {
197
193
  uuid = import_node_fs.default.readFileSync(telemetryCachePath).toString();
198
194
  }
199
195
  return uuid;
200
- };
196
+ }
201
197
  const sendTelemetry = async () => {
202
198
  const telemetryUrl = process.env.REDWOOD_REDIRECT_TELEMETRY || "https://telemetry.redwoodjs.com/api/v1/telemetry";
203
199
  try {
@@ -1 +1 @@
1
- {"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["../src/telemetry.ts"],"names":[],"mappings":"AAkDA,eAAO,MAAM,cAAc,GACzB,MAAM,MAAM,EAAE,EACd,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,MAAM,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,iBAoB9B,CAAA;AAED,eAAO,MAAM,cAAc,GAAU,MAAM,MAAM,EAAE,EAAE,OAAO,GAAG,kBAM9D,CAAA;AAGD,eAAO,MAAM,mBAAmB,qBAM/B,CAAA"}
1
+ {"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["../src/telemetry.ts"],"names":[],"mappings":"AA2CA,eAAO,MAAM,cAAc,GACzB,MAAM,MAAM,EAAE,EACd,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,MAAM,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,iBAoB9B,CAAA;AAED,eAAO,MAAM,cAAc,GAAU,MAAM,MAAM,EAAE,EAAE,OAAO,GAAG,kBAM9D,CAAA;AAGD,eAAO,MAAM,mBAAmB,qBAM/B,CAAA"}
package/dist/telemetry.js CHANGED
@@ -36,7 +36,6 @@ module.exports = __toCommonJS(telemetry_exports);
36
36
  var import_child_process = require("child_process");
37
37
  var import_os = __toESM(require("os"));
38
38
  var import_path = __toESM(require("path"));
39
- var import_project_config = require("@cedarjs/project-config");
40
39
  const spawnProcess = (...args) => {
41
40
  const isWindows = import_os.default.type() === "Windows_NT";
42
41
  const execPath = isWindows ? `"${process.execPath}"` : process.execPath;
@@ -52,12 +51,7 @@ const spawnProcess = (...args) => {
52
51
  detached: process.env.REDWOOD_VERBOSE_TELEMETRY ? false : true,
53
52
  windowsHide: true
54
53
  };
55
- const scriptArgs = [
56
- import_path.default.join(__dirname, "scripts", "invoke.js"),
57
- ...args,
58
- "--root",
59
- (0, import_project_config.getPaths)().base
60
- ];
54
+ const scriptArgs = [import_path.default.join(__dirname, "scripts", "invoke.js"), ...args];
61
55
  if (isWindows) {
62
56
  (0, import_child_process.spawn)([execPath, ...scriptArgs].join(" "), [], spawnOptions).unref();
63
57
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cedarjs/telemetry",
3
- "version": "2.8.1-next.0+f9966f3d1",
3
+ "version": "2.8.1-next.109+be993981d",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/cedarjs/cedar.git",
@@ -21,12 +21,12 @@
21
21
  "test:watch": "vitest watch"
22
22
  },
23
23
  "dependencies": {
24
- "@cedarjs/project-config": "2.8.1-next.0+f9966f3d1",
25
- "@cedarjs/structure": "2.8.1-next.0+f9966f3d1",
24
+ "@cedarjs/project-config": "2.8.1-next.109+be993981d",
25
+ "@cedarjs/structure": "2.8.1-next.109+be993981d",
26
26
  "@whatwg-node/fetch": "0.10.13",
27
27
  "ci-info": "4.4.0",
28
28
  "envinfo": "7.21.0",
29
- "systeminformation": "5.31.2",
29
+ "systeminformation": "5.31.4",
30
30
  "uuid": "11.1.0",
31
31
  "yargs": "17.7.2"
32
32
  },
@@ -40,5 +40,5 @@
40
40
  "publishConfig": {
41
41
  "access": "public"
42
42
  },
43
- "gitHead": "f9966f3d17f1740c9a1eeb90b30f0e6bd2655914"
43
+ "gitHead": "be993981d7e162a83244009c3f7ab9270c6773f3"
44
44
  }