@absolutejs/absolute 0.19.0-beta.75 → 0.19.0-beta.76

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/index.js CHANGED
@@ -134,26 +134,23 @@ body{min-height:100vh;background:linear-gradient(135deg,rgba(15,23,42,0.98) 0%,r
134
134
  };
135
135
 
136
136
  // src/build/freshReadPlugin.ts
137
+ import { readFileSync } from "fs";
137
138
  var createFreshReadPlugin = (changedFiles) => {
138
139
  const changed = new Set(changedFiles.map((f) => f.replace(/\\/g, "/")));
139
- const escaped = changedFiles.map((f) => f.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
140
- const pattern = escaped.length > 0 ? new RegExp(`(${escaped.join("|")})$`) : /(?!)/;
141
140
  return {
142
141
  name: "fresh-read",
143
142
  setup(build2) {
144
- build2.onLoad({ filter: pattern }, async (args) => {
145
- console.log(`[fresh-read] onLoad: ${args.path}`);
143
+ build2.onLoad({ filter: /\.(tsx?|jsx?)$/ }, (args) => {
146
144
  const normalized = args.path.replace(/\\/g, "/");
147
145
  if (!changed.has(normalized))
148
146
  return;
149
- const contents = await Bun.file(args.path).text();
147
+ const contents = readFileSync(args.path, "utf-8");
150
148
  const ext = args.path.split(".").pop();
151
149
  const loaderMap = {
152
150
  ts: "ts",
153
151
  tsx: "tsx",
154
152
  js: "js",
155
- jsx: "jsx",
156
- css: "css"
153
+ jsx: "jsx"
157
154
  };
158
155
  return {
159
156
  contents,
@@ -163,6 +160,7 @@ var createFreshReadPlugin = (changedFiles) => {
163
160
  }
164
161
  };
165
162
  };
163
+ var init_freshReadPlugin = () => {};
166
164
 
167
165
  // src/utils/normalizePath.ts
168
166
  var normalizePath = (path) => path.replace(/\\/g, "/");
@@ -652,14 +650,14 @@ var scanCssEntryPoints = async (dir, ignore) => {
652
650
  var init_scanCssEntryPoints = () => {};
653
651
 
654
652
  // src/cli/scripts/telemetry.ts
655
- import { existsSync as existsSync4, mkdirSync as mkdirSync2, readFileSync, writeFileSync } from "fs";
653
+ import { existsSync as existsSync4, mkdirSync as mkdirSync2, readFileSync as readFileSync2, writeFileSync } from "fs";
656
654
  import { homedir } from "os";
657
655
  import { join as join2 } from "path";
658
656
  var configDir, configPath, getTelemetryConfig = () => {
659
657
  try {
660
658
  if (!existsSync4(configPath))
661
659
  return null;
662
- const raw = readFileSync(configPath, "utf-8");
660
+ const raw = readFileSync2(configPath, "utf-8");
663
661
  const config = JSON.parse(raw);
664
662
  return config;
665
663
  } catch {
@@ -672,14 +670,14 @@ var init_telemetry = __esm(() => {
672
670
  });
673
671
 
674
672
  // src/cli/telemetryEvent.ts
675
- import { existsSync as existsSync5, readFileSync as readFileSync2 } from "fs";
673
+ import { existsSync as existsSync5, readFileSync as readFileSync3 } from "fs";
676
674
  import { arch, platform } from "os";
677
675
  import { dirname, join as join3, parse } from "path";
678
676
  var checkCandidate = (candidate) => {
679
677
  if (!existsSync5(candidate)) {
680
678
  return null;
681
679
  }
682
- const pkg = JSON.parse(readFileSync2(candidate, "utf-8"));
680
+ const pkg = JSON.parse(readFileSync3(candidate, "utf-8"));
683
681
  if (pkg.name === "@absolutejs/absolute") {
684
682
  const ver = pkg.version;
685
683
  return ver;
@@ -976,7 +974,7 @@ var devVendorPaths = null, getDevVendorPaths = () => devVendorPaths, setDevVendo
976
974
  };
977
975
 
978
976
  // src/build/angularLinkerPlugin.ts
979
- import { existsSync as existsSync7, mkdirSync as mkdirSync3, readFileSync as readFileSync3, writeFileSync as writeFileSync2 } from "fs";
977
+ import { existsSync as existsSync7, mkdirSync as mkdirSync3, readFileSync as readFileSync4, writeFileSync as writeFileSync2 } from "fs";
980
978
  import { dirname as dirname2, join as join4, relative as relative2, resolve as resolve5 } from "path";
981
979
  import { createHash } from "crypto";
982
980
  var CACHE_DIR, angularLinkerPlugin;
@@ -1003,7 +1001,7 @@ var init_angularLinkerPlugin = __esm(() => {
1003
1001
  const cachePath = join4(CACHE_DIR, `${hash}.js`);
1004
1002
  if (existsSync7(cachePath)) {
1005
1003
  return {
1006
- contents: readFileSync3(cachePath, "utf-8"),
1004
+ contents: readFileSync4(cachePath, "utf-8"),
1007
1005
  loader: "js"
1008
1006
  };
1009
1007
  }
@@ -1019,7 +1017,7 @@ var init_angularLinkerPlugin = __esm(() => {
1019
1017
  fileSystem: {
1020
1018
  dirname: dirname2,
1021
1019
  exists: existsSync7,
1022
- readFile: readFileSync3,
1020
+ readFile: readFileSync4,
1023
1021
  relative: relative2,
1024
1022
  resolve: resolve5
1025
1023
  },
@@ -170561,12 +170559,12 @@ __export(exports_compileAngular, {
170561
170559
  compileAngularFile: () => compileAngularFile,
170562
170560
  compileAngular: () => compileAngular
170563
170561
  });
170564
- import { existsSync as existsSync10, readFileSync as readFileSync4, promises as fs } from "fs";
170562
+ import { existsSync as existsSync10, readFileSync as readFileSync5, promises as fs } from "fs";
170565
170563
  import { join as join8, basename as basename4, sep as sep2, dirname as dirname5, resolve as resolve10, relative as relative6 } from "path";
170566
170564
  import { createHash as createHash2 } from "crypto";
170567
170565
  var import_typescript, computeConfigHash = () => {
170568
170566
  try {
170569
- const content = readFileSync4("./tsconfig.json", "utf-8");
170567
+ const content = readFileSync5("./tsconfig.json", "utf-8");
170570
170568
  return createHash2("md5").update(content).digest("hex");
170571
170569
  } catch {
170572
170570
  return "";
@@ -171120,11 +171118,11 @@ var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"
171120
171118
  console.warn("\u26A0\uFE0F Vue vendor build had errors:", result.logs);
171121
171119
  return;
171122
171120
  }
171123
- const { readFileSync: readFileSync5, writeFileSync: writeFileSync3, readdirSync } = await import("fs");
171121
+ const { readFileSync: readFileSync6, writeFileSync: writeFileSync3, readdirSync } = await import("fs");
171124
171122
  const files = readdirSync(vendorDir).filter((f) => f.endsWith(".js"));
171125
171123
  for (const file4 of files) {
171126
171124
  const filePath = join11(vendorDir, file4);
171127
- const content = readFileSync5(filePath, "utf-8");
171125
+ const content = readFileSync6(filePath, "utf-8");
171128
171126
  if (!content.includes("__VUE_HMR_RUNTIME__"))
171129
171127
  continue;
171130
171128
  const patched = content.replace(/getGlobalThis\(\)\.__VUE_HMR_RUNTIME__\s*=\s*\{/, "getGlobalThis().__VUE_HMR_RUNTIME__ = getGlobalThis().__VUE_HMR_RUNTIME__ || {");
@@ -171246,7 +171244,7 @@ import {
171246
171244
  copyFileSync,
171247
171245
  cpSync,
171248
171246
  mkdirSync as mkdirSync8,
171249
- readFileSync as readFileSync5,
171247
+ readFileSync as readFileSync6,
171250
171248
  rmSync,
171251
171249
  writeFileSync as writeFileSync3
171252
171250
  } from "fs";
@@ -171749,7 +171747,7 @@ var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental
171749
171747
  const injectHMRIntoHTMLFile = (filePath, framework) => {
171750
171748
  if (!hmrClientBundle)
171751
171749
  return;
171752
- let html = readFileSync5(filePath, "utf-8");
171750
+ let html = readFileSync6(filePath, "utf-8");
171753
171751
  if (html.includes("data-hmr-client"))
171754
171752
  return;
171755
171753
  const tag = `<script>window.__HMR_FRAMEWORK__="${framework}";</script><script data-hmr-client>${hmrClientBundle}</script>`;
@@ -171821,7 +171819,7 @@ var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental
171821
171819
  const indexFiles = readDir(reactIndexesPath).filter((f) => f.endsWith(".tsx"));
171822
171820
  const pagesRel = relative7(process.cwd(), resolve11(reactPagesPath)).replace(/\\/g, "/");
171823
171821
  for (const file4 of indexFiles) {
171824
- let content = readFileSync5(join13(reactIndexesPath, file4), "utf-8");
171822
+ let content = readFileSync6(join13(reactIndexesPath, file4), "utf-8");
171825
171823
  content = content.replace(/from\s*['"]\.\.\/pages\/([^'"]+)['"]/g, `from '/@src/${pagesRel}/$1'`);
171826
171824
  writeFileSync3(join13(devIndexDir, file4), content);
171827
171825
  }
@@ -171847,6 +171845,7 @@ var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental
171847
171845
  return manifest;
171848
171846
  };
171849
171847
  var init_build = __esm(() => {
171848
+ init_freshReadPlugin();
171850
171849
  init_generateManifest();
171851
171850
  init_generateReactIndexes();
171852
171851
  init_htmlScriptHMRPlugin();
@@ -171872,7 +171871,7 @@ var init_build = __esm(() => {
171872
171871
  });
171873
171872
 
171874
171873
  // src/dev/dependencyGraph.ts
171875
- import { existsSync as existsSync11, readFileSync as readFileSync6 } from "fs";
171874
+ import { existsSync as existsSync11, readFileSync as readFileSync7 } from "fs";
171876
171875
  var {Glob: Glob6 } = globalThis.Bun;
171877
171876
  import { resolve as resolve12 } from "path";
171878
171877
  var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath) => {
@@ -172039,15 +172038,15 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
172039
172038
  const lowerPath = filePath.toLowerCase();
172040
172039
  const isSvelteOrVue = lowerPath.endsWith(".svelte") || lowerPath.endsWith(".vue");
172041
172040
  if (loader === "html") {
172042
- const content = readFileSync6(filePath, "utf-8");
172041
+ const content = readFileSync7(filePath, "utf-8");
172043
172042
  return extractHtmlDependencies(filePath, content);
172044
172043
  }
172045
172044
  if (loader === "tsx" || loader === "js") {
172046
- const content = readFileSync6(filePath, "utf-8");
172045
+ const content = readFileSync7(filePath, "utf-8");
172047
172046
  return extractJsDependencies(filePath, content, loader);
172048
172047
  }
172049
172048
  if (isSvelteOrVue) {
172050
- const content = readFileSync6(filePath, "utf-8");
172049
+ const content = readFileSync7(filePath, "utf-8");
172051
172050
  return extractSvelteVueDependencies(filePath, content);
172052
172051
  }
172053
172052
  return [];
@@ -172482,10 +172481,10 @@ var init_assetStore = __esm(() => {
172482
172481
  });
172483
172482
 
172484
172483
  // src/dev/fileHashTracker.ts
172485
- import { readFileSync as readFileSync7 } from "fs";
172484
+ import { readFileSync as readFileSync8 } from "fs";
172486
172485
  var computeFileHash = (filePath) => {
172487
172486
  try {
172488
- const fileContent = readFileSync7(filePath);
172487
+ const fileContent = readFileSync8(filePath);
172489
172488
  return Number(Bun.hash(fileContent));
172490
172489
  } catch {
172491
172490
  return UNFOUND_INDEX;
@@ -172797,7 +172796,7 @@ var init_registerClientScript = __esm(() => {
172797
172796
  });
172798
172797
 
172799
172798
  // src/angular/injectorPatch.ts
172800
- import { readFileSync as readFileSync8, writeFileSync as writeFileSync4 } from "fs";
172799
+ import { readFileSync as readFileSync9, writeFileSync as writeFileSync4 } from "fs";
172801
172800
  import { dirname as dirname6, join as join15 } from "path";
172802
172801
  var applyInjectorPatch = (chunkPath, content) => {
172803
172802
  if (content.includes('Symbol.for("angular.currentInjector")')) {
@@ -172837,7 +172836,7 @@ var applyInjectorPatch = (chunkPath, content) => {
172837
172836
  try {
172838
172837
  const coreDir = dirname6(__require.resolve("@angular/core/package.json"));
172839
172838
  const chunkPath = join15(coreDir, "fesm2022", "_not_found-chunk.mjs");
172840
- const content = readFileSync8(chunkPath, "utf-8");
172839
+ const content = readFileSync9(chunkPath, "utf-8");
172841
172840
  applyInjectorPatch(chunkPath, content);
172842
172841
  } catch {}
172843
172842
  };
@@ -202397,7 +202396,7 @@ __export(exports_moduleServer, {
202397
202396
  createModuleServer: () => createModuleServer,
202398
202397
  SRC_URL_PREFIX: () => SRC_URL_PREFIX
202399
202398
  });
202400
- import { existsSync as existsSync13, readFileSync as readFileSync9, statSync } from "fs";
202399
+ import { existsSync as existsSync13, readFileSync as readFileSync10, statSync } from "fs";
202401
202400
  import { basename as basename7, dirname as dirname7, extname as extname3, resolve as resolve18, relative as relative8 } from "path";
202402
202401
  var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
202403
202402
  const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
@@ -202552,7 +202551,7 @@ ${stubs}
202552
202551
  `) + `
202553
202552
  ` + code;
202554
202553
  }, reactTranspiler, transformReactFile = (filePath, projectRoot, rewriter) => {
202555
- const raw = readFileSync9(filePath, "utf-8");
202554
+ const raw = readFileSync10(filePath, "utf-8");
202556
202555
  const valueExports = tsxTranspiler.scan(raw).exports;
202557
202556
  let transpiled = reactTranspiler.transformSync(raw);
202558
202557
  transpiled = preserveTypeExports(raw, transpiled, valueExports);
@@ -202567,7 +202566,7 @@ ${stubs}
202567
202566
  transpiled = transpiled.replace(/\binput\.tsx:/g, `${relPath}:`);
202568
202567
  return rewriteImports2(transpiled, filePath, projectRoot, rewriter);
202569
202568
  }, transformPlainFile = (filePath, projectRoot, rewriter) => {
202570
- const raw = readFileSync9(filePath, "utf-8");
202569
+ const raw = readFileSync10(filePath, "utf-8");
202571
202570
  const ext = extname3(filePath);
202572
202571
  const isTS = ext === ".ts" || ext === ".tsx";
202573
202572
  const isTSX = ext === ".tsx" || ext === ".jsx";
@@ -202606,7 +202605,7 @@ ${stubs}
202606
202605
  }
202607
202606
  }
202608
202607
  }, transformSvelteFile = async (filePath, projectRoot, rewriter) => {
202609
- const raw = readFileSync9(filePath, "utf-8");
202608
+ const raw = readFileSync10(filePath, "utf-8");
202610
202609
  if (!svelteCompiler) {
202611
202610
  svelteCompiler = await import("svelte/compiler");
202612
202611
  }
@@ -202642,7 +202641,7 @@ ${code}`;
202642
202641
  }
202643
202642
  return rewriteImports2(code, filePath, projectRoot, rewriter);
202644
202643
  }, transformVueFile = async (filePath, projectRoot, rewriter, vueDir) => {
202645
- const raw = readFileSync9(filePath, "utf-8");
202644
+ const raw = readFileSync10(filePath, "utf-8");
202646
202645
  if (!vueCompiler) {
202647
202646
  vueCompiler = await import("@vue/compiler-sfc");
202648
202647
  }
@@ -202725,7 +202724,7 @@ ${code}`;
202725
202724
  "Content-Type": "application/javascript"
202726
202725
  }
202727
202726
  }), handleCssRequest = (filePath) => {
202728
- const raw = readFileSync9(filePath, "utf-8");
202727
+ const raw = readFileSync10(filePath, "utf-8");
202729
202728
  const escaped = raw.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
202730
202729
  return [
202731
202730
  `const style = document.createElement('style');`,
@@ -204557,13 +204556,13 @@ var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g,
204557
204556
  });
204558
204557
  await rm9(tmpDir, { force: true, recursive: true });
204559
204558
  if (result.success) {
204560
- const { readdirSync, readFileSync: readFileSync10, writeFileSync: writeFileSync5 } = await import("fs");
204559
+ const { readdirSync, readFileSync: readFileSync11, writeFileSync: writeFileSync5 } = await import("fs");
204561
204560
  const { computeVendorPaths: computeVendorPaths2 } = await Promise.resolve().then(() => (init_buildReactVendor(), exports_buildReactVendor));
204562
204561
  const reactPaths = computeVendorPaths2();
204563
204562
  const files = readdirSync(vendorDir).filter((f) => f.endsWith(".js"));
204564
204563
  for (const file4 of files) {
204565
204564
  const filePath = join16(vendorDir, file4);
204566
- let content = readFileSync10(filePath, "utf-8");
204565
+ let content = readFileSync11(filePath, "utf-8");
204567
204566
  let changed = false;
204568
204567
  for (const [specifier, webPath] of Object.entries(reactPaths)) {
204569
204568
  const escaped = specifier.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
@@ -205045,7 +205044,7 @@ var handleReactPageRequest = async (PageComponent, index, ...props) => {
205045
205044
  var handleHTMLPageRequest = (pagePath) => file(pagePath);
205046
205045
  var handleHTMXPageRequest = (pagePath) => file(pagePath);
205047
205046
  // src/core/prepare.ts
205048
- import { readFileSync as readFileSync10 } from "fs";
205047
+ import { readFileSync as readFileSync11 } from "fs";
205049
205048
  import { relative as relative11, resolve as resolve23 } from "path";
205050
205049
 
205051
205050
  // src/utils/loadConfig.ts
@@ -205144,7 +205143,7 @@ var prepare = async (configOrPath) => {
205144
205143
  absolutejs: (app) => hmrPlugin(app.use(staticPlugin2({ assets: buildDir, prefix: "" })))
205145
205144
  };
205146
205145
  }
205147
- const manifest = JSON.parse(readFileSync10(`${buildDir}/manifest.json`, "utf-8"));
205146
+ const manifest = JSON.parse(readFileSync11(`${buildDir}/manifest.json`, "utf-8"));
205148
205147
  const { staticPlugin } = await import("@elysiajs/static");
205149
205148
  const absolutejs = staticPlugin({ assets: buildDir, prefix: "" });
205150
205149
  return { absolutejs, manifest };
@@ -205305,5 +205304,5 @@ export {
205305
205304
  ANGULAR_INIT_TIMEOUT_MS
205306
205305
  };
205307
205306
 
205308
- //# debugId=6029E224354C289564756E2164756E21
205307
+ //# debugId=156C748734E19FF364756E2164756E21
205309
205308
  //# sourceMappingURL=index.js.map