better-ts-stack 2.1.0 → 2.1.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.
Files changed (107) hide show
  1. package/LICENSE +21 -21
  2. package/dist/args.js +9 -0
  3. package/dist/builder/configGenerator.js +3 -1
  4. package/dist/builder/moduleSelector.js +8 -1
  5. package/dist/builder/readmeGenerator.js +12 -0
  6. package/dist/builder/templateContext.js +24 -0
  7. package/dist/output/nextSteps.js +4 -0
  8. package/dist/prompts/index.js +3 -1
  9. package/dist/prompts/stack.js +9 -0
  10. package/dist/types/index.js +3 -0
  11. package/dist/ui/messages.js +3 -0
  12. package/package.json +71 -71
  13. package/templates/backend/express/.prettierignore +52 -52
  14. package/templates/backend/express/.prettierrc +16 -16
  15. package/templates/backend/express/config.json +8 -8
  16. package/templates/backend/express/gitignore +6 -1
  17. package/templates/backend/express/tsconfig.eslint.json +9 -9
  18. package/templates/backend/nestjs/.prettierignore +52 -52
  19. package/templates/backend/nestjs/config.json +10 -10
  20. package/templates/backend/nestjs/gitignore +6 -1
  21. package/templates/backend/nestjs/src/app.module.ts.hbs +1 -1
  22. package/templates/backend/nestjs/src/health/{health.controller.ts → health.controller.ts.hbs} +8 -0
  23. package/templates/backend/nestjs/tsconfig.eslint.json +9 -9
  24. package/templates/frontend/nextjs/app/globals.css +89 -89
  25. package/templates/frontend/nextjs/app/layout.tsx +34 -34
  26. package/templates/frontend/nextjs/components/ui/button.tsx +51 -51
  27. package/templates/frontend/nextjs/components/ui/card.tsx +60 -60
  28. package/templates/frontend/nextjs/components/ui/field.tsx +67 -67
  29. package/templates/frontend/nextjs/components/ui/input.tsx +18 -18
  30. package/templates/frontend/nextjs/config.json +35 -37
  31. package/templates/frontend/nextjs/eslint.config.mjs +11 -11
  32. package/templates/frontend/nextjs/gitignore +3 -0
  33. package/templates/frontend/nextjs/next.config.ts.hbs +12 -12
  34. package/templates/frontend/nextjs/postcss.config.mjs +7 -7
  35. package/templates/frontend/nextjs/public/file.svg +1 -1
  36. package/templates/frontend/nextjs/public/globe.svg +1 -1
  37. package/templates/frontend/nextjs/public/window.svg +1 -1
  38. package/templates/frontend/tanstack/components.json +18 -18
  39. package/templates/frontend/tanstack/config.json +15 -15
  40. package/templates/frontend/tanstack/eslint.config.mjs +23 -23
  41. package/templates/frontend/tanstack/gitignore +42 -39
  42. package/templates/frontend/tanstack/public/favicon.svg +7 -7
  43. package/templates/frontend/tanstack/src/components/ui/button.tsx +51 -51
  44. package/templates/frontend/tanstack/src/components/ui/card.tsx +60 -60
  45. package/templates/frontend/tanstack/src/components/ui/field.tsx +67 -67
  46. package/templates/frontend/tanstack/src/components/ui/input.tsx +18 -18
  47. package/templates/frontend/tanstack/src/lib/utils.ts +6 -6
  48. package/templates/frontend/tanstack/src/router.tsx +31 -31
  49. package/templates/frontend/tanstack/src/routes/__root.tsx +69 -69
  50. package/templates/frontend/tanstack/tsconfig.json +22 -22
  51. package/templates/frontend/tanstack/vite.config.ts +5 -4
  52. package/templates/modules/agents/AGENTS.md.hbs +237 -0
  53. package/templates/modules/agents/CLAUDE.md +1 -0
  54. package/templates/modules/agents/config.json +10 -0
  55. package/templates/modules/auth/express/config.json +1 -1
  56. package/templates/modules/auth/express/src/lib/jwt.ts.hbs +27 -27
  57. package/templates/modules/auth/express/src/middleware/requireAuth.ts.hbs +1 -2
  58. package/templates/modules/auth/nestjs/config.json +1 -1
  59. package/templates/modules/auth/nextjs/app/api/auth/[...all]/route.ts +4 -4
  60. package/templates/modules/auth/nextjs/config.json +18 -18
  61. package/templates/modules/auth/nextjs/lib/auth-client.ts +3 -3
  62. package/templates/{frontend/nextjs/proxy.ts.hbs → modules/auth/nextjs/proxy.ts} +1 -8
  63. package/templates/modules/auth/tanstack/config.json +18 -18
  64. package/templates/modules/auth/tanstack/src/lib/auth-client.ts +2 -2
  65. package/templates/modules/auth/tanstack/src/lib/auth-functions.ts +8 -8
  66. package/templates/modules/auth/tanstack/src/lib/auth.ts.hbs +37 -37
  67. package/templates/modules/auth/tanstack/src/routes/api/auth/$.ts +15 -15
  68. package/templates/modules/auth/tanstack/src/routes/dashboard.tsx +110 -110
  69. package/templates/modules/auth/tanstack/src/routes/sign-in.tsx +36 -36
  70. package/templates/modules/auth/tanstack/src/routes/sign-up.tsx +36 -36
  71. package/templates/modules/ci/.github/workflows/ci.yml.hbs +43 -0
  72. package/templates/modules/ci/config.json +10 -0
  73. package/templates/modules/docker/.dockerignore +3 -0
  74. package/templates/modules/docker/config.json +15 -15
  75. package/templates/modules/docker/docker-compose.yml.hbs +1 -1
  76. package/templates/modules/drizzle/express/config.json +26 -26
  77. package/templates/modules/drizzle/nestjs/config.json +26 -26
  78. package/templates/modules/drizzle/nextjs/config.json +26 -26
  79. package/templates/modules/drizzle/nextjs/drizzle.config.ts +13 -13
  80. package/templates/modules/drizzle/tanstack/config.json +26 -26
  81. package/templates/modules/drizzle/tanstack/drizzle.config.ts +12 -12
  82. package/templates/modules/drizzle/tanstack/src/lib/db.ts +13 -13
  83. package/templates/modules/mongoose/express/config.json +15 -15
  84. package/templates/modules/mongoose/express/src/lib/db.ts +43 -43
  85. package/templates/modules/mongoose/express/src/models/User.ts +48 -48
  86. package/templates/modules/mongoose/nestjs/config.json +15 -15
  87. package/templates/modules/mongoose/nextjs/config.json +15 -15
  88. package/templates/modules/mongoose/nextjs/models/User.ts +48 -48
  89. package/templates/modules/mongoose/tanstack/config.json +16 -16
  90. package/templates/modules/mongoose/tanstack/src/models/User.ts +48 -48
  91. package/templates/modules/prisma/express/config.json +27 -27
  92. package/templates/modules/prisma/express/prisma/schema.prisma +23 -23
  93. package/templates/modules/prisma/express/prisma.config.ts +4 -2
  94. package/templates/modules/prisma/nestjs/config.json +27 -27
  95. package/templates/modules/prisma/nestjs/prisma.config.ts +4 -2
  96. package/templates/modules/prisma/nextjs/config.json +28 -28
  97. package/templates/modules/prisma/nextjs/lib/prisma.ts +18 -18
  98. package/templates/modules/prisma/nextjs/prisma.config.ts +14 -12
  99. package/templates/modules/prisma/tanstack/config.json +28 -28
  100. package/templates/modules/prisma/tanstack/prisma/schema.prisma.hbs +91 -91
  101. package/templates/modules/prisma/tanstack/prisma.config.ts +14 -12
  102. package/templates/modules/prisma/tanstack/src/lib/prisma.ts +17 -17
  103. package/templates/modules/rate-limit/express/config.json +1 -1
  104. package/templates/modules/rate-limit/express/src/middleware/rateLimit.ts +3 -1
  105. package/templates/modules/vscode/.vscode/extensions.json.hbs +29 -0
  106. package/templates/modules/vscode/.vscode/settings.json.hbs +22 -0
  107. package/templates/modules/vscode/config.json +10 -0
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Abdullah
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Abdullah
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/dist/args.js CHANGED
@@ -22,6 +22,9 @@ Options left out are asked interactively, unless --yes is given.
22
22
  --docker, --no-docker Add Docker files
23
23
  --rate-limit, --no-rate-limit
24
24
  Add rate limiting (Express and NestJS)
25
+ --ci, --no-ci Add a GitHub Actions workflow
26
+ --agents, --no-agents Add AGENTS.md for AI coding agents
27
+ --vscode, --no-vscode Add VS Code settings and recommended extensions
25
28
  --git, --no-git Initialize a git repository
26
29
  --install, --no-install Install dependencies
27
30
  -y, --yes Use defaults for missing options and skip confirmation
@@ -56,6 +59,9 @@ function parseCliArgs(argv) {
56
59
  auth: { type: "boolean" },
57
60
  docker: { type: "boolean" },
58
61
  "rate-limit": { type: "boolean" },
62
+ ci: { type: "boolean" },
63
+ agents: { type: "boolean" },
64
+ vscode: { type: "boolean" },
59
65
  git: { type: "boolean" },
60
66
  install: { type: "boolean" },
61
67
  yes: { type: "boolean", short: "y" },
@@ -79,6 +85,9 @@ function parseCliArgs(argv) {
79
85
  useAuth: values.auth,
80
86
  useDocker: values.docker,
81
87
  useRateLimit: values["rate-limit"],
88
+ useCi: values.ci,
89
+ useAgents: values.agents,
90
+ useVscode: values.vscode,
82
91
  initGit: values.git,
83
92
  installDeps: values.install,
84
93
  };
@@ -136,7 +136,9 @@ async function generateEnvFile(targetDir, envVars) {
136
136
  let envContent = "# Environment Variables\n";
137
137
  envContent +=
138
138
  "# Copy this file to .env and update with your actual values\n\n";
139
- let localEnvContent = envContent;
139
+ let localEnvContent = "# Environment Variables\n";
140
+ localEnvContent +=
141
+ "# Local values for this project. Do not commit them\n\n";
140
142
  // Add each environment variable
141
143
  for (const [key, value] of Object.entries(envVars)) {
142
144
  const resolvedValue = exports.GENERATED_SECRETS.includes(key)
@@ -10,7 +10,8 @@ function selectModules(config) {
10
10
  : `frontend/${framework}`;
11
11
  const modules = [];
12
12
  // Database, auth, and rate-limit modules have one variant per framework
13
- // (prisma/express, auth/nextjs, ...); the Docker module is shared
13
+ // (prisma/express, auth/nextjs, ...); the Docker, CI, and agents modules are
14
+ // shared
14
15
  if (config.database !== "none")
15
16
  modules.push(`${config.database}/${framework}`);
16
17
  if (config.useDocker)
@@ -19,5 +20,11 @@ function selectModules(config) {
19
20
  modules.push(`auth/${framework}`);
20
21
  if (config.useRateLimit)
21
22
  modules.push(`rate-limit/${framework}`);
23
+ if (config.useCi)
24
+ modules.push("ci");
25
+ if (config.useAgents)
26
+ modules.push("agents");
27
+ if (config.useVscode)
28
+ modules.push("vscode");
22
29
  return { base, modules };
23
30
  }
@@ -52,8 +52,20 @@ function renderReadme(config, mergedConfig, targetDir) {
52
52
  ? "- **Auth:** Better Auth with email and password"
53
53
  : "- **Auth:** JWT with `/auth/register`, `/auth/login`, and `/auth/me`");
54
54
  }
55
+ if (config.useRateLimit) {
56
+ lines.push(`- **Rate limiting:** 100 requests per client IP in 15 minutes${config.useAuth ? ", and 10 sign-up or login attempts" : ""}`);
57
+ }
55
58
  if (config.useDocker)
56
59
  lines.push("- **Docker:** Dockerfile and Compose file");
60
+ if (config.useCi) {
61
+ lines.push("- **CI:** GitHub Actions builds, type-checks, and lints every push to `main` and every pull request");
62
+ }
63
+ if (config.useVscode) {
64
+ lines.push("- **VS Code:** workspace settings and recommended extensions in `.vscode/`");
65
+ }
66
+ if (config.useAgents) {
67
+ lines.push("- **AI agents:** `AGENTS.md` describes the stack, commands, and rules for coding agents");
68
+ }
57
69
  lines.push(`- **Package manager:** ${config.packageManager}`, "");
58
70
  const steps = (0, nextSteps_1.generateNextSteps)(config, targetDir, false, true);
59
71
  lines.push("## Getting started", "", ...steps.map((step, index) => {
@@ -31,6 +31,28 @@ const DOCKER_COMMANDS = {
31
31
  run: "bun run",
32
32
  },
33
33
  };
34
+ // Placeholders for the CI build, the same ones the Dockerfile uses: a build
35
+ // needs these to be set, but never connects to a database
36
+ function getCiBuildEnv(config) {
37
+ const env = [];
38
+ if (config.database === "prisma" || config.database === "drizzle") {
39
+ env.push({
40
+ name: "DATABASE_URL",
41
+ value: "postgresql://postgres:postgres@localhost:5432/postgres",
42
+ });
43
+ }
44
+ if (config.database === "mongoose") {
45
+ env.push({ name: "MONGODB_URI", value: "mongodb://localhost:27017/build" });
46
+ }
47
+ // next build loads the auth route, which initializes Better Auth
48
+ if (config.framework === "nextjs" && config.useAuth) {
49
+ env.push({
50
+ name: "BETTER_AUTH_SECRET",
51
+ value: "build-only-placeholder-secret-not-used-at-runtime",
52
+ });
53
+ }
54
+ return env;
55
+ }
34
56
  function buildTemplateContext(config) {
35
57
  return {
36
58
  projectName: config.projectName,
@@ -41,7 +63,9 @@ function buildTemplateContext(config) {
41
63
  useDocker: config.useDocker,
42
64
  useAuth: config.useAuth,
43
65
  useRateLimit: config.useRateLimit,
66
+ useCi: config.useCi,
44
67
  docker: DOCKER_COMMANDS[config.packageManager],
68
+ ciBuildEnv: getCiBuildEnv(config),
45
69
  helpers: {
46
70
  eq: (a, b) => a === b,
47
71
  runner: () => {
@@ -37,6 +37,10 @@ function generateNextSteps(config, targetDir, depsInstalled, isForReadme = false
37
37
  if (hasDockerDatabase) {
38
38
  steps.push("docker compose up -d db");
39
39
  }
40
+ if ((config.database === "prisma" || config.database === "drizzle") &&
41
+ !hasDockerDatabase) {
42
+ steps.push("Ensure PostgreSQL is running locally or update DATABASE_URL in .env");
43
+ }
40
44
  if (config.database === "prisma") {
41
45
  steps.push(`${config.packageManager} run prisma:generate`);
42
46
  steps.push(`${config.packageManager} run prisma:migrate`);
@@ -23,13 +23,15 @@ async function collectProjectPath(preset, isNonInteractive) {
23
23
  return (0, stack_1.ask)(preset, () => (0, ui_1.text)({
24
24
  message: "Project name",
25
25
  placeholder: "my-awesome-project",
26
- validate: (value) => (0, validators_1.validateProjectPath)(value ?? ""),
26
+ // An empty path would resolve to the current directory and pass
27
+ validate: (value) => value ? (0, validators_1.validateProjectPath)(value) : "Project name is required",
27
28
  }));
28
29
  }
29
30
  // Asks for final confirmation before building; declining ends the session
30
31
  async function confirmBuild() {
31
32
  const shouldBuild = await (0, stack_1.ask)(undefined, () => (0, ui_1.confirm)({ message: "Create this project?", initialValue: true }));
32
33
  if (!shouldBuild) {
34
+ (0, ui_1.info)("Nothing was created.");
33
35
  process.exit(0);
34
36
  }
35
37
  }
@@ -95,6 +95,12 @@ async function collectStackChoices(preset) {
95
95
  const useRateLimit = isFullstack
96
96
  ? false
97
97
  : await ask(preset.useRateLimit, () => (0, ui_1.confirm)({ message: "Add rate limiting?", initialValue: false }));
98
+ const useCi = await ask(preset.useCi, () => (0, ui_1.confirm)({ message: "Add GitHub Actions CI?", initialValue: false }));
99
+ const useAgents = await ask(preset.useAgents, () => (0, ui_1.confirm)({
100
+ message: "Add AGENTS.md for AI coding agents?",
101
+ initialValue: false,
102
+ }));
103
+ const useVscode = await ask(preset.useVscode, () => (0, ui_1.confirm)({ message: "Add VS Code settings?", initialValue: false }));
98
104
  const initGit = await ask(preset.initGit, () => (0, ui_1.confirm)({ message: "Initialize a git repository?", initialValue: true }));
99
105
  const installDeps = await ask(preset.installDeps, () => (0, ui_1.confirm)({ message: "Install dependencies now?", initialValue: false }));
100
106
  return {
@@ -104,6 +110,9 @@ async function collectStackChoices(preset) {
104
110
  useDocker,
105
111
  useAuth,
106
112
  useRateLimit,
113
+ useCi,
114
+ useAgents,
115
+ useVscode,
107
116
  initGit,
108
117
  installDeps,
109
118
  };
@@ -12,6 +12,9 @@ exports.DEFAULT_CHOICES = {
12
12
  useDocker: false,
13
13
  useAuth: false,
14
14
  useRateLimit: false,
15
+ useCi: false,
16
+ useAgents: false,
17
+ useVscode: false,
15
18
  packageManager: "npm",
16
19
  initGit: true,
17
20
  installDeps: false,
@@ -75,6 +75,9 @@ function showSummary(config, targetDir) {
75
75
  config.useAuth && "auth",
76
76
  config.useRateLimit && "rate limit",
77
77
  config.useDocker && "docker",
78
+ config.useCi && "ci",
79
+ config.useAgents && "agents",
80
+ config.useVscode && "vscode",
78
81
  ];
79
82
  const setup = [
80
83
  config.packageManager,
package/package.json CHANGED
@@ -1,71 +1,71 @@
1
- {
2
- "name": "better-ts-stack",
3
- "version": "2.1.0",
4
- "description": "A CLI that scaffolds Express, NestJS, Next.js, and TanStack Start projects with a database, authentication, and Docker already set up.",
5
- "keywords": [
6
- "cli",
7
- "builder",
8
- "backend",
9
- "typescript",
10
- "express",
11
- "nestjs",
12
- "nextjs",
13
- "tanstack-start",
14
- "prisma",
15
- "drizzle",
16
- "mongoose",
17
- "template"
18
- ],
19
- "homepage": "https://better-ts-stack.abdullahtech.me",
20
- "bugs": {
21
- "url": "https://github.com/Abdullah-dev0/better-ts-stack/issues"
22
- },
23
- "repository": {
24
- "type": "git",
25
- "url": "git+https://github.com/Abdullah-dev0/better-ts-stack.git"
26
- },
27
- "license": "MIT",
28
- "author": "Abdullah",
29
- "type": "commonjs",
30
- "main": "dist/index.js",
31
- "bin": {
32
- "better-ts-stack": "dist/index.js"
33
- },
34
- "files": [
35
- "dist",
36
- "templates"
37
- ],
38
- "scripts": {
39
- "dev": "tsx src/index.ts",
40
- "prebuild": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\"",
41
- "build": "tsc",
42
- "postbuild": "node -e \"const fs=require('fs');const p='dist/index.js';fs.writeFileSync(p,'#!/usr/bin/env node\\n'+fs.readFileSync(p,'utf8'))\"",
43
- "prepack": "npm run build",
44
- "start": "node dist/index.js",
45
- "lint": "eslint src",
46
- "lint:fix": "eslint src --fix",
47
- "format": "prettier --write \"**/*.{ts,tsx,js,jsx,json,md,mdx,css}\"",
48
- "format:check": "prettier --check \"**/*.{ts,tsx,js,jsx,json,md,mdx,css}\"",
49
- "type:check": "tsc --noEmit"
50
- },
51
- "dependencies": {
52
- "@clack/core": "^1.4.3",
53
- "fs-extra": "^11.4.0",
54
- "handlebars": "^4.7.9",
55
- "zod": "^4.5.4"
56
- },
57
- "devDependencies": {
58
- "@better-ts-stack/eslint-config": "*",
59
- "@better-ts-stack/prettier-config": "*",
60
- "@types/fs-extra": "^11.0.4",
61
- "@types/node": "^24.13.3",
62
- "eslint": "^10.10.0",
63
- "prettier": "^3.9.6",
64
- "tsx": "^4.23.13",
65
- "typescript": "^6.0.3"
66
- },
67
- "engines": {
68
- "node": ">=24.0.0"
69
- },
70
- "prettier": "@better-ts-stack/prettier-config"
71
- }
1
+ {
2
+ "name": "better-ts-stack",
3
+ "version": "2.1.2",
4
+ "description": "A CLI that scaffolds Express, NestJS, Next.js, and TanStack Start projects with a database, authentication, and Docker already set up.",
5
+ "keywords": [
6
+ "cli",
7
+ "builder",
8
+ "backend",
9
+ "typescript",
10
+ "express",
11
+ "nestjs",
12
+ "nextjs",
13
+ "tanstack-start",
14
+ "prisma",
15
+ "drizzle",
16
+ "mongoose",
17
+ "template"
18
+ ],
19
+ "homepage": "https://better-ts-stack.abdullahtech.me",
20
+ "bugs": {
21
+ "url": "https://github.com/Abdullah-dev0/better-ts-stack/issues"
22
+ },
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "git+https://github.com/Abdullah-dev0/better-ts-stack.git"
26
+ },
27
+ "license": "MIT",
28
+ "author": "Abdullah",
29
+ "type": "commonjs",
30
+ "main": "dist/index.js",
31
+ "bin": {
32
+ "better-ts-stack": "dist/index.js"
33
+ },
34
+ "files": [
35
+ "dist",
36
+ "templates"
37
+ ],
38
+ "scripts": {
39
+ "dev": "tsx src/index.ts",
40
+ "prebuild": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\"",
41
+ "build": "tsc",
42
+ "postbuild": "node -e \"const fs=require('fs');const p='dist/index.js';fs.writeFileSync(p,'#!/usr/bin/env node\\n'+fs.readFileSync(p,'utf8'))\"",
43
+ "prepack": "npm run build",
44
+ "start": "node dist/index.js",
45
+ "lint": "eslint src",
46
+ "lint:fix": "eslint src --fix",
47
+ "format": "prettier --write \"**/*.{ts,tsx,js,jsx,json,md,mdx,css}\"",
48
+ "format:check": "prettier --check \"**/*.{ts,tsx,js,jsx,json,md,mdx,css}\"",
49
+ "type:check": "tsc --noEmit"
50
+ },
51
+ "dependencies": {
52
+ "@clack/core": "^1.4.3",
53
+ "fs-extra": "^11.4.0",
54
+ "handlebars": "^4.7.10",
55
+ "zod": "^4.6.7"
56
+ },
57
+ "devDependencies": {
58
+ "@better-ts-stack/eslint-config": "*",
59
+ "@better-ts-stack/prettier-config": "*",
60
+ "@types/fs-extra": "^11.0.4",
61
+ "@types/node": "^24.13.3",
62
+ "eslint": "^10.10.0",
63
+ "prettier": "^3.9.6",
64
+ "tsx": "^4.23.13",
65
+ "typescript": "^6.0.3"
66
+ },
67
+ "engines": {
68
+ "node": ">=24.0.0"
69
+ },
70
+ "prettier": "@better-ts-stack/prettier-config"
71
+ }
@@ -1,52 +1,52 @@
1
- # Dependencies
2
- node_modules
3
- **/node_modules
4
-
5
- # Build outputs
6
- .next
7
- out
8
- dist
9
- build
10
- **/dist
11
- **/.next
12
- **/out
13
- **/build
14
-
15
- # Generated files
16
- *.min.js
17
- *.min.css
18
- coverage
19
- .nyc_output
20
-
21
- # Lock files
22
- package-lock.json
23
- yarn.lock
24
- pnpm-lock.yaml
25
- bun.lock
26
-
27
- # Logs
28
- *.log
29
- npm-debug.log*
30
- yarn-debug.log*
31
- yarn-error.log*
32
-
33
- # Environment files
34
- .env
35
- .env.local
36
- .env.*.local
37
-
38
- # IDE
39
- .vscode
40
- .idea
41
- *.swp
42
- *.swo
43
- *~
44
-
45
- # OS
46
- .DS_Store
47
- Thumbs.db
48
-
49
- # Templates (do not format generated/scaffold content)
50
- templates
51
- **/templates/**
52
- *.hbs
1
+ # Dependencies
2
+ node_modules
3
+ **/node_modules
4
+
5
+ # Build outputs
6
+ .next
7
+ out
8
+ dist
9
+ build
10
+ **/dist
11
+ **/.next
12
+ **/out
13
+ **/build
14
+
15
+ # Generated files
16
+ *.min.js
17
+ *.min.css
18
+ coverage
19
+ .nyc_output
20
+
21
+ # Lock files
22
+ package-lock.json
23
+ yarn.lock
24
+ pnpm-lock.yaml
25
+ bun.lock
26
+
27
+ # Logs
28
+ *.log
29
+ npm-debug.log*
30
+ yarn-debug.log*
31
+ yarn-error.log*
32
+
33
+ # Environment files
34
+ .env
35
+ .env.local
36
+ .env.*.local
37
+
38
+ # IDE
39
+ .vscode
40
+ .idea
41
+ *.swp
42
+ *.swo
43
+ *~
44
+
45
+ # OS
46
+ .DS_Store
47
+ Thumbs.db
48
+
49
+ # Templates (do not format generated/scaffold content)
50
+ templates
51
+ **/templates/**
52
+ *.hbs
@@ -1,16 +1,16 @@
1
- {
2
- "semi": true,
3
- "trailingComma": "es5",
4
- "singleQuote": false,
5
- "printWidth": 80,
6
- "tabWidth": 2,
7
- "useTabs": false,
8
- "arrowParens": "always",
9
- "endOfLine": "lf",
10
- "plugins": ["@trivago/prettier-plugin-sort-imports"],
11
- "importOrder": ["<THIRD_PARTY_MODULES>", "^[./]"],
12
- "importOrderSeparation": true,
13
- "importOrderSortSpecifiers": true,
14
- "importOrderGroupNamespaceSpecifiers": true,
15
- "importOrderCaseInsensitive": true
16
- }
1
+ {
2
+ "semi": true,
3
+ "trailingComma": "es5",
4
+ "singleQuote": false,
5
+ "printWidth": 80,
6
+ "tabWidth": 2,
7
+ "useTabs": false,
8
+ "arrowParens": "always",
9
+ "endOfLine": "lf",
10
+ "plugins": ["@trivago/prettier-plugin-sort-imports"],
11
+ "importOrder": ["<THIRD_PARTY_MODULES>", "^[./]"],
12
+ "importOrderSeparation": true,
13
+ "importOrderSortSpecifiers": true,
14
+ "importOrderGroupNamespaceSpecifiers": true,
15
+ "importOrderCaseInsensitive": true
16
+ }
@@ -13,13 +13,13 @@
13
13
  "type:check": "tsc --noEmit"
14
14
  },
15
15
  "dependencies": {
16
- "express": "^5.2.1",
16
+ "express": "^5.3.0",
17
17
  "dotenv": "^17.4.2",
18
18
  "cors": "^2.8.6",
19
19
  "cross-env": "^10.1.0",
20
20
  "helmet": "^8.3.0",
21
- "morgan": "^1.12.0",
22
- "zod": "^4.6.5"
21
+ "morgan": "^1.12.1",
22
+ "zod": "^4.6.7"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@eslint/js": "^10.0.1",
@@ -27,13 +27,13 @@
27
27
  "@types/cors": "^2.8.19",
28
28
  "@types/express": "^5.0.6",
29
29
  "@types/morgan": "^1.9.10",
30
- "@types/node": "^24.13.3",
31
- "eslint": "^10.10.0",
30
+ "@types/node": "^24.19.2",
31
+ "eslint": "^10.14.0",
32
32
  "eslint-config-prettier": "^10.1.8",
33
- "prettier": "^3.9.6",
34
- "tsx": "^4.23.13",
33
+ "prettier": "^3.9.10",
34
+ "tsx": "^4.23.15",
35
35
  "typescript": "^6.0.3",
36
- "typescript-eslint": "^8.69.0"
36
+ "typescript-eslint": "^8.72.1"
37
37
  },
38
38
  "envVars": {
39
39
  "PORT": "3000",
@@ -18,7 +18,9 @@ yarn-debug.log*
18
18
  yarn-error.log*
19
19
 
20
20
  # IDE
21
- .vscode/
21
+ .vscode/*
22
+ !.vscode/settings.json
23
+ !.vscode/extensions.json
22
24
  .idea/
23
25
  *.swp
24
26
  *.swo
@@ -34,3 +36,6 @@ coverage/
34
36
 
35
37
  # Misc
36
38
  *.tsbuildinfo
39
+
40
+ # Prisma client, created by prisma generate
41
+ src/generated/
@@ -1,9 +1,9 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "compilerOptions": {
4
- "noEmit": true,
5
- "allowJs": true,
6
- "rootDir": "."
7
- },
8
- "include": ["src/**/*", "eslint.config.mjs", "prisma.config.ts"]
9
- }
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "compilerOptions": {
4
+ "noEmit": true,
5
+ "allowJs": true,
6
+ "rootDir": "."
7
+ },
8
+ "include": ["src/**/*", "eslint.config.mjs", "prisma.config.ts"]
9
+ }