@mbsi/mkcmd 0.2.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/README.md +109 -0
- package/bun.lock +44 -0
- package/dist/index.js +2308 -0
- package/package.json +24 -0
- package/src/commands/index.ts +13 -0
- package/src/config.ts +6 -0
- package/src/core/cli.ts +93 -0
- package/src/core/helpers/file-builder.ts +19 -0
- package/src/core/helpers/file-utils.ts +19 -0
- package/src/core/log.ts +82 -0
- package/src/data/init.ts +102 -0
- package/src/functions/orchestrate-scaffold.ts +21 -0
- package/src/functions/prompt-project.ts +31 -0
- package/src/functions/scaffold-core.ts +18 -0
- package/src/functions/scaffold-project.ts +19 -0
- package/src/index.ts +10 -0
- package/tsconfig.json +28 -0
package/README.md
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# mkcmd
|
|
2
|
+
|
|
3
|
+
A remote node executable for scaffolding other remote node executables with sensible defaults.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Interactive Project Setup** - Prompts for project name, target directory, and description using `@clack/prompts`
|
|
8
|
+
- **Full CLI Scaffold** - Generates a complete CLI project structure with configuration files
|
|
9
|
+
- **Core Utilities Included** - Ships with `file-builder.ts` and `file-utils.ts` for dynamic code generation
|
|
10
|
+
- **TypeScript & Bun** - Pre-configured TypeScript settings and Bun runtime support
|
|
11
|
+
- **Dynamic Core Copying** - Automatically copies all core CLI files to your new project
|
|
12
|
+
|
|
13
|
+
## What Gets Scaffolding
|
|
14
|
+
|
|
15
|
+
When you run `mkcmd init`, it creates:
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
project-name/
|
|
19
|
+
├── src/
|
|
20
|
+
│ ├── core/
|
|
21
|
+
│ │ ├── cli.ts # CLI framework with command registration
|
|
22
|
+
│ │ ├── log.ts # Logging helpers (single/multi info/warn/err, title)
|
|
23
|
+
│ │ ├── file-builder.ts # Indentation-aware file builder
|
|
24
|
+
│ │ └── file-utils.ts # Path caching and file writing utilities
|
|
25
|
+
│ ├── commands/
|
|
26
|
+
│ │ └── index.ts # Command registration hook
|
|
27
|
+
│ └── config.ts # Project configuration
|
|
28
|
+
├── package.json
|
|
29
|
+
├── tsconfig.json
|
|
30
|
+
└── README.md
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Installation
|
|
34
|
+
|
|
35
|
+
### For Development
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
bun install
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### From npm (after publishing)
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
npm install -g mkcmd
|
|
45
|
+
# or
|
|
46
|
+
bun install -g mkcmd
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Usage
|
|
50
|
+
|
|
51
|
+
### Development
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
# Show help
|
|
55
|
+
bun run src/index.ts --help
|
|
56
|
+
|
|
57
|
+
# Show version
|
|
58
|
+
bun run src/index.ts --version
|
|
59
|
+
|
|
60
|
+
# Initialize a new CLI project
|
|
61
|
+
bun run src/index.ts init
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Using Built Distribution
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
# Build for Bun runtime
|
|
68
|
+
bun run build
|
|
69
|
+
bun dist/index.js --help
|
|
70
|
+
|
|
71
|
+
# Build standalone executable
|
|
72
|
+
bun run build:exe
|
|
73
|
+
./dist/mkcmd --help
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### After Installation (from npm)
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
mkcmd --help
|
|
80
|
+
mkcmd init
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
The `init` command will prompt you for:
|
|
84
|
+
- Project name
|
|
85
|
+
- Target directory (defaults to `./<project-name>`)
|
|
86
|
+
- Project description
|
|
87
|
+
|
|
88
|
+
## Building for npm
|
|
89
|
+
|
|
90
|
+
To build and prepare for publishing:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
# Build the bundled JS file (requires Bun runtime)
|
|
94
|
+
bun run build
|
|
95
|
+
|
|
96
|
+
# Build standalone executable (works without Bun)
|
|
97
|
+
bun run build:exe
|
|
98
|
+
|
|
99
|
+
# Publish to npm
|
|
100
|
+
npm publish
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
**Note**: The default build (`bun run build`) produces a bundled JS file that requires Bun to run. The standalone executable (`bun run build:exe`) works independently but is platform-specific.
|
|
104
|
+
|
|
105
|
+
## Development
|
|
106
|
+
|
|
107
|
+
This project was created using `bun init` in bun v1.2.13. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime.
|
|
108
|
+
|
|
109
|
+
See [AGENTS.md](./AGENTS.md) for development guidelines and [RETRO.md](./RETRO.md) for session retrospective.
|
package/bun.lock
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"lockfileVersion": 1,
|
|
3
|
+
"workspaces": {
|
|
4
|
+
"": {
|
|
5
|
+
"name": "mkcmd",
|
|
6
|
+
"dependencies": {
|
|
7
|
+
"@clack/prompts": "^0.11.0",
|
|
8
|
+
"@types/figlet": "^1.7.0",
|
|
9
|
+
"figlet": "^1.9.4",
|
|
10
|
+
},
|
|
11
|
+
"devDependencies": {
|
|
12
|
+
"@types/bun": "latest",
|
|
13
|
+
},
|
|
14
|
+
"peerDependencies": {
|
|
15
|
+
"typescript": "^5",
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
"packages": {
|
|
20
|
+
"@clack/core": ["@clack/core@0.5.0", "", { "dependencies": { "picocolors": "^1.0.0", "sisteransi": "^1.0.5" } }, "sha512-p3y0FIOwaYRUPRcMO7+dlmLh8PSRcrjuTndsiA0WAFbWES0mLZlrjVoBRZ9DzkPFJZG6KGkJmoEAY0ZcVWTkow=="],
|
|
21
|
+
|
|
22
|
+
"@clack/prompts": ["@clack/prompts@0.11.0", "", { "dependencies": { "@clack/core": "0.5.0", "picocolors": "^1.0.0", "sisteransi": "^1.0.5" } }, "sha512-pMN5FcrEw9hUkZA4f+zLlzivQSeQf5dRGJjSUbvVYDLvpKCdQx5OaknvKzgbtXOizhP+SJJJjqEbOe55uKKfAw=="],
|
|
23
|
+
|
|
24
|
+
"@types/bun": ["@types/bun@1.3.5", "", { "dependencies": { "bun-types": "1.3.5" } }, "sha512-RnygCqNrd3srIPEWBd5LFeUYG7plCoH2Yw9WaZGyNmdTEei+gWaHqydbaIRkIkcbXwhBT94q78QljxN0Sk838w=="],
|
|
25
|
+
|
|
26
|
+
"@types/figlet": ["@types/figlet@1.7.0", "", {}, "sha512-KwrT7p/8Eo3Op/HBSIwGXOsTZKYiM9NpWRBJ5sVjWP/SmlS+oxxRvJht/FNAtliJvja44N3ul1yATgohnVBV0Q=="],
|
|
27
|
+
|
|
28
|
+
"@types/node": ["@types/node@25.0.3", "", { "dependencies": { "undici-types": "~7.16.0" } }, "sha512-W609buLVRVmeW693xKfzHeIV6nJGGz98uCPfeXI1ELMLXVeKYZ9m15fAMSaUPBHYLGFsVRcMmSCksQOrZV9BYA=="],
|
|
29
|
+
|
|
30
|
+
"bun-types": ["bun-types@1.3.5", "", { "dependencies": { "@types/node": "*" } }, "sha512-inmAYe2PFLs0SUbFOWSVD24sg1jFlMPxOjOSSCYqUgn4Hsc3rDc7dFvfVYjFPNHtov6kgUeulV4SxbuIV/stPw=="],
|
|
31
|
+
|
|
32
|
+
"commander": ["commander@14.0.2", "", {}, "sha512-TywoWNNRbhoD0BXs1P3ZEScW8W5iKrnbithIl0YH+uCmBd0QpPOA8yc82DS3BIE5Ma6FnBVUsJ7wVUDz4dvOWQ=="],
|
|
33
|
+
|
|
34
|
+
"figlet": ["figlet@1.9.4", "", { "dependencies": { "commander": "^14.0.0" }, "bin": { "figlet": "bin/index.js" } }, "sha512-uN6QE+TrzTAHC1IWTyrc4FfGo2KH/82J8Jl1tyKB7+z5DBit/m3D++Iu5lg91qJMnQQ3vpJrj5gxcK/pk4R9tQ=="],
|
|
35
|
+
|
|
36
|
+
"picocolors": ["picocolors@1.1.1", "", {}, "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA=="],
|
|
37
|
+
|
|
38
|
+
"sisteransi": ["sisteransi@1.0.5", "", {}, "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg=="],
|
|
39
|
+
|
|
40
|
+
"typescript": ["typescript@5.9.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw=="],
|
|
41
|
+
|
|
42
|
+
"undici-types": ["undici-types@7.16.0", "", {}, "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw=="],
|
|
43
|
+
}
|
|
44
|
+
}
|