@absolutejs/absolute 0.19.0-beta.971 → 0.19.0-beta.973

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.
@@ -1,7 +1,3 @@
1
1
  import type { EnvironmentProviders, Provider } from '@angular/core';
2
- /** Derive the manifest key (PascalCase basename) from the page's
3
- * resolved source path. Matches `generateManifest`'s convention for
4
- * Angular `pages/` so `home/home.ts` → `Home`,
5
- * `portal/portal.ts` → `Portal`, etc. */
6
2
  export declare const manifestKeyForPagePath: (pageSourcePath: string) => string;
7
3
  export declare const loadPageProviders: (pageSourcePath: string) => Promise<ReadonlyArray<Provider | EnvironmentProviders>>;
@@ -1,3 +1,4 @@
1
+ import type { AngularProvidersImport } from './parseAngularConfigImports';
1
2
  import type { AngularHandlerCall } from './scanAngularHandlerCalls';
2
3
  import { type AngularPageRoutes } from './scanAngularPageRoutes';
3
4
  export type EmittedProvidersFile = {
@@ -12,10 +13,13 @@ export type EmittedProvidersFile = {
12
13
  hasProviders: boolean;
13
14
  };
14
15
  export type EmitAngularProvidersOptions = {
15
- /** Project-relative path to the global providers module (exports
16
- * `appProviders`). The emitted files re-import it so each page's
17
- * generated providers always include the user's global setup. */
18
- providersImport?: string;
16
+ /** AST-extracted import info for the user's `angular.providers`
17
+ * binding (from absolute.config.ts). Each emitted file re-imports
18
+ * the same binding by its source path so pages and per-handler
19
+ * calls never write providers themselves. Null when the config
20
+ * doesn't set `angular.providers` — the emitter skips the global
21
+ * import. */
22
+ providersImport?: AngularProvidersImport | null;
19
23
  };
20
24
  export declare const emitAngularProvidersFiles: (projectRoot: string, calls: AngularHandlerCall[], pageRoutes: AngularPageRoutes[], options?: EmitAngularProvidersOptions) => EmittedProvidersFile[];
21
25
  /** Absolute path of the directory the emitter writes to. Exposed so other
@@ -0,0 +1,9 @@
1
+ export type AngularProvidersImport = {
2
+ /** Local binding name as referenced in the config (e.g. `appProviders`). */
3
+ bindingName: string;
4
+ /** Original exported name on the source module. */
5
+ importedName: string;
6
+ /** Resolved absolute path to the providers module (no extension). */
7
+ absolutePath: string;
8
+ };
9
+ export declare const parseAngularProvidersImport: (projectRoot: string) => AngularProvidersImport | null;
@@ -9,11 +9,4 @@ export type AngularHandlerScanResult = {
9
9
  * client bundle can import. */
10
10
  manifestKeysWithProviders: Set<string>;
11
11
  };
12
- export type AngularHandlerScanOptions = {
13
- /** Project-relative path to the user's global Angular providers
14
- * module (must export `appProviders`). When set, every generated
15
- * providers file re-imports it so pages and per-handler calls
16
- * never write providers themselves. */
17
- providersImport?: string;
18
- };
19
- export declare const runAngularHandlerScan: (projectRoot: string, angularDirectory: string, options?: AngularHandlerScanOptions) => AngularHandlerScanResult;
12
+ export declare const runAngularHandlerScan: (projectRoot: string, angularDirectory: string) => AngularHandlerScanResult;
@@ -13,7 +13,7 @@ export declare const loadConfig: (configPath?: string) => Promise<{
13
13
  vueDirectory?: string;
14
14
  angularDirectory?: string;
15
15
  angular?: {
16
- providersImport?: string;
16
+ providers?: ReadonlyArray<import("@angular/core").Provider | import("@angular/core").EnvironmentProviders>;
17
17
  };
18
18
  astroDirectory?: string;
19
19
  svelteDirectory?: string;
@@ -135,16 +135,18 @@ export type BaseBuildConfig = {
135
135
  reactDirectory?: string;
136
136
  vueDirectory?: string;
137
137
  angularDirectory?: string;
138
- /** Per-framework Angular config. Currently exposes `providersImport`
139
- * a project-relative path to a module that exports `appProviders`
140
- * (the global default DI providers every page receives at SSR + client
141
- * bootstrap). The framework imports this module from both the
142
- * generated client bundle and the SSR handler so the two trees are
143
- * identical. Per-page additions (e.g. `provideRouter(routes)`) come
144
- * from page-level `export const routes` and are auto-wired by the
145
- * build users never write `provideRouter` themselves. */
138
+ /** Per-framework Angular config. `providers` is the global default
139
+ * DI provider array every page gets at SSR + client bootstrap.
140
+ * Write it as a real typed value (`providers: appProviders`) so
141
+ * TypeScript catches a missing import or renamed binding at
142
+ * compile time. The framework AST-parses absolute.config.ts at
143
+ * build time to find the import path of the binding referenced
144
+ * here, then bakes a matching import into every per-page generated
145
+ * providers file. Per-page additions (e.g. `provideRouter(routes)`)
146
+ * come from page-level `export const routes` and are auto-wired by
147
+ * the build — users never write `provideRouter` themselves. */
146
148
  angular?: {
147
- providersImport?: string;
149
+ providers?: ReadonlyArray<import('@angular/core').Provider | import('@angular/core').EnvironmentProviders>;
148
150
  };
149
151
  astroDirectory?: string;
150
152
  svelteDirectory?: string;
package/package.json CHANGED
@@ -402,5 +402,5 @@
402
402
  ]
403
403
  }
404
404
  },
405
- "version": "0.19.0-beta.971"
405
+ "version": "0.19.0-beta.973"
406
406
  }