Skip to content

Commit 7199092

Browse files
authored
Merge branch 'cloudflare:main' into main
2 parents 050a177 + ee4873c commit 7199092

34 files changed

+858
-597
lines changed

.changeset/cuddly-jeans-check.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/eighty-panthers-rule.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@cloudflare/workers-shared": patch
3+
---
4+
5+
Adds a RewriteFrames integration for workers-shared Sentry source-mappings.

.changeset/fifty-hairs-drum.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/gold-frogs-rest.md

Lines changed: 0 additions & 29 deletions
This file was deleted.

.changeset/lucky-humans-glow.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@cloudflare/workers-shared": patch
3+
---
4+
5+
Change asset-worker and router-worker analytics to using version tag rather than version UUID.

.changeset/modern-cycles-build.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"@cloudflare/vite-plugin": patch
3+
---
4+
5+
Call `writeDeployConfig` in `writeBundle` rather than `builder.buildApp`.
6+
7+
The deploy config file is now written in the `writeBundle` hook rather than `builder.buildApp`. This ensures that the file is still written if other plugins override `builder` in the Vite config.

.changeset/orange-rockets-leave.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@cloudflare/workers-shared": patch
3+
---
4+
5+
fix: Handles a divide by zero error that could occur when searching large manifests

.changeset/wicked-pets-jump.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"wrangler": patch
3+
---
4+
5+
fix: respect `WRANGLER_LOG` in `wrangler dev`
6+
7+
Previously, `--log-level=debug` was the only way to see debug logs in `wrangler dev`, which was unlike all other commands.

.github/ISSUE_TEMPLATE/bug-template.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ body:
2929
- Miniflare
3030
- KV Asset Handler
3131
- Workers Vitest Integration
32+
- Vite Plugin
3233
- Other
3334
validations:
3435
required: true

packages/vite-plugin-cloudflare/src/deploy-config.ts

Lines changed: 29 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -67,42 +67,40 @@ export function writeDeployConfig(
6767

6868
fs.writeFileSync(deployConfigPath, JSON.stringify(deployConfig));
6969
} else {
70-
const workerConfigPaths = Object.fromEntries(
71-
Object.keys(resolvedPluginConfig.workers).map((environmentName) => {
72-
const outputDirectory =
73-
resolvedViteConfig.environments[environmentName]?.build.outDir;
74-
75-
assert(
76-
outputDirectory,
77-
`Unexpected error: ${environmentName} environment output directory is undefined`
78-
);
79-
80-
return [
81-
environmentName,
82-
getRelativePathToWorkerConfig(
83-
deployConfigDirectory,
84-
resolvedViteConfig.root,
85-
outputDirectory
86-
),
87-
];
88-
})
89-
);
70+
let entryWorkerConfigPath: string | undefined;
71+
const auxiliaryWorkers: DeployConfig["auxiliaryWorkers"] = [];
72+
73+
for (const environmentName of Object.keys(resolvedPluginConfig.workers)) {
74+
const outputDirectory =
75+
resolvedViteConfig.environments[environmentName]?.build.outDir;
76+
77+
assert(
78+
outputDirectory,
79+
`Unexpected error: ${environmentName} environment output directory is undefined`
80+
);
9081

91-
const { entryWorkerEnvironmentName } = resolvedPluginConfig;
92-
const configPath = workerConfigPaths[entryWorkerEnvironmentName];
82+
const configPath = getRelativePathToWorkerConfig(
83+
deployConfigDirectory,
84+
resolvedViteConfig.root,
85+
outputDirectory
86+
);
87+
88+
if (environmentName === resolvedPluginConfig.entryWorkerEnvironmentName) {
89+
entryWorkerConfigPath = configPath;
90+
} else {
91+
auxiliaryWorkers.push({ configPath });
92+
}
93+
}
9394

9495
assert(
95-
configPath,
96-
`Unexpected error: ${entryWorkerEnvironmentName} environment output directory is undefined`
96+
entryWorkerConfigPath,
97+
`Unexpected error: entryWorkerConfigPath is undefined`
9798
);
9899

99-
const auxiliaryWorkers = Object.entries(workerConfigPaths)
100-
.filter(
101-
([environmentName]) => environmentName !== entryWorkerEnvironmentName
102-
)
103-
.map(([_, configPath]) => ({ configPath }));
104-
105-
const deployConfig: DeployConfig = { configPath, auxiliaryWorkers };
100+
const deployConfig: DeployConfig = {
101+
configPath: entryWorkerConfigPath,
102+
auxiliaryWorkers,
103+
};
106104

107105
fs.writeFileSync(deployConfigPath, JSON.stringify(deployConfig));
108106
}

0 commit comments

Comments
 (0)