@datadog/esbuild-plugin 2.3.1-dev-3 → 2.3.1-dev-4
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.js +6 -27
- package/dist/src/index.js.map +1 -1
- package/dist/src/index.mjs +6 -27
- package/dist/src/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/src/index.js
CHANGED
|
@@ -20,7 +20,6 @@ var require$$0$2 = require('stream');
|
|
|
20
20
|
var zlib = require('zlib');
|
|
21
21
|
var require$$0$3 = require('constants');
|
|
22
22
|
var require$$5 = require('assert');
|
|
23
|
-
var https = require('https');
|
|
24
23
|
var perf_hooks = require('perf_hooks');
|
|
25
24
|
var querystring = require('querystring');
|
|
26
25
|
var process2 = require('process');
|
|
@@ -19168,7 +19167,7 @@ const getInjectionPlugins = (opts, context, toInject) => {
|
|
|
19168
19167
|
// Resolve the injected file.
|
|
19169
19168
|
{
|
|
19170
19169
|
name: RESOLUTION_PLUGIN_NAME,
|
|
19171
|
-
enforce: "
|
|
19170
|
+
enforce: "pre",
|
|
19172
19171
|
resolveId(id) {
|
|
19173
19172
|
if (isInjectedFile(id)) {
|
|
19174
19173
|
return { id, moduleSideEffects: true };
|
|
@@ -24363,30 +24362,10 @@ const sendMetrics = (metrics, auth, log) => {
|
|
|
24363
24362
|
Sending ${metrics.length} metrics.
|
|
24364
24363
|
Metrics:
|
|
24365
24364
|
- ${metricsNames.join("\n - ")}`);
|
|
24366
|
-
return
|
|
24367
|
-
|
|
24368
|
-
|
|
24369
|
-
|
|
24370
|
-
path: `/api/v1/series?api_key=${auth.apiKey}`
|
|
24371
|
-
});
|
|
24372
|
-
req.write(
|
|
24373
|
-
JSON.stringify({
|
|
24374
|
-
series: metrics
|
|
24375
|
-
})
|
|
24376
|
-
);
|
|
24377
|
-
req.on("response", (res) => {
|
|
24378
|
-
if (!(res.statusCode >= 200 && res.statusCode < 300)) {
|
|
24379
|
-
res.resume();
|
|
24380
|
-
reject(`Request Failed.
|
|
24381
|
-
Status Code: ${res.statusCode}`);
|
|
24382
|
-
return;
|
|
24383
|
-
}
|
|
24384
|
-
res.on("data", () => {
|
|
24385
|
-
});
|
|
24386
|
-
res.on("end", resolve);
|
|
24387
|
-
});
|
|
24388
|
-
req.on("error", reject);
|
|
24389
|
-
req.end();
|
|
24365
|
+
return doRequest({
|
|
24366
|
+
method: "POST",
|
|
24367
|
+
url: `${auth.endPoint}/api/v1/series?api_key=${auth.apiKey}`,
|
|
24368
|
+
getData: () => ({ data: JSON.stringify({ series: metrics }) })
|
|
24390
24369
|
}).then(() => {
|
|
24391
24370
|
log(`Sent metrics in ${formatDuration(Date.now() - startSending)}.`);
|
|
24392
24371
|
}).catch((e) => {
|
|
@@ -36492,7 +36471,7 @@ const buildPluginFactory = ({
|
|
|
36492
36471
|
|
|
36493
36472
|
var name = "@datadog/esbuild-plugin";
|
|
36494
36473
|
var packageManager = "yarn@4.0.2";
|
|
36495
|
-
var version$1 = "2.3.1-dev-
|
|
36474
|
+
var version$1 = "2.3.1-dev-4";
|
|
36496
36475
|
var license = "MIT";
|
|
36497
36476
|
var author = "Datadog";
|
|
36498
36477
|
var description = "Datadog ESBuild Plugin";
|