@absolutejs/absolute 0.19.0-beta.81 → 0.19.0-beta.83

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
@@ -203022,7 +203022,7 @@ var init_simpleHTMXHMR = () => {};
203022
203022
  // src/dev/rebuildTrigger.ts
203023
203023
  import { existsSync as existsSync14 } from "fs";
203024
203024
  import { rm as rm8 } from "fs/promises";
203025
- import { basename as basename8, dirname as dirname8, relative as relative9, resolve as resolve20 } from "path";
203025
+ import { basename as basename8, relative as relative9, resolve as resolve20 } from "path";
203026
203026
  var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseErrorLocationFromMessage = (msg) => {
203027
203027
  const pathLineCol = msg.match(/^([^\s:]+):(\d+)(?::(\d+))?/);
203028
203028
  if (pathLineCol) {
@@ -204341,18 +204341,38 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
204341
204341
  };
204342
204342
  let manifest;
204343
204343
  if (hasNonComponentFiles) {
204344
- const workerPath = resolve20(dirname8(new URL(import.meta.url).pathname), "../build/freshBuildWorker.ts");
204345
- const proc = Bun.spawn(["bun", "run", workerPath, JSON.stringify(buildConfig)], { stdout: "pipe", stderr: "pipe" });
204344
+ const tmpConfig = resolve20(process.cwd(), ".absolutejs", "build-config.json");
204345
+ const tmpScript = resolve20(process.cwd(), ".absolutejs", "fresh-build.ts");
204346
+ const { mkdirSync: mkdirSync9, writeFileSync: writeFileSync5 } = await import("fs");
204347
+ mkdirSync9(resolve20(process.cwd(), ".absolutejs"), { recursive: true });
204348
+ writeFileSync5(tmpConfig, JSON.stringify(buildConfig));
204349
+ const escapedConfig = tmpConfig.replace(/\\/g, "\\\\");
204350
+ writeFileSync5(tmpScript, [
204351
+ 'import { build } from "@absolutejs/absolute";',
204352
+ `const config = JSON.parse(await Bun.file("${escapedConfig}").text());`,
204353
+ "const manifest = await build(config);",
204354
+ 'console.log("__MANIFEST__" + JSON.stringify(manifest));'
204355
+ ].join(`
204356
+ `));
204357
+ const proc = Bun.spawn(["bun", "run", tmpScript], {
204358
+ cwd: process.cwd(),
204359
+ stderr: "pipe",
204360
+ stdout: "pipe"
204361
+ });
204346
204362
  const stdout = await new Response(proc.stdout).text();
204347
204363
  const stderr = await new Response(proc.stderr).text();
204348
204364
  await proc.exited;
204349
204365
  if (proc.exitCode !== 0) {
204350
- throw new Error(`Fresh build failed: ${stderr}`);
204351
- }
204352
- const manifestLine = stdout.split(`
204366
+ logWarn(`Fresh build stderr: ${stderr.slice(0, 500)}`);
204367
+ manifest = await build(buildConfig);
204368
+ } else {
204369
+ const manifestLine = stdout.split(`
204353
204370
  `).find((l) => l.startsWith("__MANIFEST__"));
204354
- if (manifestLine) {
204355
- manifest = JSON.parse(manifestLine.slice("__MANIFEST__".length));
204371
+ if (manifestLine) {
204372
+ manifest = JSON.parse(manifestLine.slice("__MANIFEST__".length));
204373
+ } else {
204374
+ manifest = await build(buildConfig);
204375
+ }
204356
204376
  }
204357
204377
  } else {
204358
204378
  manifest = await build(buildConfig);
@@ -204884,5 +204904,5 @@ export {
204884
204904
  build
204885
204905
  };
204886
204906
 
204887
- //# debugId=38E41C9A0485059964756E2164756E21
204907
+ //# debugId=98124A48B5AAEC2D64756E2164756E21
204888
204908
  //# sourceMappingURL=build.js.map