@datadog/esbuild-plugin 2.0.2-dev-3 → 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;
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,13 @@ 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:
13717
+ sourcemap: ${green(metadata.sourcemap)}
13718
+ file: ${green(metadata.file)}`);
13708
13719
  queue.add(async () => {
13709
13720
  await doRequest(
13710
13721
  options.intakeUrl,
@@ -13758,12 +13769,12 @@ const sendSourcemaps = async (sourcemaps, options, context, log) => {
13758
13769
  const uploadSourcemaps = async (options, context, log) => {
13759
13770
  const green = chalk.green.bold;
13760
13771
  const configurationString = Object.entries(options.sourcemaps).map(([key, value]) => ` - ${key}: ${green(value.toString())}`).join("\n");
13772
+ const sourcemaps = getSourcemapsFiles(options.sourcemaps);
13761
13773
  const summary = defaultOutdent`
13762
- Uploading sourcemap with this configuration:
13774
+ Uploading ${green(sourcemaps.length.toString())} sourcemaps with configuration:
13763
13775
  ${configurationString}
13764
13776
  `;
13765
- log(summary);
13766
- const sourcemaps = getSourcemapsFiles(options.sourcemaps);
13777
+ log(summary, "info");
13767
13778
  await sendSourcemaps(sourcemaps, options.sourcemaps, context, log);
13768
13779
  };
13769
13780
 
@@ -30142,7 +30153,7 @@ const buildPluginFactory = ({
30142
30153
 
30143
30154
  var name = "@datadog/esbuild-plugin";
30144
30155
  var packageManager = "yarn@4.0.2";
30145
- var version = "2.0.2-dev-3";
30156
+ var version = "2.0.2-dev-4";
30146
30157
  var license = "MIT";
30147
30158
  var author = "Datadog";
30148
30159
  var description = "Datadog ESBuild Plugin";