Installer et lancer WebStorm
Créer un nouveau projet
Un nouveau projet Yeoman!
Installer Node.js si ce n’est pas déjà fait
Passez en ligne de commande et utiliser npm pour installer Yeoman
Identifier votre dossier d’installation Yo
Installer le générateur Angular
Étape 1) Utiliser Grunt et non Gulp
2) Utiliser Sass à votre convenance
3) Inclure Twitter Bootstrap
4) Utiliser la version Sass, si Sass a été installé
5) Sélectionner les modules Angular à installer
6) Mettre à jour votre fichier package.json
7) npm install & bower install pour tout télécharger
À vos marques, soyez prêts, codez!
Exécutez grunt serve et la magie s’opère
1 |
$ grunt serve |
Excutez grunt test
Vos tests sont aussi importants que votre code!
1 2 3 4 5 6 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 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
Running "clean:server" (clean) task 1 path cleaned. Running "wiredep:app" (wiredep) task Running "wiredep:test" (wiredep) task Running "concurrent:test" (concurrent) task Running "copy:styles" (copy) task Copied 3 files Done, without errors. Execution Time (2016-01-28 21:32:22 UTC) loading tasks 236ms █████████████████████████████ 83% loading grunt-contrib-copy 22ms ███ 8% copy:styles 24ms ███ 8% Total 283ms Running "postcss:server" (postcss) task 3 processed stylesheets created. Running "postcss:dist" (postcss) task 3 processed stylesheets created. Running "connect:test" (connect) task Started connect web server on http://localhost:9001 Running "karma:unit" (karma) task 28 01 2016 16:32:24.932:WARN [watcher]: Pattern "C:/Users/yo/WebstormProjects/PicsApp/test/mock/**/*.js" does not match any file. 28 01 2016 16:32:24.960:INFO [karma]: Karma v0.13.19 server started at http://localhost:8080/ 28 01 2016 16:32:24.966:INFO [launcher]: Starting browser PhantomJS 28 01 2016 16:32:25.696:INFO [PhantomJS 1.9.8 ]: Connected on socket /#j3_YQp1bGDkASnKYAAAA with id 17562969 PhantomJS 1.9.8 : Executed 0 of 9 SUCCESS (0 secs / 0 secs) PhantomJS 1.9.8 : Executed 1 of 9 SUCCESS (0 secs / 0.01 secs) PhantomJS 1.9.8 : Executed 2 of 9 SUCCESS (0 secs / 0.014 secs) PhantomJS 1.9.8 : Executed 3 of 9 SUCCESS (0 secs / 0.015 secs) PhantomJS 1.9.8 : Executed 4 of 9 SUCCESS (0 secs / 0.021 secs) PhantomJS 1.9.8 : Executed 5 of 9 SUCCESS (0 secs / 0.023 secs) PhantomJS 1.9.8 : Executed 6 of 9 SUCCESS (0 secs / 0.029 secs) PhantomJS 1.9.8 : Executed 7 of 9 SUCCESS (0 secs / 0.032 secs) PhantomJS 1.9.8 : Executed 8 of 9 SUCCESS (0 secs / 0.034 secs) PhantomJS 1.9.8 : Executed 9 of 9 SUCCESS (0 secs / 0.036 secs) PhantomJS 1.9.8 : Executed 9 of 9 SUCCESS (0.003 secs / 0.036 secs) Done, without errors. Execution Time (2016-01-28 21:32:21 UTC) loading tasks 225ms ██ 6% wiredep:app 223ms ██ 6% concurrent:test 788ms ███████ 20% loading grunt-postcss 70ms █ 2% postcss:server 142ms ██ 4% loading grunt-contrib-connect 124ms █ 3% connect:test 429ms ████ 11% loading grunt-karma 808ms ███████ 20% karma:unit 1.1s █████████ 27% Total 4s Process finished with exit code 0 |
Exécutez grunt default
1 |
$ grunt default |
1 2 3 4 5 6 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 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 |
Running "newer:jshint" (newer) task Running "newer:jshint:all" (newer) task Running "jshint:all" (jshint) task √ No problems Running "newer-postrun:jshint:all:1:C:\Users\yo\WebstormProjects\PicsApp\node_modules\grunt-newer\.cache" (newer-postrun) task Running "newer:jshint:test" (newer) task No newer files to process. Running "newer:jscs" (newer) task Running "newer:jscs:all" (newer) task Running "jscs:all" (jscs) task files without code style errors. Running "newer-postrun:jscs:all:2:C:\Users\yo\WebstormProjects\PicsApp\node_modules\grunt-newer\.cache" (newer-postrun) task Running "newer:jscs:test" (newer) task No newer files to process. Running "clean:server" (clean) task 1 path cleaned. Running "wiredep:app" (wiredep) task Running "wiredep:test" (wiredep) task Running "concurrent:test" (concurrent) task Running "copy:styles" (copy) task Copied 3 files Done, without errors. Execution Time (2016-01-28 21:21:04 UTC) loading tasks 224ms █████████████████████████████ 83% loading grunt-contrib-copy 22ms ███ 8% copy:styles 23ms ███ 9% Total 270ms Running "postcss:server" (postcss) task 3 processed stylesheets created. Running "postcss:dist" (postcss) task 3 processed stylesheets created. Running "connect:test" (connect) task Started connect web server on http://localhost:9001 Running "karma:unit" (karma) task 28 01 2016 16:21:06.337:WARN [watcher]: Pattern "C:/Users/yo/WebstormProjects/PicsApp/test/mock/**/*.js" does not match any file. 28 01 2016 16:21:06.364:INFO [karma]: Karma v0.13.19 server started at http://localhost:8080/ 28 01 2016 16:21:06.370:INFO [launcher]: Starting browser PhantomJS 28 01 2016 16:21:07.095:INFO [PhantomJS 1.9.8 (Windows 7 0.0.0)]: Connected on socket /#AjBHjZNckUtQRxu7AAAA with id 61599725 PhantomJS 1.9.8 (Windows 7 0.0.0): Executed 0 of 9 SUCCESS (0 secs / 0 secs) PhantomJS 1.9.8 (Windows 7 0.0.0): Executed 1 of 9 SUCCESS (0 secs / 0.008 secs) PhantomJS 1.9.8 (Windows 7 0.0.0): Executed 2 of 9 SUCCESS (0 secs / 0.011 secs) PhantomJS 1.9.8 (Windows 7 0.0.0): Executed 3 of 9 SUCCESS (0 secs / 0.012 secs) PhantomJS 1.9.8 (Windows 7 0.0.0): Executed 4 of 9 SUCCESS (0 secs / 0.018 secs) PhantomJS 1.9.8 (Windows 7 0.0.0): Executed 5 of 9 SUCCESS (0 secs / 0.021 secs) PhantomJS 1.9.8 (Windows 7 0.0.0): Executed 6 of 9 SUCCESS (0 secs / 0.026 secs) PhantomJS 1.9.8 (Windows 7 0.0.0): Executed 7 of 9 SUCCESS (0 secs / 0.028 secs) PhantomJS 1.9.8 (Windows 7 0.0.0): Executed 8 of 9 SUCCESS (0 secs / 0.03 secs) PhantomJS 1.9.8 (Windows 7 0.0.0): Executed 9 of 9 SUCCESS (0 secs / 0.032 secs) PhantomJS 1.9.8 (Windows 7 0.0.0): Executed 9 of 9 SUCCESS (0.003 secs / 0.032 secs) Running "clean:dist" (clean) task 19 paths cleaned. Running "wiredep:app" (wiredep) task Running "wiredep:test" (wiredep) task Running "useminPrepare:html" (useminPrepare) task Configuration changed for concat, uglify, cssmin Running "concurrent:dist" (concurrent) task Running "copy:styles" (copy) task Copied 3 files Done, without errors. Execution Time (2016-01-28 21:21:08 UTC) loading tasks 244ms ███████████████████████████ 78% loading grunt-contrib-copy 27ms ███ 9% copy:styles 39ms █████ 13% Total 311ms Running "svgmin:dist" (svgmin) task Total saved: 0 B Done, without errors. Execution Time (2016-01-28 21:21:08 UTC) loading tasks 244ms █████████████████ 42% loading grunt-svgmin 223ms ████████████████ 38% svgmin:dist 116ms ████████ 20% Total 584ms Running "imagemin:dist" (imagemin) task Minified 1 image (saved 5 kB) Done, without errors. Execution Time (2016-01-28 21:21:08 UTC) loading tasks 243ms ██████ 18% loading grunt-contrib-imagemin 878ms ████████████████████ 64% imagemin:dist 254ms ██████ 18% Total 1.4s Running "postcss:server" (postcss) task 3 processed stylesheets created. Running "postcss:dist" (postcss) task 3 processed stylesheets created. Running "ngtemplates:dist" (ngtemplates) task File .tmp/templateCache.js created. Added .tmp/templateCache.js to <!-- build:js scripts/scripts.js --> Running "concat:generated" (concat) task File .tmp\concat\scripts\vendor.js created. File .tmp\concat\scripts\scripts.js created. Running "ngAnnotate:dist" (ngAnnotate) task 2 files successfully generated. Running "copy:dist" (copy) task Copied 9 files Running "cdnify:dist" (cdnify) task Going through dist/404.html, dist/index.html to update script refs ✔ bower_components/jquery-ui/jquery-ui.js changed to //ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js ✔ bower_components/angular/angular.js changed to //ajax.googleapis.com/ajax/libs/angularjs/1.5.0-beta.1/angular.min.js ✔ bower_components/angular-animate/angular-animate.js changed to //ajax.googleapis.com/ajax/libs/angularjs/1.5.0-beta.1/angular-animate.min.js ✔ bower_components/jquery-ui/jquery-ui.js changed to //ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js ✔ bower_components/angular/angular.js changed to //ajax.googleapis.com/ajax/libs/angularjs/1.5.0-beta.1/angular.min.js ✔ bower_components/angular-animate/angular-animate.js changed to //ajax.googleapis.com/ajax/libs/angularjs/1.5.0-beta.1/angular-animate.min.js Running "cssmin:generated" (cssmin) task 2 files created. 296.27 kB → 157.04 kB Running "uglify:generated" (uglify) task 2 files created. Running "filerev:dist" (filerev) task Revved 5 files Running "usemin:html" (usemin) task Replaced 2 references to assets Running "usemin:css" (usemin) task Replaced 2 references to assets Running "usemin:js" (usemin) task Replaced 2 references to assets Running "htmlmin:dist" (htmlmin) task Minified 2 files Done, without errors. Execution Time (2016-01-28 21:21:02 UTC) loading tasks 227ms █ 1% loading grunt-jscs 211ms █ 1% jscs:all 299ms █ 1% concurrent:test 753ms ██ 4% connect:test 429ms █ 2% loading grunt-karma 799ms ██ 4% karma:unit 1s ██ 5% concurrent:dist 1.9s ████ 10% ngAnnotate:dist 867ms ██ 4% loading grunt-google-cdn 1.9s ████ 10% cdnify:dist 3.1s █████ 15% loading grunt-contrib-cssmin 242ms █ 1% cssmin:generated 1.4s ███ 7% uglify:generated 5.4s █████████ 26% Total 20.2s Process finished with exit code 0 |
Facebook Comments