@datadog/esbuild-plugin 0.0.13-0 → 0.0.13-10
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 +33 -15
- package/dist/src/index.js +305 -240
- package/dist/src/index.js.map +1 -1
- package/dist/src/index.mjs +291 -224
- package/dist/src/index.mjs.map +1 -1
- package/package.json +21 -9
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,10 +1,16 @@
|
|
|
1
1
|
import * as esbuild from 'esbuild';
|
|
2
|
+
import * as src from 'src';
|
|
2
3
|
|
|
4
|
+
type LogLevel = 'debug' | 'warn' | 'error' | 'none';
|
|
3
5
|
interface GetPluginsOptions {
|
|
4
|
-
auth
|
|
5
|
-
apiKey
|
|
6
|
-
|
|
6
|
+
auth?: {
|
|
7
|
+
apiKey?: string;
|
|
8
|
+
endPoint?: string;
|
|
7
9
|
};
|
|
10
|
+
logLevel?: LogLevel;
|
|
11
|
+
}
|
|
12
|
+
interface GetPluginsOptionsWithCWD extends GetPluginsOptions {
|
|
13
|
+
cwd: string;
|
|
8
14
|
}
|
|
9
15
|
|
|
10
16
|
declare const CONFIG_KEY: "telemetry";
|
|
@@ -16,33 +22,45 @@ interface Metric {
|
|
|
16
22
|
tags: string[];
|
|
17
23
|
}
|
|
18
24
|
type Filter = (metric: Metric) => Metric | null;
|
|
19
|
-
interface DatadogOptions {
|
|
20
|
-
apiKey?: string;
|
|
21
|
-
endPoint?: string;
|
|
22
|
-
prefix?: string;
|
|
23
|
-
tags?: string[];
|
|
24
|
-
timestamp?: number;
|
|
25
|
-
filters?: Filter[];
|
|
26
|
-
}
|
|
27
25
|
type OutputOptions = boolean | string | {
|
|
28
26
|
destination: string;
|
|
29
27
|
timings?: boolean;
|
|
30
28
|
dependencies?: boolean;
|
|
31
29
|
bundler?: boolean;
|
|
32
30
|
metrics?: boolean;
|
|
31
|
+
logs?: boolean;
|
|
33
32
|
};
|
|
34
33
|
type TelemetryOptions = {
|
|
35
34
|
disabled?: boolean;
|
|
36
35
|
output?: OutputOptions;
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
prefix?: string;
|
|
37
|
+
tags?: string[];
|
|
38
|
+
timestamp?: number;
|
|
39
|
+
filters?: Filter[];
|
|
40
|
+
};
|
|
41
|
+
interface TelemetryOptionsEnabled extends TelemetryOptions {
|
|
42
|
+
disabled?: false;
|
|
43
|
+
}
|
|
44
|
+
interface OptionsWithTelemetryEnabled extends GetPluginsOptionsWithCWD {
|
|
45
|
+
[CONFIG_KEY]: TelemetryOptionsEnabled;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
type types = {
|
|
49
|
+
Metric: Metric;
|
|
50
|
+
TelemetryOptions: TelemetryOptions;
|
|
51
|
+
OptionsWithTelemetryEnabled: OptionsWithTelemetryEnabled;
|
|
39
52
|
};
|
|
40
53
|
|
|
41
54
|
interface Options extends GetPluginsOptions {
|
|
42
55
|
[CONFIG_KEY]?: TelemetryOptions;
|
|
43
56
|
}
|
|
57
|
+
declare const helpers: {
|
|
58
|
+
telemetry: {
|
|
59
|
+
filters: ((metric: Metric) => Metric | null)[];
|
|
60
|
+
};
|
|
61
|
+
};
|
|
44
62
|
|
|
45
|
-
declare const datadogEsbuildPlugin: (options:
|
|
63
|
+
declare const datadogEsbuildPlugin: (options: src.EsbuildPluginOptions) => esbuild.Plugin;
|
|
46
64
|
|
|
47
|
-
export {
|
|
65
|
+
export { type Options as EsbuildPluginOptions, type types as TelemetryTypes, datadogEsbuildPlugin, helpers };
|
|
48
66
|
//# sourceMappingURL=index.d.ts.map
|