tlc-claude-code 1.2.8 → 1.2.9

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 (3) hide show
  1. package/init.md +93 -5
  2. package/new-project.md +73 -2
  3. package/package.json +1 -1
package/init.md CHANGED
@@ -88,10 +88,17 @@ Create `.tlc.json`:
88
88
  "run": ["mocha"]
89
89
  },
90
90
  "testCommand": "npm test",
91
- "testDirectory": "test"
91
+ "testDirectory": "test",
92
+ "e2e": {
93
+ "framework": null,
94
+ "directory": "tests/e2e",
95
+ "command": null
96
+ }
92
97
  }
93
98
  ```
94
99
 
100
+ (E2E framework is configured in Step 11)
101
+
95
102
  Add test scripts to package.json:
96
103
  ```json
97
104
  "scripts": {
@@ -283,15 +290,96 @@ This branch is used by:
283
290
  - `/tlc:build` - suggests merging back to this branch
284
291
  - PR reviews - compares against this branch
285
292
 
286
- ### 11. Report Summary
293
+ ### 11. Set Up E2E Testing
294
+
295
+ Check for existing E2E setup:
296
+
297
+ ```bash
298
+ # Detect existing E2E
299
+ if [ -f "playwright.config.ts" ] || [ -f "playwright.config.js" ]; then
300
+ e2e="playwright"
301
+ elif [ -f "cypress.config.ts" ] || [ -f "cypress.config.js" ]; then
302
+ e2e="cypress"
303
+ elif [ -d "tests/e2e" ] || [ -d "e2e" ]; then
304
+ e2e="detected"
305
+ fi
306
+ ```
307
+
308
+ **If no E2E found:**
309
+
310
+ ```
311
+ No E2E testing detected.
312
+
313
+ Set up E2E tests for full user flow verification?
314
+ [1] Yes - Playwright (recommended)
315
+ [2] Yes - Cypress
316
+ [3] No - skip for now
317
+
318
+ Choice [1/2/3]: _
319
+ ```
320
+
321
+ **If Playwright selected:**
322
+
323
+ ```bash
324
+ npm init playwright@latest
325
+ ```
326
+
327
+ Create `playwright.config.ts`:
328
+ ```typescript
329
+ import { defineConfig } from '@playwright/test';
330
+
331
+ export default defineConfig({
332
+ testDir: './tests/e2e',
333
+ baseURL: process.env.BASE_URL || 'http://localhost:5001',
334
+ use: {
335
+ screenshot: 'only-on-failure',
336
+ video: 'retain-on-failure',
337
+ },
338
+ });
339
+ ```
340
+
341
+ Update `.tlc.json`:
342
+ ```json
343
+ {
344
+ "e2e": {
345
+ "framework": "playwright",
346
+ "directory": "tests/e2e",
347
+ "command": "npx playwright test"
348
+ }
349
+ }
350
+ ```
351
+
352
+ Add to `package.json`:
353
+ ```json
354
+ {
355
+ "scripts": {
356
+ "test:e2e": "playwright test",
357
+ "test:e2e:ui": "playwright test --ui"
358
+ }
359
+ }
360
+ ```
361
+
362
+ **If E2E already exists:**
363
+
364
+ ```
365
+ Detected E2E framework: playwright
366
+ E2E directory: tests/e2e
367
+ Existing E2E tests: 5 files
368
+
369
+ Keeping existing E2E setup.
370
+ ```
371
+
372
+ ### 12. Report Summary
287
373
 
288
374
  ```
289
375
  TLC initialized for [project name]
290
376
 
291
377
  Stack: [detected]
292
- Test framework: [framework] (existing/newly configured)
293
- Test directory: [path]
294
- Existing tests: [count] files
378
+ Unit tests: [framework] (existing/newly configured)
379
+ Unit test directory: [path]
380
+ E2E tests: [framework] (existing/newly configured)
381
+ E2E test directory: [path]
382
+ Existing tests: [count] unit, [count] E2E
295
383
  Untested files: [count] identified
296
384
 
297
385
  Next steps:
package/new-project.md CHANGED
@@ -252,7 +252,12 @@ Create `.tlc.json` with default test settings:
252
252
  "run": ["mocha"]
253
253
  },
254
254
  "testCommand": "npm test",
255
- "testDirectory": "test"
255
+ "testDirectory": "test",
256
+ "e2e": {
257
+ "framework": "playwright",
258
+ "directory": "tests/e2e",
259
+ "command": "npx playwright test"
260
+ }
256
261
  }
257
262
  ```
258
263
 
@@ -271,10 +276,13 @@ Scaffold based on chosen stack:
271
276
  ```
272
277
  project/
273
278
  ├── src/
274
- ├── test/
279
+ ├── test/ # Unit tests
280
+ ├── tests/
281
+ │ └── e2e/ # E2E tests (Playwright)
275
282
  ├── .env.example
276
283
  ├── .tlc.json
277
284
  ├── .mocharc.json
285
+ ├── playwright.config.ts # E2E config
278
286
  ├── docker-compose.yml
279
287
  ├── Dockerfile
280
288
  ├── [package.json | pyproject.toml | go.mod]
@@ -309,6 +317,69 @@ Add to `package.json`:
309
317
  }
310
318
  ```
311
319
 
320
+ ### Step 9: Set Up E2E Testing
321
+
322
+ E2E tests verify full user flows in the browser.
323
+
324
+ ```
325
+ Set up E2E testing?
326
+ [1] Playwright (recommended)
327
+ [2] Cypress
328
+ [3] Skip for now
329
+
330
+ Choice [1/2/3]: _
331
+ ```
332
+
333
+ **If Playwright (default):**
334
+
335
+ ```bash
336
+ npm init playwright@latest
337
+ ```
338
+
339
+ Create `playwright.config.ts`:
340
+ ```typescript
341
+ import { defineConfig } from '@playwright/test';
342
+
343
+ export default defineConfig({
344
+ testDir: './tests/e2e',
345
+ baseURL: process.env.BASE_URL || 'http://localhost:5001',
346
+ use: {
347
+ screenshot: 'only-on-failure',
348
+ video: 'retain-on-failure',
349
+ },
350
+ });
351
+ ```
352
+
353
+ Create `tests/e2e/.gitkeep` to establish the directory.
354
+
355
+ Add to `package.json`:
356
+ ```json
357
+ {
358
+ "scripts": {
359
+ "test": "mocha",
360
+ "test:watch": "mocha --watch",
361
+ "test:e2e": "playwright test",
362
+ "test:e2e:ui": "playwright test --ui"
363
+ }
364
+ }
365
+ ```
366
+
367
+ **If Cypress:**
368
+
369
+ ```bash
370
+ npm install -D cypress
371
+ npx cypress open
372
+ ```
373
+
374
+ **Summary output:**
375
+ ```
376
+ ✓ Unit tests: mocha + chai + sinon
377
+ ✓ E2E tests: playwright
378
+ ✓ Test directories: test/ (unit), tests/e2e/ (E2E)
379
+
380
+ Ready to build. Run /tlc:plan to create your first phase.
381
+ ```
382
+
312
383
  ## Usage
313
384
 
314
385
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tlc-claude-code",
3
- "version": "1.2.8",
3
+ "version": "1.2.9",
4
4
  "description": "TLC - Test Led Coding for Claude Code",
5
5
  "bin": {
6
6
  "tlc": "./bin/tlc.js",