monowalk 1.1.1 → 1.1.2-c
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/bin/commands/out.js +1 -1
- package/bin/commands/to.js +30 -1
- package/bin/utils/config.js +1 -1
- package/bin/utils/getCommands.js +1 -1
- package/package.json +14 -3
package/bin/commands/out.js
CHANGED
package/bin/commands/to.js
CHANGED
|
@@ -1,6 +1,35 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
2
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
15
|
exports.description = void 0;
|
|
4
16
|
exports.default = to;
|
|
5
|
-
|
|
17
|
+
const select_1 = __importDefault(require("@inquirer/select"));
|
|
18
|
+
const config_1 = require("../utils/config");
|
|
19
|
+
const path_1 = __importDefault(require("path"));
|
|
20
|
+
const folder_1 = require("../utils/folder");
|
|
21
|
+
function to() {
|
|
22
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
console.log("Your projects:");
|
|
24
|
+
let { content } = (0, config_1.findNearestConfigPath)();
|
|
25
|
+
let res = yield (0, select_1.default)({
|
|
26
|
+
message: "Select a project to open in Visual Studio Code:",
|
|
27
|
+
choices: Object.keys(content.projects || {}),
|
|
28
|
+
});
|
|
29
|
+
let projectPath = content.projects[res];
|
|
30
|
+
let fullPath = path_1.default.join(process.cwd(), projectPath.replace("./", ""));
|
|
31
|
+
(0, folder_1.loadFolder)(fullPath);
|
|
32
|
+
console.log(`Opened project "${res}" in Visual Studio Code.`);
|
|
33
|
+
});
|
|
34
|
+
}
|
|
6
35
|
exports.description = "Load a project in visual studio code";
|
package/bin/utils/config.js
CHANGED
|
@@ -33,7 +33,7 @@ function findNearestConfigPath(iterations = 3) {
|
|
|
33
33
|
}
|
|
34
34
|
configPath = configExists(workingDir);
|
|
35
35
|
if (!found || !configPath) {
|
|
36
|
-
throw new Error("No
|
|
36
|
+
throw new Error("No .monowalkrc found in any parent directory. Use 'monowalk init' to create one.");
|
|
37
37
|
}
|
|
38
38
|
let content = JSON.parse(fs_1.default.readFileSync(configPath, "utf-8"));
|
|
39
39
|
return { content, configPath };
|
package/bin/utils/getCommands.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"dependencies": {
|
|
3
3
|
"@inquirer/input": "^5.0.4",
|
|
4
|
+
"@inquirer/select": "^5.0.4",
|
|
4
5
|
"esbuild": "^0.27.2"
|
|
5
6
|
},
|
|
6
7
|
"devDependencies": {
|
|
@@ -8,7 +9,7 @@
|
|
|
8
9
|
"typescript": "^5.9.3"
|
|
9
10
|
},
|
|
10
11
|
"name": "monowalk",
|
|
11
|
-
"type": "
|
|
12
|
+
"type": "commonjs",
|
|
12
13
|
"module": "bin/cli.js",
|
|
13
14
|
"bin": {
|
|
14
15
|
"monowalk": "bin/cli.js",
|
|
@@ -26,8 +27,18 @@
|
|
|
26
27
|
"type": "github",
|
|
27
28
|
"url": "git+https://github.com/nekoniyah/monowalk.git"
|
|
28
29
|
},
|
|
29
|
-
"version": "1.1.
|
|
30
|
+
"version": "1.1.2-c",
|
|
30
31
|
"scripts": {
|
|
31
32
|
"prepublish": "tsc"
|
|
32
|
-
}
|
|
33
|
+
},
|
|
34
|
+
"keywords": [
|
|
35
|
+
"cli",
|
|
36
|
+
"management",
|
|
37
|
+
"monorepo",
|
|
38
|
+
"qol",
|
|
39
|
+
"utilities",
|
|
40
|
+
"console",
|
|
41
|
+
"vscode",
|
|
42
|
+
"visual studio code"
|
|
43
|
+
]
|
|
33
44
|
}
|