monowalk 1.1.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/.gitignore ADDED
@@ -0,0 +1,40 @@
1
+ # dependencies (bun install)
2
+ node_modules
3
+
4
+ # output
5
+ out
6
+ dist
7
+ *.tgz
8
+
9
+ # code coverage
10
+ coverage
11
+ *.lcov
12
+
13
+ # logs
14
+ logs
15
+ _.log
16
+ report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
17
+
18
+ # dotenv environment variable files
19
+ .env
20
+ .env.development.local
21
+ .env.test.local
22
+ .env.production.local
23
+ .env.local
24
+
25
+ # caches
26
+ .eslintcache
27
+ .cache
28
+ *.tsbuildinfo
29
+
30
+ # IntelliJ based IDEs
31
+ .idea
32
+
33
+ # Finder (MacOS) folder config
34
+ .DS_Store
35
+
36
+ .npmrc
37
+
38
+ manager.txt
39
+
40
+ bin
package/.npmignore ADDED
@@ -0,0 +1,40 @@
1
+ # dependencies (bun install)
2
+ node_modules
3
+
4
+ # output
5
+ out
6
+ dist
7
+ *.tgz
8
+
9
+ # code coverage
10
+ coverage
11
+ *.lcov
12
+
13
+ # logs
14
+ logs
15
+ _.log
16
+ report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
17
+
18
+ # dotenv environment variable files
19
+ .env
20
+ .env.development.local
21
+ .env.test.local
22
+ .env.production.local
23
+ .env.local
24
+
25
+ # caches
26
+ .eslintcache
27
+ .cache
28
+ *.tsbuildinfo
29
+
30
+ # IntelliJ based IDEs
31
+ .idea
32
+
33
+ # Finder (MacOS) folder config
34
+ .DS_Store
35
+
36
+ *.ts
37
+
38
+ .npmrc
39
+
40
+ manager.txt
package/README.md ADDED
@@ -0,0 +1,38 @@
1
+ # Monowalk
2
+
3
+ A monorepo-first tool (cli) to easily manage different related projects in a single repository.
4
+ (not 100% tested yet, use at your own risk)
5
+
6
+ ## Installation
7
+
8
+ You can install Monowalk globally using npm:
9
+
10
+ ```bash
11
+ npm install -g monowalk
12
+ ```
13
+
14
+ ## Features
15
+
16
+ - **Switch Between Projects**: Seamlessly switch between different projects within the monorepo.
17
+ - **Unified Commands**: Run commands across all projects or specific ones with ease.
18
+ - **Dependency Management**: Handle shared dependencies efficiently.
19
+ - **Project Scaffolding**: Quickly create new projects with predefined templates.
20
+ - **Version Control Integration**: Built-in support for Git to manage changes across projects.
21
+ - **Customizable Workflows**: Define custom workflows for building, testing, and deploying projects.
22
+ - **Extensible Plugins**: Support for plugins to extend functionality as needed.
23
+ - **Comprehensive Documentation**: Detailed guides and API references to help you get started and make the most of Monowalk.
24
+
25
+ ## How
26
+
27
+ - Monowalk tries to not overload your workspace by being able to switch between projects, only loading the necessary folder for the current project, without having a Visual Studio Code extension.
28
+
29
+ ## Attention
30
+
31
+ Some features are not yet implemented. Stay tuned for updates! It includes:
32
+
33
+ - Dependency Management
34
+ - Version Control Integration
35
+ - Extensible Plugins
36
+ - Comprehensive Documentation
37
+ - Customizable Workflows
38
+ - Unified Commands
package/bin/cli.js ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+
3
+ require("./index");
@@ -0,0 +1,34 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.description = void 0;
13
+ exports.default = help;
14
+ const getCommands_1 = require("../utils/getCommands");
15
+ const multiline_1 = require("../utils/multiline");
16
+ const package_1 = require("../utils/package");
17
+ function help() {
18
+ return __awaiter(this, void 0, void 0, function* () {
19
+ let commands = yield (0, getCommands_1.getCommands)();
20
+ let name = (0, package_1.getPackageInfo)().name;
21
+ (0, multiline_1.multilinelog) `Usage: ${name} [command] [options]`;
22
+ (0, multiline_1.multilinelog) `
23
+ Commands:`;
24
+ for (let cmd of commands) {
25
+ (0, multiline_1.multilinelog) ` ${cmd.name} ${cmd.description}`;
26
+ }
27
+ (0, multiline_1.multilinelog) `
28
+
29
+ For more information on a specific command, run:
30
+ ${name} [command] --help
31
+ `;
32
+ });
33
+ }
34
+ exports.description = "Display help information about commands";
@@ -0,0 +1,37 @@
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
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.description = void 0;
16
+ exports.default = init;
17
+ const fs_1 = __importDefault(require("fs"));
18
+ const path_1 = __importDefault(require("path"));
19
+ const cwd = process.cwd();
20
+ function init() {
21
+ return __awaiter(this, void 0, void 0, function* () {
22
+ console.log("Initializing a new monorepo project with Monowalk...");
23
+ // Create a .monowalkrc configuration file
24
+ const configPath = path_1.default.join(cwd, ".monowalkrc");
25
+ if (fs_1.default.existsSync(configPath)) {
26
+ console.log(".monowalkrc already exists. Initialization skipped.");
27
+ return;
28
+ }
29
+ let defaultConfig = {
30
+ projects: {}, // {"project-name": "path/to/project"},
31
+ shared_dependencies: {}, // {"dependency-name": {projects: ["project1", "project2"], version: "1.0.0"}},
32
+ };
33
+ fs_1.default.writeFileSync(configPath, JSON.stringify(defaultConfig, null, 2));
34
+ console.log("Created .monowalkrc configuration file.");
35
+ });
36
+ }
37
+ exports.description = "Initialize a monorepo project with Monowalk.";
@@ -0,0 +1,64 @@
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
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.description = void 0;
16
+ exports.default = newCommand;
17
+ const input_1 = __importDefault(require("@inquirer/input"));
18
+ const fs_1 = require("fs");
19
+ const path_1 = __importDefault(require("path"));
20
+ const child_process_1 = require("child_process");
21
+ const config_1 = require("../utils/config");
22
+ const cwd = process.cwd();
23
+ function newCommand(_a) {
24
+ return __awaiter(this, arguments, void 0, function* ({ installCommand, allInstallCommand, manager, }) {
25
+ let name = yield (0, input_1.default)({
26
+ message: "Project name:",
27
+ validate(value) {
28
+ if (value.length === 0) {
29
+ return "Project name cannot be empty.";
30
+ }
31
+ if (/\s/.test(value)) {
32
+ return "Project name cannot contain spaces.";
33
+ }
34
+ // no caps
35
+ if (value !== value.toLowerCase()) {
36
+ return "Project name must be lowercase.";
37
+ }
38
+ return true;
39
+ },
40
+ theme: {
41
+ prefix: "➕ ",
42
+ spinner: {
43
+ frames: ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"],
44
+ interval: 80,
45
+ },
46
+ },
47
+ });
48
+ console.log(`Creating project: ${name}`);
49
+ // Create project directory
50
+ const projectPath = path_1.default.join(cwd, name);
51
+ if ((0, fs_1.existsSync)(projectPath)) {
52
+ console.log(`Project directory "${name}" already exists. Creation skipped.`);
53
+ return;
54
+ }
55
+ const { content, configPath } = (0, config_1.findNearestConfigPath)();
56
+ content.projects[name] = name;
57
+ // Save the updated configuration file
58
+ (0, fs_1.writeFileSync)(configPath, JSON.stringify(content, null, 2));
59
+ (0, fs_1.mkdirSync)(projectPath);
60
+ // Initialize the package.json file
61
+ (0, child_process_1.execSync)(`${allInstallCommand}`, { cwd: projectPath, stdio: "inherit" });
62
+ });
63
+ }
64
+ exports.description = "Create a project inside the Monowalk monorepo.";
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
36
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
37
+ return new (P || (P = Promise))(function (resolve, reject) {
38
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
39
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
40
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
41
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
42
+ });
43
+ };
44
+ var __importDefault = (this && this.__importDefault) || function (mod) {
45
+ return (mod && mod.__esModule) ? mod : { "default": mod };
46
+ };
47
+ Object.defineProperty(exports, "__esModule", { value: true });
48
+ exports.description = void 0;
49
+ exports.default = out;
50
+ const fs_1 = require("fs");
51
+ const config_1 = require("../utils/config");
52
+ const esbuild = __importStar(require("esbuild"));
53
+ const path_1 = __importDefault(require("path"));
54
+ function out(_a) {
55
+ return __awaiter(this, arguments, void 0, function* ({ args }) {
56
+ // Build a project in a single js file
57
+ console.log("Building project into a single JS file...");
58
+ // Implementation goes here
59
+ if (!args || args.length === 0) {
60
+ console.log("No project name specified.");
61
+ return;
62
+ }
63
+ let data = (0, config_1.findNearestConfigPath)();
64
+ if (!data.projects) {
65
+ console.log("No projects defined in the configuration file.");
66
+ return;
67
+ }
68
+ const projectName = args[0];
69
+ if (!data.projects.includes(projectName)) {
70
+ console.log(`Project "${projectName}" not found in the configuration file.`);
71
+ return;
72
+ }
73
+ const entryFolder = data.projects[projectName];
74
+ // Get entry file from the package.json of the project
75
+ const packageJsonPath = path_1.default.join(entryFolder, "package.json");
76
+ const packageJson = JSON.parse((0, fs_1.readFileSync)(packageJsonPath, "utf-8"));
77
+ const entryFile = packageJson.main || "index.js";
78
+ const entryFilePath = path_1.default.join(entryFolder, entryFile);
79
+ yield esbuild.build({
80
+ entryPoints: [entryFilePath],
81
+ bundle: true,
82
+ outfile: path_1.default.join(entryFolder, "monowalk", `${projectName}.js`),
83
+ });
84
+ });
85
+ }
86
+ exports.description = "Build targer project into a single JavaScript file";
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.description = void 0;
4
+ exports.default = to;
5
+ function to() { }
6
+ exports.description = "Load a project in visual studio code";
package/bin/index.js ADDED
@@ -0,0 +1,93 @@
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
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ const process_1 = require("process");
16
+ const help_1 = __importDefault(require("./commands/help"));
17
+ const getCommands_1 = require("./utils/getCommands");
18
+ const fs_1 = require("fs");
19
+ const input_1 = __importDefault(require("@inquirer/input"));
20
+ const path_1 = __importDefault(require("path"));
21
+ let installCommand = "";
22
+ let allInstallCommand = "";
23
+ let packageManager = "";
24
+ function askAndSavePackageManager() {
25
+ return __awaiter(this, void 0, void 0, function* () {
26
+ packageManager = yield (0, input_1.default)({
27
+ message: "Enter your package manager (npm, yarn, pnpm, bun): ",
28
+ });
29
+ (0, fs_1.writeFileSync)(path_1.default.join(__dirname, "manager.txt"), packageManager.trim());
30
+ });
31
+ }
32
+ (() => __awaiter(void 0, void 0, void 0, function* () {
33
+ try {
34
+ packageManager = (0, fs_1.readFileSync)(path_1.default.join(__dirname, "manager.txt"), "utf-8");
35
+ if (packageManager.trim() === "")
36
+ yield askAndSavePackageManager();
37
+ }
38
+ catch (_a) {
39
+ (0, fs_1.writeFileSync)(path_1.default.join(__dirname, "manager.txt"), "");
40
+ yield askAndSavePackageManager();
41
+ }
42
+ switch (packageManager) {
43
+ case "npm":
44
+ installCommand = "npm i";
45
+ allInstallCommand = "npm install";
46
+ break;
47
+ case "yarn":
48
+ installCommand = "yarn add";
49
+ allInstallCommand = "yarn install";
50
+ break;
51
+ case "pnpm":
52
+ installCommand = "pnpm add";
53
+ allInstallCommand = "pnpm install";
54
+ break;
55
+ case "bun":
56
+ installCommand = "bun add";
57
+ allInstallCommand = "bun install";
58
+ break;
59
+ default:
60
+ console.log(`Unsupported package manager: ${packageManager}. Supported managers are npm, yarn, pnpm, and bun.`);
61
+ process.exit(1);
62
+ }
63
+ let _isLocalRun = false;
64
+ for (let arg of process_1.argv) {
65
+ if (arg.includes("bun") ||
66
+ arg.includes("ts-node") ||
67
+ arg.includes("tsx") ||
68
+ arg.includes("node")) {
69
+ _isLocalRun = true;
70
+ }
71
+ }
72
+ const args = _isLocalRun ? process_1.argv.slice(2) : process_1.argv.slice(1);
73
+ const commands = yield (0, getCommands_1.getCommands)();
74
+ if (args.length === 0) {
75
+ yield (0, help_1.default)();
76
+ }
77
+ else {
78
+ const commandName = args[0];
79
+ const command = commands.find((cmd) => cmd.name === commandName);
80
+ if (command) {
81
+ yield command.exec({
82
+ installCommand,
83
+ allInstallCommand,
84
+ manager: packageManager.trim(),
85
+ args: args.slice(1),
86
+ });
87
+ }
88
+ else {
89
+ console.log(`Unknown command: ${commandName}`);
90
+ console.log(`Use the help command to see the list of available commands.`);
91
+ }
92
+ }
93
+ }))();
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.findNearestConfigPath = findNearestConfigPath;
7
+ const path_1 = __importDefault(require("path"));
8
+ const fs_1 = __importDefault(require("fs"));
9
+ let monowalkConfigFilenames = [".monowalkrc"];
10
+ function findNearestConfigPath(iterations = 3) {
11
+ let workingDir = process.cwd();
12
+ let iters = 1;
13
+ let goBack = "..";
14
+ let found = false;
15
+ let configPath = null;
16
+ function configExists(dir) {
17
+ let exists = false;
18
+ if (iters > iterations)
19
+ return null;
20
+ iters++;
21
+ for (let filename of monowalkConfigFilenames) {
22
+ let fullPath = path_1.default.join(dir, filename);
23
+ if (fs_1.default.existsSync(fullPath)) {
24
+ configPath = fullPath;
25
+ exists = true;
26
+ break;
27
+ }
28
+ }
29
+ if (!exists)
30
+ return configExists(path_1.default.join(dir, goBack));
31
+ found = true;
32
+ return configPath;
33
+ }
34
+ configPath = configExists(workingDir);
35
+ if (!found || !configPath) {
36
+ throw new Error("No monowalk.config.js found in any parent directory.");
37
+ }
38
+ let content = JSON.parse(fs_1.default.readFileSync(configPath, "utf-8"));
39
+ return { content, configPath };
40
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.loadFolder = loadFolder;
4
+ const child_process_1 = require("child_process");
5
+ const protocol = "vscode://";
6
+ function loadFolder(folderPath) {
7
+ (0, child_process_1.spawnSync)(`open ${protocol}file/${folderPath}`);
8
+ }
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
36
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
37
+ return new (P || (P = Promise))(function (resolve, reject) {
38
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
39
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
40
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
41
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
42
+ });
43
+ };
44
+ var __importDefault = (this && this.__importDefault) || function (mod) {
45
+ return (mod && mod.__esModule) ? mod : { "default": mod };
46
+ };
47
+ Object.defineProperty(exports, "__esModule", { value: true });
48
+ exports.getCommands = getCommands;
49
+ const fs_1 = require("fs");
50
+ const win32_1 = __importDefault(require("path/win32"));
51
+ let files = (0, fs_1.readdirSync)(win32_1.default.join(__dirname, "..", "commands")).filter((file) => file.endsWith(".ts"));
52
+ function getCommands() {
53
+ return __awaiter(this, void 0, void 0, function* () {
54
+ let commands = [];
55
+ for (let file of files) {
56
+ let { default: command, description } = yield Promise.resolve(`${win32_1.default.join(__dirname, "..", "commands", file)}`).then(s => __importStar(require(s)));
57
+ commands.push({
58
+ exec: command,
59
+ description: description,
60
+ name: file.replace(".ts", ""),
61
+ });
62
+ }
63
+ return commands;
64
+ });
65
+ }
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.multilinelog = multilinelog;
4
+ function multilinelog(strings, ...values) {
5
+ let output = "";
6
+ strings.forEach((str, i) => {
7
+ output += str;
8
+ if (i < values.length) {
9
+ output += values[i];
10
+ }
11
+ });
12
+ console.log(output);
13
+ }
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getPackageInfo = getPackageInfo;
7
+ const fs_1 = __importDefault(require("fs"));
8
+ const path_1 = __importDefault(require("path"));
9
+ function getPackageInfo() {
10
+ const packagePath = path_1.default.join(__dirname, "..", "..", "package.json");
11
+ const packageData = fs_1.default.readFileSync(packagePath, "utf-8");
12
+ return JSON.parse(packageData);
13
+ }
package/package.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "dependencies": {
3
+ "@inquirer/input": "^5.0.4",
4
+ "esbuild": "^0.27.2"
5
+ },
6
+ "devDependencies": {
7
+ "@types/bun": "^1.3.8",
8
+ "typescript": "^5.9.3"
9
+ },
10
+ "name": "monowalk",
11
+ "type": "commonjs",
12
+ "module": "bin/cli.js",
13
+ "bin": {
14
+ "monowalk": "bin/cli.js",
15
+ "mw": "bin/cli.js"
16
+ },
17
+ "files": [
18
+ "bin",
19
+ ".npmignore",
20
+ ".gitignore",
21
+ "README.md",
22
+ "package.json"
23
+ ],
24
+ "main": "bin/cli.js",
25
+ "repository": {
26
+ "type": "github",
27
+ "url": "git+https://github.com/nekoniyah/monowalk.git"
28
+ },
29
+ "private": false,
30
+ "version": "1.1.0",
31
+ "scripts": {
32
+ "prepublish": "tsc"
33
+ }
34
+ }