@cloudflare/vite-plugin 1.35.0 → 1.36.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 +34 -3
- package/dist/index.mjs.map +1 -1
- package/dist/{package-D0px1l44.mjs → package-CY9M77Eh.mjs} +2 -2
- package/dist/{package-D0px1l44.mjs.map → package-CY9M77Eh.mjs.map} +1 -1
- package/dist/workers/asset-worker/index.js +16 -5
- package/dist/workers/runner-worker/index.js +5 -4
- package/package.json +8 -8
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
//#region package.json
|
|
2
2
|
var package_default = {
|
|
3
3
|
name: "@cloudflare/vite-plugin",
|
|
4
|
-
version: "1.
|
|
4
|
+
version: "1.36.0",
|
|
5
5
|
description: "Cloudflare plugin for Vite",
|
|
6
6
|
keywords: [
|
|
7
7
|
"cloudflare",
|
|
@@ -79,4 +79,4 @@ var package_default = {
|
|
|
79
79
|
|
|
80
80
|
//#endregion
|
|
81
81
|
export { package_default as default };
|
|
82
|
-
//# sourceMappingURL=package-
|
|
82
|
+
//# sourceMappingURL=package-CY9M77Eh.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package-
|
|
1
|
+
{"version":3,"file":"package-CY9M77Eh.mjs","names":[],"sources":["../package.json"],"sourcesContent":["{\n\t\"name\": \"@cloudflare/vite-plugin\",\n\t\"version\": \"1.36.0\",\n\t\"description\": \"Cloudflare plugin for Vite\",\n\t\"keywords\": [\n\t\t\"cloudflare\",\n\t\t\"cloudflare-workers\",\n\t\t\"vite\",\n\t\t\"vite-plugin\",\n\t\t\"workers\"\n\t],\n\t\"homepage\": \"https://github.com/cloudflare/workers-sdk/tree/main/packages/vite-plugin-cloudflare#readme\",\n\t\"bugs\": {\n\t\t\"url\": \"https://github.com/cloudflare/workers-sdk/issues\"\n\t},\n\t\"license\": \"MIT\",\n\t\"repository\": {\n\t\t\"type\": \"git\",\n\t\t\"url\": \"https://github.com/cloudflare/workers-sdk.git\",\n\t\t\"directory\": \"packages/vite-plugin-cloudflare\"\n\t},\n\t\"files\": [\n\t\t\"dist\"\n\t],\n\t\"type\": \"module\",\n\t\"sideEffects\": false,\n\t\"main\": \"./dist/index.mjs\",\n\t\"types\": \"./dist/index.d.mts\",\n\t\"exports\": {\n\t\t\".\": {\n\t\t\t\"types\": \"./dist/index.d.mts\",\n\t\t\t\"import\": \"./dist/index.mjs\"\n\t\t}\n\t},\n\t\"publishConfig\": {\n\t\t\"access\": \"public\"\n\t},\n\t\"scripts\": {\n\t\t\"build\": \"tsdown\",\n\t\t\"check:type\": \"tsc --build\",\n\t\t\"dev\": \"tsdown --watch\",\n\t\t\"test\": \"vitest run\",\n\t\t\"test:ci\": \"pnpm test\",\n\t\t\"test:e2e\": \"vitest run -c e2e/vitest.config.ts\",\n\t\t\"test:watch\": \"vitest\"\n\t},\n\t\"dependencies\": {\n\t\t\"@cloudflare/unenv-preset\": \"workspace:*\",\n\t\t\"miniflare\": \"workspace:*\",\n\t\t\"unenv\": \"2.0.0-rc.24\",\n\t\t\"wrangler\": \"workspace:*\",\n\t\t\"ws\": \"catalog:default\"\n\t},\n\t\"devDependencies\": {\n\t\t\"@cloudflare/containers-shared\": \"workspace:*\",\n\t\t\"@cloudflare/mock-npm-registry\": \"workspace:*\",\n\t\t\"@cloudflare/workers-shared\": \"workspace:*\",\n\t\t\"@cloudflare/workers-tsconfig\": \"workspace:*\",\n\t\t\"@cloudflare/workers-types\": \"catalog:default\",\n\t\t\"@cloudflare/workers-utils\": \"workspace:*\",\n\t\t\"@remix-run/node-fetch-server\": \"^0.8.0\",\n\t\t\"@types/node\": \"catalog:default\",\n\t\t\"@types/semver\": \"^7.5.1\",\n\t\t\"@types/ws\": \"^8.5.13\",\n\t\t\"defu\": \"^6.1.4\",\n\t\t\"get-port\": \"^7.1.0\",\n\t\t\"magic-string\": \"^0.30.12\",\n\t\t\"mlly\": \"^1.7.4\",\n\t\t\"open\": \"catalog:default\",\n\t\t\"picocolors\": \"^1.1.1\",\n\t\t\"semver\": \"^7.7.1\",\n\t\t\"tinyglobby\": \"catalog:default\",\n\t\t\"tree-kill\": \"catalog:default\",\n\t\t\"tsdown\": \"0.16.3\",\n\t\t\"typescript\": \"catalog:default\",\n\t\t\"vite\": \"catalog:default\",\n\t\t\"vite-legacy\": \"npm:vite@7.1.12\",\n\t\t\"vitest\": \"catalog:default\"\n\t},\n\t\"peerDependencies\": {\n\t\t\"vite\": \"^6.1.0 || ^7.0.0 || ^8.0.0\",\n\t\t\"wrangler\": \"workspace:^\"\n\t},\n\t\"workers-sdk\": {\n\t\t\"prerelease\": true\n\t}\n}\n"],"mappings":";sBAAA;OACS;UACG;cACI;WACH;EACX;EACA;EACA;EACA;EACA;EACA;WACW;OACJ,EACP,OAAO,oDACP;UACU;aACG;EACb,QAAQ;EACR,OAAO;EACP,aAAa;EACb;QACQ,CACR,OACA;OACO;cACO;OACP;QACC;UACE,EACV,KAAK;EACJ,SAAS;EACT,UAAU;EACV,EACD;gBACgB,EAChB,UAAU,UACV;UACU;EACV,SAAS;EACT,cAAc;EACd,OAAO;EACP,QAAQ;EACR,WAAW;EACX,YAAY;EACZ,cAAc;EACd;eACe;EACf,4BAA4B;EAC5B,aAAa;EACb,SAAS;EACT,YAAY;EACZ,MAAM;EACN;kBACkB;EAClB,iCAAiC;EACjC,iCAAiC;EACjC,8BAA8B;EAC9B,gCAAgC;EAChC,6BAA6B;EAC7B,6BAA6B;EAC7B,gCAAgC;EAChC,eAAe;EACf,iBAAiB;EACjB,aAAa;EACb,QAAQ;EACR,YAAY;EACZ,gBAAgB;EAChB,QAAQ;EACR,QAAQ;EACR,cAAc;EACd,UAAU;EACV,cAAc;EACd,aAAa;EACb,UAAU;EACV,cAAc;EACd,QAAQ;EACR,eAAe;EACf,UAAU;EACV;mBACmB;EACnB,QAAQ;EACR,YAAY;EACZ;CACD,eAAe,EACd,cAAc,MACd;CACD"}
|
|
@@ -4652,6 +4652,11 @@ function mockJaegerBinding() {
|
|
|
4652
4652
|
//#endregion
|
|
4653
4653
|
//#region ../workers-shared/asset-worker/src/analytics.ts
|
|
4654
4654
|
const VERSION$1 = 1;
|
|
4655
|
+
let EntrypointType = /* @__PURE__ */ function(EntrypointType$1) {
|
|
4656
|
+
EntrypointType$1[EntrypointType$1["Outer"] = 0] = "Outer";
|
|
4657
|
+
EntrypointType$1[EntrypointType$1["Inner"] = 1] = "Inner";
|
|
4658
|
+
return EntrypointType$1;
|
|
4659
|
+
}({});
|
|
4655
4660
|
const COMPATIBILITY_FLAG_MASKS = { assets_navigation_prefers_asset_serving: 1 };
|
|
4656
4661
|
var Analytics = class {
|
|
4657
4662
|
data = {};
|
|
@@ -4685,7 +4690,8 @@ var Analytics = class {
|
|
|
4685
4690
|
this.data.metalId ?? -1,
|
|
4686
4691
|
this.data.coloTier ?? -1,
|
|
4687
4692
|
this.data.status ?? -1,
|
|
4688
|
-
compatibilityFlagsBitmask
|
|
4693
|
+
compatibilityFlagsBitmask,
|
|
4694
|
+
this.data.entrypoint ?? -1
|
|
4689
4695
|
],
|
|
4690
4696
|
blobs: [
|
|
4691
4697
|
this.data.hostname?.substring(0, 256),
|
|
@@ -4695,7 +4701,8 @@ var Analytics = class {
|
|
|
4695
4701
|
this.data.error?.substring(0, 256),
|
|
4696
4702
|
this.data.version,
|
|
4697
4703
|
this.data.coloRegion,
|
|
4698
|
-
this.data.cacheStatus
|
|
4704
|
+
this.data.cacheStatus,
|
|
4705
|
+
this.data.cohort
|
|
4699
4706
|
]
|
|
4700
4707
|
});
|
|
4701
4708
|
}
|
|
@@ -4782,6 +4789,7 @@ function comparePathHashWithEntry(searchValue, manifest, entryIndex) {
|
|
|
4782
4789
|
for (let offset = 0; offset < PATH_HASH_SIZE; offset++, pathHashOffset++) {
|
|
4783
4790
|
const s = searchValue[offset];
|
|
4784
4791
|
const e = manifest[pathHashOffset];
|
|
4792
|
+
if (s === void 0 || e === void 0) throw new TypeError(`Unexpected undefined value at offset ${offset} during path hash comparison`);
|
|
4785
4793
|
if (s < e) return -1;
|
|
4786
4794
|
if (s > e) return 1;
|
|
4787
4795
|
}
|
|
@@ -5664,7 +5672,7 @@ async function unstableGetByPathnameImpl(env, exists, getByETag, pathname, reque
|
|
|
5664
5672
|
return getByETag(eTag, request);
|
|
5665
5673
|
});
|
|
5666
5674
|
}
|
|
5667
|
-
async function runFetchRequest(request, env, ctx, exists, getByETag) {
|
|
5675
|
+
async function runFetchRequest(request, env, ctx, exists, getByETag, cohort) {
|
|
5668
5676
|
let sentry;
|
|
5669
5677
|
const analytics = new Analytics(env.ANALYTICS);
|
|
5670
5678
|
const performance = new PerformanceTimer(env.UNSAFE_PERFORMANCE);
|
|
@@ -5692,7 +5700,9 @@ async function runFetchRequest(request, env, ctx, exists, getByETag) {
|
|
|
5692
5700
|
htmlHandling: config.html_handling,
|
|
5693
5701
|
notFoundHandling: config.not_found_handling,
|
|
5694
5702
|
compatibilityFlags: config.compatibility_flags,
|
|
5695
|
-
userAgent
|
|
5703
|
+
userAgent,
|
|
5704
|
+
entrypoint: EntrypointType.Inner,
|
|
5705
|
+
cohort: cohort ?? "unknown"
|
|
5696
5706
|
});
|
|
5697
5707
|
return await env.JAEGER.enterSpan("handleRequest", async (span) => {
|
|
5698
5708
|
span.setTags({
|
|
@@ -5715,7 +5725,8 @@ var AssetWorkerInner = class extends WorkerEntrypoint {
|
|
|
5715
5725
|
async fetch(request) {
|
|
5716
5726
|
this.env.JAEGER ??= mockJaegerBinding();
|
|
5717
5727
|
const traceContext = this.ctx.props?.traceContext ?? null;
|
|
5718
|
-
const
|
|
5728
|
+
const cohort = this.ctx.version?.cohort;
|
|
5729
|
+
const response = await this.env.JAEGER.runWithSpanContext(traceContext, () => runFetchRequest(request, this.env, this.ctx, this.unstable_exists.bind(this), this.unstable_getByETag.bind(this), cohort));
|
|
5719
5730
|
if (response instanceof Response) return response;
|
|
5720
5731
|
throw new Error("AssetWorkerInner fetch returned non-Response value.");
|
|
5721
5732
|
}
|
|
@@ -32,11 +32,12 @@ function stripInternalEnv(internalEnv) {
|
|
|
32
32
|
* Copied from `packages/wrangler/templates/middleware/middleware-miniflare3-json-error.ts`
|
|
33
33
|
*/
|
|
34
34
|
function reduceError(e) {
|
|
35
|
+
const errorObj = e ?? {};
|
|
35
36
|
return {
|
|
36
|
-
name:
|
|
37
|
-
message:
|
|
38
|
-
stack:
|
|
39
|
-
cause:
|
|
37
|
+
name: errorObj.name,
|
|
38
|
+
message: errorObj.message ?? String(e),
|
|
39
|
+
stack: errorObj.stack,
|
|
40
|
+
cause: errorObj.cause === void 0 ? void 0 : reduceError(errorObj.cause)
|
|
40
41
|
};
|
|
41
42
|
}
|
|
42
43
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudflare/vite-plugin",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.36.0",
|
|
4
4
|
"description": "Cloudflare plugin for Vite",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cloudflare",
|
|
@@ -39,11 +39,11 @@
|
|
|
39
39
|
"unenv": "2.0.0-rc.24",
|
|
40
40
|
"ws": "8.18.0",
|
|
41
41
|
"@cloudflare/unenv-preset": "2.16.1",
|
|
42
|
-
"miniflare": "4.
|
|
43
|
-
"wrangler": "4.
|
|
42
|
+
"miniflare": "4.20260504.0",
|
|
43
|
+
"wrangler": "4.88.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@cloudflare/workers-types": "^4.
|
|
46
|
+
"@cloudflare/workers-types": "^4.20260504.1",
|
|
47
47
|
"@remix-run/node-fetch-server": "^0.8.0",
|
|
48
48
|
"@types/node": "^22.10.1",
|
|
49
49
|
"@types/semver": "^7.5.1",
|
|
@@ -63,14 +63,14 @@
|
|
|
63
63
|
"vite-legacy": "npm:vite@7.1.12",
|
|
64
64
|
"vitest": "4.1.0",
|
|
65
65
|
"@cloudflare/containers-shared": "0.14.1",
|
|
66
|
+
"@cloudflare/workers-shared": "0.19.5",
|
|
66
67
|
"@cloudflare/mock-npm-registry": "0.0.0",
|
|
67
|
-
"@cloudflare/workers-
|
|
68
|
-
"@cloudflare/workers-tsconfig": "0.0.0"
|
|
69
|
-
"@cloudflare/workers-utils": "0.18.0"
|
|
68
|
+
"@cloudflare/workers-utils": "0.19.0",
|
|
69
|
+
"@cloudflare/workers-tsconfig": "0.0.0"
|
|
70
70
|
},
|
|
71
71
|
"peerDependencies": {
|
|
72
72
|
"vite": "^6.1.0 || ^7.0.0 || ^8.0.0",
|
|
73
|
-
"wrangler": "^4.
|
|
73
|
+
"wrangler": "^4.88.0"
|
|
74
74
|
},
|
|
75
75
|
"workers-sdk": {
|
|
76
76
|
"prerelease": true
|