@angular/compiler-cli 2.2.2 → 2.2.3

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.
Files changed (38) hide show
  1. package/index.d.ts +2 -2
  2. package/index.js +6 -6
  3. package/index.js.map +1 -1
  4. package/index.metadata.json +1 -1
  5. package/package.json +4 -4
  6. package/src/codegen.d.ts +10 -6
  7. package/src/codegen.js +75 -27
  8. package/src/codegen.js.map +1 -1
  9. package/src/extract_i18n.js +10 -1
  10. package/src/extract_i18n.js.map +1 -1
  11. package/src/extractor.d.ts +10 -5
  12. package/src/extractor.js +53 -10
  13. package/src/extractor.js.map +1 -1
  14. package/src/main.js +3 -1
  15. package/src/main.js.map +1 -1
  16. package/src/{path_mapped_compiler_host.d.ts → path_mapped_reflector_host.d.ts} +14 -7
  17. package/src/{path_mapped_compiler_host.js → path_mapped_reflector_host.js} +25 -27
  18. package/src/path_mapped_reflector_host.js.map +1 -0
  19. package/src/private_import_core.d.ts +4 -0
  20. package/src/private_import_core.js +1 -0
  21. package/src/private_import_core.js.map +1 -1
  22. package/src/private_import_core.metadata.json +1 -1
  23. package/src/{compiler_host.d.ts → reflector_host.d.ts} +34 -15
  24. package/src/reflector_host.js +324 -0
  25. package/src/reflector_host.js.map +1 -0
  26. package/src/static_reflection_capabilities.d.ts +29 -0
  27. package/src/static_reflection_capabilities.js +57 -0
  28. package/src/static_reflection_capabilities.js.map +1 -0
  29. package/src/static_reflector.d.ts +82 -0
  30. package/src/static_reflector.js +601 -0
  31. package/src/static_reflector.js.map +1 -0
  32. package/src/codegen.metadata.json +0 -1
  33. package/src/compiler_host.js +0 -226
  34. package/src/compiler_host.js.map +0 -1
  35. package/src/compiler_host.metadata.json +0 -1
  36. package/src/extractor.metadata.json +0 -1
  37. package/src/path_mapped_compiler_host.js.map +0 -1
  38. package/src/path_mapped_compiler_host.metadata.json +0 -1
@@ -12,3 +12,7 @@ export declare type ReflectionCapabilities = typeof r._ReflectionCapabilities;
12
12
  export declare var ReflectionCapabilities: typeof r.ReflectionCapabilities;
13
13
  export declare type Console = typeof r._Console;
14
14
  export declare var Console: typeof r.Console;
15
+ export declare var reflector: typeof r.reflector;
16
+ export declare type SetterFn = typeof r._SetterFn;
17
+ export declare type GetterFn = typeof r._GetterFn;
18
+ export declare type MethodFn = typeof r._MethodFn;
@@ -10,4 +10,5 @@ var core_1 = require('@angular/core');
10
10
  exports.ReflectorReader = core_1.__core_private__.ReflectorReader;
11
11
  exports.ReflectionCapabilities = core_1.__core_private__.ReflectionCapabilities;
12
12
  exports.Console = core_1.__core_private__.Console;
13
+ exports.reflector = core_1.__core_private__.reflector;
13
14
  //# sourceMappingURL=private_import_core.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"private_import_core.js","sourceRoot":"/Users/chuckj/src/angular/modules/@angular/compiler-cli/","sources":["src/private_import_core.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;AAEH,qBAAoC,eAAe,CAAC,CAAA;AAGzC,uBAAe,GAA6B,uBAAC,CAAC,eAAe,CAAC;AAG9D,8BAAsB,GAAoC,uBAAC,CAAC,sBAAsB,CAAC;AAGnF,eAAO,GAAqB,uBAAC,CAAC,OAAO,CAAC"}
1
+ {"version":3,"file":"private_import_core.js","sourceRoot":"/Users/vsavkin/projects/angular/modules/@angular/compiler-cli/","sources":["src/private_import_core.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;AAEH,qBAAoC,eAAe,CAAC,CAAA;AAGzC,uBAAe,GAA6B,uBAAC,CAAC,eAAe,CAAC;AAG9D,8BAAsB,GAAoC,uBAAC,CAAC,sBAAsB,CAAC;AAGnF,eAAO,GAAqB,uBAAC,CAAC,OAAO,CAAC;AAEtC,iBAAS,GAAuB,uBAAC,CAAC,SAAS,CAAC"}
@@ -1 +1 @@
1
- {"__symbolic":"module","version":2,"metadata":{"ReflectorReader":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"ReflectorReader"},"ReflectionCapabilities":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"ReflectionCapabilities"},"Console":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"Console"}}}
1
+ {"__symbolic":"module","version":1,"metadata":{"ReflectorReader":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"ReflectorReader"},"ReflectionCapabilities":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"ReflectionCapabilities"},"Console":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"Console"},"reflector":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"___core_private__"},"member":"reflector"}}}
@@ -5,29 +5,38 @@
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
7
7
  */
8
- import { AotCompilerHost } from '@angular/compiler';
8
+ import { ImportGenerator } from '@angular/compiler';
9
9
  import { AngularCompilerOptions, MetadataCollector, ModuleMetadata } from '@angular/tsc-wrapped';
10
10
  import * as ts from 'typescript';
11
- export interface CompilerHostContext {
11
+ import { StaticReflectorHost, StaticSymbol } from './static_reflector';
12
+ export interface ReflectorHostContext {
12
13
  fileExists(fileName: string): boolean;
13
14
  directoryExists(directoryName: string): boolean;
14
15
  readFile(fileName: string): string;
15
- readResource(fileName: string): Promise<string>;
16
16
  assumeFileExists(fileName: string): void;
17
17
  }
18
- export declare class CompilerHost implements AotCompilerHost {
18
+ export declare class ReflectorHost implements StaticReflectorHost, ImportGenerator {
19
19
  protected program: ts.Program;
20
20
  protected compilerHost: ts.CompilerHost;
21
21
  protected options: AngularCompilerOptions;
22
22
  protected metadataCollector: MetadataCollector;
23
- protected context: CompilerHostContext;
23
+ protected context: ReflectorHostContext;
24
24
  private isGenDirChildOfRootDir;
25
25
  protected basePath: string;
26
26
  private genDir;
27
- private resolverCache;
28
- constructor(program: ts.Program, compilerHost: ts.CompilerHost, options: AngularCompilerOptions, context?: CompilerHostContext);
27
+ constructor(program: ts.Program, compilerHost: ts.CompilerHost, options: AngularCompilerOptions, context?: ReflectorHostContext);
28
+ angularImportLocations(): {
29
+ coreDecorators: string;
30
+ diDecorators: string;
31
+ diMetadata: string;
32
+ diOpaqueToken: string;
33
+ animationMetadata: string;
34
+ provider: string;
35
+ };
29
36
  getCanonicalFileName(fileName: string): string;
30
- moduleNameToFileName(m: string, containingFile: string): string;
37
+ protected resolve(m: string, containingFile: string): string;
38
+ protected normalizeAssetUrl(url: string): string;
39
+ protected resolveAssetUrl(url: string, containingFile: string): string;
31
40
  /**
32
41
  * We want a moduleId that will appear in import statements in the generated code.
33
42
  * These need to be in a form that system.js can load, so absolute file paths don't work.
@@ -43,24 +52,34 @@ export declare class CompilerHost implements AotCompilerHost {
43
52
  *
44
53
  * NOTE: (*) the relative path is computed depending on `isGenDirChildOfRootDir`.
45
54
  */
46
- fileNameToModuleName(importedFile: string, containingFile: string): string;
55
+ getImportPath(containingFile: string, importedFile: string): string;
47
56
  private dotRelative(from, to);
48
57
  /**
49
58
  * Moves the path into `genDir` folder while preserving the `node_modules` directory.
50
59
  */
51
60
  private rewriteGenDirPath(filepath);
52
- protected getSourceFile(filePath: string): ts.SourceFile;
53
- getMetadataFor(filePath: string): ModuleMetadata[];
54
- readMetadata(filePath: string, dtsFilePath: string): ModuleMetadata[];
55
- loadResource(filePath: string): Promise<string>;
61
+ findDeclaration(module: string, symbolName: string, containingFile: string, containingModule?: string): StaticSymbol;
62
+ private typeCache;
63
+ private resolverCache;
64
+ /**
65
+ * getStaticSymbol produces a Type whose metadata is known but whose implementation is not loaded.
66
+ * All types passed to the StaticResolver should be pseudo-types returned by this method.
67
+ *
68
+ * @param declarationFile the absolute path of the file where the symbol is declared
69
+ * @param name the name of the type.
70
+ */
71
+ getStaticSymbol(declarationFile: string, name: string, members?: string[]): StaticSymbol;
72
+ getMetadataFor(filePath: string): ModuleMetadata;
73
+ readMetadata(filePath: string): any;
74
+ private getResolverMetadata(filePath);
75
+ protected resolveExportedSymbol(filePath: string, symbolName: string): StaticSymbol;
56
76
  }
57
- export declare class NodeCompilerHostContext implements CompilerHostContext {
77
+ export declare class NodeReflectorHostContext implements ReflectorHostContext {
58
78
  private host;
59
79
  constructor(host: ts.CompilerHost);
60
80
  private assumedExists;
61
81
  fileExists(fileName: string): boolean;
62
82
  directoryExists(directoryName: string): boolean;
63
83
  readFile(fileName: string): string;
64
- readResource(s: string): Promise<string>;
65
84
  assumeFileExists(fileName: string): void;
66
85
  }
@@ -0,0 +1,324 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google Inc. All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.io/license
7
+ */
8
+ "use strict";
9
+ var compiler_1 = require('@angular/compiler');
10
+ var tsc_wrapped_1 = require('@angular/tsc-wrapped');
11
+ var fs = require('fs');
12
+ var path = require('path');
13
+ var ts = require('typescript');
14
+ var static_reflector_1 = require('./static_reflector');
15
+ var EXT = /(\.ts|\.d\.ts|\.js|\.jsx|\.tsx)$/;
16
+ var DTS = /\.d\.ts$/;
17
+ var NODE_MODULES = '/node_modules/';
18
+ var IS_GENERATED = /\.(ngfactory|css(\.shim)?)$/;
19
+ var ReflectorHost = (function () {
20
+ function ReflectorHost(program, compilerHost, options, context) {
21
+ this.program = program;
22
+ this.compilerHost = compilerHost;
23
+ this.options = options;
24
+ this.metadataCollector = new tsc_wrapped_1.MetadataCollector();
25
+ this.typeCache = new Map();
26
+ this.resolverCache = new Map();
27
+ // normalize the path so that it never ends with '/'.
28
+ this.basePath = path.normalize(path.join(this.options.basePath, '.')).replace(/\\/g, '/');
29
+ this.genDir = path.normalize(path.join(this.options.genDir, '.')).replace(/\\/g, '/');
30
+ this.context = context || new NodeReflectorHostContext(compilerHost);
31
+ var genPath = path.relative(this.basePath, this.genDir);
32
+ this.isGenDirChildOfRootDir = genPath === '' || !genPath.startsWith('..');
33
+ }
34
+ ReflectorHost.prototype.angularImportLocations = function () {
35
+ return {
36
+ coreDecorators: '@angular/core/src/metadata',
37
+ diDecorators: '@angular/core/src/di/metadata',
38
+ diMetadata: '@angular/core/src/di/metadata',
39
+ diOpaqueToken: '@angular/core/src/di/opaque_token',
40
+ animationMetadata: '@angular/core/src/animation/metadata',
41
+ provider: '@angular/core/src/di/provider'
42
+ };
43
+ };
44
+ // We use absolute paths on disk as canonical.
45
+ ReflectorHost.prototype.getCanonicalFileName = function (fileName) { return fileName; };
46
+ ReflectorHost.prototype.resolve = function (m, containingFile) {
47
+ m = m.replace(EXT, '');
48
+ var resolved = ts.resolveModuleName(m, containingFile.replace(/\\/g, '/'), this.options, this.context)
49
+ .resolvedModule;
50
+ return resolved ? resolved.resolvedFileName : null;
51
+ };
52
+ ;
53
+ ReflectorHost.prototype.normalizeAssetUrl = function (url) {
54
+ var assetUrl = compiler_1.AssetUrl.parse(url);
55
+ var path = assetUrl ? assetUrl.packageName + "/" + assetUrl.modulePath : null;
56
+ return this.getCanonicalFileName(path);
57
+ };
58
+ ReflectorHost.prototype.resolveAssetUrl = function (url, containingFile) {
59
+ var assetUrl = this.normalizeAssetUrl(url);
60
+ if (assetUrl) {
61
+ return this.getCanonicalFileName(this.resolve(assetUrl, containingFile));
62
+ }
63
+ return url;
64
+ };
65
+ /**
66
+ * We want a moduleId that will appear in import statements in the generated code.
67
+ * These need to be in a form that system.js can load, so absolute file paths don't work.
68
+ *
69
+ * The `containingFile` is always in the `genDir`, where as the `importedFile` can be in
70
+ * `genDir`, `node_module` or `basePath`. The `importedFile` is either a generated file or
71
+ * existing file.
72
+ *
73
+ * | genDir | node_module | rootDir
74
+ * --------------+----------+-------------+----------
75
+ * generated | relative | relative | n/a
76
+ * existing file | n/a | absolute | relative(*)
77
+ *
78
+ * NOTE: (*) the relative path is computed depending on `isGenDirChildOfRootDir`.
79
+ */
80
+ ReflectorHost.prototype.getImportPath = function (containingFile, importedFile) {
81
+ importedFile = this.resolveAssetUrl(importedFile, containingFile);
82
+ containingFile = this.resolveAssetUrl(containingFile, '');
83
+ // If a file does not yet exist (because we compile it later), we still need to
84
+ // assume it exists it so that the `resolve` method works!
85
+ if (!this.compilerHost.fileExists(importedFile)) {
86
+ this.context.assumeFileExists(importedFile);
87
+ }
88
+ containingFile = this.rewriteGenDirPath(containingFile);
89
+ var containingDir = path.dirname(containingFile);
90
+ // drop extension
91
+ importedFile = importedFile.replace(EXT, '');
92
+ var nodeModulesIndex = importedFile.indexOf(NODE_MODULES);
93
+ var importModule = nodeModulesIndex === -1 ?
94
+ null :
95
+ importedFile.substring(nodeModulesIndex + NODE_MODULES.length);
96
+ var isGeneratedFile = IS_GENERATED.test(importedFile);
97
+ if (isGeneratedFile) {
98
+ // rewrite to genDir path
99
+ if (importModule) {
100
+ // it is generated, therefore we do a relative path to the factory
101
+ return this.dotRelative(containingDir, this.genDir + NODE_MODULES + importModule);
102
+ }
103
+ else {
104
+ // assume that import is also in `genDir`
105
+ importedFile = this.rewriteGenDirPath(importedFile);
106
+ return this.dotRelative(containingDir, importedFile);
107
+ }
108
+ }
109
+ else {
110
+ // user code import
111
+ if (importModule) {
112
+ return importModule;
113
+ }
114
+ else {
115
+ if (!this.isGenDirChildOfRootDir) {
116
+ // assume that they are on top of each other.
117
+ importedFile = importedFile.replace(this.basePath, this.genDir);
118
+ }
119
+ return this.dotRelative(containingDir, importedFile);
120
+ }
121
+ }
122
+ };
123
+ ReflectorHost.prototype.dotRelative = function (from, to) {
124
+ var rPath = path.relative(from, to).replace(/\\/g, '/');
125
+ return rPath.startsWith('.') ? rPath : './' + rPath;
126
+ };
127
+ /**
128
+ * Moves the path into `genDir` folder while preserving the `node_modules` directory.
129
+ */
130
+ ReflectorHost.prototype.rewriteGenDirPath = function (filepath) {
131
+ var nodeModulesIndex = filepath.indexOf(NODE_MODULES);
132
+ if (nodeModulesIndex !== -1) {
133
+ // If we are in node_modulse, transplant them into `genDir`.
134
+ return path.join(this.genDir, filepath.substring(nodeModulesIndex));
135
+ }
136
+ else {
137
+ // pretend that containing file is on top of the `genDir` to normalize the paths.
138
+ // we apply the `genDir` => `rootDir` delta through `rootDirPrefix` later.
139
+ return filepath.replace(this.basePath, this.genDir);
140
+ }
141
+ };
142
+ ReflectorHost.prototype.findDeclaration = function (module, symbolName, containingFile, containingModule) {
143
+ if (!containingFile || !containingFile.length) {
144
+ if (module.indexOf('.') === 0) {
145
+ throw new Error('Resolution of relative paths requires a containing file.');
146
+ }
147
+ // Any containing file gives the same result for absolute imports
148
+ containingFile = path.join(this.basePath, 'index.ts');
149
+ }
150
+ try {
151
+ var assetUrl = this.normalizeAssetUrl(module);
152
+ if (assetUrl) {
153
+ module = assetUrl;
154
+ }
155
+ var filePath = this.resolve(module, containingFile);
156
+ if (!filePath) {
157
+ // If the file cannot be found the module is probably referencing a declared module
158
+ // for which there is no disambiguating file and we also don't need to track
159
+ // re-exports. Just use the module name.
160
+ return this.getStaticSymbol(module, symbolName);
161
+ }
162
+ var tc = this.program.getTypeChecker();
163
+ var sf = this.program.getSourceFile(filePath);
164
+ if (!sf || !sf.symbol) {
165
+ // The source file was not needed in the compile but we do need the values from
166
+ // the corresponding .ts files stored in the .metadata.json file. Check the file
167
+ // for exports to see if the file is exported.
168
+ return this.resolveExportedSymbol(filePath, symbolName) ||
169
+ this.getStaticSymbol(filePath, symbolName);
170
+ }
171
+ var symbol = tc.getExportsOfModule(sf.symbol).find(function (m) { return m.name === symbolName; });
172
+ if (!symbol) {
173
+ throw new Error("can't find symbol " + symbolName + " exported from module " + filePath);
174
+ }
175
+ if (symbol &&
176
+ symbol.flags & ts.SymbolFlags.Alias) {
177
+ symbol = tc.getAliasedSymbol(symbol);
178
+ }
179
+ var declaration = symbol.getDeclarations()[0];
180
+ var declarationFile = this.getCanonicalFileName(declaration.getSourceFile().fileName);
181
+ return this.getStaticSymbol(declarationFile, symbol.getName());
182
+ }
183
+ catch (e) {
184
+ console.error("can't resolve module " + module + " from " + containingFile);
185
+ throw e;
186
+ }
187
+ };
188
+ /**
189
+ * getStaticSymbol produces a Type whose metadata is known but whose implementation is not loaded.
190
+ * All types passed to the StaticResolver should be pseudo-types returned by this method.
191
+ *
192
+ * @param declarationFile the absolute path of the file where the symbol is declared
193
+ * @param name the name of the type.
194
+ */
195
+ ReflectorHost.prototype.getStaticSymbol = function (declarationFile, name, members) {
196
+ var memberSuffix = members ? "." + members.join('.') : '';
197
+ var key = "\"" + declarationFile + "\"." + name + memberSuffix;
198
+ var result = this.typeCache.get(key);
199
+ if (!result) {
200
+ result = new static_reflector_1.StaticSymbol(declarationFile, name, members);
201
+ this.typeCache.set(key, result);
202
+ }
203
+ return result;
204
+ };
205
+ ReflectorHost.prototype.getMetadataFor = function (filePath) {
206
+ if (!this.context.fileExists(filePath)) {
207
+ // If the file doesn't exists then we cannot return metadata for the file.
208
+ // This will occur if the user refernced a declared module for which no file
209
+ // exists for the module (i.e. jQuery or angularjs).
210
+ return;
211
+ }
212
+ if (DTS.test(filePath)) {
213
+ var metadataPath = filePath.replace(DTS, '.metadata.json');
214
+ if (this.context.fileExists(metadataPath)) {
215
+ var metadata = this.readMetadata(metadataPath);
216
+ return (Array.isArray(metadata) && metadata.length == 0) ? undefined : metadata;
217
+ }
218
+ }
219
+ else {
220
+ var sf = this.program.getSourceFile(filePath);
221
+ if (!sf) {
222
+ if (this.context.fileExists(filePath)) {
223
+ var sourceText = this.context.readFile(filePath);
224
+ return this.metadataCollector.getMetadata(ts.createSourceFile(filePath, sourceText, ts.ScriptTarget.Latest, true));
225
+ }
226
+ throw new Error("Source file " + filePath + " not present in program.");
227
+ }
228
+ return this.metadataCollector.getMetadata(sf);
229
+ }
230
+ };
231
+ ReflectorHost.prototype.readMetadata = function (filePath) {
232
+ try {
233
+ return this.resolverCache.get(filePath) || JSON.parse(this.context.readFile(filePath));
234
+ }
235
+ catch (e) {
236
+ console.error("Failed to read JSON file " + filePath);
237
+ throw e;
238
+ }
239
+ };
240
+ ReflectorHost.prototype.getResolverMetadata = function (filePath) {
241
+ var metadata = this.resolverCache.get(filePath);
242
+ if (!metadata) {
243
+ metadata = this.getMetadataFor(filePath);
244
+ this.resolverCache.set(filePath, metadata);
245
+ }
246
+ return metadata;
247
+ };
248
+ ReflectorHost.prototype.resolveExportedSymbol = function (filePath, symbolName) {
249
+ var _this = this;
250
+ var resolveModule = function (moduleName) {
251
+ var resolvedModulePath = _this.getCanonicalFileName(_this.resolve(moduleName, filePath));
252
+ if (!resolvedModulePath) {
253
+ throw new Error("Could not resolve module '" + moduleName + "' relative to file " + filePath);
254
+ }
255
+ return resolvedModulePath;
256
+ };
257
+ var metadata = this.getResolverMetadata(filePath);
258
+ if (metadata) {
259
+ // If we have metadata for the symbol, this is the original exporting location.
260
+ if (metadata.metadata[symbolName]) {
261
+ return this.getStaticSymbol(filePath, symbolName);
262
+ }
263
+ // If no, try to find the symbol in one of the re-export location
264
+ if (metadata.exports) {
265
+ // Try and find the symbol in the list of explicitly re-exported symbols.
266
+ for (var _i = 0, _a = metadata.exports; _i < _a.length; _i++) {
267
+ var moduleExport = _a[_i];
268
+ if (moduleExport.export) {
269
+ var exportSymbol = moduleExport.export.find(function (symbol) {
270
+ if (typeof symbol === 'string') {
271
+ return symbol == symbolName;
272
+ }
273
+ else {
274
+ return symbol.as == symbolName;
275
+ }
276
+ });
277
+ if (exportSymbol) {
278
+ var symName = symbolName;
279
+ if (typeof exportSymbol !== 'string') {
280
+ symName = exportSymbol.name;
281
+ }
282
+ return this.resolveExportedSymbol(resolveModule(moduleExport.from), symName);
283
+ }
284
+ }
285
+ }
286
+ // Try to find the symbol via export * directives.
287
+ for (var _b = 0, _c = metadata.exports; _b < _c.length; _b++) {
288
+ var moduleExport = _c[_b];
289
+ if (!moduleExport.export) {
290
+ var resolvedModule = resolveModule(moduleExport.from);
291
+ var candidateSymbol = this.resolveExportedSymbol(resolvedModule, symbolName);
292
+ if (candidateSymbol)
293
+ return candidateSymbol;
294
+ }
295
+ }
296
+ }
297
+ }
298
+ return null;
299
+ };
300
+ return ReflectorHost;
301
+ }());
302
+ exports.ReflectorHost = ReflectorHost;
303
+ var NodeReflectorHostContext = (function () {
304
+ function NodeReflectorHostContext(host) {
305
+ this.host = host;
306
+ this.assumedExists = {};
307
+ }
308
+ NodeReflectorHostContext.prototype.fileExists = function (fileName) {
309
+ return this.assumedExists[fileName] || this.host.fileExists(fileName);
310
+ };
311
+ NodeReflectorHostContext.prototype.directoryExists = function (directoryName) {
312
+ try {
313
+ return fs.statSync(directoryName).isDirectory();
314
+ }
315
+ catch (e) {
316
+ return false;
317
+ }
318
+ };
319
+ NodeReflectorHostContext.prototype.readFile = function (fileName) { return fs.readFileSync(fileName, 'utf8'); };
320
+ NodeReflectorHostContext.prototype.assumeFileExists = function (fileName) { this.assumedExists[fileName] = true; };
321
+ return NodeReflectorHostContext;
322
+ }());
323
+ exports.NodeReflectorHostContext = NodeReflectorHostContext;
324
+ //# sourceMappingURL=reflector_host.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reflector_host.js","sourceRoot":"/Users/vsavkin/projects/angular/modules/@angular/compiler-cli/","sources":["src/reflector_host.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;AAEH,yBAAwC,mBAAmB,CAAC,CAAA;AAC5D,4BAAwE,sBAAsB,CAAC,CAAA;AAC/F,IAAY,EAAE,WAAM,IAAI,CAAC,CAAA;AACzB,IAAY,IAAI,WAAM,MAAM,CAAC,CAAA;AAC7B,IAAY,EAAE,WAAM,YAAY,CAAC,CAAA;AAEjC,iCAAgD,oBAAoB,CAAC,CAAA;AAErE,IAAM,GAAG,GAAG,kCAAkC,CAAC;AAC/C,IAAM,GAAG,GAAG,UAAU,CAAC;AACvB,IAAM,YAAY,GAAG,gBAAgB,CAAC;AACtC,IAAM,YAAY,GAAG,6BAA6B,CAAC;AASnD;IAME,uBACc,OAAmB,EAAY,YAA6B,EAC5D,OAA+B,EAAE,OAA8B;QAD/D,YAAO,G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CAAC,CAAC,WAAW,EAAE,CAAC;QAClD,CAAE;QAAA,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YACX,MAAM,CAAC,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IAED,2CAAQ,GAAR,UAAS,QAAgB,IAAY,MAAM,CAAC,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;IAEhF,mDAAgB,GAAhB,UAAiB,QAAgB,IAAU,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;IACnF,+BAAC;AAAD,CAAC,AApBD,IAoBC;AApBY,gCAAwB,2BAoBpC,CAAA"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google Inc. All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.io/license
7
+ */
8
+ import { GetterFn, MethodFn, SetterFn } from './private_import_core';
9
+ import { StaticReflector } from './static_reflector';
10
+ export declare class StaticAndDynamicReflectionCapabilities {
11
+ private staticDelegate;
12
+ static install(staticDelegate: StaticReflector): void;
13
+ private dynamicDelegate;
14
+ constructor(staticDelegate: StaticReflector);
15
+ isReflectionEnabled(): boolean;
16
+ factory(type: any): Function;
17
+ hasLifecycleHook(type: any, lcProperty: string): boolean;
18
+ parameters(type: any): any[][];
19
+ annotations(type: any): any[];
20
+ propMetadata(typeOrFunc: any): {
21
+ [key: string]: any[];
22
+ };
23
+ getter(name: string): GetterFn;
24
+ setter(name: string): SetterFn;
25
+ method(name: string): MethodFn;
26
+ importUri(type: any): string;
27
+ resolveIdentifier(name: string, moduleUrl: string, runtime: any): any;
28
+ resolveEnum(enumIdentifier: any, name: string): any;
29
+ }
@@ -0,0 +1,57 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google Inc. All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.io/license
7
+ */
8
+ "use strict";
9
+ var private_import_core_1 = require('./private_import_core');
10
+ var StaticAndDynamicReflectionCapabilities = (function () {
11
+ function StaticAndDynamicReflectionCapabilities(staticDelegate) {
12
+ this.staticDelegate = staticDelegate;
13
+ this.dynamicDelegate = new private_import_core_1.ReflectionCapabilities();
14
+ }
15
+ StaticAndDynamicReflectionCapabilities.install = function (staticDelegate) {
16
+ private_import_core_1.reflector.updateCapabilities(new StaticAndDynamicReflectionCapabilities(staticDelegate));
17
+ };
18
+ StaticAndDynamicReflectionCapabilities.prototype.isReflectionEnabled = function () { return true; };
19
+ StaticAndDynamicReflectionCapabilities.prototype.factory = function (type) { return this.dynamicDelegate.factory(type); };
20
+ StaticAndDynamicReflectionCapabilities.prototype.hasLifecycleHook = function (type, lcProperty) {
21
+ return isStaticType(type) ? this.staticDelegate.hasLifecycleHook(type, lcProperty) :
22
+ this.dynamicDelegate.hasLifecycleHook(type, lcProperty);
23
+ };
24
+ StaticAndDynamicReflectionCapabilities.prototype.parameters = function (type) {
25
+ return isStaticType(type) ? this.staticDelegate.parameters(type) :
26
+ this.dynamicDelegate.parameters(type);
27
+ };
28
+ StaticAndDynamicReflectionCapabilities.prototype.annotations = function (type) {
29
+ return isStaticType(type) ? this.staticDelegate.annotations(type) :
30
+ this.dynamicDelegate.annotations(type);
31
+ };
32
+ StaticAndDynamicReflectionCapabilities.prototype.propMetadata = function (typeOrFunc) {
33
+ return isStaticType(typeOrFunc) ? this.staticDelegate.propMetadata(typeOrFunc) :
34
+ this.dynamicDelegate.propMetadata(typeOrFunc);
35
+ };
36
+ StaticAndDynamicReflectionCapabilities.prototype.getter = function (name) { return this.dynamicDelegate.getter(name); };
37
+ StaticAndDynamicReflectionCapabilities.prototype.setter = function (name) { return this.dynamicDelegate.setter(name); };
38
+ StaticAndDynamicReflectionCapabilities.prototype.method = function (name) { return this.dynamicDelegate.method(name); };
39
+ StaticAndDynamicReflectionCapabilities.prototype.importUri = function (type) { return this.staticDelegate.importUri(type); };
40
+ StaticAndDynamicReflectionCapabilities.prototype.resolveIdentifier = function (name, moduleUrl, runtime) {
41
+ return this.staticDelegate.resolveIdentifier(name, moduleUrl, runtime);
42
+ };
43
+ StaticAndDynamicReflectionCapabilities.prototype.resolveEnum = function (enumIdentifier, name) {
44
+ if (isStaticType(enumIdentifier)) {
45
+ return this.staticDelegate.resolveEnum(enumIdentifier, name);
46
+ }
47
+ else {
48
+ return null;
49
+ }
50
+ };
51
+ return StaticAndDynamicReflectionCapabilities;
52
+ }());
53
+ exports.StaticAndDynamicReflectionCapabilities = StaticAndDynamicReflectionCapabilities;
54
+ function isStaticType(type) {
55
+ return typeof type === 'object' && type.name && type.filePath;
56
+ }
57
+ //# sourceMappingURL=static_reflection_capabilities.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"static_reflection_capabilities.js","sourceRoot":"/Users/vsavkin/projects/angular/modules/@angular/compiler-cli/","sources":["src/static_reflection_capabilities.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;AAEH,oCAA8E,uBAAuB,CAAC,CAAA;AAGtG;IAOE,gDAAoB,cAA+B;QAA/B,mBAAc,GAAd,cAAc,CAAiB;QAF3C,oBAAe,GAAG,IAAI,4CAAsB,EAAE,CAAC;IAED,CAAC;IANhD,8CAAO,GAAd,UAAe,cAA+B;QAC5C,+BAAS,CAAC,kBAAkB,CAAC,IAAI,sCAAsC,CAAC,cAAc,CAAC,CAAC,CAAC;IAC3F,CAAC;IAMD,oEAAmB,GAAnB,cAAiC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;IAC/C,wDAAO,GAAP,UAAQ,IAAS,IAAc,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAE3E,iEAAgB,GAAhB,UAAiB,IAAS,EAAE,UAAkB;QAC5C,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,cAAc,CAAC,gBAAgB,CAAC,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AY;QAC7D,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,iBAAiB,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;IACzE,CAAC;IACD,4DAAW,GAAX,UAAY,cAAmB,EAAE,IAAY;QAC3C,EAAE,CAAC,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;YACjC,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;QAC/D,CAAC;QAAC,IAAI,CAAC,CAAC;YACN,MAAM,CAAC,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IACH,6CAAC;AAAD,CAAC,AA1CD,IA0CC;AA1CY,8CAAsC,yCA0ClD,CAAA;AAED,sBAAsB,IAAS;IAC7B,MAAM,CAAC,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,QAAQ,CAAC;AAChE,CAAC"}
@@ -0,0 +1,82 @@
1
+ import { ReflectorReader } from './private_import_core';
2
+ /**
3
+ * The host of the static resolver is expected to be able to provide module metadata in the form of
4
+ * ModuleMetadata. Angular 2 CLI will produce this metadata for a module whenever a .d.ts files is
5
+ * produced and the module has exported variables or classes with decorators. Module metadata can
6
+ * also be produced directly from TypeScript sources by using MetadataCollector in tools/metadata.
7
+ */
8
+ export interface StaticReflectorHost {
9
+ /**
10
+ * Return a ModuleMetadata for the given module.
11
+ *
12
+ * @param modulePath is a string identifier for a module as an absolute path.
13
+ * @returns the metadata for the given module.
14
+ */
15
+ getMetadataFor(modulePath: string): {
16
+ [key: string]: any;
17
+ } | {
18
+ [key: string]: any;
19
+ }[];
20
+ /**
21
+ * Resolve a symbol from an import statement form, to the file where it is declared.
22
+ * @param module the location imported from
23
+ * @param containingFile for relative imports, the path of the file containing the import
24
+ */
25
+ findDeclaration(modulePath: string, symbolName: string, containingFile?: string): StaticSymbol;
26
+ getStaticSymbol(declarationFile: string, name: string, members?: string[]): StaticSymbol;
27
+ angularImportLocations(): {
28
+ coreDecorators: string;
29
+ diDecorators: string;
30
+ diMetadata: string;
31
+ diOpaqueToken: string;
32
+ animationMetadata: string;
33
+ provider: string;
34
+ };
35
+ getCanonicalFileName(fileName: string): string;
36
+ }
37
+ /**
38
+ * A token representing the a reference to a static type.
39
+ *
40
+ * This token is unique for a filePath and name and can be used as a hash table key.
41
+ */
42
+ export declare class StaticSymbol {
43
+ filePath: string;
44
+ name: string;
45
+ members: string[];
46
+ constructor(filePath: string, name: string, members?: string[]);
47
+ }
48
+ /**
49
+ * A static reflector implements enough of the Reflector API that is necessary to compile
50
+ * templates statically.
51
+ */
52
+ export declare class StaticReflector implements ReflectorReader {
53
+ private host;
54
+ private annotationCache;
55
+ private propertyCache;
56
+ private parameterCache;
57
+ private metadataCache;
58
+ private conversionMap;
59
+ private opaqueToken;
60
+ constructor(host: StaticReflectorHost);
61
+ importUri(typeOrFunc: StaticSymbol): string;
62
+ resolveIdentifier(name: string, moduleUrl: string, runtime: any): any;
63
+ resolveEnum(enumIdentifier: any, name: string): any;
64
+ annotations(type: StaticSymbol): any[];
65
+ propMetadata(type: StaticSymbol): {
66
+ [key: string]: any;
67
+ };
68
+ parameters(type: StaticSymbol): any[];
69
+ hasLifecycleHook(type: any, lcProperty: string): boolean;
70
+ private registerDecoratorOrConstructor(type, ctor);
71
+ private registerFunction(type, fn);
72
+ private initializeConversionMap();
73
+ /** @internal */
74
+ simplify(context: StaticSymbol, value: any): any;
75
+ /**
76
+ * @param module an absolute path to a module file.
77
+ */
78
+ getModuleMetadata(module: string): {
79
+ [key: string]: any;
80
+ };
81
+ private getTypeMetadata(type);
82
+ }