@cedarjs/telemetry 2.8.1-next.116 → 2.8.1-rc.3
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.
- package/dist/sendTelemetry.d.ts.map +1 -1
- package/dist/sendTelemetry.js +16 -12
- package/dist/telemetry.d.ts.map +1 -1
- package/dist/telemetry.js +7 -1
- package/package.json +5 -5
|
@@ -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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AqB,EAAE,GAAG,MAAM,EAAE,CAAC,WAyCjE,CAAA;AAyGD,eAAO,MAAM,aAAa,qBAmCzB,CAAA"}
|
package/dist/sendTelemetry.js
CHANGED
|
@@ -133,6 +133,7 @@ const sanitizeArgv = (argv) => {
|
|
|
133
133
|
};
|
|
134
134
|
const buildPayload = async () => {
|
|
135
135
|
let payload = {};
|
|
136
|
+
let project;
|
|
136
137
|
const processArgv = [...process.argv];
|
|
137
138
|
if (import_os.default.type() === "Windows_NT") {
|
|
138
139
|
const argvIndex = processArgv.findIndex((arg) => arg === "--argv") + 1;
|
|
@@ -145,12 +146,13 @@ const buildPayload = async () => {
|
|
|
145
146
|
}
|
|
146
147
|
}
|
|
147
148
|
const argv = require("yargs/yargs")(processArgv.slice(2)).parse();
|
|
149
|
+
const rootDir = argv.root;
|
|
148
150
|
const command = argv.argv ? sanitizeArgv(JSON.parse(argv.argv)) : "";
|
|
149
151
|
payload = {
|
|
150
152
|
type: argv.type || "command",
|
|
151
153
|
command,
|
|
152
154
|
duration: argv.duration ? parseInt(argv.duration) : null,
|
|
153
|
-
uid: uniqueId(),
|
|
155
|
+
uid: uniqueId(rootDir) || null,
|
|
154
156
|
ci: import_ci_info.default.isCI,
|
|
155
157
|
redwoodCi: !!process.env.REDWOOD_CI,
|
|
156
158
|
NODE_ENV: process.env.NODE_ENV || null,
|
|
@@ -160,19 +162,21 @@ const buildPayload = async () => {
|
|
|
160
162
|
payload.type = "error";
|
|
161
163
|
payload.error = argv.error.split("\n")[0].replace(/(\/[@\-\.\w]+)/g, "[path]");
|
|
162
164
|
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
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
|
+
}
|
|
171
175
|
return payload;
|
|
172
176
|
};
|
|
173
|
-
|
|
177
|
+
const uniqueId = (rootDir) => {
|
|
174
178
|
const telemetryCachePath = import_path.default.join(
|
|
175
|
-
|
|
179
|
+
rootDir || "/tmp",
|
|
176
180
|
".redwood",
|
|
177
181
|
"telemetry.txt"
|
|
178
182
|
);
|
|
@@ -193,7 +197,7 @@ function uniqueId() {
|
|
|
193
197
|
uuid = import_node_fs.default.readFileSync(telemetryCachePath).toString();
|
|
194
198
|
}
|
|
195
199
|
return uuid;
|
|
196
|
-
}
|
|
200
|
+
};
|
|
197
201
|
const sendTelemetry = async () => {
|
|
198
202
|
const telemetryUrl = process.env.REDWOOD_REDIRECT_TELEMETRY || "https://telemetry.redwoodjs.com/api/v1/telemetry";
|
|
199
203
|
try {
|
package/dist/telemetry.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["../src/telemetry.ts"],"names":[],"mappings":"
|
|
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"}
|
package/dist/telemetry.js
CHANGED
|
@@ -36,6 +36,7 @@ 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");
|
|
39
40
|
const spawnProcess = (...args) => {
|
|
40
41
|
const isWindows = import_os.default.type() === "Windows_NT";
|
|
41
42
|
const execPath = isWindows ? `"${process.execPath}"` : process.execPath;
|
|
@@ -51,7 +52,12 @@ const spawnProcess = (...args) => {
|
|
|
51
52
|
detached: process.env.REDWOOD_VERBOSE_TELEMETRY ? false : true,
|
|
52
53
|
windowsHide: true
|
|
53
54
|
};
|
|
54
|
-
const scriptArgs = [
|
|
55
|
+
const scriptArgs = [
|
|
56
|
+
import_path.default.join(__dirname, "scripts", "invoke.js"),
|
|
57
|
+
...args,
|
|
58
|
+
"--root",
|
|
59
|
+
(0, import_project_config.getPaths)().base
|
|
60
|
+
];
|
|
55
61
|
if (isWindows) {
|
|
56
62
|
(0, import_child_process.spawn)([execPath, ...scriptArgs].join(" "), [], spawnOptions).unref();
|
|
57
63
|
} else {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cedarjs/telemetry",
|
|
3
|
-
"version": "2.8.1-
|
|
3
|
+
"version": "2.8.1-rc.3",
|
|
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-
|
|
25
|
-
"@cedarjs/structure": "2.8.1-
|
|
24
|
+
"@cedarjs/project-config": "2.8.1-rc.3",
|
|
25
|
+
"@cedarjs/structure": "2.8.1-rc.3",
|
|
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.
|
|
29
|
+
"systeminformation": "5.31.2",
|
|
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": "
|
|
43
|
+
"gitHead": "f778a5b70b97c0b129246e918083f42c63a6dc0a"
|
|
44
44
|
}
|