Skip to content

Commit

Permalink
fix: unify database/app/version info (#215)
Browse files Browse the repository at this point in the history
* fix: unify database/app/version info

* chore: simplify symbol uploads

* chore: update @bugsplat/symbol-upload

* chore: more simplifications
  • Loading branch information
bobbyg603 authored Apr 19, 2024
1 parent 3522170 commit 77d0007
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 21 deletions.
1 change: 0 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'"/>
<meta http-equiv="X-Content-Security-Policy" content="default-src 'self'; script-src 'self'"/>
<link rel="stylesheet" href="./src/assets/css/styles.css">
<link rel="stylesheet" href="./node_modules/bootstrap/dist/css/bootstrap.min.css">
</head>
<body>
<div class="container">
Expand Down
19 changes: 10 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand All @@ -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",
Expand Down
14 changes: 7 additions & 7 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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": "[email protected]",
"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")
Expand Down

0 comments on commit 77d0007

Please sign in to comment.