@mintlify/cli 4.0.918 → 4.0.926
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/__test__/update.test.ts +7 -3
- package/bin/tsconfig.build.tsbuildinfo +1 -1
- package/bin/update.js +4 -3
- package/package.json +8 -8
- package/src/update.tsx +16 -3
package/bin/update.js
CHANGED
|
@@ -8,7 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
-
import { SpinnerLog, SuccessLog, ErrorLog, addLog, clearLogs } from '@mintlify/previewing';
|
|
11
|
+
import { SpinnerLog, SuccessLog, ErrorLog, addLog, addErrorLog, clearLogs, } from '@mintlify/previewing';
|
|
12
12
|
import { execAsync, getLatestCliVersion, getVersions, detectPackageManager } from './helpers.js';
|
|
13
13
|
export const update = (_a) => __awaiter(void 0, [_a], void 0, function* ({ packageName }) {
|
|
14
14
|
addLog(_jsx(SpinnerLog, { message: "updating..." }));
|
|
@@ -20,10 +20,10 @@ export const update = (_a) => __awaiter(void 0, [_a], void 0, function* ({ packa
|
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
22
22
|
if (existingCliVersion && latestCliVersion.trim() !== existingCliVersion.trim()) {
|
|
23
|
+
const packageManager = yield detectPackageManager({ packageName });
|
|
23
24
|
try {
|
|
24
25
|
clearLogs();
|
|
25
26
|
addLog(_jsx(SpinnerLog, { message: `updating ${packageName} package...` }));
|
|
26
|
-
const packageManager = yield detectPackageManager({ packageName });
|
|
27
27
|
if (packageManager === 'pnpm') {
|
|
28
28
|
yield execAsync(`pnpm install -g ${packageName}@latest --silent`);
|
|
29
29
|
}
|
|
@@ -32,7 +32,8 @@ export const update = (_a) => __awaiter(void 0, [_a], void 0, function* ({ packa
|
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
catch (err) {
|
|
35
|
-
|
|
35
|
+
const errorMessage = err instanceof Error ? err.message : String(err);
|
|
36
|
+
addErrorLog(_jsx(ErrorLog, { message: `Failed to update ${packageName}@${latestCliVersion} using ${packageManager}: ${errorMessage}` }));
|
|
36
37
|
return;
|
|
37
38
|
}
|
|
38
39
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mintlify/cli",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.926",
|
|
4
4
|
"description": "The Mintlify CLI",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=18.0.0"
|
|
@@ -40,12 +40,12 @@
|
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@inquirer/prompts": "7.9.0",
|
|
43
|
-
"@mintlify/common": "1.0.
|
|
44
|
-
"@mintlify/link-rot": "3.0.
|
|
45
|
-
"@mintlify/models": "0.0.
|
|
46
|
-
"@mintlify/prebuild": "1.0.
|
|
47
|
-
"@mintlify/previewing": "4.0.
|
|
48
|
-
"@mintlify/validation": "0.1.
|
|
43
|
+
"@mintlify/common": "1.0.704",
|
|
44
|
+
"@mintlify/link-rot": "3.0.863",
|
|
45
|
+
"@mintlify/models": "0.0.266",
|
|
46
|
+
"@mintlify/prebuild": "1.0.840",
|
|
47
|
+
"@mintlify/previewing": "4.0.896",
|
|
48
|
+
"@mintlify/validation": "0.1.580",
|
|
49
49
|
"adm-zip": "0.5.16",
|
|
50
50
|
"chalk": "5.2.0",
|
|
51
51
|
"color": "4.2.3",
|
|
@@ -81,5 +81,5 @@
|
|
|
81
81
|
"vitest": "2.0.4",
|
|
82
82
|
"vitest-mock-process": "1.0.4"
|
|
83
83
|
},
|
|
84
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "7fe3145cc1623be0be9cac643ae0fd76ff9c24d6"
|
|
85
85
|
}
|
package/src/update.tsx
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
SpinnerLog,
|
|
3
|
+
SuccessLog,
|
|
4
|
+
ErrorLog,
|
|
5
|
+
addLog,
|
|
6
|
+
addErrorLog,
|
|
7
|
+
clearLogs,
|
|
8
|
+
} from '@mintlify/previewing';
|
|
2
9
|
|
|
3
10
|
import { execAsync, getLatestCliVersion, getVersions, detectPackageManager } from './helpers.js';
|
|
4
11
|
|
|
@@ -15,17 +22,23 @@ export const update = async ({ packageName }: { packageName: string }) => {
|
|
|
15
22
|
}
|
|
16
23
|
|
|
17
24
|
if (existingCliVersion && latestCliVersion.trim() !== existingCliVersion.trim()) {
|
|
25
|
+
const packageManager = await detectPackageManager({ packageName });
|
|
18
26
|
try {
|
|
19
27
|
clearLogs();
|
|
20
28
|
addLog(<SpinnerLog message={`updating ${packageName} package...`} />);
|
|
21
|
-
|
|
29
|
+
|
|
22
30
|
if (packageManager === 'pnpm') {
|
|
23
31
|
await execAsync(`pnpm install -g ${packageName}@latest --silent`);
|
|
24
32
|
} else {
|
|
25
33
|
await execAsync(`npm install -g ${packageName}@latest --silent`);
|
|
26
34
|
}
|
|
27
35
|
} catch (err) {
|
|
28
|
-
|
|
36
|
+
const errorMessage = err instanceof Error ? err.message : String(err);
|
|
37
|
+
addErrorLog(
|
|
38
|
+
<ErrorLog
|
|
39
|
+
message={`Failed to update ${packageName}@${latestCliVersion} using ${packageManager}: ${errorMessage}`}
|
|
40
|
+
/>
|
|
41
|
+
);
|
|
29
42
|
return;
|
|
30
43
|
}
|
|
31
44
|
}
|