Skip to content

Commit d493473

Browse files
committed
Version 0.1.0
1 parent 4ee9c7d commit d493473

File tree

699 files changed

+127300
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

699 files changed

+127300
-1
lines changed

.eslintignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules
2+
dist
3+
/**/dist
4+
*.d.ts

.eslintrc.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"env": {
3+
"commonjs": true,
4+
"es2021": true,
5+
"node": true
6+
},
7+
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
8+
"parser": "@typescript-eslint/parser",
9+
"parserOptions": {
10+
"ecmaVersion": 12
11+
},
12+
"plugins": ["@typescript-eslint"],
13+
"rules": {
14+
"@typescript-eslint/no-empty-interface": [
15+
"error",
16+
{
17+
"allowSingleExtends": true
18+
}
19+
]
20+
}
21+
}

.github/workflows/test.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Node.js CI
2+
3+
on:
4+
push:
5+
branches: [main, dev]
6+
pull_request:
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
strategy:
13+
matrix:
14+
node-version: [16.x, 18.x, 20.x]
15+
16+
steps:
17+
- uses: actions/checkout@v3
18+
- name: Use Node.js ${{ matrix.node-version }}
19+
uses: actions/setup-node@v3
20+
with:
21+
node-version: ${{ matrix.node-version }}
22+
- run: npm ci
23+
- run: npm run build
24+
- run: npm run lint
25+
- run: npm run format:check
26+
- run: npm test
27+
28+
build_pre_workspaces:
29+
runs-on: ubuntu-latest
30+
31+
strategy:
32+
matrix:
33+
node-version: [14.x]
34+
35+
steps:
36+
- uses: actions/checkout@v3
37+
- name: Use Node.js ${{ matrix.node-version }}
38+
uses: actions/setup-node@v3
39+
with:
40+
node-version: ${{ matrix.node-version }}
41+
- run: npm i -g npm@8
42+
- run: npm ci
43+
- run: npm run build
44+
- run: npm run lint
45+
- run: npm run format:check
46+
- run: npm test

.gitignore

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
2+
# Created by https://www.toptal.com/developers/gitignore/api/node
3+
# Edit at https://www.toptal.com/developers/gitignore?templates=node
4+
5+
### Node ###
6+
# Logs
7+
logs
8+
*.log
9+
npm-debug.log*
10+
yarn-debug.log*
11+
yarn-error.log*
12+
lerna-debug.log*
13+
.pnpm-debug.log*
14+
15+
.DS_Store
16+
17+
# Diagnostic reports (https://nodejs.org/api/report.html)
18+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
19+
20+
# Runtime data
21+
pids
22+
*.pid
23+
*.seed
24+
*.pid.lock
25+
26+
# Directory for instrumented libs generated by jscoverage/JSCover
27+
lib-cov
28+
29+
# Coverage directory used by tools like istanbul
30+
coverage
31+
*.lcov
32+
33+
# nyc test coverage
34+
.nyc_output
35+
36+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
37+
.grunt
38+
39+
# Bower dependency directory (https://bower.io/)
40+
bower_components
41+
42+
# node-waf configuration
43+
.lock-wscript
44+
45+
# Compiled binary addons (https://nodejs.org/api/addons.html)
46+
build/Release
47+
48+
# Dependency directories
49+
node_modules/
50+
jspm_packages/
51+
52+
# Snowpack dependency directory (https://snowpack.dev/)
53+
web_modules/
54+
55+
# TypeScript cache
56+
*.tsbuildinfo
57+
58+
# Optional npm cache directory
59+
.npm
60+
61+
# Optional eslint cache
62+
.eslintcache
63+
64+
# Microbundle cache
65+
.rpt2_cache/
66+
.rts2_cache_cjs/
67+
.rts2_cache_es/
68+
.rts2_cache_umd/
69+
70+
# Optional REPL history
71+
.node_repl_history
72+
73+
# Output of 'npm pack'
74+
*.tgz
75+
76+
# Yarn Integrity file
77+
.yarn-integrity
78+
79+
# dotenv environment variables file
80+
.env
81+
.env.test
82+
.env.production
83+
84+
# parcel-bundler cache (https://parceljs.org/)
85+
.cache
86+
.parcel-cache
87+
88+
# Next.js build output
89+
.next
90+
out
91+
92+
# Nuxt.js build / generate output
93+
.nuxt
94+
dist
95+
lib
96+
# Gatsby files
97+
.cache/
98+
# Comment in the public line in if your project uses Gatsby and not Next.js
99+
# https://nextjs.org/blog/next-9-1#public-directory-support
100+
# public
101+
102+
# vuepress build output
103+
.vuepress/dist
104+
105+
# Serverless directories
106+
.serverless/
107+
108+
# FuseBox cache
109+
.fusebox/
110+
111+
# DynamoDB Local files
112+
.dynamodb/
113+
114+
# TernJS port file
115+
.tern-port
116+
117+
# Stores VSCode versions used for testing VSCode extensions
118+
.vscode-test
119+
120+
# yarn v2
121+
.yarn/cache
122+
.yarn/unplugged
123+
.yarn/build-state.yml
124+
.yarn/install-state.gz
125+
.pnp.*
126+
127+
### Node Patch ###
128+
# Serverless Webpack directories
129+
.webpack/
130+
131+
# Optional stylelint cache
132+
.stylelintcache
133+
134+
# SvelteKit build / generate output
135+
.svelte-kit
136+
137+
dist/
138+
139+
# VSCode settings
140+
settings.json
141+

.prettierignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
**/lib
2+
packages/electron/main
3+
packages/electron/renderer
4+
packages/electron/common

.prettierrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"printWidth": 120,
3+
"proseWrap": "always",
4+
"singleQuote": true,
5+
"trailingComma": "all",
6+
"arrowParens": "always",
7+
"tabWidth": 4
8+
}

.vscode/launch.json

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"version": "0.1.0",
3+
"configurations": [
4+
{
5+
"name": "Attach to react native app",
6+
"cwd": "${workspaceFolder}/examples/sdk/reactNative",
7+
"type": "reactnative",
8+
"request": "attach",
9+
"skipFiles": ["<node_internals>/**", "${workspaceFolder}/node_modules/tslib/**/*.js"]
10+
},
11+
{
12+
"name": "Launch",
13+
"program": "${workspaceFolder}/examples/sdk/node/lib/index.js",
14+
"request": "launch",
15+
"localRoot": "${workspaceFolder}",
16+
"remoteRoot": "${workspaceFolder}",
17+
"skipFiles": ["<node_internals>/**", "${workspaceFolder}/node_modules/tslib/**/*.js"],
18+
"outFiles": ["${workspaceFolder}/examples/sdk/node/lib/**/*.js"],
19+
"sourceMaps": true,
20+
"type": "pwa-node",
21+
"console": "integratedTerminal"
22+
},
23+
{
24+
"type": "chrome",
25+
"request": "launch",
26+
"name": "Launch React Example App",
27+
"url": "http://localhost:3000",
28+
"webRoot": "${workspaceFolder}/examples/sdk/react/",
29+
"sourceMaps": true
30+
},
31+
{
32+
"name": "Electron example",
33+
"type": "node",
34+
"request": "launch",
35+
"cwd": "${workspaceFolder}/examples/sdk/electron",
36+
"runtimeExecutable": "${workspaceFolder}/examples/sdk/electron/node_modules/.bin/electron",
37+
"windows": {
38+
"runtimeExecutable": "${workspaceFolder}/examples/sdk/electron/node_modules/.bin/electron.cmd"
39+
},
40+
"args": ["."],
41+
"outputCapture": "std"
42+
}
43+
]
44+
}

README.md

Lines changed: 81 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,81 @@
1-
# backtrace-javascript
1+
<div align="center">
2+
<picture>
3+
<source media="(prefers-color-scheme: dark)" srcset="./slbt.light.png" width="640">
4+
<source media="(prefers-color-scheme: light)" srcset="./slbt.dark.png" width="640">
5+
<img src="./slbt.light.png">
6+
</picture>
7+
</div>
8+
9+
# Sauce Labs Web SDK
10+
11+
Backtrace's first-class support for JavaScript platforms offers a robust solution for error monitoring and debugging in
12+
production web applications, ultimately improving the quality and reliability of your software.
13+
14+
## Supported JavaScript frameworks
15+
16+
The @backtrace/browser is suitable for all JavaScript frameworks. Additional integrations are provided to take advantage
17+
of the capabilities of different frameworks.
18+
19+
- [@backtrace/browser](https://github.com/backtrace-labs/backtrace-javascript/tree/dev/packages/browser)
20+
- [@backtrace/node](https://github.com/backtrace-labs/backtrace-javascript/tree/dev/packages/browser)
21+
- [@backtrace/react](https://github.com/backtrace-labs/backtrace-javascript/tree/dev/packages/browser)
22+
23+
## Web SDK Features
24+
25+
Backtrace is an advanced Error Reporting service, with industry-leading features to correlate, explore, manage and
26+
resolve production issues. The Backtrace Web SDK directly connects your applications to those advanced features. These
27+
SDKs specifically provide the following:
28+
29+
<table>
30+
<tr>
31+
<td>Source map support</td>
32+
<td>Source maps can be used to convert minified/transpiled production code into the original source code so error data can contain functions, line numbers, and more. In addition, the report can show the failing function in the your source code.</td>
33+
</tr>
34+
<tr>
35+
<td>Advanced breadcrumbs</td>
36+
<td>You can include helpful breadcrumbs for tracing application flow. Backtrace will also include useful default breadcrumbs for browsers, like http requests, navigation changes, and more.</td>
37+
</tr>
38+
<tr>
39+
<td>PII/Data management</td>
40+
<td>Error reports can be scrubbed for PII and otherwise altered before submission.</td>
41+
</tr>
42+
<td>Attachment support</td>
43+
<td>File attachments can be added to error submissions.</td>
44+
</tr>
45+
<tr>
46+
<td>Default and dynamic attributes</td>
47+
<td>The SDK provides accurate information about the browser and OS by default, including additional attributes specific to each Javascript framework.
48+
49+
You can also add dynamic attributes resolved every time when the library generates a report.</td>
50+
51+
</tr>
52+
<tr>
53+
<td>Application Stability Metrics</td>
54+
<td>Backtrace SDKs have built in functionality to generate application session and stability metrics like “Error free sessions” in the Backtrace web console.</td>
55+
</tr>
56+
<tr>
57+
<td>(Node) Persistent crash data</td>
58+
<td>Error data is stored locally when access to the internet is disrupted or the application is not able to send data. Data will be sent on restart.</td>
59+
</tr>
60+
<tr>
61+
<td>(Node) Crash and Out of Memory (OOM) detection</td>
62+
<td>The Node SDK can submit crash data and out of memory exceptions.</td>
63+
</tr>
64+
<tr>
65+
<td>(React) Redux support</td>
66+
<td>Backtrace will capture redux actions and states in our breadcrumb system. This allows for tracing the user journey when debugging an error.</td>
67+
</tr>
68+
<tr>
69+
<td>(React) Error Boundary support</td>
70+
<td>The error boundary component can capture the error and provide options to render a fallback component.</td>
71+
</tr>
72+
<tr>
73+
<td>Build system plugins</td>
74+
<td>Webpack, Vite and Rollup plugins are provided to support Backtrace integration with common build systems of JavaScript projects. The Backtrace plugins allow:
75+
<ul>
76+
<li>Generation and upload of multiple source maps to Backtrace.</li>
77+
<li>Multiple source maps per application.</li>
78+
<li>Source content to be included in source maps, simplifying source integration.</li>
79+
</td>
80+
</tr>
81+
</table>

build/agentDefinitionPlugin.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
const webpack = require('webpack');
2+
3+
module.exports = function agentDefinitionPlugin(packageJsonPath) {
4+
const packageJson = require(packageJsonPath);
5+
return new webpack.DefinePlugin({
6+
BACKTRACE_AGENT_NAME: JSON.stringify(packageJson.name),
7+
BACKTRACE_AGENT_VERSION: JSON.stringify(packageJson.version),
8+
});
9+
};

0 commit comments

Comments
 (0)