source: trip-planner-front/node_modules/@angular/compiler/src/i18n/extractor.js@ 188ee53

Last change on this file since 188ee53 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 18.0 KB
Line 
1/**
2 * @license
3 * Copyright Google LLC 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(function (factory) {
9 if (typeof module === "object" && typeof module.exports === "object") {
10 var v = factory(require, exports);
11 if (v !== undefined) module.exports = v;
12 }
13 else if (typeof define === "function" && define.amd) {
14 define("@angular/compiler/src/i18n/extractor", ["require", "exports", "tslib", "@angular/compiler/src/aot/compiler", "@angular/compiler/src/aot/compiler_factory", "@angular/compiler/src/aot/static_reflector", "@angular/compiler/src/aot/static_symbol", "@angular/compiler/src/aot/static_symbol_resolver", "@angular/compiler/src/aot/summary_resolver", "@angular/compiler/src/config", "@angular/compiler/src/core", "@angular/compiler/src/directive_normalizer", "@angular/compiler/src/directive_resolver", "@angular/compiler/src/metadata_resolver", "@angular/compiler/src/ml_parser/html_parser", "@angular/compiler/src/ml_parser/interpolation_config", "@angular/compiler/src/ng_module_resolver", "@angular/compiler/src/pipe_resolver", "@angular/compiler/src/schema/dom_element_schema_registry", "@angular/compiler/src/i18n/message_bundle"], factory);
15 }
16})(function (require, exports) {
17 "use strict";
18 Object.defineProperty(exports, "__esModule", { value: true });
19 exports.Extractor = void 0;
20 var tslib_1 = require("tslib");
21 /**
22 * Extract i18n messages from source code
23 */
24 var compiler_1 = require("@angular/compiler/src/aot/compiler");
25 var compiler_factory_1 = require("@angular/compiler/src/aot/compiler_factory");
26 var static_reflector_1 = require("@angular/compiler/src/aot/static_reflector");
27 var static_symbol_1 = require("@angular/compiler/src/aot/static_symbol");
28 var static_symbol_resolver_1 = require("@angular/compiler/src/aot/static_symbol_resolver");
29 var summary_resolver_1 = require("@angular/compiler/src/aot/summary_resolver");
30 var config_1 = require("@angular/compiler/src/config");
31 var core_1 = require("@angular/compiler/src/core");
32 var directive_normalizer_1 = require("@angular/compiler/src/directive_normalizer");
33 var directive_resolver_1 = require("@angular/compiler/src/directive_resolver");
34 var metadata_resolver_1 = require("@angular/compiler/src/metadata_resolver");
35 var html_parser_1 = require("@angular/compiler/src/ml_parser/html_parser");
36 var interpolation_config_1 = require("@angular/compiler/src/ml_parser/interpolation_config");
37 var ng_module_resolver_1 = require("@angular/compiler/src/ng_module_resolver");
38 var pipe_resolver_1 = require("@angular/compiler/src/pipe_resolver");
39 var dom_element_schema_registry_1 = require("@angular/compiler/src/schema/dom_element_schema_registry");
40 var message_bundle_1 = require("@angular/compiler/src/i18n/message_bundle");
41 var Extractor = /** @class */ (function () {
42 function Extractor(host, staticSymbolResolver, messageBundle, metadataResolver) {
43 this.host = host;
44 this.staticSymbolResolver = staticSymbolResolver;
45 this.messageBundle = messageBundle;
46 this.metadataResolver = metadataResolver;
47 }
48 Extractor.prototype.extract = function (rootFiles) {
49 var _this = this;
50 var _a = compiler_1.analyzeAndValidateNgModules(rootFiles, this.host, this.staticSymbolResolver, this.metadataResolver), files = _a.files, ngModules = _a.ngModules;
51 return Promise
52 .all(ngModules.map(function (ngModule) { return _this.metadataResolver.loadNgModuleDirectiveAndPipeMetadata(ngModule.type.reference, false); }))
53 .then(function () {
54 var errors = [];
55 files.forEach(function (file) {
56 var compMetas = [];
57 file.directives.forEach(function (directiveType) {
58 var dirMeta = _this.metadataResolver.getDirectiveMetadata(directiveType);
59 if (dirMeta && dirMeta.isComponent) {
60 compMetas.push(dirMeta);
61 }
62 });
63 compMetas.forEach(function (compMeta) {
64 var html = compMeta.template.template;
65 // Template URL points to either an HTML or TS file depending on
66 // whether the file is used with `templateUrl:` or `template:`,
67 // respectively.
68 var templateUrl = compMeta.template.templateUrl;
69 var interpolationConfig = interpolation_config_1.InterpolationConfig.fromArray(compMeta.template.interpolation);
70 errors.push.apply(errors, tslib_1.__spreadArray([], tslib_1.__read(_this.messageBundle.updateFromTemplate(html, templateUrl, interpolationConfig))));
71 });
72 });
73 if (errors.length) {
74 throw new Error(errors.map(function (e) { return e.toString(); }).join('\n'));
75 }
76 return _this.messageBundle;
77 });
78 };
79 Extractor.create = function (host, locale) {
80 var htmlParser = new html_parser_1.HtmlParser();
81 var urlResolver = compiler_factory_1.createAotUrlResolver(host);
82 var symbolCache = new static_symbol_1.StaticSymbolCache();
83 var summaryResolver = new summary_resolver_1.AotSummaryResolver(host, symbolCache);
84 var staticSymbolResolver = new static_symbol_resolver_1.StaticSymbolResolver(host, symbolCache, summaryResolver);
85 var staticReflector = new static_reflector_1.StaticReflector(summaryResolver, staticSymbolResolver);
86 var config = new config_1.CompilerConfig({ defaultEncapsulation: core_1.ViewEncapsulation.Emulated, useJit: false });
87 var normalizer = new directive_normalizer_1.DirectiveNormalizer({ get: function (url) { return host.loadResource(url); } }, urlResolver, htmlParser, config);
88 var elementSchemaRegistry = new dom_element_schema_registry_1.DomElementSchemaRegistry();
89 var resolver = new metadata_resolver_1.CompileMetadataResolver(config, htmlParser, new ng_module_resolver_1.NgModuleResolver(staticReflector), new directive_resolver_1.DirectiveResolver(staticReflector), new pipe_resolver_1.PipeResolver(staticReflector), summaryResolver, elementSchemaRegistry, normalizer, console, symbolCache, staticReflector);
90 // TODO(vicb): implicit tags & attributes
91 var messageBundle = new message_bundle_1.MessageBundle(htmlParser, [], {}, locale);
92 var extractor = new Extractor(host, staticSymbolResolver, messageBundle, resolver);
93 return { extractor: extractor, staticReflector: staticReflector };
94 };
95 return Extractor;
96 }());
97 exports.Extractor = Extractor;
98});
99//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXh0cmFjdG9yLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvY29tcGlsZXIvc3JjL2kxOG4vZXh0cmFjdG9yLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7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