@lyntro/cli 0.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/bin/Readme.md ADDED
@@ -0,0 +1 @@
1
+ # entry file: lyntro.js
package/bin/doctor.js ADDED
@@ -0,0 +1,45 @@
1
+ const { execSync } = require("child_process");
2
+ const os = require("os");
3
+ const path = require("path");
4
+
5
+ function runDoctor() {
6
+
7
+ // Node.js version
8
+ console.log(`Node.js version: ${process.version}`);
9
+
10
+ // npm check
11
+ try {
12
+ execSync("npm --version", { stdio: "ignore" });
13
+ console.log("npm detected.");
14
+ } catch {
15
+ console.log("npm not found!");
16
+ }
17
+
18
+ // Android SDK check
19
+ let androidSdk = process.env.ANDROID_HOME || process.env.ANDROID_SDK_ROOT;
20
+ if (!androidSdk && process.platform === "win32") {
21
+ androidSdk = path.join(os.homedir(), "AppData", "Local", "Android", "Sdk");
22
+ }
23
+ if (androidSdk) console.log("Android SDK detected at ",androidSdk);
24
+ else console.log("Android SDK not found!");
25
+
26
+ // Gradle check
27
+ try {
28
+ execSync("gradle -v", { stdio: "ignore" });
29
+ console.log("Gradle detected.");
30
+ } catch {
31
+ console.log("Gradle not found!");
32
+ }
33
+
34
+ // Java JDK check
35
+ try {
36
+ const javaVersionOutput = execSync("java -version", { stdio: ["pipe", "pipe", "pipe"] }).toString();
37
+ const versionMatch = javaVersionOutput.match(/version "(.*?)"/);
38
+ if (versionMatch) console.log("Java JDK detected: ",versionMatch[1]);
39
+ else console.log("Java detected, but version could not be parsed.");
40
+ } catch {
41
+ console.log("Java JDK not found!");
42
+ }
43
+ }
44
+
45
+ module.exports = runDoctor;
package/bin/lyntro.js ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env node
2
+ const fs = require("fs");
3
+ const runDoctor = require("./doctor.js");
4
+ const runNew = require("./new.js");
5
+ const { Command } = require("commander");
6
+ const program = new Command();
7
+ program.name("lyntro").version("0.0.0");
8
+ program.command("new <name>").action((name) => {
9
+ runNew(name);
10
+ });
11
+ program.command("doctor").action(() => {
12
+ runDoctor();
13
+ });
14
+ program.parse(process.argv);
package/bin/new.js ADDED
@@ -0,0 +1,11 @@
1
+ const fs = require("fs");
2
+ function runNew(name="my-lyntro-project"){
3
+ console.log("Creating new project:" ,name);
4
+ if (!fs.existsSync(name)) {
5
+ fs.mkdirSync(name);
6
+ console.log("Project:",name," created.");
7
+ } else {
8
+ console.log("Directory",name,"already exists.");
9
+ }
10
+ }
11
+ module.exports = runNew;
package/package.json ADDED
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "@lyntro/cli",
3
+ "version": "0.0.0",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "keywords": [],
10
+ "author": "Joseph Joseph",
11
+ "license": "MIT",
12
+ "bin": {
13
+ "lyntro": "bin/lyntro.js"
14
+ },
15
+ "publishConfig": {
16
+ "access": "public"
17
+ },
18
+ "dependencies": {
19
+ "commander": "^14.0.2"
20
+ }
21
+ }