@absolutejs/absolute 0.17.5 → 0.17.7

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/cli/index.js CHANGED
@@ -972,7 +972,12 @@ import { resolve as resolve5 } from "path";
972
972
  var loadConfig = async (configPath2) => {
973
973
  const resolved = resolve5(configPath2 ?? process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
974
974
  const mod = await import(resolved);
975
- return mod.config;
975
+ const config = mod.default ?? mod.config;
976
+ if (!config) {
977
+ throw new Error(`Config file "${resolved}" does not export a valid configuration.
978
+ Expected: export default defineConfig({ ... })`);
979
+ }
980
+ return config;
976
981
  };
977
982
 
978
983
  // src/cli/scripts/start.ts
@@ -1001,8 +1006,20 @@ var start = async (serverEntry, outdir, configPath2) => {
1001
1006
  try {
1002
1007
  const buildConfig = await loadConfig(configPath2);
1003
1008
  buildConfig.buildDirectory = resolvedOutdir;
1004
- const buildModule = "../../core/build";
1005
- const { build } = await import(buildModule);
1009
+ const candidates = [
1010
+ resolve6(import.meta.dir, "..", "..", "core", "build"),
1011
+ resolve6(import.meta.dir, "..", "build")
1012
+ ];
1013
+ let build;
1014
+ for (const candidate of candidates) {
1015
+ try {
1016
+ const mod = await import(candidate);
1017
+ build = mod.build;
1018
+ break;
1019
+ } catch {}
1020
+ }
1021
+ if (!build)
1022
+ throw new Error("Could not locate build module");
1006
1023
  await build(buildConfig);
1007
1024
  } catch (err) {
1008
1025
  console.error(cliTag2("\x1B[31m", "Build step failed."));
package/dist/index.js CHANGED
@@ -69472,17 +69472,21 @@ var require_lib27 = __commonJS((exports) => {
69472
69472
  import { existsSync as existsSync4, mkdirSync as mkdirSync2, readFileSync as readFileSync3, writeFileSync as writeFileSync2 } from "fs";
69473
69473
  import { dirname, join as join3, relative, resolve as resolve5 } from "path";
69474
69474
  import { createHash } from "crypto";
69475
- import { needsLinking } from "@angular/compiler-cli/linker";
69476
69475
  var CACHE_DIR, angularLinkerPlugin;
69477
69476
  var init_angularLinkerPlugin = __esm(() => {
69478
69477
  CACHE_DIR = resolve5(".cache", "angular-linker");
69479
69478
  angularLinkerPlugin = {
69480
69479
  name: "angular-linker",
69481
69480
  setup(bld) {
69481
+ let needsLinking;
69482
69482
  let babelTransform;
69483
69483
  let linkerPlugin;
69484
69484
  bld.onLoad({ filter: /[\\/]@angular[\\/].*\.m?js$/ }, async (args) => {
69485
69485
  const source = await Bun.file(args.path).text();
69486
+ if (!needsLinking) {
69487
+ const mod = await import("@angular/compiler-cli/linker");
69488
+ needsLinking = mod.needsLinking;
69489
+ }
69486
69490
  if (!needsLinking(args.path, source)) {
69487
69491
  return;
69488
69492
  }
@@ -271299,7 +271303,12 @@ import { resolve } from "path";
271299
271303
  var loadConfig = async (configPath) => {
271300
271304
  const resolved = resolve(configPath ?? process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
271301
271305
  const mod = await import(resolved);
271302
- return mod.config;
271306
+ const config = mod.default ?? mod.config;
271307
+ if (!config) {
271308
+ throw new Error(`Config file "${resolved}" does not export a valid configuration.
271309
+ Expected: export default defineConfig({ ... })`);
271310
+ }
271311
+ return config;
271303
271312
  };
271304
271313
 
271305
271314
  // src/core/prepare.ts
@@ -271386,6 +271395,8 @@ var networking = (app) => app.listen({
271386
271395
  version
271387
271396
  });
271388
271397
  });
271398
+ // src/utils/defineConfig.ts
271399
+ var defineConfig = (config) => config;
271389
271400
  // src/utils/getEnv.ts
271390
271401
  var {env: env4 } = globalThis.Bun;
271391
271402
  var getEnv = (key) => {
@@ -271424,6 +271435,7 @@ export {
271424
271435
  getAllNetworkIPs,
271425
271436
  generateHeadElement,
271426
271437
  generateClientScriptCode,
271438
+ defineConfig,
271427
271439
  clearAllClientScripts,
271428
271440
  asset,
271429
271441
  WS_READY_STATE_OPEN,
@@ -271441,5 +271453,5 @@ export {
271441
271453
  BUN_BUILD_WARNING_SUPPRESSION
271442
271454
  };
271443
271455
 
271444
- //# debugId=F70DF4BFBC659D4964756E2164756E21
271456
+ //# debugId=6A55DE3F62E246D064756E2164756E21
271445
271457
  //# sourceMappingURL=index.js.map