refactor(ivy): rename ngtsc/factories to ngtsc/shims (#26495)
This simple refactor of the build rules renames the .ngfactory.js shim generator to 'shims' instead of 'factories', in preparation for adding .ngsummary.js shim generation. Testing strategy: this commit does not introduce any new behavior and merely moves files and symbols around. It's sufficient that the existing ngtsc tests pass. PR Close #26495
This commit is contained in:
parent
1700bd6f08
commit
0b885ecaf7
@ -27,8 +27,8 @@ ts_library(
|
|||||||
"//packages/compiler",
|
"//packages/compiler",
|
||||||
"//packages/compiler-cli/src/ngtsc/annotations",
|
"//packages/compiler-cli/src/ngtsc/annotations",
|
||||||
"//packages/compiler-cli/src/ngtsc/diagnostics",
|
"//packages/compiler-cli/src/ngtsc/diagnostics",
|
||||||
"//packages/compiler-cli/src/ngtsc/factories",
|
|
||||||
"//packages/compiler-cli/src/ngtsc/metadata",
|
"//packages/compiler-cli/src/ngtsc/metadata",
|
||||||
|
"//packages/compiler-cli/src/ngtsc/shims",
|
||||||
"//packages/compiler-cli/src/ngtsc/switch",
|
"//packages/compiler-cli/src/ngtsc/switch",
|
||||||
"//packages/compiler-cli/src/ngtsc/transform",
|
"//packages/compiler-cli/src/ngtsc/transform",
|
||||||
"//packages/compiler-cli/src/ngtsc/typecheck",
|
"//packages/compiler-cli/src/ngtsc/typecheck",
|
||||||
|
@ -15,9 +15,9 @@ import {nocollapseHack} from '../transformers/nocollapse_hack';
|
|||||||
|
|
||||||
import {ComponentDecoratorHandler, DirectiveDecoratorHandler, InjectableDecoratorHandler, NgModuleDecoratorHandler, PipeDecoratorHandler, ResourceLoader, SelectorScopeRegistry} from './annotations';
|
import {ComponentDecoratorHandler, DirectiveDecoratorHandler, InjectableDecoratorHandler, NgModuleDecoratorHandler, PipeDecoratorHandler, ResourceLoader, SelectorScopeRegistry} from './annotations';
|
||||||
import {BaseDefDecoratorHandler} from './annotations/src/base_def';
|
import {BaseDefDecoratorHandler} from './annotations/src/base_def';
|
||||||
import {FactoryGenerator, FactoryInfo, GeneratedFactoryHostWrapper, generatedFactoryTransform} from './factories';
|
|
||||||
import {TypeScriptReflectionHost} from './metadata';
|
import {TypeScriptReflectionHost} from './metadata';
|
||||||
import {FileResourceLoader, HostResourceLoader} from './resource_loader';
|
import {FileResourceLoader, HostResourceLoader} from './resource_loader';
|
||||||
|
import {FactoryGenerator, FactoryInfo, GeneratedShimsHostWrapper, generatedFactoryTransform} from './shims';
|
||||||
import {ivySwitchTransform} from './switch';
|
import {ivySwitchTransform} from './switch';
|
||||||
import {IvyCompilation, ivyTransformFactory} from './transform';
|
import {IvyCompilation, ivyTransformFactory} from './transform';
|
||||||
import {TypeCheckContext, TypeCheckProgramHost} from './typecheck';
|
import {TypeCheckContext, TypeCheckProgramHost} from './typecheck';
|
||||||
@ -65,7 +65,7 @@ export class NgtscProgram implements api.Program {
|
|||||||
this.sourceToFactorySymbols !.set(sourceFilePath, moduleSymbolNames);
|
this.sourceToFactorySymbols !.set(sourceFilePath, moduleSymbolNames);
|
||||||
this.factoryToSourceInfo !.set(factoryPath, {sourceFilePath, moduleSymbolNames});
|
this.factoryToSourceInfo !.set(factoryPath, {sourceFilePath, moduleSymbolNames});
|
||||||
});
|
});
|
||||||
this.host = new GeneratedFactoryHostWrapper(host, generator, factoryFileMap);
|
this.host = new GeneratedShimsHostWrapper(host, generator, factoryFileMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.tsProgram =
|
this.tsProgram =
|
||||||
|
@ -3,12 +3,12 @@ package(default_visibility = ["//visibility:public"])
|
|||||||
load("//tools:defaults.bzl", "ts_library")
|
load("//tools:defaults.bzl", "ts_library")
|
||||||
|
|
||||||
ts_library(
|
ts_library(
|
||||||
name = "factories",
|
name = "shims",
|
||||||
srcs = glob([
|
srcs = glob([
|
||||||
"index.ts",
|
"index.ts",
|
||||||
"src/**/*.ts",
|
"src/**/*.ts",
|
||||||
]),
|
]),
|
||||||
module_name = "@angular/compiler-cli/src/ngtsc/factories",
|
module_name = "@angular/compiler-cli/src/ngtsc/shims",
|
||||||
deps = [
|
deps = [
|
||||||
"//packages/compiler",
|
"//packages/compiler",
|
||||||
"//packages/compiler-cli/src/ngtsc/host",
|
"//packages/compiler-cli/src/ngtsc/host",
|
@ -9,5 +9,5 @@
|
|||||||
/// <reference types="node" />
|
/// <reference types="node" />
|
||||||
|
|
||||||
export {FactoryGenerator} from './src/generator';
|
export {FactoryGenerator} from './src/generator';
|
||||||
export {GeneratedFactoryHostWrapper} from './src/host';
|
export {GeneratedShimsHostWrapper} from './src/host';
|
||||||
export {FactoryInfo, generatedFactoryTransform} from './src/transform';
|
export {FactoryInfo, generatedFactoryTransform} from './src/transform';
|
@ -14,7 +14,7 @@ import {FactoryGenerator} from './generator';
|
|||||||
/**
|
/**
|
||||||
* A wrapper around a `ts.CompilerHost` which supports generated files.
|
* A wrapper around a `ts.CompilerHost` which supports generated files.
|
||||||
*/
|
*/
|
||||||
export class GeneratedFactoryHostWrapper implements ts.CompilerHost {
|
export class GeneratedShimsHostWrapper implements ts.CompilerHost {
|
||||||
constructor(
|
constructor(
|
||||||
private delegate: ts.CompilerHost, private generator: FactoryGenerator,
|
private delegate: ts.CompilerHost, private generator: FactoryGenerator,
|
||||||
private factoryToSourceMap: Map<string, string>) {
|
private factoryToSourceMap: Map<string, string>) {
|
Loading…
x
Reference in New Issue
Block a user