@sanity/export 5.0.0 → 5.0.1

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/export.js +16 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/export",
3
- "version": "5.0.0",
3
+ "version": "5.0.1",
4
4
  "description": "Export Sanity documents and assets",
5
5
  "keywords": [
6
6
  "sanity",
package/src/export.js CHANGED
@@ -4,6 +4,7 @@ import {tmpdir} from 'node:os'
4
4
  import {join as joinPath} from 'node:path'
5
5
  import {PassThrough} from 'node:stream'
6
6
  import {finished, pipeline} from 'node:stream/promises'
7
+ import {deprecate} from 'node:util'
7
8
  import {constants as zlib} from 'node:zlib'
8
9
 
9
10
  import archiver from 'archiver'
@@ -317,3 +318,18 @@ function getDocumentInputStream(options) {
317
318
 
318
319
  throw new Error(`Invalid mode: ${options.mode}`)
319
320
  }
321
+
322
+ /**
323
+ * Alias for `exportDataset`, for backwards compatibility.
324
+ * Use named `exportDataset` instead.
325
+ *
326
+ * @deprecated Default export is deprecated and will be removed in a future release. Use named "exportDataset" function instead.
327
+ * @public
328
+ */
329
+ export default deprecate(
330
+ function deprecatedExport(opts) {
331
+ return exportDataset(opts)
332
+ },
333
+ `Default export of "@sanity/export" is deprecated and will be removed in a future release. Please use the named "exportDataset" function instead.`,
334
+ 'DEP_SANITY_EXPORT_DEFAULT',
335
+ )