create-better-t-stack 3.7.3 → 3.8.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/dist/{cli.js → cli.mjs} +1 -1
- package/dist/{index.d.ts → index.d.mts} +112 -254
- package/dist/index.mjs +4 -0
- package/dist/{src-b1TtTCMt.js → src-BDXa8gsB.mjs} +221 -371
- package/package.json +18 -17
- package/templates/api/orpc/server/package.json.hbs +0 -3
- package/templates/api/trpc/server/package.json.hbs +1 -4
- package/templates/auth/better-auth/server/base/package.json.hbs +1 -4
- package/templates/backend/convex/packages/backend/convex/README.md +1 -1
- package/templates/backend/convex/packages/backend/convex/{schema.ts → schema.ts.hbs} +2 -0
- package/templates/backend/convex/packages/backend/package.json.hbs +1 -2
- package/templates/backend/server/base/package.json.hbs +1 -3
- package/templates/db/base/package.json.hbs +1 -4
- package/templates/db/drizzle/base/src/schema/index.ts.hbs +7 -0
- package/templates/db/drizzle/mysql/src/index.ts.hbs +8 -0
- package/templates/db/drizzle/postgres/src/index.ts.hbs +8 -4
- package/templates/db/drizzle/sqlite/src/index.ts.hbs +6 -3
- package/templates/examples/todo/convex/packages/backend/convex/todos.ts.hbs +42 -0
- package/templates/frontend/native/bare/package.json.hbs +1 -2
- package/templates/frontend/native/unistyles/package.json.hbs +1 -2
- package/templates/frontend/native/uniwind/package.json.hbs +1 -2
- package/templates/frontend/nuxt/package.json.hbs +0 -1
- package/templates/frontend/react/next/package.json.hbs +6 -6
- package/templates/frontend/react/react-router/package.json.hbs +13 -13
- package/templates/frontend/react/tanstack-router/package.json.hbs +7 -8
- package/templates/frontend/react/tanstack-start/package.json.hbs +8 -9
- package/templates/frontend/solid/package.json.hbs +0 -1
- package/templates/frontend/svelte/package.json.hbs +0 -1
- package/dist/index.js +0 -4
- package/templates/backend/convex/packages/backend/convex/todos.ts +0 -42
- /package/dist/{cli.d.ts → cli.d.mts} +0 -0
- /package/templates/backend/convex/packages/backend/convex/{healthCheck.ts → healthCheck.ts.hbs} +0 -0
- /package/templates/backend/convex/packages/backend/convex/{tsconfig.json → tsconfig.json.hbs} +0 -0
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-better-t-stack",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.8.0",
|
|
4
4
|
"description": "A modern CLI tool for scaffolding end-to-end type-safe TypeScript projects with best practices and customizable configurations",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "Aman Varshney",
|
|
8
8
|
"bin": {
|
|
9
|
-
"create-better-t-stack": "dist/cli.
|
|
9
|
+
"create-better-t-stack": "dist/cli.mjs"
|
|
10
10
|
},
|
|
11
11
|
"files": [
|
|
12
12
|
"templates",
|
|
@@ -57,38 +57,39 @@
|
|
|
57
57
|
},
|
|
58
58
|
"exports": {
|
|
59
59
|
".": {
|
|
60
|
-
"types": "./dist/index.d.
|
|
61
|
-
"import": "./dist/index.
|
|
60
|
+
"types": "./dist/index.d.mts",
|
|
61
|
+
"import": "./dist/index.mjs"
|
|
62
62
|
},
|
|
63
63
|
"./cli": {
|
|
64
|
-
"import": "./dist/cli.
|
|
64
|
+
"import": "./dist/cli.mjs"
|
|
65
65
|
}
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
|
-
"@
|
|
69
|
-
"@biomejs/
|
|
70
|
-
"@
|
|
71
|
-
"@
|
|
68
|
+
"@better-t-stack/types": "^3.8.0",
|
|
69
|
+
"@biomejs/js-api": "^4.0.0",
|
|
70
|
+
"@biomejs/wasm-nodejs": "^2.3.8",
|
|
71
|
+
"@clack/prompts": "^1.0.0-alpha.8",
|
|
72
|
+
"@orpc/server": "^1.12.2",
|
|
72
73
|
"consola": "^3.4.2",
|
|
73
|
-
"execa": "^9.6.
|
|
74
|
+
"execa": "^9.6.1",
|
|
74
75
|
"fs-extra": "^11.3.2",
|
|
75
76
|
"gradient-string": "^3.0.0",
|
|
76
77
|
"handlebars": "^4.7.8",
|
|
77
78
|
"jsonc-parser": "^3.3.1",
|
|
78
79
|
"picocolors": "^1.1.1",
|
|
79
80
|
"tinyglobby": "^0.2.15",
|
|
80
|
-
"trpc-cli": "^0.12.
|
|
81
|
+
"trpc-cli": "^0.12.1",
|
|
81
82
|
"ts-morph": "^27.0.2",
|
|
82
|
-
"yaml": "^2.8.
|
|
83
|
+
"yaml": "^2.8.2",
|
|
83
84
|
"zod": "^4.1.13"
|
|
84
85
|
},
|
|
85
86
|
"devDependencies": {
|
|
86
87
|
"@types/fs-extra": "^11.0.4",
|
|
87
|
-
"@types/node": "^24.
|
|
88
|
-
"@vitest/ui": "^
|
|
89
|
-
"publint": "^0.3.
|
|
90
|
-
"tsdown": "^0.
|
|
88
|
+
"@types/node": "^24.10.2",
|
|
89
|
+
"@vitest/ui": "^4.0.15",
|
|
90
|
+
"publint": "^0.3.16",
|
|
91
|
+
"tsdown": "^0.17.2",
|
|
91
92
|
"typescript": "^5.9.3",
|
|
92
|
-
"vitest": "^
|
|
93
|
+
"vitest": "^4.0.15"
|
|
93
94
|
}
|
|
94
95
|
}
|
|
@@ -7,6 +7,8 @@ dotenv.config({
|
|
|
7
7
|
});
|
|
8
8
|
|
|
9
9
|
{{/if}}
|
|
10
|
+
import * as schema from "./schema";
|
|
11
|
+
|
|
10
12
|
{{#if (eq dbSetup "planetscale")}}
|
|
11
13
|
import { drizzle } from "drizzle-orm/planetscale-serverless";
|
|
12
14
|
|
|
@@ -16,6 +18,7 @@ export const db = drizzle({
|
|
|
16
18
|
username: process.env.DATABASE_USERNAME,
|
|
17
19
|
password: process.env.DATABASE_PASSWORD,
|
|
18
20
|
},
|
|
21
|
+
schema,
|
|
19
22
|
});
|
|
20
23
|
{{else}}
|
|
21
24
|
import { drizzle } from "drizzle-orm/mysql2";
|
|
@@ -24,11 +27,14 @@ export const db = drizzle({
|
|
|
24
27
|
connection: {
|
|
25
28
|
uri: process.env.DATABASE_URL,
|
|
26
29
|
},
|
|
30
|
+
schema,
|
|
27
31
|
});
|
|
28
32
|
{{/if}}
|
|
29
33
|
{{/if}}
|
|
30
34
|
|
|
31
35
|
{{#if (eq runtime "workers")}}
|
|
36
|
+
import * as schema from "./schema";
|
|
37
|
+
|
|
32
38
|
{{#if (eq dbSetup "planetscale")}}
|
|
33
39
|
import { drizzle } from "drizzle-orm/planetscale-serverless";
|
|
34
40
|
import { env } from "cloudflare:workers";
|
|
@@ -39,6 +45,7 @@ export const db = drizzle({
|
|
|
39
45
|
username: env.DATABASE_USERNAME,
|
|
40
46
|
password: env.DATABASE_PASSWORD,
|
|
41
47
|
},
|
|
48
|
+
schema,
|
|
42
49
|
});
|
|
43
50
|
{{else}}
|
|
44
51
|
import { drizzle } from "drizzle-orm/mysql2";
|
|
@@ -48,6 +55,7 @@ export const db = drizzle({
|
|
|
48
55
|
connection: {
|
|
49
56
|
uri: env.DATABASE_URL,
|
|
50
57
|
},
|
|
58
|
+
schema,
|
|
51
59
|
});
|
|
52
60
|
{{/if}}
|
|
53
61
|
{{/if}}
|
|
@@ -7,6 +7,8 @@ dotenv.config({
|
|
|
7
7
|
});
|
|
8
8
|
|
|
9
9
|
{{/if}}
|
|
10
|
+
import * as schema from "./schema";
|
|
11
|
+
|
|
10
12
|
{{#if (eq dbSetup "neon")}}
|
|
11
13
|
import { neon, neonConfig } from '@neondatabase/serverless';
|
|
12
14
|
import { drizzle } from 'drizzle-orm/neon-http';
|
|
@@ -18,15 +20,17 @@ neonConfig.webSocketConstructor = ws;
|
|
|
18
20
|
// neonConfig.poolQueryViaFetch = true
|
|
19
21
|
|
|
20
22
|
const sql = neon(process.env.DATABASE_URL || "");
|
|
21
|
-
export const db = drizzle(sql);
|
|
23
|
+
export const db = drizzle(sql, { schema });
|
|
22
24
|
{{else}}
|
|
23
25
|
import { drizzle } from "drizzle-orm/node-postgres";
|
|
24
26
|
|
|
25
|
-
export const db = drizzle(process.env.DATABASE_URL || "");
|
|
27
|
+
export const db = drizzle(process.env.DATABASE_URL || "", { schema });
|
|
26
28
|
{{/if}}
|
|
27
29
|
{{/if}}
|
|
28
30
|
|
|
29
31
|
{{#if (eq runtime "workers")}}
|
|
32
|
+
import * as schema from "./schema";
|
|
33
|
+
|
|
30
34
|
{{#if (eq dbSetup "neon")}}
|
|
31
35
|
import { neon, neonConfig } from '@neondatabase/serverless';
|
|
32
36
|
import { drizzle } from 'drizzle-orm/neon-http';
|
|
@@ -37,11 +41,11 @@ neonConfig.webSocketConstructor = ws;
|
|
|
37
41
|
neonConfig.poolQueryViaFetch = true;
|
|
38
42
|
|
|
39
43
|
const sql = neon(env.DATABASE_URL || "");
|
|
40
|
-
export const db = drizzle(sql);
|
|
44
|
+
export const db = drizzle(sql, { schema });
|
|
41
45
|
{{else}}
|
|
42
46
|
import { drizzle } from "drizzle-orm/node-postgres";
|
|
43
47
|
import { env } from "cloudflare:workers";
|
|
44
48
|
|
|
45
|
-
export const db = drizzle(env.DATABASE_URL || "");
|
|
49
|
+
export const db = drizzle(env.DATABASE_URL || "", { schema });
|
|
46
50
|
{{/if}}
|
|
47
51
|
{{/if}}
|
|
@@ -7,6 +7,7 @@ dotenv.config({
|
|
|
7
7
|
});
|
|
8
8
|
|
|
9
9
|
{{/if}}
|
|
10
|
+
import * as schema from "./schema";
|
|
10
11
|
import { drizzle } from "drizzle-orm/libsql";
|
|
11
12
|
import { createClient } from "@libsql/client";
|
|
12
13
|
|
|
@@ -17,15 +18,17 @@ const client = createClient({
|
|
|
17
18
|
{{/if}}
|
|
18
19
|
});
|
|
19
20
|
|
|
20
|
-
export const db = drizzle({ client });
|
|
21
|
+
export const db = drizzle({ client, schema });
|
|
21
22
|
{{/if}}
|
|
22
23
|
|
|
23
24
|
{{#if (eq runtime "workers")}}
|
|
25
|
+
import * as schema from "./schema";
|
|
26
|
+
|
|
24
27
|
{{#if (eq dbSetup "d1")}}
|
|
25
28
|
import { drizzle } from "drizzle-orm/d1";
|
|
26
29
|
import { env } from "cloudflare:workers";
|
|
27
30
|
|
|
28
|
-
export const db = drizzle(env.DB);
|
|
31
|
+
export const db = drizzle(env.DB, { schema });
|
|
29
32
|
{{else}}
|
|
30
33
|
import { drizzle } from "drizzle-orm/libsql";
|
|
31
34
|
import { env } from "cloudflare:workers";
|
|
@@ -38,6 +41,6 @@ const client = createClient({
|
|
|
38
41
|
{{/if}}
|
|
39
42
|
});
|
|
40
43
|
|
|
41
|
-
export const db = drizzle({ client });
|
|
44
|
+
export const db = drizzle({ client, schema });
|
|
42
45
|
{{/if}}
|
|
43
46
|
{{/if}}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { query, mutation } from "./_generated/server";
|
|
2
|
+
import { v } from "convex/values";
|
|
3
|
+
|
|
4
|
+
export const getAll = query({
|
|
5
|
+
handler: async (ctx) => {
|
|
6
|
+
return await ctx.db.query("todos").collect();
|
|
7
|
+
},
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export const create = mutation({
|
|
11
|
+
args: {
|
|
12
|
+
text: v.string(),
|
|
13
|
+
},
|
|
14
|
+
handler: async (ctx, args) => {
|
|
15
|
+
const newTodoId = await ctx.db.insert("todos", {
|
|
16
|
+
text: args.text,
|
|
17
|
+
completed: false,
|
|
18
|
+
});
|
|
19
|
+
return await ctx.db.get("todos", newTodoId);
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
export const toggle = mutation({
|
|
24
|
+
args: {
|
|
25
|
+
id: v.id("todos"),
|
|
26
|
+
completed: v.boolean(),
|
|
27
|
+
},
|
|
28
|
+
handler: async (ctx, args) => {
|
|
29
|
+
await ctx.db.patch("todos", args.id, { completed: args.completed });
|
|
30
|
+
return { success: true };
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
export const deleteTodo = mutation({
|
|
35
|
+
args: {
|
|
36
|
+
id: v.id("todos"),
|
|
37
|
+
},
|
|
38
|
+
handler: async (ctx, args) => {
|
|
39
|
+
await ctx.db.delete("todos", args.id);
|
|
40
|
+
return { success: true };
|
|
41
|
+
},
|
|
42
|
+
});
|
|
@@ -9,14 +9,14 @@
|
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"radix-ui": "^1.4.2",
|
|
12
|
-
"@tanstack/react-form": "^1.
|
|
12
|
+
"@tanstack/react-form": "^1.27.3",
|
|
13
13
|
"class-variance-authority": "^0.7.1",
|
|
14
14
|
"clsx": "^2.1.1",
|
|
15
15
|
"lucide-react": "^0.546.0",
|
|
16
|
-
"next": "^16.0.
|
|
16
|
+
"next": "^16.0.10",
|
|
17
17
|
"next-themes": "^0.4.6",
|
|
18
|
-
"react": "19.
|
|
19
|
-
"react-dom": "19.
|
|
18
|
+
"react": "19.2.3",
|
|
19
|
+
"react-dom": "19.2.3",
|
|
20
20
|
"sonner": "^2.0.5",
|
|
21
21
|
"tailwind-merge": "^3.3.1",
|
|
22
22
|
"tw-animate-css": "^1.3.4",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@tailwindcss/postcss": "^4.1.10",
|
|
27
27
|
"@types/node": "^20",
|
|
28
|
-
"@types/react": "19.2.
|
|
29
|
-
"@types/react-dom": "19.2.
|
|
28
|
+
"@types/react": "19.2.7",
|
|
29
|
+
"@types/react-dom": "19.2.3",
|
|
30
30
|
"tailwindcss": "^4.1.10",
|
|
31
31
|
"typescript": "^5"
|
|
32
32
|
}
|
|
@@ -10,32 +10,32 @@
|
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"radix-ui": "^1.4.2",
|
|
13
|
-
"@react-router/fs-routes": "^7.
|
|
14
|
-
"@react-router/node": "^7.
|
|
15
|
-
"@react-router/serve": "^7.
|
|
16
|
-
"@tanstack/react-form": "^1.
|
|
13
|
+
"@react-router/fs-routes": "^7.10.1",
|
|
14
|
+
"@react-router/node": "^7.10.1",
|
|
15
|
+
"@react-router/serve": "^7.10.1",
|
|
16
|
+
"@tanstack/react-form": "^1.27.3",
|
|
17
17
|
"class-variance-authority": "^0.7.1",
|
|
18
18
|
"clsx": "^2.1.1",
|
|
19
19
|
"isbot": "^5.1.28",
|
|
20
20
|
"lucide-react": "^0.511.0",
|
|
21
21
|
"next-themes": "^0.4.6",
|
|
22
|
-
"react": "19.
|
|
23
|
-
"react-dom": "19.
|
|
24
|
-
"react-router": "^7.
|
|
22
|
+
"react": "19.2.3",
|
|
23
|
+
"react-dom": "19.2.3",
|
|
24
|
+
"react-router": "^7.10.1",
|
|
25
25
|
"sonner": "^2.0.3",
|
|
26
26
|
"tailwind-merge": "^3.3.0",
|
|
27
27
|
"tw-animate-css": "^1.3.2"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@react-router/dev": "^7.
|
|
31
|
-
"@tailwindcss/vite": "^4.1.
|
|
30
|
+
"@react-router/dev": "^7.10.1",
|
|
31
|
+
"@tailwindcss/vite": "^4.1.18",
|
|
32
32
|
"@types/node": "^20",
|
|
33
|
-
"@types/react": "~19.
|
|
34
|
-
"@types/react-dom": "^19.
|
|
33
|
+
"@types/react": "~19.2.7",
|
|
34
|
+
"@types/react-dom": "^19.2.3",
|
|
35
35
|
"react-router-devtools": "^1.1.0",
|
|
36
|
-
"tailwindcss": "^4.1.
|
|
36
|
+
"tailwindcss": "^4.1.18",
|
|
37
37
|
"typescript": "^5.8.3",
|
|
38
|
-
"vite": "^
|
|
38
|
+
"vite": "^7.2.7",
|
|
39
39
|
"vite-tsconfig-paths": "^5.1.4"
|
|
40
40
|
}
|
|
41
41
|
}
|
|
@@ -15,26 +15,25 @@
|
|
|
15
15
|
"radix-ui": "^1.4.2",
|
|
16
16
|
"@tanstack/react-form": "^1.12.3",
|
|
17
17
|
"@tailwindcss/vite": "^4.0.15",
|
|
18
|
-
"@tanstack/react-router": "^1.
|
|
18
|
+
"@tanstack/react-router": "^1.141.1",
|
|
19
19
|
"class-variance-authority": "^0.7.1",
|
|
20
20
|
"clsx": "^2.1.1",
|
|
21
21
|
"lucide-react": "^0.473.0",
|
|
22
22
|
"next-themes": "^0.4.6",
|
|
23
|
-
"react": "19.
|
|
24
|
-
"react-dom": "19.
|
|
23
|
+
"react": "19.2.3",
|
|
24
|
+
"react-dom": "19.2.3",
|
|
25
25
|
"sonner": "^2.0.5",
|
|
26
26
|
"tailwind-merge": "^3.3.1",
|
|
27
27
|
"tw-animate-css": "^1.2.5"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@tanstack/react-router-devtools": "^1.
|
|
31
|
-
"@tanstack/router-plugin": "^1.
|
|
30
|
+
"@tanstack/react-router-devtools": "^1.141.1",
|
|
31
|
+
"@tanstack/router-plugin": "^1.141.1",
|
|
32
32
|
"@types/node": "^22.13.13",
|
|
33
|
-
"@types/react": "
|
|
34
|
-
"@types/react-dom": "
|
|
33
|
+
"@types/react": "19.2.7",
|
|
34
|
+
"@types/react-dom": "19.2.3",
|
|
35
35
|
"@vitejs/plugin-react": "^4.3.4",
|
|
36
36
|
"postcss": "^8.5.3",
|
|
37
|
-
"typescript": "^5.8.3",
|
|
38
37
|
"tailwindcss": "^4.0.15",
|
|
39
38
|
"vite": "^6.2.2"
|
|
40
39
|
}
|
|
@@ -12,16 +12,16 @@
|
|
|
12
12
|
"@tanstack/react-form": "^1.23.5",
|
|
13
13
|
"@tailwindcss/vite": "^4.1.8",
|
|
14
14
|
"@tanstack/react-query": "^5.80.6",
|
|
15
|
-
"@tanstack/react-router":
|
|
15
|
+
"@tanstack/react-router": "^1.141.1",
|
|
16
16
|
"@tanstack/react-router-with-query": "^1.130.17",
|
|
17
|
-
"@tanstack/react-start":
|
|
18
|
-
"@tanstack/router-plugin":
|
|
17
|
+
"@tanstack/react-start": "^1.141.1",
|
|
18
|
+
"@tanstack/router-plugin": "^1.141.1",
|
|
19
19
|
"class-variance-authority": "^0.7.1",
|
|
20
20
|
"clsx": "^2.1.1",
|
|
21
21
|
"lucide-react": "^0.525.0",
|
|
22
22
|
"next-themes": "^0.4.6",
|
|
23
|
-
"react": "19.
|
|
24
|
-
"react-dom": "19.
|
|
23
|
+
"react": "19.2.3",
|
|
24
|
+
"react-dom": "19.2.3",
|
|
25
25
|
"sonner": "^2.0.3",
|
|
26
26
|
"tailwindcss": "^4.1.3",
|
|
27
27
|
"tailwind-merge": "^3.3.1",
|
|
@@ -29,14 +29,13 @@
|
|
|
29
29
|
"vite-tsconfig-paths": "^5.1.4"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@tanstack/react-router-devtools":
|
|
32
|
+
"@tanstack/react-router-devtools": "^1.141.1",
|
|
33
33
|
"@testing-library/dom": "^10.4.0",
|
|
34
34
|
"@testing-library/react": "^16.2.0",
|
|
35
|
-
"@types/react": "
|
|
36
|
-
"@types/react-dom": "
|
|
35
|
+
"@types/react": "19.2.7",
|
|
36
|
+
"@types/react-dom": "19.2.3",
|
|
37
37
|
"@vitejs/plugin-react": "^5.0.4",
|
|
38
38
|
"jsdom": "^26.0.0",
|
|
39
|
-
"typescript": "^5.7.2",
|
|
40
39
|
"vite": "^7.0.2",
|
|
41
40
|
"web-vitals": "^5.0.3"
|
|
42
41
|
}
|
package/dist/index.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { query, mutation } from "./_generated/server";
|
|
2
|
-
import { v } from "convex/values";
|
|
3
|
-
|
|
4
|
-
export const getAll = query({
|
|
5
|
-
handler: async (ctx) => {
|
|
6
|
-
return await ctx.db.query("todos").collect();
|
|
7
|
-
},
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
export const create = mutation({
|
|
11
|
-
args: {
|
|
12
|
-
text: v.string(),
|
|
13
|
-
},
|
|
14
|
-
handler: async (ctx, args) => {
|
|
15
|
-
const newTodoId = await ctx.db.insert("todos", {
|
|
16
|
-
text: args.text,
|
|
17
|
-
completed: false,
|
|
18
|
-
});
|
|
19
|
-
return await ctx.db.get(newTodoId);
|
|
20
|
-
},
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
export const toggle = mutation({
|
|
24
|
-
args: {
|
|
25
|
-
id: v.id("todos"),
|
|
26
|
-
completed: v.boolean(),
|
|
27
|
-
},
|
|
28
|
-
handler: async (ctx, args) => {
|
|
29
|
-
await ctx.db.patch(args.id, { completed: args.completed });
|
|
30
|
-
return { success: true };
|
|
31
|
-
},
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
export const deleteTodo = mutation({
|
|
35
|
-
args: {
|
|
36
|
-
id: v.id("todos"),
|
|
37
|
-
},
|
|
38
|
-
handler: async (ctx, args) => {
|
|
39
|
-
await ctx.db.delete(args.id);
|
|
40
|
-
return { success: true };
|
|
41
|
-
},
|
|
42
|
-
});
|
|
File without changes
|
/package/templates/backend/convex/packages/backend/convex/{healthCheck.ts → healthCheck.ts.hbs}
RENAMED
|
File without changes
|
/package/templates/backend/convex/packages/backend/convex/{tsconfig.json → tsconfig.json.hbs}
RENAMED
|
File without changes
|