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

@ -6,4 +6,11 @@
* found in the LICENSE file at https://angular.io/license
*/
export {ServerModule, platformDynamicServer, platformServer} from './src/server';
/**
* @module
* @description
* Entry point for all public APIs of the platform-server package.
*/
export * from './src/platform-server';
// This file only reexports content of the `src` folder. Keep it that way.

View File

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

View File

@ -1,27 +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 {__platform_browser_private__ as r, __platform_browser_private_types__ as types} from '@angular/platform-browser';
export declare let _server_platform_browser_private_types: types;
export type DomAdapter = typeof _server_platform_browser_private_types.DomAdapter;
export var DomAdapter: typeof r.DomAdapter = r.DomAdapter;
export var setRootDomAdapter: typeof r.setRootDomAdapter = r.setRootDomAdapter;
export var getDOM: typeof r.getDOM = r.getDOM;
export type DomRootRenderer = typeof _server_platform_browser_private_types.DomRootRenderer;
export var DomRootRenderer: typeof r.DomRootRenderer = r.DomRootRenderer;
export type DomRootRenderer_ = typeof _server_platform_browser_private_types.DomRootRenderer_;
export var DomRootRenderer_: typeof r.DomRootRenderer_ = r.DomRootRenderer_;
export type DomSharedStylesHost = typeof _server_platform_browser_private_types.DomSharedStylesHost;
export var DomSharedStylesHost: typeof r.DomSharedStylesHost = r.DomSharedStylesHost;
export type SharedStylesHost = typeof _server_platform_browser_private_types.SharedStylesHost;
export var SharedStylesHost: typeof r.SharedStylesHost = r.SharedStylesHost;
export var ELEMENT_PROBE_PROVIDERS: typeof r.ELEMENT_PROBE_PROVIDERS = r.ELEMENT_PROBE_PROVIDERS;
export type DomEventsPlugin = typeof _server_platform_browser_private_types.DomEventsPlugin;
export var DomEventsPlugin: typeof r.DomEventsPlugin = r.DomEventsPlugin;

View File

@ -0,0 +1,20 @@
export default {
entry: '../../../dist/packages-dist/platform-server/testing/index.js',
dest: '../../../dist/packages-dist/platform-server/bundles/platform-server-testing.umd.js',
format: 'umd',
moduleName: 'ng.platformServer.testing',
globals: {
'@angular/core': 'ng.core',
'@angular/common': 'ng.common',
'@angular/compiler': 'ng.compiler',
'@angular/compiler/testing': 'ng.compiler.testing',
'@angular/platform-browser': 'ng.platformBrowser',
'@angular/platform-server': 'ng.platformServer',
'@angular/platform-browser-dynamic/testing': 'ng.platformBrowserDynamic.testing',
'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,19 +1,17 @@
export default {
entry: '../../../dist/packages-dist/platform-server/esm/index.js',
dest: '../../../dist/packages-dist/platform-server/esm/platform-server.umd.js',
entry: '../../../dist/packages-dist/platform-server/index.js',
dest: '../../../dist/packages-dist/platform-server/bundles/platform-server.umd.js',
format: 'umd',
moduleName: 'ng.platformServer',
globals: {
'@angular/core': 'ng.core',
'@angular/common': 'ng.common',
'@angular/compiler': 'ng.compiler',
'@angular/platform-browser': 'ng.platformBrowser',
'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'
},
plugins: [
// nodeResolve({ jsnext: true, main: true }),
]
}
}

View File

@ -9,9 +9,9 @@
var parse5 = require('parse5/index');
import {ListWrapper, StringMapWrapper} from '../src/facade/collection';
import {DomAdapter, setRootDomAdapter} from '../platform_browser_private';
import {DomAdapter, setRootDomAdapter} from './private_import_platform-browser';
import {isPresent, isBlank, global, setValueOnPath, DateWrapper} from '../src/facade/lang';
import {SelectorMatcher, CssSelector} from '../compiler_private';
import {SelectorMatcher, CssSelector} from './private_import_compiler';
import {Type} from '@angular/core';
import {ResourceLoader} from '@angular/compiler';

View File

@ -6,4 +6,5 @@
* found in the LICENSE file at https://angular.io/license
*/
export * from './testing/server';
export {ServerModule, platformDynamicServer, platformServer} from './server';
export * from './private_export';

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 {ClassProvider, ExistingProvider, FactoryProvider, Provider, TypeProvider, ValueProvider} from '@angular/core';
import {INTERNAL_SERVER_PLATFORM_PROVIDERS} from './server';
export var __platform_server_private__:
{INTERNAL_SERVER_PLATFORM_PROVIDERS: typeof INTERNAL_SERVER_PLATFORM_PROVIDERS} = {
INTERNAL_SERVER_PLATFORM_PROVIDERS: INTERNAL_SERVER_PLATFORM_PROVIDERS
};

View File

@ -10,5 +10,4 @@ import {__core_private__ as r} from '@angular/core';
export var reflector: typeof r.reflector = r.reflector;
export var ReflectionCapabilities: typeof r.ReflectionCapabilities = r.ReflectionCapabilities;
export var wtfInit: typeof r.wtfInit = r.wtfInit;
export var Console: typeof r.Console = r.Console;

View File

@ -0,0 +1,14 @@
/**
* @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 {__platform_browser_private__ as _} from '@angular/platform-browser';
export type DomAdapter = typeof _._DomAdapter;
export var DomAdapter: typeof _.DomAdapter = _.DomAdapter;
export var setRootDomAdapter: typeof _.setRootDomAdapter = _.setRootDomAdapter;
export var getDOM: typeof _.getDOM = _.getDOM;

View File

@ -8,11 +8,8 @@
import {PlatformLocation} from '@angular/common';
import {platformCoreDynamic} from '@angular/compiler';
import {ClassProvider, ExistingProvider, FactoryProvider, NgModule, PLATFORM_INITIALIZER, PlatformRef, TypeProvider, ValueProvider, createPlatformFactory, platformCore} from '@angular/core';
import {ClassProvider, ExistingProvider, FactoryProvider, NgModule, PLATFORM_INITIALIZER, PlatformRef, Provider, TypeProvider, ValueProvider, createPlatformFactory, platformCore} from '@angular/core';
import {BrowserModule} from '@angular/platform-browser';
import {wtfInit} from '../core_private';
import {Parse5DomAdapter} from './parse5_adapter';
function notSupported(feature: string): Error {
@ -39,7 +36,6 @@ export const INTERNAL_SERVER_PLATFORM_PROVIDERS: Array<any /*Type | Provider | a
function initParse5Adapter() {
Parse5DomAdapter.makeCurrent();
wtfInit();
}
/**

View File

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

View File

@ -6,6 +6,9 @@
* found in the LICENSE file at https://angular.io/license
*/
import {__platform_browser_dynamic_private__ as r} from '@angular/platform-browser-dynamic/testing';
export var DOMTestComponentRenderer: typeof r.DOMTestComponentRenderer = r.DOMTestComponentRenderer;
/**
* @module
* @description
* Entry point for all public APIs of the platform-browser-dynamic/testing package.
*/
export * from './server';

View File

@ -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
*/
import {__platform_server_private__ as _} from '@angular/platform-server';
export var INTERNAL_SERVER_PLATFORM_PROVIDERS: typeof _.INTERNAL_SERVER_PLATFORM_PROVIDERS =
_.INTERNAL_SERVER_PLATFORM_PROVIDERS;

View File

@ -7,11 +7,9 @@
*/
import {platformCoreDynamicTesting} from '@angular/compiler/testing';
import {ClassProvider, ExistingProvider, FactoryProvider, NgModule, PlatformRef, TypeProvider, ValueProvider, createPlatformFactory} from '@angular/core';
import {BrowserDynamicTestingModule,} from '@angular/platform-browser-dynamic/testing';
import {INTERNAL_SERVER_PLATFORM_PROVIDERS} from '../src/server';
import {ClassProvider, ExistingProvider, FactoryProvider, NgModule, PlatformRef, Provider, TypeProvider, ValueProvider, createPlatformFactory} from '@angular/core';
import {BrowserDynamicTestingModule} from '@angular/platform-browser-dynamic/testing';
import {INTERNAL_SERVER_PLATFORM_PROVIDERS} from './private_import_platform_server';
/**

View File

@ -1,37 +0,0 @@
{
"compilerOptions": {
"baseUrl": ".",
"declaration": true,
"stripInternal": true,
"experimentalDecorators": true,
"module": "es2015",
"moduleResolution": "node",
"outDir": "../../../dist/packages-dist/platform-server/esm",
"paths": {
"@angular/core": ["../../../dist/packages-dist/core/"],
"@angular/core/testing": ["../../../dist/packages-dist/core/testing"],
"@angular/common": ["../../../dist/packages-dist/common/"],
"@angular/common/testing": ["../../../dist/packages-dist/common/testing"],
"@angular/compiler": ["../../../dist/packages-dist/compiler/"],
"@angular/compiler/testing": ["../../../dist/packages-dist/compiler/testing"],
"@angular/platform-browser": ["../../../dist/packages-dist/platform-browser/"],
"@angular/platform-browser/testing": ["../../../dist/packages-dist/platform-browser/testing"],
"@angular/platform-browser-dynamic": ["../../../dist/packages-dist/platform-browser-dynamic"],
"@angular/platform-browser-dynamic/testing": ["../../../dist/packages-dist/platform-browser-dynamic/testing"]
},
"rootDir": ".",
"sourceMap": true,
"inlineSources": true,
"target": "es2015"
},
"files": [
"index.ts",
"testing.ts",
"../../../node_modules/@types/jasmine/index.d.ts",
"../../../node_modules/@types/node/index.d.ts",
"../../../node_modules/zone.js/dist/zone.js.d.ts"
],
"angularCompilerOptions": {
"strictMetadataEmit": true
}
}

View File

@ -4,7 +4,7 @@
"declaration": true,
"stripInternal": true,
"experimentalDecorators": true,
"module": "commonjs",
"module": "es2015",
"moduleResolution": "node",
"outDir": "../../../dist/packages-dist/platform-server/",
"paths": {
@ -17,17 +17,18 @@
"@angular/platform-browser": ["../../../dist/packages-dist/platform-browser/"],
"@angular/platform-browser/testing": ["../../../dist/packages-dist/platform-browser/testing"],
"@angular/platform-browser-dynamic": ["../../../dist/packages-dist/platform-browser-dynamic"],
"@angular/platform-browser-dynamic/testing": ["../../../dist/packages-dist/platform-browser-dynamic/testing"]
"@angular/platform-browser-dynamic/testing": ["../../../dist/packages-dist/platform-browser-dynamic/testing"],
"@angular/platform-server": ["../../../dist/packages-dist/platform-server"]
},
"rootDir": ".",
"sourceMap": true,
"inlineSources": true,
"lib": ["es6", "dom"],
"target": "es5"
"target": "es5",
"skipLibCheck": true
},
"files": [
"index.ts",
"testing.ts",
"testing/index.ts",
"../../../node_modules/@types/jasmine/index.d.ts",
"../../../node_modules/@types/node/index.d.ts",
"../../../node_modules/zone.js/dist/zone.js.d.ts"

View File

@ -0,0 +1,32 @@
{
"compilerOptions": {
"baseUrl": ".",
"declaration": true,
"stripInternal": true,
"experimentalDecorators": true,
"module": "es2015",
"moduleResolution": "node",
"outDir": "../../../dist/packages-dist/platform-server",
"paths": {
"@angular/core": ["../../../dist/packages-dist/core"],
"@angular/common": ["../../../dist/packages-dist/common"],
"@angular/compiler": ["../../../dist/packages-dist/compiler"],
"@angular/platform-browser": ["../../../dist/packages-dist/platform-browser"],
"@angular/platform-browser-dynamic": ["../../../dist/packages-dist/platform-browser-dynamic"]
},
"rootDir": ".",
"sourceMap": true,
"inlineSources": true,
"target": "es5",
"skipLibCheck": true,
"lib": ["es2015", "dom"]
},
"files": [
"index.ts",
"../../../node_modules/@types/node/index.d.ts",
"../../../node_modules/zone.js/dist/zone.js.d.ts"
],
"angularCompilerOptions": {
"strictMetadataEmit": true
}
}