@sanity/client 3.3.3-esm.14 → 3.3.3-esm.16

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.
@@ -0,0 +1,9 @@
1
+ // If fetch is defined we assume it's either a browser or a worker env (Bun, Deno or Edge) and we divert to the browser version
2
+ // Although Node is shipping `fetch` support soon this check
3
+ // won't affect it as Node respects conditional package exports and this file ain't listed.
4
+ // The EdgeRuntime check is to support dead-code elimination on Vercel Edge Functions:
5
+ // https://edge-runtime.vercel.sh/features/available-apis#addressing-the-runtime
6
+ module.exports =
7
+ typeof fetch === 'function' || typeof EdgeRuntime === 'string'
8
+ ? require('./dist/sanityClient.browser.mjs')
9
+ : require('./lib/sanityClient.js')
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@sanity/client",
3
- "version": "3.3.3-esm.14",
3
+ "version": "3.3.3-esm.16",
4
4
  "description": "Client for retrieving, creating and patching data from Sanity.io",
5
5
  "type": "commonjs",
6
6
  "main": "lib/sanityClient.js",
7
- "module": "./edge-or-node.js",
7
+ "module": "./index.module.js",
8
8
  "umd": "umd/sanityClient.min.js",
9
9
  "unpkg": "umd/sanityClient.min.js",
10
10
  "types": "./sanityClient.d.ts",
@@ -22,7 +22,7 @@
22
22
  "dist",
23
23
  "lib",
24
24
  "umd",
25
- "edge-or-node.js",
25
+ "index.module.js",
26
26
  "sanityClient.d.ts"
27
27
  ],
28
28
  "scripts": {
@@ -50,7 +50,7 @@
50
50
  },
51
51
  "dependencies": {
52
52
  "@sanity/eventsource": "^4.0.0",
53
- "get-it": "6.1.1-esm.10",
53
+ "get-it": "6.1.1-esm.13",
54
54
  "make-error": "^1.3.0",
55
55
  "rxjs": "^6.6.7"
56
56
  },
package/edge-or-node.js DELETED
@@ -1,8 +0,0 @@
1
- // Vercel's Edge Runtime works fine when using a bundler like Next.js, but if it's a vanilla
2
- // function it's not adhering to pkg.exports, but it does adhere to pkg.module
3
- // Based on https://github.com/vercel/edge-runtime/blob/1bd7684d479696843013520b0ce86c728566ec2a/packages/ponyfill/src/index.js#L1-L2
4
-
5
- module.exports =
6
- typeof EdgeRuntime === 'string'
7
- ? require('./dist/sanityClient.browser.mjs')
8
- : require('./lib/sanityClient.js')