@cedarjs/telemetry 5.0.0-canary.2392 → 5.0.0-canary.2394
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/README.md +4 -3
- package/dist/sendTelemetry.d.ts.map +1 -1
- package/dist/sendTelemetry.js +8 -7
- package/dist/telemetry.d.ts.map +1 -1
- package/dist/telemetry.js +6 -6
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -32,7 +32,7 @@ Set an environment variable, either in your app's .env file, or anywhere that
|
|
|
32
32
|
creates variables for your user space, like `.bashrc` or `.bash_profile`:
|
|
33
33
|
|
|
34
34
|
```terminal
|
|
35
|
-
|
|
35
|
+
CEDAR_DISABLE_TELEMETRY=1
|
|
36
36
|
```
|
|
37
37
|
|
|
38
38
|
## About
|
|
@@ -41,10 +41,11 @@ See: https://telemetry.redwoodjs.com
|
|
|
41
41
|
|
|
42
42
|
## Troubleshooting
|
|
43
43
|
|
|
44
|
-
If you suspect problems with telemetry when running
|
|
44
|
+
If you suspect problems with telemetry when running CCA, you can set the verbose
|
|
45
|
+
flag to help diagnose issues.
|
|
45
46
|
|
|
46
47
|
For example,
|
|
47
48
|
|
|
48
49
|
```terminal
|
|
49
|
-
|
|
50
|
+
CEDAR_VERBOSE_TELEMETRY=true yarn create-cedar-app bazinga
|
|
50
51
|
```
|
|
@@ -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,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A;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,CAAC,WAyCjE,CAAA;AAiGD,eAAO,MAAM,aAAa,qBAsCzB,CAAA"}
|
package/dist/sendTelemetry.js
CHANGED
|
@@ -194,25 +194,26 @@ function uniqueId() {
|
|
|
194
194
|
return uuid;
|
|
195
195
|
}
|
|
196
196
|
const sendTelemetry = async () => {
|
|
197
|
-
const telemetryUrl = process.env.REDWOOD_REDIRECT_TELEMETRY || "https://telemetry.redwoodjs.com/api/v1/telemetry";
|
|
197
|
+
const telemetryUrl = process.env.CEDAR_REDIRECT_TELEMETRY || process.env.REDWOOD_REDIRECT_TELEMETRY || "https://telemetry.redwoodjs.com/api/v1/telemetry";
|
|
198
|
+
const verboseTelemetry = process.env.CEDAR_VERBOSE_TELEMETRY || process.env.REDWOOD_VERBOSE_TELEMETRY;
|
|
198
199
|
try {
|
|
199
200
|
const payload = await buildPayload();
|
|
200
|
-
if (
|
|
201
|
-
console.info("
|
|
201
|
+
if (verboseTelemetry) {
|
|
202
|
+
console.info("Cedar Telemetry Payload", payload);
|
|
202
203
|
}
|
|
203
204
|
const response = await (0, import_fetch.fetch)(telemetryUrl, {
|
|
204
205
|
method: "post",
|
|
205
206
|
body: JSON.stringify(payload),
|
|
206
207
|
headers: { "Content-Type": "application/json" }
|
|
207
208
|
});
|
|
208
|
-
if (
|
|
209
|
-
console.info("
|
|
209
|
+
if (verboseTelemetry) {
|
|
210
|
+
console.info("Cedar Telemetry Response:", response);
|
|
210
211
|
}
|
|
211
|
-
if (
|
|
212
|
+
if (verboseTelemetry && response.status !== 200) {
|
|
212
213
|
console.error("Error from telemetry insert:", await response.text());
|
|
213
214
|
}
|
|
214
215
|
} catch (e) {
|
|
215
|
-
if (
|
|
216
|
+
if (verboseTelemetry) {
|
|
216
217
|
console.error("Uncaught error in telemetry:", e);
|
|
217
218
|
}
|
|
218
219
|
}
|
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":"AAmDA,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,iBAuB9B,CAAA;AAED,eAAO,MAAM,cAAc,GAAU,MAAM,MAAM,EAAE,EAAE,OAAO,GAAG,kBAS9D,CAAA;AAGD,eAAO,MAAM,mBAAmB,qBAS/B,CAAA"}
|
package/dist/telemetry.js
CHANGED
|
@@ -40,15 +40,15 @@ const spawnProcess = (...args) => {
|
|
|
40
40
|
const isWindows = import_os.default.type() === "Windows_NT";
|
|
41
41
|
const execPath = isWindows ? `"${process.execPath}"` : process.execPath;
|
|
42
42
|
const spawnOptions = isWindows ? {
|
|
43
|
-
stdio: process.env.REDWOOD_VERBOSE_TELEMETRY ? ["ignore", "inherit", "inherit"] : "ignore",
|
|
43
|
+
stdio: process.env.CEDAR_VERBOSE_TELEMETRY || process.env.REDWOOD_VERBOSE_TELEMETRY ? ["ignore", "inherit", "inherit"] : "ignore",
|
|
44
44
|
// The following options run the process in the background without a console window, even though they don't look like they would.
|
|
45
45
|
// See https://github.com/nodejs/node/issues/21825#issuecomment-503766781 for information
|
|
46
46
|
detached: false,
|
|
47
47
|
windowsHide: false,
|
|
48
48
|
shell: true
|
|
49
49
|
} : {
|
|
50
|
-
stdio: process.env.REDWOOD_VERBOSE_TELEMETRY ? ["ignore", "inherit", "inherit"] : "ignore",
|
|
51
|
-
detached: process.env.REDWOOD_VERBOSE_TELEMETRY ? false : true,
|
|
50
|
+
stdio: process.env.CEDAR_VERBOSE_TELEMETRY || process.env.REDWOOD_VERBOSE_TELEMETRY ? ["ignore", "inherit", "inherit"] : "ignore",
|
|
51
|
+
detached: process.env.CEDAR_VERBOSE_TELEMETRY || process.env.REDWOOD_VERBOSE_TELEMETRY ? false : true,
|
|
52
52
|
windowsHide: true
|
|
53
53
|
};
|
|
54
54
|
const scriptArgs = [import_path.default.join(__dirname, "scripts", "invoke.js"), ...args];
|
|
@@ -59,7 +59,7 @@ const spawnProcess = (...args) => {
|
|
|
59
59
|
}
|
|
60
60
|
};
|
|
61
61
|
const timedTelemetry = async (argv, options, func) => {
|
|
62
|
-
if (process.env.REDWOOD_DISABLE_TELEMETRY) {
|
|
62
|
+
if (process.env.CEDAR_DISABLE_TELEMETRY || process.env.REDWOOD_DISABLE_TELEMETRY) {
|
|
63
63
|
return func.call(void 0);
|
|
64
64
|
}
|
|
65
65
|
const start = /* @__PURE__ */ new Date();
|
|
@@ -76,13 +76,13 @@ const timedTelemetry = async (argv, options, func) => {
|
|
|
76
76
|
return result;
|
|
77
77
|
};
|
|
78
78
|
const errorTelemetry = async (argv, error) => {
|
|
79
|
-
if (process.env.REDWOOD_DISABLE_TELEMETRY) {
|
|
79
|
+
if (process.env.CEDAR_DISABLE_TELEMETRY || process.env.REDWOOD_DISABLE_TELEMETRY) {
|
|
80
80
|
return;
|
|
81
81
|
}
|
|
82
82
|
spawnProcess("--argv", JSON.stringify(argv), "--error", JSON.stringify(error));
|
|
83
83
|
};
|
|
84
84
|
const telemetryMiddleware = async () => {
|
|
85
|
-
if (process.env.REDWOOD_DISABLE_TELEMETRY) {
|
|
85
|
+
if (process.env.CEDAR_DISABLE_TELEMETRY || process.env.REDWOOD_DISABLE_TELEMETRY) {
|
|
86
86
|
return;
|
|
87
87
|
}
|
|
88
88
|
spawnProcess("--argv", JSON.stringify(process.argv));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cedarjs/telemetry",
|
|
3
|
-
"version": "5.0.0-canary.
|
|
3
|
+
"version": "5.0.0-canary.2394",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/cedarjs/cedar.git",
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"test:watch": "vitest watch"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@cedarjs/project-config": "5.0.0-canary.
|
|
26
|
-
"@cedarjs/structure": "5.0.0-canary.
|
|
25
|
+
"@cedarjs/project-config": "5.0.0-canary.2394",
|
|
26
|
+
"@cedarjs/structure": "5.0.0-canary.2394",
|
|
27
27
|
"@whatwg-node/fetch": "0.10.13",
|
|
28
28
|
"ci-info": "4.4.0",
|
|
29
29
|
"envinfo": "7.21.0",
|