@cloudflare/vite-plugin 1.13.11 → 1.13.13
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.js +22 -51
- package/dist/index.js.map +1 -1
- package/dist/workers/asset-worker.js +20 -43
- package/dist/workers/router-worker.js +19 -41
- package/dist/workers/runner-worker.js +9 -13
- package/package.json +6 -6
|
@@ -1020,8 +1020,7 @@ function visit(key, value, depth = Infinity, maxProperties = Infinity, memo = me
|
|
|
1020
1020
|
if (memoize(value)) return "[Circular ~]";
|
|
1021
1021
|
const valueWithToJSON = value;
|
|
1022
1022
|
if (valueWithToJSON && typeof valueWithToJSON.toJSON === "function") try {
|
|
1023
|
-
|
|
1024
|
-
return visit("", jsonValue, remainingDepth - 1, maxProperties, memo);
|
|
1023
|
+
return visit("", valueWithToJSON.toJSON(), remainingDepth - 1, maxProperties, memo);
|
|
1025
1024
|
} catch (err) {}
|
|
1026
1025
|
const normalized = Array.isArray(value) ? [] : {};
|
|
1027
1026
|
let numAdded = 0;
|
|
@@ -2398,8 +2397,7 @@ var AsyncContextStack = class {
|
|
|
2398
2397
|
* This will be removed during the v8 cycle and is only here to make migration easier.
|
|
2399
2398
|
*/
|
|
2400
2399
|
function getAsyncContextStack() {
|
|
2401
|
-
const
|
|
2402
|
-
const sentry = getSentryCarrier(registry);
|
|
2400
|
+
const sentry = getSentryCarrier(getMainCarrier());
|
|
2403
2401
|
return sentry.stack = sentry.stack || new AsyncContextStack(getDefaultCurrentScope(), getDefaultIsolationScope());
|
|
2404
2402
|
}
|
|
2405
2403
|
function withScope(callback) {
|
|
@@ -2451,16 +2449,14 @@ function getAsyncContextStrategy(carrier) {
|
|
|
2451
2449
|
* Get the currently active scope.
|
|
2452
2450
|
*/
|
|
2453
2451
|
function getCurrentScope() {
|
|
2454
|
-
|
|
2455
|
-
return getAsyncContextStrategy(carrier).getCurrentScope();
|
|
2452
|
+
return getAsyncContextStrategy(getMainCarrier()).getCurrentScope();
|
|
2456
2453
|
}
|
|
2457
2454
|
/**
|
|
2458
2455
|
* Get the currently active isolation scope.
|
|
2459
2456
|
* The isolation scope is active for the current exection context.
|
|
2460
2457
|
*/
|
|
2461
2458
|
function getIsolationScope() {
|
|
2462
|
-
|
|
2463
|
-
return getAsyncContextStrategy(carrier).getIsolationScope();
|
|
2459
|
+
return getAsyncContextStrategy(getMainCarrier()).getIsolationScope();
|
|
2464
2460
|
}
|
|
2465
2461
|
/**
|
|
2466
2462
|
* Get the global scope.
|
|
@@ -2624,8 +2620,7 @@ function getRootSpan(span) {
|
|
|
2624
2620
|
* Returns the currently active span.
|
|
2625
2621
|
*/
|
|
2626
2622
|
function getActiveSpan() {
|
|
2627
|
-
const
|
|
2628
|
-
const acs = getAsyncContextStrategy(carrier);
|
|
2623
|
+
const acs = getAsyncContextStrategy(getMainCarrier());
|
|
2629
2624
|
if (acs.getActiveSpan) return acs.getActiveSpan();
|
|
2630
2625
|
return _getSpanForScope(getCurrentScope());
|
|
2631
2626
|
}
|
|
@@ -2750,13 +2745,11 @@ function enhanceEventWithSdkInfo(event, sdkInfo) {
|
|
|
2750
2745
|
/** Creates an envelope from a Session */
|
|
2751
2746
|
function createSessionEnvelope(session, dsn, metadata, tunnel) {
|
|
2752
2747
|
const sdkInfo = getSdkMetadataForEnvelopeHeader(metadata);
|
|
2753
|
-
|
|
2748
|
+
return createEnvelope({
|
|
2754
2749
|
sent_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
2755
2750
|
...sdkInfo && { sdk: sdkInfo },
|
|
2756
2751
|
...!!tunnel && dsn && { dsn: dsnToString(dsn) }
|
|
2757
|
-
};
|
|
2758
|
-
const envelopeItem = "aggregates" in session ? [{ type: "sessions" }, session] : [{ type: "session" }, session.toJSON()];
|
|
2759
|
-
return createEnvelope(envelopeHeaders, [envelopeItem]);
|
|
2752
|
+
}, ["aggregates" in session ? [{ type: "sessions" }, session] : [{ type: "session" }, session.toJSON()]]);
|
|
2760
2753
|
}
|
|
2761
2754
|
/**
|
|
2762
2755
|
* Create an Envelope from an event.
|
|
@@ -2875,8 +2868,7 @@ function applySpanToEvent(event, span) {
|
|
|
2875
2868
|
dynamicSamplingContext: getDynamicSamplingContextFromSpan(span),
|
|
2876
2869
|
...event.sdkProcessingMetadata
|
|
2877
2870
|
};
|
|
2878
|
-
const
|
|
2879
|
-
const transactionName = spanToJSON(rootSpan).description;
|
|
2871
|
+
const transactionName = spanToJSON(getRootSpan(span)).description;
|
|
2880
2872
|
if (transactionName && !event.transaction && event.type === "transaction") event.transaction = transactionName;
|
|
2881
2873
|
}
|
|
2882
2874
|
/**
|
|
@@ -2926,19 +2918,12 @@ function prepareEvent(options, event, hint, scope, client, isolationScope) {
|
|
|
2926
2918
|
if (hint.mechanism) addExceptionMechanism(prepared, hint.mechanism);
|
|
2927
2919
|
const clientEventProcessors = client ? client.getEventProcessors() : [];
|
|
2928
2920
|
const data = getGlobalScope().getScopeData();
|
|
2929
|
-
if (isolationScope)
|
|
2930
|
-
|
|
2931
|
-
mergeScopeData(data, isolationData);
|
|
2932
|
-
}
|
|
2933
|
-
if (finalScope) {
|
|
2934
|
-
const finalScopeData = finalScope.getScopeData();
|
|
2935
|
-
mergeScopeData(data, finalScopeData);
|
|
2936
|
-
}
|
|
2921
|
+
if (isolationScope) mergeScopeData(data, isolationScope.getScopeData());
|
|
2922
|
+
if (finalScope) mergeScopeData(data, finalScope.getScopeData());
|
|
2937
2923
|
const attachments = [...hint.attachments || [], ...data.attachments];
|
|
2938
2924
|
if (attachments.length) hint.attachments = attachments;
|
|
2939
2925
|
applyScopeDataToEvent(prepared, data);
|
|
2940
|
-
|
|
2941
|
-
return notifyEventProcessors(eventProcessors, prepared, hint).then((evt) => {
|
|
2926
|
+
return notifyEventProcessors([...clientEventProcessors, ...data.eventProcessors], prepared, hint).then((evt) => {
|
|
2942
2927
|
if (evt) applyDebugMeta(evt);
|
|
2943
2928
|
if (typeof normalizeDepth === "number" && normalizeDepth > 0) return normalizeEvent(evt, normalizeDepth, normalizeMaxBreadth);
|
|
2944
2929
|
return evt;
|
|
@@ -3106,11 +3091,10 @@ var SessionFlusher = class {
|
|
|
3106
3091
|
const aggregates = Object.keys(this._pendingAggregates).map((key) => {
|
|
3107
3092
|
return this._pendingAggregates[parseInt(key)];
|
|
3108
3093
|
});
|
|
3109
|
-
|
|
3094
|
+
return dropUndefinedKeys({
|
|
3110
3095
|
attrs: this._sessionAttrs,
|
|
3111
3096
|
aggregates
|
|
3112
|
-
};
|
|
3113
|
-
return dropUndefinedKeys(sessionAggregates);
|
|
3097
|
+
});
|
|
3114
3098
|
}
|
|
3115
3099
|
/** JSDoc */
|
|
3116
3100
|
close() {
|
|
@@ -3680,8 +3664,7 @@ var BaseClient = class {
|
|
|
3680
3664
|
throw new SentryError("An event processor returned `null`, will not send event.", "log");
|
|
3681
3665
|
}
|
|
3682
3666
|
if (hint.data && hint.data.__sentry__ === true) return prepared;
|
|
3683
|
-
|
|
3684
|
-
return _validateBeforeSendResult(result, beforeSendLabel);
|
|
3667
|
+
return _validateBeforeSendResult(processBeforeSend(options, prepared, hint), beforeSendLabel);
|
|
3685
3668
|
}).then((processedEvent) => {
|
|
3686
3669
|
if (processedEvent === null) {
|
|
3687
3670
|
this.recordDroppedEvent("before_send", dataCategory, event);
|
|
@@ -3790,8 +3773,7 @@ function createCheckInEnvelope(checkIn, dynamicSamplingContext, metadata, tunnel
|
|
|
3790
3773
|
};
|
|
3791
3774
|
if (!!tunnel && !!dsn) headers.dsn = dsnToString(dsn);
|
|
3792
3775
|
if (dynamicSamplingContext) headers.trace = dropUndefinedKeys(dynamicSamplingContext);
|
|
3793
|
-
|
|
3794
|
-
return createEnvelope(headers, [item]);
|
|
3776
|
+
return createEnvelope(headers, [createCheckInEnvelopeItem(checkIn)]);
|
|
3795
3777
|
}
|
|
3796
3778
|
function createCheckInEnvelopeItem(checkIn) {
|
|
3797
3779
|
return [{ type: "check_in" }, checkIn];
|
|
@@ -4056,8 +4038,7 @@ function generateIteratee({ isBrowser, root, prefix }) {
|
|
|
4056
4038
|
}
|
|
4057
4039
|
} else if (isWindowsFrame || startsWithSlash) {
|
|
4058
4040
|
const filename = isWindowsFrame ? frame.filename.replace(/^[a-zA-Z]:/, "").replace(/\\/g, "/") : frame.filename;
|
|
4059
|
-
|
|
4060
|
-
frame.filename = `${prefix}${base}`;
|
|
4041
|
+
frame.filename = `${prefix}${root ? relative(root, filename) : basename(filename)}`;
|
|
4061
4042
|
}
|
|
4062
4043
|
return frame;
|
|
4063
4044
|
};
|
|
@@ -4589,8 +4570,7 @@ var Toucan = class Toucan extends Scope {
|
|
|
4589
4570
|
* finishes or throws.
|
|
4590
4571
|
*/
|
|
4591
4572
|
withScope(callback) {
|
|
4592
|
-
|
|
4593
|
-
return callback(toucan);
|
|
4573
|
+
return callback(this.clone());
|
|
4594
4574
|
}
|
|
4595
4575
|
};
|
|
4596
4576
|
|
|
@@ -5049,10 +5029,9 @@ const generateRulesMatcher = (rules, replacerFn = (match) => match) => {
|
|
|
5049
5029
|
const compiledRules = Object.entries(rules).map(([rule, match]) => {
|
|
5050
5030
|
const crossHost = rule.startsWith("https://");
|
|
5051
5031
|
try {
|
|
5052
|
-
const regExp = generateRuleRegExp(rule);
|
|
5053
5032
|
return [{
|
|
5054
5033
|
crossHost,
|
|
5055
|
-
regExp
|
|
5034
|
+
regExp: generateRuleRegExp(rule)
|
|
5056
5035
|
}, match];
|
|
5057
5036
|
} catch {}
|
|
5058
5037
|
}).filter((value) => value !== void 0);
|
|
@@ -5168,8 +5147,7 @@ const getResponseOrAssetIntent = async (request, env, configuration, exists) =>
|
|
|
5168
5147
|
});
|
|
5169
5148
|
return new MethodNotAllowedResponse();
|
|
5170
5149
|
});
|
|
5171
|
-
const
|
|
5172
|
-
const encodedDestination = encodePath(decodedDestination);
|
|
5150
|
+
const encodedDestination = encodePath(intent.redirect ?? decodedPathname);
|
|
5173
5151
|
/**
|
|
5174
5152
|
* The canonical path we serve an asset at is the decoded and re-encoded version.
|
|
5175
5153
|
* Thus we need to redirect if that is different from the decoded version.
|
|
@@ -5241,8 +5219,7 @@ const canFetch = async (request, env, configuration, exists) => {
|
|
|
5241
5219
|
};
|
|
5242
5220
|
const handleRequest = async (request, env, configuration, exists, getByETag, analytics) => {
|
|
5243
5221
|
const responseOrAssetIntent = await getResponseOrAssetIntent(request, env, configuration, exists);
|
|
5244
|
-
|
|
5245
|
-
return attachCustomHeaders(request, response, configuration, env);
|
|
5222
|
+
return attachCustomHeaders(request, responseOrAssetIntent instanceof Response ? responseOrAssetIntent : await resolveAssetIntentToResponse(responseOrAssetIntent, request, env, configuration, getByETag, analytics), configuration, env);
|
|
5246
5223
|
};
|
|
5247
5224
|
const getIntent = async (pathname, request, configuration, exists, skipRedirects = false) => {
|
|
5248
5225
|
switch (configuration.html_handling) {
|
|
@@ -1068,8 +1068,7 @@ function visit(key, value, depth = Infinity, maxProperties = Infinity, memo = me
|
|
|
1068
1068
|
if (memoize(value)) return "[Circular ~]";
|
|
1069
1069
|
const valueWithToJSON = value;
|
|
1070
1070
|
if (valueWithToJSON && typeof valueWithToJSON.toJSON === "function") try {
|
|
1071
|
-
|
|
1072
|
-
return visit("", jsonValue, remainingDepth - 1, maxProperties, memo);
|
|
1071
|
+
return visit("", valueWithToJSON.toJSON(), remainingDepth - 1, maxProperties, memo);
|
|
1073
1072
|
} catch (err) {}
|
|
1074
1073
|
const normalized = Array.isArray(value) ? [] : {};
|
|
1075
1074
|
let numAdded = 0;
|
|
@@ -2446,8 +2445,7 @@ var AsyncContextStack = class {
|
|
|
2446
2445
|
* This will be removed during the v8 cycle and is only here to make migration easier.
|
|
2447
2446
|
*/
|
|
2448
2447
|
function getAsyncContextStack() {
|
|
2449
|
-
const
|
|
2450
|
-
const sentry = getSentryCarrier(registry);
|
|
2448
|
+
const sentry = getSentryCarrier(getMainCarrier());
|
|
2451
2449
|
return sentry.stack = sentry.stack || new AsyncContextStack(getDefaultCurrentScope(), getDefaultIsolationScope());
|
|
2452
2450
|
}
|
|
2453
2451
|
function withScope(callback) {
|
|
@@ -2499,16 +2497,14 @@ function getAsyncContextStrategy(carrier) {
|
|
|
2499
2497
|
* Get the currently active scope.
|
|
2500
2498
|
*/
|
|
2501
2499
|
function getCurrentScope() {
|
|
2502
|
-
|
|
2503
|
-
return getAsyncContextStrategy(carrier).getCurrentScope();
|
|
2500
|
+
return getAsyncContextStrategy(getMainCarrier()).getCurrentScope();
|
|
2504
2501
|
}
|
|
2505
2502
|
/**
|
|
2506
2503
|
* Get the currently active isolation scope.
|
|
2507
2504
|
* The isolation scope is active for the current exection context.
|
|
2508
2505
|
*/
|
|
2509
2506
|
function getIsolationScope() {
|
|
2510
|
-
|
|
2511
|
-
return getAsyncContextStrategy(carrier).getIsolationScope();
|
|
2507
|
+
return getAsyncContextStrategy(getMainCarrier()).getIsolationScope();
|
|
2512
2508
|
}
|
|
2513
2509
|
/**
|
|
2514
2510
|
* Get the global scope.
|
|
@@ -2672,8 +2668,7 @@ function getRootSpan(span) {
|
|
|
2672
2668
|
* Returns the currently active span.
|
|
2673
2669
|
*/
|
|
2674
2670
|
function getActiveSpan() {
|
|
2675
|
-
const
|
|
2676
|
-
const acs = getAsyncContextStrategy(carrier);
|
|
2671
|
+
const acs = getAsyncContextStrategy(getMainCarrier());
|
|
2677
2672
|
if (acs.getActiveSpan) return acs.getActiveSpan();
|
|
2678
2673
|
return _getSpanForScope(getCurrentScope());
|
|
2679
2674
|
}
|
|
@@ -2798,13 +2793,11 @@ function enhanceEventWithSdkInfo(event, sdkInfo) {
|
|
|
2798
2793
|
/** Creates an envelope from a Session */
|
|
2799
2794
|
function createSessionEnvelope(session, dsn, metadata, tunnel) {
|
|
2800
2795
|
const sdkInfo = getSdkMetadataForEnvelopeHeader(metadata);
|
|
2801
|
-
|
|
2796
|
+
return createEnvelope({
|
|
2802
2797
|
sent_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
2803
2798
|
...sdkInfo && { sdk: sdkInfo },
|
|
2804
2799
|
...!!tunnel && dsn && { dsn: dsnToString(dsn) }
|
|
2805
|
-
};
|
|
2806
|
-
const envelopeItem = "aggregates" in session ? [{ type: "sessions" }, session] : [{ type: "session" }, session.toJSON()];
|
|
2807
|
-
return createEnvelope(envelopeHeaders, [envelopeItem]);
|
|
2800
|
+
}, ["aggregates" in session ? [{ type: "sessions" }, session] : [{ type: "session" }, session.toJSON()]]);
|
|
2808
2801
|
}
|
|
2809
2802
|
/**
|
|
2810
2803
|
* Create an Envelope from an event.
|
|
@@ -2923,8 +2916,7 @@ function applySpanToEvent(event, span) {
|
|
|
2923
2916
|
dynamicSamplingContext: getDynamicSamplingContextFromSpan(span),
|
|
2924
2917
|
...event.sdkProcessingMetadata
|
|
2925
2918
|
};
|
|
2926
|
-
const
|
|
2927
|
-
const transactionName = spanToJSON(rootSpan).description;
|
|
2919
|
+
const transactionName = spanToJSON(getRootSpan(span)).description;
|
|
2928
2920
|
if (transactionName && !event.transaction && event.type === "transaction") event.transaction = transactionName;
|
|
2929
2921
|
}
|
|
2930
2922
|
/**
|
|
@@ -2974,19 +2966,12 @@ function prepareEvent(options, event, hint, scope, client, isolationScope) {
|
|
|
2974
2966
|
if (hint.mechanism) addExceptionMechanism(prepared, hint.mechanism);
|
|
2975
2967
|
const clientEventProcessors = client ? client.getEventProcessors() : [];
|
|
2976
2968
|
const data = getGlobalScope().getScopeData();
|
|
2977
|
-
if (isolationScope)
|
|
2978
|
-
|
|
2979
|
-
mergeScopeData(data, isolationData);
|
|
2980
|
-
}
|
|
2981
|
-
if (finalScope) {
|
|
2982
|
-
const finalScopeData = finalScope.getScopeData();
|
|
2983
|
-
mergeScopeData(data, finalScopeData);
|
|
2984
|
-
}
|
|
2969
|
+
if (isolationScope) mergeScopeData(data, isolationScope.getScopeData());
|
|
2970
|
+
if (finalScope) mergeScopeData(data, finalScope.getScopeData());
|
|
2985
2971
|
const attachments = [...hint.attachments || [], ...data.attachments];
|
|
2986
2972
|
if (attachments.length) hint.attachments = attachments;
|
|
2987
2973
|
applyScopeDataToEvent(prepared, data);
|
|
2988
|
-
|
|
2989
|
-
return notifyEventProcessors(eventProcessors, prepared, hint).then((evt) => {
|
|
2974
|
+
return notifyEventProcessors([...clientEventProcessors, ...data.eventProcessors], prepared, hint).then((evt) => {
|
|
2990
2975
|
if (evt) applyDebugMeta(evt);
|
|
2991
2976
|
if (typeof normalizeDepth === "number" && normalizeDepth > 0) return normalizeEvent(evt, normalizeDepth, normalizeMaxBreadth);
|
|
2992
2977
|
return evt;
|
|
@@ -3154,11 +3139,10 @@ var SessionFlusher = class {
|
|
|
3154
3139
|
const aggregates = Object.keys(this._pendingAggregates).map((key) => {
|
|
3155
3140
|
return this._pendingAggregates[parseInt(key)];
|
|
3156
3141
|
});
|
|
3157
|
-
|
|
3142
|
+
return dropUndefinedKeys({
|
|
3158
3143
|
attrs: this._sessionAttrs,
|
|
3159
3144
|
aggregates
|
|
3160
|
-
};
|
|
3161
|
-
return dropUndefinedKeys(sessionAggregates);
|
|
3145
|
+
});
|
|
3162
3146
|
}
|
|
3163
3147
|
/** JSDoc */
|
|
3164
3148
|
close() {
|
|
@@ -3728,8 +3712,7 @@ var BaseClient = class {
|
|
|
3728
3712
|
throw new SentryError("An event processor returned `null`, will not send event.", "log");
|
|
3729
3713
|
}
|
|
3730
3714
|
if (hint.data && hint.data.__sentry__ === true) return prepared;
|
|
3731
|
-
|
|
3732
|
-
return _validateBeforeSendResult(result, beforeSendLabel);
|
|
3715
|
+
return _validateBeforeSendResult(processBeforeSend(options, prepared, hint), beforeSendLabel);
|
|
3733
3716
|
}).then((processedEvent) => {
|
|
3734
3717
|
if (processedEvent === null) {
|
|
3735
3718
|
this.recordDroppedEvent("before_send", dataCategory, event);
|
|
@@ -3838,8 +3821,7 @@ function createCheckInEnvelope(checkIn, dynamicSamplingContext, metadata, tunnel
|
|
|
3838
3821
|
};
|
|
3839
3822
|
if (!!tunnel && !!dsn) headers.dsn = dsnToString(dsn);
|
|
3840
3823
|
if (dynamicSamplingContext) headers.trace = dropUndefinedKeys(dynamicSamplingContext);
|
|
3841
|
-
|
|
3842
|
-
return createEnvelope(headers, [item]);
|
|
3824
|
+
return createEnvelope(headers, [createCheckInEnvelopeItem(checkIn)]);
|
|
3843
3825
|
}
|
|
3844
3826
|
function createCheckInEnvelopeItem(checkIn) {
|
|
3845
3827
|
return [{ type: "check_in" }, checkIn];
|
|
@@ -4104,8 +4086,7 @@ function generateIteratee({ isBrowser, root, prefix }) {
|
|
|
4104
4086
|
}
|
|
4105
4087
|
} else if (isWindowsFrame || startsWithSlash) {
|
|
4106
4088
|
const filename = isWindowsFrame ? frame.filename.replace(/^[a-zA-Z]:/, "").replace(/\\/g, "/") : frame.filename;
|
|
4107
|
-
|
|
4108
|
-
frame.filename = `${prefix}${base}`;
|
|
4089
|
+
frame.filename = `${prefix}${root ? relative(root, filename) : basename(filename)}`;
|
|
4109
4090
|
}
|
|
4110
4091
|
return frame;
|
|
4111
4092
|
};
|
|
@@ -4637,8 +4618,7 @@ var Toucan = class Toucan extends Scope {
|
|
|
4637
4618
|
* finishes or throws.
|
|
4638
4619
|
*/
|
|
4639
4620
|
withScope(callback) {
|
|
4640
|
-
|
|
4641
|
-
return callback(toucan);
|
|
4621
|
+
return callback(this.clone());
|
|
4642
4622
|
}
|
|
4643
4623
|
};
|
|
4644
4624
|
|
|
@@ -4803,8 +4783,6 @@ function formatDate(date) {
|
|
|
4803
4783
|
function renderLimitedResponse(req) {
|
|
4804
4784
|
const hostname = new URL(req.url).hostname;
|
|
4805
4785
|
const ip = req.headers.get("cf-connecting-ip") ?? "";
|
|
4806
|
-
const ray = req.headers.get("cf-ray") ?? "";
|
|
4807
|
-
const date = formatDate(/* @__PURE__ */ new Date());
|
|
4808
4786
|
return `
|
|
4809
4787
|
<!doctype html>
|
|
4810
4788
|
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en-US"> <![endif]-->
|
|
@@ -6174,11 +6152,11 @@ function renderLimitedResponse(req) {
|
|
|
6174
6152
|
<div class="cf-error-footer cf-wrapper">
|
|
6175
6153
|
<p>
|
|
6176
6154
|
<span class="cf-footer-item"
|
|
6177
|
-
>Cloudflare Ray ID: ${ray}</span
|
|
6155
|
+
>Cloudflare Ray ID: ${req.headers.get("cf-ray") ?? ""}</span
|
|
6178
6156
|
>
|
|
6179
6157
|
<span class="cf-footer-separator">•</span>
|
|
6180
6158
|
<span class="cf-footer-item"
|
|
6181
|
-
>${
|
|
6159
|
+
>${formatDate(/* @__PURE__ */ new Date())}</span
|
|
6182
6160
|
>
|
|
6183
6161
|
<span
|
|
6184
6162
|
id="cf-footer-item-ip"
|
|
@@ -160,10 +160,9 @@ for (let i = 0; i < 64; i++) {
|
|
|
160
160
|
}
|
|
161
161
|
function decodeInteger(reader, relative) {
|
|
162
162
|
let value = 0, shift = 0, integer = 0;
|
|
163
|
-
do
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
} while (integer & 32);
|
|
163
|
+
do
|
|
164
|
+
integer = charToInt[reader.next()], value |= (integer & 31) << shift, shift += 5;
|
|
165
|
+
while (integer & 32);
|
|
167
166
|
let shouldNegate = value & 1;
|
|
168
167
|
return value >>>= 1, shouldNegate && (value = -2147483648 | -value), relative + value;
|
|
169
168
|
}
|
|
@@ -1014,7 +1013,7 @@ function wrapCallSite(frame, state) {
|
|
|
1014
1013
|
}, frame) : frame;
|
|
1015
1014
|
}
|
|
1016
1015
|
function prepareStackTrace(error, stack) {
|
|
1017
|
-
let
|
|
1016
|
+
let errorString = `${error.name || "Error"}: ${error.message || ""}`, state = {
|
|
1018
1017
|
nextPosition: null,
|
|
1019
1018
|
curPosition: null
|
|
1020
1019
|
}, processedStack = [];
|
|
@@ -1050,8 +1049,8 @@ var ESModulesEvaluator = class {
|
|
|
1050
1049
|
closed = !1;
|
|
1051
1050
|
constructor(options, evaluator = new ESModulesEvaluator(), debug) {
|
|
1052
1051
|
if (this.options = options, this.evaluator = evaluator, this.debug = debug, this.evaluatedModules = options.evaluatedModules ?? new EvaluatedModules(), this.transport = normalizeModuleRunnerTransport(options.transport), options.hmr !== !1) {
|
|
1053
|
-
let optionsHmr = options.hmr ?? !0
|
|
1054
|
-
if (this.hmrClient = new HMRClient(
|
|
1052
|
+
let optionsHmr = options.hmr ?? !0;
|
|
1053
|
+
if (this.hmrClient = new HMRClient(optionsHmr === !0 || optionsHmr.logger === void 0 ? hmrLogger : optionsHmr.logger === !1 ? silentConsole : optionsHmr.logger, this.transport, ({ acceptedPath }) => this.import(acceptedPath)), !this.transport.connect) throw Error("HMR is not supported by this runner transport, but `hmr` option was set to true");
|
|
1055
1054
|
this.transport.connect(createHMRHandlerForRunner(this));
|
|
1056
1055
|
} else this.transport.connect?.();
|
|
1057
1056
|
options.sourcemapInterceptor !== !1 && (this.resetSourceMapSupport = enableSourceMapSupport(this));
|
|
@@ -1528,8 +1527,7 @@ function createWorkerEntrypointWrapper(exportName) {
|
|
|
1528
1527
|
const value = Reflect.get(target, key, receiver);
|
|
1529
1528
|
if (value !== void 0) return value;
|
|
1530
1529
|
if (typeof key === "symbol" || IGNORED_KEYS.includes(key) || DURABLE_OBJECT_KEYS.includes(key)) return;
|
|
1531
|
-
|
|
1532
|
-
return getRpcPropertyCallableThenable(key, property);
|
|
1530
|
+
return getRpcPropertyCallableThenable(key, getWorkerEntrypointRpcProperty.call(receiver, exportName, key));
|
|
1533
1531
|
} });
|
|
1534
1532
|
}
|
|
1535
1533
|
}
|
|
@@ -1601,8 +1599,7 @@ function createDurableObjectWrapper(exportName) {
|
|
|
1601
1599
|
const value = Reflect.get(target, key, receiver);
|
|
1602
1600
|
if (value !== void 0) return value;
|
|
1603
1601
|
if (typeof key === "symbol" || IGNORED_KEYS.includes(key) || WORKER_ENTRYPOINT_KEYS.includes(key)) return;
|
|
1604
|
-
|
|
1605
|
-
return getRpcPropertyCallableThenable(key, property);
|
|
1602
|
+
return getRpcPropertyCallableThenable(key, getDurableObjectRpcProperty.call(receiver, exportName, key));
|
|
1606
1603
|
} });
|
|
1607
1604
|
}
|
|
1608
1605
|
async [kEnsureInstance]() {
|
|
@@ -1610,10 +1607,9 @@ function createDurableObjectWrapper(exportName) {
|
|
|
1610
1607
|
if (typeof ctor !== "function") throw new TypeError(`Expected "${exportName}" export of "${workerEntryPath}" to be a subclass of \`DurableObject\`.`);
|
|
1611
1608
|
if (!this[kInstance] || this[kInstance].ctor !== ctor) {
|
|
1612
1609
|
const userEnv = stripInternalEnv(this.env);
|
|
1613
|
-
const instance = new ctor(this.ctx, userEnv);
|
|
1614
1610
|
this[kInstance] = {
|
|
1615
1611
|
ctor,
|
|
1616
|
-
instance
|
|
1612
|
+
instance: new ctor(this.ctx, userEnv)
|
|
1617
1613
|
};
|
|
1618
1614
|
await this.ctx.blockConcurrencyWhile(async () => {});
|
|
1619
1615
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudflare/vite-plugin",
|
|
3
|
-
"version": "1.13.
|
|
3
|
+
"version": "1.13.13",
|
|
4
4
|
"description": "Cloudflare plugin for Vite",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cloudflare",
|
|
@@ -40,11 +40,11 @@
|
|
|
40
40
|
"unenv": "2.0.0-rc.21",
|
|
41
41
|
"ws": "8.18.0",
|
|
42
42
|
"@cloudflare/unenv-preset": "2.7.7",
|
|
43
|
-
"
|
|
44
|
-
"
|
|
43
|
+
"miniflare": "4.20251008.0",
|
|
44
|
+
"wrangler": "4.43.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@cloudflare/workers-types": "^4.
|
|
47
|
+
"@cloudflare/workers-types": "^4.20251008.0",
|
|
48
48
|
"@types/node": "^22.10.1",
|
|
49
49
|
"@types/ws": "^8.5.13",
|
|
50
50
|
"magic-string": "^0.30.12",
|
|
@@ -53,14 +53,14 @@
|
|
|
53
53
|
"typescript": "^5.8.3",
|
|
54
54
|
"vite": "7.0.0",
|
|
55
55
|
"vitest": "~3.2.0",
|
|
56
|
-
"@cloudflare/mock-npm-registry": "0.0.0",
|
|
57
56
|
"@cloudflare/containers-shared": "0.2.12",
|
|
57
|
+
"@cloudflare/mock-npm-registry": "0.0.0",
|
|
58
58
|
"@cloudflare/workers-shared": "0.18.8",
|
|
59
59
|
"@cloudflare/workers-tsconfig": "0.0.0"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
62
|
"vite": "^6.1.0 || ^7.0.0",
|
|
63
|
-
"wrangler": "^4.
|
|
63
|
+
"wrangler": "^4.43.0"
|
|
64
64
|
},
|
|
65
65
|
"publishConfig": {
|
|
66
66
|
"access": "public"
|