feat(typescript): update to 1.9 nightly.

To workaround https://github.com/Microsoft/TypeScript/issues/7573
we must remove the readonly keyword from generated .d.ts files.
This solution will not scale, but will probably buy enough time to require our users move to a 2.0 beta.

Closes #8003
This commit is contained in:
Alex Eagle 2016-04-10 13:51:11 -07:00 committed by Alex Eagle
parent 347e71af7d
commit 3412aba46e
6 changed files with 47 additions and 23 deletions

View File

@ -981,9 +981,9 @@ gulp.task('static-checks', ['!build.tools'], function(done) {
// distributed in our npm package, and loaded from node_modules by // distributed in our npm package, and loaded from node_modules by
// the typescript compiler. // the typescript compiler.
// Make sure the two typings tests are isolated, by running this one in a tempdir // Make sure the typings tests are isolated, by running in a tempdir
var tmpdir = path.join(os.tmpdir(), 'test.typings', new Date().getTime().toString()); var tmpdir = path.join(os.tmpdir(), 'test.typings', new Date().getTime().toString());
gulp.task('!pre.test.typings.layoutNodeModule', ['build.js.cjs'], function() { gulp.task('!pre.test.typings.layoutNodeModule', function() {
return gulp.src(['dist/js/cjs/angular2/**/*', 'node_modules/rxjs/**/*'], {base: 'dist/js/cjs'}) return gulp.src(['dist/js/cjs/angular2/**/*', 'node_modules/rxjs/**/*'], {base: 'dist/js/cjs'})
.pipe(gulp.dest(path.join(tmpdir, 'node_modules'))); .pipe(gulp.dest(path.join(tmpdir, 'node_modules')));
}); });
@ -1003,7 +1003,7 @@ gulp.task('!pre.test.typings.copyTypingsSpec', function() {
return gulp.src(['modules/angular2/examples/**/*.ts']).pipe(gulp.dest(tmpdir)); return gulp.src(['modules/angular2/examples/**/*.ts']).pipe(gulp.dest(tmpdir));
}); });
gulp.task('test.typings', gulp.task('!test.typings',
[ [
'!pre.test.typings.layoutNodeModule', '!pre.test.typings.layoutNodeModule',
'!pre.test.typings.copyTypingsSpec', '!pre.test.typings.copyTypingsSpec',
@ -1023,6 +1023,9 @@ gulp.task('test.typings',
})); }));
}); });
gulp.task('test.typings', ['build.js.cjs'],
function(done) { runSequence('!test.typings', sequenceComplete(done)); });
// ----------------- // -----------------
// orchestrated targets // orchestrated targets

View File

@ -2231,6 +2231,9 @@
"glob": { "glob": {
"version": "4.3.5", "version": "4.3.5",
"dependencies": { "dependencies": {
"inflight": {
"version": "1.0.4"
},
"minimatch": { "minimatch": {
"version": "2.0.10" "version": "2.0.10"
} }
@ -3038,7 +3041,7 @@
} }
}, },
"gulp-tslint": { "gulp-tslint": {
"version": "4.3.4" "version": "4.3.5"
}, },
"gulp-typescript": { "gulp-typescript": {
"version": "2.10.0", "version": "2.10.0",
@ -5415,10 +5418,10 @@
} }
}, },
"tslint": { "tslint": {
"version": "3.2.1", "version": "3.7.0-dev.2",
"dependencies": { "dependencies": {
"glob": { "glob": {
"version": "6.0.3" "version": "6.0.4"
}, },
"underscore.string": { "underscore.string": {
"version": "3.1.1" "version": "3.1.1"
@ -5452,7 +5455,7 @@
"version": "0.0.6" "version": "0.0.6"
}, },
"typescript": { "typescript": {
"version": "1.7.5" "version": "1.9.0-dev.20160409"
}, },
"ua-parser-js": { "ua-parser-js": {
"version": "0.7.10" "version": "0.7.10"
@ -5823,5 +5826,5 @@
} }
}, },
"name": "angular-srcs", "name": "angular-srcs",
"version": "2.0.0-beta.12" "version": "2.0.0-beta.14"
} }

29
npm-shrinkwrap.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "angular-srcs", "name": "angular-srcs",
"version": "2.0.0-beta.12", "version": "2.0.0-beta.14",
"dependencies": { "dependencies": {
"abbrev": { "abbrev": {
"version": "1.0.7", "version": "1.0.7",
@ -3519,6 +3519,11 @@
"from": "glob@>=4.3.0 <4.4.0", "from": "glob@>=4.3.0 <4.4.0",
"resolved": "https://registry.npmjs.org/glob/-/glob-4.3.5.tgz", "resolved": "https://registry.npmjs.org/glob/-/glob-4.3.5.tgz",
"dependencies": { "dependencies": {
"inflight": {
"version": "1.0.4",
"from": "inflight@>=1.0.4 <2.0.0",
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.4.tgz"
},
"minimatch": { "minimatch": {
"version": "2.0.10", "version": "2.0.10",
"from": "minimatch@>=2.0.1 <3.0.0", "from": "minimatch@>=2.0.1 <3.0.0",
@ -4806,9 +4811,9 @@
} }
}, },
"gulp-tslint": { "gulp-tslint": {
"version": "4.3.4", "version": "4.3.5",
"from": "gulp-tslint@4.3.4", "from": "gulp-tslint@4.3.5",
"resolved": "https://registry.npmjs.org/gulp-tslint/-/gulp-tslint-4.3.4.tgz" "resolved": "https://registry.npmjs.org/gulp-tslint/-/gulp-tslint-4.3.5.tgz"
}, },
"gulp-typescript": { "gulp-typescript": {
"version": "2.10.0", "version": "2.10.0",
@ -8632,14 +8637,14 @@
} }
}, },
"tslint": { "tslint": {
"version": "3.2.1", "version": "3.7.0-dev.2",
"from": "tslint@>=3.2.1 <4.0.0", "from": "tslint@next",
"resolved": "https://registry.npmjs.org/tslint/-/tslint-3.2.1.tgz", "resolved": "https://registry.npmjs.org/tslint/-/tslint-3.7.0-dev.2.tgz",
"dependencies": { "dependencies": {
"glob": { "glob": {
"version": "6.0.3", "version": "6.0.4",
"from": "glob@>=6.0.1 <7.0.0", "from": "glob@>=6.0.1 <7.0.0",
"resolved": "https://registry.npmjs.org/glob/-/glob-6.0.3.tgz" "resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz"
}, },
"underscore.string": { "underscore.string": {
"version": "3.1.1", "version": "3.1.1",
@ -8691,9 +8696,9 @@
"resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz" "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz"
}, },
"typescript": { "typescript": {
"version": "1.7.5", "version": "1.9.0-dev.20160409",
"from": "typescript@1.7.5", "from": "typescript@next",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-1.7.5.tgz" "resolved": "https://registry.npmjs.org/typescript/-/typescript-1.9.0-dev.20160409.tgz"
}, },
"ua-parser-js": { "ua-parser-js": {
"version": "0.7.10", "version": "0.7.10",

View File

@ -113,8 +113,8 @@
"ts-api-guardian": "0.0.2", "ts-api-guardian": "0.0.2",
"ts2dart": "^0.7.31", "ts2dart": "^0.7.31",
"tsd": "^0.6.5-beta", "tsd": "^0.6.5-beta",
"tslint": "^3.2.1", "tslint": "^3.7.0-dev.2",
"typescript": "^1.7.3", "typescript": "^1.9.0-dev.20160409",
"universal-analytics": "^0.3.9", "universal-analytics": "^0.3.9",
"webpack": "^1.12.6", "webpack": "^1.12.6",
"which": "~1", "which": "~1",

View File

@ -23,7 +23,10 @@ elif [ "$MODE" = "typescript_next" ]; then
# Ignore complaints about unsatisfied peer deps # Ignore complaints about unsatisfied peer deps
npm install typescript@next || true npm install typescript@next || true
${SCRIPT_DIR}/build_js.sh ${SCRIPT_DIR}/build_js.sh
./node_modules/.bin/gulp test.typings # Run typings test using the GA release of TypeScript
# This ensures that users aren't forced onto beta/nightly
npm install typescript@1.8.9
./node_modules/.bin/gulp \!test.typings
elif [ "$MODE" = "payload" ]; then elif [ "$MODE" = "payload" ]; then
source ${SCRIPT_DIR}/env_dart.sh source ${SCRIPT_DIR}/env_dart.sh
./node_modules/.bin/gulp test.payload.dart/ci ./node_modules/.bin/gulp test.payload.dart/ci

View File

@ -120,6 +120,16 @@ module.exports = function makeNodeTree(projects, destinationPath) {
let compiledTree = mergeTrees([compiledSrcTree, compiledTestTree]); let compiledTree = mergeTrees([compiledSrcTree, compiledTestTree]);
// Down-level .d.ts files to be TS 1.8 compatible
// TODO(alexeagle): this can be removed once we drop support for using Angular 2 with TS 1.8
compiledTree = replace(compiledTree, {
files: ['**/*.d.ts'],
patterns: [
{match: /^(\s*(static\s+)?)readonly\s+/mg, replacement: "$1"},
]
});
// Now we add the LICENSE file into all the folders that will become npm packages // Now we add the LICENSE file into all the folders that will become npm packages
outputPackages.forEach(function(destDir) { outputPackages.forEach(function(destDir) {
var license = new Funnel('.', {files: ['LICENSE'], destDir: destDir}); var license = new Funnel('.', {files: ['LICENSE'], destDir: destDir});