diff --git a/CHANGELOG.md b/CHANGELOG.md index ffead6760..51e99a470 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,64 @@ # ๐Ÿšง Changelog +## 2.0.0-rc.1 + +### Breaking Changes + +- Changed the priority of bindings, so it matches Miniflare 1. The new order + (from lowest to highest priority) is: + 1. Variables from `wrangler.toml` `[vars]` + 2. Variables from `.env` files + 3. WASM module bindings (`--wasm`, `[wasm_modules]`) + 4. Custom bindings +- The result of `dispatchScheduled` will no longer include `undefined` if a + module scheduled handler doesn't return a value + +### Features + +- Added a **custom Jest test environment for Miniflare**. This allows you to + **run unit tests in the Miniflare sandbox**, with **isolated storage** for + each test. Install the `jest-environment-miniflare` to get started and see + [๐Ÿคน Jest Environment](https://v2.miniflare.dev/jest.html) for more details. +- Added support for **running multiple workers** in the same Miniflare instance. + See [๐Ÿ”Œ Multiple Workers](https://v2.miniflare.dev/mount.html) for more + details. +- Added support for the Durable Object `script_name` option. See + [๐Ÿ“Œ Durable Objects](https://v2.miniflare.dev/durable-objects.html#using-a-class-exported-by-another-script) + for more details. +- Added support for the new `__STATIC_CONTENT_MANIFEST` text module for using + Workers Sites in modules mode +- Throw an error when a Durable Object `fetch` handler doesn't return a + `Response` +- Added `queueMicrotask` to the sandbox +- Added the `Miniflare#getCaches` method for accessing the global `caches` + outside workers +- Added back the `sourceMap` option to `Miniflare` +- Changed the default location for the `update-check` and `cf.json` files to + inside `node_modules` +- Switched the CRON validation and scheduling package from + [`node-cron`](https://www.npmjs.com/package/node-cron) to + [`cron-schedule`](https://www.npmjs.com/package/cron-schedule). This improves + error messages for invalid CRON expressions, and removes a transitive + dependency on `moment-timezone`, reducing the installation size by a further + 5MB. + +### Fixes + +- Allow any close code when a client closes a WebSocket connection. Closes + [issue #86](https://github.com/cloudflare/miniflare/issues/86), thanks + [@TimTinkers](https://github.com/TimTinkers). +- Wait for worker response before opening WebSocket in client, closes + [issue #88](https://github.com/cloudflare/miniflare/issues/88), thanks + [@TimTinkers](https://github.com/TimTinkers). +- Pass the `--env` flag to `wrangler build` when `--wrangler-env` is set for + `type = "webpack"`/`"rust"` builds +- Set correct `Host` header with `--upstream` flag set +- Fixed memory leak in `HTMLRewriter` when passing non-`ArrayBuffer(View)` + chunks +- Marked `@miniflare/core` and `@miniflare/storage-memory` as `dependencies` of + `@miniflare/durable-objects` +- Removed `ServiceWorkerGlobalScope#dispose()` from global scope + ## 2.0.0-next.3 ### Fixes @@ -121,8 +180,7 @@ The docs will be updated over the next few weeks. much information is logged to the console: ```js - import { Miniflare } from "miniflare"; - import { Log, LogLevel } from "@miniflare/shared"; + import { Miniflare, Log, LogLevel } from "miniflare"; const mf = new Miniflare({ log: new Log(LogLevel.DEBUG), @@ -150,6 +208,8 @@ The docs will be updated over the next few weeks. MODULE2 = "module2.wasm" ``` +- Renamed the `buildWatchPath` option to `buildWatchPaths`. This is now an array + of string paths to watch as opposed to a single string. - Replaced the `Miniflare#reloadOptions()` method with the `Miniflare#reload()` and `Miniflare#setOptions({ ... })` methods. `reload()` will reload options from `wrangler.toml` (useful if not watching), and `setOptions()` accepts the diff --git a/README.md b/README.md index 43ffb335f..19bfd5a03 100644 --- a/README.md +++ b/README.md @@ -29,8 +29,8 @@ goals: testing. 2. โœจ **Lightweight:** Miniflare 1 included [122 third-party packages](http://npm.anvaka.com/#/view/2d/miniflare) with a - total install size of `88.3MB`. Miniflare 2 reduces this to **24 packages and - `11.5MB`** ๐Ÿคฏ. This can probably be reduced further too. + total install size of `88.3MB`. Miniflare 2 reduces this to **23 packages and + `6.2MB`** ๐Ÿคฏ. 3. โœ… **Correct:** Miniflare 2 more accurately replicates the quirks and thrown errors of the real Workers runtime, so you'll know before you deploy if things are going to break. @@ -114,6 +114,8 @@ Core Options: -d, --debug Enable debug logging [boolean] -V, --verbose Enable verbose logging [boolean] --(no-)update-check Enable update checker (enabled by default) [boolean] + --root Path to resolve default config files relative to [string] + --mount Mount additional named workers [array:NAME=PATH] HTTP Options: -H, --host Host for HTTP(S) server to listen on [string] diff --git a/docs/.vitepress/changelog.mjs b/docs/.vitepress/changelog.mjs index 6fedb5112..a82cce9fe 100644 --- a/docs/.vitepress/changelog.mjs +++ b/docs/.vitepress/changelog.mjs @@ -10,5 +10,8 @@ const changelog = await fs.readFile(changelogPath, "utf8"); const docsChangelogPath = path.resolve(__dirname, "..", "changelog.md"); // Rewrite https://miniflare.dev paths to relative paths -const docsChangelog = changelog.replace(/]\(https:\/\/miniflare.dev/g, "]("); +const docsChangelog = changelog.replace( + /]\(https:\/\/(v\d+\.)?miniflare.dev/g, + "](" +); await fs.writeFile(docsChangelogPath, docsChangelog, "utf8"); diff --git a/docs/.vitepress/config.js b/docs/.vitepress/config.js index a92243b64..03ad097a0 100644 --- a/docs/.vitepress/config.js +++ b/docs/.vitepress/config.js @@ -50,6 +50,7 @@ module.exports = { { text: "๐Ÿ“„ HTMLRewriter", link: "/html-rewriter.html" }, { text: "โšก๏ธ Live Reload", link: "/live-reload.html" }, { text: "๐Ÿ“… Compatibility Dates", link: "/compatibility.html" }, + { text: "๐Ÿ”Œ Multiple Workers", link: "/mount.html" }, { text: "๐Ÿคน Jest Environment", link: "/jest.html" }, ], }, diff --git a/docs/api.md b/docs/api.md index ce76b1812..2785e747b 100644 --- a/docs/api.md +++ b/docs/api.md @@ -55,11 +55,11 @@ const mf = new Miniflare({ wranglerConfigPath: true, }); ``` -::: - Note that options specified in the constructor have higher priority than those in `wrangler.toml`. +::: + ### String and File Scripts @@ -91,7 +91,7 @@ You must also `dispose` if you're persisting KV, cache, or Durable Object data in Redis to close opened connections. You can also manually reload scripts (main and Durable Objects') and options -(`.env`, `package.json` and `wrangler.toml`) too with `reload`: +(`.env`, `package.json` and `wrangler.toml`) with `reload`: ```js const mf = new Miniflare({ ... }); @@ -128,7 +128,8 @@ await mf.setOptions({ You can also access the global scope of the sandbox directly using the `getGlobalScope` method. Ideally, use should use the `setOptions` method when -updating the environment dynamically though: +updating the environment dynamically, as Miniflare creates a new global scope +each reload, so your changes will be lost: ```js const mf = new Miniflare({ @@ -302,11 +303,10 @@ await scheduler.dispose(); By default, `[mf:*]` logs as seen in the CLI are disabled when using the API. To enable these, set the `log` property to an instance of the `Log` class. Its only -parameter is the log level indicating which messages should be logged: +parameter is a log level indicating which messages should be logged: ```js{5} -import { Log, LogLevel } from "@miniflare/shared"; -import { Miniflare } from "miniflare"; +import { Miniflare, Log, LogLevel } from "miniflare"; const mf = new Miniflare({ scriptPath: "worker.js", diff --git a/docs/cli.md b/docs/cli.md index eeecd1c9b..6a5069d2d 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -110,6 +110,14 @@ load a different `wrangler.toml` file, use the `--wrangler-config`/`-c` flag: $ miniflare worker.js --wrangler-config wrangler.other.toml ``` +To change the directory these default files are resolved relative to, use the +`--root` flag: + +```shell +$ miniflare api/worker.js --root api +# Miniflare will look for api/.env, api/package.json and api/wrangler.toml +``` + ### Script Requirement The only required option is the script to run. This can either be passed as a @@ -159,8 +167,8 @@ $ miniflare worker.js --https ./cert_cache # Cache in ./cert_cache instead ``` To use an existing certificate instead, use the `--https-key`, `--https-cert`, -`--https-ca` and `--https-pfx` to set the paths to it. If these are encrypted, -use the `--https-passphrase` flag to set the passphrase: +`--https-ca` and `--https-pfx` flags to set the paths to it. If these are +encrypted, use the `--https-passphrase` flag to set the passphrase: ```shell $ miniflare worker.js --https-key ./key.pem --https-cert ./cert.pem @@ -196,6 +204,9 @@ Core Options: -d, --debug Enable debug logging [boolean] -V, --verbose Enable verbose logging [boolean] --(no-)update-check Enable update checker (enabled by default) [boolean] + --root Path to resolve default config files relative [string] + to + --mount Mount additional named workers [array:NAME=PATH] HTTP Options: -H, --host Host for HTTP(S) server to listen on [string] @@ -316,4 +327,6 @@ pfx = "./pfx.pfx" ## --https-pfx passphrase = "pfx passphrase" ## --https-passphrase [miniflare.globals] ## --global KEY = "value" +[miniflare.mounts] ## --mount +api = "./api" ``` diff --git a/docs/durable-objects.md b/docs/durable-objects.md index b85a2f127..d767d793b 100644 --- a/docs/durable-objects.md +++ b/docs/durable-objects.md @@ -158,6 +158,67 @@ res = await mf.dispatchFetch("http://localhost:8787/"); console.log(await res.text()); // "2" ``` +## Using a Class Exported by Another Script + +Miniflare supports the `script_name` option for accessing Durable Objects +exported by other scripts. This requires mounting the other worker as described +in [๐Ÿ”Œ Multiple Workers](/mount.html). With the following setup: + +```js +// api/src/worker.mjs +export class TestObject { + fetch() { + return new Response("API response"); + } +} +``` + +```toml +# api/wrangler.toml +name = "api" +[build.upload] +format = "modules" +dir = "src" +main = "./worker.mjs" +``` + +```js +// worker.mjs +export default { + fetch(request, env, ctx) { + const { TEST_OBJECT } = env.TEST_OBJECT; + const id = TEST_OBJECT.newUniqueId(); + const stub = TEST_OBJECT.get(id); + return stub.fetch(request); + }, +}; +``` + +Miniflare can be configured to load `TestObject` from the `api` worker with: + +```toml +# wrangler.toml +[durable_objects] +bindings = [ + # script_name must be the same as in [miniflare.mounts] + { name = "TEST_OBJECT", class_name = "TestObject", script_name = "api" }, +] +[miniflare.mounts] +api = "./api" +``` + +```js +const mf = new Miniflare({ + durableObjects: { + // scriptName must be the same as in mounts + TEST_OBJECT: { className: "TestObject", scriptName: "api" }, + }, + mounts: { api: "./api" }, +}); +``` + +Note it's not possible to set `script_name` via the CLI. + ## Internal Details Transactional semantics only hold within the same Miniflare instance. Therefore, diff --git a/docs/jest.md b/docs/jest.md index 97d41fb65..d1f6ce48a 100644 --- a/docs/jest.md +++ b/docs/jest.md @@ -1,14 +1,14 @@ # ๐Ÿคน Jest Environment Miniflare includes a custom Jest environment that allows you to run your unit -tests within the Miniflare sandbox. Note that Jest ≥ 27 is required. +tests within the Miniflare sandbox. Note that at least Jest 27 is required. ## Setup The Miniflare environment isn't installed by default, install it and Jest with: ```shell -$ npm install -D jest-environment-miniflare jest +$ npm install -D jest-environment-miniflare@next jest ``` In the following examples, we'll assume your `package.json` contains @@ -45,7 +45,7 @@ addEventListener("fetch", (event) => { }); // Assuming you've got a build tool that removes `export`s when you actually -// deploy your worker +// deploy your worker (e.g. https://esbuild.github.io/api/#format-iife) export async function handleRequest(request) { return new Response(`URL: ${request.url} KEY: ${KEY}`); } diff --git a/docs/mount.md b/docs/mount.md new file mode 100644 index 000000000..6073a91e3 --- /dev/null +++ b/docs/mount.md @@ -0,0 +1,89 @@ +# ๐Ÿ”Œ Multiple Workers + +## Mounting Workers + +Miniflare allows you to run multiple workers in the same instance. Assuming the +following directory structure: + +``` +โ”œโ”€โ”€ api +โ”‚ย ย  โ”œโ”€โ”€ api-worker.js // addEventListener("fetch", ...) +โ”‚ย ย  โ”œโ”€โ”€ package.json // { "main": "./api-worker.js" } +โ”‚ย ย  โ””โ”€โ”€ wrangler.toml // name = "api" +โ”œโ”€โ”€ site +โ”‚ย ย  โ”œโ”€โ”€ package.json // { "module": "./site-worker.mjs" } +โ”‚ย ย  โ”œโ”€โ”€ site-worker.mjs // export default { ... } +โ”‚ย ย  โ””โ”€โ”€ wrangler.toml // name = "site" [build.upload] format = "modules" +โ”œโ”€โ”€ package.json +โ”œโ”€โ”€ worker.js +โ””โ”€โ”€ wrangler.toml +``` + +...you can mount the `api` and `site` workers with: + +```shell +$ miniflare --mount api=./api --mount site=./site +``` + +```toml +# wrangler.toml +[miniflare.mounts] +api = "./api" +site = "./site" +``` + +```js +const mf = new Miniflare({ + mounts: { + api: "./api", + site: "./site", + }, +}); +``` + +Note the **mounted paths, `./api` and `./site`, are paths to directories not +worker scripts**. All worker configuration must be derivable from +`package.json`, `.env` and `wrangler.toml` files in these directories when +mounting like this. None of the configuration from the parent worker (aside from +the `watch` option) is copied to mounted workers. + +When using the API, you can instead configure the mounted workers using the same +options as the `new Miniflare` constructor. Note that nested `mounts` are not +supported: ๐Ÿ™ƒ + +```js +const mf = new Miniflare({ + mounts: { + api: { + scriptPath: "./api/api-worker.js", + kvNamespaces: ["TEST_NAMESPACE"], + }, + }, +}); +``` + +## Fetching + +When dispatching events (either via `dispatchFetch` or the HTTP(S) server), if +the path starts with the mounted name (e.g. `/api` or `/site/`), this prefix +will be stripped and the event will be dispatched to the mounted worker instead +of the parent: + +```js +// api/api-worker.js +addEventListener("fetch", (event) => { + event.respondWith(new Response(`res:${event.request.url}`)); +}); +``` + +```shell +$ curl "http://localhost:8787/api/todos/update/1" +res:http://localhost:8787/todos/update/1 # /api removed +``` + +## Durable Objects + +Miniflare supports the `script_name` option for accessing Durable Objects +exported by other scripts. See +[๐Ÿ“Œ Durable Objects](/durable-objects.html#using-a-class-exported-by-another-script) +for more details. diff --git a/package-lock.json b/package-lock.json index 9fbb1e32c..17a93a788 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@miniflare/root", - "version": "2.0.0-next.3", + "version": "2.0.0-rc.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@miniflare/root", - "version": "2.0.0-next.3", + "version": "2.0.0-rc.1", "license": "MIT", "workspaces": [ "packages/*" @@ -9482,17 +9482,17 @@ }, "packages/cache": { "name": "@miniflare/cache", - "version": "2.0.0-next.3", + "version": "2.0.0-rc.1", "license": "MIT", "dependencies": { - "@miniflare/core": "2.0.0-next.3", - "@miniflare/shared": "2.0.0-next.3", + "@miniflare/core": "2.0.0-rc.1", + "@miniflare/shared": "2.0.0-rc.1", "http-cache-semantics": "^4.1.0", "undici": "^4.9.3" }, "devDependencies": { - "@miniflare/shared-test": "2.0.0-next.3", - "@miniflare/web-sockets": "2.0.0-next.3", + "@miniflare/shared-test": "2.0.0-rc.1", + "@miniflare/web-sockets": "2.0.0-rc.1", "@types/http-cache-semantics": "^4.0.1" }, "engines": { @@ -9501,15 +9501,15 @@ }, "packages/cli-parser": { "name": "@miniflare/cli-parser", - "version": "2.0.0-next.3", + "version": "2.0.0-rc.1", "license": "MIT", "dependencies": { - "@miniflare/shared": "2.0.0-next.3", + "@miniflare/shared": "2.0.0-rc.1", "kleur": "^4.1.4" }, "devDependencies": { - "@miniflare/core": "2.0.0-next.3", - "@miniflare/shared-test": "2.0.0-next.3", + "@miniflare/core": "2.0.0-rc.1", + "@miniflare/shared-test": "2.0.0-rc.1", "@types/mri": "^1.1.1", "mri": "^1.1.6" }, @@ -9519,11 +9519,11 @@ }, "packages/core": { "name": "@miniflare/core", - "version": "2.0.0-next.3", + "version": "2.0.0-rc.1", "license": "MIT", "dependencies": { "@iarna/toml": "^2.2.5", - "@miniflare/shared": "2.0.0-next.3", + "@miniflare/shared": "2.0.0-rc.1", "busboy": "^0.3.1", "dotenv": "^10.0.0", "kleur": "^4.1.4", @@ -9531,9 +9531,9 @@ "undici": "^4.9.3" }, "devDependencies": { - "@miniflare/shared-test": "2.0.0-next.3", - "@miniflare/watcher": "2.0.0-next.3", - "@miniflare/web-sockets": "2.0.0-next.3", + "@miniflare/shared-test": "2.0.0-rc.1", + "@miniflare/watcher": "2.0.0-rc.1", + "@miniflare/web-sockets": "2.0.0-rc.1", "@types/busboy": "^0.3.1", "@types/set-cookie-parser": "^2.4.1", "dequal": "^2.0.2" @@ -9542,7 +9542,7 @@ "node": ">=16.7" }, "peerDependencies": { - "@miniflare/watcher": "2.0.0-next.3" + "@miniflare/watcher": "2.0.0-rc.1" }, "peerDependenciesMeta": { "@miniflare/watcher": { @@ -9552,16 +9552,16 @@ }, "packages/durable-objects": { "name": "@miniflare/durable-objects", - "version": "2.0.0-next.3", + "version": "2.0.0-rc.1", "license": "MIT", "dependencies": { - "@miniflare/core": "2.0.0-next.3", - "@miniflare/shared": "2.0.0-next.3", - "@miniflare/storage-memory": "2.0.0-next.3", + "@miniflare/core": "2.0.0-rc.1", + "@miniflare/shared": "2.0.0-rc.1", + "@miniflare/storage-memory": "2.0.0-rc.1", "undici": "^4.9.3" }, "devDependencies": { - "@miniflare/shared-test": "2.0.0-next.3" + "@miniflare/shared-test": "2.0.0-rc.1" }, "engines": { "node": ">=16.7" @@ -9569,16 +9569,16 @@ }, "packages/html-rewriter": { "name": "@miniflare/html-rewriter", - "version": "2.0.0-next.3", + "version": "2.0.0-rc.1", "license": "MIT", "dependencies": { - "@miniflare/core": "2.0.0-next.3", - "@miniflare/shared": "2.0.0-next.3", + "@miniflare/core": "2.0.0-rc.1", + "@miniflare/shared": "2.0.0-rc.1", "html-rewriter-wasm": "^0.3.2", "undici": "^4.9.3" }, "devDependencies": { - "@miniflare/shared-test": "2.0.0-next.3" + "@miniflare/shared-test": "2.0.0-rc.1" }, "engines": { "node": ">=16.7" @@ -9586,12 +9586,12 @@ }, "packages/http-server": { "name": "@miniflare/http-server", - "version": "2.0.0-next.3", + "version": "2.0.0-rc.1", "license": "MIT", "dependencies": { - "@miniflare/core": "2.0.0-next.3", - "@miniflare/shared": "2.0.0-next.3", - "@miniflare/web-sockets": "2.0.0-next.3", + "@miniflare/core": "2.0.0-rc.1", + "@miniflare/shared": "2.0.0-rc.1", + "@miniflare/web-sockets": "2.0.0-rc.1", "kleur": "^4.1.4", "selfsigned": "^1.10.11", "undici": "^4.9.3", @@ -9599,7 +9599,7 @@ "youch": "^2.2.2" }, "devDependencies": { - "@miniflare/shared-test": "2.0.0-next.3", + "@miniflare/shared-test": "2.0.0-rc.1", "@types/node-forge": "^0.10.4" }, "engines": { @@ -9608,23 +9608,23 @@ }, "packages/jest": { "name": "@miniflare/jest", - "version": "2.0.0-next.3", + "version": "2.0.0-rc.1", "extraneous": true, "license": "MIT", "dependencies": { - "@miniflare/cache": "2.0.0-next.3", - "@miniflare/core": "2.0.0-next.3", - "@miniflare/durable-objects": "2.0.0-next.3", - "@miniflare/html-rewriter": "2.0.0-next.3", - "@miniflare/kv": "2.0.0-next.3", - "@miniflare/shared": "2.0.0-next.3", - "@miniflare/sites": "2.0.0-next.3", - "@miniflare/storage-memory": "2.0.0-next.3", - "@miniflare/web-sockets": "2.0.0-next.3", - "miniflare": "2.0.0-next.3" + "@miniflare/cache": "2.0.0-rc.1", + "@miniflare/core": "2.0.0-rc.1", + "@miniflare/durable-objects": "2.0.0-rc.1", + "@miniflare/html-rewriter": "2.0.0-rc.1", + "@miniflare/kv": "2.0.0-rc.1", + "@miniflare/shared": "2.0.0-rc.1", + "@miniflare/sites": "2.0.0-rc.1", + "@miniflare/storage-memory": "2.0.0-rc.1", + "@miniflare/web-sockets": "2.0.0-rc.1", + "miniflare": "2.0.0-rc.1" }, "devDependencies": { - "@miniflare/shared-test": "2.0.0-next.3", + "@miniflare/shared-test": "2.0.0-rc.1", "jest": "^27.2.1" }, "engines": { @@ -9635,23 +9635,23 @@ } }, "packages/jest-environment-miniflare": { - "version": "2.0.0-next.3", + "version": "2.0.0-rc.1", "license": "MIT", "dependencies": { - "@miniflare/cache": "2.0.0-next.3", - "@miniflare/core": "2.0.0-next.3", - "@miniflare/durable-objects": "2.0.0-next.3", - "@miniflare/html-rewriter": "2.0.0-next.3", - "@miniflare/kv": "2.0.0-next.3", - "@miniflare/runner-vm": "2.0.0-next.3", - "@miniflare/shared": "2.0.0-next.3", - "@miniflare/sites": "2.0.0-next.3", - "@miniflare/storage-memory": "2.0.0-next.3", - "@miniflare/web-sockets": "2.0.0-next.3", - "miniflare": "2.0.0-next.3" + "@miniflare/cache": "2.0.0-rc.1", + "@miniflare/core": "2.0.0-rc.1", + "@miniflare/durable-objects": "2.0.0-rc.1", + "@miniflare/html-rewriter": "2.0.0-rc.1", + "@miniflare/kv": "2.0.0-rc.1", + "@miniflare/runner-vm": "2.0.0-rc.1", + "@miniflare/shared": "2.0.0-rc.1", + "@miniflare/sites": "2.0.0-rc.1", + "@miniflare/storage-memory": "2.0.0-rc.1", + "@miniflare/web-sockets": "2.0.0-rc.1", + "miniflare": "2.0.0-rc.1" }, "devDependencies": { - "@miniflare/shared-test": "2.0.0-next.3", + "@miniflare/shared-test": "2.0.0-rc.1", "jest": "^27.2.1" }, "engines": { @@ -9663,37 +9663,37 @@ }, "packages/kv": { "name": "@miniflare/kv", - "version": "2.0.0-next.3", + "version": "2.0.0-rc.1", "license": "MIT", "dependencies": { - "@miniflare/shared": "2.0.0-next.3" + "@miniflare/shared": "2.0.0-rc.1" }, "devDependencies": { - "@miniflare/shared-test": "2.0.0-next.3" + "@miniflare/shared-test": "2.0.0-rc.1" }, "engines": { "node": ">=16.7" } }, "packages/miniflare": { - "version": "2.0.0-next.3", + "version": "2.0.0-rc.1", "license": "MIT", "dependencies": { - "@miniflare/cache": "2.0.0-next.3", - "@miniflare/cli-parser": "2.0.0-next.3", - "@miniflare/core": "2.0.0-next.3", - "@miniflare/durable-objects": "2.0.0-next.3", - "@miniflare/html-rewriter": "2.0.0-next.3", - "@miniflare/http-server": "2.0.0-next.3", - "@miniflare/kv": "2.0.0-next.3", - "@miniflare/runner-vm": "2.0.0-next.3", - "@miniflare/scheduler": "2.0.0-next.3", - "@miniflare/shared": "2.0.0-next.3", - "@miniflare/sites": "2.0.0-next.3", - "@miniflare/storage-file": "2.0.0-next.3", - "@miniflare/storage-memory": "2.0.0-next.3", - "@miniflare/watcher": "2.0.0-next.3", - "@miniflare/web-sockets": "2.0.0-next.3", + "@miniflare/cache": "2.0.0-rc.1", + "@miniflare/cli-parser": "2.0.0-rc.1", + "@miniflare/core": "2.0.0-rc.1", + "@miniflare/durable-objects": "2.0.0-rc.1", + "@miniflare/html-rewriter": "2.0.0-rc.1", + "@miniflare/http-server": "2.0.0-rc.1", + "@miniflare/kv": "2.0.0-rc.1", + "@miniflare/runner-vm": "2.0.0-rc.1", + "@miniflare/scheduler": "2.0.0-rc.1", + "@miniflare/shared": "2.0.0-rc.1", + "@miniflare/sites": "2.0.0-rc.1", + "@miniflare/storage-file": "2.0.0-rc.1", + "@miniflare/storage-memory": "2.0.0-rc.1", + "@miniflare/watcher": "2.0.0-rc.1", + "@miniflare/web-sockets": "2.0.0-rc.1", "kleur": "^4.1.4", "semiver": "^1.1.0", "source-map-support": "^0.5.20", @@ -9703,14 +9703,14 @@ "miniflare": "bootstrap.js" }, "devDependencies": { - "@miniflare/shared-test": "2.0.0-next.3", + "@miniflare/shared-test": "2.0.0-rc.1", "@types/source-map-support": "^0.5.4" }, "engines": { "node": ">=16.7" }, "peerDependencies": { - "@miniflare/storage-redis": "2.0.0-next.3", + "@miniflare/storage-redis": "2.0.0-rc.1", "cron-schedule": "^3.0.4", "ioredis": "^4.27.9" }, @@ -9725,13 +9725,13 @@ }, "packages/runner-vm": { "name": "@miniflare/runner-vm", - "version": "2.0.0-next.3", + "version": "2.0.0-rc.1", "license": "MIT", "dependencies": { - "@miniflare/shared": "2.0.0-next.3" + "@miniflare/shared": "2.0.0-rc.1" }, "devDependencies": { - "@miniflare/shared-test": "2.0.0-next.3" + "@miniflare/shared-test": "2.0.0-rc.1" }, "engines": { "node": ">=16.7" @@ -9739,15 +9739,15 @@ }, "packages/scheduler": { "name": "@miniflare/scheduler", - "version": "2.0.0-next.3", + "version": "2.0.0-rc.1", "license": "MIT", "dependencies": { - "@miniflare/core": "2.0.0-next.3", - "@miniflare/shared": "2.0.0-next.3", + "@miniflare/core": "2.0.0-rc.1", + "@miniflare/shared": "2.0.0-rc.1", "cron-schedule": "^3.0.4" }, "devDependencies": { - "@miniflare/shared-test": "2.0.0-next.3" + "@miniflare/shared-test": "2.0.0-rc.1" }, "engines": { "node": ">=16.7" @@ -9755,14 +9755,14 @@ }, "packages/shared": { "name": "@miniflare/shared", - "version": "2.0.0-next.3", + "version": "2.0.0-rc.1", "license": "MIT", "dependencies": { "ignore": "^5.1.8", "kleur": "^4.1.4" }, "devDependencies": { - "@miniflare/shared-test": "2.0.0-next.3" + "@miniflare/shared-test": "2.0.0-rc.1" }, "engines": { "node": ">=16.7" @@ -9770,14 +9770,14 @@ }, "packages/shared-test": { "name": "@miniflare/shared-test", - "version": "2.0.0-next.3", + "version": "2.0.0-rc.1", "license": "MIT", "dependencies": { - "@miniflare/cli-parser": "2.0.0-next.3", - "@miniflare/core": "2.0.0-next.3", - "@miniflare/runner-vm": "2.0.0-next.3", - "@miniflare/shared": "2.0.0-next.3", - "@miniflare/storage-memory": "2.0.0-next.3", + "@miniflare/cli-parser": "2.0.0-rc.1", + "@miniflare/core": "2.0.0-rc.1", + "@miniflare/runner-vm": "2.0.0-rc.1", + "@miniflare/shared": "2.0.0-rc.1", + "@miniflare/storage-memory": "2.0.0-rc.1", "ws": "^8.2.2" }, "engines": { @@ -9786,17 +9786,17 @@ }, "packages/sites": { "name": "@miniflare/sites", - "version": "2.0.0-next.3", + "version": "2.0.0-rc.1", "license": "MIT", "dependencies": { - "@miniflare/kv": "2.0.0-next.3", - "@miniflare/shared": "2.0.0-next.3", - "@miniflare/storage-file": "2.0.0-next.3" + "@miniflare/kv": "2.0.0-rc.1", + "@miniflare/shared": "2.0.0-rc.1", + "@miniflare/storage-file": "2.0.0-rc.1" }, "devDependencies": { "@cloudflare/kv-asset-handler": "^0.1.3", - "@miniflare/core": "2.0.0-next.3", - "@miniflare/shared-test": "2.0.0-next.3" + "@miniflare/core": "2.0.0-rc.1", + "@miniflare/shared-test": "2.0.0-rc.1" }, "engines": { "node": ">=16.7" @@ -9804,14 +9804,14 @@ }, "packages/storage-file": { "name": "@miniflare/storage-file", - "version": "2.0.0-next.3", + "version": "2.0.0-rc.1", "license": "MIT", "dependencies": { - "@miniflare/shared": "2.0.0-next.3", - "@miniflare/storage-memory": "2.0.0-next.3" + "@miniflare/shared": "2.0.0-rc.1", + "@miniflare/storage-memory": "2.0.0-rc.1" }, "devDependencies": { - "@miniflare/shared-test": "2.0.0-next.3" + "@miniflare/shared-test": "2.0.0-rc.1" }, "engines": { "node": ">=16.7" @@ -9819,13 +9819,13 @@ }, "packages/storage-memory": { "name": "@miniflare/storage-memory", - "version": "2.0.0-next.3", + "version": "2.0.0-rc.1", "license": "MIT", "dependencies": { - "@miniflare/shared": "2.0.0-next.3" + "@miniflare/shared": "2.0.0-rc.1" }, "devDependencies": { - "@miniflare/shared-test": "2.0.0-next.3" + "@miniflare/shared-test": "2.0.0-rc.1" }, "engines": { "node": ">=16.7" @@ -9833,15 +9833,15 @@ }, "packages/storage-redis": { "name": "@miniflare/storage-redis", - "version": "2.0.0-next.3", + "version": "2.0.0-rc.1", "license": "MIT", "dependencies": { - "@miniflare/shared": "2.0.0-next.3", - "@miniflare/storage-memory": "2.0.0-next.3", + "@miniflare/shared": "2.0.0-rc.1", + "@miniflare/storage-memory": "2.0.0-rc.1", "ioredis": "^4.27.9" }, "devDependencies": { - "@miniflare/shared-test": "2.0.0-next.3", + "@miniflare/shared-test": "2.0.0-rc.1", "@types/ioredis": "^4.27.2" }, "engines": { @@ -9850,13 +9850,13 @@ }, "packages/watcher": { "name": "@miniflare/watcher", - "version": "2.0.0-next.3", + "version": "2.0.0-rc.1", "license": "MIT", "dependencies": { - "@miniflare/shared": "2.0.0-next.3" + "@miniflare/shared": "2.0.0-rc.1" }, "devDependencies": { - "@miniflare/shared-test": "2.0.0-next.3" + "@miniflare/shared-test": "2.0.0-rc.1" }, "engines": { "node": ">=16.7" @@ -9864,16 +9864,16 @@ }, "packages/web-sockets": { "name": "@miniflare/web-sockets", - "version": "2.0.0-next.3", + "version": "2.0.0-rc.1", "license": "MIT", "dependencies": { - "@miniflare/core": "2.0.0-next.3", - "@miniflare/shared": "2.0.0-next.3", + "@miniflare/core": "2.0.0-rc.1", + "@miniflare/shared": "2.0.0-rc.1", "undici": "^4.9.3", "ws": "^8.2.2" }, "devDependencies": { - "@miniflare/shared-test": "2.0.0-next.3", + "@miniflare/shared-test": "2.0.0-rc.1", "@types/ws": "^8.2.0" }, "engines": { @@ -10960,10 +10960,10 @@ "@miniflare/cache": { "version": "file:packages/cache", "requires": { - "@miniflare/core": "2.0.0-next.3", - "@miniflare/shared": "2.0.0-next.3", - "@miniflare/shared-test": "2.0.0-next.3", - "@miniflare/web-sockets": "2.0.0-next.3", + "@miniflare/core": "2.0.0-rc.1", + "@miniflare/shared": "2.0.0-rc.1", + "@miniflare/shared-test": "2.0.0-rc.1", + "@miniflare/web-sockets": "2.0.0-rc.1", "@types/http-cache-semantics": "^4.0.1", "http-cache-semantics": "^4.1.0", "undici": "^4.9.3" @@ -10972,9 +10972,9 @@ "@miniflare/cli-parser": { "version": "file:packages/cli-parser", "requires": { - "@miniflare/core": "2.0.0-next.3", - "@miniflare/shared": "2.0.0-next.3", - "@miniflare/shared-test": "2.0.0-next.3", + "@miniflare/core": "2.0.0-rc.1", + "@miniflare/shared": "2.0.0-rc.1", + "@miniflare/shared-test": "2.0.0-rc.1", "@types/mri": "^1.1.1", "kleur": "^4.1.4", "mri": "^1.1.6" @@ -10984,10 +10984,10 @@ "version": "file:packages/core", "requires": { "@iarna/toml": "^2.2.5", - "@miniflare/shared": "2.0.0-next.3", - "@miniflare/shared-test": "2.0.0-next.3", - "@miniflare/watcher": "2.0.0-next.3", - "@miniflare/web-sockets": "2.0.0-next.3", + "@miniflare/shared": "2.0.0-rc.1", + "@miniflare/shared-test": "2.0.0-rc.1", + "@miniflare/watcher": "2.0.0-rc.1", + "@miniflare/web-sockets": "2.0.0-rc.1", "@types/busboy": "^0.3.1", "@types/set-cookie-parser": "^2.4.1", "busboy": "^0.3.1", @@ -11001,19 +11001,19 @@ "@miniflare/durable-objects": { "version": "file:packages/durable-objects", "requires": { - "@miniflare/core": "2.0.0-next.3", - "@miniflare/shared": "2.0.0-next.3", - "@miniflare/shared-test": "2.0.0-next.3", - "@miniflare/storage-memory": "2.0.0-next.3", + "@miniflare/core": "2.0.0-rc.1", + "@miniflare/shared": "2.0.0-rc.1", + "@miniflare/shared-test": "2.0.0-rc.1", + "@miniflare/storage-memory": "2.0.0-rc.1", "undici": "^4.9.3" } }, "@miniflare/html-rewriter": { "version": "file:packages/html-rewriter", "requires": { - "@miniflare/core": "2.0.0-next.3", - "@miniflare/shared": "2.0.0-next.3", - "@miniflare/shared-test": "2.0.0-next.3", + "@miniflare/core": "2.0.0-rc.1", + "@miniflare/shared": "2.0.0-rc.1", + "@miniflare/shared-test": "2.0.0-rc.1", "html-rewriter-wasm": "^0.3.2", "undici": "^4.9.3" } @@ -11021,10 +11021,10 @@ "@miniflare/http-server": { "version": "file:packages/http-server", "requires": { - "@miniflare/core": "2.0.0-next.3", - "@miniflare/shared": "2.0.0-next.3", - "@miniflare/shared-test": "2.0.0-next.3", - "@miniflare/web-sockets": "2.0.0-next.3", + "@miniflare/core": "2.0.0-rc.1", + "@miniflare/shared": "2.0.0-rc.1", + "@miniflare/shared-test": "2.0.0-rc.1", + "@miniflare/web-sockets": "2.0.0-rc.1", "@types/node-forge": "^0.10.4", "kleur": "^4.1.4", "selfsigned": "^1.10.11", @@ -11036,30 +11036,30 @@ "@miniflare/kv": { "version": "file:packages/kv", "requires": { - "@miniflare/shared": "2.0.0-next.3", - "@miniflare/shared-test": "2.0.0-next.3" + "@miniflare/shared": "2.0.0-rc.1", + "@miniflare/shared-test": "2.0.0-rc.1" } }, "@miniflare/runner-vm": { "version": "file:packages/runner-vm", "requires": { - "@miniflare/shared": "2.0.0-next.3", - "@miniflare/shared-test": "2.0.0-next.3" + "@miniflare/shared": "2.0.0-rc.1", + "@miniflare/shared-test": "2.0.0-rc.1" } }, "@miniflare/scheduler": { "version": "file:packages/scheduler", "requires": { - "@miniflare/core": "2.0.0-next.3", - "@miniflare/shared": "2.0.0-next.3", - "@miniflare/shared-test": "2.0.0-next.3", + "@miniflare/core": "2.0.0-rc.1", + "@miniflare/shared": "2.0.0-rc.1", + "@miniflare/shared-test": "2.0.0-rc.1", "cron-schedule": "^3.0.4" } }, "@miniflare/shared": { "version": "file:packages/shared", "requires": { - "@miniflare/shared-test": "2.0.0-next.3", + "@miniflare/shared-test": "2.0.0-rc.1", "ignore": "^5.1.8", "kleur": "^4.1.4" } @@ -11067,11 +11067,11 @@ "@miniflare/shared-test": { "version": "file:packages/shared-test", "requires": { - "@miniflare/cli-parser": "2.0.0-next.3", - "@miniflare/core": "2.0.0-next.3", - "@miniflare/runner-vm": "2.0.0-next.3", - "@miniflare/shared": "2.0.0-next.3", - "@miniflare/storage-memory": "2.0.0-next.3", + "@miniflare/cli-parser": "2.0.0-rc.1", + "@miniflare/core": "2.0.0-rc.1", + "@miniflare/runner-vm": "2.0.0-rc.1", + "@miniflare/shared": "2.0.0-rc.1", + "@miniflare/storage-memory": "2.0.0-rc.1", "ws": "^8.2.2" } }, @@ -11079,34 +11079,34 @@ "version": "file:packages/sites", "requires": { "@cloudflare/kv-asset-handler": "^0.1.3", - "@miniflare/core": "2.0.0-next.3", - "@miniflare/kv": "2.0.0-next.3", - "@miniflare/shared": "2.0.0-next.3", - "@miniflare/shared-test": "2.0.0-next.3", - "@miniflare/storage-file": "2.0.0-next.3" + "@miniflare/core": "2.0.0-rc.1", + "@miniflare/kv": "2.0.0-rc.1", + "@miniflare/shared": "2.0.0-rc.1", + "@miniflare/shared-test": "2.0.0-rc.1", + "@miniflare/storage-file": "2.0.0-rc.1" } }, "@miniflare/storage-file": { "version": "file:packages/storage-file", "requires": { - "@miniflare/shared": "2.0.0-next.3", - "@miniflare/shared-test": "2.0.0-next.3", - "@miniflare/storage-memory": "2.0.0-next.3" + "@miniflare/shared": "2.0.0-rc.1", + "@miniflare/shared-test": "2.0.0-rc.1", + "@miniflare/storage-memory": "2.0.0-rc.1" } }, "@miniflare/storage-memory": { "version": "file:packages/storage-memory", "requires": { - "@miniflare/shared": "2.0.0-next.3", - "@miniflare/shared-test": "2.0.0-next.3" + "@miniflare/shared": "2.0.0-rc.1", + "@miniflare/shared-test": "2.0.0-rc.1" } }, "@miniflare/storage-redis": { "version": "file:packages/storage-redis", "requires": { - "@miniflare/shared": "2.0.0-next.3", - "@miniflare/shared-test": "2.0.0-next.3", - "@miniflare/storage-memory": "2.0.0-next.3", + "@miniflare/shared": "2.0.0-rc.1", + "@miniflare/shared-test": "2.0.0-rc.1", + "@miniflare/storage-memory": "2.0.0-rc.1", "@types/ioredis": "^4.27.2", "ioredis": "^4.27.9" } @@ -11114,16 +11114,16 @@ "@miniflare/watcher": { "version": "file:packages/watcher", "requires": { - "@miniflare/shared": "2.0.0-next.3", - "@miniflare/shared-test": "2.0.0-next.3" + "@miniflare/shared": "2.0.0-rc.1", + "@miniflare/shared-test": "2.0.0-rc.1" } }, "@miniflare/web-sockets": { "version": "file:packages/web-sockets", "requires": { - "@miniflare/core": "2.0.0-next.3", - "@miniflare/shared": "2.0.0-next.3", - "@miniflare/shared-test": "2.0.0-next.3", + "@miniflare/core": "2.0.0-rc.1", + "@miniflare/shared": "2.0.0-rc.1", + "@miniflare/shared-test": "2.0.0-rc.1", "@types/ws": "^8.2.0", "undici": "^4.9.3", "ws": "^8.2.2" @@ -14477,19 +14477,19 @@ "jest-environment-miniflare": { "version": "file:packages/jest-environment-miniflare", "requires": { - "@miniflare/cache": "2.0.0-next.3", - "@miniflare/core": "2.0.0-next.3", - "@miniflare/durable-objects": "2.0.0-next.3", - "@miniflare/html-rewriter": "2.0.0-next.3", - "@miniflare/kv": "2.0.0-next.3", - "@miniflare/runner-vm": "2.0.0-next.3", - "@miniflare/shared": "2.0.0-next.3", - "@miniflare/shared-test": "2.0.0-next.3", - "@miniflare/sites": "2.0.0-next.3", - "@miniflare/storage-memory": "2.0.0-next.3", - "@miniflare/web-sockets": "2.0.0-next.3", + "@miniflare/cache": "2.0.0-rc.1", + "@miniflare/core": "2.0.0-rc.1", + "@miniflare/durable-objects": "2.0.0-rc.1", + "@miniflare/html-rewriter": "2.0.0-rc.1", + "@miniflare/kv": "2.0.0-rc.1", + "@miniflare/runner-vm": "2.0.0-rc.1", + "@miniflare/shared": "2.0.0-rc.1", + "@miniflare/shared-test": "2.0.0-rc.1", + "@miniflare/sites": "2.0.0-rc.1", + "@miniflare/storage-memory": "2.0.0-rc.1", + "@miniflare/web-sockets": "2.0.0-rc.1", "jest": "^27.2.1", - "miniflare": "2.0.0-next.3" + "miniflare": "2.0.0-rc.1" } }, "jest-environment-node": { @@ -15278,22 +15278,22 @@ "miniflare": { "version": "file:packages/miniflare", "requires": { - "@miniflare/cache": "2.0.0-next.3", - "@miniflare/cli-parser": "2.0.0-next.3", - "@miniflare/core": "2.0.0-next.3", - "@miniflare/durable-objects": "2.0.0-next.3", - "@miniflare/html-rewriter": "2.0.0-next.3", - "@miniflare/http-server": "2.0.0-next.3", - "@miniflare/kv": "2.0.0-next.3", - "@miniflare/runner-vm": "2.0.0-next.3", - "@miniflare/scheduler": "2.0.0-next.3", - "@miniflare/shared": "2.0.0-next.3", - "@miniflare/shared-test": "2.0.0-next.3", - "@miniflare/sites": "2.0.0-next.3", - "@miniflare/storage-file": "2.0.0-next.3", - "@miniflare/storage-memory": "2.0.0-next.3", - "@miniflare/watcher": "2.0.0-next.3", - "@miniflare/web-sockets": "2.0.0-next.3", + "@miniflare/cache": "2.0.0-rc.1", + "@miniflare/cli-parser": "2.0.0-rc.1", + "@miniflare/core": "2.0.0-rc.1", + "@miniflare/durable-objects": "2.0.0-rc.1", + "@miniflare/html-rewriter": "2.0.0-rc.1", + "@miniflare/http-server": "2.0.0-rc.1", + "@miniflare/kv": "2.0.0-rc.1", + "@miniflare/runner-vm": "2.0.0-rc.1", + "@miniflare/scheduler": "2.0.0-rc.1", + "@miniflare/shared": "2.0.0-rc.1", + "@miniflare/shared-test": "2.0.0-rc.1", + "@miniflare/sites": "2.0.0-rc.1", + "@miniflare/storage-file": "2.0.0-rc.1", + "@miniflare/storage-memory": "2.0.0-rc.1", + "@miniflare/watcher": "2.0.0-rc.1", + "@miniflare/web-sockets": "2.0.0-rc.1", "@types/source-map-support": "^0.5.4", "kleur": "^4.1.4", "semiver": "^1.1.0", diff --git a/package.json b/package.json index 0fb4dc57f..83cba09dc 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@miniflare/root", - "version": "2.0.0-next.3", + "version": "2.0.0-rc.1", "description": "Fun, full-featured, fully-local simulator for Cloudflare Workers", "keywords": [ "cloudflare", diff --git a/packages/cache/package.json b/packages/cache/package.json index ab6046e4f..579d00e8d 100644 --- a/packages/cache/package.json +++ b/packages/cache/package.json @@ -1,6 +1,6 @@ { "name": "@miniflare/cache", - "version": "2.0.0-next.3", + "version": "2.0.0-rc.1", "description": "Cache module for Miniflare: a fun, full-featured, fully-local simulator for Cloudflare Workers", "keywords": [ "cloudflare", @@ -36,14 +36,14 @@ "extends": "../../package.json" }, "dependencies": { - "@miniflare/core": "2.0.0-next.3", - "@miniflare/shared": "2.0.0-next.3", + "@miniflare/core": "2.0.0-rc.1", + "@miniflare/shared": "2.0.0-rc.1", "http-cache-semantics": "^4.1.0", "undici": "^4.9.3" }, "devDependencies": { - "@miniflare/shared-test": "2.0.0-next.3", - "@miniflare/web-sockets": "2.0.0-next.3", + "@miniflare/shared-test": "2.0.0-rc.1", + "@miniflare/web-sockets": "2.0.0-rc.1", "@types/http-cache-semantics": "^4.0.1" } } diff --git a/packages/cli-parser/package.json b/packages/cli-parser/package.json index 0f40ba5ad..512260674 100644 --- a/packages/cli-parser/package.json +++ b/packages/cli-parser/package.json @@ -1,6 +1,6 @@ { "name": "@miniflare/cli-parser", - "version": "2.0.0-next.3", + "version": "2.0.0-rc.1", "description": "CLI option parsing module for Miniflare: a fun, full-featured, fully-local simulator for Cloudflare Workers", "keywords": [ "cloudflare", @@ -36,12 +36,12 @@ "extends": "../../package.json" }, "dependencies": { - "@miniflare/shared": "2.0.0-next.3", + "@miniflare/shared": "2.0.0-rc.1", "kleur": "^4.1.4" }, "devDependencies": { - "@miniflare/core": "2.0.0-next.3", - "@miniflare/shared-test": "2.0.0-next.3", + "@miniflare/core": "2.0.0-rc.1", + "@miniflare/shared-test": "2.0.0-rc.1", "@types/mri": "^1.1.1", "mri": "^1.1.6" } diff --git a/packages/core/package.json b/packages/core/package.json index 26b1dd3bf..5ab06463a 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@miniflare/core", - "version": "2.0.0-next.3", + "version": "2.0.0-rc.1", "description": "Core module for Miniflare: a fun, full-featured, fully-local simulator for Cloudflare Workers", "keywords": [ "cloudflare", @@ -40,7 +40,7 @@ ], "dependencies": { "@iarna/toml": "^2.2.5", - "@miniflare/shared": "2.0.0-next.3", + "@miniflare/shared": "2.0.0-rc.1", "busboy": "^0.3.1", "dotenv": "^10.0.0", "kleur": "^4.1.4", @@ -48,15 +48,15 @@ "undici": "^4.9.3" }, "devDependencies": { - "@miniflare/shared-test": "2.0.0-next.3", - "@miniflare/watcher": "2.0.0-next.3", - "@miniflare/web-sockets": "2.0.0-next.3", + "@miniflare/shared-test": "2.0.0-rc.1", + "@miniflare/watcher": "2.0.0-rc.1", + "@miniflare/web-sockets": "2.0.0-rc.1", "@types/busboy": "^0.3.1", "@types/set-cookie-parser": "^2.4.1", "dequal": "^2.0.2" }, "peerDependencies": { - "@miniflare/watcher": "2.0.0-next.3" + "@miniflare/watcher": "2.0.0-rc.1" }, "peerDependenciesMeta": { "@miniflare/watcher": { diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index 5acec300d..f4341d5d1 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -92,7 +92,7 @@ export type MiniflareCoreOptions = Omit< export type MiniflareCoreErrorCode = | "ERR_NO_SCRIPT" // No script specified but one was required | "ERR_MOUNT_NO_NAME" // Attempted to mount a worker with an empty string name - | "ERR_MOUNT_RECURSIVE" // Attempted to recursively mount workers + | "ERR_MOUNT_NESTED" // Attempted to recursively mount workers | "ERR_MOUNT"; // Error whilst mounting worker export class MiniflareCoreError extends MiniflareError {} @@ -460,8 +460,8 @@ export class MiniflareCore< if ("mounts" in options) { throw new MiniflareCoreError( - "ERR_MOUNT_RECURSIVE", - "Recursive mounts are unsupported" + "ERR_MOUNT_NESTED", + "Nested mounts are unsupported" ); } diff --git a/packages/core/test/index.mounts.spec.ts b/packages/core/test/index.mounts.spec.ts index 52e80fffe..bdeb6f42e 100644 --- a/packages/core/test/index.mounts.spec.ts +++ b/packages/core/test/index.mounts.spec.ts @@ -82,8 +82,8 @@ test("MiniflareCore: #init: throws when attempting to mount recursively", async ); await t.throwsAsync(mf.getPlugins(), { instanceOf: MiniflareCoreError, - code: "ERR_MOUNT_RECURSIVE", - message: "Recursive mounts are unsupported", + code: "ERR_MOUNT_NESTED", + message: "Nested mounts are unsupported", }); }); test("MiniflareCore: #init: updates existing mount options", async (t) => { diff --git a/packages/durable-objects/package.json b/packages/durable-objects/package.json index ca079d19e..dd20c6f94 100644 --- a/packages/durable-objects/package.json +++ b/packages/durable-objects/package.json @@ -1,6 +1,6 @@ { "name": "@miniflare/durable-objects", - "version": "2.0.0-next.3", + "version": "2.0.0-rc.1", "description": "Durable Objects module for Miniflare: a fun, full-featured, fully-local simulator for Cloudflare Workers", "keywords": [ "cloudflare", @@ -36,12 +36,12 @@ "extends": "../../package.json" }, "dependencies": { - "@miniflare/core": "2.0.0-next.3", - "@miniflare/shared": "2.0.0-next.3", - "@miniflare/storage-memory": "2.0.0-next.3", + "@miniflare/core": "2.0.0-rc.1", + "@miniflare/shared": "2.0.0-rc.1", + "@miniflare/storage-memory": "2.0.0-rc.1", "undici": "^4.9.3" }, "devDependencies": { - "@miniflare/shared-test": "2.0.0-next.3" + "@miniflare/shared-test": "2.0.0-rc.1" } } diff --git a/packages/html-rewriter/package.json b/packages/html-rewriter/package.json index 2b80ce457..a15724f60 100644 --- a/packages/html-rewriter/package.json +++ b/packages/html-rewriter/package.json @@ -1,6 +1,6 @@ { "name": "@miniflare/html-rewriter", - "version": "2.0.0-next.3", + "version": "2.0.0-rc.1", "description": "HTMLRewriter module for Miniflare: a fun, full-featured, fully-local simulator for Cloudflare Workers", "keywords": [ "cloudflare", @@ -36,12 +36,12 @@ "extends": "../../package.json" }, "dependencies": { - "@miniflare/core": "2.0.0-next.3", - "@miniflare/shared": "2.0.0-next.3", + "@miniflare/core": "2.0.0-rc.1", + "@miniflare/shared": "2.0.0-rc.1", "html-rewriter-wasm": "^0.3.2", "undici": "^4.9.3" }, "devDependencies": { - "@miniflare/shared-test": "2.0.0-next.3" + "@miniflare/shared-test": "2.0.0-rc.1" } } diff --git a/packages/http-server/package.json b/packages/http-server/package.json index 85514987b..37eae2c32 100644 --- a/packages/http-server/package.json +++ b/packages/http-server/package.json @@ -1,6 +1,6 @@ { "name": "@miniflare/http-server", - "version": "2.0.0-next.3", + "version": "2.0.0-rc.1", "description": "HTTP server module for Miniflare: a fun, full-featured, fully-local simulator for Cloudflare Workers", "keywords": [ "cloudflare", @@ -36,9 +36,9 @@ "extends": "../../package.json" }, "dependencies": { - "@miniflare/core": "2.0.0-next.3", - "@miniflare/shared": "2.0.0-next.3", - "@miniflare/web-sockets": "2.0.0-next.3", + "@miniflare/core": "2.0.0-rc.1", + "@miniflare/shared": "2.0.0-rc.1", + "@miniflare/web-sockets": "2.0.0-rc.1", "kleur": "^4.1.4", "selfsigned": "^1.10.11", "undici": "^4.9.3", @@ -46,7 +46,7 @@ "youch": "^2.2.2" }, "devDependencies": { - "@miniflare/shared-test": "2.0.0-next.3", + "@miniflare/shared-test": "2.0.0-rc.1", "@types/node-forge": "^0.10.4" } } diff --git a/packages/jest-environment-miniflare/package.json b/packages/jest-environment-miniflare/package.json index 3ec70ea1a..53e9d7656 100644 --- a/packages/jest-environment-miniflare/package.json +++ b/packages/jest-environment-miniflare/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "jest-environment-miniflare", - "version": "2.0.0-next.3", + "version": "2.0.0-rc.1", "description": "Jest testing module for Miniflare: a fun, full-featured, fully-local simulator for Cloudflare Workers", "keywords": [ "cloudflare", @@ -37,23 +37,23 @@ "extends": "../../package.json" }, "dependencies": { - "@miniflare/cache": "2.0.0-next.3", - "@miniflare/core": "2.0.0-next.3", - "@miniflare/durable-objects": "2.0.0-next.3", - "@miniflare/html-rewriter": "2.0.0-next.3", - "@miniflare/kv": "2.0.0-next.3", - "@miniflare/runner-vm": "2.0.0-next.3", - "@miniflare/shared": "2.0.0-next.3", - "@miniflare/sites": "2.0.0-next.3", - "@miniflare/storage-memory": "2.0.0-next.3", - "@miniflare/web-sockets": "2.0.0-next.3", - "miniflare": "2.0.0-next.3" + "@miniflare/cache": "2.0.0-rc.1", + "@miniflare/core": "2.0.0-rc.1", + "@miniflare/durable-objects": "2.0.0-rc.1", + "@miniflare/html-rewriter": "2.0.0-rc.1", + "@miniflare/kv": "2.0.0-rc.1", + "@miniflare/runner-vm": "2.0.0-rc.1", + "@miniflare/shared": "2.0.0-rc.1", + "@miniflare/sites": "2.0.0-rc.1", + "@miniflare/storage-memory": "2.0.0-rc.1", + "@miniflare/web-sockets": "2.0.0-rc.1", + "miniflare": "2.0.0-rc.1" }, "peerDependencies": { "jest": ">=27" }, "devDependencies": { - "@miniflare/shared-test": "2.0.0-next.3", + "@miniflare/shared-test": "2.0.0-rc.1", "jest": "^27.2.1" } } diff --git a/packages/jest-environment-miniflare/src/index.ts b/packages/jest-environment-miniflare/src/index.ts index 8002832bb..fdc92499c 100644 --- a/packages/jest-environment-miniflare/src/index.ts +++ b/packages/jest-environment-miniflare/src/index.ts @@ -52,8 +52,8 @@ const log = new NoOpLog(); // Adapted from jest-environment-node: // https://github.com/facebook/jest/blob/8f2cdad7694f4c217ac779d3f4e3a150b5a3d74d/packages/jest-environment-node/src/index.ts export default class MiniflareEnvironment implements JestEnvironment { - config: Config.ProjectConfig; - context: vm.Context | null; + private readonly config: Config.ProjectConfig; + private context: vm.Context | null; fakeTimers: LegacyFakeTimers | null; fakeTimersModern: ModernFakeTimers | null; @@ -61,8 +61,8 @@ export default class MiniflareEnvironment implements JestEnvironment { global: Global.Global; moduleMocker: ModuleMocker | null; - storageFactory = new StackedMemoryStorageFactory(); - scriptRunner: VMScriptRunner; + private readonly storageFactory = new StackedMemoryStorageFactory(); + private readonly scriptRunner: VMScriptRunner; constructor(config: Config.ProjectConfig) { this.config = config; diff --git a/packages/kv/package.json b/packages/kv/package.json index fc473f9cd..44c9fa914 100644 --- a/packages/kv/package.json +++ b/packages/kv/package.json @@ -1,6 +1,6 @@ { "name": "@miniflare/kv", - "version": "2.0.0-next.3", + "version": "2.0.0-rc.1", "description": "Workers KV module for Miniflare: a fun, full-featured, fully-local simulator for Cloudflare Workers", "keywords": [ "cloudflare", @@ -36,9 +36,9 @@ "extends": "../../package.json" }, "dependencies": { - "@miniflare/shared": "2.0.0-next.3" + "@miniflare/shared": "2.0.0-rc.1" }, "devDependencies": { - "@miniflare/shared-test": "2.0.0-next.3" + "@miniflare/shared-test": "2.0.0-rc.1" } } diff --git a/packages/miniflare/README.md b/packages/miniflare/README.md index 43ffb335f..19bfd5a03 100644 --- a/packages/miniflare/README.md +++ b/packages/miniflare/README.md @@ -29,8 +29,8 @@ goals: testing. 2. โœจ **Lightweight:** Miniflare 1 included [122 third-party packages](http://npm.anvaka.com/#/view/2d/miniflare) with a - total install size of `88.3MB`. Miniflare 2 reduces this to **24 packages and - `11.5MB`** ๐Ÿคฏ. This can probably be reduced further too. + total install size of `88.3MB`. Miniflare 2 reduces this to **23 packages and + `6.2MB`** ๐Ÿคฏ. 3. โœ… **Correct:** Miniflare 2 more accurately replicates the quirks and thrown errors of the real Workers runtime, so you'll know before you deploy if things are going to break. @@ -114,6 +114,8 @@ Core Options: -d, --debug Enable debug logging [boolean] -V, --verbose Enable verbose logging [boolean] --(no-)update-check Enable update checker (enabled by default) [boolean] + --root Path to resolve default config files relative to [string] + --mount Mount additional named workers [array:NAME=PATH] HTTP Options: -H, --host Host for HTTP(S) server to listen on [string] diff --git a/packages/miniflare/package.json b/packages/miniflare/package.json index 1182f4991..b69b313fc 100644 --- a/packages/miniflare/package.json +++ b/packages/miniflare/package.json @@ -1,6 +1,6 @@ { "name": "miniflare", - "version": "2.0.0-next.3", + "version": "2.0.0-rc.1", "description": "Fun, full-featured, fully-local simulator for Cloudflare Workers", "keywords": [ "cloudflare", @@ -13,8 +13,8 @@ "license": "MIT", "type": "module", "exports": { - ".": "./dist/src/index.js", - "./cli": "./dist/src/cli.js" + ".": "./dist/src/index.js", + "./cli": "./dist/src/cli.js" }, "types": "./dist/src/index.d.ts", "files": [ @@ -46,32 +46,32 @@ "miniflare": "bootstrap.js" }, "dependencies": { - "@miniflare/cache": "2.0.0-next.3", - "@miniflare/cli-parser": "2.0.0-next.3", - "@miniflare/core": "2.0.0-next.3", - "@miniflare/durable-objects": "2.0.0-next.3", - "@miniflare/html-rewriter": "2.0.0-next.3", - "@miniflare/http-server": "2.0.0-next.3", - "@miniflare/kv": "2.0.0-next.3", - "@miniflare/runner-vm": "2.0.0-next.3", - "@miniflare/scheduler": "2.0.0-next.3", - "@miniflare/shared": "2.0.0-next.3", - "@miniflare/sites": "2.0.0-next.3", - "@miniflare/storage-file": "2.0.0-next.3", - "@miniflare/storage-memory": "2.0.0-next.3", - "@miniflare/watcher": "2.0.0-next.3", - "@miniflare/web-sockets": "2.0.0-next.3", + "@miniflare/cache": "2.0.0-rc.1", + "@miniflare/cli-parser": "2.0.0-rc.1", + "@miniflare/core": "2.0.0-rc.1", + "@miniflare/durable-objects": "2.0.0-rc.1", + "@miniflare/html-rewriter": "2.0.0-rc.1", + "@miniflare/http-server": "2.0.0-rc.1", + "@miniflare/kv": "2.0.0-rc.1", + "@miniflare/runner-vm": "2.0.0-rc.1", + "@miniflare/scheduler": "2.0.0-rc.1", + "@miniflare/shared": "2.0.0-rc.1", + "@miniflare/sites": "2.0.0-rc.1", + "@miniflare/storage-file": "2.0.0-rc.1", + "@miniflare/storage-memory": "2.0.0-rc.1", + "@miniflare/watcher": "2.0.0-rc.1", + "@miniflare/web-sockets": "2.0.0-rc.1", "kleur": "^4.1.4", "semiver": "^1.1.0", "source-map-support": "^0.5.20", "undici": "^4.9.3" }, "devDependencies": { - "@miniflare/shared-test": "2.0.0-next.3", + "@miniflare/shared-test": "2.0.0-rc.1", "@types/source-map-support": "^0.5.4" }, "peerDependencies": { - "@miniflare/storage-redis": "2.0.0-next.3", + "@miniflare/storage-redis": "2.0.0-rc.1", "cron-schedule": "^3.0.4", "ioredis": "^4.27.9" }, diff --git a/packages/runner-vm/package.json b/packages/runner-vm/package.json index 3c289d85d..b8c03cc07 100644 --- a/packages/runner-vm/package.json +++ b/packages/runner-vm/package.json @@ -1,6 +1,6 @@ { "name": "@miniflare/runner-vm", - "version": "2.0.0-next.3", + "version": "2.0.0-rc.1", "description": "VM script runner module for Miniflare: a fun, full-featured, fully-local simulator for Cloudflare Workers", "keywords": [ "cloudflare", @@ -36,9 +36,9 @@ "extends": "../../package.json" }, "dependencies": { - "@miniflare/shared": "2.0.0-next.3" + "@miniflare/shared": "2.0.0-rc.1" }, "devDependencies": { - "@miniflare/shared-test": "2.0.0-next.3" + "@miniflare/shared-test": "2.0.0-rc.1" } } diff --git a/packages/scheduler/package.json b/packages/scheduler/package.json index 4c31ab815..fa6bb177d 100644 --- a/packages/scheduler/package.json +++ b/packages/scheduler/package.json @@ -1,6 +1,6 @@ { "name": "@miniflare/scheduler", - "version": "2.0.0-next.3", + "version": "2.0.0-rc.1", "description": "Scheduler module for Miniflare: a fun, full-featured, fully-local simulator for Cloudflare Workers", "keywords": [ "cloudflare", @@ -36,11 +36,11 @@ "extends": "../../package.json" }, "dependencies": { - "@miniflare/core": "2.0.0-next.3", - "@miniflare/shared": "2.0.0-next.3", + "@miniflare/core": "2.0.0-rc.1", + "@miniflare/shared": "2.0.0-rc.1", "cron-schedule": "^3.0.4" }, "devDependencies": { - "@miniflare/shared-test": "2.0.0-next.3" + "@miniflare/shared-test": "2.0.0-rc.1" } } diff --git a/packages/scheduler/src/index.ts b/packages/scheduler/src/index.ts index 10f29e9f3..915ef36d8 100644 --- a/packages/scheduler/src/index.ts +++ b/packages/scheduler/src/index.ts @@ -79,6 +79,6 @@ export async function startScheduler( cronScheduler?: Promise ): Promise> { const scheduler = new Scheduler(mf, cronScheduler); - await scheduler[kReload](new ReloadEvent(await mf.getPlugins())); + await scheduler[kReload](new ReloadEvent(await mf.getPlugins(), false)); return scheduler; } diff --git a/packages/shared-test/package.json b/packages/shared-test/package.json index 779049a80..f85a475f1 100644 --- a/packages/shared-test/package.json +++ b/packages/shared-test/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@miniflare/shared-test", - "version": "2.0.0-next.3", + "version": "2.0.0-rc.1", "description": "Shared testing utility module for Miniflare: a fun, full-featured, fully-local simulator for Cloudflare Workers", "keywords": [ "cloudflare", @@ -34,11 +34,11 @@ "extends": "../../package.json" }, "dependencies": { - "@miniflare/cli-parser": "2.0.0-next.3", - "@miniflare/core": "2.0.0-next.3", - "@miniflare/runner-vm": "2.0.0-next.3", - "@miniflare/shared": "2.0.0-next.3", - "@miniflare/storage-memory": "2.0.0-next.3", + "@miniflare/cli-parser": "2.0.0-rc.1", + "@miniflare/core": "2.0.0-rc.1", + "@miniflare/runner-vm": "2.0.0-rc.1", + "@miniflare/shared": "2.0.0-rc.1", + "@miniflare/storage-memory": "2.0.0-rc.1", "ws": "^8.2.2" } } diff --git a/packages/shared/package.json b/packages/shared/package.json index 7b3bec097..c451b4009 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,6 +1,6 @@ { "name": "@miniflare/shared", - "version": "2.0.0-next.3", + "version": "2.0.0-rc.1", "description": "Shared utility module for Miniflare: a fun, full-featured, fully-local simulator for Cloudflare Workers", "keywords": [ "cloudflare", @@ -40,6 +40,6 @@ "kleur": "^4.1.4" }, "devDependencies": { - "@miniflare/shared-test": "2.0.0-next.3" + "@miniflare/shared-test": "2.0.0-rc.1" } } diff --git a/packages/sites/package.json b/packages/sites/package.json index d4d762e42..29552acce 100644 --- a/packages/sites/package.json +++ b/packages/sites/package.json @@ -1,6 +1,6 @@ { "name": "@miniflare/sites", - "version": "2.0.0-next.3", + "version": "2.0.0-rc.1", "description": "Workers Sites module for Miniflare: a fun, full-featured, fully-local simulator for Cloudflare Workers", "keywords": [ "cloudflare", @@ -40,13 +40,13 @@ "test/fixtures/plugin.assetHandler.modules.js" ], "dependencies": { - "@miniflare/kv": "2.0.0-next.3", - "@miniflare/shared": "2.0.0-next.3", - "@miniflare/storage-file": "2.0.0-next.3" + "@miniflare/kv": "2.0.0-rc.1", + "@miniflare/shared": "2.0.0-rc.1", + "@miniflare/storage-file": "2.0.0-rc.1" }, "devDependencies": { "@cloudflare/kv-asset-handler": "^0.1.3", - "@miniflare/core": "2.0.0-next.3", - "@miniflare/shared-test": "2.0.0-next.3" + "@miniflare/core": "2.0.0-rc.1", + "@miniflare/shared-test": "2.0.0-rc.1" } } diff --git a/packages/storage-file/package.json b/packages/storage-file/package.json index 02fe018ec..043a2bd5c 100644 --- a/packages/storage-file/package.json +++ b/packages/storage-file/package.json @@ -1,6 +1,6 @@ { "name": "@miniflare/storage-file", - "version": "2.0.0-next.3", + "version": "2.0.0-rc.1", "description": "File-system storage module for Miniflare: a fun, full-featured, fully-local simulator for Cloudflare Workers", "keywords": [ "cloudflare", @@ -36,10 +36,10 @@ "extends": "../../package.json" }, "dependencies": { - "@miniflare/shared": "2.0.0-next.3", - "@miniflare/storage-memory": "2.0.0-next.3" + "@miniflare/shared": "2.0.0-rc.1", + "@miniflare/storage-memory": "2.0.0-rc.1" }, "devDependencies": { - "@miniflare/shared-test": "2.0.0-next.3" + "@miniflare/shared-test": "2.0.0-rc.1" } } diff --git a/packages/storage-memory/package.json b/packages/storage-memory/package.json index 3f2e97ed5..aeb282e39 100644 --- a/packages/storage-memory/package.json +++ b/packages/storage-memory/package.json @@ -1,6 +1,6 @@ { "name": "@miniflare/storage-memory", - "version": "2.0.0-next.3", + "version": "2.0.0-rc.1", "description": "In-memory storage module for Miniflare: a fun, full-featured, fully-local simulator for Cloudflare Workers", "keywords": [ "cloudflare", @@ -36,9 +36,9 @@ "extends": "../../package.json" }, "dependencies": { - "@miniflare/shared": "2.0.0-next.3" + "@miniflare/shared": "2.0.0-rc.1" }, "devDependencies": { - "@miniflare/shared-test": "2.0.0-next.3" + "@miniflare/shared-test": "2.0.0-rc.1" } } diff --git a/packages/storage-redis/package.json b/packages/storage-redis/package.json index d3d7129d3..f3933d06f 100644 --- a/packages/storage-redis/package.json +++ b/packages/storage-redis/package.json @@ -1,6 +1,6 @@ { "name": "@miniflare/storage-redis", - "version": "2.0.0-next.3", + "version": "2.0.0-rc.1", "description": "Redis storage module for Miniflare: a fun, full-featured, fully-local simulator for Cloudflare Workers", "keywords": [ "cloudflare", @@ -36,12 +36,12 @@ "extends": "../../package.json" }, "dependencies": { - "@miniflare/shared": "2.0.0-next.3", - "@miniflare/storage-memory": "2.0.0-next.3", + "@miniflare/shared": "2.0.0-rc.1", + "@miniflare/storage-memory": "2.0.0-rc.1", "ioredis": "^4.27.9" }, "devDependencies": { - "@miniflare/shared-test": "2.0.0-next.3", + "@miniflare/shared-test": "2.0.0-rc.1", "@types/ioredis": "^4.27.2" } } diff --git a/packages/watcher/package.json b/packages/watcher/package.json index 1e9c68b5e..64752582f 100644 --- a/packages/watcher/package.json +++ b/packages/watcher/package.json @@ -1,6 +1,6 @@ { "name": "@miniflare/watcher", - "version": "2.0.0-next.3", + "version": "2.0.0-rc.1", "description": "File-system watcher module for Miniflare: a fun, full-featured, fully-local simulator for Cloudflare Workers", "keywords": [ "cloudflare", @@ -36,9 +36,9 @@ "extends": "../../package.json" }, "dependencies": { - "@miniflare/shared": "2.0.0-next.3" + "@miniflare/shared": "2.0.0-rc.1" }, "devDependencies": { - "@miniflare/shared-test": "2.0.0-next.3" + "@miniflare/shared-test": "2.0.0-rc.1" } } diff --git a/packages/web-sockets/package.json b/packages/web-sockets/package.json index 4637d4e2b..27a5cbb7f 100644 --- a/packages/web-sockets/package.json +++ b/packages/web-sockets/package.json @@ -1,6 +1,6 @@ { "name": "@miniflare/web-sockets", - "version": "2.0.0-next.3", + "version": "2.0.0-rc.1", "description": "WebSocket module for Miniflare: a fun, full-featured, fully-local simulator for Cloudflare Workers", "keywords": [ "cloudflare", @@ -36,13 +36,13 @@ "extends": "../../package.json" }, "dependencies": { - "@miniflare/core": "2.0.0-next.3", - "@miniflare/shared": "2.0.0-next.3", + "@miniflare/core": "2.0.0-rc.1", + "@miniflare/shared": "2.0.0-rc.1", "ws": "^8.2.2", "undici": "^4.9.3" }, "devDependencies": { - "@miniflare/shared-test": "2.0.0-next.3", + "@miniflare/shared-test": "2.0.0-rc.1", "@types/ws": "^8.2.0" } }