@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
@@ -152,6 +152,9 @@ var resolveAngularPackageDir = (specifier) => {
152
152
  };
153
153
  var init_resolveAngularPackage = () => {};
154
154
 
155
+ // src/utils/runtimeMode.ts
156
+ var ENV_VAR = "NODE_ENV", isProductionRuntime = () => process.env[ENV_VAR] === "production", isDevelopmentRuntime = () => process.env[ENV_VAR] === "development";
157
+
155
158
  // src/angular/angularPatch.ts
156
159
  var exports_angularPatch = {};
157
160
  __export(exports_angularPatch, {
@@ -234,7 +237,8 @@ var ensureHead = (doc) => {
234
237
  }
235
238
  layoutPatchApplied = true;
236
239
  }, applyPatches = async () => {
237
- const { \u{275}DominoAdapter } = await import(resolveAngularRuntimePath("@angular/platform-server"));
240
+ const spec = isProductionRuntime() ? resolveAngularRuntimePath("@angular/platform-server") : "@angular/platform-server";
241
+ const { \u{275}DominoAdapter } = await import(spec);
238
242
  if (!\u{275}DominoAdapter?.prototype) {
239
243
  console.warn("[Angular Patch] \u0275DominoAdapter not found, skipping patches");
240
244
  return false;
@@ -301,18 +305,21 @@ var initDominoAdapter = (platformServer) => {
301
305
  console.error("Failed to initialize DominoAdapter:", err);
302
306
  }
303
307
  }, loadAngularDeps = async () => {
304
- if (true) {
305
- await import(resolveAngularRuntimePath("@angular/compiler"));
308
+ if (!isProductionRuntime()) {
309
+ await import("@angular/compiler");
306
310
  }
307
311
  const { applyPatches: applyPatches2 } = await Promise.resolve().then(() => (init_angularPatch(), exports_angularPatch));
308
312
  await applyPatches2();
313
+ const useBareSpecifiers = !isProductionRuntime();
309
314
  const [platformBrowser, platformServer, common, core] = await Promise.all([
310
- import(resolveAngularRuntimePath("@angular/platform-browser")),
311
- import(resolveAngularRuntimePath("@angular/platform-server")),
312
- import(resolveAngularRuntimePath("@angular/common")),
313
- import(resolveAngularRuntimePath("@angular/core"))
315
+ useBareSpecifiers ? import("@angular/platform-browser") : import(resolveAngularRuntimePath("@angular/platform-browser")),
316
+ useBareSpecifiers ? import("@angular/platform-server") : import(resolveAngularRuntimePath("@angular/platform-server")),
317
+ useBareSpecifiers ? import("@angular/common") : import(resolveAngularRuntimePath("@angular/common")),
318
+ useBareSpecifiers ? import("@angular/core") : import(resolveAngularRuntimePath("@angular/core"))
314
319
  ]);
315
- if (false) {}
320
+ if (!isDevelopmentRuntime()) {
321
+ core.enableProdMode();
322
+ }
316
323
  initDominoAdapter(platformServer);
317
324
  return {
318
325
  APP_BASE_HREF: common.APP_BASE_HREF,
@@ -1416,6 +1423,18 @@ ${contents}` : contents, normalizePostcssModule = (mod) => {
1416
1423
  return runPostcss(await readFile(filePath, "utf-8"), filePath, config);
1417
1424
  }
1418
1425
  return compileStyleSource(filePath, undefined, undefined, config);
1426
+ }, CSS_IMPORT_PATTERN, resolveCssImportsSync = (content, baseDir, visited) => {
1427
+ return content.replace(CSS_IMPORT_PATTERN, (match, importPath) => {
1428
+ const fullPath = isAbsolute(importPath) ? importPath : resolve3(baseDir, importPath);
1429
+ if (visited.has(fullPath))
1430
+ return "";
1431
+ if (!existsSync3(fullPath))
1432
+ return match;
1433
+ const nextVisited = new Set(visited);
1434
+ nextVisited.add(fullPath);
1435
+ const imported = readFileSync3(fullPath, "utf-8");
1436
+ return resolveCssImportsSync(imported, dirname(fullPath), nextVisited);
1437
+ });
1419
1438
  }, compileStyleFileIfNeededSync = (filePath, config) => {
1420
1439
  const rawContents = readFileSync3(filePath, "utf-8");
1421
1440
  const language = getStyleLanguage(filePath);
@@ -1433,7 +1452,7 @@ ${contents}` : contents, normalizePostcssModule = (mod) => {
1433
1452
  }
1434
1453
  const contents = withAdditionalData(rawContents, options.additionalData);
1435
1454
  const loadPaths = normalizeLoadPaths(filePath, options.loadPaths);
1436
- return sass.compileString(contents, {
1455
+ const compiled = sass.compileString(contents, {
1437
1456
  importers: [
1438
1457
  createSassImporter(filePath, loadPaths, language, config)
1439
1458
  ],
@@ -1442,6 +1461,7 @@ ${contents}` : contents, normalizePostcssModule = (mod) => {
1442
1461
  syntax: language === "sass" ? "indented" : "scss",
1443
1462
  url: new URL(`file://${filePath}`)
1444
1463
  }).css;
1464
+ return resolveCssImportsSync(compiled, dirname(filePath), new Set([filePath]));
1445
1465
  }
1446
1466
  if (language === "less") {
1447
1467
  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.`);
@@ -1449,7 +1469,7 @@ ${contents}` : contents, normalizePostcssModule = (mod) => {
1449
1469
  if (language === "stylus") {
1450
1470
  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.`);
1451
1471
  }
1452
- return rawContents;
1472
+ return resolveCssImportsSync(rawContents, dirname(filePath), new Set([filePath]));
1453
1473
  }, getCssOutputExtension = (filePath) => isPreprocessableStylePath(filePath) ? ".css" : extname(filePath);
1454
1474
  var init_stylePreprocessor = __esm(() => {
1455
1475
  CSS_EXTENSION_PATTERN = /\.css$/i;
@@ -1462,6 +1482,7 @@ var init_stylePreprocessor = __esm(() => {
1462
1482
  styleDependencyGraph = new Map;
1463
1483
  styleOutputHashes = new Map;
1464
1484
  stylePreprocessorPlugin = createStylePreprocessorPlugin();
1485
+ CSS_IMPORT_PATTERN = /@import\s+["']([^"']+)["']\s*;?/g;
1465
1486
  });
1466
1487
 
1467
1488
  // src/core/svelteServerModule.ts
@@ -1913,5 +1934,5 @@ export {
1913
1934
  createIslandStore
1914
1935
  };
1915
1936
 
1916
- //# debugId=11285801557540EF64756E2164756E21
1937
+ //# debugId=5F21E5EDECC6E1BB64756E2164756E21
1917
1938
  //# sourceMappingURL=index.js.map