From 603f0ca94d58523268ac2ba1221f737ca6f58811 Mon Sep 17 00:00:00 2001 From: Manuel Friedli Date: Tue, 7 Mar 2017 04:12:52 +0100 Subject: [PATCH 01/17] try to enable gitlab-pages --- .gitlab-ci.yml | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index de552cc..27c18cd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,7 +1,8 @@ stages: - build - cleanup_build - - deploy + - deploy_new +# - deploy # - cleanup .run_deploy: &run_deploy @@ -54,6 +55,32 @@ cleanup_build_job: - rm -rf typings when: on_failure +pages: + stage: deploy_new + environment: pages + except: + - 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 publiv/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/ + artifacts: + paths: + - public + dependencies: + - build_job + develop: stage: deploy <<: *run_deploy From c9c4836a88524544eae59eaa54306aa82d6c2ae3 Mon Sep 17 00:00:00 2001 From: Manuel Friedli Date: Tue, 7 Mar 2017 04:16:22 +0100 Subject: [PATCH 02/17] fixed syntax errors --- .gitlab-ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 27c18cd..a2c642b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,15 +2,15 @@ stages: - build - cleanup_build - deploy_new -# - deploy + - deploy # - cleanup .run_deploy: &run_deploy script: - chmod +x ./deploy.sh - - ./deploy.sh - dependencies: - - build_job +# - ./deploy.sh +# dependencies: +# - build_job build_job: stage: build From c2960f11e8df6ae579ff85634dbf55f1bc05e782 Mon Sep 17 00:00:00 2001 From: Manuel Friedli Date: Tue, 7 Mar 2017 04:23:23 +0100 Subject: [PATCH 03/17] fixed typo --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a2c642b..f34232f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -65,7 +65,7 @@ pages: - 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 publiv/app/converter/ + - 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/ From 23a131aec47ac66c31726209f74ec80de02b0fe2 Mon Sep 17 00:00:00 2001 From: Manuel Friedli Date: Thu, 9 Mar 2017 22:35:46 +0100 Subject: [PATCH 04/17] fixed paths for fonts --- app/app.component.css | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/app.component.css b/app/app.component.css index a1f448b..84401cc 100644 --- a/app/app.component.css +++ b/app/app.component.css @@ -7,15 +7,15 @@ src: local("ABeeZee Regular"), local("ABeeZee-Regular"), local("ABeeZee"), - url("../abeezee-regular.woff") format("woff"); + 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"); + 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; } From 9edd2b6dbf4052a3dbe41220b223ee0957c6404e Mon Sep 17 00:00:00 2001 From: Manuel Friedli Date: Tue, 14 Mar 2017 00:21:43 +0100 Subject: [PATCH 05/17] updated .gitlab-ci.yml. tried to put pages artifacts into branch-based subfolder --- .gitlab-ci.yml | 54 +++++++++++++++----------------------------------- 1 file changed, 16 insertions(+), 38 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f34232f..87e6c1b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,7 +1,6 @@ stages: - build - cleanup_build - - deploy_new - deploy # - cleanup @@ -56,53 +55,32 @@ cleanup_build_job: when: on_failure pages: - stage: deploy_new - environment: pages + stage: deploy + environment: staging except: - 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/ + - mkdir -p public .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 .public public/${CI_BUILD_REF_NAME} artifacts: paths: - public dependencies: - build_job -develop: - stage: deploy - <<: *run_deploy - environment: develop - except: - - tags - - master - - develop - variables: - ENVIRON: develop - TARGET: $WWW_DEPLOY_ROOT_DEVELOP - -staging: - stage: deploy - <<: *run_deploy - environment: staging - only: - - develop - variables: - ENVIRON: staging - TARGET: $WWW_DEPLOY_ROOT_STAGING - production: stage: deploy <<: *run_deploy From 8d9bd73da65562672350381b9a07f89b65b9734c Mon Sep 17 00:00:00 2001 From: Manuel Friedli Date: Tue, 14 Mar 2017 00:27:00 +0100 Subject: [PATCH 06/17] fixed the deploy stage for the staging environment --- .gitlab-ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 87e6c1b..c505e89 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -74,7 +74,8 @@ pages: - 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 .public public/${CI_BUILD_REF_NAME} + - mkdir -p public/${CI_BUILD_REF_NAME} + - mv .public/* public/${CI_BUILD_REF_NAME}/ artifacts: paths: - public From 79139812a40f0761711f0ab800db330607bde0da Mon Sep 17 00:00:00 2001 From: Manuel Friedli Date: Tue, 14 Mar 2017 00:35:56 +0100 Subject: [PATCH 07/17] reverted the branch-based deployment to staging --- .gitlab-ci.yml | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c505e89..34b28af 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -61,21 +61,19 @@ pages: - tags - master script: - - mkdir -p public .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/ - - mkdir -p public/${CI_BUILD_REF_NAME} - - mv .public/* public/${CI_BUILD_REF_NAME}/ + - 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/ artifacts: paths: - public From bccceaed6e372c380ff5bdaaa409206fe8865e15 Mon Sep 17 00:00:00 2001 From: Manuel Friedli Date: Tue, 14 Mar 2017 00:50:14 +0100 Subject: [PATCH 08/17] re-enabled deployment to production --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 34b28af..d521dd4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,7 +7,7 @@ stages: .run_deploy: &run_deploy script: - chmod +x ./deploy.sh -# - ./deploy.sh + - ./deploy.sh # dependencies: # - build_job From be51aab2ee096985fc9a66966301b6c6f2d96043 Mon Sep 17 00:00:00 2001 From: Manuel Friedli Date: Tue, 14 Mar 2017 15:42:11 +0100 Subject: [PATCH 09/17] Intermediate commit: - webpack build does not run successfully, typescript errors out, saying "TS2304: Cannot find name 'module'." or 'require' or 'process' in certain .ts files. --- .gitignore | 5 +- config/helpers.js | 7 ++ config/webpack.common.js | 76 ++++++++++++++++++ config/webpack.dev.js | 24 ++++++ karma.conf.js | 1 + package.json | 68 ++++++++++------ .../abeezee-regular.woff | Bin {app => src/app}/app.component.css | 0 {app => src/app}/app.component.html | 0 {app => src/app}/app.component.ts | 0 {app => src/app}/app.module.ts | 0 {app => src/app}/converter/base64decoder.ts | 0 {app => src/app}/converter/base64encoder.ts | 0 .../app}/converter/bintodecconverter.ts | 1 + {app => src/app}/converter/converter.ts | 0 .../app}/converter/dectobinconverter.ts | 1 + .../app}/converter/dectohexconverter.ts | 1 + .../app}/converter/hextodecconverter.ts | 1 + .../app}/converter/htmlentitiesdecoder.ts | 0 .../app}/converter/htmlentitiesencoder.ts | 0 {app => src/app}/converter/punycodedecoder.ts | 0 {app => src/app}/converter/punycodeencoder.ts | 0 .../app}/converter/quotedprintabledecoder.ts | 0 .../app}/converter/quotedprintableencoder.ts | 0 .../app}/converter/uricomponentdecoder.ts | 0 .../app}/converter/uricomponentencoder.ts | 0 {app => src/app}/converter/uridecoder.ts | 0 {app => src/app}/converter/uriencoder.ts | 0 {app => src/app}/converterregistry.service.ts | 0 .../app}/inputcomponentmanager.service.ts | 0 .../app}/nativelibrarywrapper.service.ts | 0 {app => src/app}/step.ts | 1 + freemono.eot => src/freemono.eot | Bin freemono.svg => src/freemono.svg | 0 freemono.ttf => src/freemono.ttf | Bin freemono.woff => src/freemono.woff | Bin index.html => src/index.html | 30 ++++--- {app => src}/main.ts | 2 +- src/polyfills.ts | 12 +++ tsconfig.json => src/tsconfig.json | 9 ++- src/vendor.ts | 17 ++++ typings.json | 9 --- webpack.config.js | 1 + 43 files changed, 213 insertions(+), 53 deletions(-) create mode 100644 config/helpers.js create mode 100644 config/webpack.common.js create mode 100644 config/webpack.dev.js create mode 100644 karma.conf.js rename abeezee-regular.woff => src/abeezee-regular.woff (100%) rename {app => src/app}/app.component.css (100%) rename {app => src/app}/app.component.html (100%) rename {app => src/app}/app.component.ts (100%) rename {app => src/app}/app.module.ts (100%) rename {app => src/app}/converter/base64decoder.ts (100%) rename {app => src/app}/converter/base64encoder.ts (100%) rename {app => src/app}/converter/bintodecconverter.ts (99%) rename {app => src/app}/converter/converter.ts (100%) rename {app => src/app}/converter/dectobinconverter.ts (99%) rename {app => src/app}/converter/dectohexconverter.ts (99%) rename {app => src/app}/converter/hextodecconverter.ts (99%) rename {app => src/app}/converter/htmlentitiesdecoder.ts (100%) rename {app => src/app}/converter/htmlentitiesencoder.ts (100%) rename {app => src/app}/converter/punycodedecoder.ts (100%) rename {app => src/app}/converter/punycodeencoder.ts (100%) rename {app => src/app}/converter/quotedprintabledecoder.ts (100%) rename {app => src/app}/converter/quotedprintableencoder.ts (100%) rename {app => src/app}/converter/uricomponentdecoder.ts (100%) rename {app => src/app}/converter/uricomponentencoder.ts (100%) rename {app => src/app}/converter/uridecoder.ts (100%) rename {app => src/app}/converter/uriencoder.ts (100%) rename {app => src/app}/converterregistry.service.ts (100%) rename {app => src/app}/inputcomponentmanager.service.ts (100%) rename {app => src/app}/nativelibrarywrapper.service.ts (100%) rename {app => src/app}/step.ts (99%) rename freemono.eot => src/freemono.eot (100%) rename freemono.svg => src/freemono.svg (100%) rename freemono.ttf => src/freemono.ttf (100%) rename freemono.woff => src/freemono.woff (100%) rename index.html => src/index.html (54%) rename {app => src}/main.ts (74%) create mode 100644 src/polyfills.ts rename tsconfig.json => src/tsconfig.json (58%) create mode 100644 src/vendor.ts delete mode 100644 typings.json create mode 100644 webpack.config.js diff --git a/.gitignore b/.gitignore index 7404c57..03b8502 100644 --- a/.gitignore +++ b/.gitignore @@ -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/ diff --git a/config/helpers.js b/config/helpers.js new file mode 100644 index 0000000..adfb603 --- /dev/null +++ b/config/helpers.js @@ -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; diff --git a/config/webpack.common.js b/config/webpack.common.js new file mode 100644 index 0000000..37a66be --- /dev/null +++ b/config/webpack.common.js @@ -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 + }) + ] +}; diff --git a/config/webpack.dev.js b/config/webpack.dev.js new file mode 100644 index 0000000..7f3c504 --- /dev/null +++ b/config/webpack.dev.js @@ -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' + } +}); diff --git a/karma.conf.js b/karma.conf.js new file mode 100644 index 0000000..9649b15 --- /dev/null +++ b/karma.conf.js @@ -0,0 +1 @@ +module.exports = require('./config/karma.conf.js'); diff --git a/package.json b/package.json index 39d3c79..ff786d3 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,10 @@ "version": "1.0.0-alpha.1", "description": "Convert to and fro!", "keywords": [ - "dencode", "conversion", "converter", "convert" + "dencode", + "conversion", + "converter", + "convert" ], "author": { "name": "Manuel Friedli", @@ -13,35 +16,48 @@ "homepage": "https://test.friedli.info/~manuel/dencode", "repository": "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-beta.5", + "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" } } diff --git a/abeezee-regular.woff b/src/abeezee-regular.woff similarity index 100% rename from abeezee-regular.woff rename to src/abeezee-regular.woff diff --git a/app/app.component.css b/src/app/app.component.css similarity index 100% rename from app/app.component.css rename to src/app/app.component.css diff --git a/app/app.component.html b/src/app/app.component.html similarity index 100% rename from app/app.component.html rename to src/app/app.component.html diff --git a/app/app.component.ts b/src/app/app.component.ts similarity index 100% rename from app/app.component.ts rename to src/app/app.component.ts diff --git a/app/app.module.ts b/src/app/app.module.ts similarity index 100% rename from app/app.module.ts rename to src/app/app.module.ts diff --git a/app/converter/base64decoder.ts b/src/app/converter/base64decoder.ts similarity index 100% rename from app/converter/base64decoder.ts rename to src/app/converter/base64decoder.ts diff --git a/app/converter/base64encoder.ts b/src/app/converter/base64encoder.ts similarity index 100% rename from app/converter/base64encoder.ts rename to src/app/converter/base64encoder.ts diff --git a/app/converter/bintodecconverter.ts b/src/app/converter/bintodecconverter.ts similarity index 99% rename from app/converter/bintodecconverter.ts rename to src/app/converter/bintodecconverter.ts index 0b4cbd7..33d73ba 100644 --- a/app/converter/bintodecconverter.ts +++ b/src/app/converter/bintodecconverter.ts @@ -1,4 +1,5 @@ import {Converter} from "./converter"; + export class BinToDecConverter implements Converter { getDisplayname():string { return "Convert binary to decimal"; diff --git a/app/converter/converter.ts b/src/app/converter/converter.ts similarity index 100% rename from app/converter/converter.ts rename to src/app/converter/converter.ts diff --git a/app/converter/dectobinconverter.ts b/src/app/converter/dectobinconverter.ts similarity index 99% rename from app/converter/dectobinconverter.ts rename to src/app/converter/dectobinconverter.ts index b64a310..c457d4c 100644 --- a/app/converter/dectobinconverter.ts +++ b/src/app/converter/dectobinconverter.ts @@ -1,4 +1,5 @@ import {Converter} from "./converter"; + export class DecToBinConverter implements Converter { getDisplayname():string { return "Convert decimal to binary"; diff --git a/app/converter/dectohexconverter.ts b/src/app/converter/dectohexconverter.ts similarity index 99% rename from app/converter/dectohexconverter.ts rename to src/app/converter/dectohexconverter.ts index b033792..4050643 100644 --- a/app/converter/dectohexconverter.ts +++ b/src/app/converter/dectohexconverter.ts @@ -1,4 +1,5 @@ import {Converter} from "./converter"; + export class DecToHexConverter implements Converter { getDisplayname():string { return "Convert decimal to hexadecimal"; diff --git a/app/converter/hextodecconverter.ts b/src/app/converter/hextodecconverter.ts similarity index 99% rename from app/converter/hextodecconverter.ts rename to src/app/converter/hextodecconverter.ts index 2dcdad2..68b8c27 100644 --- a/app/converter/hextodecconverter.ts +++ b/src/app/converter/hextodecconverter.ts @@ -1,4 +1,5 @@ import {Converter} from "./converter"; + export class HexToDecConverter implements Converter { getDisplayname():string { return "Convert hexadecimal to decimal"; diff --git a/app/converter/htmlentitiesdecoder.ts b/src/app/converter/htmlentitiesdecoder.ts similarity index 100% rename from app/converter/htmlentitiesdecoder.ts rename to src/app/converter/htmlentitiesdecoder.ts diff --git a/app/converter/htmlentitiesencoder.ts b/src/app/converter/htmlentitiesencoder.ts similarity index 100% rename from app/converter/htmlentitiesencoder.ts rename to src/app/converter/htmlentitiesencoder.ts diff --git a/app/converter/punycodedecoder.ts b/src/app/converter/punycodedecoder.ts similarity index 100% rename from app/converter/punycodedecoder.ts rename to src/app/converter/punycodedecoder.ts diff --git a/app/converter/punycodeencoder.ts b/src/app/converter/punycodeencoder.ts similarity index 100% rename from app/converter/punycodeencoder.ts rename to src/app/converter/punycodeencoder.ts diff --git a/app/converter/quotedprintabledecoder.ts b/src/app/converter/quotedprintabledecoder.ts similarity index 100% rename from app/converter/quotedprintabledecoder.ts rename to src/app/converter/quotedprintabledecoder.ts diff --git a/app/converter/quotedprintableencoder.ts b/src/app/converter/quotedprintableencoder.ts similarity index 100% rename from app/converter/quotedprintableencoder.ts rename to src/app/converter/quotedprintableencoder.ts diff --git a/app/converter/uricomponentdecoder.ts b/src/app/converter/uricomponentdecoder.ts similarity index 100% rename from app/converter/uricomponentdecoder.ts rename to src/app/converter/uricomponentdecoder.ts diff --git a/app/converter/uricomponentencoder.ts b/src/app/converter/uricomponentencoder.ts similarity index 100% rename from app/converter/uricomponentencoder.ts rename to src/app/converter/uricomponentencoder.ts diff --git a/app/converter/uridecoder.ts b/src/app/converter/uridecoder.ts similarity index 100% rename from app/converter/uridecoder.ts rename to src/app/converter/uridecoder.ts diff --git a/app/converter/uriencoder.ts b/src/app/converter/uriencoder.ts similarity index 100% rename from app/converter/uriencoder.ts rename to src/app/converter/uriencoder.ts diff --git a/app/converterregistry.service.ts b/src/app/converterregistry.service.ts similarity index 100% rename from app/converterregistry.service.ts rename to src/app/converterregistry.service.ts diff --git a/app/inputcomponentmanager.service.ts b/src/app/inputcomponentmanager.service.ts similarity index 100% rename from app/inputcomponentmanager.service.ts rename to src/app/inputcomponentmanager.service.ts diff --git a/app/nativelibrarywrapper.service.ts b/src/app/nativelibrarywrapper.service.ts similarity index 100% rename from app/nativelibrarywrapper.service.ts rename to src/app/nativelibrarywrapper.service.ts diff --git a/app/step.ts b/src/app/step.ts similarity index 99% rename from app/step.ts rename to src/app/step.ts index fb4d584..d86c68f 100644 --- a/app/step.ts +++ b/src/app/step.ts @@ -1,4 +1,5 @@ import {Converter} from "./converter/converter"; + export class Step { public content:string = ""; public selectedConverter:Converter = undefined; diff --git a/freemono.eot b/src/freemono.eot similarity index 100% rename from freemono.eot rename to src/freemono.eot diff --git a/freemono.svg b/src/freemono.svg similarity index 100% rename from freemono.svg rename to src/freemono.svg diff --git a/freemono.ttf b/src/freemono.ttf similarity index 100% rename from freemono.ttf rename to src/freemono.ttf diff --git a/freemono.woff b/src/freemono.woff similarity index 100% rename from freemono.woff rename to src/freemono.woff diff --git a/index.html b/src/index.html similarity index 54% rename from index.html rename to src/index.html index f12af09..5473fad 100644 --- a/index.html +++ b/src/index.html @@ -1,23 +1,27 @@ + + Decode? Encode? DENcode! - - - - - - - + + + + + + + - - + + + + + +

Decode? Encode? DENcode!

@@ -53,7 +12,7 @@ Browser. You won't regret it! -
Please hold on, we're starting the turbines ...
+
Please hold on, we're starting the turbines ...
diff --git a/src/polyfills.ts b/src/polyfills.ts index 24bba2f..4311901 100644 --- a/src/polyfills.ts +++ b/src/polyfills.ts @@ -1,7 +1,7 @@ import "core-js/es6"; import "core-js/es7/reflect"; import "zone.js/dist/zone"; -require('zone.js/dist/zone'); +require("zone.js/dist/zone"); if (process.env.ENV === 'production') { // Production diff --git a/src/tsconfig.json b/src/tsconfig.json index d23f0db..da26a70 100644 --- a/src/tsconfig.json +++ b/src/tsconfig.json @@ -12,6 +12,9 @@ "dom" ], "noImplicitAny": true, - "suppressImplicitAnyIndexErrors": true + "suppressImplicitAnyIndexErrors": true, + "typeRoots": [ + "../node_modules/@types/" + ] } } diff --git a/src/vendor.ts b/src/vendor.ts index 0ea4119..c7c86fe 100644 --- a/src/vendor.ts +++ b/src/vendor.ts @@ -1,17 +1,13 @@ -import "@angular/core"; -import "@angular/platform-browser"; -import "@angular/platform-browser-dynamic"; -import "@angular/forms"; -// import {Component, Injectable, NgModule, OnInit} from "@angular/core"; -// import {BrowserModule} from "@angular/platform-browser"; -// import {platformBrowserDynamic} from "@angular/platform-browser-dynamic"; -// import {FormsModule} from "@angular/forms"; +import {Component, Injectable, NgModule, OnInit} from "@angular/core"; +import {BrowserModule} from "@angular/platform-browser"; +import {platformBrowserDynamic} from "@angular/platform-browser-dynamic"; +import {FormsModule} from "@angular/forms"; -// // Angular -// import '@angular/platform-browser-dynamic'; -// import '@angular/common'; -// import '@angular/http'; -// import '@angular/router'; -// -// // RxJS -// import 'rxjs'; +import "rxjs"; + +import "utf8"; +import "quoted-printable"; +import "punycode"; +require("utf8"); +require("quoted-printable"); +require("punycode"); diff --git a/systemjs.config.js b/systemjs.config.js deleted file mode 100644 index 5ac6290..0000000 --- a/systemjs.config.js +++ /dev/null @@ -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); \ No newline at end of file From 13e6f6603e08a09e154076489004598001db8170 Mon Sep 17 00:00:00 2001 From: Manuel Friedli Date: Tue, 14 Mar 2017 17:39:09 +0100 Subject: [PATCH 12/17] Updated ci-config for the webpack build --- .gitlab-ci.yml | 42 ++++-------------------------------------- 1 file changed, 4 insertions(+), 38 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d521dd4..09fe991 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -15,43 +15,21 @@ 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 +39,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 From 06ed0eb2ddb5a7e23a93a5ced0535eb6d2e7df69 Mon Sep 17 00:00:00 2001 From: Manuel Friedli Date: Tue, 14 Mar 2017 21:33:30 +0100 Subject: [PATCH 13/17] Adjusted the publicPath property. --- config/webpack.prod.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/webpack.prod.js b/config/webpack.prod.js index eef3bf1..a5fb526 100644 --- a/config/webpack.prod.js +++ b/config/webpack.prod.js @@ -11,7 +11,7 @@ module.exports = webpackMerge(commonConfig, { output: { path: helpers.root('dist'), - publicPath: '/', + publicPath: '', filename: '[name].[hash].js', chunkFilename: '[id].[hash].chunk.js' }, From 710b703a8fef0490341c6ff739088e265d372f21 Mon Sep 17 00:00:00 2001 From: Manuel Friedli Date: Tue, 14 Mar 2017 22:36:13 +0100 Subject: [PATCH 14/17] Fixed references to fonts Moved the definitions to the main style.css file --- src/app/app.component.css | 22 ---------------------- src/assets/css/style.css | 10 ++++++++++ src/polyfills.ts | 1 - 3 files changed, 10 insertions(+), 23 deletions(-) diff --git a/src/app/app.component.css b/src/app/app.component.css index 84401cc..6a42d9d 100644 --- a/src/app/app.component.css +++ b/src/app/app.component.css @@ -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; diff --git a/src/assets/css/style.css b/src/assets/css/style.css index f539881..323ad97 100644 --- a/src/assets/css/style.css +++ b/src/assets/css/style.css @@ -10,6 +10,16 @@ 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; diff --git a/src/polyfills.ts b/src/polyfills.ts index 4311901..1a7f5df 100644 --- a/src/polyfills.ts +++ b/src/polyfills.ts @@ -1,6 +1,5 @@ import "core-js/es6"; import "core-js/es7/reflect"; -import "zone.js/dist/zone"; require("zone.js/dist/zone"); if (process.env.ENV === 'production') { From 1386babee5a4c32aab846b285ea66696732f80e6 Mon Sep 17 00:00:00 2001 From: Manuel Friedli Date: Tue, 14 Mar 2017 23:36:39 +0100 Subject: [PATCH 15/17] Fixed conversions that depend on pure JS modules That is: - quoted printable - punycode - (utf8), dependency of quoted printable --- package.json | 20 ++++++++++---------- src/app/converter/punycodedecoder.ts | 3 +-- src/app/converter/punycodeencoder.ts | 3 +-- src/app/converter/quotedprintabledecoder.ts | 8 ++++---- src/app/converter/quotedprintableencoder.ts | 3 +-- src/app/converterregistry.service.ts | 16 ++++++++-------- src/app/nativelibrarywrapper.service.ts | 19 +++++++++---------- src/app/punycode.ts | 4 ++++ src/app/quotedprintable.ts | 4 ++++ src/app/utf8.ts | 4 ++++ src/vendor.ts | 16 ++++------------ 11 files changed, 50 insertions(+), 50 deletions(-) create mode 100644 src/app/punycode.ts create mode 100644 src/app/quotedprintable.ts create mode 100644 src/app/utf8.ts diff --git a/package.json b/package.json index d63eb57..3caf487 100644 --- a/package.json +++ b/package.json @@ -19,14 +19,14 @@ "url": "https://gittr.ch/manuel/dencode.org.git" }, "dependencies": { - "@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", + "@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", + "rxjs": "^5.0.1", "zone.js": "^0.7.4", "bootstrap": "^3.3.0", "quoted-printable": "^1.0.0", @@ -53,9 +53,9 @@ "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", + "typescript": "^2.0.10", + "webpack": "^2.2.1", + "webpack-dev-server": "^2.4.1", "webpack-merge": "^3.0.0" }, "scripts": { diff --git a/src/app/converter/punycodedecoder.ts b/src/app/converter/punycodedecoder.ts index 15fc909..e61a8b4 100644 --- a/src/app/converter/punycodedecoder.ts +++ b/src/app/converter/punycodedecoder.ts @@ -15,7 +15,6 @@ export class PunycodeDecoder implements Converter { } convert(input: string): string { - // return this.nativeLibraryWrapperService.punycode.decode(input); - return ""; + return this.nativeLibraryWrapperService.punycode.decode(input); } } diff --git a/src/app/converter/punycodeencoder.ts b/src/app/converter/punycodeencoder.ts index 202d822..66345d6 100644 --- a/src/app/converter/punycodeencoder.ts +++ b/src/app/converter/punycodeencoder.ts @@ -15,7 +15,6 @@ export class PunycodeEncoder implements Converter { } convert(input: string): string { - // return this.nativeLibraryWrapperService.punycode.encode(input); - return ""; + return this.nativeLibraryWrapperService.punycode.encode(input); } } diff --git a/src/app/converter/quotedprintabledecoder.ts b/src/app/converter/quotedprintabledecoder.ts index bc1e857..d998038 100644 --- a/src/app/converter/quotedprintabledecoder.ts +++ b/src/app/converter/quotedprintabledecoder.ts @@ -14,10 +14,10 @@ export class QuotedPrintableDecoder implements Converter { } convert(input:string):string { - // try { - // return this.nativeLibraryWrapperService.utf8.decode(this.nativeLibraryWrapperService.quotedPrintable.decode(input)); - // } catch (error) { + try { + return this.nativeLibraryWrapperService.utf8.decode(this.nativeLibraryWrapperService.quotedPrintable.decode(input)); + } catch (error) { throw new Error("The input can not be interpreted as quoted-printable. May be corrupt?"); - // } + } } } diff --git a/src/app/converter/quotedprintableencoder.ts b/src/app/converter/quotedprintableencoder.ts index c97c9d7..048dbc6 100644 --- a/src/app/converter/quotedprintableencoder.ts +++ b/src/app/converter/quotedprintableencoder.ts @@ -14,7 +14,6 @@ export class QuotedPrintableEncoder implements Converter { } convert(input:string):string { - // return this.nativeLibraryWrapperService.quotedPrintable.encode(this.nativeLibraryWrapperService.utf8.encode(input)); - return ""; + return this.nativeLibraryWrapperService.quotedPrintable.encode(this.nativeLibraryWrapperService.utf8.encode(input)); } } diff --git a/src/app/converterregistry.service.ts b/src/app/converterregistry.service.ts index 1fea66c..af6e30b 100644 --- a/src/app/converterregistry.service.ts +++ b/src/app/converterregistry.service.ts @@ -12,11 +12,11 @@ import {DecToHexConverter} from "./converter/dectohexconverter"; import {HexToDecConverter} from "./converter/hextodecconverter"; import {DecToBinConverter} from "./converter/dectobinconverter"; import {BinToDecConverter} from "./converter/bintodecconverter"; -// import {QuotedPrintableDecoder} from "./converter/quotedprintabledecoder"; -// import {QuotedPrintableEncoder} from "./converter/quotedprintableencoder"; +import {QuotedPrintableDecoder} from "./converter/quotedprintabledecoder"; +import {QuotedPrintableEncoder} from "./converter/quotedprintableencoder"; import {NativeLibraryWrapperService} from "./nativelibrarywrapper.service"; -// import {PunycodeEncoder} from "./converter/punycodeencoder"; -// import {PunycodeDecoder} from "./converter/punycodedecoder"; +import {PunycodeEncoder} from "./converter/punycodeencoder"; +import {PunycodeDecoder} from "./converter/punycodedecoder"; @Injectable() export class ConverterRegistryService { @@ -48,14 +48,14 @@ export class ConverterRegistryService { this.registerConverter(new URIComponentDecoder()); this.registerConverter(new HTMLEntitiesEncoder()); this.registerConverter(new HTMLEntitiesDecoder()); - // this.registerConverter(new QuotedPrintableEncoder(this.wrapper)); - // this.registerConverter(new QuotedPrintableDecoder(this.wrapper)); + this.registerConverter(new QuotedPrintableEncoder(this.wrapper)); + this.registerConverter(new QuotedPrintableDecoder(this.wrapper)); this.registerConverter(new DecToHexConverter()); this.registerConverter(new HexToDecConverter()); this.registerConverter(new DecToBinConverter()); this.registerConverter(new BinToDecConverter()); - // this.registerConverter(new PunycodeEncoder(this.wrapper)); - // this.registerConverter(new PunycodeDecoder(this.wrapper)); + this.registerConverter(new PunycodeEncoder(this.wrapper)); + this.registerConverter(new PunycodeDecoder(this.wrapper)); } private registerConverter(converter:Converter):void { diff --git a/src/app/nativelibrarywrapper.service.ts b/src/app/nativelibrarywrapper.service.ts index 1ee1437..468b21d 100644 --- a/src/app/nativelibrarywrapper.service.ts +++ b/src/app/nativelibrarywrapper.service.ts @@ -1,18 +1,17 @@ import {Injectable} from "@angular/core"; - -declare var utf8:any; -declare var quotedPrintable:any; -declare var punycode:any; +import {Punycode} from "./punycode"; +import {Utf8} from "./utf8"; +import {QuotedPrintable} from "./quotedprintable"; @Injectable() export class NativeLibraryWrapperService { - // public utf8:any; - // public quotedPrintable:any; - // public punycode:any; + public utf8:Utf8; + public quotedPrintable:QuotedPrintable; + public punycode:Punycode; constructor() { - // this.utf8 = utf8; - // this.quotedPrintable = quotedPrintable; - // this.punycode = punycode; + this.utf8 = require("utf8"); + this.quotedPrintable = require("quoted-printable"); + this.punycode = require("punycode"); } } diff --git a/src/app/punycode.ts b/src/app/punycode.ts new file mode 100644 index 0000000..a141d24 --- /dev/null +++ b/src/app/punycode.ts @@ -0,0 +1,4 @@ +export interface Punycode { + encode(input:string):string; + decode(input:string):string; +} diff --git a/src/app/quotedprintable.ts b/src/app/quotedprintable.ts new file mode 100644 index 0000000..2cfb171 --- /dev/null +++ b/src/app/quotedprintable.ts @@ -0,0 +1,4 @@ +export interface QuotedPrintable { + encode(input:string):string; + decode(input:string):string; +} diff --git a/src/app/utf8.ts b/src/app/utf8.ts new file mode 100644 index 0000000..cce1ba8 --- /dev/null +++ b/src/app/utf8.ts @@ -0,0 +1,4 @@ +export interface Utf8 { + encode(input:any):string; + decode(input:string):any; +} diff --git a/src/vendor.ts b/src/vendor.ts index c7c86fe..bae9e0f 100644 --- a/src/vendor.ts +++ b/src/vendor.ts @@ -1,13 +1,5 @@ -import {Component, Injectable, NgModule, OnInit} from "@angular/core"; -import {BrowserModule} from "@angular/platform-browser"; -import {platformBrowserDynamic} from "@angular/platform-browser-dynamic"; -import {FormsModule} from "@angular/forms"; - +import "@angular/core"; +import "@angular/platform-browser"; +import "@angular/platform-browser-dynamic"; +import "@angular/forms"; import "rxjs"; - -import "utf8"; -import "quoted-printable"; -import "punycode"; -require("utf8"); -require("quoted-printable"); -require("punycode"); From 395b54c849e6f1d38d6fb01f679167b669c1c5b9 Mon Sep 17 00:00:00 2001 From: Manuel Friedli Date: Tue, 14 Mar 2017 23:46:57 +0100 Subject: [PATCH 16/17] Updated deploy process for the production environment. --- .gitlab-ci.yml | 27 ++++++++-------------- deploy.sh | 61 -------------------------------------------------- 2 files changed, 9 insertions(+), 79 deletions(-) delete mode 100755 deploy.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 09fe991..f38752a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,14 +2,7 @@ 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 @@ -48,17 +41,15 @@ pages: production: stage: deploy - <<: *run_deploy environment: production only: - master - variables: - ENVIRON: production - TARGET: $WWW_DEPLOY_ROOT_PRODUCTION + script: + - 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 diff --git a/deploy.sh b/deploy.sh deleted file mode 100755 index c21a4f3..0000000 --- a/deploy.sh +++ /dev/null @@ -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." From 0409f694909943ab6e6130514a663ef1ffbcc654 Mon Sep 17 00:00:00 2001 From: Manuel Friedli Date: Tue, 14 Mar 2017 23:54:42 +0100 Subject: [PATCH 17/17] Test for the target path variable being set --- .gitlab-ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f38752a..58779de 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -45,7 +45,8 @@ production: only: - master script: - - if [[ ! -d "${WWW_DEPLOY_ROOT_PRODUCTION}" ]] ; then mkdir -p "${WWW_DEPLOY_ROOT_PRODUCTION}" || die "Failed to create target directory for deployment!"; fi + - 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: