@vlandoss/starter 0.2.0 → 0.3.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/run.mjs +19 -3
- package/package.json +2 -2
- package/src/program/index.ts +4 -3
- package/src/program/ui.ts +19 -4
package/dist/run.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import path, { join } from "node:path";
|
|
2
|
-
import { createPkgService, createShellService, cwd, dirnameOf, getVersion, palette, run } from "@vlandoss/clibuddy";
|
|
2
|
+
import { colorize, createPkgService, createShellService, cwd, dirnameOf, getVersion, palette, run, text } from "@vlandoss/clibuddy";
|
|
3
3
|
import { Argument, Command, Option, createCommand } from "commander";
|
|
4
4
|
import fs from "node:fs";
|
|
5
5
|
import { createLoggy } from "@vlandoss/loggy";
|
|
@@ -171,12 +171,28 @@ function createInitCommand(ctx) {
|
|
|
171
171
|
}
|
|
172
172
|
}).addHelpText("afterAll", "\nUnder the hood, this command uses Plop.js to generate the project.");
|
|
173
173
|
}
|
|
174
|
-
|
|
174
|
+
//#endregion
|
|
175
|
+
//#region src/program/ui.ts
|
|
176
|
+
const vlandColor = colorize("#a78bfa");
|
|
177
|
+
function getBannerText(version) {
|
|
178
|
+
return `
|
|
179
|
+
${vlandColor(`
|
|
180
|
+
██╗ ██╗██╗ █████╗ ███╗ ██╗██████╗
|
|
181
|
+
██║ ██║██║ ██╔══██╗████╗ ██║██╔══██╗
|
|
182
|
+
██║ ██║██║ ███████║██╔██╗ ██║██║ ██║
|
|
183
|
+
╚██╗ ██╔╝██║ ██╔══██║██║╚██╗██║██║ ██║
|
|
184
|
+
╚████╔╝ ███████╗██║ ██║██║ ╚████║██████╔╝
|
|
185
|
+
╚═══╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═══╝╚═════╝ ${text.version(version)}
|
|
186
|
+
`.trim())}
|
|
187
|
+
|
|
188
|
+
🦉 ${palette.italic(palette.muted("The CLI to init a new project in"))} ${text.vland}\n`.trimStart();
|
|
189
|
+
}
|
|
175
190
|
//#endregion
|
|
176
191
|
//#region src/program/index.ts
|
|
177
192
|
async function createProgram(options) {
|
|
178
193
|
const ctx = await createContext(options.binDir);
|
|
179
|
-
|
|
194
|
+
const version = getVersion(ctx.binPkg);
|
|
195
|
+
return new Command("vland").version(version, "-v, --version").addHelpText("before", getBannerText(version)).addCommand(createInitCommand(ctx)).addCommand(createAddCommand(ctx));
|
|
180
196
|
}
|
|
181
197
|
//#endregion
|
|
182
198
|
//#region src/run.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vlandoss/starter",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "The CLI to init a new project in Variable Land",
|
|
5
5
|
"homepage": "https://github.com/variableland/dx/tree/main/packages/starter#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"commander": "14.0.3",
|
|
35
35
|
"node-plop": "0.32.3",
|
|
36
|
-
"@vlandoss/clibuddy": "0.
|
|
36
|
+
"@vlandoss/clibuddy": "0.4.0",
|
|
37
37
|
"@vlandoss/loggy": "0.2.0"
|
|
38
38
|
},
|
|
39
39
|
"publishConfig": {
|
package/src/program/index.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { Command } from "commander";
|
|
|
3
3
|
import { createContext } from "#src/services/ctx.ts";
|
|
4
4
|
import { createAddCommand } from "./commands/add.ts";
|
|
5
5
|
import { createInitCommand } from "./commands/init.ts";
|
|
6
|
-
import {
|
|
6
|
+
import { getBannerText } from "./ui.ts";
|
|
7
7
|
|
|
8
8
|
export type Options = {
|
|
9
9
|
binDir: string;
|
|
@@ -11,10 +11,11 @@ export type Options = {
|
|
|
11
11
|
|
|
12
12
|
export async function createProgram(options: Options) {
|
|
13
13
|
const ctx = await createContext(options.binDir);
|
|
14
|
+
const version = getVersion(ctx.binPkg);
|
|
14
15
|
|
|
15
16
|
return new Command("vland")
|
|
16
|
-
.version(
|
|
17
|
-
.addHelpText("before",
|
|
17
|
+
.version(version, "-v, --version")
|
|
18
|
+
.addHelpText("before", getBannerText(version))
|
|
18
19
|
.addCommand(createInitCommand(ctx))
|
|
19
20
|
.addCommand(createAddCommand(ctx));
|
|
20
21
|
}
|
package/src/program/ui.ts
CHANGED
|
@@ -1,7 +1,22 @@
|
|
|
1
|
-
import { palette } from "@vlandoss/clibuddy";
|
|
1
|
+
import { colorize, palette, text } from "@vlandoss/clibuddy";
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const vlandColor = colorize("#a78bfa");
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// npx figlet -f "ANSI Shadow" "vland"
|
|
6
|
+
export function getBannerText(version: string) {
|
|
7
|
+
const uiLogo = vlandColor(
|
|
8
|
+
`
|
|
9
|
+
██╗ ██╗██╗ █████╗ ███╗ ██╗██████╗
|
|
10
|
+
██║ ██║██║ ██╔══██╗████╗ ██║██╔══██╗
|
|
11
|
+
██║ ██║██║ ███████║██╔██╗ ██║██║ ██║
|
|
12
|
+
╚██╗ ██╔╝██║ ██╔══██║██║╚██╗██║██║ ██║
|
|
13
|
+
╚████╔╝ ███████╗██║ ██║██║ ╚████║██████╔╝
|
|
14
|
+
╚═══╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═══╝╚═════╝ ${text.version(version)}
|
|
15
|
+
`.trim(),
|
|
16
|
+
);
|
|
6
17
|
|
|
7
|
-
|
|
18
|
+
return `
|
|
19
|
+
${uiLogo}
|
|
20
|
+
|
|
21
|
+
🦉 ${palette.italic(palette.muted("The CLI to init a new project in"))} ${text.vland}\n`.trimStart();
|
|
22
|
+
}
|