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

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.
package/index.js ADDED
@@ -0,0 +1,7 @@
1
+ // The EdgeRuntime check is to support dead-code elimination on Vercel Edge Functions:
2
+ // https://edge-runtime.vercel.sh/features/available-apis#addressing-the-runtime
3
+ if (typeof EdgeRuntime === 'string') {
4
+ module.exports = require('./dist/sanityClient.browser.mjs')
5
+ } else {
6
+ module.exports = require('./lib/sanityClient.js')
7
+ }
package/package.json CHANGED
@@ -1,10 +1,9 @@
1
1
  {
2
2
  "name": "@sanity/client",
3
- "version": "3.3.3-esm.14",
3
+ "version": "3.3.3-esm.18",
4
4
  "description": "Client for retrieving, creating and patching data from Sanity.io",
5
5
  "type": "commonjs",
6
- "main": "lib/sanityClient.js",
7
- "module": "./edge-or-node.js",
6
+ "main": "index.js",
8
7
  "umd": "umd/sanityClient.min.js",
9
8
  "unpkg": "umd/sanityClient.min.js",
10
9
  "types": "./sanityClient.d.ts",
@@ -22,7 +21,7 @@
22
21
  "dist",
23
22
  "lib",
24
23
  "umd",
25
- "edge-or-node.js",
24
+ "index.js",
26
25
  "sanityClient.d.ts"
27
26
  ],
28
27
  "scripts": {
@@ -50,7 +49,7 @@
50
49
  },
51
50
  "dependencies": {
52
51
  "@sanity/eventsource": "^4.0.0",
53
- "get-it": "6.1.1-esm.10",
52
+ "get-it": "6.1.1-esm.13",
54
53
  "make-error": "^1.3.0",
55
54
  "rxjs": "^6.6.7"
56
55
  },
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')