@uniformdev/cli 19.214.1-alpha.36 → 19.214.1-alpha.37

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/dist/index.mjs +12 -2
  2. package/package.json +9 -9
package/dist/index.mjs CHANGED
@@ -735,6 +735,7 @@ import fsj3 from "fs-jetpack";
735
735
  import sizeOf from "image-size";
736
736
  import PQueue from "p-queue";
737
737
  import { join as join5 } from "path";
738
+ var uploadQueueByKey = /* @__PURE__ */ new Map();
738
739
  var fileUploadQueue = new PQueue({ concurrency: 10 });
739
740
  var uploadFile = async ({
740
741
  fileClient,
@@ -742,7 +743,13 @@ var uploadFile = async ({
742
743
  directory,
743
744
  fileId
744
745
  }) => {
745
- return await fileUploadQueue.add(async () => {
746
+ const key = `${fileId}-${fileUrl}`;
747
+ if (uploadQueueByKey.has(key)) {
748
+ console.log("Already have this queued!!!");
749
+ const result2 = await uploadQueueByKey.get(key);
750
+ return result2 ?? null;
751
+ }
752
+ const promise = fileUploadQueue.add(async () => {
746
753
  try {
747
754
  const writeDirectory = getFilesDirectory(directory);
748
755
  const hash = urlToHash(fileUrl);
@@ -835,7 +842,10 @@ var uploadFile = async ({
835
842
  console.warn(`Failed to upload file ${fileUrl}`, e);
836
843
  return null;
837
844
  }
838
- }) ?? null;
845
+ });
846
+ uploadQueueByKey.set(key, promise);
847
+ const result = await promise;
848
+ return result ?? null;
839
849
  };
840
850
 
841
851
  // src/files/walkFileUrlsForCompositionOrEntry.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/cli",
3
- "version": "19.214.1-alpha.36+4b318f1483",
3
+ "version": "19.214.1-alpha.37+a5e3049327",
4
4
  "description": "Uniform command line interface tool",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./cli.js",
@@ -27,13 +27,13 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@thi.ng/mime": "^2.2.23",
30
- "@uniformdev/assets": "19.214.1-alpha.36+4b318f1483",
31
- "@uniformdev/canvas": "19.214.1-alpha.36+4b318f1483",
32
- "@uniformdev/context": "19.214.1-alpha.36+4b318f1483",
33
- "@uniformdev/files": "19.214.1-alpha.36+4b318f1483",
34
- "@uniformdev/project-map": "19.214.1-alpha.36+4b318f1483",
35
- "@uniformdev/redirect": "19.214.1-alpha.36+4b318f1483",
36
- "@uniformdev/richtext": "19.214.1-alpha.36+4b318f1483",
30
+ "@uniformdev/assets": "19.214.1-alpha.37+a5e3049327",
31
+ "@uniformdev/canvas": "19.214.1-alpha.37+a5e3049327",
32
+ "@uniformdev/context": "19.214.1-alpha.37+a5e3049327",
33
+ "@uniformdev/files": "19.214.1-alpha.37+a5e3049327",
34
+ "@uniformdev/project-map": "19.214.1-alpha.37+a5e3049327",
35
+ "@uniformdev/redirect": "19.214.1-alpha.37+a5e3049327",
36
+ "@uniformdev/richtext": "19.214.1-alpha.37+a5e3049327",
37
37
  "call-bind": "^1.0.2",
38
38
  "colorette": "2.0.20",
39
39
  "cosmiconfig": "9.0.0",
@@ -79,5 +79,5 @@
79
79
  "publishConfig": {
80
80
  "access": "public"
81
81
  },
82
- "gitHead": "4b318f14833bf95e342b4e6047a597ebe72c366a"
82
+ "gitHead": "a5e3049327e1d7e0bb0fb4e0c9a74dd4b9487c54"
83
83
  }