@arcote.tech/arc-cli 0.7.27 → 0.7.29

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcote.tech/arc-cli",
3
- "version": "0.7.27",
3
+ "version": "0.7.29",
4
4
  "description": "CLI tool for Arc framework",
5
5
  "module": "index.ts",
6
6
  "main": "dist/index.js",
@@ -12,13 +12,13 @@
12
12
  "build": "bun build --target=bun ./src/index.ts --outdir=dist --external @arcote.tech/arc --external @arcote.tech/arc-ds --external @arcote.tech/arc-react --external @arcote.tech/platform --external @arcote.tech/arc-map --external '@opentelemetry/*' && chmod +x dist/index.js"
13
13
  },
14
14
  "dependencies": {
15
- "@arcote.tech/arc": "^0.7.27",
16
- "@arcote.tech/arc-ds": "^0.7.27",
17
- "@arcote.tech/arc-react": "^0.7.27",
18
- "@arcote.tech/arc-host": "^0.7.27",
19
- "@arcote.tech/arc-adapter-db-sqlite": "^0.7.27",
20
- "@arcote.tech/arc-adapter-db-postgres": "^0.7.27",
21
- "@arcote.tech/arc-otel": "^0.7.27",
15
+ "@arcote.tech/arc": "^0.7.29",
16
+ "@arcote.tech/arc-ds": "^0.7.29",
17
+ "@arcote.tech/arc-react": "^0.7.29",
18
+ "@arcote.tech/arc-host": "^0.7.29",
19
+ "@arcote.tech/arc-adapter-db-sqlite": "^0.7.29",
20
+ "@arcote.tech/arc-adapter-db-postgres": "^0.7.29",
21
+ "@arcote.tech/arc-otel": "^0.7.29",
22
22
  "@opentelemetry/api": "^1.9.0",
23
23
  "@opentelemetry/api-logs": "^0.57.0",
24
24
  "@opentelemetry/core": "^1.30.0",
@@ -31,8 +31,8 @@
31
31
  "@opentelemetry/sdk-trace-base": "^1.30.0",
32
32
  "@opentelemetry/sdk-trace-node": "^1.30.0",
33
33
  "@opentelemetry/semantic-conventions": "^1.27.0",
34
- "@arcote.tech/platform": "^0.7.27",
35
- "@arcote.tech/arc-map": "^0.7.27",
34
+ "@arcote.tech/platform": "^0.7.29",
35
+ "@arcote.tech/arc-map": "^0.7.29",
36
36
  "@clack/prompts": "^0.9.0",
37
37
  "commander": "^11.1.0",
38
38
  "chokidar": "^3.5.3",
@@ -632,6 +632,7 @@ export async function buildServerApp(
632
632
  contexts: contexts.map((p) => p.name).sort(),
633
633
  external: [...external].sort(),
634
634
  defines: SERVER_DEFINES,
635
+ sourcemap: "linked",
635
636
  });
636
637
 
637
638
  const entryFileAbs = join(serverDir, SERVER_ENTRY_FILE);
@@ -650,10 +651,12 @@ export async function buildServerApp(
650
651
 
651
652
  console.log(` building: ${unitId} (${contexts.length} server modules)`);
652
653
 
653
- // Wipe stale .js — old per-package flattened bundles AND previous chunks —
654
- // so a smaller rebuild never leaves orphaned content-addressed chunks behind.
654
+ // Wipe stale .js/.map — old per-package flattened bundles AND previous
655
+ // chunks — so a smaller rebuild never leaves orphaned artifacts behind.
655
656
  for (const f of readdirSync(serverDir)) {
656
- if (f.endsWith(".js")) rmSync(join(serverDir, f), { force: true });
657
+ if (f.endsWith(".js") || f.endsWith(".js.map")) {
658
+ rmSync(join(serverDir, f), { force: true });
659
+ }
657
660
  }
658
661
 
659
662
  // Entry side-effect-imports every context module so each registers via the
@@ -682,6 +685,9 @@ export async function buildServerApp(
682
685
  // in chunk-<hash>.js referenced by the entry.
683
686
  splitting: true,
684
687
  naming: "[name].[ext]",
688
+ // Linked source mapy: Bun mapuje stacki na oryginalne .ts natywnie —
689
+ // getSourceLocation() elementów wskazuje wtedy pliki źródłowe aplikacji.
690
+ sourcemap: "linked",
685
691
  external,
686
692
  plugins: [
687
693
  jsxDevShimPlugin(),
@@ -134,8 +134,8 @@ export function generateShellHtml(
134
134
  <html lang="en">
135
135
  <head>
136
136
  <meta charset="UTF-8" />
137
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
138
- <title>${manifest?.title ?? appName}</title>${manifest?.favicon ? `\n <link rel="icon" href="${manifest.favicon}">` : ""}${manifest ? `\n <link rel="manifest" href="/manifest.json">` : ""}
137
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover" />
138
+ <title>${manifest?.title ?? appName}</title>${manifest?.favicon ? `\n <link rel="icon" href="${manifest.favicon}">` : ""}${manifest ? `\n <link rel="manifest" href="/manifest.json${stylesQs}">` : ""}
139
139
  <link rel="stylesheet" href="/styles.css${stylesQs}" />
140
140
  <link rel="stylesheet" href="/theme.css${stylesQs}" />
141
141
  <link rel="modulepreload" href="${initialUrl}" />${otelTag}
@@ -403,9 +403,15 @@ function staticFilesHandler(
403
403
  "Cache-Control": devMode ? "no-cache" : "max-age=31536000,immutable",
404
404
  });
405
405
 
406
- // Serve manifest.json from root dir
406
+ // Serve manifest.json from root dir. Stable URL, content changes between
407
+ // builds — HTML references it with `?v=<stylesHash>` (generateShellHtml),
408
+ // so the URL changes on rebuild and immutable caching is safe. Handler
409
+ // ignores the query string itself (same pattern as /styles.css).
407
410
  if ((path === "/manifest.json" || path === "/manifest.webmanifest") && ws.manifest) {
408
- return serveFile(ws.manifest.path, ctx.corsHeaders);
411
+ return serveFile(ws.manifest.path, {
412
+ ...ctx.corsHeaders,
413
+ "Cache-Control": devMode ? "no-cache" : "max-age=31536000,immutable",
414
+ });
409
415
  }
410
416
 
411
417
  // Public files (files with extensions)
@@ -436,7 +442,18 @@ function apiEndpointsHandler(
436
442
  payloads = [ctx.tokenPayload];
437
443
  }
438
444
  return filterManifestForTokens(getManifest(), moduleAccessMap, payloads)
439
- .then((filtered) => Response.json(filtered, { headers: ctx.corsHeaders }));
445
+ .then((filtered) =>
446
+ Response.json(filtered, {
447
+ headers: {
448
+ ...ctx.corsHeaders,
449
+ // Treść zależy od tokenu (filterManifestForTokens) i zmienia się
450
+ // co deploy. Nie jest artefaktem buildu — `private`, by pośredni
451
+ // cache nie podał manifestu jednego usera drugiemu, `no-cache`,
452
+ // by po deployu klient dostał świeże hashe/podpisy chunków.
453
+ "Cache-Control": "no-cache, private",
454
+ },
455
+ }),
456
+ );
440
457
  }
441
458
 
442
459
  if (url.pathname === "/api/translations") {
@@ -501,7 +518,15 @@ function devReloadHandler(
501
518
  function spaFallbackHandler(getShellHtml: () => string): ArcHttpHandler {
502
519
  return (_req, _url, ctx) => {
503
520
  return new Response(getShellHtml(), {
504
- headers: { ...ctx.corsHeaders, "Content-Type": "text/html" },
521
+ headers: {
522
+ ...ctx.corsHeaders,
523
+ "Content-Type": "text/html",
524
+ // Stabilny URL, zmienna treść (embeduje initial.<hash>.js + styles ?v=).
525
+ // Kotwica całego łańcucha — musi być zawsze rewalidowana, inaczej po
526
+ // deployu przeglądarka/CDN podaje stary shell wskazujący na nieistniejące
527
+ // już bundle. Hash nie pomoże: to URL trasy, którego nie da się zahashować.
528
+ "Cache-Control": "no-cache, must-revalidate",
529
+ },
505
530
  });
506
531
  };
507
532
  }