-
Notifications
You must be signed in to change notification settings - Fork 251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Types revamp #423
Merged
Merged
Types revamp #423
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
9ca4594
fix(core): Correct type signature of client.use()
bengourley cd21148
feat(types): Improve UX of consuming types defs
bengourley dd911f9
v5.0.0-rc.2
bengourley f72049c
Merge branch 'universal' into u/types-revamp
bengourley ed5f9b4
v5.0.0-rc.3
bengourley 6ed89cb
fix(plugin-react): Use correct filename for type defs
bengourley 39337b7
fix(node): Missing && in build task list
bengourley ed24372
build(deps): Use exact version for all modules in monorepo
bengourley 0bc58ae
fix(node): Missing build step during release
bengourley c2e3e8c
v5.0.0-rc.4
bengourley 164d48d
build(js): Nothing to build for this module
bengourley 27ab0cd
docs(changelog): Add typescript section and tweak order
bengourley de7e4cc
build(all): There is now a required order in the build
bengourley b089283
fix(node): Disable breadcrumbs on Node
bengourley e2dc624
refactor(node): Remove autoBreadcrumbs from schema rather than defaul…
bengourley 19f810c
fix(types): Make platform-specific config extensions work
bengourley 0576938
Merge pull request #424 from bugsnag/u/disable-node-breadcrumbs
bengourley 046a20b
ci(deps): Make previously implicit dependency explicit
bengourley File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env bash | ||
|
||
# exit on all errors | ||
set -e | ||
|
||
# ensure directory exists | ||
mkdir -p dist/types/bugsnag-core | ||
|
||
# copy all .d.ts files from @bugsnag/core | ||
cp node_modules/@bugsnag/core/types/*.d.ts dist/types/bugsnag-core | ||
|
||
# copy all .d.ts files from this module | ||
cp types/*.d.ts dist/types | ||
|
||
# replace any references to @bugsnag/core with the new, bundled, local path | ||
cat types/bugsnag.d.ts | sed 's/@bugsnag\/core/\.\/bugsnag-core/' > dist/types/bugsnag.d.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,5 +3,5 @@ | |
"packages": [ | ||
"packages/*" | ||
], | ||
"version": "5.0.0-rc.1" | ||
"version": "5.0.0-rc.4" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,41 @@ | ||
import * as Bugsnag from "@bugsnag/core"; | ||
import * as BugsnagCore from "@bugsnag/core"; | ||
|
||
// augment config interface | ||
// overwrite config interface, adding browser-specific options | ||
declare module "@bugsnag/core" { | ||
namespace Bugnsag { | ||
interface IConfig { | ||
// deprecated options which are still supported | ||
endpoint?: string; | ||
sessionEndpoint?: string; | ||
// options for all bundled browser plugins | ||
maxEvents?: number; | ||
consoleBreadcrumbsEnabled?: boolean; | ||
networkBreadcrumbsEnabled?: boolean; | ||
navigationBreadcrumbsEnabled?: boolean; | ||
interactionBreadcrumbsEnabled?: boolean; | ||
collectUserIp?: boolean; | ||
} | ||
interface IConfig { | ||
apiKey: string; | ||
beforeSend?: BugsnagCore.BeforeSend | BugsnagCore.BeforeSend[]; | ||
autoBreadcrumbs?: boolean; | ||
autoNotify?: boolean; | ||
appVersion?: string; | ||
appType?: string; | ||
endpoints?: { notify: string, sessions?: string }; | ||
autoCaptureSessions?: boolean; | ||
notifyReleaseStages?: string[]; | ||
releaseStage?: string; | ||
maxBreadcrumbs?: number; | ||
user?: object | null; | ||
metaData?: object | null; | ||
logger?: BugsnagCore.ILogger | null; | ||
filters?: Array<string | RegExp>; | ||
// catch-all for any missing options | ||
[key: string]: any; | ||
// deprecated options which are still supported | ||
endpoint?: string; | ||
sessionEndpoint?: string; | ||
// options for all bundled browser plugins | ||
maxEvents?: number; | ||
consoleBreadcrumbsEnabled?: boolean; | ||
networkBreadcrumbsEnabled?: boolean; | ||
navigationBreadcrumbsEnabled?: boolean; | ||
interactionBreadcrumbsEnabled?: boolean; | ||
collectUserIp?: boolean; | ||
} | ||
} | ||
|
||
// two ways to call the exported function: apiKey or config object | ||
declare function bugsnag(apiKeyOrOpts: string | Bugsnag.IConfig): Bugsnag.Client; | ||
declare function bugsnag(apiKeyOrOpts: string | BugsnagCore.IConfig): BugsnagCore.Client; | ||
|
||
// commonjs/requirejs export | ||
export default bugsnag; | ||
export { Bugsnag }; | ||
export { BugsnagCore as Bugsnag }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
{ | ||
"name": "@bugsnag/node", | ||
"version": "5.0.0-rc.1", | ||
"version": "5.0.0-rc.4", | ||
"main": "dist/bugsnag.js", | ||
"types": "types/bugsnag.d.ts", | ||
"types": "dist/types/bugsnag.d.ts", | ||
"description": "Bugsnag error reporter for Node.js", | ||
"homepage": "https://www.bugsnag.com/", | ||
"repository": { | ||
|
@@ -13,29 +13,30 @@ | |
"access": "public" | ||
}, | ||
"files": [ | ||
"dist", | ||
"types" | ||
"dist" | ||
], | ||
"scripts": { | ||
"clean": "rm -fr dist && mkdir dist", | ||
"build": "npm run clean && npm run build:dist", | ||
"bundle-types": "../../bin/bundle-types", | ||
"build": "npm run clean && npm run build:dist && npm run bundle-types", | ||
"build:dist": "../../bin/bundle src/notifier.js --node --exclude=iserror,stack-generator,error-stack-parser,request,pump,byline --standalone=bugsnag | ../../bin/extract-source-map dist/bugsnag.js", | ||
"test": "bundle exec maze-runner" | ||
"test": "bundle exec maze-runner", | ||
"postversion": "npm run build" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The node assets were not built when each version was created. This was the cause. |
||
}, | ||
"author": "Bugsnag", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"@bugsnag/core": "^5.0.0-rc.1", | ||
"@bugsnag/delivery-node": "^5.0.0-rc.1", | ||
"@bugsnag/plugin-contextualize": "^5.0.0-rc.1", | ||
"@bugsnag/plugin-intercept": "^5.0.0-rc.1", | ||
"@bugsnag/plugin-node-device": "^5.0.0-rc.1", | ||
"@bugsnag/plugin-node-in-project": "^5.0.0-rc.1", | ||
"@bugsnag/plugin-node-surrounding-code": "^5.0.0-rc.1", | ||
"@bugsnag/plugin-node-uncaught-exception": "^5.0.0-rc.1", | ||
"@bugsnag/plugin-node-unhandled-rejection": "^5.0.0-rc.1", | ||
"@bugsnag/plugin-server-session": "^5.0.0-rc.1", | ||
"@bugsnag/plugin-strip-project-root": "^5.0.0-rc.1", | ||
"@bugsnag/core": "^5.0.0-rc.4", | ||
"@bugsnag/delivery-node": "^5.0.0-rc.4", | ||
"@bugsnag/plugin-contextualize": "^5.0.0-rc.4", | ||
"@bugsnag/plugin-intercept": "^5.0.0-rc.4", | ||
"@bugsnag/plugin-node-device": "^5.0.0-rc.4", | ||
"@bugsnag/plugin-node-in-project": "^5.0.0-rc.4", | ||
"@bugsnag/plugin-node-surrounding-code": "^5.0.0-rc.4", | ||
"@bugsnag/plugin-node-uncaught-exception": "^5.0.0-rc.4", | ||
"@bugsnag/plugin-node-unhandled-rejection": "^5.0.0-rc.4", | ||
"@bugsnag/plugin-server-session": "^5.0.0-rc.4", | ||
"@bugsnag/plugin-strip-project-root": "^5.0.0-rc.4", | ||
"jasmine": "^3.1.0", | ||
"nyc": "^12.0.2" | ||
}, | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was on the wrong package, it should have been on node.