Skip to content

Commit 251f231

Browse files
Merge branch 'main' into sk/add-lefthook
2 parents 0710e58 + 3d95a04 commit 251f231

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+592
-911
lines changed

.github/workflows/release.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
push:
1010
branches:
1111
- main
12-
pull_request:
12+
pull_request_target:
1313
types: [labeled]
1414

1515
jobs:
@@ -80,6 +80,7 @@ jobs:
8080
env:
8181
NPM_CONFIG_TOKEN: ${{ secrets.NPM_TOKEN }}
8282
BTS_TELEMETRY: 1
83+
CONVEX_INGEST_URL: ${{ secrets.CONVEX_INGEST_URL }}
8384

8485
- name: Update CLI types dependency
8586
if: steps.version.outputs.version != ''
@@ -93,6 +94,7 @@ jobs:
9394
run: cd apps/cli && bun run build
9495
env:
9596
BTS_TELEMETRY: 1
97+
CONVEX_INGEST_URL: ${{ secrets.CONVEX_INGEST_URL }}
9698

9799
- name: Update create-bts alias package version
98100
if: steps.version.outputs.version != ''
@@ -107,17 +109,19 @@ jobs:
107109
env:
108110
NPM_CONFIG_TOKEN: ${{ secrets.NPM_TOKEN }}
109111
BTS_TELEMETRY: 1
112+
CONVEX_INGEST_URL: ${{ secrets.CONVEX_INGEST_URL }}
110113

111114
- name: Publish create-bts alias to NPM
112115
if: steps.version.outputs.version != ''
113116
run: cd packages/create-bts && bun publish --access public
114117
env:
115118
NPM_CONFIG_TOKEN: ${{ secrets.NPM_TOKEN }}
116119
BTS_TELEMETRY: 1
120+
CONVEX_INGEST_URL: ${{ secrets.CONVEX_INGEST_URL }}
117121

118122
canary:
119123
runs-on: ubuntu-latest
120-
if: github.event_name == 'pull_request' && github.event.label.name == 'canary'
124+
if: github.event_name == 'pull_request_target' && github.event.label.name == 'canary'
121125
steps:
122126
- name: Checkout Code
123127
uses: actions/checkout@v4

.github/workflows/test.yaml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request_review:
8+
types: [submitted]
9+
pull_request:
10+
types: [labeled]
11+
12+
jobs:
13+
test:
14+
if: github.event_name == 'push' || (github.event_name == 'pull_request_review' && github.event.review.state == 'approved' && github.event.pull_request.base.ref == 'main') || (github.event_name == 'pull_request' && github.event.label.name == 'canary')
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout Code
18+
uses: actions/checkout@v4
19+
with:
20+
ref: ${{ (github.event_name == 'pull_request_review' || github.event_name == 'pull_request') && github.event.pull_request.head.sha || github.sha }}
21+
22+
- name: Setup Git user
23+
shell: bash
24+
run: |
25+
git config --global user.name github-actions[bot]
26+
git config --global user.email 41898282+github-actions[bot]@users.noreply.github.com
27+
28+
- name: Setup Bun
29+
uses: oven-sh/setup-bun@v2
30+
with:
31+
bun-version: latest
32+
33+
- name: Setup pnpm
34+
uses: pnpm/action-setup@v4
35+
with:
36+
version: 10
37+
38+
- name: Install Dependencies
39+
run: bun install --frozen-lockfile
40+
env:
41+
BTS_TELEMETRY: 0
42+
43+
- name: Build Workspace Dependencies
44+
run: cd packages/types && bun run build
45+
46+
- name: Run Tests
47+
working-directory: apps/cli
48+
run: bun run test:ci
49+
env:
50+
AGENT: 1

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,6 @@ yarn-error.log*
3838
.vscode
3939
.env*.local
4040

41-
.smoke
41+
.smoke
42+
43+
.idea

apps/cli/bunfig.toml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[test]
2+
# Preload setup file for global setup/teardown
3+
preload = ["./test/setup.ts"]
4+
5+
# Per-test timeout (3 minutes for smoke tests)
6+
timeout = 180000
7+
8+
# Skip test files from coverage reports
9+
coverageSkipTestFiles = true
10+
11+
# Exclude patterns from coverage
12+
coveragePathIgnorePatterns = [
13+
"test/**",
14+
"dist/**",
15+
"templates/**",
16+
"node_modules/**",
17+
]

apps/cli/package.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "create-better-t-stack",
3-
"version": "3.8.0",
3+
"version": "3.8.3",
44
"description": "A modern CLI tool for scaffolding end-to-end type-safe TypeScript projects with best practices and customizable configurations",
55
"type": "module",
66
"license": "MIT",
@@ -51,8 +51,10 @@
5151
"build": "tsdown --publint",
5252
"dev": "tsdown --watch",
5353
"check-types": "tsc --noEmit",
54-
"test": "bun run build && vitest run; rm -rf .smoke || true",
55-
"test:ui": "bun run build && vitest --ui",
54+
"test": "bun run build && bun test",
55+
"test:watch": "bun run build && bun test --watch",
56+
"test:coverage": "bun run build && bun test --coverage",
57+
"test:ci": "bun run build && AGENT=1 bun test --bail=5",
5658
"prepublishOnly": "npm run build"
5759
},
5860
"exports": {
@@ -84,12 +86,11 @@
8486
"zod": "^4.1.13"
8587
},
8688
"devDependencies": {
89+
"@types/bun": "^1.2.17",
8790
"@types/fs-extra": "^11.0.4",
8891
"@types/node": "^24.10.2",
89-
"@vitest/ui": "^4.0.15",
9092
"publint": "^0.3.16",
9193
"tsdown": "^0.17.2",
92-
"typescript": "^5.9.3",
93-
"vitest": "^4.0.15"
94+
"typescript": "^5.9.3"
9495
}
9596
}

apps/cli/src/constants.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ export const DEFAULT_CONFIG = getDefaultConfig();
4242
export const dependencyVersionMap = {
4343
typescript: "^5",
4444

45-
"better-auth": "1.4.5",
46-
"@better-auth/expo": "1.4.5",
45+
"better-auth": "^1.4.7",
46+
"@better-auth/expo": "^1.4.7",
4747

4848
"@clerk/nextjs": "^6.31.5",
4949
"@clerk/clerk-react": "^5.45.0",
@@ -112,7 +112,7 @@ export const dependencyVersionMap = {
112112
fastify: "^5.3.3",
113113
"@fastify/cors": "^11.0.1",
114114

115-
turbo: "^2.5.4",
115+
turbo: "^2.6.3",
116116

117117
ai: "^5.0.49",
118118
"@ai-sdk/google": "^2.0.13",
@@ -154,14 +154,14 @@ export const dependencyVersionMap = {
154154
"@tanstack/solid-query-devtools": "^5.87.4",
155155
"@tanstack/solid-router-devtools": "^1.131.44",
156156

157-
wrangler: "^4.40.3",
158-
"@cloudflare/vite-plugin": "^1.13.8",
159-
"@opennextjs/cloudflare": "^1.6.5",
157+
wrangler: "^4.54.0",
158+
"@cloudflare/vite-plugin": "^1.17.1",
159+
"@opennextjs/cloudflare": "^1.14.6",
160160
"nitro-cloudflare-dev": "^0.2.2",
161-
"@sveltejs/adapter-cloudflare": "^7.2.1",
162-
"@cloudflare/workers-types": "^4.20250822.0",
161+
"@sveltejs/adapter-cloudflare": "^7.2.4",
162+
"@cloudflare/workers-types": "^4.20251213.0",
163163

164-
alchemy: "^0.81.1",
164+
alchemy: "^0.81.2",
165165

166166
dotenv: "^17.2.2",
167167
tsdown: "^0.16.5",

apps/cli/src/helpers/core/env-setup.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,14 @@ export async function setupEnvironmentVariables(config: ProjectConfig) {
161161
},
162162
];
163163

164+
if (hasNextJs) {
165+
clientVars.push({
166+
key: "PORT",
167+
value: "3001",
168+
condition: true,
169+
});
170+
}
171+
164172
if (backend === "convex" && auth === "clerk") {
165173
if (hasNextJs) {
166174
clientVars.push(

apps/cli/src/helpers/core/project-config.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ async function updateRootPackageJson(projectDir: string, options: ProjectConfig)
8181
}
8282
}
8383

84+
if (database === "sqlite" && dbSetup !== "d1" && orm !== "none") {
85+
scripts["db:local"] = pmConfig.filter(dbPackageName, "db:local");
86+
}
87+
8488
if (dbSetup === "docker") {
8589
scripts["db:start"] = pmConfig.filter(dbPackageName, "db:start");
8690
scripts["db:watch"] = pmConfig.filter(dbPackageName, "db:watch");
@@ -183,7 +187,7 @@ async function updateDbPackageJson(projectDir: string, options: ProjectConfig) {
183187
const isD1Alchemy = dbSetup === "d1" && serverDeploy === "alchemy";
184188

185189
if (database !== "none") {
186-
if (database === "sqlite" && orm === "drizzle" && dbSetup !== "d1") {
190+
if (database === "sqlite" && dbSetup !== "d1") {
187191
scripts["db:local"] = "turso dev --db-file local.db";
188192
}
189193

apps/cli/src/helpers/deployment/alchemy/alchemy-next-setup.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export async function setupNextAlchemyDeploy(
2424
if (!options?.skipAppScripts) {
2525
pkg.scripts = {
2626
...pkg.scripts,
27+
dev: "alchemy dev",
2728
deploy: "alchemy deploy",
2829
destroy: "alchemy destroy",
2930
};

apps/cli/src/helpers/deployment/alchemy/alchemy-nuxt-setup.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export async function setupNuxtAlchemyDeploy(
2424
if (!options?.skipAppScripts) {
2525
pkg.scripts = {
2626
...pkg.scripts,
27+
dev: "alchemy dev",
2728
deploy: "alchemy deploy",
2829
destroy: "alchemy destroy",
2930
};

0 commit comments

Comments
 (0)