Skip to content

Commit 75897c2

Browse files
committed
Initial public release
0 parents  commit 75897c2

File tree

317 files changed

+43123
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

317 files changed

+43123
-0
lines changed

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false

.gitignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
.DS_STORE
2+
node_modules
3+
*~
4+
*.pyc
5+
static
6+
.grunt
7+
_SpecRunner.html
8+
build/
9+
*.gem
10+
docs/code
11+
docs/_site
12+
docs/.sass-cache
13+
docs/css/react.css
14+
docs/js/JSXTransformer.js
15+
docs/js/react.min.js
16+
docs/js/docs.js
17+
docs/js/live_editor.js
18+
docs/js/examples
19+
docs/downloads
20+
examples/shared/*.js
21+

.jshintrc

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"node": true,
3+
4+
"boss": true,
5+
"curly": true,
6+
"devel": true,
7+
"eqnull": true,
8+
"expr": true,
9+
"funcscope": true,
10+
"globalstrict": true,
11+
"loopfunc": true,
12+
"newcap": false,
13+
"noempty": true,
14+
"nonstandard": true,
15+
"onecase": true,
16+
"regexdash": true,
17+
"trailing": true,
18+
"undef": true,
19+
"unused": "vars"
20+
}

CONTRIBUTING.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Contributing to React
2+
3+
React is one of Facebook's first open source projects that is both under very active development and is also being used to ship code to everybody on facebook.com. We're still working out the kinks to make contributing to this project as easy and transparent as possible, but we're not quite there yet. Hopefully this document makes the process for contributing clear and preempts some questions you may have.
4+
5+
## Our Development Process
6+
7+
Some of the core team will be working directly on GitHub. These changes will be public from the beginning. Other changesets will come via a bridge with Facebook's internal source control. This is a necessity as it allows engineers at Facebook outside of the core team to move fast and contribute from an environment they are comfortable in.
8+
9+
### `master` is unsafe
10+
11+
We will do our best to keep `master` in good shape, with tests passing at all times. But in order to move fast, we will make API changes that your application might not be compatible with. We will do our best to communicate these changes and always version appropriately so you can lock into a specific version if need be.
12+
13+
### Pull Requests
14+
15+
The core team will be monitoring for pull requests. When we get one, we will pull it in an apply it to Facebook's codebase and run our test suite to ensure nothing breaks. From here, we'll need to get another person to sign off on the changes. For API changes we may need to fix internal uses, which could cause some delay. We'll do our best to provide updates and feedback throughout the process.
16+
17+
*Before* submitting a pull request, please make sure the following is done…
18+
19+
1. Fork the repo and create your branch from `master`.
20+
2. If you've added code that should be tested, add tests!
21+
3. If you've changed APIs, update the documentation.
22+
4. Ensure the test suite passes (`grunt test`).
23+
5. Make sure your code lints (`grunt lint`) - we've done our best to make sure these rules match our internal linting guidelines.
24+
6. If you haven't already, complete the CLA.
25+
26+
### Contributor License Agreement ("CLA")
27+
28+
In order to accept your pull request, we need you to submit a CLA. You only need to do this once, so if you've done this for another Facebook open source project, you're good to go. If you are submitting a pull request for the first time, just let us know that you have completed the CLA and we can cross-check with your GitHub username.
29+
30+
Complete your CLA here: <https://developers.facebook.com/opensource/cla>
31+
32+
## Bugs
33+
34+
### Where to Find Known Issues
35+
36+
We will be using GitHub Issues for our public bugs. We will keep a close eye on this and try to make it clear when we have an internal fix in progress. Before filing a new task, try to make sure your problem doesn't already exist.
37+
38+
### Reporting New Issues
39+
40+
The best way to get your bug fixed is to provide a reduced test case. jsFiddle, jsBin, and other sites provide a way to give live examples. Those are especially helpful though may not work for `JSX`-based code.
41+
42+
### Security Bugs
43+
44+
Facebook has a [bounty program](https://www.facebook.com/whitehat/) for the safe disclosure of security bugs. With that in mind, please do not file public issues and go through the process outlined on that page.
45+
46+
## How to Get in Touch
47+
48+
* IRC - [#reactjs on freenode](http://webchat.freenode.net/?channels=reactjs)
49+
* Mailing list - [reactjs on Google Groups](http://groups.google.com/group/reactjs)
50+
51+
## Coding Style
52+
53+
* Use semicolons;
54+
* Commas last,
55+
* 2 spaces for indentation (no tabs)
56+
* Prefer `'` over `"`
57+
* `"use strict";`
58+
* 80 character line length
59+
* "Attractive"
60+
61+
## License
62+
63+
By contributing to React, you agree that your contributions will be licensed under the [Apache License Version 2.0 (APLv2)](LICENSE).

Gruntfile.js

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
'use strict';
2+
3+
var exec = require('child_process').exec;
4+
var jsxTask = require('./grunt/tasks/jsx');
5+
var browserifyTask = require('./grunt/tasks/browserify');
6+
var wrapupTask = require('./grunt/tasks/wrapup');
7+
var phantomTask = require('./grunt/tasks/phantom');
8+
var releaseTasks = require('./grunt/tasks/release');
9+
10+
module.exports = function(grunt) {
11+
12+
grunt.initConfig({
13+
pkg: grunt.file.readJSON('package.json'),
14+
copy: require('./grunt/config/copy'),
15+
jsx: require('./grunt/config/jsx/jsx'),
16+
browserify: require('./grunt/config/browserify'),
17+
wrapup: require('./grunt/config/wrapup'),
18+
phantom: require('./grunt/config/phantom'),
19+
clean: ['./build', './*.gem', './docs/_site', './examples/shared/*.js'],
20+
jshint: require('./grunt/config/jshint'),
21+
compare_size: require('./grunt/config/compare_size')
22+
});
23+
24+
grunt.config.set('compress', require('./grunt/config/compress'));
25+
26+
grunt.loadNpmTasks('grunt-contrib-jshint');
27+
grunt.loadNpmTasks('grunt-contrib-copy');
28+
grunt.loadNpmTasks('grunt-contrib-clean');
29+
grunt.loadNpmTasks('grunt-compare-size');
30+
grunt.loadNpmTasks('grunt-contrib-compress');
31+
32+
// Alias 'jshint' to 'lint' to better match the workflow we know
33+
grunt.registerTask('lint', ['jshint']);
34+
35+
// Register jsx:debug and :release tasks.
36+
grunt.registerMultiTask('jsx', jsxTask);
37+
38+
// Our own browserify-based tasks to build a single JS file build
39+
grunt.registerMultiTask('browserify', browserifyTask);
40+
41+
// Similar to Browserify, use WrapUp to generate single JS file that
42+
// defines global variables instead of using require.
43+
grunt.registerMultiTask('wrapup', wrapupTask);
44+
45+
grunt.registerMultiTask('phantom', phantomTask);
46+
47+
grunt.registerTask('build:basic', ['jsx:debug', 'browserify:basic']);
48+
grunt.registerTask('build:transformer', ['jsx:debug', 'browserify:transformer']);
49+
grunt.registerTask('build:min', ['jsx:release', 'browserify:min']);
50+
grunt.registerTask('build:test', [
51+
'jsx:debug',
52+
'jsx:test',
53+
'browserify:test'
54+
]);
55+
56+
grunt.registerTask('test', ['build:test', 'phantom:run']);
57+
58+
// Optimized build task that does all of our builds. The subtasks will be run
59+
// in order so we can take advantage of that and only run jsx:debug once.
60+
grunt.registerTask('build', [
61+
'jsx:debug',
62+
'browserify:basic',
63+
'browserify:transformer',
64+
'jsx:release',
65+
'browserify:min',
66+
'copy:react_docs',
67+
'compare_size'
68+
]);
69+
70+
// Automate the release!
71+
grunt.registerTask('release:setup', releaseTasks.setup);
72+
grunt.registerTask('release:bower', releaseTasks.bower);
73+
grunt.registerTask('release:docs', releaseTasks.docs);
74+
grunt.registerTask('release:msg', releaseTasks.msg);
75+
grunt.registerTask('release:starter', releaseTasks.starter);
76+
77+
grunt.registerTask('release', [
78+
'release:setup',
79+
'clean',
80+
'build',
81+
'gem:only',
82+
'release:bower',
83+
'release:starter',
84+
'compress',
85+
'release:docs',
86+
'release:msg'
87+
]);
88+
89+
// `gem` task to build the react-source gem
90+
grunt.registerTask('gem', ['build', 'gem:only']);
91+
92+
grunt.registerTask('gem:only', function() {
93+
var done = this.async();
94+
exec('gem build react-source.gemspec', done);
95+
});
96+
97+
// The default task - build - to keep setup easy
98+
grunt.registerTask('default', ['build']);
99+
};

0 commit comments

Comments
 (0)