Skip to content

Commit 63b255f

Browse files
authored
feat(node): Add @sentry/node-native package (#16722)
- Ref #16709 (review) Adds an empty `@sentry/node-native` package
1 parent 85c10ab commit 63b255f

File tree

13 files changed

+196
-0
lines changed

13 files changed

+196
-0
lines changed

.github/ISSUE_TEMPLATE/bug.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ body:
3737
- '@sentry/node - koa'
3838
- '@sentry/node - hapi'
3939
- '@sentry/node - connect'
40+
- '@sentry/node-native'
4041
- '@sentry/angular'
4142
- '@sentry/astro'
4243
- '@sentry/aws-serverless'

dev-packages/e2e-tests/verdaccio-config/config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,12 @@ packages:
104104
unpublish: $all
105105
# proxy: npmjs # Don't proxy for E2E tests!
106106

107+
'@sentry/node-native':
108+
access: $all
109+
publish: $all
110+
unpublish: $all
111+
# proxy: npmjs # Don't proxy for E2E tests!
112+
107113
'@sentry/opentelemetry':
108114
access: $all
109115
publish: $all

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
"packages/nestjs",
6969
"packages/nextjs",
7070
"packages/node",
71+
"packages/node-native",
7172
"packages/nuxt",
7273
"packages/opentelemetry",
7374
"packages/pino-transport",

packages/node-native/.eslintrc.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module.exports = {
2+
env: {
3+
node: true,
4+
},
5+
extends: ['../../.eslintrc.js'],
6+
7+
ignorePatterns: ['build/**/*', 'examples/**/*', 'vitest.config.ts'],
8+
rules: {
9+
'@sentry-internal/sdk/no-class-field-initializers': 'off',
10+
},
11+
};

packages/node-native/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Functional Software, Inc. dba Sentry
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of
6+
this software and associated documentation files (the "Software"), to deal in
7+
the Software without restriction, including without limitation the rights to
8+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
9+
of the Software, and to permit persons to whom the Software is furnished to do
10+
so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

packages/node-native/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<p align="center">
2+
<a href="https://sentry.io/?utm_source=github&utm_medium=logo" target="_blank">
3+
<img src="https://sentry-brand.storage.googleapis.com/sentry-wordmark-dark-280x84.png" alt="Sentry" width="280" height="84">
4+
</a>
5+
</p>
6+
7+
# Native Tools for the Official Sentry Node.js SDK
8+
9+
[![npm version](https://img.shields.io/npm/v/@sentry/node-native.svg)](https://www.npmjs.com/package/@sentry/node-native)
10+
[![npm dm](https://img.shields.io/npm/dm/@sentry/node-native.svg)](https://www.npmjs.com/package/@sentry/node-native)
11+
[![npm dt](https://img.shields.io/npm/dt/@sentry/node-native.svg)](https://www.npmjs.com/package/@sentry/node-native)
12+
13+
## Installation
14+
15+
```bash
16+
# Using yarn
17+
yarn add @sentry/node @sentry/node-native
18+
19+
# Using npm
20+
npm install --save @sentry/node @sentry/node-native
21+
```

packages/node-native/package.json

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
{
2+
"name": "@sentry/node-native",
3+
"version": "9.27.0",
4+
"description": "Native Tools for the Official Sentry Node.js SDK",
5+
"repository": "git://github.com/getsentry/sentry-javascript.git",
6+
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/node-native",
7+
"author": "Sentry",
8+
"license": "MIT",
9+
"main": "build/cjs/index.js",
10+
"module": "build/esm/index.js",
11+
"types": "build/types/index.d.ts",
12+
"exports": {
13+
"./package.json": "./package.json",
14+
".": {
15+
"import": {
16+
"types": "./build/types/index.d.ts",
17+
"default": "./build/esm/index.js"
18+
},
19+
"require": {
20+
"types": "./build/types/index.d.ts",
21+
"default": "./build/cjs/index.js"
22+
}
23+
}
24+
},
25+
"typesVersions": {
26+
"<5.0": {
27+
"build/types/index.d.ts": [
28+
"build/types-ts3.8/index.d.ts"
29+
]
30+
}
31+
},
32+
"engines": {
33+
"node": ">=18"
34+
},
35+
"publishConfig": {
36+
"access": "public"
37+
},
38+
"files": [
39+
"/build",
40+
"package.json"
41+
],
42+
"scripts": {
43+
"clean": "rm -rf build",
44+
"lint": "eslint . --format stylish",
45+
"lint:es-compatibility": "es-check es2022 ./build/cjs/*.js && es-check es2022 ./build/esm/*.js --module",
46+
"fix": "eslint . --format stylish --fix",
47+
"build": "yarn build:types && yarn build:transpile",
48+
"build:transpile": "yarn rollup -c rollup.npm.config.mjs",
49+
"build:types:downlevel": "yarn downlevel-dts build/types build/types-ts3.8 --to ts3.8",
50+
"build:types": "tsc -p tsconfig.types.json && yarn build:types:downlevel",
51+
"build:types:watch": "tsc -p tsconfig.types.json --watch",
52+
"build:dev": "yarn clean && yarn build",
53+
"build:transpile:watch": "rollup -c rollup.npm.config.mjs --watch",
54+
"build:watch": "run-p build:transpile:watch build:types:watch",
55+
"build:tarball": "npm pack"
56+
},
57+
"dependencies": {
58+
"@sentry/core": "9.31.0",
59+
"@sentry/node": "9.31.0"
60+
},
61+
"devDependencies": {
62+
"@types/node": "^18.19.1"
63+
},
64+
"volta": {
65+
"extends": "../../package.json"
66+
},
67+
"sideEffects": false,
68+
"nx": {
69+
"targets": {
70+
"build:transpile": {
71+
"dependsOn": [
72+
"^build:transpile",
73+
"^build:types"
74+
]
75+
}
76+
}
77+
}
78+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { makeBaseNPMConfig, makeNPMConfigVariants } from '@sentry-internal/rollup-utils';
2+
3+
export default makeNPMConfigVariants(
4+
makeBaseNPMConfig({
5+
entrypoints: ['src/index.ts'],
6+
packageSpecificConfig: {
7+
output: {
8+
dir: 'build',
9+
// set exports to 'named' or 'auto' so that rollup doesn't warn
10+
exports: 'named',
11+
preserveModules: true,
12+
},
13+
},
14+
}),
15+
);

packages/node-native/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export {};

packages/node-native/tsconfig.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"extends": "../../tsconfig.json",
3+
"compilerOptions": {
4+
"module": "esnext",
5+
"lib": ["es2018"],
6+
"outDir": "build",
7+
"types": ["node"]
8+
},
9+
"include": ["src/**/*"]
10+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
4+
"include": ["test/**/*", "src/**/*.d.ts", "vite.config.ts"],
5+
6+
"compilerOptions": {
7+
// should include all types from `./tsconfig.json` plus types for all test frameworks used
8+
"types": ["node"]
9+
10+
// other package-specific, test-specific options
11+
}
12+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"declaration": true,
5+
"declarationMap": true,
6+
"emitDeclarationOnly": true,
7+
"outDir": "build/types",
8+
"types": ["node"]
9+
},
10+
"files": ["src/index.ts"]
11+
}

packages/node-native/vite.config.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import baseConfig from '../../vite/vite.config';
2+
3+
export default {
4+
...baseConfig,
5+
test: {
6+
...baseConfig.test,
7+
},
8+
};

0 commit comments

Comments
 (0)