Skip to content

Commit

Permalink
Merge branch 'master' of github.com:kriasoft/react-starter-kit
Browse files Browse the repository at this point in the history
* 'master' of github.com:kriasoft/react-starter-kit: (68 commits)
  Format Markdown (.md) files by Prettier (kriasoft#1461)
  Move prettier options to a separate file for editor or ide plugin
  Update dependencies; bump react to v16.1.1
  Update Babel to v7.0.0-beta.32 (kriasoft#1452)
  Update universal-router and react-error-overlay
  Use babel react optimization plugins for production instead of development
  Bump babel-preset-env
  Update dependencies; fix eslint warnings
  Update yarn.lock
  Add tools to babel-loader include
  Fore all Babel transforms in release mode only for UglifyJS2
  Update babel-plugin-transform-react-* to v7
  Fix babel ignore configuration
  Use webpack-hot-middleware api instead of query string
  Improve developer experience; update react-error-overlay (kriasoft#1421)
  Update React to v16 (kriasoft#1417)
  Update server-side dependencies
  Update Babel to v7 (kriasoft#1413)
  Remove unused mocha configs and dependencies
  Update PostCSS related dependencies, remove unused
  ...
  • Loading branch information
buildbreakdo committed Dec 3, 2017
2 parents 50ef669 + 8e79361 commit 0ca56b6
Show file tree
Hide file tree
Showing 89 changed files with 6,585 additions and 3,329 deletions.
27 changes: 27 additions & 0 deletions .babelrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* React Starter Kit (https://www.reactstarterkit.com/)
*
* Copyright © 2014-present Kriasoft, LLC. All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE.txt file in the root directory of this source tree.
*/

// Babel configuration
// https://babeljs.io/docs/usage/api/
module.exports = {
presets: [
[
'@babel/preset-env',
{
targets: {
node: 'current',
},
},
],
'@babel/preset-stage-2',
'@babel/preset-flow',
'@babel/preset-react',
],
ignore: ['node_modules', 'build'],
};
120 changes: 78 additions & 42 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,56 +10,92 @@
// ESLint configuration
// http://eslint.org/docs/user-guide/configuring
module.exports = {
parser: 'babel-eslint',
parser: 'babel-eslint',

extends: [
'airbnb',
'plugin:css-modules/recommended',
],
extends: [
'airbnb',
'plugin:flowtype/recommended',
'plugin:css-modules/recommended',
'prettier',
'prettier/flowtype',
'prettier/react',
],

plugins: [
'css-modules',
],
plugins: ['flowtype', 'css-modules', 'prettier'],

globals: {
__DEV__: true,
},
globals: {
__DEV__: true,
},

env: {
browser: true,
},
env: {
browser: true,
},

rules: {
// `js` and `jsx` are common extensions
// `mjs` is for `universal-router` only, for now
'import/extensions': [
'error',
'always',
{
js: 'never',
jsx: 'never',
mjs: 'never',
},
],
rules: {
// Forbid the use of extraneous packages
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-extraneous-dependencies.md
'import/no-extraneous-dependencies': ['error', { packageDir: '.' }],

// Not supporting nested package.json yet
// https://github.com/benmosher/eslint-plugin-import/issues/458
'import/no-extraneous-dependencies': 'off',
// Recommend not to leave any console.log in your code
// Use console.error, console.warn and console.info instead
// https://eslint.org/docs/rules/no-console
'no-console': [
'error',
{
allow: ['warn', 'error', 'info'],
},
],

// Recommend not to leave any console.log in your code
// Use console.error, console.warn and console.info instead
'no-console': [
'error',
{
allow: ['warn', 'error', 'info'],
// Prefer destructuring from arrays and objects
// http://eslint.org/docs/rules/prefer-destructuring
'prefer-destructuring': [
'error',
{
VariableDeclarator: {
array: false,
object: true,
},
],
AssignmentExpression: {
array: false,
object: false,
},
},
{
enforceForRenamedProperties: false,
},
],

// Ensure <a> tags are valid
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-is-valid.md
'jsx-a11y/anchor-is-valid': [
'error',
{
components: ['Link'],
specialLink: ['to'],
aspects: ['noHref', 'invalidHref', 'preferButton'],
},
],

// Allow .js files to use JSX syntax
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-filename-extension.md
'react/jsx-filename-extension': ['error', { extensions: ['.js', '.jsx'] }],

// Functional and class components are equivalent from React’s point of view
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prefer-stateless-function.md
'react/prefer-stateless-function': 'off',

// Allow js files to use jsx syntax, too
'react/jsx-filename-extension': 'off',
// ESLint plugin for prettier formatting
// https://github.com/prettier/eslint-plugin-prettier
'prettier/prettier': 'error',
},

// https://github.com/kriasoft/react-starter-kit/pull/961
// You can reopen this if you still want this rule
'react/prefer-stateless-function': 'off',
settings: {
// Allow absolute paths in imports, e.g. import Button from 'components/Button'
// https://github.com/benmosher/eslint-plugin-import/tree/master/resolvers
'import/resolver': {
node: {
moduleDirectory: ['node_modules', 'src'],
},
},
};
},
};
4 changes: 4 additions & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@
.*/public

[include]

[options]
module.system.node.resolve_dirname=node_modules
module.system.node.resolve_dirname=src
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,16 @@
*.html text eol=lf
*.css text eol=lf
*.less text eol=lf
*.styl text eol=lf
*.scss text eol=lf
*.sass text eol=lf
*.sss text eol=lf
*.js text eol=lf
*.jsx text eol=lf
*.json text eol=lf
*.md text eol=lf
*.mjs text eol=lf
*.sh text eol=lf
*.svg text eol=lf
*.txt text eol=lf
*.xml text eol=lf
32 changes: 26 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,29 @@
# Include your project-specific ignores in this file
# Read about how to use .gitignore: https://help.github.com/articles/ignoring-files
# See https://help.github.com/ignore-files/ for more about ignoring files.

.idea
# Dependencies
node_modules/

# Compiled output
build

# Runtime data
database.sqlite
node_modules
npm-debug.log
yarn-error.log

# Test coverage
coverage

# Logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Editors and IDEs
.idea
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

# Misc
.DS_Store
15 changes: 15 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/**
* React Starter Kit (https://www.reactstarterkit.com/)
*
* Copyright © 2014-present Kriasoft, LLC. All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE.txt file in the root directory of this source tree.
*/

// Prettier configuration
// https://prettier.io/docs/en/configuration.html
module.exports = {
singleQuote: true,
trailingComma: 'all',
};
61 changes: 61 additions & 0 deletions .stylelintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/**
* React Starter Kit (https://www.reactstarterkit.com/)
*
* Copyright © 2014-present Kriasoft, LLC. All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE.txt file in the root directory of this source tree.
*/

// stylelint configuration
// https://stylelint.io/user-guide/configuration/
module.exports = {
// The standard config based on a handful of CSS style guides
// https://github.com/stylelint/stylelint-config-standard
extends: 'stylelint-config-standard',

plugins: [
// stylelint plugin to sort CSS rules content with specified order
// https://github.com/hudochenkov/stylelint-order
'stylelint-order',
],

rules: {
'property-no-unknown': [
true,
{
ignoreProperties: [
// CSS Modules composition
// https://github.com/css-modules/css-modules#composition
'composes',
],
},
],

'selector-pseudo-class-no-unknown': [
true,
{
ignorePseudoClasses: [
// CSS Modules :global scope
// https://github.com/css-modules/css-modules#exceptions
'global',
],
},
],

// Opinionated rule, you can disable it if you want
'string-quotes': 'single',

// https://github.com/hudochenkov/stylelint-order/blob/master/rules/order/README.md
'order/order': [
'custom-properties',
'dollar-variables',
'declarations',
'at-rules',
'rules',
],

// https://github.com/hudochenkov/stylelint-order/blob/master/rules/properties-order/README.md
'order/properties-order': [],
},
};
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: node_js
node_js:
- '7'
- 'stable'
- '6'
env:
- CXX=g++-4.8
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ forked repo, check that it meets these guidelines:
* Create a separate PR for each small feature or bug fix.
* [Squash](http://stackoverflow.com/questions/5189560/squash-my-last-x-commits-together-using-git)
your commits into one for each PR.
* Run `yarn test` to make sure that your code style is OK and there are no any regression bugs.
* Run `yarn test` to make sure that your code style is OK and there are no any regression bugs.
* When contributing to an opt-in feature, apply the `[feature/...]` tag as a prefix to your PR title

#### Style Guide
Expand Down
12 changes: 9 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
FROM node:7.9.0-alpine
FROM node:8.6.0-alpine

# Set a working directory
WORKDIR /usr/src/app

# Copy application files
COPY ./build /usr/src/app
COPY ./build/package.json .
COPY ./build/yarn.lock .

# Install Node.js dependencies
RUN yarn install --production --no-progress

# Copy application files
COPY ./build .

# Run the container under "node" user by default
USER node

CMD [ "node", "server.js" ]
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@ and newcomers to the industry.
**Join** [#react-starter-kit][chat] chat room on Gitter &nbsp;|&nbsp;
**Visit our sponsors**:<br><br>

[![Rollbar - Full-stack error tracking for all apps in any language](https://koistya.github.io/files/rsk/rollbar.png)](https://rollbar.com/?utm_source=reactstartkit(github)&utm_medium=link&utm_campaign=reactstartkit(github)) &nbsp;&nbsp;
[![Localize - Translate your web app in minutes](https://koistya.github.io/files/rsk/localize.png)](https://localizejs.com/?cid=802&utm_source=rsk)
<p align="center" align="top">
<a href="https://rollbar.com/?utm_source=reactstartkit(github)&amp;utm_medium=link&amp;utm_campaign=reactstartkit(github)"><img src="https://koistya.github.io/files/rollbar-362x72.png" height="36" align="top" /></a>
<a href="https://x-team.com/hire-react-developers/?utm_source=reactstarterkit&amp;utm_medium=github-link&amp;utm_campaign=reactstarterkit-june"><img src="https://koistya.github.io/files/xteam-255x72.png" height="36" align="top" /></a>
<sup><a href="https://x-team.com/join/?utm_source=reactstarterkit&utm_medium=github-link&utm_campaign=reactstarterkit-june">Hiring</a></sup>
</p>


### Getting Started
Expand All @@ -32,18 +35,15 @@ The `master` branch of React Starter Kit doesn't include a Flux implementation o
advanced integrations. Nevertheless, we have some integrations available to you in *feature*
branches that you can use either as a reference or merge into your project:

* [feature/redux](https://github.com/kriasoft/react-starter-kit/tree/feature/redux) — isomorphic
Redux by [Pavel Lang](https://github.com/langpavel)
* [feature/redux](https://github.com/kriasoft/react-starter-kit/tree/feature/redux) ([PR](https://github.com/kriasoft/react-starter-kit/pull/1084))
— isomorphic Redux by [Pavel Lang](https://github.com/langpavel)
(see [how to integrate Redux](./docs/recipes/how-to-integrate-redux.md)) (based on `master`)
* [feature/apollo](https://github.com/kriasoft/react-starter-kit/tree/feature/apollo) — isomorphic
Apollo Client by [Pavel Lang](https://github.com/langpavel)
* [feature/apollo](https://github.com/kriasoft/react-starter-kit/tree/feature/apollo) ([PR](https://github.com/kriasoft/react-starter-kit/pull/1147))
— isomorphic Apollo Client by [Pavel Lang](https://github.com/langpavel)
(see [Tracking PR #1147](https://github.com/kriasoft/react-starter-kit/pull/1147)) (based on `feature/redux`)
* [feature/react-intl](https://github.com/kriasoft/react-starter-kit/tree/feature/react-intl)
isomorphic Redux and React Intl by [Pavel Lang](https://github.com/langpavel)
(see [how to integrate React Intl](./docs/recipes/how-to-integrate-react-intl.md)) (based on `feature/redux`)
* [feature/bootstrap3](https://github.com/kriasoft/react-starter-kit/tree/feature/bootstrap3) ***unmaintained***
Simplest possible integration of [react-bootstrap](https://react-bootstrap.github.io/)
by [Pavel Lang](https://github.com/langpavel) (based on `master`)
* [feature/react-intl](https://github.com/kriasoft/react-starter-kit/tree/feature/react-intl) ([PR](https://github.com/kriasoft/react-starter-kit/pull/1135))
— isomorphic Redux and React Intl by [Pavel Lang](https://github.com/langpavel)
(see [how to integrate React Intl](./docs/recipes/how-to-integrate-react-intl.md)) (based on `feature/apollo`)

You can see status of most reasonable merge combination as [PRs labeled as `TRACKING`](https://github.com/kriasoft/react-starter-kit/labels/TRACKING)

Expand Down
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@
* [How to Integrate React Intl](./recipes/how-to-integrate-react-intl.md)
* [How to Integrate Disqus](./recipes/how-to-integrate-disqus.md)
* [How to Use Sass/SCSS](./recipes/how-to-use-sass.md)
* [How to Configure Facebook Login](./recipes/how-to-configure-facebook-login.md)
Loading

0 comments on commit 0ca56b6

Please sign in to comment.