Skip to content

Commit f528191

Browse files
committed
Initial commit
0 parents  commit f528191

File tree

134 files changed

+19306
-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.

134 files changed

+19306
-0
lines changed

.editorconfig

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# EditorConfig helps developers define and maintain consistent
2+
# coding styles between different editors and IDEs
3+
# http://editorconfig.org
4+
5+
root = true
6+
7+
[*]
8+
9+
# Change these settings to your own preference
10+
indent_style = space
11+
indent_size = 2
12+
13+
# We recommend you to keep these unchanged
14+
end_of_line = lf
15+
charset = utf-8
16+
trim_trailing_whitespace = true
17+
insert_final_newline = true
18+
19+
# editorconfig-tools is unable to ignore longs strings or urls
20+
max_line_length = null

.eslintrc.js

+105
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
/**
2+
* React Starter Kit (https://www.reactstarterkit.com/)
3+
*
4+
* Copyright © 2014-present Kriasoft, LLC. All rights reserved.
5+
*
6+
* This source code is licensed under the MIT license found in the
7+
* LICENSE.txt file in the root directory of this source tree.
8+
*/
9+
10+
// ESLint configuration
11+
// http://eslint.org/docs/user-guide/configuring
12+
module.exports = {
13+
parser: 'babel-eslint',
14+
15+
extends: [
16+
'airbnb',
17+
'plugin:flowtype/recommended',
18+
'plugin:css-modules/recommended',
19+
'prettier',
20+
'prettier/flowtype',
21+
'prettier/react',
22+
],
23+
24+
plugins: ['flowtype', 'css-modules', 'prettier', 'jest'],
25+
26+
globals: {
27+
__DEV__: true,
28+
},
29+
30+
env: {
31+
browser: true,
32+
jest: true,
33+
},
34+
35+
rules: {
36+
// Forbid the use of extraneous packages
37+
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-extraneous-dependencies.md
38+
'import/no-extraneous-dependencies': ['error', { packageDir: '.' }],
39+
40+
// Recommend not to leave any console.log in your code
41+
// Use console.error, console.warn and console.info instead
42+
// https://eslint.org/docs/rules/no-console
43+
'no-console': [
44+
'error',
45+
{
46+
allow: ['warn', 'error', 'info'],
47+
},
48+
],
49+
50+
// Prefer destructuring from arrays and objects
51+
// http://eslint.org/docs/rules/prefer-destructuring
52+
'prefer-destructuring': [
53+
'error',
54+
{
55+
VariableDeclarator: {
56+
array: false,
57+
object: true,
58+
},
59+
AssignmentExpression: {
60+
array: false,
61+
object: false,
62+
},
63+
},
64+
{
65+
enforceForRenamedProperties: false,
66+
},
67+
],
68+
69+
// Ensure <a> tags are valid
70+
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-is-valid.md
71+
'jsx-a11y/anchor-is-valid': [
72+
'error',
73+
{
74+
components: ['Link'],
75+
specialLink: ['to'],
76+
aspects: ['noHref', 'invalidHref', 'preferButton'],
77+
},
78+
],
79+
80+
// Allow .js files to use JSX syntax
81+
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-filename-extension.md
82+
'react/jsx-filename-extension': ['error', { extensions: ['.js', '.jsx'] }],
83+
84+
// Functional and class components are equivalent from React’s point of view
85+
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prefer-stateless-function.md
86+
'react/prefer-stateless-function': 'off',
87+
88+
// ESLint plugin for prettier formatting
89+
// https://github.com/prettier/eslint-plugin-prettier
90+
'prettier/prettier': 'error',
91+
92+
'react/forbid-prop-types': 'off',
93+
'react/destructuring-assignment': 'off',
94+
},
95+
96+
settings: {
97+
// Allow absolute paths in imports, e.g. import Button from 'components/Button'
98+
// https://github.com/benmosher/eslint-plugin-import/tree/master/resolvers
99+
'import/resolver': {
100+
node: {
101+
moduleDirectory: ['node_modules', 'src'],
102+
},
103+
},
104+
},
105+
};

.flowconfig

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[ignore]
2+
.*/build
3+
.*/docs
4+
.*/node_modules
5+
.*/public
6+
7+
[include]
8+
9+
[options]
10+
module.system.node.resolve_dirname=node_modules
11+
module.system.node.resolve_dirname=src

.gitattributes

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Automatically normalize line endings for all text-based files
2+
# http://git-scm.com/docs/gitattributes#_end_of_line_conversion
3+
* text=auto
4+
5+
# For the following file types, normalize line endings to LF on
6+
# checkin and prevent conversion to CRLF when they are checked out
7+
# (this is required in order to prevent newline related issues like,
8+
# for example, after the build script is run)
9+
.* text eol=lf
10+
*.html text eol=lf
11+
*.css text eol=lf
12+
*.less text eol=lf
13+
*.styl text eol=lf
14+
*.scss text eol=lf
15+
*.sass text eol=lf
16+
*.sss text eol=lf
17+
*.js text eol=lf
18+
*.jsx text eol=lf
19+
*.json text eol=lf
20+
*.md text eol=lf
21+
*.mjs text eol=lf
22+
*.sh text eol=lf
23+
*.svg text eol=lf
24+
*.txt text eol=lf
25+
*.xml text eol=lf

.gitignore

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# See https://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# Dependencies
4+
node_modules/
5+
6+
# Compiled output
7+
build
8+
9+
# Runtime data
10+
database.sqlite
11+
12+
# Test coverage
13+
coverage
14+
15+
# Logs
16+
npm-debug.log*
17+
yarn-debug.log*
18+
yarn-error.log*
19+
20+
# Editors and IDEs
21+
.idea
22+
.vscode/*
23+
!.vscode/settings.json
24+
!.vscode/tasks.json
25+
!.vscode/launch.json
26+
!.vscode/extensions.json
27+
28+
# Misc
29+
.DS_Store

.prettierignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package.json

.prettierrc.js

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/**
2+
* React Starter Kit (https://www.reactstarterkit.com/)
3+
*
4+
* Copyright © 2014-present Kriasoft, LLC. All rights reserved.
5+
*
6+
* This source code is licensed under the MIT license found in the
7+
* LICENSE.txt file in the root directory of this source tree.
8+
*/
9+
10+
// Prettier configuration
11+
// https://prettier.io/docs/en/configuration.html
12+
module.exports = {
13+
printWidth: 80,
14+
singleQuote: true,
15+
trailingComma: 'all',
16+
};

.stylelintrc.js

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/**
2+
* React Starter Kit (https://www.reactstarterkit.com/)
3+
*
4+
* Copyright © 2014-present Kriasoft, LLC. All rights reserved.
5+
*
6+
* This source code is licensed under the MIT license found in the
7+
* LICENSE.txt file in the root directory of this source tree.
8+
*/
9+
10+
// stylelint configuration
11+
// https://stylelint.io/user-guide/configuration/
12+
module.exports = {
13+
// The standard config based on a handful of CSS style guides
14+
// https://github.com/stylelint/stylelint-config-standard
15+
extends: 'stylelint-config-standard',
16+
17+
plugins: [
18+
// stylelint plugin to sort CSS rules content with specified order
19+
// https://github.com/hudochenkov/stylelint-order
20+
'stylelint-order',
21+
],
22+
23+
rules: {
24+
'property-no-unknown': [
25+
true,
26+
{
27+
ignoreProperties: [
28+
// CSS Modules composition
29+
// https://github.com/css-modules/css-modules#composition
30+
'composes',
31+
],
32+
},
33+
],
34+
35+
'selector-pseudo-class-no-unknown': [
36+
true,
37+
{
38+
ignorePseudoClasses: [
39+
// CSS Modules :global scope
40+
// https://github.com/css-modules/css-modules#exceptions
41+
'global',
42+
'local',
43+
],
44+
},
45+
],
46+
47+
// Opinionated rule, you can disable it if you want
48+
'string-quotes': 'single',
49+
50+
// https://github.com/hudochenkov/stylelint-order/blob/master/rules/order/README.md
51+
'order/order': [
52+
'custom-properties',
53+
'dollar-variables',
54+
'declarations',
55+
'at-rules',
56+
'rules',
57+
],
58+
59+
// https://github.com/hudochenkov/stylelint-order/blob/master/rules/properties-order/README.md
60+
'order/properties-order': [],
61+
},
62+
};

.travis.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
language: node_js
2+
node_js:
3+
- 'stable'
4+
- '12'
5+
- '10'
6+
- '8'
7+
env:
8+
- CXX=g++-4.8
9+
addons:
10+
apt:
11+
sources:
12+
- ubuntu-toolchain-r-test
13+
packages:
14+
- g++-4.8
15+
cache: yarn
16+
script:
17+
- yarn lint
18+
- yarn test
19+
- yarn build --release

CHANGELOG.md

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
## React Starter Kit Change Log
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
### [Unreleased][unreleased]
6+
7+
- Split the `App` component into `App` setting context variables and `Layout` setting general look and feel of the app (BREAKING CHANGE)
8+
- Upgrade `history` npm module to v4.x, update `Link` component (BREAKING CHANGE)
9+
- Remove `core/createHistory.js` in favor of initializing a new history instance inside `server.js` and `client.js` (BREAKING CHANGE)
10+
- Remove Jade dependency in favor of React-based templates: `src/views/index.jade => src/components/Html`
11+
(BREAKING CHANGE) [#711](https://github.com/kriasoft/react-starter-kit/pull/711)
12+
- Update `isomorphic-style-loader` to `v1.0.0`, it adds comparability with ES2015+ decorators.
13+
Code such as `export default withStyles(MyComponent, style1, style2)` must be replaced with
14+
`export default withStyles(style1, style2)(MyComponent)` (BREAKING CHANGE).
15+
- Replace Jest with Mocha, Chai, Sinon. Unit test files must be renamed from
16+
`MyComponent/__test__/MyComponent-test.js` to `MyComponent/MyComponent.test.js` (BREAKING CHANGE).
17+
- Remove `actions`, `stores` folders since there is no Flux library included into the kit
18+
- Rename `server` variable in `server.js` to `app`
19+
- Integrate [Sequelize](http://docs.sequelizejs.com/) to make the project compatible with different types of databases
20+
- Rename `onSetTitle`, `onSetMeta` context variables to `setTitle`, `setMeta`
21+
- Move `Content` component to `src/routes/content`
22+
- Move `ErrorPage` component to `src/routes/error`
23+
- Move the list of top-level routes to `src/routes/index`
24+
- Update routing to use `universal-router` library
25+
- Move Babel, ESLint and JSCS configurations to `package.json` [#497](https://github.com/kriasoft/react-starter-kit/pull/497)
26+
- Convert `Feedback`, `Footer`, `Header`, and `Navigation` to functional stateless components
27+
- Move page / screen components into the `src/routes` folder along with the routing information for them (BREAKING CHANGE). [6553936](https://github.com/kriasoft/react-starter-kit/commit/6553936e693e24a8ac6178f4962af15e0ea87dfd)
28+
29+
### [v0.5.1]
30+
31+
> 2016-03-02
32+
33+
- Remove `Html` React component in favor of compiled Jade templates (`src/views`) (BREAKING CHANGE). [e188388](https://github.com/kriasoft/react-starter-kit/commit/e188388f87069cdc7d501b385d6b0e46c98fed60)
34+
- Add global error handling in Node.js/Express app. [e188388](https://github.com/kriasoft/react-starter-kit/commit/e188388f87069cdc7d501b385d6b0e46c98fed60)
35+
- Add support for Markdown and HTML for static pages. [#469](https://github.com/kriasoft/react-starter-kit/pull/469), [#477](https://github.com/kriasoft/react-starter-kit/pull/477)
36+
37+
### [v0.5.0]
38+
39+
> 2016-02-27
40+
41+
- Replace RESTful API endpoint (`src/api`) with GraphQL (`src/data`)
42+
- Add a sample GraphQL endpoint [localhost:3000/graphql](https://localhost:3000/graphql)
43+
- Change the default Node.js server port from `5000` to `3000`
44+
- Add a JWT-based authentication cookies (see `src/server.js`)
45+
- Add a reference implementation of Facebook authentication strategy (`src/core/passport.js`)
46+
- Add a sample database client utility for PostgreSQL (`src/core/db.js`)
47+
- Optimize the `tools/start.js` script that launches dev server with Browsersync and HMR
48+
- Replace Superagent with WHATWG Fetch library
49+
- Rename `app.js` to `client.js` (aka client-side code)
50+
- Integrate [CSS Modules](https://github.com/css-modules/css-modules) and
51+
[isomorphic-style-loader](https://github.com/kriasoft/isomorphic-style-loader)
52+
- Move `DOMUtils.js` to `src/core` folder; remove `src/utils` folder
53+
- Replace [cssnext](http://cssnext.io/) with [precss](https://github.com/jonathantneal/precss)
54+
- Update build automation scripts to use plain functions
55+
- Add support of `--release` and `--verbose` flags to build scripts
56+
- Add `CHANGELOG.md` file with a list of notable changes to this project
57+
58+
### [v0.4.1]
59+
60+
> 2015-10-04
61+
62+
- Replace React Hot Loader (deprecated) with React Transform
63+
- Replace `index.html` template with `Html` (shell) React component
64+
- Update the deployment script (`tools/deploy.js`), add Git-based deployment example
65+
- Update ESLint and JSCS settings to use AirBnb JavaScript style guide
66+
- Update `docs/how-to-configure-text-editors.md` to cover Atom editor
67+
- Update NPM production and dev dependencies to use the latest versions
68+
69+
[unreleased]: https://github.com/kriasoft/react-starter-kit/compare/v0.5.1...HEAD
70+
[v0.5.1]: https://github.com/kriasoft/react-starter-kit/compare/v0.5.0...v0.5.1
71+
[v0.5.0]: https://github.com/kriasoft/react-starter-kit/compare/v0.4.1...v0.5.0
72+
[v0.4.1]: https://github.com/kriasoft/react-starter-kit/compare/v0.4.0...v0.4.1

0 commit comments

Comments
 (0)