@absolutejs/absolute 0.19.0-beta.845 → 0.19.0-beta.847

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.
Files changed (37) hide show
  1. package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
  2. package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
  3. package/dist/angular/index.js +45 -23
  4. package/dist/angular/index.js.map +11 -10
  5. package/dist/angular/server.js +45 -23
  6. package/dist/angular/server.js.map +11 -10
  7. package/dist/build.js +955 -498
  8. package/dist/build.js.map +16 -13
  9. package/dist/cli/index.js +547 -286
  10. package/dist/client/index.js +16 -9
  11. package/dist/client/index.js.map +6 -5
  12. package/dist/dev/client/handlers/angular.ts +309 -19
  13. package/dist/dev/client/handlers/angularRuntime.ts +468 -0
  14. package/dist/dev/client/hmrToast.ts +150 -0
  15. package/dist/index.js +1002 -545
  16. package/dist/index.js.map +17 -14
  17. package/dist/islands/index.js +32 -11
  18. package/dist/islands/index.js.map +7 -6
  19. package/dist/react/index.js +32 -11
  20. package/dist/react/index.js.map +7 -6
  21. package/dist/src/build/rewriteImports.d.ts +6 -14
  22. package/dist/src/build/rewriteImportsPlugin.d.ts +48 -0
  23. package/dist/src/dev/angular/editTypeDetection.d.ts +8 -0
  24. package/dist/src/dev/pathUtils.d.ts +3 -0
  25. package/dist/src/utils/buildDirectoryLock.d.ts +26 -3
  26. package/dist/src/utils/loadConfig.d.ts +5 -0
  27. package/dist/src/utils/resolveDevPort.d.ts +21 -0
  28. package/dist/src/utils/runtimeMode.d.ts +3 -0
  29. package/dist/svelte/index.js +32 -11
  30. package/dist/svelte/index.js.map +7 -6
  31. package/dist/svelte/server.js +17 -3
  32. package/dist/svelte/server.js.map +3 -3
  33. package/dist/types/build.d.ts +15 -0
  34. package/dist/types/globals.d.ts +12 -0
  35. package/dist/vue/index.js +32 -11
  36. package/dist/vue/index.js.map +7 -6
  37. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  var __require = import.meta.require;
3
3
 
4
- // .angular-partial-tmp-hqZBPm/src/core/streamingSlotRegistrar.ts
4
+ // .angular-partial-tmp-COIC1V/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-hqZBPm/src/core/streamingSlotRegistrar.ts
4
+ // .angular-partial-tmp-COIC1V/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-hqZBPm/src/core/streamingSlotRegistry.ts
51
+ // .angular-partial-tmp-COIC1V/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";
@@ -274,6 +274,9 @@ var resolveAngularPackageDir = (specifier) => {
274
274
  };
275
275
  var init_resolveAngularPackage = () => {};
276
276
 
277
+ // src/utils/runtimeMode.ts
278
+ var ENV_VAR = "NODE_ENV", isProductionRuntime = () => process.env[ENV_VAR] === "production", isDevelopmentRuntime = () => process.env[ENV_VAR] === "development";
279
+
277
280
  // src/angular/angularPatch.ts
278
281
  var exports_angularPatch = {};
279
282
  __export(exports_angularPatch, {
@@ -356,7 +359,8 @@ var ensureHead = (doc) => {
356
359
  }
357
360
  layoutPatchApplied = true;
358
361
  }, applyPatches = async () => {
359
- const { \u{275}DominoAdapter } = await import(resolveAngularRuntimePath("@angular/platform-server"));
362
+ const spec = isProductionRuntime() ? resolveAngularRuntimePath("@angular/platform-server") : "@angular/platform-server";
363
+ const { \u{275}DominoAdapter } = await import(spec);
360
364
  if (!\u{275}DominoAdapter?.prototype) {
361
365
  console.warn("[Angular Patch] \u0275DominoAdapter not found, skipping patches");
362
366
  return false;
@@ -423,18 +427,21 @@ var initDominoAdapter = (platformServer) => {
423
427
  console.error("Failed to initialize DominoAdapter:", err);
424
428
  }
425
429
  }, loadAngularDeps = async () => {
426
- if (true) {
427
- await import(resolveAngularRuntimePath("@angular/compiler"));
430
+ if (!isProductionRuntime()) {
431
+ await import("@angular/compiler");
428
432
  }
429
433
  const { applyPatches: applyPatches2 } = await Promise.resolve().then(() => (init_angularPatch(), exports_angularPatch));
430
434
  await applyPatches2();
435
+ const useBareSpecifiers = !isProductionRuntime();
431
436
  const [platformBrowser, platformServer, common, core] = await Promise.all([
432
- import(resolveAngularRuntimePath("@angular/platform-browser")),
433
- import(resolveAngularRuntimePath("@angular/platform-server")),
434
- import(resolveAngularRuntimePath("@angular/common")),
435
- import(resolveAngularRuntimePath("@angular/core"))
437
+ useBareSpecifiers ? import("@angular/platform-browser") : import(resolveAngularRuntimePath("@angular/platform-browser")),
438
+ useBareSpecifiers ? import("@angular/platform-server") : import(resolveAngularRuntimePath("@angular/platform-server")),
439
+ useBareSpecifiers ? import("@angular/common") : import(resolveAngularRuntimePath("@angular/common")),
440
+ useBareSpecifiers ? import("@angular/core") : import(resolveAngularRuntimePath("@angular/core"))
436
441
  ]);
437
- if (false) {}
442
+ if (!isDevelopmentRuntime()) {
443
+ core.enableProdMode();
444
+ }
438
445
  initDominoAdapter(platformServer);
439
446
  return {
440
447
  APP_BASE_HREF: common.APP_BASE_HREF,
@@ -1428,6 +1435,18 @@ ${contents}` : contents, normalizePostcssModule = (mod) => {
1428
1435
  return runPostcss(await readFile(filePath, "utf-8"), filePath, config);
1429
1436
  }
1430
1437
  return compileStyleSource(filePath, undefined, undefined, config);
1438
+ }, CSS_IMPORT_PATTERN, resolveCssImportsSync = (content, baseDir, visited) => {
1439
+ return content.replace(CSS_IMPORT_PATTERN, (match, importPath) => {
1440
+ const fullPath = isAbsolute(importPath) ? importPath : resolve3(baseDir, importPath);
1441
+ if (visited.has(fullPath))
1442
+ return "";
1443
+ if (!existsSync3(fullPath))
1444
+ return match;
1445
+ const nextVisited = new Set(visited);
1446
+ nextVisited.add(fullPath);
1447
+ const imported = readFileSync3(fullPath, "utf-8");
1448
+ return resolveCssImportsSync(imported, dirname(fullPath), nextVisited);
1449
+ });
1431
1450
  }, compileStyleFileIfNeededSync = (filePath, config) => {
1432
1451
  const rawContents = readFileSync3(filePath, "utf-8");
1433
1452
  const language = getStyleLanguage(filePath);
@@ -1445,7 +1464,7 @@ ${contents}` : contents, normalizePostcssModule = (mod) => {
1445
1464
  }
1446
1465
  const contents = withAdditionalData(rawContents, options.additionalData);
1447
1466
  const loadPaths = normalizeLoadPaths(filePath, options.loadPaths);
1448
- return sass.compileString(contents, {
1467
+ const compiled = sass.compileString(contents, {
1449
1468
  importers: [
1450
1469
  createSassImporter(filePath, loadPaths, language, config)
1451
1470
  ],
@@ -1454,6 +1473,7 @@ ${contents}` : contents, normalizePostcssModule = (mod) => {
1454
1473
  syntax: language === "sass" ? "indented" : "scss",
1455
1474
  url: new URL(`file://${filePath}`)
1456
1475
  }).css;
1476
+ return resolveCssImportsSync(compiled, dirname(filePath), new Set([filePath]));
1457
1477
  }
1458
1478
  if (language === "less") {
1459
1479
  throw new Error(`Unable to compile ${filePath}: Less styleUrl preprocessing is async-only. Import the Less file from a bundled entrypoint or use SCSS/CSS for Angular styleUrl.`);
@@ -1461,7 +1481,7 @@ ${contents}` : contents, normalizePostcssModule = (mod) => {
1461
1481
  if (language === "stylus") {
1462
1482
  throw new Error(`Unable to compile ${filePath}: Stylus styleUrl preprocessing is async-only. Import the Stylus file from a bundled entrypoint or use SCSS/CSS for Angular styleUrl.`);
1463
1483
  }
1464
- return rawContents;
1484
+ return resolveCssImportsSync(rawContents, dirname(filePath), new Set([filePath]));
1465
1485
  }, getCssOutputExtension = (filePath) => isPreprocessableStylePath(filePath) ? ".css" : extname(filePath);
1466
1486
  var init_stylePreprocessor = __esm(() => {
1467
1487
  CSS_EXTENSION_PATTERN = /\.css$/i;
@@ -1474,6 +1494,7 @@ var init_stylePreprocessor = __esm(() => {
1474
1494
  styleDependencyGraph = new Map;
1475
1495
  styleOutputHashes = new Map;
1476
1496
  stylePreprocessorPlugin = createStylePreprocessorPlugin();
1497
+ CSS_IMPORT_PATTERN = /@import\s+["']([^"']+)["']\s*;?/g;
1477
1498
  });
1478
1499
 
1479
1500
  // src/core/svelteServerModule.ts
@@ -3444,16 +3465,16 @@ var traceAngularPhase = async (name, fn, metadata) => {
3444
3465
  return fromNodeModules;
3445
3466
  return resolve5(import.meta.dir, "./dev/client");
3446
3467
  }, devClientDir, hmrClientPath, hmrRuntimePath, injectHMRRegistration = (content, sourceId) => {
3447
- const componentClassRegex = /(?:export\s+)?class\s+(\w+Component)\s/g;
3448
- const componentNames = [];
3468
+ const entityClassRegex = /(?:export\s+)?class\s+(\w+(?:Component|Service|Directive|Pipe))\s/g;
3469
+ const entityNames = [];
3449
3470
  let match;
3450
- while ((match = componentClassRegex.exec(content)) !== null) {
3471
+ while ((match = entityClassRegex.exec(content)) !== null) {
3451
3472
  if (match[1])
3452
- componentNames.push(match[1]);
3473
+ entityNames.push(match[1]);
3453
3474
  }
3454
- if (componentNames.length === 0)
3475
+ if (entityNames.length === 0)
3455
3476
  return content;
3456
- const registrations = componentNames.map((name) => ` if (typeof ${name} === 'function') window.__ANGULAR_HMR__.register('${sourceId}#${name}', ${name});`).join(`
3477
+ const registrations = entityNames.map((name) => ` if (typeof ${name} === 'function') window.__ANGULAR_HMR__.register('${sourceId}#${name}', ${name});`).join(`
3457
3478
  `);
3458
3479
  const hmrBlock = `
3459
3480
  // Angular HMR Runtime Layer (Level 3) \u2014 Auto-registration
@@ -14079,7 +14100,8 @@ init_angularDeps();
14079
14100
  init_resolveAngularPackage();
14080
14101
  var noopAnimationProvidersPromise = null;
14081
14102
  var loadNoopAnimationProviders = async () => {
14082
- const animations = await import(resolveAngularRuntimePath("@angular/platform-browser/animations"));
14103
+ const spec = isProductionRuntime() ? resolveAngularRuntimePath("@angular/platform-browser/animations") : "@angular/platform-browser/animations";
14104
+ const animations = await import(spec);
14083
14105
  return animations.provideNoopAnimations();
14084
14106
  };
14085
14107
  var buildServerAnimationProviders = (usesLegacyAnimations) => {
@@ -14128,7 +14150,8 @@ var buildRedirectEventHandler = (responseInit, routerModule) => {
14128
14150
  var buildRouterRedirectProviders = async (deps, responseInit) => {
14129
14151
  let routerModule;
14130
14152
  try {
14131
- routerModule = await import(resolveAngularRuntimePath("@angular/router"));
14153
+ const spec = isProductionRuntime() ? resolveAngularRuntimePath("@angular/router") : "@angular/router";
14154
+ routerModule = await import(spec);
14132
14155
  } catch {
14133
14156
  return [];
14134
14157
  }
@@ -14397,7 +14420,6 @@ var runWithStreamingSlotWarningScope = (task, metadata) => ensureWarningStorage(
14397
14420
  // src/angular/pageHandler.ts
14398
14421
  init_ssrCache();
14399
14422
  init_ssrRender();
14400
- init_resolveAngularPackage();
14401
14423
  var lastSelector = "angular-page";
14402
14424
  var isRecord5 = (value) => typeof value === "object" && value !== null;
14403
14425
  var isAngularComponent2 = (value) => typeof value === "function";
@@ -14418,10 +14440,10 @@ var resolvePageComponent = (pageModule) => {
14418
14440
  };
14419
14441
  var compilerImportPromise = null;
14420
14442
  var ensureAngularCompiler = () => {
14421
- if (false)
14422
- ;
14443
+ if (isProductionRuntime())
14444
+ return Promise.resolve();
14423
14445
  if (!compilerImportPromise) {
14424
- compilerImportPromise = import(resolveAngularRuntimePath("@angular/compiler"));
14446
+ compilerImportPromise = import("@angular/compiler");
14425
14447
  }
14426
14448
  return compilerImportPromise;
14427
14449
  };
@@ -14982,5 +15004,5 @@ export {
14982
15004
  ABSOLUTE_HTTP_TRANSFER_CACHE_SKIP_HEADER
14983
15005
  };
14984
15006
 
14985
- //# debugId=3A516C93259CE34264756E2164756E21
15007
+ //# debugId=6F99FC8C0F34774664756E2164756E21
14986
15008
  //# sourceMappingURL=index.js.map