Skip to content

Commit e6b6435

Browse files
feat: Add initial files for NextJS SDK
1 parent a3a978c commit e6b6435

File tree

10 files changed

+366
-10
lines changed

10 files changed

+366
-10
lines changed

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,16 @@
2929
"packages/hub",
3030
"packages/integrations",
3131
"packages/minimal",
32+
"packages/nextjs",
3233
"packages/node",
3334
"packages/react",
3435
"packages/serverless",
3536
"packages/tracing",
3637
"packages/types",
3738
"packages/typescript",
3839
"packages/utils",
39-
"packages/wasm",
40-
"packages/vue"
40+
"packages/vue",
41+
"packages/wasm"
4142
],
4243
"devDependencies": {
4344
"@google-cloud/storage": "^5.7.0",

packages/nextjs/.eslintrc.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
es6: true,
5+
browser: true,
6+
node: true,
7+
},
8+
parserOptions: {
9+
ecmaVersion: 2018,
10+
},
11+
extends: ['@sentry-internal/sdk'],
12+
ignorePatterns: ['build/**', 'dist/**', 'esm/**', 'examples/**', 'scripts/**'],
13+
overrides: [
14+
{
15+
files: ['*.ts', '*.tsx', '*.d.ts'],
16+
parserOptions: {
17+
project: './tsconfig.json',
18+
},
19+
},
20+
{
21+
files: ['test/**'],
22+
rules: {
23+
'@typescript-eslint/no-explicit-any': 'off',
24+
'@typescript-eslint/no-non-null-assertion': 'off',
25+
},
26+
},
27+
],
28+
rules: {
29+
'max-lines': 'off',
30+
},
31+
};

packages/nextjs/LICENSE

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
MIT License
2+
3+
Copyright (c) 2021, 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/nextjs/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# `nextjs`
2+
3+
> TODO: description
4+
5+
## Usage
6+
7+
```
8+
const nextjs = require('nextjs');
9+
10+
// TODO: DEMONSTRATE API
11+
```

packages/nextjs/package.json

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{
2+
"name": "@sentry/nextjs",
3+
"version": "6.1.0",
4+
"description": "Official Sentry SDK for Next.js",
5+
"repository": "git://github.com/getsentry/sentry-javascript.git",
6+
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/nextjs",
7+
"author": "Sentry",
8+
"license": "MIT",
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+
"devDependencies": {
20+
"eslint": "^7.20.0",
21+
"rimraf": "^3.0.2"
22+
},
23+
"scripts": {
24+
"build": "run-p build:es5 build:esm",
25+
"build:es5": "tsc -p tsconfig.build.json",
26+
"build:esm": "tsc -p tsconfig.esm.json",
27+
"build:watch": "run-p build:watch:es5 build:watch:esm",
28+
"build:watch:es5": "tsc -p tsconfig.build.json -w --preserveWatchOutput",
29+
"build:watch:esm": "tsc -p tsconfig.esm.json -w --preserveWatchOutput",
30+
"clean": "rimraf dist esm coverage *.js *.js.map *.d.ts",
31+
"link:yarn": "yarn link",
32+
"lint": "run-s lint:prettier lint:eslint",
33+
"lint:prettier": "prettier --check \"{src,test}/**/*.ts\"",
34+
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
35+
"fix": "run-s fix:eslint fix:prettier",
36+
"fix:eslint": "eslint . --format stylish --fix",
37+
"fix:prettier": "prettier --write \"{src,test}/**/*.ts\"",
38+
"test": "jest",
39+
"test:watch": "jest --watch",
40+
"pack": "npm pack"
41+
},
42+
"volta": {
43+
"extends": "../../package.json"
44+
},
45+
"jest": {
46+
"collectCoverage": true,
47+
"transform": {
48+
"^.+\\.ts$": "ts-jest"
49+
},
50+
"moduleFileExtensions": [
51+
"js",
52+
"ts"
53+
],
54+
"testEnvironment": "node",
55+
"testMatch": [
56+
"**/*.test.ts"
57+
],
58+
"globals": {
59+
"ts-jest": {
60+
"tsConfig": "./tsconfig.json",
61+
"diagnostics": false
62+
}
63+
}
64+
}
65+
}

packages/nextjs/src/sdk.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// eslint-disable-next-line no-console
2+
console.log('Sentaurs greet NextJS!');

packages/nextjs/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/**/*.ts"]
8+
}

packages/nextjs/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/nextjs/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+
}

0 commit comments

Comments
 (0)