@mintlify/previewing 4.0.1099 → 4.0.1100
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import fse from 'fs-extra';
|
|
2
2
|
import { pipeline } from 'node:stream/promises';
|
|
3
|
-
import tar from 'tar';
|
|
3
|
+
import * as tar from 'tar';
|
|
4
4
|
import * as constants from '../constants.js';
|
|
5
5
|
import { downloadTargetMint } from '../local-preview/client.js';
|
|
6
6
|
import * as utils from '../util.js';
|
|
@@ -4,10 +4,10 @@ export declare const downloadTargetMint: ({ targetVersion, existingVersion, }: {
|
|
|
4
4
|
existingVersion: string | null;
|
|
5
5
|
}) => Promise<void>;
|
|
6
6
|
export declare const getVersionMap: () => Promise<string | undefined>;
|
|
7
|
-
export declare const getCompatibleClientVersion: ({ cliVersion }: {
|
|
7
|
+
export declare const getCompatibleClientVersion: ({ cliVersion, }: {
|
|
8
8
|
cliVersion: string;
|
|
9
9
|
}) => Promise<string | undefined>;
|
|
10
|
-
export declare const tryDownloadTargetMint: ({ targetVersion, existingVersion }: {
|
|
10
|
+
export declare const tryDownloadTargetMint: ({ targetVersion, existingVersion, }: {
|
|
11
11
|
targetVersion: string;
|
|
12
12
|
existingVersion: string | null;
|
|
13
13
|
}) => Promise<string | undefined>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import fse from 'fs-extra';
|
|
2
2
|
import got from 'got';
|
|
3
3
|
import isOnline from 'is-online';
|
|
4
|
-
import { pipeline } from 'node:stream/promises';
|
|
5
|
-
import tar from 'tar';
|
|
6
4
|
import yaml from 'js-yaml';
|
|
5
|
+
import { pipeline } from 'node:stream/promises';
|
|
6
|
+
import * as tar from 'tar';
|
|
7
7
|
import { DOT_MINTLIFY, DOT_MINTLIFY_LAST, VERSION_PATH, TAR_PATH, TARGET_MINT_VERSION_URL, MINT_VERSION_MAP_URL, } from '../constants.js';
|
|
8
8
|
import { restoreMintlifyLast, getTarUrl } from '../util.js';
|
|
9
9
|
export const getLatestClientVersion = async () => {
|
|
@@ -44,7 +44,7 @@ export const downloadTargetMint = async ({ targetVersion, existingVersion, }) =>
|
|
|
44
44
|
sync: true,
|
|
45
45
|
file: TAR_PATH,
|
|
46
46
|
cwd: DOT_MINTLIFY,
|
|
47
|
-
onwarn: (_code, message
|
|
47
|
+
onwarn: (_code, message) => {
|
|
48
48
|
throw new Error(message);
|
|
49
49
|
},
|
|
50
50
|
});
|
|
@@ -74,7 +74,7 @@ export const getVersionMap = async () => {
|
|
|
74
74
|
return undefined;
|
|
75
75
|
}
|
|
76
76
|
};
|
|
77
|
-
export const getCompatibleClientVersion = async ({ cliVersion }) => {
|
|
77
|
+
export const getCompatibleClientVersion = async ({ cliVersion, }) => {
|
|
78
78
|
const versionMap = await getVersionMap();
|
|
79
79
|
if (!versionMap) {
|
|
80
80
|
return undefined;
|
|
@@ -82,16 +82,16 @@ export const getCompatibleClientVersion = async ({ cliVersion }) => {
|
|
|
82
82
|
const versionMapObj = yaml.load(versionMap);
|
|
83
83
|
if (cliVersion && versionMapObj[cliVersion]) {
|
|
84
84
|
const { max } = versionMapObj[cliVersion];
|
|
85
|
-
if (max !==
|
|
85
|
+
if (max !== '') {
|
|
86
86
|
return max;
|
|
87
87
|
}
|
|
88
88
|
else {
|
|
89
|
-
return
|
|
89
|
+
return 'latest';
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
return undefined;
|
|
93
93
|
};
|
|
94
|
-
export const tryDownloadTargetMint = async ({ targetVersion, existingVersion }) => {
|
|
94
|
+
export const tryDownloadTargetMint = async ({ targetVersion, existingVersion, }) => {
|
|
95
95
|
let error;
|
|
96
96
|
try {
|
|
97
97
|
await downloadTargetMint({ targetVersion, existingVersion });
|