@absolutejs/absolute 0.19.0-beta.449 → 0.19.0-beta.450

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/dist/build.js CHANGED
@@ -171284,10 +171284,7 @@ var requireCurrentIslandRegistry = () => {
171284
171284
  };
171285
171285
 
171286
171286
  // src/core/staticStreaming.ts
171287
- import { statSync } from "fs";
171288
- import { extname as extname4 } from "path";
171289
- import { pathToFileURL } from "url";
171290
- var defineStaticStreamingSlots = (slots) => slots, STATIC_SLOT_TAG_RE, ATTRIBUTE_RE, parseAttributes = (attributeString) => {
171287
+ var STATIC_SLOT_TAG_RE, ATTRIBUTE_RE, parseAttributes = (attributeString) => {
171291
171288
  const attributes = new Map;
171292
171289
  let match = ATTRIBUTE_RE.exec(attributeString);
171293
171290
  while (match) {
@@ -171331,65 +171328,10 @@ var defineStaticStreamingSlots = (slots) => slots, STATIC_SLOT_TAG_RE, ATTRIBUTE
171331
171328
  match = tagRe.exec(html);
171332
171329
  }
171333
171330
  return tags;
171334
- }, toStaticStreamingSlotDefinition = (value) => typeof value === "function" ? { resolve: value } : value, isObjectRecord = (value) => typeof value === "object" && value !== null, isStaticStreamingSlotDefinitions = (value) => isObjectRecord(value), resolveStaticStreamingDefinitions = (moduleExports) => {
171335
- const candidate = isStaticStreamingSlotDefinitions(moduleExports.streamingSlots) ? moduleExports.streamingSlots : isStaticStreamingSlotDefinitions(moduleExports.default) ? moduleExports.default : null;
171336
- return candidate;
171337
- }, serverModuleExtensions, resolveSidecarCandidates = (pagePath) => {
171338
- const pageExt = extname4(pagePath);
171339
- if (!pageExt)
171340
- return [];
171341
- const pageStem = pagePath.slice(0, -pageExt.length);
171342
- return serverModuleExtensions.map((extension) => `${pageStem}${extension}`);
171343
- }, fileExists = async (path) => await Bun.file(path).exists(), loadStaticStreamingModule = async (pagePath) => {
171344
- for (const candidate of resolveSidecarCandidates(pagePath)) {
171345
- if (!await fileExists(candidate))
171346
- continue;
171347
- const version = statSync(candidate).mtimeMs;
171348
- const moduleUrl = new URL(pathToFileURL(candidate).href);
171349
- moduleUrl.searchParams.set("t", String(version));
171350
- const moduleExports = await import(moduleUrl.href);
171351
- const definitions = resolveStaticStreamingDefinitions(moduleExports);
171352
- if (!definitions) {
171353
- throw new Error(`Static streaming module "${candidate}" must export a default value or named "streamingSlots" object.`);
171354
- }
171355
- return definitions;
171356
- }
171357
- return null;
171358
- }, loadStaticStreamingSlots = async (pagePath, html) => {
171359
- const tagDefinitions = extractStaticStreamingTags(html);
171360
- if (tagDefinitions.length === 0) {
171361
- return [];
171362
- }
171363
- const definitions = await loadStaticStreamingModule(pagePath);
171364
- if (!definitions) {
171365
- throw new Error(`Static page "${pagePath}" uses <abs-stream-slot> but no page-adjacent server module was found. Create a sibling ".server.ts" file that exports defineStaticStreamingSlots({...}).`);
171366
- }
171367
- return tagDefinitions.map((tag) => {
171368
- const entry = definitions[tag.resolver];
171369
- if (!entry) {
171370
- throw new Error(`Static streaming resolver "${tag.resolver}" was not found for "${pagePath}".`);
171371
- }
171372
- const definition = toStaticStreamingSlotDefinition(entry);
171373
- return {
171374
- errorHtml: tag.errorHtml ?? definition.errorHtml,
171375
- fallbackHtml: tag.fallbackHtml,
171376
- id: tag.id,
171377
- resolve: definition.resolve,
171378
- timeoutMs: tag.timeoutMs ?? definition.timeoutMs
171379
- };
171380
- });
171381
171331
  };
171382
171332
  var init_staticStreaming = __esm(() => {
171383
171333
  STATIC_SLOT_TAG_RE = /<abs-stream-slot\b([^>]*?)(?:\/>|>([\s\S]*?)<\/abs-stream-slot>)/gi;
171384
171334
  ATTRIBUTE_RE = /([A-Za-z_:][-A-Za-z0-9_:.]*)\s*=\s*(?:"([^"]*)"|'([^']*)')/g;
171385
- serverModuleExtensions = [
171386
- ".server.ts",
171387
- ".server.js",
171388
- ".server.mjs",
171389
- ".slots.ts",
171390
- ".slots.js",
171391
- ".slots.mjs"
171392
- ];
171393
171335
  });
171394
171336
 
171395
171337
  // src/build/staticIslandPages.ts
@@ -172524,7 +172466,7 @@ import {
172524
172466
  dirname as dirname6,
172525
172467
  join as join11,
172526
172468
  basename as basename4,
172527
- extname as extname5,
172469
+ extname as extname4,
172528
172470
  resolve as resolve13,
172529
172471
  relative as relative6,
172530
172472
  sep as sep2
@@ -172765,7 +172707,7 @@ var resolveDevClientDir2 = () => {
172765
172707
  const roots = await Promise.all(entryPoints.map(build));
172766
172708
  await Promise.all(roots.map(async ({ client, hasAwaitSlot }) => {
172767
172709
  const relClientDir = dirname6(relative6(clientDir, client));
172768
- const name = basename4(client, extname5(client));
172710
+ const name = basename4(client, extname4(client));
172769
172711
  const indexPath = join11(indexDir, relClientDir, `${name}.js`);
172770
172712
  const importRaw = relative6(dirname6(indexPath), client).split(sep2).join("/");
172771
172713
  const importPath = importRaw.startsWith(".") || importRaw.startsWith("/") ? importRaw : `./${importRaw}`;
@@ -174510,7 +174452,7 @@ import {
174510
174452
  mkdirSync as mkdirSync10,
174511
174453
  readFileSync as readFileSync9,
174512
174454
  rmSync as rmSync2,
174513
- statSync as statSync2,
174455
+ statSync,
174514
174456
  writeFileSync as writeFileSync7
174515
174457
  } from "fs";
174516
174458
  import { basename as basename7, dirname as dirname9, join as join18, relative as relative9, resolve as resolve16 } from "path";
@@ -174616,7 +174558,7 @@ var isDev, collectConventionSourceFiles = (entry) => {
174616
174558
  }, SKIP_DIRS, addWorkerPathIfExists = (file3, relPath, workerPaths) => {
174617
174559
  const absPath = resolve16(file3, "..", relPath);
174618
174560
  try {
174619
- statSync2(absPath);
174561
+ statSync(absPath);
174620
174562
  workerPaths.add(absPath);
174621
174563
  } catch {}
174622
174564
  }, collectWorkerPathsFromContent = (content, pattern, file3, workerPaths) => {
@@ -174780,7 +174722,7 @@ ${content.slice(firstUseIdx)}`;
174780
174722
  for (const srcPath of urlReferencedFiles) {
174781
174723
  const rel = relative9(projectRoot, srcPath).replace(/\\/g, "/");
174782
174724
  const name = basename7(srcPath);
174783
- const mtime = Math.round(statSync2(srcPath).mtimeMs);
174725
+ const mtime = Math.round(statSync(srcPath).mtimeMs);
174784
174726
  const url = `/@src/${rel}?v=${mtime}`;
174785
174727
  urlFileMap.set(name, url);
174786
174728
  urlFileMap.set(name.replace(/\.tsx?$/, ".js"), url);
@@ -177531,8 +177473,8 @@ __export(exports_moduleServer, {
177531
177473
  createModuleServer: () => createModuleServer,
177532
177474
  SRC_URL_PREFIX: () => SRC_URL_PREFIX
177533
177475
  });
177534
- import { existsSync as existsSync19, readFileSync as readFileSync13, statSync as statSync3 } from "fs";
177535
- import { basename as basename12, dirname as dirname12, extname as extname6, resolve as resolve24, relative as relative10 } from "path";
177476
+ import { existsSync as existsSync19, readFileSync as readFileSync13, statSync as statSync2 } from "fs";
177477
+ import { basename as basename12, dirname as dirname12, extname as extname5, resolve as resolve24, relative as relative10 } from "path";
177536
177478
  var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
177537
177479
  const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
177538
177480
  const allExports = [];
@@ -177572,7 +177514,7 @@ ${stubs}
177572
177514
  if (cached !== undefined)
177573
177515
  return `${base}?v=${buildVersion(cached, absPath)}`;
177574
177516
  try {
177575
- const mtime = Math.round(statSync3(absPath).mtimeMs);
177517
+ const mtime = Math.round(statSync2(absPath).mtimeMs);
177576
177518
  mtimeCache.set(absPath, mtime);
177577
177519
  return `${base}?v=${buildVersion(mtime, absPath)}`;
177578
177520
  } catch {
@@ -177581,9 +177523,9 @@ ${stubs}
177581
177523
  }, resolveRelativeImport = (relPath, fileDir, projectRoot, extensions) => {
177582
177524
  const absPath = resolve24(fileDir, relPath);
177583
177525
  const rel = relative10(projectRoot, absPath);
177584
- const extension = extname6(rel);
177526
+ const extension = extname5(rel);
177585
177527
  let srcPath = RESOLVED_MODULE_EXTENSIONS.has(extension) ? rel : resolveRelativeExtension(rel, projectRoot, extensions);
177586
- if (extname6(srcPath) === ".svelte") {
177528
+ if (extname5(srcPath) === ".svelte") {
177587
177529
  srcPath = relative10(projectRoot, resolveSvelteModulePath(resolve24(projectRoot, srcPath)));
177588
177530
  }
177589
177531
  return srcUrl(srcPath, projectRoot);
@@ -177684,7 +177626,7 @@ ${transpiled}`;
177684
177626
  return rewriteImports2(transpiled, filePath, projectRoot, rewriter);
177685
177627
  }, transformPlainFile = (filePath, projectRoot, rewriter, vueDir) => {
177686
177628
  const raw = readFileSync13(filePath, "utf-8");
177687
- const ext = extname6(filePath);
177629
+ const ext = extname5(filePath);
177688
177630
  const isTS = ext === ".ts" || ext === ".tsx";
177689
177631
  const isTSX = ext === ".tsx" || ext === ".jsx";
177690
177632
  let transpiler4 = jsTranspiler2;
@@ -178074,7 +178016,7 @@ export default {};
178074
178016
  return jsResponse(`var s=document.createElement('style');s.textContent=\`${escaped}\`;s.dataset.svelteHmr=${JSON.stringify(cssCheckPath)};var p=document.querySelector('style[data-svelte-hmr="${cssCheckPath}"]');if(p)p.remove();document.head.appendChild(s);`);
178075
178017
  }, resolveSourcePath = (relPath, projectRoot) => {
178076
178018
  const filePath = resolve24(projectRoot, relPath);
178077
- const ext = extname6(filePath);
178019
+ const ext = extname5(filePath);
178078
178020
  if (ext === ".svelte")
178079
178021
  return { ext, filePath: resolveSvelteModulePath(filePath) };
178080
178022
  if (ext)
@@ -178099,18 +178041,18 @@ export default {};
178099
178041
  return transformAndCacheVue(filePath, projectRoot, rewriter, vueDir);
178100
178042
  if (!TRANSPILABLE.has(ext))
178101
178043
  return;
178102
- const stat2 = statSync3(filePath);
178044
+ const stat2 = statSync2(filePath);
178103
178045
  const resolvedVueDir = vueDir ? resolve24(vueDir) : undefined;
178104
178046
  const content = REACT_EXTENSIONS.has(ext) ? transformReactFile(filePath, projectRoot, rewriter) : transformPlainFile(filePath, projectRoot, rewriter, resolvedVueDir);
178105
178047
  setTransformed(filePath, content, stat2.mtimeMs, extractImportedFiles(content, projectRoot));
178106
178048
  return jsResponse(content);
178107
178049
  }, transformAndCacheSvelte = async (filePath, projectRoot, rewriter) => {
178108
- const stat2 = statSync3(filePath);
178050
+ const stat2 = statSync2(filePath);
178109
178051
  const content = await transformSvelteFile(filePath, projectRoot, rewriter);
178110
178052
  setTransformed(filePath, content, stat2.mtimeMs, extractImportedFiles(content, projectRoot));
178111
178053
  return jsResponse(content);
178112
178054
  }, transformAndCacheVue = async (filePath, projectRoot, rewriter, vueDir) => {
178113
- const stat2 = statSync3(filePath);
178055
+ const stat2 = statSync2(filePath);
178114
178056
  const content = await transformVueFile(filePath, projectRoot, rewriter, vueDir);
178115
178057
  setTransformed(filePath, content, stat2.mtimeMs, extractImportedFiles(content, projectRoot));
178116
178058
  return jsResponse(content);
@@ -179946,7 +179888,7 @@ __export(exports_devBuild, {
179946
179888
  devBuild: () => devBuild
179947
179889
  });
179948
179890
  import { readdir as readdir5 } from "fs/promises";
179949
- import { statSync as statSync4 } from "fs";
179891
+ import { statSync as statSync3 } from "fs";
179950
179892
  import { resolve as resolve28 } from "path";
179951
179893
  var FRAMEWORK_DIR_KEYS, parseDirectoryConfig = (source) => {
179952
179894
  const config = {};
@@ -180040,7 +179982,7 @@ var FRAMEWORK_DIR_KEYS, parseDirectoryConfig = (source) => {
180040
179982
  state.fileChangeQueue.clear();
180041
179983
  }
180042
179984
  }, handleCachedReload = async () => {
180043
- const serverMtime = statSync4(resolve28(Bun.main)).mtimeMs;
179985
+ const serverMtime = statSync3(resolve28(Bun.main)).mtimeMs;
180044
179986
  const lastMtime = globalThis.__hmrServerMtime;
180045
179987
  globalThis.__hmrServerMtime = serverMtime;
180046
179988
  const cached = globalThis.__hmrDevResult;
@@ -180193,7 +180135,7 @@ var FRAMEWORK_DIR_KEYS, parseDirectoryConfig = (source) => {
180193
180135
  manifest
180194
180136
  };
180195
180137
  globalThis.__hmrDevResult = result;
180196
- globalThis.__hmrServerMtime = statSync4(resolve28(Bun.main)).mtimeMs;
180138
+ globalThis.__hmrServerMtime = statSync3(resolve28(Bun.main)).mtimeMs;
180197
180139
  return result;
180198
180140
  };
180199
180141
  var init_devBuild = __esm(() => {
@@ -180228,5 +180170,5 @@ export {
180228
180170
  build
180229
180171
  };
180230
180172
 
180231
- //# debugId=208D43097DFA5F2464756E2164756E21
180173
+ //# debugId=1B66223FFFFDAAC264756E2164756E21
180232
180174
  //# sourceMappingURL=build.js.map