gl-life-claude-zen 1.0.2 → 1.3.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 +213 -0
- package/README.md +165 -0
- package/dist/hooks/auto-format.js +1 -1
- package/dist/hooks/complete-task.js +1 -1
- package/dist/hooks/enforce-migration-workflow.js +1 -1
- package/dist/hooks/enforce-structured-development.js +1 -1
- package/dist/hooks/enforce-test-pyramid.js +1 -1
- package/dist/hooks/init-task-tracker.js +1 -1
- package/dist/hooks/start-task.js +1 -1
- package/dist/hooks/task-status.js +1 -1
- package/dist/hooks/validate-database-changes.js +1 -1
- package/dist/hooks/validate-e2e-coverage.js +1 -1
- package/dist/hooks/validate-git-workflow.js +1 -1
- package/dist/hooks/validate-integration-site.js +2 -0
- package/dist/hooks/validate-migration-impact.js +1 -1
- package/dist/hooks/validate-task-completion.js +1 -1
- package/dist/hooks/validate-test-quality.js +1 -1
- package/dist/hooks/validate-test-results.js +1 -1
- package/dist/hooks/validate-ui-integration.js +1 -1
- package/dist/scripts/help.js +1 -1
- package/dist/scripts/plan-amend.js +1 -1
- package/dist/scripts/plan-create.js +1 -1
- package/dist/scripts/plan-help.js +1 -1
- package/dist/scripts/plan-init.js +1 -1
- package/dist/scripts/plan-manager.js +1 -1
- package/dist/scripts/setup-git-hooks.js +1 -1
- package/dist/scripts/task-done.js +1 -1
- package/dist/scripts/task-merge.js +1 -1
- package/dist/scripts/task-next.js +1 -1
- package/dist/scripts/task-start.js +1 -1
- package/dist/scripts/task-status.js +1 -1
- package/lib/init.js +9 -1
- package/package.json +6 -2
- package/templates/.claude/CLAUDE.md +196 -0
- package/templates/.claude/settings.json +40 -0
- package/templates/test-site/README.md +271 -0
- package/templates/test-site/index.html +13 -0
- package/templates/test-site/package.json +25 -0
- package/templates/test-site/server.js +125 -0
- package/templates/test-site/src/App.css +130 -0
- package/templates/test-site/src/App.jsx +78 -0
- package/templates/test-site/src/index.css +39 -0
- package/templates/test-site/src/main.jsx +10 -0
- package/templates/test-site/vite.config.js +12 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var
|
|
2
|
+
var _0x3d1491=_0x3575;(function(_0x5694cf,_0x33deff){var _0x2d5289=_0x3575,_0xb6a7a8=_0x5694cf();while(!![]){try{var _0x4b1b7e=-parseInt(_0x2d5289(0x104))/0x1+-parseInt(_0x2d5289(0xf3))/0x2*(parseInt(_0x2d5289(0x10c))/0x3)+-parseInt(_0x2d5289(0x107))/0x4*(-parseInt(_0x2d5289(0xfd))/0x5)+-parseInt(_0x2d5289(0x10a))/0x6*(-parseInt(_0x2d5289(0xfa))/0x7)+-parseInt(_0x2d5289(0xf1))/0x8+parseInt(_0x2d5289(0x101))/0x9+-parseInt(_0x2d5289(0x106))/0xa;if(_0x4b1b7e===_0x33deff)break;else _0xb6a7a8['push'](_0xb6a7a8['shift']());}catch(_0x518176){_0xb6a7a8['push'](_0xb6a7a8['shift']());}}}(_0x404a,0xe4847));var _0x2a5e29=(function(){var _0x30d501=_0x3575,_0x20eb3d={};_0x20eb3d[_0x30d501(0x10b)]=function(_0x3c8745,_0x57c887){return _0x3c8745!==_0x57c887;},_0x20eb3d[_0x30d501(0x105)]='gTCie';var _0x56d046=_0x20eb3d,_0x57891f=!![];return function(_0x45ec00,_0x2e4557){var _0x38abca=_0x30d501,_0x340ddf={'Fvjkv':function(_0x5968ac,_0x5b771d){return _0x56d046['rvkZI'](_0x5968ac,_0x5b771d);},'dqofS':_0x56d046[_0x38abca(0x105)]},_0x3f5cb6=_0x57891f?function(){var _0x39b8bc=_0x38abca;if(_0x2e4557){if(_0x340ddf[_0x39b8bc(0x102)](_0x340ddf[_0x39b8bc(0xee)],'INMpb')){var _0x2d4b52=_0x2e4557['apply'](_0x45ec00,arguments);return _0x2e4557=null,_0x2d4b52;}else{if(_0x4bf3b9){var _0x4625eb=_0x5d0d70[_0x39b8bc(0xff)](_0x39827f,arguments);return _0x57fc23=null,_0x4625eb;}}}}:function(){};return _0x57891f=![],_0x3f5cb6;};}()),_0x23caf9=_0x2a5e29(this,function(){var _0x5da6d9=_0x3575,_0x171dfc={};_0x171dfc[_0x5da6d9(0xf6)]='(((.+)+)+)+$';var _0x4f061d=_0x171dfc;return _0x23caf9['toString']()[_0x5da6d9(0x10f)](_0x4f061d[_0x5da6d9(0xf6)])[_0x5da6d9(0x111)]()[_0x5da6d9(0xfb)](_0x23caf9)[_0x5da6d9(0x10f)](_0x4f061d[_0x5da6d9(0xf6)]);});_0x23caf9();function _0x3575(_0x342b98,_0x1cadb6){_0x342b98=_0x342b98-0xee;var _0x280cd6=_0x404a();var _0x23caf9=_0x280cd6[_0x342b98];return _0x23caf9;}var o=(_0x51933b=>typeof require<'u'?require:typeof Proxy<'u'?new Proxy(_0x51933b,{'get':(_0x2636cb,_0x3637cc)=>(typeof require<'u'?require:_0x2636cb)[_0x3637cc]}):_0x51933b)(function(_0xbb9880){var _0x337ac2=_0x3575,_0x5589cf={};_0x5589cf[_0x337ac2(0x109)]=function(_0x496482,_0x271109){return _0x496482<_0x271109;},_0x5589cf[_0x337ac2(0xf7)]=function(_0x5bc693,_0xd87295){return _0x5bc693+_0xd87295;},_0x5589cf['yZpSO']=_0x337ac2(0xfe),_0x5589cf[_0x337ac2(0xf8)]=_0x337ac2(0xef);var _0x2de1e5=_0x5589cf;if(_0x2de1e5['nIWya'](typeof require,'u'))return require['apply'](this,arguments);throw Error(_0x2de1e5['gEyGZ'](_0x2de1e5['yZpSO']+_0xbb9880,_0x2de1e5[_0x337ac2(0xf8)]));}),{execSync:r}=o(_0x3d1491(0x10d)),n=o(_0x3d1491(0xf9)),a=n[_0x3d1491(0x103)](__dirname,'..',_0x3d1491(0x110),_0x3d1491(0xf4),_0x3d1491(0xf5));function _0x404a(){var _0x2eb80b=['1833375ZlspJX','nKwLm','687650DkvppO','1679276kJECkn','\x0a❌\x20Failed\x20to\x20get\x20task\x20status','nIWya','5742PzGvvA','rvkZI','9TcUKcS','child_process','stdio','search','.claude','toString','node\x20\x22','dqofS','\x22\x20is\x20not\x20supported','error','2423728QjoVuH','log','273794XmDnnt','hooks','task-status.js','HRjQi','gEyGZ','tHQIu','path','9856rPnlMk','constructor','inherit','20JkylJk','Dynamic\x20require\x20of\x20\x22','apply','exit','4725648YAPuvO','Fvjkv','join'];_0x404a=function(){return _0x2eb80b;};return _0x404a();}console[_0x3d1491(0xf2)]('📊\x20Task\x20Status\x20Report\x0a');try{var _0xf6c3db={};_0xf6c3db[_0x3d1491(0x10e)]=_0x3d1491(0xfc),r(_0x3d1491(0x112)+a+'\x22',_0xf6c3db);}catch{console[_0x3d1491(0xf0)](_0x3d1491(0x108)),process[_0x3d1491(0x100)](0x1);}
|
package/lib/init.js
CHANGED
|
@@ -54,12 +54,20 @@ export async function initializeProject(projectName, targetDir, options = {}) {
|
|
|
54
54
|
writeFileSync(join(targetDir, 'README.md'), readme);
|
|
55
55
|
|
|
56
56
|
// Copy .gitignore
|
|
57
|
-
console.log('
|
|
57
|
+
console.log(' ├─ .gitignore');
|
|
58
58
|
cpSync(
|
|
59
59
|
join(templatesDir, '.gitignore'),
|
|
60
60
|
join(targetDir, '.gitignore')
|
|
61
61
|
);
|
|
62
62
|
|
|
63
|
+
// Copy test-site template
|
|
64
|
+
console.log(' └─ test-site/');
|
|
65
|
+
cpSync(
|
|
66
|
+
join(templatesDir, 'test-site'),
|
|
67
|
+
join(targetDir, 'test-site'),
|
|
68
|
+
{ recursive: true }
|
|
69
|
+
);
|
|
70
|
+
|
|
63
71
|
console.log('✅ Framework structure created');
|
|
64
72
|
console.log('✅ Templates copied');
|
|
65
73
|
console.log('✅ Configuration files generated');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gl-life-claude-zen",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "NPM package for initializing projects with Claude Code enforcement framework",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
"scripts": {
|
|
11
11
|
"build": "node esbuild.config.js",
|
|
12
12
|
"test": "node test/bundle-protection.test.js && node test/integration.test.js",
|
|
13
|
+
"test:e2e": "node test/e2e-verification.test.js",
|
|
14
|
+
"test:site": "node test/verify-test-site.js",
|
|
13
15
|
"prepublishOnly": "npm run build"
|
|
14
16
|
},
|
|
15
17
|
"keywords": [
|
|
@@ -35,7 +37,9 @@
|
|
|
35
37
|
"node": ">=18.0.0"
|
|
36
38
|
},
|
|
37
39
|
"devDependencies": {
|
|
40
|
+
"@playwright/test": "^1.57.0",
|
|
38
41
|
"esbuild": "^0.20.0",
|
|
39
|
-
"javascript-obfuscator": "^5.1.0"
|
|
42
|
+
"javascript-obfuscator": "^5.1.0",
|
|
43
|
+
"playwright": "^1.57.0"
|
|
40
44
|
}
|
|
41
45
|
}
|
|
@@ -105,6 +105,202 @@ When modifying UI components (.tsx, .jsx, .vue, .svelte):
|
|
|
105
105
|
- Test MUST validate state changes if component has state
|
|
106
106
|
- E2E tests REQUIRED for multi-component user flows
|
|
107
107
|
|
|
108
|
+
## Integration Test Website (Hard Enforced)
|
|
109
|
+
|
|
110
|
+
UI components MUST be integrated into a test website for stakeholder validation before production deployment.
|
|
111
|
+
|
|
112
|
+
### Purpose
|
|
113
|
+
Integration test websites allow stakeholders to:
|
|
114
|
+
- Preview UI components in realistic scenarios
|
|
115
|
+
- Interact with components using actual data
|
|
116
|
+
- Validate behavior and design before production
|
|
117
|
+
- Test responsiveness across devices
|
|
118
|
+
- Approve UX flows and visual design
|
|
119
|
+
|
|
120
|
+
### Requirements
|
|
121
|
+
When modifying UI components (.tsx, .jsx, .vue, .svelte):
|
|
122
|
+
1. **Test site directory MUST exist** at `./test-site/` (or configured path)
|
|
123
|
+
2. **Test site MUST have package.json** with dev script
|
|
124
|
+
3. **Component SHOULD be imported** in test site for validation
|
|
125
|
+
4. Test site should run locally with hot reload
|
|
126
|
+
|
|
127
|
+
### Workflow
|
|
128
|
+
|
|
129
|
+
#### 1. Initial Setup (One-Time)
|
|
130
|
+
```bash
|
|
131
|
+
# Test site is included in project template
|
|
132
|
+
cd test-site
|
|
133
|
+
npm install
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
#### 2. Add Components to Test Site
|
|
137
|
+
Edit `test-site/src/App.jsx` to import and render your component:
|
|
138
|
+
|
|
139
|
+
```jsx
|
|
140
|
+
// Import your component
|
|
141
|
+
import { Button } from '../Agent/src/components/Button'
|
|
142
|
+
|
|
143
|
+
function App() {
|
|
144
|
+
return (
|
|
145
|
+
<section className="demo-section">
|
|
146
|
+
<h2>Button Component</h2>
|
|
147
|
+
<p>Validation: Click handlers, variants, disabled state</p>
|
|
148
|
+
<Button onClick={() => alert('Clicked!')} variant="primary">
|
|
149
|
+
Primary Button
|
|
150
|
+
</Button>
|
|
151
|
+
<Button variant="secondary">Secondary</Button>
|
|
152
|
+
<Button disabled>Disabled</Button>
|
|
153
|
+
</section>
|
|
154
|
+
)
|
|
155
|
+
}
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
#### 3. Run Test Site Locally
|
|
159
|
+
```bash
|
|
160
|
+
cd test-site
|
|
161
|
+
npm run dev
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
Opens at http://localhost:3000 with hot reload.
|
|
165
|
+
|
|
166
|
+
#### 4. Share with Stakeholders
|
|
167
|
+
|
|
168
|
+
**Option A: Deploy to GitHub Pages**
|
|
169
|
+
```bash
|
|
170
|
+
cd test-site
|
|
171
|
+
npm run deploy
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
Share URL: `https://username.github.io/repo-name/`
|
|
175
|
+
|
|
176
|
+
**Option B: Local Network**
|
|
177
|
+
Run `npm run dev` and share your local IP:
|
|
178
|
+
```
|
|
179
|
+
http://192.168.1.XXX:3000
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
**Option C: Tunneling (ngrok)**
|
|
183
|
+
```bash
|
|
184
|
+
npx ngrok http 3000
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
Share the generated public URL.
|
|
188
|
+
|
|
189
|
+
#### 5. Collect Feedback
|
|
190
|
+
- Schedule live demo sessions
|
|
191
|
+
- Record video walkthroughs
|
|
192
|
+
- Use GitHub Issues for feedback
|
|
193
|
+
- Create approval checklists
|
|
194
|
+
|
|
195
|
+
### Best Practices
|
|
196
|
+
|
|
197
|
+
**Use Realistic Data**
|
|
198
|
+
```jsx
|
|
199
|
+
// Good: Realistic data stakeholders recognize
|
|
200
|
+
<UserCard name="John Smith" email="john@company.com" role="Manager" />
|
|
201
|
+
|
|
202
|
+
// Bad: Placeholder text
|
|
203
|
+
<UserCard name="Test User" email="test@test.com" role="User" />
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
**Show Multiple States**
|
|
207
|
+
```jsx
|
|
208
|
+
<Button variant="primary">Primary</Button>
|
|
209
|
+
<Button variant="secondary">Secondary</Button>
|
|
210
|
+
<Button disabled>Disabled</Button>
|
|
211
|
+
<Button loading>Loading...</Button>
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
**Test Edge Cases**
|
|
215
|
+
```jsx
|
|
216
|
+
<UserName name="Really Long Name That Might Wrap To Multiple Lines" />
|
|
217
|
+
<UserName name="" /> {/* Empty state */}
|
|
218
|
+
<ErrorMessage>Network connection lost. Please try again.</ErrorMessage>
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
**Group by Feature**
|
|
222
|
+
```jsx
|
|
223
|
+
<section className="checkout-flow">
|
|
224
|
+
<h2>Checkout Flow</h2>
|
|
225
|
+
<p>Validation: Cart → Shipping → Payment → Confirmation</p>
|
|
226
|
+
<ShoppingCart />
|
|
227
|
+
<ShippingForm />
|
|
228
|
+
<PaymentForm />
|
|
229
|
+
</section>
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
**Add Annotations**
|
|
233
|
+
```jsx
|
|
234
|
+
<div className="demo-section">
|
|
235
|
+
<h2>Login Form</h2>
|
|
236
|
+
<p><strong>Validation Points:</strong></p>
|
|
237
|
+
<ul>
|
|
238
|
+
<li>Email validation works correctly</li>
|
|
239
|
+
<li>Password toggle shows/hides password</li>
|
|
240
|
+
<li>Error messages display properly</li>
|
|
241
|
+
<li>Submit button disables during API call</li>
|
|
242
|
+
</ul>
|
|
243
|
+
<LoginForm />
|
|
244
|
+
</div>
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
### Configuration
|
|
248
|
+
|
|
249
|
+
Test site requirement can be disabled in `.claude/settings.json`:
|
|
250
|
+
```json
|
|
251
|
+
{
|
|
252
|
+
"testing": {
|
|
253
|
+
"ui": {
|
|
254
|
+
"requireIntegrationSite": false
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
Or configure custom directory:
|
|
261
|
+
```json
|
|
262
|
+
{
|
|
263
|
+
"testing": {
|
|
264
|
+
"ui": {
|
|
265
|
+
"integrationSiteDir": "demo-site"
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
### Troubleshooting
|
|
272
|
+
|
|
273
|
+
**Components Not Found**
|
|
274
|
+
- Check import path relative to `test-site/src/`
|
|
275
|
+
- Verify components are exported properly
|
|
276
|
+
- Ensure file extensions match (.jsx, .tsx)
|
|
277
|
+
|
|
278
|
+
**Styles Not Working**
|
|
279
|
+
- Import component CSS alongside components
|
|
280
|
+
- Configure Tailwind/styled-components if used
|
|
281
|
+
- Check CSS module naming conventions
|
|
282
|
+
|
|
283
|
+
**Hot Reload Issues**
|
|
284
|
+
- Save files to trigger reload
|
|
285
|
+
- Check terminal for build errors
|
|
286
|
+
- Restart dev server: `Ctrl+C` then `npm run dev`
|
|
287
|
+
|
|
288
|
+
**Deployment Fails**
|
|
289
|
+
- Ensure GitHub Pages enabled in repo settings
|
|
290
|
+
- Check `gh-pages` branch exists
|
|
291
|
+
- Verify base path in `vite.config.js`
|
|
292
|
+
|
|
293
|
+
### Framework Support
|
|
294
|
+
|
|
295
|
+
**React (Default)**
|
|
296
|
+
Template uses Vite + React with hot reload.
|
|
297
|
+
|
|
298
|
+
**Vue**
|
|
299
|
+
See `test-site/README.md` for Vue migration guide.
|
|
300
|
+
|
|
301
|
+
**Svelte**
|
|
302
|
+
See `test-site/README.md` for Svelte migration guide.
|
|
303
|
+
|
|
108
304
|
## Database Migration Requirements (Hard Enforced)
|
|
109
305
|
Database changes MUST follow migration workflow:
|
|
110
306
|
- WRITE migration files in `./Agent/migrations/` or `./Agent/prisma/migrations/`
|
|
@@ -74,6 +74,26 @@
|
|
|
74
74
|
"CLAUDE_CODE_MAX_OUTPUT_TOKENS": "8192",
|
|
75
75
|
"DISABLE_NON_ESSENTIAL_MODEL_CALLS": "1"
|
|
76
76
|
},
|
|
77
|
+
"testing": {
|
|
78
|
+
"ui": {
|
|
79
|
+
"strictMode": true,
|
|
80
|
+
"requireTestFile": true,
|
|
81
|
+
"requireImport": true,
|
|
82
|
+
"requireRender": true,
|
|
83
|
+
"requireProps": true,
|
|
84
|
+
"requireEventTests": true,
|
|
85
|
+
"requireApiMocking": true,
|
|
86
|
+
"requireStateTests": true,
|
|
87
|
+
"requireFormTests": true,
|
|
88
|
+
"requireConditionalTests": true,
|
|
89
|
+
"requireIntegrationSite": true,
|
|
90
|
+
"integrationSiteDir": "test-site",
|
|
91
|
+
"conditionalThreshold": 3,
|
|
92
|
+
"requireVisualCheck": true,
|
|
93
|
+
"requireContract": false,
|
|
94
|
+
"comment": "⚠️ ALL UI testing requirements are HARD REQUIREMENTS (cannot be disabled). Commits will be blocked if any requirement is violated."
|
|
95
|
+
}
|
|
96
|
+
},
|
|
77
97
|
"hooks": {
|
|
78
98
|
"SessionStart": [
|
|
79
99
|
{
|
|
@@ -113,6 +133,22 @@
|
|
|
113
133
|
"type": "command",
|
|
114
134
|
"command": "node node_modules/.gl-life-claude/hooks/auto-format.js"
|
|
115
135
|
},
|
|
136
|
+
{
|
|
137
|
+
"type": "command",
|
|
138
|
+
"command": "node node_modules/.gl-life-claude/hooks/validate-ui-syntax.js"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"type": "command",
|
|
142
|
+
"command": "node node_modules/.gl-life-claude/hooks/validate-ui-runtime.js"
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"type": "command",
|
|
146
|
+
"command": "node node_modules/.gl-life-claude/hooks/validate-ui-visual.js"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"type": "command",
|
|
150
|
+
"command": "node node_modules/.gl-life-claude/hooks/validate-component-contract.js"
|
|
151
|
+
},
|
|
116
152
|
{
|
|
117
153
|
"type": "command",
|
|
118
154
|
"command": "node node_modules/.gl-life-claude/hooks/validate-test-quality.js"
|
|
@@ -121,6 +157,10 @@
|
|
|
121
157
|
"type": "command",
|
|
122
158
|
"command": "node node_modules/.gl-life-claude/hooks/validate-ui-integration.js"
|
|
123
159
|
},
|
|
160
|
+
{
|
|
161
|
+
"type": "command",
|
|
162
|
+
"command": "node node_modules/.gl-life-claude/hooks/validate-integration-site.js"
|
|
163
|
+
},
|
|
124
164
|
{
|
|
125
165
|
"type": "command",
|
|
126
166
|
"command": "node node_modules/.gl-life-claude/hooks/validate-database-changes.js"
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
# Integration Test Website
|
|
2
|
+
|
|
3
|
+
A lightweight, hot-reloading test site for stakeholder validation of UI components before production deployment.
|
|
4
|
+
|
|
5
|
+
## Purpose
|
|
6
|
+
|
|
7
|
+
This test site allows stakeholders to:
|
|
8
|
+
- Preview UI components in isolation
|
|
9
|
+
- Interact with components using realistic data
|
|
10
|
+
- Validate behavior before production deployment
|
|
11
|
+
- Test responsiveness across devices
|
|
12
|
+
- Approve visual design and UX flows
|
|
13
|
+
|
|
14
|
+
## Quick Start
|
|
15
|
+
|
|
16
|
+
### 1. Install Dependencies
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
cd test-site
|
|
20
|
+
npm install
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### 2. Run Development Server
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm run dev
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
The server will automatically allocate a port (default: 3000-3009 range) and display the URL.
|
|
30
|
+
|
|
31
|
+
**Port Management Features:**
|
|
32
|
+
- **Fixed Port Allocation**: Uses port 3000 by default, with automatic fallback to 3001-3009 if occupied
|
|
33
|
+
- **Auto-Cleanup**: Automatically kills stale processes on the assigned port before starting
|
|
34
|
+
- **Port Reuse**: Consistently uses the same port for a stable development experience
|
|
35
|
+
- **Conflict Resolution**: Automatically finds an available port if the preferred port is in use
|
|
36
|
+
|
|
37
|
+
Open the displayed URL (typically [http://localhost:3000](http://localhost:3000)) to view the test site.
|
|
38
|
+
|
|
39
|
+
### 3. Add Your Components
|
|
40
|
+
|
|
41
|
+
Edit `src/App.jsx` to import and render your components:
|
|
42
|
+
|
|
43
|
+
```jsx
|
|
44
|
+
// Import your component
|
|
45
|
+
import { Button } from '../Agent/src/components/Button'
|
|
46
|
+
|
|
47
|
+
function App() {
|
|
48
|
+
return (
|
|
49
|
+
<div className="demo-section">
|
|
50
|
+
<h2>Button Component Demo</h2>
|
|
51
|
+
<Button onClick={() => alert('Clicked!')}>
|
|
52
|
+
Click Me
|
|
53
|
+
</Button>
|
|
54
|
+
</div>
|
|
55
|
+
)
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Available Scripts
|
|
60
|
+
|
|
61
|
+
### `npm run dev`
|
|
62
|
+
Starts the development server with:
|
|
63
|
+
- **Port management**: Auto-allocates port from 3000-3009 range
|
|
64
|
+
- **Hot reload**: Instant updates when you save files
|
|
65
|
+
- **Auto-cleanup**: Kills stale processes before starting
|
|
66
|
+
- **Graceful shutdown**: Releases port on Ctrl+C
|
|
67
|
+
|
|
68
|
+
### `npm run dev:simple`
|
|
69
|
+
Starts Vite server without port management (uses default Vite behavior).
|
|
70
|
+
|
|
71
|
+
### `npm run build`
|
|
72
|
+
Builds the site for production to the `dist/` folder.
|
|
73
|
+
|
|
74
|
+
### `npm run preview`
|
|
75
|
+
Preview the production build locally before deploying.
|
|
76
|
+
|
|
77
|
+
### `npm run deploy`
|
|
78
|
+
Builds and deploys the site to GitHub Pages.
|
|
79
|
+
|
|
80
|
+
## Deployment to GitHub Pages
|
|
81
|
+
|
|
82
|
+
### First-time Setup
|
|
83
|
+
|
|
84
|
+
1. Create a GitHub repository for your project (if not already done)
|
|
85
|
+
2. Enable GitHub Pages in repository settings:
|
|
86
|
+
- Go to Settings → Pages
|
|
87
|
+
- Source: Deploy from a branch
|
|
88
|
+
- Branch: Select `gh-pages` branch
|
|
89
|
+
- Click Save
|
|
90
|
+
|
|
91
|
+
### Deploy Updates
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
npm run deploy
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
This will build the site and push it to the `gh-pages` branch automatically.
|
|
98
|
+
|
|
99
|
+
Your test site will be available at:
|
|
100
|
+
```
|
|
101
|
+
https://<your-username>.github.io/<repo-name>/
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## Sharing with Stakeholders
|
|
105
|
+
|
|
106
|
+
### Option 1: GitHub Pages (Recommended)
|
|
107
|
+
Deploy to GitHub Pages and share the URL. Updates are instant when you run `npm run deploy`.
|
|
108
|
+
|
|
109
|
+
### Option 2: Local Network
|
|
110
|
+
Run `npm run dev` and share your local IP address (find with `ipconfig` on Windows or `ifconfig` on Mac/Linux):
|
|
111
|
+
```
|
|
112
|
+
http://192.168.1.XXX:3000
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Option 3: Tunneling Service
|
|
116
|
+
Use a service like ngrok to create a public URL for your local server:
|
|
117
|
+
```bash
|
|
118
|
+
npx ngrok http 3000
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## Framework Support
|
|
122
|
+
|
|
123
|
+
### React (Default)
|
|
124
|
+
The template uses Vite + React with hot reload. No additional setup needed.
|
|
125
|
+
|
|
126
|
+
### Vue
|
|
127
|
+
To use Vue instead of React:
|
|
128
|
+
|
|
129
|
+
1. Replace dependencies in `package.json`:
|
|
130
|
+
```json
|
|
131
|
+
{
|
|
132
|
+
"dependencies": {
|
|
133
|
+
"vue": "^3.3.4"
|
|
134
|
+
},
|
|
135
|
+
"devDependencies": {
|
|
136
|
+
"@vitejs/plugin-vue": "^4.5.0",
|
|
137
|
+
"vite": "^5.0.8"
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
2. Update `vite.config.js`:
|
|
143
|
+
```js
|
|
144
|
+
import { defineConfig } from 'vite'
|
|
145
|
+
import vue from '@vitejs/plugin-vue'
|
|
146
|
+
|
|
147
|
+
export default defineConfig({
|
|
148
|
+
plugins: [vue()],
|
|
149
|
+
// ...rest of config
|
|
150
|
+
})
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
3. Rename `src/main.jsx` → `src/main.js` and update content:
|
|
154
|
+
```js
|
|
155
|
+
import { createApp } from 'vue'
|
|
156
|
+
import App from './App.vue'
|
|
157
|
+
import './index.css'
|
|
158
|
+
|
|
159
|
+
createApp(App).mount('#app')
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### Svelte
|
|
163
|
+
To use Svelte:
|
|
164
|
+
|
|
165
|
+
1. Replace dependencies in `package.json`:
|
|
166
|
+
```json
|
|
167
|
+
{
|
|
168
|
+
"devDependencies": {
|
|
169
|
+
"@sveltejs/vite-plugin-svelte": "^3.0.0",
|
|
170
|
+
"svelte": "^4.2.8",
|
|
171
|
+
"vite": "^5.0.8"
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
2. Update `vite.config.js`:
|
|
177
|
+
```js
|
|
178
|
+
import { defineConfig } from 'vite'
|
|
179
|
+
import { svelte } from '@sveltejs/vite-plugin-svelte'
|
|
180
|
+
|
|
181
|
+
export default defineConfig({
|
|
182
|
+
plugins: [svelte()],
|
|
183
|
+
// ...rest of config
|
|
184
|
+
})
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
3. Rename files to `.svelte` and update imports.
|
|
188
|
+
|
|
189
|
+
## Best Practices
|
|
190
|
+
|
|
191
|
+
### 1. Use Realistic Data
|
|
192
|
+
Don't use placeholder text. Use realistic data that stakeholders will recognize:
|
|
193
|
+
```jsx
|
|
194
|
+
<UserCard
|
|
195
|
+
name="John Smith"
|
|
196
|
+
email="john.smith@company.com"
|
|
197
|
+
role="Product Manager"
|
|
198
|
+
/>
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### 2. Show Multiple States
|
|
202
|
+
Demonstrate different component states:
|
|
203
|
+
```jsx
|
|
204
|
+
<Button variant="primary">Primary</Button>
|
|
205
|
+
<Button variant="secondary">Secondary</Button>
|
|
206
|
+
<Button disabled>Disabled</Button>
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
### 3. Test Edge Cases
|
|
210
|
+
Show how components handle edge cases:
|
|
211
|
+
```jsx
|
|
212
|
+
<UserName name="Really Long Name That Might Wrap" />
|
|
213
|
+
<UserName name="" /> {/* Empty state */}
|
|
214
|
+
<ErrorMessage>Something went wrong!</ErrorMessage>
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
### 4. Group by Feature
|
|
218
|
+
Organize components by feature or user flow:
|
|
219
|
+
```jsx
|
|
220
|
+
<section className="login-flow">
|
|
221
|
+
<h2>Login Flow</h2>
|
|
222
|
+
<LoginForm />
|
|
223
|
+
<ForgotPassword />
|
|
224
|
+
<SignUpLink />
|
|
225
|
+
</section>
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
### 5. Add Annotations
|
|
229
|
+
Explain what stakeholders should validate:
|
|
230
|
+
```jsx
|
|
231
|
+
<div className="demo-section">
|
|
232
|
+
<h2>Shopping Cart</h2>
|
|
233
|
+
<p><strong>Validation Points:</strong></p>
|
|
234
|
+
<ul>
|
|
235
|
+
<li>Items can be added/removed</li>
|
|
236
|
+
<li>Quantity updates recalculate total</li>
|
|
237
|
+
<li>Discount codes apply correctly</li>
|
|
238
|
+
</ul>
|
|
239
|
+
<ShoppingCart items={mockCartItems} />
|
|
240
|
+
</div>
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
## Troubleshooting
|
|
244
|
+
|
|
245
|
+
### Components Not Found
|
|
246
|
+
If your components can't be imported:
|
|
247
|
+
- Check the import path is correct relative to `test-site/src/`
|
|
248
|
+
- Ensure components are exported properly
|
|
249
|
+
- Verify file extensions match (.jsx, .tsx, etc.)
|
|
250
|
+
|
|
251
|
+
### Styles Not Working
|
|
252
|
+
- Import component CSS files alongside components
|
|
253
|
+
- Check that Tailwind/styled-components are configured if used
|
|
254
|
+
- Verify CSS module naming conventions
|
|
255
|
+
|
|
256
|
+
### Hot Reload Issues
|
|
257
|
+
- Save files to trigger reload
|
|
258
|
+
- Check terminal for build errors
|
|
259
|
+
- Restart dev server: `Ctrl+C` then `npm run dev`
|
|
260
|
+
|
|
261
|
+
## Tips for Stakeholder Review
|
|
262
|
+
|
|
263
|
+
1. **Schedule a live demo session** - Walk through components together
|
|
264
|
+
2. **Record a video** - Show interactions and flows
|
|
265
|
+
3. **Create a checklist** - What needs approval on each component
|
|
266
|
+
4. **Collect feedback** - Add a feedback form or use GitHub Issues
|
|
267
|
+
5. **Version deployments** - Use git tags to track approved versions
|
|
268
|
+
|
|
269
|
+
## License
|
|
270
|
+
|
|
271
|
+
This template is part of the gl-life-claude-zen package and follows the same license as the parent project.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<title>Integration Test Site - Component Preview</title>
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
<div id="root"></div>
|
|
11
|
+
<script type="module" src="/src/main.jsx"></script>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "integration-test-site",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"description": "Integration test website for stakeholder validation of UI components",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"dev": "node server.js",
|
|
9
|
+
"dev:simple": "vite",
|
|
10
|
+
"build": "vite build",
|
|
11
|
+
"preview": "vite preview",
|
|
12
|
+
"deploy": "npm run build && npx gh-pages -d dist"
|
|
13
|
+
},
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"react": "^18.2.0",
|
|
16
|
+
"react-dom": "^18.2.0"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"@types/react": "^18.2.43",
|
|
20
|
+
"@types/react-dom": "^18.2.17",
|
|
21
|
+
"@vitejs/plugin-react": "^4.2.1",
|
|
22
|
+
"gh-pages": "^6.1.1",
|
|
23
|
+
"vite": "^5.0.8"
|
|
24
|
+
}
|
|
25
|
+
}
|