build: publish tree of files rather than FESMs (#18541)

* Remove now unnecessary portions of build.
* Add a compilePackageES5 method to build ES5 from sources
* Rework all package.json and rollup config files to new format
* Remove "extends" from tsconfig-build.json files and fixup compilation roots

PR Close #18541
This commit is contained in:
Jason Aden
2017-08-02 19:15:30 -07:00
parent ee04217d53
commit fd701b07f0
160 changed files with 1079 additions and 892 deletions

View File

@ -3,9 +3,9 @@
"version": "0.0.0-PLACEHOLDER",
"description": "Angular - the core framework",
"main": "./bundles/core.umd.js",
"module": "./@angular/core.es5.js",
"es2015": "./@angular/core.js",
"typings": "./core.d.ts",
"module": "./esm5/index.js",
"es2015": "./esm15/index.js",
"typings": "./index.d.ts",
"author": "angular",
"license": "MIT",
"dependencies": {

View File

@ -9,7 +9,7 @@
/**
* @module
* @description
* Entry point for all public APIs of the core package.
* Entry point for all public APIs of this package.
*/
export * from './src/core';

View File

@ -7,6 +7,7 @@
*/
import resolve from 'rollup-plugin-node-resolve';
import sourcemaps from 'rollup-plugin-sourcemaps';
const globals = {
'rxjs/Observable': 'Rx',
@ -18,12 +19,12 @@ const globals = {
};
export default {
entry: '../../dist/packages-dist/core/@angular/core.es5.js',
entry: '../../dist/packages-dist/core/esm5/index.js',
dest: '../../dist/packages-dist/core/bundles/core.umd.js',
format: 'umd',
exports: 'named',
moduleName: 'ng.core',
plugins: [resolve()],
plugins: [resolve(), sourcemaps()],
external: Object.keys(globals),
globals: globals
};

View File

@ -6,10 +6,9 @@
* found in the LICENSE file at https://angular.io/license
*/
/**
* @module
* @description
* Entry point for all public APIs of the core/testing package.
*/
// This file is not used to build this module. It is only used during editing
// by the TypeScript language service and during build for verification. `ngc`
// replaces this file with production index.ts when it rewrites private symbol
// names.
export * from './src/testing';
export * from './public_api';

View File

@ -1,7 +1,7 @@
{
"name": "@angular/core/testing",
"typings": "../testing.d.ts",
"typings": "./index.d.ts",
"main": "../bundles/core-testing.umd.js",
"module": "../@angular/core/testing.es5.js",
"es2015": "../@angular/core/testing.js"
"module": "../esm5/testing/index.js",
"es2015": "../esm15/testing/index.js"
}

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
*/
/**
* @module
* @description
* Entry point for all public APIs of this package.
*/
export * from './src/testing';
// This file only reexports content of the `src` folder. Keep it that way.

View File

@ -7,6 +7,7 @@
*/
import resolve from 'rollup-plugin-node-resolve';
import sourcemaps from 'rollup-plugin-sourcemaps';
const globals = {
'@angular/core': 'ng.core',
@ -15,12 +16,12 @@ const globals = {
};
export default {
entry: '../../../dist/packages-dist/core/@angular/core/testing.es5.js',
entry: '../../../dist/packages-dist/core/esm5/testing/index.js',
dest: '../../../dist/packages-dist/core/bundles/core-testing.umd.js',
format: 'umd',
exports: 'named',
moduleName: 'ng.core.testing',
plugins: [resolve()],
plugins: [resolve(), sourcemaps()],
external: Object.keys(globals),
globals: globals
};

View File

@ -1,17 +1,25 @@
{
"extends": "../tsconfig-build",
"extends": "../tsconfig-build.json",
"compilerOptions": {
"baseUrl": ".",
"rootDir": "../",
"paths": {
"rxjs/*": ["../../node_modules/rxjs/*"],
"@angular/core": ["../../dist/packages/core"]
}
"rxjs/*": ["../../../node_modules/rxjs/*"],
"@angular/core": ["../../../dist/packages/core"]
},
"outDir": "../../../dist/packages/core"
},
"files": [
"index.ts",
"public_api.ts",
"../../../node_modules/zone.js/dist/zone.js.d.ts",
"../../system.d.ts"
],
"angularCompilerOptions": {
"strictMetadataEmit": true
"strictMetadataEmit": true,
"flatModuleOutFile": "index.js",
"flatModuleId": "@angular/core/testing"
}
}

View File

@ -1,40 +1,25 @@
{
"extends": "../tsconfig-build.json",
"compilerOptions": {
"baseUrl": ".",
"rootDir": ".",
"paths": {
"rxjs/*": ["../../node_modules/rxjs/*"]
},
"outDir": "../../dist/packages/core"
},
"files": [
"public_api.ts",
"../../node_modules/zone.js/dist/zone.js.d.ts",
"../system.d.ts"
],
"angularCompilerOptions": {
"annotateForClosureCompiler": true,
"strictMetadataEmit": true,
"flatModuleOutFile": "index.js",
"flatModuleId": "@angular/core"
},
"compilerOptions": {
"declaration": true,
"stripInternal": true,
"strictNullChecks": true,
"module": "es2015",
"moduleResolution": "node",
"target": "es2015",
"lib": ["es2015", "dom"],
"skipLibCheck": true,
// don't auto-discover @types/node, it results in a ///<reference in the .d.ts output
"types": [],
/**
* The rest of the file is configuration that's overridden by bazel.
* It can be removed after we fully migrate.
*/
"baseUrl": ".",
"experimentalDecorators": true,
"outDir": "../../dist/packages/core",
"paths": {
"rxjs/*": ["../../node_modules/rxjs/*"]
},
"rootDir": ".",
"sourceMap": true,
"inlineSources": true
},
"files": [
"public_api.ts",
"../../node_modules/zone.js/dist/zone.js.d.ts",
"../system.d.ts"
]
}
}
}