@uniformdev/cli 19.75.0 → 19.75.1-alpha.30
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/dist/index.mjs +12 -8
- package/package.json +8 -8
package/dist/index.mjs
CHANGED
|
@@ -677,7 +677,7 @@ import { createHash } from "crypto";
|
|
|
677
677
|
import fsj from "fs-jetpack";
|
|
678
678
|
import sizeOf from "image-size";
|
|
679
679
|
import PQueue from "p-queue";
|
|
680
|
-
import { join as join2 } from "path";
|
|
680
|
+
import { dirname as dirname2, join as join2 } from "path";
|
|
681
681
|
var FILES_DIRECTORY_NAME = "files";
|
|
682
682
|
var urlToHash = (url) => {
|
|
683
683
|
const hash = createHash("sha256");
|
|
@@ -723,10 +723,9 @@ var extractAndDownloadUniformFilesForObject = async (object, options) => {
|
|
|
723
723
|
return;
|
|
724
724
|
}
|
|
725
725
|
const fileBuffer = await response.arrayBuffer();
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
);
|
|
726
|
+
const isPackage = isPathAPackageFile(options.directory);
|
|
727
|
+
const writeDirectory = isPackage ? dirname2(options.directory) : options.directory;
|
|
728
|
+
await fsj.writeAsync(join2(writeDirectory, FILES_DIRECTORY_NAME, fileName), Buffer.from(fileBuffer));
|
|
730
729
|
} catch {
|
|
731
730
|
console.warn(`Failed to download file ${url}`);
|
|
732
731
|
}
|
|
@@ -782,9 +781,10 @@ var extractAndUploadUniformFilesForObject = async (object, options) => {
|
|
|
782
781
|
};
|
|
783
782
|
}
|
|
784
783
|
})();
|
|
784
|
+
const mimeType = preferredType(url.split(".").at(-1) ?? "");
|
|
785
785
|
const { id, method, uploadUrl } = await options.fileClient.insert({
|
|
786
786
|
name: fileName,
|
|
787
|
-
mediaType:
|
|
787
|
+
mediaType: mimeType,
|
|
788
788
|
size: fileBuffer.length,
|
|
789
789
|
width,
|
|
790
790
|
height,
|
|
@@ -792,7 +792,11 @@ var extractAndUploadUniformFilesForObject = async (object, options) => {
|
|
|
792
792
|
});
|
|
793
793
|
const uploadResponse = await fetch(uploadUrl, {
|
|
794
794
|
method,
|
|
795
|
-
body: fileBuffer
|
|
795
|
+
body: fileBuffer,
|
|
796
|
+
headers: {
|
|
797
|
+
"Content-Type": mimeType,
|
|
798
|
+
"Content-Length": fileBuffer.length.toString()
|
|
799
|
+
}
|
|
796
800
|
});
|
|
797
801
|
if (!uploadResponse.ok) {
|
|
798
802
|
console.warn(`Failed to upload file ${url}`);
|
|
@@ -5441,7 +5445,7 @@ import { PostHog } from "posthog-node";
|
|
|
5441
5445
|
// package.json
|
|
5442
5446
|
var package_default = {
|
|
5443
5447
|
name: "@uniformdev/cli",
|
|
5444
|
-
version: "19.75.
|
|
5448
|
+
version: "19.75.1",
|
|
5445
5449
|
description: "Uniform command line interface tool",
|
|
5446
5450
|
license: "SEE LICENSE IN LICENSE.txt",
|
|
5447
5451
|
main: "./cli.js",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/cli",
|
|
3
|
-
"version": "19.75.
|
|
3
|
+
"version": "19.75.1-alpha.30+4b3edf13d",
|
|
4
4
|
"description": "Uniform command line interface tool",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"main": "./cli.js",
|
|
@@ -17,12 +17,12 @@
|
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@thi.ng/mime": "^2.2.23",
|
|
20
|
-
"@uniformdev/assets": "19.75.
|
|
21
|
-
"@uniformdev/canvas": "19.75.
|
|
22
|
-
"@uniformdev/context": "19.75.
|
|
23
|
-
"@uniformdev/files": "19.75.
|
|
24
|
-
"@uniformdev/project-map": "19.75.
|
|
25
|
-
"@uniformdev/redirect": "19.75.
|
|
20
|
+
"@uniformdev/assets": "19.75.1-alpha.30+4b3edf13d",
|
|
21
|
+
"@uniformdev/canvas": "19.75.1-alpha.30+4b3edf13d",
|
|
22
|
+
"@uniformdev/context": "19.75.1-alpha.30+4b3edf13d",
|
|
23
|
+
"@uniformdev/files": "19.75.1-alpha.30+4b3edf13d",
|
|
24
|
+
"@uniformdev/project-map": "19.75.1-alpha.30+4b3edf13d",
|
|
25
|
+
"@uniformdev/redirect": "19.75.1-alpha.30+4b3edf13d",
|
|
26
26
|
"call-bind": "^1.0.2",
|
|
27
27
|
"colorette": "2.0.20",
|
|
28
28
|
"cosmiconfig": "8.3.6",
|
|
@@ -69,5 +69,5 @@
|
|
|
69
69
|
"publishConfig": {
|
|
70
70
|
"access": "public"
|
|
71
71
|
},
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "4b3edf13dfea6d5d0ffa8c1ca1ac9a54013a3350"
|
|
73
73
|
}
|