wrangler 4.82.0 → 4.82.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wrangler",
3
- "version": "4.82.0",
3
+ "version": "4.82.1",
4
4
  "description": "Command-line interface for all things Cloudflare Workers",
5
5
  "keywords": [
6
6
  "assembly",
@@ -146,12 +146,12 @@
146
146
  "yargs": "^17.7.2",
147
147
  "@cloudflare/cli": "1.4.0",
148
148
  "@cloudflare/codemod": "1.1.0",
149
- "@cloudflare/containers-shared": "0.13.1",
150
149
  "@cloudflare/pages-shared": "^0.13.124",
151
- "@cloudflare/workers-shared": "0.19.1",
150
+ "@cloudflare/containers-shared": "0.13.1",
151
+ "@cloudflare/workers-tsconfig": "0.0.0",
152
152
  "@cloudflare/workers-utils": "0.16.0",
153
- "@cloudflare/workflows-shared": "0.9.0",
154
- "@cloudflare/workers-tsconfig": "0.0.0"
153
+ "@cloudflare/workers-shared": "0.19.1",
154
+ "@cloudflare/workflows-shared": "0.9.0"
155
155
  },
156
156
  "peerDependencies": {
157
157
  "@cloudflare/workers-types": "^4.20260410.1"
@@ -54545,7 +54545,7 @@ var name, version;
54545
54545
  var init_package = __esm({
54546
54546
  "package.json"() {
54547
54547
  name = "wrangler";
54548
- version = "4.82.0";
54548
+ version = "4.82.1";
54549
54549
  }
54550
54550
  });
54551
54551
  function getWranglerVersion() {
@@ -132473,8 +132473,8 @@ var init_user2 = __esm({
132473
132473
  "pipelines:write": "See and change Cloudflare Pipelines configurations and data",
132474
132474
  "secrets_store:write": "See and change secrets + stores within the Secrets Store",
132475
132475
  "artifacts:write": "See and change Cloudflare Artifacts data such as registries and artifacts",
132476
- "flagship:read": "See Flagship feature flags and apps",
132477
- "flagship:write": "See and change Flagship feature flags and apps",
132476
+ // "flagship:read": "See Flagship feature flags and apps",
132477
+ // "flagship:write": "See and change Flagship feature flags and apps",
132478
132478
  "containers:write": "Manage Workers Containers",
132479
132479
  "cloudchamber:write": "Manage Cloudchamber",
132480
132480
  "connectivity:admin": "See, change, and bind to Connectivity Directory services, including creating services targeting Cloudflare Tunnel.",
@@ -218968,19 +218968,21 @@ var init_tanstack = __esm({
218968
218968
  });
218969
218969
  function addVikePhotonToConfigFile(projectPath) {
218970
218970
  const filePath = getConfigPath(projectPath);
218971
+ let programNode;
218971
218972
  transformFile(filePath, {
218972
218973
  visitProgram(n9) {
218974
+ programNode = n9.node;
218973
218975
  addVikePhotonImportToConfigFile(n9);
218974
218976
  return this.traverse(n9);
218975
218977
  },
218976
218978
  visitExportDefaultDeclaration(n9) {
218977
- addVikePhotonToVikeConfigExportObject(n9);
218979
+ addVikePhotonToVikeConfigExportObject(n9, programNode);
218978
218980
  return this.traverse(n9);
218979
218981
  }
218980
218982
  });
218981
218983
  }
218982
- function addVikePhotonToVikeConfigExportObject(n9) {
218983
- const configObject = getVikeConfigObjectExpression(n9);
218984
+ function addVikePhotonToVikeConfigExportObject(n9, programNode) {
218985
+ const configObject = getVikeConfigObjectExpression(n9, programNode);
218984
218986
  let configTargetProp = configObject.properties.find(
218985
218987
  (prop) => isExtendsProp(prop)
218986
218988
  );
@@ -218992,21 +218994,64 @@ function addVikePhotonToVikeConfigExportObject(n9) {
218992
218994
  configObject.properties.push(configTargetProp);
218993
218995
  }
218994
218996
  assert53__default.default(configTargetProp && t5.ArrayExpression.check(configTargetProp.value));
218997
+ const vikePhotonLocalName = getVikePhotonImportLocalName(programNode) ?? "vikePhoton";
218995
218998
  if (!configTargetProp.value.elements.some(
218996
- (el) => el?.type === "CallExpression" && el.callee.type === "Identifier" && el.callee.name === vikeConfigExtendsPropName
218999
+ (el) => el?.type === "Identifier" && el.name === vikePhotonLocalName
218997
219000
  )) {
218998
- configTargetProp.value.elements.push(b5.identifier("vikePhoton"));
219001
+ configTargetProp.value.elements.push(b5.identifier(vikePhotonLocalName));
218999
219002
  }
219000
219003
  }
219001
- function getVikeConfigObjectExpression(n9) {
219004
+ function getVikePhotonImportLocalName(programNode) {
219005
+ if (!programNode) {
219006
+ return void 0;
219007
+ }
219008
+ for (const stmt of programNode.body) {
219009
+ if (t5.ImportDeclaration.check(stmt) && stmt.source.value === "vike-photon/config") {
219010
+ const defaultSpec = stmt.specifiers?.find(
219011
+ (s7) => t5.ImportDefaultSpecifier.check(s7)
219012
+ );
219013
+ if (defaultSpec && t5.Identifier.check(defaultSpec.local)) {
219014
+ return defaultSpec.local.name;
219015
+ }
219016
+ }
219017
+ }
219018
+ return void 0;
219019
+ }
219020
+ function getVikeConfigObjectExpression(n9, programNode) {
219002
219021
  if (n9.node.declaration.type === "ObjectExpression") {
219003
219022
  return n9.node.declaration;
219004
219023
  }
219005
219024
  if ((n9.node.declaration.type === "TSAsExpression" || n9.node.declaration.type === "TSSatisfiesExpression") && n9.node.declaration.expression.type === "ObjectExpression") {
219006
219025
  return n9.node.declaration.expression;
219007
219026
  }
219027
+ if (n9.node.declaration.type === "Identifier" && programNode) {
219028
+ const objectExpression = resolveIdentifierToObjectExpression(
219029
+ n9.node.declaration.name,
219030
+ programNode
219031
+ );
219032
+ if (objectExpression) {
219033
+ return objectExpression;
219034
+ }
219035
+ }
219008
219036
  throw new Error("Could not determine Vike default object export");
219009
219037
  }
219038
+ function resolveIdentifierToObjectExpression(varName, programNode) {
219039
+ for (const stmt of programNode.body) {
219040
+ if (t5.VariableDeclaration.check(stmt)) {
219041
+ for (const declarator of stmt.declarations) {
219042
+ if (t5.VariableDeclarator.check(declarator) && t5.Identifier.check(declarator.id) && declarator.id.name === varName && declarator.init) {
219043
+ if (t5.ObjectExpression.check(declarator.init)) {
219044
+ return declarator.init;
219045
+ }
219046
+ if ((t5.TSAsExpression.check(declarator.init) || t5.TSSatisfiesExpression.check(declarator.init)) && t5.ObjectExpression.check(declarator.init.expression)) {
219047
+ return declarator.init.expression;
219048
+ }
219049
+ }
219050
+ }
219051
+ }
219052
+ }
219053
+ return void 0;
219054
+ }
219010
219055
  function addVikePhotonImportToConfigFile(n9) {
219011
219056
  const lastImportIndex = n9.node.body.findLastIndex(
219012
219057
  (statement) => statement.type === "ImportDeclaration"
@@ -219101,7 +219146,9 @@ var init_vike = __esm({
219101
219146
  __name(addVikePhotonToConfigFile, "addVikePhotonToConfigFile");
219102
219147
  vikeConfigExtendsPropName = "extends";
219103
219148
  __name(addVikePhotonToVikeConfigExportObject, "addVikePhotonToVikeConfigExportObject");
219149
+ __name(getVikePhotonImportLocalName, "getVikePhotonImportLocalName");
219104
219150
  __name(getVikeConfigObjectExpression, "getVikeConfigObjectExpression");
219151
+ __name(resolveIdentifierToObjectExpression, "resolveIdentifierToObjectExpression");
219105
219152
  __name(addVikePhotonImportToConfigFile, "addVikePhotonImportToConfigFile");
219106
219153
  __name(getConfigPath, "getConfigPath");
219107
219154
  __name(isExtendsProp, "isExtendsProp");