@liangmi/mo 0.0.5 → 1.0.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/README.md +20 -102
- package/config_schema.json +16 -0
- package/dist/chunk-CBBoxR_p.mjs +26 -0
- package/dist/devtools-BHS22BGO.mjs +3569 -0
- package/dist/mo-inner.mjs +26 -34
- package/dist/mo.mjs +25687 -4890
- package/dist/{runner-BDAeQY-R.mjs → runner-DW0Q4OMK.mjs} +16 -29
- package/package.json +8 -5
|
@@ -1,36 +1,13 @@
|
|
|
1
|
+
import { n as __require, r as __toESM, t as __commonJSMin } from "./chunk-CBBoxR_p.mjs";
|
|
1
2
|
import { createRequire } from "node:module";
|
|
2
3
|
import { existsSync, readFileSync, statSync } from "node:fs";
|
|
3
|
-
import os, { homedir } from "node:os";
|
|
4
|
+
import os, { homedir, tmpdir } from "node:os";
|
|
4
5
|
import path, { delimiter, dirname, normalize, resolve } from "node:path";
|
|
5
6
|
import { parse } from "jsonc-parser";
|
|
6
7
|
import { spawn } from "node:child_process";
|
|
7
8
|
import { cwd } from "node:process";
|
|
8
9
|
import { PassThrough } from "node:stream";
|
|
9
10
|
import c from "node:readline";
|
|
10
|
-
//#region \0rolldown/runtime.js
|
|
11
|
-
var __create = Object.create;
|
|
12
|
-
var __defProp = Object.defineProperty;
|
|
13
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
14
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
15
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
16
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
17
|
-
var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
18
|
-
var __copyProps = (to, from, except, desc) => {
|
|
19
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
20
|
-
key = keys[i];
|
|
21
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
22
|
-
get: ((k) => from[k]).bind(null, key),
|
|
23
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
return to;
|
|
27
|
-
};
|
|
28
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
29
|
-
value: mod,
|
|
30
|
-
enumerable: true
|
|
31
|
-
}) : target, mod));
|
|
32
|
-
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
33
|
-
//#endregion
|
|
34
11
|
//#region node_modules/.pnpm/cac@7.0.0/node_modules/cac/dist/index.js
|
|
35
12
|
function toArr(any) {
|
|
36
13
|
return any == null ? [] : Array.isArray(any) ? any : [any];
|
|
@@ -672,13 +649,17 @@ function untildify(pathWithTilde) {
|
|
|
672
649
|
const aliasCommands = [
|
|
673
650
|
"clone",
|
|
674
651
|
"list",
|
|
675
|
-
"cd"
|
|
652
|
+
"cd",
|
|
653
|
+
"edit",
|
|
654
|
+
"open"
|
|
676
655
|
];
|
|
677
656
|
const legacyAliasCommands = ["mo", ...aliasCommands];
|
|
678
657
|
const defaultAliases = {
|
|
679
658
|
clone: "k",
|
|
680
659
|
list: "li",
|
|
681
|
-
cd: "i"
|
|
660
|
+
cd: "i",
|
|
661
|
+
edit: "e",
|
|
662
|
+
open: "o"
|
|
682
663
|
};
|
|
683
664
|
const aliasNameRegex = /^[A-Za-z_][A-Za-z0-9_-]*$/;
|
|
684
665
|
function parseAliasInput(input, onInvalid) {
|
|
@@ -846,7 +827,7 @@ function success(message) {
|
|
|
846
827
|
* - Returns `never` because it calls `process.exit()`.
|
|
847
828
|
*/
|
|
848
829
|
function error(message, exitCode = 1) {
|
|
849
|
-
console.error(import_picocolors.default.red(`${icons.error} ${message}`));
|
|
830
|
+
console.error(import_picocolors.default.bold(import_picocolors.default.red(`${icons.error} ${message}`)));
|
|
850
831
|
process.exit(exitCode);
|
|
851
832
|
}
|
|
852
833
|
//#endregion
|
|
@@ -1746,5 +1727,11 @@ async function preventRunning() {
|
|
|
1746
1727
|
error("Local installation is not supported. Please install mo globally.", 78);
|
|
1747
1728
|
}
|
|
1748
1729
|
}
|
|
1730
|
+
function getRestartFlagPath() {
|
|
1731
|
+
return path.join(tmpdir(), "mo-restart-flag");
|
|
1732
|
+
}
|
|
1733
|
+
function checkRestartRequired() {
|
|
1734
|
+
if (existsSync(getRestartFlagPath())) error("Please restart your shell to apply the recent setup changes.");
|
|
1735
|
+
}
|
|
1749
1736
|
//#endregion
|
|
1750
|
-
export {
|
|
1737
|
+
export { untildify as C, parseAliasInput as S, require_picocolors as _, ensureToolReady as a, defaultAliases as b, getDefaultConfigPath as c, error as d, icons as f, toTildePath as g, success as h, preventRunning as i, loadConfig as l, stopSpinner as m, getRestartFlagPath as n, runCommand as o, startSpinner as p, innerBinName as r, R as s, checkRestartRequired as t, supportedShells as u, aliasCommands as v, cac as w, getAliasPromptLabel as x, buildAliasLines as y };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@liangmi/mo",
|
|
3
|
-
"version": "0.0
|
|
4
|
-
"description": "Manage your
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Manage your open source projects",
|
|
5
5
|
"homepage": "https://github.com/liangmiQwQ/mo#readme",
|
|
6
6
|
"bugs": {
|
|
7
7
|
"url": "https://github.com/liangmiQwQ/mo/issues"
|
|
@@ -30,17 +30,20 @@
|
|
|
30
30
|
"access": "public"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"jsonc-parser": "^3.3.1"
|
|
33
|
+
"jsonc-parser": "^3.3.1",
|
|
34
|
+
"prompts": "^2.4.2"
|
|
34
35
|
},
|
|
35
36
|
"devDependencies": {
|
|
36
|
-
"@types/node": "^25.5.
|
|
37
|
+
"@types/node": "^25.5.2",
|
|
37
38
|
"@types/prompts": "^2.4.9",
|
|
39
|
+
"@types/react": "^19.2.14",
|
|
38
40
|
"@types/which": "^3.0.4",
|
|
39
41
|
"@typescript/native-preview": "7.0.0-dev.20260316.1",
|
|
40
42
|
"bumpp": "^11.0.1",
|
|
41
43
|
"cac": "^7.0.0",
|
|
44
|
+
"ink": "^6.8.0",
|
|
42
45
|
"picocolors": "^1.1.1",
|
|
43
|
-
"
|
|
46
|
+
"react": "^19.2.4",
|
|
44
47
|
"tinyexec": "^1.0.4",
|
|
45
48
|
"tsx": "^4.21.0",
|
|
46
49
|
"typescript": "^6.0.2",
|