create-better-t-stack 3.11.0-bun-compile-opentui.6a69159 → 3.11.0-bun-compile-opentui.bd6d873
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 -66
- package/src/helpers/addons/addons-setup.ts +0 -1
- package/src/index.ts +0 -3
- 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.bd6d873",
|
|
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.bd6d873",
|
|
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.bd6d873",
|
|
97
|
+
"@better-t-stack/cli-darwin-x64": "3.11.0-bun-compile-opentui.bd6d873",
|
|
98
|
+
"@better-t-stack/cli-linux-arm64": "3.11.0-bun-compile-opentui.bd6d873",
|
|
99
|
+
"@better-t-stack/cli-linux-x64": "3.11.0-bun-compile-opentui.bd6d873",
|
|
100
|
+
"@better-t-stack/cli-windows-x64": "3.11.0-bun-compile-opentui.bd6d873",
|
|
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,64 @@ 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.
|
|
12
|
+
*
|
|
13
|
+
* For dev/npm distribution: Uses the current source directory.
|
|
14
|
+
*
|
|
15
|
+
* Package structure when installed via npm/bunx:
|
|
16
|
+
* <cache>/node_modules/create-better-t-stack/
|
|
17
|
+
* ├── templates/ <-- templates are here
|
|
18
|
+
* ├── bin/ <-- stub is here
|
|
19
|
+
* └── node_modules/
|
|
20
|
+
* └── @better-t-stack/
|
|
21
|
+
* └── cli-darwin-arm64/
|
|
22
|
+
* └── bin/ <-- compiled binary runs from here
|
|
10
23
|
*/
|
|
11
|
-
function
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
// Use process.execPath to get actual filesystem path (Bun.main returns bunfs virtual path)
|
|
24
|
-
let current = path.dirname(process.execPath);
|
|
24
|
+
function findPackageRoot(): string {
|
|
25
|
+
// Get the directory of the current module
|
|
26
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
27
|
+
const __dirname = path.dirname(__filename);
|
|
28
|
+
|
|
29
|
+
// In development or when running from source (e.g., `bun run dev`),
|
|
30
|
+
// we're already in the right package - just go up from src/constants.ts
|
|
31
|
+
const devRoot = path.resolve(__dirname, "..");
|
|
32
|
+
const devTemplatesPath = path.join(devRoot, "templates");
|
|
33
|
+
if (fs.existsSync(devTemplatesPath)) {
|
|
34
|
+
return devRoot;
|
|
35
|
+
}
|
|
25
36
|
|
|
26
|
-
//
|
|
37
|
+
// For compiled binaries, walk up the directory tree looking for templates
|
|
38
|
+
// The binary is typically at:
|
|
39
|
+
// .../create-better-t-stack/node_modules/@better-t-stack/cli-{os}-{arch}/bin/
|
|
40
|
+
// And we need to find:
|
|
41
|
+
// .../create-better-t-stack/templates/
|
|
42
|
+
let current = __dirname;
|
|
27
43
|
while (current !== path.dirname(current)) {
|
|
28
|
-
|
|
29
|
-
const templatesPath = path.join(
|
|
30
|
-
|
|
44
|
+
// Check if this directory has templates (we found create-better-t-stack root)
|
|
45
|
+
const templatesPath = path.join(current, "templates");
|
|
31
46
|
if (fs.existsSync(templatesPath)) {
|
|
32
|
-
return
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
current = path.dirname(current);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
return null;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Get the package root directory.
|
|
43
|
-
* - In JS mode (development/tsdown build): relative to dist/
|
|
44
|
-
* - In compiled binary mode: find main package in node_modules, or use dev fallback
|
|
45
|
-
*/
|
|
46
|
-
function getPkgRoot(): string {
|
|
47
|
-
if (isCompiledBinary()) {
|
|
48
|
-
// First try: find main package in node_modules (production npm install)
|
|
49
|
-
const mainPkg = findMainPackage();
|
|
50
|
-
if (mainPkg) {
|
|
51
|
-
return mainPkg;
|
|
47
|
+
return current;
|
|
52
48
|
}
|
|
53
49
|
|
|
54
|
-
//
|
|
55
|
-
|
|
56
|
-
const
|
|
57
|
-
|
|
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, "..", "..", "..");
|
|
50
|
+
// Check for create-better-t-stack in node_modules at this level
|
|
51
|
+
const nodeModulesPath = path.join(current, "node_modules", "create-better-t-stack");
|
|
52
|
+
const nodeModulesTemplatesPath = path.join(nodeModulesPath, "templates");
|
|
53
|
+
if (fs.existsSync(nodeModulesTemplatesPath)) {
|
|
54
|
+
return nodeModulesPath;
|
|
63
55
|
}
|
|
64
56
|
|
|
65
|
-
|
|
66
|
-
const altTemplatesPath = path.resolve(binaryDir, "..", "..", "templates");
|
|
67
|
-
if (fs.existsSync(altTemplatesPath)) {
|
|
68
|
-
return path.resolve(binaryDir, "..", "..");
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
// Fourth try: templates at ../templates
|
|
72
|
-
const simpleTemplatesPath = path.resolve(binaryDir, "..", "templates");
|
|
73
|
-
if (fs.existsSync(simpleTemplatesPath)) {
|
|
74
|
-
return path.resolve(binaryDir, "..");
|
|
75
|
-
}
|
|
57
|
+
current = path.dirname(current);
|
|
76
58
|
}
|
|
77
59
|
|
|
78
|
-
//
|
|
79
|
-
|
|
80
|
-
const distPath = path.dirname(__filename);
|
|
81
|
-
return path.join(distPath, "../");
|
|
60
|
+
// Fallback: return dev root and hope for the best
|
|
61
|
+
return devRoot;
|
|
82
62
|
}
|
|
83
63
|
|
|
84
|
-
export const PKG_ROOT =
|
|
64
|
+
export const PKG_ROOT = findPackageRoot();
|
|
85
65
|
|
|
86
66
|
export const DEFAULT_CONFIG_BASE = {
|
|
87
67
|
projectName: "my-better-t-app",
|
package/src/index.ts
CHANGED
|
@@ -11,7 +11,6 @@ import { PKG_ROOT } from "../constants";
|
|
|
11
11
|
declare const CLI_VERSION: string | undefined;
|
|
12
12
|
|
|
13
13
|
export const getLatestCLIVersion = (): string => {
|
|
14
|
-
// Check if version was embedded at compile time
|
|
15
14
|
if (typeof CLI_VERSION !== "undefined") {
|
|
16
15
|
return CLI_VERSION;
|
|
17
16
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/templates/frontend/react/react-router/{react-router.config.ts → react-router.config.ts.hbs}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|