@datadog/esbuild-plugin 2.3.3-dev-1 → 2.3.3-dev-3

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.
package/README.md CHANGED
@@ -35,4 +35,4 @@ require('esbuild').build({
35
35
 
36
36
  ## Configuration
37
37
 
38
- Check the main [README](../../README.md#configuration) for the common configuration options.
38
+ Check the main [README](/README.md#configuration) for the common configuration options.
@@ -2,6 +2,16 @@ import * as src from 'src';
2
2
  import esbuild from 'esbuild';
3
3
  import { UnpluginOptions } from 'unplugin';
4
4
 
5
+ declare class TrackedFilesMatcher {
6
+ private trackedFilenames;
7
+ constructor(trackedFiles: string[]);
8
+ private displaySource;
9
+ matchSourcemap(srcmapPath: string, onSourcesNotFound: (reason: string) => void): string[] | undefined;
10
+ matchSources(sources: string[]): string[];
11
+ rawTrackedFilesList(): string[];
12
+ private getFilename;
13
+ }
14
+
5
15
  declare const CONFIG_KEY$1: "rum";
6
16
 
7
17
  type MinifiedPathPrefix = `http://${string}` | `https://${string}` | `/${string}`;
@@ -35,15 +45,8 @@ type types = {
35
45
  TelemetryOptions: TelemetryOptions;
36
46
  };
37
47
 
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
- }
48
+ declare const SUPPORTED_BUNDLERS: readonly ["webpack", "vite", "esbuild", "rollup", "rspack"];
49
+ declare const FULL_NAME_BUNDLERS: readonly ["webpack4", "webpack5", "vite", "esbuild", "rollup", "rspack"];
47
50
 
48
51
  interface RepositoryData {
49
52
  hash: string;
@@ -69,6 +72,12 @@ type Entry = Output & {
69
72
  type BuildReport = {
70
73
  errors: string[];
71
74
  warnings: string[];
75
+ logs: {
76
+ pluginName: string;
77
+ type: LogLevel;
78
+ message: string;
79
+ time: number;
80
+ }[];
72
81
  entries?: Entry[];
73
82
  inputs?: Input[];
74
83
  outputs?: Output[];
@@ -77,8 +86,8 @@ type BuildReport = {
77
86
  duration?: number;
78
87
  writeDuration?: number;
79
88
  };
80
- type BundlerFullName = 'webpack5' | 'webpack4' | 'esbuild' | 'vite' | 'rollup';
81
- type BundlerName = 'webpack' | 'esbuild' | 'vite' | 'rollup';
89
+ type BundlerFullName = (typeof FULL_NAME_BUNDLERS)[number];
90
+ type BundlerName = (typeof SUPPORTED_BUNDLERS)[number];
82
91
  type BundlerReport = {
83
92
  name: BundlerName;
84
93
  fullName: BundlerFullName;
@@ -92,6 +101,14 @@ type ToInjectItem = {
92
101
  value: string;
93
102
  fallback?: ToInjectItem;
94
103
  };
104
+ type GetLogger = (name: string) => Logger;
105
+ type Logger = {
106
+ getLogger: GetLogger;
107
+ error: (text: any) => void;
108
+ warn: (text: any) => void;
109
+ info: (text: any) => void;
110
+ debug: (text: any) => void;
111
+ };
95
112
  type GlobalContext = {
96
113
  auth?: AuthOptions;
97
114
  inject: (item: ToInjectItem) => void;
@@ -103,21 +120,22 @@ type GlobalContext = {
103
120
  start: number;
104
121
  version: string;
105
122
  };
106
- type GetCustomPlugins = (options: Options, context: GlobalContext) => UnpluginOptions[];
123
+ type GetCustomPlugins = (options: Options, context: GlobalContext, log: Logger) => UnpluginOptions[];
107
124
  type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'none';
108
125
  type AuthOptions = {
109
126
  apiKey?: string;
110
127
  };
111
- interface GetPluginsOptions {
128
+ interface BaseOptions {
112
129
  auth?: AuthOptions;
113
130
  disableGit?: boolean;
114
131
  logLevel?: LogLevel;
115
132
  }
116
- interface Options extends GetPluginsOptions {
133
+ interface Options extends BaseOptions {
117
134
  [CONFIG_KEY$1]?: RumOptions;
118
135
  [CONFIG_KEY]?: TelemetryOptions;
119
136
  customPlugins?: GetCustomPlugins;
120
137
  }
138
+ type GetPluginsOptions = Required<BaseOptions>;
121
139
 
122
140
  interface Metric {
123
141
  metric: string;