Skip to content

Commit

Permalink
Move Range header handling to @miniflare/core (#499)
Browse files Browse the repository at this point in the history
`range.ts` was previously located in `@miniflare/shared`, but had a
dependency on `Response` from `@miniflare/core`. `@miniflare/shared`
isn't meant to have any `@miniflare/*` dependencies, so this change
moves the implementation to `@miniflare/core`.
  • Loading branch information
mrbbot authored Feb 13, 2023
1 parent e5e314c commit 547fda9
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/cache/src/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
Request,
RequestInfo,
Response,
getRangeResponse,
withImmutableHeaders,
withStringFormDataFiles,
} from "@miniflare/core";
Expand All @@ -12,7 +13,6 @@ import {
Storage,
assertInRequest,
defaultClock,
getRangeResponse,
getRequestContext,
millisToSeconds,
waitForOpenInputGate,
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/standards/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,5 @@ export {
} from "./streams";
export type { ArrayBufferViewConstructor } from "./streams";
export * from "./navigator";
export * from "./range";
export * from "./timers";
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ReadableStream } from "stream/web";
import { TextEncoder } from "util";
import { Response } from "@miniflare/core";
import { Headers } from "undici";
import { Response } from "./http";

const encoder = new TextEncoder();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import assert from "assert";
import { getRangeResponse, parseRanges } from "@miniflare/shared";
import { getRangeResponse, parseRanges } from "@miniflare/core";
import { utf8Encode } from "@miniflare/shared-test";
import test from "ava";
import { Headers } from "undici";
Expand Down
2 changes: 1 addition & 1 deletion packages/r2/src/bucket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import crypto from "crypto";
import { arrayBuffer } from "stream/consumers";
import { ReadableStream } from "stream/web";
import { TextEncoder } from "util";
import { parseRanges } from "@miniflare/core";
import {
RangeStoredValueMeta,
RequestContext,
Storage,
assertInRequest,
getRequestContext,
parseRanges,
viewToArray,
waitForOpenInputGate,
waitForOpenOutputGate,
Expand Down
1 change: 0 additions & 1 deletion packages/shared/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ export * from "./event";
export * from "./log";
export * from "./plugin";
export * from "./queues";
export * from "./range";
export * from "./runner";
export * from "./storage";
export * from "./sync/";
Expand Down

0 comments on commit 547fda9

Please sign in to comment.