Skip to content

Commit

Permalink
chore(package): make firebase a dependency instead of peerDep in publ…
Browse files Browse the repository at this point in the history
…ished package

Fixes angular#311
  • Loading branch information
jeffbcross committed Jun 30, 2016
1 parent 88e6f25 commit 02cf7e1
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions tools/rewrite-published-package.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,24 @@
var fs = require('fs');
var srcPackage = require('../package.json');
var [MAIN, JSNEXT_MAIN] = ['main', 'jsnext:main'].map(k => srcPackage[k].replace('/dist/', '/'));

var peerDependencies = Object.assign({}, srcPackage.dependencies);
// See note about including firebase as dependency
delete peerDependencies.firebase;
var outPackage = Object.assign({}, srcPackage, {
peerDependencies: srcPackage.dependencies,
peerDependencies,
main: MAIN,
typings: "angularfire2.d.ts",
"jsnext:main": JSNEXT_MAIN,
dependencies: undefined
dependencies: {
/**
* Firebase SDK should be a dependency since it's not required that
* projects will install/use the SDK directly. And since Firebase uses
* semver, the version restriction is more permissive. This means if the user
* has installed Firebase already, npm is more likely to find a matching version.
**/
firebase: srcPackage.dependencies.firebase
}
});

fs.writeFileSync('./dist/package.json', JSON.stringify(outPackage, null, 2));

0 comments on commit 02cf7e1

Please sign in to comment.