better-ts-stack 2.1.1 → 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 (86) hide show
  1. package/LICENSE +21 -21
  2. package/dist/args.js +6 -0
  3. package/dist/builder/moduleSelector.js +6 -1
  4. package/dist/builder/readmeGenerator.js +6 -0
  5. package/dist/builder/templateContext.js +1 -0
  6. package/dist/prompts/stack.js +7 -0
  7. package/dist/types/index.js +2 -0
  8. package/dist/ui/messages.js +2 -0
  9. package/package.json +71 -71
  10. package/templates/backend/express/.prettierignore +52 -52
  11. package/templates/backend/express/.prettierrc +16 -16
  12. package/templates/backend/express/gitignore +3 -1
  13. package/templates/backend/express/tsconfig.eslint.json +9 -9
  14. package/templates/backend/nestjs/.prettierignore +52 -52
  15. package/templates/backend/nestjs/gitignore +3 -1
  16. package/templates/backend/nestjs/tsconfig.eslint.json +9 -9
  17. package/templates/frontend/nextjs/app/globals.css +89 -89
  18. package/templates/frontend/nextjs/app/layout.tsx +34 -34
  19. package/templates/frontend/nextjs/components/ui/button.tsx +51 -51
  20. package/templates/frontend/nextjs/components/ui/card.tsx +60 -60
  21. package/templates/frontend/nextjs/components/ui/field.tsx +67 -67
  22. package/templates/frontend/nextjs/components/ui/input.tsx +18 -18
  23. package/templates/frontend/nextjs/config.json +35 -35
  24. package/templates/frontend/nextjs/eslint.config.mjs +11 -11
  25. package/templates/frontend/nextjs/next.config.ts.hbs +12 -12
  26. package/templates/frontend/nextjs/postcss.config.mjs +7 -7
  27. package/templates/frontend/nextjs/public/file.svg +1 -1
  28. package/templates/frontend/nextjs/public/globe.svg +1 -1
  29. package/templates/frontend/nextjs/public/window.svg +1 -1
  30. package/templates/frontend/tanstack/components.json +18 -18
  31. package/templates/frontend/tanstack/eslint.config.mjs +23 -23
  32. package/templates/frontend/tanstack/gitignore +39 -39
  33. package/templates/frontend/tanstack/public/favicon.svg +7 -7
  34. package/templates/frontend/tanstack/src/components/ui/button.tsx +51 -51
  35. package/templates/frontend/tanstack/src/components/ui/card.tsx +60 -60
  36. package/templates/frontend/tanstack/src/components/ui/field.tsx +67 -67
  37. package/templates/frontend/tanstack/src/components/ui/input.tsx +18 -18
  38. package/templates/frontend/tanstack/src/lib/utils.ts +6 -6
  39. package/templates/frontend/tanstack/src/router.tsx +31 -31
  40. package/templates/frontend/tanstack/src/routes/__root.tsx +69 -69
  41. package/templates/frontend/tanstack/tsconfig.json +22 -22
  42. package/templates/modules/agents/AGENTS.md.hbs +237 -0
  43. package/templates/modules/agents/CLAUDE.md +1 -0
  44. package/templates/modules/agents/config.json +10 -0
  45. package/templates/modules/auth/express/src/lib/jwt.ts.hbs +27 -27
  46. package/templates/modules/auth/nextjs/app/api/auth/[...all]/route.ts +4 -4
  47. package/templates/modules/auth/nextjs/config.json +18 -18
  48. package/templates/modules/auth/nextjs/lib/auth-client.ts +3 -3
  49. package/templates/modules/auth/tanstack/config.json +18 -18
  50. package/templates/modules/auth/tanstack/src/lib/auth-client.ts +2 -2
  51. package/templates/modules/auth/tanstack/src/lib/auth-functions.ts +8 -8
  52. package/templates/modules/auth/tanstack/src/lib/auth.ts.hbs +37 -37
  53. package/templates/modules/auth/tanstack/src/routes/api/auth/$.ts +15 -15
  54. package/templates/modules/auth/tanstack/src/routes/dashboard.tsx +110 -110
  55. package/templates/modules/auth/tanstack/src/routes/sign-in.tsx +36 -36
  56. package/templates/modules/auth/tanstack/src/routes/sign-up.tsx +36 -36
  57. package/templates/modules/docker/.dockerignore +2 -0
  58. package/templates/modules/docker/config.json +15 -15
  59. package/templates/modules/drizzle/express/config.json +26 -26
  60. package/templates/modules/drizzle/nestjs/config.json +26 -26
  61. package/templates/modules/drizzle/nextjs/config.json +26 -26
  62. package/templates/modules/drizzle/nextjs/drizzle.config.ts +13 -13
  63. package/templates/modules/drizzle/tanstack/config.json +26 -26
  64. package/templates/modules/drizzle/tanstack/drizzle.config.ts +12 -12
  65. package/templates/modules/drizzle/tanstack/src/lib/db.ts +13 -13
  66. package/templates/modules/mongoose/express/config.json +15 -15
  67. package/templates/modules/mongoose/express/src/lib/db.ts +43 -43
  68. package/templates/modules/mongoose/express/src/models/User.ts +48 -48
  69. package/templates/modules/mongoose/nestjs/config.json +15 -15
  70. package/templates/modules/mongoose/nextjs/config.json +15 -15
  71. package/templates/modules/mongoose/nextjs/models/User.ts +48 -48
  72. package/templates/modules/mongoose/tanstack/config.json +16 -16
  73. package/templates/modules/mongoose/tanstack/src/models/User.ts +48 -48
  74. package/templates/modules/prisma/express/config.json +27 -27
  75. package/templates/modules/prisma/express/prisma/schema.prisma +23 -23
  76. package/templates/modules/prisma/nestjs/config.json +27 -27
  77. package/templates/modules/prisma/nextjs/config.json +28 -28
  78. package/templates/modules/prisma/nextjs/lib/prisma.ts +18 -18
  79. package/templates/modules/prisma/nextjs/prisma.config.ts +14 -14
  80. package/templates/modules/prisma/tanstack/config.json +28 -28
  81. package/templates/modules/prisma/tanstack/prisma/schema.prisma.hbs +91 -91
  82. package/templates/modules/prisma/tanstack/prisma.config.ts +14 -14
  83. package/templates/modules/prisma/tanstack/src/lib/prisma.ts +17 -17
  84. package/templates/modules/vscode/.vscode/extensions.json.hbs +29 -0
  85. package/templates/modules/vscode/.vscode/settings.json.hbs +22 -0
  86. package/templates/modules/vscode/config.json +10 -0
@@ -1,91 +1,91 @@
1
- // Prisma schema file
2
- // Learn more: https://pris.ly/d/prisma-schema
3
-
4
- generator client {
5
- provider = "prisma-client"
6
- output = "../generated"
7
- }
8
-
9
- datasource db {
10
- provider = "postgresql"
11
- }
12
-
13
- {{#if useAuth}}
14
-
15
- model User {
16
- id String @id
17
- name String
18
- email String
19
- emailVerified Boolean @default(false)
20
- image String?
21
- createdAt DateTime @default(now())
22
- updatedAt DateTime @updatedAt
23
- sessions Session[]
24
- accounts Account[]
25
-
26
- @@unique([email])
27
- @@map("user")
28
- }
29
-
30
- model Session {
31
- id String @id
32
- expiresAt DateTime
33
- token String
34
- createdAt DateTime @default(now())
35
- updatedAt DateTime @updatedAt
36
- ipAddress String?
37
- userAgent String?
38
- userId String
39
- user User @relation(fields: [userId], references: [id], onDelete: Cascade)
40
-
41
- @@unique([token])
42
- @@index([userId])
43
- @@map("session")
44
- }
45
-
46
- model Account {
47
- id String @id
48
- accountId String
49
- providerId String
50
- userId String
51
- user User @relation(fields: [userId], references: [id], onDelete: Cascade)
52
- accessToken String?
53
- refreshToken String?
54
- idToken String?
55
- accessTokenExpiresAt DateTime?
56
- refreshTokenExpiresAt DateTime?
57
- scope String?
58
- password String?
59
- createdAt DateTime @default(now())
60
- updatedAt DateTime @updatedAt
61
-
62
- @@index([userId])
63
- @@unique([providerId, accountId])
64
- @@map("account")
65
- }
66
-
67
- model Verification {
68
- id String @id
69
- identifier String
70
- value String
71
- expiresAt DateTime
72
- createdAt DateTime @default(now())
73
- updatedAt DateTime @updatedAt
74
-
75
- @@index([identifier])
76
- @@map("verification")
77
- }
78
-
79
- {{else}}
80
- // Sample User model
81
- model User {
82
- id String @id @default(uuid())
83
- email String @unique
84
- name String?
85
- password String
86
- createdAt DateTime @default(now())
87
- updatedAt DateTime @updatedAt
88
-
89
- @@map("users")
90
- }
91
- {{/if}}
1
+ // Prisma schema file
2
+ // Learn more: https://pris.ly/d/prisma-schema
3
+
4
+ generator client {
5
+ provider = "prisma-client"
6
+ output = "../generated"
7
+ }
8
+
9
+ datasource db {
10
+ provider = "postgresql"
11
+ }
12
+
13
+ {{#if useAuth}}
14
+
15
+ model User {
16
+ id String @id
17
+ name String
18
+ email String
19
+ emailVerified Boolean @default(false)
20
+ image String?
21
+ createdAt DateTime @default(now())
22
+ updatedAt DateTime @updatedAt
23
+ sessions Session[]
24
+ accounts Account[]
25
+
26
+ @@unique([email])
27
+ @@map("user")
28
+ }
29
+
30
+ model Session {
31
+ id String @id
32
+ expiresAt DateTime
33
+ token String
34
+ createdAt DateTime @default(now())
35
+ updatedAt DateTime @updatedAt
36
+ ipAddress String?
37
+ userAgent String?
38
+ userId String
39
+ user User @relation(fields: [userId], references: [id], onDelete: Cascade)
40
+
41
+ @@unique([token])
42
+ @@index([userId])
43
+ @@map("session")
44
+ }
45
+
46
+ model Account {
47
+ id String @id
48
+ accountId String
49
+ providerId String
50
+ userId String
51
+ user User @relation(fields: [userId], references: [id], onDelete: Cascade)
52
+ accessToken String?
53
+ refreshToken String?
54
+ idToken String?
55
+ accessTokenExpiresAt DateTime?
56
+ refreshTokenExpiresAt DateTime?
57
+ scope String?
58
+ password String?
59
+ createdAt DateTime @default(now())
60
+ updatedAt DateTime @updatedAt
61
+
62
+ @@index([userId])
63
+ @@unique([providerId, accountId])
64
+ @@map("account")
65
+ }
66
+
67
+ model Verification {
68
+ id String @id
69
+ identifier String
70
+ value String
71
+ expiresAt DateTime
72
+ createdAt DateTime @default(now())
73
+ updatedAt DateTime @updatedAt
74
+
75
+ @@index([identifier])
76
+ @@map("verification")
77
+ }
78
+
79
+ {{else}}
80
+ // Sample User model
81
+ model User {
82
+ id String @id @default(uuid())
83
+ email String @unique
84
+ name String?
85
+ password String
86
+ createdAt DateTime @default(now())
87
+ updatedAt DateTime @updatedAt
88
+
89
+ @@map("users")
90
+ }
91
+ {{/if}}
@@ -1,14 +1,14 @@
1
- import "dotenv/config";
2
- import { defineConfig } from "prisma/config";
3
-
4
- export default defineConfig({
5
- schema: "prisma/schema.prisma",
6
- migrations: {
7
- path: "prisma/migrations",
8
- },
9
- datasource: {
10
- // prisma generate needs no URL, so a build without .env (CI, a host) works.
11
- // Commands that connect report the empty URL
12
- url: process.env.DATABASE_URL ?? "",
13
- },
14
- });
1
+ import "dotenv/config";
2
+ import { defineConfig } from "prisma/config";
3
+
4
+ export default defineConfig({
5
+ schema: "prisma/schema.prisma",
6
+ migrations: {
7
+ path: "prisma/migrations",
8
+ },
9
+ datasource: {
10
+ // prisma generate needs no URL, so a build without .env (CI, a host) works.
11
+ // Commands that connect report the empty URL
12
+ url: process.env.DATABASE_URL ?? "",
13
+ },
14
+ });
@@ -1,18 +1,18 @@
1
- import { PrismaPg } from "@prisma/adapter-pg";
2
-
3
- import { PrismaClient } from "../../generated/client";
4
-
5
- const globalForPrisma = global as unknown as {
6
- prisma: PrismaClient;
7
- };
8
- const adapter = new PrismaPg({
9
- connectionString: process.env.DATABASE_URL,
10
- });
11
- const prisma =
12
- globalForPrisma.prisma ||
13
- new PrismaClient({
14
- adapter,
15
- });
16
- if (process.env.NODE_ENV !== "production") globalForPrisma.prisma = prisma;
17
-
1
+ import { PrismaPg } from "@prisma/adapter-pg";
2
+
3
+ import { PrismaClient } from "../../generated/client";
4
+
5
+ const globalForPrisma = global as unknown as {
6
+ prisma: PrismaClient;
7
+ };
8
+ const adapter = new PrismaPg({
9
+ connectionString: process.env.DATABASE_URL,
10
+ });
11
+ const prisma =
12
+ globalForPrisma.prisma ||
13
+ new PrismaClient({
14
+ adapter,
15
+ });
16
+ if (process.env.NODE_ENV !== "production") globalForPrisma.prisma = prisma;
17
+
18
18
  export default prisma;
@@ -0,0 +1,29 @@
1
+ {
2
+ "recommendations": [
3
+ {{#if (eq framework 'express')}}
4
+ "esbenp.prettier-vscode",
5
+ {{/if}}
6
+ {{#if (eq framework 'nestjs')}}
7
+ "esbenp.prettier-vscode",
8
+ {{/if}}
9
+ {{#if (eq framework 'nextjs')}}
10
+ "bradlc.vscode-tailwindcss",
11
+ {{/if}}
12
+ {{#if (eq framework 'tanstack')}}
13
+ "bradlc.vscode-tailwindcss",
14
+ {{/if}}
15
+ {{#if (eq database 'prisma')}}
16
+ "Prisma.prisma",
17
+ {{/if}}
18
+ {{#if (eq database 'mongoose')}}
19
+ "mongodb.mongodb-vscode",
20
+ {{/if}}
21
+ {{#if useDocker}}
22
+ "ms-azuretools.vscode-containers",
23
+ {{/if}}
24
+ {{#if useCi}}
25
+ "github.vscode-github-actions",
26
+ {{/if}}
27
+ "dbaeumer.vscode-eslint"
28
+ ]
29
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ {{#if (eq framework 'express')}}
3
+ "editor.defaultFormatter": "esbenp.prettier-vscode",
4
+ "editor.formatOnSave": true,
5
+ {{/if}}
6
+ {{#if (eq framework 'nestjs')}}
7
+ "editor.defaultFormatter": "esbenp.prettier-vscode",
8
+ "editor.formatOnSave": true,
9
+ {{/if}}
10
+ {{#if (eq framework 'nextjs')}}
11
+ "files.associations": { "*.css": "tailwindcss" },
12
+ {{/if}}
13
+ {{#if (eq framework 'tanstack')}}
14
+ "files.associations": { "*.css": "tailwindcss" },
15
+ "files.readonlyInclude": { "**/routeTree.gen.ts": true },
16
+ "files.watcherExclude": { "**/routeTree.gen.ts": true },
17
+ "search.exclude": { "**/routeTree.gen.ts": true },
18
+ {{/if}}
19
+ "editor.codeActionsOnSave": { "source.fixAll.eslint": "explicit" },
20
+ "typescript.tsdk": "node_modules/typescript/lib",
21
+ "typescript.enablePromptUseWorkspaceTsdk": true
22
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "id": "vscode",
3
+ "name": "VS Code settings",
4
+ "description": "Workspace settings that fix lint problems on save, and the recommended extensions for the stack",
5
+ "type": "feature",
6
+ "dependencies": {},
7
+ "devDependencies": {},
8
+ "scripts": {},
9
+ "envVars": {}
10
+ }