@pronto-tools-and-more/cli 3.3.8

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/package.json ADDED
@@ -0,0 +1,23 @@
1
+ {
2
+ "name": "@pronto-tools-and-more/cli",
3
+ "version": "3.3.8",
4
+ "description": "",
5
+ "main": "src/main.js",
6
+ "type": "module",
7
+ "bin": {
8
+ "pronto": "./bin/pronto.js"
9
+ },
10
+ "scripts": {
11
+ "test": "echo ok",
12
+ "type-check": "tsc"
13
+ },
14
+ "keywords": [],
15
+ "author": "",
16
+ "license": "MIT",
17
+ "dependencies": {
18
+ "@pronto-tools-and-more/pronto": "3.3.8"
19
+ },
20
+ "devDependencies": {
21
+ "@types/node": "^20.12.7"
22
+ }
23
+ }
package/src/main.js ADDED
@@ -0,0 +1,3 @@
1
+ import * as Main from "./parts/Main/Main.js";
2
+
3
+ Main.main();
@@ -0,0 +1 @@
1
+ export const argv = process.argv.slice(2);
@@ -0,0 +1,13 @@
1
+ import { fork } from "node:child_process";
2
+ import * as Argv from "../Argv/Argv.js";
3
+ import * as ProntoPath from "../ProntoPath/ProntoPath.js";
4
+
5
+ const handleChildExit = (code) => {
6
+ process.exit(code ?? 1);
7
+ };
8
+
9
+ export const handleCliArgs = async (cwd) => {
10
+ const relevantArgv = Argv.argv;
11
+ const child = fork(ProntoPath.prontoPath, relevantArgv, { stdio: "inherit" });
12
+ child.once("exit", handleChildExit);
13
+ };
@@ -0,0 +1,6 @@
1
+ import * as HandleCliArgs from "../HandleCliArgs/HandleCliArgs.js";
2
+
3
+ export const main = async () => {
4
+ const cwd = process.cwd();
5
+ await HandleCliArgs.handleCliArgs(cwd);
6
+ };
@@ -0,0 +1,10 @@
1
+ import { join } from "node:path";
2
+ import * as Root from "../Root/Root.js";
3
+
4
+ export const prontoPath = join(
5
+ Root.root,
6
+ "packages",
7
+ "pronto",
8
+ "src",
9
+ "main.js"
10
+ );
@@ -0,0 +1,6 @@
1
+ import { dirname } from "node:path";
2
+ import { fileURLToPath } from "node:url";
3
+
4
+ const __dirname = dirname(fileURLToPath(import.meta.url));
5
+
6
+ export const root = `${__dirname}/../../../../..`;