Skip to content

Commit

Permalink
Merge pull request facebook#5396 from zpao/packagejsons
Browse files Browse the repository at this point in the history
Improve npm packages' metadata
  • Loading branch information
zpao committed Nov 5, 2015
2 parents 9b7cc43 + 88584a9 commit 6d5fe44
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 8 deletions.
20 changes: 17 additions & 3 deletions grunt/tasks/npm-react-addons.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,35 +9,43 @@ var addons = {
CSSTransitionGroup: {
module: 'ReactCSSTransitionGroup',
name: 'css-transition-group',
docs: 'animation',
},
LinkedStateMixin: {
module: 'LinkedStateMixin',
name: 'linked-state-mixin',
docs: 'two-way-binding-helpers',
},
Perf: {
module: 'ReactDefaultPerf',
name: 'perf',
docs: 'perf',
},
PureRenderMixin: {
module: 'ReactComponentWithPureRenderMixin',
name: 'pure-render-mixin',
docs: 'pure-render-mixin',
},
TestUtils: {
module: 'ReactTestUtils',
name: 'test-utils',
docs: 'test-utils',
},
TransitionGroup: {
module: 'ReactTransitionGroup',
name: 'transition-group',
docs: 'animation',
},
cloneWithProps: {
module: 'cloneWithProps',
name: 'clone-with-props',
docs: 'clone-with-props',
},
createFragment: {
module: 'ReactFragment',
method: 'create',
name: 'create-fragment',
docs: 'create-fragment',
},
shallowCompare: {
module: 'shallowCompare',
Expand All @@ -46,6 +54,7 @@ var addons = {
updates: {
module: 'update',
name: 'update',
docs: 'update',
},
};

Expand Down Expand Up @@ -76,15 +85,20 @@ function buildReleases() {
pkgData.name = pkgName;

grunt.file.mkdir(destDir);
var link = info.docs ? info.docs : 'addons';
link = `https://facebook.github.io/react/docs/${link}.html`;
fs.writeFileSync(path.join(destDir, 'index.js'), generateSource(info));
fs.writeFileSync(path.join(destDir, 'package.json'), JSON.stringify(pkgData, null, 2));
fs.writeFileSync(path.join(destDir, 'LICENSE'), license);
fs.writeFileSync(path.join(destDir, 'PATENTS'), patents);
fs.writeFileSync(
path.join(destDir, 'README.md'),
'# ' + pkgName + '\n\n' +
'This package provides the React ' + k + ' add-on. See ' +
'http://facebook.github.io/react/docs/addons.html for more information.\n'
`
# ${pkgName}
This package provides the React ${k} add-on.
See <${link}> for more information.`.slice(1)
);
});

Expand Down
7 changes: 6 additions & 1 deletion packages/react-addons/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
{
"name": "react-addons",
"name": "react-addons-template",
"version": "0.15.0-alpha",
"main": "index.js",
"repository": "facebook/react",
"keywords": [
"react",
"react-addon"
],
"license": "BSD-3-Clause",
"peerDependencies": {
"react": "^0.15.0-alpha"
Expand Down
5 changes: 1 addition & 4 deletions packages/react-dom/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
"version": "0.15.0-alpha",
"description": "React package for working with the DOM.",
"main": "index.js",
"repository": {
"type": "git",
"url": "git+https://github.com/facebook/react.git"
},
"repository": "facebook/react",
"keywords": [
"react"
],
Expand Down

0 comments on commit 6d5fe44

Please sign in to comment.