@martinffx/atelier 2.0.0 → 3.0.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 +14 -0
- package/README.md +94 -253
- package/package.json +1 -1
- package/skills/{spec-orchestrator → atelier-orchestrator}/SKILL.md +3 -3
- package/skills/atelier-setup/SKILL.md +80 -0
- package/skills/code-review/references/reviewers.md +3 -3
- package/skills/code-review/references/rq.md +6 -6
- package/skills/spec-brainstorm/SKILL.md +5 -5
- package/skills/spec-implement/SKILL.md +2 -3
- package/skills/spec-plan/SKILL.md +21 -29
- package/skills/spec-plan/references/plan_template.md +77 -0
- package/skills/python-architecture/SKILL.md +0 -148
- package/skills/python-architecture/references/data-modeling.md +0 -558
- package/skills/python-architecture/references/ddd.md +0 -569
- package/skills/python-architecture/references/functional-core.md +0 -337
- package/skills/python-build-tools/SKILL.md +0 -153
- package/skills/python-build-tools/references/basedpyright.md +0 -321
- package/skills/python-build-tools/references/ruff.md +0 -225
- package/skills/python-build-tools/references/uv.md +0 -257
- package/skills/python-fastapi/SKILL.md +0 -184
- package/skills/python-fastapi/references/api-design.md +0 -563
- package/skills/python-fastapi/references/dependencies.md +0 -479
- package/skills/python-fastapi/references/middleware.md +0 -475
- package/skills/python-fastapi/references/validation.md +0 -497
- package/skills/python-modern-python/SKILL.md +0 -201
- package/skills/python-modern-python/references/async.md +0 -76
- package/skills/python-modern-python/references/pattern-matching.md +0 -89
- package/skills/python-modern-python/references/typing.md +0 -96
- package/skills/python-monorepo/SKILL.md +0 -146
- package/skills/python-monorepo/references/docker.md +0 -515
- package/skills/python-monorepo/references/namespace-packages.md +0 -426
- package/skills/python-monorepo/references/workspace-config.md +0 -341
- package/skills/python-sqlalchemy/SKILL.md +0 -119
- package/skills/python-sqlalchemy/references/async.md +0 -51
- package/skills/python-sqlalchemy/references/models.md +0 -67
- package/skills/python-sqlalchemy/references/queries.md +0 -57
- package/skills/python-temporal/SKILL.md +0 -128
- package/skills/python-temporal/references/patterns.md +0 -87
- package/skills/python-temporal/references/testing.md +0 -54
- package/skills/python-testing/SKILL.md +0 -161
- package/skills/python-testing/references/boundaries.md +0 -449
- package/skills/python-testing/references/mocking.md +0 -449
- package/skills/python-testing/references/pytest.md +0 -524
- package/skills/typescript-api-design/SKILL.md +0 -396
- package/skills/typescript-api-design/references/error-responses.md +0 -469
- package/skills/typescript-build-tools/SKILL.md +0 -447
- package/skills/typescript-build-tools/references/biome.md +0 -436
- package/skills/typescript-build-tools/references/bun.md +0 -432
- package/skills/typescript-build-tools/references/turborepo.md +0 -426
- package/skills/typescript-build-tools/references/vitest.md +0 -518
- package/skills/typescript-drizzle-orm/SKILL.md +0 -398
- package/skills/typescript-drizzle-orm/references/cloudflare.md +0 -392
- package/skills/typescript-drizzle-orm/references/entity-pattern.md +0 -412
- package/skills/typescript-drizzle-orm/references/postgresql.md +0 -191
- package/skills/typescript-drizzle-orm/references/repository-pattern.md +0 -479
- package/skills/typescript-drizzle-orm/references/sqlite.md +0 -291
- package/skills/typescript-dynamodb-toolbox/SKILL.md +0 -370
- package/skills/typescript-dynamodb-toolbox/references/entity-layer.md +0 -574
- package/skills/typescript-dynamodb-toolbox/references/error-handling.md +0 -495
- package/skills/typescript-dynamodb-toolbox/references/modeling.md +0 -332
- package/skills/typescript-dynamodb-toolbox/references/repository-layer.md +0 -631
- package/skills/typescript-dynamodb-toolbox/references/testing.md +0 -718
- package/skills/typescript-dynamodb-toolbox/references/transactions.md +0 -423
- package/skills/typescript-effect-ts/SKILL.md +0 -341
- package/skills/typescript-effect-ts/references/core.md +0 -412
- package/skills/typescript-effect-ts/references/error-handling.md +0 -468
- package/skills/typescript-effect-ts/references/resources.md +0 -476
- package/skills/typescript-effect-ts/references/schema.md +0 -536
- package/skills/typescript-effect-ts/references/services.md +0 -461
- package/skills/typescript-fastify/SKILL.md +0 -405
- package/skills/typescript-fastify/references/plugins.md +0 -329
- package/skills/typescript-fastify/references/typeid.md +0 -315
- package/skills/typescript-functional-patterns/SKILL.md +0 -402
- package/skills/typescript-functional-patterns/references/adts.md +0 -497
- package/skills/typescript-functional-patterns/references/branded-types.md +0 -542
- package/skills/typescript-functional-patterns/references/migration-guide.md +0 -695
- package/skills/typescript-functional-patterns/references/option-result.md +0 -585
- package/skills/typescript-testing/SKILL.md +0 -353
- package/skills/typescript-testing/references/mocking.md +0 -675
- package/skills/typescript-testing/references/msw.md +0 -852
- package/skills/typescript-testing/references/snapshot-testing.md +0 -774
|
@@ -1,432 +0,0 @@
|
|
|
1
|
-
# Bun Package Manager and Task Runner
|
|
2
|
-
|
|
3
|
-
Comprehensive guide to using Bun as a package manager and task runner in TypeScript projects.
|
|
4
|
-
|
|
5
|
-
## Package Management
|
|
6
|
-
|
|
7
|
-
### Installation
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
# Install all dependencies
|
|
11
|
-
bun install
|
|
12
|
-
|
|
13
|
-
# Install with frozen lockfile (CI)
|
|
14
|
-
bun install --frozen-lockfile
|
|
15
|
-
|
|
16
|
-
# Install production dependencies only
|
|
17
|
-
bun install --production
|
|
18
|
-
|
|
19
|
-
# Clean install (removes node_modules first)
|
|
20
|
-
bun install --force
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
### Adding Dependencies
|
|
24
|
-
|
|
25
|
-
```bash
|
|
26
|
-
# Add runtime dependency
|
|
27
|
-
bun add fastify drizzle-orm @sinclair/typebox
|
|
28
|
-
|
|
29
|
-
# Add dev dependency
|
|
30
|
-
bun add -D vitest @biomejs/biome typescript
|
|
31
|
-
|
|
32
|
-
# Add specific version
|
|
33
|
-
bun add react@18.2.0
|
|
34
|
-
|
|
35
|
-
# Add from git
|
|
36
|
-
bun add user/repo
|
|
37
|
-
bun add user/repo#branch-or-commit
|
|
38
|
-
bun add github:user/repo
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
### Removing Dependencies
|
|
42
|
-
|
|
43
|
-
```bash
|
|
44
|
-
# Remove package
|
|
45
|
-
bun remove package-name
|
|
46
|
-
|
|
47
|
-
# Remove multiple packages
|
|
48
|
-
bun remove package1 package2 package3
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
### Updating Dependencies
|
|
52
|
-
|
|
53
|
-
```bash
|
|
54
|
-
# Update all dependencies
|
|
55
|
-
bun update
|
|
56
|
-
|
|
57
|
-
# Update specific package
|
|
58
|
-
bun update package-name
|
|
59
|
-
|
|
60
|
-
# Update to latest (including breaking changes)
|
|
61
|
-
bun update --latest
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
### Viewing Dependencies
|
|
65
|
-
|
|
66
|
-
```bash
|
|
67
|
-
# List installed packages
|
|
68
|
-
bun pm ls
|
|
69
|
-
|
|
70
|
-
# List dependencies of a package
|
|
71
|
-
bun pm ls package-name
|
|
72
|
-
|
|
73
|
-
# Show outdated packages
|
|
74
|
-
bun outdated
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
## Task Runner
|
|
78
|
-
|
|
79
|
-
### Running Scripts
|
|
80
|
-
|
|
81
|
-
**Critical:** Use `bun run test` (not `bun test`) on Node projects. `bun test` invokes Bun's native test runner, which expects Bun-style test files, not your package.json test script.
|
|
82
|
-
|
|
83
|
-
```bash
|
|
84
|
-
# Run script from package.json
|
|
85
|
-
bun run dev
|
|
86
|
-
bun run test
|
|
87
|
-
bun run build
|
|
88
|
-
bun run typecheck
|
|
89
|
-
|
|
90
|
-
# List available scripts
|
|
91
|
-
bun run
|
|
92
|
-
|
|
93
|
-
# Run with arguments
|
|
94
|
-
bun run build --production
|
|
95
|
-
bun run test src/users.test.ts
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
### Running TypeScript Directly
|
|
99
|
-
|
|
100
|
-
```bash
|
|
101
|
-
# Execute TypeScript file (no build step)
|
|
102
|
-
bun run src/index.ts
|
|
103
|
-
|
|
104
|
-
# Execute with arguments
|
|
105
|
-
bun run src/cli.ts --help
|
|
106
|
-
|
|
107
|
-
# Watch mode (restart on file changes)
|
|
108
|
-
bun run --watch src/index.ts
|
|
109
|
-
|
|
110
|
-
# Hot reload (reload modules without restart)
|
|
111
|
-
bun run --hot src/index.ts
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
### Environment Variables
|
|
115
|
-
|
|
116
|
-
```bash
|
|
117
|
-
# Load from .env file
|
|
118
|
-
bun run --env-file .env src/index.ts
|
|
119
|
-
|
|
120
|
-
# Load from custom env file
|
|
121
|
-
bun run --env-file .env.production src/index.ts
|
|
122
|
-
|
|
123
|
-
# Multiple env files (last one wins)
|
|
124
|
-
bun run --env-file .env --env-file .env.local src/index.ts
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
## Build Command
|
|
128
|
-
|
|
129
|
-
### Basic Build
|
|
130
|
-
|
|
131
|
-
```bash
|
|
132
|
-
# Build for Bun runtime
|
|
133
|
-
bun build ./src/index.ts --outdir ./dist --target bun
|
|
134
|
-
|
|
135
|
-
# Build for Node.js runtime
|
|
136
|
-
bun build ./src/index.ts --outdir ./dist --target node
|
|
137
|
-
|
|
138
|
-
# Build for browser
|
|
139
|
-
bun build ./src/index.ts --outdir ./dist --target browser
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
### Build Options
|
|
143
|
-
|
|
144
|
-
```bash
|
|
145
|
-
# Minify output
|
|
146
|
-
bun build ./src/index.ts --outdir ./dist --target bun --minify
|
|
147
|
-
|
|
148
|
-
# Generate sourcemaps
|
|
149
|
-
bun build ./src/index.ts --outdir ./dist --sourcemap
|
|
150
|
-
|
|
151
|
-
# External dependencies (don't bundle)
|
|
152
|
-
bun build ./src/index.ts --outdir ./dist --external fastify --external drizzle-orm
|
|
153
|
-
|
|
154
|
-
# Set entry point name
|
|
155
|
-
bun build ./src/index.ts --outfile ./dist/server.js
|
|
156
|
-
|
|
157
|
-
# Bundle format
|
|
158
|
-
bun build ./src/index.ts --outdir ./dist --format esm
|
|
159
|
-
bun build ./src/index.ts --outdir ./dist --format cjs
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
### Multiple Entry Points
|
|
163
|
-
|
|
164
|
-
```bash
|
|
165
|
-
# Build multiple files
|
|
166
|
-
bun build ./src/index.ts ./src/worker.ts --outdir ./dist --target bun
|
|
167
|
-
|
|
168
|
-
# Build all files in directory
|
|
169
|
-
bun build ./src/*.ts --outdir ./dist --target bun
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
### Production Builds
|
|
173
|
-
|
|
174
|
-
```json
|
|
175
|
-
{
|
|
176
|
-
"scripts": {
|
|
177
|
-
"build": "bun build ./src/index.ts --outdir ./dist --target bun --minify --sourcemap"
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
## bunfig.toml Configuration
|
|
183
|
-
|
|
184
|
-
### Basic Configuration
|
|
185
|
-
|
|
186
|
-
```toml
|
|
187
|
-
[install]
|
|
188
|
-
# Use frozen lockfile (equivalent to --frozen-lockfile)
|
|
189
|
-
frozen = true
|
|
190
|
-
|
|
191
|
-
# Prefer offline installation
|
|
192
|
-
prefer-offline = true
|
|
193
|
-
|
|
194
|
-
# Auto-install peer dependencies
|
|
195
|
-
auto = true
|
|
196
|
-
|
|
197
|
-
[install.lockfile]
|
|
198
|
-
# Print lockfile in yarn format (easier to review)
|
|
199
|
-
print = "yarn"
|
|
200
|
-
|
|
201
|
-
# Save lockfile (default: true)
|
|
202
|
-
save = true
|
|
203
|
-
|
|
204
|
-
[run]
|
|
205
|
-
# Silence script output header
|
|
206
|
-
silent = true
|
|
207
|
-
|
|
208
|
-
# Automatically restart on crash
|
|
209
|
-
restart = false
|
|
210
|
-
|
|
211
|
-
[test]
|
|
212
|
-
# Coverage directory
|
|
213
|
-
coverage = "./coverage"
|
|
214
|
-
|
|
215
|
-
# Coverage threshold
|
|
216
|
-
coverageThreshold = 80
|
|
217
|
-
```
|
|
218
|
-
|
|
219
|
-
### Registry Configuration
|
|
220
|
-
|
|
221
|
-
```toml
|
|
222
|
-
[install.scopes]
|
|
223
|
-
# Use custom registry for @myorg packages
|
|
224
|
-
"@myorg" = { url = "https://npm.pkg.github.com", token = "$GH_TOKEN" }
|
|
225
|
-
|
|
226
|
-
# Use npm registry for everything else
|
|
227
|
-
"*" = { url = "https://registry.npmjs.org" }
|
|
228
|
-
```
|
|
229
|
-
|
|
230
|
-
### Cache Configuration
|
|
231
|
-
|
|
232
|
-
```toml
|
|
233
|
-
[install.cache]
|
|
234
|
-
# Disable cache
|
|
235
|
-
disable = false
|
|
236
|
-
|
|
237
|
-
# Cache directory
|
|
238
|
-
dir = "~/.bun/install/cache"
|
|
239
|
-
```
|
|
240
|
-
|
|
241
|
-
## Workspaces (Monorepo)
|
|
242
|
-
|
|
243
|
-
### Root package.json
|
|
244
|
-
|
|
245
|
-
```json
|
|
246
|
-
{
|
|
247
|
-
"name": "my-monorepo",
|
|
248
|
-
"workspaces": ["apps/*", "packages/*"],
|
|
249
|
-
"scripts": {
|
|
250
|
-
"dev": "turbo dev",
|
|
251
|
-
"build": "turbo build"
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
```
|
|
255
|
-
|
|
256
|
-
### Adding Dependencies to Workspace
|
|
257
|
-
|
|
258
|
-
```bash
|
|
259
|
-
# Add to specific workspace
|
|
260
|
-
bun add fastify --workspace @myorg/api
|
|
261
|
-
|
|
262
|
-
# Add to all workspaces
|
|
263
|
-
bun add -D typescript --workspace=*
|
|
264
|
-
|
|
265
|
-
# Add to root workspace
|
|
266
|
-
bun add -D turbo
|
|
267
|
-
```
|
|
268
|
-
|
|
269
|
-
### Running Scripts in Workspaces
|
|
270
|
-
|
|
271
|
-
```bash
|
|
272
|
-
# Run script in specific workspace
|
|
273
|
-
bun run --filter @myorg/api dev
|
|
274
|
-
|
|
275
|
-
# Run script in all workspaces
|
|
276
|
-
bun run --filter "**" test
|
|
277
|
-
```
|
|
278
|
-
|
|
279
|
-
## Common Patterns
|
|
280
|
-
|
|
281
|
-
### Development Script
|
|
282
|
-
|
|
283
|
-
```json
|
|
284
|
-
{
|
|
285
|
-
"scripts": {
|
|
286
|
-
"dev": "bun run --watch --env-file .env src/index.ts"
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
```
|
|
290
|
-
|
|
291
|
-
### Build and Deploy
|
|
292
|
-
|
|
293
|
-
```json
|
|
294
|
-
{
|
|
295
|
-
"scripts": {
|
|
296
|
-
"build": "bun build ./src/index.ts --outdir ./dist --target bun --minify",
|
|
297
|
-
"start": "bun run --env-file .env.production dist/index.js",
|
|
298
|
-
"deploy": "bun run build && wrangler deploy"
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
```
|
|
302
|
-
|
|
303
|
-
### Testing
|
|
304
|
-
|
|
305
|
-
```json
|
|
306
|
-
{
|
|
307
|
-
"scripts": {
|
|
308
|
-
"test": "vitest run",
|
|
309
|
-
"test:watch": "vitest",
|
|
310
|
-
"test:coverage": "vitest run --coverage",
|
|
311
|
-
"test:ui": "vitest --ui"
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
```
|
|
315
|
-
|
|
316
|
-
### Code Quality
|
|
317
|
-
|
|
318
|
-
```json
|
|
319
|
-
{
|
|
320
|
-
"scripts": {
|
|
321
|
-
"typecheck": "tsgo --noEmit",
|
|
322
|
-
"lint": "biome check .",
|
|
323
|
-
"lint:fix": "biome check --write .",
|
|
324
|
-
"format": "biome format --write .",
|
|
325
|
-
"check": "bun run typecheck && bun run lint && bun run test"
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
```
|
|
329
|
-
|
|
330
|
-
### Monorepo Scripts
|
|
331
|
-
|
|
332
|
-
```json
|
|
333
|
-
{
|
|
334
|
-
"scripts": {
|
|
335
|
-
"dev": "turbo dev",
|
|
336
|
-
"build": "turbo build",
|
|
337
|
-
"typecheck": "turbo typecheck",
|
|
338
|
-
"test": "turbo test",
|
|
339
|
-
"lint": "turbo lint",
|
|
340
|
-
"clean": "turbo clean && rm -rf node_modules",
|
|
341
|
-
"check": "turbo typecheck lint test"
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
```
|
|
345
|
-
|
|
346
|
-
## Performance Tips
|
|
347
|
-
|
|
348
|
-
### Use `bun install` Instead of `npm install`
|
|
349
|
-
|
|
350
|
-
Bun is significantly faster at installing dependencies:
|
|
351
|
-
|
|
352
|
-
```bash
|
|
353
|
-
# Slow
|
|
354
|
-
npm install
|
|
355
|
-
|
|
356
|
-
# Fast
|
|
357
|
-
bun install
|
|
358
|
-
```
|
|
359
|
-
|
|
360
|
-
### Use `--frozen-lockfile` in CI
|
|
361
|
-
|
|
362
|
-
Prevents lockfile changes and ensures reproducible builds:
|
|
363
|
-
|
|
364
|
-
```bash
|
|
365
|
-
bun install --frozen-lockfile
|
|
366
|
-
```
|
|
367
|
-
|
|
368
|
-
### Cache Dependencies in CI
|
|
369
|
-
|
|
370
|
-
```yaml
|
|
371
|
-
# GitHub Actions
|
|
372
|
-
- uses: actions/cache@v4
|
|
373
|
-
with:
|
|
374
|
-
path: ~/.bun/install/cache
|
|
375
|
-
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }}
|
|
376
|
-
restore-keys: |
|
|
377
|
-
${{ runner.os }}-bun-
|
|
378
|
-
```
|
|
379
|
-
|
|
380
|
-
### Use `--production` for Production Builds
|
|
381
|
-
|
|
382
|
-
Skip devDependencies installation:
|
|
383
|
-
|
|
384
|
-
```bash
|
|
385
|
-
bun install --production --frozen-lockfile
|
|
386
|
-
```
|
|
387
|
-
|
|
388
|
-
## Troubleshooting
|
|
389
|
-
|
|
390
|
-
### Lockfile Conflicts
|
|
391
|
-
|
|
392
|
-
```bash
|
|
393
|
-
# Regenerate lockfile
|
|
394
|
-
rm bun.lock
|
|
395
|
-
bun install
|
|
396
|
-
|
|
397
|
-
# Or use --force to clean install
|
|
398
|
-
bun install --force
|
|
399
|
-
```
|
|
400
|
-
|
|
401
|
-
### Cache Issues
|
|
402
|
-
|
|
403
|
-
```bash
|
|
404
|
-
# Clear Bun cache
|
|
405
|
-
bun pm cache rm
|
|
406
|
-
|
|
407
|
-
# Or manually delete cache
|
|
408
|
-
rm -rf ~/.bun/install/cache
|
|
409
|
-
```
|
|
410
|
-
|
|
411
|
-
### Version Conflicts
|
|
412
|
-
|
|
413
|
-
```bash
|
|
414
|
-
# Check for duplicate packages
|
|
415
|
-
bun pm ls package-name
|
|
416
|
-
|
|
417
|
-
# Deduplicate dependencies
|
|
418
|
-
bun dedupe
|
|
419
|
-
```
|
|
420
|
-
|
|
421
|
-
## Best Practices
|
|
422
|
-
|
|
423
|
-
1. **Use `bun run test`** not `bun test` for Node projects
|
|
424
|
-
2. **Use `--frozen-lockfile`** in CI for reproducible builds
|
|
425
|
-
3. **Use `--production`** when building Docker images
|
|
426
|
-
4. **Configure bunfig.toml** for team-wide settings
|
|
427
|
-
5. **Use workspaces** for monorepos instead of npm/yarn workspaces
|
|
428
|
-
6. **Cache `~/.bun/install/cache`** in CI for faster builds
|
|
429
|
-
7. **Use `bun run --watch`** for development hot reload
|
|
430
|
-
8. **Use `bun build`** for production builds with `--minify` and `--sourcemap`
|
|
431
|
-
9. **Use `bun run --env-file`** instead of dotenv packages
|
|
432
|
-
10. **Keep bun.lock** in version control for reproducible builds
|