@absolutejs/absolute 0.19.0-beta.970 → 0.19.0-beta.972

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.
@@ -0,0 +1,7 @@
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
+ export declare const manifestKeyForPagePath: (pageSourcePath: string) => string;
7
+ 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 = {
@@ -11,7 +12,16 @@ export type EmittedProvidersFile = {
11
12
  /** `true` when the call carried a `providers:` argument. */
12
13
  hasProviders: boolean;
13
14
  };
14
- export declare const emitAngularProvidersFiles: (projectRoot: string, calls: AngularHandlerCall[], pageRoutes: AngularPageRoutes[]) => EmittedProvidersFile[];
15
+ export type EmitAngularProvidersOptions = {
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;
23
+ };
24
+ export declare const emitAngularProvidersFiles: (projectRoot: string, calls: AngularHandlerCall[], pageRoutes: AngularPageRoutes[], options?: EmitAngularProvidersOptions) => EmittedProvidersFile[];
15
25
  /** Absolute path of the directory the emitter writes to. Exposed so other
16
26
  * build steps (`compileAngular`'s client wrapper, the SSR `pageHandler`)
17
27
  * can compute relative paths to the generated files without hard-coding
@@ -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;
@@ -12,6 +12,9 @@ export declare const loadConfig: (configPath?: string) => Promise<{
12
12
  reactDirectory?: string;
13
13
  vueDirectory?: string;
14
14
  angularDirectory?: string;
15
+ angular?: {
16
+ providers?: ReadonlyArray<import("@angular/core").Provider | import("@angular/core").EnvironmentProviders>;
17
+ };
15
18
  astroDirectory?: string;
16
19
  svelteDirectory?: string;
17
20
  emberDirectory?: string;
@@ -135,6 +135,19 @@ export type BaseBuildConfig = {
135
135
  reactDirectory?: string;
136
136
  vueDirectory?: string;
137
137
  angularDirectory?: string;
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. */
148
+ angular?: {
149
+ providers?: ReadonlyArray<import('@angular/core').Provider | import('@angular/core').EnvironmentProviders>;
150
+ };
138
151
  astroDirectory?: string;
139
152
  svelteDirectory?: string;
140
153
  emberDirectory?: string;
package/package.json CHANGED
@@ -402,5 +402,5 @@
402
402
  ]
403
403
  }
404
404
  },
405
- "version": "0.19.0-beta.970"
405
+ "version": "0.19.0-beta.972"
406
406
  }