├── .gitignore ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── actionTests ├── index.js └── templates │ └── spec.js ├── app ├── index.js └── templates │ ├── .babelrc │ ├── .csscomb.json │ ├── .csslintrc │ ├── .editorconfig │ ├── .eslintrc │ ├── .flowconfig │ ├── .jscsrc │ ├── .jshintrc │ ├── .scss-lint.yml │ ├── .travis.yml │ ├── README.md │ ├── _package.json │ ├── license.txt │ ├── preprocessor.js │ ├── src │ ├── app.js │ ├── common │ │ ├── components │ │ │ ├── Footer │ │ │ │ ├── Footer.js │ │ │ │ ├── Footer.scss │ │ │ │ └── package.json │ │ │ ├── Header │ │ │ │ ├── Header.js │ │ │ │ ├── Header.scss │ │ │ │ └── package.json │ │ │ ├── Html │ │ │ │ ├── Html.js │ │ │ │ └── package.json │ │ │ ├── Link │ │ │ │ ├── Link.js │ │ │ │ └── package.json │ │ │ ├── NotFoundPage │ │ │ │ ├── NotFoundPage.js │ │ │ │ ├── NotFoundPage.scss │ │ │ │ └── package.json │ │ │ └── TextBox │ │ │ │ ├── TextBox.js │ │ │ │ ├── TextBox.scss │ │ │ │ └── package.json │ │ ├── core │ │ │ ├── HttpClient.js │ │ │ └── Location.js │ │ ├── decorators │ │ │ ├── withContext.js │ │ │ ├── withStyles.js │ │ │ └── withViewport.js │ │ ├── middleware │ │ │ └── api.js │ │ ├── reducers │ │ │ └── index.js │ │ ├── store │ │ │ └── configureStore.js │ │ └── styles │ │ │ └── variables.scss │ ├── config.js │ ├── containers │ │ ├── AboutPage │ │ │ ├── AboutPage.js │ │ │ ├── AboutPage.scss │ │ │ └── package.json │ │ ├── App │ │ │ ├── App.js │ │ │ ├── App.scss │ │ │ └── package.json │ │ ├── ErrorPage │ │ │ ├── ErrorPage.js │ │ │ ├── ErrorPage.scss │ │ │ └── package.json │ │ ├── LandingPage │ │ │ ├── LandingPage.js │ │ │ ├── LandingPage.scss │ │ │ └── package.json │ │ └── NotFoundPage │ │ │ ├── NotFoundPage.js │ │ │ ├── NotFoundPage.scss │ │ │ └── package.json │ ├── public │ │ ├── apple-touch-icon.png │ │ ├── browserconfig.xml │ │ ├── crossdomain.xml │ │ ├── favicon.ico │ │ ├── humans.txt │ │ ├── robots.txt │ │ ├── tile-wide.png │ │ └── tile.png │ ├── routes.js │ ├── server.js │ └── utils │ │ ├── DOMUtils.js │ │ ├── createDevToolsWindow.js │ │ ├── devTools.js │ │ └── fs.js │ └── tools │ ├── build.js │ ├── bundle.js │ ├── clean.js │ ├── config.js │ ├── copy.js │ ├── lib │ ├── copy.js │ ├── fs.js │ └── watch.js │ ├── run.js │ ├── serve.js │ └── start.js ├── component ├── index.js └── templates │ ├── ComponentPage.js │ ├── ComponentPage.scss │ └── _package.json ├── container ├── index.js └── templates │ ├── ContainerPage.js │ ├── ContainerPage.scss │ └── _package.json ├── gulpfile.js ├── module ├── index.js └── templates │ ├── ModuleActions.js │ ├── ModuleConstants.js │ ├── ModulePage.js │ ├── ModulePage.scss │ ├── ModuleReducer.js │ ├── UpdatedCommonReducer.js │ └── _package.json ├── package.json ├── reducerTests └── index.js └── test └── component.js /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | 5 | # Runtime data 6 | pids 7 | *.pid 8 | *.seed 9 | 10 | # Directory for instrumented libs generated by jscoverage/JSCover 11 | lib-cov 12 | 13 | # Coverage directory used by tools like istanbul 14 | coverage 15 | 16 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 17 | .grunt 18 | 19 | # node-waf configuration 20 | .lock-wscript 21 | 22 | # Compiled binary addons (http://nodejs.org/api/addons.html) 23 | build/Release 24 | 25 | # Dependency directory 26 | # https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git 27 | node_modules 28 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to React-Redux Module Generator 2 | 3 | Want to get involved? 4 | Thanks! There are plenty of ways you can help! 5 | 6 | Please take a moment to review this document in order to make the contribution 7 | process easy and effective for everyone involved. 8 | 9 | Following these guidelines helps to communicate that you respect the time of 10 | the developers managing and developing this open source project. In return, 11 | they should reciprocate that respect in addressing your issue or assessing 12 | patches and features. 13 | 14 | 15 | ## Using the issue tracker 16 | 17 | The [issue tracker](https://github.com/jermspeaks/generator-react-redux/issues) is 18 | the preferred channel for [bug reports](#bugs), [features requests](#features) 19 | and [submitting pull requests](#pull-requests), but please respect the following 20 | restrictions: 21 | 22 | * Please **do not** derail or troll issues. Keep the discussion on topic and 23 | respect the opinions of others. 24 | 25 | 26 | ## Bug reports 27 | 28 | A bug is a _demonstrable problem_ that is caused by the code in the repository. 29 | Good bug reports are extremely helpful - thank you! 30 | 31 | Guidelines for bug reports: 32 | 33 | 1. **Use the GitHub issue search** — check if the issue has already been 34 | reported. 35 | 36 | 2. **Check if the issue has been fixed** — try to reproduce it using the 37 | latest `master` or development branch in the repository. 38 | 39 | 3. **Isolate the problem** — ideally create a [reduced test 40 | case](https://css-tricks.com/reduced-test-cases/) and a live example. 41 | 42 | A good bug report shouldn't leave others needing to chase you up for more 43 | information. Please try to be as detailed as possible in your report. What is 44 | your environment? What steps will reproduce the issue? What browser(s) and OS 45 | experience the problem? What would you expect to be the outcome? All these 46 | details will help people to fix any potential bugs. 47 | 48 | Example: 49 | 50 | > Short and descriptive example bug report title 51 | > 52 | > A summary of the issue and the browser/OS environment in which it occurs. If 53 | > suitable, include the steps required to reproduce the bug. 54 | > 55 | > 1. This is the first step 56 | > 2. This is the second step 57 | > 3. Further steps, etc. 58 | > 59 | > `` - a link to the reduced test case 60 | > 61 | > Any other information you want to share that is relevant to the issue being 62 | > reported. This might include the lines of code that you have identified as 63 | > causing the bug, and potential solutions (and your opinions on their 64 | > merits). 65 | 66 | 67 | 68 | ## Feature requests 69 | 70 | Feature requests are welcome. But take a moment to find out whether your idea 71 | fits with the scope and aims of the project. It's up to *you* to make a strong 72 | case to convince the project's developers of the merits of this feature. Please 73 | provide as much detail and context as possible. 74 | 75 | 76 | 77 | ## Pull requests 78 | 79 | Good pull requests - patches, improvements, new features - are a fantastic 80 | help. They should remain focused in scope and avoid containing unrelated 81 | commits. 82 | 83 | **Please ask first** before embarking on any significant pull request (e.g. 84 | implementing features, refactoring code, porting to a different language), 85 | otherwise you risk spending a lot of time working on something that the 86 | project's developers might not want to merge into the project. 87 | 88 | Please adhere to the coding conventions used throughout a project (indentation, 89 | accurate comments, etc.) and any other requirements (such as test coverage). 90 | 91 | Adhering to the following process is the best way to get your work 92 | included in the project: 93 | 94 | 1. [Fork](https://help.github.com/articles/fork-a-repo/) the project, clone your 95 | fork, and configure the remotes: 96 | 97 | ```bash 98 | # Clone your fork of the repo into the current directory 99 | git clone https://github.com//generator-react-redux.git 100 | # Navigate to the newly cloned directory 101 | cd generator-react-redux 102 | # Assign the original repo to a remote called "upstream" 103 | git remote add upstream https://github.com/jermspeaks/generator-react-redux.git 104 | ``` 105 | 106 | 2. If you cloned a while ago, get the latest changes from upstream: 107 | 108 | ```bash 109 | git checkout master 110 | git pull upstream master 111 | ``` 112 | 113 | 3. Create a new topic branch (off the main project development branch) to 114 | contain your feature, change, or fix: 115 | 116 | ```bash 117 | git checkout -b 118 | ``` 119 | 120 | 4. Commit your changes in logical chunks. Please adhere to these [git commit 121 | message guidelines](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) 122 | or your code is unlikely be merged into the main project. Use Git's 123 | [interactive rebase](https://help.github.com/articles/about-git-rebase/) 124 | feature to tidy up your commits before making them public. 125 | 126 | 5. Locally merge (or rebase) the upstream development branch into your topic branch: 127 | 128 | ```bash 129 | git pull [--rebase] upstream master 130 | ``` 131 | 132 | 6. Push your topic branch up to your fork: 133 | 134 | ```bash 135 | git push origin 136 | ``` 137 | 138 | 7. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/) 139 | with a clear title and description. 140 | 141 | **IMPORTANT**: By submitting a patch, you agree to allow the project 142 | owners to license your work under the terms of the [MIT License](LICENSE). 143 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Jeremy Wong 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # React & Redux Generator 2 | 3 | [![License](http://img.shields.io/:license-mit-blue.svg)](https://github.com/jermspeaks/generator-react-redux/blob/master/LICENSE) 4 | 5 | A Yeoman generator for React & Redux for projects vertically integrated. 6 | 7 | Of those out there, the React and Redux templates have a horizontal structure for their projects. 8 | This means all of your elements belong in the same folder, i.e. your components 9 | go in a `components` folder. 10 | 11 | This generator works for vertically integrated React and Redux projects. The 12 | sub-generator will create modules for you with a smaller version of the 13 | horizontal structure. Each module is self-contained, although there may be a 14 | base that is `common` to everything else. 15 | 16 | This repo is copied from [React/Flux Vertical generator](https://github.com/jermspeaks/generator-react-vertical), which I'm de-comissioning in favor of this one. 17 | 18 | ## Installation 19 | 20 | ### Yeoman 21 | 22 | For this generator to work, [Yeoman](https://github.com/yeoman/yo) must be globally installed. 23 | 24 | ```bash 25 | npm install -g yo 26 | ``` 27 | 28 | Then you can install this `generator-react-redux-modules` module. I do not maintain [generator-react-redux](https://github.com/mohebifar/generator-react-redux). 29 | 30 | ```bash 31 | npm install -g generator-react-redux-modules 32 | ``` 33 | 34 | ## Base Generator 35 | 36 | Creates the base project. Loosely based off [React-starter-kit](https://github.com/kriasoft/react-starter-kit). 37 | 38 | ```bash 39 | yo react-redux-modules 40 | ``` 41 | 42 | This will compile base files, including the Source, and Tools folders. (tests pending) 43 | 44 | 45 | 46 | ### Options 47 | 48 | | Option | Description | Default | 49 | | ------ | ----------- | ------- | 50 | | `-h`, `--help` | Print the generator's options and usage | | 51 | | `--skip-cache` | Do not remember prompt answers | Default: false | 52 | | `--skip-install` | Do not automatically install dependencies | Default: false | 53 | 54 | ## Sub-generators 55 | 56 | The sub generators assumes you already have a project up and running. They are to 57 | help you through developing new modules, components, etc. 58 | 59 | ### Module 60 | 61 | When you need to start creating new modules, simple use the sub-generator `module`. 62 | 63 | ```bash 64 | yo react-redux-modules:module [options] 65 | ``` 66 | 67 | Within the module sub-generator, the following default files are generated for you. 68 | Replace with your own module name. 69 | 70 | #### Options 71 | 72 | | Option | Description | Default | 73 | | ------ | ----------- | ------- | 74 | | `-h`, `--help` | Print the generator's options and usage | | 75 | | `--skip-cache` | Do not remember prompt answers | Default: false | 76 | | `--skip-install` | Do not automatically install dependencies | Default: false | 77 | 78 | #### Arguments 79 | 80 | | Arguments | Description | Type | Required | 81 | | ----------- | ----------- | ---- | -------- | 82 | | moduleName | Name of the module | String | true | 83 | 84 | #### Examples 85 | 86 | The following command will generate the following: 87 | 88 | ```bash 89 | yo react-redux-modules:module auth 90 | # Generates the auth folder with all necessary files 91 | ``` 92 | 93 | ### Component 94 | 95 | If you want to create a component other modules depend on, this sub-generator 96 | will create the files needed for you. 97 | 98 | Within the component sub-generator, the following default files are generated for you. 99 | Replace #{CommonComponentName} with your own module name. 100 | 101 | ```bash 102 | . 103 | └── src 104 | └── common 105 | └── components 106 | └── CommonComponentName 107 | ├── CommonComponentName.js 108 | ├── CommonComponentName.scss 109 | └── package.json 110 | ``` 111 | 112 | #### Arguments 113 | 114 | | Arguments | Description | Type | Required | 115 | | -------------- | ------------------ | ------ | -------- | 116 | | componentName | Name of the module | String | true | 117 | | componentRoot | Name of the module | String | true | 118 | 119 | #### Options 120 | 121 | | Option | Description | Default | 122 | | ------ | ----------- | ------- | 123 | | `-h`, `--help` | Print the generator's options and usage | | 124 | | `--skip-cache` | Do not remember prompt answers | Default: false | 125 | | `--skip-install` | Do not automatically install dependencies | Default: false | 126 | | `--raw` | Use user input raw format for component name | Default: false | 127 | 128 | #### Examples 129 | 130 | The following command will generate the following: 131 | 132 | ```bash 133 | yo react-redux-modules:component TextBox ./src/common/components --raw 134 | # Generates the following: 135 | . 136 | └── src 137 | └── common 138 | └── components 139 | └── TextBox 140 | ├── TextBox.js 141 | ├── TextBox.scss 142 | └── package.json 143 | ``` 144 | 145 | ### Action Test 146 | 147 | If you want to generate an action test, for a known module, this sub-generator will help. 148 | 149 | Within the component sub-generator, the following default files are generated for you. 150 | 151 | Replace #{module} and #{action} with your own module and action names. 152 | 153 | ```bash 154 | . 155 | └── test 156 | └── unit 157 | └── module 158 | └── actions 159 | └── action.spec.js 160 | ``` 161 | 162 | #### Arguments 163 | 164 | | Arguments | Description | Type | Required | 165 | | -------------- | ------------------ | ------ | -------- | 166 | | module | Name of the module | String | true | 167 | | action | Name of the action | String | true | 168 | 169 | #### Examples 170 | 171 | The following command will generate the following: 172 | 173 | ```bash 174 | yo react-redux-modules:actionTests Analytics Partners 175 | 176 | # Generates the following: 177 | . 178 | └── test 179 | └── unit 180 | └── Analytics 181 | └── actions 182 | └── Partners.spec.js 183 | ``` 184 | 185 | ## Contributing 186 | 187 | Anyone and everyone is welcome to [contribute](CONTRIBUTING.md), 188 | however, if you decide to get involved, please take a moment to review 189 | the [guidelines](CONTRIBUTING.md): 190 | 191 | * [Bug reports](CONTRIBUTING.md#bugs) 192 | * [Feature requests](CONTRIBUTING.md#features) 193 | * [Pull requests](CONTRIBUTING.md#pull-requests) 194 | 195 | ## License 196 | 197 | The code is available under the [MIT license](LICENSE). 198 | -------------------------------------------------------------------------------- /actionTests/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var generators = require('yeoman-generator'); 4 | var mkdirp = require('mkdirp'); 5 | var yosay = require('yosay'); 6 | var chalk = require('chalk'); 7 | var S = require('string'); 8 | 9 | module.exports = generators.Base.extend({ 10 | _createProjectFileSystem: function() { 11 | var destRoot = this.destinationRoot(); 12 | var sourceRoot = this.sourceRoot(); 13 | var moduleDir = destRoot + '/test/unit/' + this.module; 14 | var templateContext = { 15 | module: this.module, 16 | action: this.action 17 | }; 18 | 19 | mkdirp(moduleDir + '/actions'); 20 | 21 | this.fs.copyTpl(sourceRoot + '/spec.js', moduleDir + '/actions/' + templateContext.action + '.spec.js', templateContext); 22 | }, 23 | 24 | constructor: function() { 25 | generators.Base.apply(this, arguments); 26 | 27 | this.argument('module', { 28 | desc: 'Include tests for the component', 29 | required: true, 30 | type: String, 31 | }); 32 | 33 | this.argument('action', { 34 | required: true, 35 | type: String, 36 | desc: 'Name of the action file', 37 | }); 38 | 39 | // option string caught as string and not boolean. 40 | // This method validates whether the option value is true or not 41 | // NOTE if user types anything else in, besides false, 42 | // the value is still false. May be an issue 43 | // this.tests = (this.options.tests === 'true' || this.options.tests === true); 44 | 45 | this.log('Creating module ' + this.moduleName + '.'); 46 | }, 47 | 48 | initializing: function() { 49 | var message = chalk.bgBlack.bold('\nWelcome to React-Vertical Project\n') + chalk.underline('JS React/Flux Compiler\n'); 50 | this.log(yosay(message)); 51 | }, 52 | 53 | configuring: function() { 54 | this.config.save(); 55 | }, 56 | 57 | writing: function() { 58 | this._createProjectFileSystem(); 59 | }, 60 | }); 61 | -------------------------------------------------------------------------------- /actionTests/templates/spec.js: -------------------------------------------------------------------------------- 1 | import expect from 'expect'; 2 | import * as actions from '../../../../src/<%= module %>/actions/<%= action %>'; 3 | import * as types from '../../../../src/<%= module %>/constants/<%= module %>Constants'; 4 | 5 | // import * as data from ''; 6 | // import { mockStore } from '../../utils/mockStoreWithMiddleware'; 7 | // import * as api from ''; 8 | // import Q from 'q'; 9 | // import sinon from 'sinon'; 10 | 11 | describe('<%= action %>Actions', () => { 12 | describe('<%= action %>Request', () => { 13 | it('returns a request action', () => { 14 | const expectedAction = { 15 | type: types.SAMPLE_REQUEST 16 | }; 17 | expect(actions.<%= action %>Request()).toEqual(expectedAction); 18 | }); 19 | }); 20 | 21 | describe('<%= action %>Success', () => { 22 | it('returns a successful action', () => { 23 | const expectedAction = { 24 | type: types.SAMPLE_SUCCESS 25 | }; 26 | expect(actions.<%= action %>Success()).toEqual(expectedAction); 27 | }); 28 | }); 29 | 30 | describe('<%= action %>Failure', () => { 31 | it('returns a failed action', () => { 32 | const error = 'Error message' 33 | const expectedAction = { 34 | type: types.SAMPLE_FAILURE, 35 | error: error 36 | }; 37 | expect(actions.<%= action %>Failure(mockError)).toEqual(expectedAction); 38 | }); 39 | }); 40 | }); 41 | -------------------------------------------------------------------------------- /app/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var generators = require('yeoman-generator'); 4 | var mkdirp = require('mkdirp'); 5 | var yosay = require('yosay'); 6 | var chalk = require('chalk'); 7 | 8 | module.exports = generators.Base.extend({ 9 | _createProjectFileSystem: function() { 10 | var destRoot = this.destinationRoot(); 11 | var sourceRoot = this.sourceRoot(); 12 | var appDir = destRoot + '/src'; 13 | var toolDir = destRoot + '/tools'; 14 | 15 | // var testDir = destRoot + '/tests'; 16 | var templateContext = { 17 | appName: this.appName, 18 | appDescription: this.appDescription, 19 | appVersion: this.appVersion, 20 | appLicense: this.appLicense, 21 | appAuthor: this.appAuthor, 22 | appEmail: this.appEmail, 23 | }; 24 | 25 | mkdirp(appDir); 26 | mkdirp(toolDir); 27 | 28 | // mkdirp(testDir); 29 | 30 | // Base Directory 31 | this.template('.*', destRoot); 32 | this.template('preprocessor.js', destRoot + '/preprocessor.js'); 33 | this.fs.copyTpl(this.templatePath('license.txt'), 34 | destRoot + '/license.txt', templateContext); 35 | this.fs.copyTpl(this.templatePath('_package.json'), 36 | destRoot + '/package.json', templateContext); 37 | this.fs.copyTpl(this.templatePath('README.md'), 38 | destRoot + '/README.md', templateContext); 39 | 40 | // Source Directory 41 | this.template('src/*.js', appDir); 42 | this.template('src/**/*.*', appDir); 43 | 44 | // Tools Directory 45 | this.template('tools/*.js', toolDir); 46 | this.template('tools/*/*.js', toolDir); 47 | 48 | // Tests Directory 49 | // this.template('tests/*.js', appDir); 50 | 51 | }, 52 | 53 | _getPrompts: function() { 54 | var prompts = [{ 55 | name: 'name', 56 | message: 'What is the name of your project?', 57 | default: 'react-redux-starter', 58 | }, { 59 | name: 'description', 60 | message: 'What is the description of your project?', 61 | }, { 62 | name: 'version', 63 | message: 'What is the version of your project?', 64 | default: '0.0.0', 65 | }, { 66 | name: 'license', 67 | message: 'How is your project licensed?', 68 | default: 'MIT', 69 | }, { 70 | name: 'author', 71 | message: 'What is your name?', 72 | }, { 73 | name: 'email', 74 | message: 'What is your email address?', 75 | }]; 76 | 77 | return prompts; 78 | }, 79 | 80 | _saveAnswers: function(answers, callback) { 81 | this.appName = answers.name; 82 | this.appDescription = answers.description; 83 | this.appVersion = answers.version; 84 | this.appLicense = answers.license; 85 | this.appAuthor = answers.author; 86 | this.appEmail = answers.email; 87 | callback(); 88 | }, 89 | 90 | constructor: function() { 91 | generators.Base.apply(this, arguments); 92 | }, 93 | 94 | initializing: function() { 95 | var message = chalk.bgBlack.bold('\nWelcome to React-Redux Project\n') + chalk.underline('Javascript React Redux Compiler\n'); 96 | this.log(yosay(message)); 97 | }, 98 | 99 | prompting: function() { 100 | var done = this.async(); 101 | 102 | this.prompt(this._getPrompts(), function(answers) { 103 | this._saveAnswers(answers, done); 104 | }.bind(this)); 105 | 106 | }, 107 | 108 | configuring: function() { 109 | this.config.save(); 110 | }, 111 | 112 | writing: function() { 113 | this._createProjectFileSystem(); 114 | }, 115 | 116 | install: function() { 117 | this.installDependencies({ 118 | skipInstall: this.options['skip-install'], 119 | bower: false, 120 | }); 121 | }, 122 | }); 123 | -------------------------------------------------------------------------------- /app/templates/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "stage": 0 3 | } -------------------------------------------------------------------------------- /app/templates/.csscomb.json: -------------------------------------------------------------------------------- 1 | { 2 | "always-semicolon": true, 3 | "block-indent": 2, 4 | "color-case": "lower", 5 | "color-shorthand": true, 6 | "eof-newline": true, 7 | "leading-zero": false, 8 | "remove-empty-rulesets": true, 9 | "space-after-colon": 1, 10 | "space-after-combinator": 1, 11 | "space-before-selector-delimiter": 0, 12 | "space-between-declarations": "\n", 13 | "space-after-opening-brace": "\n", 14 | "space-before-closing-brace": "\n", 15 | "space-before-colon": 0, 16 | "space-before-combinator": 1, 17 | "space-before-opening-brace": 1, 18 | "strip-spaces": true, 19 | "unitless-zero": true, 20 | "vendor-prefix-align": true, 21 | "sort-order": [ 22 | [ 23 | "position", 24 | "top", 25 | "right", 26 | "bottom", 27 | "left", 28 | "z-index", 29 | "display", 30 | "float", 31 | "width", 32 | "min-width", 33 | "max-width", 34 | "height", 35 | "min-height", 36 | "max-height", 37 | "-webkit-box-sizing", 38 | "-moz-box-sizing", 39 | "box-sizing", 40 | "-webkit-appearance", 41 | "padding", 42 | "padding-top", 43 | "padding-right", 44 | "padding-bottom", 45 | "padding-left", 46 | "margin", 47 | "margin-top", 48 | "margin-right", 49 | "margin-bottom", 50 | "margin-left", 51 | "overflow", 52 | "overflow-x", 53 | "overflow-y", 54 | "-webkit-overflow-scrolling", 55 | "-ms-overflow-x", 56 | "-ms-overflow-y", 57 | "-ms-overflow-style", 58 | "clip", 59 | "clear", 60 | "font", 61 | "font-family", 62 | "font-size", 63 | "font-style", 64 | "font-weight", 65 | "font-variant", 66 | "font-size-adjust", 67 | "font-stretch", 68 | "font-effect", 69 | "font-emphasize", 70 | "font-emphasize-position", 71 | "font-emphasize-style", 72 | "font-smooth", 73 | "-webkit-hyphens", 74 | "-moz-hyphens", 75 | "hyphens", 76 | "line-height", 77 | "color", 78 | "text-align", 79 | "-webkit-text-align-last", 80 | "-moz-text-align-last", 81 | "-ms-text-align-last", 82 | "text-align-last", 83 | "text-emphasis", 84 | "text-emphasis-color", 85 | "text-emphasis-style", 86 | "text-emphasis-position", 87 | "text-decoration", 88 | "text-indent", 89 | "text-justify", 90 | "text-outline", 91 | "-ms-text-overflow", 92 | "text-overflow", 93 | "text-overflow-ellipsis", 94 | "text-overflow-mode", 95 | "text-shadow", 96 | "text-transform", 97 | "text-wrap", 98 | "-webkit-text-size-adjust", 99 | "-ms-text-size-adjust", 100 | "letter-spacing", 101 | "-ms-word-break", 102 | "word-break", 103 | "word-spacing", 104 | "-ms-word-wrap", 105 | "word-wrap", 106 | "-moz-tab-size", 107 | "-o-tab-size", 108 | "tab-size", 109 | "white-space", 110 | "vertical-align", 111 | "list-style", 112 | "list-style-position", 113 | "list-style-type", 114 | "list-style-image", 115 | "pointer-events", 116 | "-ms-touch-action", 117 | "touch-action", 118 | "cursor", 119 | "visibility", 120 | "zoom", 121 | "flex-direction", 122 | "flex-order", 123 | "flex-pack", 124 | "flex-align", 125 | "table-layout", 126 | "empty-cells", 127 | "caption-side", 128 | "border-spacing", 129 | "border-collapse", 130 | "content", 131 | "quotes", 132 | "counter-reset", 133 | "counter-increment", 134 | "resize", 135 | "-webkit-user-select", 136 | "-moz-user-select", 137 | "-ms-user-select", 138 | "-o-user-select", 139 | "user-select", 140 | "nav-index", 141 | "nav-up", 142 | "nav-right", 143 | "nav-down", 144 | "nav-left", 145 | "background", 146 | "background-color", 147 | "background-image", 148 | "-ms-filter:\\'progid:DXImageTransform.Microsoft.gradient", 149 | "filter:progid:DXImageTransform.Microsoft.gradient", 150 | "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader", 151 | "filter", 152 | "background-repeat", 153 | "background-attachment", 154 | "background-position", 155 | "background-position-x", 156 | "background-position-y", 157 | "-webkit-background-clip", 158 | "-moz-background-clip", 159 | "background-clip", 160 | "background-origin", 161 | "-webkit-background-size", 162 | "-moz-background-size", 163 | "-o-background-size", 164 | "background-size", 165 | "border", 166 | "border-color", 167 | "border-style", 168 | "border-width", 169 | "border-top", 170 | "border-top-color", 171 | "border-top-style", 172 | "border-top-width", 173 | "border-right", 174 | "border-right-color", 175 | "border-right-style", 176 | "border-right-width", 177 | "border-bottom", 178 | "border-bottom-color", 179 | "border-bottom-style", 180 | "border-bottom-width", 181 | "border-left", 182 | "border-left-color", 183 | "border-left-style", 184 | "border-left-width", 185 | "border-radius", 186 | "border-top-left-radius", 187 | "border-top-right-radius", 188 | "border-bottom-right-radius", 189 | "border-bottom-left-radius", 190 | "-webkit-border-image", 191 | "-moz-border-image", 192 | "-o-border-image", 193 | "border-image", 194 | "-webkit-border-image-source", 195 | "-moz-border-image-source", 196 | "-o-border-image-source", 197 | "border-image-source", 198 | "-webkit-border-image-slice", 199 | "-moz-border-image-slice", 200 | "-o-border-image-slice", 201 | "border-image-slice", 202 | "-webkit-border-image-width", 203 | "-moz-border-image-width", 204 | "-o-border-image-width", 205 | "border-image-width", 206 | "-webkit-border-image-outset", 207 | "-moz-border-image-outset", 208 | "-o-border-image-outset", 209 | "border-image-outset", 210 | "-webkit-border-image-repeat", 211 | "-moz-border-image-repeat", 212 | "-o-border-image-repeat", 213 | "border-image-repeat", 214 | "outline", 215 | "outline-width", 216 | "outline-style", 217 | "outline-color", 218 | "outline-offset", 219 | "-webkit-box-shadow", 220 | "-moz-box-shadow", 221 | "box-shadow", 222 | "filter:progid:DXImageTransform.Microsoft.Alpha(Opacity", 223 | "-ms-filter:\\'progid:DXImageTransform.Microsoft.Alpha", 224 | "opacity", 225 | "-ms-interpolation-mode", 226 | "-webkit-transition", 227 | "-moz-transition", 228 | "-ms-transition", 229 | "-o-transition", 230 | "transition", 231 | "-webkit-transition-delay", 232 | "-moz-transition-delay", 233 | "-ms-transition-delay", 234 | "-o-transition-delay", 235 | "transition-delay", 236 | "-webkit-transition-timing-function", 237 | "-moz-transition-timing-function", 238 | "-ms-transition-timing-function", 239 | "-o-transition-timing-function", 240 | "transition-timing-function", 241 | "-webkit-transition-duration", 242 | "-moz-transition-duration", 243 | "-ms-transition-duration", 244 | "-o-transition-duration", 245 | "transition-duration", 246 | "-webkit-transition-property", 247 | "-moz-transition-property", 248 | "-ms-transition-property", 249 | "-o-transition-property", 250 | "transition-property", 251 | "-webkit-transform", 252 | "-moz-transform", 253 | "-ms-transform", 254 | "-o-transform", 255 | "transform", 256 | "-webkit-transform-origin", 257 | "-moz-transform-origin", 258 | "-ms-transform-origin", 259 | "-o-transform-origin", 260 | "transform-origin", 261 | "-webkit-animation", 262 | "-moz-animation", 263 | "-ms-animation", 264 | "-o-animation", 265 | "animation", 266 | "-webkit-animation-name", 267 | "-moz-animation-name", 268 | "-ms-animation-name", 269 | "-o-animation-name", 270 | "animation-name", 271 | "-webkit-animation-duration", 272 | "-moz-animation-duration", 273 | "-ms-animation-duration", 274 | "-o-animation-duration", 275 | "animation-duration", 276 | "-webkit-animation-play-state", 277 | "-moz-animation-play-state", 278 | "-ms-animation-play-state", 279 | "-o-animation-play-state", 280 | "animation-play-state", 281 | "-webkit-animation-timing-function", 282 | "-moz-animation-timing-function", 283 | "-ms-animation-timing-function", 284 | "-o-animation-timing-function", 285 | "animation-timing-function", 286 | "-webkit-animation-delay", 287 | "-moz-animation-delay", 288 | "-ms-animation-delay", 289 | "-o-animation-delay", 290 | "animation-delay", 291 | "-webkit-animation-iteration-count", 292 | "-moz-animation-iteration-count", 293 | "-ms-animation-iteration-count", 294 | "-o-animation-iteration-count", 295 | "animation-iteration-count", 296 | "-webkit-animation-direction", 297 | "-moz-animation-direction", 298 | "-ms-animation-direction", 299 | "-o-animation-direction", 300 | "animation-direction" 301 | ] 302 | ] 303 | } 304 | -------------------------------------------------------------------------------- /app/templates/.csslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "adjoining-classes": false, 3 | "box-sizing": false, 4 | "box-model": false, 5 | "compatible-vendor-prefixes": false, 6 | "floats": false, 7 | "font-sizes": false, 8 | "gradients": false, 9 | "important": false, 10 | "known-properties": false, 11 | "outline-none": false, 12 | "qualified-headings": false, 13 | "regex-selectors": false, 14 | "shorthand": false, 15 | "text-indent": false, 16 | "unique-headings": false, 17 | "universal-selector": false, 18 | "unqualified-attributes": false 19 | } 20 | -------------------------------------------------------------------------------- /app/templates/.editorconfig: -------------------------------------------------------------------------------- 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 | [*.md] 20 | trim_trailing_whitespace = false 21 | -------------------------------------------------------------------------------- /app/templates/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "parser": "babel-eslint", 3 | "plugins": [ 4 | "react" 5 | ], 6 | "env": { 7 | "browser": true, 8 | "node": true, 9 | "es6": true 10 | }, 11 | "globals": { 12 | "__DEV__": true, 13 | "__SERVER__": true 14 | }, 15 | "ecmaFeatures": { 16 | "jsx": true 17 | }, 18 | "rules": { 19 | // Strict mode 20 | "strict": [2, "never"], 21 | 22 | // Code style 23 | "indent": [2, 2], 24 | "quotes": [2, "single"], 25 | 26 | // React 27 | "react/display-name": 0, 28 | "react/jsx-boolean-value": 1, 29 | "react/jsx-closing-bracket-location": 1, 30 | "react/jsx-curly-spacing": 1, 31 | "react/jsx-max-props-per-line": 0, 32 | "react/jsx-indent-props": 0, 33 | "react/jsx-no-duplicate-props": 1, 34 | "react/jsx-no-undef": 1, 35 | "react/jsx-quotes": 1, 36 | "react/jsx-sort-prop-types": 0, 37 | "react/jsx-sort-props": 0, 38 | "react/jsx-uses-react": 1, 39 | "react/jsx-uses-vars": 1, 40 | "react/no-danger": 0, 41 | "react/no-set-state": 1, 42 | "react/no-did-mount-set-state": 1, 43 | "react/no-did-update-set-state": 1, 44 | "react/no-multi-comp": 1, 45 | "react/no-unknown-property": 1, 46 | "react/prop-types": 1, 47 | "react/react-in-jsx-scope": 1, 48 | "react/require-extension": 1, 49 | "react/self-closing-comp": 1, 50 | "react/sort-comp": 1, 51 | "react/wrap-multilines": 1 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /app/templates/.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | .*/build 3 | .*/config 4 | .*/node_modules 5 | .*/gulpfile.js 6 | 7 | [include] 8 | -------------------------------------------------------------------------------- /app/templates/.jscsrc: -------------------------------------------------------------------------------- 1 | { 2 | "preset": "google", 3 | "disallowSpacesInAnonymousFunctionExpression": null, 4 | "validateLineBreaks": "LF", 5 | "validateIndentation": 2, 6 | "excludeFiles": ["build/**", "node_modules/**"], 7 | "esnext": true, 8 | "esprima": "esprima-fb" 9 | } 10 | -------------------------------------------------------------------------------- /app/templates/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "bitwise": true, 3 | "eqeqeq": true, 4 | "forin": true, 5 | "latedef": true, 6 | "noarg": true, 7 | "nonbsp": true, 8 | "nonew": true, 9 | "undef": true, 10 | "unused": true, 11 | 12 | "esnext": true, 13 | 14 | "browser": true, 15 | "jquery": true, 16 | "node": true 17 | 18 | } 19 | -------------------------------------------------------------------------------- /app/templates/.scss-lint.yml: -------------------------------------------------------------------------------- 1 | linters: 2 | 3 | BorderZero: 4 | enabled: true 5 | convention: none 6 | 7 | BemDepth: 8 | enabled: true 9 | 10 | DeclarationOrder: 11 | enabled: false 12 | 13 | LeadingZero: 14 | enabled: false 15 | 16 | PropertySortOrder: 17 | enabled: false 18 | 19 | QualifyingElement: 20 | enabled: false 21 | 22 | SelectorFormat: 23 | enabled: true 24 | convention: hyphenated_BEM 25 | class_convention: ^(?!js-).* 26 | class_convention_explanation: should not be written in the form js-* 27 | 28 | SingleLinePerProperty: 29 | enabled: true 30 | allow_single_line_rule_sets: false 31 | 32 | StringQuotes: 33 | enabled: true 34 | style: double_quotes 35 | -------------------------------------------------------------------------------- /app/templates/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: node_js 3 | node_js: 4 | - iojs 5 | -------------------------------------------------------------------------------- /app/templates/README.md: -------------------------------------------------------------------------------- 1 | ## <%= appName %> 2 | <% if (appDescription.length > 0) { %> 3 | <%= appDescription %> 4 | <% } %> 5 | 6 | <% if (appAuthor.length > 0) { %> 7 | This project was created by <%= appAuthor %> <% if (appEmail.length > 0) { %>(<%= appEmail %>)<% } %> 8 | <% } %> 9 | 10 | ## Version 11 | <%= appVersion %> 12 | 13 | ## License 14 | <%= appLicense %> 15 | -------------------------------------------------------------------------------- /app/templates/_package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "<%= appName %>", 3 | "version": "<%= appVersion %>", 4 | "description": "<%= appDescription %>", 5 | "repository": { 6 | "type": "git", 7 | "url": "" 8 | }, 9 | "keywords": [], 10 | "author": "<%= appAuthor %> <<%= appEmail %>>", 11 | "license": "MIT", 12 | "engines": { 13 | "node": ">= 4.0", 14 | "iojs": ">= 3.0", 15 | "npm": ">= 2.1" 16 | }, 17 | "dependencies": { 18 | "async": "^1.5.0", 19 | "aws-sdk": "^2.2.12", 20 | "babel": "5.8.23", 21 | "babel-core": "^5.8.29", 22 | "body-parser": "^1.14.1", 23 | "classnames": "2.1.3", 24 | "cluster": "^0.7.7", 25 | "compression": "^1.5.2", 26 | "cookie-parser": "^1.3.5", 27 | "cors": "^2.7.1", 28 | "debug": "^2.2.0", 29 | "eventemitter3": "1.1.1", 30 | "express": "^4.13.3", 31 | "express-session": "^1.12.0", 32 | "fastclick": "1.0.6", 33 | "fbjs": "0.2.0", 34 | "front-matter": "1.0.0", 35 | "history": "^1.12.6", 36 | "humps": "^1.0.0", 37 | "invariant": "^2.1.2", 38 | "isomorphic-fetch": "^2.2.0", 39 | "jquery": "~2.1.4", 40 | "jsonwebtoken": "^5.4.1", 41 | "jwt-decode": "^1.4.0", 42 | "lodash": "3.10.1", 43 | "morgan": "^1.6.1", 44 | "normalize.css": "3.0.3", 45 | "normalizr": "^1.3.1", 46 | "react": "^0.14.0-rc1", 47 | "react-dom": "0.14.0-rc1", 48 | "react-redux": "^4.0.0", 49 | "react-router": "^1.0.0-rc1", 50 | "redux": "^3.0.4", 51 | "redux-logger": "^2.0.4", 52 | "redux-router": "^1.0.0-beta3", 53 | "redux-thunk": "^1.0.0", 54 | "reqwest": "2.0.1", 55 | "source-map-support": "0.3.2", 56 | "superagent": "1.3.0", 57 | "when": "^3.7.4", 58 | "xhr2": "^0.1.3" 59 | }, 60 | "devDependencies": { 61 | "autoprefixer-core": "^5.2.1", 62 | "babel-eslint": "^4.1.1", 63 | "babel-loader": "^5.3.2", 64 | "babel-plugin-react-transform": "^1.1.1", 65 | "browser-sync": "^2.9.2", 66 | "chimp": "^0.19.4", 67 | "css-loader": "^0.17.0", 68 | "csscomb": "^3.1.8", 69 | "cssnext": "^1.8.4", 70 | "cucumber": "^0.5.3", 71 | "del": "^2.0.1", 72 | "eslint": "^1.3.1", 73 | "eslint-loader": "^1.0.0", 74 | "eslint-plugin-react": "^3.3.1", 75 | "expect": "^1.12.2", 76 | "extract-text-webpack-plugin": "~0.8.2", 77 | "file-loader": "^0.8.4", 78 | "gaze": "^0.5.1", 79 | "glob": "^5.0.14", 80 | "imports-loader": "^0.6.4", 81 | "isparta": "^3.1.0", 82 | "jest-cli": "^0.5.10", 83 | "mkdirp": "^0.5.1", 84 | "mocha": "^2.3.3", 85 | "ncp": "^2.0.0", 86 | "node-sass": "^3.2.0", 87 | "postcss": "^5.0.4", 88 | "postcss-loader": "^0.5.1", 89 | "postcss-nested": "^1.0.0", 90 | "psi": "^1.0.6", 91 | "react-addons-test-utils": "^0.14.0", 92 | "react-transform-hmr": "^1.0.1", 93 | "redux-devtools": "^2.1.5", 94 | "replace": "^0.3.0", 95 | "rimraf": "^2.4.3", 96 | "run-sequence": "^1.1.2", 97 | "sass-loader": "~3.0.0", 98 | "selenium-standalone": "^4.6.0", 99 | "style-loader": "^0.12.3", 100 | "url-loader": "^0.5.6", 101 | "webpack": "^1.12.1", 102 | "webpack-dev-middleware": "^1.2.0", 103 | "webpack-hot-middleware": "^2.0.0" 104 | }, 105 | "scripts": { 106 | "lint": "eslint src tools", 107 | "csslint": "csscomb src --lint --verbose", 108 | "csscomb": "csscomb src --verbose", 109 | "test:unit": "NODE_ENV=test mocha --compilers js:babel/register --recursive", 110 | "test:watch": "NODE_ENV=test mocha --compilers js:babel/register --recursive --watch", 111 | "test:cov": "babel-node ./node_modules/.bin/isparta cover ./node_modules/.bin/_mocha -- --recursive", 112 | "test:feature": "node build/server.js & sleep 10 && cd test && ../node_modules/chimp/bin/chimp --browser=chrome", 113 | "test": "npm run test:unit && npm run test:feature", 114 | "clean": "babel-node tools/run clean", 115 | "copy": "babel-node tools/run copy", 116 | "bundle": "babel-node tools/run bundle", 117 | "build": "babel-node tools/run build", 118 | "serve": "babel-node tools/run serve", 119 | "start:production": "babel-node tools/run start --release", 120 | "start": "babel-node tools/run start" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /app/templates/license.txt: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) <%= new Date().getFullYear() %> <%= appAuthor %> 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /app/templates/preprocessor.js: -------------------------------------------------------------------------------- 1 | /** 2 | * React Starter Kit (http://www.reactstarterkit.com/) 3 | * 4 | * Copyright © 2014-2015 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 | 'use strict'; 11 | 12 | var babel = require('babel-core'); 13 | 14 | module.exports = { 15 | process: function(src, filename) { 16 | // Ignore files other than .js, .es, .jsx or .es6 17 | if (!babel.canCompile(filename)) { 18 | return ''; 19 | } 20 | // Ignore all files within node_modules 21 | if (filename.indexOf('node_modules') === -1) { 22 | return babel.transform(src, {filename: filename}).code; 23 | } 24 | return src; 25 | } 26 | }; 27 | -------------------------------------------------------------------------------- /app/templates/src/app.js: -------------------------------------------------------------------------------- 1 | import 'babel/polyfill'; 2 | import React from 'react'; 3 | import ReactDOM from 'react-dom'; 4 | import { Provider } from 'react-redux'; 5 | import { ReduxRouter } from 'redux-router'; 6 | import configureStore from './common/store/configureStore'; 7 | import { addEventListener } from './utils/DOMUtils'; 8 | 9 | // Create application containers for React app and CSS 10 | let appContainer = document.getElementById('app'); 11 | let cssContainer = document.getElementById('css'); 12 | 13 | // Set context of the DOM 14 | let context = { 15 | onSetTitle: value => document.title = value, 16 | onSetMeta: (name, content) => { 17 | // Remove and create a new tag in order to make it work 18 | // with bookmarks in Safari 19 | let elements = document.getElementsByTagName('meta'); 20 | [].slice.call(elements).forEach((element) => { 21 | if (element.getAttribute('name') === name) { 22 | element.parentNode.removeChild(element); 23 | } 24 | }); 25 | let meta = document.createElement('meta'); 26 | meta.setAttribute('name', name); 27 | meta.setAttribute('content', content); 28 | document.getElementsByTagName('head')[0].appendChild(meta); 29 | } 30 | }; 31 | 32 | /** 33 | * Render React App on Client 34 | */ 35 | function render() { 36 | const store = configureStore(); 37 | // Render routes 38 | ReactDOM.render( 39 | 40 | 41 | , 42 | appContainer 43 | ); 44 | 45 | if (process.env.NODE_ENV !== 'production') { 46 | // Use require because imports can't be conditional. 47 | // In production, you should ensure process.env.NODE_ENV 48 | // is envified so that Uglify can eliminate this 49 | // module and its dependencies as dead code. 50 | require('./utils/createDevToolsWindow')(store); 51 | } 52 | } 53 | 54 | // Run the application when both DOM is ready 55 | // and page content is loaded 56 | if (window.addEventListener) { 57 | window.addEventListener('DOMContentLoaded', render); 58 | } else { 59 | window.attachEvent('onload', render); 60 | } 61 | -------------------------------------------------------------------------------- /app/templates/src/common/components/Footer/Footer.js: -------------------------------------------------------------------------------- 1 | import React, { PropTypes, Component } from 'react'; 2 | import styles from './Footer.scss'; 3 | import withStyles from '../../../common/decorators/withStyles'; 4 | 5 | class Footer extends Component { 6 | render() { 7 | return ( 8 |
9 |
10 | React & Redux Generator, 2015 11 |
12 |
13 | ); 14 | } 15 | 16 | } 17 | 18 | export default Footer; 19 | -------------------------------------------------------------------------------- /app/templates/src/common/components/Footer/Footer.scss: -------------------------------------------------------------------------------- 1 | .Footer { 2 | position: absolute; 3 | bottom: 0; 4 | min-width: 100vw; 5 | background: #333; 6 | } 7 | 8 | .Footer-container { 9 | padding: 20px 15px; 10 | margin: 0 auto; 11 | text-align: center; 12 | } 13 | 14 | .Footer-text { 15 | color: rgba(255, 255, 255, .5); 16 | } 17 | 18 | .Footer-text--muted { 19 | color: rgba(255, 255, 255, .3); 20 | } 21 | 22 | .Footer-spacer { 23 | color: rgba(255, 255, 255, .3); 24 | } 25 | 26 | .Footer-text, 27 | .Footer-link { 28 | padding: 2px 5px; 29 | font-size: 1em; 30 | } 31 | 32 | .Footer-link, 33 | .Footer-link:active, 34 | .Footer-link:visited { 35 | color: rgba(255, 255, 255, .6); 36 | text-decoration: none; 37 | } 38 | 39 | .Footer-link:hover { 40 | color: rgba(255, 255, 255, 1); 41 | } 42 | -------------------------------------------------------------------------------- /app/templates/src/common/components/Footer/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Footer", 3 | "version": "0.0.0", 4 | "private": true, 5 | "main": "./Footer.js" 6 | } 7 | -------------------------------------------------------------------------------- /app/templates/src/common/components/Header/Header.js: -------------------------------------------------------------------------------- 1 | import React, { PropTypes, Component } from 'react'; 2 | import styles from './Header.scss'; 3 | import withStyles from '../../../common/decorators/withStyles'; 4 | import { Link } from 'react-router'; 5 | 6 | class Header extends Component { 7 | 8 | static propTypes = { 9 | username: PropTypes.string, 10 | }; 11 | 12 | constructor(props) { 13 | super(props); 14 | } 15 | 16 | render() { 17 | return ( 18 |
19 |
20 | 21 | Logo 22 | 23 |
24 |
25 | About 26 | | 27 |
28 |
29 |
30 | ); 31 | } 32 | } 33 | 34 | export default Header; 35 | -------------------------------------------------------------------------------- /app/templates/src/common/components/Header/Header.scss: -------------------------------------------------------------------------------- 1 | @import "../../../common/styles/variables"; 2 | 3 | :root { 4 | --brand-color: $primary-black; 5 | } 6 | 7 | .Header { 8 | min-width: 100vw; 9 | height: 60px; 10 | color: $primary-black; 11 | background: #fff; 12 | } 13 | 14 | .Header-brand { 15 | float: left; 16 | margin: 11px 40px; 17 | font-size: 1.75em; // -28px 18 | // color: $brand-color; 19 | text-decoration: none; 20 | } 21 | 22 | .Header-nav { 23 | float: right; 24 | margin: 15px 40px; 25 | } 26 | 27 | .Header-banner { 28 | text-align: center; 29 | } 30 | 31 | .Header-bannerTitle { 32 | padding: 10px; 33 | margin: 0; 34 | font-size: 4em; 35 | font-weight: normal; 36 | line-height: 1em; 37 | } 38 | 39 | .Header-bannerDesc { 40 | padding: 0; 41 | margin: 0; 42 | font-size: 1.25em; 43 | color: rgba(255, 255, 255, .5); 44 | } 45 | 46 | .Navigation { 47 | float: right; 48 | } 49 | 50 | .Navigation-link, 51 | .Navigation-user { 52 | display: inline-block; 53 | padding: 3px 8px; 54 | font-size: 1.125em; // ~18px 55 | text-decoration: none; 56 | } 57 | 58 | .Navigation-link, 59 | .Navigation-link:active, 60 | .Navigation-link:visited { 61 | color: $primary-black; 62 | cursor: pointer; 63 | } 64 | 65 | .Navigation-link:hover { 66 | color: $primary-black-light; 67 | } 68 | 69 | .Navigation-link--highlight { 70 | margin-right: 8px; 71 | margin-left: 8px; 72 | color: $primary-white; 73 | background: transparentize($primary-black, 0.15); 74 | border-radius: 3px; 75 | } 76 | 77 | .Navigation-link--highlight:hover { 78 | background: transparentize($primary-black, 0.3); 79 | } 80 | 81 | .Navigation-spacer { 82 | color: transparentize($primary-white, 0.3); 83 | } 84 | -------------------------------------------------------------------------------- /app/templates/src/common/components/Header/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Header", 3 | "version": "0.0.0", 4 | "private": true, 5 | "main": "./Header.js" 6 | } 7 | -------------------------------------------------------------------------------- /app/templates/src/common/components/Html/Html.js: -------------------------------------------------------------------------------- 1 | import React, { Component, PropTypes } from 'react'; 2 | import { googleAnalyticsId } from '../../../config'; 3 | 4 | class Html extends Component { 5 | 6 | static propTypes = { 7 | title: PropTypes.string, 8 | description: PropTypes.string, 9 | css: PropTypes.string, 10 | body: PropTypes.string.isRequired, 11 | debug: PropTypes.bool, 12 | version: PropTypes.string 13 | }; 14 | 15 | static defaultProps = { 16 | title: '', 17 | description: '', 18 | }; 19 | 20 | trackingCode() { 21 | return ({__html: 22 | `(function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]=` + 23 | `function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date;` + 24 | `e=o.createElement(i);r=o.getElementsByTagName(i)[0];` + 25 | `e.src='https://www.google-analytics.com/analytics.js';` + 26 | `r.parentNode.insertBefore(e,r)}(window,document,'script','ga'));` + 27 | `ga('create','${googleAnalyticsId}','auto');ga('send','pageview');`, 28 | }); 29 | } 30 | 31 | render() { 32 | return ( 33 | 34 | 35 | 36 | 37 | {this.props.title} 38 | 39 | 40 | 41 | 42 | 43 | 44 |
45 | 46 |