Skip to content

Commit b87b80b

Browse files
committed
telemetry updates
- send current CLI and SDK versions - send OS info and node version - send hashes of input-dir and repo url if available - add unhandled exception handlers and track any errors
1 parent 30627ae commit b87b80b

7 files changed

Lines changed: 328 additions & 47 deletions

File tree

package-lock.json

Lines changed: 140 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
"analytics-node": "^4.0.1",
4343
"chalk": "^4.1.0",
4444
"configstore": "^5.0.1",
45+
"git-url-parse": "^11.4.4",
4546
"js-yaml": "^4.0.0",
4647
"lodash": "^4.17.21",
4748
"uuid": "^8.3.2",
@@ -50,6 +51,7 @@
5051
"devDependencies": {
5152
"@types/analytics-node": "^3.1.4",
5253
"@types/configstore": "^5.0.0",
54+
"@types/git-url-parse": "^9.0.0",
5355
"@types/js-yaml": "^4.0.0",
5456
"@types/lodash": "^4.14.168",
5557
"@types/uuid": "^8.3.0",

src/init.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ import { printCMSMatchResult, printSSGMatchResult, trackInitResultStats } from '
77
import { track, EVENTS } from './telemetry';
88

99
export async function init({ inputDir, dryRun }: { inputDir: string; dryRun: boolean }) {
10-
track(EVENTS.init, { dry_run: dryRun });
10+
track(EVENTS.init, { dry_run: dryRun, inputDir });
1111
console.log(`Analyzing files in ${chalk.blueBright(path.resolve(inputDir))} ...`);
1212
const fileBrowserAdapter = new FileSystemFileBrowserAdapter({ dirPath: inputDir });
1313
const fileBrowser = new FileBrowser({ fileBrowserAdapter });
1414
const analyzeResult = await analyzeSite({ fileBrowser });
1515

1616
printSSGMatchResult(analyzeResult.ssgMatchResult);
1717
printCMSMatchResult(analyzeResult.cmsMatchResult);
18-
trackInitResultStats(analyzeResult);
18+
trackInitResultStats(analyzeResult, inputDir);
1919

2020
if (dryRun) {
2121
const yamlConfig = convertToYamlConfig({ config: analyzeResult.config });

src/stackbit.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ import { validate } from './validate';
77
import { init } from './init';
88
import { analyzeRepo } from './analyze-repo';
99
import * as telemetry from './telemetry';
10+
import { setupUncaughtExceptionHandler } from './utils';
11+
12+
setupUncaughtExceptionHandler();
1013

1114
yargs(process.argv.slice(2))
1215
.command(

0 commit comments

Comments
 (0)