You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**Feature Requests**: See `prompts-TODO/current.txt`
15
+
5
16
## Project Overview
6
17
7
18
This is a modular JavaScript implementation of the classic 1989 Kid Pix drawing application, based on Vikrum's HTML/JavaScript implementation (kidpix.app). The current focus is on maintaining and improving the modular JavaScript codebase as a foundation for future migration to React/TypeScript.
8
19
20
+
### Recent Improvements (September-October 2025)
21
+
22
+
- Multi-level undo/redo that persists across page reloads
23
+
- Expanded stamp collection with organized naming system
24
+
- Enhanced color picker tool
25
+
- Improved image organization (moved to logical folders)
26
+
- GitHub releases support for offline distribution
27
+
- Comprehensive documentation for users and maintainers
28
+
- Browser error monitoring integration for AI-assisted development
29
+
- Removed ESLint/Prettier to reduce development friction (AI writes correct code without them)
30
+
9
31
## Technology Stack
10
32
11
33
-**Runtime**: Modular JavaScript (ES5/ES6) loaded via script tags
12
-
-**Build Tool**: Vite 6.3.5 for development server and asset serving
34
+
-**Build Tool**: Vite 6.4.1 for development server and asset serving
13
35
-**Package Manager**: Yarn 1.22.22
14
-
-**Linting**: ESLint 9 (currently configured for TypeScript, needs update for JS)
15
-
-**Testing**: Vitest and Playwright configured but not yet used for JS files
16
-
-**Error Monitoring**: vite-plugin-terminal for browser console errors in Claude Code development
36
+
-**Node.js**: v24.9.0
37
+
-**Linting**: None (ESLint and Prettier removed in commit 3f1155b - September 2025)
38
+
-**Testing**: Vitest 3.2.3 and Playwright 1.56.1 configured for JavaScript files
39
+
-**Error Monitoring**: vite-plugin-terminal 1.3.0 for browser console errors in Claude Code development
17
40
18
41
## CRITICAL COMMIT WORKFLOW
19
42
@@ -59,45 +82,137 @@ git commit -m "feat(tooling): set up entire tech stack"
59
82
60
83
- After finishing a feature and moving its feature-request file to prompts-DONE, offer to create a pull request (PR)
61
84
85
+
## CI/CD and Deployment
86
+
87
+
### GitHub Actions Workflows
88
+
89
+
The project uses GitHub Actions for continuous integration and deployment:
90
+
91
+
1.**build-and-deploy-all.yml** (PRIMARY - Active)
92
+
- Triggers: Push to main, manual workflow_dispatch
93
+
- Builds app with Vite (to `dist/`)
94
+
- Builds docs with MkDocs (to `dist/docs/`)
95
+
- Deploys to GitHub Pages at https://justinpearson.github.io/kidpix/
96
+
- Sets base URL to `/kidpix/` for GitHub Pages
97
+
98
+
2.**release.yml** (Active)
99
+
- Triggers: Tag push matching `v*` pattern
100
+
- Builds application for production
101
+
- Creates tarball of `dist/` directory
102
+
- Publishes GitHub Release with downloadable archive
103
+
- Usage: `git tag v1.0.0 && git push --tags`
104
+
105
+
3.**test.yml** (Currently disabled)
106
+
- Would run unit tests with coverage
107
+
- Would run Playwright E2E tests
108
+
- Upload test results and coverage to Codecov
109
+
110
+
4.**deploy.yml** (Currently disabled)
111
+
- Alternative deployment workflow
112
+
- Runs tests before deploying
113
+
114
+
5.**docs.yml** (Superseded by build-and-deploy-all.yml)
115
+
- Previously built docs separately
116
+
117
+
### Release Process
118
+
119
+
To create a new release:
120
+
121
+
```bash
122
+
# Using npm version command (increments package.json version)
123
+
yarn release:patch # v1.0.0 -> v1.0.1
124
+
yarn release:minor # v1.0.0 -> v1.1.0
125
+
yarn release:major # v1.0.0 -> v2.0.0
126
+
127
+
# Or manually create and push a tag
128
+
git tag v1.0.0
129
+
git push origin --tags
130
+
```
131
+
132
+
The release workflow automatically:
133
+
- Builds the application
134
+
- Creates a tarball (e.g., `kidpix-v1.0.0.tar.gz`)
135
+
- Publishes a GitHub Release with the tarball
136
+
- Users can download and run locally with `python -m http.server`
- Both builds include app + docs (MkDocs output in `docs/` subdirectory)
169
+
170
+
### Testing
81
171
82
172
```bash
83
-
yarn lint
84
-
# Runs ESLint (currently only on TypeScript files, needs update for JS files)
173
+
yarn test# Run unit tests once
174
+
yarn test:unit # Run unit tests in watch mode
175
+
yarn test:coverage # Run unit tests with coverage report
176
+
yarn test:e2e # Run Playwright end-to-end tests (headless)
177
+
yarn test:e2e:headed # Run Playwright tests with visible browser
85
178
```
86
179
180
+
### Documentation
181
+
182
+
```bash
183
+
yarn dev-docs # Start MkDocs dev server at http://127.0.0.1:8000/
184
+
```
185
+
186
+
**Documentation Notes:**
187
+
- Docs are built as part of `yarn build` (no separate docs:build command)
188
+
- MkDocs outputs to `dist/docs/` and `dist-gh/docs/`
189
+
87
190
### Preview Built App
88
191
89
192
```bash
90
-
yarn preview
91
-
# Preview the built application locally
193
+
yarn preview-release # Preview local build at http://localhost:8080/ (dist/)
194
+
yarn preview-github-pages # Preview GitHub Pages build at http://localhost:8080/kidpix/ (dist-gh/)
195
+
```
196
+
197
+
**Preview Notes:**
198
+
- Uses Python's built-in HTTP server (`python3 -m http.server`)
199
+
- Must run `yarn build` first to generate the build directories
200
+
201
+
### Utilities
202
+
203
+
```bash
204
+
yarn screenshot # Capture screenshots of the app (uses scripts/screenshot-capture.js)
92
205
```
93
206
207
+
**Note:** There is no `type-check` script in this project
208
+
94
209
## Claude Code Development Workflow
95
210
96
211
### Browser Error Monitoring Setup
97
212
98
-
To facilitate development with Claude Code, this project is configured with `vite-plugin-terminal` to display browser runtime errors directly in the Vite dev server terminal; this makes browser console errors visible to Claude Code when it runs `yarn dev` in its own sub-shell.
213
+
To facilitate development with Claude Code, this project is configured with `vite-plugin-terminal` to display browser runtime errors directly in the Vite dev server terminal; this makes browser console errors visible to Claude Code when it runs `yarn dev-app` in its own sub-shell.
99
214
100
-
-**NOTE FOR CLAUDE CODE**: If claude code is running the local dev server in a sub-shell (ie, `yarn dev`), claude code should remember to frequently check its stdout / stderr for browser console errors, and compare the errors' timestamps with the current time to ensure it doesn't get confused by reading old errors.
215
+
-**NOTE FOR CLAUDE CODE**: If claude code is running the local dev server in a sub-shell (ie, `yarn dev-app`), claude code should remember to frequently check its stdout / stderr for browser console errors, and compare the errors' timestamps with the current time to ensure it doesn't get confused by reading old errors.
101
216
102
217
#### Setup Details
103
218
@@ -109,7 +224,7 @@ To facilitate development with Claude Code, this project is configured with `vit
109
224
110
225
#### Usage for Claude Code
111
226
112
-
1.**Start Development Server**: Claude Code runs `yarn dev` in background bash shell
227
+
1.**Start Development Server**: Claude Code runs `yarn dev-app` in background bash shell
113
228
2.**Error Monitoring**: Runtime errors appear in terminal with full stack traces
114
229
3.**Real-time Debugging**: Errors visible immediately as user interacts with browser
115
230
4.**Error Format**: Shows file location, line numbers, complete stack traces, and timestamps
@@ -145,7 +260,7 @@ Example error output:
145
260
146
261
#### Version Compatibility
147
262
148
-
⚠️ **Important**: We use Vite 6.3.5 (not the latest 7.x) for security reasons and plugin compatibility. The `vite-plugin-terminal` has [known compatibility issues](https://github.com/patak-dev/vite-plugin-terminal/issues/34) with Vite 7.x. If you need Vite 7.x, consider implementing a custom error monitoring solution.
263
+
⚠️ **Important**: We use Vite 6.x (currently 6.4.1, not the latest 7.x) for security reasons and plugin compatibility. The `vite-plugin-terminal` has [known compatibility issues](https://github.com/patak-dev/vite-plugin-terminal/issues/34) with Vite 7.x. If you need Vite 7.x, consider implementing a custom error monitoring solution.
149
264
150
265
#### Workflow Benefits
151
266
@@ -223,17 +338,18 @@ KiddoPaint.Tools.Toolbox.ToolName = function () {
223
338
224
339
## Feature Development Workflow
225
340
226
-
1. Read feature requests from `prompts-TODO/` directory (newest first)
341
+
1. Read feature requests from `prompts-TODO/` directory (check `current.txt`first, then others)
227
342
2. Create a new git branch for the feature
228
-
3. Implement using JavaScript best practices in the modular structure
229
-
4. Ensure no build or lint errors before committing
230
-
5. Use conventional commit format
231
-
6. Push branch and create PR via GitHub CLI (`gh pr create`)
232
-
7. Verify CI passes on GitHub, make & push any needed corrections
233
-
8.**BEFORE MERGING**: Move feature request file from `prompts-TODO/` to `prompts-DONE/` using `git mv`
234
-
9. Commit and push the moved feature request file to the PR
235
-
10. Merge PR and delete branch
236
-
11. Locally: `git fetch origin/main` and fast-forward local main branch
343
+
3.**First commit**: Add the feature request file to git (if not already tracked)
344
+
4. Implement using JavaScript best practices in the modular structure
345
+
5. Make logical, incremental commits following conventional commit format
346
+
6. Run tests locally (`yarn test`) before pushing
347
+
7. Push branch and create PR via GitHub CLI (`gh pr create`)
348
+
8. Verify CI passes on GitHub, make & push any needed corrections
349
+
9.**BEFORE MERGING**: Move feature request file from `prompts-TODO/` to `prompts-DONE/` using `git mv`
350
+
10. Commit and push the moved feature request file to the PR
351
+
11. Merge PR and delete branch via GitHub UI
352
+
12. Locally: `git checkout main && git pull origin main` to sync with remote
237
353
238
354
## Key Development Patterns
239
355
@@ -260,17 +376,27 @@ KiddoPaint.Tools.Toolbox.ToolName = function () {
260
376
261
377
## Testing Strategy
262
378
263
-
Testing framework is configured but not yet adapted for JavaScript files:
379
+
### Current Test Setup
264
380
265
-
- Vitest and Playwright are set up but configured for TypeScript
266
-
- Need to adapt testing for JavaScript files in `js/` directory
267
-
- Focus on utility functions first (most testable)
268
-
- Consider integration tests for tool interactions
269
-
- Test canvas rendering functionality
381
+
-**Unit Tests**: Vitest 3.2.3 configured for both JavaScript and TypeScript files
382
+
- Test files: `**/*.{test,spec}.{js,ts,tsx}` and `**/js/**/*.{test,spec}.js`
383
+
- Environment: jsdom for DOM testing
384
+
- Setup file: `src/test-setup.ts`
385
+
- Coverage provider: v8
386
+
- Coverage output: text, json, html formats
387
+
388
+
-**E2E Tests**: Playwright 1.52.0 configured
389
+
- Test files in `tests/e2e/`
390
+
- Excluded from Vitest coverage
391
+
- Multiple browser support (Chromium, Firefox, WebKit)
392
+
393
+
-**Coverage Scope**:
394
+
- Includes: `js/**/*.js` and `src/**/*.{js,ts,tsx}`
395
+
- Excludes: config files, test files, node_modules, coverage, dist, site
270
396
271
397
### Coverage Thresholds (TODO: Increase as tests are added)
272
398
273
-
**Current Status (2025-06-17)**: Very low coverage thresholds set to allow CI to pass:
399
+
**Current Status (as of June 2025)**: Very low coverage thresholds set to allow CI to pass:
274
400
275
401
- Lines: 1% (currently 1.76%)
276
402
- Functions: 10% (currently 14.96%)
@@ -279,15 +405,45 @@ Testing framework is configured but not yet adapted for JavaScript files:
⚠️ **IMPORTANT**: These thresholds should be gradually increased as we add more comprehensive tests to the JavaScript codebase. See `vitest.config.ts` for current configuration.
408
+
⚠️ **IMPORTANT**: These thresholds should be gradually increased as we add more comprehensive tests to the JavaScript codebase. See [vitest.config.ts](vitest.config.ts:30-35) for current configuration.
409
+
410
+
### Test Development Priorities
411
+
412
+
1. Utility functions in `js/util/` (most testable, already has some tests)
0 commit comments