miniflare 0.0.0-e55f489db → 0.0.0-e5ae13ade

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.
@@ -1,10 +1,15 @@
1
1
  // src/workers/analytics-engine/analytics-engine.worker.ts
2
- import { WorkerEntrypoint } from "cloudflare:workers";
3
- var LocalAnalyticsEngineDataset = class extends WorkerEntrypoint {
2
+ var LocalAnalyticsEngineDataset = class {
3
+ constructor(env) {
4
+ this.env = env;
5
+ }
4
6
  writeDataPoint(_event) {
5
7
  }
6
8
  };
9
+ function analytics_engine_worker_default(env) {
10
+ return new LocalAnalyticsEngineDataset(env);
11
+ }
7
12
  export {
8
- LocalAnalyticsEngineDataset
13
+ analytics_engine_worker_default as default
9
14
  };
10
15
  //# sourceMappingURL=analytics-engine.worker.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/workers/analytics-engine/analytics-engine.worker.ts"],
4
- "mappings": ";AAAA,SAAS,wBAAwB;AAE1B,IAAM,8BAAN,cACE,iBAET;AAAA,EACC,eAAe,QAAyC;AAAA,EAExD;AACD;",
4
+ "mappings": ";AAGA,IAAM,8BAAN,MAAoE;AAAA,EACnE,YAAoB,KAAU;AAAV;AAAA,EAAW;AAAA,EAC/B,eAAe,QAAyC;AAAA,EAExD;AACD;AAEe,SAAR,gCAAkB,KAAU;AAClC,SAAO,IAAI,4BAA4B,GAAG;AAC3C;",
5
5
  "names": []
6
6
  }
@@ -7966,6 +7966,7 @@ var normalizeConfiguration = (configuration) => {
7966
7966
  version: 2,
7967
7967
  rules: {}
7968
7968
  },
7969
+ has_static_routing: configuration?.has_static_routing ?? !1,
7969
7970
  account_id: configuration?.account_id ?? -1,
7970
7971
  script_id: configuration?.script_id ?? -1,
7971
7972
  debug: configuration?.debug ?? !1
@@ -8141,21 +8142,23 @@ var ESCAPE_REGEX_CHARACTERS = /[-/\\^$*+?.()|[\]{}]/g, escapeRegex = (str) => st
8141
8142
  for (let [replacement, value] of Object.entries(replacements))
8142
8143
  str = str.replaceAll(`:${replacement}`, value);
8143
8144
  return str;
8145
+ };
8146
+ var generateRuleRegExp = (rule) => {
8147
+ rule = rule.split("*").map(escapeRegex).join("(?<splat>.*)");
8148
+ let host_matches = rule.matchAll(HOST_PLACEHOLDER_REGEX);
8149
+ for (let host_match of host_matches)
8150
+ rule = rule.split(host_match[0]).join(`(?<${host_match[1]}>[^/.]+)`);
8151
+ let path_matches = rule.matchAll(PLACEHOLDER_REGEX);
8152
+ for (let path_match of path_matches)
8153
+ rule = rule.split(path_match[0]).join(`(?<${path_match[1]}>[^/]+)`);
8154
+ return rule = "^" + rule + "$", RegExp(rule);
8144
8155
  }, generateRulesMatcher = (rules, replacerFn = (match) => match) => {
8145
8156
  if (!rules)
8146
8157
  return () => [];
8147
8158
  let compiledRules = Object.entries(rules).map(([rule, match]) => {
8148
8159
  let crossHost = rule.startsWith("https://");
8149
- rule = rule.split("*").map(escapeRegex).join("(?<splat>.*)");
8150
- let host_matches = rule.matchAll(HOST_PLACEHOLDER_REGEX);
8151
- for (let host_match of host_matches)
8152
- rule = rule.split(host_match[0]).join(`(?<${host_match[1]}>[^/.]+)`);
8153
- let path_matches = rule.matchAll(PLACEHOLDER_REGEX);
8154
- for (let path_match of path_matches)
8155
- rule = rule.split(path_match[0]).join(`(?<${path_match[1]}>[^/]+)`);
8156
- rule = "^" + rule + "$";
8157
8160
  try {
8158
- let regExp = new RegExp(rule);
8161
+ let regExp = generateRuleRegExp(rule);
8159
8162
  return [{ crossHost, regExp }, match];
8160
8163
  } catch {
8161
8164
  }
@@ -8295,7 +8298,7 @@ var REDIRECTS_VERSION = 1, HEADERS_VERSION = 2, getResponseOrAssetIntent = async
8295
8298
  }, canFetch = async (request, env, configuration, exists) => (flagIsEnabled(
8296
8299
  configuration,
8297
8300
  SEC_FETCH_MODE_NAVIGATE_HEADER_PREFERS_ASSET_SERVING
8298
- ) && request.headers.get("Sec-Fetch-Mode") === "navigate" || (configuration = {
8301
+ ) && request.headers.get("Sec-Fetch-Mode") === "navigate" && !configuration.has_static_routing || (configuration = {
8299
8302
  ...configuration,
8300
8303
  not_found_handling: "none"
8301
8304
  }), !(await getResponseOrAssetIntent(