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
This release includes monorepo architecture, comprehensive documentation
infrastructure, CI automation, and pre-release governance tooling.
See RELEASE-v0.0.2.md for detailed changelog.
This repository is a JavaScript/TypeScript monorepo for front.js. Keep changes small, security-minded, and aligned with the size budget of the core runtime.
4
+
5
+
## Project Structure & Module Organization
6
+
-`packages/core/src/` — core runtime; public API re-exported via `packages/core/src/index.js`.
- Branch names: `feat/<slug>`, `fix/<slug>`, `chore/<slug>`, etc., as in existing history.
37
+
- PRs should describe motivation, testing performed (`npm test`, `npm run validate`, `npm run size-check -w @frontjs/core`), and link issues. Include screenshots/GIFs for UI-affecting changes in `website/` or examples.
38
+
- Keep diffs minimal; update docs (`docs/`, `website/docs/`) and types when APIs change.
Copy file name to clipboardExpand all lines: CLAUDE.md
+37-6Lines changed: 37 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
9
9
## Key Commands
10
10
11
11
### Development
12
+
12
13
```bash
13
14
npm install # Install dependencies
14
15
npm test# Run all tests with Vitest
@@ -20,11 +21,36 @@ npm run lint # Lint code with ESLint
20
21
```
21
22
22
23
### Running Examples
24
+
23
25
```bash
24
26
npx serve .
25
27
# Navigate to http://localhost:3000/examples/index.html
26
28
```
27
29
30
+
### Website Build Scripts (Optional)
31
+
32
+
The framework itself has **zero build step**, but the website uses optional build scripts for progressive enhancement:
33
+
34
+
```bash
35
+
npm run navbar:generate # Generate server-rendered navbar HTML
36
+
npm run navbar:validate # Validate navbar islands match config
37
+
npm run docs:api # Generate API documentation from JSDoc
38
+
```
39
+
40
+
**NavBar Generation**: Keeps server-rendered HTML in sync with props across all pages.
41
+
42
+
-**Config**: `website/navbar-config.json` defines links for each page
43
+
-**How it works**: Reads `NavBar.server.js` renderer → generates HTML → updates HTML files in-place
44
+
-**Philosophy**: Generated HTML is committed to git (site works without building)
45
+
-**When to use**: After editing navbar links or adding new pages with navbar
46
+
47
+
To update navbar links:
48
+
1. Edit `website/navbar-config.json`
49
+
2. Run `npm run navbar:generate`
50
+
3. Commit the updated HTML files
51
+
52
+
**Why this works**: The framework ships as ES modules (no build). The website build is OPTIONAL and only for SEO/performance optimization (pre-rendering). This follows the same pattern as `generate-initial-doc.js` for docs.
53
+
28
54
## Architecture Overview
29
55
30
56
### Core Principles (see wiki/STANDARDS.md)
@@ -69,11 +95,13 @@ src/
69
95
### Hydration System (src/core/client.js)
70
96
71
97
**Component Registration**:
98
+
72
99
```javascript
73
-
register(name, componentFn)// name must match /^[a-zA-Z0-9_-]+$/
100
+
register(name, componentFn);// name must match /^[a-zA-Z0-9_-]+$/
74
101
```
75
102
76
103
**Hydration Algorithm**:
104
+
77
105
1. Query all `[data-island]` elements
78
106
2. For each island:
79
107
- Extract `data-component` name and validate (alphanumeric only)
@@ -88,6 +116,7 @@ register(name, componentFn) // name must match /^[a-zA-Z0-9_-]+$/
88
116
### Component Model (src/core/component.js)
89
117
90
118
Components are higher-order functions:
119
+
91
120
```javascript
92
121
functionMyComponent(props) {
93
122
// Setup phase: create values, calculated values
@@ -101,6 +130,7 @@ function MyComponent(props) {
101
130
`defineComponent(renderFn, container)` wraps the render function in a run that auto-reruns on value changes, passing the template to uhtml's render function for efficient DOM diffing.
102
131
103
132
**Lifecycle Cleanup**: Components can use runs with cleanup functions for side effects:
0 commit comments