@uniformdev/cli 19.79.0 → 19.80.0
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 +11 -7
- package/package.json +8 -8
package/dist/index.mjs
CHANGED
|
@@ -691,8 +691,10 @@ var urlToFileName = (url) => {
|
|
|
691
691
|
return `${fileName}${fileExtension ? `.${fileExtension}` : ""}`;
|
|
692
692
|
};
|
|
693
693
|
var deleteDownloadedFileByUrl = async (url, options) => {
|
|
694
|
+
const isPackage = isPathAPackageFile(options.directory);
|
|
695
|
+
const writeDirectory = isPackage ? dirname2(options.directory) : options.directory;
|
|
694
696
|
const fileName = urlToFileName(url);
|
|
695
|
-
const fileToDelete = join2(
|
|
697
|
+
const fileToDelete = join2(writeDirectory, FILES_DIRECTORY_NAME, fileName);
|
|
696
698
|
try {
|
|
697
699
|
await fsj.removeAsync(fileToDelete);
|
|
698
700
|
} catch {
|
|
@@ -704,6 +706,8 @@ var extractAndDownloadUniformFilesForObject = async (object, options) => {
|
|
|
704
706
|
const uniformFileUrlMatches = objectAsString.matchAll(
|
|
705
707
|
/"(https:\/\/(.*)?img\.uniform\.(rocks|global)\/(.*?))"/g
|
|
706
708
|
);
|
|
709
|
+
const isPackage = isPathAPackageFile(options.directory);
|
|
710
|
+
const writeDirectory = isPackage ? dirname2(options.directory) : options.directory;
|
|
707
711
|
if (uniformFileUrlMatches) {
|
|
708
712
|
const fileDownloadQueue = new PQueue({ concurrency: 10 });
|
|
709
713
|
for (const match of uniformFileUrlMatches) {
|
|
@@ -713,7 +717,7 @@ var extractAndDownloadUniformFilesForObject = async (object, options) => {
|
|
|
713
717
|
const fetchUrl = `${url.origin}${url.pathname}?format=original`;
|
|
714
718
|
const fileName = urlToFileName(url.toString());
|
|
715
719
|
const fileAlreadyExists = await fsj.existsAsync(
|
|
716
|
-
join2(
|
|
720
|
+
join2(writeDirectory, FILES_DIRECTORY_NAME, fileName)
|
|
717
721
|
);
|
|
718
722
|
if (fileAlreadyExists) {
|
|
719
723
|
return;
|
|
@@ -723,8 +727,6 @@ var extractAndDownloadUniformFilesForObject = async (object, options) => {
|
|
|
723
727
|
return;
|
|
724
728
|
}
|
|
725
729
|
const fileBuffer = await response.arrayBuffer();
|
|
726
|
-
const isPackage = isPathAPackageFile(options.directory);
|
|
727
|
-
const writeDirectory = isPackage ? dirname2(options.directory) : options.directory;
|
|
728
730
|
await fsj.writeAsync(join2(writeDirectory, FILES_DIRECTORY_NAME, fileName), Buffer.from(fileBuffer));
|
|
729
731
|
} catch {
|
|
730
732
|
console.warn(`Failed to download file ${url}`);
|
|
@@ -740,6 +742,8 @@ var extractAndUploadUniformFilesForObject = async (object, options) => {
|
|
|
740
742
|
const uniformFileUrlMatches = objectAsString.matchAll(
|
|
741
743
|
/"(https:\/\/(.*)?img\.uniform\.(rocks|global)\/(.*?))"/g
|
|
742
744
|
);
|
|
745
|
+
const isPackage = isPathAPackageFile(options.directory);
|
|
746
|
+
const writeDirectory = isPackage ? dirname2(options.directory) : options.directory;
|
|
743
747
|
if (uniformFileUrlMatches) {
|
|
744
748
|
const fileUploadQueue = new PQueue({ concurrency: 3 });
|
|
745
749
|
for (const match of uniformFileUrlMatches) {
|
|
@@ -756,14 +760,14 @@ var extractAndUploadUniformFilesForObject = async (object, options) => {
|
|
|
756
760
|
}
|
|
757
761
|
const localFileName = urlToFileName(url);
|
|
758
762
|
const fileExistsLocally = await fsj.existsAsync(
|
|
759
|
-
join2(
|
|
763
|
+
join2(writeDirectory, FILES_DIRECTORY_NAME, localFileName)
|
|
760
764
|
);
|
|
761
765
|
if (!fileExistsLocally) {
|
|
762
766
|
console.warn(`Skipping file ${url} as we couldn't find a local copy`);
|
|
763
767
|
return;
|
|
764
768
|
}
|
|
765
769
|
const fileBuffer = await fsj.readAsync(
|
|
766
|
-
join2(
|
|
770
|
+
join2(writeDirectory, FILES_DIRECTORY_NAME, localFileName),
|
|
767
771
|
"buffer"
|
|
768
772
|
);
|
|
769
773
|
if (!fileBuffer) {
|
|
@@ -5451,7 +5455,7 @@ import { PostHog } from "posthog-node";
|
|
|
5451
5455
|
// package.json
|
|
5452
5456
|
var package_default = {
|
|
5453
5457
|
name: "@uniformdev/cli",
|
|
5454
|
-
version: "19.
|
|
5458
|
+
version: "19.80.0",
|
|
5455
5459
|
description: "Uniform command line interface tool",
|
|
5456
5460
|
license: "SEE LICENSE IN LICENSE.txt",
|
|
5457
5461
|
main: "./cli.js",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/cli",
|
|
3
|
-
"version": "19.
|
|
3
|
+
"version": "19.80.0",
|
|
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.
|
|
21
|
-
"@uniformdev/canvas": "19.
|
|
22
|
-
"@uniformdev/context": "19.
|
|
23
|
-
"@uniformdev/files": "19.
|
|
24
|
-
"@uniformdev/project-map": "19.
|
|
25
|
-
"@uniformdev/redirect": "19.
|
|
20
|
+
"@uniformdev/assets": "19.80.0",
|
|
21
|
+
"@uniformdev/canvas": "19.80.0",
|
|
22
|
+
"@uniformdev/context": "19.80.0",
|
|
23
|
+
"@uniformdev/files": "19.80.0",
|
|
24
|
+
"@uniformdev/project-map": "19.80.0",
|
|
25
|
+
"@uniformdev/redirect": "19.80.0",
|
|
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": "8c61dce79f176cb5aa3cb163657326407f17dee6"
|
|
73
73
|
}
|