@@ -11,40 +11,37 @@ import constants from './constants.mts'
1111// NODE_CHANNEL_FD is set when spawned with IPC (stdio includes 'ipc')
1212// SOCKET_CLI_PRELOAD_PHASE is set by Socket CLI when spawning
1313if (
14- ! constants . ENV . INLINED_SOCKET_CLI_SENTRY_BUILD ||
15- ! constants . ENV . NODE_CHANNEL_FD ||
16- ! constants . ENV . SOCKET_CLI_PRELOAD_PHASE
14+ constants . ENV . INLINED_SOCKET_CLI_SENTRY_BUILD &&
15+ constants . ENV . NODE_CHANNEL_FD &&
16+ constants . ENV . SOCKET_CLI_PRELOAD_PHASE
1717) {
18- // eslint-disable-next-line n/no-process-exit
19- process . exit ( 0 )
18+ const require = createRequire ( import . meta. url )
19+ const Sentry = /*@__PURE__ */ require ( '@sentry/node' )
20+ Sentry . init ( {
21+ onFatalError ( error : Error ) {
22+ // Defer module loads until after Sentry.init is called.
23+ if ( constants . ENV . SOCKET_CLI_DEBUG ) {
24+ logger . fail ( '[DEBUG] [Sentry onFatalError]:' , error )
25+ }
26+ } ,
27+ dsn : 'https://66736701db8e4ffac046bd09fa6aaced@o555220.ingest.us.sentry.io/4508846967619585' ,
28+ enabled : true ,
29+ integrations : [ ] ,
30+ } )
31+ Sentry . setTag (
32+ 'environment' ,
33+ constants . ENV . INLINED_SOCKET_CLI_PUBLISHED_BUILD ? 'pub' : constants . ENV . NODE_ENV ,
34+ )
35+ Sentry . setTag ( 'version' , constants . ENV . INLINED_SOCKET_CLI_VERSION_HASH )
36+ if ( constants . ENV . SOCKET_CLI_DEBUG ) {
37+ Sentry . setTag ( 'debugging' , true )
38+ logger . info ( '[DEBUG] Set up Sentry.' )
39+ } else {
40+ Sentry . setTag ( 'debugging' , false )
41+ }
42+ const {
43+ kInternalsSymbol,
44+ [ kInternalsSymbol as unknown as 'Symbol(kInternalsSymbol)' ] : { setSentry } ,
45+ } = constants
46+ setSentry ( Sentry )
2047}
21-
22- const require = createRequire ( import . meta. url )
23- const Sentry = /*@__PURE__ */ require ( '@sentry/node' )
24- Sentry . init ( {
25- onFatalError ( error : Error ) {
26- // Defer module loads until after Sentry.init is called.
27- if ( constants . ENV . SOCKET_CLI_DEBUG ) {
28- logger . fail ( '[DEBUG] [Sentry onFatalError]:' , error )
29- }
30- } ,
31- dsn : 'https://66736701db8e4ffac046bd09fa6aaced@o555220.ingest.us.sentry.io/4508846967619585' ,
32- enabled : true ,
33- integrations : [ ] ,
34- } )
35- Sentry . setTag (
36- 'environment' ,
37- constants . ENV . INLINED_SOCKET_CLI_PUBLISHED_BUILD ? 'pub' : constants . ENV . NODE_ENV ,
38- )
39- Sentry . setTag ( 'version' , constants . ENV . INLINED_SOCKET_CLI_VERSION_HASH )
40- if ( constants . ENV . SOCKET_CLI_DEBUG ) {
41- Sentry . setTag ( 'debugging' , true )
42- logger . info ( '[DEBUG] Set up Sentry.' )
43- } else {
44- Sentry . setTag ( 'debugging' , false )
45- }
46- const {
47- kInternalsSymbol,
48- [ kInternalsSymbol as unknown as 'Symbol(kInternalsSymbol)' ] : { setSentry } ,
49- } = constants
50- setSentry ( Sentry )
0 commit comments