@vlandoss/starter 0.4.0 → 0.4.1-git-53b6b02.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 +9 -0
- package/dist/cli.usage.kdl +2 -2
- package/dist/run.mjs +3 -3
- package/package.json +3 -3
- package/src/program/index.ts +1 -2
- package/src/services/ctx.ts +3 -3
package/README.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
The CLI to init a new project in Variable Land 👊
|
|
4
4
|
|
|
5
|
+
> [!CAUTION]
|
|
6
|
+
> `@vlandoss/starter` is deprecated. Use [`@vlandoss/vland`](https://github.com/variableland/dx/tree/main/packages/vland) instead — same `vland` binary, modern stack (`giget` + `@clack/prompts` + `commander`), and three first-class templates (`library`, `backend`, `monorepo`).
|
|
7
|
+
>
|
|
8
|
+
> ```sh
|
|
9
|
+
> pnpm add -g @vlandoss/vland
|
|
10
|
+
> # or one-shot:
|
|
11
|
+
> npx @vlandoss/vland init
|
|
12
|
+
> ```
|
|
13
|
+
|
|
5
14
|
## Prerequisites
|
|
6
15
|
|
|
7
16
|
- Node.js >= 24.0.0
|
package/dist/cli.usage.kdl
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// @generated by @usage-spec/commander from Commander.js metadata
|
|
2
2
|
name vland
|
|
3
3
|
bin vland
|
|
4
|
-
version "0.4.0"
|
|
4
|
+
version "0.4.1-git-53b6b02.0"
|
|
5
5
|
usage "[options] [command]"
|
|
6
6
|
flag --usage help="print KDL spec for this CLI (https://kdl.dev)"
|
|
7
|
-
cmd completion help="print shell completion script 🐚 (
|
|
7
|
+
cmd completion help="print shell completion script 🐚 (\u{1b}[38;2;36;197;94musage\u{1b}[39m)" {
|
|
8
8
|
long_help "Prints a shell completion script for vland. Add to your shell rc file:\n\n bash: eval \"$(vland completion bash)\"\n zsh: eval \"$(vland completion zsh)\"\n fish: vland completion fish | source"
|
|
9
9
|
arg <shell> help="target shell" {
|
|
10
10
|
choices bash zsh fish
|
package/dist/run.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import path, { join } from "node:path";
|
|
2
|
-
import { colorize,
|
|
2
|
+
import { colorize, createPkg, createShellService, cwd, dirnameOf, 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";
|
|
@@ -32,7 +32,7 @@ async function createContext(binDir) {
|
|
|
32
32
|
const debug = logger.subdebug("create-context-value");
|
|
33
33
|
const binPath = fs.realpathSync(binDir);
|
|
34
34
|
debug("bin path %s", binPath);
|
|
35
|
-
const binPkg = await
|
|
35
|
+
const binPkg = await createPkg(binPath);
|
|
36
36
|
if (!binPkg) throw new Error("Could not find bin package.json");
|
|
37
37
|
debug("bin pkg info %O", binPkg.info());
|
|
38
38
|
return {
|
|
@@ -216,7 +216,7 @@ function addUsage(program) {
|
|
|
216
216
|
//#region src/program/index.ts
|
|
217
217
|
async function createProgram(options) {
|
|
218
218
|
const ctx = await createContext(options.binDir);
|
|
219
|
-
const version =
|
|
219
|
+
const version = ctx.binPkg.version;
|
|
220
220
|
return addUsage(new Command("vland").version(version, "-v, --version").addHelpText("before", getBannerText(version)).addCommand(createCompletionCommand()).addCommand(createInitCommand(ctx)).addCommand(createAddCommand(ctx)));
|
|
221
221
|
}
|
|
222
222
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vlandoss/starter",
|
|
3
|
-
"version": "0.4.0",
|
|
3
|
+
"version": "0.4.1-git-53b6b02.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": {
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"@usage-spec/commander": "1.1.0",
|
|
35
35
|
"commander": "14.0.3",
|
|
36
36
|
"node-plop": "0.32.3",
|
|
37
|
-
"@vlandoss/
|
|
38
|
-
"@vlandoss/
|
|
37
|
+
"@vlandoss/loggy": "0.2.0",
|
|
38
|
+
"@vlandoss/clibuddy": "0.4.1-git-53b6b02.0"
|
|
39
39
|
},
|
|
40
40
|
"publishConfig": {
|
|
41
41
|
"access": "public"
|
package/src/program/index.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { getVersion } from "@vlandoss/clibuddy";
|
|
2
1
|
import { Command } from "commander";
|
|
3
2
|
import { createContext } from "#src/services/ctx.ts";
|
|
4
3
|
import { createAddCommand } from "./commands/add.ts";
|
|
@@ -13,7 +12,7 @@ export type Options = {
|
|
|
13
12
|
|
|
14
13
|
export async function createProgram(options: Options) {
|
|
15
14
|
const ctx = await createContext(options.binDir);
|
|
16
|
-
const version =
|
|
15
|
+
const version = ctx.binPkg.version;
|
|
17
16
|
|
|
18
17
|
return addUsage(
|
|
19
18
|
new Command("vland")
|
package/src/services/ctx.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
|
-
import {
|
|
2
|
+
import { createPkg, createShellService, type Pkg, type ShellService } from "@vlandoss/clibuddy";
|
|
3
3
|
import { ConfigService } from "./config.ts";
|
|
4
4
|
import { logger } from "./logger.ts";
|
|
5
5
|
|
|
6
6
|
export type ContextValue = {
|
|
7
|
-
binPkg:
|
|
7
|
+
binPkg: Pkg;
|
|
8
8
|
config: ConfigService;
|
|
9
9
|
shell: ShellService;
|
|
10
10
|
};
|
|
@@ -16,7 +16,7 @@ export async function createContext(binDir: string): Promise<ContextValue> {
|
|
|
16
16
|
|
|
17
17
|
debug("bin path %s", binPath);
|
|
18
18
|
|
|
19
|
-
const binPkg = await
|
|
19
|
+
const binPkg = await createPkg(binPath);
|
|
20
20
|
|
|
21
21
|
if (!binPkg) {
|
|
22
22
|
throw new Error("Could not find bin package.json");
|