pulse-js-framework 1.7.11 → 1.7.13
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/README.md +80 -8
- package/cli/docs.js +712 -0
- package/cli/doctor.js +702 -0
- package/cli/index.js +338 -65
- package/cli/scaffold.js +1037 -0
- package/cli/test.js +455 -0
- package/package.json +19 -2
- package/runtime/a11y.js +824 -1
- package/runtime/context.js +374 -0
- package/runtime/graphql.js +1356 -0
- package/runtime/index.js +6 -0
- package/runtime/logger.js +2 -1
- package/runtime/websocket.js +874 -0
- package/types/context.d.ts +171 -0
- package/types/graphql.d.ts +490 -0
- package/types/index.d.ts +15 -0
- package/types/websocket.d.ts +347 -0
package/README.md
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
# Pulse Framework
|
|
2
2
|
|
|
3
3
|
[](https://github.com/vincenthirtz/pulse-js-framework/actions/workflows/ci.yml)
|
|
4
|
+
[](https://codecov.io/gh/vincenthirtz/pulse-js-framework)
|
|
4
5
|
[](https://app.netlify.com/projects/pulse-js/deploys)
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
No build. No dependencies. Just JavaScript.
|
|
7
8
|
|
|
8
9
|
## Features
|
|
9
10
|
|
|
@@ -37,6 +38,15 @@ npm install
|
|
|
37
38
|
npm run dev
|
|
38
39
|
```
|
|
39
40
|
|
|
41
|
+
### Or with TypeScript
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
npx pulse-js-framework create my-app --typescript
|
|
45
|
+
cd my-app
|
|
46
|
+
npm install
|
|
47
|
+
npm run dev
|
|
48
|
+
```
|
|
49
|
+
|
|
40
50
|
### Or use directly
|
|
41
51
|
|
|
42
52
|
```javascript
|
|
@@ -125,13 +135,43 @@ See [Pulse DSL documentation](docs/pulse-dsl.md) for full syntax reference.
|
|
|
125
135
|
## CLI Commands
|
|
126
136
|
|
|
127
137
|
```bash
|
|
128
|
-
|
|
129
|
-
pulse
|
|
130
|
-
pulse
|
|
131
|
-
pulse
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
pulse
|
|
138
|
+
# Project Creation
|
|
139
|
+
pulse create <name> # Create new project
|
|
140
|
+
pulse create <name> --typescript # Create TypeScript project
|
|
141
|
+
pulse init --typescript # Initialize in current directory
|
|
142
|
+
|
|
143
|
+
# Development
|
|
144
|
+
pulse dev [port] # Start dev server (default: 3000)
|
|
145
|
+
pulse build # Build for production
|
|
146
|
+
pulse preview [port] # Preview production build
|
|
147
|
+
pulse compile <file> # Compile .pulse file
|
|
148
|
+
|
|
149
|
+
# Code Quality
|
|
150
|
+
pulse lint [files] # Validate .pulse files
|
|
151
|
+
pulse format [files] # Format .pulse files
|
|
152
|
+
pulse analyze # Analyze bundle
|
|
153
|
+
|
|
154
|
+
# Testing
|
|
155
|
+
pulse test # Run tests with Node.js test runner
|
|
156
|
+
pulse test --coverage # Run tests with coverage
|
|
157
|
+
pulse test --watch # Watch mode
|
|
158
|
+
pulse test --create <name> # Generate test file
|
|
159
|
+
|
|
160
|
+
# Project Tools
|
|
161
|
+
pulse doctor # Run project diagnostics
|
|
162
|
+
pulse doctor --verbose # Detailed diagnostics
|
|
163
|
+
|
|
164
|
+
# Scaffolding
|
|
165
|
+
pulse scaffold component <name> # Generate component
|
|
166
|
+
pulse scaffold page <name> # Generate page
|
|
167
|
+
pulse scaffold store <name> # Generate store module
|
|
168
|
+
pulse scaffold hook <name> # Generate custom hook
|
|
169
|
+
pulse scaffold service <name> # Generate API service
|
|
170
|
+
|
|
171
|
+
# Documentation
|
|
172
|
+
pulse docs --generate # Generate API docs (Markdown)
|
|
173
|
+
pulse docs --generate -f html # Generate HTML docs
|
|
174
|
+
pulse docs --generate -f json # Generate JSON docs
|
|
135
175
|
```
|
|
136
176
|
|
|
137
177
|
See [CLI documentation](docs/cli.md) for full command reference.
|
|
@@ -187,6 +227,38 @@ const { data, loading } = useAsync(() => fetch('/api/users').then(r => r.json())
|
|
|
187
227
|
const users = useResource('users', fetchUsers, { refreshInterval: 30000 });
|
|
188
228
|
```
|
|
189
229
|
|
|
230
|
+
### Accessibility
|
|
231
|
+
|
|
232
|
+
```javascript
|
|
233
|
+
import {
|
|
234
|
+
// Announcements
|
|
235
|
+
announce, createAnnouncementQueue,
|
|
236
|
+
// Focus management
|
|
237
|
+
trapFocus, onEscapeKey, createFocusVisibleTracker,
|
|
238
|
+
// User preferences
|
|
239
|
+
prefersReducedMotion, prefersReducedTransparency, forcedColorsMode,
|
|
240
|
+
// ARIA widgets
|
|
241
|
+
createModal, createTooltip, createAccordion, createMenu,
|
|
242
|
+
// Color contrast
|
|
243
|
+
getContrastRatio, meetsContrastRequirement,
|
|
244
|
+
// Validation
|
|
245
|
+
validateA11y
|
|
246
|
+
} from 'pulse-js-framework/runtime/a11y';
|
|
247
|
+
|
|
248
|
+
// Screen reader announcements
|
|
249
|
+
announce('Item saved successfully');
|
|
250
|
+
|
|
251
|
+
// Accessible modal dialog
|
|
252
|
+
const modal = createModal(dialog, { labelledBy: 'title', closeOnBackdropClick: true });
|
|
253
|
+
modal.open();
|
|
254
|
+
|
|
255
|
+
// Check color contrast (WCAG)
|
|
256
|
+
const ratio = getContrastRatio('#333', '#fff'); // 12.63
|
|
257
|
+
meetsContrastRequirement(ratio, 'AA'); // true
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
See [Accessibility documentation](docs/accessibility.md) for full guide.
|
|
261
|
+
|
|
190
262
|
See [API documentation](docs/api.md) for full reference.
|
|
191
263
|
|
|
192
264
|
## Mobile Apps
|