create-thexjs-app 1.1.2 → 1.2.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
CHANGED
|
@@ -27,7 +27,7 @@ bun create thexjs-app@latest
|
|
|
27
27
|
You'll be guided through interactive prompts:
|
|
28
28
|
|
|
29
29
|
- **Project name** — e.g. `my-app`
|
|
30
|
-
- **Features** — choose from Tailwind CSS, shadcn/ui, Auth,
|
|
30
|
+
- **Features** — choose from Tailwind CSS, shadcn/ui, Auth, Content collections, and Hooks
|
|
31
31
|
- **Install & git** — confirm dependency install and `git init`
|
|
32
32
|
|
|
33
33
|
```bash
|
|
@@ -49,6 +49,7 @@ selected at prompt time (or via CLI flags).
|
|
|
49
49
|
| **shadcn/ui** | Accessible React components in `src/components/ui` (requires Tailwind) |
|
|
50
50
|
| **Auth** | SQLite-backed demo sessions, `/login` and a protected `/dashboard` with middleware |
|
|
51
51
|
| **Content** | Markdown/MDX with frontmatter in `content/`, auto-routed and indexed on `/blog` |
|
|
52
|
+
| **Hooks** | `@thexjs/hooks` dependency — SSR-safe React hooks (debounce, media query, localStorage, forms, server actions) |
|
|
52
53
|
|
|
53
54
|
Enabling **shadcn/ui** automatically enables **Tailwind CSS**.
|
|
54
55
|
|
|
@@ -70,6 +71,7 @@ bun create thexjs-app@latest my-app --tailwind --auth --content --shadcn
|
|
|
70
71
|
| `--shadcn` | Include shadcn/ui (implies `--tailwind`) |
|
|
71
72
|
| `--auth` | Include demo auth |
|
|
72
73
|
| `--content` | Include content collections |
|
|
74
|
+
| `--hooks` | Include the `@thexjs/hooks` package |
|
|
73
75
|
| `--no-install` | Skip `bun install` |
|
|
74
76
|
| `--no-git` | Skip `git init` |
|
|
75
77
|
| `--dev` | Start the dev server after install |
|
package/dist/index.js
CHANGED
|
@@ -72,6 +72,14 @@ var FEATURES = [
|
|
|
72
72
|
default: false,
|
|
73
73
|
dependencies: {},
|
|
74
74
|
devDependencies: {}
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
id: "hooks",
|
|
78
|
+
label: "Hooks (@thexjs/hooks)",
|
|
79
|
+
hint: "SSR-safe React hooks: debounce, media query, localStorage, forms, server actions",
|
|
80
|
+
default: false,
|
|
81
|
+
dependencies: {},
|
|
82
|
+
devDependencies: {}
|
|
75
83
|
}
|
|
76
84
|
];
|
|
77
85
|
var BASE_DEPENDENCIES = {
|
|
@@ -95,6 +103,7 @@ var TEMPLATES_ROOT = join(__dirname, "..", "templates");
|
|
|
95
103
|
var BASE_TEMPLATE = join(TEMPLATES_ROOT, "base");
|
|
96
104
|
var ADDONS_ROOT = join(TEMPLATES_ROOT, "addons");
|
|
97
105
|
var FALLBACK_CORE_VERSION = "1.2.2";
|
|
106
|
+
var FALLBACK_HOOKS_VERSION = "0.1.0";
|
|
98
107
|
function parseArgs(argv) {
|
|
99
108
|
const options = {
|
|
100
109
|
features: [],
|
|
@@ -132,6 +141,9 @@ function parseArgs(argv) {
|
|
|
132
141
|
case "--content":
|
|
133
142
|
nonInteractive.push("content");
|
|
134
143
|
break;
|
|
144
|
+
case "--hooks":
|
|
145
|
+
nonInteractive.push("hooks");
|
|
146
|
+
break;
|
|
135
147
|
default:
|
|
136
148
|
if (arg && !arg.startsWith("--")) positional.push(arg);
|
|
137
149
|
}
|
|
@@ -190,7 +202,7 @@ function finalizeGitignore(targetDir) {
|
|
|
190
202
|
const to = join(targetDir, ".gitignore");
|
|
191
203
|
renameSync(from, to);
|
|
192
204
|
}
|
|
193
|
-
function buildPackageJson(name, features, coreVersion, cliVersion) {
|
|
205
|
+
function buildPackageJson(name, features, coreVersion, cliVersion, hooksVersion) {
|
|
194
206
|
const dependencies = {
|
|
195
207
|
...BASE_DEPENDENCIES,
|
|
196
208
|
"@thexjs/core": `^${coreVersion}`
|
|
@@ -199,6 +211,9 @@ function buildPackageJson(name, features, coreVersion, cliVersion) {
|
|
|
199
211
|
...BASE_DEV_DEPENDENCIES,
|
|
200
212
|
"@thexjs/cli": `^${cliVersion}`
|
|
201
213
|
};
|
|
214
|
+
if (features.includes("hooks") && hooksVersion) {
|
|
215
|
+
dependencies["@thexjs/hooks"] = `^${hooksVersion}`;
|
|
216
|
+
}
|
|
202
217
|
for (const feature of features) {
|
|
203
218
|
const meta = FEATURES.find((f) => f.id === feature);
|
|
204
219
|
if (!meta) continue;
|
|
@@ -300,9 +315,10 @@ async function main() {
|
|
|
300
315
|
spin.message("Resolving latest @thexjs versions");
|
|
301
316
|
const coreVersion = await fetchLatestVersion("@thexjs/core") ?? FALLBACK_CORE_VERSION;
|
|
302
317
|
const cliVersion = await fetchLatestVersion("@thexjs/cli") ?? FALLBACK_CORE_VERSION;
|
|
318
|
+
const hooksVersion = features.includes("hooks") ? await fetchLatestVersion("@thexjs/hooks") ?? FALLBACK_HOOKS_VERSION : void 0;
|
|
303
319
|
writeFileSync(
|
|
304
320
|
join(targetDir, "package.json"),
|
|
305
|
-
buildPackageJson(slug, features, coreVersion, cliVersion)
|
|
321
|
+
buildPackageJson(slug, features, coreVersion, cliVersion, hooksVersion)
|
|
306
322
|
);
|
|
307
323
|
writeFileSync(join(targetDir, "x.config.ts"), buildXConfig(features));
|
|
308
324
|
spin.stop(`Created ${slug}/`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-thexjs-app",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Scaffold a new x framework app (npm create thexjs-app@latest).",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -42,7 +42,12 @@
|
|
|
42
42
|
"bin": {
|
|
43
43
|
"create-thexjs-app": "./dist/index.js"
|
|
44
44
|
},
|
|
45
|
-
"files": [
|
|
45
|
+
"files": [
|
|
46
|
+
"dist",
|
|
47
|
+
"templates",
|
|
48
|
+
"README.md",
|
|
49
|
+
"LICENSE"
|
|
50
|
+
],
|
|
46
51
|
"publishConfig": {
|
|
47
52
|
"access": "public"
|
|
48
53
|
},
|
|
@@ -58,7 +63,7 @@
|
|
|
58
63
|
"@clack/prompts": "^1.7.0"
|
|
59
64
|
},
|
|
60
65
|
"devDependencies": {
|
|
61
|
-
"@types/node": "^
|
|
66
|
+
"@types/node": "^26.2.0",
|
|
62
67
|
"tsup": "^8.3.0"
|
|
63
68
|
}
|
|
64
69
|
}
|
|
@@ -30,4 +30,4 @@ function CardContent({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
30
30
|
return <div className={cn("p-6 pt-0", className)} {...props} />;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
export { Card,
|
|
33
|
+
export { Card, CardContent, CardDescription, CardHeader, CardTitle };
|
|
@@ -6,8 +6,8 @@ html,
|
|
|
6
6
|
body {
|
|
7
7
|
margin: 0;
|
|
8
8
|
padding: 0;
|
|
9
|
-
font-family:
|
|
10
|
-
sans-serif;
|
|
9
|
+
font-family:
|
|
10
|
+
ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
|
11
11
|
color: #0f172a;
|
|
12
12
|
background: #ffffff;
|
|
13
13
|
-webkit-font-smoothing: antialiased;
|