Skip to content

Commit 48abece

Browse files
committed
init(react): Create folder structure
1 parent ace2651 commit 48abece

14 files changed

+212
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"packages/integrations",
2727
"packages/minimal",
2828
"packages/node",
29-
"packages/opentracing",
29+
"package/react",
3030
"packages/types",
3131
"packages/typescript",
3232
"packages/utils"

packages/react/.npmignore

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

packages/react/LICENSE

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
BSD 3-Clause License
2+
3+
Copyright (c) 2019, Sentry
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions are met:
8+
9+
* Redistributions of source code must retain the above copyright notice, this
10+
list of conditions and the following disclaimer.
11+
12+
* Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
16+
* Neither the name of the copyright holder nor the names of its
17+
contributors may be used to endorse or promote products derived from
18+
this software without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

packages/react/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<p align="center">
2+
<a href="https://sentry.io" target="_blank" align="center">
3+
<img src="https://sentry-brand.storage.googleapis.com/sentry-logo-black.png" width="280">
4+
</a>
5+
<br />
6+
</p>
7+
8+
# Official Sentry SDK for NodeJS

packages/react/package.json

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
{
2+
"name": "@sentry/react",
3+
"version": "5.16.0-beta.5",
4+
"description": "Offical Sentry SDK for Node.js",
5+
"repository": "git://github.com/getsentry/sentry-javascript.git",
6+
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/react",
7+
"author": "Sentry",
8+
"license": "BSD-3-Clause",
9+
"engines": {
10+
"node": ">=6"
11+
},
12+
"main": "dist/index.js",
13+
"module": "esm/index.js",
14+
"types": "dist/index.d.ts",
15+
"publishConfig": {
16+
"access": "public"
17+
},
18+
"dependencies": {
19+
"@sentry/browser": "5.16.0-beta.5"
20+
},
21+
"peerDependencies": {
22+
"react": "^16.0.0"
23+
},
24+
"devDependencies": {
25+
"@types/react": "^16.9.35",
26+
"@sentry/types": "5.16.0-beta.5",
27+
"jest": "^24.7.1",
28+
"prettier": "^1.17.0",
29+
"prettier-check": "^2.0.0",
30+
"rimraf": "^2.6.3",
31+
"npm-run-all": "^4.1.2",
32+
"rollup": "^1.10.1",
33+
"rollup-plugin-commonjs": "^9.3.4",
34+
"rollup-plugin-license": "^0.8.1",
35+
"rollup-plugin-node-resolve": "^4.2.3",
36+
"rollup-plugin-terser": "^4.0.4",
37+
"rollup-plugin-typescript2": "^0.21.0",
38+
"tslint": "^5.16.0",
39+
"typescript": "^3.4.5"
40+
},
41+
"scripts": {
42+
"build": "run-p build:es5 build:esm build:bundle",
43+
"build:bundle": "rollup --config",
44+
"build:bundle:watch": "rollup --config --watch",
45+
"build:es5": "tsc -p tsconfig.build.json",
46+
"build:esm": "tsc -p tsconfig.esm.json",
47+
"build:watch": "run-p build:watch:es5 build:watch:esm",
48+
"build:watch:es5": "tsc -p tsconfig.build.json -w --preserveWatchOutput",
49+
"build:watch:esm": "tsc -p tsconfig.esm.json -w --preserveWatchOutput",
50+
"clean": "rimraf dist coverage build esm",
51+
"link:yarn": "yarn link",
52+
"lint": "run-s lint:prettier lint:tslint",
53+
"lint:prettier": "prettier-check \"{src,test}/**/*.ts\"",
54+
"lint:tslint": "tslint -t stylish -p .",
55+
"lint:tslint:json": "tslint --format json -p . | tee lint-results.json",
56+
"fix": "run-s fix:tslint fix:prettier",
57+
"fix:prettier": "prettier --write \"{src,test}/**/*.ts\"",
58+
"fix:tslint": "tslint --fix -t stylish -p .",
59+
"test": "jest",
60+
"test:watch": "jest --watch"
61+
},
62+
"jest": {
63+
"collectCoverage": true,
64+
"transform": {
65+
"^.+\\.ts$": "ts-jest"
66+
},
67+
"moduleFileExtensions": [
68+
"js",
69+
"ts"
70+
],
71+
"testEnvironment": "node",
72+
"testMatch": [
73+
"**/*.test.ts"
74+
],
75+
"globals": {
76+
"ts-jest": {
77+
"tsConfig": "./tsconfig.json",
78+
"diagnostics": false
79+
}
80+
}
81+
},
82+
"sideEffects": false
83+
}

packages/react/src/errorboundary.ts

Whitespace-only changes.

packages/react/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * as Sentry from "@sentry/browser"

packages/react/src/profiler.ts

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
import * as React from 'react';
2+
import * as React from 'react';
3+
import { getCurrentHub } from '@sentry/browser';
4+
import { Integration, IntegrationClass } from '@sentry/types';
5+
6+
/** The Props Injected by the HOC */
7+
interface InjectedProps {
8+
/** */
9+
finishProfile(): void;
10+
}
11+
12+
const TRACING_GETTER = ({
13+
id: 'Tracing',
14+
} as any) as IntegrationClass<Integration>;
15+
16+
const tracingIntegration = getCurrentHub().getIntegration(TRACING_GETTER);
17+
18+
// export default function withProfiler<P extends InjectedProps>(WrappedComponent: React.ComponentType<P>) {
19+
// const componentDisplayName = WrappedComponent.displayName || WrappedComponent.name || 'Component';
20+
21+
// return class extends React.Component<Omit<P, keyof InjectedProps>> {
22+
// static displayName = `profiler(${componentDisplayName})`;
23+
24+
// componentWillUnmount() {
25+
// this.finishProfile();
26+
// }
27+
28+
// public activity: number | null = Integrations.Tracing.pushActivity(
29+
// componentDisplayName,
30+
// {
31+
// data: {},
32+
// op: 'react',
33+
// description: `<${componentDisplayName}>`,
34+
// },
35+
// {
36+
// // After this timeout we'll pop this activity regardless
37+
// // Set to 30s because that's the length of our longest requests
38+
// autoPopAfter: 30000,
39+
// },
40+
// );
41+
42+
// // For whatever reason it's not guaranteed that `finishProfile` will be
43+
// // called, that's why we need the previously described timeout to make
44+
// // sure our transaction will be finished.
45+
// public finishProfile = () => {
46+
// if (!this.activity) {
47+
// return;
48+
// }
49+
50+
// Integrations.Tracing.popActivity(this.activity);
51+
// this.activity = null;
52+
// };
53+
54+
// render() {
55+
// return {...this.props as P} as WrappedComponent finishProfile={this.finishProfile} />;
56+
// }
57+
// };
58+
// }

packages/react/test/profiler.test.ts

Whitespace-only changes.

packages/react/tsconfig.build.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "../../tsconfig.json",
3+
"compilerOptions": {
4+
"baseUrl": ".",
5+
"outDir": "dist"
6+
},
7+
"include": ["src/**/*"]
8+
}

packages/react/tsconfig.esm.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "../../tsconfig.esm.json",
3+
"compilerOptions": {
4+
"baseUrl": ".",
5+
"outDir": "esm"
6+
},
7+
"include": ["src/**/*"]
8+
}

packages/react/tsconfig.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"extends": "./tsconfig.build.json",
3+
"include": ["src/**/*.ts", "test/**/*.ts"],
4+
"exclude": ["dist"],
5+
"compilerOptions": {
6+
"rootDir": ".",
7+
"types": ["node", "jest"]
8+
}
9+
}

packages/react/tslint.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "@sentry/typescript/tslint"
3+
}

typedoc.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ module.exports = {
99
'**/dist/**/*',
1010
'**/esm/**/*',
1111
'**/build/**/*',
12-
'**/packages/opentracing/**/*',
1312
'**/packages/typescript/**/*',
1413
'**/dangerfile.ts',
1514
],

0 commit comments

Comments
 (0)