Skip to content

Commit

Permalink
fix(typings): publish es6 typings rather than postinstall.
Browse files Browse the repository at this point in the history
Despite local testing, multiple users failed to run the postinstall to install typings.
Instead, we can distribute the typings we installed locally.

This is an alternative to angular#7003.
This also reverts rxjs to beta.1 since we have errors using beta.2, being addressed
in angular#7001.

Fixes angular#7000
  • Loading branch information
alexeagle committed Feb 11, 2016
1 parent c7261c2 commit 3d715a2
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 19 deletions.
6 changes: 0 additions & 6 deletions modules/angular2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@
"license": "<%= packageJson.license %>",
"repository": <%= JSON.stringify(packageJson.repository) %>,
"devDependencies": <%= JSON.stringify(packageJson.defaultDevDependencies) %>,
"dependencies": {
"typings": "0.6.6"
},
"scripts": {
"postinstall": "typings install --ambient --name es6-promise github:DefinitelyTyped/DefinitelyTyped/es6-promise/es6-promise.d.ts#830e8ebd9ef137d039d5c7ede24a421f08595f83; typings install --ambient --name es6-collections github:DefinitelyTyped/DefinitelyTyped/es6-collections/es6-collections.d.ts#9f97e2a2bc1f502550c9b4fcaad1c48df5521d37"
},
"peerDependencies": {
"es6-promise": "<%= packageJson.dependencies['es6-promise'] %>",
"es6-shim": "<%= packageJson.dependencies['es6-shim'] %>",
Expand Down
10 changes: 9 additions & 1 deletion npm-shrinkwrap.clean.json
Original file line number Diff line number Diff line change
Expand Up @@ -1451,6 +1451,14 @@
}
}
},
"broccoli-file-creator": {
"version": "1.1.0",
"dependencies": {
"rsvp": {
"version": "3.0.21"
}
}
},
"broccoli-filter": {
"version": "0.1.14",
"dependencies": {
Expand Down Expand Up @@ -5828,5 +5836,5 @@
}
},
"name": "angular-srcs",
"version": "2.0.0-beta.3"
"version": "2.0.0-beta.5"
}
28 changes: 20 additions & 8 deletions npm-shrinkwrap.json

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

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
"es6-promise": "^3.0.2",
"es6-shim": "^0.33.3",
"reflect-metadata": "0.1.2",
"rxjs": "^5.0.0-beta.2",
"zone.js": "^0.5.14"
"rxjs": "5.0.0-beta.0",
"zone.js": "0.5.13"
},
"devDependencies": {
"angular": "^1.5.0",
Expand All @@ -45,6 +45,7 @@
"base64-js": "^0.0.8",
"bower": "^1.3.12",
"broccoli": "^0.16.9",
"broccoli-file-creator": "^1.1.0",
"broccoli-funnel": "^1.0.1",
"broccoli-slow-trees": "1.x.x",
"broccoli-stew": "^0.2.1",
Expand Down Expand Up @@ -111,8 +112,8 @@
"systemjs": "0.18.10",
"systemjs-builder": "^0.10.3",
"through2": "^0.6.5",
"ts2dart": "^0.7.22",
"ts-api-guardian": "0.0.2",
"ts2dart": "^0.7.22",
"tsd": "^0.6.5-beta",
"tslint": "^3.2.1",
"typescript": "^1.7.3",
Expand Down
22 changes: 21 additions & 1 deletion tools/broccoli/trees/node_tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ var path = require('path');
import renderLodashTemplate from '../broccoli-lodash';
import replace from '../broccoli-replace';
var stew = require('broccoli-stew');
var writeFile = require('broccoli-file-creator');

var projectRootDir = path.normalize(path.join(__dirname, '..', '..', '..', '..'));

Expand Down Expand Up @@ -118,7 +119,26 @@ module.exports = function makeNodeTree(projects, destinationPath) {
var srcPkgJsons = extractPkgJsons(srcTree, BASE_PACKAGE_JSON);
var testPkgJsons = extractPkgJsons(testTree, BASE_PACKAGE_JSON);

var nodeTree = mergeTrees([compiledTree, srcDocs, testDocs, srcPkgJsons, testPkgJsons]);
// Copy es6 typings so quickstart doesn't require typings install
let typingsTree = mergeTrees([
new Funnel('modules',
{
include: [
'angular2/typings/es6-collections/es6-collections.d.ts',
'angular2/typings/es6-promise/es6-promise.d.ts',
]
}),
writeFile('angular2/typings/browser.d.ts',
'// Typings needed for compilation with --target=es5\n' +
'///<reference path="./es6-collections/es6-collections.d.ts"/>\n' +
'///<reference path="./es6-promise/es6-promise.d.ts"/>\n' +
'// Workaround for https://github.com/ReactiveX/RxJS/issues/1270\n' +
'// to be removed when angular2 upgrades to rxjs beta.2\n' +
'declare type PromiseConstructor = typeof Promise;\n')
]);

var nodeTree =
mergeTrees([compiledTree, srcDocs, testDocs, srcPkgJsons, testPkgJsons, typingsTree]);

// Transform all tests to make them runnable in node
nodeTree = replace(nodeTree, {
Expand Down

0 comments on commit 3d715a2

Please sign in to comment.