Expose `createHybridCompiler` factory function to construct a `HybridCompiler`
configured with compiler options read from `IAnalyzer.getCompilerOptions()`.
Add `keepAnalyzerAlive` option to `RunOptions` in `run()` to allow persistent
worker hosts to keep the analysis sidecar open across multiple compilation requests.
Moves the diagnostic codes source of truth from ngtsc into the Rust side of the preprocessor. We generate a TS file from them for the cases where the codes need to be used in TS.
Integrations such as bundlers and the Angular CLI may have no tsconfig at all, or already own
the parsed configuration. The analyzer can now be constructed from options alone.
`AnalyzerOptions.tsconfigPath` is now optional, and three options replace what could
previously only come from the tsconfig:
- `entryPoints`: the roots of the program closure. When set, they replace the tsconfig's root
files, and the roots are no longer re-read from the tsconfig after file updates (the same
holds after `setEntryPoints`). Bundlers pass their own entry files; the analyzer follows
imports from there. The `.d.ts` files a tsconfig lists are still searched for ambient
modules either way.
- `r3SymbolsFile`: the `r3_symbols.ts` file used when compiling `@angular/core` itself, which
was only found by scanning the root files for that name. The scan remains the fallback.
- `implicitStandalone`: whether declarations without an explicit `standalone` flag are
standalone, which was only derived from `angularCompilerOptions._angularCoreVersion`. The
tsconfig value remains the fallback, and the default is `true`.
`setEntryPoints` is now exposed on every backend (N-API, WASM and the sidecar) and on
`IAnalyzer`, so integrations that discover entry files incrementally can replace the roots
after construction. Like `updateFileContent`, it returns every path whose cached analysis is
now stale.
`createAnalyzer` and `createAnalyzerWithInfo` also accept a single options object in which
`tsconfigPath` is optional, alongside the existing tsconfig-path form, which is unchanged.
Without a tsconfig, every unset option takes its documented default (matching the defaults of
an empty tsconfig), path-valued options must be absolute since there is no directory to
resolve them against, and the module resolver runs without tsconfig `paths` mappings.
Behavior is unchanged when a tsconfig is given and the new options are unset.
The preprocessor analyzer could only be configured by reading a tsconfig, which prevents
integrations (bundlers, the Angular CLI) that have no tsconfig or already own the parsed
configuration from driving it directly. This is the first step toward making the analyzer
tsconfig-agnostic.
Every setting that was previously only read from the tsconfig is now also an explicit
`AnalyzerOptions` field: `strictStandalone`, `strictInjectionParameters`,
`compileNonExportedClasses` and `generateExtraImportsInLocalMode`. Settings that only
configure the built-in file-system module resolution move into a separate `defaultHost`
(`rootDirs`, `preserveSymlinks`, `nodeModulesPathOverride`), since they will belong to the
default host rather than the analyzer core once resolution is delegated to a host.
`importPrefixRoots` replaces the ambiguously named `rootDirs` option, which only ever
configured the `PrefixImportStrategy` roots. The previous `rootDirs` and top-level
`nodeModulesPathOverride` fields remain as deprecated aliases.
All new fields are optional and fall back to the tsconfig; an explicitly set option always
wins. Construction is split into `EffectiveConfig::resolve`, the single place where options
are merged over tsconfig values, and `Analyzer::construct`, which preserves the previous
construction order. Behavior is unchanged when no new options are set.
`LoadAnalyzerOptions` now extends the engine's `AnalyzerOptions` and the loader forwards
engine options as-is instead of copying a fixed subset of fields, so new engine options are
usable through `createAnalyzer()` without loader changes. `SidecarAnalyzer.initialize`
forwards any additional engine options the same way.
Implements AST-only and scope-aware extended template diagnostics,
template variable write checks, and unused standalone import checks
in the NGP preprocessor.
- Add Bazel (`dist/bin/packages/compiler-cli/preprocessor/ng-analyze/ng_analyze_wasm/ng_analyze_wasm.js`) and bundled (`../ng-analyze/ng_analyze_wasm/ng_analyze_wasm.js`) WASM binding candidates to `wasmCandidates()` in `analyzer_loader.ts` so `createAnalyzer(..., {backend: 'wasm'})` and `main.ts --wasm` locate the Bazel-built WASM binary without requiring an explicit `wasmBinding` path.
- Wire `options.sidecar` in `test/utils.ts` (`runPipeline`) to spawn `SidecarAnalyzer` (`ng_analyze_bin`) so `t4_tri_modal_parity_audit` in `test/resource_resolution_spec.ts` compares WASM vs. Sidecar output rather than comparing WASM against itself.
- Deduplicate `refName` and `refToExpression` in `processor.ts` by importing them from `compiler-utils.ts`.
- Remove unused `_workspaceName` and `_rootDirs` parameters from `prepareTcbTargets` in `tcb.ts` and its call sites.
- Remove unused imports, interfaces (`ImportViaMetadata`), fields (`FileAnalysis.typeOnlyExports`), variables (`IGNORE_MARKER_REGEX`, `currentTcbUri`, `GOLDEN_ROOT`), and helper functions (`collectGoldenCases()`, `flatten()`).
- Fix outdated comments, typos, and Vitest/standalone repo references.
Add synchronous execution paths to WasmAnalyzer, HybridCompiler, and processor so synchronous compiler test harnesses can invoke the WASM analyzer and preprocessor without async bridging.
PR Close#71313