@analogjs/vite-plugin-angular 2.5.0-beta.42 → 2.5.0-beta.44
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.
- package/README.md +22 -0
- package/package.json +5 -4
- package/src/lib/angular-vite-plugin.d.ts +12 -7
- package/src/lib/angular-vite-plugin.js +7 -7
- package/src/lib/angular-vite-plugin.js.map +1 -1
- package/src/lib/compiler/angular-version.d.ts +19 -0
- package/src/lib/compiler/angular-version.js +42 -0
- package/src/lib/compiler/angular-version.js.map +1 -0
- package/src/lib/compiler/class-field-lowering.d.ts +23 -0
- package/src/lib/compiler/class-field-lowering.js +213 -0
- package/src/lib/compiler/class-field-lowering.js.map +1 -0
- package/src/lib/compiler/compile.d.ts +44 -0
- package/src/lib/compiler/compile.js +1160 -0
- package/src/lib/compiler/compile.js.map +1 -0
- package/src/lib/compiler/constants.d.ts +18 -0
- package/src/lib/compiler/constants.js +48 -0
- package/src/lib/compiler/constants.js.map +1 -0
- package/src/lib/compiler/debug.d.ts +22 -0
- package/src/lib/compiler/debug.js +35 -0
- package/src/lib/compiler/debug.js.map +1 -0
- package/src/lib/compiler/defer.d.ts +47 -0
- package/src/lib/compiler/defer.js +203 -0
- package/src/lib/compiler/defer.js.map +1 -0
- package/src/lib/compiler/dts-reader.d.ts +35 -0
- package/src/lib/compiler/dts-reader.js +526 -0
- package/src/lib/compiler/dts-reader.js.map +1 -0
- package/src/lib/compiler/hmr.d.ts +16 -0
- package/src/lib/compiler/hmr.js +80 -0
- package/src/lib/compiler/hmr.js.map +1 -0
- package/src/lib/compiler/index.d.ts +7 -0
- package/src/lib/compiler/index.js +8 -0
- package/src/lib/compiler/index.js.map +1 -0
- package/src/lib/compiler/jit-metadata.d.ts +14 -0
- package/src/lib/compiler/jit-metadata.js +224 -0
- package/src/lib/compiler/jit-metadata.js.map +1 -0
- package/src/lib/compiler/jit-transform.d.ts +24 -0
- package/src/lib/compiler/jit-transform.js +269 -0
- package/src/lib/compiler/jit-transform.js.map +1 -0
- package/src/lib/compiler/js-emitter.d.ts +10 -0
- package/src/lib/compiler/js-emitter.js +502 -0
- package/src/lib/compiler/js-emitter.js.map +1 -0
- package/src/lib/compiler/metadata.d.ts +57 -0
- package/src/lib/compiler/metadata.js +894 -0
- package/src/lib/compiler/metadata.js.map +1 -0
- package/src/lib/compiler/registry.d.ts +49 -0
- package/src/lib/compiler/registry.js +273 -0
- package/src/lib/compiler/registry.js.map +1 -0
- package/src/lib/compiler/resource-inliner.d.ts +21 -0
- package/src/lib/compiler/resource-inliner.js +200 -0
- package/src/lib/compiler/resource-inliner.js.map +1 -0
- package/src/lib/compiler/style-ast.d.ts +8 -0
- package/src/lib/compiler/style-ast.js +110 -0
- package/src/lib/compiler/style-ast.js.map +1 -0
- package/src/lib/compiler/styles.d.ts +13 -0
- package/src/lib/compiler/styles.js +60 -0
- package/src/lib/compiler/styles.js.map +1 -0
- package/src/lib/compiler/test-helpers.d.ts +7 -0
- package/src/lib/compiler/test-helpers.js +28 -0
- package/src/lib/compiler/test-helpers.js.map +1 -0
- package/src/lib/compiler/type-elision.d.ts +26 -0
- package/src/lib/compiler/type-elision.js +313 -0
- package/src/lib/compiler/type-elision.js.map +1 -0
- package/src/lib/compiler/utils.d.ts +10 -0
- package/src/lib/compiler/utils.js +95 -0
- package/src/lib/compiler/utils.js.map +1 -0
- package/src/lib/{analog-compiler-plugin.d.ts → fast-compile-plugin.d.ts} +3 -3
- package/src/lib/{analog-compiler-plugin.js → fast-compile-plugin.js} +31 -31
- package/src/lib/fast-compile-plugin.js.map +1 -0
- package/src/lib/utils/virtual-resources.js +1 -1
- package/src/lib/utils/virtual-resources.js.map +1 -1
- package/src/lib/analog-compiler-plugin.js.map +0 -1
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import MagicString from 'magic-string';
|
|
2
|
+
import { ComponentRegistry } from './registry.js';
|
|
3
|
+
/**
|
|
4
|
+
* COMPLETE EXHAUSTIVE ANGULAR LITE COMPILER
|
|
5
|
+
* Translates Angular Decorators + Signals to Ivy Static Definitions.
|
|
6
|
+
*
|
|
7
|
+
* @param registry - Optional external registry from the global analysis plugin.
|
|
8
|
+
* When provided, used to resolve component/directive selectors for template compilation.
|
|
9
|
+
*/
|
|
10
|
+
export interface CompileResult {
|
|
11
|
+
code: string;
|
|
12
|
+
/** Source map for the transformation */
|
|
13
|
+
map: ReturnType<MagicString['generateMap']>;
|
|
14
|
+
/** Absolute paths of external resources (templateUrl, styleUrl) read during compilation */
|
|
15
|
+
resourceDependencies: string[];
|
|
16
|
+
}
|
|
17
|
+
export interface CompileOptions {
|
|
18
|
+
registry?: ComponentRegistry;
|
|
19
|
+
/** Pre-resolved style contents keyed by absolute file path (e.g. SCSS already compiled to CSS). */
|
|
20
|
+
resolvedStyles?: Map<string, string>;
|
|
21
|
+
/** Pre-processed inline styles (index in styles array → compiled CSS). */
|
|
22
|
+
resolvedInlineStyles?: Map<number, string>;
|
|
23
|
+
/**
|
|
24
|
+
* When `false` (default), instance class field initializers are lowered to
|
|
25
|
+
* constructor assignments (matching TypeScript's `useDefineForClassFields: false`
|
|
26
|
+
* behavior). This is required for Angular's `inject()` and constructor DI to
|
|
27
|
+
* work correctly with the standard Angular tsconfig.
|
|
28
|
+
*/
|
|
29
|
+
useDefineForClassFields?: boolean;
|
|
30
|
+
/** Enable legacy i18n message ID format (default: true). */
|
|
31
|
+
enableI18nLegacyMessageIdFormat?: boolean;
|
|
32
|
+
/** Normalize line endings in ICU expressions (default: true). */
|
|
33
|
+
i18nNormalizeLineEndingsInICUs?: boolean;
|
|
34
|
+
/** Use external IDs in `$localize` calls (for Closure Compiler compatibility). */
|
|
35
|
+
i18nUseExternalIds?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Compilation output mode.
|
|
38
|
+
* - `'full'` (default): Emit final Ivy definitions (`ɵɵdefineComponent`) for application builds.
|
|
39
|
+
* - `'partial'`: Emit partial declarations (`ɵɵngDeclareComponent`) for library publishing.
|
|
40
|
+
* Partial output is version-stable and linked at application build time.
|
|
41
|
+
*/
|
|
42
|
+
compilationMode?: 'full' | 'partial';
|
|
43
|
+
}
|
|
44
|
+
export declare function compile(sourceCode: string, fileName: string, optionsOrRegistry?: CompileOptions | ComponentRegistry): CompileResult;
|