create-kubojs 0.2.1 → 0.2.2
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.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{src-CvkZZND8.mjs → src-CAMyqVYx.mjs} +38 -9
- package/package.json +3 -3
package/dist/cli.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { _ as getLatestCLIVersion, g as types_exports, i as SchemaNameSchema, l as create, m as getSchemaResult, s as add, u as createBtsCli } from "./src-
|
|
2
|
+
import { _ as getLatestCLIVersion, g as types_exports, i as SchemaNameSchema, l as create, m as getSchemaResult, s as add, u as createBtsCli } from "./src-CAMyqVYx.mjs";
|
|
3
3
|
import z from "zod";
|
|
4
4
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
5
5
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { C as UserCancelledError, S as ProjectCreationError, a as TEMPLATE_COUNT, b as DatabaseSetupError, c as builder, d as createVirtual, f as docs, h as router, i as SchemaNameSchema, l as create, m as getSchemaResult, n as GeneratorError, o as VirtualFileSystem, p as generate, r as Result, s as add, t as EMBEDDED_TEMPLATES, u as createBtsCli, v as CLIError, w as ValidationError, x as DirectoryConflictError, y as CompatibilityError } from "./src-
|
|
2
|
+
import { C as UserCancelledError, S as ProjectCreationError, a as TEMPLATE_COUNT, b as DatabaseSetupError, c as builder, d as createVirtual, f as docs, h as router, i as SchemaNameSchema, l as create, m as getSchemaResult, n as GeneratorError, o as VirtualFileSystem, p as generate, r as Result, s as add, t as EMBEDDED_TEMPLATES, u as createBtsCli, v as CLIError, w as ValidationError, x as DirectoryConflictError, y as CompatibilityError } from "./src-CAMyqVYx.mjs";
|
|
3
3
|
export { CLIError, CompatibilityError, DatabaseSetupError, DirectoryConflictError, EMBEDDED_TEMPLATES, GeneratorError, ProjectCreationError, Result, SchemaNameSchema, TEMPLATE_COUNT, UserCancelledError, ValidationError, VirtualFileSystem, add, builder, create, createBtsCli, createVirtual, docs, generate, getSchemaResult, router };
|
|
@@ -30,9 +30,30 @@ const KUBO_COLORS = {
|
|
|
30
30
|
orange: "#e08a2e",
|
|
31
31
|
cream: "#f2ede0"
|
|
32
32
|
};
|
|
33
|
-
const
|
|
33
|
+
const TRUECOLOR_COLORTERM = new Set(["24bit", "truecolor"]);
|
|
34
|
+
function parseForceColor(forceColor) {
|
|
35
|
+
if (forceColor === void 0 || forceColor === "") return void 0;
|
|
36
|
+
if (forceColor === "true") return 1;
|
|
37
|
+
const parsed = Number.parseInt(forceColor, 10);
|
|
38
|
+
return Number.isNaN(parsed) ? 1 : parsed;
|
|
39
|
+
}
|
|
40
|
+
function supportsAnsiColor(env = process.env, terminal = process.stdout) {
|
|
41
|
+
if (env.NO_COLOR !== void 0) return false;
|
|
42
|
+
const forceColor = parseForceColor(env.FORCE_COLOR);
|
|
43
|
+
if (forceColor === 0) return false;
|
|
44
|
+
if (forceColor !== void 0) return true;
|
|
45
|
+
return terminal.isTTY === true;
|
|
46
|
+
}
|
|
47
|
+
function supportsTrueColor(env = process.env, terminal = process.stdout) {
|
|
48
|
+
if (!supportsAnsiColor(env, terminal)) return false;
|
|
49
|
+
const forceColor = parseForceColor(env.FORCE_COLOR);
|
|
50
|
+
if (forceColor !== void 0) return forceColor >= 3;
|
|
51
|
+
const colorTerm = env.COLORTERM?.toLowerCase();
|
|
52
|
+
if (colorTerm !== void 0 && TRUECOLOR_COLORTERM.has(colorTerm)) return true;
|
|
53
|
+
return env.TERM?.toLowerCase().includes("direct") === true;
|
|
54
|
+
}
|
|
34
55
|
function createColor(hex, fallback) {
|
|
35
|
-
if (!supportsTrueColor) return fallback;
|
|
56
|
+
if (!supportsTrueColor()) return fallback;
|
|
36
57
|
const red = Number.parseInt(hex.slice(1, 3), 16);
|
|
37
58
|
const green = Number.parseInt(hex.slice(3, 5), 16);
|
|
38
59
|
const blue = Number.parseInt(hex.slice(5, 7), 16);
|
|
@@ -464,10 +485,12 @@ const KUBO_TITLE_COLORS = [
|
|
|
464
485
|
const renderTitle = () => {
|
|
465
486
|
const terminalWidth = process.stdout.columns || 80;
|
|
466
487
|
const titleLines = TITLE_TEXT.split("\n");
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
console.log(gradient([...KUBO_TITLE_COLORS]).multiline(
|
|
470
|
-
|
|
488
|
+
const title = terminalWidth < Math.max(...titleLines.map((line) => line.length)) ? "Kubo" : TITLE_TEXT;
|
|
489
|
+
if (supportsTrueColor()) {
|
|
490
|
+
console.log(gradient([...KUBO_TITLE_COLORS]).multiline(title));
|
|
491
|
+
return;
|
|
492
|
+
}
|
|
493
|
+
console.log(pc.yellow(title));
|
|
471
494
|
};
|
|
472
495
|
//#endregion
|
|
473
496
|
//#region src/commands/history.ts
|
|
@@ -917,6 +940,12 @@ function getMultiHint() {
|
|
|
917
940
|
function normalizeValidationMessage(validationMessage) {
|
|
918
941
|
return validationMessage instanceof Error ? validationMessage.message : validationMessage;
|
|
919
942
|
}
|
|
943
|
+
function formatKeycap(key) {
|
|
944
|
+
return pc.bold(`<${key}>`);
|
|
945
|
+
}
|
|
946
|
+
function getRequiredMultiselectMessage() {
|
|
947
|
+
return `Please select at least one option.\n${pc.dim(`Press ${formatKeycap("space")} to select, ${formatKeycap("enter")} to submit`)}`;
|
|
948
|
+
}
|
|
920
949
|
async function runWithNavigation(prompt) {
|
|
921
950
|
let goBack = false;
|
|
922
951
|
prompt.on("key", (char) => {
|
|
@@ -974,7 +1003,7 @@ async function navigableMultiselect(opts) {
|
|
|
974
1003
|
initialValues: opts.initialValues,
|
|
975
1004
|
required,
|
|
976
1005
|
validate(selected) {
|
|
977
|
-
if (required && (selected === void 0 || selected.length === 0)) return
|
|
1006
|
+
if (required && (selected === void 0 || selected.length === 0)) return getRequiredMultiselectMessage();
|
|
978
1007
|
return normalizeValidationMessage(opts.validate?.(selected));
|
|
979
1008
|
},
|
|
980
1009
|
render() {
|
|
@@ -1058,7 +1087,7 @@ async function navigableGroupMultiselect(opts) {
|
|
|
1058
1087
|
required,
|
|
1059
1088
|
selectableGroups: true,
|
|
1060
1089
|
validate(selected) {
|
|
1061
|
-
if (required && (selected === void 0 || selected.length === 0)) return
|
|
1090
|
+
if (required && (selected === void 0 || selected.length === 0)) return getRequiredMultiselectMessage();
|
|
1062
1091
|
return normalizeValidationMessage(opts.validate?.(selected));
|
|
1063
1092
|
},
|
|
1064
1093
|
render() {
|
|
@@ -4118,7 +4147,7 @@ function kuboText(options) {
|
|
|
4118
4147
|
initialValue: options.initialValue,
|
|
4119
4148
|
render() {
|
|
4120
4149
|
const title = `${cliColors.signal(S_BAR)}\n${cliColors.bright(S_STEP_ACTIVE)} ${options.message}\n`;
|
|
4121
|
-
const placeholder = options.placeholder ? pc.
|
|
4150
|
+
const placeholder = options.placeholder ? pc.dim(options.placeholder) : pc.dim("_");
|
|
4122
4151
|
const input = this.userInput ? this.userInputWithCursor : placeholder;
|
|
4123
4152
|
const value = this.value ?? "";
|
|
4124
4153
|
switch (this.state) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-kubojs",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "A modern CLI tool for scaffolding end-to-end type-safe TypeScript projects with best practices and customizable configurations",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"better-auth",
|
|
@@ -73,8 +73,8 @@
|
|
|
73
73
|
"dependencies": {
|
|
74
74
|
"@clack/core": "^1.4.1",
|
|
75
75
|
"@clack/prompts": "^1.5.1",
|
|
76
|
-
"@kubojs/template-generator": "^0.2.
|
|
77
|
-
"@kubojs/types": "^0.2.
|
|
76
|
+
"@kubojs/template-generator": "^0.2.2",
|
|
77
|
+
"@kubojs/types": "^0.2.2",
|
|
78
78
|
"@modelcontextprotocol/sdk": "1.29.0",
|
|
79
79
|
"@tanstack/router-generator": "1.167.28",
|
|
80
80
|
"@trpc/server": "^11.17.0",
|