@datadog/esbuild-plugin 0.0.13-4 → 0.0.13-5
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 +38 -1
- package/dist/src/index.d.ts +18 -16
- package/dist/src/index.js +293 -237
- package/dist/src/index.js.map +1 -1
- package/dist/src/index.mjs +279 -224
- package/dist/src/index.mjs.map +1 -1
- package/package.json +15 -1
package/README.md
CHANGED
|
@@ -1 +1,38 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Datadog ESBuild Plugin
|
|
2
|
+
|
|
3
|
+
A ESBuild plugin to interact with Datadog from your ESBuild builds.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
- Yarn
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
yarn add -D @datadog/esbuild-plugin
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
- NPM
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install --save-dev @datadog/esbuild-plugin
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
```js
|
|
22
|
+
const { datadogEsbuildPlugin } = require('@datadog/esbuild-plugin');
|
|
23
|
+
|
|
24
|
+
require('esbuild').build({
|
|
25
|
+
plugins: [
|
|
26
|
+
datadogEsbuildPlugin({
|
|
27
|
+
// Configuration
|
|
28
|
+
}),
|
|
29
|
+
],
|
|
30
|
+
});
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
> [!TIP]
|
|
34
|
+
> It is important to have the plugin in the first position in order to report every other plugins.
|
|
35
|
+
|
|
36
|
+
## Configuration
|
|
37
|
+
|
|
38
|
+
Check the main [README](../../README.md#configuration) for the common configuration options.
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,28 +1,23 @@
|
|
|
1
1
|
import * as esbuild from 'esbuild';
|
|
2
2
|
|
|
3
|
+
type LogLevel = 'debug' | 'warn' | 'error' | 'none';
|
|
3
4
|
interface GetPluginsOptions {
|
|
4
|
-
auth
|
|
5
|
-
apiKey
|
|
5
|
+
auth?: {
|
|
6
|
+
apiKey?: string;
|
|
7
|
+
endPoint?: string;
|
|
6
8
|
};
|
|
9
|
+
logLevel?: LogLevel;
|
|
7
10
|
}
|
|
11
|
+
|
|
12
|
+
declare const CONFIG_KEY: "telemetry";
|
|
13
|
+
|
|
8
14
|
interface Metric {
|
|
9
15
|
metric: string;
|
|
10
16
|
type: 'count' | 'size' | 'duration';
|
|
11
17
|
value: number;
|
|
12
18
|
tags: string[];
|
|
13
19
|
}
|
|
14
|
-
|
|
15
|
-
declare const CONFIG_KEY: "telemetry";
|
|
16
|
-
|
|
17
20
|
type Filter = (metric: Metric) => Metric | null;
|
|
18
|
-
interface DatadogOptions {
|
|
19
|
-
apiKey?: string;
|
|
20
|
-
endPoint?: string;
|
|
21
|
-
prefix?: string;
|
|
22
|
-
tags?: string[];
|
|
23
|
-
timestamp?: number;
|
|
24
|
-
filters?: Filter[];
|
|
25
|
-
}
|
|
26
21
|
type OutputOptions = boolean | string | {
|
|
27
22
|
destination: string;
|
|
28
23
|
timings?: boolean;
|
|
@@ -33,15 +28,22 @@ type OutputOptions = boolean | string | {
|
|
|
33
28
|
type TelemetryOptions = {
|
|
34
29
|
disabled?: boolean;
|
|
35
30
|
output?: OutputOptions;
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
prefix?: string;
|
|
32
|
+
tags?: string[];
|
|
33
|
+
timestamp?: number;
|
|
34
|
+
filters?: Filter[];
|
|
38
35
|
};
|
|
39
36
|
|
|
40
37
|
interface Options extends GetPluginsOptions {
|
|
41
38
|
[CONFIG_KEY]?: TelemetryOptions;
|
|
42
39
|
}
|
|
40
|
+
declare const helpers: {
|
|
41
|
+
telemetry: {
|
|
42
|
+
filters: ((metric: Metric) => Metric | null)[];
|
|
43
|
+
};
|
|
44
|
+
};
|
|
43
45
|
|
|
44
46
|
declare const datadogEsbuildPlugin: (options: Options) => esbuild.Plugin;
|
|
45
47
|
|
|
46
|
-
export { type Options as EsbuildPluginOptions, datadogEsbuildPlugin };
|
|
48
|
+
export { type Options as EsbuildPluginOptions, datadogEsbuildPlugin, helpers };
|
|
47
49
|
//# sourceMappingURL=index.d.ts.map
|