@datadog/vite-plugin 3.2.12 → 3.3.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.
@@ -10,36 +10,24 @@ declare class TrackedFilesMatcher {
10
10
  rawTrackedFilesList(): string[];
11
11
  private getFilename;
12
12
  }
13
- type AuthMethod = "apiKey" | "oauth";
14
- type AppsProtectionLevel = "direct_publish" | "approval_required";
13
+ type LongPollingOptions = {
14
+ /** Max long-poll attempts. `1` polls once and never retries. Default: `10`. */
15
+ maxRetries?: number;
16
+ /** Randomize retry delays so concurrent pollers don't sync up. Default: `true`. */
17
+ jitter?: boolean;
18
+ /** Grow the delay between retries exponentially. Default: `true`. */
19
+ exponentialBackoff?: boolean;
20
+ /**
21
+ * Deadline for one attempt, in ms. Must stay above the server's ~30s window,
22
+ * otherwise healthy polls get aborted. Default: `40000`.
23
+ */
24
+ timeoutMs?: number;
25
+ };
15
26
  type AppsOptions = {
16
27
  enable?: boolean;
17
28
  include?: string[];
18
- dryRun?: boolean;
19
- identifier?: string;
20
- name?: string;
21
- /** Human-readable description of the app. */
22
- description?: string;
23
- /** When true, the app appears in the Datadog self-service catalog. */
24
- selfService?: boolean;
25
- /** Deployment and identity settings for the app. */
26
- permissions?: {
27
- /**
28
- * Controls whether publishing the app requires a second approver.
29
- * - `direct_publish`: any user with publish rights can deploy immediately.
30
- * - `approval_required`: a second user must approve before the app goes live.
31
- */
32
- protectionLevel?: AppsProtectionLevel;
33
- /**
34
- * UUID of the service account the app's backend functions run as.
35
- * When omitted the app runs as the uploading user.
36
- * Only service accounts are accepted; arbitrary user UUIDs are rejected by the API.
37
- */
38
- runAs?: string;
39
- };
40
- authOverrides?: {
41
- method?: AuthMethod;
42
- };
29
+ /** Controls how the dev server retries the Datadog long-poll execution endpoint. */
30
+ longPolling?: LongPollingOptions;
43
31
  };
44
32
  declare const CONFIG_KEY: "apps";
45
33
  declare const PLUGIN_NAME: PluginName;
@@ -48,14 +36,24 @@ type types = {
48
36
  };
49
37
  declare const getPlugins: GetPlugins;
50
38
  type MinifiedPathPrefix = `http://${string}` | `https://${string}` | `/${string}`;
51
- type SourcemapsOptions = {
39
+ type SourcemapsUploadOptions = {
52
40
  bailOnError?: boolean;
53
41
  dryRun?: boolean;
54
42
  maxConcurrency?: number;
43
+ };
44
+ type DebugIdSourcemapsOptions = SourcemapsUploadOptions & {
45
+ debugId: true;
46
+ minifiedPathPrefix?: never;
47
+ releaseVersion?: never;
48
+ service?: never;
49
+ };
50
+ type ServiceVersionSourcemapsOptions = SourcemapsUploadOptions & {
51
+ debugId?: false;
55
52
  minifiedPathPrefix: MinifiedPathPrefix;
56
53
  releaseVersion?: string;
57
54
  service: string;
58
55
  };
56
+ type SourcemapsOptions = DebugIdSourcemapsOptions | ServiceVersionSourcemapsOptions;
59
57
  type ErrorTrackingOptions = {
60
58
  enable?: boolean;
61
59
  sourcemaps?: SourcemapsOptions;
@@ -75,6 +73,11 @@ declare const VALID_FUNCTION_KINDS: readonly [
75
73
  "classPrivateMethod"
76
74
  ];
77
75
  type FunctionKind = (typeof VALID_FUNCTION_KINDS)[number];
76
+ declare const VALID_DECORATOR_SYNTAXES: readonly [
77
+ "legacy",
78
+ "modern"
79
+ ];
80
+ type DecoratorSyntax = (typeof VALID_DECORATOR_SYNTAXES)[number];
78
81
  type LiveDebuggerOptions = {
79
82
  enable?: boolean;
80
83
  include?: (string | RegExp)[];
@@ -82,6 +85,7 @@ type LiveDebuggerOptions = {
82
85
  honorSkipComments?: boolean;
83
86
  functionTypes?: FunctionKind[];
84
87
  namedOnly?: boolean;
88
+ decorators?: DecoratorSyntax;
85
89
  };
86
90
  type LiveDebuggerOptionsWithDefaults = {
87
91
  version: string | undefined;
@@ -90,6 +94,7 @@ type LiveDebuggerOptionsWithDefaults = {
90
94
  honorSkipComments: boolean;
91
95
  functionTypes: FunctionKind[] | undefined;
92
96
  namedOnly: boolean;
97
+ decorators: DecoratorSyntax;
93
98
  };
94
99
  declare const CONFIG_KEY$2: "liveDebugger";
95
100
  declare const PLUGIN_NAME$2: PluginName;
@@ -5098,11 +5103,17 @@ interface PrivacyOptions {
5098
5103
  addToDictionaryFunctionName?: string;
5099
5104
  helperCodeExpression?: string;
5100
5105
  }
5101
- type SourceCodeContextOptions = {
5106
+ type DebugIdSourceCodeContextOptions = {
5107
+ debugId: true;
5102
5108
  service?: string;
5103
5109
  version?: string;
5104
- debugId?: boolean;
5105
5110
  };
5111
+ type ServiceVersionSourceCodeContextOptions = {
5112
+ debugId?: false;
5113
+ service: string;
5114
+ version?: string;
5115
+ };
5116
+ type SourceCodeContextOptions = DebugIdSourceCodeContextOptions | ServiceVersionSourceCodeContextOptions;
5106
5117
  type RumOptions = {
5107
5118
  enable?: boolean;
5108
5119
  sdk?: SDKOptions;
@@ -5294,6 +5305,8 @@ type Env = (typeof ALL_ENVS)[number];
5294
5305
  type TriggerHook<R> = <K extends keyof CustomHooks>(name: K, ...args: Parameters<NonNullable<CustomHooks[K]>>) => R;
5295
5306
  type GlobalContext = {
5296
5307
  addMetric: (metric: Metric) => void;
5308
+ artifactsPending: boolean;
5309
+ artifactsReady: Promise<void>;
5297
5310
  asyncHook: TriggerHook<Promise<void[]>>;
5298
5311
  auth: AuthOptionsWithDefaults;
5299
5312
  build: BuildReport;
@@ -5304,6 +5317,8 @@ type GlobalContext = {
5304
5317
  git?: RepositoryData;
5305
5318
  hook: TriggerHook<void>;
5306
5319
  inject: (item: ToInjectItem) => void;
5320
+ markArtifactsPending: () => void;
5321
+ markArtifactsReady: (error?: unknown) => void;
5307
5322
  pluginNames: string[];
5308
5323
  plugins: (PluginOptions | CustomPluginOptions)[];
5309
5324
  queue: (promise: Promise<any>) => void;
@@ -5363,7 +5378,6 @@ type AuthOptions = {
5363
5378
  };
5364
5379
  type AuthOptionsWithDefaults = Omit<AuthOptions, "site"> & {
5365
5380
  site: Site$1;
5366
- siteSubdomain?: string;
5367
5381
  };
5368
5382
  interface BaseOptions {
5369
5383
  auth?: AuthOptions;
@@ -5371,6 +5385,21 @@ interface BaseOptions {
5371
5385
  enableGit?: boolean;
5372
5386
  logLevel?: LogLevel;
5373
5387
  }
5388
+ type SourcemapsUploadEnabledOptions = {
5389
+ upload: true;
5390
+ bailOnError?: boolean;
5391
+ dryRun?: boolean;
5392
+ maxConcurrency?: number;
5393
+ };
5394
+ type SourcemapsInjectionOnlyOptions = {
5395
+ upload?: false;
5396
+ bailOnError?: never;
5397
+ dryRun?: never;
5398
+ maxConcurrency?: never;
5399
+ };
5400
+ type SourcemapsOptions$1 = {
5401
+ debugId: true;
5402
+ } & (SourcemapsUploadEnabledOptions | SourcemapsInjectionOnlyOptions);
5374
5403
  interface Options extends BaseOptions {
5375
5404
  [CONFIG_KEY]?: AppsOptions;
5376
5405
  [CONFIG_KEY$1]?: ErrorTrackingOptions;
@@ -5378,6 +5407,7 @@ interface Options extends BaseOptions {
5378
5407
  [CONFIG_KEY$3]?: MetricsOptions;
5379
5408
  [CONFIG_KEY$4]?: OutputOptions;
5380
5409
  [rum.CONFIG_KEY]?: RumOptions;
5410
+ sourcemaps?: SourcemapsOptions$1;
5381
5411
  customPlugins?: GetCustomPlugins;
5382
5412
  }
5383
5413
  type OptionsWithDefaults = Assign<Assign<Options, Required<BaseOptions>>, {