@datadog/rspack-plugin 2.4.1 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,10 +11,10 @@ declare class TrackedFilesMatcher {
11
11
  private getFilename;
12
12
  }
13
13
 
14
- declare const CONFIG_KEY$1: "rum";
14
+ declare const CONFIG_KEY$1: "errorTracking";
15
15
 
16
16
  type MinifiedPathPrefix = `http://${string}` | `https://${string}` | `/${string}`;
17
- type RumSourcemapsOptions = {
17
+ type SourcemapsOptions = {
18
18
  bailOnError?: boolean;
19
19
  dryRun?: boolean;
20
20
  intakeUrl?: string;
@@ -23,17 +23,17 @@ type RumSourcemapsOptions = {
23
23
  releaseVersion: string;
24
24
  service: string;
25
25
  };
26
- type RumOptions = {
26
+ type ErrorTrackingOptions = {
27
27
  disabled?: boolean;
28
- sourcemaps?: RumSourcemapsOptions;
28
+ sourcemaps?: SourcemapsOptions;
29
29
  };
30
- interface OptionsWithRum extends GetPluginsOptions {
31
- [CONFIG_KEY$1]: RumOptions;
30
+ interface OptionsWithErrorTracking extends GetPluginsOptions {
31
+ [CONFIG_KEY$1]: ErrorTrackingOptions;
32
32
  }
33
33
 
34
34
  type types$1 = {
35
- RumOptions: RumOptions;
36
- OptionsWithRum: OptionsWithRum;
35
+ ErrorTrackingOptions: ErrorTrackingOptions;
36
+ OptionsWithErrorTracking: OptionsWithErrorTracking;
37
37
  };
38
38
 
39
39
  declare const CONFIG_KEY: "telemetry";
@@ -45,7 +45,7 @@ type types = {
45
45
  };
46
46
 
47
47
  declare const SUPPORTED_BUNDLERS: readonly ["webpack", "vite", "esbuild", "rollup", "rspack"];
48
- declare const FULL_NAME_BUNDLERS: readonly ["webpack4", "webpack5", "vite", "esbuild", "rollup", "rspack"];
48
+ declare const FULL_NAME_BUNDLERS: readonly ["esbuild", "rollup", "rspack", "vite", "webpack4", "webpack5"];
49
49
 
50
50
  interface RepositoryData {
51
51
  hash: string;
@@ -69,9 +69,11 @@ type Entry = Output & {
69
69
  outputs: Output[];
70
70
  };
71
71
  type BuildReport = {
72
+ bundler: Omit<BundlerReport, 'outDir' | 'rawConfig'>;
72
73
  errors: string[];
73
74
  warnings: string[];
74
75
  logs: {
76
+ bundler: BundlerFullName;
75
77
  pluginName: string;
76
78
  type: LogLevel;
77
79
  message: string;
@@ -95,9 +97,16 @@ type BundlerReport = {
95
97
  variant?: string;
96
98
  version: string;
97
99
  };
100
+ type InjectedValue = string | (() => Promise<string>);
101
+ declare enum InjectPosition {
102
+ BEFORE = 0,
103
+ MIDDLE = 1,
104
+ AFTER = 2
105
+ }
98
106
  type ToInjectItem = {
99
107
  type: 'file' | 'code';
100
- value: string;
108
+ value: InjectedValue;
109
+ position?: InjectPosition;
101
110
  fallback?: ToInjectItem;
102
111
  };
103
112
  type GetLogger = (name: string) => Logger;
@@ -123,6 +132,7 @@ type GetCustomPlugins = (options: Options, context: GlobalContext, log: Logger)
123
132
  type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'none';
124
133
  type AuthOptions = {
125
134
  apiKey?: string;
135
+ appKey?: string;
126
136
  };
127
137
  interface BaseOptions {
128
138
  auth?: AuthOptions;
@@ -130,7 +140,7 @@ interface BaseOptions {
130
140
  logLevel?: LogLevel;
131
141
  }
132
142
  interface Options extends BaseOptions {
133
- [CONFIG_KEY$1]?: RumOptions;
143
+ [CONFIG_KEY$1]?: ErrorTrackingOptions;
134
144
  [CONFIG_KEY]?: TelemetryOptions;
135
145
  customPlugins?: GetCustomPlugins;
136
146
  }
@@ -160,9 +170,9 @@ type TelemetryOptions = {
160
170
  timestamp?: number;
161
171
  };
162
172
 
163
- declare const datadogRspackPlugin: (options: Options) => unplugin.RspackPluginInstance;
164
173
  type RspackPluginOptions = Options;
165
174
 
175
+ declare const datadogRspackPlugin: (options: Options) => unplugin.RspackPluginInstance;
166
176
  declare const version: string;
167
177
  declare const helpers: {
168
178
  telemetry: {
@@ -170,5 +180,4 @@ declare const helpers: {
170
180
  };
171
181
  };
172
182
 
173
- export { type RspackPluginOptions, type types$1 as RumTypes, type types as TelemetryTypes, datadogRspackPlugin, helpers, version };
174
- //# sourceMappingURL=index.d.ts.map
183
+ export { type types$1 as ErrorTrackingTypes, type RspackPluginOptions, type types as TelemetryTypes, datadogRspackPlugin, helpers, version };