@martinffx/atelier 0.1.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/CHANGELOG.md +38 -0
- package/LICENSE +21 -0
- package/README.md +285 -0
- package/agents/architect.md +38 -0
- package/agents/oracle.md +40 -0
- package/agents/recon.md +39 -0
- package/dist/atelier.js +33082 -0
- package/package.json +44 -0
- package/skills/code-conventional-commit/SKILL.md +134 -0
- package/skills/code-conventional-commit/evals/evals.json +23 -0
- package/skills/code-conventional-commit/workspace/iteration-1/eval-0/with_skill/outputs/commit-message.txt +4 -0
- package/skills/code-conventional-commit/workspace/iteration-1/eval-0/with_skill/outputs/eval_metadata.json +6 -0
- package/skills/code-conventional-commit/workspace/iteration-1/eval-1/with_skill/outputs/eval_metadata.json +6 -0
- package/skills/code-conventional-commit/workspace/iteration-1/eval-1/with_skill/outputs/validation-result.txt +16 -0
- package/skills/code-conventional-commit/workspace/iteration-1/eval-2/with_skill/outputs/commit-message.txt +8 -0
- package/skills/code-conventional-commit/workspace/iteration-1/eval-2/with_skill/outputs/eval_metadata.json +6 -0
- package/skills/code-conventional-commit/workspace/iteration-1/report.html +1325 -0
- package/skills/code-debug/SKILL.md +271 -0
- package/skills/code-debug/references/language-tools.md +139 -0
- package/skills/code-debug/references/techniques.md +117 -0
- package/skills/code-docs/SKILL.md +171 -0
- package/skills/code-docs/references/api-docs.md +116 -0
- package/skills/code-docs/references/changelog.md +64 -0
- package/skills/code-docs/references/readme-structure.md +94 -0
- package/skills/code-git-worktrees/SKILL.md +218 -0
- package/skills/code-perf/SKILL.md +163 -0
- package/skills/code-perf/references/common-bottlenecks.md +124 -0
- package/skills/code-perf/references/optimization-patterns.md +167 -0
- package/skills/code-perf/references/profiling-tools.md +126 -0
- package/skills/code-review/SKILL.md +78 -0
- package/skills/code-review/references/output.md +200 -0
- package/skills/code-review/references/reviewers.md +719 -0
- package/skills/code-review/references/rq.md +357 -0
- package/skills/code-review/references/rs.md +30 -0
- package/skills/code-security/SKILL.md +183 -0
- package/skills/code-security/references/owasp-top-10.md +129 -0
- package/skills/code-security/references/security-tools.md +102 -0
- package/skills/code-security/references/vulnerability-patterns.md +129 -0
- package/skills/code-stacked-commit/SKILL.md +155 -0
- package/skills/code-subagents/SKILL.md +184 -0
- package/skills/code-subagents/references/code-quality-reviewer-prompt.md +48 -0
- package/skills/code-subagents/references/implementor-prompt.md +79 -0
- package/skills/code-subagents/references/spec-reviewer-prompt.md +62 -0
- package/skills/oracle-architect/SKILL.md +246 -0
- package/skills/oracle-architect/references/api-design.md +345 -0
- package/skills/oracle-architect/references/data-modeling.md +318 -0
- package/skills/oracle-architect/references/ddd-patterns.md +247 -0
- package/skills/oracle-challenge/SKILL.md +126 -0
- package/skills/oracle-testing/SKILL.md +237 -0
- package/skills/oracle-testing/references/anti-patterns.md +618 -0
- package/skills/oracle-testing/references/boundaries.md +579 -0
- package/skills/oracle-testing/references/core-testing.md +691 -0
- package/skills/oracle-testing/references/edge-testing.md +794 -0
- package/skills/oracle-testing/references/stub-driven-tdd.md +322 -0
- package/skills/oracle-thinkdeep/SKILL.md +164 -0
- package/skills/python-architecture/SKILL.md +148 -0
- package/skills/python-architecture/references/data-modeling.md +558 -0
- package/skills/python-architecture/references/ddd.md +569 -0
- package/skills/python-architecture/references/functional-core.md +337 -0
- package/skills/python-build-tools/SKILL.md +153 -0
- package/skills/python-build-tools/references/basedpyright.md +321 -0
- package/skills/python-build-tools/references/ruff.md +225 -0
- package/skills/python-build-tools/references/uv.md +257 -0
- package/skills/python-fastapi/SKILL.md +184 -0
- package/skills/python-fastapi/references/api-design.md +563 -0
- package/skills/python-fastapi/references/dependencies.md +479 -0
- package/skills/python-fastapi/references/middleware.md +475 -0
- package/skills/python-fastapi/references/validation.md +497 -0
- package/skills/python-modern-python/SKILL.md +201 -0
- package/skills/python-modern-python/references/async.md +76 -0
- package/skills/python-modern-python/references/pattern-matching.md +89 -0
- package/skills/python-modern-python/references/typing.md +96 -0
- package/skills/python-monorepo/SKILL.md +146 -0
- package/skills/python-monorepo/references/docker.md +515 -0
- package/skills/python-monorepo/references/namespace-packages.md +426 -0
- package/skills/python-monorepo/references/workspace-config.md +341 -0
- package/skills/python-sqlalchemy/SKILL.md +119 -0
- package/skills/python-sqlalchemy/references/async.md +51 -0
- package/skills/python-sqlalchemy/references/models.md +67 -0
- package/skills/python-sqlalchemy/references/queries.md +57 -0
- package/skills/python-temporal/SKILL.md +128 -0
- package/skills/python-temporal/references/patterns.md +87 -0
- package/skills/python-temporal/references/testing.md +54 -0
- package/skills/python-testing/SKILL.md +161 -0
- package/skills/python-testing/references/boundaries.md +449 -0
- package/skills/python-testing/references/mocking.md +449 -0
- package/skills/python-testing/references/pytest.md +524 -0
- package/skills/spec-brainstorm/SKILL.md +325 -0
- package/skills/spec-finish/SKILL.md +159 -0
- package/skills/spec-implement/SKILL.md +296 -0
- package/skills/spec-orchestrator/SKILL.md +156 -0
- package/skills/spec-plan/SKILL.md +248 -0
- package/skills/typescript-api-design/SKILL.md +396 -0
- package/skills/typescript-api-design/references/error-responses.md +469 -0
- package/skills/typescript-build-tools/SKILL.md +447 -0
- package/skills/typescript-build-tools/references/biome.md +436 -0
- package/skills/typescript-build-tools/references/bun.md +432 -0
- package/skills/typescript-build-tools/references/turborepo.md +426 -0
- package/skills/typescript-build-tools/references/vitest.md +518 -0
- package/skills/typescript-drizzle-orm/SKILL.md +398 -0
- package/skills/typescript-drizzle-orm/references/cloudflare.md +392 -0
- package/skills/typescript-drizzle-orm/references/entity-pattern.md +412 -0
- package/skills/typescript-drizzle-orm/references/postgresql.md +191 -0
- package/skills/typescript-drizzle-orm/references/repository-pattern.md +479 -0
- package/skills/typescript-drizzle-orm/references/sqlite.md +291 -0
- package/skills/typescript-dynamodb-toolbox/SKILL.md +370 -0
- package/skills/typescript-dynamodb-toolbox/references/entity-layer.md +574 -0
- package/skills/typescript-dynamodb-toolbox/references/error-handling.md +495 -0
- package/skills/typescript-dynamodb-toolbox/references/modeling.md +332 -0
- package/skills/typescript-dynamodb-toolbox/references/repository-layer.md +631 -0
- package/skills/typescript-dynamodb-toolbox/references/testing.md +718 -0
- package/skills/typescript-dynamodb-toolbox/references/transactions.md +423 -0
- package/skills/typescript-effect-ts/SKILL.md +341 -0
- package/skills/typescript-effect-ts/references/core.md +412 -0
- package/skills/typescript-effect-ts/references/error-handling.md +468 -0
- package/skills/typescript-effect-ts/references/resources.md +476 -0
- package/skills/typescript-effect-ts/references/schema.md +536 -0
- package/skills/typescript-effect-ts/references/services.md +461 -0
- package/skills/typescript-fastify/SKILL.md +405 -0
- package/skills/typescript-fastify/references/plugins.md +329 -0
- package/skills/typescript-fastify/references/typeid.md +315 -0
- package/skills/typescript-functional-patterns/SKILL.md +402 -0
- package/skills/typescript-functional-patterns/references/adts.md +497 -0
- package/skills/typescript-functional-patterns/references/branded-types.md +542 -0
- package/skills/typescript-functional-patterns/references/migration-guide.md +695 -0
- package/skills/typescript-functional-patterns/references/option-result.md +585 -0
- package/skills/typescript-testing/SKILL.md +353 -0
- package/skills/typescript-testing/references/mocking.md +675 -0
- package/skills/typescript-testing/references/msw.md +852 -0
- package/skills/typescript-testing/references/snapshot-testing.md +774 -0
|
@@ -0,0 +1,447 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: typescript-build-tools
|
|
3
|
+
description: TypeScript project tooling with Bun, tsgo, Vitest, Biome, and Turborepo. Use when setting up package.json scripts, running builds, typechecking, configuring tests, linting, formatting, or orchestrating monorepo development.
|
|
4
|
+
user-invocable: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# TypeScript Build Tools
|
|
8
|
+
|
|
9
|
+
Modern TypeScript build tooling stack: Bun for package management and task running, tsgo for typechecking, Vitest for testing, Biome for linting/formatting, and Turborepo for monorepo orchestration.
|
|
10
|
+
|
|
11
|
+
## Additional References
|
|
12
|
+
|
|
13
|
+
- [references/bun.md](./references/bun.md) - Bun package manager and task runner
|
|
14
|
+
- [references/vitest.md](./references/vitest.md) - Advanced Vitest configuration patterns
|
|
15
|
+
- [references/biome.md](./references/biome.md) - Biome rules and customization
|
|
16
|
+
- [references/turborepo.md](./references/turborepo.md) - Turborepo monorepo orchestration
|
|
17
|
+
|
|
18
|
+
## Quick Start
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
# Install dependencies
|
|
22
|
+
bun add -D vitest @vitest/coverage-v8 @biomejs/biome
|
|
23
|
+
|
|
24
|
+
# For monorepos
|
|
25
|
+
bun add -D turbo
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Package.json Scripts
|
|
29
|
+
|
|
30
|
+
### Single Package
|
|
31
|
+
|
|
32
|
+
```json
|
|
33
|
+
{
|
|
34
|
+
"scripts": {
|
|
35
|
+
"dev": "bun run --watch src/index.ts",
|
|
36
|
+
"build": "bun build ./src/index.ts --outdir ./dist --target bun",
|
|
37
|
+
"typecheck": "tsgo --noEmit",
|
|
38
|
+
"test": "vitest run",
|
|
39
|
+
"test:watch": "vitest",
|
|
40
|
+
"test:coverage": "vitest run --coverage",
|
|
41
|
+
"lint": "biome check .",
|
|
42
|
+
"lint:fix": "biome check --write .",
|
|
43
|
+
"format": "biome format --write .",
|
|
44
|
+
"check": "bun run typecheck && bun run lint && bun run test"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Monorepo Root
|
|
50
|
+
|
|
51
|
+
```json
|
|
52
|
+
{
|
|
53
|
+
"scripts": {
|
|
54
|
+
"dev": "turbo dev",
|
|
55
|
+
"build": "turbo build",
|
|
56
|
+
"typecheck": "turbo typecheck",
|
|
57
|
+
"test": "turbo test",
|
|
58
|
+
"lint": "turbo lint",
|
|
59
|
+
"check": "turbo typecheck lint test"
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Bun
|
|
65
|
+
|
|
66
|
+
### Package Manager
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
# Install dependencies
|
|
70
|
+
bun install
|
|
71
|
+
|
|
72
|
+
# Add dependencies
|
|
73
|
+
bun add fastify drizzle-orm
|
|
74
|
+
bun add -D vitest @biomejs/biome
|
|
75
|
+
|
|
76
|
+
# Remove dependency
|
|
77
|
+
bun remove package-name
|
|
78
|
+
|
|
79
|
+
# Update dependencies
|
|
80
|
+
bun update
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Task Runner
|
|
84
|
+
|
|
85
|
+
**Important:** Use `bun run test` (not `bun test`) on Node projects. `bun test` invokes Bun's native test runner, not your package.json test script.
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
# Run script from package.json
|
|
89
|
+
bun run dev
|
|
90
|
+
bun run test
|
|
91
|
+
bun run build
|
|
92
|
+
|
|
93
|
+
# Run TypeScript directly (no build step)
|
|
94
|
+
bun run src/index.ts
|
|
95
|
+
|
|
96
|
+
# Watch mode
|
|
97
|
+
bun run --watch src/index.ts
|
|
98
|
+
|
|
99
|
+
# With environment variables
|
|
100
|
+
bun run --env-file .env src/index.ts
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Build Command
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
# Basic build for Bun runtime
|
|
107
|
+
bun build ./src/index.ts --outdir ./dist --target bun
|
|
108
|
+
|
|
109
|
+
# For Node.js runtime
|
|
110
|
+
bun build ./src/index.ts --outdir ./dist --target node
|
|
111
|
+
|
|
112
|
+
# With minification
|
|
113
|
+
bun build ./src/index.ts --outdir ./dist --target bun --minify
|
|
114
|
+
|
|
115
|
+
# Multiple entry points
|
|
116
|
+
bun build ./src/index.ts ./src/worker.ts --outdir ./dist --target bun
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
See [references/bun.md](./references/bun.md) for bunfig.toml configuration and advanced patterns.
|
|
120
|
+
|
|
121
|
+
## tsgo Typechecking
|
|
122
|
+
|
|
123
|
+
tsgo is a fast TypeScript typechecker. Use it instead of `tsc` for faster CI builds.
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
# Typecheck without emitting
|
|
127
|
+
tsgo --noEmit
|
|
128
|
+
|
|
129
|
+
# Typecheck specific files
|
|
130
|
+
tsgo --noEmit src/**/*.ts
|
|
131
|
+
|
|
132
|
+
# With project reference
|
|
133
|
+
tsgo --noEmit -p tsconfig.json
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### tsconfig.json
|
|
137
|
+
|
|
138
|
+
```json
|
|
139
|
+
{
|
|
140
|
+
"compilerOptions": {
|
|
141
|
+
"target": "ESNext",
|
|
142
|
+
"module": "ESNext",
|
|
143
|
+
"moduleResolution": "bundler",
|
|
144
|
+
"strict": true,
|
|
145
|
+
"skipLibCheck": true,
|
|
146
|
+
"noEmit": true,
|
|
147
|
+
"esModuleInterop": true,
|
|
148
|
+
"resolveJsonModule": true,
|
|
149
|
+
"isolatedModules": true,
|
|
150
|
+
"verbatimModuleSyntax": true,
|
|
151
|
+
"lib": ["ESNext"],
|
|
152
|
+
"types": ["bun-types"]
|
|
153
|
+
},
|
|
154
|
+
"include": ["src/**/*.ts"],
|
|
155
|
+
"exclude": ["node_modules", "dist"]
|
|
156
|
+
}
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
## Vitest
|
|
160
|
+
|
|
161
|
+
### Basic Configuration
|
|
162
|
+
|
|
163
|
+
```typescript
|
|
164
|
+
// vitest.config.ts
|
|
165
|
+
import { defineConfig } from 'vitest/config'
|
|
166
|
+
|
|
167
|
+
export default defineConfig({
|
|
168
|
+
test: {
|
|
169
|
+
globals: true,
|
|
170
|
+
environment: 'node',
|
|
171
|
+
include: ['src/**/*.test.ts', 'test/**/*.test.ts'],
|
|
172
|
+
coverage: {
|
|
173
|
+
provider: 'v8',
|
|
174
|
+
reporter: ['text', 'json', 'html'],
|
|
175
|
+
include: ['src/**/*.ts'],
|
|
176
|
+
exclude: ['src/**/*.test.ts', 'src/types/**'],
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
})
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### With Path Aliases
|
|
183
|
+
|
|
184
|
+
```typescript
|
|
185
|
+
// vitest.config.ts
|
|
186
|
+
import { defineConfig } from 'vitest/config'
|
|
187
|
+
import tsconfigPaths from 'vite-tsconfig-paths'
|
|
188
|
+
|
|
189
|
+
export default defineConfig({
|
|
190
|
+
plugins: [tsconfigPaths()],
|
|
191
|
+
test: {
|
|
192
|
+
globals: true,
|
|
193
|
+
},
|
|
194
|
+
})
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
### Global Setup (Database Migrations)
|
|
198
|
+
|
|
199
|
+
```typescript
|
|
200
|
+
// vitest.config.ts
|
|
201
|
+
import { defineConfig } from 'vitest/config'
|
|
202
|
+
|
|
203
|
+
export default defineConfig({
|
|
204
|
+
test: {
|
|
205
|
+
globals: true,
|
|
206
|
+
globalSetup: './test/global-setup.ts',
|
|
207
|
+
setupFiles: ['./test/setup.ts'],
|
|
208
|
+
},
|
|
209
|
+
})
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
```typescript
|
|
213
|
+
// test/global-setup.ts
|
|
214
|
+
import { execSync } from 'node:child_process'
|
|
215
|
+
|
|
216
|
+
export async function setup() {
|
|
217
|
+
console.log('Running database migrations...')
|
|
218
|
+
execSync('drizzle-kit migrate', { stdio: 'inherit' })
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
export async function teardown() {
|
|
222
|
+
console.log('Test teardown complete')
|
|
223
|
+
}
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
See [references/vitest.md](./references/vitest.md) for workspace configs, benchmarks, and Cloudflare Workers pool.
|
|
227
|
+
|
|
228
|
+
## Biome
|
|
229
|
+
|
|
230
|
+
### Basic biome.json
|
|
231
|
+
|
|
232
|
+
```json
|
|
233
|
+
{
|
|
234
|
+
"$schema": "https://biomejs.dev/schemas/2.0.0/schema.json",
|
|
235
|
+
"vcs": {
|
|
236
|
+
"enabled": true,
|
|
237
|
+
"clientKind": "git",
|
|
238
|
+
"useIgnoreFile": true
|
|
239
|
+
},
|
|
240
|
+
"files": {
|
|
241
|
+
"ignoreUnknown": true,
|
|
242
|
+
"ignore": ["dist", "node_modules", "*.gen.ts"]
|
|
243
|
+
},
|
|
244
|
+
"formatter": {
|
|
245
|
+
"enabled": true,
|
|
246
|
+
"indentStyle": "tab",
|
|
247
|
+
"lineWidth": 100
|
|
248
|
+
},
|
|
249
|
+
"javascript": {
|
|
250
|
+
"formatter": {
|
|
251
|
+
"quoteStyle": "double",
|
|
252
|
+
"trailingCommas": "es5"
|
|
253
|
+
}
|
|
254
|
+
},
|
|
255
|
+
"linter": {
|
|
256
|
+
"enabled": true,
|
|
257
|
+
"rules": {
|
|
258
|
+
"recommended": true
|
|
259
|
+
}
|
|
260
|
+
},
|
|
261
|
+
"organizeImports": {
|
|
262
|
+
"enabled": true
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
### Strict Rules (Production)
|
|
268
|
+
|
|
269
|
+
```json
|
|
270
|
+
{
|
|
271
|
+
"linter": {
|
|
272
|
+
"enabled": true,
|
|
273
|
+
"rules": {
|
|
274
|
+
"recommended": true,
|
|
275
|
+
"complexity": {
|
|
276
|
+
"noForEach": "error"
|
|
277
|
+
},
|
|
278
|
+
"performance": {
|
|
279
|
+
"noDelete": "error"
|
|
280
|
+
},
|
|
281
|
+
"style": {
|
|
282
|
+
"useNodejsImportProtocol": "error"
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
See [references/biome.md](./references/biome.md) for rule explanations, shareable configs, and CLI commands.
|
|
290
|
+
|
|
291
|
+
## Turborepo (Monorepo)
|
|
292
|
+
|
|
293
|
+
### turbo.json
|
|
294
|
+
|
|
295
|
+
```json
|
|
296
|
+
{
|
|
297
|
+
"$schema": "https://turbo.build/schema.json",
|
|
298
|
+
"tasks": {
|
|
299
|
+
"build": {
|
|
300
|
+
"dependsOn": ["^build"],
|
|
301
|
+
"outputs": ["dist/**"]
|
|
302
|
+
},
|
|
303
|
+
"typecheck": {
|
|
304
|
+
"dependsOn": ["^typecheck"]
|
|
305
|
+
},
|
|
306
|
+
"lint": {},
|
|
307
|
+
"test": {
|
|
308
|
+
"dependsOn": ["^build"],
|
|
309
|
+
"env": ["DATABASE_URL"]
|
|
310
|
+
},
|
|
311
|
+
"dev": {
|
|
312
|
+
"cache": false,
|
|
313
|
+
"persistent": true
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
### Workspace Structure
|
|
320
|
+
|
|
321
|
+
```
|
|
322
|
+
my-monorepo/
|
|
323
|
+
├── package.json # Root with turbo scripts
|
|
324
|
+
├── turbo.json # Turbo configuration
|
|
325
|
+
├── biome.json # Shared Biome config
|
|
326
|
+
├── packages/
|
|
327
|
+
│ ├── config-biome/ # Shareable Biome package
|
|
328
|
+
│ └── shared/ # Shared utilities
|
|
329
|
+
├── apps/
|
|
330
|
+
│ ├── api/ # Fastify API
|
|
331
|
+
│ └── web/ # React app
|
|
332
|
+
└── bun.lock
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
See [references/turborepo.md](./references/turborepo.md) for caching strategies, filtering, and CI setup.
|
|
336
|
+
|
|
337
|
+
## Cloudflare Workers
|
|
338
|
+
|
|
339
|
+
### Vite + Cloudflare Plugin
|
|
340
|
+
|
|
341
|
+
```typescript
|
|
342
|
+
// vite.config.ts
|
|
343
|
+
import { cloudflare } from '@cloudflare/vite-plugin'
|
|
344
|
+
import { reactRouter } from '@react-router/dev/vite'
|
|
345
|
+
import tailwindcss from '@tailwindcss/vite'
|
|
346
|
+
import tsconfigPaths from 'vite-tsconfig-paths'
|
|
347
|
+
import { defineConfig } from 'vite'
|
|
348
|
+
|
|
349
|
+
export default defineConfig({
|
|
350
|
+
plugins: [
|
|
351
|
+
cloudflare({ viteEnvironment: { name: 'ssr' } }),
|
|
352
|
+
tailwindcss(),
|
|
353
|
+
reactRouter(),
|
|
354
|
+
tsconfigPaths(),
|
|
355
|
+
],
|
|
356
|
+
})
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
### Vitest with Cloudflare Workers Pool
|
|
360
|
+
|
|
361
|
+
```typescript
|
|
362
|
+
// vitest.config.ts
|
|
363
|
+
import { defineWorkersConfig } from '@cloudflare/vitest-pool-workers/config'
|
|
364
|
+
|
|
365
|
+
export default defineWorkersConfig({
|
|
366
|
+
test: {
|
|
367
|
+
globals: true,
|
|
368
|
+
pool: '@cloudflare/vitest-pool-workers',
|
|
369
|
+
poolOptions: {
|
|
370
|
+
workers: {
|
|
371
|
+
wrangler: { configPath: './wrangler.jsonc' },
|
|
372
|
+
},
|
|
373
|
+
},
|
|
374
|
+
},
|
|
375
|
+
})
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
## CI Pipeline
|
|
379
|
+
|
|
380
|
+
### GitHub Actions
|
|
381
|
+
|
|
382
|
+
```yaml
|
|
383
|
+
name: typescript-build-tools
|
|
384
|
+
|
|
385
|
+
on:
|
|
386
|
+
push:
|
|
387
|
+
branches: [main]
|
|
388
|
+
pull_request:
|
|
389
|
+
|
|
390
|
+
jobs:
|
|
391
|
+
check:
|
|
392
|
+
runs-on: ubuntu-latest
|
|
393
|
+
steps:
|
|
394
|
+
- uses: actions/checkout@v4
|
|
395
|
+
|
|
396
|
+
- uses: oven-sh/setup-bun@v2
|
|
397
|
+
with:
|
|
398
|
+
bun-version: latest
|
|
399
|
+
|
|
400
|
+
- run: bun install --frozen-lockfile
|
|
401
|
+
|
|
402
|
+
- run: bun run typecheck
|
|
403
|
+
- run: bun run lint
|
|
404
|
+
- run: bun run test
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
### Monorepo CI with Turbo
|
|
408
|
+
|
|
409
|
+
```yaml
|
|
410
|
+
name: typescript-build-tools
|
|
411
|
+
|
|
412
|
+
on:
|
|
413
|
+
push:
|
|
414
|
+
branches: [main]
|
|
415
|
+
pull_request:
|
|
416
|
+
|
|
417
|
+
jobs:
|
|
418
|
+
check:
|
|
419
|
+
runs-on: ubuntu-latest
|
|
420
|
+
steps:
|
|
421
|
+
- uses: actions/checkout@v4
|
|
422
|
+
|
|
423
|
+
- uses: oven-sh/setup-bun@v2
|
|
424
|
+
|
|
425
|
+
- run: bun install --frozen-lockfile
|
|
426
|
+
|
|
427
|
+
- run: bun run check # turbo typecheck lint test
|
|
428
|
+
env:
|
|
429
|
+
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
|
430
|
+
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
|
|
431
|
+
```
|
|
432
|
+
|
|
433
|
+
## Guidelines
|
|
434
|
+
|
|
435
|
+
1. **Use Bun** as package manager (`bun install`) and task runner (`bun run`)
|
|
436
|
+
2. **Use `bun run test`** (not `bun test`) - `bun test` runs Bun's native test runner
|
|
437
|
+
3. **Use tsgo** for typechecking - faster than `tsc` for CI
|
|
438
|
+
4. **Use Vitest** for testing - fast, ESM-native, great DX
|
|
439
|
+
5. **Use Biome** for linting and formatting - single tool, fast
|
|
440
|
+
6. **Use Turborepo** for monorepos - caching, parallel execution
|
|
441
|
+
7. **Enable V8 coverage** in Vitest for accurate coverage reports
|
|
442
|
+
8. **Configure global setup** for database migrations in tests
|
|
443
|
+
9. **Use workspace configs** in Vitest for different test pools
|
|
444
|
+
10. **Share Biome config** via workspace package in monorepos
|
|
445
|
+
11. **Run checks in order**: typecheck, lint, test (fail fast)
|
|
446
|
+
12. **Use `--frozen-lockfile`** in CI for reproducible builds
|
|
447
|
+
13. **Configure Turbo caching** for faster CI with remote cache
|