arcane-os 0.51.0 → 0.51.1

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,14 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.51.1
4
+
5
+ - Restore the published `node-http-server` MIME map in development and packaged
6
+ preview serving. PDFs, Markdown and supported audio/video files retain their
7
+ declared content types; generated representations reuse the same public map.
8
+ Existing text charsets, unknown-extension binary fallback, complete file
9
+ contents, routing, conditional GET/HEAD and server lifecycle remain unchanged.
10
+ No new dependency, application setting or installed-file patch is required.
11
+
3
12
  ## 0.51.0
4
13
 
5
14
  - Add synchronous native speech `provider.setDefaultVoice(voiceURI|null)`.
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 share the theme, packaging, event, cancellation,
20
20
  and browser run contracts while retaining their selected application layout.
21
21
 
22
- This checkout defines the `0.51.0` SDK contract. Applications pin one exact npm
22
+ This checkout defines the `0.51.1` 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
 
@@ -374,6 +374,10 @@ HTTPS is the default for development and required for packaged browser previews.
374
374
  The published `node-http-server` 10.0.0 integration negotiates HTTP/2 or HTTP/1.1
375
375
  on the same HTTPS port using the configured PEM pair. Source routes, generated
376
376
  PWA resources, and conditional responses use the same serving pipeline.
377
+ Static files retain the module's complete MIME map, including PDF, Markdown,
378
+ audio and video. Generated representations use the same published map;
379
+ unknown extensions retain `application/octet-stream`. No application MIME
380
+ override is needed for these supported types.
377
381
  `--https` remains accepted but is no longer needed to select the transport.
378
382
  `--port` selects the HTTPS application port. A second HTTP listener returns
379
383
  `308` redirects to that HTTPS port, preserving the requested path and query.
@@ -3732,6 +3732,12 @@ negotiate HTTP/2 or HTTP/1.1 on the same HTTPS port. Explicit raw `tls` options
3732
3732
  retain native HTTPS transport with the same module response and static-file
3733
3733
  operations.
3734
3734
 
3735
+ Static files retain the module's complete built-in MIME map, including PDF,
3736
+ Markdown, audio and video. Generated representations use the same published
3737
+ `node-http-server/mime-types` map. Existing text charsets and the
3738
+ `application/octet-stream` fallback for unknown extensions remain unchanged;
3739
+ supported document and media types need no application override.
3740
+
3735
3741
  ### Signature, modes, and result
3736
3742
 
3737
3743
  ```text
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arcane-os",
3
- "version": "0.51.0",
3
+ "version": "0.51.1",
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",
@@ -1,5 +1,6 @@
1
1
  import Is from 'strong-type';
2
2
  import {Server} from 'node-http-server';
3
+ import contentTypes from 'node-http-server/mime-types';
3
4
  import {constants as FS_CONSTANTS} from 'node:fs';
4
5
  import {lstat,open,readFile,readdir,realpath} from 'node:fs/promises';
5
6
  import https from 'node:https';
@@ -19,26 +20,6 @@ import {createPwaArtifacts,selectPwaFiles} from './pwa.mjs';
19
20
 
20
21
  const is = new Is(false);
21
22
 
22
- const MIME_TYPES=new Map([
23
- ['.css','text/css; charset=utf-8'],
24
- ['.gif','image/gif'],
25
- ['.html','text/html; charset=utf-8'],
26
- ['.htm','text/html; charset=utf-8'],
27
- ['.ico','image/x-icon'],
28
- ['.jpeg','image/jpeg'],
29
- ['.jpg','image/jpeg'],
30
- ['.js','text/javascript; charset=utf-8'],
31
- ['.json','application/json; charset=utf-8'],
32
- ['.mjs','text/javascript; charset=utf-8'],
33
- ['.png','image/png'],
34
- ['.svg','image/svg+xml; charset=utf-8'],
35
- ['.txt','text/plain; charset=utf-8'],
36
- ['.wasm','application/wasm'],
37
- ['.webmanifest','application/manifest+json; charset=utf-8'],
38
- ['.webp','image/webp'],
39
- ['.woff','font/woff'],
40
- ['.woff2','font/woff2']
41
- ]);
42
23
  const READ_ONLY_NO_FOLLOW=FS_CONSTANTS.O_RDONLY|(FS_CONSTANTS.O_NOFOLLOW??0);
43
24
  const PRIVATE_SOURCE_SEGMENTS=new Set([
44
25
  'arcane-app.json','arcane-package.json','test','tests','scripts','node_modules','dist','local'
@@ -366,7 +347,7 @@ async function serveSourceFile(fileServer, request, response, opened, {
366
347
  response,
367
348
  {
368
349
  lastModified,
369
- contentType: MIME_TYPES.get(extension) || 'application/octet-stream',
350
+ contentType: contentTypes[extension.substring(1)] || 'application/octet-stream',
370
351
  body: async function createSourceRepresentation() {
371
352
  let content = opened.content ?? await readFile(opened.candidate);
372
353
  if (rewrite) {
@@ -1187,7 +1168,7 @@ async function startOwnedDevServer({
1187
1168
  // An older in-flight snapshot may finish after a newer
1188
1169
  // selection. Its body cannot validate that newer output.
1189
1170
  lastModified: selectedRoutes === currentSourceRoutes ? generated.lastModified : undefined,
1190
- contentType: MIME_TYPES.get(path.extname(generated.path)),
1171
+ contentType: contentTypes[path.extname(generated.path).substring(1).toLowerCase()],
1191
1172
  body: function generatedPwaBody() {
1192
1173
  return generated.content;
1193
1174
  }
@@ -1313,13 +1294,6 @@ async function startOwnedDevServer({
1313
1294
  await task;
1314
1295
  return true;
1315
1296
  }
1316
- const contentType = Object.fromEntries(
1317
- [...MIME_TYPES].map(
1318
- function serverContentType([extension, value]) {
1319
- return [extension.substring(1), value];
1320
- }
1321
- )
1322
- );
1323
1297
  const fileServer = new Server(
1324
1298
  {
1325
1299
  root: mappings[0].root,
@@ -1338,7 +1312,6 @@ async function startOwnedDevServer({
1338
1312
  })
1339
1313
  }
1340
1314
  );
1341
- fileServer.config.contentType = contentType;
1342
1315
  fileServer.onRawRequest = serveDevelopmentRequest;
1343
1316
  // The module's public HTTPS configuration accepts PEM paths. Its HTTPS
1344
1317
  // guide leaves advanced TLS inputs to application code; preserve that