Merge branch '16-migrate-build-to-webpack' into 'develop'
Resolve "Migrate build to webpack" Closes #16 See merge request !11
This commit is contained in:
		
						commit
						c4f508705f
					
				
					 53 changed files with 330 additions and 301 deletions
				
			
		
							
								
								
									
										5
									
								
								.gitignore
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										5
									
								
								.gitignore
									
										
									
									
										vendored
									
									
								
							|  | @ -4,6 +4,7 @@ | |||
| atlassian-ide-plugin.xml | ||||
| node_modules/ | ||||
| typings/ | ||||
| app/**/*.js | ||||
| app/**/*.js.map | ||||
| src/**/*.js | ||||
| src/**/*.js.map | ||||
| npm-debug.log | ||||
| dist/ | ||||
|  |  | |||
|  | @ -2,56 +2,27 @@ stages: | |||
|   - build | ||||
|   - cleanup_build | ||||
|   - deploy | ||||
| #  - cleanup | ||||
| 
 | ||||
| .run_deploy: &run_deploy | ||||
|   script: | ||||
|     - chmod +x ./deploy.sh | ||||
|     - ./deploy.sh | ||||
| #  dependencies: | ||||
| #    - build_job | ||||
|   - cleanup | ||||
| 
 | ||||
| build_job: | ||||
|   stage: build | ||||
|   script: | ||||
|     - npm install | ||||
|     - npm run tsc | ||||
|     - npm run build | ||||
|   tags: | ||||
|     - javascript | ||||
|   except: | ||||
|     - tags | ||||
|   artifacts: | ||||
|     paths: | ||||
|       - app/*.css | ||||
|       - app/*.html | ||||
|       - app/*.js | ||||
|       - app/*.js.map | ||||
|       - app/converter/*.js | ||||
|       - app/converter/*.js.map | ||||
|       - node_modules/@angular/ | ||||
|       - node_modules/core-js/client/shim.js | ||||
|       - node_modules/zone.js/dist/zone.js | ||||
|       - node_modules/reflect-metadata/Reflect.js | ||||
|       - node_modules/rxjs/ | ||||
|       - node_modules/systemjs/dist/system.src.js | ||||
|       - node_modules/utf8/utf8.js | ||||
|       - node_modules/quoted-printable/quoted-printable.js | ||||
|       - node_modules/punycode/punycode.js | ||||
|       - abeezee-regular.woff | ||||
|       - freemono.eot | ||||
|       - freemono.svg | ||||
|       - freemono.ttf | ||||
|       - freemono.woff | ||||
|       - index.html | ||||
|       - package.json | ||||
|       - systemjs.config.js | ||||
|       - dist | ||||
|     expire_in: 30 min | ||||
| 
 | ||||
| cleanup_build_job: | ||||
|   stage: cleanup_build | ||||
|   script: | ||||
|     - rm -rf node_modules | ||||
|     - rm -rf typings | ||||
|     - rm -rf dist | ||||
|   when: on_failure | ||||
| 
 | ||||
| pages: | ||||
|  | @ -61,19 +32,7 @@ pages: | |||
|     - tags | ||||
|     - master | ||||
|   script: | ||||
|     - mkdir -p public/{app/converter,node_modules/{@angular,core-js/client,zone.js/dist,reflect-metadata,rxjs,systemjs/dist,utf8,quoted-printable,punycode}} | ||||
|     - cp -a index.html abeezee-regular.woff freemono.* package.json systemjs.config.js public/ | ||||
|     - cp -a app/*.css app/*.html app/*.js app/*.js.map public/app/ | ||||
|     - cp -a app/converter/*.js app/converter/*.js.map public/app/converter/ | ||||
|     - cp -a node_modules/@angular/* public/node_modules/@angular/ | ||||
|     - cp -a node_modules/core-js/client/shim.js public/node_modules/core-js/client/ | ||||
|     - cp -a node_modules/zone.js/dist/zone.js public/node_modules/zone.js/dist/ | ||||
|     - cp -a node_modules/reflect-metadata/Reflect.js public/node_modules/reflect-metadata/ | ||||
|     - cp -a node_modules/rxjs/* public/node_modules/rxjs/ | ||||
|     - cp -a node_modules/systemjs/dist/system.src.js public/node_modules/systemjs/dist/ | ||||
|     - cp -a node_modules/utf8/utf8.js public/node_modules/utf8/ | ||||
|     - cp -a node_modules/quoted-printable/quoted-printable.js public/node_modules/quoted-printable/ | ||||
|     - cp -a node_modules/punycode/punycode.js public/node_modules/punycode/ | ||||
|     - mv dist public | ||||
|   artifacts: | ||||
|     paths: | ||||
|       - public | ||||
|  | @ -82,17 +41,16 @@ pages: | |||
| 
 | ||||
| production: | ||||
|   stage: deploy | ||||
|   <<: *run_deploy | ||||
|   environment: production | ||||
|   only: | ||||
|     - master | ||||
|   variables: | ||||
|     ENVIRON: production | ||||
|     TARGET: $WWW_DEPLOY_ROOT_PRODUCTION | ||||
|   script: | ||||
|     - if [[ -z "${WWW_DEPLOY_ROOT_PRODUCTION}" ]] ; then echo "WWW_DEPLOY_ROOT_PRODUCTION is not set" ; exit 1 ; fi | ||||
|     - if [[ ! -d "${WWW_DEPLOY_ROOT_PRODUCTION}" ]] ; then mkdir -p "${WWW_DEPLOY_ROOT_PRODUCTION}" || die "Failed to create target directory for deployment!" ; fi | ||||
|     - cp dist/* "${WWW_DEPLOY_ROOT_PRODUCTION}" | ||||
| 
 | ||||
| #cleanup_job: | ||||
| #  stage: cleanup | ||||
| #  script: | ||||
| #    - rm -rf node_modules | ||||
| #    - rm -rf typings | ||||
| #  when: always | ||||
| cleanup_job: | ||||
|   stage: cleanup | ||||
|   script: | ||||
|     - rm -rf node_modules | ||||
|   when: always | ||||
|  |  | |||
|  | @ -1,18 +0,0 @@ | |||
| import {Injectable} from "@angular/core"; | ||||
| 
 | ||||
| declare var utf8:any; | ||||
| declare var quotedPrintable:any; | ||||
| declare var punycode:any; | ||||
| 
 | ||||
| @Injectable() | ||||
| export class NativeLibraryWrapperService { | ||||
|     public utf8:any; | ||||
|     public quotedPrintable:any; | ||||
|     public punycode:any; | ||||
| 
 | ||||
|     constructor() { | ||||
|         this.utf8 = utf8; | ||||
|         this.quotedPrintable = quotedPrintable; | ||||
|         this.punycode = punycode; | ||||
|     } | ||||
| } | ||||
							
								
								
									
										7
									
								
								config/helpers.js
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								config/helpers.js
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,7 @@ | |||
| var path = require('path'); | ||||
| var _root = path.resolve(__dirname, '..'); | ||||
| function root(args) { | ||||
|     args = Array.prototype.slice.call(arguments, 0); | ||||
|     return path.join.apply(path, [_root].concat(args)); | ||||
| } | ||||
| exports.root = root; | ||||
							
								
								
									
										76
									
								
								config/webpack.common.js
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										76
									
								
								config/webpack.common.js
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,76 @@ | |||
| var webpack = require('webpack'); | ||||
| var HtmlWebpackPlugin = require('html-webpack-plugin'); | ||||
| var ExtractTextPlugin = require('extract-text-webpack-plugin'); | ||||
| var helpers = require('./helpers'); | ||||
| 
 | ||||
| module.exports = { | ||||
|     entry: { | ||||
|         'polyfills': './src/polyfills.ts', | ||||
|         'vendor': './src/vendor.ts', | ||||
|         'app': './src/main.ts' | ||||
|     }, | ||||
| 
 | ||||
|     resolve: { | ||||
|         extensions: ['.ts', '.js'] | ||||
|     }, | ||||
| 
 | ||||
|     module: { | ||||
|         rules: [ | ||||
|             { | ||||
|                 test: /\.ts$/, | ||||
|                 loaders: [ | ||||
|                     { | ||||
|                         loader: 'awesome-typescript-loader', | ||||
|                         options: { | ||||
|                             configFileName: helpers.root('src', 'tsconfig.json') | ||||
|                         } | ||||
|                     }, | ||||
|                     'angular2-template-loader' | ||||
|                 ] | ||||
|             }, | ||||
|             { | ||||
|                 test: /\.html$/, | ||||
|                 use: 'html-loader' | ||||
|             }, | ||||
|             { | ||||
|                 test: /\.(png|jpe?g|gif|svg|woff|woff2|ttf|eot|ico)$/, | ||||
|                 use: 'file-loader?name=assets/[name].[hash].[ext]' | ||||
|             }, | ||||
|             { | ||||
|                 test: /\.css$/, | ||||
|                 exclude: helpers.root('src', 'app'), | ||||
|                 use: ExtractTextPlugin.extract({ | ||||
|                     fallback: 'style-loader', | ||||
|                     use: 'css-loader?sourceMap' | ||||
|                 }) | ||||
|             }, | ||||
|             { | ||||
|                 test: /\.css$/, | ||||
|                 include: helpers.root('src', 'app'), | ||||
|                 use: 'raw-loader' | ||||
|             } | ||||
|         ] | ||||
|     }, | ||||
| 
 | ||||
|     plugins: [ | ||||
|         // Workaround for angular/angular#11580
 | ||||
|         new webpack.ContextReplacementPlugin( | ||||
|             // The (\\|\/) piece accounts for path separators in *nix and Windows
 | ||||
|             /angular(\\|\/)core(\\|\/)(esm(\\|\/)src|src)(\\|\/)linker/, | ||||
|             helpers.root('./src'), // location of your src
 | ||||
|             {} // a map of your routes
 | ||||
|         ), | ||||
| 
 | ||||
|         new webpack.optimize.CommonsChunkPlugin({ | ||||
|             name: ['app', 'vendor', 'polyfills'] | ||||
|         }), | ||||
| 
 | ||||
|         new HtmlWebpackPlugin({ | ||||
|             template: 'src/index.html' | ||||
|         }), | ||||
| 
 | ||||
|         new webpack.optimize.UglifyJsPlugin({ | ||||
|             comments: false | ||||
|         }) | ||||
|     ] | ||||
| }; | ||||
							
								
								
									
										24
									
								
								config/webpack.dev.js
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								config/webpack.dev.js
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,24 @@ | |||
| var webpackMerge = require('webpack-merge'); | ||||
| var ExtractTextPlugin = require('extract-text-webpack-plugin'); | ||||
| var commonConfig = require('./webpack.common.js'); | ||||
| var helpers = require('./helpers'); | ||||
| 
 | ||||
| module.exports = webpackMerge(commonConfig, { | ||||
|     devtool: 'cheap-module-eval-source-map', | ||||
| 
 | ||||
|     output: { | ||||
|         path: helpers.root('dist'), | ||||
|         publicPath: 'http://localhost:8080/', | ||||
|         filename: '[name].js', | ||||
|         chunkFilename: '[id].chunk.js' | ||||
|     }, | ||||
| 
 | ||||
|     plugins: [ | ||||
|         new ExtractTextPlugin('[name].css') | ||||
|     ], | ||||
| 
 | ||||
|     devServer: { | ||||
|         historyApiFallback: true, | ||||
|         stats: 'minimal' | ||||
|     } | ||||
| }); | ||||
							
								
								
									
										38
									
								
								config/webpack.prod.js
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								config/webpack.prod.js
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,38 @@ | |||
| var webpack = require('webpack'); | ||||
| var webpackMerge = require('webpack-merge'); | ||||
| var ExtractTextPlugin = require('extract-text-webpack-plugin'); | ||||
| var commonConfig = require('./webpack.common.js'); | ||||
| var helpers = require('./helpers'); | ||||
| 
 | ||||
| const ENV = process.env.NODE_ENV = process.env.ENV = 'production'; | ||||
| 
 | ||||
| module.exports = webpackMerge(commonConfig, { | ||||
|     devtool: 'source-map', | ||||
| 
 | ||||
|     output: { | ||||
|         path: helpers.root('dist'), | ||||
|         publicPath: '', | ||||
|         filename: '[name].[hash].js', | ||||
|         chunkFilename: '[id].[hash].chunk.js' | ||||
|     }, | ||||
| 
 | ||||
|     plugins: [ | ||||
|         new webpack.NoEmitOnErrorsPlugin(), | ||||
|         new webpack.optimize.UglifyJsPlugin({ // https://github.com/angular/angular/issues/10618
 | ||||
|             mangle: { | ||||
|                 keep_fnames: true | ||||
|             } | ||||
|         }), | ||||
|         new ExtractTextPlugin('[name].[hash].css'), | ||||
|         new webpack.DefinePlugin({ | ||||
|             'process.env': { | ||||
|                 'ENV': JSON.stringify(ENV) | ||||
|             } | ||||
|         }), | ||||
|         new webpack.LoaderOptionsPlugin({ | ||||
|             htmlLoader: { | ||||
|                 minimize: false // workaround for ng2
 | ||||
|             } | ||||
|         }) | ||||
|     ] | ||||
| }); | ||||
							
								
								
									
										61
									
								
								deploy.sh
									
										
									
									
									
								
							
							
						
						
									
										61
									
								
								deploy.sh
									
										
									
									
									
								
							|  | @ -1,61 +0,0 @@ | |||
| #!/bin/sh | ||||
| 
 | ||||
| function die() { | ||||
|     echo $* | ||||
|     exit 1 | ||||
| } | ||||
| 
 | ||||
| declare destination | ||||
| case "${TARGET}" in | ||||
| 	"${WWW_DEPLOY_ROOT_DEVELOP}") | ||||
| 		destination="${TARGET}/${CI_BUILD_REF_NAME}" | ||||
| 		;; | ||||
| 	"${WWW_DEPLOY_ROOT_STAGING}"|"${WWW_DEPLOY_ROOT_PRODUCTION}") | ||||
| 		destination="${TARGET}" | ||||
| 		;; | ||||
| 	*) | ||||
| 		die "Invalid TARGET specified. Aborting deployment." | ||||
| 		;; | ||||
| esac | ||||
| 
 | ||||
| if [[ ! -d "${destination}" ]] ; then | ||||
|     mkdir -p "${destination}" || die "Failed to create target directory for deployment!" | ||||
| fi | ||||
| 
 | ||||
| rm -rf "${destination}"/* || die "Failed to clean destination directory (step 1)" | ||||
| rm -rf "${destination}"/.??* || die "Failed to clean destination directory (step 2)" | ||||
| 
 | ||||
| cp -a index.html abeezee-regular.woff freemono.* package.json systemjs.config.js "${destination}" || die "Failed to copy resources to dest/" | ||||
| 
 | ||||
| mkdir -p "${destination}/app/converter" || die "Failed to create dest/app/converter directory" | ||||
| cp -a app/*.css app/*.html app/*.js app/*.js.map "${destination}/app" || die "Failed to copy resources to dest/app" | ||||
| cp -a app/converter/*.js app/converter/*.js.map "${destination}/app/converter" || die "Failed to copy resources to dest/app/converter" | ||||
| 
 | ||||
| mkdir -p "${destination}/node_modules/@angular" || die "Failed to create dest/node_modules/@angular" | ||||
| cp -a node_modules/@angular/* "${destination}/node_modules/@angular/" || die "Failed to copy @angular" | ||||
| 
 | ||||
| mkdir -p "${destination}/node_modules/core-js/client" || die "Failed to create dest/node_modules/core-js" | ||||
| cp -a node_modules/core-js/client/shim.js "${destination}/node_modules/core-js/client/" || die "Failed to copy core-js" | ||||
| 
 | ||||
| mkdir -p "${destination}/node_modules/zone.js/dist" || die "Failed to create dest/node_modules/zone.js" | ||||
| cp -a node_modules/zone.js/dist/zone.js "${destination}/node_modules/zone.js/dist/" || die "Failed to copy zone.js" | ||||
| 
 | ||||
| mkdir -p "${destination}/node_modules/reflect-metadata" || die "Failed to create dest/node_modules/reflect-metadata" | ||||
| cp -a node_modules/reflect-metadata/Reflect.js "${destination}/node_modules/reflect-metadata/" || die "Failed to copy Reflect.js" | ||||
| 
 | ||||
| mkdir -p "${destination}/node_modules/rxjs" || die "Failed to create dest/node_modules/rxjs" | ||||
| cp -a node_modules/rxjs/* "${destination}/node_modules/rxjs/" || die "Failed to copy rxjs" | ||||
| 
 | ||||
| mkdir -p "${destination}/node_modules/systemjs/dist" || die "Failed to create dest/node_modules/systemjs" | ||||
| cp -a node_modules/systemjs/dist/system.src.js "${destination}/node_modules/systemjs/dist/" || die "Failed to copy system.src.js" | ||||
| 
 | ||||
| mkdir -p "${destination}/node_modules/utf8" || die "Failed to create dest/node_modules/utf8" | ||||
| cp -a node_modules/utf8/utf8.js "${destination}/node_modules/utf8/" || die "Failed to copy utf8.js" | ||||
| 
 | ||||
| mkdir -p "${destination}/node_modules/quoted-printable" || die "Failed to create dest/node_modules/quoted-printable" | ||||
| cp -a node_modules/quoted-printable/quoted-printable.js "${destination}/node_modules/quoted-printable/" || die "Failed to copy quoted-printable.js" | ||||
| 
 | ||||
| mkdir -p "${destination}/node_modules/punycode" || die "Failed to create dest/node_modules/punycode" | ||||
| cp -a node_modules/punycode/punycode.js "${destination}/node_modules/punycode/" || die "Failed to copy punycode.js" | ||||
| 
 | ||||
| echo "Deployment successful." | ||||
							
								
								
									
										55
									
								
								index.html
									
										
									
									
									
								
							
							
						
						
									
										55
									
								
								index.html
									
										
									
									
									
								
							|  | @ -1,55 +0,0 @@ | |||
| <!DOCTYPE html> | ||||
| <html> | ||||
| <head> | ||||
|     <meta charset="UTF-8"/> | ||||
|     <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no"/> | ||||
|     <title>Decode? Encode? DENcode!</title> | ||||
|     <script type="text/javascript" src="node_modules/core-js/client/shim.js"></script> | ||||
|     <script type="text/javascript" src="node_modules/zone.js/dist/zone.js"></script> | ||||
|     <script type="text/javascript" src="node_modules/reflect-metadata/Reflect.js"></script> | ||||
|     <script type="text/javascript" src="node_modules/systemjs/dist/system.src.js"></script> | ||||
|     <script type="text/javascript" src="node_modules/utf8/utf8.js"></script> | ||||
|     <script type="text/javascript" src="node_modules/quoted-printable/quoted-printable.js"></script> | ||||
|     <script type="text/javascript" src="node_modules/punycode/punycode.js"></script> | ||||
| 
 | ||||
|     <script type="text/javascript" src="systemjs.config.js"></script> | ||||
|     <script type="text/javascript"> | ||||
|         System.import("app").catch(function (err) { | ||||
|             console.log(err); | ||||
|         }); | ||||
|     </script> | ||||
|     <style> | ||||
|         @font-face { | ||||
|             font-family: "ABeeZee"; | ||||
|             font-stretch: normal; | ||||
|             font-style: normal; | ||||
|             font-variant: normal; | ||||
|             font-weight: normal; | ||||
|             src: local("ABeeZee Regular"), | ||||
|             local("ABeeZee-Regular"), | ||||
|             local("ABeeZee"), | ||||
|             url("abeezee-regular.woff") format("woff"); | ||||
|         } | ||||
| 
 | ||||
|         body { | ||||
|             font-family: "ABeeZee", sans-serif; | ||||
|             margin: 0; | ||||
|             padding: 1em 0 0 0; | ||||
|         } | ||||
| 
 | ||||
|         h1 { | ||||
|             text-align: center; | ||||
|         } | ||||
|     </style> | ||||
| </head> | ||||
| <body> | ||||
| <h1>Decode? Encode? DENcode!</h1> | ||||
| <noscript>This webpage lets you decode and encode data and text to and from various formats. But | ||||
|     it requires you to <strong>enable Javascript</strong> to do so. So please turn it on in your | ||||
|     Browser. You won't regret it! | ||||
| </noscript> | ||||
| <den-app> | ||||
|     <div style="text-align:center;">Please hold on, we're starting the turbines ...</div> | ||||
| </den-app> | ||||
| </body> | ||||
| </html> | ||||
							
								
								
									
										1
									
								
								karma.conf.js
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								karma.conf.js
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1 @@ | |||
| module.exports = require('./config/karma.conf.js'); | ||||
							
								
								
									
										77
									
								
								package.json
									
										
									
									
									
								
							
							
						
						
									
										77
									
								
								package.json
									
										
									
									
									
								
							|  | @ -1,47 +1,66 @@ | |||
| { | ||||
|   "name": "dencode.org", | ||||
|   "version": "1.0.0-alpha.1", | ||||
|   "version": "1.0.0-alpha.2", | ||||
|   "description": "Convert to and fro!", | ||||
|   "keywords": [ | ||||
|     "dencode", "conversion", "converter", "convert" | ||||
|     "dencode", | ||||
|     "conversion", | ||||
|     "converter", | ||||
|     "convert" | ||||
|   ], | ||||
|   "author": { | ||||
|     "name": "Manuel Friedli", | ||||
|     "email": "manuel@fritteli.ch" | ||||
|   }, | ||||
|   "license": "MIT", | ||||
|   "homepage": "https://test.friedli.info/~manuel/dencode", | ||||
|   "repository": "https://gittr.ch/manuel/dencode.org.git", | ||||
|   "homepage": "https://manuel.pages.gittr.ch/dencode.org", | ||||
|   "repository": { | ||||
|     "type": "git", | ||||
|     "url": "https://gittr.ch/manuel/dencode.org.git" | ||||
|   }, | ||||
|   "dependencies": { | ||||
|     "@angular/common": "2.0.0", | ||||
|     "@angular/compiler": "2.0.0", | ||||
|     "@angular/core": "2.0.0", | ||||
|     "@angular/forms": "2.0.0", | ||||
|     "@angular/platform-browser": "2.0.0", | ||||
|     "@angular/platform-browser-dynamic": "2.0.0", | ||||
|     "@angular/upgrade": "2.0.0", | ||||
|     "bootstrap": "^3.3.6", | ||||
|     "core-js": "^2.4.0", | ||||
|     "reflect-metadata": "^0.1.3", | ||||
|     "rxjs": "5.0.0-beta.12", | ||||
|     "systemjs": "^0.19.27", | ||||
|     "zone.js": "^0.6.12", | ||||
|     "@angular/common": "^2.4.0", | ||||
|     "@angular/compiler": "^2.4.0", | ||||
|     "@angular/core": "^2.4.0", | ||||
|     "@angular/forms": "^2.4.0", | ||||
|     "@angular/platform-browser": "^2.4.0", | ||||
|     "@angular/platform-browser-dynamic": "^2.4.0", | ||||
|     "core-js": "^2.4.1", | ||||
|     "rxjs": "^5.0.1", | ||||
|     "zone.js": "^0.7.4", | ||||
|     "bootstrap": "^3.3.0", | ||||
|     "quoted-printable": "^1.0.0", | ||||
|     "utf8": "^2.1.1", | ||||
|     "punycode": "1.4.1" | ||||
|     "utf8": "^2.1.0", | ||||
|     "punycode": "^1.4.0" | ||||
|   }, | ||||
|   "devDependencies": { | ||||
|     "concurrently": "^2.2.0", | ||||
|     "lite-server": "^2.2.0", | ||||
|     "typescript": "^2.0.2", | ||||
|     "typings": "^1.3.2" | ||||
|     "@types/node": "^6.0.45", | ||||
|     "@types/jasmine": "2.5.36", | ||||
|     "angular2-template-loader": "^0.6.0", | ||||
|     "awesome-typescript-loader": "^3.0.4", | ||||
|     "css-loader": "^0.26.1", | ||||
|     "extract-text-webpack-plugin": "^2.0.0", | ||||
|     "file-loader": "^0.9.0", | ||||
|     "html-loader": "^0.4.3", | ||||
|     "html-webpack-plugin": "^2.16.1", | ||||
|     "jasmine-core": "^2.4.1", | ||||
|     "karma": "^1.2.0", | ||||
|     "karma-chrome-launcher": "^2.0.0", | ||||
|     "karma-jasmine": "^1.0.2", | ||||
|     "karma-sourcemap-loader": "^0.3.7", | ||||
|     "karma-webpack": "^2.0.1", | ||||
|     "null-loader": "^0.1.1", | ||||
|     "raw-loader": "^0.5.1", | ||||
|     "rimraf": "^2.5.2", | ||||
|     "style-loader": "^0.13.1", | ||||
|     "typescript": "^2.0.10", | ||||
|     "webpack": "^2.2.1", | ||||
|     "webpack-dev-server": "^2.4.1", | ||||
|     "webpack-merge": "^3.0.0" | ||||
|   }, | ||||
|   "scripts": { | ||||
|     "start": "tsc && concurrently \"npm run tsc:w\" \"npm run lite\"", | ||||
|     "lite": "lite-server", | ||||
|     "postinstall": "typings install", | ||||
|     "tsc": "tsc", | ||||
|     "tsc:w": "tsc -w", | ||||
|     "typings": "typings" | ||||
|     "start": "webpack-dev-server --inline --progress --port 8080", | ||||
|     "test": "karma start", | ||||
|     "build": "rimraf dist && webpack --config config/webpack.prod.js --progress --profile --bail" | ||||
|   } | ||||
| } | ||||
|  |  | |||
|  | @ -1,25 +1,3 @@ | |||
| @font-face { | ||||
|     font-family: "ABeeZee"; | ||||
|     font-stretch: normal; | ||||
|     font-style: normal; | ||||
|     font-variant: normal; | ||||
|     font-weight: normal; | ||||
|     src: local("ABeeZee Regular"), | ||||
|     local("ABeeZee-Regular"), | ||||
|     local("ABeeZee"), | ||||
|     url("abeezee-regular.woff") format("woff"); | ||||
| } | ||||
| 
 | ||||
| @font-face { | ||||
|     font-family: "Free Monospaced"; | ||||
|     src: url("freemono.eot?") format("eot"), | ||||
|     url("freemono.woff") format("woff"), | ||||
|     url("freemono.ttf") format("truetype"), | ||||
|     url("freemono.svg#FreeMono") format("svg"); | ||||
|     font-weight: normal; | ||||
|     font-style: normal; | ||||
| } | ||||
| 
 | ||||
| .inputwrapper { | ||||
|     font-family: "ABeeZee", sans-serif; | ||||
|     margin: 0 1em 1em 1em; | ||||
|  | @ -5,11 +5,12 @@ import {Converter} from "./converter/converter"; | |||
| import {NativeLibraryWrapperService} from "./nativelibrarywrapper.service"; | ||||
| import {Step} from "./step"; | ||||
| 
 | ||||
| import "../assets/css/style.css"; | ||||
| 
 | ||||
| @Component({ | ||||
|     moduleId: module.id, | ||||
|     selector: "den-app", | ||||
|     templateUrl: "app.component.html", | ||||
|     styleUrls: ["app.component.css"], | ||||
|     templateUrl: "./app.component.html", | ||||
|     styleUrls: ["./app.component.css"], | ||||
|     providers: [ConverterRegistryService, InputComponentManagerService, NativeLibraryWrapperService] | ||||
| }) | ||||
| export class AppComponent extends OnInit { | ||||
|  | @ -1,4 +1,5 @@ | |||
| import {Converter} from "./converter"; | ||||
| 
 | ||||
| export class BinToDecConverter implements Converter { | ||||
|     getDisplayname():string { | ||||
|         return "Convert binary to decimal"; | ||||
|  | @ -1,4 +1,5 @@ | |||
| import {Converter} from "./converter"; | ||||
| 
 | ||||
| export class DecToBinConverter implements Converter { | ||||
|     getDisplayname():string { | ||||
|         return "Convert decimal to binary"; | ||||
|  | @ -1,4 +1,5 @@ | |||
| import {Converter} from "./converter"; | ||||
| 
 | ||||
| export class DecToHexConverter implements Converter { | ||||
|     getDisplayname():string { | ||||
|         return "Convert decimal to hexadecimal"; | ||||
|  | @ -1,4 +1,5 @@ | |||
| import {Converter} from "./converter"; | ||||
| 
 | ||||
| export class HexToDecConverter implements Converter { | ||||
|     getDisplayname():string { | ||||
|         return "Convert hexadecimal to decimal"; | ||||
							
								
								
									
										17
									
								
								src/app/nativelibrarywrapper.service.ts
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								src/app/nativelibrarywrapper.service.ts
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,17 @@ | |||
| import {Injectable} from "@angular/core"; | ||||
| import {Punycode} from "./punycode"; | ||||
| import {Utf8} from "./utf8"; | ||||
| import {QuotedPrintable} from "./quotedprintable"; | ||||
| 
 | ||||
| @Injectable() | ||||
| export class NativeLibraryWrapperService { | ||||
|     public utf8:Utf8; | ||||
|     public quotedPrintable:QuotedPrintable; | ||||
|     public punycode:Punycode; | ||||
| 
 | ||||
|     constructor() { | ||||
|         this.utf8 = require("utf8"); | ||||
|         this.quotedPrintable = require("quoted-printable"); | ||||
|         this.punycode = require("punycode"); | ||||
|     } | ||||
| } | ||||
							
								
								
									
										4
									
								
								src/app/punycode.ts
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								src/app/punycode.ts
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,4 @@ | |||
| export interface Punycode { | ||||
|     encode(input:string):string; | ||||
|     decode(input:string):string; | ||||
| } | ||||
							
								
								
									
										4
									
								
								src/app/quotedprintable.ts
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								src/app/quotedprintable.ts
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,4 @@ | |||
| export interface QuotedPrintable { | ||||
|     encode(input:string):string; | ||||
|     decode(input:string):string; | ||||
| } | ||||
|  | @ -1,4 +1,5 @@ | |||
| import {Converter} from "./converter/converter"; | ||||
| 
 | ||||
| export class Step { | ||||
|     public content:string = ""; | ||||
|     public selectedConverter:Converter = undefined; | ||||
							
								
								
									
										4
									
								
								src/app/utf8.ts
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								src/app/utf8.ts
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,4 @@ | |||
| export interface Utf8 { | ||||
|     encode(input:any):string; | ||||
|     decode(input:string):any; | ||||
| } | ||||
							
								
								
									
										35
									
								
								src/assets/css/style.css
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										35
									
								
								src/assets/css/style.css
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,35 @@ | |||
| @font-face { | ||||
|     font-family: "ABeeZee"; | ||||
|     font-stretch: normal; | ||||
|     font-style: normal; | ||||
|     font-variant: normal; | ||||
|     font-weight: normal; | ||||
|     src: local("ABeeZee Regular"), | ||||
|     local("ABeeZee-Regular"), | ||||
|     local("ABeeZee"), | ||||
|     url("../fonts/abeezee-regular.woff") format("woff"); | ||||
| } | ||||
| 
 | ||||
| @font-face { | ||||
|     font-family: "Free Monospaced"; | ||||
|     src: url("../fonts/freemono.eot?") format("eot"), | ||||
|     url("../fonts/freemono.woff") format("woff"), | ||||
|     url("../fonts/freemono.ttf") format("truetype"), | ||||
|     url("../fonts/freemono.svg#FreeMono") format("svg"); | ||||
|     font-weight: normal; | ||||
|     font-style: normal; | ||||
| } | ||||
| 
 | ||||
| body { | ||||
|     font-family: "ABeeZee", sans-serif; | ||||
|     margin: 0; | ||||
|     padding: 1em 0 0 0; | ||||
| } | ||||
| 
 | ||||
| h1 { | ||||
|     text-align: center; | ||||
| } | ||||
| 
 | ||||
| .apploader { | ||||
|     text-align: center; | ||||
| } | ||||
| Before Width: | Height: | Size: 75 KiB After Width: | Height: | Size: 75 KiB | 
							
								
								
									
										18
									
								
								src/index.html
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								src/index.html
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,18 @@ | |||
| <!DOCTYPE html> | ||||
| <html> | ||||
| <head> | ||||
|     <meta charset="UTF-8"/> | ||||
|     <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no"/> | ||||
|     <title>Decode? Encode? DENcode!</title> | ||||
| </head> | ||||
| <body> | ||||
| <h1>Decode? Encode? DENcode!</h1> | ||||
| <noscript>This webpage lets you decode and encode data and text to and from various formats. But | ||||
|     it requires you to <strong>enable Javascript</strong> to do so. So please turn it on in your | ||||
|     Browser. You won't regret it! | ||||
| </noscript> | ||||
| <den-app> | ||||
|     <div class="apploader">Please hold on, we're starting the turbines ...</div> | ||||
| </den-app> | ||||
| </body> | ||||
| </html> | ||||
|  | @ -1,4 +1,4 @@ | |||
| import {platformBrowserDynamic} from "@angular/platform-browser-dynamic"; | ||||
| import {AppModule} from "./app.module"; | ||||
| import {AppModule} from "./app/app.module"; | ||||
| 
 | ||||
| platformBrowserDynamic().bootstrapModule(AppModule); | ||||
							
								
								
									
										11
									
								
								src/polyfills.ts
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								src/polyfills.ts
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,11 @@ | |||
| import "core-js/es6"; | ||||
| import "core-js/es7/reflect"; | ||||
| require("zone.js/dist/zone"); | ||||
| 
 | ||||
| if (process.env.ENV === 'production') { | ||||
|     // Production
 | ||||
| } else { | ||||
|     // Development and test
 | ||||
|     Error['stackTraceLimit'] = Infinity; | ||||
|     require('zone.js/dist/long-stack-trace-zone'); | ||||
| } | ||||
|  | @ -1,12 +1,20 @@ | |||
| { | ||||
|   "compilerOptions": { | ||||
|     "alwaysStrict": true, | ||||
|     "target": "es5", | ||||
|     "module": "commonjs", | ||||
|     "moduleResolution": "node", | ||||
|     "sourceMap": true, | ||||
|     "emitDecoratorMetadata": true, | ||||
|     "experimentalDecorators": true, | ||||
|     "removeComments": false, | ||||
|     "noImplicitAny": false | ||||
|     "lib": [ | ||||
|       "es2015", | ||||
|       "dom" | ||||
|     ], | ||||
|     "noImplicitAny": true, | ||||
|     "suppressImplicitAnyIndexErrors": true, | ||||
|     "typeRoots": [ | ||||
|       "../node_modules/@types/" | ||||
|     ] | ||||
|   } | ||||
| } | ||||
							
								
								
									
										5
									
								
								src/vendor.ts
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								src/vendor.ts
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,5 @@ | |||
| import "@angular/core"; | ||||
| import "@angular/platform-browser"; | ||||
| import "@angular/platform-browser-dynamic"; | ||||
| import "@angular/forms"; | ||||
| import "rxjs"; | ||||
|  | @ -1,43 +0,0 @@ | |||
| /** | ||||
|  * System configuration for Angular 2 samples | ||||
|  * Adjust as necessary for your application needs. | ||||
|  */ | ||||
| (function (global) { | ||||
|     System.config({ | ||||
|         paths: { | ||||
|             // paths serve as alias
 | ||||
|             'npm:': 'node_modules/' | ||||
|         }, | ||||
|         // map tells the System loader where to look for things
 | ||||
|         map: { | ||||
|             // our app is within the app folder
 | ||||
|             app: 'app', | ||||
|             // angular bundles
 | ||||
|             '@angular/core': 'npm:@angular/core/bundles/core.umd.js', | ||||
|             '@angular/common': 'npm:@angular/common/bundles/common.umd.js', | ||||
|             '@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js', | ||||
|             '@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js', | ||||
|             '@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js', | ||||
| //            '@angular/http': 'npm:@angular/http/bundles/http.umd.js',
 | ||||
| //            '@angular/router': 'npm:@angular/router/bundles/router.umd.js',
 | ||||
|            '@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js', | ||||
|             // other libraries
 | ||||
|             'rxjs': 'npm:rxjs'//,
 | ||||
| //            'angular2-in-memory-web-api': 'npm:angular2-in-memory-web-api',
 | ||||
|         }, | ||||
|         // packages tells the System loader how to load when no filename and/or no extension
 | ||||
|         packages: { | ||||
|             app: { | ||||
|                 main: './main.js', | ||||
|                 defaultExtension: 'js' | ||||
|             }, | ||||
|             rxjs: { | ||||
|                 defaultExtension: 'js' | ||||
|             }, | ||||
|             'angular2-in-memory-web-api': { | ||||
|                 main: './index.js', | ||||
|                 defaultExtension: 'js' | ||||
|             } | ||||
|         } | ||||
|     }); | ||||
| })(this); | ||||
|  | @ -1,9 +0,0 @@ | |||
| { | ||||
|   "name": "dencode.org", | ||||
|   "dependencies": {}, | ||||
|   "globalDependencies": { | ||||
|     "core-js": "registry:dt/core-js#0.0.0+20160914114559", | ||||
|     "jasmine": "registry:dt/jasmine#2.2.0+20160621224255", | ||||
|     "node": "registry:dt/node#6.0.0+20160915134512" | ||||
|   } | ||||
| } | ||||
							
								
								
									
										1
									
								
								webpack.config.js
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								webpack.config.js
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1 @@ | |||
| module.exports = require('./config/webpack.dev.js'); | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue