@datadog/esbuild-plugin 2.2.1 → 2.3.0-dev-1

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.
@@ -1,4 +1,6 @@
1
1
  import * as esbuild from 'esbuild';
2
+ import * as src from 'src';
3
+ import { UnpluginOptions } from 'unplugin';
2
4
 
3
5
  declare const CONFIG_KEY$1: "rum";
4
6
 
@@ -33,10 +35,68 @@ type types = {
33
35
  TelemetryOptions: TelemetryOptions;
34
36
  };
35
37
 
38
+ declare class TrackedFilesMatcher {
39
+ private trackedFilenames;
40
+ constructor(trackedFiles: string[]);
41
+ private displaySource;
42
+ matchSourcemap(srcmapPath: string, onSourcesNotFound: (reason: string) => void): string[] | undefined;
43
+ matchSources(sources: string[]): string[];
44
+ rawTrackedFilesList(): string[];
45
+ private getFilename;
46
+ }
47
+
48
+ interface RepositoryData {
49
+ hash: string;
50
+ remote: string;
51
+ trackedFilesMatcher: TrackedFilesMatcher;
52
+ }
53
+ type File = {
54
+ filepath: string;
55
+ name: string;
56
+ size: number;
57
+ type: string;
58
+ };
59
+ type Input = File & {
60
+ dependencies: Set<Input>;
61
+ dependents: Set<Input>;
62
+ };
63
+ type Output = File & {
64
+ inputs: (Input | Output)[];
65
+ };
66
+ type Entry = Output & {
67
+ outputs: Output[];
68
+ };
69
+ type BuildReport = {
70
+ errors: string[];
71
+ warnings: string[];
72
+ entries?: Entry[];
73
+ inputs?: Input[];
74
+ outputs?: Output[];
75
+ start?: number;
76
+ end?: number;
77
+ duration?: number;
78
+ writeDuration?: number;
79
+ };
80
+ type BundlerReport = {
81
+ name: string;
82
+ fullName: string;
83
+ outDir: string;
84
+ rawConfig?: any;
85
+ variant?: string;
86
+ };
87
+ type GlobalContext = {
88
+ auth?: AuthOptions;
89
+ bundler: BundlerReport;
90
+ build: BuildReport;
91
+ cwd: string;
92
+ git?: RepositoryData;
93
+ start: number;
94
+ version: string;
95
+ };
96
+ type GetCustomPlugins<T> = (options: T, context: GlobalContext) => UnpluginOptions[];
36
97
  type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'none';
37
98
  type AuthOptions = {
38
99
  apiKey?: string;
39
- endPoint?: string;
40
100
  };
41
101
  interface GetPluginsOptions {
42
102
  auth?: AuthOptions;
@@ -46,6 +106,7 @@ interface GetPluginsOptions {
46
106
  interface Options extends GetPluginsOptions {
47
107
  [CONFIG_KEY$1]?: RumOptions;
48
108
  [CONFIG_KEY]?: TelemetryOptions;
109
+ customPlugins?: GetCustomPlugins<Options>;
49
110
  }
50
111
 
51
112
  interface Metric {
@@ -58,29 +119,30 @@ type Filter = (metric: Metric) => Metric | null;
58
119
  type OutputOptions = boolean | string | {
59
120
  destination: string;
60
121
  timings?: boolean;
61
- dependencies?: boolean;
62
- bundler?: boolean;
63
122
  metrics?: boolean;
64
- logs?: boolean;
65
123
  };
66
124
  type TelemetryOptions = {
67
125
  disabled?: boolean;
126
+ /** @deprecated */
127
+ enableTracing?: boolean;
128
+ endPoint?: string;
129
+ filters?: Filter[];
68
130
  output?: OutputOptions;
69
131
  prefix?: string;
70
132
  tags?: string[];
71
133
  timestamp?: number;
72
- filters?: Filter[];
73
134
  };
74
135
 
75
- declare const datadogEsbuildPlugin: (options: Options) => esbuild.Plugin;
136
+ declare const datadogEsbuildPlugin: (options: src.EsbuildPluginOptions) => esbuild.Plugin;
76
137
 
138
+ declare const version: string;
77
139
  declare const helpers: {
78
140
  telemetry: {
79
141
  filters: ((metric: Metric) => Metric | null)[];
80
142
  };
81
143
  };
82
144
 
83
- export { type Options as EsbuildPluginOptions, type types$1 as RumTypes, type types as TelemetryTypes, datadogEsbuildPlugin, helpers };
145
+ export { type Options as EsbuildPluginOptions, type types$1 as RumTypes, type types as TelemetryTypes, datadogEsbuildPlugin, helpers, version };
84
146
 
85
147
 
86
148
  if (typeof module !== 'undefined') {
@@ -89,7 +151,8 @@ if (typeof module !== 'undefined') {
89
151
  RumTypes,
90
152
  TelemetryTypes,
91
153
  datadogEsbuildPlugin,
92
- helpers
154
+ helpers,
155
+ version
93
156
  };
94
157
  }
95
158
  //# sourceMappingURL=index.d.ts.map