Skip to content

Commit

Permalink
Version 0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
konraddysput committed Oct 30, 2023
1 parent 4ee9c7d commit d493473
Show file tree
Hide file tree
Showing 699 changed files with 127,300 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
dist
/**/dist
*.d.ts
21 changes: 21 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"env": {
"commonjs": true,
"es2021": true,
"node": true
},
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 12
},
"plugins": ["@typescript-eslint"],
"rules": {
"@typescript-eslint/no-empty-interface": [
"error",
{
"allowSingleExtends": true
}
]
}
}
46 changes: 46 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Node.js CI

on:
push:
branches: [main, dev]
pull_request:

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x, 18.x, 20.x]

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build
- run: npm run lint
- run: npm run format:check
- run: npm test

build_pre_workspaces:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [14.x]

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm i -g npm@8
- run: npm ci
- run: npm run build
- run: npm run lint
- run: npm run format:check
- run: npm test
141 changes: 141 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@

# Created by https://www.toptal.com/developers/gitignore/api/node
# Edit at https://www.toptal.com/developers/gitignore?templates=node

### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

.DS_Store

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test
.env.production

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist
lib
# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

### Node Patch ###
# Serverless Webpack directories
.webpack/

# Optional stylelint cache
.stylelintcache

# SvelteKit build / generate output
.svelte-kit

dist/

# VSCode settings
settings.json

4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
**/lib
packages/electron/main
packages/electron/renderer
packages/electron/common
8 changes: 8 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"printWidth": 120,
"proseWrap": "always",
"singleQuote": true,
"trailingComma": "all",
"arrowParens": "always",
"tabWidth": 4
}
44 changes: 44 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"version": "0.1.0",
"configurations": [
{
"name": "Attach to react native app",
"cwd": "${workspaceFolder}/examples/sdk/reactNative",
"type": "reactnative",
"request": "attach",
"skipFiles": ["<node_internals>/**", "${workspaceFolder}/node_modules/tslib/**/*.js"]
},
{
"name": "Launch",
"program": "${workspaceFolder}/examples/sdk/node/lib/index.js",
"request": "launch",
"localRoot": "${workspaceFolder}",
"remoteRoot": "${workspaceFolder}",
"skipFiles": ["<node_internals>/**", "${workspaceFolder}/node_modules/tslib/**/*.js"],
"outFiles": ["${workspaceFolder}/examples/sdk/node/lib/**/*.js"],
"sourceMaps": true,
"type": "pwa-node",
"console": "integratedTerminal"
},
{
"type": "chrome",
"request": "launch",
"name": "Launch React Example App",
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}/examples/sdk/react/",
"sourceMaps": true
},
{
"name": "Electron example",
"type": "node",
"request": "launch",
"cwd": "${workspaceFolder}/examples/sdk/electron",
"runtimeExecutable": "${workspaceFolder}/examples/sdk/electron/node_modules/.bin/electron",
"windows": {
"runtimeExecutable": "${workspaceFolder}/examples/sdk/electron/node_modules/.bin/electron.cmd"
},
"args": ["."],
"outputCapture": "std"
}
]
}
82 changes: 81 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,81 @@
# backtrace-javascript
<div align="center">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="./slbt.light.png" width="640">
<source media="(prefers-color-scheme: light)" srcset="./slbt.dark.png" width="640">
<img src="./slbt.light.png">
</picture>
</div>

# Sauce Labs Web SDK

Backtrace's first-class support for JavaScript platforms offers a robust solution for error monitoring and debugging in
production web applications, ultimately improving the quality and reliability of your software.

## Supported JavaScript frameworks

The @backtrace/browser is suitable for all JavaScript frameworks. Additional integrations are provided to take advantage
of the capabilities of different frameworks.

- [@backtrace/browser](https://github.com/backtrace-labs/backtrace-javascript/tree/dev/packages/browser)
- [@backtrace/node](https://github.com/backtrace-labs/backtrace-javascript/tree/dev/packages/browser)
- [@backtrace/react](https://github.com/backtrace-labs/backtrace-javascript/tree/dev/packages/browser)

## Web SDK Features

Backtrace is an advanced Error Reporting service, with industry-leading features to correlate, explore, manage and
resolve production issues. The Backtrace Web SDK directly connects your applications to those advanced features. These
SDKs specifically provide the following:

<table>
<tr>
<td>Source map support</td>
<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>
</tr>
<tr>
<td>Advanced breadcrumbs</td>
<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>
</tr>
<tr>
<td>PII/Data management</td>
<td>Error reports can be scrubbed for PII and otherwise altered before submission.</td>
</tr>
<td>Attachment support</td>
<td>File attachments can be added to error submissions.</td>
</tr>
<tr>
<td>Default and dynamic attributes</td>
<td>The SDK provides accurate information about the browser and OS by default, including additional attributes specific to each Javascript framework.

You can also add dynamic attributes resolved every time when the library generates a report.</td>

</tr>
<tr>
<td>Application Stability Metrics</td>
<td>Backtrace SDKs have built in functionality to generate application session and stability metrics like “Error free sessions” in the Backtrace web console.</td>
</tr>
<tr>
<td>(Node) Persistent crash data</td>
<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>
</tr>
<tr>
<td>(Node) Crash and Out of Memory (OOM) detection</td>
<td>The Node SDK can submit crash data and out of memory exceptions.</td>
</tr>
<tr>
<td>(React) Redux support</td>
<td>Backtrace will capture redux actions and states in our breadcrumb system. This allows for tracing the user journey when debugging an error.</td>
</tr>
<tr>
<td>(React) Error Boundary support</td>
<td>The error boundary component can capture the error and provide options to render a fallback component.</td>
</tr>
<tr>
<td>Build system plugins</td>
<td>Webpack, Vite and Rollup plugins are provided to support Backtrace integration with common build systems of JavaScript projects. The Backtrace plugins allow:
<ul>
<li>Generation and upload of multiple source maps to Backtrace.</li>
<li>Multiple source maps per application.</li>
<li>Source content to be included in source maps, simplifying source integration.</li>
</td>
</tr>
</table>
9 changes: 9 additions & 0 deletions build/agentDefinitionPlugin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const webpack = require('webpack');

module.exports = function agentDefinitionPlugin(packageJsonPath) {
const packageJson = require(packageJsonPath);
return new webpack.DefinePlugin({
BACKTRACE_AGENT_NAME: JSON.stringify(packageJson.name),
BACKTRACE_AGENT_VERSION: JSON.stringify(packageJson.version),
});
};
Loading

0 comments on commit d493473

Please sign in to comment.