@datadog/esbuild-plugin 2.2.0-dev-0 → 2.2.0
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/dist/src/index.d.ts +22 -23
- package/dist/src/index.js +24 -22
- package/dist/src/index.js.map +1 -1
- package/dist/src/index.mjs +24 -22
- package/dist/src/index.mjs.map +1 -1
- package/package.json +1 -2
package/dist/src/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as esbuild from 'esbuild';
|
|
2
|
-
import * as src from 'src';
|
|
3
2
|
|
|
4
3
|
declare const CONFIG_KEY$1: "rum";
|
|
5
4
|
|
|
@@ -28,27 +27,6 @@ type types$1 = {
|
|
|
28
27
|
|
|
29
28
|
declare const CONFIG_KEY: "telemetry";
|
|
30
29
|
|
|
31
|
-
type types = {
|
|
32
|
-
Filter: Filter;
|
|
33
|
-
Metric: Metric;
|
|
34
|
-
TelemetryOptions: TelemetryOptions;
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'none';
|
|
38
|
-
type AuthOptions = {
|
|
39
|
-
apiKey?: string;
|
|
40
|
-
endPoint?: string;
|
|
41
|
-
};
|
|
42
|
-
interface GetPluginsOptions {
|
|
43
|
-
auth?: AuthOptions;
|
|
44
|
-
disableGit?: boolean;
|
|
45
|
-
logLevel?: LogLevel;
|
|
46
|
-
}
|
|
47
|
-
interface Options extends GetPluginsOptions {
|
|
48
|
-
[CONFIG_KEY$1]?: RumOptions;
|
|
49
|
-
[CONFIG_KEY]?: TelemetryOptions;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
30
|
interface Metric {
|
|
53
31
|
metric: string;
|
|
54
32
|
type: 'count' | 'size' | 'duration';
|
|
@@ -73,13 +51,34 @@ type TelemetryOptions = {
|
|
|
73
51
|
filters?: Filter[];
|
|
74
52
|
};
|
|
75
53
|
|
|
54
|
+
type types = {
|
|
55
|
+
Filter: Filter;
|
|
56
|
+
Metric: Metric;
|
|
57
|
+
TelemetryOptions: TelemetryOptions;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'none';
|
|
61
|
+
type AuthOptions = {
|
|
62
|
+
apiKey?: string;
|
|
63
|
+
endPoint?: string;
|
|
64
|
+
};
|
|
65
|
+
interface GetPluginsOptions {
|
|
66
|
+
auth?: AuthOptions;
|
|
67
|
+
disableGit?: boolean;
|
|
68
|
+
logLevel?: LogLevel;
|
|
69
|
+
}
|
|
70
|
+
interface Options extends GetPluginsOptions {
|
|
71
|
+
[CONFIG_KEY$1]?: RumOptions;
|
|
72
|
+
[CONFIG_KEY]?: TelemetryOptions;
|
|
73
|
+
}
|
|
74
|
+
|
|
76
75
|
declare const helpers: {
|
|
77
76
|
telemetry: {
|
|
78
77
|
filters: ((metric: Metric) => Metric | null)[];
|
|
79
78
|
};
|
|
80
79
|
};
|
|
81
80
|
|
|
82
|
-
declare const datadogEsbuildPlugin: (options:
|
|
81
|
+
declare const datadogEsbuildPlugin: (options: Options) => esbuild.Plugin;
|
|
83
82
|
|
|
84
83
|
export { type Options as EsbuildPluginOptions, type types$1 as RumTypes, type types as TelemetryTypes, datadogEsbuildPlugin, helpers };
|
|
85
84
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.js
CHANGED
|
@@ -10481,6 +10481,7 @@ const upload = async (payloads, options, context, log) => {
|
|
|
10481
10481
|
"DD-EVP-ORIGIN": `${context.bundler.name}-build-plugin_sourcemaps`,
|
|
10482
10482
|
"DD-EVP-ORIGIN-VERSION": context.version
|
|
10483
10483
|
};
|
|
10484
|
+
const addPromises = [];
|
|
10484
10485
|
for (const payload of payloads) {
|
|
10485
10486
|
const metadata = {
|
|
10486
10487
|
sourcemap: payload.content.get("source_map")?.path.replace(
|
|
@@ -10493,29 +10494,32 @@ const upload = async (payloads, options, context, log) => {
|
|
|
10493
10494
|
)
|
|
10494
10495
|
};
|
|
10495
10496
|
log(`Queuing ${green(metadata.sourcemap)} | ${green(metadata.file)}`);
|
|
10496
|
-
|
|
10497
|
-
|
|
10498
|
-
|
|
10499
|
-
|
|
10500
|
-
|
|
10501
|
-
|
|
10502
|
-
|
|
10503
|
-
|
|
10497
|
+
addPromises.push(
|
|
10498
|
+
queue.add(async () => {
|
|
10499
|
+
try {
|
|
10500
|
+
await doRequest(
|
|
10501
|
+
options.intakeUrl,
|
|
10502
|
+
getData$1(payload, defaultHeaders),
|
|
10503
|
+
// On retry we store the error as a warning.
|
|
10504
|
+
(error, attempt) => {
|
|
10505
|
+
const warningMessage = `Failed to upload ${yellow(metadata.sourcemap)} | ${yellow(metadata.file)}:
|
|
10504
10506
|
${error.message}
|
|
10505
10507
|
Retrying ${attempt}/${nbRetries}`;
|
|
10506
|
-
|
|
10507
|
-
|
|
10508
|
+
warnings.push(warningMessage);
|
|
10509
|
+
log(warningMessage, "warn");
|
|
10510
|
+
}
|
|
10511
|
+
);
|
|
10512
|
+
log(`Sent ${green(metadata.sourcemap)} | ${green(metadata.file)}`);
|
|
10513
|
+
} catch (e) {
|
|
10514
|
+
errors.push({ metadata, error: e });
|
|
10515
|
+
if (options.bailOnError === true) {
|
|
10516
|
+
throw e;
|
|
10508
10517
|
}
|
|
10509
|
-
);
|
|
10510
|
-
log(`Sent ${green(metadata.sourcemap)} | ${green(metadata.file)}`);
|
|
10511
|
-
} catch (e) {
|
|
10512
|
-
errors.push({ metadata, error: e });
|
|
10513
|
-
if (options.bailOnError === true) {
|
|
10514
|
-
throw e;
|
|
10515
10518
|
}
|
|
10516
|
-
}
|
|
10517
|
-
|
|
10519
|
+
})
|
|
10520
|
+
);
|
|
10518
10521
|
}
|
|
10522
|
+
await Promise.all(addPromises);
|
|
10519
10523
|
await queue.onIdle();
|
|
10520
10524
|
return { warnings, errors };
|
|
10521
10525
|
};
|
|
@@ -26953,7 +26957,7 @@ const buildPluginFactory = ({
|
|
|
26953
26957
|
|
|
26954
26958
|
var name = "@datadog/esbuild-plugin";
|
|
26955
26959
|
var packageManager = "yarn@4.0.2";
|
|
26956
|
-
var version = "2.2.0
|
|
26960
|
+
var version = "2.2.0";
|
|
26957
26961
|
var license = "MIT";
|
|
26958
26962
|
var author = "Datadog";
|
|
26959
26963
|
var description = "Datadog ESBuild Plugin";
|
|
@@ -27018,7 +27022,6 @@ var devDependencies = {
|
|
|
27018
27022
|
var peerDependencies = {
|
|
27019
27023
|
esbuild: ">=0.x"
|
|
27020
27024
|
};
|
|
27021
|
-
var stableVersion = "2.1.0";
|
|
27022
27025
|
var pkg = {
|
|
27023
27026
|
name: name,
|
|
27024
27027
|
packageManager: packageManager,
|
|
@@ -27036,8 +27039,7 @@ var pkg = {
|
|
|
27036
27039
|
files: files,
|
|
27037
27040
|
scripts: scripts,
|
|
27038
27041
|
devDependencies: devDependencies,
|
|
27039
|
-
peerDependencies: peerDependencies
|
|
27040
|
-
stableVersion: stableVersion
|
|
27042
|
+
peerDependencies: peerDependencies
|
|
27041
27043
|
};
|
|
27042
27044
|
|
|
27043
27045
|
const datadogEsbuildPlugin = buildPluginFactory({
|