jsgui3-server 0.0.148 → 0.0.150
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/.github/agents/Mobile Developer.agent.md +89 -0
- package/.github/workflows/control-scan-manifest-check.yml +31 -0
- package/AGENTS.md +4 -0
- package/README.md +215 -3
- package/admin-ui/client.js +81 -51
- package/admin-ui/v1/admin_auth_service.js +197 -0
- package/admin-ui/v1/admin_user_store.js +71 -0
- package/admin-ui/v1/client.js +17 -0
- package/admin-ui/v1/controls/admin_shell.js +1399 -0
- package/admin-ui/v1/controls/group_box.js +84 -0
- package/admin-ui/v1/controls/stat_card.js +125 -0
- package/admin-ui/v1/server.js +658 -0
- package/admin-ui/v1/utils/formatters.js +68 -0
- package/dev-status.svg +139 -0
- package/docs/admin-extension-guide.md +345 -0
- package/docs/api-reference.md +301 -43
- package/docs/books/adaptive-control-improvements/01-control-candidate-matrix.md +122 -0
- package/docs/books/adaptive-control-improvements/02-tier-1-layout-playbooks.md +207 -0
- package/docs/books/adaptive-control-improvements/03-tier-2-navigation-form-overlay.md +140 -0
- package/docs/books/adaptive-control-improvements/04-cross-cutting-platform-functionality.md +141 -0
- package/docs/books/adaptive-control-improvements/05-styling-theming-density-upgrades.md +114 -0
- package/docs/books/adaptive-control-improvements/06-testing-quality-gates.md +97 -0
- package/docs/books/adaptive-control-improvements/07-delivery-roadmap-and-ownership.md +137 -0
- package/docs/books/adaptive-control-improvements/08-appendix-tier1-acceptance-and-pr-templates.md +261 -0
- package/docs/books/adaptive-control-improvements/README.md +66 -0
- package/docs/books/admin-ui-authentication/01-threat-model-and-goals.md +124 -0
- package/docs/books/admin-ui-authentication/02-session-model-and-token-model.md +75 -0
- package/docs/books/admin-ui-authentication/03-auth-middleware-patterns.md +77 -0
- package/docs/books/admin-ui-authentication/README.md +25 -0
- package/docs/books/creating-a-new-admin-ui/01-introduction-and-vision.md +130 -0
- package/docs/books/creating-a-new-admin-ui/02-architecture-and-data-flow.md +298 -0
- package/docs/books/creating-a-new-admin-ui/03-server-introspection.md +381 -0
- package/docs/books/creating-a-new-admin-ui/04-admin-module-adapter-layer.md +592 -0
- package/docs/books/creating-a-new-admin-ui/05-domain-controls-stat-cards-and-gauges.md +513 -0
- package/docs/books/creating-a-new-admin-ui/06-domain-controls-process-manager.md +544 -0
- package/docs/books/creating-a-new-admin-ui/07-domain-controls-resource-pool-inspector.md +493 -0
- package/docs/books/creating-a-new-admin-ui/08-domain-controls-route-table-and-api-explorer.md +586 -0
- package/docs/books/creating-a-new-admin-ui/09-domain-controls-log-viewer-and-activity-feed.md +490 -0
- package/docs/books/creating-a-new-admin-ui/10-domain-controls-build-status-and-bundle-inspector.md +526 -0
- package/docs/books/creating-a-new-admin-ui/11-domain-controls-configuration-panel.md +808 -0
- package/docs/books/creating-a-new-admin-ui/12-admin-shell-layout-sidebar-navigation.md +210 -0
- package/docs/books/creating-a-new-admin-ui/13-telemetry-integration.md +556 -0
- package/docs/books/creating-a-new-admin-ui/14-realtime-sse-observable-integration.md +485 -0
- package/docs/books/creating-a-new-admin-ui/15-styling-theming-aero-design-system.md +521 -0
- package/docs/books/creating-a-new-admin-ui/16-testing-and-quality-assurance.md +147 -0
- package/docs/books/creating-a-new-admin-ui/17-next-steps-process-resource-roadmap.md +356 -0
- package/docs/books/creating-a-new-admin-ui/README.md +68 -0
- package/docs/books/device-adaptive-composition/01-platform-feature-audit.md +177 -0
- package/docs/books/device-adaptive-composition/02-responsive-composition-model.md +187 -0
- package/docs/books/device-adaptive-composition/03-data-model-vs-view-model.md +231 -0
- package/docs/books/device-adaptive-composition/04-styling-theme-breakpoints.md +234 -0
- package/docs/books/device-adaptive-composition/05-showcase-app-multi-device-assessment.md +193 -0
- package/docs/books/device-adaptive-composition/06-implementation-patterns-and-apis.md +346 -0
- package/docs/books/device-adaptive-composition/07-testing-harness-and-quality-gates.md +265 -0
- package/docs/books/device-adaptive-composition/08-roadmap-and-adoption-plan.md +250 -0
- package/docs/books/device-adaptive-composition/README.md +47 -0
- package/docs/books/jsgui3-bundling-research-book/00-table-of-contents.md +35 -0
- package/docs/books/jsgui3-bundling-research-book/01-pipeline-and-runtime-semantics.md +34 -0
- package/docs/books/jsgui3-bundling-research-book/02-javascript-bundling-core.md +36 -0
- package/docs/books/jsgui3-bundling-research-book/03-style-extraction-and-css-compilation.md +35 -0
- package/docs/books/jsgui3-bundling-research-book/04-static-publishing-and-delivery.md +39 -0
- package/docs/books/jsgui3-bundling-research-book/05-current-limits-and-size-bloat-vectors.md +25 -0
- package/docs/books/jsgui3-bundling-research-book/06-unused-module-elimination-strategy.md +77 -0
- package/docs/books/jsgui3-bundling-research-book/07-jsgui3-html-control-and-mixin-pruning.md +63 -0
- package/docs/books/jsgui3-bundling-research-book/08-test-and-verification-methodology.md +43 -0
- package/docs/books/jsgui3-bundling-research-book/09-roadmap-and-rollout.md +42 -0
- package/docs/books/jsgui3-bundling-research-book/10-further-research-strategies-and-upgrades.md +211 -0
- package/docs/books/jsgui3-bundling-research-book/README.md +35 -0
- package/docs/bundling-system-deep-dive.md +9 -4
- package/docs/comparison-report-express-plex-cpanel.md +549 -0
- package/docs/comprehensive-documentation.md +49 -18
- package/docs/configuration-reference.md +152 -27
- package/docs/core/README.md +19 -0
- package/docs/core/jsgui3-server-core-book/00-table-of-contents.md +21 -0
- package/docs/core/jsgui3-server-core-book/01-startup-readiness-state-machine.md +41 -0
- package/docs/core/jsgui3-server-core-book/02-resource-abstraction-and-lifecycle.md +92 -0
- package/docs/core/jsgui3-server-core-book/03-resource-pool-and-event-topology.md +47 -0
- package/docs/core/jsgui3-server-core-book/04-sse-publisher-semantics.md +41 -0
- package/docs/core/jsgui3-server-core-book/05-serve-factory-resource-wiring.md +46 -0
- package/docs/core/jsgui3-server-core-book/06-e2e-testing-methodology.md +48 -0
- package/docs/core/jsgui3-server-core-book/07-defect-detection-and-hardening-loop.md +47 -0
- package/docs/designs/server-admin-interface-aero.svg +611 -0
- package/docs/publishers-guide.md +59 -4
- package/docs/resources-guide.md +184 -35
- package/docs/simple-server-api-design.md +72 -17
- package/docs/system-architecture.md +18 -14
- package/docs/troubleshooting.md +84 -53
- package/examples/controls/15) window, observable SSE/server.js +6 -1
- package/examples/controls/19) window, auto observable ui/server.js +9 -0
- package/examples/controls/20) window, task manager app/README.md +133 -0
- package/examples/controls/20) window, task manager app/client.js +797 -0
- package/examples/controls/20) window, task manager app/server.js +178 -0
- package/examples/controls/6) window, color_palette/client.js +165 -68
- package/examples/controls/9) window, date picker/client.js +362 -76
- package/examples/controls/9b) window, shared data.model mirrored date pickers/client.js +104 -83
- package/examples/jsgui3-html/06) theming/client.js +22 -1
- package/examples/jsgui3-html/10) binding-debugger/client.js +137 -1
- package/http/responders/static/Static_Route_HTTP_Responder.js +52 -34
- package/lab/experiments/capture-color-controls.js +196 -0
- package/lab/results/screenshots/color-controls/full_page.png +0 -0
- package/lab/results/screenshots/color-controls/section_1_color_grid_12x12.png +0 -0
- package/lab/results/screenshots/color-controls/section_2_color_grid_4x2.png +0 -0
- package/lab/results/screenshots/color-controls/section_3_color_palette.png +0 -0
- package/lab/results/screenshots/color-controls/section_4_palette_comparison.png +0 -0
- package/lab/results/screenshots/color-controls/section_5_raw_swatches.png +0 -0
- package/lab/results/screenshots/color-controls/section_6_optimized_crayola.png +0 -0
- package/lab/results/screenshots/color-controls/section_7_pastel_palette.png +0 -0
- package/lab/results/screenshots/color-controls/section_8_extended_144.png +0 -0
- package/lab/screenshot-utils.js +248 -0
- package/module.js +12 -0
- package/package.json +12 -2
- package/publishers/Publishers.js +4 -3
- package/publishers/helpers/assigners/static-compressed-response-buffers/Single_Control_Webpage_Server_Static_Compressed_Response_Buffers_Assigner.js +5 -5
- package/publishers/http-sse-publisher.js +341 -0
- package/resources/process-resource.js +950 -0
- package/resources/processors/bundlers/js/esbuild/Advanced_JS_Bundler_Using_ESBuild.js +129 -33
- package/resources/processors/bundlers/js/esbuild/Core_JS_Non_Minifying_Bundler_Using_ESBuild.js +18 -7
- package/resources/processors/bundlers/js/esbuild/JSGUI3_HTML_Control_Optimizer.js +829 -0
- package/resources/remote-process-resource.js +355 -0
- package/resources/server-resource-pool.js +354 -41
- package/serve-factory.js +442 -259
- package/server.js +288 -13
- package/tests/README.md +71 -4
- package/tests/admin-ui-jsgui-controls.test.js +581 -0
- package/tests/admin-ui-render.test.js +24 -0
- package/tests/assigners.test.js +56 -40
- package/tests/bundling-default-control-elimination.puppeteer.test.js +260 -0
- package/tests/configuration-validation.test.js +21 -18
- package/tests/content-analysis.test.js +7 -6
- package/tests/control-optimizer-cache-behavior.test.js +52 -0
- package/tests/control-scan-manifest-regression.test.js +144 -0
- package/tests/end-to-end.test.js +15 -14
- package/tests/error-handling.test.js +222 -179
- package/tests/fixtures/bundling-default-button-client.js +37 -0
- package/tests/fixtures/bundling-default-window-client.js +34 -0
- package/tests/fixtures/control_scan_manifest_expectations.json +48 -0
- package/tests/fixtures/resource-monitor-client.js +319 -0
- package/tests/helpers/puppeteer-e2e-harness.js +317 -0
- package/tests/http-sse-publisher.test.js +136 -0
- package/tests/performance.test.js +69 -65
- package/tests/process-resource.test.js +138 -0
- package/tests/publishers.test.js +7 -7
- package/tests/remote-process-resource.test.js +160 -0
- package/tests/sass-controls.e2e.test.js +7 -1
- package/tests/serve-resources.test.js +270 -0
- package/tests/serve.test.js +120 -50
- package/tests/server-resource-pool.test.js +106 -0
- package/tests/small-controls-bundle-size.test.js +252 -0
- package/tests/test-runner.js +14 -1
- package/tests/window-examples.puppeteer.test.js +204 -1
- package/tests/window-resource-integration.puppeteer.test.js +585 -0
- package/tests/temp_invalid.js +0 -7
- package/tests/temp_invalid_utf8.js +0 -1
- package/tests/temp_malformed.js +0 -10
package/docs/api-reference.md
CHANGED
|
@@ -32,13 +32,30 @@ Server.serve(options?: ServerOptions): Promise<Server>
|
|
|
32
32
|
- `DiscoveryError`: Cannot find client files or controls
|
|
33
33
|
- `BindingError`: Cannot bind to specified host/port
|
|
34
34
|
|
|
35
|
-
**Example:**
|
|
36
|
-
```javascript
|
|
37
|
-
const server = await Server.serve({
|
|
38
|
-
port: 3000,
|
|
39
|
-
ctrl: MyControl
|
|
40
|
-
|
|
41
|
-
|
|
35
|
+
**Example:**
|
|
36
|
+
```javascript
|
|
37
|
+
const server = await Server.serve({
|
|
38
|
+
port: 3000,
|
|
39
|
+
ctrl: MyControl,
|
|
40
|
+
resources: {
|
|
41
|
+
worker_direct: {
|
|
42
|
+
type: 'process',
|
|
43
|
+
command: process.execPath,
|
|
44
|
+
args: ['worker.js']
|
|
45
|
+
},
|
|
46
|
+
remote_worker: {
|
|
47
|
+
type: 'remote',
|
|
48
|
+
host: '127.0.0.1',
|
|
49
|
+
port: 3400
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
events: true
|
|
53
|
+
});
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
**Serve-specific options:**
|
|
57
|
+
- `resources`: Registers managed resources (in-process resource objects, local process resources, remote HTTP process resources).
|
|
58
|
+
- `events`: Enables built-in SSE publisher for resource lifecycle events (`/events` by default).
|
|
42
59
|
|
|
43
60
|
### Server Constructor
|
|
44
61
|
|
|
@@ -54,12 +71,27 @@ new Server(options?: ServerOptions)
|
|
|
54
71
|
|
|
55
72
|
**Returns:** Server instance
|
|
56
73
|
|
|
57
|
-
**Events:**
|
|
58
|
-
- `'ready'`: Emitted when bundling is complete
|
|
59
|
-
- `'started'`: Emitted when HTTP server is listening
|
|
60
|
-
- `'error'`: Emitted on server errors
|
|
61
|
-
|
|
62
|
-
|
|
74
|
+
**Events:**
|
|
75
|
+
- `'ready'`: Emitted when bundling is complete
|
|
76
|
+
- `'started'`: Emitted when HTTP server is listening
|
|
77
|
+
- `'error'`: Emitted on server errors
|
|
78
|
+
|
|
79
|
+
### Module Exports
|
|
80
|
+
|
|
81
|
+
```javascript
|
|
82
|
+
const jsgui = require('jsgui3-server');
|
|
83
|
+
|
|
84
|
+
// Top-level exports
|
|
85
|
+
jsgui.Process_Resource;
|
|
86
|
+
jsgui.Remote_Process_Resource;
|
|
87
|
+
jsgui.HTTP_SSE_Publisher;
|
|
88
|
+
|
|
89
|
+
// Resource namespace aliases
|
|
90
|
+
jsgui.Resource.Process;
|
|
91
|
+
jsgui.Resource.Remote_Process;
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Server Instance Methods
|
|
63
95
|
|
|
64
96
|
### server.start(port, callback)
|
|
65
97
|
|
|
@@ -74,7 +106,7 @@ server.start(port?: number, callback?: (err?: Error) => void): void
|
|
|
74
106
|
- `port` (number, optional): Port to listen on (default: 8080)
|
|
75
107
|
- `callback` (function, optional): Called when server starts or fails
|
|
76
108
|
|
|
77
|
-
### server.publish(route, handler)
|
|
109
|
+
### server.publish(route, handler)
|
|
78
110
|
|
|
79
111
|
Adds an API endpoint (legacy API).
|
|
80
112
|
|
|
@@ -83,13 +115,45 @@ Adds an API endpoint (legacy API).
|
|
|
83
115
|
server.publish(route: string, handler: Function): void
|
|
84
116
|
```
|
|
85
117
|
|
|
86
|
-
**Parameters:**
|
|
87
|
-
- `route` (string): Route path (automatically prefixed with `/api/`)
|
|
88
|
-
- `handler` (Function): Request handler function
|
|
89
|
-
|
|
90
|
-
### server.
|
|
91
|
-
|
|
92
|
-
Adds
|
|
118
|
+
**Parameters:**
|
|
119
|
+
- `route` (string): Route path (automatically prefixed with `/api/`)
|
|
120
|
+
- `handler` (Function): Request handler function
|
|
121
|
+
|
|
122
|
+
### server.publish_observable(route, observable, options)
|
|
123
|
+
|
|
124
|
+
Adds an observable-backed SSE endpoint.
|
|
125
|
+
|
|
126
|
+
**Signature:**
|
|
127
|
+
```javascript
|
|
128
|
+
server.publish_observable(route: string, observable: Observable, options?: object): HTTP_Observable_Publisher
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
**Parameters:**
|
|
132
|
+
- `route` (string): Route path. If it does not start with `/`, it is prefixed with `/api/`.
|
|
133
|
+
- `observable` (Observable): Source observable stream.
|
|
134
|
+
- `options` (object, optional): Publisher options.
|
|
135
|
+
|
|
136
|
+
**Returns:** `HTTP_Observable_Publisher` instance.
|
|
137
|
+
|
|
138
|
+
**Alias:** `server.publishObservable(route, observable, options)`
|
|
139
|
+
|
|
140
|
+
### server.close(callback)
|
|
141
|
+
|
|
142
|
+
Stops managed resources and closes all bound HTTP servers.
|
|
143
|
+
|
|
144
|
+
**Signature:**
|
|
145
|
+
```javascript
|
|
146
|
+
server.close(callback?: (err?: Error | null) => void): void
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
**Behavior:**
|
|
150
|
+
- Calls `resource_pool.stop()` when available
|
|
151
|
+
- Stops `sse_publisher` when present
|
|
152
|
+
- Closes all HTTP listeners
|
|
153
|
+
|
|
154
|
+
### server.use(middleware)
|
|
155
|
+
|
|
156
|
+
Adds middleware to the server.
|
|
93
157
|
|
|
94
158
|
**Signature:**
|
|
95
159
|
```javascript
|
|
@@ -443,7 +507,7 @@ Serves CSS files.
|
|
|
443
507
|
serve(request: IncomingMessage, response: ServerResponse): Promise<void>
|
|
444
508
|
```
|
|
445
509
|
|
|
446
|
-
### HTTP_API_Publisher
|
|
510
|
+
### HTTP_API_Publisher
|
|
447
511
|
|
|
448
512
|
Handles API endpoints.
|
|
449
513
|
|
|
@@ -461,13 +525,162 @@ new HTTP_API_Publisher(spec?: PublisherSpec)
|
|
|
461
525
|
Handles API requests.
|
|
462
526
|
|
|
463
527
|
**Signature:**
|
|
464
|
-
```javascript
|
|
465
|
-
serve(request: IncomingMessage, response: ServerResponse): Promise<void>
|
|
466
|
-
```
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
528
|
+
```javascript
|
|
529
|
+
serve(request: IncomingMessage, response: ServerResponse): Promise<void>
|
|
530
|
+
```
|
|
531
|
+
|
|
532
|
+
### HTTP_SSE_Publisher
|
|
533
|
+
|
|
534
|
+
General-purpose SSE publisher for explicit event fan-out.
|
|
535
|
+
|
|
536
|
+
**Extends:** `HTTP_Publisher`
|
|
537
|
+
|
|
538
|
+
**Constructor:**
|
|
539
|
+
```javascript
|
|
540
|
+
new HTTP_SSE_Publisher(spec?: {
|
|
541
|
+
name?: string,
|
|
542
|
+
keepaliveIntervalMs?: number,
|
|
543
|
+
maxClients?: number,
|
|
544
|
+
eventHistorySize?: number
|
|
545
|
+
})
|
|
546
|
+
```
|
|
547
|
+
|
|
548
|
+
**Methods:**
|
|
549
|
+
- `handle_http(req, res)`
|
|
550
|
+
- `broadcast(event_name, data_value)`
|
|
551
|
+
- `send(client_id, event_name, data_value)`
|
|
552
|
+
- `stop(callback?)`
|
|
553
|
+
|
|
554
|
+
**Properties:**
|
|
555
|
+
- `client_count` (number)
|
|
556
|
+
|
|
557
|
+
## Resource Classes
|
|
558
|
+
|
|
559
|
+
### Process_Resource
|
|
560
|
+
|
|
561
|
+
Represents a local process as a resource with a unified lifecycle API.
|
|
562
|
+
|
|
563
|
+
**Extends:** `Resource`
|
|
564
|
+
|
|
565
|
+
**Constructor:**
|
|
566
|
+
```javascript
|
|
567
|
+
new Process_Resource(spec?: {
|
|
568
|
+
name?: string,
|
|
569
|
+
command?: string,
|
|
570
|
+
args?: string[],
|
|
571
|
+
cwd?: string,
|
|
572
|
+
env?: object,
|
|
573
|
+
autoRestart?: boolean,
|
|
574
|
+
maxRestarts?: number,
|
|
575
|
+
processManager?: 'direct' | {
|
|
576
|
+
type: 'direct' | 'pm2',
|
|
577
|
+
pm2Path?: string,
|
|
578
|
+
ecosystem?: string
|
|
579
|
+
},
|
|
580
|
+
healthCheck?: {
|
|
581
|
+
type: 'http' | 'tcp' | 'custom',
|
|
582
|
+
url?: string,
|
|
583
|
+
host?: string,
|
|
584
|
+
port?: number,
|
|
585
|
+
fn?: Function,
|
|
586
|
+
intervalMs?: number,
|
|
587
|
+
timeoutMs?: number,
|
|
588
|
+
failuresBeforeUnhealthy?: number
|
|
589
|
+
}
|
|
590
|
+
})
|
|
591
|
+
```
|
|
592
|
+
|
|
593
|
+
**Core Methods:**
|
|
594
|
+
- `start(callback?)`
|
|
595
|
+
- `stop(callback?)`
|
|
596
|
+
- `restart(callback?)`
|
|
597
|
+
- `get_abstract()`
|
|
598
|
+
|
|
599
|
+
**Status:**
|
|
600
|
+
```javascript
|
|
601
|
+
{
|
|
602
|
+
state: 'stopped' | 'starting' | 'running' | 'stopping' | 'restarting' | 'crashed',
|
|
603
|
+
pid: number | null,
|
|
604
|
+
uptime: number,
|
|
605
|
+
restartCount: number,
|
|
606
|
+
lastHealthCheck: object | null,
|
|
607
|
+
memoryUsage: object | null,
|
|
608
|
+
processManager: { type: 'direct' | 'pm2' }
|
|
609
|
+
}
|
|
610
|
+
```
|
|
611
|
+
|
|
612
|
+
**Events:**
|
|
613
|
+
- `state_change`
|
|
614
|
+
- `stdout`
|
|
615
|
+
- `stderr`
|
|
616
|
+
- `exit`
|
|
617
|
+
- `health_check`
|
|
618
|
+
- `unhealthy`
|
|
619
|
+
- `crashed`
|
|
620
|
+
|
|
621
|
+
### Remote_Process_Resource
|
|
622
|
+
|
|
623
|
+
Represents a remote HTTP-controlled process using the same lifecycle-oriented API style as `Process_Resource`.
|
|
624
|
+
|
|
625
|
+
**Extends:** `Resource`
|
|
626
|
+
|
|
627
|
+
**Constructor:**
|
|
628
|
+
```javascript
|
|
629
|
+
new Remote_Process_Resource(spec?: {
|
|
630
|
+
name?: string,
|
|
631
|
+
host: string,
|
|
632
|
+
port: number,
|
|
633
|
+
protocol?: 'http' | 'https',
|
|
634
|
+
pollIntervalMs?: number,
|
|
635
|
+
httpTimeoutMs?: number,
|
|
636
|
+
historySize?: number,
|
|
637
|
+
unreachableFailuresBeforeEvent?: number,
|
|
638
|
+
endpoints?: {
|
|
639
|
+
status?: string,
|
|
640
|
+
start?: string,
|
|
641
|
+
stop?: string,
|
|
642
|
+
health?: string
|
|
643
|
+
}
|
|
644
|
+
})
|
|
645
|
+
```
|
|
646
|
+
|
|
647
|
+
**Core Methods:**
|
|
648
|
+
- `start(callback?)`
|
|
649
|
+
- `stop(callback?)`
|
|
650
|
+
- `restart(callback?)`
|
|
651
|
+
- `get_abstract()`
|
|
652
|
+
|
|
653
|
+
**Status:** Includes `state`, `pid`, `uptime`, `restartCount`, `lastHealthCheck`, `memoryUsage`, and `processManager: { type: 'remote' }`.
|
|
654
|
+
|
|
655
|
+
**Events:**
|
|
656
|
+
- `state_change`
|
|
657
|
+
- `unreachable`
|
|
658
|
+
- `recovered`
|
|
659
|
+
|
|
660
|
+
### Server_Resource_Pool
|
|
661
|
+
|
|
662
|
+
Server-specific resource pool with lifecycle orchestration and event forwarding.
|
|
663
|
+
|
|
664
|
+
**Extends:** `Resource_Pool`
|
|
665
|
+
|
|
666
|
+
**Methods:**
|
|
667
|
+
- `add(resource)`
|
|
668
|
+
- `remove(name, callback?)`
|
|
669
|
+
- `start(callback?)`
|
|
670
|
+
- `stop(callback?)`
|
|
671
|
+
- `get_resources_by_type(type)`
|
|
672
|
+
|
|
673
|
+
**Properties:**
|
|
674
|
+
- `summary`: Aggregated state summary grouped by resource type.
|
|
675
|
+
|
|
676
|
+
**Forwarded Events:**
|
|
677
|
+
- `resource_state_change`
|
|
678
|
+
- `crashed`
|
|
679
|
+
- `unhealthy`
|
|
680
|
+
- `unreachable`
|
|
681
|
+
- `recovered`
|
|
682
|
+
|
|
683
|
+
### File_System_Resource
|
|
471
684
|
|
|
472
685
|
Provides access to local file system.
|
|
473
686
|
|
|
@@ -699,10 +912,10 @@ ensure_route_leading_slash(route: string): string
|
|
|
699
912
|
### ServerOptions
|
|
700
913
|
|
|
701
914
|
```typescript
|
|
702
|
-
interface ServerOptions {
|
|
703
|
-
ctrl?: Function;
|
|
704
|
-
Ctrl?: Function;
|
|
705
|
-
src_path_client_js?: string;
|
|
915
|
+
interface ServerOptions {
|
|
916
|
+
ctrl?: Function;
|
|
917
|
+
Ctrl?: Function;
|
|
918
|
+
src_path_client_js?: string;
|
|
706
919
|
port?: number;
|
|
707
920
|
host?: string;
|
|
708
921
|
debug?: boolean;
|
|
@@ -715,15 +928,60 @@ interface ServerOptions {
|
|
|
715
928
|
api?: Record<string, Function>;
|
|
716
929
|
static?: Record<string, string>;
|
|
717
930
|
|
|
718
|
-
// Advanced options
|
|
719
|
-
cors?: CorsConfig;
|
|
720
|
-
https?: HttpsConfig;
|
|
721
|
-
middleware?: Function[];
|
|
722
|
-
publishers?: Record<string, Publisher>;
|
|
723
|
-
resources?:
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
931
|
+
// Advanced options
|
|
932
|
+
cors?: CorsConfig;
|
|
933
|
+
https?: HttpsConfig;
|
|
934
|
+
middleware?: Function[];
|
|
935
|
+
publishers?: Record<string, Publisher>;
|
|
936
|
+
resources?: ResourceEntries;
|
|
937
|
+
events?: boolean | EventsOptions;
|
|
938
|
+
bundler?: BundlerConfig;
|
|
939
|
+
}
|
|
940
|
+
```
|
|
941
|
+
|
|
942
|
+
```typescript
|
|
943
|
+
type ResourceEntries = Record<string, ResourceEntry> | ResourceEntry[];
|
|
944
|
+
|
|
945
|
+
type ResourceEntry =
|
|
946
|
+
| Resource
|
|
947
|
+
| {
|
|
948
|
+
type?: 'process' | 'local';
|
|
949
|
+
command?: string;
|
|
950
|
+
args?: string[];
|
|
951
|
+
processManager?: 'direct' | {
|
|
952
|
+
type?: 'direct' | 'pm2';
|
|
953
|
+
pm2Path?: string;
|
|
954
|
+
ecosystem?: string;
|
|
955
|
+
};
|
|
956
|
+
[key: string]: any;
|
|
957
|
+
}
|
|
958
|
+
| {
|
|
959
|
+
type?: 'remote' | 'http';
|
|
960
|
+
host?: string;
|
|
961
|
+
port?: number;
|
|
962
|
+
protocol?: 'http' | 'https';
|
|
963
|
+
endpoints?: Record<string, string>;
|
|
964
|
+
[key: string]: any;
|
|
965
|
+
}
|
|
966
|
+
| {
|
|
967
|
+
type?: 'resource' | 'in_process' | 'in-process';
|
|
968
|
+
instance?: Resource;
|
|
969
|
+
resource?: Resource;
|
|
970
|
+
class?: new (spec?: any) => Resource;
|
|
971
|
+
Ctor?: new (spec?: any) => Resource;
|
|
972
|
+
constructor_fn?: new (spec?: any) => Resource;
|
|
973
|
+
spec?: Record<string, any>;
|
|
974
|
+
[key: string]: any;
|
|
975
|
+
};
|
|
976
|
+
|
|
977
|
+
interface EventsOptions {
|
|
978
|
+
route?: string;
|
|
979
|
+
name?: string;
|
|
980
|
+
keepaliveIntervalMs?: number;
|
|
981
|
+
maxClients?: number;
|
|
982
|
+
eventHistorySize?: number;
|
|
983
|
+
}
|
|
984
|
+
```
|
|
727
985
|
|
|
728
986
|
### PageConfig
|
|
729
987
|
|
|
@@ -1029,4 +1287,4 @@ const server = await Server.serve({
|
|
|
1029
1287
|
|
|
1030
1288
|
---
|
|
1031
1289
|
|
|
1032
|
-
This API reference provides comprehensive technical documentation for JSGUI3 Server internals. For practical usage examples and tutorials, refer to the user-facing documentation.
|
|
1290
|
+
This API reference provides comprehensive technical documentation for JSGUI3 Server internals. For practical usage examples and tutorials, refer to the user-facing documentation.
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# Chapter 1 — Control Candidate Matrix and Findings
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Prioritize the control catalog for adaptive upgrades based on real impact:
|
|
6
|
+
|
|
7
|
+
- Structural risk on phone/tablet/orientation change
|
|
8
|
+
- Data density and interaction complexity
|
|
9
|
+
- Existing gap between desktop and touch behavior
|
|
10
|
+
- Reuse value as a pattern for other controls
|
|
11
|
+
|
|
12
|
+
## Evidence Snapshot
|
|
13
|
+
|
|
14
|
+
Recent source-level review identified these concrete issues in key controls:
|
|
15
|
+
|
|
16
|
+
- `master_detail.js`: fixed two-column grid (`minmax(180px, 240px) 1fr`) with no layout-mode branch.
|
|
17
|
+
- `tabbed-panel.js`: horizontal tab strip is vulnerable to overflow in narrow widths.
|
|
18
|
+
- `split_pane.js`: pointer-oriented resize interaction with no touch-first fallback.
|
|
19
|
+
- `data_table.js`: large data surface with no responsive column-priority/card transformation strategy.
|
|
20
|
+
- `sidebar_nav.js`: manual collapse exists, but no environment-driven auto-collapse/morph.
|
|
21
|
+
- `Toolbar.js`: no overflow strategy for narrow widths.
|
|
22
|
+
- `modal.js`: static size variants only; no automatic phone full-screen mode.
|
|
23
|
+
- `form_container.js`: no adaptive multi-column to single-column strategy.
|
|
24
|
+
- `status_dashboard.js`: strongest baseline due to grid auto-fit, but no explicit density/layout-mode policy.
|
|
25
|
+
|
|
26
|
+
## Tiering Criteria
|
|
27
|
+
|
|
28
|
+
### Impact score (1-5)
|
|
29
|
+
|
|
30
|
+
- 5: Breaks or heavily degrades on common phone/tablet layouts
|
|
31
|
+
- 4: Usable but substantially reduced usability on touch/narrow layouts
|
|
32
|
+
- 3: Mostly usable; quality or accessibility debt
|
|
33
|
+
- 2: Minor adaptive polish only
|
|
34
|
+
- 1: Already adaptive enough through existing composition/tokens
|
|
35
|
+
|
|
36
|
+
### Effort score (1-5)
|
|
37
|
+
|
|
38
|
+
- 5: Significant API and behavior changes across composition + interaction + tests
|
|
39
|
+
- 4: Medium-high code and test work
|
|
40
|
+
- 3: Moderate scoped update
|
|
41
|
+
- 2: Small targeted update
|
|
42
|
+
- 1: Minimal changes
|
|
43
|
+
|
|
44
|
+
## Candidate Matrix
|
|
45
|
+
|
|
46
|
+
| Control | Impact | Effort | Priority | Why now |
|
|
47
|
+
|---|---:|---:|---|---|
|
|
48
|
+
| Master_Detail | 5 | 3 | Tier 1 | Canonical two-pane pattern; immediate phone pain; good first pattern anchor |
|
|
49
|
+
| Tabbed_Panel | 5 | 4 | Tier 1 | High usage + overflow + keyboard/touch adaptation needs |
|
|
50
|
+
| Split_Pane | 5 | 4 | Tier 1 | Pointer-first behavior conflicts with touch/mobile |
|
|
51
|
+
| Data_Table | 5 | 5 | Tier 1 | Highest value for admin UIs; biggest adaptation gap |
|
|
52
|
+
| Sidebar_Nav | 4 | 3 | Tier 2 | Shell-level navigation needs auto morphing |
|
|
53
|
+
| Form_Container | 4 | 3 | Tier 2 | Forms must adapt cleanly across orientation and width |
|
|
54
|
+
| Modal | 4 | 2 | Tier 2 | Quick high-value upgrade for phone usability |
|
|
55
|
+
| Toolbar | 4 | 3 | Tier 2 | Navigation/action density requires overflow strategy |
|
|
56
|
+
| Window / Window_Manager | 3 | 4 | Tier 3 | Desktop metaphor must degrade predictably on touch |
|
|
57
|
+
| Wizard | 3 | 2 | Tier 3 | Stepper strip and nav controls need mobile pattern |
|
|
58
|
+
| Status_Dashboard | 2 | 2 | Tier 4 | Mostly good; needs explicit density/mode tuning |
|
|
59
|
+
| Drawer | 2 | 2 | Tier 4 | Good baseline; mostly environment integration and polish |
|
|
60
|
+
|
|
61
|
+
## Top Discoveries
|
|
62
|
+
|
|
63
|
+
### Discovery A — the highest-value pattern is the two-pane morph
|
|
64
|
+
|
|
65
|
+
`Master_Detail`, `Split_Pane`, and many app-level shells all need the same adaptive morph:
|
|
66
|
+
|
|
67
|
+
- Desktop: dual pane
|
|
68
|
+
- Tablet portrait: primary + secondary as revealable overlay
|
|
69
|
+
- Phone: stacked flow or drawer/sheet secondary
|
|
70
|
+
|
|
71
|
+
This should be implemented once as a reusable adaptive region pattern and reused.
|
|
72
|
+
|
|
73
|
+
### Discovery B — navigation controls need shared overflow/morph infrastructure
|
|
74
|
+
|
|
75
|
+
`Tabbed_Panel`, `Sidebar_Nav`, and `Toolbar` all face narrow-width overflow and touch navigation constraints.
|
|
76
|
+
|
|
77
|
+
Without shared helpers, each control will reinvent:
|
|
78
|
+
|
|
79
|
+
- overflow detection
|
|
80
|
+
- “more” bucket behavior
|
|
81
|
+
- focus order and ARIA preservation across morphs
|
|
82
|
+
|
|
83
|
+
### Discovery C — Data_Table is both a control and a mode family
|
|
84
|
+
|
|
85
|
+
Treat `Data_Table` as a multi-mode control family:
|
|
86
|
+
|
|
87
|
+
- Desktop mode: full grid
|
|
88
|
+
- Tablet mode: reduced columns + optional detail pane
|
|
89
|
+
- Phone mode: list/card mode with row expansion
|
|
90
|
+
|
|
91
|
+
Trying to keep a single static grid shape across all modes will keep mobile quality low.
|
|
92
|
+
|
|
93
|
+
## Layer Analysis (A/B/C/D)
|
|
94
|
+
|
|
95
|
+
Applying the four-layer model:
|
|
96
|
+
|
|
97
|
+
- Layer A (Domain): mostly unaffected; business data stays stable.
|
|
98
|
+
- Layer B (View Composition): major work in Tier 1 and Tier 2 controls.
|
|
99
|
+
- Layer C (Adaptive Resolution): requires consistent environment service usage.
|
|
100
|
+
- Layer D (Concrete Render): token/mode-attribute CSS work across most controls.
|
|
101
|
+
|
|
102
|
+
## Model Placement Rules for This Program
|
|
103
|
+
|
|
104
|
+
For all upgrades in this book:
|
|
105
|
+
|
|
106
|
+
- `data.model`: business entities, user-intent preferences that are device-agnostic.
|
|
107
|
+
- `view.data.model`: resolved adaptive state (layout_mode, visible_columns, region presentation state).
|
|
108
|
+
- `view.model`: transient interaction state (open/closed, active tab index, temporary scroll/focus state).
|
|
109
|
+
|
|
110
|
+
Never persist runtime viewport-derived values as domain data.
|
|
111
|
+
|
|
112
|
+
## Success Criteria for Candidate Selection
|
|
113
|
+
|
|
114
|
+
A control is ready for implementation when:
|
|
115
|
+
|
|
116
|
+
1. Target mode behavior is specified for phone, tablet, desktop.
|
|
117
|
+
2. State placement is mapped to model layers.
|
|
118
|
+
3. CSS mode-attribute strategy is identified.
|
|
119
|
+
4. P0/P1/P2 viewport assertions are defined.
|
|
120
|
+
5. Regression impact on existing desktop behavior is bounded.
|
|
121
|
+
|
|
122
|
+
Next: Tier 1 playbooks with concrete upgrade recipes.
|