Skip to content

Commit

Permalink
feat(typescript): update to 1.9 nightly.
Browse files Browse the repository at this point in the history
To workaround microsoft/TypeScript#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.
  • Loading branch information
alexeagle committed Apr 12, 2016
1 parent 75fc834 commit 71b2b95
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 23 deletions.
10 changes: 7 additions & 3 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -981,9 +981,9 @@ gulp.task('static-checks', ['!build.tools'], function(done) {
// distributed in our npm package, and loaded from node_modules by
// 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());
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'})
.pipe(gulp.dest(path.join(tmpdir, 'node_modules')));
});
Expand All @@ -1003,7 +1003,7 @@ gulp.task('!pre.test.typings.copyTypingsSpec', function() {
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.copyTypingsSpec',
Expand All @@ -1023,6 +1023,10 @@ gulp.task('test.typings',
}));
});

gulp.task('test.typings', ['build.js.cjs'], function (done) {
runSequence('!test.typings', sequenceComplete(done));
});

// -----------------
// orchestrated targets

Expand Down
13 changes: 8 additions & 5 deletions npm-shrinkwrap.clean.json
Original file line number Diff line number Diff line change
Expand Up @@ -2231,6 +2231,9 @@
"glob": {
"version": "4.3.5",
"dependencies": {
"inflight": {
"version": "1.0.4"
},
"minimatch": {
"version": "2.0.10"
}
Expand Down Expand Up @@ -3038,7 +3041,7 @@
}
},
"gulp-tslint": {
"version": "4.3.4"
"version": "4.3.5"
},
"gulp-typescript": {
"version": "2.10.0",
Expand Down Expand Up @@ -5415,10 +5418,10 @@
}
},
"tslint": {
"version": "3.2.1",
"version": "3.7.0-dev.2",
"dependencies": {
"glob": {
"version": "6.0.3"
"version": "6.0.4"
},
"underscore.string": {
"version": "3.1.1"
Expand Down Expand Up @@ -5452,7 +5455,7 @@
"version": "0.0.6"
},
"typescript": {
"version": "1.7.5"
"version": "1.9.0-dev.20160409"
},
"ua-parser-js": {
"version": "0.7.10"
Expand Down Expand Up @@ -5823,5 +5826,5 @@
}
},
"name": "angular-srcs",
"version": "2.0.0-beta.12"
"version": "2.0.0-beta.14"
}
29 changes: 17 additions & 12 deletions npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@
"ts-api-guardian": "0.0.2",
"ts2dart": "^0.7.31",
"tsd": "^0.6.5-beta",
"tslint": "^3.2.1",
"typescript": "^1.7.3",
"tslint": "^3.7.0-dev.2",
"typescript": "^1.9.0-dev.20160409",
"universal-analytics": "^0.3.9",
"webpack": "^1.12.6",
"which": "~1",
Expand Down
5 changes: 4 additions & 1 deletion scripts/ci/build_and_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ elif [ "$MODE" = "typescript_next" ]; then
# Ignore complaints about unsatisfied peer deps
npm install typescript@next || true
${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 [email protected]
./node_modules/.bin/gulp \!test.typings
elif [ "$MODE" = "payload" ]; then
source ${SCRIPT_DIR}/env_dart.sh
./node_modules/.bin/gulp test.payload.dart/ci
Expand Down
10 changes: 10 additions & 0 deletions tools/broccoli/trees/node_tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,16 @@ module.exports = function makeNodeTree(projects, destinationPath) {

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*)readonly\s+/mg, replacement: "$1"},
]
});


// Now we add the LICENSE file into all the folders that will become npm packages
outputPackages.forEach(function(destDir) {
var license = new Funnel('.', {files: ['LICENSE'], destDir: destDir});
Expand Down

0 comments on commit 71b2b95

Please sign in to comment.