Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve npm packages' metadata #5396

Merged
merged 2 commits into from
Nov 5, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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