Skip to content

Commit 19678ba

Browse files
committed
Merge pull request facebook#5396 from zpao/packagejsons
Improve npm packages' metadata (cherry picked from commit 6d5fe44)
1 parent a43dfdc commit 19678ba

File tree

3 files changed

+24
-8
lines changed

3 files changed

+24
-8
lines changed

grunt/tasks/npm-react-addons.js

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,35 +9,43 @@ var addons = {
99
CSSTransitionGroup: {
1010
module: 'ReactCSSTransitionGroup',
1111
name: 'css-transition-group',
12+
docs: 'animation',
1213
},
1314
LinkedStateMixin: {
1415
module: 'LinkedStateMixin',
1516
name: 'linked-state-mixin',
17+
docs: 'two-way-binding-helpers',
1618
},
1719
Perf: {
1820
module: 'ReactDefaultPerf',
1921
name: 'perf',
22+
docs: 'perf',
2023
},
2124
PureRenderMixin: {
2225
module: 'ReactComponentWithPureRenderMixin',
2326
name: 'pure-render-mixin',
27+
docs: 'pure-render-mixin',
2428
},
2529
TestUtils: {
2630
module: 'ReactTestUtils',
2731
name: 'test-utils',
32+
docs: 'test-utils',
2833
},
2934
TransitionGroup: {
3035
module: 'ReactTransitionGroup',
3136
name: 'transition-group',
37+
docs: 'animation',
3238
},
3339
cloneWithProps: {
3440
module: 'cloneWithProps',
3541
name: 'clone-with-props',
42+
docs: 'clone-with-props',
3643
},
3744
createFragment: {
3845
module: 'ReactFragment',
3946
method: 'create',
4047
name: 'create-fragment',
48+
docs: 'create-fragment',
4149
},
4250
shallowCompare: {
4351
module: 'shallowCompare',
@@ -46,6 +54,7 @@ var addons = {
4654
updates: {
4755
module: 'update',
4856
name: 'update',
57+
docs: 'update',
4958
},
5059
};
5160

@@ -76,15 +85,20 @@ function buildReleases() {
7685
pkgData.name = pkgName;
7786

7887
grunt.file.mkdir(destDir);
88+
var link = info.docs ? info.docs : 'addons';
89+
link = `https://facebook.github.io/react/docs/${link}.html`;
7990
fs.writeFileSync(path.join(destDir, 'index.js'), generateSource(info));
8091
fs.writeFileSync(path.join(destDir, 'package.json'), JSON.stringify(pkgData, null, 2));
8192
fs.writeFileSync(path.join(destDir, 'LICENSE'), license);
8293
fs.writeFileSync(path.join(destDir, 'PATENTS'), patents);
8394
fs.writeFileSync(
8495
path.join(destDir, 'README.md'),
85-
'# ' + pkgName + '\n\n' +
86-
'This package provides the React ' + k + ' add-on. See ' +
87-
'http://facebook.github.io/react/docs/addons.html for more information.\n'
96+
`
97+
# ${pkgName}
98+
99+
This package provides the React ${k} add-on.
100+
101+
See <${link}> for more information.`.slice(1)
88102
);
89103
});
90104

packages/react-addons/package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
{
2-
"name": "react-addons",
2+
"name": "react-addons-template",
33
"version": "0.14.3-alpha",
44
"main": "index.js",
5+
"repository": "facebook/react",
6+
"keywords": [
7+
"react",
8+
"react-addon"
9+
],
510
"license": "BSD-3-Clause",
611
"peerDependencies": {
712
"react": "^0.14.3-alpha"

packages/react-dom/package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@
33
"version": "0.14.3-alpha",
44
"description": "React package for working with the DOM.",
55
"main": "index.js",
6-
"repository": {
7-
"type": "git",
8-
"url": "git+https://github.com/facebook/react.git"
9-
},
6+
"repository": "facebook/react",
107
"keywords": [
118
"react"
129
],

0 commit comments

Comments
 (0)