Conexio amb la api

This commit is contained in:
janmaroto 2022-02-09 18:30:03 +01:00
commit b12369cb47
48513 changed files with 7391639 additions and 7 deletions

12
node_modules/@angular/compiler-cli/index.d.ts generated vendored Executable file
View file

@ -0,0 +1,12 @@
/// <amd-module name="@angular/compiler-cli" />
export { AotCompilerHost, AotCompilerHost as StaticReflectorHost, StaticReflector, StaticSymbol } from '@angular/compiler';
export { VERSION } from './src/version';
export * from './src/metadata';
export * from './src/transformers/api';
export * from './src/transformers/entry_points';
export * from './src/perform_compile';
export * from './src/tooling';
export { CompilerOptions as AngularCompilerOptions } from './src/transformers/api';
export { ngToTsDiagnostic } from './src/transformers/util';
export { NgTscPlugin } from './src/ngtsc/tsc_plugin';
export { NgtscProgram } from './src/ngtsc/program';

40
node_modules/@angular/compiler-cli/index.js generated vendored Executable file
View file

@ -0,0 +1,40 @@
(function (factory) {
if (typeof module === "object" && typeof module.exports === "object") {
var v = factory(require, exports);
if (v !== undefined) module.exports = v;
}
else if (typeof define === "function" && define.amd) {
define("@angular/compiler-cli", ["require", "exports", "tslib", "@angular/compiler-cli/src/ngtsc/file_system", "@angular/compiler", "@angular/compiler-cli/src/version", "@angular/compiler-cli/src/metadata/index", "@angular/compiler-cli/src/transformers/api", "@angular/compiler-cli/src/transformers/entry_points", "@angular/compiler-cli/src/perform_compile", "@angular/compiler-cli/src/tooling", "@angular/compiler-cli/src/transformers/util", "@angular/compiler-cli/src/ngtsc/tsc_plugin", "@angular/compiler-cli/src/ngtsc/program"], factory);
}
})(function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.NgtscProgram = exports.NgTscPlugin = exports.ngToTsDiagnostic = exports.VERSION = exports.StaticSymbol = exports.StaticReflector = void 0;
var tslib_1 = require("tslib");
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
var file_system_1 = require("@angular/compiler-cli/src/ngtsc/file_system");
var compiler_1 = require("@angular/compiler");
Object.defineProperty(exports, "StaticReflector", { enumerable: true, get: function () { return compiler_1.StaticReflector; } });
Object.defineProperty(exports, "StaticSymbol", { enumerable: true, get: function () { return compiler_1.StaticSymbol; } });
var version_1 = require("@angular/compiler-cli/src/version");
Object.defineProperty(exports, "VERSION", { enumerable: true, get: function () { return version_1.VERSION; } });
tslib_1.__exportStar(require("@angular/compiler-cli/src/metadata/index"), exports);
tslib_1.__exportStar(require("@angular/compiler-cli/src/transformers/api"), exports);
tslib_1.__exportStar(require("@angular/compiler-cli/src/transformers/entry_points"), exports);
tslib_1.__exportStar(require("@angular/compiler-cli/src/perform_compile"), exports);
tslib_1.__exportStar(require("@angular/compiler-cli/src/tooling"), exports);
var util_1 = require("@angular/compiler-cli/src/transformers/util");
Object.defineProperty(exports, "ngToTsDiagnostic", { enumerable: true, get: function () { return util_1.ngToTsDiagnostic; } });
var tsc_plugin_1 = require("@angular/compiler-cli/src/ngtsc/tsc_plugin");
Object.defineProperty(exports, "NgTscPlugin", { enumerable: true, get: function () { return tsc_plugin_1.NgTscPlugin; } });
var program_1 = require("@angular/compiler-cli/src/ngtsc/program");
Object.defineProperty(exports, "NgtscProgram", { enumerable: true, get: function () { return program_1.NgtscProgram; } });
file_system_1.setFileSystem(new file_system_1.NodeJSFileSystem());
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9jb21waWxlci1jbGkvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7OztJQUFBOzs7Ozs7T0FNRztJQUNILDJFQUF3RTtJQUV4RSw4Q0FBeUg7SUFBeEQsMkdBQUEsZUFBZSxPQUFBO0lBQUUsd0dBQUEsWUFBWSxPQUFBO0lBQzlGLDZEQUFzQztJQUE5QixrR0FBQSxPQUFPLE9BQUE7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b3JtZXJzL2VudHJ5X3BvaW50cyc7XG5cbmV4cG9ydCAqIGZyb20gJy4vc3JjL3BlcmZvcm1fY29tcGlsZSc7XG5leHBvcnQgKiBmcm9tICcuL3NyYy90b29saW5nJztcblxuLy8gVE9ETyh0Ym9zY2gpOiByZW1vdmUgdGhpcyBvbmNlIHVzYWdlcyBpbiBHMyBhcmUgY2hhbmdlZCB0byBgQ29tcGlsZXJPcHRpb25zYFxuZXhwb3J0IHtDb21waWxlck9wdGlvbnMgYXMgQW5ndWxhckNvbXBpbGVyT3B0aW9uc30gZnJvbSAnLi9zcmMvdHJhbnNmb3JtZXJzL2FwaSc7XG5cbmV4cG9ydCB7bmdUb1RzRGlhZ25vc3RpY30gZnJvbSAnLi9zcmMvdHJhbnNmb3JtZXJzL3V0aWwnO1xuZXhwb3J0IHtOZ1RzY1BsdWdpbn0gZnJvbSAnLi9zcmMvbmd0c2MvdHNjX3BsdWdpbic7XG5leHBvcnQge05ndHNjUHJvZ3JhbX0gZnJvbSAnLi9zcmMvbmd0c2MvcHJvZ3JhbSc7XG5cbnNldEZpbGVTeXN0ZW0obmV3IE5vZGVKU0ZpbGVTeXN0ZW0oKSk7XG4iXX0=

11
node_modules/@angular/compiler-cli/linker/babel/index.d.ts generated vendored Executable file
View file

@ -0,0 +1,11 @@
/// <amd-module name="@angular/compiler-cli/linker/babel" />
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { defaultLinkerPlugin } from './src/babel_plugin';
export { createEs2015LinkerPlugin } from './src/es2015_linker_plugin';
export default defaultLinkerPlugin;

25
node_modules/@angular/compiler-cli/linker/babel/index.js generated vendored Executable file
View file

@ -0,0 +1,25 @@
(function (factory) {
if (typeof module === "object" && typeof module.exports === "object") {
var v = factory(require, exports);
if (v !== undefined) module.exports = v;
}
else if (typeof define === "function" && define.amd) {
define("@angular/compiler-cli/linker/babel", ["require", "exports", "@angular/compiler-cli/linker/babel/src/babel_plugin", "@angular/compiler-cli/linker/babel/src/es2015_linker_plugin"], factory);
}
})(function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createEs2015LinkerPlugin = void 0;
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
var babel_plugin_1 = require("@angular/compiler-cli/linker/babel/src/babel_plugin");
var es2015_linker_plugin_1 = require("@angular/compiler-cli/linker/babel/src/es2015_linker_plugin");
Object.defineProperty(exports, "createEs2015LinkerPlugin", { enumerable: true, get: function () { return es2015_linker_plugin_1.createEs2015LinkerPlugin; } });
exports.default = babel_plugin_1.defaultLinkerPlugin;
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9jb21waWxlci1jbGkvbGlua2VyL2JhYmVsL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7OztJQUFBOzs7Ozs7T0FNRztJQUNILG9GQUF1RDtJQUV2RCxvR0FBb0U7SUFBNUQsZ0lBQUEsd0JBQXdCLE9BQUE7SUFDaEMsa0JBQWUsa0NBQW1CLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEBsaWNlbnNlXG4gKiBDb3B5cmlnaHQgR29vZ2xlIExMQyBBbGwgUmlnaHRzIFJlc2VydmVkLlxuICpcbiAqIFVzZSBvZiB0aGlzIHNvdXJjZSBjb2RlIGlzIGdvdmVybmVkIGJ5IGFuIE1JVC1zdHlsZSBsaWNlbnNlIHRoYXQgY2FuIGJlXG4gKiBmb3VuZCBpbiB0aGUgTElDRU5TRSBmaWxlIGF0IGh0dHBzOi8vYW5ndWxhci5pby9saWNlbnNlXG4gKi9cbmltcG9ydCB7ZGVmYXVsdExpbmtlclBsdWdpbn0gZnJvbSAnLi9zcmMvYmFiZWxfcGx1Z2luJztcblxuZXhwb3J0IHtjcmVhdGVFczIwMTVMaW5rZXJQbHVnaW59IGZyb20gJy4vc3JjL2VzMjAxNV9saW5rZXJfcGx1Z2luJztcbmV4cG9ydCBkZWZhdWx0IGRlZmF1bHRMaW5rZXJQbHVnaW47XG4iXX0=

View file

@ -0,0 +1,45 @@
/// <amd-module name="@angular/compiler-cli/linker/babel/src/ast/babel_ast_factory" />
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import * as t from '@babel/types';
import { AstFactory, BinaryOperator, LeadingComment, ObjectLiteralProperty, SourceMapRange, TemplateLiteral, VariableDeclarationType } from '../../../../src/ngtsc/translator';
/**
* A Babel flavored implementation of the AstFactory.
*/
export declare class BabelAstFactory implements AstFactory<t.Statement, t.Expression> {
/** The absolute path to the source file being compiled. */
private sourceUrl;
constructor(
/** The absolute path to the source file being compiled. */
sourceUrl: string);
attachComments(statement: t.Statement, leadingComments: LeadingComment[]): void;
createArrayLiteral: typeof t.arrayExpression;
createAssignment(target: t.Expression, value: t.Expression): t.Expression;
createBinaryExpression(leftOperand: t.Expression, operator: BinaryOperator, rightOperand: t.Expression): t.Expression;
createBlock: typeof t.blockStatement;
createCallExpression(callee: t.Expression, args: t.Expression[], pure: boolean): t.Expression;
createConditional: typeof t.conditionalExpression;
createElementAccess(expression: t.Expression, element: t.Expression): t.Expression;
createExpressionStatement: typeof t.expressionStatement;
createFunctionDeclaration(functionName: string, parameters: string[], body: t.Statement): t.Statement;
createFunctionExpression(functionName: string | null, parameters: string[], body: t.Statement): t.Expression;
createIdentifier: typeof t.identifier;
createIfStatement: typeof t.ifStatement;
createLiteral(value: string | number | boolean | null | undefined): t.Expression;
createNewExpression: typeof t.newExpression;
createObjectLiteral(properties: ObjectLiteralProperty<t.Expression>[]): t.Expression;
createParenthesizedExpression: typeof t.parenthesizedExpression;
createPropertyAccess(expression: t.Expression, propertyName: string): t.Expression;
createReturnStatement: typeof t.returnStatement;
createTaggedTemplate(tag: t.Expression, template: TemplateLiteral<t.Expression>): t.Expression;
createThrowStatement: typeof t.throwStatement;
createTypeOfExpression(expression: t.Expression): t.Expression;
createUnaryExpression: typeof t.unaryExpression;
createVariableDeclaration(variableName: string, initializer: t.Expression | null, type: VariableDeclarationType): t.Statement;
setSourceMapRange<T extends t.Statement | t.Expression | t.TemplateElement>(node: T, sourceMapRange: SourceMapRange | null): T;
}

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,32 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/// <amd-module name="@angular/compiler-cli/linker/babel/src/ast/babel_ast_host" />
import * as t from '@babel/types';
import { AstHost, Range } from '../../../../linker';
/**
* This implementation of `AstHost` is able to get information from Babel AST nodes.
*/
export declare class BabelAstHost implements AstHost<t.Expression> {
getSymbolName(node: t.Expression): string | null;
isStringLiteral: typeof t.isStringLiteral;
parseStringLiteral(str: t.Expression): string;
isNumericLiteral: typeof t.isNumericLiteral;
parseNumericLiteral(num: t.Expression): number;
isBooleanLiteral(bool: t.Expression): boolean;
parseBooleanLiteral(bool: t.Expression): boolean;
isArrayLiteral: typeof t.isArrayExpression;
parseArrayLiteral(array: t.Expression): t.Expression[];
isObjectLiteral: typeof t.isObjectExpression;
parseObjectLiteral(obj: t.Expression): Map<string, t.Expression>;
isFunctionExpression(node: t.Expression): node is Extract<t.Function, t.Expression>;
parseReturnValue(fn: t.Expression): t.Expression;
isCallExpression: typeof t.isCallExpression;
parseCallee(call: t.Expression): t.Expression;
parseArguments(call: t.Expression): t.Expression[];
getRange(node: t.Expression): Range;
}

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,38 @@
/// <amd-module name="@angular/compiler-cli/linker/babel/src/babel_declaration_scope" />
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { NodePath, Scope } from '@babel/traverse';
import * as t from '@babel/types';
import { DeclarationScope } from '../../../linker';
export declare type ConstantScopePath = NodePath<t.Function | t.Program>;
/**
* This class represents the lexical scope of a partial declaration in Babel source code.
*
* Its only responsibility is to compute a reference object for the scope of shared constant
* statements that will be generated during partial linking.
*/
export declare class BabelDeclarationScope implements DeclarationScope<ConstantScopePath, t.Expression> {
private declarationScope;
/**
* Construct a new `BabelDeclarationScope`.
*
* @param declarationScope the Babel scope containing the declaration call expression.
*/
constructor(declarationScope: Scope);
/**
* Compute the Babel `NodePath` that can be used to reference the lexical scope where any
* shared constant statements would be inserted.
*
* There will only be a shared constant scope if the expression is in an ECMAScript module, or a
* UMD module. Otherwise `null` is returned to indicate that constant statements must be emitted
* locally to the generated linked definition, to avoid polluting the global scope.
*
* @param expression the expression that points to the Angular core framework import.
*/
getConstantScopeRef(expression: t.Expression): ConstantScopePath | null;
}

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,26 @@
/// <amd-module name="@angular/compiler-cli/linker/babel/src/babel_plugin" />
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { ConfigAPI, PluginObj } from '@babel/core';
import { LinkerOptions } from '../../src/file_linker/linker_options';
/**
* This is the Babel plugin definition that is provided as a default export from the package, such
* that the plugin can be used using the module specifier of the package. This is the recommended
* way of integrating the Angular Linker into a build pipeline other than the Angular CLI.
*
* When the module specifier `@angular/compiler-cli/linker/babel` is used as a plugin in a Babel
* configuration, Babel invokes this function (by means of the default export) to create the plugin
* instance according to the provided options.
*
* The linker plugin that is created uses the native NodeJS filesystem APIs to interact with the
* filesystem. Any logging output is printed to the console.
*
* @param api Provides access to the Babel environment that is configuring this plugin.
* @param options The plugin options that have been configured.
*/
export declare function defaultLinkerPlugin(api: ConfigAPI, options: Partial<LinkerOptions>): PluginObj;

View file

@ -0,0 +1,38 @@
(function (factory) {
if (typeof module === "object" && typeof module.exports === "object") {
var v = factory(require, exports);
if (v !== undefined) module.exports = v;
}
else if (typeof define === "function" && define.amd) {
define("@angular/compiler-cli/linker/babel/src/babel_plugin", ["require", "exports", "tslib", "@angular/compiler-cli/src/ngtsc/file_system", "@angular/compiler-cli/src/ngtsc/logging", "@angular/compiler-cli/linker/babel/src/es2015_linker_plugin"], factory);
}
})(function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.defaultLinkerPlugin = void 0;
var tslib_1 = require("tslib");
var file_system_1 = require("@angular/compiler-cli/src/ngtsc/file_system");
var logging_1 = require("@angular/compiler-cli/src/ngtsc/logging");
var es2015_linker_plugin_1 = require("@angular/compiler-cli/linker/babel/src/es2015_linker_plugin");
/**
* This is the Babel plugin definition that is provided as a default export from the package, such
* that the plugin can be used using the module specifier of the package. This is the recommended
* way of integrating the Angular Linker into a build pipeline other than the Angular CLI.
*
* When the module specifier `@angular/compiler-cli/linker/babel` is used as a plugin in a Babel
* configuration, Babel invokes this function (by means of the default export) to create the plugin
* instance according to the provided options.
*
* The linker plugin that is created uses the native NodeJS filesystem APIs to interact with the
* filesystem. Any logging output is printed to the console.
*
* @param api Provides access to the Babel environment that is configuring this plugin.
* @param options The plugin options that have been configured.
*/
function defaultLinkerPlugin(api, options) {
api.assertVersion(7);
return es2015_linker_plugin_1.createEs2015LinkerPlugin(tslib_1.__assign(tslib_1.__assign({}, options), { fileSystem: new file_system_1.NodeJSFileSystem(), logger: new logging_1.ConsoleLogger(logging_1.LogLevel.info) }));
}
exports.defaultLinkerPlugin = defaultLinkerPlugin;
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmFiZWxfcGx1Z2luLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvY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mlsZXN5c3RlbS4gQW55IGxvZ2dpbmcgb3V0cHV0IGlzIHByaW50ZWQgdG8gdGhlIGNvbnNvbGUuXG4gKlxuICogQHBhcmFtIGFwaSBQcm92aWRlcyBhY2Nlc3MgdG8gdGhlIEJhYmVsIGVudmlyb25tZW50IHRoYXQgaXMgY29uZmlndXJpbmcgdGhpcyBwbHVnaW4uXG4gKiBAcGFyYW0gb3B0aW9ucyBUaGUgcGx1Z2luIG9wdGlvbnMgdGhhdCBoYXZlIGJlZW4gY29uZmlndXJlZC5cbiAqL1xuZXhwb3J0IGZ1bmN0aW9uIGRlZmF1bHRMaW5rZXJQbHVnaW4oYXBpOiBDb25maWdBUEksIG9wdGlvbnM6IFBhcnRpYWw8TGlua2VyT3B0aW9ucz4pOiBQbHVnaW5PYmoge1xuICBhcGkuYXNzZXJ0VmVyc2lvbig3KTtcblxuICByZXR1cm4gY3JlYXRlRXMyMDE1TGlua2VyUGx1Z2luKHtcbiAgICAuLi5vcHRpb25zLFxuICAgIGZpbGVTeXN0ZW06IG5ldyBOb2RlSlNGaWxlU3lzdGVtKCksXG4gICAgbG9nZ2VyOiBuZXcgQ29uc29sZUxvZ2dlcihMb2dMZXZlbC5pbmZvKSxcbiAgfSk7XG59XG4iXX0=

View file

@ -0,0 +1,17 @@
/// <amd-module name="@angular/compiler-cli/linker/babel/src/es2015_linker_plugin" />
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { PluginObj } from '@babel/core';
import { LinkerPluginOptions } from './linker_plugin_options';
/**
* Create a Babel plugin that visits the program, identifying and linking partial declarations.
*
* The plugin delegates most of its work to a generic `FileLinker` for each file (`t.Program` in
* Babel) that is visited.
*/
export declare function createEs2015LinkerPlugin({ fileSystem, logger, ...options }: LinkerPluginOptions): PluginObj;

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,21 @@
/// <amd-module name="@angular/compiler-cli/linker/babel/src/linker_plugin_options" />
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { LinkerOptions } from '../..';
import { ReadonlyFileSystem } from '../../../src/ngtsc/file_system';
import { Logger } from '../../../src/ngtsc/logging';
export interface LinkerPluginOptions extends Partial<LinkerOptions> {
/**
* File-system, used to load up the input source-map and content.
*/
fileSystem: ReadonlyFileSystem;
/**
* Logger used by the linker.
*/
logger: Logger;
}

View file

@ -0,0 +1,13 @@
(function (factory) {
if (typeof module === "object" && typeof module.exports === "object") {
var v = factory(require, exports);
if (v !== undefined) module.exports = v;
}
else if (typeof define === "function" && define.amd) {
define("@angular/compiler-cli/linker/babel/src/linker_plugin_options", ["require", "exports"], factory);
}
})(function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGlua2VyX3BsdWdpbl9vcHRpb25zLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvY29tcGlsZXItY2xpL2xpbmtlci9iYWJlbC9zcmMvbGlua2VyX3BsdWdpbl9vcHRpb25zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEBsaWNlbnNlXG4gKiBDb3B5cmlnaHQgR29vZ2xlIExMQyBBbGwgUmlnaHRzIFJlc2VydmVkLlxuICpcbiAqIFVzZSBvZiB0aGlzIHNvdXJjZSBjb2RlIGlzIGdvdmVybmVkIGJ5IGFuIE1JVC1zdHlsZSBsaWNlbnNlIHRoYXQgY2FuIGJlXG4gKiBmb3VuZCBpbiB0aGUgTElDRU5TRSBmaWxlIGF0IGh0dHBzOi8vYW5ndWxhci5pby9saWNlbnNlXG4gKi9cbmltcG9ydCB7TGlua2VyT3B0aW9uc30gZnJvbSAnLi4vLi4nO1xuaW1wb3J0IHtSZWFkb25seUZpbGVTeXN0ZW19IGZyb20gJy4uLy4uLy4uL3NyYy9uZ3RzYy9maWxlX3N5c3RlbSc7XG5pbXBvcnQge0xvZ2dlcn0gZnJvbSAnLi4vLi4vLi4vc3JjL25ndHNjL2xvZ2dpbmcnO1xuXG5leHBvcnQgaW50ZXJmYWNlIExpbmtlclBsdWdpbk9wdGlvbnMgZXh0ZW5kcyBQYXJ0aWFsPExpbmtlck9wdGlvbnM+IHtcbiAgLyoqXG4gICAqIEZpbGUtc3lzdGVtLCB1c2VkIHRvIGxvYWQgdXAgdGhlIGlucHV0IHNvdXJjZS1tYXAgYW5kIGNvbnRlbnQuXG4gICAqL1xuICBmaWxlU3lzdGVtOiBSZWFkb25seUZpbGVTeXN0ZW07XG5cbiAgLyoqXG4gICAqIExvZ2dlciB1c2VkIGJ5IHRoZSBsaW5rZXIuXG4gICAqL1xuICBsb2dnZXI6IExvZ2dlcjtcbn1cbiJdfQ==

16
node_modules/@angular/compiler-cli/linker/index.d.ts generated vendored Executable file
View file

@ -0,0 +1,16 @@
/// <amd-module name="@angular/compiler-cli/linker" />
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
export { AstHost, Range } from './src/ast/ast_host';
export { assert } from './src/ast/utils';
export { FatalLinkerError, isFatalLinkerError } from './src/fatal_linker_error';
export { DeclarationScope } from './src/file_linker/declaration_scope';
export { FileLinker } from './src/file_linker/file_linker';
export { LinkerEnvironment } from './src/file_linker/linker_environment';
export { DEFAULT_LINKER_OPTIONS, LinkerOptions } from './src/file_linker/linker_options';
export { needsLinking } from './src/file_linker/needs_linking';

27
node_modules/@angular/compiler-cli/linker/index.js generated vendored Executable file
View file

@ -0,0 +1,27 @@
(function (factory) {
if (typeof module === "object" && typeof module.exports === "object") {
var v = factory(require, exports);
if (v !== undefined) module.exports = v;
}
else if (typeof define === "function" && define.amd) {
define("@angular/compiler-cli/linker", ["require", "exports", "@angular/compiler-cli/linker/src/ast/utils", "@angular/compiler-cli/linker/src/fatal_linker_error", "@angular/compiler-cli/linker/src/file_linker/file_linker", "@angular/compiler-cli/linker/src/file_linker/linker_environment", "@angular/compiler-cli/linker/src/file_linker/linker_options", "@angular/compiler-cli/linker/src/file_linker/needs_linking"], factory);
}
})(function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.needsLinking = exports.DEFAULT_LINKER_OPTIONS = exports.LinkerEnvironment = exports.FileLinker = exports.isFatalLinkerError = exports.FatalLinkerError = exports.assert = void 0;
var utils_1 = require("@angular/compiler-cli/linker/src/ast/utils");
Object.defineProperty(exports, "assert", { enumerable: true, get: function () { return utils_1.assert; } });
var fatal_linker_error_1 = require("@angular/compiler-cli/linker/src/fatal_linker_error");
Object.defineProperty(exports, "FatalLinkerError", { enumerable: true, get: function () { return fatal_linker_error_1.FatalLinkerError; } });
Object.defineProperty(exports, "isFatalLinkerError", { enumerable: true, get: function () { return fatal_linker_error_1.isFatalLinkerError; } });
var file_linker_1 = require("@angular/compiler-cli/linker/src/file_linker/file_linker");
Object.defineProperty(exports, "FileLinker", { enumerable: true, get: function () { return file_linker_1.FileLinker; } });
var linker_environment_1 = require("@angular/compiler-cli/linker/src/file_linker/linker_environment");
Object.defineProperty(exports, "LinkerEnvironment", { enumerable: true, get: function () { return linker_environment_1.LinkerEnvironment; } });
var linker_options_1 = require("@angular/compiler-cli/linker/src/file_linker/linker_options");
Object.defineProperty(exports, "DEFAULT_LINKER_OPTIONS", { enumerable: true, get: function () { return linker_options_1.DEFAULT_LINKER_OPTIONS; } });
var needs_linking_1 = require("@angular/compiler-cli/linker/src/file_linker/needs_linking");
Object.defineProperty(exports, "needsLinking", { enumerable: true, get: function () { return needs_linking_1.needsLinking; } });
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiI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GVfbGlua2VyL2RlY2xhcmF0aW9uX3Njb3BlJztcbmV4cG9ydCB7RmlsZUxpbmtlcn0gZnJvbSAnLi9zcmMvZmlsZV9saW5rZXIvZmlsZV9saW5rZXInO1xuZXhwb3J0IHtMaW5rZXJFbnZpcm9ubWVudH0gZnJvbSAnLi9zcmMvZmlsZV9saW5rZXIvbGlua2VyX2Vudmlyb25tZW50JztcbmV4cG9ydCB7REVGQVVMVF9MSU5LRVJfT1BUSU9OUywgTGlua2VyT3B0aW9uc30gZnJvbSAnLi9zcmMvZmlsZV9saW5rZXIvbGlua2VyX29wdGlvbnMnO1xuZXhwb3J0IHtuZWVkc0xpbmtpbmd9IGZyb20gJy4vc3JjL2ZpbGVfbGlua2VyL25lZWRzX2xpbmtpbmcnO1xuIl19

View file

@ -0,0 +1,107 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/// <amd-module name="@angular/compiler-cli/linker/src/ast/ast_host" />
/**
* An abstraction for getting information from an AST while being agnostic to the underlying AST
* implementation.
*/
export interface AstHost<TExpression> {
/**
* Get the name of the symbol represented by the given expression node, or `null` if it is not a
* symbol.
*/
getSymbolName(node: TExpression): string | null;
/**
* Return `true` if the given expression is a string literal, or false otherwise.
*/
isStringLiteral(node: TExpression): boolean;
/**
* Parse the string value from the given expression, or throw if it is not a string literal.
*/
parseStringLiteral(str: TExpression): string;
/**
* Return `true` if the given expression is a numeric literal, or false otherwise.
*/
isNumericLiteral(node: TExpression): boolean;
/**
* Parse the numeric value from the given expression, or throw if it is not a numeric literal.
*/
parseNumericLiteral(num: TExpression): number;
/**
* Return `true` if the given expression can be considered a boolean literal, or false otherwise.
*
* Note that this should also cover the special case of some minified code where `true` and
* `false` are replaced by `!0` and `!1` respectively.
*/
isBooleanLiteral(node: TExpression): boolean;
/**
* Parse the boolean value from the given expression, or throw if it is not a boolean literal.
*
* Note that this should also cover the special case of some minified code where `true` and
* `false` are replaced by `!0` and `!1` respectively.
*/
parseBooleanLiteral(bool: TExpression): boolean;
/**
* Return `true` if the given expression is an array literal, or false otherwise.
*/
isArrayLiteral(node: TExpression): boolean;
/**
* Parse an array of expressions from the given expression, or throw if it is not an array
* literal.
*/
parseArrayLiteral(array: TExpression): TExpression[];
/**
* Return `true` if the given expression is an object literal, or false otherwise.
*/
isObjectLiteral(node: TExpression): boolean;
/**
* Parse the given expression into a map of object property names to property expressions, or
* throw if it is not an object literal.
*/
parseObjectLiteral(obj: TExpression): Map<string, TExpression>;
/**
* Return `true` if the given expression is a function, or false otherwise.
*/
isFunctionExpression(node: TExpression): boolean;
/**
* Compute the "value" of a function expression by parsing its body for a single `return`
* statement, extracting the returned expression, or throw if it is not possible.
*/
parseReturnValue(fn: TExpression): TExpression;
/**
* Return true if the given expression is a call expression, or false otherwise.
*/
isCallExpression(node: TExpression): boolean;
/**
* Returns the expression that is called in the provided call expression, or throw if it is not
* a call expression.
*/
parseCallee(call: TExpression): TExpression;
/**
* Returns the argument expressions for the provided call expression, or throw if it is not
* a call expression.
*/
parseArguments(call: TExpression): TExpression[];
/**
* Compute the location range of the expression in the source file, to be used for source-mapping.
*/
getRange(node: TExpression): Range;
}
/**
* The location of the start and end of an expression in the original source file.
*/
export interface Range {
/** 0-based character position of the range start in the source file text. */
startPos: number;
/** 0-based line index of the range start in the source file text. */
startLine: number;
/** 0-based column position of the range start in the source file text. */
startCol: number;
/** 0-based character position of the range end in the source file text. */
endPos: number;
}

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,202 @@
/// <amd-module name="@angular/compiler-cli/linker/src/ast/ast_value" />
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import * as o from '@angular/compiler';
import { AstHost, Range } from './ast_host';
/**
* Represents only those types in `T` that are object types.
*/
declare type ObjectType<T> = Extract<T, object>;
/**
* Represents the value type of an object literal.
*/
declare type ObjectValueType<T> = T extends Record<string, infer R> ? R : never;
/**
* Represents the value type of an array literal.
*/
declare type ArrayValueType<T> = T extends Array<infer R> ? R : never;
/**
* Ensures that `This` has its generic type `Actual` conform to the expected generic type in
* `Expected`, to disallow calling a method if the generic type does not conform.
*/
declare type ConformsTo<This, Actual, Expected> = Actual extends Expected ? This : never;
/**
* Ensures that `This` is an `AstValue` whose generic type conforms to `Expected`, to disallow
* calling a method if the value's type does not conform.
*/
declare type HasValueType<This, Expected> = This extends AstValue<infer Actual, any> ? ConformsTo<This, Actual, Expected> : never;
/**
* Represents only the string keys of type `T`.
*/
declare type PropertyKey<T> = keyof T & string;
/**
* This helper class wraps an object expression along with an `AstHost` object, exposing helper
* methods that make it easier to extract the properties of the object.
*
* The generic `T` is used as reference type of the expected structure that is represented by this
* object. It does not achieve full type-safety for the provided operations in correspondence with
* `T`; its main goal is to provide references to a documented type and ensure that the properties
* that are read from the object are present.
*
* Unfortunately, the generic types are unable to prevent reading an optional property from the
* object without first having called `has` to ensure that the property exists. This is one example
* of where full type-safety is not achieved.
*/
export declare class AstObject<T extends object, TExpression> {
readonly expression: TExpression;
private obj;
private host;
/**
* Create a new `AstObject` from the given `expression` and `host`.
*/
static parse<T extends object, TExpression>(expression: TExpression, host: AstHost<TExpression>): AstObject<T, TExpression>;
private constructor();
/**
* Returns true if the object has a property called `propertyName`.
*/
has(propertyName: PropertyKey<T>): boolean;
/**
* Returns the number value of the property called `propertyName`.
*
* Throws an error if there is no such property or the property is not a number.
*/
getNumber<K extends PropertyKey<T>>(this: ConformsTo<this, T[K], number>, propertyName: K): number;
/**
* Returns the string value of the property called `propertyName`.
*
* Throws an error if there is no such property or the property is not a string.
*/
getString<K extends PropertyKey<T>>(this: ConformsTo<this, T[K], string>, propertyName: K): string;
/**
* Returns the boolean value of the property called `propertyName`.
*
* Throws an error if there is no such property or the property is not a boolean.
*/
getBoolean<K extends PropertyKey<T>>(this: ConformsTo<this, T[K], boolean>, propertyName: K): boolean;
/**
* Returns the nested `AstObject` parsed from the property called `propertyName`.
*
* Throws an error if there is no such property or the property is not an object.
*/
getObject<K extends PropertyKey<T>>(this: ConformsTo<this, T[K], object>, propertyName: K): AstObject<ObjectType<T[K]>, TExpression>;
/**
* Returns an array of `AstValue` objects parsed from the property called `propertyName`.
*
* Throws an error if there is no such property or the property is not an array.
*/
getArray<K extends PropertyKey<T>>(this: ConformsTo<this, T[K], unknown[]>, propertyName: K): AstValue<ArrayValueType<T[K]>, TExpression>[];
/**
* Returns a `WrappedNodeExpr` object that wraps the expression at the property called
* `propertyName`.
*
* Throws an error if there is no such property.
*/
getOpaque(propertyName: PropertyKey<T>): o.WrappedNodeExpr<TExpression>;
/**
* Returns the raw `TExpression` value of the property called `propertyName`.
*
* Throws an error if there is no such property.
*/
getNode(propertyName: PropertyKey<T>): TExpression;
/**
* Returns an `AstValue` that wraps the value of the property called `propertyName`.
*
* Throws an error if there is no such property.
*/
getValue<K extends PropertyKey<T>>(propertyName: K): AstValue<T[K], TExpression>;
/**
* Converts the AstObject to a raw JavaScript object, mapping each property value (as an
* `AstValue`) to the generic type (`T`) via the `mapper` function.
*/
toLiteral<V>(mapper: (value: AstValue<ObjectValueType<T>, TExpression>) => V): Record<string, V>;
/**
* Converts the AstObject to a JavaScript Map, mapping each property value (as an
* `AstValue`) to the generic type (`T`) via the `mapper` function.
*/
toMap<V>(mapper: (value: AstValue<ObjectValueType<T>, TExpression>) => V): Map<string, V>;
private getRequiredProperty;
}
/**
* This helper class wraps an `expression`, exposing methods that use the `host` to give
* access to the underlying value of the wrapped expression.
*
* The generic `T` is used as reference type of the expected type that is represented by this value.
* It does not achieve full type-safety for the provided operations in correspondence with `T`; its
* main goal is to provide references to a documented type.
*/
export declare class AstValue<T, TExpression> {
readonly expression: TExpression;
private host;
constructor(expression: TExpression, host: AstHost<TExpression>);
/**
* Get the name of the symbol represented by the given expression node, or `null` if it is not a
* symbol.
*/
getSymbolName(): string | null;
/**
* Is this value a number?
*/
isNumber(): boolean;
/**
* Parse the number from this value, or error if it is not a number.
*/
getNumber(this: HasValueType<this, number>): number;
/**
* Is this value a string?
*/
isString(): boolean;
/**
* Parse the string from this value, or error if it is not a string.
*/
getString(this: HasValueType<this, string>): string;
/**
* Is this value a boolean?
*/
isBoolean(): boolean;
/**
* Parse the boolean from this value, or error if it is not a boolean.
*/
getBoolean(this: HasValueType<this, boolean>): boolean;
/**
* Is this value an object literal?
*/
isObject(): boolean;
/**
* Parse this value into an `AstObject`, or error if it is not an object literal.
*/
getObject(this: HasValueType<this, object>): AstObject<ObjectType<T>, TExpression>;
/**
* Is this value an array literal?
*/
isArray(): boolean;
/**
* Parse this value into an array of `AstValue` objects, or error if it is not an array literal.
*/
getArray(this: HasValueType<this, unknown[]>): AstValue<ArrayValueType<T>, TExpression>[];
/**
* Is this value a function expression?
*/
isFunction(): boolean;
/**
* Extract the return value as an `AstValue` from this value as a function expression, or error if
* it is not a function expression.
*/
getFunctionReturnValue<R>(this: HasValueType<this, Function>): AstValue<R, TExpression>;
isCallExpression(): boolean;
getCallee(): AstValue<unknown, TExpression>;
getArguments(): AstValue<unknown, TExpression>[];
/**
* Return the `TExpression` of this value wrapped in a `WrappedNodeExpr`.
*/
getOpaque(): o.WrappedNodeExpr<TExpression>;
/**
* Get the range of the location of this value in the original source.
*/
getRange(): Range;
}
export {};

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,38 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/// <amd-module name="@angular/compiler-cli/linker/src/ast/typescript/typescript_ast_host" />
import * as ts from 'typescript';
import { AstHost, Range } from '../ast_host';
/**
* This implementation of `AstHost` is able to get information from TypeScript AST nodes.
*
* This host is not actually used at runtime in the current code.
*
* It is implemented here to ensure that the `AstHost` abstraction is not unfairly skewed towards
* the Babel implementation. It could also provide a basis for a 3rd TypeScript compiler plugin to
* do linking in the future.
*/
export declare class TypeScriptAstHost implements AstHost<ts.Expression> {
getSymbolName(node: ts.Expression): string | null;
isStringLiteral: typeof ts.isStringLiteral;
parseStringLiteral(str: ts.Expression): string;
isNumericLiteral: typeof ts.isNumericLiteral;
parseNumericLiteral(num: ts.Expression): number;
isBooleanLiteral(node: ts.Expression): boolean;
parseBooleanLiteral(bool: ts.Expression): boolean;
isArrayLiteral: typeof ts.isArrayLiteralExpression;
parseArrayLiteral(array: ts.Expression): ts.Expression[];
isObjectLiteral: typeof ts.isObjectLiteralExpression;
parseObjectLiteral(obj: ts.Expression): Map<string, ts.Expression>;
isFunctionExpression(node: ts.Expression): node is ts.FunctionExpression | ts.ArrowFunction;
parseReturnValue(fn: ts.Expression): ts.Expression;
isCallExpression: typeof ts.isCallExpression;
parseCallee(call: ts.Expression): ts.Expression;
parseArguments(call: ts.Expression): ts.Expression[];
getRange(node: ts.Expression): Range;
}

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,5 @@
/// <amd-module name="@angular/compiler-cli/linker/src/ast/utils" />
/**
* Assert that the given `node` is of the type guarded by the `predicate` function.
*/
export declare function assert<T, K extends T>(node: T, predicate: (node: T) => node is K, expected: string): asserts node is K;

31
node_modules/@angular/compiler-cli/linker/src/ast/utils.js generated vendored Executable file
View file

@ -0,0 +1,31 @@
(function (factory) {
if (typeof module === "object" && typeof module.exports === "object") {
var v = factory(require, exports);
if (v !== undefined) module.exports = v;
}
else if (typeof define === "function" && define.amd) {
define("@angular/compiler-cli/linker/src/ast/utils", ["require", "exports", "@angular/compiler-cli/linker/src/fatal_linker_error"], factory);
}
})(function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.assert = void 0;
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
var fatal_linker_error_1 = require("@angular/compiler-cli/linker/src/fatal_linker_error");
/**
* Assert that the given `node` is of the type guarded by the `predicate` function.
*/
function assert(node, predicate, expected) {
if (!predicate(node)) {
throw new fatal_linker_error_1.FatalLinkerError(node, "Unsupported syntax, expected " + expected + ".");
}
}
exports.assert = assert;
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9jb21waWxlci1jbGkvbGlua2VyL3NyYy9hc3QvdXRpbHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7O0lBQUE7Ozs7OztPQU1HO0lBQ0gsMEZBQXVEO0lBRXZEOztPQUVHO0lBQ0gsU0FBZ0IsTUFBTSxDQUNsQixJQUFPLEVBQUUsU0FBaUMsRUFBRSxRQUFnQjtRQUM5RCxJQUFJLENBQUMsU0FBUyxDQUFDLElBQUksQ0FBQyxFQUFFO1lBQ3BCLE1BQU0sSUFBSSxxQ0FBZ0IsQ0FBQyxJQUFJLEVBQUUsa0NBQWdDLFFBQVEsTUFBRyxDQUFDLENBQUM7U0FDL0U7SUFDSCxDQUFDO0lBTEQsd0JBS0MiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEBsaWNlbnNlXG4gKiBDb3B5cmlnaHQgR29vZ2xlIExMQyBBbGwgUmlnaHRzIFJlc2VydmVkLlxuICpcbiAqIFVzZSBvZiB0aGlzIHNvdXJjZSBjb2RlIGlzIGdvdmVybmVkIGJ5IGFuIE1JVC1zdHlsZSBsaWNlbnNlIHRoYXQgY2FuIGJlXG4gKiBmb3VuZCBpbiB0aGUgTElDRU5TRSBmaWxlIGF0IGh0dHBzOi8vYW5ndWxhci5pby9saWNlbnNlXG4gKi9cbmltcG9ydCB7RmF0YWxMaW5rZXJFcnJvcn0gZnJvbSAnLi4vZmF0YWxfbGlua2VyX2Vycm9yJztcblxuLyoqXG4gKiBBc3NlcnQgdGhhdCB0aGUgZ2l2ZW4gYG5vZGVgIGlzIG9mIHRoZSB0eXBlIGd1YXJkZWQgYnkgdGhlIGBwcmVkaWNhdGVgIGZ1bmN0aW9uLlxuICovXG5leHBvcnQgZnVuY3Rpb24gYXNzZXJ0PFQsIEsgZXh0ZW5kcyBUPihcbiAgICBub2RlOiBULCBwcmVkaWNhdGU6IChub2RlOiBUKSA9PiBub2RlIGlzIEssIGV4cGVjdGVkOiBzdHJpbmcpOiBhc3NlcnRzIG5vZGUgaXMgSyB7XG4gIGlmICghcHJlZGljYXRlKG5vZGUpKSB7XG4gICAgdGhyb3cgbmV3IEZhdGFsTGlua2VyRXJyb3Iobm9kZSwgYFVuc3VwcG9ydGVkIHN5bnRheCwgZXhwZWN0ZWQgJHtleHBlY3RlZH0uYCk7XG4gIH1cbn1cbiJdfQ==

View file

@ -0,0 +1,26 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/// <amd-module name="@angular/compiler-cli/linker/src/fatal_linker_error" />
/**
* An unrecoverable error during linking.
*/
export declare class FatalLinkerError extends Error {
node: unknown;
readonly type = "FatalLinkerError";
/**
* Create a new FatalLinkerError.
*
* @param node The AST node where the error occurred.
* @param message A description of the error.
*/
constructor(node: unknown, message: string);
}
/**
* Whether the given object `e` is a FatalLinkerError.
*/
export declare function isFatalLinkerError(e: any): e is FatalLinkerError;

View file

@ -0,0 +1,49 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
(function (factory) {
if (typeof module === "object" && typeof module.exports === "object") {
var v = factory(require, exports);
if (v !== undefined) module.exports = v;
}
else if (typeof define === "function" && define.amd) {
define("@angular/compiler-cli/linker/src/fatal_linker_error", ["require", "exports", "tslib"], factory);
}
})(function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isFatalLinkerError = exports.FatalLinkerError = void 0;
var tslib_1 = require("tslib");
/**
* An unrecoverable error during linking.
*/
var FatalLinkerError = /** @class */ (function (_super) {
tslib_1.__extends(FatalLinkerError, _super);
/**
* Create a new FatalLinkerError.
*
* @param node The AST node where the error occurred.
* @param message A description of the error.
*/
function FatalLinkerError(node, message) {
var _this = _super.call(this, message) || this;
_this.node = node;
_this.type = 'FatalLinkerError';
return _this;
}
return FatalLinkerError;
}(Error));
exports.FatalLinkerError = FatalLinkerError;
/**
* Whether the given object `e` is a FatalLinkerError.
*/
function isFatalLinkerError(e) {
return e && e.type === 'FatalLinkerError';
}
exports.isFatalLinkerError = isFatalLinkerError;
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmF0YWxfbGlua2VyX2Vycm9yLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvY29tcGlsZXItY2xpL2xpbmtlci9zcmMvZmF0YWxfbGlua2VyX2Vycm9yLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7R0FNRzs7Ozs7Ozs7Ozs7Ozs7SUFFSDs7T0FFRztJQUNIO1FBQXNDLDRDQUFLO1FBR3pDOzs7OztXQUtHO1FBQ0gsMEJBQW1CLElBQWEsRUFBRSxPQUFlO1lBQWpELFlBQ0Usa0JBQU0sT0FBTyxDQUFDLFNBQ2Y7WUFGa0IsVUFBSSxHQUFKLElBQUksQ0FBUztZQVJ2QixVQUFJLEdBQUcsa0JBQWtCLENBQUM7O1FBVW5DLENBQUM7UUFDSCx1QkFBQztJQUFELENBQUMsQUFaRCxDQUFzQyxLQUFLLEdBWTFDO0lBWlksNENBQWdCO0lBYzdCOztPQUVHO0lBQ0gsU0FBZ0Isa0JBQWtCLENBQUMsQ0FBTTtRQUN2QyxPQUFPLENBQUMsSUFBSSxDQUFDLENBQUMsSUFBSSxLQUFLLGtCQUFrQixDQUFDO0lBQzVDLENBQUM7SUFGRCxnREFFQyIsInNvdXJjZX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

View file

@ -0,0 +1,45 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/// <amd-module name="@angular/compiler-cli/linker/src/file_linker/declaration_scope" />
/**
* This interface represents the lexical scope of a partial declaration in the source code.
*
* For example, if you had the following code:
*
* ```
* function foo() {
* function bar () {
* ɵɵngDeclareDirective({...});
* }
* }
* ```
*
* The `DeclarationScope` of the `ɵɵngDeclareDirective()` call is the body of the `bar()` function.
*
* The `FileLinker` uses this object to identify the lexical scope of any constant statements that
* might be generated by the linking process (i.e. where the `ConstantPool` lives for a set of
* partial linkers).
*/
export interface DeclarationScope<TSharedConstantScope, TExpression> {
/**
* Get a `TSharedConstantScope` object that can be used to reference the lexical scope where any
* shared constant statements would be inserted.
*
* This object is generic because different AST implementations will need different
* `TConstantScope` types to be able to insert shared constant statements. For example in Babel
* this would be a `NodePath` object; in TS it would just be a `Node` object.
*
* If it is not possible to find such a shared scope, then constant statements will be wrapped up
* with their generated linked definition expression, in the form of an IIFE.
*
* @param expression the expression that points to the Angular core framework import.
* @returns a reference to a reference object for where the shared constant statements will be
* inserted, or `null` if it is not possible to have a shared scope.
*/
getConstantScopeRef(expression: TExpression): TSharedConstantScope | null;
}

View file

@ -0,0 +1,20 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
(function (factory) {
if (typeof module === "object" && typeof module.exports === "object") {
var v = factory(require, exports);
if (v !== undefined) module.exports = v;
}
else if (typeof define === "function" && define.amd) {
define("@angular/compiler-cli/linker/src/file_linker/declaration_scope", ["require", "exports"], factory);
}
})(function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVjbGFyYXRpb25fc2NvcGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI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lZmluaXRpb24gZXhwcmVzc2lvbiwgaW4gdGhlIGZvcm0gb2YgYW4gSUlGRS5cbiAgICpcbiAgICogQHBhcmFtIGV4cHJlc3Npb24gdGhlIGV4cHJlc3Npb24gdGhhdCBwb2ludHMgdG8gdGhlIEFuZ3VsYXIgY29yZSBmcmFtZXdvcmsgaW1wb3J0LlxuICAgKiBAcmV0dXJucyBhIHJlZmVyZW5jZSB0byBhIHJlZmVyZW5jZSBvYmplY3QgZm9yIHdoZXJlIHRoZSBzaGFyZWQgY29uc3RhbnQgc3RhdGVtZW50cyB3aWxsIGJlXG4gICAqICAgICBpbnNlcnRlZCwgb3IgYG51bGxgIGlmIGl0IGlzIG5vdCBwb3NzaWJsZSB0byBoYXZlIGEgc2hhcmVkIHNjb3BlLlxuICAgKi9cbiAgZ2V0Q29uc3RhbnRTY29wZVJlZihleHByZXNzaW9uOiBURXhwcmVzc2lvbik6IFRTaGFyZWRDb25zdGFudFNjb3BlfG51bGw7XG59XG4iXX0=

View file

@ -0,0 +1,36 @@
/// <amd-module name="@angular/compiler-cli/linker/src/file_linker/emit_scopes/emit_scope" />
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { ConstantPool } from '@angular/compiler';
import * as o from '@angular/compiler/src/output/output_ast';
import { Translator } from '../translator';
/**
* This class represents (from the point of view of the `FileLinker`) the scope in which
* statements and expressions related to a linked partial declaration will be emitted.
*
* It holds a copy of a `ConstantPool` that is used to capture any constant statements that need to
* be emitted in this context.
*
* This implementation will emit the definition and the constant statements separately.
*/
export declare class EmitScope<TStatement, TExpression> {
protected readonly ngImport: TExpression;
protected readonly translator: Translator<TStatement, TExpression>;
readonly constantPool: ConstantPool;
constructor(ngImport: TExpression, translator: Translator<TStatement, TExpression>);
/**
* Translate the given Output AST definition expression into a generic `TExpression`.
*
* Use a `LinkerImportGenerator` to handle any imports in the definition.
*/
translateDefinition(definition: o.Expression): TExpression;
/**
* Return any constant statements that are shared between all uses of this `EmitScope`.
*/
getConstantStatements(): TStatement[];
}

View file

@ -0,0 +1,57 @@
(function (factory) {
if (typeof module === "object" && typeof module.exports === "object") {
var v = factory(require, exports);
if (v !== undefined) module.exports = v;
}
else if (typeof define === "function" && define.amd) {
define("@angular/compiler-cli/linker/src/file_linker/emit_scopes/emit_scope", ["require", "exports", "@angular/compiler", "@angular/compiler-cli/linker/src/linker_import_generator"], factory);
}
})(function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.EmitScope = void 0;
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
var compiler_1 = require("@angular/compiler");
var linker_import_generator_1 = require("@angular/compiler-cli/linker/src/linker_import_generator");
/**
* This class represents (from the point of view of the `FileLinker`) the scope in which
* statements and expressions related to a linked partial declaration will be emitted.
*
* It holds a copy of a `ConstantPool` that is used to capture any constant statements that need to
* be emitted in this context.
*
* This implementation will emit the definition and the constant statements separately.
*/
var EmitScope = /** @class */ (function () {
function EmitScope(ngImport, translator) {
this.ngImport = ngImport;
this.translator = translator;
this.constantPool = new compiler_1.ConstantPool();
}
/**
* Translate the given Output AST definition expression into a generic `TExpression`.
*
* Use a `LinkerImportGenerator` to handle any imports in the definition.
*/
EmitScope.prototype.translateDefinition = function (definition) {
return this.translator.translateExpression(definition, new linker_import_generator_1.LinkerImportGenerator(this.ngImport));
};
/**
* Return any constant statements that are shared between all uses of this `EmitScope`.
*/
EmitScope.prototype.getConstantStatements = function () {
var _this = this;
var importGenerator = new linker_import_generator_1.LinkerImportGenerator(this.ngImport);
return this.constantPool.statements.map(function (statement) { return _this.translator.translateStatement(statement, importGenerator); });
};
return EmitScope;
}());
exports.EmitScope = EmitScope;
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW1pdF9zY29wZS5qcyIsInNvdXJjZVJvb3QiOiIiL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WAuXG4gICAqL1xuICBnZXRDb25zdGFudFN0YXRlbWVudHMoKTogVFN0YXRlbWVudFtdIHtcbiAgICBjb25zdCBpbXBvcnRHZW5lcmF0b3IgPSBuZXcgTGlua2VySW1wb3J0R2VuZXJhdG9yKHRoaXMubmdJbXBvcnQpO1xuICAgIHJldHVybiB0aGlzLmNvbnN0YW50UG9vbC5zdGF0ZW1lbnRzLm1hcChcbiAgICAgICAgc3RhdGVtZW50ID0+IHRoaXMudHJhbnNsYXRvci50cmFuc2xhdGVTdGF0ZW1lbnQoc3RhdGVtZW50LCBpbXBvcnRHZW5lcmF0b3IpKTtcbiAgfVxufVxuIl19

View file

@ -0,0 +1,33 @@
/// <amd-module name="@angular/compiler-cli/linker/src/file_linker/emit_scopes/iife_emit_scope" />
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import * as o from '@angular/compiler/src/output/output_ast';
import { AstFactory } from '../../../../src/ngtsc/translator';
import { Translator } from '../translator';
import { EmitScope } from './emit_scope';
/**
* This class is a specialization of the `EmitScope` class that is designed for the situation where
* there is no clear shared scope for constant statements. In this case they are bundled with the
* translated definition inside an IIFE.
*/
export declare class IifeEmitScope<TStatement, TExpression> extends EmitScope<TStatement, TExpression> {
private readonly factory;
constructor(ngImport: TExpression, translator: Translator<TStatement, TExpression>, factory: AstFactory<TStatement, TExpression>);
/**
* Translate the given Output AST definition expression into a generic `TExpression`.
*
* Wraps the output from `EmitScope.translateDefinition()` and `EmitScope.getConstantStatements()`
* in an IIFE.
*/
translateDefinition(definition: o.Expression): TExpression;
/**
* It is not valid to call this method, since there will be no shared constant statements - they
* are already emitted in the IIFE alongside the translated definition.
*/
getConstantStatements(): TStatement[];
}

View file

@ -0,0 +1,51 @@
(function (factory) {
if (typeof module === "object" && typeof module.exports === "object") {
var v = factory(require, exports);
if (v !== undefined) module.exports = v;
}
else if (typeof define === "function" && define.amd) {
define("@angular/compiler-cli/linker/src/file_linker/emit_scopes/iife_emit_scope", ["require", "exports", "tslib", "@angular/compiler-cli/linker/src/file_linker/emit_scopes/emit_scope"], factory);
}
})(function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.IifeEmitScope = void 0;
var tslib_1 = require("tslib");
var emit_scope_1 = require("@angular/compiler-cli/linker/src/file_linker/emit_scopes/emit_scope");
/**
* This class is a specialization of the `EmitScope` class that is designed for the situation where
* there is no clear shared scope for constant statements. In this case they are bundled with the
* translated definition inside an IIFE.
*/
var IifeEmitScope = /** @class */ (function (_super) {
tslib_1.__extends(IifeEmitScope, _super);
function IifeEmitScope(ngImport, translator, factory) {
var _this = _super.call(this, ngImport, translator) || this;
_this.factory = factory;
return _this;
}
/**
* Translate the given Output AST definition expression into a generic `TExpression`.
*
* Wraps the output from `EmitScope.translateDefinition()` and `EmitScope.getConstantStatements()`
* in an IIFE.
*/
IifeEmitScope.prototype.translateDefinition = function (definition) {
var constantStatements = _super.prototype.getConstantStatements.call(this);
var returnStatement = this.factory.createReturnStatement(_super.prototype.translateDefinition.call(this, definition));
var body = this.factory.createBlock(tslib_1.__spreadArray(tslib_1.__spreadArray([], tslib_1.__read(constantStatements)), [returnStatement]));
var fn = this.factory.createFunctionExpression(/* name */ null, /* args */ [], body);
return this.factory.createCallExpression(fn, /* args */ [], /* pure */ false);
};
/**
* It is not valid to call this method, since there will be no shared constant statements - they
* are already emitted in the IIFE alongside the translated definition.
*/
IifeEmitScope.prototype.getConstantStatements = function () {
throw new Error('BUG - IifeEmitScope should not expose any constant statements');
};
return IifeEmitScope;
}(emit_scope_1.EmitScope));
exports.IifeEmitScope = IifeEmitScope;
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaWlmZV9lbWl0X3Njb3BlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvY29tcGl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GJvZHkgPSB0aGlzLmZhY3RvcnkuY3JlYXRlQmxvY2soWy4uLmNvbnN0YW50U3RhdGVtZW50cywgcmV0dXJuU3RhdGVtZW50XSk7XG4gICAgY29uc3QgZm4gPSB0aGlzLmZhY3RvcnkuY3JlYXRlRnVuY3Rpb25FeHByZXNzaW9uKC8qIG5hbWUgKi8gbnVsbCwgLyogYXJncyAqL1tdLCBib2R5KTtcbiAgICByZXR1cm4gdGhpcy5mYWN0b3J5LmNyZWF0ZUNhbGxFeHByZXNzaW9uKGZuLCAvKiBhcmdzICovW10sIC8qIHB1cmUgKi8gZmFsc2UpO1xuICB9XG5cbiAgLyoqXG4gICAqIEl0IGlzIG5vdCB2YWxpZCB0byBjYWxsIHRoaXMgbWV0aG9kLCBzaW5jZSB0aGVyZSB3aWxsIGJlIG5vIHNoYXJlZCBjb25zdGFudCBzdGF0ZW1lbnRzIC0gdGhleVxuICAgKiBhcmUgYWxyZWFkeSBlbWl0dGVkIGluIHRoZSBJSUZFIGFsb25nc2lkZSB0aGUgdHJhbnNsYXRlZCBkZWZpbml0aW9uLlxuICAgKi9cbiAgb3ZlcnJpZGUgZ2V0Q29uc3RhbnRTdGF0ZW1lbnRzKCk6IFRTdGF0ZW1lbnRbXSB7XG4gICAgdGhyb3cgbmV3IEVycm9yKCdCVUcgLSBJaWZlRW1pdFNjb3BlIHNob3VsZCBub3QgZXhwb3NlIGFueSBjb25zdGFudCBzdGF0ZW1lbnRzJyk7XG4gIH1cbn1cbiJdfQ==

View file

@ -0,0 +1,40 @@
/// <amd-module name="@angular/compiler-cli/linker/src/file_linker/file_linker" />
import { AbsoluteFsPath } from '../../../src/ngtsc/file_system';
import { DeclarationScope } from './declaration_scope';
import { LinkerEnvironment } from './linker_environment';
export declare const NO_STATEMENTS: Readonly<any[]>;
/**
* This class is responsible for linking all the partial declarations found in a single file.
*/
export declare class FileLinker<TConstantScope, TStatement, TExpression> {
private linkerEnvironment;
private linkerSelector;
private emitScopes;
constructor(linkerEnvironment: LinkerEnvironment<TStatement, TExpression>, sourceUrl: AbsoluteFsPath, code: string);
/**
* Return true if the given callee name matches a partial declaration that can be linked.
*/
isPartialDeclaration(calleeName: string): boolean;
/**
* Link the metadata extracted from the args of a call to a partial declaration function.
*
* The `declarationScope` is used to determine the scope and strategy of emission of the linked
* definition and any shared constant statements.
*
* @param declarationFn the name of the function used to declare the partial declaration - e.g.
* `ɵɵngDeclareDirective`.
* @param args the arguments passed to the declaration function, should be a single object that
* corresponds to the `R3DeclareDirectiveMetadata` or `R3DeclareComponentMetadata` interfaces.
* @param declarationScope the scope that contains this call to the declaration function.
*/
linkPartialDeclaration(declarationFn: string, args: TExpression[], declarationScope: DeclarationScope<TConstantScope, TExpression>): TExpression;
/**
* Return all the shared constant statements and their associated constant scope references, so
* that they can be inserted into the source code.
*/
getConstantStatements(): {
constantScope: TConstantScope;
statements: TStatement[];
}[];
private getEmitScope;
}

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,19 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/// <amd-module name="@angular/compiler-cli/linker/src/file_linker/get_source_file" />
import { AbsoluteFsPath } from '../../../src/ngtsc/file_system';
import { SourceFile, SourceFileLoader } from '../../../src/ngtsc/sourcemaps';
/**
* A function that will return a `SourceFile` object (or null) for the current file being linked.
*/
export declare type GetSourceFileFn = () => SourceFile | null;
/**
* Create a `GetSourceFileFn` that will return the `SourceFile` being linked or `null`, if not
* available.
*/
export declare function createGetSourceFile(sourceUrl: AbsoluteFsPath, code: string, loader: SourceFileLoader | null): GetSourceFileFn;

View file

@ -0,0 +1,42 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
(function (factory) {
if (typeof module === "object" && typeof module.exports === "object") {
var v = factory(require, exports);
if (v !== undefined) module.exports = v;
}
else if (typeof define === "function" && define.amd) {
define("@angular/compiler-cli/linker/src/file_linker/get_source_file", ["require", "exports"], factory);
}
})(function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createGetSourceFile = void 0;
/**
* Create a `GetSourceFileFn` that will return the `SourceFile` being linked or `null`, if not
* available.
*/
function createGetSourceFile(sourceUrl, code, loader) {
if (loader === null) {
// No source-mapping so just return a function that always returns `null`.
return function () { return null; };
}
else {
// Source-mapping is available so return a function that will load (and cache) the `SourceFile`.
var sourceFile_1 = undefined;
return function () {
if (sourceFile_1 === undefined) {
sourceFile_1 = loader.loadSourceFile(sourceUrl, code);
}
return sourceFile_1;
};
}
}
exports.createGetSourceFile = createGetSourceFile;
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2V0X3NvdXJjZV9maWxlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvY29tcGlsZXItY2xpL2xpbmtlci9zcmMvZmlsZV9saW5rZXIvZ2V0X3NvdXJjZV9maWxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7R0FNRzs7Ozs7Ozs7Ozs7OztJQVVIOzs7T0FHRztJQUNILFNBQWdCLG1CQUFtQixDQUMvQixTQUF5QixFQUFFLElBQVksRUFBRSxNQUE2QjtRQUN4RSxJQUFJLE1BQU0sS0FBSyxJQUFJLEVBQUU7WUFDbkIsMEVBQTBFO1lBQzFFLE9BQU8sY0FBTSxPQUFBLElBQUksRUFBSixDQUFJLENBQUM7U0FDbkI7YUFBTTtZQUNMLGdHQUFnRztZQUNoRyxJQUFJLFlBQVUsR0FBOEIsU0FBUyxDQUFDO1lBQ3RELE9BQU87Z0JBQ0wsSUFBSSxZQUFVLEtBQUssU0FBUyxFQUFFO29CQUM1QixZQUFVLEdBQUcsTUFBTSxDQUFDLGNBQWMsQ0FBQyxTQUFTLEVBQ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VybDogQWJzb2x1dGVGc1BhdGgsIGNvZGU6IHN0cmluZywgbG9hZGVyOiBTb3VyY2VGaWxlTG9hZGVyfG51bGwpOiBHZXRTb3VyY2VGaWxlRm4ge1xuICBpZiAobG9hZGVyID09PSBudWxsKSB7XG4gICAgLy8gTm8gc291cmNlLW1hcHBpbmcgc28ganVzdCByZXR1cm4gYSBmdW5jdGlvbiB0aGF0IGFsd2F5cyByZXR1cm5zIGBudWxsYC5cbiAgICByZXR1cm4gKCkgPT4gbnVsbDtcbiAgfSBlbHNlIHtcbiAgICAvLyBTb3VyY2UtbWFwcGluZyBpcyBhdmFpbGFibGUgc28gcmV0dXJuIGEgZnVuY3Rpb24gdGhhdCB3aWxsIGxvYWQgKGFuZCBjYWNoZSkgdGhlIGBTb3VyY2VGaWxlYC5cbiAgICBsZXQgc291cmNlRmlsZTogU291cmNlRmlsZXxudWxsfHVuZGVmaW5lZCA9IHVuZGVmaW5lZDtcbiAgICByZXR1cm4gKCkgPT4ge1xuICAgICAgaWYgKHNvdXJjZUZpbGUgPT09IHVuZGVmaW5lZCkge1xuICAgICAgICBzb3VyY2VGaWxlID0gbG9hZGVyLmxvYWRTb3VyY2VGaWxlKHNvdXJjZVVybCwgY29kZSk7XG4gICAgICB9XG4gICAgICByZXR1cm4gc291cmNlRmlsZTtcbiAgICB9O1xuICB9XG59XG4iXX0=

View file

@ -0,0 +1,26 @@
/// <amd-module name="@angular/compiler-cli/linker/src/file_linker/linker_environment" />
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { ReadonlyFileSystem } from '../../../src/ngtsc/file_system';
import { Logger } from '../../../src/ngtsc/logging';
import { SourceFileLoader } from '../../../src/ngtsc/sourcemaps';
import { AstFactory } from '../../../src/ngtsc/translator';
import { AstHost } from '../ast/ast_host';
import { LinkerOptions } from './linker_options';
import { Translator } from './translator';
export declare class LinkerEnvironment<TStatement, TExpression> {
readonly fileSystem: ReadonlyFileSystem;
readonly logger: Logger;
readonly host: AstHost<TExpression>;
readonly factory: AstFactory<TStatement, TExpression>;
readonly options: LinkerOptions;
readonly translator: Translator<TStatement, TExpression>;
readonly sourceFileLoader: SourceFileLoader | null;
private constructor();
static create<TStatement, TExpression>(fileSystem: ReadonlyFileSystem, logger: Logger, host: AstHost<TExpression>, factory: AstFactory<TStatement, TExpression>, options: Partial<LinkerOptions>): LinkerEnvironment<TStatement, TExpression>;
}

View file

@ -0,0 +1,38 @@
(function (factory) {
if (typeof module === "object" && typeof module.exports === "object") {
var v = factory(require, exports);
if (v !== undefined) module.exports = v;
}
else if (typeof define === "function" && define.amd) {
define("@angular/compiler-cli/linker/src/file_linker/linker_environment", ["require", "exports", "@angular/compiler-cli/src/ngtsc/sourcemaps", "@angular/compiler-cli/linker/src/file_linker/linker_options", "@angular/compiler-cli/linker/src/file_linker/translator"], factory);
}
})(function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.LinkerEnvironment = void 0;
var sourcemaps_1 = require("@angular/compiler-cli/src/ngtsc/sourcemaps");
var linker_options_1 = require("@angular/compiler-cli/linker/src/file_linker/linker_options");
var translator_1 = require("@angular/compiler-cli/linker/src/file_linker/translator");
var LinkerEnvironment = /** @class */ (function () {
function LinkerEnvironment(fileSystem, logger, host, factory, options) {
this.fileSystem = fileSystem;
this.logger = logger;
this.host = host;
this.factory = factory;
this.options = options;
this.translator = new translator_1.Translator(this.factory);
this.sourceFileLoader = this.options.sourceMapping ? new sourcemaps_1.SourceFileLoader(this.fileSystem, this.logger, {}) : null;
}
LinkerEnvironment.create = function (fileSystem, logger, host, factory, options) {
var _a, _b, _c;
return new LinkerEnvironment(fileSystem, logger, host, factory, {
sourceMapping: (_a = options.sourceMapping) !== null && _a !== void 0 ? _a : linker_options_1.DEFAULT_LINKER_OPTIONS.sourceMapping,
linkerJitMode: (_b = options.linkerJitMode) !== null && _b !== void 0 ? _b : linker_options_1.DEFAULT_LINKER_OPTIONS.linkerJitMode,
unknownDeclarationVersionHandling: (_c = options.unknownDeclarationVersionHandling) !== null && _c !== void 0 ? _c : linker_options_1.DEFAULT_LINKER_OPTIONS.unknownDeclarationVersionHandling,
});
};
return LinkerEnvironment;
}());
exports.LinkerEnvironment = LinkerEnvironment;
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGlua2VyX2Vudmlyb25tZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvY29tcGlsZXItY2xpL2xpbmtlci9zcmMvZmlsZV9saW5rZXIvbGlua2VyX2Vudmlyb25tZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7OztJQVNBLHlFQUErRDtJQUkvRCw4RkFBdUU7SUFDdkUsc0ZBQXdDO0lBRXhDO1FBS0UsMkJBQ2EsVUFBOEIsRUFBVyxNQUFjLEVBQ3ZELElBQTBCLEVBQVcsT0FBNEMsRUFDakYsT0FBc0I7WUFGdEIsZUFBVSxHQUFWLFVBQVUsQ0FBb0I7WUFBVyxXQUFNLEdBQU4sTUFBTSxDQUFRO1lBQ3ZELFNBQUksR0FBSixJQUFJLENBQXNCO1lBQVcsWUFBTyxHQUFQLE9BQU8sQ0FBcUM7WUFDakYsWUFBTyxHQUFQLE9BQU8sQ0FBZTtZQVAxQixlQUFVLEdBQUcsSUFBSSx1QkFBVSxDQUEwQixJQUFJLENBQUMsT0FBTyxDQUFDLENBQUM7WUFDbkUscUJBQWdCLEdBQ3JCLElBQUksQ0FBQyxPQUFPLENBQUMsYUFBYSxDQUFDLENBQUMsQ0FBQyxJQUFJLDZCQUFnQixDQUFDLElBQUksQ0FBQyxVQUFVLEVBQUUsSUFBSSxDQUFDLE1BQU0sRUFBRSxFQUFFLENBQUMsQ0FBQyxDQUFDLENBQUMsSUFBSSxDQUFDO1FBS3pELENBQU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FxuICAgICAgZmlsZVN5c3RlbTogUmVhZG9ubHlGaWxlU3lzdGVtLCBsb2dnZXI6IExvZ2dlciwgaG9zdDogQXN0SG9zdDxURXhwcmVzc2lvbj4sXG4gICAgICBmYWN0b3J5OiBBc3RGYWN0b3J5PFRTdGF0ZW1lbnQsIFRFeHByZXNzaW9uPixcbiAgICAgIG9wdGlvbnM6IFBhcnRpYWw8TGlua2VyT3B0aW9ucz4pOiBMaW5rZXJFbnZpcm9ubWVudDxUU3RhdGVtZW50LCBURXhwcmVzc2lvbj4ge1xuICAgIHJldHVybiBuZXcgTGlua2VyRW52aXJvbm1lbnQoZmlsZVN5c3RlbSwgbG9nZ2VyLCBob3N0LCBmYWN0b3J5LCB7XG4gICAgICBzb3VyY2VNYXBwaW5nOiBvcHRpb25zLnNvdXJjZU1hcHBpbmcgPz8gREVGQVVMVF9MSU5LRVJfT1BUSU9OUy5zb3VyY2VNYXBwaW5nLFxuICAgICAgbGlua2VySml0TW9kZTogb3B0aW9ucy5saW5rZXJKaXRNb2RlID8/IERFRkFVTFRfTElOS0VSX09QVElPTlMubGlua2VySml0TW9kZSxcbiAgICAgIHVua25vd25EZWNsYXJhdGlvblZlcnNpb25IYW5kbGluZzogb3B0aW9ucy51bmtub3duRGVjbGFyYXRpb25WZXJzaW9uSGFuZGxpbmcgPz9cbiAgICAgICAgICBERUZBVUxUX0xJTktFUl9PUFRJT05TLnVua25vd25EZWNsYXJhdGlvblZlcnNpb25IYW5kbGluZyxcbiAgICB9KTtcbiAgfVxufVxuIl19

View file

@ -0,0 +1,42 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/// <amd-module name="@angular/compiler-cli/linker/src/file_linker/linker_options" />
/**
* Options to configure the linking behavior.
*/
export interface LinkerOptions {
/**
* Whether to use source-mapping to compute the original source for external templates.
* The default is `true`.
*/
sourceMapping: boolean;
/**
* This option tells the linker to generate information used by a downstream JIT compiler.
*
* Specifically, in JIT mode, NgModule definitions must describe the `declarations`, `imports`,
* `exports`, etc, which are otherwise not needed.
*/
linkerJitMode: boolean;
/**
* How to handle a situation where a partial declaration matches none of the supported
* partial-linker versions.
*
* - `error` - the version mismatch is a fatal error.
* - `warn` - a warning is sent to the logger but the most recent partial-linker
* will attempt to process the declaration anyway.
* - `ignore` - the most recent partial-linker will, silently, attempt to process
* the declaration.
*
* The default is `error`.
*/
unknownDeclarationVersionHandling: 'ignore' | 'warn' | 'error';
}
/**
* The default linker options to use if properties are not provided.
*/
export declare const DEFAULT_LINKER_OPTIONS: LinkerOptions;

View file

@ -0,0 +1,29 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
(function (factory) {
if (typeof module === "object" && typeof module.exports === "object") {
var v = factory(require, exports);
if (v !== undefined) module.exports = v;
}
else if (typeof define === "function" && define.amd) {
define("@angular/compiler-cli/linker/src/file_linker/linker_options", ["require", "exports"], factory);
}
})(function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DEFAULT_LINKER_OPTIONS = void 0;
/**
* The default linker options to use if properties are not provided.
*/
exports.DEFAULT_LINKER_OPTIONS = {
sourceMapping: true,
linkerJitMode: false,
unknownDeclarationVersionHandling: 'error',
};
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGlua2VyX29wdGlvbnMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9jb21waWxlci1jbGkvbGlua2VyL3NyYy9maWxlX2xpbmtlci9saW5rZXJfb3B0aW9ucy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7O0dBTUc7Ozs7Ozs7Ozs7Ozs7SUFtQ0g7O09BRUc7SUFDVSxRQUFBLHNCQUFzQixHQUF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GVjbGFyYXRpb25WZXJzaW9uSGFuZGxpbmc6ICdlcnJvcicsXG59O1xuIl19

View file

@ -0,0 +1,24 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/// <amd-module name="@angular/compiler-cli/linker/src/file_linker/needs_linking" />
/**
* Determines if the provided source file may need to be processed by the linker, i.e. whether it
* potentially contains any declarations. If true is returned, then the source file should be
* processed by the linker as it may contain declarations that need to be fully compiled. If false
* is returned, parsing and processing of the source file can safely be skipped to improve
* performance.
*
* This function may return true even for source files that don't actually contain any declarations
* that need to be compiled.
*
* @param path the absolute path of the source file for which to determine whether linking may be
* needed.
* @param source the source file content as a string.
* @returns whether the source file may contain declarations that need to be linked.
*/
export declare function needsLinking(path: string, source: string): boolean;

View file

@ -0,0 +1,41 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
(function (factory) {
if (typeof module === "object" && typeof module.exports === "object") {
var v = factory(require, exports);
if (v !== undefined) module.exports = v;
}
else if (typeof define === "function" && define.amd) {
define("@angular/compiler-cli/linker/src/file_linker/needs_linking", ["require", "exports", "@angular/compiler-cli/linker/src/file_linker/partial_linkers/partial_linker_selector"], factory);
}
})(function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.needsLinking = void 0;
var partial_linker_selector_1 = require("@angular/compiler-cli/linker/src/file_linker/partial_linkers/partial_linker_selector");
/**
* Determines if the provided source file may need to be processed by the linker, i.e. whether it
* potentially contains any declarations. If true is returned, then the source file should be
* processed by the linker as it may contain declarations that need to be fully compiled. If false
* is returned, parsing and processing of the source file can safely be skipped to improve
* performance.
*
* This function may return true even for source files that don't actually contain any declarations
* that need to be compiled.
*
* @param path the absolute path of the source file for which to determine whether linking may be
* needed.
* @param source the source file content as a string.
* @returns whether the source file may contain declarations that need to be linked.
*/
function needsLinking(path, source) {
return partial_linker_selector_1.declarationFunctions.some(function (fn) { return source.includes(fn); });
}
exports.needsLinking = needsLinking;
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmVlZHNfbGlua2luZy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL2NvbXBpbGVyLWNsaS9saW5rZXIvc3JjL2ZpbGVfbGlua2VyL25lZWRzX2xpbmtpbmcudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7OztHQU1HOzs7Ozs7Ozs7Ozs7O0lBRUgsZ0lBQStFO0lBRS9FOzs7Ozs7Ozs7Ozs7OztPQWNHO0lBQ0gsU0FBZ0IsWUFBWSxDQUFDLElBQVksRUFBRSxNQUFjO1FBQ3ZELE9BQU8sOENBQW9CLENBQUMsSUFBSSxDQUFDLFVBQUEsRUFBRSxJQUFJLE9BQUEsTUFBTSxDQUFDLFFBQVEsQ0FBQyxFQUFFLENBQUMsRUFBbkIsQ0FBbUIsQ0FBQyxDQUFDO0lBQzlELENBQUM7SUFGRCxvQ0FFQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogQGxpY2Vuc2VcbiAqIENvcHlyaWdodCBHb29nbGUgTExDIEFsbCBSaWdodHMgUmVzZXJ2ZWQuXG4gKlxuICogVXNlIG9mIHRoaXMgc291cmNlIGNvZGUgaXMgZ292ZXJuZWQgYnkgYW4gTUlULXN0eWxlIGxpY2Vuc2UgdGhhdCBjYW4gYmVcbiAqIGZvdW5kIGluIHRoZSBMSUNFTlNFIGZpbGUgYXQgaHR0cHM6Ly9hbmd1bGFyLmlvL2xpY2Vuc2VcbiAqL1xuXG5pbXBvcnQge2RlY2xhcmF0aW9uRnVuY3Rpb25zfSBmcm9tICcuL3BhcnRpYWxfbGlua2Vycy9wYXJ0aWFsX2xpbmtlcl9zZWxlY3Rvcic7XG5cbi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9cbmV4cG9ydCBmdW5jdGlvbiBuZWVkc0xpbmtpbmcocGF0aDogc3RyaW5nLCBzb3VyY2U6IHN0cmluZyk6IGJvb2xlYW4ge1xuICByZXR1cm4gZGVjbGFyYXRpb25GdW5jdGlvbnMuc29tZShmbiA9PiBzb3VyY2UuaW5jbHVkZXMoZm4pKTtcbn1cbiJdfQ==

View file

@ -0,0 +1,22 @@
/// <amd-module name="@angular/compiler-cli/linker/src/file_linker/partial_linkers/partial_class_metadata_linker_1" />
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { ConstantPool, R3ClassMetadata, R3DeclareClassMetadata, R3PartialDeclaration } from '@angular/compiler';
import * as o from '@angular/compiler/src/output/output_ast';
import { AstObject } from '../../ast/ast_value';
import { PartialLinker } from './partial_linker';
/**
* A `PartialLinker` that is designed to process `ɵɵngDeclareClassMetadata()` call expressions.
*/
export declare class PartialClassMetadataLinkerVersion1<TExpression> implements PartialLinker<TExpression> {
linkPartialDeclaration(constantPool: ConstantPool, metaObj: AstObject<R3PartialDeclaration, TExpression>): o.Expression;
}
/**
* Derives the `R3ClassMetadata` structure from the AST object.
*/
export declare function toR3ClassMetadata<TExpression>(metaObj: AstObject<R3DeclareClassMetadata, TExpression>): R3ClassMetadata;

View file

@ -0,0 +1,47 @@
(function (factory) {
if (typeof module === "object" && typeof module.exports === "object") {
var v = factory(require, exports);
if (v !== undefined) module.exports = v;
}
else if (typeof define === "function" && define.amd) {
define("@angular/compiler-cli/linker/src/file_linker/partial_linkers/partial_class_metadata_linker_1", ["require", "exports", "@angular/compiler"], factory);
}
})(function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.toR3ClassMetadata = exports.PartialClassMetadataLinkerVersion1 = void 0;
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
var compiler_1 = require("@angular/compiler");
/**
* A `PartialLinker` that is designed to process `ɵɵngDeclareClassMetadata()` call expressions.
*/
var PartialClassMetadataLinkerVersion1 = /** @class */ (function () {
function PartialClassMetadataLinkerVersion1() {
}
PartialClassMetadataLinkerVersion1.prototype.linkPartialDeclaration = function (constantPool, metaObj) {
var meta = toR3ClassMetadata(metaObj);
return compiler_1.compileClassMetadata(meta);
};
return PartialClassMetadataLinkerVersion1;
}());
exports.PartialClassMetadataLinkerVersion1 = PartialClassMetadataLinkerVersion1;
/**
* Derives the `R3ClassMetadata` structure from the AST object.
*/
function toR3ClassMetadata(metaObj) {
return {
type: metaObj.getOpaque('type'),
decorators: metaObj.getOpaque('decorators'),
ctorParameters: metaObj.has('ctorParameters') ? metaObj.getOpaque('ctorParameters') : null,
propDecorators: metaObj.has('propDecorators') ? metaObj.getOpaque('propDecorators') : null,
};
}
exports.toR3ClassMetadata = toR3ClassMetadata;
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGFydGlhbF9jbGFzc19tZXRhZGF0YV9saW5rZXJfMS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL2NvbXBpbGVyLWNsaS9saW5rZXIvc3JjL2ZpbGVfbGlua2VyL3BhcnRpYWxfbGlua2Vycy9wYXJ0aWFsX2NsYXNzX21ldGFkYXRhX2xpbmtlcl8xLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7OztJQUFBOzs7Ozs7T0FNRztJQUNILDhDQUFvSTtJQU9wSTs7T0FFRztJQUNIO1FBQUE7UUFPQSxDQUFDO1FBTkMsbUVBQXNCLEdBQXRCLFVBQ0ksWUFBMEIsRUFDMUIsT0FBcUQ7WUFDdkQsSUFBTSxJQUFJLEdBQUcsaUJBQWlCLENBQUMsT0FBTyxDQUFDLENBQUM7WUFDeEMsT0FBTyw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V0YU9iajogQXN0T2JqZWN0PFIzRGVjbGFyZUNsYXNzTWV0YWRhdGEsIFRFeHByZXNzaW9uPik6IFIzQ2xhc3NNZXRhZGF0YSB7XG4gIHJldHVybiB7XG4gICAgdHlwZTogbWV0YU9iai5nZXRPcGFxdWUoJ3R5cGUnKSxcbiAgICBkZWNvcmF0b3JzOiBtZXRhT2JqLmdldE9wYXF1ZSgnZGVjb3JhdG9ycycpLFxuICAgIGN0b3JQYXJhbWV0ZXJzOiBtZXRhT2JqLmhhcygnY3RvclBhcmFtZXRlcnMnKSA/IG1ldGFPYmouZ2V0T3BhcXVlKCdjdG9yUGFyYW1ldGVycycpIDogbnVsbCxcbiAgICBwcm9wRGVjb3JhdG9yczogbWV0YU9iai5oYXMoJ3Byb3BEZWNvcmF0b3JzJykgPyBtZXRhT2JqLmdldE9wYXF1ZSgncHJvcERlY29yYXRvcnMnKSA6IG51bGwsXG4gIH07XG59XG4iXX0=

View file

@ -0,0 +1,34 @@
/// <amd-module name="@angular/compiler-cli/linker/src/file_linker/partial_linkers/partial_component_linker_1" />
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { ConstantPool, R3PartialDeclaration } from '@angular/compiler';
import * as o from '@angular/compiler/src/output/output_ast';
import { AbsoluteFsPath } from '../../../../src/ngtsc/file_system';
import { AstObject } from '../../ast/ast_value';
import { GetSourceFileFn } from '../get_source_file';
import { PartialLinker } from './partial_linker';
/**
* A `PartialLinker` that is designed to process `ɵɵngDeclareComponent()` call expressions.
*/
export declare class PartialComponentLinkerVersion1<TStatement, TExpression> implements PartialLinker<TExpression> {
private readonly getSourceFile;
private sourceUrl;
private code;
constructor(getSourceFile: GetSourceFileFn, sourceUrl: AbsoluteFsPath, code: string);
linkPartialDeclaration(constantPool: ConstantPool, metaObj: AstObject<R3PartialDeclaration, TExpression>): o.Expression;
/**
* This function derives the `R3ComponentMetadata` from the provided AST object.
*/
private toR3ComponentMeta;
/**
* Update the range to remove the start and end chars, which should be quotes around the template.
*/
private getTemplateInfo;
private tryExternalTemplate;
private templateFromPartialCode;
}

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,28 @@
/// <amd-module name="@angular/compiler-cli/linker/src/file_linker/partial_linkers/partial_directive_linker_1" />
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { ConstantPool, ParseSourceSpan, R3DeclareDirectiveMetadata, R3DirectiveMetadata, R3PartialDeclaration } from '@angular/compiler';
import * as o from '@angular/compiler/src/output/output_ast';
import { AbsoluteFsPath } from '../../../../src/ngtsc/file_system';
import { Range } from '../../ast/ast_host';
import { AstObject } from '../../ast/ast_value';
import { PartialLinker } from './partial_linker';
/**
* A `PartialLinker` that is designed to process `ɵɵngDeclareDirective()` call expressions.
*/
export declare class PartialDirectiveLinkerVersion1<TExpression> implements PartialLinker<TExpression> {
private sourceUrl;
private code;
constructor(sourceUrl: AbsoluteFsPath, code: string);
linkPartialDeclaration(constantPool: ConstantPool, metaObj: AstObject<R3PartialDeclaration, TExpression>): o.Expression;
}
/**
* Derives the `R3DirectiveMetadata` structure from the AST object.
*/
export declare function toR3DirectiveMeta<TExpression>(metaObj: AstObject<R3DeclareDirectiveMetadata, TExpression>, code: string, sourceUrl: AbsoluteFsPath): R3DirectiveMetadata;
export declare function createSourceSpan(range: Range, code: string, sourceUrl: string): ParseSourceSpan;

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,22 @@
/// <amd-module name="@angular/compiler-cli/linker/src/file_linker/partial_linkers/partial_factory_linker_1" />
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { ConstantPool, R3DeclareFactoryMetadata, R3FactoryMetadata, R3PartialDeclaration } from '@angular/compiler';
import * as o from '@angular/compiler/src/output/output_ast';
import { AstObject } from '../../ast/ast_value';
import { PartialLinker } from './partial_linker';
/**
* A `PartialLinker` that is designed to process `ɵɵngDeclareFactory()` call expressions.
*/
export declare class PartialFactoryLinkerVersion1<TExpression> implements PartialLinker<TExpression> {
linkPartialDeclaration(constantPool: ConstantPool, metaObj: AstObject<R3PartialDeclaration, TExpression>): o.Expression;
}
/**
* Derives the `R3FactoryMetadata` structure from the AST object.
*/
export declare function toR3FactoryMeta<TExpression>(metaObj: AstObject<R3DeclareFactoryMetadata, TExpression>): R3FactoryMetadata;

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,22 @@
/// <amd-module name="@angular/compiler-cli/linker/src/file_linker/partial_linkers/partial_injectable_linker_1" />
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { ConstantPool, R3DeclareInjectableMetadata, R3InjectableMetadata, R3PartialDeclaration } from '@angular/compiler';
import * as o from '@angular/compiler/src/output/output_ast';
import { AstObject } from '../../ast/ast_value';
import { PartialLinker } from './partial_linker';
/**
* A `PartialLinker` that is designed to process `ɵɵngDeclareInjectable()` call expressions.
*/
export declare class PartialInjectableLinkerVersion1<TExpression> implements PartialLinker<TExpression> {
linkPartialDeclaration(constantPool: ConstantPool, metaObj: AstObject<R3PartialDeclaration, TExpression>): o.Expression;
}
/**
* Derives the `R3InjectableMetadata` structure from the AST object.
*/
export declare function toR3InjectableMeta<TExpression>(metaObj: AstObject<R3DeclareInjectableMetadata, TExpression>): R3InjectableMetadata;

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,22 @@
/// <amd-module name="@angular/compiler-cli/linker/src/file_linker/partial_linkers/partial_injector_linker_1" />
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { ConstantPool, R3DeclareInjectorMetadata, R3InjectorMetadata, R3PartialDeclaration } from '@angular/compiler';
import * as o from '@angular/compiler/src/output/output_ast';
import { AstObject } from '../../ast/ast_value';
import { PartialLinker } from './partial_linker';
/**
* A `PartialLinker` that is designed to process `ɵɵngDeclareInjector()` call expressions.
*/
export declare class PartialInjectorLinkerVersion1<TExpression> implements PartialLinker<TExpression> {
linkPartialDeclaration(constantPool: ConstantPool, metaObj: AstObject<R3PartialDeclaration, TExpression>): o.Expression;
}
/**
* Derives the `R3InjectorMetadata` structure from the AST object.
*/
export declare function toR3InjectorMeta<TExpression>(metaObj: AstObject<R3DeclareInjectorMetadata, TExpression>): R3InjectorMetadata;

View file

@ -0,0 +1,56 @@
(function (factory) {
if (typeof module === "object" && typeof module.exports === "object") {
var v = factory(require, exports);
if (v !== undefined) module.exports = v;
}
else if (typeof define === "function" && define.amd) {
define("@angular/compiler-cli/linker/src/file_linker/partial_linkers/partial_injector_linker_1", ["require", "exports", "@angular/compiler", "@angular/compiler-cli/linker/src/fatal_linker_error", "@angular/compiler-cli/linker/src/file_linker/partial_linkers/util"], factory);
}
})(function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.toR3InjectorMeta = exports.PartialInjectorLinkerVersion1 = void 0;
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
var compiler_1 = require("@angular/compiler");
var fatal_linker_error_1 = require("@angular/compiler-cli/linker/src/fatal_linker_error");
var util_1 = require("@angular/compiler-cli/linker/src/file_linker/partial_linkers/util");
/**
* A `PartialLinker` that is designed to process `ɵɵngDeclareInjector()` call expressions.
*/
var PartialInjectorLinkerVersion1 = /** @class */ (function () {
function PartialInjectorLinkerVersion1() {
}
PartialInjectorLinkerVersion1.prototype.linkPartialDeclaration = function (constantPool, metaObj) {
var meta = toR3InjectorMeta(metaObj);
var def = compiler_1.compileInjector(meta);
return def.expression;
};
return PartialInjectorLinkerVersion1;
}());
exports.PartialInjectorLinkerVersion1 = PartialInjectorLinkerVersion1;
/**
* Derives the `R3InjectorMetadata` structure from the AST object.
*/
function toR3InjectorMeta(metaObj) {
var typeExpr = metaObj.getValue('type');
var typeName = typeExpr.getSymbolName();
if (typeName === null) {
throw new fatal_linker_error_1.FatalLinkerError(typeExpr.expression, 'Unsupported type, its name could not be determined');
}
return {
name: typeName,
type: util_1.wrapReference(typeExpr.getOpaque()),
internalType: metaObj.getOpaque('type'),
providers: metaObj.has('providers') ? metaObj.getOpaque('providers') : null,
imports: metaObj.has('imports') ? metaObj.getArray('imports').map(function (i) { return i.getOpaque(); }) : [],
};
}
exports.toR3InjectorMeta = toR3InjectorMeta;
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGFydGlhbF9pbmplY3Rvcl9saW5rZXJfMS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL2NvbXBpbGVyLWNsaS9saW5rZXIvc3JjL2ZpbGVfbGlua2VyL3BhcnRpYWxfbGlua2Vycy9wYXJ0aWFsX2luamVjdG9yX2xpbmtlcl8xLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7OztJQUFBOzs7Ozs7T0FNRztJQUNILDhDQUFxSTtJQUlySSwwRkFBMEQ7SUFHMUQsMEZBQXFDO0lBRXJDOztPQUVHO0lBQ0g7UUFBQTtRQVFBLENBQUM7UUFQQyw4REFBc0IsR0FBdEIsVUFDSSxZQUEwQixFQUMxQixPQUFxRDtZQUN2RCxJQUFNLElBQUksR0FBRyxnQkFBZ0IsQ0FBQyxPQUFPLENBQUMsQ0FBQztZQUN2QyxJQUFNLEdBQUcsR0FBRywwQkFBZSxDQUFDLElBQUksQ0FBQyxDQUFDO1lBQ2xDLE9BQU8sR0FBRyxDQUFDLFVBQVUsQ0FBQztRQUN4QixDQUFDO1FBQ0gsb0NBQUM7SUFBRCxDQUFDLEFBUkQsSUFRQztJQVJZLHNFQUE2QjtJQV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6IG1ldGFPYmouaGFzKCdwcm92aWRlcnMnKSA/IG1ldGFPYmouZ2V0T3BhcXVlKCdwcm92aWRlcnMnKSA6IG51bGwsXG4gICAgaW1wb3J0czogbWV0YU9iai5oYXMoJ2ltcG9ydHMnKSA/IG1ldGFPYmouZ2V0QXJyYXkoJ2ltcG9ydHMnKS5tYXAoaSA9PiBpLmdldE9wYXF1ZSgpKSA6IFtdLFxuICB9O1xufVxuIl19

View file

@ -0,0 +1,23 @@
/// <amd-module name="@angular/compiler-cli/linker/src/file_linker/partial_linkers/partial_linker" />
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { ConstantPool, R3PartialDeclaration } from '@angular/compiler';
import * as o from '@angular/compiler/src/output/output_ast';
import { AstObject } from '../../ast/ast_value';
/**
* An interface for classes that can link partial declarations into full definitions.
*/
export interface PartialLinker<TExpression> {
/**
* Link the partial declaration `metaObj` information to generate a full definition expression.
*
* @param metaObj An object that fits one of the `R3DeclareDirectiveMetadata` or
* `R3DeclareComponentMetadata` interfaces.
*/
linkPartialDeclaration(constantPool: ConstantPool, metaObj: AstObject<R3PartialDeclaration, TExpression>): o.Expression;
}

View file

@ -0,0 +1,13 @@
(function (factory) {
if (typeof module === "object" && typeof module.exports === "object") {
var v = factory(require, exports);
if (v !== undefined) module.exports = v;
}
else if (typeof define === "function" && define.amd) {
define("@angular/compiler-cli/linker/src/file_linker/partial_linkers/partial_linker", ["require", "exports"], factory);
}
})(function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGFydGlhbF9saW5rZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9jb21waWxlci1jbGkvbGlua2VyL3NyYy9maWxlX2xpbmtlci9w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NZXRhZGF0YWAgb3JcbiAgICogICAgIGBSM0RlY2xhcmVDb21wb25lbnRNZXRhZGF0YWAgaW50ZXJmYWNlcy5cbiAgICovXG4gIGxpbmtQYXJ0aWFsRGVjbGFyYXRpb24oXG4gICAgICBjb25zdGFudFBvb2w6IENvbnN0YW50UG9vbCxcbiAgICAgIG1ldGFPYmo6IEFzdE9iamVjdDxSM1BhcnRpYWxEZWNsYXJhdGlvbiwgVEV4cHJlc3Npb24+KTogby5FeHByZXNzaW9uO1xufVxuIl19

View file

@ -0,0 +1,81 @@
/// <amd-module name="@angular/compiler-cli/linker/src/file_linker/partial_linkers/partial_linker_selector" />
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { Range } from 'semver';
import { AbsoluteFsPath } from '../../../../src/ngtsc/file_system';
import { Logger } from '../../../../src/ngtsc/logging';
import { LinkerEnvironment } from '../linker_environment';
import { PartialLinker } from './partial_linker';
export declare const ɵɵngDeclareDirective = "\u0275\u0275ngDeclareDirective";
export declare const ɵɵngDeclareClassMetadata = "\u0275\u0275ngDeclareClassMetadata";
export declare const ɵɵngDeclareComponent = "\u0275\u0275ngDeclareComponent";
export declare const ɵɵngDeclareFactory = "\u0275\u0275ngDeclareFactory";
export declare const ɵɵngDeclareInjectable = "\u0275\u0275ngDeclareInjectable";
export declare const ɵɵngDeclareInjector = "\u0275\u0275ngDeclareInjector";
export declare const ɵɵngDeclareNgModule = "\u0275\u0275ngDeclareNgModule";
export declare const ɵɵngDeclarePipe = "\u0275\u0275ngDeclarePipe";
export declare const declarationFunctions: string[];
export interface LinkerRange<TExpression> {
range: Range;
linker: PartialLinker<TExpression>;
}
/**
* Create a mapping between partial-declaration call name and collections of partial-linkers.
*
* Each collection of partial-linkers will contain a version range that will be matched against the
* `minVersion` of the partial-declaration. (Additionally, a partial-linker may modify its behaviour
* internally based on the `version` property of the declaration.)
*
* Versions should be sorted in ascending order. The most recent partial-linker will be used as the
* fallback linker if none of the other version ranges match. For example:
*
* ```
* {range: getRange('<=', '13.0.0'), linker PartialDirectiveLinkerVersion2(...) },
* {range: getRange('<=', '13.1.0'), linker PartialDirectiveLinkerVersion3(...) },
* {range: getRange('<=', '14.0.0'), linker PartialDirectiveLinkerVersion4(...) },
* {range: LATEST_VERSION_RANGE, linker: new PartialDirectiveLinkerVersion1(...)},
* ```
*
* If the `LATEST_VERSION_RANGE` is `<=15.0.0` then the fallback linker would be
* `PartialDirectiveLinkerVersion1` for any version greater than `15.0.0`.
*
* When there is a change to a declaration interface that requires a new partial-linker, the
* `minVersion` of the partial-declaration should be updated, the new linker implementation should
* be added to the end of the collection, and the version of the previous linker should be updated.
*/
export declare function createLinkerMap<TStatement, TExpression>(environment: LinkerEnvironment<TStatement, TExpression>, sourceUrl: AbsoluteFsPath, code: string): Map<string, LinkerRange<TExpression>[]>;
/**
* A helper that selects the appropriate `PartialLinker` for a given declaration.
*
* The selection is made from a database of linker instances, chosen if their given semver range
* satisfies the `minVersion` of the partial declaration to be linked.
*
* Note that the ranges are checked in order, and the first matching range will be selected. So
* ranges should be most restrictive first. In practice, since ranges are always `<=X.Y.Z` this
* means that ranges should be in ascending order.
*
* Note that any "pre-release" versions are stripped from ranges. Therefore if a `minVersion` is
* `11.1.0-next.1` then this would match `11.1.0-next.2` and also `12.0.0-next.1`. (This is
* different to standard semver range checking, where pre-release versions do not cross full version
* boundaries.)
*/
export declare class PartialLinkerSelector<TExpression> {
private readonly linkers;
private readonly logger;
private readonly unknownDeclarationVersionHandling;
constructor(linkers: Map<string, LinkerRange<TExpression>[]>, logger: Logger, unknownDeclarationVersionHandling: 'ignore' | 'warn' | 'error');
/**
* Returns true if there are `PartialLinker` classes that can handle functions with this name.
*/
supportsDeclaration(functionName: string): boolean;
/**
* Returns the `PartialLinker` that can handle functions with the given name and version.
* Throws an error if there is none.
*/
getLinker(functionName: string, minVersion: string, version: string): PartialLinker<TExpression>;
}

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,33 @@
/// <amd-module name="@angular/compiler-cli/linker/src/file_linker/partial_linkers/partial_ng_module_linker_1" />
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { ConstantPool, R3DeclareNgModuleMetadata, R3NgModuleMetadata, R3PartialDeclaration } from '@angular/compiler';
import * as o from '@angular/compiler/src/output/output_ast';
import { AstObject } from '../../ast/ast_value';
import { PartialLinker } from './partial_linker';
/**
* A `PartialLinker` that is designed to process `ɵɵngDeclareNgModule()` call expressions.
*/
export declare class PartialNgModuleLinkerVersion1<TExpression> implements PartialLinker<TExpression> {
/**
* If true then emit the additional declarations, imports, exports, etc in the NgModule
* definition. These are only used by JIT compilation.
*/
private emitInline;
constructor(
/**
* If true then emit the additional declarations, imports, exports, etc in the NgModule
* definition. These are only used by JIT compilation.
*/
emitInline: boolean);
linkPartialDeclaration(constantPool: ConstantPool, metaObj: AstObject<R3PartialDeclaration, TExpression>): o.Expression;
}
/**
* Derives the `R3NgModuleMetadata` structure from the AST object.
*/
export declare function toR3NgModuleMeta<TExpression>(metaObj: AstObject<R3DeclareNgModuleMetadata, TExpression>, emitInline: boolean): R3NgModuleMetadata;

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,23 @@
/// <amd-module name="@angular/compiler-cli/linker/src/file_linker/partial_linkers/partial_pipe_linker_1" />
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { ConstantPool, R3DeclarePipeMetadata, R3PartialDeclaration, R3PipeMetadata } from '@angular/compiler';
import * as o from '@angular/compiler/src/output/output_ast';
import { AstObject } from '../../ast/ast_value';
import { PartialLinker } from './partial_linker';
/**
* A `PartialLinker` that is designed to process `ɵɵngDeclarePipe()` call expressions.
*/
export declare class PartialPipeLinkerVersion1<TExpression> implements PartialLinker<TExpression> {
constructor();
linkPartialDeclaration(constantPool: ConstantPool, metaObj: AstObject<R3PartialDeclaration, TExpression>): o.Expression;
}
/**
* Derives the `R3PipeMetadata` structure from the AST object.
*/
export declare function toR3PipeMeta<TExpression>(metaObj: AstObject<R3DeclarePipeMetadata, TExpression>): R3PipeMetadata;

View file

@ -0,0 +1,59 @@
(function (factory) {
if (typeof module === "object" && typeof module.exports === "object") {
var v = factory(require, exports);
if (v !== undefined) module.exports = v;
}
else if (typeof define === "function" && define.amd) {
define("@angular/compiler-cli/linker/src/file_linker/partial_linkers/partial_pipe_linker_1", ["require", "exports", "@angular/compiler", "@angular/compiler-cli/linker/src/fatal_linker_error", "@angular/compiler-cli/linker/src/file_linker/partial_linkers/util"], factory);
}
})(function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.toR3PipeMeta = exports.PartialPipeLinkerVersion1 = void 0;
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
var compiler_1 = require("@angular/compiler");
var fatal_linker_error_1 = require("@angular/compiler-cli/linker/src/fatal_linker_error");
var util_1 = require("@angular/compiler-cli/linker/src/file_linker/partial_linkers/util");
/**
* A `PartialLinker` that is designed to process `ɵɵngDeclarePipe()` call expressions.
*/
var PartialPipeLinkerVersion1 = /** @class */ (function () {
function PartialPipeLinkerVersion1() {
}
PartialPipeLinkerVersion1.prototype.linkPartialDeclaration = function (constantPool, metaObj) {
var meta = toR3PipeMeta(metaObj);
var def = compiler_1.compilePipeFromMetadata(meta);
return def.expression;
};
return PartialPipeLinkerVersion1;
}());
exports.PartialPipeLinkerVersion1 = PartialPipeLinkerVersion1;
/**
* Derives the `R3PipeMetadata` structure from the AST object.
*/
function toR3PipeMeta(metaObj) {
var typeExpr = metaObj.getValue('type');
var typeName = typeExpr.getSymbolName();
if (typeName === null) {
throw new fatal_linker_error_1.FatalLinkerError(typeExpr.expression, 'Unsupported type, its name could not be determined');
}
var pure = metaObj.has('pure') ? metaObj.getBoolean('pure') : true;
return {
name: typeName,
type: util_1.wrapReference(typeExpr.getOpaque()),
internalType: metaObj.getOpaque('type'),
typeArgumentCount: 0,
deps: null,
pipeName: metaObj.getString('name'),
pure: pure,
};
}
exports.toR3PipeMeta = toR3PipeMeta;
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGFydGlhbF9waXBlX2xpbmtlcl8xLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvY29tcGlsZXItY2xpL2xpbmtlci9zcmMvZmlsZV9saW5rZXIvcGFydGlhbF9saW5rZXJzL3BhcnRpYWxfcGlwZV9saW5rZXJfMS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7SUFBQTs7Ozs7O09BTUc7SUFDSCw4Q0FBcUk7SUFJckksMEZBQTBEO0lBRzFELDBGQUFxQztJQUVyQzs7T0FFRztJQUNIO1FBQ0U7UUFBZSxDQUFDO1FBRWhCLDBEQUFzQixHQUF0QixVQUNJLFlBQTBCLEVBQzFCLE9BQXFEO1lBQ3ZELElBQU0sSUFBSSxHQUFHLFlBQVksQ0FBQyxPQUFPLENBQUMsQ0FBQztZQUNuQyxJQUFNLEdBQUcsR0FBRyxrQ0FBdUIsQ0FBQyxJQUFJLENBQUMsQ0FBQztZQUMxQyxPQUFPLEdBQUcsQ0FBQyxVQUFVLENBQUM7UUFDeEIsQ0FBQztRQUNILGdDQUFDO0lBQUQsQ0FBQyxBQVZELElBVUM7SUFWWSw4REFBeUI7SUFZdEM7O09BRUc7SUFDSCxTQUFnQixZQUFZLENBQWMsT0FBc0Q7UUFFOUYsSUFBTSxRQUFRLEdBQUcsT0FBTyxDQUFDLFFBQVEsQ0FBQyxNQUFNLENBQUMsQ0FBQztRQUMxQyxJQUFNLFFBQVEsR0FBRyxRQUFRLENBQUMsYUFB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cli/linker/src/file_linker/partial_linkers/util" />
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { R3DeclareDependencyMetadata, R3DependencyMetadata, R3ProviderExpression, R3Reference } from '@angular/compiler';
import * as o from '@angular/compiler/src/output/output_ast';
import { AstObject, AstValue } from '../../ast/ast_value';
export declare function wrapReference<TExpression>(wrapped: o.WrappedNodeExpr<TExpression>): R3Reference;
/**
* Parses the value of an enum from the AST value's symbol name.
*/
export declare function parseEnum<TExpression, TEnum>(value: AstValue<unknown, TExpression>, Enum: TEnum): TEnum[keyof TEnum];
/**
* Parse a dependency structure from an AST object.
*/
export declare function getDependency<TExpression>(depObj: AstObject<R3DeclareDependencyMetadata, TExpression>): R3DependencyMetadata;
/**
* Return an `R3ProviderExpression` that represents either the extracted type reference expression
* from a `forwardRef` function call, or the type itself.
*
* For example, the expression `forwardRef(function() { return FooDir; })` returns `FooDir`. Note
* that this expression is required to be wrapped in a closure, as otherwise the forward reference
* would be resolved before initialization.
*
* If there is no forwardRef call expression then we just return the opaque type.
*/
export declare function extractForwardRef<TExpression>(expr: AstValue<unknown, TExpression>): R3ProviderExpression<o.WrappedNodeExpr<TExpression>>;

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,26 @@
/// <amd-module name="@angular/compiler-cli/linker/src/file_linker/translator" />
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import * as o from '@angular/compiler';
import { AstFactory, ImportGenerator, TranslatorOptions } from '@angular/compiler-cli/src/ngtsc/translator';
/**
* Generic translator helper class, which exposes methods for translating expressions and
* statements.
*/
export declare class Translator<TStatement, TExpression> {
private factory;
constructor(factory: AstFactory<TStatement, TExpression>);
/**
* Translate the given output AST in the context of an expression.
*/
translateExpression(expression: o.Expression, imports: ImportGenerator<TExpression>, options?: TranslatorOptions<TExpression>): TExpression;
/**
* Translate the given output AST in the context of a statement.
*/
translateStatement(statement: o.Statement, imports: ImportGenerator<TExpression>, options?: TranslatorOptions<TExpression>): TStatement;
}

View file

@ -0,0 +1,40 @@
(function (factory) {
if (typeof module === "object" && typeof module.exports === "object") {
var v = factory(require, exports);
if (v !== undefined) module.exports = v;
}
else if (typeof define === "function" && define.amd) {
define("@angular/compiler-cli/linker/src/file_linker/translator", ["require", "exports", "@angular/compiler-cli/src/ngtsc/translator"], factory);
}
})(function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Translator = void 0;
var translator_1 = require("@angular/compiler-cli/src/ngtsc/translator");
/**
* Generic translator helper class, which exposes methods for translating expressions and
* statements.
*/
var Translator = /** @class */ (function () {
function Translator(factory) {
this.factory = factory;
}
/**
* Translate the given output AST in the context of an expression.
*/
Translator.prototype.translateExpression = function (expression, imports, options) {
if (options === void 0) { options = {}; }
return expression.visitExpression(new translator_1.ExpressionTranslatorVisitor(this.factory, imports, options), new translator_1.Context(false));
};
/**
* Translate the given output AST in the context of a statement.
*/
Translator.prototype.translateStatement = function (statement, imports, options) {
if (options === void 0) { options = {}; }
return statement.visitStatement(new translator_1.ExpressionTranslatorVisitor(this.factory, imports, options), new translator_1.Context(true));
};
return Translator;
}());
exports.Translator = Translator;
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJhbnNsYXRvci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL2NvbXBpbGVyLWNsaS9saW5rZXIvc3JjL2ZpbGVfbGlua2VyL3RyYW5zbGF0b3IudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7O0lBUUEseUVBQWdKO0lBRWhKOzs7T0FHRztJQUNIO1FBQ0Usb0JBQW9CLE9BQTRDO1lBQTVDLFlBQU8sR0FBUCxPQUFPLENBQXFD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W5zbGF0ZSB0aGUgZ2l2ZW4gb3V0cHV0IEFTVCBpbiB0aGUgY29udGV4dCBvZiBhIHN0YXRlbWVudC5cbiAgICovXG4gIHRyYW5zbGF0ZVN0YXRlbWVudChcbiAgICAgIHN0YXRlbWVudDogby5TdGF0ZW1lbnQsIGltcG9ydHM6IEltcG9ydEdlbmVyYXRvcjxURXhwcmVzc2lvbj4sXG4gICAgICBvcHRpb25zOiBUcmFuc2xhdG9yT3B0aW9uczxURXhwcmVzc2lvbj4gPSB7fSk6IFRTdGF0ZW1lbnQge1xuICAgIHJldHVybiBzdGF0ZW1lbnQudmlzaXRTdGF0ZW1lbnQoXG4gICAgICAgIG5ldyBFeHByZXNzaW9uVHJhbnNsYXRvclZpc2l0b3I8VFN0YXRlbWVudCwgVEV4cHJlc3Npb24+KHRoaXMuZmFjdG9yeSwgaW1wb3J0cywgb3B0aW9ucyksXG4gICAgICAgIG5ldyBDb250ZXh0KHRydWUpKTtcbiAgfVxufVxuIl19

View file

@ -0,0 +1,24 @@
/// <amd-module name="@angular/compiler-cli/linker/src/linker_import_generator" />
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { ImportGenerator, NamedImport } from '../../src/ngtsc/translator';
/**
* A class that is used to generate imports when translating from Angular Output AST to an AST to
* render, such as Babel.
*
* Note that, in the linker, there can only be imports from `@angular/core` and that these imports
* must be achieved by property access on an `ng` namespace identifer, which is passed in via the
* constructor.
*/
export declare class LinkerImportGenerator<TExpression> implements ImportGenerator<TExpression> {
private ngImport;
constructor(ngImport: TExpression);
generateNamespaceImport(moduleName: string): TExpression;
generateNamedImport(moduleName: string, originalSymbol: string): NamedImport<TExpression>;
private assertModuleName;
}

View file

@ -0,0 +1,43 @@
(function (factory) {
if (typeof module === "object" && typeof module.exports === "object") {
var v = factory(require, exports);
if (v !== undefined) module.exports = v;
}
else if (typeof define === "function" && define.amd) {
define("@angular/compiler-cli/linker/src/linker_import_generator", ["require", "exports", "@angular/compiler-cli/linker/src/fatal_linker_error"], factory);
}
})(function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.LinkerImportGenerator = void 0;
var fatal_linker_error_1 = require("@angular/compiler-cli/linker/src/fatal_linker_error");
/**
* A class that is used to generate imports when translating from Angular Output AST to an AST to
* render, such as Babel.
*
* Note that, in the linker, there can only be imports from `@angular/core` and that these imports
* must be achieved by property access on an `ng` namespace identifer, which is passed in via the
* constructor.
*/
var LinkerImportGenerator = /** @class */ (function () {
function LinkerImportGenerator(ngImport) {
this.ngImport = ngImport;
}
LinkerImportGenerator.prototype.generateNamespaceImport = function (moduleName) {
this.assertModuleName(moduleName);
return this.ngImport;
};
LinkerImportGenerator.prototype.generateNamedImport = function (moduleName, originalSymbol) {
this.assertModuleName(moduleName);
return { moduleImport: this.ngImport, symbol: originalSymbol };
};
LinkerImportGenerator.prototype.assertModuleName = function (moduleName) {
if (moduleName !== '@angular/core') {
throw new fatal_linker_error_1.FatalLinkerError(this.ngImport, "Unable to import from anything other than '@angular/core'");
}
};
return LinkerImportGenerator;
}());
exports.LinkerImportGenerator = LinkerImportGenerator;
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGlua2VyX2ltcG9ydF9nZW5lcmF0b3IuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9jb21waWxlci1jbGkvbGlua2VyL3NyYy9saW5rZXJfaW1wb3J0X2dlbmVyYXRvci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7SUFRQSwwRkFBc0Q7SUFFdEQ7Ozs7Ozs7T0FPRztJQUNIO1FBQ0UsK0JBQW9CLFFBQXFCO1lBQXJCLGFBQVEsR0FBUixRQUFRLENBQWE7UUFBRyxDQUFDO1FBRTdDLHVEQUF1QixHQUF2Qix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XR1cm4ge21vZHVsZUltcG9ydDogdGhpcy5uZ0ltcG9ydCwgc3ltYm9sOiBvcmlnaW5hbFN5bWJvbH07XG4gIH1cblxuICBwcml2YXRlIGFzc2VydE1vZHVsZU5hbWUobW9kdWxlTmFtZTogc3RyaW5nKTogdm9pZCB7XG4gICAgaWYgKG1vZHVsZU5hbWUgIT09ICdAYW5ndWxhci9jb3JlJykge1xuICAgICAgdGhyb3cgbmV3IEZhdGFsTGlua2VyRXJyb3IoXG4gICAgICAgICAgdGhpcy5uZ0ltcG9ydCwgYFVuYWJsZSB0byBpbXBvcnQgZnJvbSBhbnl0aGluZyBvdGhlciB0aGFuICdAYW5ndWxhci9jb3JlJ2ApO1xuICAgIH1cbiAgfVxufVxuIl19

6
node_modules/@angular/compiler-cli/ngcc/index.d.ts generated vendored Executable file
View file

@ -0,0 +1,6 @@
/// <amd-module name="@angular/compiler-cli/ngcc" />
import { AsyncNgccOptions, SyncNgccOptions } from './src/ngcc_options';
export { ConsoleLogger, Logger, LogLevel } from '../src/ngtsc/logging';
export { AsyncNgccOptions, clearTsConfigCache, NgccOptions, SyncNgccOptions } from './src/ngcc_options';
export { PathMappings } from './src/path_mappings';
export declare function process<T extends AsyncNgccOptions | SyncNgccOptions>(options: T): T extends AsyncNgccOptions ? Promise<void> : void;

33
node_modules/@angular/compiler-cli/ngcc/index.js generated vendored Executable file
View file

@ -0,0 +1,33 @@
(function (factory) {
if (typeof module === "object" && typeof module.exports === "object") {
var v = factory(require, exports);
if (v !== undefined) module.exports = v;
}
else if (typeof define === "function" && define.amd) {
define("@angular/compiler-cli/ngcc", ["require", "exports", "@angular/compiler-cli/src/ngtsc/file_system", "@angular/compiler-cli/ngcc/src/main", "@angular/compiler-cli/src/ngtsc/logging", "@angular/compiler-cli/ngcc/src/ngcc_options"], factory);
}
})(function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.process = exports.clearTsConfigCache = exports.LogLevel = exports.ConsoleLogger = void 0;
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
var file_system_1 = require("@angular/compiler-cli/src/ngtsc/file_system");
var main_1 = require("@angular/compiler-cli/ngcc/src/main");
var logging_1 = require("@angular/compiler-cli/src/ngtsc/logging");
Object.defineProperty(exports, "ConsoleLogger", { enumerable: true, get: function () { return logging_1.ConsoleLogger; } });
Object.defineProperty(exports, "LogLevel", { enumerable: true, get: function () { return logging_1.LogLevel; } });
var ngcc_options_1 = require("@angular/compiler-cli/ngcc/src/ngcc_options");
Object.defineProperty(exports, "clearTsConfigCache", { enumerable: true, get: function () { return ngcc_options_1.clearTsConfigCache; } });
function process(options) {
file_system_1.setFileSystem(new file_system_1.NodeJSFileSystem());
return main_1.mainNgcc(options);
}
exports.process = process;
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9jb21waWxlci1jbGkvbmdjYy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7SUFBQTs7Ozs7O09BTUc7SUFDSCwyRUFBeUU7SUFFekUsNERBQW9DO0lBR3BDLG1FQUFxRTtJQUE3RCx3R0FBQSxhQUFhLE9BQUE7SUFBVSxtR0FBQSxRQUFRLE9BQUE7SUFDdkMsNEVBQXNHO0lBQTVFLGtIQUFBLGtCQUFrQixPQUFBO0lBSzVDLFNBQWdCLE9BQU8sQ0FBQyxPQUF5QztRQUMvRCwyQkFBYSxDQUFDLElBQUksOEJBQWdCLEVBQUUsQ0FBQyxDQUFDO1FBQ3RDLE9BQU8sZUFBUSxDQUFDLE9BQU8sQ0FBQyxDQUFDO0lBQzNCLENBQUM7SUFIRCwwQkFHQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogQGxpY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djY09wdGlvbnN8U3luY05nY2NPcHRpb25zKTogdm9pZHxQcm9taXNlPHZvaWQ+IHtcbiAgc2V0RmlsZVN5c3RlbShuZXcgTm9kZUpTRmlsZVN5c3RlbSgpKTtcbiAgcmV0dXJuIG1haW5OZ2NjKG9wdGlvbnMpO1xufVxuIl19

9
node_modules/@angular/compiler-cli/ngcc/main-ivy-ngcc.d.ts generated vendored Executable file
View file

@ -0,0 +1,9 @@
#!/usr/bin/env node
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/// <amd-module name="@angular/compiler-cli/ngcc/main-ivy-ngcc" />

12
node_modules/@angular/compiler-cli/ngcc/main-ivy-ngcc.js generated vendored Executable file
View file

@ -0,0 +1,12 @@
#!/usr/bin/env node
"use strict";
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
console.error(new Error('The \'ivy-ngcc\' command was renamed to just \'ngcc\'. Please update your usage.'));
process.exit(1);
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWFpbi1pdnktbmdjYy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL2NvbXBpbGVyLWNsaS9uZ2NjL21haW4taXZ5LW5nY2MudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFDQTs7Ozs7O0dBTUc7QUFFSCxPQUFPLENBQUMsS0FBSyxDQUNULElBQUksS0FBSyxDQUFDLGtGQUFrRixDQUFDLENBQUMsQ0FBQztBQUNuRyxPQUFPLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiIyEvdXNyL2Jpbi9lbnYgbm9kZVxuLyoqXG4gKiBAbGljZW5zZVxuICogQ29weXJpZ2h0IEdvb2dsZSBMTEMgQWxsIFJpZ2h0cyBSZXNlcnZlZC5cbiAqXG4gKiBVc2Ugb2YgdGhpcyBzb3VyY2UgY29kZSBpcyBnb3Zlcm5lZCBieSBhbiBNSVQtc3R5bGUgbGljZW5zZSB0aGF0IGNhbiBiZVxuICogZm91bmQgaW4gdGhlIExJQ0VOU0UgZmlsZSBhdCBodHRwczovL2FuZ3VsYXIuaW8vbGljZW5zZVxuICovXG5cbmNvbnNvbGUuZXJyb3IoXG4gICAgbmV3IEVycm9yKCdUaGUgXFwnaXZ5LW5nY2NcXCcgY29tbWFuZCB3YXMgcmVuYW1lZCB0byBqdXN0IFxcJ25nY2NcXCcuIFBsZWFzZSB1cGRhdGUgeW91ciB1c2FnZS4nKSk7XG5wcm9jZXNzLmV4aXQoMSk7XG4iXX0=

3
node_modules/@angular/compiler-cli/ngcc/main-ngcc.d.ts generated vendored Executable file
View file

@ -0,0 +1,3 @@
#!/usr/bin/env node
/// <amd-module name="@angular/compiler-cli/ngcc/main-ngcc" />
export {};

54
node_modules/@angular/compiler-cli/ngcc/main-ngcc.js generated vendored Executable file
View file

@ -0,0 +1,54 @@
#!/usr/bin/env node
(function (factory) {
if (typeof module === "object" && typeof module.exports === "object") {
var v = factory(require, exports);
if (v !== undefined) module.exports = v;
}
else if (typeof define === "function" && define.amd) {
define("@angular/compiler-cli/ngcc/main-ngcc", ["require", "exports", "tslib", "@angular/compiler-cli/ngcc/src/main", "@angular/compiler-cli/ngcc/src/command_line_options"], factory);
}
})(function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
var main_1 = require("@angular/compiler-cli/ngcc/src/main");
var command_line_options_1 = require("@angular/compiler-cli/ngcc/src/command_line_options");
// CLI entry point
if (require.main === module) {
process.title = 'ngcc';
var startTime_1 = Date.now();
var options_1 = command_line_options_1.parseCommandLineOptions(process.argv.slice(2));
(function () { return tslib_1.__awaiter(void 0, void 0, void 0, function () {
var duration, e_1;
return tslib_1.__generator(this, function (_a) {
switch (_a.label) {
case 0:
_a.trys.push([0, 2, , 3]);
return [4 /*yield*/, main_1.mainNgcc(options_1)];
case 1:
_a.sent();
if (options_1.logger) {
duration = Math.round((Date.now() - startTime_1) / 1000);
options_1.logger.debug("Run ngcc in " + duration + "s.");
}
process.exitCode = 0;
return [3 /*break*/, 3];
case 2:
e_1 = _a.sent();
console.error(e_1.stack || e_1.message);
process.exit(typeof e_1.code === 'number' ? e_1.code : 1);
return [3 /*break*/, 3];
case 3: return [2 /*return*/];
}
});
}); })();
}
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWFpbi1uZ2NjLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvY29tcGlsZXItY2xpL25nY2MvbWFpbi1uZ2NjLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7SUFDQTs7Ozs7O09BTUc7SUFDSCw0REFBb0M7SUFDcEMsNEZBQW1FO0lBRW5FLGtCQUFrQjtJQUNsQixJQUFJLE9BQU8sQ0FBQyxJQUFJLEtBQUssTUFBTSxFQUFFO1FBQzNCLE9BQU8sQ0FBQyxLQUFLLEdBQUcsTUFBTSxDQUFDO1FBQ3ZCLElBQU0sV0FBUyxHQUFHLElBQUksQ0FBQyxHQUFHLEVBQUUsQ0FBQztRQUM3QixJQUFNLFNBQU8sR0FBRyw4Q0FBdUIsQ0FBQyxPQUFPLENBQUMsSUFBSSxDQUFDLEtBQUssQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO1FBQy9ELENBQUM7Ozs7Ozt3QkFFRyxxQkFBTSxlQUFRLENBQUMsU0FBTyxDQUFDLEVBQUE7O3dCQUF2QixTQUF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vc3JjL2NvbW1hbmRfbGluZV9vcHRpb25zJztcblxuLy8gQ0xJIGVudHJ5IHBvaW50XG5pZiAocmVxdWlyZS5tYWluID09PSBtb2R1bGUpIHtcbiAgcHJvY2Vzcy50aXRsZSA9ICduZ2NjJztcbiAgY29uc3Qgc3RhcnRUaW1lID0gRGF0ZS5ub3coKTtcbiAgY29uc3Qgb3B0aW9ucyA9IHBhcnNlQ29tbWFuZExpbmVPcHRpb25zKHByb2Nlc3MuYXJndi5zbGljZSgyKSk7XG4gIChhc3luYyAoKSA9PiB7XG4gICAgdHJ5IHtcbiAgICAgIGF3YWl0IG1haW5OZ2NjKG9wdGlvbnMpO1xuICAgICAgaWYgKG9wdGlvbnMubG9nZ2VyKSB7XG4gICAgICAgIGNvbnN0IGR1cmF0aW9uID0gTWF0aC5yb3VuZCgoRGF0ZS5ub3coKSAtIHN0YXJ0VGltZSkgLyAxMDAwKTtcbiAgICAgICAgb3B0aW9ucy5sb2dnZXIuZGVidWcoYFJ1biBuZ2NjIGluICR7ZHVyYXRpb259cy5gKTtcbiAgICAgIH1cbiAgICAgIHByb2Nlc3MuZXhpdENvZGUgPSAwO1xuICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgIGNvbnNvbGUuZXJyb3IoZS5zdGFjayB8fCBlLm1lc3NhZ2UpO1xuICAgICAgcHJvY2Vzcy5leGl0KHR5cGVvZiBlLmNvZGUgPT09ICdudW1iZXInID8gZS5jb2RlIDogMSk7XG4gICAgfVxuICB9KSgpO1xufVxuIl19

View file

@ -0,0 +1,79 @@
/// <amd-module name="@angular/compiler-cli/ngcc/src/analysis/decoration_analyzer" />
import * as ts from 'typescript';
import { ParsedConfiguration } from '../../..';
import { ReferencesRegistry, ResourceLoader } from '../../../src/ngtsc/annotations';
import { CycleAnalyzer, ImportGraph } from '../../../src/ngtsc/cycles';
import { ReadonlyFileSystem } from '../../../src/ngtsc/file_system';
import { ModuleResolver, PrivateExportAliasingHost, ReferenceEmitter } from '../../../src/ngtsc/imports';
import { SemanticSymbol } from '../../../src/ngtsc/incremental/semantic_graph';
import { CompoundMetadataReader, CompoundMetadataRegistry, DtsMetadataReader, InjectableClassRegistry, LocalMetadataRegistry } from '../../../src/ngtsc/metadata';
import { PartialEvaluator } from '../../../src/ngtsc/partial_evaluator';
import { LocalModuleScopeRegistry, MetadataDtsModuleScopeResolver, TypeCheckScopeRegistry } from '../../../src/ngtsc/scope';
import { DecoratorHandler } from '../../../src/ngtsc/transform';
import { NgccReflectionHost } from '../host/ngcc_host';
import { Migration } from '../migrations/migration';
import { EntryPointBundle } from '../packages/entry_point_bundle';
import { NgccTraitCompiler } from './ngcc_trait_compiler';
import { CompiledFile, DecorationAnalyses } from './types';
/**
* Simple class that resolves and loads files directly from the filesystem.
*/
declare class NgccResourceLoader implements ResourceLoader {
private fs;
constructor(fs: ReadonlyFileSystem);
canPreload: boolean;
canPreprocess: boolean;
preload(): undefined | Promise<void>;
preprocessInline(): Promise<string>;
load(url: string): string;
resolve(url: string, containingFile: string): string;
}
/**
* This Analyzer will analyze the files that have decorated classes that need to be transformed.
*/
export declare class DecorationAnalyzer {
private fs;
private bundle;
private reflectionHost;
private referencesRegistry;
private diagnosticHandler;
private tsConfig;
private program;
private options;
private host;
private typeChecker;
private rootDirs;
private packagePath;
private isCore;
private compilerOptions;
moduleResolver: ModuleResolver;
resourceManager: NgccResourceLoader;
metaRegistry: LocalMetadataRegistry;
dtsMetaReader: DtsMetadataReader;
fullMetaReader: CompoundMetadataReader;
refEmitter: ReferenceEmitter;
aliasingHost: PrivateExportAliasingHost | null;
dtsModuleScopeResolver: MetadataDtsModuleScopeResolver;
scopeRegistry: LocalModuleScopeRegistry;
fullRegistry: CompoundMetadataRegistry;
evaluator: PartialEvaluator;
importGraph: ImportGraph;
cycleAnalyzer: CycleAnalyzer;
injectableRegistry: InjectableClassRegistry;
typeCheckScopeRegistry: TypeCheckScopeRegistry;
handlers: DecoratorHandler<unknown, unknown, SemanticSymbol | null, unknown>[];
compiler: NgccTraitCompiler;
migrations: Migration[];
constructor(fs: ReadonlyFileSystem, bundle: EntryPointBundle, reflectionHost: NgccReflectionHost, referencesRegistry: ReferencesRegistry, diagnosticHandler?: (error: ts.Diagnostic) => void, tsConfig?: ParsedConfiguration | null);
/**
* Analyze a program to find all the decorated files should be transformed.
*
* @returns a map of the source files to the analysis for those files.
*/
analyzeProgram(): DecorationAnalyses;
protected applyMigrations(): void;
protected reportDiagnostics(): void;
protected compileFile(sourceFile: ts.SourceFile): CompiledFile;
private getReexportsForSourceFile;
}
export {};

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,23 @@
/// <amd-module name="@angular/compiler-cli/ngcc/src/analysis/migration_host" />
import { AbsoluteFsPath } from '../../../src/ngtsc/file_system';
import { MetadataReader } from '../../../src/ngtsc/metadata';
import { PartialEvaluator } from '../../../src/ngtsc/partial_evaluator';
import { ClassDeclaration, Decorator } from '../../../src/ngtsc/reflection';
import { HandlerFlags } from '../../../src/ngtsc/transform';
import { NgccReflectionHost } from '../host/ngcc_host';
import { MigrationHost } from '../migrations/migration';
import { NgccTraitCompiler } from './ngcc_trait_compiler';
/**
* The standard implementation of `MigrationHost`, which is created by the `DecorationAnalyzer`.
*/
export declare class DefaultMigrationHost implements MigrationHost {
readonly reflectionHost: NgccReflectionHost;
readonly metadata: MetadataReader;
readonly evaluator: PartialEvaluator;
private compiler;
private entryPointPath;
constructor(reflectionHost: NgccReflectionHost, metadata: MetadataReader, evaluator: PartialEvaluator, compiler: NgccTraitCompiler, entryPointPath: AbsoluteFsPath);
injectSyntheticDecorator(clazz: ClassDeclaration, decorator: Decorator, flags?: HandlerFlags): void;
getAllDecorators(clazz: ClassDeclaration): Decorator[] | null;
isInScope(clazz: ClassDeclaration): boolean;
}

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,62 @@
/// <amd-module name="@angular/compiler-cli/ngcc/src/analysis/module_with_providers_analyzer" />
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import * as ts from 'typescript';
import { ReferencesRegistry } from '../../../src/ngtsc/annotations';
import { Reference } from '../../../src/ngtsc/imports';
import { ClassDeclaration, DeclarationNode } from '../../../src/ngtsc/reflection';
import { NgccReflectionHost } from '../host/ngcc_host';
/**
* A structure returned from `getModuleWithProvidersFunctions()` that describes functions
* that return ModuleWithProviders objects.
*/
export interface ModuleWithProvidersInfo {
/**
* The name of the declared function.
*/
name: string;
/**
* The declaration of the function that returns the `ModuleWithProviders` object.
*/
declaration: ts.SignatureDeclaration;
/**
* Declaration of the containing class (if this is a method)
*/
container: DeclarationNode | null;
/**
* The declaration of the class that the `ngModule` property on the `ModuleWithProviders` object
* refers to.
*/
ngModule: Reference<ClassDeclaration>;
}
export declare type ModuleWithProvidersAnalyses = Map<ts.SourceFile, ModuleWithProvidersInfo[]>;
export declare const ModuleWithProvidersAnalyses: MapConstructor;
export declare class ModuleWithProvidersAnalyzer {
private host;
private typeChecker;
private referencesRegistry;
private processDts;
private evaluator;
constructor(host: NgccReflectionHost, typeChecker: ts.TypeChecker, referencesRegistry: ReferencesRegistry, processDts: boolean);
analyzeProgram(program: ts.Program): ModuleWithProvidersAnalyses;
private getRootFiles;
private getModuleWithProvidersFunctions;
/**
* Parse a function/method node (or its implementation), to see if it returns a
* `ModuleWithProviders` object.
* @param name The name of the function.
* @param node the node to check - this could be a function, a method or a variable declaration.
* @param implementation the actual function expression if `node` is a variable declaration.
* @param container the class that contains the function, if it is a method.
* @returns info about the function if it does return a `ModuleWithProviders` object; `null`
* otherwise.
*/
private parseForModuleWithProviders;
private getDtsModuleWithProvidersFunction;
private resolveNgModuleReference;
}

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,35 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/// <amd-module name="@angular/compiler-cli/ngcc/src/analysis/ngcc_references_registry" />
import * as ts from 'typescript';
import { ReferencesRegistry } from '../../../src/ngtsc/annotations';
import { Reference } from '../../../src/ngtsc/imports';
import { Declaration, DeclarationNode, ReflectionHost } from '../../../src/ngtsc/reflection';
/**
* This is a place for DecoratorHandlers to register references that they
* find in their analysis of the code.
*
* This registry is used to ensure that these references are publicly exported
* from libraries that are compiled by ngcc.
*/
export declare class NgccReferencesRegistry implements ReferencesRegistry {
private host;
private map;
constructor(host: ReflectionHost);
/**
* Register one or more references in the registry.
* Only `ResolveReference` references are stored. Other types are ignored.
* @param references A collection of references to register.
*/
add(source: DeclarationNode, ...references: Reference<DeclarationNode>[]): void;
/**
* Create and return a mapping for the registered resolved references.
* @returns A map of reference identifiers to reference declarations.
*/
getDeclarationMap(): Map<ts.Identifier, Declaration>;
}

View file

@ -0,0 +1,65 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
(function (factory) {
if (typeof module === "object" && typeof module.exports === "object") {
var v = factory(require, exports);
if (v !== undefined) module.exports = v;
}
else if (typeof define === "function" && define.amd) {
define("@angular/compiler-cli/ngcc/src/analysis/ngcc_references_registry", ["require", "exports", "@angular/compiler-cli/ngcc/src/utils"], factory);
}
})(function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.NgccReferencesRegistry = void 0;
var utils_1 = require("@angular/compiler-cli/ngcc/src/utils");
/**
* This is a place for DecoratorHandlers to register references that they
* find in their analysis of the code.
*
* This registry is used to ensure that these references are publicly exported
* from libraries that are compiled by ngcc.
*/
var NgccReferencesRegistry = /** @class */ (function () {
function NgccReferencesRegistry(host) {
this.host = host;
this.map = new Map();
}
/**
* Register one or more references in the registry.
* Only `ResolveReference` references are stored. Other types are ignored.
* @param references A collection of references to register.
*/
NgccReferencesRegistry.prototype.add = function (source) {
var _this = this;
var references = [];
for (var _i = 1; _i < arguments.length; _i++) {
references[_i - 1] = arguments[_i];
}
references.forEach(function (ref) {
// Only store relative references. We are not interested in literals.
if (ref.bestGuessOwningModule === null && utils_1.hasNameIdentifier(ref.node)) {
var declaration = _this.host.getDeclarationOfIdentifier(ref.node.name);
if (declaration && utils_1.hasNameIdentifier(declaration.node)) {
_this.map.set(declaration.node.name, declaration);
}
}
});
};
/**
* Create and return a mapping for the registered resolved references.
* @returns A map of reference identifiers to reference declarations.
*/
NgccReferencesRegistry.prototype.getDeclarationMap = function () {
return this.map;
};
return NgccReferencesRegistry;
}());
exports.NgccReferencesRegistry = NgccReferencesRegistry;
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmdjY19yZWZlcmVuY2VzX3JlZ2lzdHJ5LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvY29tcGlsZXItY2xpL25nY2Mvc3JjL2FuYWx5c2lzL25nY2NfcmVmZXJlbmNlc19yZWdpc3RyeS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7O0dBTUc7Ozs7Ozs7Ozs7Ozs7SUFNSCw4REFBMkM7SUFFM0M7Ozs7OztPQU1HO0lBQ0g7UUFHRSxnQ0FBb0IsSUFBb0I7WUFBcEIsU0FBSSxHQUFKLElBQUksQ0FBZ0I7WUFGaEMsUUFBRyxHQUFHLElBQUksR0FBRyxFQUE4QixDQUFDO1FBRVQsQ0FBQztRQUU1Qzs7OztXQUlHO1FBQ0gsb0NBQUcsR0FBSCxVQUFJLE1BQXVCO1lBQTNCLGlCQVVDO1lBVjRCLG9CQUEyQztpQkFBM0MsVUFBMkMsRUFBM0MscUJBQTJDLEVBQTNDLElBQTJDO2dCQUEzQyxtQ0FBMkM7O1lBQ3RFLFVBQVUsQ0FBQyxPQUFPLENBQUMsVUFBQSxHQUFHO2dCQUNwQixxRUFBcUU7Z0JBQ3JFLElBQUksR0FBRyxDQUFDLHFCQUFxQixLQUFLLElBQUks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/compiler-cli/ngcc/src/analysis/ngcc_trait_compiler" />
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import * as ts from 'typescript';
import { SemanticSymbol } from '../../../src/ngtsc/incremental/semantic_graph';
import { ClassDeclaration, Decorator } from '../../../src/ngtsc/reflection';
import { DecoratorHandler, HandlerFlags, Trait, TraitCompiler } from '../../../src/ngtsc/transform';
import { NgccReflectionHost } from '../host/ngcc_host';
/**
* Specializes the `TraitCompiler` for ngcc purposes. Mainly, this includes an alternative way of
* scanning for classes to compile using the reflection host's `findClassSymbols`, together with
* support to inject synthetic decorators into the compilation for ad-hoc migrations that ngcc
* performs.
*/
export declare class NgccTraitCompiler extends TraitCompiler {
private ngccReflector;
constructor(handlers: DecoratorHandler<unknown, unknown, SemanticSymbol | null, unknown>[], ngccReflector: NgccReflectionHost);
get analyzedFiles(): ts.SourceFile[];
/**
* Analyzes the source file in search for classes to process. For any class that is found in the
* file, a `ClassRecord` is created and the source file is included in the `analyzedFiles` array.
*/
analyzeFile(sf: ts.SourceFile): void;
/**
* Associate a new synthesized decorator, which did not appear in the original source, with a
* given class.
* @param clazz the class to receive the new decorator.
* @param decorator the decorator to inject.
* @param flags optional bitwise flag to influence the compilation of the decorator.
*/
injectSyntheticDecorator(clazz: ClassDeclaration, decorator: Decorator, flags?: HandlerFlags): Trait<unknown, unknown, SemanticSymbol | null, unknown>[];
/**
* Returns all decorators that have been recognized for the provided class, including any
* synthetically injected decorators.
* @param clazz the declaration for which the decorators are returned.
*/
getAllDecorators(clazz: ClassDeclaration): Decorator[] | null;
}

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,30 @@
/// <amd-module name="@angular/compiler-cli/ngcc/src/analysis/private_declarations_analyzer" />
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import * as ts from 'typescript';
import { AbsoluteFsPath } from '../../../src/ngtsc/file_system';
import { NgccReflectionHost } from '../host/ngcc_host';
import { NgccReferencesRegistry } from './ngcc_references_registry';
export interface ExportInfo {
identifier: string;
from: AbsoluteFsPath;
dtsFrom?: AbsoluteFsPath | null;
}
export declare type PrivateDeclarationsAnalyses = ExportInfo[];
/**
* This class will analyze a program to find all the declared classes
* (i.e. on an NgModule) that are not publicly exported via an entry-point.
*/
export declare class PrivateDeclarationsAnalyzer {
private host;
private referencesRegistry;
constructor(host: NgccReflectionHost, referencesRegistry: NgccReferencesRegistry);
analyzeProgram(program: ts.Program): PrivateDeclarationsAnalyses;
private getRootFiles;
private getPrivateDeclarations;
}

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,35 @@
/// <amd-module name="@angular/compiler-cli/ngcc/src/analysis/switch_marker_analyzer" />
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import * as ts from 'typescript';
import { AbsoluteFsPath } from '../../../src/ngtsc/file_system';
import { NgccReflectionHost, SwitchableVariableDeclaration } from '../host/ngcc_host';
export interface SwitchMarkerAnalysis {
sourceFile: ts.SourceFile;
declarations: SwitchableVariableDeclaration[];
}
export declare type SwitchMarkerAnalyses = Map<ts.SourceFile, SwitchMarkerAnalysis>;
export declare const SwitchMarkerAnalyses: MapConstructor;
/**
* This Analyzer will analyse the files that have an R3 switch marker in them
* that will be replaced.
*/
export declare class SwitchMarkerAnalyzer {
private host;
private packagePath;
constructor(host: NgccReflectionHost, packagePath: AbsoluteFsPath);
/**
* Analyze the files in the program to identify declarations that contain R3
* switch markers.
* @param program The program to analyze.
* @return A map of source files to analysis objects. The map will contain only the
* source files that had switch markers, and the analysis will contain an array of
* the declarations in that source file that contain the marker.
*/
analyzeProgram(program: ts.Program): SwitchMarkerAnalyses;
}

View file

@ -0,0 +1,50 @@
(function (factory) {
if (typeof module === "object" && typeof module.exports === "object") {
var v = factory(require, exports);
if (v !== undefined) module.exports = v;
}
else if (typeof define === "function" && define.amd) {
define("@angular/compiler-cli/ngcc/src/analysis/switch_marker_analyzer", ["require", "exports", "@angular/compiler-cli/src/ngtsc/file_system", "@angular/compiler-cli/ngcc/src/analysis/util"], factory);
}
})(function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SwitchMarkerAnalyzer = exports.SwitchMarkerAnalyses = void 0;
var file_system_1 = require("@angular/compiler-cli/src/ngtsc/file_system");
var util_1 = require("@angular/compiler-cli/ngcc/src/analysis/util");
exports.SwitchMarkerAnalyses = Map;
/**
* This Analyzer will analyse the files that have an R3 switch marker in them
* that will be replaced.
*/
var SwitchMarkerAnalyzer = /** @class */ (function () {
function SwitchMarkerAnalyzer(host, packagePath) {
this.host = host;
this.packagePath = packagePath;
}
/**
* Analyze the files in the program to identify declarations that contain R3
* switch markers.
* @param program The program to analyze.
* @return A map of source files to analysis objects. The map will contain only the
* source files that had switch markers, and the analysis will contain an array of
* the declarations in that source file that contain the marker.
*/
SwitchMarkerAnalyzer.prototype.analyzeProgram = function (program) {
var _this = this;
var analyzedFiles = new exports.SwitchMarkerAnalyses();
program.getSourceFiles()
.filter(function (sourceFile) { return util_1.isWithinPackage(_this.packagePath, file_system_1.absoluteFromSourceFile(sourceFile)); })
.forEach(function (sourceFile) {
var declarations = _this.host.getSwitchableDeclarations(sourceFile);
if (declarations.length) {
analyzedFiles.set(sourceFile, { sourceFile: sourceFile, declarations: declarations });
}
});
return analyzedFiles;
};
return SwitchMarkerAnalyzer;
}());
exports.SwitchMarkerAnalyzer = SwitchMarkerAnalyzer;
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3dpdGNoX21hcmtlcl9hbmFseXplci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL2NvbXBpbGVyLWNsaS9uZ2NjL3NyYy9hbmFseXNpc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lcbiAgICAgICAgLmZvckVhY2goc291cmNlRmlsZSA9PiB7XG4gICAgICAgICAgY29uc3QgZGVjbGFyYXRpb25zID0gdGhpcy5ob3N0LmdldFN3aXRjaGFibGVEZWNsYXJhdGlvbnMoc291cmNlRmlsZSk7XG4gICAgICAgICAgaWYgKGRlY2xhcmF0aW9ucy5sZW5ndGgpIHtcbiAgICAgICAgICAgIGFuYWx5emVkRmlsZXMuc2V0KHNvdXJjZUZpbGUsIHtzb3VyY2VGaWxlLCBkZWNsYXJhdGlvbnN9KTtcbiAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgIHJldHVybiBhbmFseXplZEZpbGVzO1xuICB9XG59XG4iXX0=

View file

@ -0,0 +1,30 @@
/// <amd-module name="@angular/compiler-cli/ngcc/src/analysis/types" />
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { ConstantPool } from '@angular/compiler';
import * as ts from 'typescript';
import { Reexport } from '../../../src/ngtsc/imports';
import { ClassDeclaration, Decorator } from '../../../src/ngtsc/reflection';
import { CompileResult } from '../../../src/ngtsc/transform';
export interface CompiledClass {
name: string;
decorators: Decorator[] | null;
declaration: ClassDeclaration;
compilation: CompileResult[];
}
export interface CompiledFile {
compiledClasses: CompiledClass[];
sourceFile: ts.SourceFile;
constantPool: ConstantPool;
/**
* Any re-exports which should be added next to this class, both in .js and (if possible) .d.ts.
*/
reexports: Reexport[];
}
export declare type DecorationAnalyses = Map<ts.SourceFile, CompiledFile>;
export declare const DecorationAnalyses: MapConstructor;

View file

@ -0,0 +1,15 @@
(function (factory) {
if (typeof module === "object" && typeof module.exports === "object") {
var v = factory(require, exports);
if (v !== undefined) module.exports = v;
}
else if (typeof define === "function" && define.amd) {
define("@angular/compiler-cli/ngcc/src/analysis/types", ["require", "exports"], factory);
}
})(function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DecorationAnalyses = void 0;
exports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ZWNvcmF0b3JbXXxudWxsO1xuICBkZWNsYXJhdGlvbjogQ2xhc3NEZWNsYXJhdGlvbjtcbiAgY29tcGlsYXRpb246IENvbXBpbGVSZXN1bHRbXTtcbn1cblxuZXhwb3J0IGludGVyZmFjZSBDb21waWxlZEZpbGUge1xuICBjb21waWxlZENsYXNzZXM6IENvbXBpbGVkQ2xhc3NbXTtcbiAgc291cmNlRmlsZTogdHMuU291cmNlRmlsZTtcbiAgY29uc3RhbnRQb29sOiBDb25zdGFudFBvb2w7XG5cbiAgLyoqXG4gICAqIEFueSByZS1leHBvcnRzIHdoaWNoIHNob3VsZCBiZSBhZGRlZCBuZXh0IHRvIHRoaXMgY2xhc3MsIGJvdGggaW4gLmpzIGFuZCAoaWYgcG9zc2libGUpIC5kLnRzLlxuICAgKi9cbiAgcmVleHBvcnRzOiBSZWV4cG9ydFtdO1xufVxuXG5leHBvcnQgdHlwZSBEZWNvcmF0aW9uQW5hbHlzZXMgPSBNYXA8dHMuU291cmNlRmlsZSwgQ29tcGlsZWRGaWxlPjtcbmV4cG9ydCBjb25zdCBEZWNvcmF0aW9uQW5hbHlzZXMgPSBNYXA7XG4iXX0=

View file

@ -0,0 +1,12 @@
/// <amd-module name="@angular/compiler-cli/ngcc/src/analysis/util" />
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { AbsoluteFsPath } from '../../../src/ngtsc/file_system';
import { DependencyTracker } from '../../../src/ngtsc/incremental/api';
export declare function isWithinPackage(packagePath: AbsoluteFsPath, filePath: AbsoluteFsPath): boolean;
export declare const NOOP_DEPENDENCY_TRACKER: DependencyTracker;

36
node_modules/@angular/compiler-cli/ngcc/src/analysis/util.js generated vendored Executable file
View file

@ -0,0 +1,36 @@
(function (factory) {
if (typeof module === "object" && typeof module.exports === "object") {
var v = factory(require, exports);
if (v !== undefined) module.exports = v;
}
else if (typeof define === "function" && define.amd) {
define("@angular/compiler-cli/ngcc/src/analysis/util", ["require", "exports", "@angular/compiler-cli/src/ngtsc/file_system"], factory);
}
})(function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.NOOP_DEPENDENCY_TRACKER = exports.isWithinPackage = void 0;
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
var file_system_1 = require("@angular/compiler-cli/src/ngtsc/file_system");
function isWithinPackage(packagePath, filePath) {
var relativePath = file_system_1.relative(packagePath, filePath);
return file_system_1.isLocalRelativePath(relativePath) && !relativePath.startsWith('node_modules/');
}
exports.isWithinPackage = isWithinPackage;
var NoopDependencyTracker = /** @class */ (function () {
function NoopDependencyTracker() {
}
NoopDependencyTracker.prototype.addDependency = function () { };
NoopDependencyTracker.prototype.addResourceDependency = function () { };
NoopDependencyTracker.prototype.recordDependencyAnalysisFailure = function () { };
return NoopDependencyTracker;
}());
exports.NOOP_DEPENDENCY_TRACKER = new NoopDependencyTracker();
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL2NvbXBpbGVyLWNsaS9uZ2NjL3NyYy9hbmFseXNpcy91dGlsLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7OztJQUFBOzs7Ozs7T0FNRztJQUNILDJFQUE2RjtJQUc3RixTQUFnQixlQUFlLENBQUMsV0FBMkIsRUFBRSxRQUF3QjtRQUNuRixJQUFNLFlBQVksR0FBRyxzQkFBUSxDQUFDLFdBQVcsRUFBRSxRQUFRLENBQUMsQ0FBQztRQUNyRCxPQUFPLGlDQUFtQixDQUFDLFlBQVksQ0FBQyxJQUFJLENBQUMsWUFBWSxDQUFDLFVBQVUsQ0FBQyxlQUFlLENBQUMs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HJlbGF0aXZlUGF0aCkgJiYgIXJlbGF0aXZlUGF0aC5zdGFydHNXaXRoKCdub2RlX21vZHVsZXMvJyk7XG59XG5cbmNsYXNzIE5vb3BEZXBlbmRlbmN5VHJhY2tlciBpbXBsZW1lbnRzIERlcGVuZGVuY3lUcmFja2VyIHtcbiAgYWRkRGVwZW5kZW5jeSgpOiB2b2lkIHt9XG4gIGFkZFJlc291cmNlRGVwZW5kZW5jeSgpOiB2b2lkIHt9XG4gIHJlY29yZERlcGVuZGVuY3lBbmFseXNpc0ZhaWx1cmUoKTogdm9pZCB7fVxufVxuXG5leHBvcnQgY29uc3QgTk9PUF9ERVBFTkRFTkNZX1RSQUNLRVI6IERlcGVuZGVuY3lUcmFja2VyID0gbmV3IE5vb3BEZXBlbmRlbmN5VHJhY2tlcigpO1xuIl19

View file

@ -0,0 +1,4 @@
#!/usr/bin/env node
/// <amd-module name="@angular/compiler-cli/ngcc/src/command_line_options" />
import { NgccOptions } from './ngcc_options';
export declare function parseCommandLineOptions(args: string[]): NgccOptions;

File diff suppressed because one or more lines are too long

10
node_modules/@angular/compiler-cli/ngcc/src/constants.d.ts generated vendored Executable file
View file

@ -0,0 +1,10 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/// <amd-module name="@angular/compiler-cli/ngcc/src/constants" />
export declare const IMPORT_PREFIX = "\u0275ngcc";
export declare const NGCC_TIMED_OUT_EXIT_CODE = 177;

23
node_modules/@angular/compiler-cli/ngcc/src/constants.js generated vendored Executable file
View file

@ -0,0 +1,23 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
(function (factory) {
if (typeof module === "object" && typeof module.exports === "object") {
var v = factory(require, exports);
if (v !== undefined) module.exports = v;
}
else if (typeof define === "function" && define.amd) {
define("@angular/compiler-cli/ngcc/src/constants", ["require", "exports"], factory);
}
})(function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.NGCC_TIMED_OUT_EXIT_CODE = exports.IMPORT_PREFIX = void 0;
exports.IMPORT_PREFIX = 'ɵngcc';
exports.NGCC_TIMED_OUT_EXIT_CODE = 177;
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uc3RhbnRzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvY29tcGlsZXItY2xpL25nY2Mvc3JjL2NvbnN0YW50cy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7O0dBTUc7Ozs7Ozs7Ozs7Ozs7SUFFVSxRQUFBLGFBQWEsR0FBRyxPQUFPLENBQUM7SUFDeEIsUUFBQSx3QkFBd0IsR0FBRyxHQUFHLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEBsaWNlbnNlXG4gKiBDb3B5cmlnaHQgR29vZ2xlIExMQyBBbGwgUmlnaHRzIFJlc2VydmVkLlxuICpcbiAqIFVzZSBvZiB0aGlzIHNvdXJjZSBjb2RlIGlzIGdvdmVybmVkIGJ5IGFuIE1JVC1zdHlsZSBsaWNlbnNlIHRoYXQgY2FuIGJlXG4gKiBmb3VuZCBpbiB0aGUgTElDRU5TRSBmaWxlIGF0IGh0dHBzOi8vYW5ndWxhci5pby9saWNlbnNlXG4gKi9cblxuZXhwb3J0IGNvbnN0IElNUE9SVF9QUkVGSVggPSAnybVuZ2NjJztcbmV4cG9ydCBjb25zdCBOR0NDX1RJTUVEX09VVF9FWElUX0NPREUgPSAxNzc7XG4iXX0=

View file

@ -0,0 +1,21 @@
/// <amd-module name="@angular/compiler-cli/ngcc/src/dependencies/commonjs_dependency_host" />
import { AbsoluteFsPath } from '../../../src/ngtsc/file_system';
import { DependencyHostBase } from './dependency_host';
/**
* Helper functions for computing dependencies.
*/
export declare class CommonJsDependencyHost extends DependencyHostBase {
protected canSkipFile(fileContents: string): boolean;
protected extractImports(file: AbsoluteFsPath, fileContents: string): Set<string>;
}
/**
* Check whether a source file needs to be parsed for imports.
* This is a performance short-circuit, which saves us from creating
* a TypeScript AST unnecessarily.
*
* @param source The content of the source file to check.
*
* @returns false if there are definitely no require calls
* in this file, true otherwise.
*/
export declare function hasRequireCalls(source: string): boolean;

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show more