Skip to content

Commit 8d01f26

Browse files
IgorMinarmhevery
authored andcommitted
repackaging: all the repackaging changes squashed
1 parent 7e87393 commit 8d01f26

837 files changed

Lines changed: 7640 additions & 5116 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,6 @@ npm-debug.log
5252

5353
# built dart payload tests
5454
/modules_dart/payload/**/build
55+
56+
# rollup-test output
57+
/modules/rollup-test/dist/

build.sh

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
#!/usr/bin/env bash
2+
3+
set -e -o pipefail
4+
5+
cd `dirname $0`
6+
7+
rm -rf ./dist/packages-dist
8+
9+
for PACKAGE in \
10+
core \
11+
compiler \
12+
common \
13+
platform-browser \
14+
platform-browser-dynamic \
15+
platform-server \
16+
http \
17+
router \
18+
upgrade
19+
do
20+
SRCDIR=./modules/@angular/${PACKAGE}
21+
DESTDIR=./dist/packages-dist/${PACKAGE}
22+
UMDES6PATH=${DESTDIR}/esm/${PACKAGE}.umd.js
23+
UMDES5PATH=${DESTDIR}/${PACKAGE}.umd.js
24+
25+
26+
echo "====== COMPILING: \$(npm bin)/tsc -p ${SRCDIR}/tsconfig.json ====="
27+
$(npm bin)/tsc -p ${SRCDIR}/tsconfig.json
28+
cp ${SRCDIR}/package.json ${DESTDIR}/
29+
30+
31+
echo "====== TSC 1.8 d.ts compat for ${DESTDIR} ====="
32+
# safely strips 'readonly' specifier from d.ts files to make them compatible with tsc 1.8
33+
find ${DESTDIR} -type f -name '*.d.ts' -print0 | xargs -0 sed -i '' -e 's/\(^ *(static |private )*\)*readonly */\1/g'
34+
35+
36+
echo "====== (esm)COMPILING: \$(npm bin)/tsc -p ${SRCDIR}/tsconfig-es2015.json ====="
37+
$(npm bin)/tsc -p ${SRCDIR}/tsconfig-es2015.json
38+
39+
40+
if (true); then
41+
echo "====== BUNDLING: ${SRCDIR} ====="
42+
(
43+
cd ${SRCDIR}
44+
echo "..." # here just to have grep match something and not exit with 1
45+
../../../node_modules/.bin/rollup -c rollup.config.js
46+
) 2>&1 | grep -v "as external dependency"
47+
48+
# workaround for https://github.com/rollup/rollup/issues/626
49+
sed -i '' "s/ class exports\./ class /g" ${DESTDIR}/esm/${PACKAGE}.umd.js
50+
51+
$(npm bin)/tsc \
52+
--out ${UMDES5PATH} \
53+
--target es5 \
54+
--allowJs \
55+
${UMDES6PATH} \
56+
modules/\@angular/manual_typings/globals.d.ts \
57+
modules/\@angular/typings/es6-collections/es6-collections.d.ts \
58+
modules/\@angular/typings/es6-promise/es6-promise.d.ts
59+
rm ${UMDES6PATH}
60+
fi
61+
done
62+
63+
TSCONFIG=./modules/tsconfig.json
64+
echo "====== (all)COMPILING: \$(npm bin)/tsc -p ${TSCONFIG} ====="
65+
rm -rf ./dist/all/
66+
$(npm bin)/tsc -p ${TSCONFIG}

gulpfile.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -916,7 +916,7 @@ gulp.task('test.unit.cjs/ci', function(done) {
916916
runJasmineTests(['dist/js/cjs/{angular2,benchpress}/test/**/*_spec.js'], done);
917917
});
918918

919-
gulp.task('check-public-api',
919+
gulp.task('check-public-api', ['build.tools'],
920920
function(done) { runJasmineTests(['dist/tools/public_api_guard/**/*_spec.js'], done); });
921921

922922
gulp.task('test.unit.cjs', ['build/clean.js', 'build.tools'], function(neverDone) {
@@ -1555,6 +1555,10 @@ process.on('beforeExit', function() {
15551555

15561556

15571557
var firstTask = true;
1558+
1559+
1560+
1561+
15581562
gulp.on('task_start', (e) => {
15591563
if (firstTask) {
15601564
firstTask = false;

karma-js.conf.js

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ module.exports = function(config) {
1111
files: [
1212
// Sources and specs.
1313
// Loaded through the System loader, in `test-main.js`.
14-
{pattern: 'dist/js/dev/es5/**', included: false, watched: false},
14+
{pattern: 'dist/all/@angular/**/*.js', included: false, watched: true},
15+
{pattern: 'dist/all/@angular/**/*.js.map', included: false, watched: false},
16+
17+
{pattern: 'dist/all/angular2/**/*.js', included: false, watched: true},
18+
{pattern: 'dist/all/angular2/**/*.js.map', included: false, watched: false},
1519

1620
'node_modules/es6-shim/es6-shim.js',
1721
// include Angular v1 for upgrade module testing
@@ -24,16 +28,23 @@ module.exports = function(config) {
2428
'node_modules/zone.js/dist/fake-async-test.js',
2529

2630
// Including systemjs because it defines `__eval`, which produces correct stack traces.
27-
'modules/angular2/src/testing/shims_for_IE.js',
31+
'modules/@angular/platform-browser/testing/shims_for_IE.js',
2832
'node_modules/systemjs/dist/system.src.js',
2933
{pattern: 'node_modules/rxjs/**', included: false, watched: false, served: true},
3034
'node_modules/reflect-metadata/Reflect.js',
3135
'tools/build/file2modulename.js',
3236
'test-main.js',
33-
{pattern: 'modules/**/test/**/static_assets/**', included: false, watched: false}
37+
{pattern: 'dist/all/empty.*', included: false, watched: false},
38+
{pattern: 'modules/@angular/platform-browser/test/static_assets/**', included: false, watched: false},
39+
{pattern: 'modules/@angular/platform-browser-dynamic/test/browser/static_assets/**', included: false, watched: false}
3440
],
3541

36-
exclude: ['dist/js/dev/es5/**/e2e_test/**', 'dist/js/dev/es5/angular2/examples/**', 'dist/angular1_router.js'],
42+
exclude: [
43+
'dist/all/@angular/**/e2e_test/**',
44+
'dist/all/@angular/examples/**',
45+
'dist/all/angular1_router.js',
46+
'dist/all/@angular/platform-browser/testing/e2e_util.js'
47+
],
3748

3849
customLaunchers: browserProvidersConf.customLaunchers,
3950

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export 'index.dart';

modules/@angular/common/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export * from './src/pipes';
2+
export * from './src/directives';
3+
export * from './src/forms';
4+
export * from './src/common_directives';
5+
export * from './src/location';
6+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"name": "@angular/common",
3+
"version": "$$ANGULAR_VERSION$$",
4+
"description": "",
5+
"main": "index.js",
6+
"jsnext:main": "esm/index.js",
7+
"typings": "index.d.ts",
8+
"author": "angular",
9+
"license": "MIT",
10+
"peerDependencies": {
11+
"@angular/core": "$$ANGULAR_VERSION$$"
12+
}
13+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
2+
export default {
3+
entry: '../../../dist/packages-dist/common/esm/index.js',
4+
dest: '../../../dist/packages-dist/common/esm/common.umd.js',
5+
sourceMap: true,
6+
format: 'umd',
7+
moduleName: 'ng.common',
8+
globals: {
9+
'@angular/core': 'ng.core',
10+
'rxjs/Subject': 'Rx',
11+
'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.
12+
'rxjs/operator/toPromise': 'Rx.Observable.prototype',
13+
'rxjs/Observable': 'Rx'
14+
},
15+
plugins: [
16+
// nodeResolve({ jsnext: true, main: true }),
17+
]
18+
}

modules/@angular/common/src/common_directives.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import {Type} from 'angular2/src/facade/lang';
2-
1+
import {Type} from '@angular/core';
32
import {FORM_DIRECTIVES} from './forms';
43
import {CORE_DIRECTIVES} from './directives';
54

@@ -17,7 +16,7 @@ import {CORE_DIRECTIVES} from './directives';
1716
*
1817
* ```typescript
1918
* import {NgClass, NgIf, NgFor, NgSwitch, NgSwitchWhen, NgSwitchDefault, NgModel, NgForm} from
20-
* 'angular2/common';
19+
* '@angular/common';
2120
* import {OtherDirective} from './myDirectives';
2221
*
2322
* @Component({
@@ -33,7 +32,7 @@ import {CORE_DIRECTIVES} from './directives';
3332
* one could import all the common directives at once:
3433
*
3534
* ```typescript
36-
* import {COMMON_DIRECTIVES} from 'angular2/common';
35+
* import {COMMON_DIRECTIVES} from '@angular/common';
3736
* import {OtherDirective} from './myDirectives';
3837
*
3938
* @Component({

modules/@angular/common/src/directives/core_directives.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Type} from 'angular2/src/facade/lang';
1+
import {Type} from '../../src/facade/lang';
22
import {NgClass} from './ng_class';
33
import {NgFor} from './ng_for';
44
import {NgIf} from './ng_if';
@@ -19,7 +19,7 @@ import {NgPlural, NgPluralCase} from './ng_plural';
1919
* Instead of writing:
2020
*
2121
* ```typescript
22-
* import {NgClass, NgIf, NgFor, NgSwitch, NgSwitchWhen, NgSwitchDefault} from 'angular2/common';
22+
* import {NgClass, NgIf, NgFor, NgSwitch, NgSwitchWhen, NgSwitchDefault} from '@angular/common';
2323
* import {OtherDirective} from './myDirectives';
2424
*
2525
* @Component({
@@ -34,7 +34,7 @@ import {NgPlural, NgPluralCase} from './ng_plural';
3434
* one could import all the core directives at once:
3535
*
3636
* ```typescript
37-
* import {CORE_DIRECTIVES} from 'angular2/common';
37+
* import {CORE_DIRECTIVES} from '@angular/common';
3838
* import {OtherDirective} from './myDirectives';
3939
*
4040
* @Component({

0 commit comments

Comments
 (0)