Skip to content

Commit 8be3f3b

Browse files
logaretmcodex
andauthored
ref: rename node native stacktrace package (#40)
* ref: rename node native stacktrace package Rename the published package from @sentry-internal/node-native-stacktrace to @sentry/node-native-stacktrace and update docs/test imports. Refs getsentry/sentry-javascript#21366 Co-Authored-By: OpenAI Codex <codex@openai.com> * ci: strip unsupported Node 26 Windows LTO flags Co-Authored-By: OpenAI Codex <codex@openai.com> --------- Co-authored-by: OpenAI Codex <codex@openai.com>
1 parent 9303e18 commit 8be3f3b

15 files changed

Lines changed: 31 additions & 18 deletions

.github/workflows/ci.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,19 @@ jobs:
278278
if: matrix.arch != 'arm64'
279279
run: yarn build:bindings:configure
280280

281+
- name: Remove unsupported Node LTO flags
282+
if: matrix.os == 'windows-2022' && matrix.node == 26 && matrix.arch != 'arm64'
283+
shell: pwsh
284+
run: |
285+
$projectFiles = Get-ChildItem -Path build -Filter *.vcxproj -Recurse
286+
foreach ($file in $projectFiles) {
287+
$content = Get-Content -Raw -Path $file.FullName
288+
$content = $content -replace '(?i)\s*-flto=(thin|full)', ''
289+
$content = $content -replace '(?i)\s*/flto=(thin|full)', ''
290+
$content = $content -replace '(?i)\s*/opt:lldltojobs=\d+', ''
291+
Set-Content -Path $file.FullName -Value $content -NoNewline
292+
}
293+
281294
- name: Configure node-gyp (arm64, ${{ contains(matrix.container, 'alpine') && 'musl' || 'glibc' }})
282295
if: matrix.arch == 'arm64' && matrix.target_platform != 'darwin'
283296
run: yarn build:bindings:configure:arm64

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# `@sentry-internal/node-native-stacktrace`
1+
# `@sentry/node-native-stacktrace`
22

33
A native Node.js module that can capture JavaScript stack traces for registered
44
main or worker threads from any other thread, even if event loops are blocked.
@@ -22,7 +22,7 @@ feature.
2222
In your main thread or worker threads:
2323

2424
```ts
25-
import { registerThread } from "@sentry-internal/node-native-stacktrace";
25+
import { registerThread } from "@sentry/node-native-stacktrace";
2626

2727
// Register this thread for monitoring
2828
registerThread();
@@ -31,7 +31,7 @@ registerThread();
3131
### 2. Capture stack traces from any thread
3232

3333
```ts
34-
import { captureStackTrace } from "@sentry-internal/node-native-stacktrace";
34+
import { captureStackTrace } from "@sentry/node-native-stacktrace";
3535

3636
// Capture stack traces from all registered threads
3737
const stacks = captureStackTrace();
@@ -115,7 +115,7 @@ Send regular heartbeats:
115115
import {
116116
registerThread,
117117
threadPoll,
118-
} from "@sentry-internal/node-native-stacktrace";
118+
} from "@sentry/node-native-stacktrace";
119119
import { AsyncLocalStorage } from "node:async_hooks";
120120

121121
// Create async local storage for state tracking
@@ -140,7 +140,7 @@ Monitor all registered threads from a dedicated thread:
140140
import {
141141
captureStackTrace,
142142
getThreadsLastSeen,
143-
} from "@sentry-internal/node-native-stacktrace";
143+
} from "@sentry/node-native-stacktrace";
144144

145145
const THRESHOLD = 1000; // 1 second
146146

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@sentry-internal/node-native-stacktrace",
2+
"name": "@sentry/node-native-stacktrace",
33
"version": "0.5.0",
44
"main": "lib/index.js",
55
"types": "lib/index.d.ts",

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ function getNativeModule(): Native {
7272
return require('../build/Release/stack-trace.node');
7373
} catch (e) {
7474
// eslint-disable-next-line no-console
75-
console.warn('The \'@sentry-internal/node-native-stacktrace\' binary could not be found. Use \'@electron/rebuild\' to ensure the native module is built for Electron.');
75+
console.warn('The \'@sentry/node-native-stacktrace\' binary could not be found. Use \'@electron/rebuild\' to ensure the native module is built for Electron.');
7676
throw e;
7777
}
7878
}

test/async-storage.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { AsyncLocalStorage } from 'node:async_hooks';
22
import { Worker } from 'node:worker_threads';
3-
import { registerThread } from '@sentry-internal/node-native-stacktrace';
3+
import { registerThread } from '@sentry/node-native-stacktrace';
44
import { longWork } from './long-work.js';
55

66
const asyncLocalStorage = new AsyncLocalStorage();

test/package.json.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
"name": "node-native-stacktrace-test",
33
"license": "MIT",
44
"dependencies": {
5-
"@sentry-internal/node-native-stacktrace": "{{path}}"
5+
"@sentry/node-native-stacktrace": "{{path}}"
66
}
77
}

test/stack-traces.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const { Worker } = require('node:worker_threads');
22
const { longWork } = require('./long-work.js');
3-
const { registerThread } = require('@sentry-internal/node-native-stacktrace');
3+
const { registerThread } = require('@sentry/node-native-stacktrace');
44

55
registerThread();
66

test/stalled-disabled.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const { Worker } = require('node:worker_threads');
22
const { AsyncLocalStorage } = require('node:async_hooks');
33
const { longWork } = require('./long-work.js');
4-
const { registerThread, threadPoll } = require('@sentry-internal/node-native-stacktrace');
4+
const { registerThread, threadPoll } = require('@sentry/node-native-stacktrace');
55

66
const asyncLocalStorage = new AsyncLocalStorage();
77
asyncLocalStorage.enterWith({ some_property: 'some_value' });

test/stalled-forever.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const { Worker } = require('node:worker_threads');
2-
const { registerThread, threadPoll } = require('@sentry-internal/node-native-stacktrace');
2+
const { registerThread, threadPoll } = require('@sentry/node-native-stacktrace');
33

44
registerThread();
55

test/stalled-watchdog.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { captureStackTrace, getThreadsLastSeen } = require('@sentry-internal/node-native-stacktrace');
1+
const { captureStackTrace, getThreadsLastSeen } = require('@sentry/node-native-stacktrace');
22

33
const THRESHOLD = 500; // 1 second
44

0 commit comments

Comments
 (0)