@cloudflare/vite-plugin 1.43.3 → 1.44.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.
package/dist/index.mjs CHANGED
@@ -26084,7 +26084,7 @@ var require_command_exists = __commonJS$1({ "../../node_modules/.pnpm/command-ex
26084
26084
  var exec = __require$1("child_process").exec;
26085
26085
  var execSync = __require$1("child_process").execSync;
26086
26086
  var fs3 = __require$1("fs");
26087
- var path4 = __require$1("path");
26087
+ var path5 = __require$1("path");
26088
26088
  var access = fs3.access;
26089
26089
  var accessSync2 = fs3.accessSync;
26090
26090
  var constants2 = fs3.constants || fs3;
@@ -26161,8 +26161,8 @@ var require_command_exists = __commonJS$1({ "../../node_modules/.pnpm/command-ex
26161
26161
  }, "cleanInput");
26162
26162
  if (isUsingWindows) cleanInput = /* @__PURE__ */ __name$1(function(s) {
26163
26163
  if (/[\\]/.test(s)) {
26164
- var dirname2 = "\"" + path4.dirname(s) + "\"";
26165
- var basename2 = "\"" + path4.basename(s) + "\"";
26164
+ var dirname2 = "\"" + path5.dirname(s) + "\"";
26165
+ var basename2 = "\"" + path5.basename(s) + "\"";
26166
26166
  return dirname2 + ":" + basename2;
26167
26167
  }
26168
26168
  return "\"" + s + "\"";
@@ -26385,7 +26385,7 @@ var require_strip_json_comments = __commonJS$1({ "../../node_modules/.pnpm/strip
26385
26385
  var require_utils$1 = __commonJS$1({ "../../node_modules/.pnpm/rc@1.2.8/node_modules/rc/lib/utils.js"(exports$2) {
26386
26386
  var fs3 = __require$1("fs");
26387
26387
  var ini = require_ini();
26388
- var path4 = __require$1("path");
26388
+ var path5 = __require$1("path");
26389
26389
  var stripJsonComments = require_strip_json_comments();
26390
26390
  var parse$13 = exports$2.parse = function(content) {
26391
26391
  if (/^\s*{/.test(content)) return JSON.parse(stripJsonComments(content));
@@ -26396,7 +26396,7 @@ var require_utils$1 = __commonJS$1({ "../../node_modules/.pnpm/rc@1.2.8/node_mod
26396
26396
  return arg != null;
26397
26397
  });
26398
26398
  for (var i$1 in args) if ("string" !== typeof args[i$1]) return;
26399
- var file2 = path4.join.apply(null, args);
26399
+ var file2 = path5.join.apply(null, args);
26400
26400
  try {
26401
26401
  return fs3.readFileSync(file2, "utf-8");
26402
26402
  } catch (err) {
@@ -26426,14 +26426,14 @@ var require_utils$1 = __commonJS$1({ "../../node_modules/.pnpm/rc@1.2.8/node_mod
26426
26426
  return obj;
26427
26427
  };
26428
26428
  exports$2.find = function() {
26429
- var rel = path4.join.apply(null, [].slice.call(arguments));
26429
+ var rel = path5.join.apply(null, [].slice.call(arguments));
26430
26430
  function find2(start, rel2) {
26431
- var file2 = path4.join(start, rel2);
26431
+ var file2 = path5.join(start, rel2);
26432
26432
  try {
26433
26433
  fs3.statSync(file2);
26434
26434
  return file2;
26435
26435
  } catch (err) {
26436
- if (path4.dirname(start) !== start) return find2(path4.dirname(start), rel2);
26436
+ if (path5.dirname(start) !== start) return find2(path5.dirname(start), rel2);
26437
26437
  }
26438
26438
  }
26439
26439
  __name$1(find2, "find");
@@ -26823,8 +26823,8 @@ var require_registry_auth_token = __commonJS$1({ "../../node_modules/.pnpm/regis
26823
26823
  };
26824
26824
  }
26825
26825
  __name$1(getLegacyAuthInfo, "getLegacyAuthInfo");
26826
- function normalizePath$3(path4) {
26827
- return path4[path4.length - 1] === "/" ? path4 : path4 + "/";
26826
+ function normalizePath$3(path5) {
26827
+ return path5[path5.length - 1] === "/" ? path5 : path5 + "/";
26828
26828
  }
26829
26829
  __name$1(normalizePath$3, "normalizePath");
26830
26830
  function getAuthInfoForUrl(regUrl, npmrc) {
@@ -26996,6 +26996,7 @@ var defaultWranglerConfig = {
26996
26996
  targetEnvironment: void 0,
26997
26997
  pages_build_output_dir: void 0,
26998
26998
  send_metrics: void 0,
26999
+ dependencies_instrumentation: void 0,
26999
27000
  dev: {
27000
27001
  ip: process.platform === "win32" ? "127.0.0.1" : "localhost",
27001
27002
  port: void 0,
@@ -27382,8 +27383,8 @@ function getErrorMap$1() {
27382
27383
  }
27383
27384
  __name$1(getErrorMap$1, "getErrorMap");
27384
27385
  var makeIssue$1 = /* @__PURE__ */ __name$1((params) => {
27385
- const { data: data$1, path: path4, errorMaps, issueData } = params;
27386
- const fullPath = [...path4, ...issueData.path || []];
27386
+ const { data: data$1, path: path5, errorMaps, issueData } = params;
27387
+ const fullPath = [...path5, ...issueData.path || []];
27387
27388
  const fullIssue = {
27388
27389
  ...issueData,
27389
27390
  path: fullPath
@@ -27487,11 +27488,11 @@ var ParseInputLazyPath$1 = class {
27487
27488
  static {
27488
27489
  __name$1(this, "ParseInputLazyPath");
27489
27490
  }
27490
- constructor(parent, value, path4, key) {
27491
+ constructor(parent, value, path5, key) {
27491
27492
  this._cachedPath = [];
27492
27493
  this.parent = parent;
27493
27494
  this.data = value;
27494
- this._path = path4;
27495
+ this._path = path5;
27495
27496
  this._key = key;
27496
27497
  }
27497
27498
  get path() {
@@ -30641,7 +30642,7 @@ function isValidWorkflowName(name) {
30641
30642
  __name$1(isValidWorkflowName, "isValidWorkflowName");
30642
30643
  z.object({
30643
30644
  retries: z.object({
30644
- delay: z.number().gte(0).or(z.string()),
30645
+ delay: z.number().gte(0).or(z.string()).or(z.function()),
30645
30646
  limit: z.number().gte(0),
30646
30647
  backoff: z.enum([
30647
30648
  "constant",
@@ -30888,9 +30889,9 @@ Please add "${field}" to "env.${envName}".`);
30888
30889
  return rawEnv[field] ?? defaultValue;
30889
30890
  }
30890
30891
  __name$1(notInheritable, "notInheritable");
30891
- function unwindPropertyPath(root, path4) {
30892
+ function unwindPropertyPath(root, path5) {
30892
30893
  let container = root;
30893
- const parts = path4.split(".");
30894
+ const parts = path5.split(".");
30894
30895
  for (let i$1 = 0; i$1 < parts.length - 1; i$1++) {
30895
30896
  if (!hasProperty(container, parts[i$1])) return;
30896
30897
  container = container[parts[i$1]];
@@ -31165,6 +31166,12 @@ function normalizeAndValidateConfig(rawConfig, configPath, userConfigPath, args,
31165
31166
  const diagnostics = new Diagnostics(`Processing ${configPath ? path2.relative(process.cwd(), configPath) : "wrangler"} configuration:`);
31166
31167
  validateOptionalProperty(diagnostics, "", "legacy_env", rawConfig.legacy_env, "boolean");
31167
31168
  validateOptionalProperty(diagnostics, "", "send_metrics", rawConfig.send_metrics, "boolean");
31169
+ if (validateOptionalProperty(diagnostics, "", "dependencies_instrumentation", rawConfig.dependencies_instrumentation, "object")) {
31170
+ if (typeof rawConfig.dependencies_instrumentation === "object") {
31171
+ validateOptionalProperty(diagnostics, "dependencies_instrumentation", "enabled", rawConfig.dependencies_instrumentation.enabled, "boolean");
31172
+ validateAdditionalProperties(diagnostics, "dependencies_instrumentation", Object.keys(rawConfig.dependencies_instrumentation), ["enabled"]);
31173
+ }
31174
+ }
31168
31175
  validateOptionalProperty(diagnostics, "", "keep_vars", rawConfig.keep_vars, "boolean");
31169
31176
  validateOptionalProperty(diagnostics, "", "pages_build_output_dir", rawConfig.pages_build_output_dir, "string");
31170
31177
  validateOptionalProperty(diagnostics, "", "$schema", rawConfig.$schema, "string");
@@ -31223,6 +31230,7 @@ Consider adding an environment configuration section to the ${configFileName$1(c
31223
31230
  pages_build_output_dir: normalizeAndValidatePagesBuildOutputDir(configPath, rawConfig.pages_build_output_dir),
31224
31231
  legacy_env: !useServiceEnvironments,
31225
31232
  send_metrics: rawConfig.send_metrics,
31233
+ dependencies_instrumentation: rawConfig.dependencies_instrumentation,
31226
31234
  keep_vars: rawConfig.keep_vars,
31227
31235
  ...activeEnv,
31228
31236
  dev: normalizeAndValidateDev(diagnostics, rawConfig.dev ?? {}, args),
@@ -33658,6 +33666,49 @@ Pages requires Durable Object bindings to specify the name of the Worker where t
33658
33666
  }
33659
33667
  }
33660
33668
  __name$1(validateDurableObjectBinding2, "validateDurableObjectBinding");
33669
+ function getPackagePath(packageName, projectPath) {
33670
+ try {
33671
+ return path2.dirname(__require$1.resolve(`${packageName}/package.json`, { paths: [projectPath] }));
33672
+ } catch {}
33673
+ try {
33674
+ return path2.dirname(__require$1.resolve(packageName, { paths: [projectPath] }));
33675
+ } catch {}
33676
+ }
33677
+ __name$1(getPackagePath, "getPackagePath");
33678
+ function isPackageInstalled(packageName, projectPath) {
33679
+ return !!getPackagePath(packageName, projectPath);
33680
+ }
33681
+ __name$1(isPackageInstalled, "isPackageInstalled");
33682
+ function getInstalledPackageVersion(packageName, projectPath, opts = {}) {
33683
+ try {
33684
+ const packagePath = getPackagePath(packageName, projectPath);
33685
+ if (!packagePath) return;
33686
+ const packageJsonPath = findFileUp("package.json", packagePath, opts.stopAtProjectPath === true ? projectPath : void 0);
33687
+ if (!packageJsonPath) return;
33688
+ const packageJson = parsePackageJSON$1(readFileSync$2(packageJsonPath), packageJsonPath);
33689
+ if (packageJson.name !== packageName) {
33690
+ const bundledVersion = packageJson.bundledVersions?.[packageName];
33691
+ if (bundledVersion !== void 0) return bundledVersion;
33692
+ }
33693
+ return packageJson.version;
33694
+ } catch {}
33695
+ }
33696
+ __name$1(getInstalledPackageVersion, "getInstalledPackageVersion");
33697
+ function findFileUp(name, startDir, lastDir) {
33698
+ let dir = startDir;
33699
+ const root = path2.parse(dir).root;
33700
+ while (true) {
33701
+ const candidate = path2.join(dir, name);
33702
+ try {
33703
+ if (statSync(candidate).isFile()) return candidate;
33704
+ } catch {}
33705
+ if (lastDir !== void 0 && dir === lastDir) break;
33706
+ const parent = path2.dirname(dir);
33707
+ if (parent === dir || dir === root) break;
33708
+ dir = parent;
33709
+ }
33710
+ }
33711
+ __name$1(findFileUp, "findFileUp");
33661
33712
  var signals = [];
33662
33713
  signals.push("SIGHUP", "SIGINT", "SIGTERM");
33663
33714
  if (process.platform !== "win32") signals.push("SIGALRM", "SIGABRT", "SIGVTALRM", "SIGXCPU", "SIGXFSZ", "SIGUSR2", "SIGTRAP", "SIGSYS", "SIGQUIT", "SIGIOT");