├── .editorconfig
├── .gitattributes
├── .gitignore
├── .jshintrc
├── .travis.yml
├── Gruntfile.js
├── History.md
├── README.md
├── app
├── index.js
└── templates
│ ├── Gruntfile.js
│ ├── Gruntfile.slim.js
│ ├── _bower.json
│ ├── _package.json
│ ├── bowerrc
│ ├── editorconfig
│ ├── eslintrc
│ ├── gitignore
│ ├── grunt
│ ├── aliases.js
│ ├── appcache.js
│ ├── autoprefixer.js
│ ├── availabletasks.js
│ ├── bowerRequirejs.js
│ ├── browserSync.js
│ ├── browserify.js
│ ├── clean.js
│ ├── concat.js
│ ├── connect.js
│ ├── copy.js
│ ├── critical.js
│ ├── cssmin.js
│ ├── eslint.js
│ ├── exec.js
│ ├── filerev.js
│ ├── http.js
│ ├── imagemin.js
│ ├── karma.js
│ ├── less.js
│ ├── phpunit.js
│ ├── requirejs.js
│ ├── sass.js
│ ├── stylus.js
│ ├── svgmin.js
│ ├── sw-precache.js
│ ├── uglify.js
│ ├── uncss.js
│ ├── usemin.js
│ ├── watch.js
│ ├── webpack.js
│ └── wiredep.js
│ ├── hooks
│ └── post-merge
│ ├── img
│ ├── touch
│ │ ├── android-chrome-144x144.png
│ │ ├── android-chrome-192x192.png
│ │ ├── android-chrome-36x36.png
│ │ ├── android-chrome-48x48.png
│ │ ├── android-chrome-72x72.png
│ │ ├── android-chrome-96x96.png
│ │ ├── apple-touch-icon-114x114.png
│ │ ├── apple-touch-icon-120x120.png
│ │ ├── apple-touch-icon-144x144.png
│ │ ├── apple-touch-icon-152x152.png
│ │ ├── apple-touch-icon-180x180.png
│ │ ├── apple-touch-icon-57x57.png
│ │ ├── apple-touch-icon-60x60.png
│ │ ├── apple-touch-icon-72x72.png
│ │ ├── apple-touch-icon-76x76.png
│ │ ├── apple-touch-icon-precomposed.png
│ │ ├── apple-touch-icon.png
│ │ ├── favicon-16x16.png
│ │ ├── favicon-32x32.png
│ │ ├── favicon-96x96.png
│ │ ├── mstile-144x144.png
│ │ ├── mstile-150x150.png
│ │ ├── mstile-310x150.png
│ │ ├── mstile-310x310.png
│ │ ├── mstile-70x70.png
│ │ └── safari-pinned-tab.svg
│ └── yo-grunt-bower-symfony.png
│ ├── jscsrc
│ ├── public
│ ├── appcache-loader.html
│ ├── browserconfig.xml
│ ├── favicon.ico
│ ├── manifest.json
│ ├── manifest.webapp
│ └── service-worker.js
│ ├── scripts
│ ├── browserify
│ │ ├── main.js
│ │ ├── modules
│ │ │ ├── dummy.js
│ │ │ └── service-worker.js
│ │ └── shim
│ │ │ ├── bootstrap.js
│ │ │ ├── foundation.js
│ │ │ └── uikit.js
│ ├── jspm
│ │ ├── config.js
│ │ ├── main.js
│ │ └── modules
│ │ │ ├── dummy.js
│ │ │ └── service-worker.js
│ ├── requirejs
│ │ ├── app.js
│ │ ├── config.js
│ │ ├── main.js
│ │ └── modules
│ │ │ ├── dummy.js
│ │ │ └── service-worker.js
│ ├── sw
│ │ └── runtime-caching.js
│ └── webpack
│ │ ├── main.js
│ │ ├── modules
│ │ ├── dummy.js
│ │ └── service-worker.js
│ │ └── shim
│ │ ├── bootstrap.js
│ │ ├── foundation.js
│ │ └── uikit.js
│ ├── styles
│ ├── inuit
│ │ ├── base
│ │ │ └── _index.scss
│ │ ├── components
│ │ │ ├── _index.scss
│ │ │ ├── content.scss
│ │ │ ├── header.scss
│ │ │ ├── nav.scss
│ │ │ └── panel.scss
│ │ ├── elements
│ │ │ └── _index.scss
│ │ ├── generic
│ │ │ └── _index.scss
│ │ ├── main.scss
│ │ ├── objects
│ │ │ └── _index.scss
│ │ ├── settings
│ │ │ └── _index.scss
│ │ ├── tools
│ │ │ └── _index.scss
│ │ ├── trumps
│ │ │ ├── _index.scss
│ │ │ ├── align.scss
│ │ │ ├── display.scss
│ │ │ ├── layout.scss
│ │ │ └── text.scss
│ │ └── vendor
│ │ │ └── _index.scss
│ ├── main.css
│ ├── main.less
│ ├── main.scss
│ └── main.styl
│ ├── symfony
│ ├── DefaultController.php
│ ├── DefaultControllerTest.php
│ ├── _htaccess
│ ├── app.php
│ ├── base.html.twig
│ ├── config_node.yml
│ ├── index.html.twig
│ └── routing.yml
│ ├── test
│ ├── browserify
│ │ ├── karma.conf.js
│ │ └── spec
│ │ │ └── dummySpec.js
│ ├── jspm
│ │ ├── karma.conf.js
│ │ └── spec
│ │ │ └── dummySpec.js
│ ├── requirejs
│ │ ├── karma.conf.js
│ │ ├── spec
│ │ │ └── dummySpec.js
│ │ └── test-main.js
│ └── webpack
│ │ ├── karma.conf.js
│ │ └── spec
│ │ └── dummySpec.js
│ └── webpack.config.js
├── package.json
└── test
├── .jshintrc
├── fixtures
├── app
│ ├── Resources
│ │ └── public
│ │ │ └── scripts
│ │ │ └── config.js
│ ├── autoload.php
│ └── config
│ │ ├── parameters.yml
│ │ └── parameters.yml.dist
├── bower.json
├── composer.json
├── composer.lock
├── composer.phar
└── package.json
├── helper
├── fileHelper.js
├── fixturesHelper.js
└── testHelper.js
└── test-app.js
/.editorconfig:
--------------------------------------------------------------------------------
1 | # http://editorconfig.org
2 | root = true
3 |
4 | [*]
5 | indent_style = space
6 | indent_size = 4
7 | charset = utf-8
8 | trim_trailing_whitespace = true
9 | insert_final_newline = true
10 |
11 | [*.md]
12 | trim_trailing_whitespace = false
13 |
14 | [*.yml]
15 | indent_style = space
16 | indent_size = 2
17 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | * text=auto
2 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | test/temp/
3 | test/fixtures/bin/
4 | test/fixtures/bower_components/
5 | test/fixtures/jspm_packages/
6 | test/fixtures/vendor/
7 | test/fixtures/app/bootstrap.php.cache
8 | test/fixtures/app/check.php
9 | test/fixtures/app/SymfonyRequirements.php
10 |
--------------------------------------------------------------------------------
/.jshintrc:
--------------------------------------------------------------------------------
1 | {
2 | "node": true,
3 | "esnext": true,
4 | "bitwise": true,
5 | "curly": true,
6 | "eqeqeq": true,
7 | "immed": true,
8 | "latedef": true,
9 | "newcap": true,
10 | "mocha": true,
11 | "noarg": true,
12 | "quotmark": true,
13 | "undef": true,
14 | "unused": true,
15 | "strict": true
16 | }
17 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | sudo: false
2 | language: node_js
3 | node_js:
4 | - stable
5 | - '0.12'
6 | addons:
7 | apt:
8 | packages:
9 | - php5
10 | - php5-curl
11 | - php5-cli
12 | - php5-intl
13 |
14 | before_install:
15 | - gem update --system
16 | - gem install sass
17 | - php --version
18 | - php -r "readfile('https://getcomposer.org/installer');" | php && php composer.phar config -g github-oauth.github.com $GH_AUTH
19 | - npm update -g npm
20 | - npm install -g bower grunt-cli jspm
21 | - jspm config registries.github.auth $JSPM_AUTH
22 | - currentfolder=${PWD##*/}
23 | - if [ "$currentfolder" != 'generator-grunt-symfony' ]; then cd .. && eval "mv $currentfolder generator-grunt-symfony" && cd generator-grunt-symfony; fi
24 | - npm install
25 |
26 | matrix:
27 | fast_finish: true
28 |
29 | cache:
30 | directories:
31 | - node_modules
32 | - test/fixtures/bower_components
33 | - test/fixtures/jspm_packages
34 | - test/fixtures/node_modules
35 | - test/fixtures/vendor
36 |
--------------------------------------------------------------------------------
/Gruntfile.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | var shell = require('shelljs');
3 | var exec = require('child_process').exec;
4 | var fs = require('fs-extra');
5 | var path = require('path');
6 | var debug = require('debug')('yeoman:generator-grunt-symfony');
7 |
8 | module.exports = function (grunt) {
9 | require('load-grunt-tasks')(grunt);
10 |
11 | // Project configuration.
12 | grunt.initConfig({
13 | pkg: grunt.file.readJSON('package.json'),
14 | jshint: {
15 | all: [
16 | 'Gruntfile.js',
17 | 'app/index.js',
18 | 'test/**/*.js',
19 | '!test/fixtures/**/*.js',
20 | '!test/temp/**/*.js'
21 | ],
22 | options: {
23 | jshintrc: '.jshintrc',
24 | reporter: require('jshint-stylish')
25 | }
26 | },
27 | clean: {
28 | test: [
29 | 'test/fixtures/node_modules',
30 | 'test/fixtures/bower_components',
31 | 'test/fixtures/jspm_packages',
32 | 'test/fixtures/composer.phar',
33 | 'test/fixtures/app/bootstrap.php.cache',
34 | 'test/fixtures/app/check.php',
35 | 'test/fixtures/app/SymfonyRequirements.php',
36 | 'test/fixtures/vendor'
37 | ]
38 | },
39 | simplemocha: {
40 | all: ['test/*.js'],
41 | options: {
42 | reporter: 'spec',
43 | timeout: 600000,
44 | ui: 'bdd'
45 | }
46 | }
47 | });
48 |
49 | grunt.registerTask('updateFixtures', 'updates package and bower fixtures', function () {
50 | var done = this.async();
51 | var packageJson = fs.readFileSync(path.resolve('app/templates/_package.json'), 'utf8');
52 | var bowerJson = fs.readFileSync(path.resolve('app/templates/_bower.json'), 'utf8');
53 | var jspmConfig = fs.readFileSync(path.resolve('app/templates/scripts/jspm/config.js'), 'utf8');
54 |
55 | // remove all ejs conditionals
56 | packageJson = packageJson.replace(/"name": "<%(.*)%>"/g, '"name": "tempApp"');
57 | packageJson = packageJson.replace(/<%(.*)%>/g, '');
58 |
59 | bowerJson = bowerJson.replace(/"name": "<%(.*)%>"/g, '"name": "tempApp"');
60 | bowerJson = bowerJson.replace(/<%(.*)%>/g, '');
61 |
62 | jspmConfig = jspmConfig.replace(/<%(.*)%>/g, '');
63 |
64 | // save files
65 | fs.outputFile(path.resolve(__dirname + '/test/fixtures/package.json'), packageJson, function () {
66 | fs.outputFile(path.resolve(__dirname + '/test/fixtures/bower.json'), bowerJson, function () {
67 | fs.outputFile(path.resolve(__dirname + '/test/fixtures/app/Resources/public/scripts/config.js'), jspmConfig, function () {
68 | done();
69 | });
70 | });
71 | });
72 | });
73 |
74 |
75 | grunt.registerTask('installNpmFixtures', 'install npm packages', function () {
76 | var done = this.async();
77 |
78 | shell.cd('test/fixtures');
79 | grunt.log.ok('installing npm dependencies for generated app');
80 | exec('npm install', {cwd: '../fixtures'}, function () {
81 | grunt.log.ok('installing npm dependencies for generated app (2nd run)');
82 | exec('npm install', {cwd: '../fixtures'}, function () {
83 | shell.cd('../../');
84 | done();
85 | }).stdout.on('data', function(data) {
86 | console.log(data);
87 | });
88 | }).stdout.on('data', function(data) {
89 | console.log(data);
90 | });
91 | });
92 |
93 | grunt.registerTask('installBowerFixtures', 'install bower packages', function () {
94 | var done = this.async();
95 |
96 | shell.cd('test/fixtures');
97 | grunt.log.ok('installing bower dependencies for generated app');
98 | exec('bower install', {cwd: '../fixtures'}, function () {
99 | shell.cd('../../');
100 | done();
101 | }).stdout.on('data', function(data) {
102 | console.log(data);
103 | });
104 | });
105 |
106 | grunt.registerTask('installJspmFixtures', 'install jspm packages', function () {
107 | var done = this.async();
108 |
109 | shell.cd('test/fixtures');
110 | grunt.log.ok('installing jspm dependencies for generated app');
111 | exec('npm install --save jspm', {cwd: '../fixtures'}, function () {
112 | exec('node_modules/.bin/jspm install', {cwd: '../fixtures'}, function () {
113 | shell.cd('../../');
114 | done();
115 | }).stdout.on('data', function(data) {
116 | console.log(data);
117 | });
118 | }).stdout.on('data', function(data) {
119 | console.log(data);
120 | });
121 | });
122 |
123 | grunt.registerTask('installComposerFixtures', 'install Composer fixtures', function () {
124 | var done = this.async();
125 |
126 | shell.cd('test/fixtures');
127 | grunt.log.ok('fetching local composer');
128 | exec('php -r "readfile(\'https://getcomposer.org/installer\');" | php', function() {
129 | grunt.log.ok('installing composer dependencies for generated app');
130 | exec('php composer.phar update --prefer-source --no-interaction --dev ', {cwd: '../fixtures'}, function (error, stdout, stderr) {
131 | debug('stdout: composer.phar update -> ', stdout);
132 | debug('stderr: composer.phar update -> ', stderr);
133 |
134 | if (error) {
135 | debug('stderr: composer.phar update -> ', stderr);
136 | }
137 | exec('php composer.phar run-script post-update-cmd --no-interaction ', {cwd: '../fixtures'}, function (error, stdout, stderr) {
138 | debug('stdout: composer.phar run-script -> ', stdout);
139 | debug('stderr: composer.phar run-script -> ', stderr);
140 |
141 | if (error) {
142 | debug('stderr: composer.phar run-script -> ', stderr);
143 | }
144 | shell.cd('../../');
145 | done();
146 | }).stdout.on('data', function(data) {
147 | console.log(data);
148 | });
149 | }).stdout.on('data', function(data) {
150 | console.log(data);
151 | });
152 | }).stdout.on('data', function(data) {
153 | console.log(data);
154 | });
155 |
156 |
157 | });
158 |
159 |
160 | grunt.registerTask('installFixtures', 'install package and bower fixtures', function () {
161 | var done = this.async();
162 |
163 | shell.cd('test/fixtures');
164 | grunt.log.ok('installing jspm dependencies for generated app');
165 |
166 | exec('jspm install', {cwd: '../fixtures'}, function (err) {
167 | if (err) {
168 | grunt.log.error(err.message || err);
169 | }
170 | grunt.log.ok('installing bower dependencies for generated app');
171 | exec('bower install', {cwd: '../fixtures'}, function () {
172 | grunt.log.ok('installing npm dependencies for generated app');
173 | exec('npm install', {cwd: '../fixtures'}, function () {
174 |
175 | grunt.log.ok('installing comnposer dependencies for generated app');
176 | exec('composer install --no-interaction', {cwd: '../fixtures'}, function () {
177 | grunt.log.ok('installing npm dependencies for generated app (2nd run)');
178 | exec('npm install', {cwd: '../fixtures'}, function () {
179 |
180 | shell.cd('../../');
181 | done();
182 | });
183 | });
184 | });
185 | });
186 | });
187 | });
188 |
189 | grunt.registerTask('test', [
190 | 'clean:test',
191 | 'jshint',
192 | 'updateFixtures',
193 | 'installJspmFixtures',
194 | 'installNpmFixtures',
195 | 'installBowerFixtures',
196 | 'installComposerFixtures',
197 | 'simplemocha'
198 | ]);
199 | };
200 |
--------------------------------------------------------------------------------
/History.md:
--------------------------------------------------------------------------------
1 |
2 | 0.10.0 / 2016-03-16
3 | ==================
4 |
5 | * fix paths for bootstrap-stylus
6 | * tweaked travis setup
7 | * fix path for npm bootstrap-sass
8 | * minor style tweak
9 | * update readme
10 | * update fixtures
11 | * minor test tweaks
12 | * minor fix for webpack + uikit
13 | * use css kits from npm for webpack & browserify
14 | * routes config for critical & uncss
15 | * add browserify tests
16 | * bump tests
17 | * update bower components & resolve jquery issue
18 | * eslint fix
19 | * bump foundation to 6.2.0
20 | * minor webpack tweaks
21 | * add browserify
22 | * node 0.12 fix
23 | * local composer for tests
24 | * webpck update to babel 6
25 | * fixed eslint issues
26 | * bump tests
27 | * enable jshint
28 | * bump deps
29 | * fix post-merge hook for local composer
30 | * more lightweight assets task
31 | * default to symfony 3.0
32 | * minor fix for requirejs
33 | * Fixed kernel env for SF3
34 | * Update .travis.yml
35 | * renamed travis environment var
36 | * new composer token
37 |
38 | 0.9.2 / 2016-01-21
39 | ==================
40 |
41 | * tweaks for lodash 4
42 | * add app icons + manifest
43 | * added appcache to tests
44 | * some tweaks
45 | * relatrive asset filerev fix
46 | * Update README.md
47 |
48 | 0.9.1 / 2016-01-10
49 | ==================
50 |
51 | * fixes for symfony 3.0
52 | * bump deps
53 |
54 | 0.9.0 / 2016-01-08
55 | ==================
56 |
57 | * fixed karma/require tests
58 | * dynamic port
59 | * even better tests
60 | * fixed eslint
61 | * added service worker
62 |
63 | 0.8.0 / 2016-01-05
64 | ==================
65 |
66 | * eslint fixes for requirejs config
67 | * removed jshint
68 | * updated tests
69 | * jscsrc for webstorm code style configuration
70 | * dropped jshint & added eslint
71 |
72 | 0.7.2 / 2015-12-31
73 | ==================
74 |
75 | * jspm fixes
76 | * remove deprecated warnings
77 | * bump deps
78 | * jspm babel version
79 | * fixed tests
80 | * use visionmedia debug instead of loglevel
81 | * Fixed #57
82 | * show available grunt tasks on default
83 |
84 | 0.7.1 / 2015-12-09
85 | ==================
86 |
87 | * tweaked .travis.yml
88 | * unfixed lodash version
89 | * debugging composer in travis
90 | * use composer post-install-cmd
91 | * travis debug
92 | * local jspm & composer auth
93 | * more debug + composer cache-clear
94 | * added travis debug logs
95 | * try container-based travis
96 |
97 | 0.7.0 / 2015-12-08
98 | ==================
99 |
100 | * Travis composer tweaks
101 | * Use bem syntax for inuit
102 | * Add inuit css
103 | * Fixed webpack dist target dir
104 | * Symfony 3.0 compatibility
105 | * Separated Bundle for handling filerev asset rewrites
106 | * Bump dependencies
107 |
108 | 0.6.0 / 2015-11-09
109 | ==================
110 |
111 | * Added support for Symfony 2.7
112 | * Added support for Webpack
113 | * Dropped support for Pure CSS
114 | * Picturefill 3
115 | * Bump dependencies
116 | * Tweaked tests
117 | * fixed chmod issue when using git (#19)
118 |
119 | 0.5.2 / 2015-09-10
120 | ==================
121 |
122 | * Fixed filerev paths for windows (#18)
123 |
124 | 0.5.1 / 2015-09-10
125 | ==================
126 |
127 | * Fixed missing fs.deleteSync
128 |
129 | 0.5.0 / 2015-09-10
130 | ==================
131 |
132 | * Filerev bundle improvments
133 | * bump deps
134 |
135 | 0.4.1 / 2015-06-18
136 | ==================
137 |
138 | * Init picturefill for jspm
139 | * picturefill version bump
140 |
141 | 0.4.0 / 2015-06-17
142 | ==================
143 |
144 | * Replace usemin for twig with filerev bundle
145 | * Added filerev bundle
146 |
147 | 0.3.7 / 2015-06-10
148 | ==================
149 |
150 | * Fixed issue with comma after loglevel [Bruno Wego]
151 | * Minor tweaks
152 |
153 | 0.3.6 / 2015-05-19
154 | ==================
155 |
156 | * Better generator tests including phpunit
157 | * Phpunit integration
158 | * Karma integration
159 |
160 | 0.3.5 / 2015-04-28
161 | ==================
162 |
163 | * Fixed wrong allocated bootstrap js
164 |
165 | 0.3.4 / 2015-04-25
166 | ==================
167 |
168 | * bump deps
169 | * Add some unser hint
170 | * badges
171 | * Promts restructured + update-notifier
172 | * Updates for test
173 | * Added uncss
174 |
175 | 0.3.3 / 2015-04-01
176 | ==================
177 |
178 | * Set symfony folder permissions for 'app/cache' & 'app/logs'
179 |
180 | 0.3.2 / 2015-03-31
181 | ==================
182 |
183 | * Smarter tests to speed up travis
184 | * Added optional 'load-grunt-config'
185 |
186 | 0.3.1 / 2015-03-30
187 | ==================
188 | * Added tests for jspm configuration
189 | * Use 'includePaths' for libsass
190 | * dropped autoprefixer plugins in favour of grunt-autoprefixer 2.2.0
191 | * bump deps
192 | * improved tests
193 | * integrated frontend framework scripts with requirejs
194 | * integrated frontend framework scripts with jspm
195 | * Fix #9
196 | * Fixed typo
197 |
198 | 0.3.0 / 2015-03-20
199 | ==================
200 |
201 | * Added uikit support
202 | * Added css framework support for jspm
203 |
204 | 0.2.3 / 2015-03-19
205 | ==================
206 |
207 | * fixed symfony environment
208 |
209 | 0.2.2 / 2015-03-19
210 | ==================
211 |
212 | * composer cmd fix
213 |
214 | 0.2.1 / 2015-03-19
215 | ==================
216 |
217 | * minor template fix
218 |
219 | 0.2.0 / 2015-03-18
220 | ==================
221 |
222 | * Added critical
223 | * bumped dependency
224 | * optimized rev process
225 |
226 | 0.1.3 / 2015-03-12
227 | ==================
228 |
229 | * Allow local installed jspm
230 |
231 | 0.1.2 / 2015-03-06
232 | ==================
233 |
234 | * Added 'git init' option + post-merge hook for composer, node, jspm & bower
235 |
236 | 0.1.1 / 2015-03-06
237 | ==================
238 |
239 | * Fixed missing font
240 | * Tweaked jshint
241 | * Fixed BrowserSync:dist
242 | * Bumped dependencies
243 |
244 | 0.1.0 / 2015-02-19
245 | ==================
246 |
247 | * Added custom gitignore to fix #7
248 | * Fixed run loop
249 |
250 | 0.0.8 / 2015-02-18
251 | ==================
252 |
253 | * cleanup
254 | * Fixed #5
255 | * Add hint on missing composer for win32 user
256 | * Update README.md
257 |
258 | 0.0.7 / 2015-02-12
259 | ==================
260 |
261 | * Fixed dependency issue in generated package.json
262 |
263 | 0.0.6 / 2015-02-11
264 | ==================
265 |
266 | * Fixed ruby-sass configuration
267 | * Minor tweaks
268 | * Cleanup, fixes #3
269 | * Added info to jspm & requirejs
270 | * Basic template for noframework option
271 | * Default to dot notation
272 | * Added some tests
273 | * Merge pull request #1 from futjikato/symfony-parameters-patch-1
274 | * Remove sourcemap generation for requirejs
275 | * Added choice to use dot-notation in parameters.
276 | * Added `grunt serve:dist` configuration
277 |
278 | 0.0.5 / 2015-02-11
279 | ==================
280 |
281 | * Fixed Less + Foundation
282 |
283 | 0.0.4 / 2015-02-11
284 | ==================
285 |
286 | * Fixed build process
287 |
288 | 0.0.3 / 2015-02-11
289 | ==================
290 |
291 | * Initial release
292 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # generator-grunt-symfony
2 | [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][depstat-image]][depstat-url] [![Download][dlcounter-image]][dlcounter-url]
3 |
4 | This [Yeoman](http://yeoman.io) generator scaffolds a symfony app with full featured frontend tooling.
5 | Just scaffold your app, run `grunt serve` and you are ready to go.
6 |
7 | ## DEPRECATED Use [generator-sf](https://github.com/bezoerb/generator-sf) instead
8 |
9 | 
10 |
11 | ## Features
12 | * Symfony framework
13 | * Twig templating engine
14 | * Assetic removed
15 | * Browsersync dev/prod server with livereload
16 | * Choose the CSS preprocessor which fits your needs
17 | - [Sass](http://sass-lang.com/)
18 | - [Less](http://lesscss.org)
19 | - [Stylus](http://learnboost.github.io/stylus/)
20 | - or no preprocessor at all
21 | * Choose CSS Framework
22 | * [uikit](http://getuikit.com)
23 | * [Bootstrap](http://getbootstrap.com)
24 | * [Foundation](http://foundation.zurb.com)
25 | * [inuitcss](http://inuitcss.com) (sass only)
26 | * no framework?
27 | * Choose Javascript module loader
28 | * [RequireJS](http://requirejs.org/)
29 | * [JSPM](http://jspm.io/) + [SystemJS](https://github.com/systemjs/systemjs) (ES6)
30 | * [Webpack](https://webpack.github.io/) (ES6)
31 | * [Browserify](http://browserify.org/) (ES6)
32 | * File revving
33 | * Image optimization
34 | * [Critical](https://github.com/addyosmani/critical) (Extract & Inline Critical-path CSS)
35 | * [uncss](https://github.com/addyosmani/grunt-uncss) (Automatically strip off unused css)
36 | * Service Worker
37 | * Organized Gruntfile with [load-grunt-config](http://firstandthird.github.io/load-grunt-config)
38 | * Preconfigured testing Stack: [Karma](http://karma-runner.github.io/0.12/index.html), [Mocha](http://mochajs.org/) & [Chai](http://chaijs.com/)
39 | * Phpunit
40 |
41 |
42 | ## Things to come
43 |
44 | * Feel free to add feature requests ;)
45 |
46 | ## Getting Started
47 |
48 | Install dependencies
49 | ```bash
50 | npm install -g yo grunt bower
51 | ```
52 | To install generator-grunt-symfony from npm, run:
53 | ```bash
54 | npm install -g generator-grunt-symfony
55 | ```
56 |
57 | Finally, initiate the generator:
58 |
59 | ```bash
60 | yo grunt-symfony
61 | ```
62 |
63 | ### Environments
64 | The browsersync server uses it's own symfony environment to prevent asset loading conflicts with the environment loaded via apache2.
65 |
66 | ### Directory structure
67 | The directory structure is based on the [Symfony Best Practices](http://symfony.com/doc/current/best_practices/index.html)
68 | #### Dev
69 | * Assets are located in `app/Resources/public`
70 | * Templates can be found in `app/Resources/views`
71 |
72 | #### Production
73 | * All production assets are located in the `web` folder.
74 | *
75 | Run `grunt build` to compile, optimize and rev your assets for production.
76 |
77 | ### Getting To Know Yeoman
78 |
79 | Yeoman has a heart of gold. He's a person with feelings and opinions, but he's very easy to work with. If you think he's too opinionated, he can be easily convinced.
80 |
81 | If you'd like to get to know Yeoman better and meet some of his friends, [Grunt](http://gruntjs.com) and [Bower](http://bower.io), check out the complete [Getting Started Guide](https://github.com/yeoman/yeoman/wiki/Getting-Started).
82 |
83 | ### Changelog
84 |
85 | See [History.md](History.md)
86 |
87 | ## License
88 |
89 | MIT
90 |
91 | [npm-url]: https://npmjs.org/package/generator-grunt-symfony
92 | [npm-image]: https://badge.fury.io/js/generator-grunt-symfony.svg
93 |
94 | [travis-url]: https://travis-ci.org/bezoerb/generator-grunt-symfony
95 | [travis-image]: https://secure.travis-ci.org/bezoerb/generator-grunt-symfony.svg?branch=master
96 |
97 | [depstat-url]: https://david-dm.org/bezoerb/generator-grunt-symfony
98 | [depstat-image]: https://david-dm.org/bezoerb/generator-grunt-symfony.svg
99 |
100 | [dlcounter-url]: https://www.npmjs.com/package/generator-grunt-symfony
101 | [dlcounter-image]: https://img.shields.io/npm/dm/generator-grunt-symfony.svg
102 |
--------------------------------------------------------------------------------
/app/templates/Gruntfile.slim.js:
--------------------------------------------------------------------------------
1 | // Generated on <%= (new Date).toISOString().split('T')[0] %> using
2 | // <%= pkg.name %> <%= pkg.version %>
3 | module.exports = function(grunt) {
4 | var _ = require('lodash');
5 | var fs = require('fs');
6 | var path = require('path');
7 |
8 | var env = _.defaults(fs.existsSync('.envrc') && grunt.file.readJSON('.envrc') || {}, {
9 | port: parseInt(grunt.option('port'), 10) || 8000
10 | });
11 |
12 | var paths = {
13 | app: 'app/Resources/public',
14 | dist: 'web'
15 | };
16 |
17 | // Define routes which should be processed by critical & uncss
18 | // critical-path css will be located in 'app/Resources/public/styles/critical'
19 | // The files are named with the routes key. e.g. index.css
20 | var routes = {
21 | // 'index': '/'
22 | };
23 |
24 | require('jit-grunt')(grunt,{
25 | availabletasks: 'grunt-available-tasks'
26 | });
27 |
28 | // load grunt config
29 | require('load-grunt-config')(grunt, {
30 | // path to task.js files, defaults to grunt dir
31 | configPath: path.join(process.cwd(), 'grunt'),
32 |
33 | // auto grunt.initConfig
34 | init: true,
35 |
36 | // data passed into config.
37 | data: {
38 | paths: paths,
39 | env: env,
40 | routes: routes
41 | },
42 |
43 | jitGrunt: true
44 | });
45 | };
46 |
--------------------------------------------------------------------------------
/app/templates/_bower.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "<%= safeProjectName %>",
3 | "private": true,
4 | "dependencies": {
5 | "jquery": "~2.2.1",
6 | "bootstrap": "~3.3.0",
7 | "bootstrap-sass-official": "~3.3.0",
8 | "bootstrap-stylus": "~5.0.2",
9 | "sass-bootstrap-glyphicons": "~1.0.0",
10 | "foundation-sites": "~6.2.0",
11 | "uikit": "~2.26.2",
12 | "visionmedia-debug": "~2.2.0",
13 | "requirejs": "2.2.0",
14 | "almond": "~0.3.0",
15 | "picturefill": "~3.0.1",
16 | "modernizr": "~3.3.1",
17 | "appcache-nanny": "~1.0.3"
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/app/templates/_package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "<%= safeProjectName %>",
3 | "version": "0.0.0",
4 | "scripts": {
5 | "test": "grunt test"
6 | },<% if (frameworkFromNpm) { %>
7 | "dependencies": {
8 | "jquery": "^2.1.4",
9 | "picturefill": "^3.0.2"<% if (useBootstrap && useSass) { %>,
10 | "bootstrap-sass": "^3.3.6"<% } else if (useBootstrap && useStylus) { %>,
11 | "bootstrap-styl": "^5.0.5"<% } if (useBootstrap) { %>,
12 | "bootstrap": "^3.3.5"<% } if (useUikit) { %>,
13 | "uikit": "^2.25.0"<% } if (useFoundation) { %>,
14 | "foundation-sites": "^6.2.0"<% } %>
15 | },<% } %>
16 | "devDependencies": {
17 | "bower": "^1.3.12",
18 | "grunt": "^1.0.1",
19 | "chalk": "^1.1.1",
20 | "lodash": "^4.6.1",
21 | "eslint": "^2.3.0",
22 | "eslint-config-xo": "^0.14.1",
23 | "grunt-eslint": "^18.0.0",
24 | "grunt-available-tasks": "^0.6.1",
25 | "grunt-browser-sync": "^2.0.0",
26 | "grunt-contrib-clean": "^1.0.0",
27 | "grunt-contrib-copy": "^1.0.0",
28 | "grunt-contrib-cssmin": "^1.0.0",
29 | "grunt-sw-precache": "^1.0.3",
30 | "sw-toolbox": "^3.0.1",
31 | "appcache-nanny": "^1.0.3",
32 | "grunt-appcache": "^0.2.0",
33 | "grunt-contrib-imagemin": "^1.0.0",<% if (includeRubySass) { %>
34 | "grunt-contrib-sass": "^1.0.0",<% } else if (includeLibSass) { %>
35 | "grunt-sass": "^1.0.0",<% } if (useLess) { %>
36 | "grunt-contrib-less": "^1.0.0",<% } if (useRequirejs) { %>
37 | "grunt-bower-requirejs": "^2.0.0",
38 | "grunt-contrib-requirejs": "^1.0.0",<% } if (noPreprocessor) { %>
39 | "grunt-contrib-concat": "^1.0.0",<% } %>
40 | "grunt-autoprefixer": "^3.0.0",
41 | "grunt-contrib-watch": "^1.0.0",
42 | "grunt-filerev": "^2.1.2",<% if (useStylus) { %>
43 | "nib": "^1.1.0",
44 | "grunt-contrib-stylus": "^1.1.0",<% } %>
45 | "grunt-svgmin": "^3.1.2",
46 | "grunt-usemin": "^3.0.0",
47 | "grunt-phpunit": "^0.3.6",
48 | "jit-grunt": "^0.10.0",
49 | "grunt-exec": "^0.4.6",<% if (useUncss) { %>
50 | "grunt-uncss": "^0.5.0",<% } if (useCritical) { %>
51 | "grunt-critical": "^0.2.0",<% } if (useCritical || useUncss) { %>
52 | "grunt-contrib-connect": "^1.0.0",
53 | "get-port": "^2.1.0",
54 | "grunt-http": "^2.0.1",<% } %>
55 | "parseurl": "^1.3.0",
56 | "php-proxy-middleware": "^1.0.1"<% if (loadGruntConfig) { %>,
57 | "load-grunt-config": "^0.19.0"<% } if (useJspm) { %>,
58 | "jspm": "^0.16.19",
59 | "grunt-contrib-uglify": "^1.0.0"<% } if (useWebpack) { %>,
60 | "babel": "^6.0.15",
61 | "babel-core": "^6.6.5",
62 | "babel-loader": "^6.2.4",
63 | "babel-runtime": "^6.6.1",
64 | "babel-preset-es2015": "^6.6.0",
65 | "grunt-webpack": "^1.0.11",
66 | "webpack": "^1.12.2",
67 | "webpack-dev-server": "^1.12.1",
68 | "webpack-dev-middleware": "^1.2.0",
69 | "webpack-hot-middleware": "^2.4.1",
70 | "json-loader": "^0.5.3",
71 | "karma-webpack": "^1.7.0",
72 | "monkey-hot-loader": "0.0.3"<% } if (useBrowserify) { %>,
73 | "babel": "^6.5.2",
74 | "babel-core": "^6.6.5",
75 | "babel-preset-es2015": "^6.6.0",
76 | "babel-runtime": "^6.6.1",
77 | "babelify": "^7.2.0",
78 | "browserify": "^13.0.0",
79 | "watchify": "^3.7.0",
80 | "deamdify": "^0.2.0",
81 | "debowerify": "^1.4.1",
82 | "grunt-browserify": "^5.0.0",
83 | "karma-browserify": "^5.0.2",
84 | "karma-babel-preprocessor": "^6.0.1",
85 | "grunt-contrib-uglify": "^1.0.0"<% } %>,
86 | "core-js": "^2.4.0",
87 | "chai": "^3.3.0",
88 | "karma": "^0.13.10",
89 | "mocha": "^2.3.3",
90 | "grunt-karma": "^1.0.0",
91 | "karma-chai": "^0.1.0",
92 | "karma-coverage": "^1.0.0",
93 | "karma-mocha": "^1.0.1",
94 | "karma-mocha-reporter": "^2.0.0",
95 | "karma-phantomjs-launcher": "^1.0.0",<% if (useJspm) { %>
96 | "karma-jspm": "^2.0.1",
97 | "systemjs": "^0.19.3",
98 | "babel": "^6.0.15",
99 | "es6-module-loader": "^0.17.6",
100 | "phantomjs-polyfill": "0.0.2",<% } else if (useRequirejs) { %>
101 | "karma-requirejs": "^1.0.0",
102 | "grunt-wiredep": "^3.0.1",<% } %>
103 | "time-grunt": "^1.1.0",
104 | "phantomjs-prebuilt": ">=1.9",
105 | "slash": "^1.0.0",
106 | "fs-extra": "^0.30.0"
107 | }<% if (useJspm) { %>,
108 | "jspm": {
109 | "directories": {
110 | "lib": "app/Resources/public/scripts"
111 | },
112 | "configFile": "app/Resources/public/scripts/config.js",
113 | "dependencies": {<% if (useBootstrap) { %>
114 | "bootstrap": "github:twbs/bootstrap@^3.3.4",<% } else if (useFoundation) { %>
115 | "foundation-sites": "npm:foundation-sites@^6.2.0",<% } %>
116 | "debug": "npm:debug@^2.2.0",
117 | "appcache-nanny": "npm:appcache-nanny@^1.0.3",
118 | "jquery": "npm:jquery@^2.2.1",
119 | "picturefill": "npm:picturefill@^3.0.1"<% if (useUikit) { %>,
120 | "uikit": "github:uikit/uikit@2.26.2"<% } %>
121 | },
122 | "devDependencies": {
123 | "babel": "npm:babel-core@^5.8.34",
124 | "babel-runtime": "npm:babel-runtime@^5.8.34",
125 | "core-js": "npm:core-js@^1.1.4"
126 | }
127 | }<% } %>
128 | }
129 |
--------------------------------------------------------------------------------
/app/templates/bowerrc:
--------------------------------------------------------------------------------
1 | {
2 | "directory": "bower_components"
3 | }
4 |
--------------------------------------------------------------------------------
/app/templates/editorconfig:
--------------------------------------------------------------------------------
1 | # http://editorconfig.org
2 | root = true
3 |
4 | [*]
5 | indent_style = space
6 | indent_size = 4
7 | charset = utf-8
8 | trim_trailing_whitespace = true
9 | insert_final_newline = true
10 |
11 | [*.md]
12 | trim_trailing_whitespace = false
13 |
--------------------------------------------------------------------------------
/app/templates/eslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "xo",
3 | "env": {
4 | "node": false,
5 | "browser": true,
6 | "es6": <% if (useRequirejs) { %>false<% } else { %>true<% } %>
7 | },<% if (useRequirejs) { %>
8 | "globals": {
9 | "define": false,
10 | "require": false
11 | },<% } %>
12 | "rules": {
13 | "indent": [2, 4, {"SwitchCase": 1}],
14 | "no-invalid-this": 2
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/app/templates/gitignore:
--------------------------------------------------------------------------------
1 | /web/bundles/
2 | /app/bootstrap.php.cache
3 | /app/cache/*
4 | /app/config/parameters.yml
5 | /app/logs/*
6 | !app/cache/.gitkeep
7 | !app/logs/.gitkeep
8 | /app/phpunit.xml
9 | /build/
10 | /vendor/
11 | /bin/
12 | /composer.phar
13 |
14 | ### Files compiled or processed by grunt ###
15 | /web/scripts
16 | /web/styles
17 | /web/img
18 | /web/manifest.appcache
19 | /web/service-worker.js
20 | .tmp/
21 |
22 | ### Node ###
23 | node_modules
24 | npm-debug.log
25 |
26 | ### Bower ###
27 | bower_components
28 | <% if (useJspm) { %>
29 | ### JSPM ###
30 | jspm_packages<% } %>
31 |
--------------------------------------------------------------------------------
/app/templates/grunt/aliases.js:
--------------------------------------------------------------------------------
1 | module.exports = function (grunt, options) {
2 | var reduce = require('lodash/reduce');
3 | var size = require('lodash/size');
4 | var fs = require('fs-extra');
5 | var path = require('path');
6 | var slash = require('slash');
7 | var php = require('php-proxy-middleware');<% if (useCritical || useUncss) { %>
8 | var getPort = require('get-port');
9 | <% } %>
10 |
11 | // helper
12 | function getMiddleware(target) {
13 | if (target === 'dist') {
14 | process.env['SYMFONY_ENV'] = 'prod';
15 | process.env['SYMFONY_DEBUG'] = 0;
16 | } else {
17 | process.env['SYMFONY_ENV'] = 'node';
18 | process.env['SYMFONY_DEBUG'] = 1;
19 | }
20 | return php({
21 | address: '127.0.0.1', // which interface to bind to
22 | ini: {max_execution_time: 60, variables_order: 'EGPCS'},
23 | root: options.paths.dist,
24 | router: path.join(options.paths.dist, 'app.php')
25 | });
26 | }
27 |
28 | return {
29 | default: [
30 | 'availabletasks'
31 | ],
32 | css: function (target) {
33 | grunt.task.run([
34 | 'clean:css',<% if (useLess) { %>
35 | 'less',<% } else if (useStylus) { %>
36 | 'stylus',<% } else if (useSass) { %>
37 | 'sass',<% } else if (noPreprocessor) { %>
38 | 'concat:css',<% } %>
39 | 'autoprefixer'
40 | ]);
41 | if (target === 'dist') {
42 | <% if (useUncss || useCritical) { %>// configure routes inside gruntfile if you'd like to use <% if (useCritical) { %>critical <% } if (useCritical && useUncss) { %>and <% } if (useUncss) { %>uncss<% } %>
43 | grunt.task.run(size(options.routes) ? ['fetch',<% if (useCritical) { %> 'critical',<% } if (useUncss) { %> 'uncss',<% } %> 'cssmin'] : ['cssmin']);<% } else {
44 | %>grunt.task.run('cssmin');<% } %>
45 | } else if (target === 'assets') {
46 | grunt.task.run(['copy:assets-css']);
47 | }
48 | },
49 | js: function (<% if (useRequirejs || useJspm || useBrowserify) { %>target<% } %>) {
50 | grunt.task.run([
51 | 'clean:js'<% if (useRequirejs) { %>,
52 | 'bowerRequirejs:dist'<% } else if (useWebpack) { %>,
53 | 'webpack'<% } else if (useJspm) { %>,
54 | 'exec:jspm'<% } %>
55 | ]);<% if (useRequirejs || useJspm || useBrowserify) { %>
56 | if (target === 'dist') {
57 | grunt.task.run([<% if (useRequirejs) {
58 | %>'requirejs:dist'<% } else if (useJspm) {
59 | %>'uglify:dist'<% } else if (useBrowserify) {
60 | %>'browserify:dist','uglify:dist'<% } %>]);
61 | } else {
62 | grunt.task.run([<% if (useRequirejs) {
63 | %>'requirejs:assets'<% } else if (useJspm){
64 | %>'copy:assets-js'<% } else if (useBrowserify) {
65 | %>'browserify:dev','copy:assets-js'<% } %>]);
66 | }<% } %>
67 | },
68 | img: function (target) {
69 | grunt.task.run(['clean:img']);
70 | if (target === 'dist') {
71 | grunt.task.run([
72 | 'imagemin',
73 | 'svgmin'
74 | ]);
75 | } else {
76 | grunt.task.run(['copy:assets-img']);
77 | }
78 | },
79 | rev: [
80 | 'filerev',
81 | 'revdump',
82 | 'usemin'
83 | ],
84 | 'generate-service-worker': [
85 | 'copy:sw-scripts',
86 | 'sw-precache:dist',
87 | // fallback for browsers not supporting service workers
88 | 'appcache'
89 | ],
90 | assets: [
91 | 'js:assets',
92 | 'css:assets',
93 | 'img:assets',
94 | 'copy:sw-scripts',
95 | 'rev',
96 | 'copy:dist',
97 | 'clean:tmp',
98 | 'generate-service-worker'
99 | ],
100 | build: [
101 | 'test',
102 | 'js:dist',
103 | 'css:dist',
104 | 'img:dist',
105 | 'copy:sw-scripts',
106 | 'rev',
107 | 'copy:dist',
108 | 'clean:tmp',
109 | 'generate-service-worker'
110 | ],
111 | test: [
112 | 'eslint',<% if (useRequirejs) { %>'wiredep:test','bowerRequirejs:test',<% } %>'karma','phpunit'
113 | ],<% if (useCritical || useUncss) { %>
114 | fetch: function(){
115 | var done = this.async();
116 |
117 | getPort().then(function(port){
118 | grunt.connectMiddleware = getMiddleware();
119 | grunt.config.set('connect.fetch.options.port', port);
120 | grunt.task.run(['connect', 'http']);
121 | done();
122 | });
123 | },<% } %>
124 | revdump: function(){
125 | var file = 'app/config/filerev.json';
126 | fs.outputJsonSync(file, reduce(grunt.filerev.summary, function(acc,val,key){
127 | acc[slash(key.replace('web',''))] = slash(val.replace('web',''));
128 | return acc;
129 | },{}));
130 | },
131 | serve: function(target) {
132 | // clean tmp
133 | grunt.task.run(['clean:tmp']);
134 |
135 | if (target === 'dist') {
136 | grunt.task.run(['build']);
137 | } else {
138 | target = 'dev';
139 | grunt.task.run(['css:serve'<% if (useBrowserify) { %>, 'browserify:dev'<% } %>]);
140 | }
141 |
142 | // start php middleware
143 | grunt.bsMiddleware = getMiddleware(target);
144 |
145 | grunt.task.run([
146 | 'browserSync:'+ target, // Using the php middleware
147 | 'watch' // Any other watch tasks you want to run
148 | ]);
149 | }
150 | };
151 | };
152 |
--------------------------------------------------------------------------------
/app/templates/grunt/appcache.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | module.exports = {
3 | options: {
4 | basePath: '<%%= paths.dist %>',
5 | preferOnline: true
6 | },
7 | all: {
8 | dest: '<%%= paths.dist %>/manifest.appcache',
9 | cache: {
10 | patterns: [
11 | '<%%= paths.dist %>/styles/**/*.css',
12 | '<%%= paths.dist %>/fonts/**/*.{woff,woff2,ttf,svg,eot}',
13 | '<%%= paths.dist %>/img/**/*.{gif,png,jpg,svg}',
14 | '<%%= paths.dist %>/scripts/**/*.js'
15 | ]
16 | },
17 | network: ['*']
18 | }
19 | };
--------------------------------------------------------------------------------
/app/templates/grunt/autoprefixer.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | module.exports = {
3 | options: {
4 | browsers: ['> 5%', 'last 2 versions', 'ie 9'],
5 | map: {
6 | prev: '.tmp/styles/'
7 | }
8 | },
9 | dist: {
10 | files: [{
11 | expand: true,
12 | cwd: '.tmp/<% if (noPreprocessor) {%>concat<% } else if (useLess) {%>less<% } else if (useSass) { %>sass<% } else if (useStylus) { %>stylus<% } %>/',
13 | src: '{,*/}*.css',
14 | dest: '.tmp/styles/'
15 | }]
16 | }
17 | };
18 |
--------------------------------------------------------------------------------
/app/templates/grunt/availabletasks.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | module.exports = function (grunt) {
3 | var chalk = require('chalk');
4 | grunt.loadNpmTasks('grunt-contrib-copy');
5 | grunt.loadNpmTasks('grunt-karma');
6 | grunt.loadNpmTasks('grunt-eslint');
7 | grunt.loadNpmTasks('grunt-phpunit');
8 |
9 | return {
10 | tasks: {
11 | options: {
12 | hideUngrouped: true,
13 | sort: ['default', 'serve', 'build', 'assets', 'test', 'js', 'css', 'img', 'copy', 'rev', 'eslint', 'karma', 'phpunit'],
14 | descriptions: {
15 | default: 'Show help',
16 | serve: 'Start development server. Use ' + chalk.cyan('serve:dist') + ' for production environment',
17 | assets: 'Copy assets without optimization to public web directory',
18 | build: 'Build & install all assets to public web directory ' + chalk.green('[test, js, css, img, rev, copy]'),
19 | test: 'Run tests ' + chalk.green('[eslint, karma, phpunit]'),
20 | js: 'Build & install scripts',
21 | css: 'Build & install styles',
22 | img: 'Build & install images',
23 | rev: 'Rev assets',
24 | copy: 'Copy non preprocessed assets like fonts to public web directory',
25 | eslint: 'Check javascript files with eslint',
26 | karma: 'Start karma test runner'
27 | },
28 | groups: {
29 | 'Main:': ['default', 'serve', 'build', 'assets', 'test'],
30 | 'Assets': ['js', 'css', 'img', 'copy', 'rev'],
31 | 'Tests': ['eslint', 'karma', 'phpunit']
32 | }
33 | }
34 | }
35 | };
36 | };
37 |
--------------------------------------------------------------------------------
/app/templates/grunt/bowerRequirejs.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | module.exports = {
3 | options: {
4 | exclude: ['modernizr', 'requirejs', 'almond'<% if (useBootstrap && useSass) { %>, 'bootstrap-sass-official'<% } %>],
5 | baseUrl: 'bower_components'
6 | },
7 | dist: {
8 | rjsConfig: '<%%= paths.app %>/scripts/config.js'
9 | },
10 | test: {
11 | rjsConfig: 'tests/Frontend/test-main.js'
12 | }
13 | };
14 |
--------------------------------------------------------------------------------
/app/templates/grunt/browserSync.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | module.exports = function(grunt, options) {
3 | <% if (useWebpack) { %>var path = require('path');
4 | <% } %>var parseurl = require('parseurl');
5 |
6 | // just a helper to prevent double config
7 | function bsOptions() {
8 | <% if (useWebpack) { %>
9 | var webpack = require('webpack');
10 | var webpackDevMiddleware = require('webpack-dev-middleware');
11 | var webpackHotMiddleware = require('webpack-hot-middleware');
12 | var webpackConfig = require('../webpack.config').dev;
13 | var bundler = webpack(webpackConfig);<% } %>
14 |
15 | return {
16 | server: {
17 | baseDir: Array.prototype.slice.call(arguments),
18 | middleware: [<% if (useWebpack) { %>
19 | webpackDevMiddleware(bundler, {
20 | publicPath: webpackConfig.output.publicPath,
21 | noInfo: true,
22 | stats: {colors: true}
23 |
24 | // for other settings see
25 | // http://webpack.github.io/docs/webpack-dev-middleware.html
26 | }),
27 |
28 | // bundler should be the same as above
29 | webpackHotMiddleware(bundler),
30 | <% } %>
31 | // use php proxy
32 | function(req, res, next) {
33 | var obj = parseurl(req);
34 | if (!/\.\w{2,}$/.test(obj.pathname) || /\.php/.test(obj.pathname)) {
35 | grunt.bsMiddleware(req, res, next);
36 | } else {
37 | next();
38 | }
39 | }
40 | ]
41 | },
42 | port: parseInt(options.env.port, 10),
43 | watchTask: true,
44 | notify: true,
45 | open: true,
46 | ghostMode: {
47 | clicks: true,
48 | scroll: true,
49 | links: true,
50 | forms: true
51 | }
52 | };
53 | }
54 |
55 | return {
56 | dev: {
57 | bsFiles: {
58 | src: [
59 | <% if (!useWebpack) { %>'<%%= paths.app %>/scripts/**/*.js',
60 | <% } %>'<%%= paths.app %>/images/**/*.{jpg,jpeg,gif,png,webp}',
61 | 'app/Resources/views/**/*.html.twig',
62 | '.tmp/styles/*.css'
63 | ]
64 | },
65 | options: bsOptions('.tmp', '<%%= paths.app %>', './', 'bower_components', '<%%= paths.dist %>')
66 | },
67 | dist: {
68 | bsFiles: {src: []},
69 | options: bsOptions('<%%= paths.dist %>')
70 | }
71 | };
72 | };
73 |
--------------------------------------------------------------------------------
/app/templates/grunt/browserify.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | var babelify = require('babelify');
3 | module.exports = {
4 | options: {
5 | transform: [
6 | [babelify.configure({
7 | presets: ['es2015'],
8 | ignore: /(node_modules|bower_components)/,
9 | sourceMaps: true
10 | })],
11 | ['debowerify', {preferNPM: true}],
12 | ['deamdify']
13 | ]
14 | },
15 |
16 | dev: {
17 | options: {
18 | browserifyOptions: {
19 | debug: true
20 | },
21 | watch: true
22 | },
23 | files: {
24 | '.tmp/scripts/main.js': ['<%%= paths.app %>/scripts/main.js']
25 | }
26 | },
27 | dist: {
28 | files: {
29 | '.tmp/scripts/main.js': ['<%%= paths.app %>/scripts/main.js']
30 | }
31 | }
32 | };
33 |
--------------------------------------------------------------------------------
/app/templates/grunt/clean.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | css: ['<%%= paths.dist %>/styles'],
3 | js: ['<%%= paths.dist %>/scripts'],
4 | img: ['<%%= paths.dist %>/img'],
5 | tmp: ['.tmp']
6 | };
7 |
--------------------------------------------------------------------------------
/app/templates/grunt/concat.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | module.exports = {
3 | css: {
4 | src: [<% if (useBootstrap) { %>
5 | '<% if (frameworkFromNpm) { %>node_modules<% } else { %>bower_components<% } %>/bootstrap/dist/css/bootstrap.css',<% } else if (useUikit) { %>
6 | '<% if (frameworkFromNpm) { %>node_modules/uikit/dist/<% } else { %>bower_components/uikit/<% } %>css/uikit.almost-flat.css',<% } else { %>
7 | 'bower_components/sass-bootstrap-glyphicons/css/bootstrap-glyphicons.css',<% } if (useFoundation) { %>
8 | '<% if (frameworkFromNpm) { %>node_modules<% } else { %>bower_components<% } %>/foundation-sites/dist/foundation.css',<% } %>
9 | '<%%= paths.app %>/styles/{,*/}*.css'
10 | ],
11 | dest: '.tmp/concat/main.css'
12 | }
13 | };
14 |
--------------------------------------------------------------------------------
/app/templates/grunt/connect.js:
--------------------------------------------------------------------------------
1 | // Implementation of critical css processing
2 | // Relevant pages are fetched processed afterwards by the critical task
3 | // Generated critical path css is stored in 'app/Resources/public/styles/critical'
4 | // and inlined in the corresponding twig template.
5 | // See: app/Resources/views/Controller/default/index.html.twig
6 | 'use strict';
7 | module.exports = function(grunt, options) {
8 | var parseurl = require('parseurl');
9 | return {
10 | fetch: {
11 | options: {
12 | port: options.env.port + 1000,
13 | hostname: '127.0.0.1',
14 | base: '<%%= paths.dist %>',
15 | middleware: [
16 | function(req, res, next) {
17 | var obj = parseurl(req);
18 | if (!/\.\w{2,}$/.test(obj.pathname) || /\.php/.test(obj.pathname)) {
19 | grunt.connectMiddleware(req, res, next);
20 | } else {
21 | next();
22 | }
23 | }
24 | ]
25 | }
26 | }
27 | };
28 | };
29 |
--------------------------------------------------------------------------------
/app/templates/grunt/copy.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | module.exports = {
3 | dist: {
4 | files: [{
5 | expand: true,
6 | dot: true,
7 | cwd: '<%%= paths.app %>',
8 | dest: '<%%= paths.dist %>',
9 | src: [
10 | '*.{ico,png,txt,json,webapp,xml}',
11 | 'img/**/*.webp',
12 | 'fonts/**/*'
13 | ]
14 | }]
15 | },<% if (useJspm || useBrowserify) { %>
16 | // copy unminified js because optimization is skipped when using grunt assets
17 | 'assets-js': {
18 | files: [
19 | {expand: true, dot: true, cwd: '.tmp', dest: '<%%= paths.dist %>', src: ['scripts/*.js']}
20 | ]
21 | },<% } %>
22 | // copy autoprefixed css because optimization is skipped when using grunt assets
23 | 'assets-css': {
24 | files: [
25 | {expand: true, dot: true, cwd: '.tmp', dest: '<%%= paths.dist %>', src: ['styles/*.css']}
26 | ]
27 | },
28 | // copy unoptimized images because optimization is skipped when using grunt assets
29 | 'assets-img': {
30 | files: [
31 | {expand: true, dot: true, cwd: '<%%= paths.app %>', dest: '<%%= paths.dist %>', src: ['img/**/*', '!img/**/*.webp']}
32 | ]
33 | },
34 | 'sw-scripts': {
35 | files: [
36 | // includes files within path
37 | {expand: true, flatten: true, src: ['node_modules/sw-toolbox/sw-toolbox.js'], dest: '<%%= paths.dist %>/scripts/sw/', filter: 'isFile'},
38 | {expand: true, flatten: true, src: ['<%%= paths.app %>/scripts/sw/runtime-caching.js'], dest: '<%%= paths.dist %>/scripts/sw/', filter: 'isFile'},
39 | {expand: true, flatten: true, src: ['node_modules/appcache-nanny/appcache-loader.html'], dest: '<%%= paths.dist %>/', filter: 'isFile'}
40 | ]
41 | }
42 | };
43 |
--------------------------------------------------------------------------------
/app/templates/grunt/critical.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | /**
3 | * creates critical path css for all html pages inside the .tmp folder generated by the html task.
4 | */
5 | module.exports = {
6 | options: {
7 | base: '<%%= paths.dist %>',
8 | minify: true,
9 | css: ['.tmp/styles/main.css']
10 | },
11 | all: {
12 | files: [
13 | {expand: true, dot: true, cwd: '.tmp', dest: '<%%= paths.app %>/styles/critical/', src: ['**/*.html'], ext: '.css'}
14 | ]
15 | }
16 | };
17 |
--------------------------------------------------------------------------------
/app/templates/grunt/cssmin.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | dist: {
3 | src: '.tmp/styles/main.css',
4 | dest: 'web/styles/main.css'
5 | }
6 | };
--------------------------------------------------------------------------------
/app/templates/grunt/eslint.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | module.exports = {<% if (useWebpack) { %>
3 | all: ['<%%= paths.app %>/scripts/**/*.js']<% } else { %>
4 | all: [
5 | '<%%= paths.app %>/scripts/**/*.js',
6 | // don't lint as this is autogenerated
7 | '!<%%= paths.app %>/scripts/config.js'
8 | ]<% } %>
9 | };
10 |
--------------------------------------------------------------------------------
/app/templates/grunt/exec.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | module.exports = {
3 | sfcl: 'php <% if (parseFloat(symfonyDistribution.commit) >= 3 ) { %>bin<% } else { %>app<% } %>/console cache:clear'<% if (useJspm) { %>,
4 | jspm: 'node_modules/.bin/jspm bundle-sfx scripts/main .tmp/scripts/main.js'<% } %>
5 | };
6 |
--------------------------------------------------------------------------------
/app/templates/grunt/filerev.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | module.exports = {
3 | dist: {
4 | src: [
5 | '<%%= paths.dist %>/img/**/*.{jpg,jpeg,gif,png,webp}',
6 | '<%%= paths.dist %>/styles/main.css',
7 | '<%%= paths.dist %>/scripts/main.js'
8 | ]
9 | }
10 | };
11 |
--------------------------------------------------------------------------------
/app/templates/grunt/http.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | module.exports = {
3 | index: {
4 | options: {
5 | url: 'http://<%%= connect.fetch.options.hostname %>:<%%= connect.fetch.options.port %>/'
6 | },
7 | dest: '.tmp/index.html'
8 | }
9 | };
10 |
--------------------------------------------------------------------------------
/app/templates/grunt/imagemin.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | module.exports = {
3 | dist: {
4 | files: [{
5 | expand: true,
6 | cwd: '<%%= paths.app %>/img',
7 | src: ['**/*.{png,jpg,gif}'],
8 | dest: '<%%= paths.dist %>/img'
9 | }]
10 | }
11 | };
12 |
--------------------------------------------------------------------------------
/app/templates/grunt/karma.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | module.exports = {
3 | unit: {
4 | configFile: 'tests/Frontend/karma.conf.js',
5 | singleRun: true
6 | }
7 | };
8 |
--------------------------------------------------------------------------------
/app/templates/grunt/less.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | module.exports = {
3 | dist: {
4 | options: {
5 | paths: [
6 | '<%%= paths.app %>/styles',
7 | 'bower_components'<% if (useBrowserify || useWebpack) { %>,
8 | 'node_modules'<% } %>
9 | ]
10 | },
11 | src: '<%%= paths.app %>/styles/main.less',
12 | dest: '.tmp/less/main.css'
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/app/templates/grunt/phpunit.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | module.exports = {
3 | app: {
4 | options: {
5 | configuration: '<% if (sfVersion < 3) { %>app/<% } %>phpunit.xml.dist',
6 | bin: '<% if (sfVersion >= 3) { %>vendor/<% } %>bin/phpunit',
7 | followOutput: true,
8 | color: true
9 | }
10 | }
11 | };
--------------------------------------------------------------------------------
/app/templates/grunt/requirejs.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | module.exports = {
3 | dist: {
4 | options: {
5 | baseUrl: 'bower_components',
6 | name: 'almond/almond',
7 | include: 'main',
8 | out: '<%%= paths.dist %>/scripts/main.js',
9 | mainConfigFile: '<%%= paths.app %>/scripts/config.js',
10 | preserveLicenseComments: false,
11 | useStrict: true,
12 | wrap: true,
13 | optimize: 'uglify2',
14 | generateSourceMaps: false
15 | }
16 | },
17 | assets: {
18 | options: {
19 | baseUrl: 'bower_components',
20 | name: 'almond/almond',
21 | include: 'main',
22 | out: '<%%= paths.dist %>/scripts/main.js',
23 | mainConfigFile: '<%%= paths.app %>/scripts/config.js',
24 | preserveLicenseComments: false,
25 | useStrict: true,
26 | wrap: true,
27 | optimize: 'none',
28 | generateSourceMaps: true
29 | }
30 |
31 | }
32 | };
33 |
--------------------------------------------------------------------------------
/app/templates/grunt/sass.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | module.exports = {
3 | options: {<% if (includeLibSass) { %>
4 | includePaths: ['bower_components'<% if (useBrowserify || useWebpack) { %>, 'node_modules'<% } %>]<% } else { %>
5 | loadPath: ['bower_components'<% if (useBrowserify || useWebpack) { %>, 'node_modules'<% } %>]<% } %>
6 | },
7 | all: {
8 | files: {
9 | '.tmp/sass/main.css': '<%%= paths.app %>/styles/main.scss'
10 | }
11 | }
12 | };
13 |
--------------------------------------------------------------------------------
/app/templates/grunt/stylus.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | module.exports = {
3 | compile: {
4 | files: {
5 | '.tmp/stylus/main.css': '<%%= paths.app %>/styles/main.styl'
6 | },
7 | options: {
8 | paths: ['bower_components'<% if (frameworkFromNpm) { %>, 'node_modules'<% if (useBootstrap) { %>, 'node_modules/bootstrap-styl'<% }} else if (useBootstrap) { %>, 'bower_components/bootstrap-stylus'<% } %>],
9 | 'include css':true,
10 | use: [require('nib')],
11 | dest: '.tmp'
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/app/templates/grunt/svgmin.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | module.exports = {
3 | dist: {
4 | files: [{
5 | expand: true,
6 | cwd: '<%%= paths.app %>/img',
7 | src: '{,*/}*.svg',
8 | dest: '<%%= paths.dist %>/img'
9 | }]
10 | }
11 | };
12 |
--------------------------------------------------------------------------------
/app/templates/grunt/sw-precache.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | var pkg = require('../package.json');
3 |
4 | module.exports = {
5 | options: {
6 | cacheId: pkg.name || 'grunt-symfony',
7 | verbose: true,
8 | baseDir: '<%%= paths.dist %>',
9 | importScripts: [
10 | 'scripts/sw/sw-toolbox.js',
11 | 'scripts/sw/runtime-caching.js'
12 | ],
13 | staticFileGlobs: [
14 | 'styles/**/*.css',
15 | 'fonts/**/*.{woff,woff2,ttf,svg,eot}',
16 | 'img/**/*.{gif,png,jpg,svg}',
17 | 'scripts/**/*.js'
18 | ]
19 | },
20 | dist: {
21 | handleFetch: true
22 | }
23 | };
24 |
--------------------------------------------------------------------------------
/app/templates/grunt/uglify.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | dist: {
3 | files: {
4 | '<%%= paths.dist %>/scripts/main.js': ['.tmp/scripts/main.js']
5 | }
6 | }
7 | };
8 |
--------------------------------------------------------------------------------
/app/templates/grunt/uncss.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | /**
3 | * uncss takes all html pages inside the .tmp folder generated by the html task into account.
4 | * Any styles not beeing used there will be dropped!
5 | */
6 | module.exports = {
7 | dist: {
8 | options: {
9 | stylesheets: ['../.tmp/styles/main.css'],
10 | ignore: [
11 | /* ignore classes which are not present at dom load */<% if (useBootstrap) { %>
12 | /\.fade/,
13 | /\.collapse/,
14 | /\.collapsing/,
15 | /\.modal/,
16 | /\.alert/,
17 | /\.open/,
18 | /\.in/<% } else if (useFoundation) { %>
19 | /meta\..+/,
20 | /\.move-/,
21 | /\.fixed/,
22 | /\.modal/,
23 | /open/<% } else if (useUikit) { %>
24 | /\.uk-open/,
25 | /\.uk-notify/,
26 | /\.uk-nestable/,
27 | /\.uk-sortable/,
28 | /\.uk-active/<% } %>
29 | ]
30 | },
31 | files: {
32 | '.tmp/styles/main.css': ['.tmp/*.html']
33 | }
34 | }
35 | };
36 |
--------------------------------------------------------------------------------
/app/templates/grunt/usemin.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | module.exports = function(grunt) {
3 | return {
4 | css: ['<%%= paths.dist %>/styles/**/*.css'<% if (useCritical) { %>, '<%%= paths.app %>/styles/critical/*.css'<% } %>],
5 | js: ['<%%= paths.dist %>/scripts/**/*.js'],
6 | options: {
7 | assetsDirs: ['<%%= paths.dist %>', '<%%= paths.dist %>/img']
8 | }
9 | };
10 | };
11 |
--------------------------------------------------------------------------------
/app/templates/grunt/watch.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | module.exports = {
3 | styles: {
4 | files: ['<%%= paths.app %>/styles/{,*/}*.<% if (useLess) { %>less<% } else if (useStylus) { %>styl<% } else if (useSass) { %>{scss,sass}<% } else if (noPreprocessor) { %>css<% } %>'],
5 | tasks: ['<% if (useLess) { %>less<% } else if (useStylus) { %>stylus<% } else if (useSass) { %>sass<% } else if (noPreprocessor) { %>concat:css<% } %>','autoprefixer']
6 | },
7 | scripts: {
8 | files: ['<%%= paths.app %>/scripts/**/*.js'],
9 | tasks: ['eslint']
10 | }
11 | };
12 |
--------------------------------------------------------------------------------
/app/templates/grunt/webpack.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | module.exports = {
3 | options: require('../webpack.config').dist,
4 | dist: {
5 | keepalive: false,
6 | stats: {
7 | // Configure the console output
8 | colors: true,
9 | modules: true,
10 | reasons: true,
11 | errorDetails: true
12 | }
13 | }
14 | };
15 |
--------------------------------------------------------------------------------
/app/templates/grunt/wiredep.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | module.exports = {
3 | test: {
4 | src: 'tests/Frontend/karma.conf.js',
5 | devDependencies: false,
6 | ignorePath: '../../',
7 | fileTypes: {
8 | js: {
9 | block: /(([\s\t]*)\/\/\s*bower:*(\S*))(\n|\r|.)*?(\/\/\s*endbower)/gi,
10 | detect: {
11 | js: /'(.*\.js)'/gi
12 | },
13 | replace: {
14 | js: '{pattern: \'{{filePath}}\', included: false},'
15 | }
16 | }
17 | },
18 | exclude: []
19 | }
20 | };
21 |
--------------------------------------------------------------------------------
/app/templates/hooks/post-merge:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | # MIT © Sindre Sorhus - sindresorhus.com
3 | #
4 | # Updated to work in any project directory
5 | #
6 | # git hook to run a command after `git pull` if a specified file was changed
7 | # Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
8 | changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
9 | check_run() {
10 | echo "$changed_files" | grep --quiet "$1" && cd ./$(git rev-parse --show-cdup) && cd $(change_dir "$1") && eval "$2"
11 | }
12 | change_dir() {
13 | dirname $(find . -maxdepth 2 -mindepth 1 -name "$1" -type f | head -n 1)
14 | }
15 | # Example usage
16 | # In this example it's used to run `npm install` if package.json changed and `bower install` if `bower.json` changed.
17 | check_run package.json "npm install <% if (useJspm) { %>&& jspm install<% } %>"
18 | check_run bower.json "bower install"
19 | check_run composer.json "<% if (!globalComposer) { %>php composer.phar<% } else { %>composer<% } %> install"
20 |
--------------------------------------------------------------------------------
/app/templates/img/touch/android-chrome-144x144.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezoerb/generator-grunt-symfony/fc9865a80bdd18c77c512b7d938c9c92426358ad/app/templates/img/touch/android-chrome-144x144.png
--------------------------------------------------------------------------------
/app/templates/img/touch/android-chrome-192x192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezoerb/generator-grunt-symfony/fc9865a80bdd18c77c512b7d938c9c92426358ad/app/templates/img/touch/android-chrome-192x192.png
--------------------------------------------------------------------------------
/app/templates/img/touch/android-chrome-36x36.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezoerb/generator-grunt-symfony/fc9865a80bdd18c77c512b7d938c9c92426358ad/app/templates/img/touch/android-chrome-36x36.png
--------------------------------------------------------------------------------
/app/templates/img/touch/android-chrome-48x48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezoerb/generator-grunt-symfony/fc9865a80bdd18c77c512b7d938c9c92426358ad/app/templates/img/touch/android-chrome-48x48.png
--------------------------------------------------------------------------------
/app/templates/img/touch/android-chrome-72x72.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezoerb/generator-grunt-symfony/fc9865a80bdd18c77c512b7d938c9c92426358ad/app/templates/img/touch/android-chrome-72x72.png
--------------------------------------------------------------------------------
/app/templates/img/touch/android-chrome-96x96.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezoerb/generator-grunt-symfony/fc9865a80bdd18c77c512b7d938c9c92426358ad/app/templates/img/touch/android-chrome-96x96.png
--------------------------------------------------------------------------------
/app/templates/img/touch/apple-touch-icon-114x114.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezoerb/generator-grunt-symfony/fc9865a80bdd18c77c512b7d938c9c92426358ad/app/templates/img/touch/apple-touch-icon-114x114.png
--------------------------------------------------------------------------------
/app/templates/img/touch/apple-touch-icon-120x120.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezoerb/generator-grunt-symfony/fc9865a80bdd18c77c512b7d938c9c92426358ad/app/templates/img/touch/apple-touch-icon-120x120.png
--------------------------------------------------------------------------------
/app/templates/img/touch/apple-touch-icon-144x144.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezoerb/generator-grunt-symfony/fc9865a80bdd18c77c512b7d938c9c92426358ad/app/templates/img/touch/apple-touch-icon-144x144.png
--------------------------------------------------------------------------------
/app/templates/img/touch/apple-touch-icon-152x152.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezoerb/generator-grunt-symfony/fc9865a80bdd18c77c512b7d938c9c92426358ad/app/templates/img/touch/apple-touch-icon-152x152.png
--------------------------------------------------------------------------------
/app/templates/img/touch/apple-touch-icon-180x180.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezoerb/generator-grunt-symfony/fc9865a80bdd18c77c512b7d938c9c92426358ad/app/templates/img/touch/apple-touch-icon-180x180.png
--------------------------------------------------------------------------------
/app/templates/img/touch/apple-touch-icon-57x57.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezoerb/generator-grunt-symfony/fc9865a80bdd18c77c512b7d938c9c92426358ad/app/templates/img/touch/apple-touch-icon-57x57.png
--------------------------------------------------------------------------------
/app/templates/img/touch/apple-touch-icon-60x60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezoerb/generator-grunt-symfony/fc9865a80bdd18c77c512b7d938c9c92426358ad/app/templates/img/touch/apple-touch-icon-60x60.png
--------------------------------------------------------------------------------
/app/templates/img/touch/apple-touch-icon-72x72.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezoerb/generator-grunt-symfony/fc9865a80bdd18c77c512b7d938c9c92426358ad/app/templates/img/touch/apple-touch-icon-72x72.png
--------------------------------------------------------------------------------
/app/templates/img/touch/apple-touch-icon-76x76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezoerb/generator-grunt-symfony/fc9865a80bdd18c77c512b7d938c9c92426358ad/app/templates/img/touch/apple-touch-icon-76x76.png
--------------------------------------------------------------------------------
/app/templates/img/touch/apple-touch-icon-precomposed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezoerb/generator-grunt-symfony/fc9865a80bdd18c77c512b7d938c9c92426358ad/app/templates/img/touch/apple-touch-icon-precomposed.png
--------------------------------------------------------------------------------
/app/templates/img/touch/apple-touch-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezoerb/generator-grunt-symfony/fc9865a80bdd18c77c512b7d938c9c92426358ad/app/templates/img/touch/apple-touch-icon.png
--------------------------------------------------------------------------------
/app/templates/img/touch/favicon-16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezoerb/generator-grunt-symfony/fc9865a80bdd18c77c512b7d938c9c92426358ad/app/templates/img/touch/favicon-16x16.png
--------------------------------------------------------------------------------
/app/templates/img/touch/favicon-32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezoerb/generator-grunt-symfony/fc9865a80bdd18c77c512b7d938c9c92426358ad/app/templates/img/touch/favicon-32x32.png
--------------------------------------------------------------------------------
/app/templates/img/touch/favicon-96x96.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezoerb/generator-grunt-symfony/fc9865a80bdd18c77c512b7d938c9c92426358ad/app/templates/img/touch/favicon-96x96.png
--------------------------------------------------------------------------------
/app/templates/img/touch/mstile-144x144.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezoerb/generator-grunt-symfony/fc9865a80bdd18c77c512b7d938c9c92426358ad/app/templates/img/touch/mstile-144x144.png
--------------------------------------------------------------------------------
/app/templates/img/touch/mstile-150x150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezoerb/generator-grunt-symfony/fc9865a80bdd18c77c512b7d938c9c92426358ad/app/templates/img/touch/mstile-150x150.png
--------------------------------------------------------------------------------
/app/templates/img/touch/mstile-310x150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezoerb/generator-grunt-symfony/fc9865a80bdd18c77c512b7d938c9c92426358ad/app/templates/img/touch/mstile-310x150.png
--------------------------------------------------------------------------------
/app/templates/img/touch/mstile-310x310.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezoerb/generator-grunt-symfony/fc9865a80bdd18c77c512b7d938c9c92426358ad/app/templates/img/touch/mstile-310x310.png
--------------------------------------------------------------------------------
/app/templates/img/touch/mstile-70x70.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezoerb/generator-grunt-symfony/fc9865a80bdd18c77c512b7d938c9c92426358ad/app/templates/img/touch/mstile-70x70.png
--------------------------------------------------------------------------------
/app/templates/img/touch/safari-pinned-tab.svg:
--------------------------------------------------------------------------------
1 |
2 |
4 |
7 |
8 | Created by potrace 1.11, written by Peter Selinger 2001-2013
9 |
10 |
12 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/app/templates/img/yo-grunt-bower-symfony.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezoerb/generator-grunt-symfony/fc9865a80bdd18c77c512b7d938c9c92426358ad/app/templates/img/yo-grunt-bower-symfony.png
--------------------------------------------------------------------------------
/app/templates/jscsrc:
--------------------------------------------------------------------------------
1 | {
2 | "disallowCapitalizedComments": true,
3 | "disallowEmptyBlocks": true,
4 | "disallowIdentifierNames": [
5 | "temp"
6 | ],
7 | "disallowImplicitTypeConversion": [
8 | "numeric",
9 | "boolean",
10 | "binary",
11 | "string"
12 | ],
13 | "disallowKeywordsOnNewLine": [
14 | "else"
15 | ],
16 | "disallowKeywords": [
17 | "with"
18 | ],
19 | "disallowMixedSpacesAndTabs": "smart",
20 | "disallowMultipleLineBreaks": true,
21 | "disallowMultipleLineStrings": true,
22 | "disallowMultipleSpaces": true,
23 | "disallowMultipleVarDecl": "strict",
24 | "disallowNewlineBeforeBlockStatements": true,
25 | "disallowNodeTypes": [
26 | "LabeledStatement"
27 | ],
28 | "disallowNotOperatorsInConditionals": true,
29 | "disallowOperatorBeforeLineBreak": [
30 | "+",
31 | "."
32 | ],
33 | "disallowPaddingNewLinesAfterUseStrict": true,
34 | "disallowPaddingNewlinesInBlocks": true,
35 | "disallowParenthesesAroundArrowParam": true,
36 | "disallowQuotedKeysInObjects": true,
37 | "disallowSpaceAfterObjectKeys": true,
38 | "disallowSpaceAfterPrefixUnaryOperators": true,
39 | "disallowSpaceBeforeComma": true,
40 | "disallowSpaceBeforePostfixUnaryOperators": true,
41 | "disallowSpaceBeforeSemicolon": true,
42 | "disallowSpacesInCallExpression": true,
43 | "disallowSpacesInFunctionDeclaration": {
44 | "beforeOpeningRoundBrace": true
45 | },
46 | "disallowSpacesInsideArrayBrackets": true,
47 | "disallowSpacesInsideBrackets": true,
48 | "disallowSpacesInsideObjectBrackets": true,
49 | "disallowSpacesInsideParentheses": true,
50 | "disallowTrailingComma": true,
51 | "disallowTrailingWhitespace": true,
52 | "disallowYodaConditions": true,
53 | "requireBlocksOnNewline": {
54 | "includeComments": true
55 | },
56 | "requireCamelCaseOrUpperCaseIdentifiers": true,
57 | "requireCapitalizedConstructors": true,
58 | "requireCommaBeforeLineBreak": true,
59 | "requireCurlyBraces": true,
60 | "requireDollarBeforejQueryAssignment": true,
61 | "requireDotNotation": "except_snake_case",
62 | "requireLineBreakAfterVariableAssignment": true,
63 | "requireLineFeedAtFileEnd": true,
64 | "requireMatchingFunctionName": true,
65 | "requireObjectKeysOnNewLine": true,
66 | "requirePaddingNewLinesAfterBlocks": true,
67 | "requirePaddingNewLinesBeforeExport": true,
68 | "requirePaddingNewlinesBeforeKeywords": [
69 | "do",
70 | "for",
71 | "if",
72 | "switch",
73 | "try",
74 | "while",
75 | "with"
76 | ],
77 | "requirePaddingNewLinesBeforeLineComments": {
78 | "allExcept": "firstAfterCurly"
79 | },
80 | "requireParenthesesAroundIIFE": true,
81 | "requireSemicolons": true,
82 | "requireShorthandArrowFunctions": true,
83 | "requireSpaceAfterBinaryOperators": true,
84 | "requireSpaceAfterKeywords": [
85 | "do",
86 | "for",
87 | "if",
88 | "else",
89 | "switch",
90 | "try",
91 | "catch",
92 | "while",
93 | "with",
94 | "return",
95 | "typeof",
96 | "function"
97 | ],
98 | "requireSpaceAfterLineComment": true,
99 | "requireSpaceBeforeBinaryOperators": true,
100 | "requireSpaceBeforeBlockStatements": true,
101 | "requireSpaceBeforeKeywords": [
102 | "else",
103 | "catch",
104 | "while"
105 | ],
106 | "requireSpaceBeforeObjectValues": true,
107 | "requireSpaceBetweenArguments": true,
108 | "requireSpacesInAnonymousFunctionExpression": {
109 | "beforeOpeningRoundBrace": true,
110 | "beforeOpeningCurlyBrace": true
111 | },
112 | "requireSpacesInConditionalExpression": true,
113 | "requireSpacesInForStatement": true,
114 | "requireSpacesInFunctionDeclaration": {
115 | "beforeOpeningCurlyBrace": true
116 | },
117 | "requireSpacesInNamedFunctionExpression": {
118 | "beforeOpeningCurlyBrace": true
119 | },
120 | "safeContextKeyword": [
121 | "self"
122 | ],
123 | "validateAlignedFunctionParameters": true,
124 | "validateIndentation": 4,
125 | "validateLineBreaks": "LF",
126 | "validateParameterSeparator": ", ",
127 | "validateQuoteMarks": "'",
128 | "excludeFiles": [
129 | "node_modules/**",
130 | "bower_components/**",
131 | "coverage/**",
132 | "tmp/**",
133 | "temp/**",
134 | "**/*.min.js",
135 | "**/bundle.js"
136 | ],
137 | "fileExtensions": [
138 | ".js",
139 | ".jsx"
140 | ],
141 | "esnext": true
142 | }
143 |
--------------------------------------------------------------------------------
/app/templates/public/appcache-loader.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
13 |
14 |
--------------------------------------------------------------------------------
/app/templates/public/browserconfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | #ffc40d
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/app/templates/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezoerb/generator-grunt-symfony/fc9865a80bdd18c77c512b7d938c9c92426358ad/app/templates/public/favicon.ico
--------------------------------------------------------------------------------
/app/templates/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "<%= appname %>",
3 | "start_url": "/?homescreen=1",
4 | "display": "standalone",
5 | "background_color": "#FFC40D",
6 | "theme_color": "#1E1E1E",
7 | "icons": [
8 | {
9 | "src": "img/touch/android-chrome-36x36.png",
10 | "sizes": "36x36",
11 | "type": "image/png",
12 | "density": 0.75
13 | },
14 | {
15 | "src": "img/touch/android-chrome-48x48.png",
16 | "sizes": "48x48",
17 | "type": "image/png",
18 | "density": 1
19 | },
20 | {
21 | "src": "img/touch/android-chrome-72x72.png",
22 | "sizes": "72x72",
23 | "type": "image/png",
24 | "density": 1.5
25 | },
26 | {
27 | "src": "img/touch/android-chrome-96x96.png",
28 | "sizes": "96x96",
29 | "type": "image/png",
30 | "density": 2
31 | },
32 | {
33 | "src": "img/touch/android-chrome-144x144.png",
34 | "sizes": "144x144",
35 | "type": "image/png",
36 | "density": 3
37 | },
38 | {
39 | "src": "img/touch/android-chrome-192x192.png",
40 | "sizes": "192x192",
41 | "type": "image/png",
42 | "density": 4
43 | }
44 | ]
45 | }
46 |
--------------------------------------------------------------------------------
/app/templates/public/manifest.webapp:
--------------------------------------------------------------------------------
1 | {
2 | "version": "1.0.0",
3 | "name": "<%= appname %>",
4 | "launch_path": "/",
5 | "description": "A Grunt powered Symfony application",
6 | "icons": {
7 | "128": "/img/touch/android-chrome-36x36.png",
8 | {
9 | "src": "img/touch/android-chrome-36x36.png",
10 | "sizes": "36x36",
11 | "type": "image/png",
12 | "density": 0.75
13 | },
14 | {
15 | "src": "img/touch/android-chrome-48x48.png",
16 | "sizes": "48x48",
17 | "type": "image/png",
18 | "density": 1
19 | },
20 | {
21 | "src": "img/touch/android-chrome-72x72.png",
22 | "sizes": "72x72",
23 | "type": "image/png",
24 | "density": 1.5
25 | },
26 | {
27 | "src": "img/touch/android-chrome-96x96.png",
28 | "sizes": "96x96",
29 | "type": "image/png",
30 | "density": 2
31 | },
32 | {
33 | "src": "img/touch/android-chrome-144x144.png",
34 | "sizes": "144x144",
35 | "type": "image/png",
36 | "density": 3
37 | },
38 | {
39 | "src": "img/touch/android-chrome-192x192.png",
40 | },
41 | "developer": {
42 | "name": "",
43 | "url": ""
44 | },
45 | "installs_allowed_from": [
46 | "*"
47 | ],
48 | "default_locale": "en",
49 | "permissions": {
50 | },
51 | "locales": {
52 | "en": {
53 | "name": "<%= appname %>",
54 | "description": "A Grunt powered Symfony application"
55 | }
56 | }
57 | }
--------------------------------------------------------------------------------
/app/templates/public/service-worker.js:
--------------------------------------------------------------------------------
1 | // This file is intentionally without code.
2 | // It's present so that service worker registration will work when serving from the 'app' directory.
3 | // The version of service-worker.js that's present in the 'dist' directory is automatically
4 | // generated by the 'generate-service-worker' grunt task, and contains code to precache resources.
5 |
--------------------------------------------------------------------------------
/app/templates/scripts/browserify/main.js:
--------------------------------------------------------------------------------
1 | import debugFn from 'debug';
2 | import $ from 'jquery';<% if (useBootstrap) { %>
3 | import './shim/bootstrap';<% } else if (useUikit) { %>
4 | import UIkit from './shim/uikit';<% } else if (useFoundation) { %>
5 | import Foundation from './shim/foundation';<% } %>
6 | import picturefill from 'picturefill';
7 | import * as SW from './modules/service-worker';
8 | import {msg} from './modules/dummy';
9 |
10 | let debug = debugFn('<%= safeProjectName %>:main');
11 | picturefill();<% if (useFoundation) { %>
12 | $(document).foundation();<% } %>
13 |
14 | debug('\'Allo \'Allo');
15 | debug('Running jQuery:', $().jquery);<% if (useBootstrap) { %>
16 | debug('Running Bootstrap:', $.fn.scrollspy ? '~3.3.6' : false);<% } else if (useUikit) { %>
17 | debug('Running UIkit:', UIkit.version);<% } else if (useFoundation) { %>
18 | debug('Running Foundation:', Foundation.version);<% } %>
19 | debug(msg);
20 |
21 | SW.init();
22 |
--------------------------------------------------------------------------------
/app/templates/scripts/browserify/modules/dummy.js:
--------------------------------------------------------------------------------
1 | export const msg = 'I\'m an awesome dummy message';
2 |
--------------------------------------------------------------------------------
/app/templates/scripts/browserify/modules/service-worker.js:
--------------------------------------------------------------------------------
1 | /**
2 | *
3 | * @author Ben Zörb @bezoerb https://github.com/bezoerb
4 | * @copyright Copyright (c) 2015 Ben Zörb
5 | *
6 | * Licensed under the MIT license.
7 | * http://bezoerb.mit-license.org/
8 | * All rights reserved.
9 | */
10 | /* eslint-env worker */
11 | import debugFn from 'debug';
12 | import appCacheNanny from 'appcache-nanny';
13 |
14 | let debug = debugFn('<%= safeProjectName %>:service-worker');
15 |
16 | export function init() {
17 | // Check to make sure service workers are supported in the current browser,
18 | // and that the current page is accessed from a secure origin. Using a
19 | // service worker from an insecure origin will trigger JS console errors. See
20 | // http://www.chromium.org/Home/chromium-security/prefer-secure-origins-for-powerful-new-features
21 | let isLocalhost = Boolean(window.location.hostname === 'localhost' ||
22 | // [::1] is the IPv6 localhost address.
23 | window.location.hostname === '[::1]' ||
24 | // 127.0.0.1/8 is considered localhost for IPv4.
25 | window.location.hostname.match(
26 | /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
27 | )
28 | );
29 |
30 | debug('initializing service worker');
31 | if ('serviceWorker' in navigator && (window.location.protocol === 'https:' || isLocalhost)) {
32 | navigator.serviceWorker.register('/service-worker.js')
33 | .then(function (registration) {
34 | debug('service worker registration', registration);
35 |
36 | // Check to see if there's an updated version of service-worker.js with
37 | // new files to cache:
38 | // https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#service-worker-registration-update-method
39 | if (typeof registration.update === 'function') {
40 | debug('service worker update');
41 | registration.update();
42 | }
43 |
44 | // updatefound is fired if service-worker.js changes.
45 | registration.onupdatefound = function () {
46 | // updatefound is also fired the very first time the SW is installed,
47 | // and there's no need to prompt for a reload at that point.
48 | // So check here to see if the page is already controlled,
49 | // i.e. whether there's an existing service worker.
50 | if (navigator.serviceWorker.controller) {
51 | // The updatefound event implies that registration.installing is set:
52 | // https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#service-worker-container-updatefound-event
53 | var installingWorker = registration.installing;
54 |
55 | installingWorker.onstatechange = function () {
56 | switch (installingWorker.state) {
57 | case 'installed':
58 | // At this point, the old content will have been purged and the
59 | // fresh content will have been added to the cache.
60 | // It's the perfect time to display a "New content is
61 | // available; please refresh." message in the page's interface.
62 | break;
63 |
64 | case 'redundant':
65 | throw new Error('The installing ' +
66 | 'service worker became redundant.');
67 |
68 | default:
69 | // Ignore
70 | }
71 | };
72 | }
73 | };
74 | }).catch(function (e) {
75 | debug('Error during service worker registration:', e);
76 | });
77 | } else if ('applicationCache' in window) {
78 | debug('initializing application cache');
79 | // start to check for updates every 30s
80 | appCacheNanny.start();
81 | }
82 | }
83 |
--------------------------------------------------------------------------------
/app/templates/scripts/browserify/shim/bootstrap.js:
--------------------------------------------------------------------------------
1 | // shim to make jquery globally available
2 | // needed for libraries depending on the global jquery object
3 | /* global require */
4 | var $ = require('jquery');
5 | window.jQuery = window.$ = $;
6 | require('bootstrap');
7 |
8 |
--------------------------------------------------------------------------------
/app/templates/scripts/browserify/shim/foundation.js:
--------------------------------------------------------------------------------
1 | // shim to make jquery globally available
2 | // needed for libraries depending on the global jquery object
3 | /* global require */
4 | var $ = require('jquery');
5 | window.jQuery = window.$ = $;
6 | require('foundation-sites');
7 |
8 | export default window.Foundation;
9 |
10 |
--------------------------------------------------------------------------------
/app/templates/scripts/browserify/shim/uikit.js:
--------------------------------------------------------------------------------
1 | // shim to make jquery globally available
2 | // needed for libraries depending on the global jquery object
3 | /* global require */
4 | var $ = require('jquery');
5 | window.jQuery = window.$ = $;
6 | require('uikit');
7 |
8 | export default window.UIkit;
9 |
10 |
--------------------------------------------------------------------------------
/app/templates/scripts/jspm/config.js:
--------------------------------------------------------------------------------
1 | System.config({
2 | "baseURL": "./",
3 | "defaultJSExtensions": true,
4 | "transpiler": "babel",
5 | "babelOptions": {
6 | "optional": [
7 | "runtime",
8 | "optimisation.modules.system"
9 | ]
10 | },
11 | "paths": {
12 | "*": "app/Resources/public/*",
13 | "github:*": "../../../jspm_packages/github/*.js",
14 | "npm:*": "../../../jspm_packages/npm/*.js"
15 | }
16 | });
--------------------------------------------------------------------------------
/app/templates/scripts/jspm/main.js:
--------------------------------------------------------------------------------
1 | import debugFn from 'debug';
2 | import $ from 'jquery';<% if (useBootstrap) { %>
3 | import 'bootstrap';<% } else if (useUikit) { %>
4 | import UI from 'uikit';<% } else if (useFoundation) { %>
5 | import {Foundation} from 'foundation-sites';<% } %>
6 | import picturefill from 'picturefill';
7 | import * as SW from './modules/service-worker';
8 |
9 | let debug = debugFn('<%= safeProjectName %>:main');
10 | picturefill();<% if (useFoundation) { %>
11 | $(document).foundation();<% } %>
12 |
13 | debug('\'Allo \'Allo');
14 | debug('Running jQuery:', $().jquery);<% if (useBootstrap) { %>
15 | debug('Running Bootstrap:', $.fn.scrollspy ? '~3.3.0' : false);<% } else if (useUikit) { %>
16 | debug('Running UIkit:', UI.version);<% } else if (useFoundation) { %>
17 | debug('Running Foundation:', Foundation.version);<% } %>
18 |
19 | SW.init();
20 |
--------------------------------------------------------------------------------
/app/templates/scripts/jspm/modules/dummy.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | export const msg = 'I\'m an awesome dummy module';
3 |
--------------------------------------------------------------------------------
/app/templates/scripts/jspm/modules/service-worker.js:
--------------------------------------------------------------------------------
1 | /**
2 | *
3 | * @author Ben Zörb @bezoerb https://github.com/bezoerb
4 | * @copyright Copyright (c) 2015 Ben Zörb
5 | *
6 | * Licensed under the MIT license.
7 | * http://bezoerb.mit-license.org/
8 | * All rights reserved.
9 | */
10 | /* eslint-env worker */
11 | import debugFn from 'debug';
12 | import appCacheNanny from 'appcache-nanny';
13 |
14 | let debug = debugFn('<%= safeProjectName %>:service-worker');
15 |
16 | export function init() {
17 | // Check to make sure service workers are supported in the current browser,
18 | // and that the current page is accessed from a secure origin. Using a
19 | // service worker from an insecure origin will trigger JS console errors. See
20 | // http://www.chromium.org/Home/chromium-security/prefer-secure-origins-for-powerful-new-features
21 | let isLocalhost = Boolean(window.location.hostname === 'localhost' ||
22 | // [::1] is the IPv6 localhost address.
23 | window.location.hostname === '[::1]' ||
24 | // 127.0.0.1/8 is considered localhost for IPv4.
25 | window.location.hostname.match(
26 | /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
27 | )
28 | );
29 |
30 | debug('initializing service worker');
31 | if ('serviceWorker' in navigator && (window.location.protocol === 'https:' || isLocalhost)) {
32 | navigator.serviceWorker.register('/service-worker.js')
33 | .then(function (registration) {
34 | debug('service worker registration', registration);
35 |
36 | // Check to see if there's an updated version of service-worker.js with
37 | // new files to cache:
38 | // https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#service-worker-registration-update-method
39 | if (typeof registration.update === 'function') {
40 | debug('service worker update');
41 | registration.update();
42 | }
43 |
44 | // updatefound is fired if service-worker.js changes.
45 | registration.onupdatefound = function () {
46 | // updatefound is also fired the very first time the SW is installed,
47 | // and there's no need to prompt for a reload at that point.
48 | // So check here to see if the page is already controlled,
49 | // i.e. whether there's an existing service worker.
50 | if (navigator.serviceWorker.controller) {
51 | // The updatefound event implies that registration.installing is set:
52 | // https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#service-worker-container-updatefound-event
53 | var installingWorker = registration.installing;
54 |
55 | installingWorker.onstatechange = function () {
56 | switch (installingWorker.state) {
57 | case 'installed':
58 | // At this point, the old content will have been purged and the
59 | // fresh content will have been added to the cache.
60 | // It's the perfect time to display a "New content is
61 | // available; please refresh." message in the page's interface.
62 | break;
63 |
64 | case 'redundant':
65 | throw new Error('The installing ' +
66 | 'service worker became redundant.');
67 |
68 | default:
69 | // Ignore
70 | }
71 | };
72 | }
73 | };
74 | }).catch(function (e) {
75 | debug('Error during service worker registration:', e);
76 | });
77 | } else if ('applicationCache' in window) {
78 | debug('initializing application cache');
79 | // start to check for updates every 30s
80 | appCacheNanny.start();
81 | }
82 | }
83 |
--------------------------------------------------------------------------------
/app/templates/scripts/requirejs/app.js:
--------------------------------------------------------------------------------
1 | /**
2 | *
3 | * @author Ben Zörb @bezoerb https://github.com/bezoerb
4 | * @copyright Copyright (c) 2015 Ben Zörb
5 | *
6 | * Licensed under the MIT license.
7 | * http://bezoerb.mit-license.org/
8 | * All rights reserved.
9 | */
10 | define(function (require, exports) {
11 | 'use strict';
12 | var $ = require('jquery');
13 | var serviceWorker = require('./modules/service-worker');
14 | var debug = require('visionmedia-debug')('<%= safeProjectName %>:main');<% if (useUikit) { %>
15 | var UI = require('uikit');<% } else if (useFoundation) { %>
16 | var Foundation = require('foundation');<% } else if (useBootstrap) { %>
17 | require('bootstrap');<% } %><% if (useFoundation) { %>
18 | $(document).foundation();<% } %>
19 |
20 | exports.init = function init() {
21 | debug('\'Allo \'Allo');
22 | debug('Running jQuery:', $().jquery);<% if (useBootstrap) { %>
23 | debug('Running Bootstrap:', $.fn.scrollspy ? '~3.3.0' : false);<% } else if (useUikit) { %>
24 | debug('Running UIkit:', UI.version);<% } else if (useFoundation) { %>
25 | debug('Running Foundation:', Foundation.version);<% } %>
26 |
27 | serviceWorker.init();
28 | };
29 | });
30 |
--------------------------------------------------------------------------------
/app/templates/scripts/requirejs/config.js:
--------------------------------------------------------------------------------
1 | /* jshint -W098,-W079 */
2 | var require = {
3 | baseUrl: '/bower_components',
4 | paths: {
5 | main: '../app/Resources/public/scripts/main',
6 | app: '../app/Resources/public/scripts/app',
7 | modules: '../app/Resources/public/scripts/modules',
8 | jquery: 'jquery/dist/jquery',
9 | 'visionmedia-debug': 'visionmedia-debug/dist/debug'<% if (useFoundation) { %>,
10 | foundation: 'foundation-sites/dist/foundation'<% } else if (useBootstrap && !useSass) { %>,
11 | bootstrap: 'bootstrap/dist/js/bootstrap',
12 | 'bootstrap/affix': 'bootstrap/js/affix',
13 | 'bootstrap/alert': 'bootstrap/js/alert',
14 | 'bootstrap/button': 'bootstrap/js/button',
15 | 'bootstrap/carousel': 'bootstrap/js/carousel',
16 | 'bootstrap/collapse': 'bootstrap/js/collapse',
17 | 'bootstrap/dropdown': 'bootstrap/js/dropdown',
18 | 'bootstrap/modal': 'bootstrap/js/modal',
19 | 'bootstrap/popover': 'bootstrap/js/popover',
20 | 'bootstrap/scrollspy': 'bootstrap/js/scrollspy',
21 | 'bootstrap/tab': 'bootstrap/js/tab',
22 | 'bootstrap/tooltip': 'bootstrap/js/tooltip',
23 | 'bootstrap/transition': 'bootstrap/js/transition'<% } else if (useBootstrap) { %>,
24 | bootstrap: 'bootstrap-sass-official/assets/javascripts/bootstrap',
25 | 'bootstrap/affix': 'bootstrap-sass-official/assets/javascripts/bootstrap/affix',
26 | 'bootstrap/alert': 'bootstrap-sass-official/assets/javascripts/bootstrap/alert',
27 | 'bootstrap/button': 'bootstrap-sass-official/assets/javascripts/bootstrap/button',
28 | 'bootstrap/carousel': 'bootstrap-sass-official/assets/javascripts/bootstrap/carousel',
29 | 'bootstrap/collapse': 'bootstrap-sass-official/assets/javascripts/bootstrap/collapse',
30 | 'bootstrap/dropdown': 'bootstrap-sass-official/assets/javascripts/bootstrap/dropdown',
31 | 'bootstrap/modal': 'bootstrap-sass-official/assets/javascripts/bootstrap/modal',
32 | 'bootstrap/popover': 'bootstrap-sass-official/assets/javascripts/bootstrap/popover',
33 | 'bootstrap/scrollspy': 'bootstrap-sass-official/assets/javascripts/bootstrap/scrollspy',
34 | 'bootstrap/tab': 'bootstrap-sass-official/assets/javascripts/bootstrap/tab',
35 | 'bootstrap/tooltip': 'bootstrap-sass-official/assets/javascripts/bootstrap/tooltip',
36 | 'bootstrap/transition': 'bootstrap-sass-official/assets/javascripts/bootstrap/transition'<% } %>
37 | },
38 | shim: {<% if (useUikit) { %>
39 | uikit: ['jquery']<% } else if (useFoundation) { %>
40 | foundation: { exports: 'Foundation', deps: [ 'jquery' ] }<% } else if (useBootstrap) { %>
41 | bootstrap: { exports: '$', deps: ['jquery'] },
42 | 'bootstrap/affix': { exports: '$.fn.affix', deps: ['jquery'] },
43 | 'bootstrap/alert': { exports: '$.fn.alert', deps: ['jquery'] },
44 | 'bootstrap/button': { exports: '$.fn.button', deps: ['jquery'] },
45 | 'bootstrap/carousel': { exports: '$.fn.carousel', deps: ['jquery'] },
46 | 'bootstrap/collapse': { exports: '$.fn.collapse', deps: ['jquery'] },
47 | 'bootstrap/dropdown': { exports: '$.fn.dropdown', deps: ['jquery'] },
48 | 'bootstrap/modal': { exports: '$.fn.modal', deps: ['jquery'] },
49 | 'bootstrap/popover': { exports: '$.fn.popover', deps: ['jquery'] },
50 | 'bootstrap/scrollspy': { exports: '$.fn.scrollspy', deps: ['jquery'] },
51 | 'bootstrap/tab': { exports: '$.fn.tab', deps: ['jquery'] },
52 | 'bootstrap/tooltip': { exports: '$.fn.tooltip', deps: ['jquery'] },
53 | 'bootstrap/transition': { exports: '$.fn.transition', deps: ['jquery'] }<% } %>
54 | },
55 | packages: [
56 |
57 | ]
58 | };
59 |
--------------------------------------------------------------------------------
/app/templates/scripts/requirejs/main.js:
--------------------------------------------------------------------------------
1 | require(['app'], function (app) {
2 | 'use strict';
3 | app.init();
4 | });
5 |
--------------------------------------------------------------------------------
/app/templates/scripts/requirejs/modules/dummy.js:
--------------------------------------------------------------------------------
1 | /**
2 | *
3 | * @author Ben Zörb @bezoerb https://github.com/bezoerb
4 | * @copyright Copyright (c) 2015 Ben Zörb
5 | *
6 | * Licensed under the MIT license.
7 | * http://bezoerb.mit-license.org/
8 | * All rights reserved.
9 | */
10 | define(function (require, exports) {
11 | 'use strict';
12 | exports.msg = 'I\'m an awesome dummy module!';
13 | });
14 |
--------------------------------------------------------------------------------
/app/templates/scripts/requirejs/modules/service-worker.js:
--------------------------------------------------------------------------------
1 | /**
2 | *
3 | * @author Ben Zörb @bezoerb https://github.com/bezoerb
4 | * @copyright Copyright (c) 2015 Ben Zörb
5 | *
6 | * Licensed under the MIT license.
7 | * http://bezoerb.mit-license.org/
8 | * All rights reserved.
9 | */
10 | /* eslint-env worker */
11 | define(function (require, exports) {
12 | 'use strict';
13 | var debug = require('visionmedia-debug')('<%= safeProjectName %>:service-worker');
14 | var appCacheNanny = require('appcache-nanny');
15 |
16 | exports.init = function () {
17 | // Check to make sure service workers are supported in the current browser,
18 | // and that the current page is accessed from a secure origin. Using a
19 | // service worker from an insecure origin will trigger JS console errors. See
20 | // http://www.chromium.org/Home/chromium-security/prefer-secure-origins-for-powerful-new-features
21 | var isLocalhost = Boolean(window.location.hostname === 'localhost' ||
22 | // [::1] is the IPv6 localhost address.
23 | window.location.hostname === '[::1]' ||
24 | // 127.0.0.1/8 is considered localhost for IPv4.
25 | window.location.hostname.match(
26 | /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
27 | )
28 | );
29 |
30 | debug('initializing service worker');
31 | if ('serviceWorker' in navigator && (window.location.protocol === 'https:' || isLocalhost)) {
32 | navigator.serviceWorker.register('/service-worker.js')
33 | .then(function (registration) {
34 | debug('service worker registration', registration);
35 |
36 | // Check to see if there's an updated version of service-worker.js with
37 | // new files to cache:
38 | // https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#service-worker-registration-update-method
39 | if (typeof registration.update === 'function') {
40 | debug('service worker update');
41 | registration.update();
42 | }
43 |
44 | // updatefound is fired if service-worker.js changes.
45 | registration.onupdatefound = function () {
46 | // updatefound is also fired the very first time the SW is installed,
47 | // and there's no need to prompt for a reload at that point.
48 | // So check here to see if the page is already controlled,
49 | // i.e. whether there's an existing service worker.
50 | if (navigator.serviceWorker.controller) {
51 | // The updatefound event implies that registration.installing is set:
52 | // https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#service-worker-container-updatefound-event
53 | var installingWorker = registration.installing;
54 |
55 | installingWorker.onstatechange = function () {
56 | switch (installingWorker.state) {
57 | case 'installed':
58 | // At this point, the old content will have been purged and the
59 | // fresh content will have been added to the cache.
60 | // It's the perfect time to display a "New content is
61 | // available; please refresh." message in the page's interface.
62 | break;
63 |
64 | case 'redundant':
65 | throw new Error('The installing ' +
66 | 'service worker became redundant.');
67 |
68 | default:
69 | // Ignore
70 | }
71 | };
72 | }
73 | };
74 | }).catch(function (e) {
75 | debug('Error during service worker registration:', e);
76 | });
77 | } else if ('applicationCache' in window) {
78 | debug('initializing application cache');
79 | // start to check for updates every 30s
80 | appCacheNanny.start();
81 | }
82 | };
83 | });
84 |
--------------------------------------------------------------------------------
/app/templates/scripts/sw/runtime-caching.js:
--------------------------------------------------------------------------------
1 | /* eslint-env worker */
2 | // global.toolbox is defined in sw-toolbox.js, which is part of the https://github.com/GoogleChrome/sw-toolbox project.
3 | // That sw-toolbox.js script must be executed first, so it needs to be listed before this in the
4 | // importScripts() call that the parent service worker makes.
5 | (function (global) {
6 | 'use strict';
7 |
8 | // Activate to see debug messages of your service worker
9 | // See https://github.com/GoogleChrome/sw-toolbox/blob/master/README.md#options for more options
10 | // global.toolbox.options.debug = true;
11 |
12 | var assets = [
13 | 'woff', 'woff2', 'ttf', 'eot',
14 | 'svg', 'gif', 'png', 'jpg',
15 | 'js', 'css'
16 | ];
17 |
18 | // See https://github.com/GoogleChrome/sw-toolbox/blob/master/README.md#toolboxfastest
19 | // for more details on how this handler is defined and what the toolbox.fastest strategy does.
20 | global.toolbox.router.get('.*.(' + assets.join('|') + ')', global.toolbox.fastest);
21 |
22 | // store google fonts
23 | global.toolbox.router.get('/(.*)', global.toolbox.fastest, {
24 | origin: /\.(?:googleapis|gstatic)\.com$/
25 | });
26 |
27 | // default
28 | global.toolbox.router.default = global.toolbox.networkFirst;
29 | })(self);
30 |
--------------------------------------------------------------------------------
/app/templates/scripts/webpack/main.js:
--------------------------------------------------------------------------------
1 | import debugFn from 'debug';
2 | import $ from 'jquery';<% if (useBootstrap) { %>
3 | import './shim/bootstrap';<% } else if (useUikit) { %>
4 | import UIkit from './shim/uikit';<% } else if (useFoundation) { %>
5 | import Foundation from './shim/foundation';<% } %>
6 | import picturefill from 'picturefill';
7 | import * as SW from './modules/service-worker';
8 | import {msg} from './modules/dummy';
9 |
10 | let debug = debugFn('<%= safeProjectName %>:main');
11 | picturefill();<% if (useFoundation) { %>
12 | $(document).foundation();<% } %>
13 |
14 | debug('\'Allo \'Allo');
15 | debug('Running jQuery:', $().jquery);<% if (useBootstrap) { %>
16 | debug('Running Bootstrap:', $.fn.scrollspy ? '~3.3.0' : false);<% } else if (useUikit) { %>
17 | debug('Running UIkit:', UIkit.version);<% } else if (useFoundation) { %>
18 | debug('Running Foundation:', Foundation.version);<% } %>
19 | debug(msg);
20 |
21 | SW.init();
22 |
--------------------------------------------------------------------------------
/app/templates/scripts/webpack/modules/dummy.js:
--------------------------------------------------------------------------------
1 | export const msg = 'I\'m an awesome dummy message';
2 |
--------------------------------------------------------------------------------
/app/templates/scripts/webpack/modules/service-worker.js:
--------------------------------------------------------------------------------
1 | /**
2 | *
3 | * @author Ben Zörb @bezoerb https://github.com/bezoerb
4 | * @copyright Copyright (c) 2015 Ben Zörb
5 | *
6 | * Licensed under the MIT license.
7 | * http://bezoerb.mit-license.org/
8 | * All rights reserved.
9 | */
10 | /* eslint-env worker */
11 | import debugFn from 'debug';
12 | import appCacheNanny from 'appcache-nanny';
13 |
14 | let debug = debugFn('<%= safeProjectName %>:service-worker');
15 |
16 | export function init() {
17 | // Check to make sure service workers are supported in the current browser,
18 | // and that the current page is accessed from a secure origin. Using a
19 | // service worker from an insecure origin will trigger JS console errors. See
20 | // http://www.chromium.org/Home/chromium-security/prefer-secure-origins-for-powerful-new-features
21 | let isLocalhost = Boolean(window.location.hostname === 'localhost' ||
22 | // [::1] is the IPv6 localhost address.
23 | window.location.hostname === '[::1]' ||
24 | // 127.0.0.1/8 is considered localhost for IPv4.
25 | window.location.hostname.match(
26 | /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
27 | )
28 | );
29 |
30 | debug('initializing service worker');
31 | if ('serviceWorker' in navigator && (window.location.protocol === 'https:' || isLocalhost)) {
32 | navigator.serviceWorker.register('/service-worker.js')
33 | .then(function (registration) {
34 | debug('service worker registration', registration);
35 |
36 | // Check to see if there's an updated version of service-worker.js with
37 | // new files to cache:
38 | // https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#service-worker-registration-update-method
39 | if (typeof registration.update === 'function') {
40 | debug('service worker update');
41 | registration.update();
42 | }
43 |
44 | // updatefound is fired if service-worker.js changes.
45 | registration.onupdatefound = function () {
46 | // updatefound is also fired the very first time the SW is installed,
47 | // and there's no need to prompt for a reload at that point.
48 | // So check here to see if the page is already controlled,
49 | // i.e. whether there's an existing service worker.
50 | if (navigator.serviceWorker.controller) {
51 | // The updatefound event implies that registration.installing is set:
52 | // https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#service-worker-container-updatefound-event
53 | var installingWorker = registration.installing;
54 |
55 | installingWorker.onstatechange = function () {
56 | switch (installingWorker.state) {
57 | case 'installed':
58 | // At this point, the old content will have been purged and the
59 | // fresh content will have been added to the cache.
60 | // It's the perfect time to display a "New content is
61 | // available; please refresh." message in the page's interface.
62 | break;
63 |
64 | case 'redundant':
65 | throw new Error('The installing ' +
66 | 'service worker became redundant.');
67 |
68 | default:
69 | // Ignore
70 | }
71 | };
72 | }
73 | };
74 | }).catch(function (e) {
75 | debug('Error during service worker registration:', e);
76 | });
77 | } else if ('applicationCache' in window) {
78 | debug('initializing application cache');
79 | // start to check for updates every 30s
80 | appCacheNanny.start();
81 | }
82 | }
83 |
--------------------------------------------------------------------------------
/app/templates/scripts/webpack/shim/bootstrap.js:
--------------------------------------------------------------------------------
1 | // shim to make jquery globally available
2 | // needed for libraries depending on the global jquery object
3 | /* global require */
4 | var $ = require('jquery');
5 | window.jQuery = window.$ = $;
6 | require('bootstrap');
7 |
8 |
--------------------------------------------------------------------------------
/app/templates/scripts/webpack/shim/foundation.js:
--------------------------------------------------------------------------------
1 | // shim to make jquery globally available
2 | // needed for libraries depending on the global jquery object
3 | /* global require */
4 | var $ = require('jquery');
5 | window.jQuery = window.$ = $;
6 | require('foundation-sites');
7 |
8 | export default window.Foundation;
9 |
10 |
--------------------------------------------------------------------------------
/app/templates/scripts/webpack/shim/uikit.js:
--------------------------------------------------------------------------------
1 | // shim to make jquery globally available
2 | // needed for libraries depending on the global jquery object
3 | /* global require */
4 | var $ = require('jquery');
5 | window.jQuery = window.$ = $;
6 | require('uikit');
7 |
8 | export default window.UIkit;
9 |
10 |
--------------------------------------------------------------------------------
/app/templates/styles/inuit/base/_index.scss:
--------------------------------------------------------------------------------
1 | /*------------------------------------*\
2 | Base
3 | \*------------------------------------*/
4 |
5 | @import "inuit-page/base.page";
6 | @import "inuit-images/base.images";
7 | @import "inuit-headings/base.headings";
8 | @import "inuit-paragraphs/base.paragraphs";
9 | @import "inuit-tables/objects.tables";
10 | @import "inuit-lists/base.lists";
11 |
--------------------------------------------------------------------------------
/app/templates/styles/inuit/components/_index.scss:
--------------------------------------------------------------------------------
1 | /*------------------------------------*\
2 | Components
3 | \*------------------------------------*/
4 | @import "header";
5 | @import "nav";
6 | @import "content";
7 | @import "panel";
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/app/templates/styles/inuit/components/content.scss:
--------------------------------------------------------------------------------
1 | .content {
2 | max-width: $page-width;
3 | margin: 0 auto;
4 | }
5 |
--------------------------------------------------------------------------------
/app/templates/styles/inuit/components/header.scss:
--------------------------------------------------------------------------------
1 | .header {
2 | background: rgba(#000,0.1);
3 | color: #fff;
4 | background: #444;
5 | }
6 |
7 |
8 | .header__content {
9 | max-width: $page-width;
10 | margin: 0 auto;
11 | display: flex;
12 | align-items: center;
13 | justify-content: space-between;
14 | padding: 0.5em 0;
15 | }
16 |
17 | .header__title {
18 | @include inuit-font-size(30px,1);
19 | }
20 |
21 | .header__description {
22 | @include inuit-font-size(14px,1);
23 | }
24 |
--------------------------------------------------------------------------------
/app/templates/styles/inuit/components/nav.scss:
--------------------------------------------------------------------------------
1 | .nav {
2 | list-style:none;
3 | margin-left:0;
4 | @extend .clearfix;
5 |
6 | > li {
7 | display:inline-block;
8 | *display:inline;
9 | zoom:1;
10 | }
11 | }
12 |
13 | .nav__item {
14 | color: #fff;
15 | text-decoration: none;
16 | transition: color 100ms;
17 | padding-left: 0.5em;
18 | padding-right: 0.5em;
19 |
20 | &:hover {
21 | color: #bbb;
22 | }
23 |
24 | &--first {
25 | padding-left: 0;
26 | }
27 |
28 | &--last {
29 | padding-right: 0;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/app/templates/styles/inuit/components/panel.scss:
--------------------------------------------------------------------------------
1 | .panel {
2 | background: #eee;
3 | padding: 2em;
4 | border-radius: 3px;
5 | }
--------------------------------------------------------------------------------
/app/templates/styles/inuit/elements/_index.scss:
--------------------------------------------------------------------------------
1 | /*------------------------------------*\
2 | Components
3 | \*------------------------------------*/
4 |
--------------------------------------------------------------------------------
/app/templates/styles/inuit/generic/_index.scss:
--------------------------------------------------------------------------------
1 | /*------------------------------------*\
2 | Generic
3 | \*------------------------------------*/
4 |
5 | @import "inuit-normalize/generic.normalize";
6 | @import "inuit-box-sizing/generic.box-sizing";
7 | @import "inuit-reset/generic.reset";
8 | // @import "inuit-shared/generic.shared";
9 |
--------------------------------------------------------------------------------
/app/templates/styles/inuit/main.scss:
--------------------------------------------------------------------------------
1 | @charset "utf-8";
2 | /*
3 | * This project follows Inverted Triangle CSS (ITCSS) by Harry "CSS Wizardry" Roberts.
4 | * Files should be organized in groups from:
5 | * - Generic to explicit
6 | * - Far-reaching to localised
7 | * - Low specificity to high specificity
8 | *
9 | */
10 |
11 |
12 | /*
13 | * Variables, config switches, etc.
14 | * Split up into logical sections, the smaller and simpler the better.
15 | */
16 | @import "settings/index";
17 |
18 | /*
19 | * Tools / mixins
20 | */
21 | @import "tools/index";
22 |
23 | /*
24 | * Generic rules are project-agnostic.
25 | * These can be copied from any project to the next
26 | */
27 | @import "generic/index";
28 |
29 | /*
30 | * Base are rules for classless HTML tags.
31 | */
32 | @import "base/index";
33 |
34 | /*
35 | * Objects are "formless", in other words invisible to the user, no cosmetics
36 | * Eg. wrappers, grid systems, etc.
37 | * This is the first layer of classes and should be agnostically named
38 | */
39 | @import "objects/index";
40 |
41 | /*
42 | * Components like buttons, teaser, etc.
43 | */
44 | @import "components/index";
45 |
46 | /*
47 | * Vendor styles and e.g. theme overwrites
48 | */
49 | @import "vendor/index";
50 |
51 | /*
52 | * Trumps are overrides, helpers, utilities. They should only affect
53 | * one piece of DOM at a time and usually carry !important
54 | */
55 | @import "trumps/index";
56 |
--------------------------------------------------------------------------------
/app/templates/styles/inuit/objects/_index.scss:
--------------------------------------------------------------------------------
1 | /*------------------------------------*\
2 | Objects
3 | \*------------------------------------*/
4 |
5 | @import "inuit-layout/objects.layout";
6 | @import "inuit-media/objects.media";
7 | @import "inuit-box/objects.box";
8 | @import "inuit-buttons/objects.buttons";
9 | @import "inuit-list-inline/objects.list-inline";
10 | @import "inuit-list-ui/objects.list-ui";
11 | @import "inuit-flag/objects.flag";
12 | @import "inuit-tabs/objects.tabs";
13 |
--------------------------------------------------------------------------------
/app/templates/styles/inuit/settings/_index.scss:
--------------------------------------------------------------------------------
1 | /*------------------------------------*\
2 | Settings
3 | \*------------------------------------*/
4 | @import "inuit-defaults/settings.defaults";
5 | @import "inuit-responsive-settings/settings.responsive";
6 |
7 | $inuit-enable-margins: true;
8 | $inuit-enable-margins--large: true;
9 | $inuit-enable-margins--huge: true;
10 | $inuit-enable-box--flush: true;
11 |
12 |
13 | $page-width: 1024px;
14 |
--------------------------------------------------------------------------------
/app/templates/styles/inuit/tools/_index.scss:
--------------------------------------------------------------------------------
1 | /*------------------------------------*\
2 | Tools
3 | \*------------------------------------*/
4 |
5 | @import "inuit-functions/tools.functions";
6 | @import "inuit-tools-widths/tools.widths";
7 | @import "inuit-mixins/tools.mixins";
8 | @import "inuit-responsive-tools/tools.responsive";
9 |
--------------------------------------------------------------------------------
/app/templates/styles/inuit/trumps/_index.scss:
--------------------------------------------------------------------------------
1 | /*------------------------------------*\
2 | Trumps
3 | \*------------------------------------*/
4 |
5 | @import "inuit-clearfix/trumps.clearfix";
6 | @import "inuit-spacing/trumps.spacing";
7 | @import "inuit-widths/trumps.widths";
8 | @import "inuit-widths-responsive/trumps.widths-responsive";
9 | @import "align";
10 | @import "display";
11 | @import "layout";
12 | @import "text";
13 |
--------------------------------------------------------------------------------
/app/templates/styles/inuit/trumps/align.scss:
--------------------------------------------------------------------------------
1 | /**
2 | * suitcss-utils-align
3 | *
4 | * Vertical alignment utilities
5 | * Depends on an appropriate `display` value.
6 | */
7 |
8 | .u-alignBaseline {
9 | vertical-align: baseline !important;
10 | }
11 |
12 | .u-alignBottom {
13 | vertical-align: bottom !important;
14 | }
15 |
16 | .u-alignMiddle {
17 | vertical-align: middle !important;
18 | }
19 |
20 | .u-alignTop {
21 | vertical-align: top !important;
22 | }
23 |
--------------------------------------------------------------------------------
/app/templates/styles/inuit/trumps/display.scss:
--------------------------------------------------------------------------------
1 | /**
2 | * suitcss-utils-display
3 | *
4 | * Display-type utilities
5 | */
6 |
7 | .u-block {
8 | display: block !important;
9 | }
10 |
11 | .u-hidden {
12 | display: none !important;
13 | }
14 |
15 | /**
16 | * Completely remove from the flow but leave available to screen readers.
17 | */
18 |
19 | .u-hiddenVisually {
20 | position: absolute !important;
21 | overflow: hidden !important;
22 | width: 1px !important;
23 | height: 1px !important;
24 | padding: 0 !important;
25 | border: 0 !important;
26 | clip: rect(1px, 1px, 1px, 1px) !important;
27 | }
28 |
29 | .u-inline {
30 | display: inline !important;
31 | }
32 |
33 | /**
34 | * 1. Fix for Firefox bug: an image styled `max-width:100%` within an
35 | * inline-block will display at its default size, and not limit its width to
36 | * 100% of an ancestral container.
37 | */
38 |
39 | .u-inlineBlock {
40 | display: inline-block !important;
41 | max-width: 100%; /* 1 */
42 | }
43 |
44 | .u-table {
45 | display: table !important;
46 | }
47 |
48 | .u-tableCell {
49 | display: table-cell !important;
50 | }
51 |
52 | .u-tableRow {
53 | display: table-row !important;
54 | }
55 |
--------------------------------------------------------------------------------
/app/templates/styles/inuit/trumps/layout.scss:
--------------------------------------------------------------------------------
1 | /**
2 | * suitcss-utils-layout
3 | *
4 | * Contain floats
5 | *
6 | * Make an element expand to contain floated children.
7 | * Uses pseudo-elements (micro clearfix).
8 | *
9 | * 1. The space content is one way to avoid an Opera bug when the
10 | * `contenteditable` attribute is included anywhere else in the document.
11 | * Otherwise it causes space to appear at the top and bottom of the
12 | * element.
13 | * 2. The use of `table` rather than `block` is only necessary if using
14 | * `:before` to contain the top-margins of child elements.
15 | */
16 |
17 | .u-cf:before,
18 | .u-cf:after {
19 | content: " "; /* 1 */
20 | display: table; /* 2 */
21 | }
22 |
23 | .u-cf:after {
24 | clear: both;
25 | }
26 |
27 | /**
28 | * New block formatting context
29 | *
30 | * This affords some useful properties to the element. It won't wrap under
31 | * floats. Will also contain any floated children.
32 |
33 | * N.B. This will clip overflow. Use the alternative method below if this is
34 | * problematic.
35 | */
36 |
37 | .u-nbfc {
38 | overflow: hidden !important;
39 | }
40 |
41 | /**
42 | * New block formatting context (alternative)
43 | *
44 | * Alternative method when overflow must not be clipped.
45 | *
46 | * 1. Create a new block formatting context (NBFC).
47 | * 2. Avoid shrink-wrap behaviour of table-cell.
48 | *
49 | * N.B. This breaks down in some browsers when elements within this element
50 | * exceed its width.
51 | */
52 |
53 | .u-nbfcAlt {
54 | display: table-cell !important; /* 1 */
55 | width: 10000px !important; /* 2 */
56 | }
57 |
58 | /**
59 | * Floats
60 | */
61 |
62 | .u-floatLeft {
63 | float: left !important;
64 | }
65 |
66 | .u-floatRight {
67 | float: right !important;
68 | }
69 |
--------------------------------------------------------------------------------
/app/templates/styles/inuit/trumps/text.scss:
--------------------------------------------------------------------------------
1 | /**
2 | * suitcss-utils-text
3 | *
4 | * Word breaking
5 | *
6 | * Break strings when their length exceeds the width of their container.
7 | */
8 |
9 | .u-textBreak {
10 | word-wrap: break-word !important;
11 | }
12 |
13 | /**
14 | * Horizontal text alignment
15 | */
16 |
17 | .u-textCenter {
18 | text-align: center !important;
19 | }
20 |
21 | .u-textLeft {
22 | text-align: left !important;
23 | }
24 |
25 | .u-textRight {
26 | text-align: right !important;
27 | }
28 |
29 | /**
30 | * Inherit the ancestor's text color.
31 | */
32 |
33 | .u-textInheritColor {
34 | color: inherit !important;
35 | }
36 |
37 | /**
38 | * Enables font kerning in all browsers.
39 | * http://blog.typekit.com/2014/02/05/kerning-on-the-web/
40 | *
41 | * 1. Chrome (not Windows), Firefox, Safari 6+, iOS, Android
42 | * 2. Chrome (not Windows), Firefox, IE 10+
43 | * 3. Safari 7 and future browsers
44 | */
45 |
46 | .u-textKern {
47 | text-rendering: optimizeLegibility; /* 1 */
48 | font-feature-settings: "kern" 1; /* 2 */
49 | font-kerning: normal; /* 3 */
50 | }
51 |
52 | /**
53 | * Prevent whitespace wrapping
54 | */
55 |
56 | .u-textNoWrap {
57 | white-space: nowrap !important;
58 | }
59 |
60 | /**
61 | * Text truncation
62 | *
63 | * Prevent text from wrapping onto multiple lines, and truncate with an
64 | * ellipsis.
65 | *
66 | * 1. Ensure that the node has a maximum width after which truncation can
67 | * occur.
68 | * 2. Fix for IE 8/9 if `word-wrap: break-word` is in effect on ancestor
69 | * nodes.
70 | */
71 |
72 | .u-textTruncate {
73 | max-width: 100%; /* 1 */
74 | overflow: hidden !important;
75 | text-overflow: ellipsis !important;
76 | white-space: nowrap !important;
77 | word-wrap: normal !important; /* 2 */
78 | }
79 |
--------------------------------------------------------------------------------
/app/templates/styles/inuit/vendor/_index.scss:
--------------------------------------------------------------------------------
1 | /*------------------------------------*\
2 | Vendor
3 | \*------------------------------------*/
4 |
--------------------------------------------------------------------------------
/app/templates/styles/main.css:
--------------------------------------------------------------------------------
1 | <% if (useFoundation) { %>
2 | .panel {
3 | background: #eee;
4 | padding: 2em;
5 | margin-bottom: 2em;
6 | }
7 |
8 | .header {
9 | margin-bottom: 2em;
10 | }<% } else if (usePure) { %>
11 | .pure-g {
12 | padding: 15px 20px;
13 | }
14 |
15 | .button-success {
16 | background: rgb(28, 184, 65);
17 | }
18 |
19 | .hero {
20 | background: #eee;
21 | }
22 |
23 | .container {
24 | max-width: 1024px;
25 | margin: 0 auto;
26 | }<% } %>
27 |
28 | <% if (!useUikit && !useFoundation) { %>
29 | .header {
30 | height: 50px;
31 | }<% } %>
32 |
33 | .yeoman-team {
34 | max-width: 90%;
35 | display:block;
36 | margin: 20px 0 50px;
37 | }
38 |
--------------------------------------------------------------------------------
/app/templates/styles/main.less:
--------------------------------------------------------------------------------
1 | <% if (useBootstrap) { %>@import "bootstrap/less/bootstrap"; <% } else if (useFoundation) { %>@import (inline) "foundation-sites/dist/foundation.css";<% } else if (usePure) { %>@import (inline) "pure/pure.css";
2 | @import (inline) "suit-utils-layout/lib/layout.css";<% } else if (useUikit) { %>
3 | @import "uikit/<% if (frameworkFromNpm) { %>dist/<% } %>less/uikit-variables";
4 | @navbar-background: #444;
5 | @navbar-color: #eee;
6 | @navbar-link-color: #eee;
7 | @navbar-link-hover-color: #fff;
8 | @navbar-nav-color: #eee;
9 | @navbar-brand-color: #eee;
10 | @navbar-brand-hover-color: #eee;
11 | @icon-font-path: "../fonts";
12 | @import "uikit/<% if (frameworkFromNpm) { %>dist/<% } %>less/uikit";
13 |
14 | a {
15 | transition: all 100ms ease-in-out;
16 | } <% } %>
17 | <% if (!useBootstrap && !useUikit) { %>@import "sass-bootstrap-glyphicons/less/bootstrap-glyphicons";<% } %>
18 |
19 | <% if (usePure) { %>
20 | .pure-g {
21 | padding: 15px 20px;
22 | }
23 |
24 | .button-success {
25 | background: rgb(28, 184, 65);
26 | }
27 |
28 | .hero {
29 | background: #eee;
30 | }
31 |
32 | .container {
33 | max-width: 1024px;
34 | margin: 0 auto;
35 | }<% } %>
36 | <% if (!useUikit && !useFoundation) { %>
37 | .header {
38 | height: 50px;
39 | }<% } %>
40 |
41 | .yeoman-team {
42 | max-width: 90%;
43 | display:block;
44 | margin: 20px 0 50px;
45 |
46 | }
47 |
--------------------------------------------------------------------------------
/app/templates/styles/main.scss:
--------------------------------------------------------------------------------
1 | <% if (useBootstrap) { %> @import "bootstrap-sass<% if (!frameworkFromNpm) { %>-official<% } %>/assets/stylesheets/_bootstrap";<% } else if (useFoundation) { %>@import "foundation-sites/scss/foundation";<% } else if (usePure) { %>@import "/pure/pure.css";
2 | @import "/suit-utils-layout/lib/layout.css";<% } else if (useUikit) { %>
3 | $navbar-background: #444;
4 | $navbar-color: #eee;
5 | $navbar-link-color: #eee;
6 | $navbar-link-hover-color: #fff;
7 | $navbar-nav-color: #eee;
8 | $navbar-brand-color: #eee;
9 | $navbar-brand-hover-color: #eee;
10 | $icon-font-path: "../fonts";
11 |
12 | @import "uikit/<% if (frameworkFromNpm) { %>dist/<% } %>scss/uikit-variables";
13 | @import "uikit/<% if (frameworkFromNpm) { %>dist/<% } %>scss/uikit-mixins";
14 | @import "uikit/<% if (frameworkFromNpm) { %>dist/<% } %>scss/uikit";
15 |
16 | a {
17 | transition: all 100ms ease-in-out;
18 | } <% } %>
19 | <% if (!useBootstrap && !useUikit) { %>@import "sass-bootstrap-glyphicons/scss/bootstrap-glyphicons";<% } %>
20 | <% if (useFoundation) { %>
21 | @include foundation-everything();
22 |
23 | .panel {
24 | background: #eee;
25 | padding: 2em;
26 | margin-bottom: 2em;
27 | }
28 |
29 | .header {
30 | margin-bottom: 2em;
31 | }<% } else if (usePure) { %>
32 | .pure-g {
33 | padding: 15px 20px;
34 | }
35 |
36 | .button-success {
37 | background: rgb(28, 184, 65);
38 | }
39 |
40 | .hero {
41 | background: #eee;
42 | }
43 |
44 | .container {
45 | max-width: 1024px;
46 | margin: 0 auto;
47 | }<% } %>
48 | <% if (!useUikit && !useFoundation) { %>
49 | .header {
50 | height: 50px;
51 | }<% } %>
52 |
53 |
54 | .yeoman-team {
55 | max-width: 90%;
56 | display:block;
57 | margin: 20px 0 50px;
58 |
59 | }
60 |
--------------------------------------------------------------------------------
/app/templates/styles/main.styl:
--------------------------------------------------------------------------------
1 | <% if (useBootstrap) { %> @import "/bootstrap-styl<% if (!frameworkFromNpm) { %>us<% } %>/bootstrap" <% } else if (useFoundation) { %>@import "/foundation-sites/dist/foundation.css";<% } else if (usePure) { %>@import "/pure/pure.css";
2 | @import "/suit-utils-layout/lib/layout.css";<% } else if (useUikit) { %>
3 | @import "/uikit/<% if (frameworkFromNpm) { %>dist/<% } %>css/uikit.almost-flat.css";
4 |
5 | a {
6 | transition: all 100ms ease-in-out;
7 | } <% } %>
8 | <% if (!useBootstrap && !useUikit) { %> @import "/sass-bootstrap-glyphicons/css/bootstrap-glyphicons.css"; <% } %>
9 | <% if (useFoundation) { %>
10 | .panel {
11 | background: #eee;
12 | padding: 2em;
13 | margin-bottom: 2em;
14 | }
15 |
16 | .header {
17 | margin-bottom: 2em;
18 | }<% } else if (usePure) { %>
19 | .pure-g
20 | padding: 15px 20px;
21 |
22 | .button-success
23 | background: rgb(28, 184, 65);
24 |
25 | .hero
26 | background: #eee;
27 |
28 | .container
29 | max-width: 1024px;
30 | margin: 0 auto;
31 | <% } %>
32 | <% if (!useUikit && !useFoundation) { %>
33 | .header
34 | height: 50px; <% } %>
35 |
36 |
37 | .yeoman-team
38 | max-width: 90%;
39 | display:block;
40 | margin: 20px 0 50px;
41 |
--------------------------------------------------------------------------------
/app/templates/symfony/DefaultController.php:
--------------------------------------------------------------------------------
1 | render('controller/default/index.html.twig');
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/app/templates/symfony/DefaultControllerTest.php:
--------------------------------------------------------------------------------
1 | Tests\AppBundle\Controller<% } else { %>AppBundle\Tests\Controller<% } %>;
4 |
5 | use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
6 |
7 | class DefaultControllerTest extends WebTestCase
8 | {
9 | public function testIndex()
10 | {
11 | $client = static::createClient();
12 |
13 | $crawler = $client->request('GET', '/');
14 |
15 | $this->assertEquals(200, $client->getResponse()->getStatusCode());
16 | $this->assertTrue($crawler->filter('html:contains("Welcome")')->count() > 0);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/app/templates/symfony/app.php:
--------------------------------------------------------------------------------
1 |
9 | $loader = require_once __DIR__.'/../app/bootstrap.php.cache';
10 | <% } else { %>
11 | /**
12 | * @var Composer\Autoload\ClassLoader
13 | */
14 | $loader = require __DIR__.'/../app/autoload.php';
15 | include_once __DIR__.'/../var/bootstrap.php.cache';
16 | <% } %>
17 |
18 | // Enable APC for autoloading to improve performance.
19 | // You should change the ApcClassLoader first argument to a unique prefix
20 | // in order to prevent cache key conflicts with other applications
21 | // also using APC.
22 | /*
23 | $apcLoader = new ApcClassLoader(sha1(__FILE__), $loader);
24 | $loader->unregister();
25 | $apcLoader->register(true);
26 | */
27 |
28 | $env = 'prod';
29 | $debug = false;
30 |
31 | // Override env by server env
32 | // Depending on the SYMFONY_ENV environment variable, tells which environment should be taken
33 | if (($servEnv = getenv("SYMFONY_ENV")) !== false) {
34 | $env = $servEnv;
35 | }
36 |
37 | // Overwrite $debug depending on the SYMFONY_DEBUG environment variable
38 | if (($servDbg = getenv("SYMFONY_DEBUG")) !== false) {
39 | $debug = !!$servDbg;
40 | }
41 |
42 |
43 | if ($debug) {
44 | Debug::enable();
45 | }
46 |
47 | require_once __DIR__.'/../app/AppKernel.php';
48 | //require_once __DIR__.'/../app/AppCache.php';
49 |
50 |
51 | $kernel = new AppKernel($env, $debug);
52 | $kernel->loadClassCache();
53 | //$kernel = new AppCache($kernel);
54 |
55 | // When using the HttpCache, you need to call the method in your front controller instead of relying on the configuration parameter
56 | //Request::enableHttpMethodParameterOverride();
57 | $request = Request::createFromGlobals();
58 | $response = $kernel->handle($request);
59 | $response->send();
60 | $kernel->terminate($request, $response);
61 |
--------------------------------------------------------------------------------
/app/templates/symfony/base.html.twig:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | {% block title %}Welcome!{% endblock %}
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 | {% block stylesheets %}<% if (useCritical) { %>
37 | {% if app.environment == 'node' %}
38 |
39 | {% else %}
40 | {% block stylesheetsDist %}
41 |
42 | {% endblock stylesheetsDist %}
43 | {% endif %}<% } else { %>
44 |
45 | <% } %>{% endblock %}
46 |
47 |
48 | {% block body %}{% endblock %}
49 | {% block javascripts %}<% if (!useWebpack && !useBrowserify) { %>
50 | {% if app.environment == 'node' %}<% if (useRequirejs) { %>
51 |
52 |
53 | <% } else if (useJspm) { %>
54 |
55 | <% } %>
58 | {% else %}
59 |
60 | {% endif %}<% } else { %>
61 | <% } %>
62 | {% endblock %}
63 |
64 |
65 |
--------------------------------------------------------------------------------
/app/templates/symfony/config_node.yml:
--------------------------------------------------------------------------------
1 | imports:
2 | - { resource: config_dev.yml }
3 |
4 | zoerb_filerev:
5 | enabled: false
6 |
--------------------------------------------------------------------------------
/app/templates/symfony/index.html.twig:
--------------------------------------------------------------------------------
1 | {% extends 'base.html.twig' %}
2 | <% if (useCritical) { %>
3 | {% block stylesheetsDist %}
4 |
7 |
10 |
11 |
12 |
13 | {% endblock stylesheetsDist %}
14 | <% } %>
15 | {% block body %}
16 | <% if (useBootstrap) { %>
17 |
18 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
'Allo, 'Allo!
34 |
Always a pleasure scaffolding your apps.
35 |
Splendid!
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
Symfony
44 |
High Performance PHP Framework for Web Development
45 |
Browsersync
46 |
Keep multiple browsers & devices in sync when building websites.
47 |
48 | <% if (useLess) { %>
Less
49 |
Less is a mature, stable, and powerful professional grade CSS extension language.
50 | <% } else if (useSass) { %>
Sass
51 |
Sass is a mature, stable, and powerful professional grade CSS extension language.
52 | <% } else if (useStylus) { %>
Stylus
53 |
Stylus is a revolutionary new language, providing an efficient, dynamic, and expressive way to generate CSS. Supporting both an indented syntax and regular CSS style.
54 | <% } %>
55 | <% if (useCritical) { %>
Critical
56 |
Extracts & inlines critical-path (above-the-fold) CSS from HTML.
<% } %>
57 |
Bootstrap
58 |
Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
59 | <% if (useRequirejs) { %>
RequireJS
60 |
A JavaScript file and module loader optimized for in-browser use.
<% } %>
61 | <% if (useJspm) { %>
JSPM
62 |
jspm is a package manager for the SystemJS universal module loader, built on top of the dynamic ES6 module loader
<% } %>
63 |
64 |
65 |
66 |
67 | <% } else if (useFoundation) { %>
68 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
'Allo, 'Allo!
98 |
Always a pleasure scaffolding your apps.
99 |
Splendid!
100 |
101 |
102 |
103 |
104 |
105 |
Symfony
106 |
High Performance PHP Framework for Web Development
107 |
Browsersync
108 |
Keep multiple browsers & devices in sync when building websites.
109 |
110 | <% if (useLess) { %>
Less
111 |
Less is a mature, stable, and powerful professional grade CSS extension language.
112 | <% } else if (useSass) { %>
Sass
113 |
Sass is a mature, stable, and powerful professional grade CSS extension language.
114 | <% } else if (useStylus) { %>
Stylus
115 |
Stylus is a revolutionary new language, providing an efficient, dynamic, and expressive way to generate CSS. Supporting both an indented syntax and regular CSS style.
116 | <% } %>
117 | <% if (useCritical) { %>
Critical
118 |
Extracts & inlines critical-path (above-the-fold) CSS from HTML.
<% } %>
119 |
Foundation
120 |
Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
121 | <% if (useRequirejs) { %>
RequireJS
122 |
A JavaScript file and module loader optimized for in-browser use.
<% } %>
123 | <% if (useJspm) { %>
JSPM
124 |
jspm is a package manager for the SystemJS universal module loader, built on top of the dynamic ES6 module loader
<% } %>
125 |
126 |
127 | <% } else if (useUikit) { %>
128 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
'Allo, 'Allo!
149 |
150 |
Always a pleasure scaffolding your apps.
151 |
152 |
Splendid!
153 |
154 |
155 |
156 |
157 |
158 |
159 |
185 |
186 | <% } else if (useInuit) { %>
187 |
188 |
206 |
207 |
208 |
209 |
'Allo, 'Allo!
210 |
Always a pleasure scaffolding your apps.
211 |
Splendit
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
Here's what you got
220 |
Symfony
221 |
High Performance PHP Framework for Web Development
222 |
Browsersync
223 |
Keep multiple browsers & devices in sync when building websites.
224 |
225 | <% if (useLess) { %>
Less
226 |
Less is a mature, stable, and powerful professional grade CSS extension language.
227 | <% } else if (useSass) { %>
Sass
228 |
Sass is a mature, stable, and powerful professional grade CSS extension language.
229 | <% } else if (useStylus) { %>
Stylus
230 |
Stylus is a revolutionary new language, providing an efficient, dynamic, and expressive way to generate CSS. Supporting both an indented syntax and regular CSS style.
231 | <% } %>
232 | <% if (useCritical) { %>
Critical
233 |
Extracts & inlines critical-path (above-the-fold) CSS from HTML.
<% } %>
234 |
Bootstrap
235 |
Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
236 | <% if (useRequirejs) { %>
RequireJS
237 |
A JavaScript file and module loader optimized for in-browser use.
<% } %>
238 | <% if (useJspm) { %>
JSPM
239 |
jspm is a package manager for the SystemJS universal module loader, built on top of the dynamic ES6 module loader
<% } %>
240 |
241 |
242 | <% } else { %>
243 |
244 |
<%= appname %>
245 |
246 |
247 |
'Allo, 'Allo!
248 |
Always a pleasure scaffolding your apps.
249 |
250 |
251 |
252 |
253 |
254 | Symfony
255 | High Performance PHP Framework for Web Development
256 | Browsersync
257 | Keep multiple browsers & devices in sync when building websites.
258 |
259 | <% if (useLess) { %>Less
260 | Less is a mature, stable, and powerful professional grade CSS extension language.
261 | <% } else if (useSass) { %>Sass
262 | Sass is a mature, stable, and powerful professional grade CSS extension language.
263 | <% } else if (useStylus) { %>Stylus
264 | Stylus is a revolutionary new language, providing an efficient, dynamic, and expressive way to generate CSS. Supporting both an indented syntax and regular CSS style.
265 | <% } %>
266 | <% if (useCritical) { %>Critical
267 | Extracts & inlines critical-path (above-the-fold) CSS from HTML.
<% } %>
268 | <% if (useRequirejs) { %>RequireJS
269 | A JavaScript file and module loader optimized for in-browser use.
<% } %>
270 | <% if (useJspm) { %>JSPM
271 | jspm is a package manager for the SystemJS universal module loader, built on top of the dynamic ES6 module loader
<% } %>
272 |
273 |
274 |
275 |
276 | <% } %>
277 | {% endblock %}
278 |
--------------------------------------------------------------------------------
/app/templates/symfony/routing.yml:
--------------------------------------------------------------------------------
1 | app:
2 | resource: "@AppBundle/Controller/"
3 | type: annotation
4 |
--------------------------------------------------------------------------------
/app/templates/test/browserify/karma.conf.js:
--------------------------------------------------------------------------------
1 | // Karma configuration
2 | // Generated on Thu May 07 2015 20:08:12 GMT+0200 (CEST)
3 | 'use strict';
4 | module.exports = function(config) {
5 | config.set({
6 | // base path that will be used to resolve all patterns (eg. files, exclude)
7 | basePath: '../../',
8 | plugins: [
9 | 'karma-browserify',
10 | 'karma-mocha',
11 | 'karma-chai',
12 | 'karma-mocha-reporter',
13 | 'karma-phantomjs-launcher'
14 | ],
15 |
16 | // frameworks to use
17 | // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
18 | frameworks: ['browserify', 'mocha', 'chai'],
19 |
20 | files: [
21 | 'tests/Frontend/**/*Spec.js'
22 | ],
23 |
24 | preprocessors: {
25 | // add browserify as preprocessor
26 | 'tests/Frontend/**/*Spec.js': ['browserify']
27 | },
28 |
29 | // add additional browserify configuration properties here
30 | // such as transform and/or debug=true to generate source maps
31 | browserify: {
32 | debug: true,
33 | transform: [
34 | ['babelify', {presets: ['es2015'], ignore: /(node_modules|bower_components)/}],
35 | ['debowerify', {preferNPM: true}],
36 | ['deamdify']
37 | ],
38 | paths: [require('path').join(__dirname,'../../app/Resources/public/scripts')]
39 | },
40 |
41 | // test results reporter to use
42 | // possible values: 'dots', 'progress'
43 | // available reporters: https://npmjs.org/browse/keyword/karma-reporter
44 | reporters: ['mocha'],
45 |
46 | // web server port
47 | port: 9876,
48 |
49 | // enable / disable colors in the output (reporters and logs)
50 | colors: true,
51 |
52 | // level of logging
53 | // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
54 | logLevel: config.LOG_WARN,
55 |
56 | // enable / disable watching file and executing tests whenever any file changes
57 | autoWatch: true,
58 |
59 | // start these browsers
60 | // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
61 | browsers: ['PhantomJS'],
62 |
63 | // Continuous Integration mode
64 | // if true, Karma captures browsers, runs the tests and exits
65 | singleRun: false
66 | });
67 | };
68 |
--------------------------------------------------------------------------------
/app/templates/test/browserify/spec/dummySpec.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | import $ from 'jquery';
3 | import * as dummy from 'modules/dummy';
4 |
5 | describe('Give it some context', () => {
6 | describe('maybe a bit more context here', () => {
7 | it('should run here few assertions', (done) => {
8 | expect($).to.exist;
9 | expect(dummy).to.exist;
10 | expect(dummy.msg).to.equal('I\'m an awesome dummy message');
11 | done();
12 | });
13 | });
14 | });
15 |
--------------------------------------------------------------------------------
/app/templates/test/jspm/karma.conf.js:
--------------------------------------------------------------------------------
1 | // Karma configuration
2 | // Generated on Thu May 07 2015 20:08:12 GMT+0200 (CEST)
3 | 'use strict';
4 | module.exports = function(config) {
5 | config.set({
6 | // base path that will be used to resolve all patterns (eg. files, exclude)
7 | basePath: '../../',
8 | plugins: [
9 | 'karma-jspm',
10 | 'karma-mocha',
11 | 'karma-chai',
12 | 'karma-mocha-reporter',
13 | 'karma-phantomjs-launcher'
14 | ],
15 |
16 | // frameworks to use
17 | // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
18 | frameworks: ['jspm', 'mocha', 'chai'],
19 |
20 | // list of files / patterns to load in the browser
21 | files: [
22 | 'node_modules/phantomjs-polyfill/bind-polyfill.js'
23 | ],
24 |
25 | jspm: {
26 | // Edit this to your needs
27 | config: 'app/Resources/public/scripts/config.js',
28 | loadFiles: ['tests/Frontend/**/*Spec.js'],
29 | serveFiles : ['app/Resources/public/scripts/**/*.js', 'jspm_packages/**/*.js'],
30 | paths: {
31 | '*': 'base/app/Resources/public/scripts/*',
32 | 'tests\/*': 'base/tests/*',
33 | 'github:*': 'base/jspm_packages/github/*',
34 | 'npm:*': 'base/jspm_packages/npm/*'
35 | }
36 | },
37 |
38 | // list of files to exclude
39 | exclude: [],
40 |
41 | // preprocess matching files before serving them to the browser
42 | // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
43 | preprocessors: {},
44 |
45 | // test results reporter to use
46 | // possible values: 'dots', 'progress'
47 | // available reporters: https://npmjs.org/browse/keyword/karma-reporter
48 | reporters: ['mocha'],
49 |
50 | // web server port
51 | port: 9876,
52 |
53 | // enable / disable colors in the output (reporters and logs)
54 | colors: true,
55 |
56 | // level of logging
57 | // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
58 | logLevel: config.LOG_INFO,
59 |
60 | // enable / disable watching file and executing tests whenever any file changes
61 | autoWatch: true,
62 |
63 | // start these browsers
64 | // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
65 | browsers: ['PhantomJS'],
66 |
67 | // Continuous Integration mode
68 | // if true, Karma captures browsers, runs the tests and exits
69 | singleRun: false
70 | });
71 | };
72 |
--------------------------------------------------------------------------------
/app/templates/test/jspm/spec/dummySpec.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | import $ from 'jquery';
3 | import * as dummy from 'modules/dummy';
4 |
5 | describe('Give it some context', () => {
6 | describe('maybe a bit more context here', () => {
7 | it('should run here few assertions', (done) => {
8 | expect($).to.exist;
9 | expect(dummy).to.exist;
10 | expect(dummy.msg).to.equal('I\'m an awesome dummy module');
11 | done();
12 | });
13 | });
14 | });
--------------------------------------------------------------------------------
/app/templates/test/requirejs/karma.conf.js:
--------------------------------------------------------------------------------
1 | // Karma configuration
2 | // Generated on Thu May 07 2015 20:08:12 GMT+0200 (CEST)
3 | 'use strict';
4 | module.exports = function(config) {
5 | config.set({
6 |
7 | // base path that will be used to resolve all patterns (eg. files, exclude)
8 | basePath: '../../',
9 |
10 | plugins: [
11 | 'karma-mocha',
12 | 'karma-requirejs',
13 | 'karma-chai',
14 | 'karma-phantomjs-launcher',
15 | 'karma-mocha-reporter'
16 | ],
17 |
18 | // frameworks to use
19 | // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
20 | frameworks: ['mocha', 'requirejs', 'chai'],
21 |
22 | // list of files / patterns to load in the browser
23 | files: [
24 | 'tests/Frontend/test-main.js',
25 | //bower:
26 | //endbower
27 | {pattern: 'app/Resources/public/scripts/**/*.js', included: false},
28 | {pattern: 'tests/Frontend/**/*Spec.js', included: false}
29 |
30 | ],
31 |
32 | // list of files to exclude
33 | exclude: [],
34 |
35 | // preprocess matching files before serving them to the browser
36 | // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
37 | preprocessors: {},
38 |
39 | // test results reporter to use
40 | // possible values: 'dots', 'progress'
41 | // available reporters: https://npmjs.org/browse/keyword/karma-reporter
42 | reporters: ['mocha'],
43 |
44 | // web server port
45 | port: 9876,
46 |
47 | // enable / disable colors in the output (reporters and logs)
48 | colors: true,
49 |
50 | // level of logging
51 | // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
52 | logLevel: config.LOG_INFO,
53 |
54 | // enable / disable watching file and executing tests whenever any file changes
55 | autoWatch: true,
56 |
57 | // start these browsers
58 | // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
59 | browsers: ['PhantomJS'],
60 |
61 | // Continuous Integration mode
62 | // if true, Karma captures browsers, runs the tests and exits
63 | singleRun: false
64 | });
65 | };
66 |
--------------------------------------------------------------------------------
/app/templates/test/requirejs/spec/dummySpec.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | describe('Give it some context', function () {
3 | describe('maybe a bit more context here', function () {
4 | it('should run here few assertions', function (done) {
5 | require(['jquery','modules/dummy'],function($,dummy) {
6 | expect($).to.exist;
7 | expect(dummy).to.exist;
8 | expect(dummy.msg).to.equal('I\'m an awesome dummy module!');
9 | done();
10 | });
11 | });
12 | });
13 | });
14 |
--------------------------------------------------------------------------------
/app/templates/test/requirejs/test-main.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | var allTestFiles = [];
3 | var TEST_REGEXP = /(spec|test)\.js$/i;
4 |
5 | var pathToModule = function(path) {
6 | return path.replace(/^\/base\//, '../').replace(/\.js$/, '');
7 | };
8 |
9 | Object.keys(window.__karma__.files).forEach(function(file) {
10 | if (TEST_REGEXP.test(file)) {
11 | // Normalize paths to RequireJS module names.
12 | allTestFiles.push(pathToModule(file));
13 | }
14 | });
15 |
16 | require.config({
17 | baseUrl: '/base/bower_components',
18 | paths: {
19 | main: '../app/Resources/public/scripts/main',
20 | app: '../app/Resources/public/scripts/app',
21 | modules: '../app/Resources/public/scripts/modules',
22 | jquery: 'jquery/dist/jquery',
23 | loglevel: 'loglevel/dist/loglevel.min'<% if (useFoundation) { %>,
24 | foundation: 'foundation/js/foundation',
25 | 'foundation/core': 'foundation/js/foundation/foundation',
26 | 'foundation/abide': 'foundation/js/foundation/foundation.abide',
27 | 'foundation/accordion': 'foundation/js/foundation/foundation.accordion',
28 | 'foundation/alert': 'foundation/js/foundation/foundation.alert',
29 | 'foundation/clearing': 'foundation/js/foundation/foundation.clearing',
30 | 'foundation/dropdown': 'foundation/js/foundation/foundation.abide',
31 | 'foundation/equalizer': 'foundation/js/foundation/foundation.equalizer',
32 | 'foundation/interchange': 'foundation/js/foundation/foundation.interchange',
33 | 'foundation/joyride': 'foundation/js/foundation/foundation.joyride',
34 | 'foundation/magellan': 'foundation/js/foundation/foundation.magellan',
35 | 'foundation/offcanvas': 'foundation/js/foundation/foundation.offcanvas',
36 | 'foundation/orbit': 'foundation/js/foundation/foundation.orbit',
37 | 'foundation/reveal': 'foundation/js/foundation/foundation.reveal',
38 | 'foundation/slider': 'foundation/js/foundation/foundation.slider',
39 | 'foundation/tab': 'foundation/js/foundation/foundation.tab',
40 | 'foundation/tooltip': 'foundation/js/foundation/foundation.tooltip',
41 | 'foundation/topbar': 'foundation/js/foundation/foundation.topbar'<% } else if (useBootstrap && !useSass) { %>,
42 | bootstrap: 'bootstrap/dist/js/bootstrap',
43 | 'bootstrap/affix': 'bootstrap/js/affix',
44 | 'bootstrap/alert': 'bootstrap/js/alert',
45 | 'bootstrap/button': 'bootstrap/js/button',
46 | 'bootstrap/carousel': 'bootstrap/js/carousel',
47 | 'bootstrap/collapse': 'bootstrap/js/collapse',
48 | 'bootstrap/dropdown': 'bootstrap/js/dropdown',
49 | 'bootstrap/modal': 'bootstrap/js/modal',
50 | 'bootstrap/popover': 'bootstrap/js/popover',
51 | 'bootstrap/scrollspy': 'bootstrap/js/scrollspy',
52 | 'bootstrap/tab': 'bootstrap/js/tab',
53 | 'bootstrap/tooltip': 'bootstrap/js/tooltip',
54 | 'bootstrap/transition': 'bootstrap/js/transition'<% } else if (useBootstrap) { %>,
55 | bootstrap: 'bootstrap-sass-official/assets/javascripts/bootstrap',
56 | 'bootstrap/affix': 'bootstrap-sass-official/assets/javascripts/bootstrap/affix',
57 | 'bootstrap/alert': 'bootstrap-sass-official/assets/javascripts/bootstrap/alert',
58 | 'bootstrap/button': 'bootstrap-sass-official/assets/javascripts/bootstrap/button',
59 | 'bootstrap/carousel': 'bootstrap-sass-official/assets/javascripts/bootstrap/carousel',
60 | 'bootstrap/collapse': 'bootstrap-sass-official/assets/javascripts/bootstrap/collapse',
61 | 'bootstrap/dropdown': 'bootstrap-sass-official/assets/javascripts/bootstrap/dropdown',
62 | 'bootstrap/modal': 'bootstrap-sass-official/assets/javascripts/bootstrap/modal',
63 | 'bootstrap/popover': 'bootstrap-sass-official/assets/javascripts/bootstrap/popover',
64 | 'bootstrap/scrollspy': 'bootstrap-sass-official/assets/javascripts/bootstrap/scrollspy',
65 | 'bootstrap/tab': 'bootstrap-sass-official/assets/javascripts/bootstrap/tab',
66 | 'bootstrap/tooltip': 'bootstrap-sass-official/assets/javascripts/bootstrap/tooltip',
67 | 'bootstrap/transition': 'bootstrap-sass-official/assets/javascripts/bootstrap/transition'<% } %>
68 | },
69 | shim: {<% if (useUikit) { %>
70 | uikit: ['jquery']<% } else if (useFoundation) { %>
71 | foundation: { exports: 'Foundation', deps: ['jquery'] },
72 | 'foundation/core': { exports: 'Foundation', deps: ['jquery'] },
73 | 'foundation/abide': { exports: 'Foundation.libs.abide', deps: ['foundation/core'] },
74 | 'foundation/accordion': { exports: 'Foundation.libs.accordion', deps: ['foundation/core'] },
75 | 'foundation/alert': { exports: 'Foundation.libs.alert', deps: ['foundation/core'] },
76 | 'foundation/clearing': { exports: 'Foundation.libs.clearing', deps: ['foundation/core'] },
77 | 'foundation/dropdown': { exports: 'Foundation.libs.dropdown', deps: ['foundation/core'] },
78 | 'foundation/equalizer': { exports: 'Foundation.libs.equalizer', deps: ['foundation/core'] },
79 | 'foundation/interchange': { exports: 'Foundation.libs.interchange', deps: ['foundation/core'] },
80 | 'foundation/joyride': { exports: 'Foundation.libs.joyride', deps: ['foundation/core'] },
81 | 'foundation/magellan': { exports: 'Foundation.libs.magellan', deps: ['foundation/core'] },
82 | 'foundation/offcanvas': { exports: 'Foundation.libs.offcanvas', deps: ['foundation/core'] },
83 | 'foundation/orbit': { exports: 'Foundation.libs.orbit', deps: ['foundation/core'] },
84 | 'foundation/reveal': { exports: 'Foundation.libs.reveal', deps: ['foundation/core'] },
85 | 'foundation/slider': { exports: 'Foundation.libs.slider', deps: ['foundation/core'] },
86 | 'foundation/tab': { exports: 'Foundation.libs.tab', deps: ['foundation/core'] },
87 | 'foundation/tooltip': { exports: 'Foundation.libs.tooltip', deps: ['foundation/core'] },
88 | 'foundation/topbar': { exports: 'Foundation.libs.topbar', deps: ['foundation/core'] }<% } else if (useBootstrap) { %>
89 | bootstrap: { exports: '$', deps: ['jquery'] },
90 | 'bootstrap/affix': { exports: '$.fn.affix', deps: ['jquery'] },
91 | 'bootstrap/alert': { exports: '$.fn.alert', deps: ['jquery'] },
92 | 'bootstrap/button': { exports: '$.fn.button', deps: ['jquery'] },
93 | 'bootstrap/carousel': { exports: '$.fn.carousel', deps: ['jquery'] },
94 | 'bootstrap/collapse': { exports: '$.fn.collapse', deps: ['jquery'] },
95 | 'bootstrap/dropdown': { exports: '$.fn.dropdown', deps: ['jquery'] },
96 | 'bootstrap/modal': { exports: '$.fn.modal', deps: ['jquery'] },
97 | 'bootstrap/popover': { exports: '$.fn.popover', deps: ['jquery'] },
98 | 'bootstrap/scrollspy': { exports: '$.fn.scrollspy', deps: ['jquery'] },
99 | 'bootstrap/tab': { exports: '$.fn.tab', deps: ['jquery'] },
100 | 'bootstrap/tooltip': { exports: '$.fn.tooltip', deps: ['jquery'] },
101 | 'bootstrap/transition': { exports: '$.fn.transition', deps: ['jquery'] }<% } %>
102 | },
103 | packages: [
104 |
105 | ]
106 | });
107 |
108 | require(allTestFiles,window.__karma__.start);
109 |
--------------------------------------------------------------------------------
/app/templates/test/webpack/karma.conf.js:
--------------------------------------------------------------------------------
1 | // Karma configuration
2 | // Generated on Thu May 07 2015 20:08:12 GMT+0200 (CEST)
3 | 'use strict';
4 | var webpackConfig = require('../../webpack.config').dist;
5 | module.exports = function(config) {
6 | config.set({
7 | // base path that will be used to resolve all patterns (eg. files, exclude)
8 | basePath: '../../',
9 | plugins: [
10 | require('karma-webpack'),
11 | 'karma-mocha',
12 | 'karma-chai',
13 | 'karma-mocha-reporter',
14 | 'karma-phantomjs-launcher'
15 | ],
16 |
17 | // frameworks to use
18 | // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
19 | frameworks: ['mocha', 'chai'],
20 |
21 | files: [
22 | 'tests/Frontend/**/*Spec.js'
23 | ],
24 |
25 | preprocessors: {
26 | // add webpack as preprocessor
27 | 'tests/Frontend/**/*Spec.js': ['webpack'],
28 | },
29 |
30 | webpack: webpackConfig,
31 |
32 | webpackMiddleware: {
33 | noInfo: true
34 | },
35 |
36 | // test results reporter to use
37 | // possible values: 'dots', 'progress'
38 | // available reporters: https://npmjs.org/browse/keyword/karma-reporter
39 | reporters: ['mocha'],
40 |
41 | // web server port
42 | port: 9876,
43 |
44 | // enable / disable colors in the output (reporters and logs)
45 | colors: true,
46 |
47 | // level of logging
48 | // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
49 | logLevel: config.LOG_DEBUG,
50 |
51 | // enable / disable watching file and executing tests whenever any file changes
52 | autoWatch: true,
53 |
54 | // start these browsers
55 | // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
56 | browsers: ['PhantomJS'],
57 |
58 | // Continuous Integration mode
59 | // if true, Karma captures browsers, runs the tests and exits
60 | singleRun: false
61 | });
62 | };
63 |
--------------------------------------------------------------------------------
/app/templates/test/webpack/spec/dummySpec.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | import $ from 'jquery';
3 | import * as dummy from 'modules/dummy';
4 |
5 | describe('Give it some context', () => {
6 | describe('maybe a bit more context here', () => {
7 | it('should run here few assertions', (done) => {
8 | expect($).to.exist;
9 | expect(dummy).to.exist;
10 | expect(dummy.msg).to.equal('I\'m an awesome dummy message');
11 | done();
12 | });
13 | });
14 | });
15 |
--------------------------------------------------------------------------------
/app/templates/webpack.config.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | var path = require('path');
3 | var webpack = require('webpack');
4 | var assign = require('lodash/assign');
5 |
6 | var resolveNpmPath = function (componentPath) {
7 | return path.resolve(path.join(__dirname, 'node_modules', componentPath));
8 | };
9 |
10 | var aliases = {
11 | 'jquery': resolveNpmPath('jquery/dist/jquery')
12 | };
13 |
14 | module.exports.dev = {
15 | debug: true,
16 | devtool: '#cheap-module-source-map',
17 |
18 | context: path.join(__dirname, 'app', 'Resources', 'public', 'scripts'),
19 | resolve: {
20 | root: [
21 | __dirname,
22 | path.join(__dirname, 'app', 'Resources', 'public', 'scripts'),
23 | path.join(__dirname, 'test')
24 | ],
25 | modulesDirectories: [
26 | path.join('app', 'Resources', 'public', 'scripts'),
27 | 'test',
28 | 'node_modules',
29 | 'bower_components'
30 | ],
31 | alias: aliases
32 | },
33 |
34 | entry: [
35 | 'webpack/hot/dev-server',
36 | 'webpack-hot-middleware/client',
37 | './main'
38 | ],
39 |
40 | output: {
41 | path: path.join(__dirname, '.tmp', 'scripts'),
42 | publicPath: '/scripts/',
43 | filename: 'main.js'
44 | },
45 |
46 | plugins: [
47 | new webpack.optimize.DedupePlugin(),
48 | new webpack.optimize.OccurenceOrderPlugin(),
49 | new webpack.HotModuleReplacementPlugin(),
50 | new webpack.NoErrorsPlugin(),
51 |
52 | new webpack.ResolverPlugin(
53 | new webpack.ResolverPlugin.DirectoryDescriptionFilePlugin('bower.json', ['main'])
54 | ),
55 | new webpack.ProvidePlugin({
56 | $: 'jquery',
57 | jQuery: 'jquery',
58 | 'window.jQuery': 'jquery'
59 | })
60 | ],
61 | module: {
62 | loaders: [
63 | {test: /.jsx?$/, exclude: /(node_modules|bower_components)/, loaders: ['monkey-hot', 'babel?presets[]=es2015,cacheDirectory=true']}
64 | ]
65 | }
66 | };
67 |
68 | module.exports.dist = {
69 | context: path.join(__dirname, 'app', 'Resources', 'public', 'scripts'),
70 | resolve: {
71 | root: [
72 | __dirname,
73 | path.join(__dirname, 'app', 'Resources', 'public', 'scripts'),
74 | path.join(__dirname, 'test')
75 | ],
76 | modulesDirectories: [
77 | path.join('app', 'Resources', 'public', 'scripts'),
78 | 'test',
79 | 'node_modules',
80 | 'bower_components'
81 | ],
82 | alias: aliases
83 | },
84 |
85 | entry: ['./main'],
86 |
87 | output: {
88 | path: path.join(__dirname, 'web', 'scripts'),
89 | publicPath: '/scripts/',
90 | filename: 'main.js'
91 | },
92 |
93 | plugins: [
94 | new webpack.optimize.DedupePlugin(),
95 | new webpack.optimize.UglifyJsPlugin({sourceMap: false}),
96 | new webpack.optimize.OccurenceOrderPlugin(),
97 | new webpack.NoErrorsPlugin(),
98 |
99 | new webpack.ResolverPlugin(
100 | new webpack.ResolverPlugin.DirectoryDescriptionFilePlugin('bower.json', ['main'])
101 | ),
102 | new webpack.ProvidePlugin({
103 | $: 'jquery',
104 | jQuery: 'jquery',
105 | 'window.jQuery': 'jquery'
106 | })
107 | ],
108 | module: {
109 | loaders: [
110 | {test: /.jsx?$/, exclude: /(node_modules|bower_components)/, loaders: ['babel?presets[]=es2015,cacheDirectory=true']}
111 | ]
112 | }
113 | };
114 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "generator-grunt-symfony",
3 | "version": "0.10.1",
4 | "description": "Yeoman generator to scaffold Symfony PHP apps with full featured frontend tooling incl. browsersync",
5 | "license": "MIT",
6 | "main": "app/index.js",
7 | "repository": "bezoerb/generator-grunt-symfony",
8 | "author": {
9 | "name": "Ben Zörb",
10 | "email": "",
11 | "url": "https://github.com/bezoerb"
12 | },
13 | "engines": {
14 | "node": ">=0.10.0"
15 | },
16 | "scripts": {
17 | "test": "grunt test"
18 | },
19 | "files": [
20 | "app"
21 | ],
22 | "keywords": [
23 | "yeoman-generator",
24 | "symfony",
25 | "php",
26 | "grunt",
27 | "browsersync",
28 | "jspm",
29 | "requirejs",
30 | "sass",
31 | "less",
32 | "stylus"
33 | ],
34 | "dependencies": {
35 | "chalk": "1.1.3",
36 | "fs-extra": "0.30.0",
37 | "html-wiring": "1.2.0",
38 | "inquirer": "^1.0.2",
39 | "js-yaml": "^3.6.0",
40 | "lodash": "^4.12.0",
41 | "string-length": "1.0.1",
42 | "update-notifier": "1.0.1",
43 | "yeoman-generator": "^0.22.5",
44 | "yo": "1.8.4",
45 | "yosay": "1.1.1"
46 | },
47 | "devDependencies": {
48 | "chai": "3.5.0",
49 | "debug": "2.2.0",
50 | "es6-promise": "4.0.2",
51 | "glob": "7.0.3",
52 | "grunt": "1.0.1",
53 | "grunt-contrib-clean": "1.0.0",
54 | "grunt-contrib-jshint": "1.0.0",
55 | "grunt-exec": "0.4.7",
56 | "grunt-simple-mocha": "0.4.1",
57 | "indent-string": "2.1.0",
58 | "jshint-stylish": "2.2.0",
59 | "load-grunt-tasks": "3.5.0",
60 | "mocha": "2.5.3",
61 | "shelljs": "0.7.0",
62 | "yeoman-assert": "2.2.1",
63 | "yeoman-test": "1.4.0"
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/test/.jshintrc:
--------------------------------------------------------------------------------
1 | {
2 | "node": true,
3 | "mocha": true,
4 | "expr": true,
5 | "esnext": true,
6 | "bitwise": true,
7 | "curly": true,
8 | "eqeqeq": true,
9 | "immed": true,
10 | "latedef": true,
11 | "newcap": true,
12 | "noarg": true,
13 | "quotmark": true,
14 | "undef": true,
15 | "unused": true,
16 | "strict": true
17 | }
18 |
--------------------------------------------------------------------------------
/test/fixtures/app/Resources/public/scripts/config.js:
--------------------------------------------------------------------------------
1 | System.config({
2 | "baseURL": "./",
3 | "defaultJSExtensions": true,
4 | "transpiler": "babel",
5 | "babelOptions": {
6 | "optional": [
7 | "runtime",
8 | "optimisation.modules.system"
9 | ]
10 | },
11 | "paths": {
12 | "*": "app/Resources/public/*",
13 | "github:*": "../../../jspm_packages/github/*.js",
14 | "npm:*": "../../../jspm_packages/npm/*.js"
15 | }
16 | });
--------------------------------------------------------------------------------
/test/fixtures/app/autoload.php:
--------------------------------------------------------------------------------
1 | =5.3.9",
14 | "symfony/symfony": "2.7.*",
15 | "doctrine/orm": "^2.4.8",
16 | "doctrine/doctrine-bundle": "~1.4",
17 | "symfony/swiftmailer-bundle": "~2.3",
18 | "symfony/monolog-bundle": "~2.4",
19 | "sensio/distribution-bundle": "~4.0",
20 | "sensio/framework-extra-bundle": "^3.0.2",
21 | "incenteev/composer-parameter-handler": "~2.0",
22 | "zoerb/filerevbundle": "~1.0"
23 | },
24 | "require-dev": {
25 | "sensio/generator-bundle": "~2.3",
26 | "phpunit/phpunit": "~4.6"
27 | },
28 | "scripts": {
29 | "post-root-package-install": [
30 | "SymfonyStandard\\Composer::hookRootPackageInstall"
31 | ],
32 | "post-install-cmd": [
33 | "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
34 | "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
35 | "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
36 | "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::removeSymfonyStandardFiles"
37 | ],
38 | "post-update-cmd": [
39 | "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
40 | "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
41 | "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
42 | "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::removeSymfonyStandardFiles"
43 | ]
44 | },
45 | "config": {
46 | "bin-dir": "bin"
47 | },
48 | "extra": {
49 | "symfony-app-dir": "app",
50 | "symfony-web-dir": "web",
51 | "symfony-assets-install": "relative",
52 | "incenteev-parameters": {
53 | "file": "app/config/parameters.yml"
54 | },
55 | "branch-alias": {
56 | "dev-master": "2.6-dev"
57 | }
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/test/fixtures/composer.phar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/bezoerb/generator-grunt-symfony/fc9865a80bdd18c77c512b7d938c9c92426358ad/test/fixtures/composer.phar
--------------------------------------------------------------------------------
/test/fixtures/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "tempApp",
3 | "version": "0.0.0",
4 | "scripts": {
5 | "test": "grunt test"
6 | },
7 | "dependencies": {
8 | "bootstrap": "^3.3.5",
9 | "bootstrap-sass": "^3.3.6",
10 | "bootstrap-styl": "^5.0.5",
11 | "foundation-sites": "^6.2.0",
12 | "jquery": "^2.1.4",
13 | "jspm": "^0.16.34",
14 | "picturefill": "^3.0.2",
15 | "uikit": "^2.25.0"
16 | },
17 | "devDependencies": {
18 | "bower": "^1.3.12",
19 | "grunt": "^1.0.1",
20 | "chalk": "^1.1.1",
21 | "lodash": "^4.6.1",
22 | "eslint": "^2.3.0",
23 | "eslint-config-xo": "^0.14.1",
24 | "grunt-eslint": "^18.0.0",
25 | "grunt-available-tasks": "^0.6.1",
26 | "grunt-browser-sync": "^2.0.0",
27 | "grunt-contrib-clean": "^1.0.0",
28 | "grunt-contrib-copy": "^1.0.0",
29 | "grunt-contrib-cssmin": "^1.0.0",
30 | "grunt-sw-precache": "^1.0.3",
31 | "sw-toolbox": "^3.0.1",
32 | "appcache-nanny": "^1.0.3",
33 | "grunt-appcache": "^0.2.0",
34 | "grunt-contrib-imagemin": "^1.0.0",
35 | "grunt-contrib-sass": "^1.0.0",
36 | "grunt-sass": "^1.0.0",
37 | "grunt-contrib-less": "^1.0.0",
38 | "grunt-bower-requirejs": "^2.0.0",
39 | "grunt-contrib-requirejs": "^1.0.0",
40 | "grunt-contrib-concat": "^1.0.0",
41 | "grunt-autoprefixer": "^3.0.0",
42 | "grunt-contrib-watch": "^1.0.0",
43 | "grunt-filerev": "^2.1.2",
44 | "nib": "^1.1.0",
45 | "grunt-contrib-stylus": "^1.1.0",
46 | "grunt-svgmin": "^3.1.2",
47 | "grunt-usemin": "^3.0.0",
48 | "grunt-phpunit": "^0.3.6",
49 | "jit-grunt": "^0.10.0",
50 | "grunt-exec": "^0.4.6",
51 | "grunt-uncss": "^0.5.0",
52 | "grunt-critical": "^0.2.0",
53 | "grunt-contrib-connect": "^1.0.0",
54 | "get-port": "^2.1.0",
55 | "grunt-http": "^2.0.1",
56 | "parseurl": "^1.3.0",
57 | "php-proxy-middleware": "^1.0.1",
58 | "load-grunt-config": "^0.19.0",
59 | "jspm": "^0.16.19",
60 | "grunt-contrib-uglify": "^1.0.0",
61 | "babel": "^6.0.15",
62 | "babel-core": "^6.6.5",
63 | "babel-loader": "^6.2.4",
64 | "babel-runtime": "^6.6.1",
65 | "babel-preset-es2015": "^6.6.0",
66 | "grunt-webpack": "^1.0.11",
67 | "webpack": "^1.12.2",
68 | "webpack-dev-server": "^1.12.1",
69 | "webpack-dev-middleware": "^1.2.0",
70 | "webpack-hot-middleware": "^2.4.1",
71 | "json-loader": "^0.5.3",
72 | "karma-webpack": "^1.7.0",
73 | "monkey-hot-loader": "0.0.3",
74 | "babelify": "^7.2.0",
75 | "browserify": "^13.0.0",
76 | "watchify": "^3.7.0",
77 | "deamdify": "^0.2.0",
78 | "debowerify": "^1.4.1",
79 | "grunt-browserify": "^5.0.0",
80 | "karma-browserify": "^5.0.2",
81 | "karma-babel-preprocessor": "^6.0.1",
82 | "core-js": "^2.4.0",
83 | "chai": "^3.3.0",
84 | "karma": "^0.13.10",
85 | "mocha": "^2.3.3",
86 | "grunt-karma": "^1.0.0",
87 | "karma-chai": "^0.1.0",
88 | "karma-coverage": "^1.0.0",
89 | "karma-mocha": "^1.0.1",
90 | "karma-mocha-reporter": "^2.0.0",
91 | "karma-phantomjs-launcher": "^1.0.0",
92 | "karma-jspm": "^2.0.1",
93 | "systemjs": "^0.19.3",
94 | "es6-module-loader": "^0.17.6",
95 | "phantomjs-polyfill": "0.0.2",
96 | "karma-requirejs": "^1.0.0",
97 | "grunt-wiredep": "^3.0.1",
98 | "time-grunt": "^1.1.0",
99 | "phantomjs-prebuilt": ">=1.9",
100 | "slash": "^1.0.0",
101 | "fs-extra": "^0.30.0"
102 | },
103 | "jspm": {
104 | "directories": {
105 | "lib": "app/Resources/public/scripts"
106 | },
107 | "configFile": "app/Resources/public/scripts/config.js",
108 | "dependencies": {
109 | "appcache-nanny": "npm:appcache-nanny@^1.0.3",
110 | "bootstrap": "github:twbs/bootstrap@^3.3.4",
111 | "debug": "npm:debug@^2.2.0",
112 | "foundation-sites": "npm:foundation-sites@^6.2.0",
113 | "jquery": "npm:jquery@^2.2.1",
114 | "picturefill": "npm:picturefill@^3.0.1",
115 | "uikit": "github:uikit/uikit@2.26.2"
116 | },
117 | "devDependencies": {
118 | "babel": "npm:babel-core@^5.8.34",
119 | "babel-runtime": "npm:babel-runtime@^5.8.34",
120 | "core-js": "npm:core-js@^1.1.4"
121 | }
122 | }
123 | }
124 |
--------------------------------------------------------------------------------
/test/helper/fileHelper.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Created by ben on 11.02.15.
3 | */
4 | 'use strict';
5 |
6 | var path = require('path');
7 |
8 | function Base(dir) {
9 | this._dir = dir;
10 | this.files = [
11 | path.join(this._dir, 'bower.json'),
12 | path.join(this._dir, 'package.json'),
13 | path.join(this._dir, 'Gruntfile.js'),
14 | path.join(this._dir, '.editorconfig'),
15 | path.join(this._dir, '.eslintrc'),
16 | path.join(this._dir, '.jscsrc'),
17 | // service worker
18 | path.join(this._dir, 'app/Resources/public/scripts/modules/dummy.js'),
19 | path.join(this._dir, 'app/Resources/public/scripts/modules/service-worker.js'),
20 | path.join(this._dir, 'app/Resources/public/scripts/sw/runtime-caching.js'),
21 | path.join(this._dir, 'app/Resources/public/service-worker.js')
22 | ];
23 | }
24 |
25 | Base.prototype.addRequirejs = function () {
26 | this.files.concat([
27 | path.join(this._dir, 'app/Resources/public/scripts/main.js'),
28 | path.join(this._dir, 'app/Resources/public/scripts/config.js'),
29 | path.join(this._dir, 'app/Resources/public/scripts/app.js')
30 | ]);
31 | return this;
32 | };
33 |
34 |
35 | Base.prototype.addJspm = function () {
36 | this.files.concat([
37 | path.join(this._dir, 'app/Resources/public/scripts/main.js'),
38 | path.join(this._dir, 'app/Resources/public/scripts/config.js')
39 | ]);
40 | return this;
41 | };
42 |
43 | Base.prototype.addNop = function () {
44 | this.files.concat([path.join(this._dir, 'app/Resources/public/styles/main.css')]);
45 | return this;
46 | };
47 |
48 | Base.prototype.addLess = function () {
49 | this.files.concat([path.join(this._dir, 'app/Resources/public/styles/main.less')]);
50 | return this;
51 | };
52 |
53 | Base.prototype.addStylus = function () {
54 | this.files.concat([path.join(this._dir, 'app/Resources/public/styles/main.styl')]);
55 | return this;
56 | };
57 |
58 | Base.prototype.addSass = function () {
59 | this.files.concat([path.join(this._dir, 'app/Resources/public/styles/main.sass')]);
60 | return this;
61 | };
62 |
63 | Base.prototype.toArray = function () {
64 | return this.files;
65 | };
66 |
67 | module.exports = function (dir) {
68 | return new Base(dir);
69 | };
70 |
--------------------------------------------------------------------------------
/test/helper/fixturesHelper.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Created by ben on 09.05.15.
3 | */
4 | 'use strict';
5 | var _ = require('lodash');
6 | var fs = require('fs-extra');
7 | var glob = require('glob');
8 | var path = require('path');
9 | var exec = require('child_process').exec;
10 | var debug = require('debug')('yeoman:generator-grunt-symfony');
11 |
12 | function inArray(arr) {
13 | return function (fp) {
14 | var name = path.basename(fp);
15 | var suit = _.indexOf(arr, 'suit') !== -1 && /^suit-/.test(name);
16 | return suit || _.indexOf(['karma'], name) !== -1 || _.indexOf(arr, name) !== -1;
17 | };
18 | }
19 |
20 | /**
21 | * symlink npm dependencies
22 | */
23 | function prepareNpmDeps(configFile, baseConfigFile, base, target) {
24 | var config = fs.readJsonSync(configFile);
25 | var baseConfig = fs.readJsonSync(baseConfigFile);
26 | var modules = _.keys(_.merge(config.dependencies || {}, config.devDependencies));
27 | var baseModules = _.keys(_.merge(baseConfig.dependencies || {}, baseConfig.devDependencies));
28 | var drop = _.difference(baseModules, modules);
29 |
30 | fs.removeSync(target);
31 |
32 | _.forEach(glob.sync(base + '/*'), function(fp) {
33 | var module = path.basename(fp);
34 | if (drop.indexOf(module) === -1) {
35 | fs.ensureSymlinkSync(fp, path.join(target, module));
36 | }
37 | });
38 | }
39 |
40 | /**
41 | * symlink bower dependencies
42 | */
43 | function prepareBowerDeps(configFile, base, target) {
44 | var config = fs.readJsonSync(configFile);
45 | var dependencies = _.keys(_.merge(config.dependencies || {}, config.devDependencies));
46 |
47 | // add dependencies from dependencies as bower has a flat directory structure
48 | var modules = _.reduce(dependencies, function (res, item) {
49 | try {
50 | var configPath = path.join(base, item, 'bower.json');
51 | var config = fs.readJsonSync(configPath);
52 | return res.concat(_.keys(config.dependencies || {}));
53 | } catch (err) {
54 | return res;
55 | }
56 | }, dependencies);
57 |
58 | fs.removeSync(target);
59 |
60 | // link deps
61 | return _.chain(glob.sync(base + '/*'))
62 | .filter(inArray(_.uniq(modules)))
63 | .forEach(function (fp) {
64 | fs.ensureSymlinkSync(fp, path.join(target, path.basename(fp)));
65 | }).value();
66 | }
67 |
68 | /**
69 | * link dependencies
70 | */
71 | function linkDeps(base, target, done) {
72 | return function () {
73 | prepareNpmDeps(path.join(target, 'package.json'), path.join(base, 'package.json'), path.join(base, 'node_modules'), path.join(target, 'node_modules'));
74 | prepareBowerDeps(path.join(target, 'bower.json'), path.join(base, 'bower_components'), path.join(target, 'bower_components'));
75 |
76 | fs.ensureSymlinkSync(path.join(base, 'node_modules', '.bin'), path.join(target, 'node_modules', '.bin'));
77 | fs.ensureSymlinkSync(path.join(base, 'vendor'), path.join(target, 'vendor'));
78 | fs.removeSync(path.join(target, 'composer.lock'));
79 | fs.ensureSymlinkSync(path.join(base, 'composer.lock'), path.join(target, 'composer.lock'));
80 | fs.removeSync(path.join(target, 'composer.json'));
81 | fs.ensureSymlinkSync(path.join(base, 'composer.json'), path.join(target, 'composer.json'));
82 | fs.ensureSymlinkSync(path.join(base, 'bin'), path.join(target, 'bin'));
83 | fs.copySync(path.join(base, 'app/autoload.php'), path.join(target, 'app/autoload.php'));
84 | fs.copySync(path.join(base, 'app/bootstrap.php.cache'), path.join(target, 'app/bootstrap.php.cache'));
85 | fs.copySync(path.join(base, 'app/config/parameters.yml'), path.join(target, 'app/config/parameters.yml'));
86 | fs.copySync(path.join(base, 'app/config/parameters.yml.dist'), path.join(target, 'app/config/parameters.yml.dist'));
87 |
88 | var pkg = fs.readJsonSync(path.join(target, 'package.json'));
89 | if (pkg.jspm) {
90 | fs.ensureSymlinkSync(path.join(base, 'jspm_packages'), path.join(target, 'jspm_packages'));
91 | }
92 |
93 | done();
94 | };
95 | }
96 |
97 | module.exports.linkDeps = linkDeps;
98 |
99 | module.exports.withComposer = function (cb) {
100 | if (!cb) {
101 | cb = function () {
102 | };
103 | }
104 |
105 | debug('process.cwd() -> ', process.cwd());
106 |
107 | exec('php -r "readfile(\'https://getcomposer.org/installer\');" | php', function (error) {
108 | if (error) {
109 | cb(error);
110 | return;
111 | }
112 |
113 | var cmd = process.env.COMPOSER_AUTH ? 'config github-oauth.github.com ' + process.env.COMPOSER_AUTH : ' --version';
114 | exec('php composer.phar ' + cmd, function (error, stdout, stderr) {
115 | debug('stdout: composer config -> ', stdout);
116 | debug('stderr: composer config -> ', stderr);
117 | if (error) {
118 | debug('error: composer config -> ', error);
119 | }
120 |
121 | exec('php composer.phar clear-cache', function (error, stdout, stderr) {
122 | debug('stdout: composer clear-cache -> ', stdout);
123 | debug('stderr: composer clear-cache -> ', stderr);
124 | if (error) {
125 | debug('error: composer clear-cache -> ', error);
126 | cb(error);
127 | return;
128 | }
129 |
130 | //exec('php composer.phar run-script post-install-cmd --no-interaction', function (error, stdout, stderr) {
131 | exec('php composer.phar install --prefer-dist --no-interaction --dev', function (error, stdout, stderr) {
132 | debug('error: composer install -> ', error);
133 | debug('stdout: composer install -> ', stdout);
134 | debug('stderr: composer install -> ', stderr);
135 | // app/bootstrap.php.cache should be ready
136 | var bootstrap = path.resolve('app/bootstrap.php.cache');
137 | /* jshint -W016 */
138 | try {
139 | fs.statSync(bootstrap, fs.R_OK | fs.W_OK);
140 | debug('SUCCESS bootstrap.php.cache -> available');
141 | } catch (err) {
142 | debug('ERROR: bootstrap.php.cache -> ', err.message || err);
143 | }
144 |
145 | cb(error, stdout);
146 | });
147 | });
148 | });
149 | });
150 | };
151 |
152 | module.exports.withJspm = function (cb) {
153 | if (!cb) {
154 | cb = function () {
155 | };
156 | }
157 |
158 | var cmd = process.env.JSPM_AUTH ? 'config registries.github.auth ' + process.env.JSPM_AUTH : ' --version';
159 | exec('node_modules/.bin/jspm ' + cmd, function (error, stdout, stderr) {
160 | debug('stdout: jspm config -> ', stdout);
161 | debug('stderr: jspm config -> ', stderr);
162 |
163 | if (error) {
164 | debug('stderr: jspm config -> ', stderr);
165 | }
166 | exec('node_modules/.bin/jspm init -y', function (error, stdout, stderr) {
167 | debug('stdout: jspm init -> ', stdout);
168 | debug('stderr: jspm init -> ', stderr);
169 |
170 | if (error) {
171 | debug('error: jspm init -> ', error);
172 | }
173 | exec('node_modules/.bin/jspm install', function (error, stdout, stderr) {
174 | debug('stdout: jspm install -> ', stdout);
175 | debug('stderr: jspm install -> ', stderr);
176 |
177 | if (error) {
178 | debug('error: jspm install -> ', error);
179 | cb(error);
180 | return;
181 | }
182 | cb(error, stdout);
183 | });
184 | });
185 | });
186 | };
187 |
--------------------------------------------------------------------------------
/test/helper/testHelper.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Created by ben on 27.10.15.
3 | */
4 | 'use strict';
5 | /*jshint expr: true*/
6 | var path = require('path');
7 | /*jshint -W079 */
8 | var Promise = require('es6-promise').Promise;
9 | var debug = require('debug')('yeoman:generator-grunt-symfony');
10 | var helpers = require('yeoman-test');
11 | var chalk = require('chalk');
12 | var indentString = require('indent-string');
13 | var assert = require('yeoman-assert');
14 | var _ = require('lodash');
15 | var files = require('./fileHelper');
16 | var fixtureHelper = require('./fixturesHelper');
17 | var withComposer = fixtureHelper.withComposer;
18 | var withJspm = fixtureHelper.withJspm;
19 | var chai = require('chai');
20 | var expect = chai.expect;
21 | var exec = require('child_process').exec;
22 | var os = require('os');
23 | var fs = require('fs-extra');
24 |
25 | var base = path.join(__dirname, '..', 'fixtures');
26 | var target = path.join(__dirname, '..', 'temp');
27 |
28 | function log(text) {
29 | process.stdout.write(indentString(chalk.grey(text), chalk.grey(' ')));
30 | }
31 |
32 | function markDone(data) {
33 | process.stdout.write(os.EOL);
34 | return data;
35 | }
36 |
37 | function prompts2String(promts) {
38 | return _.reduce(promts, function (res, curr, key) {
39 | if (_.indexOf(['symfonyStandard', 'continue'], key) >= 0) {
40 | return res;
41 | } else {
42 | res.push(key + ': ' + chalk.yellow(curr));
43 | return res;
44 | }
45 |
46 | }, []);
47 | }
48 |
49 | /**
50 | * Helper function to test grunt task for don't throwning an error
51 | * @param task
52 | * @returns {promise}
53 | */
54 | function runTask(task) {
55 | return new Promise(function (resolve, reject) {
56 | debug('grunt ' + task);
57 | exec('grunt ' + task + ' --no-color', function (error, stdout, stderr) {
58 | debug('stderr:', stderr);
59 | debug('stdout:', stdout);
60 | if (error) {
61 | log(os.EOL + stdout + os.EOL);
62 | reject(error);
63 | }
64 |
65 | /*jshint expr: true*/
66 | expect(error).to.be.null;
67 | expect(stdout).to.contain('Done.');
68 | resolve(stdout);
69 | });
70 | });
71 | }
72 |
73 |
74 | /**
75 | * Run generator
76 | *
77 | * @param prompts
78 | * @returns {Promise}
79 | */
80 | function install(prompts) {
81 | return new Promise(function (resolve) {
82 | var opts = prompts2String(prompts);
83 | process.stdout.write(os.EOL + indentString('running app with ' + opts.join(', '), ' ') + os.EOL);
84 | debug(path.join(__dirname, '../../app'),target);
85 | helpers.run(path.join(__dirname, '../../app'))
86 | .inDir(target)
87 | .withOptions({'skip-install': true})
88 | .withPrompts(prompts)
89 | .on('end', fixtureHelper.linkDeps(base, target, function () {
90 | resolve();
91 | }));
92 | });
93 | }
94 |
95 | function installDeps(prompts) {
96 | return function () {
97 | log('... install dependencies');
98 | return new Promise(function (resolve) {
99 |
100 | withComposer(function (error, stdout) {
101 | if (error) {
102 | log(os.EOL + stdout + os.EOL);
103 | }
104 |
105 | debug(os.EOL + stdout);
106 | /*jshint expr: true*/
107 | //noinspection BadExpressionStatementJS
108 | expect(error).to.be.null;
109 | process.stdout.write(chalk.green(' composer'));
110 |
111 | if (prompts.loader !== 'jspm') {
112 | markDone();
113 | return resolve();
114 | }
115 |
116 | withJspm(function (error, stdout) {
117 | if (error) {
118 | log(os.EOL + stdout + os.EOL);
119 | }
120 | debug(os.EOL + stdout);
121 | /*jshint expr: true*/
122 | //noinspection BadExpressionStatementJS
123 | expect(error).to.be.null;
124 | process.stdout.write(', ' + chalk.green('jspm'));
125 | markDone();
126 | resolve();
127 | });
128 | });
129 | });
130 | };
131 | }
132 |
133 | /**
134 | * @param prompts
135 | * @returns {Function}
136 | */
137 | function checkFiles(prompts) {
138 | return function () {
139 | log('... check files');
140 |
141 | var usedFiles = files(target);
142 | switch (prompts.preprocessor) {
143 | case 'less':
144 | usedFiles = usedFiles.addLess();
145 | break;
146 | case 'stylus':
147 | usedFiles = usedFiles.addStylus();
148 | break;
149 | case 'sass':
150 | usedFiles = usedFiles.addSass();
151 | break;
152 | default:
153 | usedFiles = usedFiles.addNop();
154 | break;
155 | }
156 |
157 | switch (prompts.loader) {
158 | case 'requirejs':
159 | usedFiles = usedFiles.addRequirejs();
160 | break;
161 | case 'jspm':
162 | usedFiles = usedFiles.addJspm();
163 | break;
164 | }
165 |
166 | assert.file(usedFiles.toArray());
167 | markDone();
168 | };
169 | }
170 |
171 | function checkEslint() {
172 | return function () {
173 | log('... check eslint');
174 | return runTask('eslint').then(markDone);
175 | };
176 | }
177 |
178 | function checkKarma(prompts) {
179 | return function () {
180 | log('... check karma');
181 | if (prompts.loader === 'requirejs') {
182 | return runTask('wiredep')
183 | .then(function(){
184 | return runTask('bowerRequirejs');
185 | })
186 | .then(function(){
187 | return runTask('karma');
188 | })
189 | .then(markDone);
190 | } else {
191 | return runTask('karma').then(markDone);
192 | }
193 | };
194 | }
195 |
196 | function checkPhpUnit() {
197 | return function () {
198 | log('... check phpunit');
199 | return runTask('phpunit').then(markDone);
200 | };
201 | }
202 |
203 | function checkJs() {
204 | return function () {
205 | log('... check js build');
206 | return runTask('js:dist').then(markDone);
207 | };
208 | }
209 |
210 | function checkCss(prompts) {
211 | return function () {
212 | log('... check css build');
213 | return runTask('css:dist').then(function() {
214 | if (_.indexOf(prompts.additional,'critical') >= 0) {
215 | assert.file(['app/Resources/public/styles/critical/index.css']);
216 | var critical = fs.readFileSync('app/Resources/public/styles/critical/index.css','utf8');
217 | expect(critical).to.not.equal('');
218 | }
219 | markDone();
220 | });
221 | };
222 | }
223 |
224 | function checkRev() {
225 | return function () {
226 | log('... check rev');
227 | return runTask('rev').then(function() {
228 | assert.file(['app/config/filerev.json']);
229 | var reved = fs.readJsonSync('app/config/filerev.json');
230 | _.forEach(reved, function (file) {
231 | assert.file([path.join('web', file)]);
232 | });
233 | expect(_.size(reved)).to.equal(2);
234 | return markDone(reved);
235 | });
236 | };
237 | }
238 |
239 | function checkServiceWorker() {
240 | // must be called directly after checkRev because it takes the reved file summary
241 | return function (reved) {
242 | log('... check service worker');
243 | return runTask('generate-service-worker').then(function() {
244 | assert.file(['web/service-worker.js']);
245 | var workerJs = fs.readFileSync('web/service-worker.js', 'utf8');
246 | _.forEach(reved, function (file) {
247 | expect(workerJs).to.contain(file.replace(/^\//,''));
248 | });
249 | expect(workerJs).to.contain('scripts/sw/runtime-caching.js');
250 | expect(workerJs).to.contain('scripts/sw/sw-toolbox.js');
251 | markDone();
252 | });
253 | };
254 | }
255 |
256 |
257 | module.exports.testPrompts = function (prompts, done) {
258 | install(prompts)
259 | .then(installDeps(prompts))
260 | .then(checkFiles(prompts))
261 | .then(checkEslint())
262 | .then(checkKarma(prompts))
263 | .then(checkPhpUnit())
264 | .then(checkJs())
265 | .then(checkCss(prompts))
266 | .then(checkRev())
267 | .then(checkServiceWorker())
268 | .then(function () {
269 | _.delay(done, 100);
270 | })
271 | .catch(function (err) {
272 | _.delay(done, 100, new Error(err.message || err));
273 | });
274 | };
275 |
--------------------------------------------------------------------------------
/test/test-app.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | /*jshint expr: true*/
3 | var testPrompts = require('./helper/testHelper').testPrompts;
4 | var assign = require('lodash/assign');
5 | var clone = require('lodash/clone');
6 |
7 | describe('grunt-symfony generator', function () {
8 | this.timeout(300000);
9 |
10 | var tests = [
11 | // jspm no framework
12 | {loader: 'browserify'},
13 | {loader: 'browserify', preprocessor: 'less'},
14 | {loader: 'browserify', preprocessor: 'sass', libsass: false},
15 | {loader: 'browserify', preprocessor: 'sass', libsass: true},
16 | {loader: 'browserify', preprocessor: 'stylus'},
17 | // browserify uikit
18 | {loader: 'browserify', framework: 'uikit'},
19 | {loader: 'browserify', framework: 'uikit', preprocessor: 'less'},
20 | {loader: 'browserify', framework: 'uikit', preprocessor: 'sass', libsass: false},
21 | {loader: 'browserify', framework: 'uikit', preprocessor: 'sass', libsass: true},
22 | {loader: 'browserify', framework: 'uikit', preprocessor: 'stylus'},
23 | // browserify bootstrap
24 | {loader: 'browserify', framework: 'bootstrap'},
25 | {loader: 'browserify', framework: 'bootstrap', preprocessor: 'less'},
26 | {loader: 'browserify', framework: 'bootstrap', preprocessor: 'sass', libsass: false},
27 | {loader: 'browserify', framework: 'bootstrap', preprocessor: 'sass', libsass: true},
28 | {loader: 'browserify', framework: 'bootstrap', preprocessor: 'stylus'},
29 | // browserify foundation
30 | {loader: 'browserify', framework: 'foundation'},
31 | {loader: 'browserify', framework: 'foundation', preprocessor: 'less'},
32 | {loader: 'browserify', framework: 'foundation', preprocessor: 'sass', libsass: false},
33 | {loader: 'browserify', framework: 'foundation', preprocessor: 'sass', libsass: true},
34 | {loader: 'browserify', framework: 'foundation', preprocessor: 'stylus'},
35 |
36 | // jspm no framework
37 | {loader: 'jspm'},
38 | {loader: 'jspm', preprocessor: 'less'},
39 | {loader: 'jspm', preprocessor: 'sass', libsass: false},
40 | {loader: 'jspm', preprocessor: 'sass', libsass: true},
41 | {loader: 'jspm', preprocessor: 'stylus'},
42 | // jspm uikit
43 | {loader: 'jspm', framework: 'uikit'},
44 | {loader: 'jspm', framework: 'uikit', preprocessor: 'less'},
45 | {loader: 'jspm', framework: 'uikit', preprocessor: 'sass', libsass: false},
46 | {loader: 'jspm', framework: 'uikit', preprocessor: 'sass', libsass: true},
47 | {loader: 'jspm', framework: 'uikit', preprocessor: 'stylus'},
48 | // jspm bootstrap
49 | {loader: 'jspm', framework: 'bootstrap'},
50 | {loader: 'jspm', framework: 'bootstrap', preprocessor: 'less'},
51 | {loader: 'jspm', framework: 'bootstrap', preprocessor: 'sass', libsass: false},
52 | {loader: 'jspm', framework: 'bootstrap', preprocessor: 'sass', libsass: true},
53 | {loader: 'jspm', framework: 'bootstrap', preprocessor: 'stylus'},
54 | // jspm foundation
55 | {loader: 'jspm', framework: 'foundation'},
56 | {loader: 'jspm', framework: 'foundation', preprocessor: 'less'},
57 | {loader: 'jspm', framework: 'foundation', preprocessor: 'sass', libsass: false},
58 | {loader: 'jspm', framework: 'foundation', preprocessor: 'sass', libsass: true},
59 | {loader: 'jspm', framework: 'foundation', preprocessor: 'stylus'},
60 |
61 | // webpack no framework
62 | {loader: 'webpack'},
63 | {loader: 'webpack', preprocessor: 'less'},
64 | {loader: 'webpack', preprocessor: 'sass', libsass: false},
65 | {loader: 'webpack', preprocessor: 'sass', libsass: true},
66 | {loader: 'webpack', preprocessor: 'stylus'},
67 | // webpack uikit
68 | {loader: 'webpack', framework: 'uikit'},
69 | {loader: 'webpack', framework: 'uikit', preprocessor: 'less'},
70 | {loader: 'webpack', framework: 'uikit', preprocessor: 'sass', libsass: false},
71 | {loader: 'webpack', framework: 'uikit', preprocessor: 'sass', libsass: true},
72 | {loader: 'webpack', framework: 'uikit', preprocessor: 'stylus'},
73 | // webpack bootstrap
74 | {loader: 'webpack', framework: 'bootstrap'},
75 | {loader: 'webpack', framework: 'bootstrap', preprocessor: 'less'},
76 | {loader: 'webpack', framework: 'bootstrap', preprocessor: 'sass', libsass: false},
77 | {loader: 'webpack', framework: 'bootstrap', preprocessor: 'sass', libsass: true},
78 | {loader: 'webpack', framework: 'bootstrap', preprocessor: 'stylus'},
79 | // webpack foundation
80 | {loader: 'webpack', framework: 'foundation'},
81 | {loader: 'webpack', framework: 'foundation', preprocessor: 'less'},
82 | {loader: 'webpack', framework: 'foundation', preprocessor: 'sass', libsass: false},
83 | {loader: 'webpack', framework: 'foundation', preprocessor: 'sass', libsass: true},
84 | {loader: 'webpack', framework: 'foundation', preprocessor: 'stylus'},
85 |
86 | // requirejs no framework
87 | {loader: 'requirejs'},
88 | {loader: 'requirejs', preprocessor: 'less'},
89 | {loader: 'requirejs', preprocessor: 'sass', libsass: false},
90 | {loader: 'requirejs', preprocessor: 'sass', libsass: true},
91 | {loader: 'requirejs', preprocessor: 'stylus'},
92 | // requirejs uikit
93 | {loader: 'requirejs', framework: 'uikit'},
94 | {loader: 'requirejs', framework: 'uikit', preprocessor: 'less'},
95 | {loader: 'requirejs', framework: 'uikit', preprocessor: 'sass', libsass: false},
96 | {loader: 'requirejs', framework: 'uikit', preprocessor: 'sass', libsass: true},
97 | {loader: 'requirejs', framework: 'uikit', preprocessor: 'stylus'},
98 | // requirejs bootstrap
99 | {loader: 'requirejs', framework: 'bootstrap'},
100 | {loader: 'requirejs', framework: 'bootstrap', preprocessor: 'less'},
101 | {loader: 'requirejs', framework: 'bootstrap', preprocessor: 'sass', libsass: false},
102 | {loader: 'requirejs', framework: 'bootstrap', preprocessor: 'sass', libsass: true},
103 | {loader: 'requirejs', framework: 'bootstrap', preprocessor: 'stylus'},
104 | // requirejs foundation
105 | {loader: 'requirejs', framework: 'foundation'},
106 | {loader: 'requirejs', framework: 'foundation', preprocessor: 'less'},
107 | {loader: 'requirejs', framework: 'foundation', preprocessor: 'sass', libsass: false},
108 | {loader: 'requirejs', framework: 'foundation', preprocessor: 'sass', libsass: true},
109 | {loader: 'requirejs', framework: 'foundation', preprocessor: 'stylus'}
110 | ];
111 |
112 | var defaults = {
113 | // need to inject symfony 2.7 to tests as travis node does not support min php version for symfony 3.0
114 | symfonyStandard: false,
115 | symfonyCommit: '2.7',
116 | continue: true,
117 | framework: 'noframework',
118 | preprocessor: 'nopreprocessor',
119 | loader: 'requirejs',
120 | additional: []
121 | };
122 |
123 | tests.forEach(function (test) {
124 | it('test passed', function (done) {
125 | testPrompts(assign(clone(defaults), test), done);
126 | });
127 | });
128 | });
129 |
--------------------------------------------------------------------------------