arcane-os 0.17.0 → 0.18.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 CHANGED
@@ -1,5 +1,20 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.18.0
4
+
5
+ - Adopt published `node-http-server` 10.0.0. PEM-backed development and
6
+ packaged-preview HTTPS now negotiate HTTP/2 or HTTP/1.1 on the same port
7
+ through the existing module integration, with no new runtime dependency.
8
+ - Document the returned `Http2SecureServer` for PEM-backed HTTPS. Preserve
9
+ raw `tls` options on native `https.Server`, explicit HTTP development, the
10
+ HTTP mail gateway, paired HTTP `308` redirects, source/PWA routes, complete
11
+ responses, conditional caching, and owned listener shutdown.
12
+ - Adapt the shared synthetic TLS fixture to both native TLS constructors while
13
+ retaining option capture and cleanup. The fixture models routing and option
14
+ delegation; it does not establish a real TLS handshake or protocol negotiation.
15
+ - Report an occupied mail listener port clearly while retaining native
16
+ `EADDRINUSE` details, the original cause, and the existing startup cleanup.
17
+
3
18
  ## 0.17.0
4
19
 
5
20
  - Add neutral `modal.configure({dismissible})` configuration, defaulting to
package/NOTICE CHANGED
@@ -8,7 +8,7 @@ informational notice and is not itself a grant of commercial rights.
8
8
  Third-party material retains its own terms:
9
9
 
10
10
  - event-pubsub 6.1.0: MIT License; see its installed `licence` file.
11
- - node-http-server 9.1.1: MIT License; see its installed `licence` file.
11
+ - node-http-server 10.0.0: MIT License; see its installed `licence` file.
12
12
  - strong-type 2.0.1: MIT License; see its installed `licence` file.
13
13
  - vanilla-test 2.1.3: MIT License; see its installed `licence` file.
14
14
  - ansi-colors-es6 5.0.0: MIT License; see its installed `LICENSE` file.
package/README.md CHANGED
@@ -19,7 +19,7 @@ version-locked SDK runtime, while an integrated Arcane checkout uses its live
19
19
  `arcane/` runtime. Both profiles preserve the same app URLs, theme, packaging,
20
20
  event, cancellation, and browser run contracts.
21
21
 
22
- This checkout defines the `0.16.2` SDK contract. Applications pin one exact npm
22
+ This checkout defines the `0.18.0` SDK contract. Applications pin one exact npm
23
23
  version and lockfile; registry state is deliberately not baked into application
24
24
  artifacts.
25
25
 
@@ -134,8 +134,10 @@ expiration. The timestamp advances only after the whole resource check succeeds.
134
134
  Restarting is not a content synchronization step; inspect the
135
135
  selected source route and the last successful check when evaluating freshness.
136
136
 
137
- The shared dev server uses RIAEvangelist's `node-http-server` public interface
138
- for HTTPS and conditional responses on those selected routes. The SDK
137
+ The shared dev server uses RIAEvangelist's published `node-http-server` 10.0.0
138
+ public interface for HTTPS and conditional responses on those selected routes.
139
+ PEM-backed HTTPS uses Node's `Http2SecureServer` with HTTP/1.1 compatibility;
140
+ clients negotiate either protocol on the same HTTPS port. The SDK
139
141
  owns source selection and generated representations. By default, source development
140
142
  and every packaged browser preview serve content on HTTPS and redirect their
141
143
  paired HTTP listener with status 308 through the public request hook.
@@ -345,6 +345,9 @@ Network URLs come from one interface snapshot at startup and do not establish
345
345
  remote reachability through the machine's firewall or network.
346
346
 
347
347
  HTTPS is the default for development and required for packaged browser previews.
348
+ The published `node-http-server` 10.0.0 integration negotiates HTTP/2 or HTTP/1.1
349
+ on the same HTTPS port using the configured PEM pair. Source routes, generated
350
+ PWA resources, and conditional responses use the same serving pipeline.
348
351
  `--https` remains accepted but is no longer needed to select the transport.
349
352
  `--port` selects the HTTPS application port. A second HTTP listener returns
350
353
  `308` redirects to that HTTPS port, preserving the requested path and query.
@@ -320,6 +320,13 @@ address and port. The server can serve callers from multiple domains on the
320
320
  same machine. Route the page's `/v1/mail` to this listener, or configure an
321
321
  explicit shared endpoint in the caller.
322
322
 
323
+ If the selected port is occupied, startup reports
324
+ `Mail port <port> is already taken, possibly by another mail server.`
325
+ The CLI exits with status 1. Programmatic callers receive the same message,
326
+ with native `EADDRINUSE` metadata and the original error retained as `cause`.
327
+ The existing listener remains running; this launch does not retry or select
328
+ another port.
329
+
323
330
  `--app` is an optional server event label and does not restrict incoming
324
331
  application names. `--from` is an optional shared sender override; omit it to
325
332
  preserve each report's sender or its provider template's default.
@@ -3464,14 +3464,15 @@ async function useselectApp(...arguments_) {
3464
3464
 
3465
3465
  Starts one owned browser development server with exact runtime/app route mappings and a caller-selected bind address.
3466
3466
 
3467
- HTTP and HTTPS serving use the published `node-http-server` module. The SDK
3467
+ HTTP and HTTPS serving use published `node-http-server` 10.0.0. The SDK
3468
3468
  selects source routes and supplies generated representations; the module owns
3469
3469
  static-file conditional GET/HEAD handling and response delivery. The SDK
3470
3470
  retains modification dates for its generated representations. Unchanged
3471
3471
  resources can return `304` with no body while changed resources return their
3472
- complete current representation. PEM-path listeners use module deployment;
3473
- explicit raw `tls` options retain native HTTPS transport with the same module
3474
- response and static-file operations.
3472
+ complete current representation. PEM-path listeners use module deployment and
3473
+ negotiate HTTP/2 or HTTP/1.1 on the same HTTPS port. Explicit raw `tls` options
3474
+ retain native HTTPS transport with the same module response and static-file
3475
+ operations.
3475
3476
 
3476
3477
  ### Signature, modes, and result
3477
3478
 
@@ -3518,8 +3519,12 @@ requirements remain browser-owned; see [explicit HTTP development](cli.md#explic
3518
3519
  The promise settles after all selected listeners are ready and resolves to
3519
3520
  `{server, protocol, mode, workspaceRoot, appId, host, port, origin, cleanUrl, url,
3520
3521
  networkUrls, httpPort, httpOrigin, httpUrl, close, closed, lifecycle}`. `server` is the raw Node
3521
- server for application content; `protocol` is `'https:'` by default or `'http:'`
3522
- with explicit HTTP source mode.
3522
+ server for application content: `Http2SecureServer` for PEM-backed HTTPS,
3523
+ `https.Server` for explicit raw `tls` options, or `http.Server` for explicit
3524
+ HTTP source mode. HTTP/2 uses Node's compatibility request/response APIs;
3525
+ callers accessing the raw server must account for its native type.
3526
+ `protocol` describes the URL scheme: `'https:'` for either negotiated HTTPS
3527
+ protocol or `'http:'` with explicit HTTP source mode.
3523
3528
  `url` and `cleanUrl` are the same application URL. Wildcard listeners use
3524
3529
  `localhost` in that local URL; `host` retains the actual bound address.
3525
3530
  `httpPort` is the actual HTTP listener port, `httpOrigin` is its HTTP origin,
@@ -159,6 +159,7 @@ The upstream listener and public lifecycle follow.
159
159
  | `deployMailServer` | Adapts published `deploy(callback)` into listener startup promise. | Y/Y/N — Keep. | Startup must return the actual bound address or an actual bind error. Current name: `listenForMailRequests`. |
160
160
  | `waitForMailListener` | Owns the startup promise. | Y/Y/N — Keep. | Required callback-to-promise adapter at the upstream owner. Name is clear. |
161
161
  | Listener `onError` | Rejects startup when binding fails. | Y/Y/N — Keep. | Do not claim listening before this boundary. Current callback name remains `onError`, local to the listener promise. |
162
+ | Occupied-port startup message | `startResendMailServer` handles the actual native `EADDRINUSE` after closing its failed launch resources. | Y/Y/N — Keep. | Identifies the selected mail port and says another mail server may own it. The existing CLI failure path exits with status 1; native error metadata and the complete original cause remain available. One failure-only branch replaces the generic bind message, with no port probe, retry, process control, or work on successful requests. Source and diff reviewed; this follow-up was not exercised locally. |
162
163
  | `onListening` | Removes startup error listener and resolves actual raw server. | Y/Y/N — Keep. | Retain upstream callback semantics. Current callback name remains `onListening`; its `(instance, server)` positions follow the upstream callback. |
163
164
  | `startResendMailServer` | Constructs upstream server and mail handler, then exposes lifecycle. | Y/Y/Y — Keep entry point; remove duplicate configuration/loopback gate. | Use configured host/domain; keep selected upstream public interface and no implicit socket deadline. Preserve public name. |
164
165
  | `handleMailRequest` assigned to `onRawRequest` | Hands original Node request/response to mail handler and returns true. | Y/Y/N — Keep. | `true` prevents upstream body/static processing of an already-owned mail request. Current name: `routeRawMailRequest`, distinct from the actual request handler. |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arcane-os",
3
- "version": "0.17.0",
3
+ "version": "0.18.0",
4
4
  "description": "Arcane OS JavaScript SDK, project-local CLI, browser runtime, and repository-portable application packager.",
5
5
  "type": "module",
6
6
  "main": "./src/index.mjs",
@@ -106,7 +106,7 @@
106
106
  },
107
107
  "dependencies": {
108
108
  "event-pubsub": "6.1.0",
109
- "node-http-server": "9.1.1",
109
+ "node-http-server": "10.0.0",
110
110
  "strong-type": "2.0.1",
111
111
  "vanilla-test": "2.1.3"
112
112
  },
@@ -1033,6 +1033,15 @@ export async function startResendMailServer(options={}){
1033
1033
  server=await listenForMailRequests(mailServer);
1034
1034
  }catch(error){
1035
1035
  await Promise.allSettled([mailServer.close(),requestHandler.close()]);
1036
+ if (error?.code === 'EADDRINUSE') {
1037
+ throw Object.assign(
1038
+ new Error(
1039
+ `Mail port ${configuration.port} is already taken, possibly by another mail server.`,
1040
+ {cause:error}
1041
+ ),
1042
+ error
1043
+ );
1044
+ }
1036
1045
  throw error;
1037
1046
  }
1038
1047
  const address=server.address();