@datadog/webpack-plugin 2.0.2-dev-2 → 2.0.2-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.
@@ -34,7 +34,7 @@ type types = {
34
34
  TelemetryOptions: TelemetryOptions;
35
35
  };
36
36
 
37
- type LogLevel = 'debug' | 'warn' | 'error' | 'none';
37
+ type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'none';
38
38
  type AuthOptions = {
39
39
  apiKey?: string;
40
40
  endPoint?: string;
@@ -82,5 +82,5 @@ declare const helpers: {
82
82
 
83
83
  declare const datadogWebpackPlugin: (options: src.WebpackPluginOptions) => webpack.WebpackPluginInstance;
84
84
 
85
- export { type types$1 as RumTypes, type types as TelemetryTypes, type Options as WebpackPluginOptions, datadogWebpackPlugin, datadogWebpackPlugin as default, helpers };
85
+ export { type types$1 as RumTypes, type types as TelemetryTypes, type Options as WebpackPluginOptions, datadogWebpackPlugin, helpers };
86
86
  //# sourceMappingURL=index.d.ts.map
package/dist/src/index.js CHANGED
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  var fs$l = require('fs');
6
4
  var require$$0 = require('tty');
7
5
  var require$$1 = require('util');
@@ -8885,6 +8883,9 @@ const log = (text, level, type = "debug", name) => {
8885
8883
  } else if (type === "warn") {
8886
8884
  color = chalk.yellow;
8887
8885
  logFn = console.warn;
8886
+ } else if (type === "info") {
8887
+ color = chalk.cyan;
8888
+ logFn = console.log;
8888
8889
  }
8889
8890
  const prefix = name ? `[${chalk.bold(name)}] ` : "";
8890
8891
  if (level === "debug" || level === "warn" && ["error", "warn"].includes(type) || level === "error" && type === "error") {
@@ -13621,6 +13622,7 @@ const getPayload = async (sourcemap, metadata, prefix, git) => {
13621
13622
 
13622
13623
  const errorCodesNoRetry = [400, 403, 413];
13623
13624
  const nbRetries = 5;
13625
+ const green = chalk.green.bold;
13624
13626
  const doRequest = async (url, getData2, onRetry) => {
13625
13627
  return retry$2(
13626
13628
  async (bail, attempt) => {
@@ -13707,6 +13709,13 @@ const upload = async (payloads, options, context, log) => {
13707
13709
  "DD-EVP-ORIGIN-VERSION": context.version
13708
13710
  };
13709
13711
  for (const payload of payloads) {
13712
+ const metadata = {
13713
+ sourcemap: payload.content.get("source_map")?.path,
13714
+ file: payload.content.get("minified_file")?.path
13715
+ };
13716
+ log(`Queuing:
13717
+ sourcemap: ${green(metadata.sourcemap)}
13718
+ file: ${green(metadata.file)}`);
13710
13719
  queue.add(async () => {
13711
13720
  await doRequest(
13712
13721
  options.intakeUrl,
@@ -13760,12 +13769,12 @@ const sendSourcemaps = async (sourcemaps, options, context, log) => {
13760
13769
  const uploadSourcemaps = async (options, context, log) => {
13761
13770
  const green = chalk.green.bold;
13762
13771
  const configurationString = Object.entries(options.sourcemaps).map(([key, value]) => ` - ${key}: ${green(value.toString())}`).join("\n");
13772
+ const sourcemaps = getSourcemapsFiles(options.sourcemaps);
13763
13773
  const summary = defaultOutdent`
13764
- Uploading sourcemap with this configuration:
13774
+ Uploading ${green(sourcemaps.length.toString())} sourcemaps with configuration:
13765
13775
  ${configurationString}
13766
13776
  `;
13767
- log(summary);
13768
- const sourcemaps = getSourcemapsFiles(options.sourcemaps);
13777
+ log(summary, "info");
13769
13778
  await sendSourcemaps(sourcemaps, options.sourcemaps, context, log);
13770
13779
  };
13771
13780
 
@@ -30144,7 +30153,7 @@ const buildPluginFactory = ({
30144
30153
 
30145
30154
  var name = "@datadog/webpack-plugin";
30146
30155
  var packageManager = "yarn@4.0.2";
30147
- var version = "2.0.2-dev-2";
30156
+ var version = "2.0.2-dev-4";
30148
30157
  var license = "MIT";
30149
30158
  var author = "Datadog";
30150
30159
  var description = "Datadog Webpack Plugin";
@@ -30234,8 +30243,11 @@ var pkg = {
30234
30243
  const datadogWebpackPlugin = buildPluginFactory({
30235
30244
  version: pkg.version
30236
30245
  }).webpack;
30246
+ module.exports = {
30247
+ helpers,
30248
+ datadogWebpackPlugin
30249
+ };
30237
30250
 
30238
30251
  exports.datadogWebpackPlugin = datadogWebpackPlugin;
30239
- exports.default = datadogWebpackPlugin;
30240
30252
  exports.helpers = helpers;
30241
30253
  //# sourceMappingURL=index.js.map