create-origo-app 0.0.0-stage → 0.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/dist/cli.js +22 -0
- package/dist/commands/create.js +11 -0
- package/dist/commands/index.js +6 -0
- package/dist/constants/app.js +3 -0
- package/dist/index.js +6 -0
- package/dist/ui/banner.js +10 -0
- package/dist/ui/logger.js +15 -0
- package/dist/ui/multiselect.js +22 -0
- package/package.json +30 -4
- package/README.md +0 -3
package/dist/cli.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { showBanner } from "./ui/banner.js";
|
|
2
|
+
import { logger } from "./ui/logger.js";
|
|
3
|
+
import { VERSION } from "./constants/app.js";
|
|
4
|
+
import { createCommand } from "./commands/create.js";
|
|
5
|
+
export function runCLI(args) {
|
|
6
|
+
showBanner();
|
|
7
|
+
createCommand();
|
|
8
|
+
if (args.includes("--version") || args.includes("-v")) {
|
|
9
|
+
console.log(`Origo v${VERSION}`);
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
if (args.includes("--help") || args.includes("-h")) {
|
|
13
|
+
console.log("Usage: origo [options]");
|
|
14
|
+
console.log();
|
|
15
|
+
console.log("Options:");
|
|
16
|
+
console.log(" -v, --version Show version");
|
|
17
|
+
console.log(" -h, --help Show help");
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
logger.success("Welcome to Origo!");
|
|
21
|
+
logger.info("Your CLI is ready.");
|
|
22
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { multiSelect } from "../ui/multiselect.js";
|
|
2
|
+
export async function createCommand() {
|
|
3
|
+
const features = await multiSelect("Select features for your project", [
|
|
4
|
+
{ name: "TypeScript", value: "typescript", checked: true },
|
|
5
|
+
{ name: "ESLint", value: "eslint" },
|
|
6
|
+
{ name: "Prettier", value: "prettier" },
|
|
7
|
+
{ name: "Docker", value: "docker" },
|
|
8
|
+
{ name: "Testing", value: "testing" },
|
|
9
|
+
]);
|
|
10
|
+
console.log("\nSelected features:", features.join(", "));
|
|
11
|
+
}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import pc from "picocolors";
|
|
2
|
+
import { APP_NAME, TAGLINE } from "../constants/app.js";
|
|
3
|
+
export function showBanner() {
|
|
4
|
+
console.log();
|
|
5
|
+
console.log(` ${pc.green("◎")} ${pc.bold(pc.white(APP_NAME.toUpperCase()))}`);
|
|
6
|
+
console.log(` ${pc.dim(TAGLINE)}`);
|
|
7
|
+
console.log();
|
|
8
|
+
console.log(pc.dim(" ─────────────────────────────────────"));
|
|
9
|
+
console.log();
|
|
10
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import pc from "picocolors";
|
|
2
|
+
export const logger = {
|
|
3
|
+
info(message) {
|
|
4
|
+
console.log(`${pc.blue("ℹ")} ${message}`);
|
|
5
|
+
},
|
|
6
|
+
success(message) {
|
|
7
|
+
console.log(`${pc.green("✔")} ${message}`);
|
|
8
|
+
},
|
|
9
|
+
error(message) {
|
|
10
|
+
console.log(`${pc.red("✖")} ${message}`);
|
|
11
|
+
},
|
|
12
|
+
warn(message) {
|
|
13
|
+
console.log(`${pc.yellow("⚠")} ${message}`);
|
|
14
|
+
},
|
|
15
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { checkbox } from "@inquirer/prompts";
|
|
2
|
+
export async function multiSelect(message, options) {
|
|
3
|
+
return checkbox({
|
|
4
|
+
message,
|
|
5
|
+
choices: options.map((option) => ({
|
|
6
|
+
name: option.name,
|
|
7
|
+
value: option.value,
|
|
8
|
+
description: option.description,
|
|
9
|
+
checked: option.checked,
|
|
10
|
+
})),
|
|
11
|
+
pageSize: 8,
|
|
12
|
+
required: true,
|
|
13
|
+
theme: {
|
|
14
|
+
prefix: "◆",
|
|
15
|
+
icon: {
|
|
16
|
+
checked: "◉",
|
|
17
|
+
unchecked: "◯",
|
|
18
|
+
cursor: "❯ ",
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-origo-app",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "A modern project scaffolding CLI",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"origo": "dist/index.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"dist"
|
|
11
|
+
],
|
|
12
|
+
"scripts": {
|
|
13
|
+
"build": "tsc",
|
|
14
|
+
"start": "npm run build && node dist/index.js",
|
|
15
|
+
"dev": "concurrently \"tsc --watch\" \"node --watch dist/index.js\"",
|
|
16
|
+
"prepublishOnly": "npm run build"
|
|
17
|
+
},
|
|
18
|
+
"engines": {
|
|
19
|
+
"node": ">=20"
|
|
20
|
+
},
|
|
21
|
+
"keywords": [],
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@types/node": "^26.6.6",
|
|
24
|
+
"concurrently": "^10.0.7",
|
|
25
|
+
"typescript": "^7.0.2"
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"@inquirer/prompts": "^8.8.0",
|
|
29
|
+
"commander": "^15.1.0",
|
|
30
|
+
"picocolors": "^1.1.1"
|
|
31
|
+
}
|
|
32
|
+
}
|
package/README.md
DELETED