From 77d000777a6b18c86c3d1df6cf3a5fc7fb2c8723 Mon Sep 17 00:00:00 2001 From: Bobby Galli Date: Thu, 18 Apr 2024 20:46:42 -0400 Subject: [PATCH] fix: unify database/app/version info (#215) * fix: unify database/app/version info * chore: simplify symbol uploads * chore: update @bugsplat/symbol-upload * chore: more simplifications --- index.html | 1 - package-lock.json | 19 ++++++++++--------- package.json | 7 +++---- src/main.ts | 14 +++++++------- 4 files changed, 20 insertions(+), 21 deletions(-) diff --git a/index.html b/index.html index 2b875c7..7aed38e 100644 --- a/index.html +++ b/index.html @@ -7,7 +7,6 @@ -
diff --git a/package-lock.json b/package-lock.json index 3022fb3..cdafe6a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,13 +9,12 @@ "version": "1.0.0", "license": "CC0-1.0", "dependencies": { - "bugsplat": "^8.0.1", "bugsplat-node": "^3.0.2", "dotenv": "^16.0.3", "node-addon-api": "^3.2.1" }, "devDependencies": { - "@bugsplat/symbol-upload": "^8.0.5", + "@bugsplat/symbol-upload": "^8.0.6", "@eslint/js": "^9.0.0", "@types/node": "^20.12.7", "cmake-js": "^7.2.1", @@ -78,9 +77,9 @@ } }, "node_modules/@bugsplat/symbol-upload": { - "version": "8.0.5", - "resolved": "https://registry.npmjs.org/@bugsplat/symbol-upload/-/symbol-upload-8.0.5.tgz", - "integrity": "sha512-FZHOIwWWz+gW59eOMeSQQbXuuDi2YnojJUSnRoYBD3QDzGiJIpxiI9GB1d73pZxO/oyjXv5j/QaGod+WuraRmQ==", + "version": "8.0.6", + "resolved": "https://registry.npmjs.org/@bugsplat/symbol-upload/-/symbol-upload-8.0.6.tgz", + "integrity": "sha512-IIZ+ZyaD/nTGsq1jSFDU/YK5yPhQj0rXPW055tWvCl6Re1Dwbjds5b+eJjG7HQJIi07Tlm7gc5oXJHumjI1Tqg==", "dev": true, "dependencies": { "@bugsplat/elfy": "^1.0.1", @@ -1054,6 +1053,7 @@ "version": "8.0.1", "resolved": "https://registry.npmjs.org/bugsplat/-/bugsplat-8.0.1.tgz", "integrity": "sha512-wBo+O580bpPRv5dqj0a4f8OhGCHxfD0LhpHimmc/ESxSRkk+7oP/k7bBaep2x2V7GzkvVedTgGDMTssWEVd3MA==", + "peer": true, "engines": { "node": ">=16.0.0", "npm": ">=8.0.0" @@ -4597,9 +4597,9 @@ } }, "@bugsplat/symbol-upload": { - "version": "8.0.5", - "resolved": "https://registry.npmjs.org/@bugsplat/symbol-upload/-/symbol-upload-8.0.5.tgz", - "integrity": "sha512-FZHOIwWWz+gW59eOMeSQQbXuuDi2YnojJUSnRoYBD3QDzGiJIpxiI9GB1d73pZxO/oyjXv5j/QaGod+WuraRmQ==", + "version": "8.0.6", + "resolved": "https://registry.npmjs.org/@bugsplat/symbol-upload/-/symbol-upload-8.0.6.tgz", + "integrity": "sha512-IIZ+ZyaD/nTGsq1jSFDU/YK5yPhQj0rXPW055tWvCl6Re1Dwbjds5b+eJjG7HQJIi07Tlm7gc5oXJHumjI1Tqg==", "dev": true, "requires": { "@bugsplat/elfy": "^1.0.1", @@ -5308,7 +5308,8 @@ "bugsplat": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/bugsplat/-/bugsplat-8.0.1.tgz", - "integrity": "sha512-wBo+O580bpPRv5dqj0a4f8OhGCHxfD0LhpHimmc/ESxSRkk+7oP/k7bBaep2x2V7GzkvVedTgGDMTssWEVd3MA==" + "integrity": "sha512-wBo+O580bpPRv5dqj0a4f8OhGCHxfD0LhpHimmc/ESxSRkk+7oP/k7bBaep2x2V7GzkvVedTgGDMTssWEVd3MA==", + "peer": true }, "bugsplat-node": { "version": "3.0.2", diff --git a/package.json b/package.json index d9f112c..39f63c0 100644 --- a/package.json +++ b/package.json @@ -10,8 +10,8 @@ "build:all": "npm run build:ts && npm run build:cpp", "build:ts": "npx tsc", "build:cpp": "cmake-js compile --debug && copyfiles --flat ./build/Debug/addon.node ./dist", - "postbuild:cpp": "node -r dotenv/config ./node_modules/@bugsplat/symbol-upload/dist/bin/index.js -d ./dist -f \"/**/*.node\" -m", - "postbuild:ts": "node -r dotenv/config ./node_modules/@bugsplat/symbol-upload/dist/bin/index.js -d ./dist -f \"/**/*.js.map\"", + "postbuild:cpp": "npx symbol-upload -u fred@bugsplat.com -p Flintstone -d ./dist -f \"/**/*.node\" -m", + "postbuild:ts": "npx symbol-upload -u fred@bugsplat.com -p Flintstone -d ./dist -f \"/**/*.js.map\"", "watch": "tsc -w", "lint": "npx eslint ./src" }, @@ -35,13 +35,12 @@ "author": "BugSplat", "license": "CC0-1.0", "dependencies": { - "bugsplat": "^8.0.1", "bugsplat-node": "^3.0.2", "dotenv": "^16.0.3", "node-addon-api": "^3.2.1" }, "devDependencies": { - "@bugsplat/symbol-upload": "^8.0.5", + "@bugsplat/symbol-upload": "^8.0.6", "@eslint/js": "^9.0.0", "@types/node": "^20.12.7", "cmake-js": "^7.2.1", diff --git a/src/main.ts b/src/main.ts index 0ec2c3f..97319d4 100644 --- a/src/main.ts +++ b/src/main.ts @@ -2,27 +2,27 @@ import { BrowserWindow, app, crashReporter, ipcMain, shell } from "electron"; import * as path from "path"; import { unhandledRejection } from "./crasher"; +const { database, name, version } = require("../../package.json"); const { add } = require('../addon.node'); // Required: Handle native crashes in Electron and native add-ins crashReporter.start({ - companyName: "BugSplat", - productName: "my-electron-crasher", - submitURL: "https://fred.bugsplat.com/post/electron/crash.php", + submitURL: `https://${database}.bugsplat.com/post/electron/v2/crash.php`, ignoreSystemCrashHandler: true, uploadToServer: true, rateLimit: false, globalExtra: { + "product": name, + "version": version, "key": "en-US", "email": "fred@bugsplat.com", - "comments": "BugSplat rocks!" + "comments": "BugSplat rocks!", } }) // Recommended: Initialize BugSplat with database name, app name, and version to catch JavaScript errors -import { BugSplatNode as BugSplat } from "bugsplat-node"; -import * as env from "../package.json"; -const bugsplat = new BugSplat(env.database, env.name, env.version) +import { BugSplatNode as BugSplat } from "bugsplat-node" +const bugsplat = new BugSplat(database, name, version) // Recommended: The following methods allow further customization bugsplat.setDefaultAppKey("main")