fix(packages): use ES modules for primary build (#11120)

This commit is contained in:
Miško Hevery 2016-08-30 18:07:40 -07:00 committed by Victor Berchet
parent 8cb1046ce9
commit 979657989b
249 changed files with 1929 additions and 1463 deletions

View File

@ -51,6 +51,7 @@ TSCONFIG=./modules/tsconfig.json
echo "====== (all)COMPILING: \$(npm bin)/tsc -p ${TSCONFIG} =====" echo "====== (all)COMPILING: \$(npm bin)/tsc -p ${TSCONFIG} ====="
# compile ts code # compile ts code
TSC="node --max-old-space-size=3000 dist/tools/@angular/tsc-wrapped/src/main" TSC="node --max-old-space-size=3000 dist/tools/@angular/tsc-wrapped/src/main"
UGLIFYJS=`pwd`/node_modules/.bin/uglifyjs
$TSC -p modules/tsconfig.json $TSC -p modules/tsconfig.json
rm -rf ./dist/packages-dist rm -rf ./dist/packages-dist
@ -68,56 +69,61 @@ for PACKAGE in \
upgrade \ upgrade \
compiler-cli compiler-cli
do do
SRCDIR=./modules/@angular/${PACKAGE} PWD=`pwd`
DESTDIR=./dist/packages-dist/${PACKAGE} SRCDIR=${PWD}/modules/@angular/${PACKAGE}
UMD_ES6_PATH=${DESTDIR}/esm/${PACKAGE}.umd.js DESTDIR=${PWD}/dist/packages-dist/${PACKAGE}
UMD_ES5_PATH=${DESTDIR}/bundles/${PACKAGE}.umd.js UMD_ES5_PATH=${DESTDIR}/bundles/${PACKAGE}.umd.js
UMD_TESTING_ES5_PATH=${DESTDIR}/bundles/${PACKAGE}-testing.umd.js
UMD_ES5_MIN_PATH=${DESTDIR}/bundles/${PACKAGE}.umd.min.js UMD_ES5_MIN_PATH=${DESTDIR}/bundles/${PACKAGE}.umd.min.js
LICENSE_BANNER=${PWD}/modules/@angular/license-banner.txt
echo "====== COMPILING: ${TSC} -p ${SRCDIR}/tsconfig-es5.json =====" echo "====== COMPILING: ${TSC} -p ${SRCDIR}/tsconfig.json ====="
$TSC -p ${SRCDIR}/tsconfig-es5.json $TSC -p ${SRCDIR}/tsconfig.json
cp ${SRCDIR}/package.json ${DESTDIR}/ cp ${SRCDIR}/package.json ${DESTDIR}/
if [[ -e ${SRCDIR}/tsconfig-testing.json ]]; then
echo "====== COMPILING TESTING: ${TSC} -p ${SRCDIR}/tsconfig-testing.json"
$TSC -p ${SRCDIR}/tsconfig-testing.json
fi
echo "====== TSC 1.8 d.ts compat for ${DESTDIR} =====" echo "====== TSC 1.8 d.ts compat for ${DESTDIR} ====="
# safely strips 'readonly' specifier from d.ts files to make them compatible with tsc 1.8 # safely strips 'readonly' specifier from d.ts files to make them compatible with tsc 1.8
if [ "$(uname)" == "Darwin" ]; then if [ "$(uname)" == "Darwin" ]; then
find ${DESTDIR} -type f -name '*.d.ts' -print0 | xargs -0 sed -i '' -e 's/\(^ *(static |private )*\)*readonly */\1/g' find ${DESTDIR} -type f -name '*.d.ts' -print0 | xargs -0 sed -i '' -e 's/\(^ *(static |private )*\)*readonly */\1/g'
find ${DESTDIR} -type f -name '*.d.ts' -print0 | xargs -0 sed -i '' -e 's/\/\/\/ <reference types="node" \/>//g'
find ${DESTDIR} -type f -name '*.d.ts' -print0 | xargs -0 sed -i '' -E 's/^( +)abstract ([[:alnum:]]+\:)/\1\2/g' find ${DESTDIR} -type f -name '*.d.ts' -print0 | xargs -0 sed -i '' -E 's/^( +)abstract ([[:alnum:]]+\:)/\1\2/g'
else else
find ${DESTDIR} -type f -name '*.d.ts' -print0 | xargs -0 sed -i -e 's/\(^ *(static |private )*\)*readonly */\1/g' find ${DESTDIR} -type f -name '*.d.ts' -print0 | xargs -0 sed -i -e 's/\(^ *(static |private )*\)*readonly */\1/g'
find ${DESTDIR} -type f -name '*.d.ts' -print0 | xargs -0 sed -i -e 's/\/\/\/ <reference types="node" \/>//g'
find ${DESTDIR} -type f -name '*.d.ts' -print0 | xargs -0 sed -i -E 's/^( +)abstract ([[:alnum:]]+\:)/\1\2/g' find ${DESTDIR} -type f -name '*.d.ts' -print0 | xargs -0 sed -i -E 's/^( +)abstract ([[:alnum:]]+\:)/\1\2/g'
fi fi
if [[ ${PACKAGE} != compiler-cli ]]; then if [[ ${PACKAGE} != compiler-cli ]]; then
echo "====== (esm)COMPILING: $TSC -p ${SRCDIR}/tsconfig-es2015.json ====="
$TSC -p ${SRCDIR}/tsconfig-es2015.json
echo "====== BUNDLING: ${SRCDIR} =====" echo "====== BUNDLING: ${SRCDIR} ====="
mkdir ${DESTDIR}/bundles mkdir ${DESTDIR}/bundles
( (
cd ${SRCDIR} cd ${SRCDIR}
echo "..." # here just to have grep match something and not exit with 1 echo "====== Rollup ${PACKAGE} index"
../../../node_modules/.bin/rollup -c rollup.config.js ../../../node_modules/.bin/rollup -c rollup.config.js
) 2>&1 | grep -v "as external dependency" cat ${LICENSE_BANNER} > ${UMD_ES5_PATH}.tmp
$(npm bin)/tsc \
--out ${UMD_ES5_PATH} \
--target es5 \
--lib "es6,dom" \
--allowJs \
${UMD_ES6_PATH}
rm ${UMD_ES6_PATH}
cat ./modules/@angular/license-banner.txt > ${UMD_ES5_PATH}.tmp
cat ${UMD_ES5_PATH} >> ${UMD_ES5_PATH}.tmp cat ${UMD_ES5_PATH} >> ${UMD_ES5_PATH}.tmp
mv ${UMD_ES5_PATH}.tmp ${UMD_ES5_PATH} mv ${UMD_ES5_PATH}.tmp ${UMD_ES5_PATH}
$UGLIFYJS -c --screw-ie8 --comments -o ${UMD_ES5_MIN_PATH} ${UMD_ES5_PATH}
if [[ -e rollup-testing.config.js ]]; then
echo "====== Rollup ${PACKAGE} testing"
../../../node_modules/.bin/rollup -c rollup-testing.config.js
echo "{\"main\": \"../bundles/${PACKAGE}-testing.umd.js\"}" > ${DESTDIR}/testing/package.json
cat ${LICENSE_BANNER} > ${UMD_TESTING_ES5_PATH}.tmp
cat ${UMD_TESTING_ES5_PATH} >> ${UMD_TESTING_ES5_PATH}.tmp
mv ${UMD_TESTING_ES5_PATH}.tmp ${UMD_TESTING_ES5_PATH}
fi
) 2>&1 | grep -v "as external dependency"
$(npm bin)/uglifyjs -c --screw-ie8 -o ${UMD_ES5_MIN_PATH} ${UMD_ES5_PATH}
fi fi
done done

View File

@ -30,22 +30,22 @@ gulp.task('format', () => {
const entrypoints = [ const entrypoints = [
'dist/packages-dist/core/index.d.ts', 'dist/packages-dist/core/index.d.ts',
'dist/packages-dist/core/testing.d.ts', 'dist/packages-dist/core/testing/index.d.ts',
'dist/packages-dist/common/index.d.ts', 'dist/packages-dist/common/index.d.ts',
'dist/packages-dist/common/testing.d.ts', 'dist/packages-dist/common/testing/index.d.ts',
// The API surface of the compiler is currently unstable - all of the important APIs are exposed // The API surface of the compiler is currently unstable - all of the important APIs are exposed
// via @angular/core, @angular/platform-browser or @angular/platform-browser-dynamic instead. // via @angular/core, @angular/platform-browser or @angular/platform-browser-dynamic instead.
//'dist/packages-dist/compiler/index.d.ts', //'dist/packages-dist/compiler/index.d.ts',
//'dist/packages-dist/compiler/testing.d.ts', //'dist/packages-dist/compiler/testing.d.ts',
'dist/packages-dist/upgrade/index.d.ts', 'dist/packages-dist/upgrade/index.d.ts',
'dist/packages-dist/platform-browser/index.d.ts', 'dist/packages-dist/platform-browser/index.d.ts',
'dist/packages-dist/platform-browser/testing.d.ts', 'dist/packages-dist/platform-browser/testing/index.d.ts',
'dist/packages-dist/platform-browser-dynamic/index.d.ts', 'dist/packages-dist/platform-browser-dynamic/index.d.ts',
'dist/packages-dist/platform-browser-dynamic/testing.d.ts', 'dist/packages-dist/platform-browser-dynamic/testing/index.d.ts',
'dist/packages-dist/platform-server/index.d.ts', 'dist/packages-dist/platform-server/index.d.ts',
'dist/packages-dist/platform-server/testing.d.ts', 'dist/packages-dist/platform-server/testing/index.d.ts',
'dist/packages-dist/http/index.d.ts', 'dist/packages-dist/http/index.d.ts',
'dist/packages-dist/http/testing.d.ts', 'dist/packages-dist/http/testing/index.d.ts',
'dist/packages-dist/forms/index.d.ts', 'dist/packages-dist/forms/index.d.ts',
'dist/packages-dist/router/index.d.ts' 'dist/packages-dist/router/index.d.ts'
]; ];
@ -102,9 +102,10 @@ gulp.task('lint', ['format:enforce', 'tools:build'], () => {
.pipe(tslint({ .pipe(tslint({
tslint: require('tslint').default, tslint: require('tslint').default,
configuration: tslintConfig, configuration: tslintConfig,
rulesDirectory: 'dist/tools/tslint' rulesDirectory: 'dist/tools/tslint',
formatter: 'prose'
})) }))
.pipe(tslint.report('prose', {emitError: true})); .pipe(tslint.report({emitError: true}));
}); });
gulp.task('tools:build', (done) => { tsc('tools/', done); }); gulp.task('tools:build', (done) => { tsc('tools/', done); });

View File

@ -6,8 +6,11 @@
* found in the LICENSE file at https://angular.io/license * found in the LICENSE file at https://angular.io/license
*/ */
export * from './src/pipes'; /**
export * from './src/directives'; * @module
export * from './src/location'; * @description
export {NgLocalization} from './src/localization'; * Entry point for all public APIs of the common package.
export {CommonModule} from './src/common_module'; */
export * from './src/common';
// This file only reexports content of the `src` folder. Keep it that way.

View File

@ -2,8 +2,8 @@
"name": "@angular/common", "name": "@angular/common",
"version": "0.0.0-PLACEHOLDER", "version": "0.0.0-PLACEHOLDER",
"description": "", "description": "",
"main": "index.js", "main": "bundles/common.umd.js",
"jsnext:main": "esm/index.js", "module": "index.js",
"typings": "index.d.ts", "typings": "index.d.ts",
"author": "angular", "author": "angular",
"license": "MIT", "license": "MIT",

View File

@ -0,0 +1,15 @@
export default {
entry: '../../../dist/packages-dist/common/testing/index.js',
dest: '../../../dist/packages-dist/common/bundles/common-testing.umd.js',
format: 'umd',
moduleName: 'ng.common.testing',
globals: {
'@angular/core': 'ng.core',
'@angular/common': 'ng.common',
'rxjs/Subject': 'Rx',
'rxjs/observable/PromiseObservable': 'Rx', // this is wrong, but this stuff has changed in rxjs b.6 so we need to fix it when we update.
'rxjs/operator/toPromise': 'Rx.Observable.prototype',
'rxjs/Observable': 'Rx'
}
}

View File

@ -1,7 +1,7 @@
export default { export default {
entry: '../../../dist/packages-dist/common/esm/index.js', entry: '../../../dist/packages-dist/common/index.js',
dest: '../../../dist/packages-dist/common/esm/common.umd.js', dest: '../../../dist/packages-dist/common/bundles/common.umd.js',
format: 'umd', format: 'umd',
moduleName: 'ng.common', moduleName: 'ng.common',
globals: { globals: {
@ -10,8 +10,5 @@ export default {
'rxjs/observable/PromiseObservable': 'Rx', // this is wrong, but this stuff has changed in rxjs b.6 so we need to fix it when we update. 'rxjs/observable/PromiseObservable': 'Rx', // this is wrong, but this stuff has changed in rxjs b.6 so we need to fix it when we update.
'rxjs/operator/toPromise': 'Rx.Observable.prototype', 'rxjs/operator/toPromise': 'Rx.Observable.prototype',
'rxjs/Observable': 'Rx' 'rxjs/Observable': 'Rx'
}, }
plugins: [
// nodeResolve({ jsnext: true, main: true }),
]
} }

View File

@ -0,0 +1,13 @@
/**
* @license
* Copyright Google Inc. 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 * from './pipes';
export * from './directives';
export * from './location';
export {NgLocalization} from './localization';
export {CommonModule} from './common_module';

View File

@ -0,0 +1 @@
../../facade/src

View File

@ -0,0 +1,15 @@
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @module
* @description
* Entry point for all public APIs of the common/testing package.
*/
export {SpyLocation} from './location_mock';
export {MockLocationStrategy} from './mock_location_strategy';

View File

@ -6,11 +6,9 @@
* found in the LICENSE file at https://angular.io/license * found in the LICENSE file at https://angular.io/license
*/ */
import {Location, LocationStrategy} from '@angular/common';
import {EventEmitter, Injectable} from '@angular/core'; import {EventEmitter, Injectable} from '@angular/core';
import {Location} from '../index';
import {LocationStrategy} from '../src/location/location_strategy';
/** /**
* A spy for {@link Location} that allows tests to fire simulated location events. * A spy for {@link Location} that allows tests to fire simulated location events.

View File

@ -6,10 +6,8 @@
* found in the LICENSE file at https://angular.io/license * found in the LICENSE file at https://angular.io/license
*/ */
import {Injectable} from '@angular/core'; import {LocationStrategy} from '@angular/common';
import {EventEmitter, Injectable} from '@angular/core';
import {LocationStrategy} from '../index';
import {EventEmitter} from '../src/facade/async';

View File

@ -4,21 +4,22 @@
"declaration": true, "declaration": true,
"stripInternal": true, "stripInternal": true,
"experimentalDecorators": true, "experimentalDecorators": true,
"module": "commonjs", "module": "es2015",
"moduleResolution": "node", "moduleResolution": "node",
"outDir": "../../../dist/packages-dist/common/", "outDir": "../../../dist/packages-dist/common/",
"paths": { "paths": {
"@angular/core": ["../../../dist/packages-dist/core/"] "@angular/core": ["../../../dist/packages-dist/core/"],
"@angular/common": ["../../../dist/packages-dist/common"]
}, },
"rootDir": ".", "rootDir": ".",
"sourceMap": true, "sourceMap": true,
"inlineSources": true, "inlineSources": true,
"lib": ["es6", "dom"], "lib": ["es6", "dom"],
"target": "es5" "target": "es5",
"skipLibCheck": true
}, },
"files": [ "files": [
"index.ts", "testing/index.ts",
"testing.ts",
"../../../node_modules/zone.js/dist/zone.js.d.ts" "../../../node_modules/zone.js/dist/zone.js.d.ts"
], ],
"angularCompilerOptions": { "angularCompilerOptions": {

View File

@ -6,18 +6,19 @@
"experimentalDecorators": true, "experimentalDecorators": true,
"module": "es2015", "module": "es2015",
"moduleResolution": "node", "moduleResolution": "node",
"outDir": "../../../dist/packages-dist/common/esm", "outDir": "../../../dist/packages-dist/common",
"paths": { "paths": {
"@angular/core": ["../../../dist/packages-dist/core"] "@angular/core": ["../../../dist/packages-dist/core"]
}, },
"rootDir": ".", "rootDir": ".",
"sourceMap": true, "sourceMap": true,
"inlineSources": true, "inlineSources": true,
"target": "es2015" "target": "es5",
"skipLibCheck": true,
"lib": [ "es2015", "dom" ]
}, },
"files": [ "files": [
"index.ts", "index.ts",
"testing.ts",
"../../../node_modules/zone.js/dist/zone.js.d.ts" "../../../node_modules/zone.js/dist/zone.js.d.ts"
], ],
"angularCompilerOptions": { "angularCompilerOptions": {

View File

@ -0,0 +1,16 @@
/**
* @license
* Copyright Google Inc. 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 './init';
import './animate_spec';
import './basic_spec';
import './entry_components_spec';
import './i18n_spec';
import './ng_module_spec';
import './projection_spec';
import './query_spec';

View File

@ -0,0 +1,10 @@
module.exports = {
target: 'node',
entry: './test/all_spec.js',
output: {
filename: './all_spec.js'
},
resolve: {
extensions: ['.js']
},
};

View File

@ -16,9 +16,9 @@ import {AngularCompilerOptions, NgcCliOptions} from '@angular/tsc-wrapped';
import * as path from 'path'; import * as path from 'path';
import * as ts from 'typescript'; import * as ts from 'typescript';
import {CompileMetadataResolver, DirectiveNormalizer, DomElementSchemaRegistry, HtmlParser, Lexer, NgModuleCompiler, Parser, StyleCompiler, TemplateParser, TypeScriptEmitter, ViewCompiler} from './compiler_private';
import {Console} from './core_private';
import {PathMappedReflectorHost} from './path_mapped_reflector_host'; import {PathMappedReflectorHost} from './path_mapped_reflector_host';
import {CompileMetadataResolver, DirectiveNormalizer, DomElementSchemaRegistry, HtmlParser, Lexer, NgModuleCompiler, Parser, StyleCompiler, TemplateParser, TypeScriptEmitter, ViewCompiler} from './private_import_compiler';
import {Console} from './private_import_core';
import {ReflectorHost, ReflectorHostContext} from './reflector_host'; import {ReflectorHost, ReflectorHostContext} from './reflector_host';
import {StaticAndDynamicReflectionCapabilities} from './static_reflection_capabilities'; import {StaticAndDynamicReflectionCapabilities} from './static_reflection_capabilities';
import {StaticReflector, StaticSymbol} from './static_reflector'; import {StaticReflector, StaticSymbol} from './static_reflector';
@ -159,7 +159,7 @@ export class CodeGenerator {
const staticReflector = new StaticReflector(reflectorHost); const staticReflector = new StaticReflector(reflectorHost);
StaticAndDynamicReflectionCapabilities.install(staticReflector); StaticAndDynamicReflectionCapabilities.install(staticReflector);
const htmlParser = const htmlParser =
new compiler.i18n.HtmlParser(new HtmlParser(), transContent, cliOptions.i18nFormat); new compiler.I18NHtmlParser(new HtmlParser(), transContent, cliOptions.i18nFormat);
const config = new compiler.CompilerConfig({ const config = new compiler.CompilerConfig({
genDebugInfo: options.debug === true, genDebugInfo: options.debug === true,
defaultEncapsulation: ViewEncapsulation.Emulated, defaultEncapsulation: ViewEncapsulation.Emulated,

View File

@ -1,55 +0,0 @@
/**
* @license
* Copyright Google Inc. 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 {__compiler_private__ as _c} from '@angular/compiler';
export type AssetUrl = _c.AssetUrl;
export var AssetUrl: typeof _c.AssetUrl = _c.AssetUrl;
export type ImportGenerator = _c.ImportGenerator;
export var ImportGenerator: typeof _c.ImportGenerator = _c.ImportGenerator;
export type CompileMetadataResolver = _c.CompileMetadataResolver;
export var CompileMetadataResolver: typeof _c.CompileMetadataResolver = _c.CompileMetadataResolver;
export type HtmlParser = _c.HtmlParser;
export var HtmlParser: typeof _c.HtmlParser = _c.HtmlParser;
export type ParseError = _c.ParseError;
export var ParseError: typeof _c.ParseError = _c.ParseError;
export type InterpolationConfig = _c.InterpolationConfig;
export var InterpolationConfig: typeof _c.InterpolationConfig = _c.InterpolationConfig;
export type DirectiveNormalizer = _c.DirectiveNormalizer;
export var DirectiveNormalizer: typeof _c.DirectiveNormalizer = _c.DirectiveNormalizer;
export type Lexer = _c.Lexer;
export var Lexer: typeof _c.Lexer = _c.Lexer;
export type Parser = _c.Parser;
export var Parser: typeof _c.Parser = _c.Parser;
export type TemplateParser = _c.TemplateParser;
export var TemplateParser: typeof _c.TemplateParser = _c.TemplateParser;
export type DomElementSchemaRegistry = _c.DomElementSchemaRegistry;
export var DomElementSchemaRegistry: typeof _c.DomElementSchemaRegistry =
_c.DomElementSchemaRegistry;
export type StyleCompiler = _c.StyleCompiler;
export var StyleCompiler: typeof _c.StyleCompiler = _c.StyleCompiler;
export type ViewCompiler = _c.ViewCompiler;
export var ViewCompiler: typeof _c.ViewCompiler = _c.ViewCompiler;
export type NgModuleCompiler = _c.NgModuleCompiler;
export var NgModuleCompiler: typeof _c.NgModuleCompiler = _c.NgModuleCompiler;
export type TypeScriptEmitter = _c.TypeScriptEmitter;
export var TypeScriptEmitter: typeof _c.TypeScriptEmitter = _c.TypeScriptEmitter;

View File

@ -21,8 +21,8 @@ import {ComponentMetadata, NgModuleMetadata, ViewEncapsulation} from '@angular/c
import * as path from 'path'; import * as path from 'path';
import * as ts from 'typescript'; import * as ts from 'typescript';
import * as tsc from '@angular/tsc-wrapped'; import * as tsc from '@angular/tsc-wrapped';
import {CompileMetadataResolver, DirectiveNormalizer, DomElementSchemaRegistry, HtmlParser, Lexer, NgModuleCompiler, Parser, StyleCompiler, TemplateParser, TypeScriptEmitter, ViewCompiler, ParseError} from './compiler_private'; import {CompileMetadataResolver, DirectiveNormalizer, DomElementSchemaRegistry, HtmlParser, Lexer, NgModuleCompiler, Parser, StyleCompiler, TemplateParser, TypeScriptEmitter, ViewCompiler, ParseError} from './private_import_compiler';
import {Console} from './core_private'; import {Console} from './private_import_core';
import {ReflectorHost, ReflectorHostContext} from './reflector_host'; import {ReflectorHost, ReflectorHostContext} from './reflector_host';
import {StaticAndDynamicReflectionCapabilities} from './static_reflection_capabilities'; import {StaticAndDynamicReflectionCapabilities} from './static_reflection_capabilities';
import {StaticReflector, StaticSymbol} from './static_reflector'; import {StaticReflector, StaticSymbol} from './static_reflector';
@ -30,25 +30,25 @@ import {StaticReflector, StaticSymbol} from './static_reflector';
function extract( function extract(
ngOptions: tsc.AngularCompilerOptions, cliOptions: tsc.I18nExtractionCliOptions, ngOptions: tsc.AngularCompilerOptions, cliOptions: tsc.I18nExtractionCliOptions,
program: ts.Program, host: ts.CompilerHost) { program: ts.Program, host: ts.CompilerHost) {
const htmlParser = new compiler.i18n.HtmlParser(new HtmlParser()); const htmlParser = new compiler.I18NHtmlParser(new HtmlParser());
const extractor = Extractor.create(ngOptions, cliOptions.i18nFormat, program, host, htmlParser); const extractor = Extractor.create(ngOptions, cliOptions.i18nFormat, program, host, htmlParser);
const bundlePromise: Promise<compiler.i18n.MessageBundle> = extractor.extract(); const bundlePromise: Promise<compiler.MessageBundle> = extractor.extract();
return (bundlePromise).then(messageBundle => { return (bundlePromise).then(messageBundle => {
let ext: string; let ext: string;
let serializer: compiler.i18n.Serializer; let serializer: compiler.Serializer;
const format = (cliOptions.i18nFormat || 'xlf').toLowerCase(); const format = (cliOptions.i18nFormat || 'xlf').toLowerCase();
switch (format) { switch (format) {
case 'xmb': case 'xmb':
ext = 'xmb'; ext = 'xmb';
serializer = new compiler.i18n.Xmb(); serializer = new compiler.Xmb();
break; break;
case 'xliff': case 'xliff':
case 'xlf': case 'xlf':
default: default:
ext = 'xlf'; ext = 'xlf';
serializer = new compiler.i18n.Xliff(htmlParser, compiler.DEFAULT_INTERPOLATION_CONFIG); serializer = new compiler.Xliff(htmlParser, compiler.DEFAULT_INTERPOLATION_CONFIG);
break; break;
} }
@ -62,7 +62,7 @@ const GENERATED_FILES = /\.ngfactory\.ts$|\.css\.ts$|\.css\.shim\.ts$/;
export class Extractor { export class Extractor {
constructor( constructor(
private program: ts.Program, public host: ts.CompilerHost, private program: ts.Program, public host: ts.CompilerHost,
private staticReflector: StaticReflector, private messageBundle: compiler.i18n.MessageBundle, private staticReflector: StaticReflector, private messageBundle: compiler.MessageBundle,
private reflectorHost: ReflectorHost, private metadataResolver: CompileMetadataResolver, private reflectorHost: ReflectorHost, private metadataResolver: CompileMetadataResolver,
private directiveNormalizer: DirectiveNormalizer, private directiveNormalizer: DirectiveNormalizer,
private compiler: compiler.OfflineCompiler) {} private compiler: compiler.OfflineCompiler) {}
@ -97,7 +97,7 @@ export class Extractor {
return result; return result;
} }
extract(): Promise<compiler.i18n.MessageBundle> { extract(): Promise<compiler.MessageBundle> {
const filePaths = const filePaths =
this.program.getSourceFiles().map(sf => sf.fileName).filter(f => !GENERATED_FILES.test(f)); this.program.getSourceFiles().map(sf => sf.fileName).filter(f => !GENERATED_FILES.test(f));
const fileMetas = filePaths.map((filePath) => this.readFileMetadata(filePath)); const fileMetas = filePaths.map((filePath) => this.readFileMetadata(filePath));
@ -145,7 +145,7 @@ export class Extractor {
static create( static create(
options: tsc.AngularCompilerOptions, translationsFormat: string, program: ts.Program, options: tsc.AngularCompilerOptions, translationsFormat: string, program: ts.Program,
compilerHost: ts.CompilerHost, htmlParser: compiler.i18n.HtmlParser, compilerHost: ts.CompilerHost, htmlParser: compiler.I18NHtmlParser,
reflectorHostContext?: ReflectorHostContext): Extractor { reflectorHostContext?: ReflectorHostContext): Extractor {
const resourceLoader: compiler.ResourceLoader = { const resourceLoader: compiler.ResourceLoader = {
get: (s: string) => { get: (s: string) => {
@ -184,7 +184,7 @@ export class Extractor {
new NgModuleCompiler(), new TypeScriptEmitter(reflectorHost), null, null); new NgModuleCompiler(), new TypeScriptEmitter(reflectorHost), null, null);
// TODO(vicb): implicit tags & attributes // TODO(vicb): implicit tags & attributes
let messageBundle = new compiler.i18n.MessageBundle(htmlParser, [], {}); let messageBundle = new compiler.MessageBundle(htmlParser, [], {});
return new Extractor( return new Extractor(
program, compilerHost, staticReflector, messageBundle, reflectorHost, resolver, normalizer, program, compilerHost, staticReflector, messageBundle, reflectorHost, resolver, normalizer,

View File

@ -0,0 +1,54 @@
/**
* @license
* Copyright Google Inc. 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 {__compiler_private__ as _} from '@angular/compiler';
export type AssetUrl = typeof _._AssetUrl;
export var AssetUrl: typeof _.AssetUrl = _.AssetUrl;
export type ImportGenerator = typeof _._ImportGenerator;
export var ImportGenerator: typeof _.ImportGenerator = _.ImportGenerator;
export type CompileMetadataResolver = typeof _._CompileMetadataResolver;
export var CompileMetadataResolver: typeof _.CompileMetadataResolver = _.CompileMetadataResolver;
export type HtmlParser = typeof _._HtmlParser;
export var HtmlParser: typeof _.HtmlParser = _.HtmlParser;
export type ParseError = typeof _._ParseError;
export var ParseError: typeof _.ParseError = _.ParseError;
export type InterpolationConfig = typeof _._InterpolationConfig;
export var InterpolationConfig: typeof _.InterpolationConfig = _.InterpolationConfig;
export type DirectiveNormalizer = typeof _._DirectiveNormalizer;
export var DirectiveNormalizer: typeof _.DirectiveNormalizer = _.DirectiveNormalizer;
export type Lexer = typeof _._Lexer;
export var Lexer: typeof _.Lexer = _.Lexer;
export type Parser = typeof _._Parser;
export var Parser: typeof _.Parser = _.Parser;
export type TemplateParser = typeof _._TemplateParser;
export var TemplateParser: typeof _.TemplateParser = _.TemplateParser;
export type DomElementSchemaRegistry = typeof _._DomElementSchemaRegistry;
export var DomElementSchemaRegistry: typeof _.DomElementSchemaRegistry = _.DomElementSchemaRegistry;
export type StyleCompiler = typeof _._StyleCompiler;
export var StyleCompiler: typeof _.StyleCompiler = _.StyleCompiler;
export type ViewCompiler = typeof _._ViewCompiler;
export var ViewCompiler: typeof _.ViewCompiler = _.ViewCompiler;
export type NgModuleCompiler = typeof _._NgModuleCompiler;
export var NgModuleCompiler: typeof _.NgModuleCompiler = _.NgModuleCompiler;
export type TypeScriptEmitter = typeof _._TypeScriptEmitter;
export var TypeScriptEmitter: typeof _.TypeScriptEmitter = _.TypeScriptEmitter;

View File

@ -6,17 +6,19 @@
* found in the LICENSE file at https://angular.io/license * found in the LICENSE file at https://angular.io/license
*/ */
import {__core_private__ as r, __core_private_types__ as types} from '@angular/core'; import {__core_private__ as r} from '@angular/core';
export declare let _compiler_cli_core_private_types: types; export type ReflectorReader = typeof r._ReflectorReader;
export type ReflectorReader = typeof _compiler_cli_core_private_types.ReflectorReader;
export var ReflectorReader: typeof r.ReflectorReader = r.ReflectorReader; export var ReflectorReader: typeof r.ReflectorReader = r.ReflectorReader;
export type ReflectionCapabilities = typeof _compiler_cli_core_private_types.ReflectionCapabilities; export type ReflectionCapabilities = typeof r._ReflectionCapabilities;
export var ReflectionCapabilities: typeof r.ReflectionCapabilities = r.ReflectionCapabilities; export var ReflectionCapabilities: typeof r.ReflectionCapabilities = r.ReflectionCapabilities;
export type Console = typeof _compiler_cli_core_private_types.Console; export type Console = typeof r._Console;
export var Console: typeof r.Console = r.Console; export var Console: typeof r.Console = r.Console;
export var reflector: typeof r.reflector = r.reflector; export var reflector: typeof r.reflector = r.reflector;
export type SetterFn = typeof r._SetterFn;
export type GetterFn = typeof r._GetterFn;
export type MethodFn = typeof r._MethodFn;

View File

@ -11,7 +11,7 @@ import * as fs from 'fs';
import * as path from 'path'; import * as path from 'path';
import * as ts from 'typescript'; import * as ts from 'typescript';
import {AssetUrl, ImportGenerator} from './compiler_private'; import {AssetUrl, ImportGenerator} from './private_import_compiler';
import {StaticReflectorHost, StaticSymbol} from './static_reflector'; import {StaticReflectorHost, StaticSymbol} from './static_reflector';
const EXT = /(\.ts|\.d\.ts|\.js|\.jsx|\.tsx)$/; const EXT = /(\.ts|\.d\.ts|\.js|\.jsx|\.tsx)$/;
@ -59,6 +59,7 @@ export class ReflectorHost implements StaticReflectorHost, ImportGenerator {
getCanonicalFileName(fileName: string): string { return fileName; } getCanonicalFileName(fileName: string): string { return fileName; }
protected resolve(m: string, containingFile: string) { protected resolve(m: string, containingFile: string) {
m = m.replace(EXT, '');
const resolved = const resolved =
ts.resolveModuleName(m, containingFile.replace(/\\/g, '/'), this.options, this.context) ts.resolveModuleName(m, containingFile.replace(/\\/g, '/'), this.options, this.context)
.resolvedModule; .resolvedModule;

View File

@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.io/license * found in the LICENSE file at https://angular.io/license
*/ */
import {ReflectionCapabilities, reflector} from './core_private'; import {GetterFn, MethodFn, ReflectionCapabilities, SetterFn, reflector} from './private_import_core';
import {StaticReflector} from './static_reflector'; import {StaticReflector} from './static_reflector';
export class StaticAndDynamicReflectionCapabilities { export class StaticAndDynamicReflectionCapabilities {
@ -38,9 +38,9 @@ export class StaticAndDynamicReflectionCapabilities {
return isStaticType(typeOrFunc) ? this.staticDelegate.propMetadata(typeOrFunc) : return isStaticType(typeOrFunc) ? this.staticDelegate.propMetadata(typeOrFunc) :
this.dynamicDelegate.propMetadata(typeOrFunc); this.dynamicDelegate.propMetadata(typeOrFunc);
} }
getter(name: string) { return this.dynamicDelegate.getter(name); } getter(name: string): GetterFn { return this.dynamicDelegate.getter(name); }
setter(name: string) { return this.dynamicDelegate.setter(name); } setter(name: string): SetterFn { return this.dynamicDelegate.setter(name); }
method(name: string) { return this.dynamicDelegate.method(name); } method(name: string): MethodFn { return this.dynamicDelegate.method(name); }
importUri(type: any): string { return this.staticDelegate.importUri(type); } importUri(type: any): string { return this.staticDelegate.importUri(type); }
resolveIdentifier(name: string, moduleUrl: string, runtime: any) { resolveIdentifier(name: string, moduleUrl: string, runtime: any) {
return this.staticDelegate.resolveIdentifier(name, moduleUrl, runtime); return this.staticDelegate.resolveIdentifier(name, moduleUrl, runtime);

View File

@ -8,7 +8,7 @@
import {AttributeMetadata, ComponentMetadata, ContentChildMetadata, ContentChildrenMetadata, DirectiveMetadata, HostBindingMetadata, HostListenerMetadata, HostMetadata, InjectMetadata, InjectableMetadata, InputMetadata, NgModuleMetadata, OptionalMetadata, OutputMetadata, PipeMetadata, QueryMetadata, SelfMetadata, SkipSelfMetadata, ViewChildMetadata, ViewChildrenMetadata, ViewQueryMetadata, animate, group, keyframes, sequence, state, style, transition, trigger} from '@angular/core'; import {AttributeMetadata, ComponentMetadata, ContentChildMetadata, ContentChildrenMetadata, DirectiveMetadata, HostBindingMetadata, HostListenerMetadata, HostMetadata, InjectMetadata, InjectableMetadata, InputMetadata, NgModuleMetadata, OptionalMetadata, OutputMetadata, PipeMetadata, QueryMetadata, SelfMetadata, SkipSelfMetadata, ViewChildMetadata, ViewChildrenMetadata, ViewQueryMetadata, animate, group, keyframes, sequence, state, style, transition, trigger} from '@angular/core';
import {ReflectorReader} from './core_private'; import {ReflectorReader} from './private_import_core';
const SUPPORTED_SCHEMA_VERSION = 1; const SUPPORTED_SCHEMA_VERSION = 1;

View File

@ -6,10 +6,9 @@
* found in the LICENSE file at https://angular.io/license * found in the LICENSE file at https://angular.io/license
*/ */
import {ReflectorHostContext} from '@angular/compiler-cli/src/reflector_host';
import * as ts from 'typescript'; import * as ts from 'typescript';
import {ReflectorHostContext} from '../src/reflector_host';
export type Entry = string | Directory; export type Entry = string | Directory;
export interface Directory { [name: string]: Entry; } export interface Directory { [name: string]: Entry; }
@ -61,6 +60,15 @@ export class MockContext implements ReflectorHostContext {
} }
return current; return current;
} }
getDirectories(path: string): string[] {
const dir = this.getEntry(path);
if (typeof dir !== 'object') {
return [];
} else {
return Object.keys(dir).filter(key => typeof dir[key] === 'object');
}
}
} }
function normalize(parts: string[]): string[] { function normalize(parts: string[]): string[] {
@ -117,4 +125,6 @@ export class MockCompilerHost implements ts.CompilerHost {
useCaseSensitiveFileNames(): boolean { return false; } useCaseSensitiveFileNames(): boolean { return false; }
getNewLine(): string { return '\n'; } getNewLine(): string { return '\n'; }
getDirectories(path: string): string[] { return this.context.getDirectories(path); }
} }

View File

@ -176,28 +176,28 @@ describe('StaticReflector', () => {
expect(simplify(noContext, ({__symbolic: 'binop', operator: '==', left: 0x22, right: 0x22}))) expect(simplify(noContext, ({__symbolic: 'binop', operator: '==', left: 0x22, right: 0x22})))
.toBe(0x22 == 0x22); .toBe(0x22 == 0x22);
expect(simplify(noContext, ({__symbolic: 'binop', operator: '==', left: 0x22, right: 0xF0}))) expect(simplify(noContext, ({__symbolic: 'binop', operator: '==', left: 0x22, right: 0xF0})))
.toBe(0x22 == 0xF0); .toBe(0x22 as any == 0xF0);
}); });
it('should simplify !=', () => { it('should simplify !=', () => {
expect(simplify(noContext, ({__symbolic: 'binop', operator: '!=', left: 0x22, right: 0x22}))) expect(simplify(noContext, ({__symbolic: 'binop', operator: '!=', left: 0x22, right: 0x22})))
.toBe(0x22 != 0x22); .toBe(0x22 != 0x22);
expect(simplify(noContext, ({__symbolic: 'binop', operator: '!=', left: 0x22, right: 0xF0}))) expect(simplify(noContext, ({__symbolic: 'binop', operator: '!=', left: 0x22, right: 0xF0})))
.toBe(0x22 != 0xF0); .toBe(0x22 as any != 0xF0);
}); });
it('should simplify ===', () => { it('should simplify ===', () => {
expect(simplify(noContext, ({__symbolic: 'binop', operator: '===', left: 0x22, right: 0x22}))) expect(simplify(noContext, ({__symbolic: 'binop', operator: '===', left: 0x22, right: 0x22})))
.toBe(0x22 === 0x22); .toBe(0x22 === 0x22);
expect(simplify(noContext, ({__symbolic: 'binop', operator: '===', left: 0x22, right: 0xF0}))) expect(simplify(noContext, ({__symbolic: 'binop', operator: '===', left: 0x22, right: 0xF0})))
.toBe(0x22 === 0xF0); .toBe(0x22 as any === 0xF0);
}); });
it('should simplify !==', () => { it('should simplify !==', () => {
expect(simplify(noContext, ({__symbolic: 'binop', operator: '!==', left: 0x22, right: 0x22}))) expect(simplify(noContext, ({__symbolic: 'binop', operator: '!==', left: 0x22, right: 0x22})))
.toBe(0x22 !== 0x22); .toBe(0x22 !== 0x22);
expect(simplify(noContext, ({__symbolic: 'binop', operator: '!==', left: 0x22, right: 0xF0}))) expect(simplify(noContext, ({__symbolic: 'binop', operator: '!==', left: 0x22, right: 0xF0})))
.toBe(0x22 !== 0xF0); .toBe(0x22 as any !== 0xF0);
}); });
it('should simplify >', () => { it('should simplify >', () => {

View File

@ -18,7 +18,8 @@
"rootDir": ".", "rootDir": ".",
"sourceRoot": ".", "sourceRoot": ".",
"outDir": "../../../dist/packages-dist/compiler-cli", "outDir": "../../../dist/packages-dist/compiler-cli",
"declaration": true "declaration": true,
"skipLibCheck": true
}, },
"exclude": ["integrationtest"], "exclude": ["integrationtest"],
"files": [ "files": [

View File

@ -1,103 +0,0 @@
/**
* @license
* Copyright Google Inc. 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 {__core_private_DebugAppView__, __core_private_TemplateRef__, __core_private__ as r, __core_private_types__ as types} from '@angular/core';
export declare let _compiler_core_private_types: types;
export var isDefaultChangeDetectionStrategy: typeof r.isDefaultChangeDetectionStrategy =
r.isDefaultChangeDetectionStrategy;
export type ChangeDetectorStatus = typeof _compiler_core_private_types.ChangeDetectorStatus;
export var ChangeDetectorStatus: typeof r.ChangeDetectorStatus = r.ChangeDetectorStatus;
export var CHANGE_DETECTION_STRATEGY_VALUES: typeof r.CHANGE_DETECTION_STRATEGY_VALUES =
r.CHANGE_DETECTION_STRATEGY_VALUES;
export var constructDependencies: typeof r.constructDependencies = r.constructDependencies;
export type LifecycleHooks = typeof _compiler_core_private_types.LifecycleHooks;
export var LifecycleHooks: typeof r.LifecycleHooks = r.LifecycleHooks;
export var LIFECYCLE_HOOKS_VALUES: typeof r.LIFECYCLE_HOOKS_VALUES = r.LIFECYCLE_HOOKS_VALUES;
export type ReflectorReader = typeof _compiler_core_private_types.ReflectorReader;
export var ReflectorReader: typeof r.ReflectorReader = r.ReflectorReader;
export type AppElement = typeof _compiler_core_private_types.AppElement;
export var AppElement: typeof r.AppElement = r.AppElement;
export var CodegenComponentFactoryResolver: typeof r.CodegenComponentFactoryResolver =
r.CodegenComponentFactoryResolver;
export var AppView: typeof r.AppView = r.AppView;
export type DebugAppView<T> = __core_private_DebugAppView__<T>;
export var DebugAppView: typeof r.DebugAppView = r.DebugAppView;
export var NgModuleInjector: typeof r.NgModuleInjector = r.NgModuleInjector;
export type ViewType = typeof _compiler_core_private_types.ViewType;
export var ViewType: typeof r.ViewType = r.ViewType;
export var MAX_INTERPOLATION_VALUES: typeof r.MAX_INTERPOLATION_VALUES = r.MAX_INTERPOLATION_VALUES;
export var checkBinding: typeof r.checkBinding = r.checkBinding;
export var flattenNestedViewRenderNodes: typeof r.flattenNestedViewRenderNodes =
r.flattenNestedViewRenderNodes;
export var interpolate: typeof r.interpolate = r.interpolate;
export var ViewUtils: typeof r.ViewUtils = r.ViewUtils;
export var VIEW_ENCAPSULATION_VALUES: typeof r.VIEW_ENCAPSULATION_VALUES =
r.VIEW_ENCAPSULATION_VALUES;
export var DebugContext: typeof r.DebugContext = r.DebugContext;
export var StaticNodeDebugInfo: typeof r.StaticNodeDebugInfo = r.StaticNodeDebugInfo;
export var devModeEqual: typeof r.devModeEqual = r.devModeEqual;
export var UNINITIALIZED: typeof r.UNINITIALIZED = r.UNINITIALIZED;
export var ValueUnwrapper: typeof _compiler_core_private_types.ValueUnwrapper = r.ValueUnwrapper;
export type TemplateRef_<T> = __core_private_TemplateRef__<T>;
export var TemplateRef_: typeof r.TemplateRef_ = r.TemplateRef_;
export type RenderDebugInfo = typeof _compiler_core_private_types.RenderDebugInfo;
export var RenderDebugInfo: typeof r.RenderDebugInfo = r.RenderDebugInfo;
export var EMPTY_ARRAY: typeof r.EMPTY_ARRAY = r.EMPTY_ARRAY;
export var EMPTY_MAP: typeof r.EMPTY_MAP = r.EMPTY_MAP;
export var pureProxy1: typeof r.pureProxy1 = r.pureProxy1;
export var pureProxy2: typeof r.pureProxy2 = r.pureProxy2;
export var pureProxy3: typeof r.pureProxy3 = r.pureProxy3;
export var pureProxy4: typeof r.pureProxy4 = r.pureProxy4;
export var pureProxy5: typeof r.pureProxy5 = r.pureProxy5;
export var pureProxy6: typeof r.pureProxy6 = r.pureProxy6;
export var pureProxy7: typeof r.pureProxy7 = r.pureProxy7;
export var pureProxy8: typeof r.pureProxy8 = r.pureProxy8;
export var pureProxy9: typeof r.pureProxy9 = r.pureProxy9;
export var pureProxy10: typeof r.pureProxy10 = r.pureProxy10;
export var castByValue: typeof r.castByValue = r.castByValue;
export type Console = typeof _compiler_core_private_types.Console;
export var Console: typeof r.Console = r.Console;
export var reflector: typeof _compiler_core_private_types.Reflector = r.reflector;
export var Reflector: typeof r.Reflector = r.Reflector;
export type Reflector = typeof _compiler_core_private_types.Reflector;
export type ReflectionCapabilities = typeof _compiler_core_private_types.ReflectionCapabilities;
export var ReflectionCapabilities: typeof r.ReflectionCapabilities = r.ReflectionCapabilities;
export type NoOpAnimationPlayer = typeof _compiler_core_private_types.NoOpAnimationPlayer;
export var NoOpAnimationPlayer: typeof r.NoOpAnimationPlayer = r.NoOpAnimationPlayer;
export type AnimationPlayer = typeof _compiler_core_private_types.AnimationPlayer;
export var AnimationPlayer: typeof r.AnimationPlayer = r.AnimationPlayer;
export type AnimationSequencePlayer = typeof _compiler_core_private_types.AnimationSequencePlayer;
export var AnimationSequencePlayer: typeof r.AnimationSequencePlayer = r.AnimationSequencePlayer;
export type AnimationGroupPlayer = typeof _compiler_core_private_types.AnimationGroupPlayer;
export var AnimationGroupPlayer: typeof r.AnimationGroupPlayer = r.AnimationGroupPlayer;
export type AnimationKeyframe = typeof _compiler_core_private_types.AnimationKeyframe;
export var AnimationKeyframe: typeof r.AnimationKeyframe = r.AnimationKeyframe;
export type AnimationStyles = typeof _compiler_core_private_types.AnimationStyles;
export var AnimationStyles: typeof r.AnimationStyles = r.AnimationStyles;
export type AnimationOutput = typeof _compiler_core_private_types.AnimationOutput;
export var AnimationOutput: typeof r.AnimationOutput = r.AnimationOutput;
export var ANY_STATE = r.ANY_STATE;
export var DEFAULT_STATE = r.DEFAULT_STATE;
export var EMPTY_STATE = r.EMPTY_STATE;
export var FILL_STYLE_FLAG = r.FILL_STYLE_FLAG;
export var prepareFinalAnimationStyles: typeof r.prepareFinalAnimationStyles =
r.prepareFinalAnimationStyles;
export var balanceAnimationKeyframes: typeof r.balanceAnimationKeyframes =
r.balanceAnimationKeyframes;
export var flattenStyles: typeof r.flattenStyles = r.flattenStyles;
export var clearStyles: typeof r.clearStyles = r.clearStyles;
export var collectAndResolveStyles: typeof r.collectAndResolveStyles = r.collectAndResolveStyles;
export var renderStyles: typeof r.renderStyles = r.renderStyles;
export type ViewMetadata = typeof _compiler_core_private_types.ViewMetadata;
export var ViewMetadata: typeof r.ViewMetadata = r.ViewMetadata;
export type ComponentStillLoadingError =
typeof _compiler_core_private_types.ComponentStillLoadingError;
export var ComponentStillLoadingError: typeof r.ComponentStillLoadingError =
r.ComponentStillLoadingError;

View File

@ -1,17 +0,0 @@
/**
* @license
* Copyright Google Inc. 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 {__core_private_testing__ as r, __core_private_testing_types__ as types} from '@angular/core/testing';
export declare let _compiler_core_testing_types: types;
export type TestingCompiler = typeof _compiler_core_testing_types.TestingCompiler;
export var TestingCompiler: typeof r.TestingCompiler = r.TestingCompiler;
export type TestingCompilerFactory = typeof _compiler_core_testing_types.TestingCompilerFactory;
export var TestingCompilerFactory: typeof r.TestingCompilerFactory = r.TestingCompilerFactory;

View File

@ -9,14 +9,18 @@
/** /**
* @module * @module
* @description * @description
* Starting point to import all compiler APIs. * Entry point for all APIs of the compiler package.
*
* <div class="callout is-critical">
* <header>Unstable APIs</header>
* <p>
* All compiler apis are currently considered experimental and private!
* </p>
* <p>
* We expect the APIs in this package to keep on changing. Do not rely on them.
* </p>
* </div>
*/ */
import * as i18n from './src/i18n/index'; export * from './src/index';
export {COMPILER_PROVIDERS, CompileDiDependencyMetadata, CompileDirectiveMetadata, CompileFactoryMetadata, CompileIdentifierMetadata, CompileMetadataWithIdentifier, CompilePipeMetadata, CompileProviderMetadata, CompileQueryMetadata, CompileTemplateMetadata, CompileTokenMetadata, CompileTypeMetadata, CompilerConfig, DEFAULT_PACKAGE_URL_PROVIDER, DirectiveResolver, NgModuleResolver, OfflineCompiler, PipeResolver, RenderTypes, ResourceLoader, RuntimeCompiler, SourceModule, TEMPLATE_TRANSFORMS, UrlResolver, createOfflineCompileUrlResolver, platformCoreDynamic} from './src/compiler'; // This file only reexports content of the `src` folder. Keep it that way.
export {DEFAULT_INTERPOLATION_CONFIG, InterpolationConfig} from './src/ml_parser/interpolation_config';
export {ElementSchemaRegistry} from './src/schema/element_schema_registry';
export {i18n};
export * from './src/template_parser/template_ast';
export * from './private_export';

View File

@ -1,9 +1,9 @@
{ {
"name": "@angular/compiler", "name": "@angular/compiler",
"version": "0.0.0-PLACEHOLDER", "version": "0.0.0-PLACEHOLDER",
"description": "", "description": "Angular2 - compiler",
"main": "index.js", "main": "bundles/compiler.umd.js",
"jsnext:main": "esm/index.js", "module": "index.js",
"typings": "index.d.ts", "typings": "index.d.ts",
"author": "angular", "author": "angular",
"license": "MIT", "license": "MIT",

View File

@ -1,90 +0,0 @@
/**
* @license
* Copyright Google Inc. 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 directive_normalizer from './src/directive_normalizer';
import * as lexer from './src/expression_parser/lexer';
import * as parser from './src/expression_parser/parser';
import * as metadata_resolver from './src/metadata_resolver';
import * as html_parser from './src/ml_parser/html_parser';
import * as interpolation_config from './src/ml_parser/interpolation_config';
import * as ng_module_compiler from './src/ng_module_compiler';
import * as path_util from './src/output/path_util';
import * as ts_emitter from './src/output/ts_emitter';
import * as parse_util from './src/parse_util';
import * as dom_element_schema_registry from './src/schema/dom_element_schema_registry';
import * as selector from './src/selector';
import * as style_compiler from './src/style_compiler';
import * as template_parser from './src/template_parser/template_parser';
import * as view_compiler from './src/view_compiler/view_compiler';
export namespace __compiler_private__ {
export type SelectorMatcher = selector.SelectorMatcher;
export var SelectorMatcher = selector.SelectorMatcher;
export type CssSelector = selector.CssSelector;
export var CssSelector = selector.CssSelector;
export type AssetUrl = path_util.AssetUrl;
export var AssetUrl = path_util.AssetUrl;
export type ImportGenerator = path_util.ImportGenerator;
export var ImportGenerator = path_util.ImportGenerator;
export type CompileMetadataResolver = metadata_resolver.CompileMetadataResolver;
export var CompileMetadataResolver = metadata_resolver.CompileMetadataResolver;
export type HtmlParser = html_parser.HtmlParser;
export var HtmlParser = html_parser.HtmlParser;
export type InterpolationConfig = interpolation_config.InterpolationConfig;
export var InterpolationConfig = interpolation_config.InterpolationConfig;
export type DirectiveNormalizer = directive_normalizer.DirectiveNormalizer;
export var DirectiveNormalizer = directive_normalizer.DirectiveNormalizer;
export type Lexer = lexer.Lexer;
export var Lexer = lexer.Lexer;
export type Parser = parser.Parser;
export var Parser = parser.Parser;
export type ParseLocation = parse_util.ParseLocation;
export var ParseLocation = parse_util.ParseLocation;
export type ParseError = parse_util.ParseError;
export var ParseError = parse_util.ParseError;
export type ParseErrorLevel = parse_util.ParseErrorLevel;
export var ParseErrorLevel = parse_util.ParseErrorLevel;
export type ParseSourceFile = parse_util.ParseSourceFile;
export var ParseSourceFile = parse_util.ParseSourceFile;
export type ParseSourceSpan = parse_util.ParseSourceSpan;
export var ParseSourceSpan = parse_util.ParseSourceSpan;
export type TemplateParser = template_parser.TemplateParser;
export var TemplateParser = template_parser.TemplateParser;
export type TemplateParseResult = template_parser.TemplateParseResult;
export type DomElementSchemaRegistry = dom_element_schema_registry.DomElementSchemaRegistry;
export var DomElementSchemaRegistry = dom_element_schema_registry.DomElementSchemaRegistry;
export type StyleCompiler = style_compiler.StyleCompiler;
export var StyleCompiler = style_compiler.StyleCompiler;
export type ViewCompiler = view_compiler.ViewCompiler;
export var ViewCompiler = view_compiler.ViewCompiler;
export type NgModuleCompiler = ng_module_compiler.NgModuleCompiler;
export var NgModuleCompiler = ng_module_compiler.NgModuleCompiler;
export type TypeScriptEmitter = ts_emitter.TypeScriptEmitter;
export var TypeScriptEmitter = ts_emitter.TypeScriptEmitter;
}

View File

@ -0,0 +1,16 @@
export default {
entry: '../../../dist/packages-dist/compiler/testing/index.js',
dest: '../../../dist/packages-dist/compiler/bundles/compiler-testing.umd.js',
format: 'umd',
moduleName: 'ng.compiler.testing',
globals: {
'@angular/core': 'ng.core',
'@angular/core/testing': 'ng.core.testing',
'@angular/compiler': 'ng.compiler',
'rxjs/Subject': 'Rx',
'rxjs/observable/PromiseObservable': 'Rx', // this is wrong, but this stuff has changed in rxjs b.6 so we need to fix it when we update.
'rxjs/operator/toPromise': 'Rx.Observable.prototype',
'rxjs/Observable': 'Rx'
}
}

View File

@ -1,7 +1,7 @@
export default { export default {
entry: '../../../dist/packages-dist/compiler/esm/index.js', entry: '../../../dist/packages-dist/compiler/index.js',
dest: '../../../dist/packages-dist/compiler/esm/compiler.umd.js', dest: '../../../dist/packages-dist/compiler/bundles/compiler.umd.js',
format: 'umd', format: 'umd',
moduleName: 'ng.compiler', moduleName: 'ng.compiler',
globals: { globals: {

View File

@ -6,12 +6,12 @@
* found in the LICENSE file at https://angular.io/license * found in the LICENSE file at https://angular.io/license
*/ */
import {ANY_STATE, AnimationOutput, DEFAULT_STATE, EMPTY_STATE} from '../../core_private';
import {CompileDirectiveMetadata} from '../compile_metadata'; import {CompileDirectiveMetadata} from '../compile_metadata';
import {StringMapWrapper} from '../facade/collection'; import {StringMapWrapper} from '../facade/collection';
import {isBlank, isPresent} from '../facade/lang'; import {isBlank, isPresent} from '../facade/lang';
import {Identifiers, resolveIdentifier} from '../identifiers'; import {Identifiers, resolveIdentifier} from '../identifiers';
import * as o from '../output/output_ast'; import * as o from '../output/output_ast';
import {ANY_STATE, AnimationOutput, DEFAULT_STATE, EMPTY_STATE} from '../private_import_core';
import * as t from '../template_parser/template_ast'; import * as t from '../template_parser/template_ast';
import {AnimationAst, AnimationAstVisitor, AnimationEntryAst, AnimationGroupAst, AnimationKeyframeAst, AnimationSequenceAst, AnimationStateAst, AnimationStateDeclarationAst, AnimationStateTransitionAst, AnimationStepAst, AnimationStylesAst} from './animation_ast'; import {AnimationAst, AnimationAstVisitor, AnimationEntryAst, AnimationGroupAst, AnimationKeyframeAst, AnimationSequenceAst, AnimationStateAst, AnimationStateDeclarationAst, AnimationStateTransitionAst, AnimationStepAst, AnimationStylesAst} from './animation_ast';

View File

@ -6,13 +6,13 @@
* found in the LICENSE file at https://angular.io/license * found in the LICENSE file at https://angular.io/license
*/ */
import {ANY_STATE, AnimationOutput, FILL_STYLE_FLAG} from '../../core_private';
import {CompileAnimationAnimateMetadata, CompileAnimationEntryMetadata, CompileAnimationGroupMetadata, CompileAnimationKeyframesSequenceMetadata, CompileAnimationMetadata, CompileAnimationSequenceMetadata, CompileAnimationStateDeclarationMetadata, CompileAnimationStateTransitionMetadata, CompileAnimationStyleMetadata, CompileAnimationWithStepsMetadata} from '../compile_metadata'; import {CompileAnimationAnimateMetadata, CompileAnimationEntryMetadata, CompileAnimationGroupMetadata, CompileAnimationKeyframesSequenceMetadata, CompileAnimationMetadata, CompileAnimationSequenceMetadata, CompileAnimationStateDeclarationMetadata, CompileAnimationStateTransitionMetadata, CompileAnimationStyleMetadata, CompileAnimationWithStepsMetadata} from '../compile_metadata';
import {ListWrapper, StringMapWrapper} from '../facade/collection'; import {ListWrapper, StringMapWrapper} from '../facade/collection';
import {NumberWrapper, isArray, isBlank, isPresent, isString, isStringMap} from '../facade/lang'; import {NumberWrapper, isArray, isBlank, isPresent, isString, isStringMap} from '../facade/lang';
import {Math} from '../facade/math'; import {Math} from '../facade/math';
import {ParseError} from '../parse_util'; import {ParseError} from '../parse_util';
import {ANY_STATE, AnimationOutput, FILL_STYLE_FLAG} from '../private_import_core';
import {AnimationAst, AnimationEntryAst, AnimationGroupAst, AnimationKeyframeAst, AnimationSequenceAst, AnimationStateDeclarationAst, AnimationStateTransitionAst, AnimationStateTransitionExpression, AnimationStepAst, AnimationStylesAst, AnimationWithStepsAst} from './animation_ast'; import {AnimationAst, AnimationEntryAst, AnimationGroupAst, AnimationKeyframeAst, AnimationSequenceAst, AnimationStateDeclarationAst, AnimationStateTransitionAst, AnimationStateTransitionExpression, AnimationStepAst, AnimationStylesAst, AnimationWithStepsAst} from './animation_ast';
import {StylesCollection} from './styles_collection'; import {StylesCollection} from './styles_collection';

View File

@ -8,10 +8,9 @@
import {ChangeDetectionStrategy, SchemaMetadata, Type, ViewEncapsulation} from '@angular/core'; import {ChangeDetectionStrategy, SchemaMetadata, Type, ViewEncapsulation} from '@angular/core';
import {LifecycleHooks, reflector} from '../core_private';
import {ListWrapper, MapWrapper, StringMapWrapper} from './facade/collection'; import {ListWrapper, MapWrapper, StringMapWrapper} from './facade/collection';
import {isBlank, isPresent, isStringMap, normalizeBlank, normalizeBool} from './facade/lang'; import {isBlank, isPresent, isStringMap, normalizeBlank, normalizeBool} from './facade/lang';
import {LifecycleHooks, reflector} from './private_import_core';
import {CssSelector} from './selector'; import {CssSelector} from './selector';
import {getUrlScheme} from './url_resolver'; import {getUrlScheme} from './url_resolver';
import {sanitizeIdentifier, splitAtColon} from './util'; import {sanitizeIdentifier, splitAtColon} from './util';

View File

@ -38,7 +38,7 @@ import {Lexer} from './expression_parser/lexer';
import {DirectiveResolver} from './directive_resolver'; import {DirectiveResolver} from './directive_resolver';
import {PipeResolver} from './pipe_resolver'; import {PipeResolver} from './pipe_resolver';
import {NgModuleResolver} from './ng_module_resolver'; import {NgModuleResolver} from './ng_module_resolver';
import {Console, Reflector, reflector, ReflectorReader, ReflectionCapabilities} from '../core_private'; import {Console, Reflector, reflector, ReflectorReader, ReflectionCapabilities} from './private_import_core';
import {ResourceLoader} from './resource_loader'; import {ResourceLoader} from './resource_loader';
import * as i18n from './i18n/index'; import * as i18n from './i18n/index';
@ -61,9 +61,9 @@ export const COMPILER_PROVIDERS: Array<any|Type<any>|{[k: string]: any}|any[]> =
Parser, Parser,
HtmlParser, HtmlParser,
{ {
provide: i18n.HtmlParser, provide: i18n.I18NHtmlParser,
useFactory: (parser: HtmlParser, translations: string, format: string) => useFactory: (parser: HtmlParser, translations: string, format: string) =>
new i18n.HtmlParser(parser, translations, format), new i18n.I18NHtmlParser(parser, translations, format),
deps: [ deps: [
HtmlParser, HtmlParser,
[new OptionalMetadata(), new Inject(TRANSLATIONS)], [new OptionalMetadata(), new Inject(TRANSLATIONS)],

View File

@ -7,9 +7,10 @@
*/ */
import {ComponentMetadata, DirectiveMetadata, HostBindingMetadata, HostListenerMetadata, Injectable, InputMetadata, OutputMetadata, QueryMetadata, Type, resolveForwardRef} from '@angular/core'; import {ComponentMetadata, DirectiveMetadata, HostBindingMetadata, HostListenerMetadata, Injectable, InputMetadata, OutputMetadata, QueryMetadata, Type, resolveForwardRef} from '@angular/core';
import {ReflectorReader, reflector} from '../core_private';
import {StringMapWrapper} from './facade/collection'; import {StringMapWrapper} from './facade/collection';
import {isPresent, stringify} from './facade/lang'; import {isPresent, stringify} from './facade/lang';
import {ReflectorReader, reflector} from './private_import_core';
import {splitAtColon} from './util'; import {splitAtColon} from './util';
function _isDirectiveMetadata(type: any): type is DirectiveMetadata { function _isDirectiveMetadata(type: any): type is DirectiveMetadata {

View File

@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.io/license * found in the LICENSE file at https://angular.io/license
*/ */
import {HtmlParser as BaseHtmlParser} from '../ml_parser/html_parser'; import {HtmlParser} from '../ml_parser/html_parser';
import {DEFAULT_INTERPOLATION_CONFIG, InterpolationConfig} from '../ml_parser/interpolation_config'; import {DEFAULT_INTERPOLATION_CONFIG, InterpolationConfig} from '../ml_parser/interpolation_config';
import {ParseTreeResult} from '../ml_parser/parser'; import {ParseTreeResult} from '../ml_parser/parser';
@ -18,7 +18,7 @@ import {Xmb} from './serializers/xmb';
import {Xtb} from './serializers/xtb'; import {Xtb} from './serializers/xtb';
import {TranslationBundle} from './translation_bundle'; import {TranslationBundle} from './translation_bundle';
export class HtmlParser implements BaseHtmlParser { export class I18NHtmlParser implements HtmlParser {
// @override // @override
getTagDefinition: any; getTagDefinition: any;
@ -26,7 +26,7 @@ export class HtmlParser implements BaseHtmlParser {
// interpolationConfig) // interpolationConfig)
// TODO(vicb): remove the interpolationConfig from the Xtb serializer // TODO(vicb): remove the interpolationConfig from the Xtb serializer
constructor( constructor(
private _htmlParser: BaseHtmlParser, private _translations?: string, private _htmlParser: HtmlParser, private _translations?: string,
private _translationsFormat?: string) {} private _translationsFormat?: string) {}
parse( parse(

View File

@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.io/license * found in the LICENSE file at https://angular.io/license
*/ */
export {HtmlParser} from './html_parser'; export {I18NHtmlParser} from './i18n_html_parser';
export {MessageBundle} from './message_bundle'; export {MessageBundle} from './message_bundle';
export {Serializer} from './serializers/serializer'; export {Serializer} from './serializers/serializer';
export {Xliff} from './serializers/xliff'; export {Xliff} from './serializers/xliff';

View File

@ -8,9 +8,8 @@
import {ANALYZE_FOR_ENTRY_COMPONENTS, ChangeDetectionStrategy, ChangeDetectorRef, ComponentFactory, ComponentFactoryResolver, ElementRef, Injector, LOCALE_ID as LOCALE_ID_, NgModuleFactory, QueryList, RenderComponentType, Renderer, SecurityContext, SimpleChange, TRANSLATIONS_FORMAT as TRANSLATIONS_FORMAT_, TemplateRef, ViewContainerRef, ViewEncapsulation} from '@angular/core'; import {ANALYZE_FOR_ENTRY_COMPONENTS, ChangeDetectionStrategy, ChangeDetectorRef, ComponentFactory, ComponentFactoryResolver, ElementRef, Injector, LOCALE_ID as LOCALE_ID_, NgModuleFactory, QueryList, RenderComponentType, Renderer, SecurityContext, SimpleChange, TRANSLATIONS_FORMAT as TRANSLATIONS_FORMAT_, TemplateRef, ViewContainerRef, ViewEncapsulation} from '@angular/core';
import {AnimationGroupPlayer, AnimationKeyframe, AnimationOutput, AnimationSequencePlayer, AnimationStyles, AppElement, AppView, ChangeDetectorStatus, CodegenComponentFactoryResolver, DebugAppView, DebugContext, EMPTY_ARRAY, EMPTY_MAP, NgModuleInjector, NoOpAnimationPlayer, StaticNodeDebugInfo, TemplateRef_, UNINITIALIZED, ValueUnwrapper, ViewType, ViewUtils, balanceAnimationKeyframes, castByValue, checkBinding, clearStyles, collectAndResolveStyles, devModeEqual, flattenNestedViewRenderNodes, interpolate, prepareFinalAnimationStyles, pureProxy1, pureProxy10, pureProxy2, pureProxy3, pureProxy4, pureProxy5, pureProxy6, pureProxy7, pureProxy8, pureProxy9, reflector, renderStyles} from '../core_private';
import {CompileIdentifierMetadata, CompileTokenMetadata} from './compile_metadata'; import {CompileIdentifierMetadata, CompileTokenMetadata} from './compile_metadata';
import {AnimationGroupPlayer, AnimationKeyframe, AnimationOutput, AnimationSequencePlayer, AnimationStyles, AppElement, AppView, ChangeDetectorStatus, CodegenComponentFactoryResolver, DebugAppView, DebugContext, EMPTY_ARRAY, EMPTY_MAP, NgModuleInjector, NoOpAnimationPlayer, StaticNodeDebugInfo, TemplateRef_, UNINITIALIZED, ValueUnwrapper, ViewType, ViewUtils, balanceAnimationKeyframes, castByValue, checkBinding, clearStyles, collectAndResolveStyles, devModeEqual, flattenNestedViewRenderNodes, interpolate, prepareFinalAnimationStyles, pureProxy1, pureProxy10, pureProxy2, pureProxy3, pureProxy4, pureProxy5, pureProxy6, pureProxy7, pureProxy8, pureProxy9, reflector, renderStyles} from './private_import_core';
import {assetUrl} from './util'; import {assetUrl} from './util';
var APP_VIEW_MODULE_URL = assetUrl('core', 'linker/view'); var APP_VIEW_MODULE_URL = assetUrl('core', 'linker/view');

View File

@ -0,0 +1,20 @@
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @module
* @description
* Starting point to import all compiler APIs.
*/
export {COMPILER_PROVIDERS, CompileDiDependencyMetadata, CompileDirectiveMetadata, CompileFactoryMetadata, CompileIdentifierMetadata, CompileMetadataWithIdentifier, CompilePipeMetadata, CompileProviderMetadata, CompileQueryMetadata, CompileTemplateMetadata, CompileTokenMetadata, CompileTypeMetadata, CompilerConfig, DEFAULT_PACKAGE_URL_PROVIDER, DirectiveResolver, NgModuleResolver, OfflineCompiler, PipeResolver, RenderTypes, ResourceLoader, RuntimeCompiler, SourceModule, TEMPLATE_TRANSFORMS, UrlResolver, createOfflineCompileUrlResolver, platformCoreDynamic} from './compiler';
export {DEFAULT_INTERPOLATION_CONFIG, InterpolationConfig} from './ml_parser/interpolation_config';
export {ElementSchemaRegistry} from './schema/element_schema_registry';
export * from './i18n/index';
export * from './template_parser/template_ast';
export * from './private_export';

View File

@ -8,9 +8,8 @@
import {AfterContentChecked, AfterContentInit, AfterViewChecked, AfterViewInit, DoCheck, OnChanges, OnDestroy, OnInit, Type} from '@angular/core'; import {AfterContentChecked, AfterContentInit, AfterViewChecked, AfterViewInit, DoCheck, OnChanges, OnDestroy, OnInit, Type} from '@angular/core';
import {LifecycleHooks, reflector} from '../core_private';
import {MapWrapper} from './facade/collection'; import {MapWrapper} from './facade/collection';
import {LifecycleHooks, reflector} from './private_import_core';
const LIFECYCLE_INTERFACES: Map<any, Type<any>> = MapWrapper.createFromPairs([ const LIFECYCLE_INTERFACES: Map<any, Type<any>> = MapWrapper.createFromPairs([
[LifecycleHooks.OnInit, OnInit], [LifecycleHooks.OnInit, OnInit],

View File

@ -8,7 +8,6 @@
import {AnimationAnimateMetadata, AnimationEntryMetadata, AnimationGroupMetadata, AnimationKeyframesSequenceMetadata, AnimationMetadata, AnimationStateDeclarationMetadata, AnimationStateMetadata, AnimationStateTransitionMetadata, AnimationStyleMetadata, AnimationWithStepsMetadata, AttributeMetadata, ChangeDetectionStrategy, ComponentMetadata, HostMetadata, InjectMetadata, Injectable, ModuleWithProviders, OptionalMetadata, Provider, QueryMetadata, SchemaMetadata, SelfMetadata, SkipSelfMetadata, Type, ViewQueryMetadata, resolveForwardRef} from '@angular/core'; import {AnimationAnimateMetadata, AnimationEntryMetadata, AnimationGroupMetadata, AnimationKeyframesSequenceMetadata, AnimationMetadata, AnimationStateDeclarationMetadata, AnimationStateMetadata, AnimationStateTransitionMetadata, AnimationStyleMetadata, AnimationWithStepsMetadata, AttributeMetadata, ChangeDetectionStrategy, ComponentMetadata, HostMetadata, InjectMetadata, Injectable, ModuleWithProviders, OptionalMetadata, Provider, QueryMetadata, SchemaMetadata, SelfMetadata, SkipSelfMetadata, Type, ViewQueryMetadata, resolveForwardRef} from '@angular/core';
import {LIFECYCLE_HOOKS_VALUES, ReflectorReader, reflector} from '../core_private';
import {StringMapWrapper} from '../src/facade/collection'; import {StringMapWrapper} from '../src/facade/collection';
import {assertArrayOfStrings, assertInterpolationSymbols} from './assertions'; import {assertArrayOfStrings, assertInterpolationSymbols} from './assertions';
@ -19,6 +18,7 @@ import {Identifiers, resolveIdentifierToken} from './identifiers';
import {hasLifecycleHook} from './lifecycle_reflector'; import {hasLifecycleHook} from './lifecycle_reflector';
import {NgModuleResolver} from './ng_module_resolver'; import {NgModuleResolver} from './ng_module_resolver';
import {PipeResolver} from './pipe_resolver'; import {PipeResolver} from './pipe_resolver';
import {LIFECYCLE_HOOKS_VALUES, ReflectorReader, reflector} from './private_import_core';
import {ElementSchemaRegistry} from './schema/element_schema_registry'; import {ElementSchemaRegistry} from './schema/element_schema_registry';
import {getUrlScheme} from './url_resolver'; import {getUrlScheme} from './url_resolver';
import {MODULE_SUFFIX, ValueTransformer, sanitizeIdentifier, visitValue} from './util'; import {MODULE_SUFFIX, ValueTransformer, sanitizeIdentifier, visitValue} from './util';

View File

@ -8,14 +8,13 @@
import {Injectable} from '@angular/core'; import {Injectable} from '@angular/core';
import {LifecycleHooks} from '../core_private';
import {CompileDiDependencyMetadata, CompileIdentifierMetadata, CompileNgModuleMetadata, CompileProviderMetadata, CompileTokenMetadata} from './compile_metadata'; import {CompileDiDependencyMetadata, CompileIdentifierMetadata, CompileNgModuleMetadata, CompileProviderMetadata, CompileTokenMetadata} from './compile_metadata';
import {isBlank, isPresent} from './facade/lang'; import {isBlank, isPresent} from './facade/lang';
import {Identifiers, identifierToken, resolveIdentifier, resolveIdentifierToken} from './identifiers'; import {Identifiers, identifierToken, resolveIdentifier, resolveIdentifierToken} from './identifiers';
import * as o from './output/output_ast'; import * as o from './output/output_ast';
import {convertValueToOutputAst} from './output/value_util'; import {convertValueToOutputAst} from './output/value_util';
import {ParseLocation, ParseSourceFile, ParseSourceSpan} from './parse_util'; import {ParseLocation, ParseSourceFile, ParseSourceSpan} from './parse_util';
import {LifecycleHooks} from './private_import_core';
import {NgModuleProviderAnalyzer} from './provider_analyzer'; import {NgModuleProviderAnalyzer} from './provider_analyzer';
import {ProviderAst} from './template_parser/template_ast'; import {ProviderAst} from './template_parser/template_ast';
import {createDiTokenExpression} from './util'; import {createDiTokenExpression} from './util';

View File

@ -8,8 +8,8 @@
import {Injectable, NgModuleMetadata, Type} from '@angular/core'; import {Injectable, NgModuleMetadata, Type} from '@angular/core';
import {ReflectorReader, reflector} from '../core_private';
import {isPresent, stringify} from './facade/lang'; import {isPresent, stringify} from './facade/lang';
import {ReflectorReader, reflector} from './private_import_core';
function _isNgModuleMetadata(obj: any): obj is NgModuleMetadata { function _isNgModuleMetadata(obj: any): obj is NgModuleMetadata {
return obj instanceof NgModuleMetadata; return obj instanceof NgModuleMetadata;

View File

@ -8,9 +8,8 @@
import {Injectable, PipeMetadata, Type, resolveForwardRef} from '@angular/core'; import {Injectable, PipeMetadata, Type, resolveForwardRef} from '@angular/core';
import {ReflectorReader, reflector} from '../core_private';
import {isPresent, stringify} from './facade/lang'; import {isPresent, stringify} from './facade/lang';
import {ReflectorReader, reflector} from './private_import_core';
function _isPipeMetadata(type: any): boolean { function _isPipeMetadata(type: any): boolean {
return type instanceof PipeMetadata; return type instanceof PipeMetadata;

View File

@ -0,0 +1,112 @@
/**
* @license
* Copyright Google Inc. 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 directive_normalizer from './directive_normalizer';
import * as lexer from './expression_parser/lexer';
import * as parser from './expression_parser/parser';
import * as metadata_resolver from './metadata_resolver';
import * as html_parser from './ml_parser/html_parser';
import * as interpolation_config from './ml_parser/interpolation_config';
import * as ng_module_compiler from './ng_module_compiler';
import * as path_util from './output/path_util';
import * as ts_emitter from './output/ts_emitter';
import * as parse_util from './parse_util';
import * as dom_element_schema_registry from './schema/dom_element_schema_registry';
import * as selector from './selector';
import * as style_compiler from './style_compiler';
import * as template_parser from './template_parser/template_parser';
import * as view_compiler from './view_compiler/view_compiler';
export const __compiler_private__: {
_SelectorMatcher?: selector.SelectorMatcher; SelectorMatcher: typeof selector.SelectorMatcher;
_CssSelector?: selector.CssSelector;
CssSelector: typeof selector.CssSelector;
_AssetUrl?: path_util.AssetUrl;
AssetUrl: typeof path_util.AssetUrl;
_ImportGenerator?: path_util.ImportGenerator;
ImportGenerator: typeof path_util.ImportGenerator;
_CompileMetadataResolver?: metadata_resolver.CompileMetadataResolver;
CompileMetadataResolver: typeof metadata_resolver.CompileMetadataResolver;
_HtmlParser?: html_parser.HtmlParser;
HtmlParser: typeof html_parser.HtmlParser;
_InterpolationConfig?: interpolation_config.InterpolationConfig;
InterpolationConfig: typeof interpolation_config.InterpolationConfig;
_DirectiveNormalizer?: directive_normalizer.DirectiveNormalizer;
DirectiveNormalizer: typeof directive_normalizer.DirectiveNormalizer;
_Lexer?: lexer.Lexer;
Lexer: typeof lexer.Lexer;
_Parser?: parser.Parser;
Parser: typeof parser.Parser;
_ParseLocation?: parse_util.ParseLocation;
ParseLocation: typeof parse_util.ParseLocation;
_ParseError?: parse_util.ParseError;
ParseError: typeof parse_util.ParseError;
_ParseErrorLevel?: parse_util.ParseErrorLevel;
ParseErrorLevel: typeof parse_util.ParseErrorLevel;
_ParseSourceFile?: parse_util.ParseSourceFile;
ParseSourceFile: typeof parse_util.ParseSourceFile;
_ParseSourceSpan?: parse_util.ParseSourceSpan;
ParseSourceSpan: typeof parse_util.ParseSourceSpan;
_TemplateParser?: template_parser.TemplateParser;
TemplateParser: typeof template_parser.TemplateParser;
_TemplateParseResult?: template_parser.TemplateParseResult;
_DomElementSchemaRegistry?: dom_element_schema_registry.DomElementSchemaRegistry;
DomElementSchemaRegistry: typeof dom_element_schema_registry.DomElementSchemaRegistry;
_StyleCompiler?: style_compiler.StyleCompiler;
StyleCompiler: typeof style_compiler.StyleCompiler;
_ViewCompiler?: view_compiler.ViewCompiler;
ViewCompiler: typeof view_compiler.ViewCompiler;
_NgModuleCompiler?: ng_module_compiler.NgModuleCompiler;
NgModuleCompiler: typeof ng_module_compiler.NgModuleCompiler;
_TypeScriptEmitter?: ts_emitter.TypeScriptEmitter;
TypeScriptEmitter: typeof ts_emitter.TypeScriptEmitter;
} = {
SelectorMatcher: selector.SelectorMatcher,
CssSelector: selector.CssSelector,
AssetUrl: path_util.AssetUrl,
ImportGenerator: path_util.ImportGenerator,
CompileMetadataResolver: metadata_resolver.CompileMetadataResolver,
HtmlParser: html_parser.HtmlParser,
InterpolationConfig: interpolation_config.InterpolationConfig,
DirectiveNormalizer: directive_normalizer.DirectiveNormalizer,
Lexer: lexer.Lexer,
Parser: parser.Parser,
ParseLocation: parse_util.ParseLocation,
ParseError: parse_util.ParseError,
ParseErrorLevel: parse_util.ParseErrorLevel,
ParseSourceFile: parse_util.ParseSourceFile,
ParseSourceSpan: parse_util.ParseSourceSpan,
TemplateParser: template_parser.TemplateParser,
DomElementSchemaRegistry: dom_element_schema_registry.DomElementSchemaRegistry,
StyleCompiler: style_compiler.StyleCompiler,
ViewCompiler: view_compiler.ViewCompiler,
NgModuleCompiler: ng_module_compiler.NgModuleCompiler,
TypeScriptEmitter: ts_emitter.TypeScriptEmitter
};

View File

@ -0,0 +1,94 @@
/**
* @license
* Copyright Google Inc. 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 {__core_private__ as r} from '@angular/core';
export const isDefaultChangeDetectionStrategy: typeof r.isDefaultChangeDetectionStrategy =
r.isDefaultChangeDetectionStrategy;
export type ChangeDetectorStatus = typeof r._ChangeDetectorStatus;
export const ChangeDetectorStatus: typeof r.ChangeDetectorStatus = r.ChangeDetectorStatus;
r.CHANGE_DETECTION_STRATEGY_VALUES;
export type LifecycleHooks = typeof r._LifecycleHooks;
export const LifecycleHooks: typeof r.LifecycleHooks = r.LifecycleHooks;
export const LIFECYCLE_HOOKS_VALUES: typeof r.LIFECYCLE_HOOKS_VALUES = r.LIFECYCLE_HOOKS_VALUES;
export type ReflectorReader = typeof r._ReflectorReader;
export const ReflectorReader: typeof r.ReflectorReader = r.ReflectorReader;
export type AppElement = typeof r._AppElement;
export const AppElement: typeof r.AppElement = r.AppElement;
export const CodegenComponentFactoryResolver: typeof r.CodegenComponentFactoryResolver =
r.CodegenComponentFactoryResolver;
export const AppView: typeof r.AppView = r.AppView;
export const DebugAppView: typeof r.DebugAppView = r.DebugAppView;
export const NgModuleInjector: typeof r.NgModuleInjector = r.NgModuleInjector;
export type ViewType = typeof r._ViewType;
export const ViewType: typeof r.ViewType = r.ViewType;
export const MAX_INTERPOLATION_VALUES: typeof r.MAX_INTERPOLATION_VALUES =
r.MAX_INTERPOLATION_VALUES;
export const checkBinding: typeof r.checkBinding = r.checkBinding;
export const flattenNestedViewRenderNodes: typeof r.flattenNestedViewRenderNodes =
r.flattenNestedViewRenderNodes;
export const interpolate: typeof r.interpolate = r.interpolate;
export const ViewUtils: typeof r.ViewUtils = r.ViewUtils;
export const DebugContext: typeof r.DebugContext = r.DebugContext;
export const StaticNodeDebugInfo: typeof r.StaticNodeDebugInfo = r.StaticNodeDebugInfo;
export const devModeEqual: typeof r.devModeEqual = r.devModeEqual;
export const UNINITIALIZED: typeof r.UNINITIALIZED = r.UNINITIALIZED;
export const ValueUnwrapper: typeof r.ValueUnwrapper = r.ValueUnwrapper;
export const TemplateRef_: typeof r.TemplateRef_ = r.TemplateRef_;
export type RenderDebugInfo = typeof r._RenderDebugInfo;
export const RenderDebugInfo: typeof r.RenderDebugInfo = r.RenderDebugInfo;
export const EMPTY_ARRAY: typeof r.EMPTY_ARRAY = r.EMPTY_ARRAY;
export const EMPTY_MAP: typeof r.EMPTY_MAP = r.EMPTY_MAP;
export const pureProxy1: typeof r.pureProxy1 = r.pureProxy1;
export const pureProxy2: typeof r.pureProxy2 = r.pureProxy2;
export const pureProxy3: typeof r.pureProxy3 = r.pureProxy3;
export const pureProxy4: typeof r.pureProxy4 = r.pureProxy4;
export const pureProxy5: typeof r.pureProxy5 = r.pureProxy5;
export const pureProxy6: typeof r.pureProxy6 = r.pureProxy6;
export const pureProxy7: typeof r.pureProxy7 = r.pureProxy7;
export const pureProxy8: typeof r.pureProxy8 = r.pureProxy8;
export const pureProxy9: typeof r.pureProxy9 = r.pureProxy9;
export const pureProxy10: typeof r.pureProxy10 = r.pureProxy10;
export const castByValue: typeof r.castByValue = r.castByValue;
export type Console = typeof r._Console;
export const Console: typeof r.Console = r.Console;
export const reflector: typeof r.reflector = r.reflector;
export const Reflector: typeof r.Reflector = r.Reflector;
export type Reflector = typeof r._Reflector;
export type ReflectionCapabilities = typeof r._ReflectionCapabilities;
export const ReflectionCapabilities: typeof r.ReflectionCapabilities = r.ReflectionCapabilities;
export type NoOpAnimationPlayer = typeof r._NoOpAnimationPlayer;
export const NoOpAnimationPlayer: typeof r.NoOpAnimationPlayer = r.NoOpAnimationPlayer;
export type AnimationPlayer = typeof r._AnimationPlayer;
export const AnimationPlayer: typeof r.AnimationPlayer = r.AnimationPlayer;
export type AnimationSequencePlayer = typeof r._AnimationSequencePlayer;
export const AnimationSequencePlayer: typeof r.AnimationSequencePlayer = r.AnimationSequencePlayer;
export type AnimationGroupPlayer = typeof r._AnimationGroupPlayer;
export const AnimationGroupPlayer: typeof r.AnimationGroupPlayer = r.AnimationGroupPlayer;
export type AnimationKeyframe = typeof r._AnimationKeyframe;
export const AnimationKeyframe: typeof r.AnimationKeyframe = r.AnimationKeyframe;
export type AnimationStyles = typeof r._AnimationStyles;
export const AnimationStyles: typeof r.AnimationStyles = r.AnimationStyles;
export type AnimationOutput = typeof r._AnimationOutput;
export const AnimationOutput: typeof r.AnimationOutput = r.AnimationOutput;
export const ANY_STATE = r.ANY_STATE;
export const DEFAULT_STATE = r.DEFAULT_STATE;
export const EMPTY_STATE = r.EMPTY_STATE;
export const FILL_STYLE_FLAG = r.FILL_STYLE_FLAG;
export const prepareFinalAnimationStyles: typeof r.prepareFinalAnimationStyles =
r.prepareFinalAnimationStyles;
export const balanceAnimationKeyframes: typeof r.balanceAnimationKeyframes =
r.balanceAnimationKeyframes;
export const clearStyles: typeof r.clearStyles = r.clearStyles;
export const collectAndResolveStyles: typeof r.collectAndResolveStyles = r.collectAndResolveStyles;
export const renderStyles: typeof r.renderStyles = r.renderStyles;
export type ViewMetadata = typeof r._ViewMetadata;
export const ViewMetadata: typeof r.ViewMetadata = r.ViewMetadata;
export type ComponentStillLoadingError = typeof r._ComponentStillLoadingError;
export const ComponentStillLoadingError: typeof r.ComponentStillLoadingError =
r.ComponentStillLoadingError;

View File

@ -7,7 +7,7 @@
*/ */
import {Compiler, ComponentFactory, Injectable, Injector, ModuleWithComponentFactories, NgModuleFactory, OptionalMetadata, Provider, SchemaMetadata, SkipSelfMetadata, Type} from '@angular/core'; import {Compiler, ComponentFactory, Injectable, Injector, ModuleWithComponentFactories, NgModuleFactory, OptionalMetadata, Provider, SchemaMetadata, SkipSelfMetadata, Type} from '@angular/core';
import {ComponentStillLoadingError} from '../core_private';
import {CompileDirectiveMetadata, CompileIdentifierMetadata, CompileNgModuleMetadata, CompilePipeMetadata, ProviderMeta, createHostComponentMeta} from './compile_metadata'; import {CompileDirectiveMetadata, CompileIdentifierMetadata, CompileNgModuleMetadata, CompilePipeMetadata, ProviderMeta, createHostComponentMeta} from './compile_metadata';
import {CompilerConfig} from './config'; import {CompilerConfig} from './config';
import {DirectiveNormalizer} from './directive_normalizer'; import {DirectiveNormalizer} from './directive_normalizer';
@ -17,6 +17,7 @@ import {NgModuleCompiler} from './ng_module_compiler';
import * as ir from './output/output_ast'; import * as ir from './output/output_ast';
import {interpretStatements} from './output/output_interpreter'; import {interpretStatements} from './output/output_interpreter';
import {jitStatements} from './output/output_jit'; import {jitStatements} from './output/output_jit';
import {ComponentStillLoadingError} from './private_import_core';
import {CompiledStylesheet, StyleCompiler} from './style_compiler'; import {CompiledStylesheet, StyleCompiler} from './style_compiler';
import {TemplateParser} from './template_parser/template_parser'; import {TemplateParser} from './template_parser/template_parser';
import {SyncAsyncResult} from './util'; import {SyncAsyncResult} from './util';

View File

@ -8,12 +8,14 @@
import {SecurityContext} from '@angular/core'; import {SecurityContext} from '@angular/core';
import {LifecycleHooks} from '../../core_private';
import {CompileDirectiveMetadata, CompileProviderMetadata, CompileTokenMetadata} from '../compile_metadata'; import {CompileDirectiveMetadata, CompileProviderMetadata, CompileTokenMetadata} from '../compile_metadata';
import {AST} from '../expression_parser/ast'; import {AST} from '../expression_parser/ast';
import {isPresent} from '../facade/lang'; import {isPresent} from '../facade/lang';
import {ParseSourceSpan} from '../parse_util'; import {ParseSourceSpan} from '../parse_util';
import {LifecycleHooks} from '../private_import_core';
/** /**
* An Abstract Syntax Tree node representing part of a parsed Angular template. * An Abstract Syntax Tree node representing part of a parsed Angular template.

View File

@ -8,13 +8,12 @@
import {Inject, Injectable, OpaqueToken, Optional, SchemaMetadata, SecurityContext} from '@angular/core'; import {Inject, Injectable, OpaqueToken, Optional, SchemaMetadata, SecurityContext} from '@angular/core';
import {Console, MAX_INTERPOLATION_VALUES} from '../../core_private';
import {CompileDirectiveMetadata, CompilePipeMetadata, CompileTokenMetadata, removeIdentifierDuplicates} from '../compile_metadata'; import {CompileDirectiveMetadata, CompilePipeMetadata, CompileTokenMetadata, removeIdentifierDuplicates} from '../compile_metadata';
import {AST, ASTWithSource, BindingPipe, EmptyExpr, Interpolation, ParserError, RecursiveAstVisitor, TemplateBinding} from '../expression_parser/ast'; import {AST, ASTWithSource, BindingPipe, EmptyExpr, Interpolation, ParserError, RecursiveAstVisitor, TemplateBinding} from '../expression_parser/ast';
import {Parser} from '../expression_parser/parser'; import {Parser} from '../expression_parser/parser';
import {ListWrapper, SetWrapper, StringMapWrapper} from '../facade/collection'; import {ListWrapper, SetWrapper, StringMapWrapper} from '../facade/collection';
import {isBlank, isPresent, isString} from '../facade/lang'; import {isBlank, isPresent, isString} from '../facade/lang';
import {HtmlParser} from '../i18n/html_parser'; import {I18NHtmlParser} from '../i18n/i18n_html_parser';
import {Identifiers, identifierToken, resolveIdentifierToken} from '../identifiers'; import {Identifiers, identifierToken, resolveIdentifierToken} from '../identifiers';
import * as html from '../ml_parser/ast'; import * as html from '../ml_parser/ast';
import {ParseTreeResult} from '../ml_parser/html_parser'; import {ParseTreeResult} from '../ml_parser/html_parser';
@ -22,6 +21,7 @@ import {expandNodes} from '../ml_parser/icu_ast_expander';
import {InterpolationConfig} from '../ml_parser/interpolation_config'; import {InterpolationConfig} from '../ml_parser/interpolation_config';
import {mergeNsAndName, splitNsName} from '../ml_parser/tags'; import {mergeNsAndName, splitNsName} from '../ml_parser/tags';
import {ParseError, ParseErrorLevel, ParseSourceSpan} from '../parse_util'; import {ParseError, ParseErrorLevel, ParseSourceSpan} from '../parse_util';
import {Console, MAX_INTERPOLATION_VALUES} from '../private_import_core';
import {ProviderElementContext, ProviderViewContext} from '../provider_analyzer'; import {ProviderElementContext, ProviderViewContext} from '../provider_analyzer';
import {ElementSchemaRegistry} from '../schema/element_schema_registry'; import {ElementSchemaRegistry} from '../schema/element_schema_registry';
import {CssSelector, SelectorMatcher} from '../selector'; import {CssSelector, SelectorMatcher} from '../selector';
@ -93,7 +93,7 @@ export class TemplateParseResult {
export class TemplateParser { export class TemplateParser {
constructor( constructor(
private _exprParser: Parser, private _schemaRegistry: ElementSchemaRegistry, private _exprParser: Parser, private _schemaRegistry: ElementSchemaRegistry,
private _htmlParser: HtmlParser, private _console: Console, private _htmlParser: I18NHtmlParser, private _console: Console,
@Optional() @Inject(TEMPLATE_TRANSFORMS) public transforms: TemplateAstVisitor[]) {} @Optional() @Inject(TEMPLATE_TRANSFORMS) public transforms: TemplateAstVisitor[]) {}
parse( parse(

View File

@ -6,7 +6,6 @@
* found in the LICENSE file at https://angular.io/license * found in the LICENSE file at https://angular.io/license
*/ */
import {ViewType} from '../../core_private';
import {CompiledAnimationTriggerResult} from '../animation/animation_compiler'; import {CompiledAnimationTriggerResult} from '../animation/animation_compiler';
import {CompileDirectiveMetadata, CompileIdentifierMetadata, CompilePipeMetadata, CompileTokenMetadata} from '../compile_metadata'; import {CompileDirectiveMetadata, CompileIdentifierMetadata, CompilePipeMetadata, CompileTokenMetadata} from '../compile_metadata';
import {CompilerConfig} from '../config'; import {CompilerConfig} from '../config';
@ -14,6 +13,7 @@ import {ListWrapper, MapWrapper} from '../facade/collection';
import {isBlank, isPresent} from '../facade/lang'; import {isBlank, isPresent} from '../facade/lang';
import {Identifiers, resolveIdentifier} from '../identifiers'; import {Identifiers, resolveIdentifier} from '../identifiers';
import * as o from '../output/output_ast'; import * as o from '../output/output_ast';
import {ViewType} from '../private_import_core';
import {createDiTokenExpression} from '../util'; import {createDiTokenExpression} from '../util';
import {CompileBinding} from './compile_binding'; import {CompileBinding} from './compile_binding';

View File

@ -8,12 +8,13 @@
import {ChangeDetectionStrategy, ViewEncapsulation} from '@angular/core'; import {ChangeDetectionStrategy, ViewEncapsulation} from '@angular/core';
import {ChangeDetectorStatus, ViewType} from '../../core_private';
import {CompileIdentifierMetadata} from '../compile_metadata'; import {CompileIdentifierMetadata} from '../compile_metadata';
import {isBlank} from '../facade/lang'; import {isBlank} from '../facade/lang';
import {Identifiers, resolveEnumIdentifier, resolveIdentifier} from '../identifiers'; import {Identifiers, resolveEnumIdentifier, resolveIdentifier} from '../identifiers';
import * as o from '../output/output_ast'; import * as o from '../output/output_ast';
import {ChangeDetectorStatus, ViewType} from '../private_import_core';
function _enumExpression(classIdentifier: CompileIdentifierMetadata, name: string): o.Expression { function _enumExpression(classIdentifier: CompileIdentifierMetadata, name: string): o.Expression {
return o.importExpr(resolveEnumIdentifier(classIdentifier, name)); return o.importExpr(resolveEnumIdentifier(classIdentifier, name));
} }

View File

@ -6,12 +6,12 @@
* found in the LICENSE file at https://angular.io/license * found in the LICENSE file at https://angular.io/license
*/ */
import {AnimationOutput} from '../../core_private';
import {CompileDirectiveMetadata} from '../compile_metadata'; import {CompileDirectiveMetadata} from '../compile_metadata';
import {ListWrapper, StringMapWrapper} from '../facade/collection'; import {ListWrapper, StringMapWrapper} from '../facade/collection';
import {StringWrapper, isBlank, isPresent} from '../facade/lang'; import {StringWrapper, isBlank, isPresent} from '../facade/lang';
import {Identifiers, identifierToken, resolveIdentifier} from '../identifiers'; import {Identifiers, identifierToken, resolveIdentifier} from '../identifiers';
import * as o from '../output/output_ast'; import * as o from '../output/output_ast';
import {AnimationOutput} from '../private_import_core';
import {BoundEventAst, DirectiveAst} from '../template_parser/template_ast'; import {BoundEventAst, DirectiveAst} from '../template_parser/template_ast';
import {CompileBinding} from './compile_binding'; import {CompileBinding} from './compile_binding';

View File

@ -6,9 +6,9 @@
* found in the LICENSE file at https://angular.io/license * found in the LICENSE file at https://angular.io/license
*/ */
import {LifecycleHooks} from '../../core_private';
import {CompileDirectiveMetadata, CompilePipeMetadata} from '../compile_metadata'; import {CompileDirectiveMetadata, CompilePipeMetadata} from '../compile_metadata';
import * as o from '../output/output_ast'; import * as o from '../output/output_ast';
import {LifecycleHooks} from '../private_import_core';
import {DirectiveAst, ProviderAst} from '../template_parser/template_ast'; import {DirectiveAst, ProviderAst} from '../template_parser/template_ast';
import {CompileElement} from './compile_element'; import {CompileElement} from './compile_element';

View File

@ -8,11 +8,11 @@
import {SecurityContext} from '@angular/core'; import {SecurityContext} from '@angular/core';
import {EMPTY_STATE as EMPTY_ANIMATION_STATE, LifecycleHooks, isDefaultChangeDetectionStrategy} from '../../core_private';
import * as cdAst from '../expression_parser/ast'; import * as cdAst from '../expression_parser/ast';
import {isBlank, isPresent} from '../facade/lang'; import {isBlank, isPresent} from '../facade/lang';
import {Identifiers, resolveIdentifier} from '../identifiers'; import {Identifiers, resolveIdentifier} from '../identifiers';
import * as o from '../output/output_ast'; import * as o from '../output/output_ast';
import {EMPTY_STATE as EMPTY_ANIMATION_STATE, LifecycleHooks, isDefaultChangeDetectionStrategy} from '../private_import_core';
import {BoundElementPropertyAst, BoundTextAst, DirectiveAst, PropertyBindingType} from '../template_parser/template_ast'; import {BoundElementPropertyAst, BoundTextAst, DirectiveAst, PropertyBindingType} from '../template_parser/template_ast';
import {camelCaseToDashCase} from '../util'; import {camelCaseToDashCase} from '../util';

View File

@ -5,9 +5,9 @@
* Use of this source code is governed by an MIT-style license that can be * 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 * found in the LICENSE file at https://angular.io/license
*/ */
import {AnimationOutput} from '../../core_private';
import {ListWrapper} from '../facade/collection'; import {ListWrapper} from '../facade/collection';
import {identifierToken} from '../identifiers'; import {identifierToken} from '../identifiers';
import {AnimationOutput} from '../private_import_core';
import {AttrAst, BoundDirectivePropertyAst, BoundElementPropertyAst, BoundEventAst, BoundTextAst, DirectiveAst, ElementAst, EmbeddedTemplateAst, NgContentAst, ReferenceAst, TemplateAst, TemplateAstVisitor, TextAst, VariableAst, templateVisitAll} from '../template_parser/template_ast'; import {AttrAst, BoundDirectivePropertyAst, BoundElementPropertyAst, BoundEventAst, BoundTextAst, DirectiveAst, ElementAst, EmbeddedTemplateAst, NgContentAst, ReferenceAst, TemplateAst, TemplateAstVisitor, TextAst, VariableAst, templateVisitAll} from '../template_parser/template_ast';
import {CompileElement, CompileNode} from './compile_element'; import {CompileElement, CompileNode} from './compile_element';

View File

@ -8,13 +8,13 @@
import {ChangeDetectionStrategy, ViewEncapsulation} from '@angular/core'; import {ChangeDetectionStrategy, ViewEncapsulation} from '@angular/core';
import {ChangeDetectorStatus, ViewType, isDefaultChangeDetectionStrategy} from '../../core_private';
import {AnimationCompiler} from '../animation/animation_compiler'; import {AnimationCompiler} from '../animation/animation_compiler';
import {CompileDirectiveMetadata, CompileIdentifierMetadata, CompileTokenMetadata, CompileTypeMetadata} from '../compile_metadata'; import {CompileDirectiveMetadata, CompileIdentifierMetadata, CompileTokenMetadata, CompileTypeMetadata} from '../compile_metadata';
import {ListWrapper, SetWrapper, StringMapWrapper} from '../facade/collection'; import {ListWrapper, SetWrapper, StringMapWrapper} from '../facade/collection';
import {StringWrapper, isPresent} from '../facade/lang'; import {StringWrapper, isPresent} from '../facade/lang';
import {Identifiers, identifierToken, resolveIdentifier, resolveIdentifierToken} from '../identifiers'; import {Identifiers, identifierToken, resolveIdentifier, resolveIdentifierToken} from '../identifiers';
import * as o from '../output/output_ast'; import * as o from '../output/output_ast';
import {ChangeDetectorStatus, ViewType, isDefaultChangeDetectionStrategy} from '../private_import_core';
import {AttrAst, BoundDirectivePropertyAst, BoundElementPropertyAst, BoundEventAst, BoundTextAst, DirectiveAst, ElementAst, EmbeddedTemplateAst, NgContentAst, ProviderAst, ReferenceAst, TemplateAst, TemplateAstVisitor, TextAst, VariableAst, templateVisitAll} from '../template_parser/template_ast'; import {AttrAst, BoundDirectivePropertyAst, BoundElementPropertyAst, BoundEventAst, BoundTextAst, DirectiveAst, ElementAst, EmbeddedTemplateAst, NgContentAst, ProviderAst, ReferenceAst, TemplateAst, TemplateAstVisitor, TextAst, VariableAst, templateVisitAll} from '../template_parser/template_ast';
import {createDiTokenExpression} from '../util'; import {createDiTokenExpression} from '../util';

View File

@ -10,11 +10,11 @@ import {AnimationAnimateMetadata, AnimationGroupMetadata, AnimationMetadata, Ani
import {AsyncTestCompleter, beforeEach, beforeEachProviders, ddescribe, describe, iit, inject, it, xdescribe, xit} from '@angular/core/testing/testing_internal'; import {AsyncTestCompleter, beforeEach, beforeEachProviders, ddescribe, describe, iit, inject, it, xdescribe, xit} from '@angular/core/testing/testing_internal';
import {expect} from '@angular/platform-browser/testing/matchers'; import {expect} from '@angular/platform-browser/testing/matchers';
import {FILL_STYLE_FLAG, flattenStyles} from '../../core_private';
import {AnimationAst, AnimationEntryAst, AnimationGroupAst, AnimationKeyframeAst, AnimationSequenceAst, AnimationStateTransitionAst, AnimationStepAst, AnimationStylesAst} from '../../src/animation/animation_ast'; import {AnimationAst, AnimationEntryAst, AnimationGroupAst, AnimationKeyframeAst, AnimationSequenceAst, AnimationStateTransitionAst, AnimationStepAst, AnimationStylesAst} from '../../src/animation/animation_ast';
import {parseAnimationEntry} from '../../src/animation/animation_parser'; import {parseAnimationEntry} from '../../src/animation/animation_parser';
import {StringMapWrapper} from '../../src/facade/collection'; import {StringMapWrapper} from '../../src/facade/collection';
import {CompileMetadataResolver} from '../../src/metadata_resolver'; import {CompileMetadataResolver} from '../../src/metadata_resolver';
import {FILL_STYLE_FLAG, flattenStyles} from '../private_import_core';
export function main() { export function main() {
describe('parseAnimationEntry', () => { describe('parseAnimationEntry', () => {

View File

@ -9,8 +9,9 @@
import {Component, ComponentMetadata, Directive, Injector} from '@angular/core'; import {Component, ComponentMetadata, Directive, Injector} from '@angular/core';
import {TestBed, inject} from '@angular/core/testing'; import {TestBed, inject} from '@angular/core/testing';
import {ViewMetadata} from '../core_private'; import {MockDirectiveResolver} from '../testing/index';
import {MockDirectiveResolver} from '../testing';
import {ViewMetadata} from './private_import_core';
export function main() { export function main() {
describe('MockDirectiveResolver', () => { describe('MockDirectiveResolver', () => {

View File

@ -20,8 +20,13 @@ class ASTValidator extends RecursiveAstVisitor {
validate(ast: AST, cb: () => void): void { validate(ast: AST, cb: () => void): void {
if (!inSpan(ast.span, this.parentSpan)) { if (!inSpan(ast.span, this.parentSpan)) {
if (this.parentSpan) {
let parentSpan = this.parentSpan as ParseSpan;
throw Error( throw Error(
`Invalid AST span [expected (${ast.span.start}, ${ast.span.end}) to be in (${this.parentSpan.start}, ${this.parentSpan.end}) for ${unparse(ast)}`); `Invalid AST span [expected (${ast.span.start}, ${ast.span.end}) to be in (${parentSpan.start}, ${parentSpan.end}) for ${unparse(ast)}`);
} else {
throw Error(`Invalid root AST span for ${unparse(ast)}`);
}
} }
const oldParent = this.parentSpan; const oldParent = this.parentSpan;
this.parentSpan = ast.span; this.parentSpan = ast.span;

View File

@ -7,7 +7,7 @@
*/ */
import {NgLocalization} from '@angular/common'; import {NgLocalization} from '@angular/common';
import {ResourceLoader, i18n} from '@angular/compiler'; import {ResourceLoader} from '@angular/compiler';
import {Component, DebugElement, TRANSLATIONS, TRANSLATIONS_FORMAT} from '@angular/core'; import {Component, DebugElement, TRANSLATIONS, TRANSLATIONS_FORMAT} from '@angular/core';
import {TestBed, async} from '@angular/core/testing'; import {TestBed, async} from '@angular/core/testing';
import {By} from '@angular/platform-browser/src/dom/debug/by'; import {By} from '@angular/platform-browser/src/dom/debug/by';

View File

@ -10,7 +10,7 @@ import {Injector, NgModule, NgModuleMetadata} from '@angular/core';
import {beforeEach, ddescribe, describe, expect, iit, inject, it} from '@angular/core/testing/testing_internal'; import {beforeEach, ddescribe, describe, expect, iit, inject, it} from '@angular/core/testing/testing_internal';
import {isBlank, stringify} from '../src/facade/lang'; import {isBlank, stringify} from '../src/facade/lang';
import {MockNgModuleResolver} from '../testing'; import {MockNgModuleResolver} from '../testing/index';
export function main() { export function main() {
describe('MockNgModuleResolver', () => { describe('MockNgModuleResolver', () => {

View File

@ -10,7 +10,7 @@ import {Injector, Pipe, PipeMetadata} from '@angular/core';
import {beforeEach, ddescribe, describe, expect, iit, inject, it} from '@angular/core/testing/testing_internal'; import {beforeEach, ddescribe, describe, expect, iit, inject, it} from '@angular/core/testing/testing_internal';
import {isBlank, stringify} from '../src/facade/lang'; import {isBlank, stringify} from '../src/facade/lang';
import {MockPipeResolver} from '../testing'; import {MockPipeResolver} from '../testing/index';
export function main() { export function main() {
describe('MockPipeResolver', () => { describe('MockPipeResolver', () => {

View File

@ -0,0 +1,15 @@
/**
* @license
* Copyright Google Inc. 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 {__core_private__ as _} from '../../core/index';
export type ViewMetadata = typeof _._ViewMetadata;
export const ViewMetadata: typeof _.ViewMetadata = _.ViewMetadata;
export const FILL_STYLE_FLAG = _.FILL_STYLE_FLAG;
export const flattenStyles: typeof _.flattenStyles = _.flattenStyles;

View File

@ -7,15 +7,15 @@
*/ */
import {DirectiveResolver, ResourceLoader} from '@angular/compiler'; import {DirectiveResolver, ResourceLoader} from '@angular/compiler';
import {MockDirectiveResolver} from '@angular/compiler/testing';
import {Compiler, Component, ComponentFactory, Injectable, Injector, Input, NgModule, NgModuleFactory, Type} from '@angular/core'; import {Compiler, Component, ComponentFactory, Injectable, Injector, Input, NgModule, NgModuleFactory, Type} from '@angular/core';
import {ComponentFixture, TestBed, async, fakeAsync, getTestBed, tick} from '@angular/core/testing'; import {ComponentFixture, TestBed, async, fakeAsync, getTestBed, tick} from '@angular/core/testing';
import {beforeEach, beforeEachProviders, ddescribe, describe, iit, inject, it, xdescribe, xit} from '@angular/core/testing/testing_internal'; import {beforeEach, beforeEachProviders, ddescribe, describe, iit, inject, it, xdescribe, xit} from '@angular/core/testing/testing_internal';
import {expect} from '@angular/platform-browser/testing/matchers'; import {expect} from '@angular/platform-browser/testing/matchers';
import {ViewMetadata} from '../core_private';
import {stringify} from '../src/facade/lang'; import {stringify} from '../src/facade/lang';
import {MockDirectiveResolver} from '../testing/index';
import {ViewMetadata} from './private_import_core';
import {SpyResourceLoader} from './spies'; import {SpyResourceLoader} from './spies';
@Component({selector: 'child-cmp'}) @Component({selector: 'child-cmp'})

View File

@ -11,7 +11,6 @@ import {DomElementSchemaRegistry} from '@angular/compiler/src/schema/dom_element
import {ElementSchemaRegistry} from '@angular/compiler/src/schema/element_schema_registry'; import {ElementSchemaRegistry} from '@angular/compiler/src/schema/element_schema_registry';
import {AttrAst, BoundDirectivePropertyAst, BoundElementPropertyAst, BoundEventAst, BoundTextAst, DirectiveAst, ElementAst, EmbeddedTemplateAst, NgContentAst, PropertyBindingType, ProviderAstType, ReferenceAst, TemplateAst, TemplateAstVisitor, TextAst, VariableAst, templateVisitAll} from '@angular/compiler/src/template_parser/template_ast'; import {AttrAst, BoundDirectivePropertyAst, BoundElementPropertyAst, BoundEventAst, BoundTextAst, DirectiveAst, ElementAst, EmbeddedTemplateAst, NgContentAst, PropertyBindingType, ProviderAstType, ReferenceAst, TemplateAst, TemplateAstVisitor, TextAst, VariableAst, templateVisitAll} from '@angular/compiler/src/template_parser/template_ast';
import {TEMPLATE_TRANSFORMS, TemplateParser, splitClasses} from '@angular/compiler/src/template_parser/template_parser'; import {TEMPLATE_TRANSFORMS, TemplateParser, splitClasses} from '@angular/compiler/src/template_parser/template_parser';
import {MockSchemaRegistry} from '@angular/compiler/testing';
import {TEST_COMPILER_PROVIDERS} from '@angular/compiler/testing/test_bindings'; import {TEST_COMPILER_PROVIDERS} from '@angular/compiler/testing/test_bindings';
import {SchemaMetadata, SecurityContext, Type} from '@angular/core'; import {SchemaMetadata, SecurityContext, Type} from '@angular/core';
import {Console} from '@angular/core/src/console'; import {Console} from '@angular/core/src/console';
@ -20,6 +19,7 @@ import {afterEach, beforeEach, beforeEachProviders, ddescribe, describe, expect,
import {Identifiers, identifierToken, resolveIdentifierToken} from '../../src/identifiers'; import {Identifiers, identifierToken, resolveIdentifierToken} from '../../src/identifiers';
import {DEFAULT_INTERPOLATION_CONFIG, InterpolationConfig} from '../../src/ml_parser/interpolation_config'; import {DEFAULT_INTERPOLATION_CONFIG, InterpolationConfig} from '../../src/ml_parser/interpolation_config';
import {MockSchemaRegistry} from '../../testing/index';
import {unparse} from '../expression_parser/unparser'; import {unparse} from '../expression_parser/unparser';
var someModuleUrl = 'package:someModule'; var someModuleUrl = 'package:someModule';

View File

@ -5,13 +5,12 @@
* Use of this source code is governed by an MIT-style license that can be * 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 * found in the LICENSE file at https://angular.io/license
*/ */
import {DirectiveResolver} from '@angular/compiler';
import {AnimationEntryMetadata, Compiler, ComponentMetadata, DirectiveMetadata, Injectable, Injector, Provider, Type, resolveForwardRef} from '@angular/core'; import {AnimationEntryMetadata, Compiler, ComponentMetadata, DirectiveMetadata, Injectable, Injector, Provider, Type, resolveForwardRef} from '@angular/core';
import {ViewMetadata} from '../core_private';
import {DirectiveResolver} from '../src/directive_resolver'; import {Map} from './facade/collection';
import {Map} from '../src/facade/collection'; import {isArray, isPresent} from './facade/lang';
import {isArray, isPresent} from '../src/facade/lang'; import {ViewMetadata} from './private_import_core';

View File

@ -0,0 +1 @@
../../facade/src

View File

@ -6,19 +6,34 @@
* found in the LICENSE file at https://angular.io/license * found in the LICENSE file at https://angular.io/license
*/ */
export * from './testing/schema_registry_mock'; /**
export * from './testing/directive_resolver_mock'; * @module
export * from './testing/ng_module_resolver_mock'; * @description
export * from './testing/pipe_resolver_mock'; * Entry point for all APIs of the compiler package.
*
* <div class="callout is-critical">
* <header>Unstable APIs</header>
* <p>
* All compiler apis are currently considered experimental and private!
* </p>
* <p>
* We expect the APIs in this package to keep on changing. Do not rely on them.
* </p>
* </div>
*/
export * from './schema_registry_mock';
export * from './directive_resolver_mock';
export * from './ng_module_resolver_mock';
export * from './pipe_resolver_mock';
import {createPlatformFactory, ModuleWithComponentFactories, Injectable, CompilerOptions, COMPILER_OPTIONS, CompilerFactory, ComponentFactory, NgModuleFactory, Injector, NgModuleMetadata, NgModuleMetadataType, ComponentMetadata, ComponentMetadataType, DirectiveMetadata, DirectiveMetadataType, PipeMetadata, PipeMetadataType, Type, PlatformRef} from '@angular/core'; import {createPlatformFactory, ModuleWithComponentFactories, Injectable, CompilerOptions, COMPILER_OPTIONS, CompilerFactory, ComponentFactory, NgModuleFactory, Injector, NgModuleMetadata, NgModuleMetadataType, ComponentMetadata, ComponentMetadataType, DirectiveMetadata, DirectiveMetadataType, PipeMetadata, PipeMetadataType, Type, PlatformRef} from '@angular/core';
import {MetadataOverride} from '@angular/core/testing'; import {MetadataOverride} from '@angular/core/testing';
import {TestingCompilerFactory, TestingCompiler} from './core_private_testing'; import {TestingCompilerFactory, TestingCompiler} from './private_import_core';
import {platformCoreDynamic, RuntimeCompiler, DirectiveResolver, NgModuleResolver, PipeResolver} from './index'; import {platformCoreDynamic, RuntimeCompiler, DirectiveResolver, NgModuleResolver, PipeResolver} from '@angular/compiler';
import {MockDirectiveResolver} from './testing/directive_resolver_mock'; import {MockDirectiveResolver} from './directive_resolver_mock';
import {MockNgModuleResolver} from './testing/ng_module_resolver_mock'; import {MockNgModuleResolver} from './ng_module_resolver_mock';
import {MockPipeResolver} from './testing/pipe_resolver_mock'; import {MockPipeResolver} from './pipe_resolver_mock';
import {MetadataOverrider} from './testing/metadata_overrider'; import {MetadataOverrider} from './metadata_overrider';
@Injectable() @Injectable()
export class TestingCompilerFactoryImpl implements TestingCompilerFactory { export class TestingCompilerFactoryImpl implements TestingCompilerFactory {

View File

@ -7,7 +7,7 @@
*/ */
import {MetadataOverride} from '@angular/core/testing'; import {MetadataOverride} from '@angular/core/testing';
import {stringify} from '../src/facade/lang'; import {stringify} from './facade/lang';
type StringMap = { type StringMap = {
[key: string]: any [key: string]: any

View File

@ -6,10 +6,10 @@
* found in the LICENSE file at https://angular.io/license * found in the LICENSE file at https://angular.io/license
*/ */
import {NgModuleResolver} from '@angular/compiler';
import {Compiler, Injectable, Injector, NgModuleMetadata, Type} from '@angular/core'; import {Compiler, Injectable, Injector, NgModuleMetadata, Type} from '@angular/core';
import {NgModuleResolver} from '../index'; import {Map} from './facade/collection';
import {Map} from '../src/facade/collection';
@Injectable() @Injectable()
export class MockNgModuleResolver extends NgModuleResolver { export class MockNgModuleResolver extends NgModuleResolver {

View File

@ -6,10 +6,10 @@
* found in the LICENSE file at https://angular.io/license * found in the LICENSE file at https://angular.io/license
*/ */
import {PipeResolver} from '@angular/compiler';
import {Compiler, Injectable, Injector, PipeMetadata, Type} from '@angular/core'; import {Compiler, Injectable, Injector, PipeMetadata, Type} from '@angular/core';
import {PipeResolver} from '../index'; import {Map} from './facade/collection';
import {Map} from '../src/facade/collection';
@Injectable() @Injectable()
export class MockPipeResolver extends PipeResolver { export class MockPipeResolver extends PipeResolver {

View File

@ -0,0 +1,23 @@
/**
* @license
* Copyright Google Inc. 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 {__core_private__ as r} from '@angular/core';
export type ViewMetadata = typeof r._ViewMetadata;
export var ViewMetadata: typeof r.ViewMetadata = r.ViewMetadata;
import {__core_private_testing__ as r2} from '@angular/core/testing';
export type TestingCompiler = typeof r2._TestingCompiler;
export var TestingCompiler: typeof r2.TestingCompiler = r2.TestingCompiler;
export type TestingCompilerFactory = typeof r2._TestingCompilerFactory;
export var TestingCompilerFactory: typeof r2.TestingCompilerFactory = r2.TestingCompilerFactory;

View File

@ -6,10 +6,10 @@
* found in the LICENSE file at https://angular.io/license * found in the LICENSE file at https://angular.io/license
*/ */
import {ResourceLoader} from '@angular/compiler';
import {ListWrapper, Map} from './facade/collection';
import {isBlank, normalizeBlank} from './facade/lang';
import {ResourceLoader} from '../index';
import {ListWrapper, Map} from '../src/facade/collection';
import {isBlank, normalizeBlank} from '../src/facade/lang';
/** /**

View File

@ -6,10 +6,10 @@
* found in the LICENSE file at https://angular.io/license * found in the LICENSE file at https://angular.io/license
*/ */
import {ElementSchemaRegistry} from '@angular/compiler';
import {SchemaMetadata, SecurityContext} from '@angular/core'; import {SchemaMetadata, SecurityContext} from '@angular/core';
import {ElementSchemaRegistry} from '../index'; import {isPresent} from './facade/lang';
import {isPresent} from '../src/facade/lang';
export class MockSchemaRegistry implements ElementSchemaRegistry { export class MockSchemaRegistry implements ElementSchemaRegistry {
constructor( constructor(

View File

@ -7,11 +7,13 @@
*/ */
import {ElementSchemaRegistry, ResourceLoader, UrlResolver} from '@angular/compiler'; import {ElementSchemaRegistry, ResourceLoader, UrlResolver} from '@angular/compiler';
import {createUrlResolverWithoutPackagePrefix} from '@angular/compiler/src/url_resolver';
import {MockSchemaRegistry} from '@angular/compiler/testing';
import {MockResourceLoader} from '@angular/compiler/testing/resource_loader_mock';
import {Provider} from '@angular/core'; import {Provider} from '@angular/core';
import {MockResourceLoader} from './resource_loader_mock';
import {MockSchemaRegistry} from './schema_registry_mock';
export function createUrlResolverWithoutPackagePrefix(): UrlResolver {
return new UrlResolver();
}
// This provider is put here just so that we can access it from multiple // This provider is put here just so that we can access it from multiple
// internal test packages. // internal test packages.

View File

@ -4,22 +4,23 @@
"declaration": true, "declaration": true,
"stripInternal": true, "stripInternal": true,
"experimentalDecorators": true, "experimentalDecorators": true,
"module": "commonjs", "module": "es2015",
"moduleResolution": "node", "moduleResolution": "node",
"outDir": "../../../dist/packages-dist/compiler/", "outDir": "../../../dist/packages-dist/compiler/",
"paths": { "paths": {
"@angular/core": ["../../../dist/packages-dist/core"], "@angular/core": ["../../../dist/packages-dist/core"],
"@angular/core/testing": ["../../../dist/packages-dist/core/testing"] "@angular/core/testing": ["../../../dist/packages-dist/core/testing"],
"@angular/compiler": ["../../../dist/packages-dist/compiler"]
}, },
"rootDir": ".", "rootDir": ".",
"sourceMap": true, "sourceMap": true,
"inlineSources": true, "inlineSources": true,
"lib": ["es6", "dom"], "lib": ["es6", "dom"],
"target": "es5" "target": "es5",
"skipLibCheck": true
}, },
"files": [ "files": [
"index.ts", "testing/index.ts",
"testing.ts",
"../../../node_modules/zone.js/dist/zone.js.d.ts" "../../../node_modules/zone.js/dist/zone.js.d.ts"
] ]
} }

View File

@ -7,7 +7,7 @@
"experimentalDecorators": true, "experimentalDecorators": true,
"module": "es2015", "module": "es2015",
"moduleResolution": "node", "moduleResolution": "node",
"outDir": "../../../dist/packages-dist/compiler/esm", "outDir": "../../../dist/packages-dist/compiler",
"paths": { "paths": {
"@angular/core": ["../../../dist/packages-dist/core"], "@angular/core": ["../../../dist/packages-dist/core"],
"@angular/core/testing": ["../../../dist/packages-dist/core/testing"] "@angular/core/testing": ["../../../dist/packages-dist/core/testing"]
@ -15,11 +15,12 @@
"rootDir": ".", "rootDir": ".",
"sourceMap": true, "sourceMap": true,
"inlineSources": true, "inlineSources": true,
"target": "es2015" "target": "es5",
"skipLibCheck": true,
"lib": ["es2015", "dom"]
}, },
"files": [ "files": [
"index.ts", "index.ts",
"testing.ts",
"../../../node_modules/zone.js/dist/zone.js.d.ts" "../../../node_modules/zone.js/dist/zone.js.d.ts"
] ]
} }

View File

@ -9,32 +9,8 @@
/** /**
* @module * @module
* @description * @description
* Entry point from which you should import all public core APIs. * Entry point for all public APIs of the core package.
*/ */
export * from './src/metadata'; export * from './src/core';
export * from './src/util';
export * from './src/di';
export {createPlatform, assertPlatform, destroyPlatform, getPlatform, PlatformRef, ApplicationRef, enableProdMode, isDevMode, createPlatformFactory} from './src/application_ref';
export {APP_ID, PACKAGE_ROOT_URL, PLATFORM_INITIALIZER, APP_BOOTSTRAP_LISTENER} from './src/application_tokens';
export {APP_INITIALIZER, ApplicationInitStatus} from './src/application_init';
export * from './src/zone';
export * from './src/render';
export * from './src/linker';
export {DebugElement, DebugNode, asNativeElements, getDebugNode} from './src/debug/debug_node';
export {GetTestability, Testability, TestabilityRegistry, setTestabilityGetter} from './src/testability/testability';
export * from './src/change_detection';
export * from './src/platform_core_providers';
export {TRANSLATIONS, TRANSLATIONS_FORMAT, LOCALE_ID} from './src/i18n/tokens';
export {ApplicationModule} from './src/application_module';
export {wtfCreateScope, wtfLeave, wtfStartTimeRange, wtfEndTimeRange, WtfScopeFn} from './src/profile/profile';
export {Type} from './src/type'; // This file only reexports content of the `src` folder. Keep it that way.
export {EventEmitter} from './src/facade/async';
export {ErrorHandler} from './src/error_handler';
export * from './private_export';
export * from './src/animation/metadata';
export {AnimationTransitionEvent} from './src/animation/animation_transition_event';
export {AnimationPlayer} from './src/animation/animation_player';
export {Sanitizer, SecurityContext} from './src/security';

View File

@ -1,15 +1,15 @@
{ {
"name": "@angular/core", "name": "@angular/core",
"version": "0.0.0-PLACEHOLDER", "version": "0.0.0-PLACEHOLDER",
"description": "", "description": "Angular 2 core",
"main": "index.js", "main": "bundles/core.umd.js",
"jsnext:main": "esm/index.js", "module": "index.js",
"typings": "index.d.ts", "typings": "index.d.ts",
"author": "angular", "author": "angular",
"license": "MIT", "license": "MIT",
"peerDependencies": { "peerDependencies": {
"rxjs": "5.0.0-beta.11", "rxjs": "5.0.0-beta.11",
"zone.js": "^0.6.6" "zone.js": "^0.6.17"
}, },
"repository": { "repository": {
"type": "git", "type": "git",

View File

@ -1,184 +0,0 @@
/**
* @license
* Copyright Google Inc. 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 {ANY_STATE as ANY_STATE_, DEFAULT_STATE as DEFAULT_STATE_, EMPTY_STATE as EMPTY_STATE_, FILL_STYLE_FLAG as FILL_STYLE_FLAG_} from './src/animation/animation_constants';
import {AnimationGroupPlayer as AnimationGroupPlayer_} from './src/animation/animation_group_player';
import {AnimationKeyframe as AnimationKeyframe_} from './src/animation/animation_keyframe';
import {AnimationOutput as AnimationOutput_} from './src/animation/animation_output';
import {AnimationPlayer as AnimationPlayer_, NoOpAnimationPlayer as NoOpAnimationPlayer_} from './src/animation/animation_player';
import {AnimationSequencePlayer as AnimationSequencePlayer_} from './src/animation/animation_sequence_player';
import * as animationUtils from './src/animation/animation_style_util';
import {AnimationStyles as AnimationStyles_} from './src/animation/animation_styles';
import * as change_detection_util from './src/change_detection/change_detection_util';
import * as constants from './src/change_detection/constants';
import * as console from './src/console';
import * as debug from './src/debug/debug_renderer';
import * as provider from './src/di/provider';
import * as reflective_provider from './src/di/reflective_provider';
import {ComponentStillLoadingError} from './src/linker/compiler';
import * as component_factory_resolver from './src/linker/component_factory_resolver';
import * as debug_context from './src/linker/debug_context';
import * as element from './src/linker/element';
import * as ng_module_factory from './src/linker/ng_module_factory';
import * as template_ref from './src/linker/template_ref';
import * as view from './src/linker/view';
import * as view_type from './src/linker/view_type';
import * as view_utils from './src/linker/view_utils';
import * as lifecycle_hooks from './src/metadata/lifecycle_hooks';
import * as metadata_view from './src/metadata/view';
import * as wtf_init from './src/profile/wtf_init';
import * as reflection from './src/reflection/reflection';
// We need to import this name separately from the above wildcard, because this symbol is exposed.
import {Reflector} from './src/reflection/reflection'; // tslint:disable-line
import * as reflection_capabilities from './src/reflection/reflection_capabilities';
import * as reflector_reader from './src/reflection/reflector_reader';
import * as api from './src/render/api';
import * as security from './src/security';
import * as decorators from './src/util/decorators';
// These generic types can't be exported within the __core_private_types__
// interface because the generic type info will be lost. So just exporting
// them separately.
export type __core_private_DebugAppView__<T> = view.DebugAppView<T>;
export type __core_private_TemplateRef__<C> = template_ref.TemplateRef_<C>;
export interface __core_private_types__ {
isDefaultChangeDetectionStrategy: typeof constants.isDefaultChangeDetectionStrategy;
ChangeDetectorStatus: constants.ChangeDetectorStatus;
CHANGE_DETECTION_STRATEGY_VALUES: typeof constants.CHANGE_DETECTION_STRATEGY_VALUES;
constructDependencies: typeof reflective_provider.constructDependencies;
LifecycleHooks: lifecycle_hooks.LifecycleHooks;
LIFECYCLE_HOOKS_VALUES: typeof lifecycle_hooks.LIFECYCLE_HOOKS_VALUES;
ReflectorReader: reflector_reader.ReflectorReader;
CodegenComponentFactoryResolver:
typeof component_factory_resolver.CodegenComponentFactoryResolver;
AppElement: element.AppElement;
AppView: typeof view.AppView;
NgModuleInjector: typeof ng_module_factory.NgModuleInjector;
ViewType: view_type.ViewType;
MAX_INTERPOLATION_VALUES: typeof view_utils.MAX_INTERPOLATION_VALUES;
checkBinding: typeof view_utils.checkBinding;
flattenNestedViewRenderNodes: typeof view_utils.flattenNestedViewRenderNodes;
interpolate: typeof view_utils.interpolate;
ViewUtils: typeof view_utils.ViewUtils;
VIEW_ENCAPSULATION_VALUES: typeof metadata_view.VIEW_ENCAPSULATION_VALUES;
ViewMetadata: metadata_view.ViewMetadata;
DebugContext: typeof debug_context.DebugContext;
StaticNodeDebugInfo: typeof debug_context.StaticNodeDebugInfo;
devModeEqual: typeof change_detection_util.devModeEqual;
UNINITIALIZED: typeof change_detection_util.UNINITIALIZED;
ValueUnwrapper: typeof change_detection_util.ValueUnwrapper;
RenderDebugInfo: api.RenderDebugInfo;
wtfInit: typeof wtf_init.wtfInit;
ReflectionCapabilities: reflection_capabilities.ReflectionCapabilities;
makeDecorator: typeof decorators.makeDecorator;
DebugDomRootRenderer: debug.DebugDomRootRenderer;
EMPTY_ARRAY: typeof view_utils.EMPTY_ARRAY;
EMPTY_MAP: typeof view_utils.EMPTY_MAP;
pureProxy1: typeof view_utils.pureProxy1;
pureProxy2: typeof view_utils.pureProxy2;
pureProxy3: typeof view_utils.pureProxy3;
pureProxy4: typeof view_utils.pureProxy4;
pureProxy5: typeof view_utils.pureProxy5;
pureProxy6: typeof view_utils.pureProxy6;
pureProxy7: typeof view_utils.pureProxy7;
pureProxy8: typeof view_utils.pureProxy8;
pureProxy9: typeof view_utils.pureProxy9;
pureProxy10: typeof view_utils.pureProxy10;
castByValue: typeof view_utils.castByValue;
Console: console.Console;
reflector: typeof reflection.reflector;
Reflector: reflection.Reflector;
NoOpAnimationPlayer: NoOpAnimationPlayer_;
AnimationPlayer: AnimationPlayer_;
AnimationSequencePlayer: AnimationSequencePlayer_;
AnimationGroupPlayer: AnimationGroupPlayer_;
AnimationKeyframe: AnimationKeyframe_;
prepareFinalAnimationStyles: typeof animationUtils.prepareFinalAnimationStyles;
balanceAnimationKeyframes: typeof animationUtils.balanceAnimationKeyframes;
flattenStyles: typeof animationUtils.flattenStyles;
clearStyles: typeof animationUtils.clearStyles;
renderStyles: typeof animationUtils.renderStyles;
collectAndResolveStyles: typeof animationUtils.collectAndResolveStyles;
AnimationStyles: AnimationStyles_;
AnimationOutput: AnimationOutput_;
ANY_STATE: typeof ANY_STATE_;
DEFAULT_STATE: typeof DEFAULT_STATE_;
EMPTY_STATE: typeof EMPTY_STATE_;
FILL_STYLE_FLAG: typeof FILL_STYLE_FLAG_;
ComponentStillLoadingError: typeof ComponentStillLoadingError;
}
export var __core_private__ = {
isDefaultChangeDetectionStrategy: constants.isDefaultChangeDetectionStrategy,
ChangeDetectorStatus: constants.ChangeDetectorStatus,
CHANGE_DETECTION_STRATEGY_VALUES: constants.CHANGE_DETECTION_STRATEGY_VALUES,
constructDependencies: reflective_provider.constructDependencies,
LifecycleHooks: lifecycle_hooks.LifecycleHooks,
LIFECYCLE_HOOKS_VALUES: lifecycle_hooks.LIFECYCLE_HOOKS_VALUES,
ReflectorReader: reflector_reader.ReflectorReader,
CodegenComponentFactoryResolver: component_factory_resolver.CodegenComponentFactoryResolver,
AppElement: element.AppElement,
AppView: view.AppView,
DebugAppView: view.DebugAppView,
NgModuleInjector: ng_module_factory.NgModuleInjector,
ViewType: view_type.ViewType,
MAX_INTERPOLATION_VALUES: view_utils.MAX_INTERPOLATION_VALUES,
checkBinding: view_utils.checkBinding,
flattenNestedViewRenderNodes: view_utils.flattenNestedViewRenderNodes,
interpolate: view_utils.interpolate,
ViewUtils: view_utils.ViewUtils,
VIEW_ENCAPSULATION_VALUES: metadata_view.VIEW_ENCAPSULATION_VALUES,
ViewMetadata: metadata_view.ViewMetadata,
DebugContext: debug_context.DebugContext,
StaticNodeDebugInfo: debug_context.StaticNodeDebugInfo,
devModeEqual: change_detection_util.devModeEqual,
UNINITIALIZED: change_detection_util.UNINITIALIZED,
ValueUnwrapper: change_detection_util.ValueUnwrapper,
RenderDebugInfo: api.RenderDebugInfo,
TemplateRef_: template_ref.TemplateRef_,
wtfInit: wtf_init.wtfInit,
ReflectionCapabilities: reflection_capabilities.ReflectionCapabilities,
makeDecorator: decorators.makeDecorator,
DebugDomRootRenderer: debug.DebugDomRootRenderer,
EMPTY_ARRAY: view_utils.EMPTY_ARRAY,
EMPTY_MAP: view_utils.EMPTY_MAP,
pureProxy1: view_utils.pureProxy1,
pureProxy2: view_utils.pureProxy2,
pureProxy3: view_utils.pureProxy3,
pureProxy4: view_utils.pureProxy4,
pureProxy5: view_utils.pureProxy5,
pureProxy6: view_utils.pureProxy6,
pureProxy7: view_utils.pureProxy7,
pureProxy8: view_utils.pureProxy8,
pureProxy9: view_utils.pureProxy9,
pureProxy10: view_utils.pureProxy10,
castByValue: view_utils.castByValue,
Console: console.Console,
reflector: reflection.reflector,
Reflector: reflection.Reflector,
NoOpAnimationPlayer: NoOpAnimationPlayer_,
AnimationPlayer: AnimationPlayer_,
AnimationSequencePlayer: AnimationSequencePlayer_,
AnimationGroupPlayer: AnimationGroupPlayer_,
AnimationKeyframe: AnimationKeyframe_,
prepareFinalAnimationStyles: animationUtils.prepareFinalAnimationStyles,
balanceAnimationKeyframes: animationUtils.balanceAnimationKeyframes,
flattenStyles: animationUtils.flattenStyles,
clearStyles: animationUtils.clearStyles,
renderStyles: animationUtils.renderStyles,
collectAndResolveStyles: animationUtils.collectAndResolveStyles,
AnimationStyles: AnimationStyles_,
AnimationOutput: AnimationOutput_,
ANY_STATE: ANY_STATE_,
DEFAULT_STATE: DEFAULT_STATE_,
EMPTY_STATE: EMPTY_STATE_,
FILL_STYLE_FLAG: FILL_STYLE_FLAG_,
ComponentStillLoadingError: ComponentStillLoadingError
};

View File

@ -1,19 +0,0 @@
/**
* @license
* Copyright Google Inc. 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 test_compiler from './testing/test_compiler';
export interface __core_private_testing_types__ {
TestingCompiler: test_compiler.TestingCompiler;
TestingCompilerFactory: test_compiler.TestingCompilerFactory;
}
export var __core_private_testing__ = {
TestingCompiler: test_compiler.TestingCompiler,
TestingCompilerFactory: test_compiler.TestingCompilerFactory,
};

View File

@ -0,0 +1,15 @@
export default {
entry: '../../../dist/packages-dist/core/testing/index.js',
dest: '../../../dist/packages-dist/core/bundles/core-testing.umd.js',
format: 'umd',
moduleName: 'ng.core.testing',
globals: {
'@angular/core': 'ng.core',
'rxjs/Subject': 'Rx',
'rxjs/observable/PromiseObservable': 'Rx', // this is wrong, but this stuff has changed in rxjs b.6 so we need to fix it when we update.
'rxjs/operator/toPromise': 'Rx.Observable.prototype',
'rxjs/Observable': 'Rx'
}
}

View File

@ -1,7 +1,7 @@
export default { export default {
entry: '../../../dist/packages-dist/core/esm/index.js', entry: '../../../dist/packages-dist/core/index.js',
dest: '../../../dist/packages-dist/core/esm/core.umd.js', dest: '../../../dist/packages-dist/core/bundles/core.umd.js',
format: 'umd', format: 'umd',
moduleName: 'ng.core', moduleName: 'ng.core',
globals: { globals: {
@ -9,9 +9,6 @@ export default {
'rxjs/observable/PromiseObservable': 'Rx', // this is wrong, but this stuff has changed in rxjs b.6 so we need to fix it when we update. 'rxjs/observable/PromiseObservable': 'Rx', // this is wrong, but this stuff has changed in rxjs b.6 so we need to fix it when we update.
'rxjs/operator/toPromise': 'Rx.Observable.prototype', 'rxjs/operator/toPromise': 'Rx.Observable.prototype',
'rxjs/Observable': 'Rx' 'rxjs/Observable': 'Rx'
}, }
plugins: [
// nodeResolve({ jsnext: true, main: true }),
]
} }

View File

@ -76,21 +76,14 @@ export function createPlatform(injector: Injector): PlatformRef {
return _platform; return _platform;
} }
/**
* Factory for a platform.
*
* @experimental
*/
export type PlatformFactory = (extraProviders?: Provider[]) => PlatformRef;
/** /**
* Creates a factory for a platform * Creates a factory for a platform
* *
* @experimental APIs related to application bootstrap are currently under review. * @experimental APIs related to application bootstrap are currently under review.
*/ */
export function createPlatformFactory( export function createPlatformFactory(
parentPlaformFactory: PlatformFactory, name: string, parentPlaformFactory: (extraProviders?: Provider[]) => PlatformRef, name: string,
providers: Provider[] = []): PlatformFactory { providers: Provider[] = []): (extraProviders?: Provider[]) => PlatformRef {
const marker = new OpaqueToken(`Platform: ${name}`); const marker = new OpaqueToken(`Platform: ${name}`);
return (extraProviders: Provider[] = []) => { return (extraProviders: Provider[] = []) => {
if (!getPlatform()) { if (!getPlatform()) {
@ -221,7 +214,7 @@ export abstract class PlatformRef {
get destroyed(): boolean { throw unimplemented(); } get destroyed(): boolean { throw unimplemented(); }
} }
function _callAndReportToExceptionHandler(errorHandler: ErrorHandler, callback: () => any): any { function _callAndReportToErrorHandler(errorHandler: ErrorHandler, callback: () => any): any {
try { try {
const result = callback(); const result = callback();
if (isPromise(result)) { if (isPromise(result)) {
@ -283,11 +276,11 @@ export class PlatformRef_ extends PlatformRef {
const moduleRef = <NgModuleInjector<M>>moduleFactory.create(ngZoneInjector); const moduleRef = <NgModuleInjector<M>>moduleFactory.create(ngZoneInjector);
const exceptionHandler: ErrorHandler = moduleRef.injector.get(ErrorHandler, null); const exceptionHandler: ErrorHandler = moduleRef.injector.get(ErrorHandler, null);
if (!exceptionHandler) { if (!exceptionHandler) {
throw new Error('No ExceptionHandler. Is platform module (BrowserModule) included?'); throw new Error('No ErrorHandler. Is platform module (BrowserModule) included?');
} }
moduleRef.onDestroy(() => ListWrapper.remove(this._modules, moduleRef)); moduleRef.onDestroy(() => ListWrapper.remove(this._modules, moduleRef));
ngZone.onError.subscribe({next: (error: any) => { exceptionHandler.handleError(error); }}); ngZone.onError.subscribe({next: (error: any) => { exceptionHandler.handleError(error); }});
return _callAndReportToExceptionHandler(exceptionHandler, () => { return _callAndReportToErrorHandler(exceptionHandler, () => {
const initStatus: ApplicationInitStatus = moduleRef.injector.get(ApplicationInitStatus); const initStatus: ApplicationInitStatus = moduleRef.injector.get(ApplicationInitStatus);
return initStatus.donePromise.then(() => { return initStatus.donePromise.then(() => {
this._moduleDoBootstrap(moduleRef); this._moduleDoBootstrap(moduleRef);

View File

@ -0,0 +1,37 @@
/**
* @license
* Copyright Google Inc. 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
*/
/**
* @module
* @description
* Entry point from which you should import all public core APIs.
*/
export * from './metadata';
export * from './util';
export * from './di';
export {createPlatform, assertPlatform, destroyPlatform, getPlatform, PlatformRef, ApplicationRef, enableProdMode, isDevMode, createPlatformFactory} from './application_ref';
export {APP_ID, PACKAGE_ROOT_URL, PLATFORM_INITIALIZER, APP_BOOTSTRAP_LISTENER} from './application_tokens';
export {APP_INITIALIZER, ApplicationInitStatus} from './application_init';
export * from './zone';
export * from './render';
export * from './linker';
export {DebugElement, DebugNode, asNativeElements, getDebugNode} from './debug/debug_node';
export {GetTestability, Testability, TestabilityRegistry, setTestabilityGetter} from './testability/testability';
export * from './change_detection';
export * from './platform_core_providers';
export {TRANSLATIONS, TRANSLATIONS_FORMAT, LOCALE_ID} from './i18n/tokens';
export {ApplicationModule} from './application_module';
export {wtfCreateScope, wtfLeave, wtfStartTimeRange, wtfEndTimeRange, WtfScopeFn} from './profile/profile';
export {Type} from './type';
export {EventEmitter} from './facade/async';
export {ErrorHandler} from './error_handler';
export * from './core_private_export';
export * from './animation/metadata';
export {AnimationTransitionEvent} from './animation/animation_transition_event';
export {AnimationPlayer} from './animation/animation_player';
export {Sanitizer, SecurityContext} from './security';

View File

@ -0,0 +1,186 @@
/**
* @license
* Copyright Google Inc. 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 {ANY_STATE as ANY_STATE_, DEFAULT_STATE as DEFAULT_STATE_, EMPTY_STATE as EMPTY_STATE_, FILL_STYLE_FLAG as FILL_STYLE_FLAG_} from './animation/animation_constants';
import {AnimationGroupPlayer as AnimationGroupPlayer_} from './animation/animation_group_player';
import {AnimationKeyframe as AnimationKeyframe_} from './animation/animation_keyframe';
import {AnimationOutput as AnimationOutput_} from './animation/animation_output';
import {AnimationPlayer as AnimationPlayer_, NoOpAnimationPlayer as NoOpAnimationPlayer_} from './animation/animation_player';
import {AnimationSequencePlayer as AnimationSequencePlayer_} from './animation/animation_sequence_player';
import * as animationUtils from './animation/animation_style_util';
import {AnimationStyles as AnimationStyles_} from './animation/animation_styles';
import * as change_detection_util from './change_detection/change_detection_util';
import * as constants from './change_detection/constants';
import * as console from './console';
import * as debug from './debug/debug_renderer';
import * as reflective_provider from './di/reflective_provider';
import {ComponentStillLoadingError} from './linker/compiler';
import * as component_factory_resolver from './linker/component_factory_resolver';
import * as debug_context from './linker/debug_context';
import * as element from './linker/element';
import * as ng_module_factory from './linker/ng_module_factory';
import * as template_ref from './linker/template_ref';
import * as view from './linker/view';
import * as view_type from './linker/view_type';
import * as view_utils from './linker/view_utils';
import * as lifecycle_hooks from './metadata/lifecycle_hooks';
import * as metadata_view from './metadata/view';
import * as reflection from './reflection/reflection';
// We need to import this name separately from the above wildcard, because this symbol is exposed.
import {Reflector} from './reflection/reflection'; // tslint:disable-line
import * as reflection_capabilities from './reflection/reflection_capabilities';
import * as reflector_reader from './reflection/reflector_reader';
import * as reflection_types from './reflection/types';
import * as api from './render/api';
import * as decorators from './util/decorators';
export var __core_private__: {
isDefaultChangeDetectionStrategy: typeof constants.isDefaultChangeDetectionStrategy,
ChangeDetectorStatus: typeof constants.ChangeDetectorStatus,
_ChangeDetectorStatus?: constants.ChangeDetectorStatus,
CHANGE_DETECTION_STRATEGY_VALUES: typeof constants.CHANGE_DETECTION_STRATEGY_VALUES,
constructDependencies: typeof reflective_provider.constructDependencies,
LifecycleHooks: typeof lifecycle_hooks.LifecycleHooks,
_LifecycleHooks?: lifecycle_hooks.LifecycleHooks,
LIFECYCLE_HOOKS_VALUES: typeof lifecycle_hooks.LIFECYCLE_HOOKS_VALUES,
ReflectorReader: typeof reflector_reader.ReflectorReader,
_ReflectorReader?: reflector_reader.ReflectorReader,
_SetterFn?: reflection_types.SetterFn;
_GetterFn?: reflection_types.GetterFn;
_MethodFn?: reflection_types.MethodFn;
CodegenComponentFactoryResolver:
typeof component_factory_resolver.CodegenComponentFactoryResolver,
_CodegenComponentFactoryResolver?: component_factory_resolver.CodegenComponentFactoryResolver,
AppElement: typeof element.AppElement, _AppElement?: element.AppElement,
AppView: typeof view.AppView, _AppView?: view.AppView<any>,
DebugAppView: typeof view.DebugAppView, _DebugAppView?: view.DebugAppView<any>,
NgModuleInjector: typeof ng_module_factory.NgModuleInjector,
_NgModuleInjector?: ng_module_factory.NgModuleInjector<any>,
ViewType: typeof view_type.ViewType, _ViewType?: view_type.ViewType,
MAX_INTERPOLATION_VALUES: typeof view_utils.MAX_INTERPOLATION_VALUES,
checkBinding: typeof view_utils.checkBinding,
flattenNestedViewRenderNodes: typeof view_utils.flattenNestedViewRenderNodes,
interpolate: typeof view_utils.interpolate,
ViewUtils: typeof view_utils.ViewUtils, _ViewUtils?: view_utils.ViewUtils,
VIEW_ENCAPSULATION_VALUES: typeof metadata_view.VIEW_ENCAPSULATION_VALUES,
ViewMetadata: typeof metadata_view.ViewMetadata, _ViewMetadata?: metadata_view.ViewMetadata,
DebugContext: typeof debug_context.DebugContext, _DebugContext?: debug_context.DebugContext,
StaticNodeDebugInfo: typeof debug_context.StaticNodeDebugInfo,
_StaticNodeDebugInfo?: debug_context.StaticNodeDebugInfo,
devModeEqual: typeof change_detection_util.devModeEqual,
UNINITIALIZED: typeof change_detection_util.UNINITIALIZED,
ValueUnwrapper: typeof change_detection_util.ValueUnwrapper,
_ValueUnwrapper?: change_detection_util.ValueUnwrapper,
RenderDebugInfo: typeof api.RenderDebugInfo, _RenderDebugInfo?: api.RenderDebugInfo,
TemplateRef_: typeof template_ref.TemplateRef_, _TemplateRef_?: template_ref.TemplateRef_<any>,
ReflectionCapabilities: typeof reflection_capabilities.ReflectionCapabilities,
_ReflectionCapabilities?: reflection_capabilities.ReflectionCapabilities,
makeDecorator: typeof decorators.makeDecorator,
DebugDomRootRenderer: typeof debug.DebugDomRootRenderer,
_DebugDomRootRenderer?: debug.DebugDomRootRenderer,
EMPTY_ARRAY: typeof view_utils.EMPTY_ARRAY,
EMPTY_MAP: typeof view_utils.EMPTY_MAP,
pureProxy1: typeof view_utils.pureProxy1,
pureProxy2: typeof view_utils.pureProxy2,
pureProxy3: typeof view_utils.pureProxy3,
pureProxy4: typeof view_utils.pureProxy4,
pureProxy5: typeof view_utils.pureProxy5,
pureProxy6: typeof view_utils.pureProxy6,
pureProxy7: typeof view_utils.pureProxy7,
pureProxy8: typeof view_utils.pureProxy8,
pureProxy9: typeof view_utils.pureProxy9,
pureProxy10: typeof view_utils.pureProxy10,
castByValue: typeof view_utils.castByValue,
Console: typeof console.Console, _Console?: console.Console,
reflector: typeof reflection.reflector,
Reflector: typeof reflection.Reflector, _Reflector?: reflection.Reflector,
NoOpAnimationPlayer: typeof NoOpAnimationPlayer_, _NoOpAnimationPlayer?: NoOpAnimationPlayer_,
AnimationPlayer: typeof AnimationPlayer_, _AnimationPlayer?: AnimationPlayer_,
AnimationSequencePlayer: typeof AnimationSequencePlayer_,
_AnimationSequencePlayer?: AnimationSequencePlayer_,
AnimationGroupPlayer: typeof AnimationGroupPlayer_, _AnimationGroupPlayer?: AnimationGroupPlayer_,
AnimationKeyframe: typeof AnimationKeyframe_, _AnimationKeyframe?: AnimationKeyframe_,
prepareFinalAnimationStyles: typeof animationUtils.prepareFinalAnimationStyles,
balanceAnimationKeyframes: typeof animationUtils.balanceAnimationKeyframes,
flattenStyles: typeof animationUtils.flattenStyles,
clearStyles: typeof animationUtils.clearStyles,
renderStyles: typeof animationUtils.renderStyles,
collectAndResolveStyles: typeof animationUtils.collectAndResolveStyles,
AnimationStyles: typeof AnimationStyles_, _AnimationStyles?: AnimationStyles_,
AnimationOutput: typeof AnimationOutput_, _AnimationOutput?: AnimationOutput_,
ANY_STATE: typeof ANY_STATE_,
DEFAULT_STATE: typeof DEFAULT_STATE_,
EMPTY_STATE: typeof EMPTY_STATE_,
FILL_STYLE_FLAG: typeof FILL_STYLE_FLAG_, _ComponentStillLoadingError?: ComponentStillLoadingError
ComponentStillLoadingError: typeof ComponentStillLoadingError
} = {
isDefaultChangeDetectionStrategy: constants.isDefaultChangeDetectionStrategy,
ChangeDetectorStatus: constants.ChangeDetectorStatus,
CHANGE_DETECTION_STRATEGY_VALUES: constants.CHANGE_DETECTION_STRATEGY_VALUES,
constructDependencies: reflective_provider.constructDependencies,
LifecycleHooks: lifecycle_hooks.LifecycleHooks,
LIFECYCLE_HOOKS_VALUES: lifecycle_hooks.LIFECYCLE_HOOKS_VALUES,
ReflectorReader: reflector_reader.ReflectorReader,
CodegenComponentFactoryResolver: component_factory_resolver.CodegenComponentFactoryResolver,
AppElement: element.AppElement,
AppView: view.AppView,
DebugAppView: view.DebugAppView,
NgModuleInjector: ng_module_factory.NgModuleInjector,
ViewType: view_type.ViewType,
MAX_INTERPOLATION_VALUES: view_utils.MAX_INTERPOLATION_VALUES,
checkBinding: view_utils.checkBinding,
flattenNestedViewRenderNodes: view_utils.flattenNestedViewRenderNodes,
interpolate: view_utils.interpolate,
ViewUtils: view_utils.ViewUtils,
VIEW_ENCAPSULATION_VALUES: metadata_view.VIEW_ENCAPSULATION_VALUES,
ViewMetadata: metadata_view.ViewMetadata,
DebugContext: debug_context.DebugContext,
StaticNodeDebugInfo: debug_context.StaticNodeDebugInfo,
devModeEqual: change_detection_util.devModeEqual,
UNINITIALIZED: change_detection_util.UNINITIALIZED,
ValueUnwrapper: change_detection_util.ValueUnwrapper,
RenderDebugInfo: api.RenderDebugInfo,
TemplateRef_: template_ref.TemplateRef_,
ReflectionCapabilities: reflection_capabilities.ReflectionCapabilities,
makeDecorator: decorators.makeDecorator,
DebugDomRootRenderer: debug.DebugDomRootRenderer,
EMPTY_ARRAY: view_utils.EMPTY_ARRAY,
EMPTY_MAP: view_utils.EMPTY_MAP,
pureProxy1: view_utils.pureProxy1,
pureProxy2: view_utils.pureProxy2,
pureProxy3: view_utils.pureProxy3,
pureProxy4: view_utils.pureProxy4,
pureProxy5: view_utils.pureProxy5,
pureProxy6: view_utils.pureProxy6,
pureProxy7: view_utils.pureProxy7,
pureProxy8: view_utils.pureProxy8,
pureProxy9: view_utils.pureProxy9,
pureProxy10: view_utils.pureProxy10,
castByValue: view_utils.castByValue,
Console: console.Console,
reflector: reflection.reflector,
Reflector: reflection.Reflector,
NoOpAnimationPlayer: NoOpAnimationPlayer_,
AnimationPlayer: AnimationPlayer_,
AnimationSequencePlayer: AnimationSequencePlayer_,
AnimationGroupPlayer: AnimationGroupPlayer_,
AnimationKeyframe: AnimationKeyframe_,
prepareFinalAnimationStyles: animationUtils.prepareFinalAnimationStyles,
balanceAnimationKeyframes: animationUtils.balanceAnimationKeyframes,
flattenStyles: animationUtils.flattenStyles,
clearStyles: animationUtils.clearStyles,
renderStyles: animationUtils.renderStyles,
collectAndResolveStyles: animationUtils.collectAndResolveStyles,
AnimationStyles: AnimationStyles_,
AnimationOutput: AnimationOutput_,
ANY_STATE: ANY_STATE_,
DEFAULT_STATE: DEFAULT_STATE_,
EMPTY_STATE: EMPTY_STATE_,
FILL_STYLE_FLAG: FILL_STYLE_FLAG_,
ComponentStillLoadingError: ComponentStillLoadingError
};

View File

@ -19,7 +19,7 @@ import {WrappedError} from './facade/errors';
* *
* ```javascript * ```javascript
* *
* class MyExceptionHandler implements ErrorHandler { * class MyErrorHandler implements ErrorHandler {
* call(error, stackTrace = null, reason = null) { * call(error, stackTrace = null, reason = null) {
* // do something with the exception * // do something with the exception
* } * }

View File

@ -176,7 +176,7 @@ export function main() {
return defaultPlatform.bootstrapModule(EmptyModule) return defaultPlatform.bootstrapModule(EmptyModule)
.then(() => fail('expecting error'), (error) => { .then(() => fail('expecting error'), (error) => {
expect(error.message) expect(error.message)
.toEqual('No ExceptionHandler. Is platform module (BrowserModule) included?'); .toEqual('No ErrorHandler. Is platform module (BrowserModule) included?');
}); });
})); }));

View File

@ -7,7 +7,6 @@
*/ */
import {ElementSchemaRegistry} from '@angular/compiler/src/schema/element_schema_registry'; import {ElementSchemaRegistry} from '@angular/compiler/src/schema/element_schema_registry';
import {MockSchemaRegistry} from '@angular/compiler/testing';
import {TEST_COMPILER_PROVIDERS} from '@angular/compiler/testing/test_bindings'; import {TEST_COMPILER_PROVIDERS} from '@angular/compiler/testing/test_bindings';
import {AfterContentChecked, AfterContentInit, AfterViewChecked, AfterViewInit, ChangeDetectionStrategy, ChangeDetectorRef, Component, ComponentMetadata, DebugElement, Directive, DoCheck, Injectable, Input, OnChanges, OnDestroy, OnInit, Output, Pipe, PipeTransform, RenderComponentType, Renderer, RootRenderer, SimpleChange, SimpleChanges, TemplateRef, Type, ViewContainerRef, WrappedValue, forwardRef} from '@angular/core'; import {AfterContentChecked, AfterContentInit, AfterViewChecked, AfterViewInit, ChangeDetectionStrategy, ChangeDetectorRef, Component, ComponentMetadata, DebugElement, Directive, DoCheck, Injectable, Input, OnChanges, OnDestroy, OnInit, Output, Pipe, PipeTransform, RenderComponentType, Renderer, RootRenderer, SimpleChange, SimpleChanges, TemplateRef, Type, ViewContainerRef, WrappedValue, forwardRef} from '@angular/core';
import {DebugDomRenderer} from '@angular/core/src/debug/debug_renderer'; import {DebugDomRenderer} from '@angular/core/src/debug/debug_renderer';
@ -16,6 +15,7 @@ import {By} from '@angular/platform-browser/src/dom/debug/by';
import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter'; import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
import {DomRootRenderer} from '@angular/platform-browser/src/dom/dom_renderer'; import {DomRootRenderer} from '@angular/platform-browser/src/dom/dom_renderer';
import {MockSchemaRegistry} from '../../../compiler/testing/index';
import {EventEmitter} from '../../src/facade/async'; import {EventEmitter} from '../../src/facade/async';
import {StringMapWrapper} from '../../src/facade/collection'; import {StringMapWrapper} from '../../src/facade/collection';
import {NumberWrapper, isBlank} from '../../src/facade/lang'; import {NumberWrapper, isBlank} from '../../src/facade/lang';

View File

@ -1,16 +0,0 @@
/**
* @license
* Copyright Google Inc. 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 * from './testing/async';
export * from './testing/component_fixture';
export * from './testing/fake_async';
export * from './testing/test_bed';
export * from './testing/testing';
export * from './testing/metadata_override';
export * from './private_export_testing';

View File

@ -6,10 +6,8 @@
* found in the LICENSE file at https://angular.io/license * found in the LICENSE file at https://angular.io/license
*/ */
import {ChangeDetectorRef, ComponentRef, DebugElement, ElementRef, NgZone, getDebugNode} from '../index'; import {ChangeDetectorRef, ComponentRef, DebugElement, ElementRef, NgZone, getDebugNode} from '@angular/core';
import {scheduleMicroTask} from '../src/facade/lang'; import {scheduleMicroTask} from './facade/lang';
import {tick} from './fake_async';
/** /**

View File

@ -0,0 +1 @@
../../facade/src

View File

@ -7,7 +7,6 @@
*/ */
const FakeAsyncTestZoneSpec = (Zone as any)['FakeAsyncTestZoneSpec']; const FakeAsyncTestZoneSpec = (Zone as any)['FakeAsyncTestZoneSpec'];
type ProxyZoneSpec = { type ProxyZoneSpec = {
setDelegate(delegateSpec: ZoneSpec): void; getDelegate(): ZoneSpec; resetDelegate(): void; setDelegate(delegateSpec: ZoneSpec): void; getDelegate(): ZoneSpec; resetDelegate(): void;
@ -87,6 +86,7 @@ export function fakeAsync(fn: Function): (...args: any[]) => any {
return res; return res;
} finally { } finally {
_inFakeAsyncCall = false; _inFakeAsyncCall = false;
resetFakeAsyncZone();
} }
}; };
} }

View File

@ -6,11 +6,16 @@
* found in the LICENSE file at https://angular.io/license * found in the LICENSE file at https://angular.io/license
*/ */
/**
* @module
* @description
* Entry point for all public APIs of the core/testing package.
*/
export * from './async'; export * from './async';
export * from './component_fixture'; export * from './component_fixture';
export * from './fake_async'; export * from './fake_async';
export * from './test_bed'; export * from './test_bed';
export * from './testing'; export * from './testing';
export * from './metadata_override'; export * from './metadata_override';
export * from './private_export_testing';
export * from '../private_export_testing';

View File

@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.io/license * found in the LICENSE file at https://angular.io/license
*/ */
import {Injectable} from '../index'; import {Injectable} from '@angular/core';
@Injectable() @Injectable()
export class Log { export class Log {

View File

@ -6,8 +6,8 @@
* found in the LICENSE file at https://angular.io/license * found in the LICENSE file at https://angular.io/license
*/ */
import {AnimationPlayer} from '../src/animation/animation_player'; import {AnimationPlayer} from '@angular/core';
import {isPresent} from '../src/facade/lang'; import {isPresent} from './facade/lang';
export class MockAnimationPlayer implements AnimationPlayer { export class MockAnimationPlayer implements AnimationPlayer {
private _onDoneFns: Function[] = []; private _onDoneFns: Function[] = [];

View File

@ -6,8 +6,8 @@
* found in the LICENSE file at https://angular.io/license * found in the LICENSE file at https://angular.io/license
*/ */
import {Injectable, NgZone} from '../index'; import {Injectable, NgZone} from '@angular/core';
import {EventEmitter} from '../src/facade/async'; import {EventEmitter} from './facade/async';
/** /**
* A mock implementation of {@link NgZone}. * A mock implementation of {@link NgZone}.

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