diff --git a/.pullapprove.yml b/.pullapprove.yml index 8ced9e7721..200c6f06fd 100644 --- a/.pullapprove.yml +++ b/.pullapprove.yml @@ -87,7 +87,7 @@ groups: core: conditions: files: - - "modules/@angular/core/*" + - "packages/core/*" users: - tbosch #primary - mhevery @@ -97,7 +97,7 @@ groups: compiler/animations: conditions: files: - - "modules/@angular/compiler/src/animation/*" + - "packages/compiler/src/animation/*" users: - matsko #primary - tbosch @@ -107,7 +107,7 @@ groups: compiler/i18n: conditions: files: - - "modules/@angular/compiler/src/i18n/*" + - "packages/compiler/src/i18n/*" users: - vicb #primary - tbosch @@ -117,7 +117,7 @@ groups: compiler: conditions: files: - - "modules/@angular/compiler/*" + - "packages/compiler/*" users: - tbosch #primary - vicb @@ -129,7 +129,7 @@ groups: conditions: files: - "tools/@angular/tsc-wrapped/*" - - "modules/@angular/compiler-cli/*" + - "packages/compiler-cli/*" users: - alexeagle - chuckjaz @@ -140,7 +140,7 @@ groups: common: conditions: files: - - "modules/@angular/common/*" + - "packages/common/*" users: - pkozlowski-opensource #primary - vicb @@ -150,7 +150,7 @@ groups: forms: conditions: files: - - "modules/@angular/forms/*" + - "packages/forms/*" users: - kara #primary # needs secondary @@ -160,7 +160,7 @@ groups: http: conditions: files: - - "modules/@angular/http/*" + - "packages/http/*" users: - vikerman #primary - alxhub @@ -170,7 +170,7 @@ groups: language-service: conditions: files: - - "modules/@angular/language-service/*" + - "packages/language-service/*" users: - chuckjaz #primary # needs secondary @@ -180,7 +180,7 @@ groups: router: conditions: files: - - "modules/@angular/router/*" + - "packages/router/*" users: - vicb #primary # needs secondary @@ -190,7 +190,7 @@ groups: upgrade: conditions: files: - - "modules/@angular/upgrade/*" + - "packages/upgrade/*" users: - petebacondarwin #primary - gkalpak @@ -200,7 +200,7 @@ groups: platform-browser: conditions: files: - - "modules/@angular/platform-browser/*" + - "packages/platform-browser/*" users: - tbosch #primary - vicb #secondary @@ -210,7 +210,7 @@ groups: platform-server: conditions: files: - - "modules/@angular/platform-server/*" + - "packages/platform-server/*" users: - vikerman #primary - alxhub @@ -222,7 +222,7 @@ groups: platform-webworker: conditions: files: - - "modules/@angular/platform-webworker/*" + - "packages/platform-webworker/*" users: - vicb #primary - tbosch #secondary @@ -234,7 +234,7 @@ groups: benchpress: conditions: files: - - "modules/@angular/benchpress/*" + - "packages/benchpress/*" users: - tbosch #primary # needs secondary diff --git a/CHANGELOG.md b/CHANGELOG.md index bb972ae157..638daf8833 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2020,7 +2020,7 @@ prefix using `animate-` must now be preixed using `bind-animate-`. ### ROUTER CHANGE LOG -[You can find the router changelog here.](https://github.com/angular/angular/blob/master/modules/@angular/router/CHANGELOG.md) +[You can find the router changelog here.](https://github.com/angular/angular/blob/master/packages/router/CHANGELOG.md) # [2.0.0-rc.4](https://github.com/angular/angular/compare/2.0.0-rc.3...2.0.0-rc.4) (2016-06-30) diff --git a/aio/content/examples/testing/ts/app-specs.plnkr.no-link.html b/aio/content/examples/testing/ts/app-specs.plnkr.no-link.html index 63c497e00e..6676c8179a 100644 --- a/aio/content/examples/testing/ts/app-specs.plnkr.no-link.html +++ b/aio/content/examples/testing/ts/app-specs.plnkr.no-link.html @@ -416,14 +416,14 @@ can be found in the LICENSE file at http://angular.io/license -"> \ No newline at end of file +"> diff --git a/aio/content/examples/testing/ts/src/app/app.component.router.spec.ts b/aio/content/examples/testing/ts/src/app/app.component.router.spec.ts index de22db8ceb..dac70d8fb6 100644 --- a/aio/content/examples/testing/ts/src/app/app.component.router.spec.ts +++ b/aio/content/examples/testing/ts/src/app/app.component.router.spec.ts @@ -1,5 +1,5 @@ // For more examples: -// https://github.com/angular/angular/blob/master/modules/@angular/router/test/integration.spec.ts +// https://github.com/angular/angular/blob/master/packages/router/test/integration.spec.ts import { async, ComponentFixture, fakeAsync, TestBed, tick, } from '@angular/core/testing'; diff --git a/integration/README.md b/integration/README.md index 1ae678187b..b189c02834 100644 --- a/integration/README.md +++ b/integration/README.md @@ -43,7 +43,7 @@ See the `package.json` of the test(s) you're debugging, to see which dist/ folde Then run the right `tsc --watch` command to keep those dist folders up-to-date, for example: ``` -$ ./node_modules/.bin/tsc -p modules/@angular/core/tsconfig-build.json --watch +$ ./node_modules/.bin/tsc -p packages/core/tsconfig-build.json --watch ``` Now you can run the integration test, it will re-install from the dist/ folder on each run. diff --git a/karma-js.conf.js b/karma-js.conf.js index 6f387139d2..7934b136a3 100644 --- a/karma-js.conf.js +++ b/karma-js.conf.js @@ -42,13 +42,9 @@ module.exports = function(config) { 'tools/build/file2modulename.js', 'test-main.js', {pattern: 'dist/all/empty.*', included: false, watched: false}, + {pattern: 'packages/platform-browser/test/static_assets/**', included: false, watched: false}, { - pattern: 'modules/@angular/platform-browser/test/static_assets/**', - included: false, - watched: false - }, - { - pattern: 'modules/@angular/platform-browser/test/browser/static_assets/**', + pattern: 'packages/platform-browser/test/browser/static_assets/**', included: false, watched: false, } diff --git a/modules/empty.ts b/modules/empty.ts new file mode 100644 index 0000000000..540a7a0ad7 --- /dev/null +++ b/modules/empty.ts @@ -0,0 +1,12 @@ +/** + * @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 + */ + +// This file intentionally left blank. It is used to load nothing in some cases. +// Such as parse5/index is redirected here instead of loading into browser. + +export let __empty__: any; diff --git a/modules/es6-subset.d.ts b/modules/es6-subset.d.ts new file mode 100644 index 0000000000..caef53e496 --- /dev/null +++ b/modules/es6-subset.d.ts @@ -0,0 +1,65 @@ + +/** + * Subset of lib.es2015.core.d.ts typings. + * Angular should not require use of ES6 runtime but some API usages are already present. + * See https://github.com/angular/angular/issues/5242 + * TODO(alexeagle): remove methods below which may not be present in targeted browser + */ + +interface String { + /** + * Returns true if the sequence of elements of searchString converted to a String is the + * same as the corresponding elements of this object (converted to a String) starting at + * position. Otherwise returns false. + */ + startsWith(searchString: string, position?: number): boolean; + + /** + * Returns true if the sequence of elements of searchString converted to a String is the + * same as the corresponding elements of this object (converted to a String) starting at + * endPosition – length(this). Otherwise returns false. + */ + endsWith(searchString: string, endPosition?: number): boolean; +} + +interface Array { + /** + * Returns the value of the first element in the array where predicate is true, and undefined + * otherwise. + * @param predicate find calls predicate once for each element of the array, in ascending + * order, until it finds one where predicate returns true. If such an element is found, find + * immediately returns that element value. Otherwise, find returns undefined. + * @param thisArg If provided, it will be used as the this value for each invocation of + * predicate. If it is not provided, undefined is used instead. + */ + find(predicate: (value: T, index: number, obj: Array) => boolean, thisArg?: any): T; + /** + * Returns the this object after filling the section identified by start and end with value + * @param value value to fill array section with + * @param start index to start filling the array at. If start is negative, it is treated as + * length+start where length is the length of the array. + * @param end index to stop filling the array at. If end is negative, it is treated as + * length+end. + */ + fill(value: T, start?: number, end?: number): T[]; +} + +interface NumberConstructor { + /** + * Returns true if the value passed is an integer, false otherwise. + * @param number A numeric value. + */ + isInteger(number: number): boolean; +} + +// Workaround https://github.com/Microsoft/TypeScript/issues/9193 +interface PromiseConstructor { + all(values: (T|PromiseLike)[]): Promise; +} + +interface Function { + /** + * Returns the name of the function. Function names are read-only and can not be changed. + */ + readonly name: string; +} diff --git a/modules/system.d.ts b/modules/system.d.ts new file mode 100644 index 0000000000..f94cec235e --- /dev/null +++ b/modules/system.d.ts @@ -0,0 +1,4 @@ +/** + * Dummy typings for systemjs. + */ +declare var System: any; diff --git a/modules/tsconfig.json b/modules/tsconfig.json new file mode 100644 index 0000000000..fb8de06ce6 --- /dev/null +++ b/modules/tsconfig.json @@ -0,0 +1,36 @@ +{ + "compilerOptions": { + "baseUrl": ".", + "declaration": true, + "experimentalDecorators": true, + "emitDecoratorMetadata": true, + "module": "commonjs", + "moduleResolution": "node", + "outDir": "../dist/all/", + "noImplicitAny": true, + "noFallthroughCasesInSwitch": true, + "paths": { + "selenium-webdriver": ["../node_modules/@types/selenium-webdriver/index.d.ts"], + "rxjs/*": ["../node_modules/rxjs/*"], + "@angular/*": ["../dist/all/@angular/*"], + "@angular/tsc-wrapped": ["../dist/tools/@angular/tsc-wrapped"], + "@angular/tsc-wrapped/*": ["../dist/tools/@angular/tsc-wrapped/*"] + }, + "rootDir": ".", + "inlineSourceMap": true, + "lib": ["es5", "dom", "es2015.promise", "es2015.collection", "es2015.iterable"], + "skipDefaultLibCheck": true, + "skipLibCheck": true, + "target": "es5", + "types": ["angularjs"] + }, + "exclude": [ + "angular1_router", + "benchmarks/e2e_test/old", + "benchmarks/src/old", + "benchmarks/src/**/index_aot.ts", + "benchmarks_external", + "payload_tests", + "rollup-test" + ] +} diff --git a/modules/types.d.ts b/modules/types.d.ts new file mode 100644 index 0000000000..009398d12f --- /dev/null +++ b/modules/types.d.ts @@ -0,0 +1,17 @@ +/** + * @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 + */ + +// This file contains all ambient imports needed to compile the modules/ source code + +/// +/// +/// +/// +/// +/// +/// diff --git a/packages/benchpress/package.json b/packages/benchpress/package.json index 1bf937ac41..a01e9bcc35 100644 --- a/packages/benchpress/package.json +++ b/packages/benchpress/package.json @@ -27,5 +27,5 @@ "bugs": { "url": "https://github.com/angular/angular/issues" }, - "homepage": "https://github.com/angular/angular/tree/master/modules/@angular/compiler-cli" + "homepage": "https://github.com/angular/angular/tree/master/packages/compiler-cli" } diff --git a/packages/benchpress/publish.sh b/packages/benchpress/publish.sh index be33c0034f..2b17befcf5 100755 --- a/packages/benchpress/publish.sh +++ b/packages/benchpress/publish.sh @@ -4,7 +4,7 @@ set -ex cd $(dirname $0)/../../.. ROOTDIR=$(pwd) -SRCDIR=${ROOTDIR}/modules/@angular/benchpress +SRCDIR=${ROOTDIR}/packages/benchpress DESTDIR=${ROOTDIR}/dist/packages-dist/benchpress rm -fr ${DESTDIR} diff --git a/packages/common/testing/package.json b/packages/common/testing/package.json index eaa79d5679..5611599bf6 100644 --- a/packages/common/testing/package.json +++ b/packages/common/testing/package.json @@ -1,5 +1,5 @@ { - "typings": "../typings/testing.d.ts", + "typings": "../typings/testing/index.d.ts", "main": "../bundles/common-testing.umd.js", "module": "../@angular/common/testing.es5.js", "es2015": "../@angular/common/testing.js" diff --git a/packages/compiler-cli/README.md b/packages/compiler-cli/README.md index de0967ca61..d7817ef0e2 100644 --- a/packages/compiler-cli/README.md +++ b/packages/compiler-cli/README.md @@ -128,11 +128,11 @@ $ cp tools/@angular/tsc-wrapped/package.json dist/tools/@angular/tsc-wrapped $ ./scripts/ci/offline_compiler_test.sh # Keep a package fresh in watch mode -./node_modules/.bin/tsc -p modules/@angular/compiler/tsconfig-es5.json -w +./node_modules/.bin/tsc -p packages/compiler/tsconfig-build.json -w # Recompile @angular/core module (needs to use tsc-ext to keep the metadata) $ export NODE_PATH=${NODE_PATH}:$(pwd)/dist/all:$(pwd)/dist/tools -$ node dist/tools/@angular/tsc-wrapped/src/main -p modules/@angular/core/tsconfig-es5.json +$ node dist/tools/@angular/tsc-wrapped/src/main -p packages/core/tsconfig-build.json # Iterate on the test $ cd /tmp/wherever/e2e_test.1464388257/ diff --git a/packages/compiler-cli/package.json b/packages/compiler-cli/package.json index f10e12332c..cdba30fb95 100644 --- a/packages/compiler-cli/package.json +++ b/packages/compiler-cli/package.json @@ -34,5 +34,5 @@ "bugs": { "url": "https://github.com/angular/angular/issues" }, - "homepage": "https://github.com/angular/angular/tree/master/modules/@angular/compiler-cli" + "homepage": "https://github.com/angular/angular/tree/master/packages/compiler-cli" } diff --git a/packages/compiler/testing/package.json b/packages/compiler/testing/package.json index aeef9999f3..46beb8e2f2 100644 --- a/packages/compiler/testing/package.json +++ b/packages/compiler/testing/package.json @@ -1,5 +1,5 @@ { - "typings": "../typings/testing.d.ts", + "typings": "../typings/testing/index.d.ts", "main": "../bundles/compiler-testing.umd.js", "module": "../@angular/compiler/testing.es5.js", "es2015": "../@angular/compiler/testing.js" diff --git a/packages/core/testing/package.json b/packages/core/testing/package.json index e760e1b2fa..2429a97862 100644 --- a/packages/core/testing/package.json +++ b/packages/core/testing/package.json @@ -1,5 +1,5 @@ { - "typings": "../typings/testing.d.ts", + "typings": "../typings/testing/index.d.ts", "main": "../bundles/core-testing.umd.js", "module": "../@angular/core/testing.es5.js", "es2015": "../@angular/core/testing.js" diff --git a/packages/es6-subset.d.ts b/packages/es6-subset.d.ts index 96398c9c4c..caef53e496 100644 --- a/packages/es6-subset.d.ts +++ b/packages/es6-subset.d.ts @@ -54,12 +54,12 @@ interface NumberConstructor { // Workaround https://github.com/Microsoft/TypeScript/issues/9193 interface PromiseConstructor { - all(values: (T | PromiseLike)[]): Promise; + all(values: (T|PromiseLike)[]): Promise; } interface Function { - /** - * Returns the name of the function. Function names are read-only and can not be changed. - */ - readonly name: string; + /** + * Returns the name of the function. Function names are read-only and can not be changed. + */ + readonly name: string; } diff --git a/packages/examples/README.md b/packages/examples/README.md index 811366fd6c..2e3269f41f 100644 --- a/packages/examples/README.md +++ b/packages/examples/README.md @@ -11,7 +11,7 @@ behavior) just like an Angular application developer would write. ./build.sh # run when test change -./modules/@angular/examples/build.sh +./packages/examples/build.sh # start server $(npm bin)/gulp serve-examples @@ -26,7 +26,7 @@ navigate to [http://localhost:8001](http://localhost:8001) ./build.sh # run to compile tests and run them -./modules/@angular/examples/test.sh +./packages/examples/test.sh ``` NOTE: sometimes the http server does not exit properly and it retains the `8001` port. diff --git a/packages/http/testing/package.json b/packages/http/testing/package.json index 0760f0358d..b17d41a900 100644 --- a/packages/http/testing/package.json +++ b/packages/http/testing/package.json @@ -1,5 +1,5 @@ { - "typings": "../typings/testing.d.ts", + "typings": "../typings/testing/index.d.ts", "main": "../bundles/http-testing.umd.js", "module": "../@angular/http/testing.es5.js", "es2015": "../@angular/http/testing.js" diff --git a/packages/language-service/rollup.config.js b/packages/language-service/rollup.config.js index bf9a572047..834d91f0bc 100644 --- a/packages/language-service/rollup.config.js +++ b/packages/language-service/rollup.config.js @@ -24,7 +24,7 @@ var esm_suffixes = {}; function normalize(fileName) { return path.resolve(__dirname, fileName); } -console.log('running') + function resolve(id, from) { // console.log('Resolve id:', id, 'from', from) if (id == '@angular/tsc-wrapped') { @@ -37,7 +37,8 @@ function resolve(id, from) { var packageName = match[1]; var esm_suffix = esm_suffixes[packageName] || ''; var loc = locations[packageName] || location; - var r = loc !== location && (loc + esm_suffix + packageName + (match[3] || '/index') + '.js') || loc + packageName + '/@angular/' + packageName + '.es5.js'; + var r = loc !== location && (loc + esm_suffix + packageName + (match[3] || '/index') + '.js') || + loc + packageName + '/@angular/' + packageName + '.es5.js'; // console.log('** ANGULAR MAPPED **: ', r); return r; } diff --git a/packages/language-service/test/test_utils.ts b/packages/language-service/test/test_utils.ts index 2609449e56..3f7a1d7193 100644 --- a/packages/language-service/test/test_utils.ts +++ b/packages/language-service/test/test_utils.ts @@ -6,9 +6,6 @@ * found in the LICENSE file at https://angular.io/license */ -/// -/// - import * as fs from 'fs'; import * as path from 'path'; import * as ts from 'typescript'; diff --git a/packages/platform-browser-dynamic/rollup.config.js b/packages/platform-browser-dynamic/rollup.config.js index 429cb77872..90ad898e96 100644 --- a/packages/platform-browser-dynamic/rollup.config.js +++ b/packages/platform-browser-dynamic/rollup.config.js @@ -7,7 +7,8 @@ */ export default { - entry: '../../dist/packages-dist/platform-browser-dynamic/@angular/platform-browser-dynamic.es5.js', + entry: + '../../dist/packages-dist/platform-browser-dynamic/@angular/platform-browser-dynamic.es5.js', dest: '../../dist/packages-dist/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js', format: 'umd', moduleName: 'ng.platformBrowserDynamic', diff --git a/packages/platform-browser-dynamic/test/resource_loader/resource_loader_impl_spec.ts b/packages/platform-browser-dynamic/test/resource_loader/resource_loader_impl_spec.ts index fdd27e8925..1a325a8bd9 100644 --- a/packages/platform-browser-dynamic/test/resource_loader/resource_loader_impl_spec.ts +++ b/packages/platform-browser-dynamic/test/resource_loader/resource_loader_impl_spec.ts @@ -19,7 +19,7 @@ export function main() { // will be relative to here, so url200 should look like // static_assets/200.html. // We currently have no way of detecting this. - const url200 = '/base/modules/@angular/platform-browser/test/browser/static_assets/200.html'; + const url200 = '/base/packages/platform-browser/test/browser/static_assets/200.html'; const url404 = '/bad/path/404.html'; beforeEach(() => { resourceLoader = new ResourceLoaderImpl(); }); diff --git a/packages/platform-browser-dynamic/test/testing_public_browser_spec.ts b/packages/platform-browser-dynamic/test/testing_public_browser_spec.ts index fbd1fbc246..c8da7744b8 100644 --- a/packages/platform-browser-dynamic/test/testing_public_browser_spec.ts +++ b/packages/platform-browser-dynamic/test/testing_public_browser_spec.ts @@ -26,7 +26,7 @@ class FancyService { @Component({ selector: 'external-template-comp', - templateUrl: '/base/modules/@angular/platform-browser/test/static_assets/test.html' + templateUrl: '/base/packages/platform-browser/test/static_assets/test.html' }) class ExternalTemplateComp { } @@ -48,8 +48,7 @@ export function main() { it('should run async tests with ResourceLoaders', async(() => { const resourceLoader = new ResourceLoaderImpl(); - resourceLoader - .get('/base/modules/@angular/platform-browser/test/static_assets/test.html') + resourceLoader.get('/base/packages/platform-browser/test/static_assets/test.html') .then(() => { actuallyDone = true; }); }), 10000); // Long timeout here because this test makes an actual ResourceLoader. diff --git a/packages/platform-browser-dynamic/testing/package.json b/packages/platform-browser-dynamic/testing/package.json index c81618f623..d831b9d4d1 100644 --- a/packages/platform-browser-dynamic/testing/package.json +++ b/packages/platform-browser-dynamic/testing/package.json @@ -1,5 +1,5 @@ { - "typings": "../typings/testing.d.ts", + "typings": "../typings/testing/index.d.ts", "main": "../bundles/platform-browser-dynamic-testing.umd.js", "module": "../@angular/platform-browser-dynamic/testing.es5.js", "es2015": "../@angular/platform-browser-dynamic/testing.js" diff --git a/packages/platform-browser-dynamic/testing/rollup.config.js b/packages/platform-browser-dynamic/testing/rollup.config.js index 3790697596..dac3e9e076 100644 --- a/packages/platform-browser-dynamic/testing/rollup.config.js +++ b/packages/platform-browser-dynamic/testing/rollup.config.js @@ -7,7 +7,8 @@ */ export default { - entry: '../../../dist/packages-dist/platform-browser-dynamic/@angular/platform-browser-dynamic/testing.es5.js', + entry: + '../../../dist/packages-dist/platform-browser-dynamic/@angular/platform-browser-dynamic/testing.es5.js', dest: '../../../dist/packages-dist/platform-browser-dynamic/bundles/platform-browser-dynamic-testing.umd.js', format: 'umd', diff --git a/packages/platform-browser/animations/package.json b/packages/platform-browser/animations/package.json index 09769a5c9d..f37f7a1b45 100644 --- a/packages/platform-browser/animations/package.json +++ b/packages/platform-browser/animations/package.json @@ -1,5 +1,5 @@ { - "typings": "../typings/animations.d.ts", + "typings": "../typings/animations/index.d.ts", "main": "../bundles/platform-browser-animations.umd.js", "module": "../@angular/platform-browser/animations.es5.js", "es2015": "../@angular/platform-browser/animations.js" diff --git a/packages/platform-browser/animations/testing/rollup.config.js b/packages/platform-browser/animations/testing/rollup.config.js index 4aa53b0d6d..0ee8058d39 100644 --- a/packages/platform-browser/animations/testing/rollup.config.js +++ b/packages/platform-browser/animations/testing/rollup.config.js @@ -7,8 +7,10 @@ */ export default { - entry: '../../../../dist/packages-dist/platform-browser/@angular/platform-browser/animations/testing.es5.js', - dest: '../../../../dist/packages-dist/platform-browser/bundles/platform-browser-animations-testing.umd.js', + entry: + '../../../../dist/packages-dist/platform-browser/@angular/platform-browser/animations/testing.es5.js', + dest: + '../../../../dist/packages-dist/platform-browser/bundles/platform-browser-animations-testing.umd.js', format: 'umd', moduleName: 'ng.platformBrowser.testing', globals: { diff --git a/packages/platform-browser/test/testing_public_spec.ts b/packages/platform-browser/test/testing_public_spec.ts index 740818386b..dec52c0d66 100644 --- a/packages/platform-browser/test/testing_public_spec.ts +++ b/packages/platform-browser/test/testing_public_spec.ts @@ -103,10 +103,8 @@ class CompUsingModuleDirectiveAndPipe { class SomeLibModule { } -@Component({ - selector: 'comp', - templateUrl: '/base/modules/@angular/platform-browser/test/static_assets/test.html' -}) +@Component( + {selector: 'comp', templateUrl: '/base/packages/platform-browser/test/static_assets/test.html'}) class CompWithUrlTemplate { } diff --git a/packages/platform-browser/testing/package.json b/packages/platform-browser/testing/package.json index 9366f7135e..bf2ef8312d 100644 --- a/packages/platform-browser/testing/package.json +++ b/packages/platform-browser/testing/package.json @@ -1,5 +1,5 @@ { - "typings": "../typings/testing.d.ts", + "typings": "../typings/testing/index.d.ts", "main": "../bundles/platform-browser-testing.umd.js", "module": "../@angular/platform-browser/testing.es5.js", "es2015": "../@angular/platform-browser/testing.js" diff --git a/packages/platform-server/testing/package.json b/packages/platform-server/testing/package.json index 5945241b56..987bfb91a4 100644 --- a/packages/platform-server/testing/package.json +++ b/packages/platform-server/testing/package.json @@ -1,5 +1,5 @@ { - "typings": "../typings/testing.d.ts", + "typings": "../typings/testing/index.d.ts", "main": "../bundles/platform-server-testing.umd.js", "module": "../@angular/platform-server/testing.es5.js", "es2015": "../@angular/platform-server/testing.js" diff --git a/packages/platform-webworker-dynamic/rollup.config.js b/packages/platform-webworker-dynamic/rollup.config.js index c89d895645..1bde035401 100644 --- a/packages/platform-webworker-dynamic/rollup.config.js +++ b/packages/platform-webworker-dynamic/rollup.config.js @@ -7,7 +7,8 @@ */ export default { - entry: '../../dist/packages-dist/platform-webworker-dynamic/@angular/platform-webworker-dynamic.es5.js', + entry: + '../../dist/packages-dist/platform-webworker-dynamic/@angular/platform-webworker-dynamic.es5.js', dest: '../../dist/packages-dist/platform-webworker-dynamic/bundles/platform-webworker-dynamic.umd.js', format: 'umd', diff --git a/packages/router/karma.conf.js b/packages/router/karma.conf.js index 26812a70a7..689cf406cc 100644 --- a/packages/router/karma.conf.js +++ b/packages/router/karma.conf.js @@ -40,7 +40,7 @@ module.exports = function(config) { {pattern: 'node_modules/rxjs/**/*.js.map', included: false, watched: false}, // shim - {pattern: 'modules/@angular/router/karma-test-shim.js', included: true, watched: true}, + {pattern: 'packages/router/karma-test-shim.js', included: true, watched: true}, // Angular modules {pattern: 'dist/all/@angular/core/*.js', included: false, watched: false}, diff --git a/modules/@angular/router/test/bootstrap.spec.ts b/packages/router/test/bootstrap.spec.ts similarity index 100% rename from modules/@angular/router/test/bootstrap.spec.ts rename to packages/router/test/bootstrap.spec.ts diff --git a/packages/router/testing/package.json b/packages/router/testing/package.json index bb7657d86d..f4a9089bb3 100644 --- a/packages/router/testing/package.json +++ b/packages/router/testing/package.json @@ -1,5 +1,5 @@ { - "typings": "../typings/testing.d.ts", + "typings": "../typings/testing/index.d.ts", "main": "../bundles/router-testing.umd.js", "module": "../@angular/router/testing.es5.js", "es2015": "../@angular/router/testing.js" diff --git a/packages/router/upgrade/package.json b/packages/router/upgrade/package.json index c923a3cdfc..fd4ae6b0e5 100644 --- a/packages/router/upgrade/package.json +++ b/packages/router/upgrade/package.json @@ -1,5 +1,5 @@ { - "typings": "../typings/upgrade.d.ts", + "typings": "../typings/upgrade/index.d.ts", "main": "../bundles/router-upgrade.umd.js", "module": "../@angular/router/upgrade.es5.js", "es2015": "../@angular/router/upgrade.js" diff --git a/packages/tsconfig.json b/packages/tsconfig.json index 9674aeb51d..e3fd4343de 100644 --- a/packages/tsconfig.json +++ b/packages/tsconfig.json @@ -6,7 +6,7 @@ "emitDecoratorMetadata": true, "module": "commonjs", "moduleResolution": "node", - "outDir": "../dist/all/", + "outDir": "../dist/all/@angular", "noImplicitAny": true, "noFallthroughCasesInSwitch": true, "paths": { @@ -26,13 +26,6 @@ "types": ["angularjs"] }, "exclude": [ - "angular1_router", - "benchmarks/e2e_test/old", - "benchmarks/src/old", - "benchmarks/src/**/index_aot.ts", - "benchmarks_external", - "payload_tests", - "rollup-test", "compiler-cli/integrationtest" ] } diff --git a/packages/upgrade/static/package.json b/packages/upgrade/static/package.json index e93fde9e87..3e9a10e550 100644 --- a/packages/upgrade/static/package.json +++ b/packages/upgrade/static/package.json @@ -1,5 +1,5 @@ { - "typings": "../typings/static.d.ts", + "typings": "../typings/static/index.d.ts", "main": "../bundles/upgrade-static.umd.js", "module": "../@angular/upgrade/static.es5.js", "es2015": "../@angular/upgrade/static.js" diff --git a/scripts/ci/build.sh b/scripts/ci/build.sh index c46011fadf..9077a1f237 100755 --- a/scripts/ci/build.sh +++ b/scripts/ci/build.sh @@ -22,17 +22,17 @@ travisFoldEnd "tsc tools" travisFoldStart "tsc all" - node --max-old-space-size=3000 dist/tools/@angular/tsc-wrapped/src/main -p modules + node --max-old-space-size=3000 dist/tools/@angular/tsc-wrapped/src/main -p packages travisFoldEnd "tsc all" # TODO(i): what are these compilations here for? travisFoldStart "tsc a bunch of useless stuff" - node dist/tools/@angular/tsc-wrapped/src/main -p modules/@angular/core/tsconfig-build.json - node dist/tools/@angular/tsc-wrapped/src/main -p modules/@angular/common/tsconfig-build.json - node dist/tools/@angular/tsc-wrapped/src/main -p modules/@angular/platform-browser/tsconfig-build.json - node dist/tools/@angular/tsc-wrapped/src/main -p modules/@angular/router/tsconfig-build.json - node dist/tools/@angular/tsc-wrapped/src/main -p modules/@angular/forms/tsconfig-build.json + node dist/tools/@angular/tsc-wrapped/src/main -p packages/core/tsconfig-build.json + node dist/tools/@angular/tsc-wrapped/src/main -p packages/common/tsconfig-build.json + node dist/tools/@angular/tsc-wrapped/src/main -p packages/platform-browser/tsconfig-build.json + node dist/tools/@angular/tsc-wrapped/src/main -p packages/router/tsconfig-build.json + node dist/tools/@angular/tsc-wrapped/src/main -p packages/forms/tsconfig-build.json travisFoldEnd "tsc a bunch of useless stuff" diff --git a/scripts/ci/install.sh b/scripts/ci/install.sh index 01b0fffb5f..93420bbcaa 100755 --- a/scripts/ci/install.sh +++ b/scripts/ci/install.sh @@ -2,6 +2,9 @@ set -u -e -o pipefail +TRAVIS=${TRAVIS:-} +CI_MODE=${CI_MODE:-} + # Setup environment readonly thisDir=$(cd $(dirname $0); pwd) source ${thisDir}/_travis-fold.sh diff --git a/scripts/ci/offline_compiler_test.sh b/scripts/ci/offline_compiler_test.sh index eed041d165..b0cef0f2d9 100755 --- a/scripts/ci/offline_compiler_test.sh +++ b/scripts/ci/offline_compiler_test.sh @@ -23,7 +23,7 @@ PKGS=( TMPDIR=${TMPDIR:-.} readonly TMP=$TMPDIR/e2e_test.$(date +%s) mkdir -p $TMP -cp -R -v modules/@angular/compiler-cli/integrationtest/* $TMP +cp -R -v packages/compiler-cli/integrationtest/* $TMP cp -R -v modules/benchmarks $TMP # Try to use the same versions as angular, in particular, this will # cause us to install the same rxjs version. diff --git a/scripts/ci/test-e2e.sh b/scripts/ci/test-e2e.sh index 131a295f9e..5b8cbc58dc 100755 --- a/scripts/ci/test-e2e.sh +++ b/scripts/ci/test-e2e.sh @@ -12,7 +12,7 @@ travisFoldStart "test.e2e.buildPackages" travisFoldEnd "test.e2e.buildPackages" -if [[ ${TRAVIS} ]]; then +if [[ ${TRAVIS:-} ]]; then travisFoldStart "test.e2e.xvfb-start" sh -e /etc/init.d/xvfb start travisFoldEnd "test.e2e.xvfb-start" diff --git a/scripts/ci/test-js.sh b/scripts/ci/test-js.sh index 40b6d18d2e..69abd215d6 100755 --- a/scripts/ci/test-js.sh +++ b/scripts/ci/test-js.sh @@ -30,7 +30,7 @@ travisFoldEnd "test.unit.node" # rebuild to revert files in @angular/compiler/test # TODO(tbosch): remove this and teach karma to serve the right files travisFoldStart "test.unit.rebuildHack" - node dist/tools/@angular/tsc-wrapped/src/main -p modules/tsconfig.json + node dist/tools/@angular/tsc-wrapped/src/main -p packages/tsconfig.json travisFoldStart "test.unit.rebuildHack" @@ -47,5 +47,5 @@ travisFoldEnd "test.unit.localChrome" travisFoldStart "test.unit.localChrome.router" - $(npm bin)/karma start ./modules/@angular/router/karma.conf.js --single-run --browsers=${KARMA_JS_BROWSERS} + $(npm bin)/karma start ./packages/router/karma.conf.js --single-run --browsers=${KARMA_JS_BROWSERS} travisFoldEnd "test.unit.localChrome.router" diff --git a/test-main.js b/test-main.js index 0f988a2e67..9a510faf44 100644 --- a/test-main.js +++ b/test-main.js @@ -46,6 +46,7 @@ System.config({ '@angular/router': {main: 'index.js', defaultExtension: 'js'}, '@angular/http/testing': {main: 'index.js', defaultExtension: 'js'}, '@angular/http': {main: 'index.js', defaultExtension: 'js'}, + '@angular/upgrade/static': {main: 'index.js', defaultExtension: 'js'}, '@angular/upgrade': {main: 'index.js', defaultExtension: 'js'}, '@angular/platform-browser/animations/testing': {main: 'index.js', defaultExtension: 'js'}, '@angular/platform-browser/animations': {main: 'index.js', defaultExtension: 'js'}, diff --git a/tools/cjs-jasmine/test-cjs-main.ts b/tools/cjs-jasmine/test-cjs-main.ts index 6a03ea6fe5..7720713d8f 100644 --- a/tools/cjs-jasmine/test-cjs-main.ts +++ b/tools/cjs-jasmine/test-cjs-main.ts @@ -6,7 +6,7 @@ * found in the LICENSE file at https://angular.io/license */ -const testingPlatformServer = require('../../all/@angular/platform-server/testing/server.js'); +const testingPlatformServer = require('../../all/@angular/platform-server/testing/src/server.js'); const coreTesting = require('../../all/@angular/core/testing'); coreTesting.TestBed.initTestEnvironment( diff --git a/tools/gulp-tasks/format.js b/tools/gulp-tasks/format.js index 4ebc892eb4..02f27466ce 100644 --- a/tools/gulp-tasks/format.js +++ b/tools/gulp-tasks/format.js @@ -1,6 +1,6 @@ // clang-format entry points const srcsToFmt = [ - 'modules/@angular/**/*.{js,ts}', + 'packages/**/*.{js,ts}', 'modules/benchmarks/**/*.{js,ts}', 'modules/e2e_util/**/*.{js,ts}', 'modules/playground/**/*.{js,ts}', diff --git a/tools/gulp-tasks/public-api.js b/tools/gulp-tasks/public-api.js index 36c3897aca..380bdca8b1 100644 --- a/tools/gulp-tasks/public-api.js +++ b/tools/gulp-tasks/public-api.js @@ -7,7 +7,7 @@ const entrypoints = [ //'dist/packages-dist/compiler/index.d.ts', //'dist/packages-dist/compiler/testing.d.ts', 'dist/packages-dist/upgrade/typings/upgrade.d.ts', - 'dist/packages-dist/upgrade/typings/static/static.d.ts', + 'dist/packages-dist/upgrade/typings/static/index.d.ts', 'dist/packages-dist/platform-browser/typings/platform-browser.d.ts', 'dist/packages-dist/platform-browser/typings/testing/index.d.ts', 'dist/packages-dist/platform-browser-dynamic/typings/platform-browser-dynamic.d.ts', @@ -19,7 +19,7 @@ const entrypoints = [ 'dist/packages-dist/http/typings/http.d.ts', 'dist/packages-dist/http/typings/testing/index.d.ts', 'dist/packages-dist/forms/typings/forms.d.ts', 'dist/packages-dist/router/typings/router.d.ts', 'dist/packages-dist/animations/typings/animations.d.ts', - 'dist/packages-dist/platform-browser/typings/animations/animations.d.ts', + 'dist/packages-dist/platform-browser/typings/animations/index.d.ts', 'dist/packages-dist/platform-browser/typings/animations/testing/index.d.ts' ]; diff --git a/tools/public_api_guard/platform-browser/typings/animations/animations.d.ts b/tools/public_api_guard/platform-browser/typings/animations/index.d.ts similarity index 100% rename from tools/public_api_guard/platform-browser/typings/animations/animations.d.ts rename to tools/public_api_guard/platform-browser/typings/animations/index.d.ts diff --git a/tools/public_api_guard/upgrade/typings/static/static.d.ts b/tools/public_api_guard/upgrade/typings/static/index.d.ts similarity index 100% rename from tools/public_api_guard/upgrade/typings/static/static.d.ts rename to tools/public_api_guard/upgrade/typings/static/index.d.ts diff --git a/tools/tree-shaking-test/rollup.config.js b/tools/tree-shaking-test/rollup.config.js index 633f476432..7bef7c2cc9 100644 --- a/tools/tree-shaking-test/rollup.config.js +++ b/tools/tree-shaking-test/rollup.config.js @@ -9,7 +9,8 @@ class RollupNG2 { resolveId(id, from) { if (id.startsWith('@angular/')) { - return `${__dirname}/../../packages-dist/${id.split('/')[1]}/esm/index.js`; + const packageName = id.split('/')[1]; + return `${__dirname}/../../packages-dist/${packageName}/@angular/packageName.es5.js`; } // if(id.startsWith('rxjs/')){ diff --git a/tools/tsc-watch/index.ts b/tools/tsc-watch/index.ts index c399d11c2f..1e6e6d5a57 100644 --- a/tools/tsc-watch/index.ts +++ b/tools/tsc-watch/index.ts @@ -38,7 +38,7 @@ const BaseConfig = { if (platform == 'node') { tscWatch = new TscWatch(Object.assign( { - tsconfig: 'modules/tsconfig.json', + tsconfig: 'packages/tsconfig.json', onChangeCmds: [[ 'node', 'dist/tools/cjs-jasmine', '--', '@angular/**/*_spec.js', '@angular/compiler-cli/test/**/*_spec.js', '@angular/benchpress/test/**/*_spec.js' @@ -48,7 +48,7 @@ if (platform == 'node') { } else if (platform == 'browser') { tscWatch = new TscWatch(Object.assign( { - tsconfig: 'modules/tsconfig.json', + tsconfig: 'packages/tsconfig.json', onStartCmds: [ [ 'node', 'node_modules/karma/bin/karma', 'start', '--no-auto-watch', '--port=9876', @@ -56,7 +56,7 @@ if (platform == 'node') { ], [ 'node', 'node_modules/karma/bin/karma', 'start', '--no-auto-watch', '--port=9877', - 'modules/@angular/router/karma.conf.js' + 'packages/router/karma.conf.js' ], ], onChangeCmds: [ @@ -68,11 +68,11 @@ if (platform == 'node') { } else if (platform == 'router') { tscWatch = new TscWatch(Object.assign( { - tsconfig: 'modules/tsconfig.json', + tsconfig: 'packages/tsconfig.json', onStartCmds: [ [ 'node', 'node_modules/karma/bin/karma', 'start', '--no-auto-watch', '--port=9877', - 'modules/@angular/router/karma.conf.js' + 'packages/router/karma.conf.js' ], ], onChangeCmds: [ @@ -83,7 +83,7 @@ if (platform == 'node') { } else if (platform == 'browserNoRouter') { tscWatch = new TscWatch(Object.assign( { - tsconfig: 'modules/tsconfig.json', + tsconfig: 'packages/tsconfig.json', onStartCmds: [[ 'node', 'node_modules/karma/bin/karma', 'start', '--no-auto-watch', '--port=9876', 'karma-js.conf.js'