Skip to content

Commit 3f02ee1

Browse files
Init docs lib simulation with inline commenting and module build
0 parents  commit 3f02ee1

27 files changed

Lines changed: 3889 additions & 0 deletions
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Build and Release
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
build-and-release:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
18+
- name: Populate design system submodule
19+
run: git submodule update --init
20+
21+
- name: Setup Node.js
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: '22.13.1'
25+
cache: 'npm'
26+
27+
- name: Install all dependencies
28+
run: npm ci
29+
30+
- name: Build project
31+
run: npm run build
32+
33+
- name: Install production dependencies only
34+
run: |
35+
npm ci --production
36+
37+
- name: Create release tarball
38+
run: |
39+
tar -czf release.tar.gz dist/ package.json server.js node_modules/
40+
41+
- name: Upload build artifact (for workflow logs)
42+
uses: actions/upload-artifact@v4
43+
with:
44+
name: dist
45+
path: dist
46+
47+
- name: Create GitHub Release and upload asset
48+
uses: ncipollo/release-action@v1
49+
with:
50+
token: ${{ secrets.GITHUB_TOKEN }}
51+
tag: v${{ github.run_number }}
52+
name: Release ${{ github.run_number }}
53+
body: |
54+
Latest build from main branch.
55+
artifacts: release.tar.gz
56+
allowUpdates: false
57+
draft: false
58+
prerelease: false
59+
makeLatest: true

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
dist
3+
module

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "client/design-system"]
2+
path = client/design-system
3+
url = https://github.com/CodeSignal/learn_bespoke-design-system.git

AGENTS.md

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
# Repository Guidelines
2+
3+
This repository contains a template for building embedded applications using
4+
the Bespoke Simulation framework. For complete template documentation, see
5+
[BESPOKE-TEMPLATE.md](./BESPOKE-TEMPLATE.md).
6+
7+
## Overview
8+
9+
This template provides:
10+
- CodeSignal Design System integration
11+
- Consistent layout components (header, sidebar, main content area)
12+
- Help modal system
13+
- Local development server with WebSocket support
14+
- Standardized file structure and naming conventions
15+
16+
## Quick Start
17+
18+
1. **Customize the HTML template** (`client/index.html`):
19+
- Replace `<!-- APP_TITLE -->` with your page title
20+
- Replace `<!-- APP_NAME -->` with your app name
21+
- Add your main content at `<!-- APP_SPECIFIC_MAIN_CONTENT -->`
22+
- Add app-specific CSS links at `<!-- APP_SPECIFIC_CSS -->`
23+
- Add app-specific JavaScript at `<!-- APP_SPECIFIC_SCRIPTS -->`
24+
25+
2. **Create your application files**:
26+
- App-specific CSS (e.g., `my-app.css`)
27+
- App-specific JavaScript (e.g., `my-app.js`)
28+
- Help content (based on `help-content-template.html`)
29+
30+
3. **Start the development server**:
31+
```bash
32+
npm start
33+
```
34+
Server runs on `http://localhost:3000`
35+
36+
## Key Conventions
37+
38+
### File Naming
39+
40+
- CSS files: kebab-case (e.g., `my-app.css`)
41+
- JavaScript files: kebab-case (e.g., `my-app.js`)
42+
- Data files: kebab-case (e.g., `solution.json`)
43+
- Image files: kebab-case (e.g., `overview.png`)
44+
45+
### Error Handling
46+
47+
- Wrap all async operations in try-catch blocks
48+
- Provide meaningful error messages to users
49+
- Log errors to console for debugging
50+
- Implement retry logic for network operations
51+
- Handle localStorage quota exceeded errors
52+
- Validate data before saving operations
53+
54+
## Development Workflow
55+
56+
### Build and Test
57+
58+
```bash
59+
# Start development server
60+
npm start
61+
62+
# Development mode (same as start)
63+
npm run dev
64+
```
65+
66+
### WebSocket Messaging
67+
68+
The server provides a `POST /message` endpoint for real-time messaging:
69+
70+
```bash
71+
curl -X POST http://localhost:3000/message \
72+
-H "Content-Type: application/json" \
73+
-d '{"message": "Your message here"}'
74+
```
75+
76+
This sends alerts to connected clients. Requires `ws` package:
77+
```bash
78+
npm install
79+
```
80+
81+
## Template Documentation
82+
83+
For detailed information about:
84+
- Design System usage and components
85+
- CSS implementation guidelines
86+
- JavaScript API (HelpModal)
87+
- Component reference and examples
88+
- Customization options
89+
90+
See [BESPOKE-TEMPLATE.md](./BESPOKE-TEMPLATE.md).
91+
92+
## Project Structure
93+
94+
```
95+
client/
96+
├── index.html # Main HTML template
97+
├── app.js # Application logic
98+
├── bespoke-template.css # Template-specific styles
99+
├── help-modal.js # Help modal system
100+
├── help-content-template.html # Help content template
101+
└── design-system/ # CodeSignal Design System
102+
├── colors/
103+
├── spacing/
104+
├── typography/
105+
└── components/
106+
server.js # Development server
107+
```
108+
109+
## Notes for AI Agents
110+
111+
When working on applications built with this template:
112+
113+
1. **Always reference BESPOKE-TEMPLATE.md** for template-specific
114+
implementation details
115+
2. **Follow the conventions** listed above for file naming
116+
3. **Use Design System components** directly - see BESPOKE-TEMPLATE.md for
117+
component classes and usage
118+
4. **Maintain consistency** with the template's structure and patterns
119+
5. **Keep guidelines up to date** by editing this AGENTS.md file as the codebase evolves

0 commit comments

Comments
 (0)