create-better-t-stack 3.11.0-bun-compile-opentui.2583611 → 3.11.0-bun-compile-opentui.eb5328c
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/package.json +7 -7
- package/src/constants.ts +46 -67
- package/src/helpers/addons/addons-setup.ts +0 -1
- package/src/index.ts +0 -3
- package/src/tui/app.tsx +133 -972
- package/src/tui/components/index.ts +11 -0
- package/src/tui/components/log-display.tsx +35 -0
- package/src/tui/components/logo.tsx +68 -0
- package/src/tui/components/prompts/confirm-step.tsx +43 -0
- package/src/tui/components/prompts/confirm.tsx +39 -0
- package/src/tui/components/prompts/index.ts +5 -0
- package/src/tui/components/prompts/input.tsx +36 -0
- package/src/tui/components/prompts/multi-select.tsx +46 -0
- package/src/tui/components/prompts/select.tsx +44 -0
- package/src/tui/components/spinner.tsx +21 -0
- package/src/tui/components/status-bar.tsx +68 -0
- package/src/tui/steps.ts +520 -0
- package/src/tui/theme.ts +22 -0
- package/src/utils/get-latest-cli-version.ts +0 -1
- /package/templates/examples/ai/native/bare/{polyfills.js → polyfills.js.hbs} +0 -0
- /package/templates/examples/ai/native/unistyles/{polyfills.js → polyfills.js.hbs} +0 -0
- /package/templates/examples/ai/native/uniwind/{polyfills.js → polyfills.js.hbs} +0 -0
- /package/templates/examples/todo/server/drizzle/mysql/src/schema/{todo.ts → todo.ts.hbs} +0 -0
- /package/templates/examples/todo/server/drizzle/postgres/src/schema/{todo.ts → todo.ts.hbs} +0 -0
- /package/templates/examples/todo/server/drizzle/sqlite/src/schema/{todo.ts → todo.ts.hbs} +0 -0
- /package/templates/frontend/native/uniwind/{global.css → global.css.hbs} +0 -0
- /package/templates/frontend/nuxt/app/assets/css/{main.css → main.css.hbs} +0 -0
- /package/templates/frontend/react/react-router/{react-router.config.ts → react-router.config.ts.hbs} +0 -0
- /package/templates/frontend/react/react-router/src/{routes.ts → routes.ts.hbs} +0 -0
- /package/templates/frontend/solid/{index.html → index.html.hbs} +0 -0
- /package/templates/frontend/solid/src/components/{loader.tsx → loader.tsx.hbs} +0 -0
- /package/templates/frontend/solid/src/{styles.css → styles.css.hbs} +0 -0
- /package/templates/frontend/svelte/src/{app.css → app.css.hbs} +0 -0
- /package/templates/frontend/svelte/src/{app.d.ts → app.d.ts.hbs} +0 -0
- /package/templates/frontend/svelte/src/{app.html → app.html.hbs} +0 -0
- /package/templates/frontend/svelte/src/lib/{index.ts → index.ts.hbs} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-better-t-stack",
|
|
3
|
-
"version": "3.11.0-bun-compile-opentui.
|
|
3
|
+
"version": "3.11.0-bun-compile-opentui.eb5328c",
|
|
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",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"prepublishOnly": "echo 'Build binaries separately before publishing'"
|
|
69
69
|
},
|
|
70
70
|
"dependencies": {
|
|
71
|
-
"@better-t-stack/types": "3.11.0-bun-compile-opentui.
|
|
71
|
+
"@better-t-stack/types": "3.11.0-bun-compile-opentui.eb5328c",
|
|
72
72
|
"@clack/prompts": "^1.0.0-alpha.8",
|
|
73
73
|
"@opentui/core": "^0.1.62",
|
|
74
74
|
"@opentui/react": "^0.1.62",
|
|
@@ -93,11 +93,11 @@
|
|
|
93
93
|
"typescript": "^5.9.3"
|
|
94
94
|
},
|
|
95
95
|
"optionalDependencies": {
|
|
96
|
-
"@better-t-stack/cli-darwin-arm64": "3.11.0-bun-compile-opentui.
|
|
97
|
-
"@better-t-stack/cli-darwin-x64": "3.11.0-bun-compile-opentui.
|
|
98
|
-
"@better-t-stack/cli-linux-arm64": "3.11.0-bun-compile-opentui.
|
|
99
|
-
"@better-t-stack/cli-linux-x64": "3.11.0-bun-compile-opentui.
|
|
100
|
-
"@better-t-stack/cli-windows-x64": "3.11.0-bun-compile-opentui.
|
|
96
|
+
"@better-t-stack/cli-darwin-arm64": "3.11.0-bun-compile-opentui.eb5328c",
|
|
97
|
+
"@better-t-stack/cli-darwin-x64": "3.11.0-bun-compile-opentui.eb5328c",
|
|
98
|
+
"@better-t-stack/cli-linux-arm64": "3.11.0-bun-compile-opentui.eb5328c",
|
|
99
|
+
"@better-t-stack/cli-linux-x64": "3.11.0-bun-compile-opentui.eb5328c",
|
|
100
|
+
"@better-t-stack/cli-windows-x64": "3.11.0-bun-compile-opentui.eb5328c",
|
|
101
101
|
"@opentui/core-darwin-arm64": "0.1.63",
|
|
102
102
|
"@opentui/core-darwin-x64": "0.1.63",
|
|
103
103
|
"@opentui/core-linux-arm64": "0.1.63",
|
package/src/constants.ts
CHANGED
|
@@ -4,84 +4,63 @@ import { fileURLToPath } from "node:url";
|
|
|
4
4
|
import { getUserPkgManager } from "./utils/get-package-manager";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* Find the package root directory containing templates.
|
|
8
|
+
*
|
|
9
|
+
* For compiled binaries: The binary runs from @better-t-stack/cli-{platform}-{arch},
|
|
10
|
+
* but templates are shipped with the main create-better-t-stack package.
|
|
11
|
+
* We need to find that package in node_modules.
|
|
12
|
+
*
|
|
13
|
+
* For dev/npm distribution: Uses the current source directory.
|
|
10
14
|
*/
|
|
11
|
-
function
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
function findMainPackage(): string | null {
|
|
23
|
-
// Use process.execPath to get actual filesystem path (Bun.main returns bunfs virtual path)
|
|
24
|
-
let current = path.dirname(process.execPath);
|
|
25
|
-
|
|
26
|
-
// Search up the directory tree for node_modules/create-better-t-stack
|
|
27
|
-
while (current !== path.dirname(current)) {
|
|
28
|
-
const candidate = path.join(current, "node_modules", "create-better-t-stack");
|
|
29
|
-
const templatesPath = path.join(candidate, "templates");
|
|
30
|
-
|
|
31
|
-
if (fs.existsSync(templatesPath)) {
|
|
32
|
-
return candidate;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
current = path.dirname(current);
|
|
15
|
+
function findPackageRoot(): string {
|
|
16
|
+
// Get the directory of the current module
|
|
17
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
18
|
+
const __dirname = path.dirname(__filename);
|
|
19
|
+
|
|
20
|
+
// In development or when running from source (e.g., `bun run dev`),
|
|
21
|
+
// we're already in the right package - just go up from src/constants.ts
|
|
22
|
+
const devRoot = path.resolve(__dirname, "..");
|
|
23
|
+
const devTemplatesPath = path.join(devRoot, "templates");
|
|
24
|
+
if (fs.existsSync(devTemplatesPath)) {
|
|
25
|
+
return devRoot;
|
|
36
26
|
}
|
|
37
27
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
return mainPkg;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
// Second try: development mode - binary is in dist/create-better-t-stack-{platform}-{arch}/bin/
|
|
55
|
-
// Use process.execPath to get actual filesystem path (Bun.main returns bunfs virtual path)
|
|
56
|
-
const binaryPath = process.execPath;
|
|
57
|
-
const binaryDir = path.dirname(binaryPath);
|
|
58
|
-
|
|
59
|
-
// Templates are at ../../../templates relative to the binary (bin -> platform-dir -> dist -> apps/cli)
|
|
60
|
-
const devTemplatesPath = path.resolve(binaryDir, "..", "..", "..", "templates");
|
|
61
|
-
if (fs.existsSync(devTemplatesPath)) {
|
|
62
|
-
return path.resolve(binaryDir, "..", "..", "..");
|
|
28
|
+
// For compiled binaries, the binary is in @better-t-stack/cli-{platform}-{arch}/bin/
|
|
29
|
+
// We need to find create-better-t-stack package which contains templates
|
|
30
|
+
// Walk up from the binary location to find node_modules
|
|
31
|
+
let current = __dirname;
|
|
32
|
+
while (current !== path.dirname(current)) {
|
|
33
|
+
// Check if we're in node_modules and can find the main package
|
|
34
|
+
const nodeModulesPath = path.join(current, "node_modules");
|
|
35
|
+
if (fs.existsSync(nodeModulesPath)) {
|
|
36
|
+
const mainPackagePath = path.join(nodeModulesPath, "create-better-t-stack");
|
|
37
|
+
const mainTemplatesPath = path.join(mainPackagePath, "templates");
|
|
38
|
+
if (fs.existsSync(mainTemplatesPath)) {
|
|
39
|
+
return mainPackagePath;
|
|
40
|
+
}
|
|
63
41
|
}
|
|
64
42
|
|
|
65
|
-
//
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
43
|
+
// Also check if current directory is inside node_modules
|
|
44
|
+
// e.g., /path/node_modules/@better-t-stack/cli-darwin-arm64/bin
|
|
45
|
+
const parts = current.split(path.sep);
|
|
46
|
+
const nodeModulesIndex = parts.lastIndexOf("node_modules");
|
|
47
|
+
if (nodeModulesIndex !== -1) {
|
|
48
|
+
const nodeModulesDir = parts.slice(0, nodeModulesIndex + 1).join(path.sep);
|
|
49
|
+
const mainPackagePath = path.join(nodeModulesDir, "create-better-t-stack");
|
|
50
|
+
const mainTemplatesPath = path.join(mainPackagePath, "templates");
|
|
51
|
+
if (fs.existsSync(mainTemplatesPath)) {
|
|
52
|
+
return mainPackagePath;
|
|
53
|
+
}
|
|
69
54
|
}
|
|
70
55
|
|
|
71
|
-
|
|
72
|
-
const simpleTemplatesPath = path.resolve(binaryDir, "..", "templates");
|
|
73
|
-
if (fs.existsSync(simpleTemplatesPath)) {
|
|
74
|
-
return path.resolve(binaryDir, "..");
|
|
75
|
-
}
|
|
56
|
+
current = path.dirname(current);
|
|
76
57
|
}
|
|
77
58
|
|
|
78
|
-
//
|
|
79
|
-
|
|
80
|
-
const distPath = path.dirname(__filename);
|
|
81
|
-
return path.join(distPath, "../");
|
|
59
|
+
// Fallback: return dev root and hope for the best
|
|
60
|
+
return devRoot;
|
|
82
61
|
}
|
|
83
62
|
|
|
84
|
-
export const PKG_ROOT =
|
|
63
|
+
export const PKG_ROOT = findPackageRoot();
|
|
85
64
|
|
|
86
65
|
export const DEFAULT_CONFIG_BASE = {
|
|
87
66
|
projectName: "my-better-t-app",
|