@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
@@ -154,7 +154,22 @@ export type BaseBuildConfig = {
154
154
  incrementalFiles?: string[];
155
155
  mode?: 'production' | 'development';
156
156
  dev?: {
157
+ /** Dev server port (env: ABSOLUTE_PORT, default 3000). */
158
+ port?: number;
159
+ /** When `port` is busy, probe up to `portRange-1` neighboring ports
160
+ * before failing (env: ABSOLUTE_PORT_RANGE, default 10). */
161
+ portRange?: number;
162
+ /** When true, refuse to start if `port` is busy instead of falling
163
+ * through to the next free port (env: ABSOLUTE_STRICT_PORT, default false). */
164
+ strictPort?: boolean;
165
+ /** Bind host (env: ABSOLUTE_HOST, default "localhost"). */
166
+ host?: string;
157
167
  https?: boolean;
168
+ /** Extra directories to add to the dev file watcher's positive
169
+ * include list. Anything outside the configured framework dirs,
170
+ * conventional source dirs (`src/`, `db/`, `assets/`, `styles/`),
171
+ * and these `watchDirs` is implicitly ignored. */
172
+ watchDirs?: string[];
158
173
  devtools?: {
159
174
  projectRoot?: string;
160
175
  uuid?: string;
@@ -67,6 +67,15 @@ declare global {
67
67
  __ANGULAR_HMR__?: {
68
68
  register: (id: string, ctor: unknown) => void;
69
69
  applyUpdate: (id: string, newCtor: unknown) => boolean;
70
+ applyStyleUpdate: (id: string, newCtor: unknown) => boolean;
71
+ applyTemplateUpdate: (id: string, newCtor: unknown) => boolean;
72
+ applyServiceUpdate: (id: string, newCtor: unknown) => boolean;
73
+ beginStyleUpdateBatch: () => void;
74
+ endStyleUpdateBatch: () => Array<{ id: string; ok: boolean }>;
75
+ beginTemplateUpdateBatch: () => void;
76
+ endTemplateUpdateBatch: () => Array<{ id: string; ok: boolean }>;
77
+ beginServiceUpdateBatch: () => void;
78
+ endServiceUpdateBatch: () => Array<{ id: string; ok: boolean }>;
70
79
  refresh: () => void;
71
80
  getStats: () => { componentCount: number; updateCount: number };
72
81
  getRegistry: () => Map<
@@ -85,6 +94,9 @@ declare global {
85
94
  ) => void;
86
95
  hasPageExportsChanged: (sourceId: string) => boolean;
87
96
  };
97
+ __ANGULAR_HMR_STYLE_UPDATE_MODE__?: boolean;
98
+ __ANGULAR_HMR_TEMPLATE_UPDATE_MODE__?: boolean;
99
+ __ANGULAR_HMR_SERVICE_UPDATE_MODE__?: boolean;
88
100
  __VUE_APP__?:
89
101
  | ({
90
102
  unmount: () => void;
package/dist/vue/index.js CHANGED
@@ -1162,6 +1162,9 @@ var resolveAngularPackageDir = (specifier) => {
1162
1162
  };
1163
1163
  var init_resolveAngularPackage = () => {};
1164
1164
 
1165
+ // src/utils/runtimeMode.ts
1166
+ var ENV_VAR = "NODE_ENV", isProductionRuntime = () => process.env[ENV_VAR] === "production", isDevelopmentRuntime = () => process.env[ENV_VAR] === "development";
1167
+
1165
1168
  // src/angular/angularPatch.ts
1166
1169
  var exports_angularPatch = {};
1167
1170
  __export(exports_angularPatch, {
@@ -1244,7 +1247,8 @@ var ensureHead = (doc) => {
1244
1247
  }
1245
1248
  layoutPatchApplied = true;
1246
1249
  }, applyPatches = async () => {
1247
- const { \u{275}DominoAdapter } = await import(resolveAngularRuntimePath("@angular/platform-server"));
1250
+ const spec = isProductionRuntime() ? resolveAngularRuntimePath("@angular/platform-server") : "@angular/platform-server";
1251
+ const { \u{275}DominoAdapter } = await import(spec);
1248
1252
  if (!\u{275}DominoAdapter?.prototype) {
1249
1253
  console.warn("[Angular Patch] \u0275DominoAdapter not found, skipping patches");
1250
1254
  return false;
@@ -1311,18 +1315,21 @@ var initDominoAdapter = (platformServer) => {
1311
1315
  console.error("Failed to initialize DominoAdapter:", err);
1312
1316
  }
1313
1317
  }, loadAngularDeps = async () => {
1314
- if (true) {
1315
- await import(resolveAngularRuntimePath("@angular/compiler"));
1318
+ if (!isProductionRuntime()) {
1319
+ await import("@angular/compiler");
1316
1320
  }
1317
1321
  const { applyPatches: applyPatches2 } = await Promise.resolve().then(() => (init_angularPatch(), exports_angularPatch));
1318
1322
  await applyPatches2();
1323
+ const useBareSpecifiers = !isProductionRuntime();
1319
1324
  const [platformBrowser, platformServer, common, core] = await Promise.all([
1320
- import(resolveAngularRuntimePath("@angular/platform-browser")),
1321
- import(resolveAngularRuntimePath("@angular/platform-server")),
1322
- import(resolveAngularRuntimePath("@angular/common")),
1323
- import(resolveAngularRuntimePath("@angular/core"))
1325
+ useBareSpecifiers ? import("@angular/platform-browser") : import(resolveAngularRuntimePath("@angular/platform-browser")),
1326
+ useBareSpecifiers ? import("@angular/platform-server") : import(resolveAngularRuntimePath("@angular/platform-server")),
1327
+ useBareSpecifiers ? import("@angular/common") : import(resolveAngularRuntimePath("@angular/common")),
1328
+ useBareSpecifiers ? import("@angular/core") : import(resolveAngularRuntimePath("@angular/core"))
1324
1329
  ]);
1325
- if (false) {}
1330
+ if (!isDevelopmentRuntime()) {
1331
+ core.enableProdMode();
1332
+ }
1326
1333
  initDominoAdapter(platformServer);
1327
1334
  return {
1328
1335
  APP_BASE_HREF: common.APP_BASE_HREF,
@@ -2399,6 +2406,18 @@ ${contents}` : contents, normalizePostcssModule = (mod) => {
2399
2406
  return runPostcss(await readFile(filePath, "utf-8"), filePath, config);
2400
2407
  }
2401
2408
  return compileStyleSource(filePath, undefined, undefined, config);
2409
+ }, CSS_IMPORT_PATTERN, resolveCssImportsSync = (content, baseDir, visited) => {
2410
+ return content.replace(CSS_IMPORT_PATTERN, (match, importPath) => {
2411
+ const fullPath = isAbsolute(importPath) ? importPath : resolve3(baseDir, importPath);
2412
+ if (visited.has(fullPath))
2413
+ return "";
2414
+ if (!existsSync3(fullPath))
2415
+ return match;
2416
+ const nextVisited = new Set(visited);
2417
+ nextVisited.add(fullPath);
2418
+ const imported = readFileSync3(fullPath, "utf-8");
2419
+ return resolveCssImportsSync(imported, dirname2(fullPath), nextVisited);
2420
+ });
2402
2421
  }, compileStyleFileIfNeededSync = (filePath, config) => {
2403
2422
  const rawContents = readFileSync3(filePath, "utf-8");
2404
2423
  const language = getStyleLanguage(filePath);
@@ -2416,7 +2435,7 @@ ${contents}` : contents, normalizePostcssModule = (mod) => {
2416
2435
  }
2417
2436
  const contents = withAdditionalData(rawContents, options.additionalData);
2418
2437
  const loadPaths = normalizeLoadPaths(filePath, options.loadPaths);
2419
- return sass.compileString(contents, {
2438
+ const compiled = sass.compileString(contents, {
2420
2439
  importers: [
2421
2440
  createSassImporter(filePath, loadPaths, language, config)
2422
2441
  ],
@@ -2425,6 +2444,7 @@ ${contents}` : contents, normalizePostcssModule = (mod) => {
2425
2444
  syntax: language === "sass" ? "indented" : "scss",
2426
2445
  url: new URL(`file://${filePath}`)
2427
2446
  }).css;
2447
+ return resolveCssImportsSync(compiled, dirname2(filePath), new Set([filePath]));
2428
2448
  }
2429
2449
  if (language === "less") {
2430
2450
  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.`);
@@ -2432,7 +2452,7 @@ ${contents}` : contents, normalizePostcssModule = (mod) => {
2432
2452
  if (language === "stylus") {
2433
2453
  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.`);
2434
2454
  }
2435
- return rawContents;
2455
+ return resolveCssImportsSync(rawContents, dirname2(filePath), new Set([filePath]));
2436
2456
  }, getCssOutputExtension = (filePath) => isPreprocessableStylePath(filePath) ? ".css" : extname(filePath);
2437
2457
  var init_stylePreprocessor = __esm(() => {
2438
2458
  CSS_EXTENSION_PATTERN = /\.css$/i;
@@ -2445,6 +2465,7 @@ var init_stylePreprocessor = __esm(() => {
2445
2465
  styleDependencyGraph = new Map;
2446
2466
  styleOutputHashes = new Map;
2447
2467
  stylePreprocessorPlugin = createStylePreprocessorPlugin();
2468
+ CSS_IMPORT_PATTERN = /@import\s+["']([^"']+)["']\s*;?/g;
2448
2469
  });
2449
2470
 
2450
2471
  // src/core/svelteServerModule.ts
@@ -4361,5 +4382,5 @@ export {
4361
4382
  Image
4362
4383
  };
4363
4384
 
4364
- //# debugId=12D756F847558C9864756E2164756E21
4385
+ //# debugId=FF18F3AE9B56CF9D64756E2164756E21
4365
4386
  //# sourceMappingURL=index.js.map