@datadog/webpack-plugin 2.0.2-dev-3 → 2.0.2-dev-5

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;
package/dist/src/index.js CHANGED
@@ -8883,6 +8883,9 @@ const log = (text, level, type = "debug", name) => {
8883
8883
  } else if (type === "warn") {
8884
8884
  color = chalk.yellow;
8885
8885
  logFn = console.warn;
8886
+ } else if (type === "info") {
8887
+ color = chalk.cyan;
8888
+ logFn = console.log;
8886
8889
  }
8887
8890
  const prefix = name ? `[${chalk.bold(name)}] ` : "";
8888
8891
  if (level === "debug" || level === "warn" && ["error", "warn"].includes(type) || level === "error" && type === "error") {
@@ -13619,6 +13622,7 @@ const getPayload = async (sourcemap, metadata, prefix, git) => {
13619
13622
 
13620
13623
  const errorCodesNoRetry = [400, 403, 413];
13621
13624
  const nbRetries = 5;
13625
+ const green = chalk.green.bold;
13622
13626
  const doRequest = async (url, getData2, onRetry) => {
13623
13627
  return retry$2(
13624
13628
  async (bail, attempt) => {
@@ -13705,6 +13709,11 @@ const upload = async (payloads, options, context, log) => {
13705
13709
  "DD-EVP-ORIGIN-VERSION": context.version
13706
13710
  };
13707
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 ${green(metadata.sourcemap)} | ${green(metadata.file)}`);
13708
13717
  queue.add(async () => {
13709
13718
  await doRequest(
13710
13719
  options.intakeUrl,
@@ -13717,6 +13726,7 @@ Retrying ${attempt}/${nbRetries}`,
13717
13726
  );
13718
13727
  }
13719
13728
  );
13729
+ log(`Sent ${green(metadata.sourcemap)} | ${green(metadata.file)}`);
13720
13730
  });
13721
13731
  }
13722
13732
  return queue.onIdle();
@@ -13758,12 +13768,12 @@ const sendSourcemaps = async (sourcemaps, options, context, log) => {
13758
13768
  const uploadSourcemaps = async (options, context, log) => {
13759
13769
  const green = chalk.green.bold;
13760
13770
  const configurationString = Object.entries(options.sourcemaps).map(([key, value]) => ` - ${key}: ${green(value.toString())}`).join("\n");
13771
+ const sourcemaps = getSourcemapsFiles(options.sourcemaps);
13761
13772
  const summary = defaultOutdent`
13762
- Uploading sourcemap with this configuration:
13773
+ Uploading ${green(sourcemaps.length.toString())} sourcemaps with configuration:
13763
13774
  ${configurationString}
13764
13775
  `;
13765
- log(summary);
13766
- const sourcemaps = getSourcemapsFiles(options.sourcemaps);
13776
+ log(summary, "info");
13767
13777
  await sendSourcemaps(sourcemaps, options.sourcemaps, context, log);
13768
13778
  };
13769
13779
 
@@ -30142,7 +30152,7 @@ const buildPluginFactory = ({
30142
30152
 
30143
30153
  var name = "@datadog/webpack-plugin";
30144
30154
  var packageManager = "yarn@4.0.2";
30145
- var version = "2.0.2-dev-3";
30155
+ var version = "2.0.2-dev-5";
30146
30156
  var license = "MIT";
30147
30157
  var author = "Datadog";
30148
30158
  var description = "Datadog Webpack Plugin";