@datadog/rspack-plugin 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 +40 -0
- package/dist/src/index.d.ts +174 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +3234 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/index.mjs +3230 -0
- package/dist/src/index.mjs.map +1 -0
- package/package.json +86 -0
package/README.md
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Datadog Rspack Plugin
|
|
2
|
+
|
|
3
|
+
A Rspack plugin to interact with Datadog from your builds.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
- Yarn
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
yarn add -D @datadog/rspack-plugin
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
- NPM
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install --save-dev @datadog/rspack-plugin
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
Inside your `rspack.config.js`.
|
|
22
|
+
|
|
23
|
+
```js
|
|
24
|
+
const { datadogRspackPlugin } = require('@datadog/rspack-plugin');
|
|
25
|
+
|
|
26
|
+
module.exports = {
|
|
27
|
+
plugins: [
|
|
28
|
+
datadogRspackPlugin({
|
|
29
|
+
// Configuration
|
|
30
|
+
}),
|
|
31
|
+
],
|
|
32
|
+
};
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
> [!TIP]
|
|
36
|
+
> It is important to have the plugin in the first position in order to report every other plugins.
|
|
37
|
+
|
|
38
|
+
## Configuration
|
|
39
|
+
|
|
40
|
+
Check the main [README](/README.md#configuration) for the common configuration options.
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import * as unplugin from 'unplugin';
|
|
2
|
+
import { UnpluginOptions } from 'unplugin';
|
|
3
|
+
import * as src from 'src';
|
|
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
|
+
|
|
15
|
+
declare const CONFIG_KEY$1: "rum";
|
|
16
|
+
|
|
17
|
+
type MinifiedPathPrefix = `http://${string}` | `https://${string}` | `/${string}`;
|
|
18
|
+
type RumSourcemapsOptions = {
|
|
19
|
+
bailOnError?: boolean;
|
|
20
|
+
dryRun?: boolean;
|
|
21
|
+
intakeUrl?: string;
|
|
22
|
+
maxConcurrency?: number;
|
|
23
|
+
minifiedPathPrefix: MinifiedPathPrefix;
|
|
24
|
+
releaseVersion: string;
|
|
25
|
+
service: string;
|
|
26
|
+
};
|
|
27
|
+
type RumOptions = {
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
sourcemaps?: RumSourcemapsOptions;
|
|
30
|
+
};
|
|
31
|
+
interface OptionsWithRum extends GetPluginsOptions {
|
|
32
|
+
[CONFIG_KEY$1]: RumOptions;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
type types$1 = {
|
|
36
|
+
RumOptions: RumOptions;
|
|
37
|
+
OptionsWithRum: OptionsWithRum;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
declare const CONFIG_KEY: "telemetry";
|
|
41
|
+
|
|
42
|
+
type types = {
|
|
43
|
+
Filter: Filter;
|
|
44
|
+
Metric: Metric;
|
|
45
|
+
TelemetryOptions: TelemetryOptions;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
declare const SUPPORTED_BUNDLERS: readonly ["webpack", "vite", "esbuild", "rollup", "rspack"];
|
|
49
|
+
declare const FULL_NAME_BUNDLERS: readonly ["webpack4", "webpack5", "vite", "esbuild", "rollup", "rspack"];
|
|
50
|
+
|
|
51
|
+
interface RepositoryData {
|
|
52
|
+
hash: string;
|
|
53
|
+
remote: string;
|
|
54
|
+
trackedFilesMatcher: TrackedFilesMatcher;
|
|
55
|
+
}
|
|
56
|
+
type File = {
|
|
57
|
+
filepath: string;
|
|
58
|
+
name: string;
|
|
59
|
+
size: number;
|
|
60
|
+
type: string;
|
|
61
|
+
};
|
|
62
|
+
type Input = File & {
|
|
63
|
+
dependencies: Set<Input>;
|
|
64
|
+
dependents: Set<Input>;
|
|
65
|
+
};
|
|
66
|
+
type Output = File & {
|
|
67
|
+
inputs: (Input | Output)[];
|
|
68
|
+
};
|
|
69
|
+
type Entry = Output & {
|
|
70
|
+
outputs: Output[];
|
|
71
|
+
};
|
|
72
|
+
type BuildReport = {
|
|
73
|
+
errors: string[];
|
|
74
|
+
warnings: string[];
|
|
75
|
+
logs: {
|
|
76
|
+
pluginName: string;
|
|
77
|
+
type: LogLevel;
|
|
78
|
+
message: string;
|
|
79
|
+
time: number;
|
|
80
|
+
}[];
|
|
81
|
+
entries?: Entry[];
|
|
82
|
+
inputs?: Input[];
|
|
83
|
+
outputs?: Output[];
|
|
84
|
+
start?: number;
|
|
85
|
+
end?: number;
|
|
86
|
+
duration?: number;
|
|
87
|
+
writeDuration?: number;
|
|
88
|
+
};
|
|
89
|
+
type BundlerFullName = (typeof FULL_NAME_BUNDLERS)[number];
|
|
90
|
+
type BundlerName = (typeof SUPPORTED_BUNDLERS)[number];
|
|
91
|
+
type BundlerReport = {
|
|
92
|
+
name: BundlerName;
|
|
93
|
+
fullName: BundlerFullName;
|
|
94
|
+
outDir: string;
|
|
95
|
+
rawConfig?: any;
|
|
96
|
+
variant?: string;
|
|
97
|
+
version: string;
|
|
98
|
+
};
|
|
99
|
+
type ToInjectItem = {
|
|
100
|
+
type: 'file' | 'code';
|
|
101
|
+
value: string;
|
|
102
|
+
fallback?: ToInjectItem;
|
|
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
|
+
};
|
|
112
|
+
type GlobalContext = {
|
|
113
|
+
auth?: AuthOptions;
|
|
114
|
+
inject: (item: ToInjectItem) => void;
|
|
115
|
+
bundler: BundlerReport;
|
|
116
|
+
build: BuildReport;
|
|
117
|
+
cwd: string;
|
|
118
|
+
git?: RepositoryData;
|
|
119
|
+
pluginNames: string[];
|
|
120
|
+
start: number;
|
|
121
|
+
version: string;
|
|
122
|
+
};
|
|
123
|
+
type GetCustomPlugins = (options: Options, context: GlobalContext, log: Logger) => UnpluginOptions[];
|
|
124
|
+
type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'none';
|
|
125
|
+
type AuthOptions = {
|
|
126
|
+
apiKey?: string;
|
|
127
|
+
};
|
|
128
|
+
interface BaseOptions {
|
|
129
|
+
auth?: AuthOptions;
|
|
130
|
+
disableGit?: boolean;
|
|
131
|
+
logLevel?: LogLevel;
|
|
132
|
+
}
|
|
133
|
+
interface Options extends BaseOptions {
|
|
134
|
+
[CONFIG_KEY$1]?: RumOptions;
|
|
135
|
+
[CONFIG_KEY]?: TelemetryOptions;
|
|
136
|
+
customPlugins?: GetCustomPlugins;
|
|
137
|
+
}
|
|
138
|
+
type GetPluginsOptions = Required<BaseOptions>;
|
|
139
|
+
|
|
140
|
+
interface Metric {
|
|
141
|
+
metric: string;
|
|
142
|
+
type: 'count' | 'size' | 'duration';
|
|
143
|
+
value: number;
|
|
144
|
+
tags: string[];
|
|
145
|
+
}
|
|
146
|
+
type Filter = (metric: Metric) => Metric | null;
|
|
147
|
+
type OutputOptions = boolean | string | {
|
|
148
|
+
destination: string;
|
|
149
|
+
timings?: boolean;
|
|
150
|
+
metrics?: boolean;
|
|
151
|
+
};
|
|
152
|
+
type TelemetryOptions = {
|
|
153
|
+
disabled?: boolean;
|
|
154
|
+
/** @deprecated */
|
|
155
|
+
enableTracing?: boolean;
|
|
156
|
+
endPoint?: string;
|
|
157
|
+
filters?: Filter[];
|
|
158
|
+
output?: OutputOptions;
|
|
159
|
+
prefix?: string;
|
|
160
|
+
tags?: string[];
|
|
161
|
+
timestamp?: number;
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
declare const datadogRspackPlugin: (options: src.RspackPluginOptions) => unplugin.RspackPluginInstance;
|
|
165
|
+
|
|
166
|
+
declare const version: string;
|
|
167
|
+
declare const helpers: {
|
|
168
|
+
telemetry: {
|
|
169
|
+
filters: ((metric: Metric) => Metric | null)[];
|
|
170
|
+
};
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
export { type Options as RspackPluginOptions, type types$1 as RumTypes, type types as TelemetryTypes, datadogRspackPlugin, helpers, version };
|
|
174
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|