@absolutejs/absolute 0.19.0-beta.1088 → 0.19.0-beta.1089

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.
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  var __require = import.meta.require;
3
3
 
4
- // .angular-partial-tmp-fXNIM4/src/core/streamingSlotRegistrar.ts
4
+ // .angular-partial-tmp-PeMO36/src/core/streamingSlotRegistrar.ts
5
5
  var STREAMING_SLOT_REGISTRAR_KEY = Symbol.for("absolutejs.streamingSlotRegistrar");
6
6
  var STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotWarningController");
7
7
  var STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotCollectionController");
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  var __require = import.meta.require;
3
3
 
4
- // .angular-partial-tmp-fXNIM4/src/core/streamingSlotRegistrar.ts
4
+ // .angular-partial-tmp-PeMO36/src/core/streamingSlotRegistrar.ts
5
5
  var STREAMING_SLOT_REGISTRAR_KEY = Symbol.for("absolutejs.streamingSlotRegistrar");
6
6
  var STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotWarningController");
7
7
  var STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotCollectionController");
@@ -48,7 +48,7 @@ var warnMissingStreamingSlotCollector = (primitiveName) => {
48
48
  getWarningController()?.maybeWarn(primitiveName);
49
49
  };
50
50
 
51
- // .angular-partial-tmp-fXNIM4/src/core/streamingSlotRegistry.ts
51
+ // .angular-partial-tmp-PeMO36/src/core/streamingSlotRegistry.ts
52
52
  var STREAMING_SLOT_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotAsyncLocalStorage");
53
53
  var isObjectRecord2 = (value) => Boolean(value) && typeof value === "object";
54
54
  var isAsyncLocalStorage = (value) => isObjectRecord2(value) && ("getStore" in value) && typeof value.getStore === "function" && ("run" in value) && typeof value.run === "function";
package/dist/index.js CHANGED
@@ -40015,6 +40015,7 @@ var handleHTMXPageRequest = async (pagePath) => {
40015
40015
  });
40016
40016
  };
40017
40017
  // src/core/prepare.ts
40018
+ import { createHash as createHash5 } from "crypto";
40018
40019
  import { existsSync as existsSync39, readdirSync as readdirSync9, readFileSync as readFileSync33 } from "fs";
40019
40020
  import { basename as basename16, join as join49, relative as relative18, resolve as resolve45 } from "path";
40020
40021
  import { Elysia as Elysia8 } from "elysia";
@@ -40118,6 +40119,20 @@ var withTelemetry = async (app, config2, cwd) => {
40118
40119
  // src/core/prepare.ts
40119
40120
  init_loadConfig();
40120
40121
 
40122
+ // src/utils/iconVersion.ts
40123
+ var iconMimeType = (icon) => {
40124
+ if (icon.endsWith(".svg"))
40125
+ return "image/svg+xml";
40126
+ if (icon.endsWith(".png"))
40127
+ return "image/png";
40128
+ return "image/x-icon";
40129
+ };
40130
+ var resolver;
40131
+ var applyIconVersion = (href) => resolver ? resolver(href) : href;
40132
+ var setIconVersionResolver = (resolverFn) => {
40133
+ resolver = resolverFn;
40134
+ };
40135
+
40121
40136
  // src/core/loadIslandRegistry.ts
40122
40137
  init_islandEntries();
40123
40138
  import { resolve as resolve11 } from "path";
@@ -40537,6 +40552,26 @@ var patchManifestIndexes = (manifest, devIndexDir, SRC_URL_PREFIX2) => {
40537
40552
  manifest[key] = `${SRC_URL_PREFIX2}${rel}`;
40538
40553
  }
40539
40554
  };
40555
+ var ICON_HASH_LENGTH = 8;
40556
+ var registerIconVersioning = (buildDir) => {
40557
+ const cache2 = new Map;
40558
+ setIconVersionResolver((href) => {
40559
+ if (!href.startsWith("/") || href.startsWith("//"))
40560
+ return href;
40561
+ const cached2 = cache2.get(href);
40562
+ if (cached2 !== undefined)
40563
+ return cached2;
40564
+ const path = href.split("?")[0] ?? href;
40565
+ const filePath = join49(buildDir, path);
40566
+ let versioned = href;
40567
+ if (existsSync39(filePath)) {
40568
+ const hash = createHash5("sha256").update(readFileSync33(filePath)).digest("hex").slice(0, ICON_HASH_LENGTH);
40569
+ versioned = href.includes("?") ? `${href}&v=${hash}` : `${href}?v=${hash}`;
40570
+ }
40571
+ cache2.set(href, versioned);
40572
+ return versioned;
40573
+ });
40574
+ };
40540
40575
  var prepareDev = async (config2, buildDir) => {
40541
40576
  const startupSteps = [];
40542
40577
  const recordStep = (label, startedAt) => {
@@ -40700,6 +40735,7 @@ var prepare = async (configOrPath) => {
40700
40735
  const nodeEnv = process.env["NODE_ENV"];
40701
40736
  const isDev3 = nodeEnv === "development";
40702
40737
  const buildDir = resolve45(process.env.ABSOLUTE_BUILD_DIR ?? config2.buildDirectory ?? "build");
40738
+ registerIconVersioning(buildDir);
40703
40739
  if (isDev3) {
40704
40740
  stepStartedAt = performance.now();
40705
40741
  const result = await prepareDev(config2, buildDir);
@@ -41301,7 +41337,7 @@ var generateHeadElement = ({
41301
41337
  '<meta name="viewport" content="width=device-width, initial-scale=1.0">',
41302
41338
  `<title>${title}</title>`,
41303
41339
  `<meta name="description" content="${description}">`,
41304
- `<link rel="icon" href="${icon}" type="image/x-icon">`
41340
+ `<link rel="icon" href="${applyIconVersion(icon)}" type="${iconMimeType(icon)}">`
41305
41341
  ];
41306
41342
  if (canonical) {
41307
41343
  tags.push(`<link rel="canonical" href="${canonical}">`);
@@ -47514,6 +47550,7 @@ export {
47514
47550
  streamOutOfOrderSlots,
47515
47551
  setStreamingSlotPolicy,
47516
47552
  setSsrContextGetter,
47553
+ setIconVersionResolver,
47517
47554
  serializeJsonLd,
47518
47555
  serializeIslandProps,
47519
47556
  resolveDevtoolsUuidCachePath,
@@ -47537,6 +47574,7 @@ export {
47537
47574
  injectHtmlIntoHead,
47538
47575
  injectHtmlIntoBody,
47539
47576
  incrementalTailwindBuild,
47577
+ iconMimeType,
47540
47578
  hmrState,
47541
47579
  handleHTMXPageRequest,
47542
47580
  handleHTMLPageRequest,
@@ -47568,6 +47606,7 @@ export {
47568
47606
  compileTailwind,
47569
47607
  clearAllClientScripts,
47570
47608
  asset,
47609
+ applyIconVersion,
47571
47610
  appendStreamingSlotPatchesToStream,
47572
47611
  WS_READY_STATE_OPEN,
47573
47612
  WORKSPACE_TUI_VISIBILITY_WIDTH,
@@ -47672,5 +47711,5 @@ export {
47672
47711
  ANGULAR_INIT_TIMEOUT_MS
47673
47712
  };
47674
47713
 
47675
- //# debugId=06E5FD5939F586B964756E2164756E21
47714
+ //# debugId=39C8705EE6614D9464756E2164756E21
47676
47715
  //# sourceMappingURL=index.js.map