@sanity/export 2.36.2-weighted-search.10 → 2.36.2-weighted-search.15

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.
@@ -37,6 +37,8 @@ var ASSET_DOWNLOAD_CONCURRENCY = 8;
37
37
  class AssetHandler {
38
38
  constructor(options) {
39
39
  var _this = this;
40
+ // Called when we want to download all assets to local filesystem and rewrite documents to hold
41
+ // placeholder asset references (_sanityAsset: 'image@file:///local/path')
40
42
  _defineProperty(this, "rewriteAssets", miss.through.obj( /*#__PURE__*/function () {
41
43
  var _ref = _asyncToGenerator(function* (doc, enc, callback) {
42
44
  if (['sanity.imageAsset', 'sanity.fileAsset'].includes(doc._type)) {
@@ -53,6 +55,8 @@ class AssetHandler {
53
55
  return _ref.apply(this, arguments);
54
56
  };
55
57
  }()));
58
+ // Called in the case where we don't _want_ assets, so basically just remove all asset documents
59
+ // as well as references to assets (*.asset._ref ^= (image|file)-)
56
60
  _defineProperty(this, "stripAssets", miss.through.obj( /*#__PURE__*/function () {
57
61
  var _ref2 = _asyncToGenerator(function* (doc, enc, callback) {
58
62
  if (['sanity.imageAsset', 'sanity.fileAsset'].includes(doc._type)) {
@@ -65,6 +69,8 @@ class AssetHandler {
65
69
  return _ref2.apply(this, arguments);
66
70
  };
67
71
  }()));
72
+ // Called when we are using raw export mode along with `assets: false`, where we simply
73
+ // want to skip asset documents but retain asset references (useful for data mangling)
68
74
  _defineProperty(this, "skipAssets", miss.through.obj((doc, enc, callback) => {
69
75
  var isAsset = ['sanity.imageAsset', 'sanity.fileAsset'].includes(doc._type);
70
76
  if (isAsset) {
@@ -141,10 +147,6 @@ class AssetHandler {
141
147
  this.queue.onIdle().then(() => resolve(this.assetMap));
142
148
  });
143
149
  }
144
-
145
- // Called when we want to download all assets to local filesystem and rewrite documents to hold
146
- // placeholder asset references (_sanityAsset: 'image@file:///local/path')
147
-
148
150
  queueAssetDownload(assetDoc, dstPath, type) {
149
151
  if (!assetDoc.url) {
150
152
  debug('Asset document "%s" does not have a URL property, skipping', assetDoc._id);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/export",
3
- "version": "2.36.2-weighted-search.10+897c60f97",
3
+ "version": "2.36.2-weighted-search.15+ba27885fc",
4
4
  "description": "Export Sanity documents and assets",
5
5
  "main": "lib/export.js",
6
6
  "engines": {
@@ -49,5 +49,5 @@
49
49
  "url": "https://github.com/sanity-io/sanity/issues"
50
50
  },
51
51
  "homepage": "https://www.sanity.io/",
52
- "gitHead": "897c60f9788ebc7d30e20843d603609972563c43"
52
+ "gitHead": "ba27885fc586fa0e88578e6f3b537e864248fd49"
53
53
  }