├── .gitignore ├── .travis.yml ├── README.md ├── app ├── assets │ ├── fonts │ │ ├── MaterialIcons-Regular.ttf │ │ ├── MaterialIcons-Regular.woff │ │ └── MaterialIcons-Regular.woff2 │ ├── i18n │ │ └── en.json │ └── material-icons.css ├── index.html ├── jspm-config │ └── config.js └── src │ ├── about │ ├── about.html │ ├── about.scss │ ├── about.spec.ts │ └── about.ts │ ├── app.html │ ├── app.scss │ ├── app.spec.ts │ ├── app.ts │ ├── boot.ts │ └── home │ ├── home.html │ ├── home.scss │ ├── home.spec.ts │ └── home.ts ├── e2e ├── home.spec.ts └── pageobjects │ └── home.pageobject.ts ├── gulpfile.js ├── karma.conf.js ├── package.json ├── protractor.conf.js ├── tools ├── gulp │ ├── config.js │ ├── tasks │ │ ├── default.js │ │ ├── develolpment │ │ │ ├── browser-sync.js │ │ │ ├── build.js │ │ │ ├── copy.js │ │ │ ├── delete.js │ │ │ ├── html.js │ │ │ ├── karma.js │ │ │ ├── sass.js │ │ │ ├── templates.js │ │ │ ├── typescript.js │ │ │ └── watch.js │ │ ├── e2e │ │ │ ├── e2e-tests.js │ │ │ └── typescript.js │ │ └── production │ │ │ ├── config.js │ │ │ ├── copy.js │ │ │ ├── delete.js │ │ │ ├── deploy.js │ │ │ ├── html.js │ │ │ ├── karma.js │ │ │ ├── sass.js │ │ │ ├── scripts.js │ │ │ ├── templates.js │ │ │ └── typescript.js │ └── util │ │ ├── bundleLogger.js │ │ └── handleErrors.js ├── karma.conf.js ├── protractor.conf.js └── tslint.json ├── tsconfig.json └── tslint.json /.gitignore: -------------------------------------------------------------------------------- 1 | # Git 2 | *.rej 3 | *.orig 4 | 5 | # Maven 6 | target 7 | 8 | # IntelliJ 9 | *.iml 10 | *.ipr 11 | *.iws 12 | .idea 13 | 14 | #Node.js 15 | node 16 | node_modules 17 | npm-debug.log 18 | 19 | #Oxygen 20 | __MACOSX 21 | 22 | #OSX 23 | .DS_Store -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 5.2.0 4 | before_script: 5 | - npm install -g gulp 6 | - npm install -g jspm 7 | - npm install 8 | - jspm install 9 | - export DISPLAY=:99.0 10 | - sh -e /etc/init.d/xvfb start 11 | script: 12 | - gulp deploy 13 | env: 14 | global: 15 | secure: IJPOubCseuVMalPUnZQFDabbGGgech84T0UpDxUdgs8FxTfBLvXySvtZNsB1IU0IQv4Mo5aciv9LBblRXsU8bzysincpcWI/apKQSVTcbdNgWANyNukZuwoRmDgI6J5pz4SpAz5FXVDHSY15O64uUgqHPClbAQb1fG3TG5nyWCH2lBGlCrVOh/Y8djvwaYBQYIc0kKlZd+ERSsqah5/GcSB7vK00ifpqqHZwqpuzKLgmWuHwGGsWHfrK/LQmylrICh+Tim+PnrMl/vJ3NzCvU42nFtEjUwoS8eMK4njRSH5ym4ABnouRf3USP90Ay34fDjfTvsgSaNURDfWl3siAbbHg+2DwMb23nqP+R5PB4OGA6e0bEtJpYrKk84vv1pl9viBXiVOilpbCtAvehWQ3nC6y2AsclqzmBvz6zxgG6y8UN7LXEbI2OEgdgUTrcbrCNYAMYvwkMUFLbHOmrfy7M98iE6m4AwYMs56VQo82oHBrl2wVtyDWlOZLdZ8LBHIFdXPWP0e7UZg9v6iJ9Gd/XZXrpIS2HZNIqRKbCsGh4lv2TwUSvZsuVtoGed4KIFHeBm3TJoF9KPNcCuBvO6J8SJNNKpPLwrkX91mDIK5GeEL0S5y9dHVl+M6Yk4FYU/V+kZ4n7UqItBptjfDoINSbsC7i3ktbgEGZ14k93rYI9pw= 16 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Build Status](https://travis-ci.org/madhukard/angular2-jspm-seed.svg?branch=master)](https://travis-ci.org/madhukard/angular2-jspm-seed) 2 | [![devDependency Status](https://david-dm.org/madhukard/angular2-jspm-seed/dev-status.svg)](https://david-dm.org/madhukard/angular2-jspm-seed#info=devDependencies) 3 | 4 | Starter project for Angular 2 + material2 + TypeScript + JSPM + Gulp 5 | 6 | # Angular2 / material2 / TypeScript / JSPM / Gulp Starter Project 7 | 8 | A quick start template for web development with JSPM, Gulp, material2, TypeScript and Angular 2. 9 | 10 | Work in progress! 11 | 12 | ## Development Requirements 13 | 14 | |Dependency|OS X Installation| 15 | |:--|:--| 16 | |node.js|`brew install nodejs`| 17 | |gulp|`npm install -g gulp`| 18 | |jspm|`npm install -g jspm`| 19 | 20 | ## Development 21 | 22 | ### Installation 23 | 24 | ``` 25 | git clone https://github.com/madhukard/angular2-jspm-seed.git myapp 26 | cd myapp 27 | npm install 28 | jspm install 29 | gulp 30 | ``` 31 | 32 | ### Live Reload 33 | 34 | `gulp` 35 | 36 | ### Running test 37 | 38 | `gulp test` 39 | 40 | ### Running e2e integration tests 41 | 42 | `gulp e2e` 43 | 44 | ### Production build 45 | 46 | `gulp deploy` 47 | -------------------------------------------------------------------------------- /app/assets/fonts/MaterialIcons-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madhukard/angular2-jspm-seed/7db35edd5a962acca5901fac59e0ce6686e225c6/app/assets/fonts/MaterialIcons-Regular.ttf -------------------------------------------------------------------------------- /app/assets/fonts/MaterialIcons-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madhukard/angular2-jspm-seed/7db35edd5a962acca5901fac59e0ce6686e225c6/app/assets/fonts/MaterialIcons-Regular.woff -------------------------------------------------------------------------------- /app/assets/fonts/MaterialIcons-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madhukard/angular2-jspm-seed/7db35edd5a962acca5901fac59e0ce6686e225c6/app/assets/fonts/MaterialIcons-Regular.woff2 -------------------------------------------------------------------------------- /app/assets/i18n/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "Angular2 + ng2-material + JSPM" 3 | } -------------------------------------------------------------------------------- /app/assets/material-icons.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'Material Icons'; 3 | font-style: normal; 4 | font-weight: 400; 5 | src: local('Material Icons'), 6 | local('MaterialIcons-Regular'), 7 | url(fonts/MaterialIcons-Regular.woff2) format('woff2'), 8 | url(fonts/MaterialIcons-Regular.woff) format('woff'), 9 | url(fonts/MaterialIcons-Regular.ttf) format('truetype'); 10 | } 11 | 12 | .material-icons { 13 | font-family: 'Material Icons'; 14 | font-weight: normal; 15 | font-style: normal; 16 | font-size: 24px; /* Preferred icon size */ 17 | display: inline-block; 18 | width: 1em; 19 | height: 1em; 20 | line-height: 1; 21 | text-transform: none; 22 | letter-spacing: normal; 23 | word-wrap: normal; 24 | white-space: nowrap; 25 | direction: ltr; 26 | 27 | /* Support for all WebKit browsers. */ 28 | -webkit-font-smoothing: antialiased; 29 | /* Support for Safari and Chrome. */ 30 | text-rendering: optimizeLegibility; 31 | 32 | /* Support for Firefox. */ 33 | -moz-osx-font-smoothing: grayscale; 34 | 35 | /* Support for IE. */ 36 | font-feature-settings: 'liga'; 37 | } -------------------------------------------------------------------------------- /app/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Angular 2 JSPM Seed 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | Loading... 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /app/jspm-config/config.js: -------------------------------------------------------------------------------- 1 | System.config({ 2 | defaultJSExtensions: true, 3 | transpiler: "-", 4 | babelOptions: { 5 | "optional": [ 6 | "runtime", 7 | "optimisation.modules.system" 8 | ] 9 | }, 10 | paths: { 11 | "github:*": "target/development/jspm/github/*", 12 | "npm:*": "target/development/jspm/npm/*" 13 | }, 14 | 15 | packages: { 16 | "app": { 17 | "format": "register", 18 | "defaultExtension": "js" 19 | } 20 | }, 21 | 22 | map: { 23 | "-": "npm:babel-core@5.8.38", 24 | "--runtime": "npm:babel-runtime@5.8.38", 25 | "@angular/common": "npm:@angular/common@2.0.0-rc.1", 26 | "@angular/compiler": "npm:@angular/compiler@2.0.0-rc.1", 27 | "@angular/core": "npm:@angular/core@2.0.0-rc.1", 28 | "@angular/http": "npm:@angular/http@2.0.0-rc.1", 29 | "@angular/platform-browser": "npm:@angular/platform-browser@2.0.0-rc.1", 30 | "@angular/platform-browser-dynamic": "npm:@angular/platform-browser-dynamic@2.0.0-rc.1", 31 | "@angular/router": "npm:@angular/router@2.0.0-rc.1", 32 | "@angular/router-deprecated": "npm:@angular/router-deprecated@2.0.0-rc.1", 33 | "@angular2-material/button": "npm:@angular2-material/button@2.0.0-alpha.5", 34 | "@angular2-material/card": "npm:@angular2-material/card@2.0.0-alpha.5", 35 | "@angular2-material/checkbox": "npm:@angular2-material/checkbox@2.0.0-alpha.5", 36 | "@angular2-material/core": "npm:@angular2-material/core@2.0.0-alpha.5", 37 | "@angular2-material/input": "npm:@angular2-material/input@2.0.0-alpha.5", 38 | "@angular2-material/list": "npm:@angular2-material/list@2.0.0-alpha.5", 39 | "@angular2-material/progress-bar": "npm:@angular2-material/progress-bar@2.0.0-alpha.5", 40 | "@angular2-material/progress-circle": "npm:@angular2-material/progress-circle@2.0.0-alpha.5", 41 | "@angular2-material/radio": "npm:@angular2-material/radio@2.0.0-alpha.5", 42 | "@angular2-material/sidenav": "npm:@angular2-material/sidenav@2.0.0-alpha.5", 43 | "@angular2-material/toolbar": "npm:@angular2-material/toolbar@2.0.0-alpha.5", 44 | "clean-css": "npm:clean-css@3.4.13", 45 | "css": "github:systemjs/plugin-css@0.1.22", 46 | "es6-shim": "github:es-shims/es6-shim@0.35.1", 47 | "json": "github:systemjs/plugin-json@0.1.2", 48 | "ng2-translate": "npm:ng2-translate@2.1.0", 49 | "reflect-metadata": "npm:reflect-metadata@0.1.2", 50 | "rxjs": "npm:rxjs@5.0.0-beta.6", 51 | "scss": "github:theefer/plugin-sass@master", 52 | "text": "github:systemjs/plugin-text@0.0.2", 53 | "zone.js": "npm:zone.js@0.6.12", 54 | "github:jspm/nodelibs-assert@0.1.0": { 55 | "assert": "npm:assert@1.4.0" 56 | }, 57 | "github:jspm/nodelibs-buffer@0.1.0": { 58 | "buffer": "npm:buffer@3.6.0" 59 | }, 60 | "github:jspm/nodelibs-constants@0.1.0": { 61 | "constants-browserify": "npm:constants-browserify@0.0.1" 62 | }, 63 | "github:jspm/nodelibs-crypto@0.1.0": { 64 | "crypto-browserify": "npm:crypto-browserify@3.11.0" 65 | }, 66 | "github:jspm/nodelibs-events@0.1.1": { 67 | "events": "npm:events@1.0.2" 68 | }, 69 | "github:jspm/nodelibs-http@1.7.1": { 70 | "Base64": "npm:Base64@0.2.1", 71 | "events": "github:jspm/nodelibs-events@0.1.1", 72 | "inherits": "npm:inherits@2.0.1", 73 | "stream": "github:jspm/nodelibs-stream@0.1.0", 74 | "url": "github:jspm/nodelibs-url@0.1.0", 75 | "util": "github:jspm/nodelibs-util@0.1.0" 76 | }, 77 | "github:jspm/nodelibs-https@0.1.0": { 78 | "https-browserify": "npm:https-browserify@0.0.0" 79 | }, 80 | "github:jspm/nodelibs-os@0.1.0": { 81 | "os-browserify": "npm:os-browserify@0.1.2" 82 | }, 83 | "github:jspm/nodelibs-path@0.1.0": { 84 | "path-browserify": "npm:path-browserify@0.0.0" 85 | }, 86 | "github:jspm/nodelibs-process@0.1.2": { 87 | "process": "npm:process@0.11.3" 88 | }, 89 | "github:jspm/nodelibs-stream@0.1.0": { 90 | "stream-browserify": "npm:stream-browserify@1.0.0" 91 | }, 92 | "github:jspm/nodelibs-string_decoder@0.1.0": { 93 | "string_decoder": "npm:string_decoder@0.10.31" 94 | }, 95 | "github:jspm/nodelibs-url@0.1.0": { 96 | "url": "npm:url@0.10.3" 97 | }, 98 | "github:jspm/nodelibs-util@0.1.0": { 99 | "util": "npm:util@0.10.3" 100 | }, 101 | "github:jspm/nodelibs-vm@0.1.0": { 102 | "vm-browserify": "npm:vm-browserify@0.0.4" 103 | }, 104 | "github:theefer/plugin-sass@master": { 105 | "fs": "github:jspm/nodelibs-fs@0.1.2", 106 | "sass.js": "npm:sass.js@0.9.10" 107 | }, 108 | "npm:@angular/common@2.0.0-rc.1": { 109 | "@angular/core": "npm:@angular/core@2.0.0-rc.1", 110 | "process": "github:jspm/nodelibs-process@0.1.2" 111 | }, 112 | "npm:@angular/compiler@2.0.0-rc.1": { 113 | "@angular/core": "npm:@angular/core@2.0.0-rc.1", 114 | "process": "github:jspm/nodelibs-process@0.1.2" 115 | }, 116 | "npm:@angular/core@2.0.0-rc.1": { 117 | "process": "github:jspm/nodelibs-process@0.1.2", 118 | "rxjs": "npm:rxjs@5.0.0-beta.6", 119 | "zone.js": "npm:zone.js@0.6.12" 120 | }, 121 | "npm:@angular/http@2.0.0-rc.1": { 122 | "@angular/core": "npm:@angular/core@2.0.0-rc.1", 123 | "rxjs": "npm:rxjs@5.0.0-beta.6" 124 | }, 125 | "npm:@angular/platform-browser-dynamic@2.0.0-rc.1": { 126 | "@angular/common": "npm:@angular/common@2.0.0-rc.1", 127 | "@angular/compiler": "npm:@angular/compiler@2.0.0-rc.1", 128 | "@angular/core": "npm:@angular/core@2.0.0-rc.1", 129 | "@angular/platform-browser": "npm:@angular/platform-browser@2.0.0-rc.1", 130 | "process": "github:jspm/nodelibs-process@0.1.2" 131 | }, 132 | "npm:@angular/platform-browser@2.0.0-rc.1": { 133 | "@angular/common": "npm:@angular/common@2.0.0-rc.1", 134 | "@angular/compiler": "npm:@angular/compiler@2.0.0-rc.1", 135 | "@angular/core": "npm:@angular/core@2.0.0-rc.1", 136 | "process": "github:jspm/nodelibs-process@0.1.2" 137 | }, 138 | "npm:@angular/router-deprecated@2.0.0-rc.1": { 139 | "@angular/common": "npm:@angular/common@2.0.0-rc.1", 140 | "@angular/core": "npm:@angular/core@2.0.0-rc.1", 141 | "@angular/platform-browser": "npm:@angular/platform-browser@2.0.0-rc.1" 142 | }, 143 | "npm:@angular/router@2.0.0-rc.1": { 144 | "@angular/common": "npm:@angular/common@2.0.0-rc.1", 145 | "@angular/core": "npm:@angular/core@2.0.0-rc.1", 146 | "@angular/platform-browser": "npm:@angular/platform-browser@2.0.0-rc.1" 147 | }, 148 | "npm:@angular2-material/button@2.0.0-alpha.5": { 149 | "@angular2-material/core": "npm:@angular2-material/core@2.0.0-alpha.5" 150 | }, 151 | "npm:@angular2-material/card@2.0.0-alpha.5": { 152 | "@angular2-material/core": "npm:@angular2-material/core@2.0.0-alpha.5" 153 | }, 154 | "npm:@angular2-material/checkbox@2.0.0-alpha.5": { 155 | "@angular2-material/core": "npm:@angular2-material/core@2.0.0-alpha.5" 156 | }, 157 | "npm:@angular2-material/core@2.0.0-alpha.5": { 158 | "@angular/common": "npm:@angular/common@2.0.0-rc.1", 159 | "@angular/core": "npm:@angular/core@2.0.0-rc.1" 160 | }, 161 | "npm:@angular2-material/input@2.0.0-alpha.5": { 162 | "@angular2-material/core": "npm:@angular2-material/core@2.0.0-alpha.5" 163 | }, 164 | "npm:@angular2-material/list@2.0.0-alpha.5": { 165 | "@angular2-material/core": "npm:@angular2-material/core@2.0.0-alpha.5" 166 | }, 167 | "npm:@angular2-material/progress-bar@2.0.0-alpha.5": { 168 | "@angular2-material/core": "npm:@angular2-material/core@2.0.0-alpha.5", 169 | "buffer": "github:jspm/nodelibs-buffer@0.1.0" 170 | }, 171 | "npm:@angular2-material/progress-circle@2.0.0-alpha.5": { 172 | "@angular2-material/core": "npm:@angular2-material/core@2.0.0-alpha.5" 173 | }, 174 | "npm:@angular2-material/radio@2.0.0-alpha.5": { 175 | "@angular2-material/core": "npm:@angular2-material/core@2.0.0-alpha.5" 176 | }, 177 | "npm:@angular2-material/sidenav@2.0.0-alpha.5": { 178 | "@angular2-material/core": "npm:@angular2-material/core@2.0.0-alpha.5" 179 | }, 180 | "npm:@angular2-material/toolbar@2.0.0-alpha.5": { 181 | "@angular2-material/core": "npm:@angular2-material/core@2.0.0-alpha.5" 182 | }, 183 | "npm:amdefine@1.0.0": { 184 | "fs": "github:jspm/nodelibs-fs@0.1.2", 185 | "module": "github:jspm/nodelibs-module@0.1.0", 186 | "path": "github:jspm/nodelibs-path@0.1.0", 187 | "process": "github:jspm/nodelibs-process@0.1.2" 188 | }, 189 | "npm:asn1.js@4.6.0": { 190 | "assert": "github:jspm/nodelibs-assert@0.1.0", 191 | "bn.js": "npm:bn.js@4.11.3", 192 | "buffer": "github:jspm/nodelibs-buffer@0.1.0", 193 | "fs": "github:jspm/nodelibs-fs@0.1.2", 194 | "inherits": "npm:inherits@2.0.1", 195 | "minimalistic-assert": "npm:minimalistic-assert@1.0.0", 196 | "vm": "github:jspm/nodelibs-vm@0.1.0" 197 | }, 198 | "npm:assert@1.4.0": { 199 | "assert": "github:jspm/nodelibs-assert@0.1.0", 200 | "buffer": "github:jspm/nodelibs-buffer@0.1.0", 201 | "buffer-shims": "npm:buffer-shims@1.0.0", 202 | "process": "github:jspm/nodelibs-process@0.1.2", 203 | "util": "npm:util@0.10.3" 204 | }, 205 | "npm:babel-runtime@5.8.38": { 206 | "process": "github:jspm/nodelibs-process@0.1.2" 207 | }, 208 | "npm:bn.js@4.11.3": { 209 | "buffer": "github:jspm/nodelibs-buffer@0.1.0" 210 | }, 211 | "npm:browserify-aes@1.0.6": { 212 | "buffer": "github:jspm/nodelibs-buffer@0.1.0", 213 | "buffer-xor": "npm:buffer-xor@1.0.3", 214 | "cipher-base": "npm:cipher-base@1.0.2", 215 | "create-hash": "npm:create-hash@1.1.2", 216 | "crypto": "github:jspm/nodelibs-crypto@0.1.0", 217 | "evp_bytestokey": "npm:evp_bytestokey@1.0.0", 218 | "fs": "github:jspm/nodelibs-fs@0.1.2", 219 | "inherits": "npm:inherits@2.0.1", 220 | "systemjs-json": "github:systemjs/plugin-json@0.1.2" 221 | }, 222 | "npm:browserify-cipher@1.0.0": { 223 | "browserify-aes": "npm:browserify-aes@1.0.6", 224 | "browserify-des": "npm:browserify-des@1.0.0", 225 | "buffer": "github:jspm/nodelibs-buffer@0.1.0", 226 | "crypto": "github:jspm/nodelibs-crypto@0.1.0", 227 | "evp_bytestokey": "npm:evp_bytestokey@1.0.0" 228 | }, 229 | "npm:browserify-des@1.0.0": { 230 | "buffer": "github:jspm/nodelibs-buffer@0.1.0", 231 | "cipher-base": "npm:cipher-base@1.0.2", 232 | "crypto": "github:jspm/nodelibs-crypto@0.1.0", 233 | "des.js": "npm:des.js@1.0.0", 234 | "inherits": "npm:inherits@2.0.1" 235 | }, 236 | "npm:browserify-rsa@4.0.1": { 237 | "bn.js": "npm:bn.js@4.11.3", 238 | "buffer": "github:jspm/nodelibs-buffer@0.1.0", 239 | "constants": "github:jspm/nodelibs-constants@0.1.0", 240 | "crypto": "github:jspm/nodelibs-crypto@0.1.0", 241 | "randombytes": "npm:randombytes@2.0.3" 242 | }, 243 | "npm:browserify-sign@4.0.0": { 244 | "bn.js": "npm:bn.js@4.11.3", 245 | "browserify-rsa": "npm:browserify-rsa@4.0.1", 246 | "buffer": "github:jspm/nodelibs-buffer@0.1.0", 247 | "create-hash": "npm:create-hash@1.1.2", 248 | "create-hmac": "npm:create-hmac@1.1.4", 249 | "crypto": "github:jspm/nodelibs-crypto@0.1.0", 250 | "elliptic": "npm:elliptic@6.2.7", 251 | "inherits": "npm:inherits@2.0.1", 252 | "parse-asn1": "npm:parse-asn1@5.0.0", 253 | "stream": "github:jspm/nodelibs-stream@0.1.0" 254 | }, 255 | "npm:buffer-shims@1.0.0": { 256 | "buffer": "github:jspm/nodelibs-buffer@0.1.0" 257 | }, 258 | "npm:buffer-xor@1.0.3": { 259 | "buffer": "github:jspm/nodelibs-buffer@0.1.0", 260 | "systemjs-json": "github:systemjs/plugin-json@0.1.2" 261 | }, 262 | "npm:buffer@3.6.0": { 263 | "base64-js": "npm:base64-js@0.0.8", 264 | "child_process": "github:jspm/nodelibs-child_process@0.1.0", 265 | "fs": "github:jspm/nodelibs-fs@0.1.2", 266 | "ieee754": "npm:ieee754@1.1.6", 267 | "isarray": "npm:isarray@1.0.0", 268 | "process": "github:jspm/nodelibs-process@0.1.2" 269 | }, 270 | "npm:cipher-base@1.0.2": { 271 | "buffer": "github:jspm/nodelibs-buffer@0.1.0", 272 | "inherits": "npm:inherits@2.0.1", 273 | "stream": "github:jspm/nodelibs-stream@0.1.0", 274 | "string_decoder": "github:jspm/nodelibs-string_decoder@0.1.0" 275 | }, 276 | "npm:clean-css@3.4.13": { 277 | "buffer": "github:jspm/nodelibs-buffer@0.1.0", 278 | "commander": "npm:commander@2.8.1", 279 | "fs": "github:jspm/nodelibs-fs@0.1.2", 280 | "http": "github:jspm/nodelibs-http@1.7.1", 281 | "https": "github:jspm/nodelibs-https@0.1.0", 282 | "os": "github:jspm/nodelibs-os@0.1.0", 283 | "path": "github:jspm/nodelibs-path@0.1.0", 284 | "process": "github:jspm/nodelibs-process@0.1.2", 285 | "source-map": "npm:source-map@0.4.4", 286 | "url": "github:jspm/nodelibs-url@0.1.0", 287 | "util": "github:jspm/nodelibs-util@0.1.0" 288 | }, 289 | "npm:commander@2.8.1": { 290 | "child_process": "github:jspm/nodelibs-child_process@0.1.0", 291 | "events": "github:jspm/nodelibs-events@0.1.1", 292 | "fs": "github:jspm/nodelibs-fs@0.1.2", 293 | "graceful-readlink": "npm:graceful-readlink@1.0.1", 294 | "path": "github:jspm/nodelibs-path@0.1.0", 295 | "process": "github:jspm/nodelibs-process@0.1.2" 296 | }, 297 | "npm:constants-browserify@0.0.1": { 298 | "systemjs-json": "github:systemjs/plugin-json@0.1.2" 299 | }, 300 | "npm:core-util-is@1.0.2": { 301 | "buffer": "github:jspm/nodelibs-buffer@0.1.0" 302 | }, 303 | "npm:create-ecdh@4.0.0": { 304 | "bn.js": "npm:bn.js@4.11.3", 305 | "buffer": "github:jspm/nodelibs-buffer@0.1.0", 306 | "crypto": "github:jspm/nodelibs-crypto@0.1.0", 307 | "elliptic": "npm:elliptic@6.2.7" 308 | }, 309 | "npm:create-hash@1.1.2": { 310 | "buffer": "github:jspm/nodelibs-buffer@0.1.0", 311 | "cipher-base": "npm:cipher-base@1.0.2", 312 | "crypto": "github:jspm/nodelibs-crypto@0.1.0", 313 | "fs": "github:jspm/nodelibs-fs@0.1.2", 314 | "inherits": "npm:inherits@2.0.1", 315 | "ripemd160": "npm:ripemd160@1.0.1", 316 | "sha.js": "npm:sha.js@2.4.5" 317 | }, 318 | "npm:create-hmac@1.1.4": { 319 | "buffer": "github:jspm/nodelibs-buffer@0.1.0", 320 | "create-hash": "npm:create-hash@1.1.2", 321 | "crypto": "github:jspm/nodelibs-crypto@0.1.0", 322 | "inherits": "npm:inherits@2.0.1", 323 | "stream": "github:jspm/nodelibs-stream@0.1.0" 324 | }, 325 | "npm:crypto-browserify@3.11.0": { 326 | "browserify-cipher": "npm:browserify-cipher@1.0.0", 327 | "browserify-sign": "npm:browserify-sign@4.0.0", 328 | "create-ecdh": "npm:create-ecdh@4.0.0", 329 | "create-hash": "npm:create-hash@1.1.2", 330 | "create-hmac": "npm:create-hmac@1.1.4", 331 | "diffie-hellman": "npm:diffie-hellman@5.0.2", 332 | "inherits": "npm:inherits@2.0.1", 333 | "pbkdf2": "npm:pbkdf2@3.0.4", 334 | "public-encrypt": "npm:public-encrypt@4.0.0", 335 | "randombytes": "npm:randombytes@2.0.3" 336 | }, 337 | "npm:des.js@1.0.0": { 338 | "buffer": "github:jspm/nodelibs-buffer@0.1.0", 339 | "inherits": "npm:inherits@2.0.1", 340 | "minimalistic-assert": "npm:minimalistic-assert@1.0.0" 341 | }, 342 | "npm:diffie-hellman@5.0.2": { 343 | "bn.js": "npm:bn.js@4.11.3", 344 | "buffer": "github:jspm/nodelibs-buffer@0.1.0", 345 | "crypto": "github:jspm/nodelibs-crypto@0.1.0", 346 | "miller-rabin": "npm:miller-rabin@4.0.0", 347 | "randombytes": "npm:randombytes@2.0.3", 348 | "systemjs-json": "github:systemjs/plugin-json@0.1.2" 349 | }, 350 | "npm:elliptic@6.2.7": { 351 | "bn.js": "npm:bn.js@4.11.3", 352 | "brorand": "npm:brorand@1.0.5", 353 | "hash.js": "npm:hash.js@1.0.3", 354 | "inherits": "npm:inherits@2.0.1", 355 | "systemjs-json": "github:systemjs/plugin-json@0.1.2" 356 | }, 357 | "npm:evp_bytestokey@1.0.0": { 358 | "buffer": "github:jspm/nodelibs-buffer@0.1.0", 359 | "create-hash": "npm:create-hash@1.1.2", 360 | "crypto": "github:jspm/nodelibs-crypto@0.1.0" 361 | }, 362 | "npm:graceful-readlink@1.0.1": { 363 | "fs": "github:jspm/nodelibs-fs@0.1.2" 364 | }, 365 | "npm:hash.js@1.0.3": { 366 | "inherits": "npm:inherits@2.0.1" 367 | }, 368 | "npm:https-browserify@0.0.0": { 369 | "http": "github:jspm/nodelibs-http@1.7.1" 370 | }, 371 | "npm:inherits@2.0.1": { 372 | "util": "github:jspm/nodelibs-util@0.1.0" 373 | }, 374 | "npm:miller-rabin@4.0.0": { 375 | "bn.js": "npm:bn.js@4.11.3", 376 | "brorand": "npm:brorand@1.0.5" 377 | }, 378 | "npm:ng2-translate@2.1.0": { 379 | "@angular/common": "npm:@angular/common@2.0.0-rc.1", 380 | "@angular/compiler": "npm:@angular/compiler@2.0.0-rc.1", 381 | "@angular/core": "npm:@angular/core@2.0.0-rc.1", 382 | "@angular/http": "npm:@angular/http@2.0.0-rc.1", 383 | "path": "github:jspm/nodelibs-path@0.1.0", 384 | "process": "github:jspm/nodelibs-process@0.1.2", 385 | "systemjs-json": "github:systemjs/plugin-json@0.1.2" 386 | }, 387 | "npm:os-browserify@0.1.2": { 388 | "os": "github:jspm/nodelibs-os@0.1.0" 389 | }, 390 | "npm:parse-asn1@5.0.0": { 391 | "asn1.js": "npm:asn1.js@4.6.0", 392 | "browserify-aes": "npm:browserify-aes@1.0.6", 393 | "buffer": "github:jspm/nodelibs-buffer@0.1.0", 394 | "create-hash": "npm:create-hash@1.1.2", 395 | "evp_bytestokey": "npm:evp_bytestokey@1.0.0", 396 | "pbkdf2": "npm:pbkdf2@3.0.4", 397 | "systemjs-json": "github:systemjs/plugin-json@0.1.2" 398 | }, 399 | "npm:path-browserify@0.0.0": { 400 | "process": "github:jspm/nodelibs-process@0.1.2" 401 | }, 402 | "npm:pbkdf2@3.0.4": { 403 | "buffer": "github:jspm/nodelibs-buffer@0.1.0", 404 | "child_process": "github:jspm/nodelibs-child_process@0.1.0", 405 | "create-hmac": "npm:create-hmac@1.1.4", 406 | "crypto": "github:jspm/nodelibs-crypto@0.1.0", 407 | "path": "github:jspm/nodelibs-path@0.1.0", 408 | "process": "github:jspm/nodelibs-process@0.1.2", 409 | "systemjs-json": "github:systemjs/plugin-json@0.1.2" 410 | }, 411 | "npm:process@0.11.3": { 412 | "assert": "github:jspm/nodelibs-assert@0.1.0" 413 | }, 414 | "npm:public-encrypt@4.0.0": { 415 | "bn.js": "npm:bn.js@4.11.3", 416 | "browserify-rsa": "npm:browserify-rsa@4.0.1", 417 | "buffer": "github:jspm/nodelibs-buffer@0.1.0", 418 | "create-hash": "npm:create-hash@1.1.2", 419 | "crypto": "github:jspm/nodelibs-crypto@0.1.0", 420 | "parse-asn1": "npm:parse-asn1@5.0.0", 421 | "randombytes": "npm:randombytes@2.0.3" 422 | }, 423 | "npm:punycode@1.3.2": { 424 | "process": "github:jspm/nodelibs-process@0.1.2" 425 | }, 426 | "npm:randombytes@2.0.3": { 427 | "buffer": "github:jspm/nodelibs-buffer@0.1.0", 428 | "crypto": "github:jspm/nodelibs-crypto@0.1.0", 429 | "process": "github:jspm/nodelibs-process@0.1.2" 430 | }, 431 | "npm:readable-stream@1.1.14": { 432 | "buffer": "github:jspm/nodelibs-buffer@0.1.0", 433 | "core-util-is": "npm:core-util-is@1.0.2", 434 | "events": "github:jspm/nodelibs-events@0.1.1", 435 | "inherits": "npm:inherits@2.0.1", 436 | "isarray": "npm:isarray@0.0.1", 437 | "process": "github:jspm/nodelibs-process@0.1.2", 438 | "stream-browserify": "npm:stream-browserify@1.0.0", 439 | "string_decoder": "npm:string_decoder@0.10.31" 440 | }, 441 | "npm:reflect-metadata@0.1.2": { 442 | "assert": "github:jspm/nodelibs-assert@0.1.0", 443 | "process": "github:jspm/nodelibs-process@0.1.2" 444 | }, 445 | "npm:ripemd160@1.0.1": { 446 | "buffer": "github:jspm/nodelibs-buffer@0.1.0", 447 | "process": "github:jspm/nodelibs-process@0.1.2" 448 | }, 449 | "npm:rxjs@5.0.0-beta.6": { 450 | "buffer": "github:jspm/nodelibs-buffer@0.1.0", 451 | "process": "github:jspm/nodelibs-process@0.1.2" 452 | }, 453 | "npm:sass.js@0.9.10": { 454 | "buffer": "github:jspm/nodelibs-buffer@0.1.0", 455 | "crypto": "github:jspm/nodelibs-crypto@0.1.0", 456 | "fs": "github:jspm/nodelibs-fs@0.1.2", 457 | "path": "github:jspm/nodelibs-path@0.1.0", 458 | "process": "github:jspm/nodelibs-process@0.1.2" 459 | }, 460 | "npm:sha.js@2.4.5": { 461 | "buffer": "github:jspm/nodelibs-buffer@0.1.0", 462 | "fs": "github:jspm/nodelibs-fs@0.1.2", 463 | "inherits": "npm:inherits@2.0.1", 464 | "process": "github:jspm/nodelibs-process@0.1.2" 465 | }, 466 | "npm:source-map@0.4.4": { 467 | "amdefine": "npm:amdefine@1.0.0", 468 | "process": "github:jspm/nodelibs-process@0.1.2" 469 | }, 470 | "npm:stream-browserify@1.0.0": { 471 | "events": "github:jspm/nodelibs-events@0.1.1", 472 | "inherits": "npm:inherits@2.0.1", 473 | "readable-stream": "npm:readable-stream@1.1.14" 474 | }, 475 | "npm:string_decoder@0.10.31": { 476 | "buffer": "github:jspm/nodelibs-buffer@0.1.0" 477 | }, 478 | "npm:url@0.10.3": { 479 | "assert": "github:jspm/nodelibs-assert@0.1.0", 480 | "punycode": "npm:punycode@1.3.2", 481 | "querystring": "npm:querystring@0.2.0", 482 | "util": "github:jspm/nodelibs-util@0.1.0" 483 | }, 484 | "npm:util@0.10.3": { 485 | "inherits": "npm:inherits@2.0.1", 486 | "process": "github:jspm/nodelibs-process@0.1.2" 487 | }, 488 | "npm:vm-browserify@0.0.4": { 489 | "indexof": "npm:indexof@0.0.1" 490 | }, 491 | "npm:zone.js@0.6.12": { 492 | "buffer": "github:jspm/nodelibs-buffer@0.1.0", 493 | "process": "github:jspm/nodelibs-process@0.1.2" 494 | } 495 | } 496 | }); 497 | -------------------------------------------------------------------------------- /app/src/about/about.html: -------------------------------------------------------------------------------- 1 |

About Route

2 | -------------------------------------------------------------------------------- /app/src/about/about.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madhukard/angular2-jspm-seed/7db35edd5a962acca5901fac59e0ce6686e225c6/app/src/about/about.scss -------------------------------------------------------------------------------- /app/src/about/about.spec.ts: -------------------------------------------------------------------------------- 1 | import { 2 | it, 3 | describe, 4 | expect 5 | } from '@angular/core/testing'; 6 | import {About} from './about'; 7 | 8 | describe('AboutComponent component', () => { 9 | it('should be able to create and onClickMe method', () => { 10 | var aboutComponent = new About(); 11 | expect(aboutComponent).toBeDefined(); 12 | }); 13 | }); 14 | -------------------------------------------------------------------------------- /app/src/about/about.ts: -------------------------------------------------------------------------------- 1 | import {Component} from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'about', 5 | templateUrl: 'src/about/about.html', 6 | styleUrls: ['src/about/about.css'], 7 | directives: [] 8 | }) 9 | export class About { } 10 | -------------------------------------------------------------------------------- /app/src/app.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Home 5 | About 6 | 7 | 8 | 9 |
10 | 11 | menu 12 |
13 |

Angular 2 + Material2 + JSPM Seed

14 |
15 |
16 | 17 |
18 | 19 |
20 | 21 |
22 |
23 | -------------------------------------------------------------------------------- /app/src/app.scss: -------------------------------------------------------------------------------- 1 | .app-root { 2 | font-family: "Roboto"; 3 | position: absolute; 4 | top: 0; 5 | bottom: 0; 6 | left: 0; 7 | right: 0; 8 | 9 | // Helps fonts on OSX looks more consistent with other systems 10 | // Isn't currently in button styles due to performance concerns 11 | * { 12 | -webkit-font-smoothing: antialiased; 13 | -moz-osx-font-smoothing: grayscale; 14 | } 15 | 16 | md-sidenav { 17 | width: 15%; 18 | 19 | [md-button] { 20 | width: 100%; 21 | position: absolute; 22 | bottom: 0; 23 | margin-bottom: 24px; 24 | } 25 | } 26 | 27 | .demo-content { 28 | padding: 32px; 29 | } 30 | 31 | md-toolbar { 32 | md-icon { 33 | padding: 20px; 34 | cursor: pointer; 35 | } 36 | 37 | .demo-toolbar { 38 | display: flex; 39 | justify-content: space-between; 40 | width: 100%; 41 | } 42 | 43 | button { 44 | color: white; 45 | } 46 | } 47 | 48 | h1 { 49 | font-size: 20px; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /app/src/app.spec.ts: -------------------------------------------------------------------------------- 1 | import 'reflect-metadata'; 2 | import 'es6-shim'; 3 | import { 4 | it, 5 | describe, 6 | expect 7 | } from '@angular/core/testing'; 8 | import {AppComponent} from './app'; 9 | 10 | describe('AppComponent component', () => { 11 | it('should be able to create', () => { 12 | let routerMock = { 13 | subscribe: function() { 14 | } 15 | }; 16 | 17 | let translateMock = { 18 | useStaticFilesLoader: function() { 19 | 20 | }, 21 | use: function() { 22 | 23 | } 24 | }; 25 | // noinspection TypeScriptValidateTypes 26 | var appComponent = new AppComponent(routerMock, translateMock); 27 | expect(appComponent).toBeDefined(); 28 | }); 29 | }); 30 | -------------------------------------------------------------------------------- /app/src/app.ts: -------------------------------------------------------------------------------- 1 | import {Component} from '@angular/core'; 2 | import {Router, Route, RouteConfig, ROUTER_DIRECTIVES} from '@angular/router-deprecated'; 3 | 4 | // noinspection TypeScriptCheckImport 5 | import {MdButton} from '@angular2-material/button'; 6 | // noinspection TypeScriptCheckImport 7 | import {MD_SIDENAV_DIRECTIVES} from '@angular2-material/sidenav'; 8 | // noinspection TypeScriptCheckImport 9 | import {MD_LIST_DIRECTIVES} from '@angular2-material/list'; 10 | // noinspection TypeScriptCheckImport 11 | import {MdToolbar} from '@angular2-material/toolbar'; 12 | 13 | // noinspection TypeScriptCheckImport 14 | import {TranslateService, TranslatePipe} from 'ng2-translate/ng2-translate'; 15 | 16 | import {Home} from './home/home'; 17 | import {About} from './about/about'; 18 | 19 | @Component({ 20 | selector: 'my-app', 21 | providers: [], 22 | templateUrl: 'src/app.html', 23 | styleUrls: ['src/app.css'], 24 | directives: [ 25 | ROUTER_DIRECTIVES, 26 | MD_SIDENAV_DIRECTIVES, 27 | MD_LIST_DIRECTIVES, 28 | MdToolbar, 29 | MdButton 30 | ], 31 | pipes: [TranslatePipe] 32 | }) 33 | @RouteConfig([ 34 | new Route({ path: '/home', component: Home, name: 'Home', useAsDefault: true}), 35 | new Route({ path: '/about', component: About, name: 'About'}) 36 | ]) 37 | export class AppComponent { 38 | currentPathStr = ''; 39 | 40 | constructor(router: Router, translate: TranslateService) { 41 | this.currentPathStr = '/home'; 42 | router.subscribe((value) => this.currentPathStr = value); 43 | translate.use('en'); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /app/src/boot.ts: -------------------------------------------------------------------------------- 1 | import 'zone.js'; 2 | import 'reflect-metadata'; 3 | import {provide} from '@angular/core'; 4 | import {bootstrap} from '@angular/platform-browser-dynamic'; 5 | import {HTTP_PROVIDERS, Http} from '@angular/http'; 6 | import {ROUTER_PROVIDERS} from '@angular/router-deprecated'; 7 | import {AppComponent} from './app'; 8 | 9 | // noinspection TypeScriptCheckImport 10 | import {TranslateLoader, TranslateStaticLoader, TranslateService} from 'ng2-translate/ng2-translate'; 11 | 12 | // noinspection TypeScriptValidateTypes 13 | bootstrap(AppComponent, [ 14 | HTTP_PROVIDERS, 15 | ROUTER_PROVIDERS, 16 | provide(TranslateLoader, { 17 | useFactory: (http: Http) => new TranslateStaticLoader(http, 'assets/i18n', '.json'), 18 | deps: [Http] 19 | }), 20 | TranslateService 21 | ]).catch(err => console.error(err)); 22 | -------------------------------------------------------------------------------- /app/src/home/home.html: -------------------------------------------------------------------------------- 1 |

Home Route

2 | -------------------------------------------------------------------------------- /app/src/home/home.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/madhukard/angular2-jspm-seed/7db35edd5a962acca5901fac59e0ce6686e225c6/app/src/home/home.scss -------------------------------------------------------------------------------- /app/src/home/home.spec.ts: -------------------------------------------------------------------------------- 1 | import { 2 | it, 3 | describe, 4 | expect 5 | } from '@angular/core/testing'; 6 | import {Home} from './home'; 7 | 8 | describe('HomeComponent component', () => { 9 | it('should be able to create', () => { 10 | var homeComponent = new Home(); 11 | expect(homeComponent).toBeDefined(); 12 | }); 13 | }); 14 | -------------------------------------------------------------------------------- /app/src/home/home.ts: -------------------------------------------------------------------------------- 1 | import {Component} from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'home', 5 | templateUrl: 'src/home/home.html', 6 | styleUrls: ['src/home/home.css'], 7 | directives: [] 8 | }) 9 | export class Home { } 10 | -------------------------------------------------------------------------------- /e2e/home.spec.ts: -------------------------------------------------------------------------------- 1 | import {HomePageObject} from './pageobjects/home.pageobject'; 2 | 3 | describe('Home Page', () => { 4 | var home: HomePageObject = new HomePageObject(); 5 | 6 | beforeEach(function() { 7 | browser.get('/home'); 8 | }); 9 | 10 | it('should have table', function() { 11 | expect(home.tabs.isPresent()).toBeTruthy(); 12 | }); 13 | }); 14 | -------------------------------------------------------------------------------- /e2e/pageobjects/home.pageobject.ts: -------------------------------------------------------------------------------- 1 | export class HomePageObject { 2 | public tabs = element(by.tagName('md-tabs')); 3 | } 4 | -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | var requireDir = require('require-dir'); 2 | var gulp = require('gulp'); 3 | var FwdRef = require('undertaker-forward-reference'); 4 | 5 | gulp.registry(FwdRef()); 6 | requireDir('./tools/gulp/tasks', { recurse: true }); 7 | -------------------------------------------------------------------------------- /karma.conf.js: -------------------------------------------------------------------------------- 1 | /*globals module,process,require */ 2 | module.exports = function (config) { 3 | 'use strict'; 4 | config.set({ 5 | autoWatch: true, 6 | singleRun: false, 7 | 8 | frameworks: ['jspm', 'jasmine'], 9 | 10 | files: [ 11 | 'node_modules/babel-polyfill/dist/polyfill.js' 12 | ], 13 | 14 | jspm: { 15 | config: 'app/jspm-config/config.js', 16 | packages: "target/development/jspm/", 17 | loadFiles: [ 18 | 'target/development/src/**/*.spec.js' 19 | ], 20 | serveFiles: [ 21 | 'target/development/src/**/!(*spec).js' 22 | ] 23 | }, 24 | 25 | // - Chrome, ChromeCanary, Firefox, Opera, Safari (only Mac), PhantomJS, IE (only Windows) 26 | browsers: process.env.TRAVIS ? ['Firefox'] : ['Chrome'], 27 | 28 | reporters: ['dots', 'coverage'], 29 | 30 | preprocessors: {"target/development/src/**/!(*spec).js": "coverage"}, 31 | coverageReporter: { 32 | dir: 'target/coverageReport', 33 | 34 | reporters: [ 35 | {type: 'json'}, 36 | {type: 'lcov'} 37 | ] 38 | } 39 | 40 | }); 41 | 42 | }; 43 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular2-jspm-seed", 3 | "version": "0.0.1", 4 | "description": "Angular 2 seed app with Typescript, JSPM and Gulp", 5 | "license": "MIT", 6 | "repository": { 7 | "type": "git", 8 | "url": "https://github.com/madhukard/angular2-jspm-seed" 9 | }, 10 | "keywords": [ 11 | "Angular 2", 12 | "TypeScript", 13 | "JSPM", 14 | "Gulp", 15 | "Bootstrap" 16 | ], 17 | "dependencies": {}, 18 | "scripts": { 19 | "test": "gulp test" 20 | }, 21 | "devDependencies": { 22 | "@angular/common": "^2.0.0-rc.1", 23 | "@angular/compiler": "^2.0.0-rc.1", 24 | "@angular/core": "^2.0.0-rc.1", 25 | "@angular/http": "^2.0.0-rc.1", 26 | "@angular/platform-browser": "^2.0.0-rc.1", 27 | "@angular/platform-browser-dynamic": "^2.0.0-rc.1", 28 | "@angular/router": "^2.0.0-rc.1", 29 | "@angular/router-deprecated": "^2.0.0-rc.1", 30 | "babel-core": "^6.8.0", 31 | "babel-polyfill": "^6.8.0", 32 | "babel-preset-es2015-node5": "^1.2.0", 33 | "babel-preset-stage-3": "^6.5.0", 34 | "browser-sync": "^2.10.1", 35 | "browser-sync-spa": "^1.0.2", 36 | "del": "^2.2.0", 37 | "es6-promise": "^3.0.2", 38 | "es6-shim": "^0.35.0", 39 | "gulp": "github:gulpjs/gulp#4.0", 40 | "gulp-angular-templatecache": "^1.7.0", 41 | "gulp-cached": "^1.1.0", 42 | "gulp-css-globbing": "^0.1.8", 43 | "gulp-debug": "^2.1.2", 44 | "gulp-flatten": "^0.2.0", 45 | "gulp-inject": "~3.0.0", 46 | "gulp-insert": "^0.5.0", 47 | "gulp-ng-annotate": "^1.1.0", 48 | "gulp-notify": "^2.2.0", 49 | "gulp-postcss": "^6.1.0", 50 | "gulp-protractor": "^2.1.0", 51 | "gulp-remove-code": "^1.0.2", 52 | "gulp-rename": "~1.2.2", 53 | "gulp-replace": "~0.5.3", 54 | "gulp-sass": "^2.2.0", 55 | "gulp-shell": "^0.5.1", 56 | "gulp-sourcemaps": "^1.6.0", 57 | "gulp-tslint": "^4.2.2", 58 | "gulp-typescript": "^2.10.0", 59 | "gulp-uglify": "^1.5.1", 60 | "gulp-util": "~3.0.5", 61 | "gulp-wait": "0.0.2", 62 | "http-proxy-middleware": "^0.9.0", 63 | "isparta": "^4.0.0", 64 | "jspm": "^0.16.32", 65 | "jasmine": "2.3.2", 66 | "karma": "^0.13.22", 67 | "karma-chrome-launcher": "^0.2.1", 68 | "karma-cli": "^0.0.4", 69 | "karma-jasmine": "^0.3.6", 70 | "karma-babel-preprocessor": "^6.0.1", 71 | "karma-browserify": "^4.3.0", 72 | "karma-coverage": "^0.5.3", 73 | "karma-html-reporter": "^0.2.6", 74 | "karma-jspm": "^2.0.1", 75 | "karma-phantomjs-launcher": "^1.0.0", 76 | "karma-sourcemap-loader": "^0.3.5", 77 | "karma-spec-reporter": "0.0.23", 78 | "koa": "^2.0.0-alpha.5", 79 | "koa-bodyparser": "^2.0.1", 80 | "koa-convert": "^1.2.0", 81 | "koa-generic-session": "^1.10.1", 82 | "koa-passport": "^2.0.0", 83 | "koa-router": "^7.0.1", 84 | "node-sass": "3.7.0", 85 | "passport-local": "^1.0.0", 86 | "phantomjs-prebuilt": "^2.1.4", 87 | "postcss-reporter": "^1.3.3", 88 | "postcss-scss": "^0.1.5", 89 | "pretty-hrtime": "^1.0.0", 90 | "reflect-metadata": "0.1.2", 91 | "request": "^2.69.0", 92 | "require-dir": "^0.3.0", 93 | "rxjs": "^5.0.0-beta.6", 94 | "stylelint": "^4.4.0", 95 | "tslint": "^3.7.0-dev.2", 96 | "typescript": "^1.9.0-dev.20160409", 97 | "undertaker-forward-reference": "^1.0.1", 98 | "url": "^0.11.0", 99 | "vinyl-buffer": "^1.0.0", 100 | "vinyl-source-stream": "^1.1.0", 101 | "zone.js": "^0.6.12" 102 | }, 103 | "jspm": { 104 | "directories": { 105 | "packages": "target/development/jspm" 106 | }, 107 | "configFile": "app/jspm-config/config.js", 108 | "dependencies": { 109 | "@angular/common": "npm:@angular/common@^2.0.0-rc.1", 110 | "@angular/compiler": "npm:@angular/compiler@^2.0.0-rc.1", 111 | "@angular/core": "npm:@angular/core@^2.0.0-rc.1", 112 | "@angular/http": "npm:@angular/http@^2.0.0-rc.1", 113 | "@angular/platform-browser": "npm:@angular/platform-browser@^2.0.0-rc.1", 114 | "@angular/platform-browser-dynamic": "npm:@angular/platform-browser-dynamic@^2.0.0-rc.1", 115 | "@angular/router": "npm:@angular/router@^2.0.0-rc.1", 116 | "@angular/router-deprecated": "npm:@angular/router-deprecated@^2.0.0-rc.1", 117 | "@angular2-material/button": "npm:@angular2-material/button@2.0.0-alpha.5", 118 | "@angular2-material/card": "npm:@angular2-material/card@2.0.0-alpha.5", 119 | "@angular2-material/checkbox": "npm:@angular2-material/checkbox@2.0.0-alpha.5", 120 | "@angular2-material/core": "npm:@angular2-material/core@2.0.0-alpha.5", 121 | "@angular2-material/input": "npm:@angular2-material/input@2.0.0-alpha.5", 122 | "@angular2-material/list": "npm:@angular2-material/list@2.0.0-alpha.5", 123 | "@angular2-material/progress-bar": "npm:@angular2-material/progress-bar@2.0.0-alpha.5", 124 | "@angular2-material/progress-circle": "npm:@angular2-material/progress-circle@2.0.0-alpha.5", 125 | "@angular2-material/radio": "npm:@angular2-material/radio@2.0.0-alpha.5", 126 | "@angular2-material/sidenav": "npm:@angular2-material/sidenav@2.0.0-alpha.5", 127 | "@angular2-material/toolbar": "npm:@angular2-material/toolbar@2.0.0-alpha.5", 128 | "es6-shim": "github:es-shims/es6-shim@^0.35.0", 129 | "ng2-translate": "npm:ng2-translate@^2.1.0", 130 | "reflect-metadata": "npm:reflect-metadata@0.1.2", 131 | "rxjs": "npm:rxjs@5.0.0-beta.6", 132 | "zone.js": "npm:zone.js@0.6.12" 133 | }, 134 | "devDependencies": { 135 | "-": "npm:babel-core@^5.8.24", 136 | "--runtime": "npm:babel-runtime@^5.8.24", 137 | "clean-css": "npm:clean-css@^3.4.11", 138 | "css": "github:systemjs/plugin-css@^0.1.6", 139 | "json": "github:systemjs/plugin-json@^0.1.0", 140 | "scss": "github:theefer/plugin-sass@master", 141 | "text": "github:systemjs/plugin-text@^0.0.2" 142 | } 143 | } 144 | } 145 | -------------------------------------------------------------------------------- /protractor.conf.js: -------------------------------------------------------------------------------- 1 | exports.config = { 2 | baseUrl: 'http://localhost:3000', 3 | specs: ['target/e2e/**/*.spec.js'], 4 | directConnect: true, 5 | exclude: [], 6 | multiCapabilities: [{ 7 | browserName: 'chrome' 8 | }], 9 | allScriptsTimeout: 110000, 10 | getPageTimeout: 100000, 11 | framework: 'jasmine2', 12 | jasmineNodeOpts: { 13 | isVerbose: false, 14 | showColors: true, 15 | includeStackTrace: false, 16 | defaultTimeoutInterval: 400000 17 | }, 18 | 19 | /** 20 | * ng2 related configuration 21 | * 22 | * useAllAngular2AppRoots: tells Protractor to wait for any angular2 apps on the page instead of just the one matching 23 | * `rootEl` 24 | * 25 | */ 26 | useAllAngular2AppRoots: true 27 | }; -------------------------------------------------------------------------------- /tools/gulp/config.js: -------------------------------------------------------------------------------- 1 | var app = 'app'; 2 | var src = 'app/src'; 3 | var e2e = 'test/e2e'; 4 | var vendor = 'app/vendor'; 5 | var shared = '../ui-proto/shared'; 6 | var vendorSCSS = '../ui-proto/scss/materialize/materialize.scss'; 7 | var build = 'target'; 8 | var development = 'target/development'; 9 | var coverage = 'target/coverage'; 10 | var production = 'target/production'; 11 | var developmentAssets = 'target/development/assets'; 12 | 13 | 14 | module.exports = { 15 | browsersync: { 16 | development: { 17 | server: { 18 | baseDir: development 19 | }, 20 | port: 3000, 21 | files: [ 22 | development + '/**/*.js', 23 | developmentAssets + '/images/**' 24 | ] 25 | } 26 | }, 27 | delete: { 28 | development: ['target/development/**/*', '!target/development/jspm/**'], 29 | production: production, 30 | coverage: coverage 31 | }, 32 | copy: { 33 | development: { 34 | sharedAssets: shared + '/assets/**/*.*', 35 | assets: app + '/assets/**/*.*', 36 | js: app + '/**/*.js', 37 | vendorFiles: [], 38 | dest: development 39 | }, 40 | production: { 41 | sharedAssets: shared + '/assets/**/*.*', 42 | assets: app + '/assets/**/*.*', 43 | vendorFiles: ['node_modules/angular2/bundles/angular2-polyfills.min.js'], 44 | dest: production 45 | } 46 | }, 47 | watch: { 48 | html: [app + '/**/*.html', shared + '/**/*.html'], 49 | scripts: [app + '/src/**/*.ts', shared + '/src/**/*.ts'], 50 | sass: [src + '/**/*.scss', shared + '/src/**/*.scss'], 51 | assets: [app + '/assets/**/*.*', shared + '/assets/**/*.*'] 52 | }, 53 | app: app, 54 | production: production, 55 | shared: shared, 56 | typescript: { 57 | development: { 58 | scripts: [app + '/src/**/*.ts', shared + '/src/**/*.ts'], 59 | dest: development + '/src', 60 | coverage: build + '/coverage/src' 61 | }, 62 | production: { 63 | scripts: [app + '/src/**/*.ts', shared + '/src/**/*.ts'], 64 | dest: production + '/src' 65 | }, 66 | e2e: { 67 | scripts: e2e + '/**/*.ts', 68 | dest: build + '/e2e' 69 | } 70 | }, 71 | 72 | html: { 73 | development: { 74 | source: [app + '/**/*.html', shared + '/**/*.html'], 75 | dest: development, 76 | coverage: build + '/coverage/js' 77 | }, 78 | production: { 79 | source: [app + '/**/*.html', shared + '/**/*.html'], 80 | dest: production 81 | } 82 | }, 83 | 84 | sass: { 85 | development: { 86 | vendorSCSS: vendorSCSS, 87 | vendorSCSSDest: development + '/assets', 88 | source: [src + '/**/*.scss', shared + '/src/**/*.scss'], 89 | dest: development + '/src' 90 | }, 91 | production: { 92 | vendorSCSS: vendorSCSS, 93 | vendorSCSSDest: production + '/assets', 94 | source: [src + '/**/*.scss', shared + '/src/**/*.scss'], 95 | dest: production + '/src' 96 | } 97 | }, 98 | 99 | scripts: { 100 | production: { 101 | source: production + '/src/boot.js' , 102 | loginSource: production + '/src/login/loginboot.js' , 103 | dest: production 104 | } 105 | } 106 | 107 | }; 108 | -------------------------------------------------------------------------------- /tools/gulp/tasks/default.js: -------------------------------------------------------------------------------- 1 | var gulp = require('gulp'); 2 | 3 | gulp.task('default', gulp.series( 4 | 'build', 5 | gulp.parallel('browser-sync', 'watch', 'test') 6 | )); 7 | -------------------------------------------------------------------------------- /tools/gulp/tasks/develolpment/browser-sync.js: -------------------------------------------------------------------------------- 1 | var gulp = require('gulp'); 2 | var browserSync = require('browser-sync'); 3 | var spa = require("browser-sync-spa"); 4 | var config = require('../../config').browsersync.development; 5 | 6 | /** 7 | * Run the build task and start a server with BrowserSync 8 | */ 9 | gulp.task('browser-sync', function () { 10 | browserSync.use(spa({ 11 | selector: "[ng-app]", 12 | history: { 13 | index: '/index.html' 14 | } 15 | })); 16 | 17 | browserSync(config); 18 | }); 19 | -------------------------------------------------------------------------------- /tools/gulp/tasks/develolpment/build.js: -------------------------------------------------------------------------------- 1 | var gulp = require('gulp'); 2 | 3 | /** 4 | * Run all tasks needed for a build in defined order 5 | */ 6 | gulp.task('build', 7 | gulp.series( 8 | 'delete', 9 | 'copy-dev', 10 | 'html-dev', 11 | 'sass-lint', 12 | 'sass', 13 | 'typescript-dev' 14 | ) 15 | ); 16 | -------------------------------------------------------------------------------- /tools/gulp/tasks/develolpment/copy.js: -------------------------------------------------------------------------------- 1 | var gulp = require('gulp'); 2 | var replace = require('gulp-replace'); 3 | var conf = require('../../config').copy.development; 4 | 5 | /** 6 | * Copy assets, html, jspm config & index.html from app directory to development directory 7 | */ 8 | gulp.task('copy-dev', function () { 9 | gulp 10 | .src([conf.sharedAssets]) 11 | .pipe(gulp.dest(conf.dest + '/assets')); 12 | 13 | gulp 14 | .src([conf.assets]) 15 | .pipe(gulp.dest(conf.dest + '/assets')); 16 | 17 | /*gulp 18 | .src(conf.vendorFiles) 19 | .pipe(gulp.dest(conf.dest + '/vendor'));*/ 20 | 21 | return gulp 22 | .src([conf.js]) 23 | .pipe(replace('"github:*": "target/development/jspm/github/*"', '"github:*": "jspm/github/*"')) 24 | .pipe(replace('"npm:*": "target/development/jspm/npm/*"', '"npm:*": "jspm/npm/*"')) 25 | .pipe(gulp.dest(conf.dest)); 26 | }); 27 | -------------------------------------------------------------------------------- /tools/gulp/tasks/develolpment/delete.js: -------------------------------------------------------------------------------- 1 | var gulp = require('gulp'); 2 | var del = require('del'); 3 | var config = require('../../config'); 4 | /** 5 | * Delete folders and files 6 | */ 7 | gulp.task('delete', function () { 8 | return del(config.delete.development); 9 | }); 10 | -------------------------------------------------------------------------------- /tools/gulp/tasks/develolpment/html.js: -------------------------------------------------------------------------------- 1 | var gulp = require('gulp'); 2 | var flatten = require('gulp-flatten'); 3 | var config = require('../../config').html.development; 4 | var removeCode = require('gulp-remove-code'); 5 | var inject = require('gulp-inject'); 6 | var browserSync = require('browser-sync'); 7 | 8 | gulp.task('html-dev', function () { 9 | return gulp.src(config.source) 10 | .pipe(removeCode({development: true})) 11 | .pipe(gulp.dest(config.dest)) 12 | .pipe(browserSync.stream()); 13 | }); 14 | -------------------------------------------------------------------------------- /tools/gulp/tasks/develolpment/karma.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var path = require('path'); 4 | var gulp = require('gulp'); 5 | var Server = require('karma').Server; 6 | var config = require('../../config').watch; 7 | 8 | gulp.task('test', function (done) { 9 | new Server({ 10 | configFile: path.join(__dirname, '/../../../karma.conf.js') 11 | }, done).start(); 12 | }); 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /tools/gulp/tasks/develolpment/sass.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var gulp = require('gulp'); 4 | var sass = require('gulp-sass'); 5 | var browserSync = require('browser-sync'); 6 | var globbing = require('gulp-css-globbing'); 7 | var config = require('../../config').sass.development; 8 | 9 | var postcss = require('gulp-postcss'); 10 | var reporter = require('postcss-reporter'); 11 | var syntax_scss = require('postcss-scss'); 12 | var stylelint = require('stylelint'); 13 | var debug = require('gulp-debug'); 14 | 15 | gulp.task('sass', function () { 16 | return gulp.src(config.source) 17 | .pipe(debug()) 18 | .pipe(globbing({ 19 | extensions: ['.scss'] 20 | })) 21 | .pipe(debug()) 22 | .pipe(sass().on('error', sass.logError)) 23 | .pipe(gulp.dest(config.dest)) 24 | .pipe(debug()) 25 | .pipe(browserSync.stream()); 26 | }); 27 | 28 | 29 | gulp.task('sass-lint', function() { 30 | var styleLintConfig = { 31 | 'rules': { 32 | 'block-no-empty': true, 33 | 'color-no-invalid-hex': true, 34 | 'declaration-colon-space-after': 'always', 35 | 'declaration-colon-space-before': 'never', 36 | 'function-comma-space-after': 'always', 37 | 'function-url-quotes': 'double', 38 | 'media-feature-colon-space-after': 'always', 39 | 'media-feature-colon-space-before': 'never', 40 | 'media-feature-name-no-vendor-prefix': true, 41 | 'max-empty-lines': 5, 42 | 'number-leading-zero': 'never', 43 | 'number-no-trailing-zeros': true, 44 | 'property-no-vendor-prefix': true, 45 | 'declaration-block-no-duplicate-properties': true, 46 | 'block-no-single-line': true, 47 | 'declaration-block-trailing-semicolon': 'always', 48 | 'selector-list-comma-space-before': 'never', 49 | 'selector-list-comma-newline-after': 'always', 50 | 'selector-no-id': true, 51 | 'string-quotes': 'double', 52 | 'value-no-vendor-prefix': true 53 | } 54 | }; 55 | 56 | var processors = [ 57 | stylelint(styleLintConfig), 58 | reporter({ 59 | clearMessages: true, 60 | throwError: true 61 | }) 62 | ]; 63 | 64 | return gulp.src(config.source) 65 | .pipe(postcss(processors, {syntax: syntax_scss})); 66 | }); 67 | -------------------------------------------------------------------------------- /tools/gulp/tasks/develolpment/templates.js: -------------------------------------------------------------------------------- 1 | var gulp = require('gulp'); 2 | var templateCache = require('gulp-angular-templatecache'); 3 | var insert = require('gulp-insert'); 4 | var browserSync = require('browser-sync'); 5 | var conf = require('../../config').html.development; 6 | 7 | gulp.task('dev-templates', function () { 8 | return gulp.src(conf.source) 9 | .pipe(templateCache({root: '/src/', moduleSystem: 'Browserify', standalone: true})) 10 | //need to add an angular require to keep karma happy! 11 | .pipe(insert.prepend('var angular = require(\'angular\');')) 12 | .pipe(gulp.dest(conf.dest)) 13 | .pipe(browserSync.stream()); 14 | }); 15 | -------------------------------------------------------------------------------- /tools/gulp/tasks/develolpment/typescript.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var gulp = require('gulp'); 4 | var conf = require('../../config').typescript.development; 5 | var tsLintConf = require('../../../tslint.json'); 6 | var typescript = require('gulp-typescript'); 7 | var sourcemaps = require('gulp-sourcemaps'); 8 | var tslint = require('gulp-tslint'); 9 | var cache = require('gulp-cached'); 10 | var browserSync = require('browser-sync'); 11 | var tsProject = typescript.createProject({ 12 | "target": "es5", 13 | "module": "commonjs", 14 | "moduleResolution": "node", 15 | "sourceMap": true, 16 | "emitDecoratorMetadata": true, 17 | "experimentalDecorators": true, 18 | "removeComments": false, 19 | "noImplicitAny": true, 20 | "suppressImplicitAnyIndexErrors": true, 21 | "isolatedModules": true 22 | }); 23 | 24 | gulp.task('typescript-dev', function () { 25 | return gulp.src(conf.scripts) 26 | .pipe(cache('typescript')) 27 | .pipe(sourcemaps.init()) 28 | .pipe(tslint({ 29 | configuration: tsLintConf 30 | })) 31 | .pipe(tslint.report('prose', {emitError: false})) 32 | .pipe(typescript(tsProject)) 33 | //.pipe(sourcemaps.write('./maps', {includeContent: false, sourceRoot: '/app/src'})) 34 | .pipe(gulp.dest(conf.dest)) 35 | .pipe(browserSync.stream()); 36 | }); 37 | 38 | 39 | -------------------------------------------------------------------------------- /tools/gulp/tasks/develolpment/watch.js: -------------------------------------------------------------------------------- 1 | var gulp = require('gulp'); 2 | var config = require('../../config').watch; 3 | 4 | /** 5 | * Start browsersync task and then watch files for changes 6 | */ 7 | gulp.task('watch', function () { 8 | gulp.watch(config.sass, gulp.series('sass')); 9 | gulp.watch(config.scripts, gulp.series('typescript-dev')); 10 | gulp.watch(config.html, gulp.series('html-dev')); 11 | gulp.watch(config.assets, gulp.series('copy-dev')); 12 | }); 13 | -------------------------------------------------------------------------------- /tools/gulp/tasks/e2e/e2e-tests.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var gulp = require('gulp'); 4 | var protractor = require('gulp-protractor'); 5 | var conf = require('../../config'); 6 | var browserSync = require('browser-sync'); 7 | 8 | // Downloads the selenium webdriver 9 | gulp.task('webdriver-update', protractor.webdriver_update); 10 | 11 | gulp.task('webdriver-standalone', protractor.webdriver_standalone); 12 | 13 | gulp.task('runProtractor', function runProtractor(done) { 14 | var params = process.argv; 15 | var args = params.length > 3 ? [params[3], params[4]] : []; 16 | 17 | gulp.src(conf.app + '/e2e/**/*.e2e.js') 18 | .pipe(protractor.protractor({ 19 | configFile: './tools/protractor.conf.js', 20 | args: args 21 | })) 22 | .on('error', function (err) { 23 | // Make sure failed tests cause gulp to exit non-zero 24 | throw err; 25 | }) 26 | .on('end', function () { 27 | // Close browser sync server 28 | browserSync.exit(); 29 | done(); 30 | }); 31 | }); 32 | 33 | gulp.task('e2e', gulp.series('typescript-e2e', 'webdriver-update', 'runProtractor')); 34 | -------------------------------------------------------------------------------- /tools/gulp/tasks/e2e/typescript.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var gulp = require('gulp'); 4 | var conf = require('../../config').typescript.e2e; 5 | var tsLintConf = require('../../../tslint.json'); 6 | var typescript = require('gulp-typescript'); 7 | var sourcemaps = require('gulp-sourcemaps'); 8 | var tslint = require('gulp-tslint'); 9 | var cache = require('gulp-cached'); 10 | var browserSync = require('browser-sync'); 11 | var tsProject = typescript.createProject({ 12 | "target": "es5", 13 | "module": "commonjs", 14 | "moduleResolution": "node", 15 | "sourceMap": true, 16 | "emitDecoratorMetadata": true, 17 | "experimentalDecorators": true, 18 | "removeComments": false, 19 | "noImplicitAny": true, 20 | "suppressImplicitAnyIndexErrors": true, 21 | "isolatedModules": true 22 | }); 23 | 24 | gulp.task('typescript-e2e', function () { 25 | return gulp.src(conf.scripts) 26 | .pipe(cache('typescript')) 27 | .pipe(sourcemaps.init()) 28 | .pipe(tslint({ 29 | configuration: tsLintConf 30 | })) 31 | .pipe(tslint.report('prose', {emitError: false})) 32 | .pipe(typescript(tsProject)) 33 | //.pipe(sourcemaps.write('./maps', {includeContent: false, sourceRoot: '/app/src'})) 34 | .pipe(gulp.dest(conf.dest)) 35 | .pipe(browserSync.stream()); 36 | }); 37 | -------------------------------------------------------------------------------- /tools/gulp/tasks/production/config.js: -------------------------------------------------------------------------------- 1 | var gulp = require('gulp'); 2 | var path = require('../../config').typescript.production.dest; 3 | var configPath = path + '/common'; 4 | var rename = require('gulp-rename'); 5 | /** 6 | * Move production jspm-config into place 7 | */ 8 | 9 | gulp.task('production-jspm-config', function () { 10 | return gulp.src(configPath + '/jspm-config-production.js') 11 | .pipe(rename('config.js')) 12 | .pipe(gulp.dest(configPath)); 13 | }); 14 | -------------------------------------------------------------------------------- /tools/gulp/tasks/production/copy.js: -------------------------------------------------------------------------------- 1 | var gulp = require('gulp'); 2 | var replace = require('gulp-replace'); 3 | var conf = require('../../config').copy.production; 4 | 5 | /** 6 | * Copy assets & vendor files to production directory 7 | */ 8 | gulp.task('copy-deploy', function () { 9 | gulp 10 | .src([conf.sharedAssets]) 11 | .pipe(gulp.dest(conf.dest + '/assets')); 12 | 13 | return gulp 14 | .src([conf.assets]) 15 | .pipe(gulp.dest(conf.dest + '/assets')); 16 | 17 | /*return gulp 18 | .src(conf.vendorFiles) 19 | .pipe(gulp.dest(conf.dest + '/vendor'));*/ 20 | }); 21 | -------------------------------------------------------------------------------- /tools/gulp/tasks/production/delete.js: -------------------------------------------------------------------------------- 1 | var gulp = require('gulp'); 2 | var del = require('del'); 3 | var path = require('../../config').delete.production; 4 | var deploySrc = path + '/src/**/*.js'; 5 | /** 6 | * Delete folders and files 7 | */ 8 | gulp.task('delete-deploy', function () { 9 | return del(path); 10 | }); 11 | 12 | gulp.task('delete-deploy-src', function () { 13 | return del(deploySrc); 14 | }); 15 | -------------------------------------------------------------------------------- /tools/gulp/tasks/production/deploy.js: -------------------------------------------------------------------------------- 1 | var gulp = require('gulp'); 2 | gulp.task('deploy', gulp.series( 3 | 'delete-deploy', 4 | 'html-deploy', 5 | 'sass-deploy', 6 | 'typescript-deploy', 7 | 'test-deploy', 8 | 'copy-deploy', 9 | 'scripts-bundle', 10 | 'delete-deploy-src' 11 | )); 12 | -------------------------------------------------------------------------------- /tools/gulp/tasks/production/html.js: -------------------------------------------------------------------------------- 1 | var gulp = require('gulp'); 2 | var flatten = require('gulp-flatten'); 3 | var config = require('../../config').html.production; 4 | var removeCode = require('gulp-remove-code'); 5 | var inject = require('gulp-inject'); 6 | 7 | gulp.task('html-deploy', function () { 8 | return gulp.src(config.source) 9 | .pipe(removeCode({production: true})) 10 | .pipe(gulp.dest(config.dest)); 11 | 12 | }); 13 | -------------------------------------------------------------------------------- /tools/gulp/tasks/production/karma.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var path = require('path'); 4 | var gulp = require('gulp'); 5 | var glob = require("glob"); 6 | var Server = require('karma').Server; 7 | 8 | function runTests(done) { 9 | var specsToLoad = glob.sync("target/production/src/**/*.spec.js"); 10 | var filesToServe = glob.sync("target/production/src/**/*.@(js|html|css)"); 11 | 12 | new Server({ 13 | configFile: path.join(__dirname, '/../../../karma.conf.js'), 14 | singleRun: true, 15 | autoWatch: false, 16 | jspm: { 17 | config: 'app/jspm-config/config.js', 18 | packages: "target/development/jspm/", 19 | loadFiles: specsToLoad, 20 | serveFiles: filesToServe 21 | }, 22 | proxies: { 23 | "/src/": "/base/target/production/src/" 24 | }, 25 | reporters: ['dots', 'coverage'], 26 | preprocessors: {"target/production/src/**/!(*spec).js": "coverage"} 27 | }, function (code) { 28 | if (code == 1) { 29 | console.log('Unit Test failures, exiting process'); 30 | done('Unit Test Failures'); 31 | } else { 32 | console.log('Unit Tests passed'); 33 | done(); 34 | } 35 | }).start(); 36 | } 37 | 38 | gulp.task('test-deploy', function (done) { 39 | runTests(done); 40 | }); 41 | -------------------------------------------------------------------------------- /tools/gulp/tasks/production/sass.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var gulp = require('gulp'); 4 | var sass = require('gulp-sass'); 5 | var config = require('../../config').sass.production; 6 | var globbing = require('gulp-css-globbing'); 7 | var debug = require('gulp-debug'); 8 | 9 | gulp.task('sass-deploy', function () { 10 | return gulp.src(config.source) 11 | .pipe(globbing({ 12 | extensions: ['.scss'] 13 | })) 14 | .pipe(debug({ 15 | title: 'debug after globbing:' 16 | })) 17 | .pipe(sass({outputStyle: 'compressed'}).on('error', sass.logError)) 18 | .pipe(gulp.dest(config.dest)); 19 | }); 20 | -------------------------------------------------------------------------------- /tools/gulp/tasks/production/scripts.js: -------------------------------------------------------------------------------- 1 | var gulp = require('gulp'); 2 | var shell = require('gulp-shell'); 3 | var config = require('../../config').scripts.production; 4 | var jspm = require('jspm'); 5 | var source = require('vinyl-source-stream'); 6 | var vinylBuffer = require('vinyl-buffer'); 7 | var ngAnnotate = require('gulp-ng-annotate'); 8 | var sourcemaps = require('gulp-sourcemaps'); 9 | var uglify = require('gulp-uglify'); 10 | var rename = require('gulp-rename'); 11 | 12 | gulp.task('scripts-bundle', function () { 13 | return scriptsBundle(config.source, 'app.js'); 14 | }); 15 | 16 | var scriptsBundle = function(bundleSource, targetFileName) { 17 | var builder = new jspm.Builder(); 18 | 19 | builder.config({ 20 | paths: { 21 | "assets/material-icons.css": "target/production/assets/material-icons.css", 22 | "assets/app.css": "target/production/assets/app.css" 23 | }, 24 | rootURL: "target/production/" 25 | }); 26 | 27 | return new Promise(function(resolve, reject) { 28 | builder.buildStatic(bundleSource, bundleSource, { sourceMaps: true }) 29 | .then(function (output) { 30 | var stream = source(targetFileName); 31 | 32 | stream.write(output.source); 33 | process.nextTick(function () { 34 | stream.end(); 35 | }); 36 | 37 | return stream.pipe(vinylBuffer()) 38 | //.pipe(sourcemaps.init()) 39 | .pipe(ngAnnotate()) 40 | //.pipe(uglify()) 41 | //.pipe(rename({ suffix: '.min' })) 42 | //.pipe(sourcemaps.write()) 43 | .pipe(gulp.dest(config.dest)) 44 | .on('end', resolve) 45 | .on('error', reject); 46 | }, reject); 47 | }); 48 | }; 49 | -------------------------------------------------------------------------------- /tools/gulp/tasks/production/templates.js: -------------------------------------------------------------------------------- 1 | var gulp = require('gulp'); 2 | var templateCache = require('gulp-angular-templatecache'); 3 | var path = require('../../config'); 4 | var insert = require('gulp-insert'); 5 | 6 | gulp.task('deploy-templates', function () { 7 | return gulp.src(path.app + '/src/**/*.html') 8 | .pipe(templateCache({root: '/src/', moduleSystem: 'Browserify', standalone: true})) 9 | //need to add an angular require to keep karma happy! 10 | .pipe(insert.prepend('var angular = require(\'angular\');')) 11 | .pipe(gulp.dest(path.typescript.production.dest)); 12 | }); 13 | -------------------------------------------------------------------------------- /tools/gulp/tasks/production/typescript.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var gulp = require('gulp'); 4 | var conf = require('../../config').typescript.production; 5 | var tsLintConf = require('../../../tslint.json'); 6 | var typescript = require('gulp-typescript'); 7 | var sourcemaps = require('gulp-sourcemaps'); 8 | var tslint = require('gulp-tslint'); 9 | var tsProject = typescript.createProject({ 10 | "target": "es5", 11 | "module": "commonjs", 12 | "moduleResolution": "node", 13 | "sourceMap": true, 14 | "emitDecoratorMetadata": true, 15 | "experimentalDecorators": true, 16 | "removeComments": false, 17 | "noImplicitAny": true, 18 | "suppressImplicitAnyIndexErrors": true, 19 | "isolatedModules": true 20 | }); 21 | 22 | gulp.task('typescript-deploy', function () { 23 | return gulp.src(conf.scripts) 24 | .pipe(sourcemaps.init()) 25 | .pipe(tslint({ 26 | configuration: tsLintConf 27 | })) 28 | .pipe(tslint.report('prose', {emitError: false})) 29 | .pipe(typescript(tsProject)) 30 | .pipe(gulp.dest(conf.dest)) 31 | }); 32 | -------------------------------------------------------------------------------- /tools/gulp/util/bundleLogger.js: -------------------------------------------------------------------------------- 1 | /* bundleLogger 2 | ------------ 3 | Provides gulp style logs to the bundle method in browserify.js 4 | */ 5 | 6 | var gutil = require('gulp-util'); 7 | var prettyHrtime = require('pretty-hrtime'); 8 | var startTime; 9 | 10 | module.exports = { 11 | start: function (filepath) { 12 | startTime = process.hrtime(); 13 | gutil.log('Bundling', gutil.colors.green(filepath)); 14 | }, 15 | 16 | end: function (filepath) { 17 | var taskTime = process.hrtime(startTime); 18 | var prettyTime = prettyHrtime(taskTime); 19 | gutil.log('Bundled', gutil.colors.green(filepath), 'in', gutil.colors.magenta(prettyTime)); 20 | } 21 | }; 22 | -------------------------------------------------------------------------------- /tools/gulp/util/handleErrors.js: -------------------------------------------------------------------------------- 1 | var notify = require("gulp-notify"); 2 | 3 | module.exports = function () { 4 | 5 | var args = Array.prototype.slice.call(arguments); 6 | 7 | // Send error to notification center with gulp-notify 8 | notify.onError({ 9 | title: "Compile Error", 10 | message: "<%= error.message %>" 11 | }).apply(this, args); 12 | 13 | // Keep gulp from hanging on this task 14 | this.emit('end'); 15 | }; 16 | -------------------------------------------------------------------------------- /tools/karma.conf.js: -------------------------------------------------------------------------------- 1 | /* global module */ 2 | module.exports = function (config) { 3 | 'use strict'; 4 | 5 | var glob = require("glob"); 6 | var specsToLoad = glob.sync("target/development/src/**/*.spec.js"); 7 | var filesToServe = glob.sync("target/development/src/**/*.@(js|html|css)"); 8 | 9 | 10 | config.set({ 11 | basePath: '../', 12 | autoWatch: true, 13 | autoWatchBatchDelay: 2000, 14 | singleRun: false, 15 | 16 | frameworks: ['jspm', 'jasmine'], 17 | 18 | files: [ 19 | 'node_modules/es6-shim/es6-shim.js', 20 | 'node_modules/reflect-metadata/Reflect.js', 21 | 'node_modules/zone.js/dist/zone.js', 22 | 'node_modules/zone.js/dist/jasmine-patch.js', 23 | 'node_modules/zone.js/dist/async-test.js', 24 | 'node_modules/zone.js/dist/fake-async-test.js' 25 | ], 26 | 27 | jspm: { 28 | config: 'app/jspm-config/config.js', 29 | packages: "target/development/jspm/", 30 | loadFiles: specsToLoad, 31 | serveFiles: filesToServe 32 | }, 33 | 34 | // proxied base paths 35 | proxies: { 36 | "/src/": "/base/target/development/src/" 37 | }, 38 | 39 | // - Chrome, ChromeCanary, Firefox, Opera, Safari (only Mac), PhantomJS, IE (only Windows) 40 | browsers: ['PhantomJS'], 41 | 42 | reporters: ['dots', 'coverage'], 43 | 44 | preprocessors: { 45 | "target/development/src/**/!(*spec).js": "coverage" 46 | }, 47 | 48 | coverageReporter: { 49 | dir: 'target/coverageReport', 50 | reporters: [ 51 | { type: 'text-summary' }, 52 | { type: 'json' }, 53 | { type: 'lcov' } 54 | ] 55 | } 56 | 57 | }); 58 | 59 | }; 60 | -------------------------------------------------------------------------------- /tools/protractor.conf.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Configuration for running e2e tests with Protractor. 3 | */ 4 | exports.config = { 5 | framework: 'jasmine2', 6 | useAllAngular2AppRoots: true, 7 | 8 | baseUrl: 'http://localhost:3000/', 9 | 10 | suites: { 11 | security: [ 12 | '../target/e2e/security/login.e2e.js', 13 | '../target/e2e/security/my_account.e2e.js', 14 | '../target/e2e/security/organizations.e2e.js', 15 | '../target/e2e/security/users.e2e.js', 16 | '../target/e2e/security/data_collectors.e2e.js' 17 | ] 18 | }, 19 | 20 | // Specific options for jasmine. 21 | jasmineNodeOpts: { 22 | showColors: true, 23 | defaultTimeoutInterval: 60000 24 | }, 25 | 26 | onPrepare: function() { 27 | setTimeout(function() { 28 | browser.driver.executeScript(function() { 29 | return { 30 | width: window.screen.availWidth, 31 | height: window.screen.availHeight 32 | }; 33 | }).then(function(result) { 34 | browser.driver.manage().window().setSize(result.width - 40, result.height - 40); 35 | }); 36 | }); 37 | } 38 | }; -------------------------------------------------------------------------------- /tools/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | "max-line-length": [true, 120], 4 | "no-inferrable-types": true, 5 | "class-name": true, 6 | "comment-format": [ 7 | true, 8 | "check-space" 9 | ], 10 | "indent": [ 11 | true, 12 | "spaces" 13 | ], 14 | "eofline": true, 15 | "no-duplicate-variable": true, 16 | "no-eval": true, 17 | "no-arg": true, 18 | "no-internal-module": true, 19 | "no-trailing-whitespace": true, 20 | "no-bitwise": true, 21 | "no-shadowed-variable": true, 22 | "no-unused-expression": true, 23 | "no-unused-variable": [true, {"ignore-pattern": "^(_.*)$"}], 24 | "one-line": [ 25 | true, 26 | "check-catch", 27 | "check-else", 28 | "check-open-brace", 29 | "check-whitespace" 30 | ], 31 | "quotemark": [ 32 | true, 33 | "single", 34 | "avoid-escape" 35 | ], 36 | "semicolon": true, 37 | "typedef-whitespace": [ 38 | true, 39 | { 40 | "call-signature": "nospace", 41 | "index-signature": "nospace", 42 | "parameter": "nospace", 43 | "property-declaration": "nospace", 44 | "variable-declaration": "nospace" 45 | } 46 | ], 47 | "curly": true, 48 | "variable-name": [ 49 | true, 50 | "ban-keywords", 51 | "check-format", 52 | "allow-leading-underscore" 53 | ], 54 | "whitespace": [ 55 | true, 56 | "check-branch", 57 | "check-decl", 58 | "check-operator", 59 | "check-separator", 60 | "check-type" 61 | ] 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "moduleResolution": "node", 6 | "sourceMap": true, 7 | "emitDecoratorMetadata": true, 8 | "experimentalDecorators": true, 9 | "removeComments": false, 10 | "noImplicitAny": true, 11 | "suppressImplicitAnyIndexErrors": true, 12 | "isolatedModules": true 13 | }, 14 | "exclude": [ 15 | "node_modules" 16 | ] 17 | } -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | "no-inferrable-types": true, 4 | "class-name": true, 5 | "comment-format": [ 6 | true, 7 | "check-space" 8 | ], 9 | "indent": [ 10 | true, 11 | "spaces" 12 | ], 13 | "eofline": true, 14 | "no-duplicate-variable": true, 15 | "no-eval": true, 16 | "no-arg": true, 17 | "no-internal-module": true, 18 | "no-trailing-whitespace": true, 19 | "no-bitwise": true, 20 | "no-shadowed-variable": true, 21 | "one-line": [ 22 | true, 23 | "check-catch", 24 | "check-else", 25 | "check-open-brace", 26 | "check-whitespace" 27 | ], 28 | "quotemark": [ 29 | true, 30 | "single", 31 | "avoid-escape" 32 | ], 33 | "semicolon": true, 34 | "triple-equals": [ 35 | true, 36 | "allow-null-check" 37 | ], 38 | "typedef-whitespace": [ 39 | true, 40 | { 41 | "call-signature": "nospace", 42 | "index-signature": "nospace", 43 | "parameter": "nospace", 44 | "property-declaration": "nospace", 45 | "variable-declaration": "nospace" 46 | } 47 | ], 48 | "curly": true, 49 | "variable-name": [ 50 | true, 51 | "ban-keywords", 52 | "check-format", 53 | "allow-trailing-underscore" 54 | ], 55 | "whitespace": [ 56 | true, 57 | "check-branch", 58 | "check-decl", 59 | "check-operator", 60 | "check-separator", 61 | "check-type" 62 | ] 63 | } 64 | } 65 | --------------------------------------------------------------------------------