├── .editorconfig
├── .gitattributes
├── .gitignore
├── .jshintrc
├── .travis.yml
├── LICENSE
├── README.md
├── app
├── index.js
└── templates
│ ├── Gruntfile.js
│ ├── Procfile
│ ├── README.md
│ ├── _bower.json
│ ├── _package.json
│ ├── app.js
│ ├── bowerrc
│ ├── editorconfig
│ ├── favicon.ico
│ ├── gitignore
│ ├── jshintrc
│ ├── styles
│ ├── sass
│ │ ├── _mixins.scss
│ │ ├── _vars.scss
│ │ ├── screen.scss
│ │ └── ui
│ │ │ ├── _buttons.scss
│ │ │ ├── _color.scss
│ │ │ ├── _footer.scss
│ │ │ ├── _forms.scss
│ │ │ ├── _header.scss
│ │ │ ├── _helpers.scss
│ │ │ ├── _navs.scss
│ │ │ ├── _scaffolding.scss
│ │ │ └── _typography.scss
│ └── screen.css
│ ├── travis.yml
│ └── views
│ ├── index.handlebars
│ └── layouts
│ └── main.handlebars
├── package.json
└── test
├── test-creation.js
└── test-load.js
/.editorconfig:
--------------------------------------------------------------------------------
1 | # http://editorconfig.org
2 | root = true
3 |
4 | [*]
5 | indent_style = space
6 | indent_size = 4
7 | end_of_line = lf
8 | charset = utf-8
9 | trim_trailing_whitespace = true
10 | insert_final_newline = true
11 |
12 | [*.md]
13 | trim_trailing_whitespace = false
14 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | * text=auto
2 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | temp/
3 |
--------------------------------------------------------------------------------
/.jshintrc:
--------------------------------------------------------------------------------
1 | {
2 | "node": true,
3 | "esnext": true,
4 | "bitwise": true,
5 | "camelcase": true,
6 | "curly": true,
7 | "eqeqeq": true,
8 | "immed": true,
9 | "indent": 4,
10 | "latedef": true,
11 | "newcap": true,
12 | "noarg": true,
13 | "quotmark": "single",
14 | "regexp": true,
15 | "undef": true,
16 | "unused": true,
17 | "strict": true,
18 | "trailing": true,
19 | "smarttabs": true,
20 | "white": true
21 | }
22 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 | node_js:
3 | - '0.8'
4 | - '0.10'
5 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright 2013 Luke Larsen
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining
4 | a copy of this software and associated documentation files (the
5 | "Software"), to deal in the Software without restriction, including
6 | without limitation the rights to use, copy, modify, merge, publish,
7 | distribute, sublicense, and/or sell copies of the Software, and to
8 | permit persons to whom the Software is furnished to do so, subject to
9 | the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be
12 | included in all copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # generator-node-express
2 |
3 | A generator for [Yeoman](http://yeoman.io).
4 |
5 |
6 | ## Getting Started
7 |
8 | ### What is Yeoman?
9 |
10 | 
11 |
12 | From the default Yeoman Generator:
13 |
14 | >Basically, he wears a top hat, lives in your computer, and waits for you to tell him what kind of application you wish to create.
15 |
16 | >Not every new computer comes with a Yeoman pre-installed. He lives in the [npm](https://npmjs.org) package repository. You only have to ask for him once, then he packs up and moves into your hard drive. *Make sure you clean up, he likes new and shiny things.*
17 |
18 |
19 | To install Yeoman you will need to have npm (node packaged modules) installed. It comes with Node . You can install Node by using the downloader or through Brew . I like Brew. If you use Brew you'll need to add this to your .bash_profile.
20 |
21 | ```
22 | homebrew=/usr/local/share/npm/bin
23 | ```
24 |
25 | Here is a post on installing Node if you need it.
26 |
27 | Once Node is installed you'll have access to npm so you can use this to install Yeoman.
28 |
29 |
30 | ```
31 | $ npm install -g yo
32 | ```
33 |
34 | The -g means that you are installing Yeoman globally. If you wish to uninstall Yeoman you can do so with this command.
35 |
36 | ```
37 | $ npm uninstall -g yo
38 | ```
39 |
40 | ### What's included in this generator
41 |
42 | This generator uses some tools I find useful. Those include:
43 |
44 |
45 | Express.js
46 | Express3-Handlebars for templating
47 | Sass for styling
48 | Javascript linting
49 | It will open your project in your editor of choice
50 | It will open your project in a browser of your choice
51 | It will watch for changes to your files and recompile or restart the server if needed.
52 | Uses LiveReload to refresh the browser when saving
53 | It will build a production version of your app when you are ready to deploy
54 | It comes ready to deploy to Heroku
55 |
56 |
57 | Optional tools
58 |
64 |
65 | ### Installing this generator
66 |
67 | With Node and npm installed run this to install.
68 |
69 | ```
70 | $ npm install -g generator-node-express
71 | ```
72 |
73 |
74 | ### Using this generator
75 |
76 | With the generator installed it is time to run it. Create a directory on your computer somewhere and cd into it via the terminal. Then run:
77 |
78 | ```
79 | $ yo node-express
80 | ```
81 |
82 | Yeoman will ask you some questions. Answer them and it will install stuff based on your answers.
83 |
84 | Once Yeoman is done setting up your project run this command to start working on it.
85 |
86 | ```
87 | $ grunt workon
88 | ```
89 |
90 | This starts the server, launches the project in your editor, opens the project in a browser, and starts watching the project for changes.
91 |
92 | LiveReload
93 |
94 | To enable LiveRelaod you'll need to install the Chrome extension.
95 |
96 | Live Reload Chrome extension
97 |
98 | Once installed and the project is running just turn on the Chrome Extension.
99 |
100 |
101 | Restarting the server
102 |
103 | When you edit files that need the server to restart for you to see the changes, most of the time Grunt will just restart it for you. There are times when it gets stuck though. If this happens you can run this command to start it back up without reopening the project in your editor and browser.
104 |
105 | ```
106 | $ grunt restart
107 | ```
108 |
109 | Generate a production version of your app
110 |
111 | Once your app is ready for production run this to generate a production build of your project.
112 |
113 | ```
114 | $ grunt build
115 | ```
116 |
117 | To test to see if the app is using the production version of the app you can shut down the server and start it again in production mode.
118 |
119 | ```
120 | $ NODE_ENV=production node app.js
121 | ```
122 |
123 | If it all works you are ready to deploy to Heroku. The Procfile at the root directory is for Heroku. Without it Heroku will choke. To deploy to Heroku you will need a Heorku account and the Heroku Toolbelt installed.
124 |
125 | Once that is setup use Git to commit and then Heroku to create and deploy.
126 |
127 | ```
128 | $ git init
129 | $ git add .
130 | $ git commit -m 'init'
131 | ```
132 |
133 | Create the app
134 | ```
135 | heroku create
136 | ```
137 |
138 | Deploy your code
139 | ```
140 | git push heroku master
141 | ```
142 |
143 | To ensure that Heroku is setup to use your production settings you'll need to run this:
144 |
145 | ```
146 | $ heroku config:set NODE_ENV=production
147 | ```
148 |
149 | Open the project
150 | ```
151 | heroku open
152 | ```
153 |
154 | ### Things to do
155 |
156 |
157 | Add test driven development.
158 |
--------------------------------------------------------------------------------
/app/index.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | var util = require('util');
3 | var path = require('path');
4 | var yeoman = require('yeoman-generator');
5 |
6 |
7 | var NodeExpressGenerator = module.exports = function NodeExpressGenerator(args, options, config) {
8 | yeoman.generators.Base.apply(this, arguments);
9 |
10 | this.on('end', function () {
11 | this.installDependencies({ skipInstall: options['skip-install'] });
12 | });
13 |
14 | this.pkg = JSON.parse(this.readFileAsString(path.join(__dirname, '../package.json')));
15 | };
16 |
17 | util.inherits(NodeExpressGenerator, yeoman.generators.Base);
18 |
19 | NodeExpressGenerator.prototype.askFor = function askFor() {
20 | var cb = this.async();
21 |
22 | // have Yeoman greet the user.
23 | console.log(this.yeoman);
24 |
25 | var prompts = [
26 | {
27 | name: 'projectName',
28 | message: 'What would you like to call your project?'
29 | },
30 | {
31 | name: 'features',
32 | type: 'checkbox',
33 | message: 'Would you like to use any of these?\n Use the arrow keys to move and space to check/uncheck.',
34 | choices: [{
35 | name: 'Inuit.css',
36 | value: 'useInuit',
37 | checked: true
38 | },
39 | {
40 | name: 'Bourbon',
41 | value: 'useBourbon',
42 | checked: true
43 | },
44 | {
45 | name: 'Angular',
46 | value: 'useAngular',
47 | checked: true
48 | },
49 | {
50 | name: 'jQuery',
51 | value: 'useJQuery',
52 | checked: false
53 | }]
54 | },
55 | {
56 | name: 'editors',
57 | type: 'checkbox',
58 | message: 'Which editor will you be developing in?\n Please select only one.\n (We use this to launch the project in your editor.)',
59 | choices: [{
60 | name: 'Sublime Text',
61 | value: 'useSublimeText',
62 | checked: true
63 | },
64 | {
65 | name: 'WebStorm',
66 | value: 'useWebStorm',
67 | checked: false
68 | },
69 | {
70 | name: 'Coda2',
71 | value: 'useCoda2',
72 | checked: false
73 | },
74 | {
75 | name: 'Chocolat',
76 | value: 'useChocolat',
77 | checked: false
78 | },
79 | {
80 | name: 'TextMate',
81 | value: 'useTextMate',
82 | checked: false
83 | },
84 | {
85 | name: 'None',
86 | value: 'useNone',
87 | checked: false
88 | }]
89 | },
90 | {
91 | name: 'browsers',
92 | type: 'checkbox',
93 | message: 'Which browser do you primarily use in developement?\n Please select only one.\n (We use this to launch your project in your browser.)',
94 | choices: [{
95 | name: 'Google Chrome',
96 | value: 'useGoogleChrome',
97 | checked: true
98 | },
99 | {
100 | name: 'Firefox',
101 | value: 'useFirefox',
102 | checked: false
103 | },
104 | {
105 | name: 'Safari',
106 | value: 'useSafari',
107 | checked: false
108 | },
109 | {
110 | name: 'Opera',
111 | value: 'useOpera',
112 | checked: false
113 | }]
114 | },
115 | {
116 | name: 'heroku',
117 | type: 'confirm',
118 | message: 'Will you be deploying to Heroku?',
119 | default: true
120 | }
121 | ];
122 |
123 | this.prompt(prompts, function (answers) {
124 | // this.prompt(prompts, function (answers) {
125 |
126 | this.projectName = answers.projectName;
127 |
128 | // features
129 | var features = answers.features;
130 | function hasFeature(feat) { return features.indexOf(feat) !== -1; }
131 |
132 | this.useInuit = hasFeature('useInuit');
133 | this.useBourbon = hasFeature('useBourbon');
134 | this.useAngular = hasFeature('useAngular');
135 | this.useJQuery = hasFeature('useJQuery');
136 |
137 | // editors
138 | var editors = answers.editors;
139 | function hasEditor(edit) { return editors.indexOf(edit) !== -1; }
140 |
141 | this.useSublimeText2 = hasEditor('useSublimeText2');
142 | this.useWebStorm = hasEditor('useWebStorm');
143 | this.useCoda2 = hasEditor('useCoda2');
144 | this.useChocolat = hasEditor('useChocolat');
145 | this.useTextMate = hasEditor('useTextMate');
146 | this.useNone = hasEditor('useNone');
147 |
148 | // browsers
149 | var browsers = answers.browsers;
150 | function hasBrowser(browse) { return browsers.indexOf(browse) !== -1; }
151 |
152 | this.useGoogleChrome = hasBrowser('useGoogleChrome');
153 | this.useFirefox = hasBrowser('useFirefox');
154 | this.useSafari = hasBrowser('useSafari');
155 | this.useOpera = hasBrowser('useOpera');
156 |
157 | // heroku
158 | this.heroku = answers.heroku;
159 |
160 | cb();
161 | }.bind(this));
162 | };
163 |
164 |
165 | NodeExpressGenerator.prototype.gruntfile = function gruntfile() {
166 | this.copy('Gruntfile.js', 'Gruntfile.js');
167 | };
168 |
169 | NodeExpressGenerator.prototype.packageJSON = function packageJSON() {
170 | this.copy('_package.json', 'package.json');
171 | };
172 |
173 | NodeExpressGenerator.prototype.git = function git() {
174 | this.copy('gitignore', '.gitignore');
175 | };
176 |
177 | NodeExpressGenerator.prototype.bower = function bower() {
178 | this.copy('bowerrc', '.bowerrc');
179 | this.copy('_bower.json', 'bower.json');
180 | };
181 |
182 | NodeExpressGenerator.prototype.jshint = function jshint() {
183 | this.copy('jshintrc', '.jshintrc');
184 | };
185 |
186 | NodeExpressGenerator.prototype.editorConfig = function editorConfig() {
187 | this.copy('editorconfig', '.editorconfig');
188 | };
189 |
190 | NodeExpressGenerator.prototype.views = function views() {
191 | this.mkdir('views');
192 | this.mkdir('views/layouts');
193 | this.mkdir('views/partials');
194 | this.copy('views/index.handlebars', 'views/index.handlebars');
195 | this.copy('views/layouts/main.handlebars', 'views/layouts/main.handlebars');
196 | };
197 |
198 | NodeExpressGenerator.prototype.assets = function assets() {
199 | this.mkdir('assets');
200 | this.mkdir('assets/font');
201 | this.mkdir('assets/images');
202 | this.mkdir('assets/scripts');
203 | this.mkdir('assets/styles');
204 | this.mkdir('assets/styles/sass');
205 | this.mkdir('assets/styles/sass/ui');
206 |
207 | this.copy('styles/sass/_mixins.scss', 'assets/styles/sass/_mixins.scss');
208 | this.copy('styles/sass/_vars.scss', 'assets/styles/sass/_vars.scss');
209 |
210 | this.copy('styles/sass/ui/_buttons.scss', 'assets/styles/sass/ui/_buttons.scss');
211 | this.copy('styles/sass/ui/_color.scss', 'assets/styles/sass/ui/_color.scss');
212 | this.copy('styles/sass/ui/_footer.scss', 'assets/styles/sass/ui/_footer.scss');
213 | this.copy('styles/sass/ui/_forms.scss', 'assets/styles/sass/ui/_forms.scss');
214 | this.copy('styles/sass/ui/_header.scss', 'assets/styles/sass/ui/_header.scss');
215 | this.copy('styles/sass/ui/_helpers.scss', 'assets/styles/sass/ui/_helpers.scss');
216 | this.copy('styles/sass/ui/_navs.scss', 'assets/styles/sass/ui/_navs.scss');
217 | this.copy('styles/sass/ui/_scaffolding.scss', 'assets/styles/sass/ui/_scaffolding.scss');
218 | this.copy('styles/sass/ui/_typography.scss', 'assets/styles/sass/ui/_typography.scss');
219 |
220 | this.copy('styles/sass/screen.scss', 'assets/styles/sass/screen.scss');
221 |
222 | this.copy('favicon.ico', 'assets/favicon.ico');
223 | };
224 |
225 | NodeExpressGenerator.prototype.app = function app() {
226 | this.copy('app.js', 'app.js');
227 | };
228 |
229 | NodeExpressGenerator.prototype.procfile = function procfile() {
230 | if (this.heroku) {
231 | this.copy('Procfile', 'Procfile');
232 | }
233 | };
234 |
235 | NodeExpressGenerator.prototype.readme = function readme() {
236 | this.copy('README.md', 'README.md');
237 | };
238 |
--------------------------------------------------------------------------------
/app/templates/Gruntfile.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | module.exports = function (grunt) {
4 | // show elapsed time at the end
5 | require('time-grunt')(grunt);
6 | // load all grunt tasks
7 | require('load-grunt-tasks')(grunt);
8 |
9 | grunt.initConfig({
10 |
11 | // Watch Config
12 | watch: {
13 | files: ['views/**/*'],
14 | options: {
15 | livereload: true
16 | },
17 | scripts: {
18 | files: [
19 | 'assets/scripts/**/*.js',
20 | ],
21 | },
22 | css: {
23 | files: [
24 | 'assets/styles/**/*.css',
25 | ],
26 | },
27 | sass: {
28 | files: ['assets/styles/**/*.scss'],
29 | tasks: ['sass:dev']
30 | },
31 | images: {
32 | files: [
33 | 'assets/images/**/*.{png,jpg,jpeg,webp}'
34 | ],
35 | },
36 | express: {
37 | files: [ 'app.js', '!**/node_modules/**', '!Gruntfile.js' ],
38 | tasks: [ 'express:dev' ],
39 | options: {
40 | nospawn: true // Without this option specified express won't be reloaded
41 | }
42 | },
43 | },
44 |
45 | // Clean Config
46 | clean: {
47 | dist: {
48 | files: [{
49 | dot: true,
50 | src: [
51 | '.tmp',
52 | 'dist/*',
53 | '!dist/.git*'
54 | ]
55 | }]
56 | },
57 | server: ['.tmp'],
58 | },
59 |
60 | // Hint Config
61 | jshint: {
62 | options: {
63 | jshintrc: '.jshintrc'
64 | },
65 | all: [
66 | 'Gruntfile.js',
67 | 'assets/scripts/**/*.js',
68 | '!assets/scripts/vendor/*',
69 | 'test/spec/**/*.js'
70 | ]
71 | },
72 |
73 | // Sass Config
74 | sass: {
75 | options: {
76 | cacheLocation: '.tmp/.sass-cache'
77 | },
78 | dev: {
79 | options: {
80 | style: 'expanded',
81 | lineComments: true
82 | },
83 | files: [{
84 | expand: true,
85 | cwd: 'assets/styles/sass',
86 | dest: 'assets/styles',
87 | src: ['screen.scss'],
88 | ext: '.css'
89 | }]
90 | }
91 | },
92 |
93 | // Express Config
94 | express: {
95 | options: {
96 | // Override defaults here
97 | },
98 | dev: {
99 | options: {
100 | script: 'app.js'
101 | }
102 | }
103 | },
104 |
105 | // Open Config
106 | open: {
107 | site: {
108 | path: 'http://localhost:3000',<% if (useGoogleChrome) { %>
109 | app: 'Google Chrome'<% } %><% if (useFirefox) { %>
110 | app: 'Firefox'<% } %><% if (useSafari) { %>
111 | app: 'Safari'<% } %><% if (useOpera) { %>
112 | app: 'Opera'<% } %>
113 | },
114 | editor: {
115 | path: './',<% if (useSublimeText) { %>
116 | app: 'Sublime Text'<% } %><% if (useWebStorm) { %>
117 | app: 'WebStorm'<% } %><% if (useCoda2) { %>
118 | app: 'Coda 2'<% } %><% if (useChocolat) { %>
119 | app: 'Chocolat'<% } %><% if (useTextMate) { %>
120 | app: 'TextMate'<% } %><% if (useNone) { %>
121 | app: ''<% } %>
122 | },
123 | },
124 |
125 | // Rev Config
126 | rev: {
127 | dist: {
128 | files: {
129 | src: [
130 | 'dist/assets/scripts/**/*.js',
131 | 'dist/assets/styles/**/*.css',
132 | 'dist/assets/images/**/*.{png,jpg,jpeg,gif,webp}',
133 | 'dist/assets/styles/fonts/**/*.*'
134 | ]
135 | }
136 | }
137 | },
138 |
139 | // Usemin Config
140 | useminPrepare: {
141 | options: {
142 | dest: 'dist/assets'
143 | },
144 | html: ['assets/{,*/}*.html', 'views/**/*.handlebars']
145 | },
146 | usemin: {
147 | options: {
148 | dirs: ['dist/assets'],
149 | basedir: 'dist/assets',
150 | },
151 | html: ['dist/assets/{,*/}*.html', 'dist/views/**/*.handlebars'],
152 | css: ['dist/assets/styles/{,*/}*.css']
153 | },
154 |
155 | // Imagemin Config
156 | imagemin: {
157 | dist: {
158 | files: [{
159 | expand: true,
160 | cwd: 'assets/images',
161 | src: '**/*.{png,jpg,jpeg}',
162 | dest: 'dist/assets/images'
163 | }]
164 | }
165 | },
166 |
167 | // SVGmin Config
168 | svgmin: {
169 | dist: {
170 | files: [{
171 | expand: true,
172 | cwd: 'assets/images',
173 | src: '{,*/}*.svg',
174 | dest: 'dist/assets/images'
175 | }]
176 | }
177 | },
178 |
179 | // CSSmin config
180 | cssmin: {
181 | // This task is pre-configured if you do not wish to use Usemin
182 | // blocks for your CSS. By default, the Usemin block from your
183 | // `index.html` will take care of minification, e.g.
184 | //
185 | //
186 | //
187 | // dist: {
188 | // files: {
189 | // 'dist/assets/styles/main.css': [
190 | // '.tmp/styles/{,*/}*.css',
191 | // 'assets/styles/{,*/}*.css'
192 | // ]
193 | // }
194 | // }
195 | },
196 |
197 | // HTML Config
198 | htmlmin: {
199 | dist: {
200 | options: {
201 | /*removeCommentsFromCDATA: true,
202 | // https://github.com/yeoman/grunt-usemin/issues/44
203 | //collapseWhitespace: true,
204 | collapseBooleanAttributes: true,
205 | removeAttributeQuotes: true,
206 | removeRedundantAttributes: true,
207 | useShortDoctype: true,
208 | removeEmptyAttributes: true,
209 | removeOptionalTags: true*/
210 | },
211 | files: [{
212 | expand: true,
213 | cwd: 'assets',
214 | src: '*.html',
215 | dest: 'dist/assets'
216 | }]
217 | }
218 | },
219 |
220 | // Copy Config
221 | // Put files not handled in other tasks here
222 | copy: {
223 | dist: {
224 | files: [{
225 | expand: true,
226 | dot: true,
227 | cwd: 'assets',
228 | dest: 'dist/assets',
229 | src: [
230 | '*.{ico,png,txt}',
231 | '.htaccess',
232 | 'images/**/*.{webp,gif}',
233 | 'styles/fonts/{,*/}*.*',
234 | ]
235 | }, {
236 | expand: true,
237 | dot: true,
238 | cwd: 'views',
239 | dest: 'dist/views/',
240 | src: '**/*.handlebars',
241 | }]
242 | },
243 | styles: {
244 | expand: true,
245 | dot: true,
246 | cwd: 'assets/styles',
247 | dest: '.tmp/styles/',
248 | src: '{,*/}*.css'
249 | },
250 | },
251 |
252 | // Concurrent Config
253 | concurrent: {
254 | dist: [
255 | 'copy:styles',
256 | 'svgmin',
257 | 'htmlmin'
258 | ]
259 | },
260 | });
261 |
262 | // Register Tasks
263 | // Workon
264 | grunt.registerTask('workon', 'Start working on this project.', [
265 | 'jshint',
266 | 'sass:dev',
267 | 'express:dev',
268 | 'open:site',
269 | 'open:editor',
270 | 'watch'
271 | ]);
272 |
273 |
274 | // Restart
275 | grunt.registerTask('restart', 'Restart the server.', [
276 | 'express:dev',
277 | 'watch'
278 | ]);
279 |
280 |
281 | // Build
282 | grunt.registerTask('build', 'Build production ready assets and views.', [
283 | 'clean:dist',
284 | 'concurrent:dist',
285 | 'useminPrepare',
286 | 'imagemin',
287 | 'concat',
288 | 'cssmin',
289 | 'uglify',
290 | 'copy:dist',
291 | 'rev',
292 | 'usemin',
293 | ]);
294 |
295 | };
296 |
--------------------------------------------------------------------------------
/app/templates/Procfile:
--------------------------------------------------------------------------------
1 | web: node app.js
--------------------------------------------------------------------------------
/app/templates/README.md:
--------------------------------------------------------------------------------
1 | ## Introduction
2 |
3 | Description of your project here.
--------------------------------------------------------------------------------
/app/templates/_bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "<%= _.slugify(projectName) %>",
3 | "version": "0.0.0",
4 | "dependencies": {<% if (useInuit) { %>
5 | "inuit.css": "~5.0.0",<% } %><% if (useBourbon) { %>
6 | "bourbon": "~3.1.8",<% } %><% if (useAngular) { %>
7 | "angular": "~1.0.8",<% } %><% if (useJQuery) { %>
8 | "jquery": "2.0.3",<% } %>
9 | "modernizr": "~2.6.2"
10 | },
11 | "devDependencies": {}
12 | }
--------------------------------------------------------------------------------
/app/templates/_package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "<%= _.slugify(projectName) %>",
3 | "version": "0.0.0",
4 | "private": true,
5 | "dependencies": {
6 | "express": "~3.4.0",
7 | "express3-handlebars": "0.4.x"
8 | },
9 | "devDependencies": {
10 | "grunt": "~0.4.1",
11 | "grunt-contrib-copy": "~0.4.1",
12 | "grunt-contrib-concat": "~0.3.0",
13 | "grunt-contrib-uglify": "~0.2.0",
14 | "grunt-contrib-jshint": "~0.6.3",
15 | "grunt-contrib-sass": "~0.5.0",
16 | "grunt-contrib-cssmin": "~0.6.0",
17 | "grunt-contrib-connect": "~0.5.0",
18 | "grunt-contrib-clean": "~0.5.0",
19 | "grunt-contrib-htmlmin": "~0.1.3",
20 | "grunt-contrib-imagemin": "~0.2.0",
21 | "grunt-contrib-watch": "~0.5.2",
22 | "grunt-open": "~0.2.2",
23 | "grunt-express-server": "~0.4.2",
24 | "grunt-rev": "~0.1.0",
25 | "grunt-usemin": "~0.1.10",
26 | "grunt-svgmin": "~0.2.0",
27 | "grunt-concurrent": "~0.3.0",
28 | "load-grunt-tasks": "~0.1.0",
29 | "time-grunt": "~0.1.1"
30 | },
31 | "engines": {
32 | "node": ">=0.8.0",
33 | "npm": "1.2.x"
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/app/templates/app.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | /*
4 | * Express Dependencies
5 | */
6 | var express = require('express');
7 | var app = express();
8 | var port = 3000;
9 |
10 | /*
11 | * Use Handlebars for templating
12 | */
13 | var exphbs = require('express3-handlebars');
14 | var hbs;
15 |
16 | // For gzip compression
17 | app.use(express.compress());
18 |
19 | /*
20 | * Config for Production and Development
21 | */
22 | if (process.env.NODE_ENV === 'production') {
23 | // Set the default layout and locate layouts and partials
24 | app.engine('handlebars', exphbs({
25 | defaultLayout: 'main',
26 | layoutsDir: 'dist/views/layouts/',
27 | partialsDir: 'dist/views/partials/'
28 | }));
29 |
30 | // Locate the views
31 | app.set('views', __dirname + '/dist/views');
32 |
33 | // Locate the assets
34 | app.use(express.static(__dirname + '/dist/assets'));
35 |
36 | } else {
37 | app.engine('handlebars', exphbs({
38 | // Default Layout and locate layouts and partials
39 | defaultLayout: 'main',
40 | layoutsDir: 'views/layouts/',
41 | partialsDir: 'views/partials/'
42 | }));
43 |
44 | // Locate the views
45 | app.set('views', __dirname + '/views');
46 |
47 | // Locate the assets
48 | app.use(express.static(__dirname + '/assets'));
49 | }
50 |
51 | // Set Handlebars
52 | app.set('view engine', 'handlebars');
53 |
54 |
55 |
56 | /*
57 | * Routes
58 | */
59 | // Index Page
60 | app.get('/', function(request, response, next) {
61 | response.render('index');
62 | });
63 |
64 |
65 | /*
66 | * Start it up
67 | */
68 | var port = process.env.PORT || port;
69 | app.listen(port);
70 | console.log('Express started on port ' + port);
71 |
--------------------------------------------------------------------------------
/app/templates/bowerrc:
--------------------------------------------------------------------------------
1 | {
2 | "directory": "assets/bower_components"
3 | }
4 |
--------------------------------------------------------------------------------
/app/templates/editorconfig:
--------------------------------------------------------------------------------
1 | # EditorConfig helps developers define and maintain consistent
2 | # coding styles between different editors and IDEs
3 | # editorconfig.org
4 |
5 | root = true
6 |
7 |
8 | [*]
9 |
10 | # Change these settings to your own preference
11 | indent_style = space
12 | indent_size = 4
13 |
14 | # We recommend you to keep these unchanged
15 | end_of_line = lf
16 | charset = utf-8
17 | trim_trailing_whitespace = true
18 | insert_final_newline = true
19 |
20 | [*.md]
21 | trim_trailing_whitespace = false
22 |
23 |
--------------------------------------------------------------------------------
/app/templates/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lukelarsen/generator-node-express/4f729b11b8d97febd618d4653b8b0a32a726c779/app/templates/favicon.ico
--------------------------------------------------------------------------------
/app/templates/gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .tmp
3 | .sass-cache
4 | assets/bower_components
5 |
--------------------------------------------------------------------------------
/app/templates/jshintrc:
--------------------------------------------------------------------------------
1 | {
2 | "bitwise": true,
3 | "browser": true,
4 | "camelcase": true,
5 | "curly": true,
6 | "esnext": true,
7 | "eqeqeq": true,
8 | "eqnull": true,
9 | "immed": true,
10 | "indent": 4,
11 | "latedef": true,
12 | "maxlen": 180,
13 | "maxstatements": 20,
14 | "newcap": true,
15 | "node": true,
16 | "strict": true,
17 | "trailing": true,
18 | "quotmark": "single",
19 | "undef": true,
20 | "unused": true,
21 | "white": true
22 | }
23 |
--------------------------------------------------------------------------------
/app/templates/styles/sass/_mixins.scss:
--------------------------------------------------------------------------------
1 | /*------------------------------------*\
2 | $CONTENTS
3 | \*------------------------------------*/
4 | /**
5 | * MIXINS
6 | */
7 |
8 |
9 |
10 |
11 |
12 | /*------------------------------------*\
13 | $MIXINS
14 | \*------------------------------------*/
15 |
16 | // Media Queries - Retina - http://37signals.com/svn/posts/3271-easy-retina-ready-images-using-scss & http://www.brettjankord.com/2012/11/28/cross-browser-retinahigh-resolution-media-queries/
17 | @mixin image-2x($image, $width, $height) {
18 | @media
19 | only screen and (-webkit-min-device-pixel-ratio: 2),
20 | only screen and (min-resolution: 192dpi) {
21 | background-image: url('../images/#{$image}');
22 | background-size: $width $height;
23 | }
24 | }
25 |
26 | // .svg w/ .png fallback for IE8
27 | @mixin svg-background($file_name) {
28 | background-image: url('../images/#{$file_name}.png');
29 | background-image: none, url('../images/#{$file_name}.svg');
30 | }
31 |
32 | // Sizing
33 | @mixin sizing($width, $height) {
34 | width: $width;
35 | height: $height;
36 | }
37 |
38 | @mixin square($size) {
39 | width: $size;
40 | height: $size;
41 | }
42 |
43 | // Headlines - This overries the default inuit headings mixin
44 | @mixin headings($from: 1, $to: 6){
45 | $headings_selector: "";
46 | @for $i from $from through $to {
47 | $headings_selector : $headings_selector + "h#{$i}";
48 | @if $i < $to {
49 | $headings_selector: $headings_selector + ",";
50 | }
51 | }
52 | #{$headings_selector} {
53 | @content
54 | }
55 | }
--------------------------------------------------------------------------------
/app/templates/styles/sass/_vars.scss:
--------------------------------------------------------------------------------
1 | /*------------------------------------*\
2 | VARS.SCSS
3 | \*------------------------------------*/
4 | /**
5 | * OBJECTS-AND-ABSTRACTIONS
6 | * OVERRIDES
7 | * CUSTOM
8 | ^ COLORS
9 | ^ FONTS
10 | ^ CUSTOM FONT MIXINS
11 | */
12 |
13 | /**
14 | * Any variables you find set in inuit.css’ `_vars.scss` that you do not wish to
15 | * keep, simply redefine here. This means that if inuit.css, for example, sets
16 | * your `$base-font-size` at 16px and you wish it to be 14px, simply redeclare
17 | * that variable in this file. inuit.css ignores its own variables in favour of
18 | * using your own, so you can completely modify how inuit.css works without ever
19 | * having to alter the framework itself.
20 | */
21 |
22 |
23 |
24 |
25 |
26 | /*------------------------------------*\
27 | $OBJECTS-AND-ABSTRACTIONS
28 | \*------------------------------------*/
29 | /**
30 | * All of inuit.css’ objects and abstractions are initially turned off by
31 | * default. This means that you start any project with as little as possible,
32 | * and introducing objects and abstractions is as simple as switching the
33 | * following variables to `true`.
34 | */
35 | $use-grids: false;
36 | $use-flexbox: false;
37 | $use-columns: false;
38 | $use-nav: false;
39 | $use-options: false;
40 | $use-pagination: false;
41 | $use-breadcrumb: false;
42 | $use-media: false;
43 | $use-marginalia: false;
44 | $use-island: false;
45 | $use-block-list: false;
46 | $use-matrix: false;
47 | $use-split: false;
48 | $use-this-or-this: false;
49 | $use-link-complex: false;
50 | $use-flyout: false;
51 | $use-arrows: false;
52 | $use-sprite: false;
53 | $use-icon-text: false;
54 | $use-beautons: false;
55 | $use-lozenges: false;
56 | $use-rules: false;
57 | $use-stats: false;
58 | $use-greybox: false;
59 |
60 |
61 |
62 |
63 |
64 | /*------------------------------------*\
65 | $OVERRIDES
66 | \*------------------------------------*/
67 | /**
68 | * Place any variables that should override inuit.css’ defaults here.
69 | */
70 | $debug-mode: false;
71 |
72 | $responsive: true;
73 |
74 | $brand-color: #D70014;
75 | $brand-face: 'Helvetica Neue', sans-serif;
76 |
77 | $base-font-family: $brand-face;
78 |
79 | $base-line-height: 24px;
80 |
81 |
82 | /**
83 | * Other overrides to inuit
84 | */
85 | label{ cursor:default !important; }
86 | .form-fields input[type=text]{ cursor: text;}
87 | .check-list label{ cursor: pointer !important }
88 |
89 |
90 |
91 |
92 |
93 |
94 | /*------------------------------------*\
95 | $CUSTOM
96 | \*------------------------------------*/
97 | /**
98 | * Place any of your own variables that sit on top of inuit.css here.
99 | */
100 |
101 | /**
102 | * ^COLORS
103 | */
104 | $color1: $brand-color; // red
105 | $color2: #2F7DC4; // blue
106 | $color2--dark: darken($color2, 14%); // dark blue
107 | $color2--light: lighten($color2, 8%); // light blue
108 | $color3: #6CBA16; // green
109 | $color4: #FFA501; // orange
110 | $color5: #8A2CA1; // orange
111 |
112 | $linkedin: #00659B;
113 | $facebook: #3B5895;
114 | $twitter: #63CDF7;
115 | $google: #FF0017;
116 | $pinterest: #CE1E1F;
117 | $mail: $color3;
118 |
119 | $white: #FFF;
120 | $gray1: #F7F7F7;
121 | $gray2: #EEE;
122 | $gray3: #D8D8D8;
123 | $gray4: #9A9EA1;
124 | $gray5: #808284;
125 | $gray6: #58585B;
126 | $black: #000;
127 |
128 |
129 | /**
130 | * ^FONTS
131 | */
132 | $sans-serif: $brand-face;
133 | $serif: "Georgia", serif;
134 |
135 | /**
136 | * ^CUSTOM FONT MIXINS
137 | */
138 | @mixin sans-serif-extra-light{
139 | font-family: 'Gotham SSm 2r', 'Gotham SSm A', 'Gotham SSm B';
140 | font-weight: 200;
141 | font-style: normal;
142 | }
143 |
144 | @mixin serif{
145 | font-family: $serif;
146 | font-weight: 100;
147 | }
--------------------------------------------------------------------------------
/app/templates/styles/sass/screen.scss:
--------------------------------------------------------------------------------
1 | @charset "UTF-8";
2 | /*------------------------------------*\
3 | SCREEN.CSS
4 | \*------------------------------------*/
5 |
6 |
7 |
8 |
9 |
10 | /**
11 | * Setup
12 | */<% if (useBourbon) { %>
13 | @import "../../bower_components/bourbon/app/assets/stylesheets/bourbon";<% } %>
14 | @import "vars";<% if (useInuit) { %>
15 | @import "../../bower_components/inuit.css/inuit";<% } %>
16 | @import "mixins"; // Custom mixins
17 |
18 |
19 |
20 |
21 |
22 | /**
23 | * She’s all yours, cap’n... Begin importing your stuff here.
24 | */
25 | @import "ui/scaffolding";
26 | @import "ui/typography";
27 | @import "ui/color";
28 | @import "ui/header";
29 | @import "ui/navs";
30 | @import "ui/forms";
31 | @import "ui/buttons";
32 | @import "ui/footer";
33 | @import "ui/helpers";
--------------------------------------------------------------------------------
/app/templates/styles/sass/ui/_buttons.scss:
--------------------------------------------------------------------------------
1 | /*------------------------------------*\
2 | $CONTENTS
3 | \*------------------------------------*/
4 | /**
5 | * BASE
6 | * SIZES
7 | * COLORS
8 | ^Colors
9 | ^Hover
10 | */
11 |
12 |
13 |
14 |
15 |
16 | /*------------------------------------*\
17 | $BASE
18 | \*------------------------------------*/
19 |
20 | // Example
21 |
22 | // .btn{
23 | // @include font-size(14px);
24 | // @include transition (all .2s ease-in-out);
25 | // display:inline-block;
26 | // margin:0 0 10px 0;
27 | // padding-top: 1px;
28 | // padding-right: 2em;
29 | // padding-bottom: 0;
30 | // padding-left: 2em;
31 | // border: none;
32 | // vertical-align: middle;
33 | // white-space: nowrap;
34 | // line-height: 2.9;
35 | // cursor: pointer;
36 |
37 | // &,
38 | // &:hover{
39 | // text-decoration:none;
40 | // }
41 |
42 | // &:active,
43 | // &:focus{
44 | // outline:none;
45 | // }
46 |
47 | // }
48 |
49 |
50 |
51 |
52 |
53 | /*------------------------------------*\
54 | $SIZES
55 | \*------------------------------------*/
56 |
57 | // Example
58 |
59 | // .btn--small{
60 | // padding-top: 4px;
61 | // padding-bottom: 3px;
62 | // padding-right:1.5em;
63 | // padding-left: 1.5em;
64 | // line-height:2;
65 | // @include font-size(12px);
66 | // }
67 |
68 |
69 |
70 |
71 |
72 | /*------------------------------------*\
73 | $COLORS
74 | \*------------------------------------*/
75 |
76 | /**
77 | * Colors
78 | */
79 |
80 | // Example
81 |
82 | // .btn--color1{
83 | // @extend .bg-color1;
84 | // color: $white;
85 | // &:hover{
86 | // background-color: $color1;
87 | // }
88 | // }
89 |
90 |
91 |
92 |
93 |
94 |
95 | /**
96 | * HOVERS
97 | */
98 |
99 | // Example
100 |
101 | // .btn--color1, .btn--color2, .btn--color3, .btn--color4, .btn--gray4{
102 | // &:hover{
103 | // color: $white;
104 | // }
105 | // }
--------------------------------------------------------------------------------
/app/templates/styles/sass/ui/_color.scss:
--------------------------------------------------------------------------------
1 | /*------------------------------------*\
2 | $CONTENTS
3 | \*------------------------------------*/
4 | /**
5 | * TEXT
6 | * BACKGROUND
7 | * BORDERS
8 | * BLOCKS
9 | */
10 |
11 |
12 |
13 |
14 |
15 | /*------------------------------------*\
16 | $TEXT
17 | \*------------------------------------*/
18 |
19 | body { color: $gray5; }
20 |
21 | // Grays
22 | .white { color: $white; }
23 | .gray1 { color: $gray1; }
24 | .gray2 { color: $gray2; }
25 | .gray3 { color: $gray3; }
26 | .gray4 { color: $gray4; }
27 | .gray5 { color: $gray5; }
28 | .gray6 { color: $gray6; }
29 | .black { color: $black; }
30 |
31 | // Social Colors
32 | .color-twitter,
33 | .hover-color-twitter:hover { color: $twitter; }
34 |
35 | .color-linkedin,
36 | .hover-color-linkedin:hover { color: $linkedin; }
37 |
38 | .color-facebook,
39 | .hover-color-facebook:hover { color: $facebook; }
40 |
41 | .color-google,
42 | .hover-color-google:hover { color: $google; }
43 |
44 | .color-mail,
45 | .hover-color-mail:hover { color: $mail; }
46 |
47 | // Colors
48 | .color1,
49 | .hover-color1:hover,
50 | .hover-color1.active { color: $color1 !important; }
51 |
52 | .color2,
53 | .hover-color2:hover,
54 | .hover-color2.active { color: $color2 !important; }
55 |
56 | .color3,
57 | .hover-color3:hover,
58 | .hover-color3.active { color: $color3 !important; }
59 |
60 | .color4,
61 | .hover-color4:hover,
62 | .hover-color4.active { color: $color4 !important; }
63 |
64 | .color5,
65 | .hover-color5:hover,
66 | .hover-color5.active { color: $color5 !important; }
67 |
68 |
69 |
70 |
71 |
72 | /*------------------------------------*\
73 | $BACKGROUND
74 | \*------------------------------------*/
75 |
76 | .bg-white { background-color: $white; }
77 | .bg-gray1 { background-color: $gray1; }
78 | .bg-gray2 { background-color: $gray2; }
79 | .bg-gray3 { background-color: $gray3; }
80 | .bg-gray4 { background-color: $gray4; }
81 | .bg-gray5 { background-color: $gray5; }
82 | .bg-gray6 { background-color: $gray6; }
83 | .bg-black { background-color: $black; }
84 |
85 | .bg-color1 { background-color: $color1; }
86 | .bg-color2 { background-color: $color2; }
87 | .bg-color3 { background-color: $color3; }
88 | .bg-color4 { background-color: $color4; }
89 | .bg-color5 { background-color: $color5; }
90 |
91 |
92 | .bg-gray4,
93 | .bg-gray5,
94 | .bg-gray6,
95 | .bg-black,
96 | .bg-color1,
97 | .bg-color2,
98 | .bg-color3,
99 | .bg-color4,
100 | .bg-color5{
101 | color: $white;
102 | }
103 |
104 |
105 |
106 |
107 |
108 | /*------------------------------------*\
109 | $BORDERS
110 | \*------------------------------------*/
111 |
112 | .border-color1 { border-color: $color1; }
113 | .border-color2 { border-color: $color2; }
114 | .border-color3 { border-color: $color3; }
115 | .border-color4 { border-color: $color4; }
116 |
117 | .border-none{
118 | border: none !important;
119 | }
--------------------------------------------------------------------------------
/app/templates/styles/sass/ui/_footer.scss:
--------------------------------------------------------------------------------
1 | /*------------------------------------*\
2 | $CONTENTS
3 | \*------------------------------------*/
4 | /**
5 | * FOOTER
6 | */
7 |
8 |
9 |
10 |
11 |
12 | /*------------------------------------*\
13 | $FOOTER
14 | \*------------------------------------*/
15 |
--------------------------------------------------------------------------------
/app/templates/styles/sass/ui/_forms.scss:
--------------------------------------------------------------------------------
1 | /*------------------------------------*\
2 | $CONTENTS
3 | \*------------------------------------*/
4 | /**
5 | * OVERRIDES
6 | * LABELS
7 | * INPUTS
8 | * ERRORS
9 | * SIZES
10 | */
11 |
12 |
13 |
14 |
15 |
16 | /*------------------------------------*\
17 | $OVERRIDES
18 | \*------------------------------------*/
19 |
20 | input[type=text]:active,
21 | input[type=text]:focus,
22 | input[type=password]:active,
23 | input[type=password]:focus{
24 | cursor:text;
25 | outline:none;
26 | }
27 |
28 |
29 |
30 |
31 |
32 | /*------------------------------------*\
33 | $LABELS
34 | \*------------------------------------*/
35 |
36 | label,
37 | .label{
38 |
39 | }
40 |
41 |
42 |
43 |
44 |
45 | /*------------------------------------*\
46 | $INPUTS
47 | \*------------------------------------*/
48 |
49 | .text-input input,
50 | textarea{
51 |
52 | &:focus{
53 |
54 | }
55 | }
56 |
57 |
58 |
59 |
60 |
61 | /*------------------------------------*\
62 | $ERRORS
63 | \*------------------------------------*/
64 |
65 | .field-with-errors{
66 | position: relative;
67 | display: inline-block;
68 |
69 | label,
70 | .label{
71 | color: $color4;
72 | }
73 |
74 | input,
75 | // If using Select2
76 | .select2-container .select2-choice,
77 | .select2-container-multi .select2-choices{
78 | border-color: $color4 !important;
79 | }
80 | }
81 |
82 |
83 |
84 |
85 |
86 |
87 | /*------------------------------------*\
88 | $SIZES
89 | \*------------------------------------*/
90 |
91 | // The normal size is applied by default
92 |
93 | /**
94 | * Small
95 | */
96 | .form-fields__small input[type=text], .spoken-form input[type=text]{
97 |
98 | }
--------------------------------------------------------------------------------
/app/templates/styles/sass/ui/_header.scss:
--------------------------------------------------------------------------------
1 | /*------------------------------------*\
2 | $CONTENTS
3 | \*------------------------------------*/
4 | /**
5 | * LOGO
6 | */
7 |
8 |
9 |
10 |
11 |
12 | /*------------------------------------*\
13 | $LOGO
14 | \*------------------------------------*/
15 |
16 | header{
17 |
18 | }
19 |
20 | .brand{
21 |
22 | }
--------------------------------------------------------------------------------
/app/templates/styles/sass/ui/_helpers.scss:
--------------------------------------------------------------------------------
1 | /*------------------------------------*\
2 | $CONTENTS
3 | \*------------------------------------*/
4 | /**
5 | * SECTION TITLE
6 | */
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/templates/styles/sass/ui/_navs.scss:
--------------------------------------------------------------------------------
1 | /*------------------------------------*\
2 | $CONTENTS
3 | \*------------------------------------*/
4 | /**
5 | * NAV PRIMARY
6 | * NAV MOBILE
7 | */
8 |
9 |
10 |
11 |
12 |
13 | /*------------------------------------*\
14 | $NAV PRIMARY
15 | \*------------------------------------*/
16 |
17 |
18 |
19 |
20 |
21 | /*------------------------------------*\
22 | $NAV MOBILE
23 | \*------------------------------------*/
24 |
--------------------------------------------------------------------------------
/app/templates/styles/sass/ui/_scaffolding.scss:
--------------------------------------------------------------------------------
1 | /*------------------------------------*\
2 | $CONTENTS
3 | \*------------------------------------*/
4 | /**
5 | * GRID
6 | */
7 |
8 |
9 |
10 |
11 |
12 | /*------------------------------------*\
13 | $GRID
14 | \*------------------------------------*/
15 |
--------------------------------------------------------------------------------
/app/templates/styles/sass/ui/_typography.scss:
--------------------------------------------------------------------------------
1 | /*------------------------------------*\
2 | $CONTENTS
3 | \*------------------------------------*/
4 | /**
5 | * GLOBAL
6 | * COLORS
7 | * LOAD FONTS
8 | * ICONS
9 | * HEADINGS
10 | * LINKS
11 | * ICONS
12 | * OTHER
13 | */
14 |
15 |
16 |
17 |
18 |
19 | /*------------------------------------*\
20 | $GLOBAL
21 | \*------------------------------------*/
22 |
23 | html{
24 | font-weight: 300;
25 | font-style: normal;
26 | }
27 |
28 |
29 |
30 |
31 |
32 | /*------------------------------------*\
33 | $COLORS
34 | \*------------------------------------*/
35 |
36 | // See _color.scss
37 |
38 |
39 |
40 |
41 |
42 | /*------------------------------------*\
43 | $LOAD FONTS
44 | \*------------------------------------*/
45 |
46 | // Example
47 |
48 | // @include font-face("Icons", "../fonts/Icons");
49 |
50 |
51 |
52 |
53 |
54 |
55 | /*------------------------------------*\
56 | $ICONS
57 | \*------------------------------------*/
58 |
59 | [data-icon]:before {
60 | content: attr(data-icon);
61 | text-transform: none;
62 | font-weight: normal;
63 | font-variant: normal;
64 | font-family: 'Icons';
65 | line-height: 1;
66 | speak: none;
67 | -webkit-font-smoothing: antialiased;
68 | }
69 |
70 |
71 |
72 |
73 |
74 | /*------------------------------------*\
75 | $HEADINGS
76 | \*------------------------------------*/
77 |
78 |
79 |
80 |
81 |
82 | /*------------------------------------*\
83 | $LINKS
84 | \*------------------------------------*/
85 |
86 | a{
87 | // @include transition (color .2s ease-in); // You can use this if Bourbon is installed
88 | color: $gray6;
89 |
90 | &:hover{ color: $brand-color; }
91 | }
92 |
93 |
94 |
95 |
96 |
97 | /*------------------------------------*\
98 | $OTHER
99 | \*------------------------------------*/
100 |
101 | strong,
102 | .bold{ font-weight: bold; }
103 |
104 | em{ font-style: italic; }
105 |
106 | .no-underline{ text-decoration: none; }
107 |
108 | ::selection {
109 | background: $color1;
110 | color: $white;
111 | }
112 | ::-moz-selection {
113 | background: $color1;
114 | color: $white;
115 | }
--------------------------------------------------------------------------------
/app/templates/styles/screen.css:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lukelarsen/generator-node-express/4f729b11b8d97febd618d4653b8b0a32a726c779/app/templates/styles/screen.css
--------------------------------------------------------------------------------
/app/templates/travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 | node_js:
3 | - '0.8'
4 | - '0.10'
5 |
--------------------------------------------------------------------------------
/app/templates/views/index.handlebars:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Your Node Express App
4 |
5 |
--------------------------------------------------------------------------------
/app/templates/views/layouts/main.handlebars:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | <%= _.capitalize(projectName) %>
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
21 |
22 |
30 |
31 | {{{ body }}}
32 |
33 |
36 |
37 | <% if (useAngular) { %>
38 | <% } %><% if (useJQuery) { %>
39 | <% } %>
40 |
41 |
42 |
43 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "generator-node-express",
3 | "version": "0.0.4",
4 | "description": "A generator for Yeoman that will kick start a Node Application using Express.",
5 | "keywords": [
6 | "yeoman-generator",
7 | "Express",
8 | "Express3-Handlebars",
9 | "Inuit.css",
10 | "Bourbon"
11 | ],
12 | "homepage": "https://github.com/lukelarsen/generator-node-express",
13 | "bugs": "https://github.com/lukelarsen/generator-node-express/issues",
14 | "author": {
15 | "name": "Luke",
16 | "email": "luke@lukelarsen.com",
17 | "url": "https://github.com/lukelarsen"
18 | },
19 | "main": "app/index.js",
20 | "repository": {
21 | "type": "git",
22 | "url": "git://github.com/lukelarsen/generator-node-express.git"
23 | },
24 | "scripts": {
25 | "test": "mocha"
26 | },
27 | "dependencies": {
28 | "yeoman-generator": "~0.13.0"
29 | },
30 | "devDependencies": {
31 |
32 | },
33 | "peerDependencies": {
34 | "yo": ">=1.0.0-rc.1"
35 | },
36 | "engines": {
37 | "node": ">=0.8.0",
38 | "npm": ">=1.2.10"
39 | },
40 | "licenses": [
41 | {
42 | "type": "MIT"
43 | }
44 | ]
45 | }
46 |
--------------------------------------------------------------------------------
/test/test-creation.js:
--------------------------------------------------------------------------------
1 | /*global describe, beforeEach, it*/
2 | 'use strict';
3 |
4 | var path = require('path');
5 | var helpers = require('yeoman-generator').test;
6 |
7 |
8 | describe('node-express generator', function () {
9 | beforeEach(function (done) {
10 | helpers.testDirectory(path.join(__dirname, 'temp'), function (err) {
11 | if (err) {
12 | return done(err);
13 | }
14 |
15 | this.app = helpers.createGenerator('node-express:app', [
16 | '../../app'
17 | ]);
18 | done();
19 | }.bind(this));
20 | });
21 |
22 | it('creates expected files', function (done) {
23 | var expected = [
24 | // add files you expect to exist here.
25 | '.jshintrc',
26 | '.editorconfig'
27 | ];
28 |
29 | helpers.mockPrompt(this.app, {
30 | 'someOption': true
31 | });
32 | this.app.options['skip-install'] = true;
33 | this.app.run({}, function () {
34 | helpers.assertFiles(expected);
35 | done();
36 | });
37 | });
38 | });
39 |
--------------------------------------------------------------------------------
/test/test-load.js:
--------------------------------------------------------------------------------
1 | /*global describe, beforeEach, it*/
2 | 'use strict';
3 |
4 | var assert = require('assert');
5 |
6 | describe('node-express generator', function () {
7 | it('can be imported without blowing up', function () {
8 | var app = require('../app');
9 | assert(app !== undefined);
10 | });
11 | });
12 |
--------------------------------------------------------------------------------