Skip to content

Commit

Permalink
refactor!: drop experimental vendor presets (#366)
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 authored Dec 3, 2024
1 parent 380be9f commit 9fa8622
Show file tree
Hide file tree
Showing 8 changed files with 1 addition and 327 deletions.
46 changes: 0 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,52 +81,6 @@ import { env, nodeless } from "unenv";
const envConfig = env(nodeless, {});
```

### `deno`

[(view source)](./src/presets/deno.ts)

This preset can be used to extend `nodeless` to use Deno's Node.js API Compatibility ([docs](https://docs.deno.com/runtime/manual/node/compatibility), [docs](https://docs.deno.com/deploy/api/runtime-node)).

> [!WARNING]
> This preset is **experimental** and behavior might change!
```js
import { env, nodeless, deno } from "unenv";

const envConfig = env(nodeless, deno, {});
```

### `cloudflare`

[(view source)](./src/presets/cloudflare.ts)

This preset can be used to extend `nodeless` to use [Cloudflare Worker](https://workers.cloudflare.com/) Node.js API Compatibility ([docs](https://developers.cloudflare.com/workers/runtime-apis/nodejs/)).

> [!WARNING]
> This preset is **experimental** and behavior might change!
> [!NOTE]
> Make sure to enable [`nodejs_compat`](https://developers.cloudflare.com/workers/configuration/compatibility-dates/#nodejs-compatibility-flag) compatibility flag.
```js
import { env, nodeless, cloudflare } from "unenv";

const envConfig = env(nodeless, cloudflare, {});
```

### `vercel`

This preset can be used to extend `nodeless` to use [Vercel Edge](https://vercel.com/docs/functions/edge-functions/edge-runtime) Node.js API Compatibility ([docs](https://vercel.com/docs/functions/edge-functions/edge-runtime#compatible-node.js-modules)).

> [!WARNING]
> This preset is **experimental** and behavior might change!
```js
import { env, nodeless, vercel } from "unenv";

const envConfig = env(nodeless, vercel, {});
```

## Built-in Node.js modules

`unenv` provides a replacement for Node.js built-in modules compatible with any runtime.
Expand Down
5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,10 @@
"prepack": "unbuild",
"release": "pnpm test && changelogen --release && pnpm publish && git push --follow-tags",
"test": "pnpm lint && pnpm test:types && pnpm test:node",
"test:cf": "pnpm jiti test/cloudflare.ts",
"test:deno": "NODE_NO_WARNINGS=1 pnpm jiti test/deno.ts",
"test:node": "node --test --import jiti/register ./test/node/test-*",
"test:node-coverage": "node test/node-coverage.mjs",
"test:node:watch": "node --test --watch --import jiti/register ./test/node/test-*",
"test:types": "tsc --noEmit",
"test:vc": "pnpm jiti test/vercel.ts",
"test:workerd": "node test/workerd/main.mjs"
},
"dependencies": {
Expand All @@ -64,4 +61,4 @@
"wrangler": "^3.91.0"
},
"packageManager": "pnpm@9.14.4"
}
}
77 changes: 0 additions & 77 deletions src/presets/deno.ts

This file was deleted.

2 changes: 0 additions & 2 deletions src/presets/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
export { default as node } from "./node";
export { default as nodeless } from "./nodeless";
export { default as deno } from "./deno";
export { default as cloudflare } from "./cloudflare";
export { default as vercel } from "./vercel";
25 changes: 0 additions & 25 deletions src/presets/vercel.ts

This file was deleted.

43 changes: 0 additions & 43 deletions test/cloudflare.ts

This file was deleted.

37 changes: 0 additions & 37 deletions test/deno.ts

This file was deleted.

93 changes: 0 additions & 93 deletions test/vercel.ts

This file was deleted.

0 comments on commit 9fa8622

Please sign in to comment.