File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
packages/react-native/src/metro Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ import * as path from 'path';
22import { generate } from '../../scripts/generate' ;
33import { WebSocketServer , WebSocket , Data } from 'ws' ;
44import type { MetroConfig } from 'metro-config' ;
5+ import { optionalEnvToBoolean } from 'storybook/internal/common' ;
6+ import { telemetry } from 'storybook/internal/telemetry' ;
57
68/**
79 * Options for configuring WebSockets used for syncing storybook instances or sending events to storybook.
@@ -106,6 +108,14 @@ function withStorybook(
106108 liteMode = false ,
107109 } = options ;
108110
111+ const disableTelemetry = optionalEnvToBoolean ( process . env . STORYBOOK_DISABLE_TELEMETRY ) ;
112+
113+ if ( ! disableTelemetry && enabled ) {
114+ const event = process . env . NODE_ENV === 'production' ? 'build' : 'dev' ;
115+
116+ telemetry ( event , { } ) . catch ( ( e ) => { } ) ;
117+ }
118+
109119 if ( ! enabled ) {
110120 if ( onDisabledRemoveStorybook ) {
111121 return {
You can’t perform that action at this time.
0 commit comments