diff --git a/cli-diff-selector/.editorconfig b/.editorconfig similarity index 78% rename from cli-diff-selector/.editorconfig rename to .editorconfig index 6e87a00..e89330a 100644 --- a/cli-diff-selector/.editorconfig +++ b/.editorconfig @@ -1,4 +1,4 @@ -# Editor configuration, see http://editorconfig.org +# Editor configuration, see https://editorconfig.org root = true [*] diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 243b502..0000000 --- a/.eslintignore +++ /dev/null @@ -1,142 +0,0 @@ -# Created by .ignore support plugin (hsz.mobi) -### Node template -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* - -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage - -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Bower dependency directory (https://bower.io/) -bower_components - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (https://nodejs.org/api/addons.html) -build/Release - -# Dependency directories -node_modules/ -jspm_packages/ - -# Typescript v1 declaration files -typings/ - -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - -# Optional REPL history -.node_repl_history - -# Output of 'npm pack' -*.tgz - -# Yarn Integrity file -.yarn-integrity - -# dotenv environment variables file -.env - -### macOS template -# General -.DS_Store -.AppleDouble -.LSOverride - -# Icon must end with two \r -Icon - -# Thumbnails -._* - -# Files that might appear in the root of a volume -.DocumentRevisions-V100 -.fseventsd -.Spotlight-V100 -.TemporaryItems -.Trashes -.VolumeIcon.icns -.com.apple.timemachine.donotpresent - -# Directories potentially created on remote AFP share -.AppleDB -.AppleDesktop -Network Trash Folder -Temporary Items -.apdisk -### JetBrains template -# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm -# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 - -# User-specific stuff: -.idea/**/workspace.xml -.idea/**/tasks.xml -.idea/dictionaries - -# Sensitive or high-churn files: -.idea/**/dataSources/ -.idea/**/dataSources.ids -.idea/**/dataSources.xml -.idea/**/dataSources.local.xml -.idea/**/sqlDataSources.xml -.idea/**/dynamic.xml -.idea/**/uiDesigner.xml - -# Gradle: -.idea/**/gradle.xml -.idea/**/libraries - -# CMake -cmake-build-debug/ - -# Mongo Explorer plugin: -.idea/**/mongoSettings.xml - -## File-based project format: -*.iws - -## Plugin-specific files: - -# IntelliJ -out/ - -# mpeltonen/sbt-idea plugin -.idea_modules/ - -# JIRA plugin -atlassian-ide-plugin.xml - -# Cursive Clojure plugin -.idea/replstate.xml - -# Crashlytics plugin (for Android Studio and IntelliJ) -com_crashlytics_export_strings.xml -crashlytics.properties -crashlytics-build.properties -fabric.properties - -app/ -testApp/ -cli-diff-selector/ diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index c482ad1..0000000 --- a/.eslintrc.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "env": { - "node": true, - "commonjs": true, - "es6": true - }, - "extends": "eslint:recommended", - "rules": { - "indent": [ - "error", - 4 - ], - "linebreak-style": [ - "error", - "unix" - ], - "quotes": [ - "error", - "single" - ], - "semi": [ - "error", - "always" - ], - "no-console": 0, - "no-shadow": [ - "error", - { - "builtinGlobals": true, - "hoist": "functions", - "allow": [] - } - ] - } -} diff --git a/.gitignore b/.gitignore index 06f9c5f..f4f46a5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,143 +1,46 @@ -# Created by .ignore support plugin (hsz.mobi) -### Node template -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* - -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage - -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Bower dependency directory (https://bower.io/) -bower_components - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (https://nodejs.org/api/addons.html) -build/Release - -# Dependency directories -node_modules/ -jspm_packages/ - -# Typescript v1 declaration files -typings/ - -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - -# Optional REPL history -.node_repl_history - -# Output of 'npm pack' -*.tgz - -# Yarn Integrity file -.yarn-integrity - -# dotenv environment variables file -.env - -### macOS template -# General +# See http://help.github.com/ignore-files/ for more about ignoring files. + +# compiled output +/dist +/tmp +/out-tsc +# Only exists if Bazel was run +/bazel-out + +# dependencies +/node_modules + +# profiling files +chrome-profiler-events.json +speed-measure-plugin.json + +# IDEs and editors +/.idea +.project +.classpath +.c9/ +*.launch +.settings/ +*.sublime-workspace + +# IDE - VSCode +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +.history/* + +# misc +/.sass-cache +/connect.lock +/coverage +/libpeerconnection.log +npm-debug.log +yarn-error.log +testem.log +/typings + +# System Files .DS_Store -.AppleDouble -.LSOverride - -# Icon must end with two \r -Icon - -# Thumbnails -._* - -# Files that might appear in the root of a volume -.DocumentRevisions-V100 -.fseventsd -.Spotlight-V100 -.TemporaryItems -.Trashes -.VolumeIcon.icns -.com.apple.timemachine.donotpresent - -# Directories potentially created on remote AFP share -.AppleDB -.AppleDesktop -Network Trash Folder -Temporary Items -.apdisk -### JetBrains template -# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm -# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 - -# User-specific stuff: -.idea/**/workspace.xml -.idea/**/tasks.xml -.idea/dictionaries - -# Sensitive or high-churn files: -.idea/**/dataSources/ -.idea/**/dataSources.ids -.idea/**/dataSources.xml -.idea/**/dataSources.local.xml -.idea/**/sqlDataSources.xml -.idea/**/dynamic.xml -.idea/**/uiDesigner.xml - -# Gradle: -.idea/**/gradle.xml -.idea/**/libraries - -# CMake -cmake-build-debug/ - -# Mongo Explorer plugin: -.idea/**/mongoSettings.xml - -## File-based project format: -*.iws - -## Plugin-specific files: - -# IntelliJ -out/ - -# mpeltonen/sbt-idea plugin -.idea_modules/ - -# JIRA plugin -atlassian-ide-plugin.xml - -# Cursive Clojure plugin -.idea/replstate.xml - -# Crashlytics plugin (for Android Studio and IntelliJ) -com_crashlytics_export_strings.xml -crashlytics.properties -crashlytics-build.properties -fabric.properties - -/testApp/ -/app/ -/deploy_key -/deploy_key.pub +Thumbs.db diff --git a/cli-diff-selector/src/assets/.gitkeep b/.gitkeep similarity index 100% rename from cli-diff-selector/src/assets/.gitkeep rename to .gitkeep diff --git a/.idea/angular-cli-diff.iml b/.idea/angular-cli-diff.iml deleted file mode 100644 index fdf7d80..0000000 --- a/.idea/angular-cli-diff.iml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/codeStyleSettings.xml b/.idea/codeStyleSettings.xml deleted file mode 100644 index f5770e9..0000000 --- a/.idea/codeStyleSettings.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml deleted file mode 100644 index 8d66637..0000000 --- a/.idea/inspectionProfiles/Project_Default.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 88c2979..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - Dart - - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 7413a84..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/watcherTasks.xml b/.idea/watcherTasks.xml deleted file mode 100644 index 9338ba6..0000000 --- a/.idea/watcherTasks.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 8d69591..0000000 --- a/.travis.yml +++ /dev/null @@ -1,32 +0,0 @@ -language: node_js - -node_js: - - "node" - -before_install: - # Setup the github deployment key for pushs - - openssl aes-256-cbc -K $encrypted_3582d3969d58_key -iv $encrypted_3582d3969d58_iv -in deploy_key.enc -out deploy_key -d - - chmod 600 deploy_key - - eval $(ssh-agent -s) - - ssh-add deploy_key - -install: - - npm install - - npm run lint - -script: - - if [ "$TRAVIS_BRANCH" == "deploy" ]; then - npm start; - cd cli-diff-selector; - npm install; - echo "[" > src/assets/versions.json; - git branch -r | grep -v base | awk -F/ '/\/ng/{print "\""$3"\","}' | uniq | tr -d '\n' | sed 's/.$//' >> src/assets/versions.json; - echo "]" >> src/assets/versions.json; - cat src/assets/versions.json; - export DEMO_DIST=$(pwd)/dist; - node_modules/.bin/ng build --prod; - cd ..; - ./deploy.sh; - else - echo "Not on deploy branch"; - fi diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 8906445..0000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2017 Sebastian Fuss - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/README.md b/README.md index a088c94..2d72a8b 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,27 @@ -# @angular/cli diff +# TestApp -See the diffs of `@angular/cli` generated apps for easier upgrades +This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 7.3.10. -Note: This project does not offer an automated way of upgrading your `@angular/cli` based app. -It only offers git diffs between the different versions for easy manual upgrading. +## Development server -## How to +Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files. -- Visit [nolanus.github.io/angular-cli-diff](http://nolanus.github.io/angular-cli-diff) and select your current and the target version -- Click to compare button to show the diff of the generated project -- Go over the changes and apply the changes to your codebase -- Update the `@angular/cli` version in your `package.json` and run `npm i` +## Code scaffolding -## Why +Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. -The official `@angular/cli` does not offer an automated way to upgrade to a newer version of their generator. This -leaves the developers with manually comparing the changes to the angular application architecture and upgrading or -upgrading the cli without adjusting and hoping for the best. -This project tries to point out the necessary differences in the generated apps so that developers can manually -upgrade their files and use the newer `@angular/cli` versions. +## Build -## Development +Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build. -This repo is generated using a node script which checks for the released `@angular/cli` versions an generates -a new app whenever there is a new release detected. Additionally the subgenerators for services/pipes/components/... -are used. All code is committed onto separate branches in this repo. +## Running unit tests + +Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). + +## Running end-to-end tests + +Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/). + +## Further help + +To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md). diff --git a/angular.json b/angular.json new file mode 100644 index 0000000..585147b --- /dev/null +++ b/angular.json @@ -0,0 +1,136 @@ +{ + "$schema": "./node_modules/@angular/cli/lib/config/schema.json", + "version": 1, + "newProjectRoot": "projects", + "projects": { + "testApp": { + "root": "", + "sourceRoot": "src", + "projectType": "application", + "prefix": "app", + "schematics": {}, + "architect": { + "build": { + "builder": "@angular-devkit/build-angular:browser", + "options": { + "outputPath": "dist/testApp", + "index": "src/index.html", + "main": "src/main.ts", + "polyfills": "src/polyfills.ts", + "tsConfig": "src/tsconfig.app.json", + "assets": [ + "src/favicon.ico", + "src/assets" + ], + "styles": [ + "src/styles.css" + ], + "scripts": [], + "es5BrowserSupport": true + }, + "configurations": { + "production": { + "fileReplacements": [ + { + "replace": "src/environments/environment.ts", + "with": "src/environments/environment.prod.ts" + } + ], + "optimization": true, + "outputHashing": "all", + "sourceMap": false, + "extractCss": true, + "namedChunks": false, + "aot": true, + "extractLicenses": true, + "vendorChunk": false, + "buildOptimizer": true, + "budgets": [ + { + "type": "initial", + "maximumWarning": "2mb", + "maximumError": "5mb" + } + ] + } + } + }, + "serve": { + "builder": "@angular-devkit/build-angular:dev-server", + "options": { + "browserTarget": "testApp:build" + }, + "configurations": { + "production": { + "browserTarget": "testApp:build:production" + } + } + }, + "extract-i18n": { + "builder": "@angular-devkit/build-angular:extract-i18n", + "options": { + "browserTarget": "testApp:build" + } + }, + "test": { + "builder": "@angular-devkit/build-angular:karma", + "options": { + "main": "src/test.ts", + "polyfills": "src/polyfills.ts", + "tsConfig": "src/tsconfig.spec.json", + "karmaConfig": "src/karma.conf.js", + "styles": [ + "src/styles.css" + ], + "scripts": [], + "assets": [ + "src/favicon.ico", + "src/assets" + ] + } + }, + "lint": { + "builder": "@angular-devkit/build-angular:tslint", + "options": { + "tsConfig": [ + "src/tsconfig.app.json", + "src/tsconfig.spec.json" + ], + "exclude": [ + "**/node_modules/**" + ] + } + } + } + }, + "testApp-e2e": { + "root": "e2e/", + "projectType": "application", + "prefix": "", + "architect": { + "e2e": { + "builder": "@angular-devkit/build-angular:protractor", + "options": { + "protractorConfig": "e2e/protractor.conf.js", + "devServerTarget": "testApp:serve" + }, + "configurations": { + "production": { + "devServerTarget": "testApp:serve:production" + } + } + }, + "lint": { + "builder": "@angular-devkit/build-angular:tslint", + "options": { + "tsConfig": "e2e/tsconfig.e2e.json", + "exclude": [ + "**/node_modules/**" + ] + } + } + } + } + }, + "defaultProject": "testApp" +} \ No newline at end of file diff --git a/cli-diff-selector/.angular-cli.json b/cli-diff-selector/.angular-cli.json deleted file mode 100644 index fddb3b3..0000000 --- a/cli-diff-selector/.angular-cli.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "$schema": "./node_modules/@angular/cli/lib/config/schema.json", - "project": { - "name": "cli-diff-selector" - }, - "apps": [ - { - "root": "src", - "outDir": "dist", - "assets": [ - "assets", - "favicon.ico" - ], - "index": "index.html", - "main": "main.ts", - "polyfills": "polyfills.ts", - "test": "test.ts", - "tsconfig": "tsconfig.app.json", - "testTsconfig": "tsconfig.spec.json", - "prefix": "app", - "styles": [ - "styles.css" - ], - "scripts": [], - "environmentSource": "environments/environment.ts", - "environments": { - "dev": "environments/environment.ts", - "prod": "environments/environment.prod.ts" - } - } - ], - "e2e": { - "protractor": { - "config": "./protractor.conf.js" - } - }, - "lint": [ - { - "project": "src/tsconfig.app.json", - "exclude": "**/node_modules/**" - }, - { - "project": "src/tsconfig.spec.json", - "exclude": "**/node_modules/**" - }, - { - "project": "e2e/tsconfig.e2e.json", - "exclude": "**/node_modules/**" - } - ], - "test": { - "karma": { - "config": "./karma.conf.js" - } - }, - "defaults": { - "styleExt": "css", - "component": {} - } -} diff --git a/cli-diff-selector/.gitignore b/cli-diff-selector/.gitignore deleted file mode 100644 index 54bfd20..0000000 --- a/cli-diff-selector/.gitignore +++ /dev/null @@ -1,42 +0,0 @@ -# See http://help.github.com/ignore-files/ for more about ignoring files. - -# compiled output -/dist -/tmp -/out-tsc - -# dependencies -/node_modules - -# IDEs and editors -/.idea -.project -.classpath -.c9/ -*.launch -.settings/ -*.sublime-workspace - -# IDE - VSCode -.vscode/* -!.vscode/settings.json -!.vscode/tasks.json -!.vscode/launch.json -!.vscode/extensions.json - -# misc -/.sass-cache -/connect.lock -/coverage -/libpeerconnection.log -npm-debug.log -testem.log -/typings - -# e2e -/e2e/*.js -/e2e/*.map - -# System Files -.DS_Store -Thumbs.db diff --git a/cli-diff-selector/README.md b/cli-diff-selector/README.md deleted file mode 100644 index a5466bd..0000000 --- a/cli-diff-selector/README.md +++ /dev/null @@ -1,27 +0,0 @@ -# CliDiffSelector - -This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.5.0. - -## Development server - -Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files. - -## Code scaffolding - -Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. - -## Build - -Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build. - -## Running unit tests - -Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). - -## Running end-to-end tests - -Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/). - -## Further help - -To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md). diff --git a/cli-diff-selector/e2e/app.e2e-spec.ts b/cli-diff-selector/e2e/app.e2e-spec.ts deleted file mode 100644 index 702c282..0000000 --- a/cli-diff-selector/e2e/app.e2e-spec.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { AppPage } from './app.po'; - -describe('cli-diff-selector App', () => { - let page: AppPage; - - beforeEach(() => { - page = new AppPage(); - }); - - it('should display welcome message', () => { - page.navigateTo(); - expect(page.getParagraphText()).toEqual('Welcome to app!'); - }); -}); diff --git a/cli-diff-selector/e2e/app.po.ts b/cli-diff-selector/e2e/app.po.ts deleted file mode 100644 index 82ea75b..0000000 --- a/cli-diff-selector/e2e/app.po.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { browser, by, element } from 'protractor'; - -export class AppPage { - navigateTo() { - return browser.get('/'); - } - - getParagraphText() { - return element(by.css('app-root h1')).getText(); - } -} diff --git a/cli-diff-selector/package.json b/cli-diff-selector/package.json deleted file mode 100644 index 17e91dd..0000000 --- a/cli-diff-selector/package.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "name": "cli-diff-selector", - "version": "0.0.0", - "license": "MIT", - "scripts": { - "ng": "ng", - "start": "ng serve", - "build": "ng build", - "test": "ng test", - "lint": "ng lint", - "e2e": "ng e2e" - }, - "private": true, - "dependencies": { - "@angular/animations": "^5.0.1", - "@angular/cdk": "^5.0.0-rc0", - "@angular/common": "^5.0.0", - "@angular/compiler": "^5.0.0", - "@angular/core": "^5.0.0", - "@angular/forms": "^5.0.0", - "@angular/http": "^5.0.0", - "@angular/material": "^5.0.0-rc0", - "@angular/platform-browser": "^5.0.0", - "@angular/platform-browser-dynamic": "^5.0.0", - "@angular/router": "^5.0.0", - "core-js": "^2.4.1", - "normalize.css": "^7.0.0", - "rxjs": "^5.5.2", - "zone.js": "^0.8.14" - }, - "devDependencies": { - "@angular/cli": "1.5.0", - "@angular/compiler-cli": "^5.0.0", - "@angular/language-service": "^5.0.0", - "@types/jasmine": "~2.5.53", - "@types/jasminewd2": "~2.0.2", - "@types/node": "~6.0.60", - "codelyzer": "~4.0.1", - "jasmine-core": "~2.6.2", - "jasmine-spec-reporter": "~4.1.0", - "karma": "~1.7.0", - "karma-chrome-launcher": "~2.1.1", - "karma-cli": "~1.0.1", - "karma-coverage-istanbul-reporter": "^1.2.1", - "karma-jasmine": "~1.1.0", - "karma-jasmine-html-reporter": "^0.2.2", - "protractor": "~5.1.2", - "ts-node": "~3.2.0", - "tslint": "~5.7.0", - "typescript": "~2.4.2" - } -} diff --git a/cli-diff-selector/src/app/app.component.css b/cli-diff-selector/src/app/app.component.css deleted file mode 100644 index 1ed91ef..0000000 --- a/cli-diff-selector/src/app/app.component.css +++ /dev/null @@ -1,19 +0,0 @@ -.toolbar-spacer { - flex: 1; -} - -mat-card { - text-align: center; -} - -mat-form-field { - width: 85%; -} - -mat-grid-list.selector-grid { - font-size: 180%; -} - -.github-button img { - height: 24px; -} diff --git a/cli-diff-selector/src/app/app.component.html b/cli-diff-selector/src/app/app.component.html deleted file mode 100644 index f60079b..0000000 --- a/cli-diff-selector/src/app/app.component.html +++ /dev/null @@ -1,50 +0,0 @@ -
- - @angular/cli diff - - - GitHub GitHub - - - - -

- Select the respective - @angular/cli versions and press the compare button to get a git diff for easy manual version upgrade. -

- - - - - -- - - {{ version }} - - - Please choose a version - - - - arrow_forward - - - - - -- - - {{ version }} - - - Please choose a version - Please choose later version than your current - - - - - - -
- -
diff --git a/cli-diff-selector/src/app/app.component.ts b/cli-diff-selector/src/app/app.component.ts deleted file mode 100644 index 0782908..0000000 --- a/cli-diff-selector/src/app/app.component.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import { HttpClient } from '@angular/common/http'; -import { FormControl, Validators, AbstractControl } from '@angular/forms'; - -@Component({ - selector: 'app-root', - templateUrl: './app.component.html', - styleUrls: ['./app.component.css'] -}) -export class AppComponent implements OnInit { - public readonly githubUrl = 'https://github.com/Nolanus/angular-cli-diff'; - - currentVersionControl = new FormControl('', [Validators.required]); - targetVersionControl = new FormControl('', [Validators.required, (control: AbstractControl): { [key: string]: any } => { - return this.currentVersionControl.value.index >= control.value.index ? { 'downgradeNotPossible': true } : null; - }]); - - public versions: string[] = []; - constructor(httpClient: HttpClient) { - httpClient.get('assets/versions.json').subscribe((data: string[]) => { - this.versions = data; - }); - } - - ngOnInit(): void { - this.currentVersionControl.valueChanges.subscribe(() => { - this.targetVersionControl.updateValueAndValidity(); - }); - } - - public compare() { - window.location.replace(this.githubUrl + '/compare/ng/' + - this.currentVersionControl.value.version + '/app...ng/' + this.targetVersionControl.value.version + '/app#diff'); - } -} diff --git a/cli-diff-selector/src/app/app.module.ts b/cli-diff-selector/src/app/app.module.ts deleted file mode 100644 index d6afe63..0000000 --- a/cli-diff-selector/src/app/app.module.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { BrowserModule } from '@angular/platform-browser'; -import { NgModule } from '@angular/core'; -import { HttpClientModule } from '@angular/common/http'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; - -import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; -import { MatToolbarModule } from '@angular/material/toolbar'; -import { MatCardModule } from '@angular/material/card'; -import { MatGridListModule } from '@angular/material/grid-list'; -import { MatSelectModule } from '@angular/material/select'; -import { MatButtonModule } from '@angular/material/button'; -import { MatIconModule } from '@angular/material/icon'; - -import { AppComponent } from './app.component'; - - -@NgModule({ - declarations: [ - AppComponent - ], - imports: [ - BrowserModule, - HttpClientModule, - BrowserAnimationsModule, - FormsModule, - ReactiveFormsModule, - MatToolbarModule, - MatCardModule, - MatGridListModule, - MatSelectModule, - MatButtonModule, - MatIconModule - ], - providers: [], - bootstrap: [AppComponent] -}) -export class AppModule { } diff --git a/cli-diff-selector/src/assets/github.svg b/cli-diff-selector/src/assets/github.svg deleted file mode 100644 index ab110f4..0000000 --- a/cli-diff-selector/src/assets/github.svg +++ /dev/null @@ -1,5 +0,0 @@ - - GitHub icon - - diff --git a/cli-diff-selector/src/assets/versions.json b/cli-diff-selector/src/assets/versions.json deleted file mode 100644 index e9cecf0..0000000 --- a/cli-diff-selector/src/assets/versions.json +++ /dev/null @@ -1,9 +0,0 @@ -[ - "1.0.0", - "1.0.1", - "1.0.2", - "1.0.3", - "1.0.4", - "1.0.5", - "1.0.6" -] diff --git a/cli-diff-selector/src/environments/environment.ts b/cli-diff-selector/src/environments/environment.ts deleted file mode 100644 index b7f639a..0000000 --- a/cli-diff-selector/src/environments/environment.ts +++ /dev/null @@ -1,8 +0,0 @@ -// The file contents for the current environment will overwrite these during build. -// The build system defaults to the dev environment which uses `environment.ts`, but if you do -// `ng build --env=prod` then `environment.prod.ts` will be used instead. -// The list of which env maps to which file can be found in `.angular-cli.json`. - -export const environment = { - production: false -}; diff --git a/cli-diff-selector/src/polyfills.ts b/cli-diff-selector/src/polyfills.ts deleted file mode 100644 index 20d4075..0000000 --- a/cli-diff-selector/src/polyfills.ts +++ /dev/null @@ -1,76 +0,0 @@ -/** - * This file includes polyfills needed by Angular and is loaded before the app. - * You can add your own extra polyfills to this file. - * - * This file is divided into 2 sections: - * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. - * 2. Application imports. Files imported after ZoneJS that should be loaded before your main - * file. - * - * The current setup is for so-called "evergreen" browsers; the last versions of browsers that - * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), - * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. - * - * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html - */ - -/*************************************************************************************************** - * BROWSER POLYFILLS - */ - -/** IE9, IE10 and IE11 requires all of the following polyfills. **/ -// import 'core-js/es6/symbol'; -// import 'core-js/es6/object'; -// import 'core-js/es6/function'; -// import 'core-js/es6/parse-int'; -// import 'core-js/es6/parse-float'; -// import 'core-js/es6/number'; -// import 'core-js/es6/math'; -// import 'core-js/es6/string'; -// import 'core-js/es6/date'; -// import 'core-js/es6/array'; -// import 'core-js/es6/regexp'; -// import 'core-js/es6/map'; -// import 'core-js/es6/weak-map'; -// import 'core-js/es6/set'; - -/** IE10 and IE11 requires the following for NgClass support on SVG elements */ -// import 'classlist.js'; // Run `npm install --save classlist.js`. - -/** IE10 and IE11 requires the following for the Reflect API. */ -// import 'core-js/es6/reflect'; - - -/** Evergreen browsers require these. **/ -// Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove. -import 'core-js/es7/reflect'; - - -/** - * Required to support Web Animations `@angular/platform-browser/animations`. - * Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation - **/ -// import 'web-animations-js'; // Run `npm install --save web-animations-js`. - - - -/*************************************************************************************************** - * Zone JS is required by Angular itself. - */ -import 'zone.js/dist/zone'; // Included with Angular CLI. - - - -/*************************************************************************************************** - * APPLICATION IMPORTS - */ - -/** - * Date, currency, decimal and percent pipes. - * Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10 - */ -// import 'intl'; // Run `npm install --save intl`. -/** - * Need to import at least one locale-data with intl. - */ -// import 'intl/locale-data/jsonp/en'; diff --git a/cli-diff-selector/src/styles.css b/cli-diff-selector/src/styles.css deleted file mode 100644 index 5595bd1..0000000 --- a/cli-diff-selector/src/styles.css +++ /dev/null @@ -1,3 +0,0 @@ -/* You can add global styles to this file, and also import other style files */ -@import "~normalize.css/normalize.css"; -@import "~@angular/material/prebuilt-themes/indigo-pink.css"; diff --git a/cli-diff-selector/src/typings.d.ts b/cli-diff-selector/src/typings.d.ts deleted file mode 100644 index ef5c7bd..0000000 --- a/cli-diff-selector/src/typings.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -/* SystemJS module definition */ -declare var module: NodeModule; -interface NodeModule { - id: string; -} diff --git a/cli-diff-selector/tslint.json b/cli-diff-selector/tslint.json deleted file mode 100644 index c24dc29..0000000 --- a/cli-diff-selector/tslint.json +++ /dev/null @@ -1,141 +0,0 @@ -{ - "rulesDirectory": [ - "node_modules/codelyzer" - ], - "rules": { - "arrow-return-shorthand": true, - "callable-types": true, - "class-name": true, - "comment-format": [ - true, - "check-space" - ], - "curly": true, - "eofline": true, - "forin": true, - "import-blacklist": [ - true, - "rxjs", - "rxjs/Rx" - ], - "import-spacing": true, - "indent": [ - true, - "spaces" - ], - "interface-over-type-literal": true, - "label-position": true, - "max-line-length": [ - true, - 140 - ], - "member-access": false, - "member-ordering": [ - true, - { - "order": [ - "static-field", - "instance-field", - "static-method", - "instance-method" - ] - } - ], - "no-arg": true, - "no-bitwise": true, - "no-console": [ - true, - "debug", - "info", - "time", - "timeEnd", - "trace" - ], - "no-construct": true, - "no-debugger": true, - "no-duplicate-super": true, - "no-empty": false, - "no-empty-interface": true, - "no-eval": true, - "no-inferrable-types": [ - true, - "ignore-params" - ], - "no-misused-new": true, - "no-non-null-assertion": true, - "no-shadowed-variable": true, - "no-string-literal": false, - "no-string-throw": true, - "no-switch-case-fall-through": true, - "no-trailing-whitespace": true, - "no-unnecessary-initializer": true, - "no-unused-expression": true, - "no-use-before-declare": true, - "no-var-keyword": true, - "object-literal-sort-keys": false, - "one-line": [ - true, - "check-open-brace", - "check-catch", - "check-else", - "check-whitespace" - ], - "prefer-const": true, - "quotemark": [ - true, - "single" - ], - "radix": true, - "semicolon": [ - true, - "always" - ], - "triple-equals": [ - true, - "allow-null-check" - ], - "typedef-whitespace": [ - true, - { - "call-signature": "nospace", - "index-signature": "nospace", - "parameter": "nospace", - "property-declaration": "nospace", - "variable-declaration": "nospace" - } - ], - "typeof-compare": true, - "unified-signatures": true, - "variable-name": false, - "whitespace": [ - true, - "check-branch", - "check-decl", - "check-operator", - "check-separator", - "check-type" - ], - "directive-selector": [ - true, - "attribute", - "app", - "camelCase" - ], - "component-selector": [ - true, - "element", - "app", - "kebab-case" - ], - "use-input-property-decorator": true, - "use-output-property-decorator": true, - "use-host-property-decorator": true, - "no-input-rename": true, - "no-output-rename": true, - "use-life-cycle-interface": true, - "use-pipe-transform-interface": true, - "component-class-suffix": true, - "directive-class-suffix": true, - "invoke-injectable": true - } -} diff --git a/deploy.sh b/deploy.sh deleted file mode 100755 index dbf021d..0000000 --- a/deploy.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/bash -set -e # Exit with nonzero exit code if anything fails - -SOURCE_BRANCH="deploy" -TARGET_BRANCH="gh-pages" - -# Pull requests and commits to other branches shouldn't try to deploy, just build to verify -if [ "$TRAVIS_PULL_REQUEST" != "false" -o "$TRAVIS_BRANCH" != "$SOURCE_BRANCH" ]; then - echo "Skipping deploy; Not correct branch or just a PR" - exit 0 -fi - -# Save some useful information -REPO=$(git config remote.origin.url) -SSH_REPO=${REPO/https:\/\/github.com\//git@github.com:} -SHA=$(git rev-parse --verify HEAD) - -# Clone the existing gh-pages for this repo into ghpages/ -# Create a new empty branch if gh-pages doesn't exist yet (should only happen on first deploy) -git clone $REPO ghpages -cd ghpages -git checkout $TARGET_BRANCH || git checkout --orphan $TARGET_BRANCH -# Clean out existing contents (except for the .git dir) -ls -A1 | grep -v .git | xargs rm -rf || exit 0 - -cd .. - -# Copy over the build/compiled files from the demo app -echo "Moving over the demo dist from $DEMO_DIST" -cp -a $DEMO_DIST/. ghpages/ - -# Now let's go have some fun with the cloned repo -echo "Go into ghpages folder" -cd ghpages - -# Adjust the baseurl href property to meet the one of github pages -echo "Adjust base href" -sed -i -e 's/base href="\/"/base href="\/angular-cli-diff\/"/g' index.html - -# Configure git -echo "Configure git" -git config user.name "Travis CI" -git config user.email "$COMMIT_AUTHOR_EMAIL" - -echo "Check git diff status" -# If there are no changes to the compiled out (e.g. this is a README update) then just bail. -if [ $(git status --porcelain | wc -l) -lt 1 ]; then - echo "No changes to the output on this push; exiting." - exit 0 -fi - -# Commit the "changes", i.e. the new version. -# The delta will show diffs between new and old versions. -echo "Committing the changes" -git add -A . -git commit -m "Deploy to GitHub Pages: ${SHA}" - -# Now that we're all set up, we can push. -echo "Pushing to Github" -git push $SSH_REPO $TARGET_BRANCH diff --git a/deploy_key.enc b/deploy_key.enc deleted file mode 100644 index 4b461ce..0000000 Binary files a/deploy_key.enc and /dev/null differ diff --git a/cli-diff-selector/protractor.conf.js b/e2e/protractor.conf.js similarity index 86% rename from cli-diff-selector/protractor.conf.js rename to e2e/protractor.conf.js index 7ee3b5e..86776a3 100644 --- a/cli-diff-selector/protractor.conf.js +++ b/e2e/protractor.conf.js @@ -6,7 +6,7 @@ const { SpecReporter } = require('jasmine-spec-reporter'); exports.config = { allScriptsTimeout: 11000, specs: [ - './e2e/**/*.e2e-spec.ts' + './src/**/*.e2e-spec.ts' ], capabilities: { 'browserName': 'chrome' @@ -21,8 +21,8 @@ exports.config = { }, onPrepare() { require('ts-node').register({ - project: 'e2e/tsconfig.e2e.json' + project: require('path').join(__dirname, './tsconfig.e2e.json') }); jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); } -}; +}; \ No newline at end of file diff --git a/e2e/src/app.e2e-spec.ts b/e2e/src/app.e2e-spec.ts new file mode 100644 index 0000000..82634fa --- /dev/null +++ b/e2e/src/app.e2e-spec.ts @@ -0,0 +1,23 @@ +import { AppPage } from './app.po'; +import { browser, logging } from 'protractor'; + +describe('workspace-project App', () => { + let page: AppPage; + + beforeEach(() => { + page = new AppPage(); + }); + + it('should display welcome message', () => { + page.navigateTo(); + expect(page.getTitleText()).toEqual('Welcome to testApp!'); + }); + + afterEach(async () => { + // Assert that there are no errors emitted from the browser + const logs = await browser.manage().logs().get(logging.Type.BROWSER); + expect(logs).not.toContain(jasmine.objectContaining({ + level: logging.Level.SEVERE, + } as logging.Entry)); + }); +}); diff --git a/e2e/src/app.po.ts b/e2e/src/app.po.ts new file mode 100644 index 0000000..5776aa9 --- /dev/null +++ b/e2e/src/app.po.ts @@ -0,0 +1,11 @@ +import { browser, by, element } from 'protractor'; + +export class AppPage { + navigateTo() { + return browser.get(browser.baseUrl) as Promise; + } + + getTitleText() { + return element(by.css('app-root h1')).getText() as Promise; + } +} diff --git a/cli-diff-selector/e2e/tsconfig.e2e.json b/e2e/tsconfig.e2e.json similarity index 76% rename from cli-diff-selector/e2e/tsconfig.e2e.json rename to e2e/tsconfig.e2e.json index 1d9e5ed..a6dd622 100644 --- a/cli-diff-selector/e2e/tsconfig.e2e.json +++ b/e2e/tsconfig.e2e.json @@ -1,8 +1,7 @@ { "extends": "../tsconfig.json", "compilerOptions": { - "outDir": "../out-tsc/e2e", - "baseUrl": "./", + "outDir": "../out-tsc/app", "module": "commonjs", "target": "es5", "types": [ @@ -11,4 +10,4 @@ "node" ] } -} +} \ No newline at end of file diff --git a/package.json b/package.json index 163c56f..ac7a12e 100644 --- a/package.json +++ b/package.json @@ -1,31 +1,48 @@ { - "name": "angular-cli-diff", - "version": "1.0.0", - "description": "See the diffs of angular-cli generated apps for easier upgrades", - "main": "run.js", + "name": "test-app", + "version": "0.0.0", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1", - "lint": "eslint ./**/*.js", - "start": "node run.js" + "ng": "ng", + "start": "ng serve", + "build": "ng build", + "test": "ng test", + "lint": "ng lint", + "e2e": "ng e2e" }, - "author": "Sebastian Fuss ", - "license": "MIT", - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/Nolanus/angular-cli-diff.git" - }, - "bugs": { - "url": "https://github.com/Nolanus/angular-cli-diff/issues" - }, - "homepage": "https://github.com/Nolanus/angular-cli-diff#readme", + "private": true, "dependencies": { - "async": "^2.5.0", - "chalk": "^2.3.0", - "glob-move": "^1.0.1", - "npm": "^4.6.1", - "rimraf": "^2.6.2" + "@angular/animations": "~7.2.0", + "@angular/common": "~7.2.0", + "@angular/compiler": "~7.2.0", + "@angular/core": "~7.2.0", + "@angular/forms": "~7.2.0", + "@angular/platform-browser": "~7.2.0", + "@angular/platform-browser-dynamic": "~7.2.0", + "@angular/router": "~7.2.0", + "core-js": "^2.5.4", + "rxjs": "~6.3.3", + "tslib": "^1.9.0", + "zone.js": "~0.8.26" }, "devDependencies": { - "eslint": "^4.10.0" + "@angular-devkit/build-angular": "~0.13.0", + "@angular/cli": "~7.3.10", + "@angular/compiler-cli": "~7.2.0", + "@angular/language-service": "~7.2.0", + "@types/node": "~8.9.4", + "@types/jasmine": "~2.8.8", + "@types/jasminewd2": "~2.0.3", + "codelyzer": "~4.5.0", + "jasmine-core": "~2.99.1", + "jasmine-spec-reporter": "~4.2.1", + "karma": "~4.0.0", + "karma-chrome-launcher": "~2.2.0", + "karma-coverage-istanbul-reporter": "~2.0.1", + "karma-jasmine": "~1.1.2", + "karma-jasmine-html-reporter": "^0.2.2", + "protractor": "~5.4.0", + "ts-node": "~7.0.0", + "tslint": "~5.11.0", + "typescript": "~3.2.2" } } diff --git a/run.js b/run.js deleted file mode 100644 index 4843340..0000000 --- a/run.js +++ /dev/null @@ -1,159 +0,0 @@ -// Versions to be ignored, e.g. due to serious bugs that prevent them from functioning -const ignoreVersions = [ - '1.0.0-beta.28.3', - '1.3.0-rc.4', - '1.4.0-rc.0', - '1.5.0-beta.0', - '1.5.0-beta.1', - '1.5.0-beta.2', - '6.0.0-beta.4', - '6.0.0-beta.5', - '6.0.0-rc.2', - '6.0.0-rc.3', - '6.0.0-rc.4', - '6.0.0-rc.7', - '6.0.0-rc.8', - '6.0.0-rc.9', - '6.0.4', - '6.1.0-beta.0', - '6.1.0-beta.2', - '6.1.0-rc.0', - '6.1.0-rc.1', - '6.1.0-rc.2', - '6.1.0-rc.3', - '6.1.0', - '6.1.1', - '6.1.2', - '6.2.0-beta.0', - '6.2.0-beta.1', -]; - -const chalk = require('chalk'); -const async = require('async'); - -const ngCli = require('./util/ngcli'); -const npm = require('./util/npm'); -const gitUtil = require('./util/git'); - -console.log(chalk.bold.underline.magenta('angular-cli-diff')); -async.auto({ - gitBranches: ['cliOptions', ({cliOptions}, cb) => { - async.series( - [ - async.apply(gitUtil.fixOriginFetch, __dirname), - async.apply(gitUtil.fetchAll, __dirname) - ], - (fetchErr) => { - if (fetchErr) { - cb(fetchErr); - return; - } - console.log(chalk.dim('Checking ' + (cliOptions.localMode ? 'local' : 'remote') + ' git branches...')); - const getter = cliOptions.localMode ? gitUtil.getLocalBranches : gitUtil.getRemoteBranches; - getter(__dirname, (error, branches) => { - if (error) { - cb(error); - return; - } - if (cliOptions.fullOutput) { - console.log('Loaded the following branches: ' + branches); - } - const versions = branches.map(branch => { - const matches = branch.match(/ng\/([^\/]+)/); - if (matches === null) { - return null; - } - return matches[1]; - }).reduce((arr, version) => { - if (version !== null && arr.indexOf(version) < 0) { - arr.push(version); - } - return arr; - }, []); - - cb(null, versions); - }); - }); - }], - gitRemoteUrl: ['cliOptions', ({cliOptions}, cb) => { - gitUtil.getRemoteUrl(__dirname, (err, url) => { - if (err) { - cb(err); - return; - } - cb(null, cliOptions.noSsh ? url : url.replace(/https:\/\/github.com\//, 'git@github.com:')); - }); - }], - npmVersions: (cb) => { - console.log(chalk.dim('Checking existing @angular/cli versions...')); - npm('view', '@angular/cli', {}, (err, details) => { - if (err) { - return cb(err); - } - // console.log(arguments); - const detailKeys = Object.keys(details); - // console.log(details[detailKeys[0]].versions); - cb(null, details[detailKeys[0]].versions); - }); - }, - cliOptions: (cb) => { - const options = { - localMode: false, - noSsh: false, - stopAfterVersionFail: false, - fullOutput: false - }; - process.argv.slice(2).forEach((argument) => { - switch (argument) { - case '--local': - options.localMode = true; - break; - case '--no-ssh': - options.noSsh = true; - break; - case '--stop-on-fail': - options.stopAfterVersionFail = true; - break; - case '--verbose': - options.fullOutput = true; - break; - } - }); - cb(null, options); - } -}, (err, results) => { - if (err) { - console.error(err); - return; - } - const missingVersions = results.npmVersions.filter((filterTag) => { - return results.gitBranches.indexOf(filterTag) === -1 && ignoreVersions.indexOf(filterTag) === -1; - }); - console.log('The following versions are missing\n' + missingVersions.map(version => '- ' + version).join('\n')); - async.eachLimit(missingVersions, 1, (version, cb) => { - const options = Object.assign({}, results.cliOptions, { - basePath: __dirname, - angularCliVersion: version, - gitRemoteUrl: results.gitRemoteUrl - }); - ngCli.createApp(options, (err) => { - if (err) { - console.error(chalk.red('Error while generating app for version ' + version)); - console.error(err); - if (results.cliOptions.stopAfterVersionFail) { - cb(err); - return; - } else { - console.info(chalk.yellow('Will continue anyway')); - } - } - cb(null); - }); - }, (err) => { - if (err) { - console.error(err); - } else { - console.info(chalk.green('All testApps successfully generated')); - } - }); -}); diff --git a/src/app/app.component.css b/src/app/app.component.css new file mode 100644 index 0000000..e69de29 diff --git a/src/app/app.component.html b/src/app/app.component.html new file mode 100644 index 0000000..5226d57 --- /dev/null +++ b/src/app/app.component.html @@ -0,0 +1,20 @@ + +
+

+ Welcome to {{ title }}! +

+ Angular Logo +
+

Here are some links to help you start:

+ + diff --git a/cli-diff-selector/src/app/app.component.spec.ts b/src/app/app.component.spec.ts similarity index 77% rename from cli-diff-selector/src/app/app.component.spec.ts rename to src/app/app.component.spec.ts index bcbdf36..570dd0c 100644 --- a/cli-diff-selector/src/app/app.component.spec.ts +++ b/src/app/app.component.spec.ts @@ -1,5 +1,6 @@ import { TestBed, async } from '@angular/core/testing'; import { AppComponent } from './app.component'; + describe('AppComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ @@ -8,20 +9,23 @@ describe('AppComponent', () => { ], }).compileComponents(); })); - it('should create the app', async(() => { + + it('should create the app', () => { const fixture = TestBed.createComponent(AppComponent); const app = fixture.debugElement.componentInstance; expect(app).toBeTruthy(); - })); - it(`should have as title 'app'`, async(() => { + }); + + it(`should have as title 'testApp'`, () => { const fixture = TestBed.createComponent(AppComponent); const app = fixture.debugElement.componentInstance; - expect(app.title).toEqual('app'); - })); - it('should render title in a h1 tag', async(() => { + expect(app.title).toEqual('testApp'); + }); + + it('should render title in a h1 tag', () => { const fixture = TestBed.createComponent(AppComponent); fixture.detectChanges(); const compiled = fixture.debugElement.nativeElement; - expect(compiled.querySelector('h1').textContent).toContain('Welcome to app!'); - })); + expect(compiled.querySelector('h1').textContent).toContain('Welcome to testApp!'); + }); }); diff --git a/src/app/app.component.ts b/src/app/app.component.ts new file mode 100644 index 0000000..ef73f3c --- /dev/null +++ b/src/app/app.component.ts @@ -0,0 +1,10 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'app-root', + templateUrl: './app.component.html', + styleUrls: ['./app.component.css'] +}) +export class AppComponent { + title = 'testApp'; +} diff --git a/src/app/app.module.ts b/src/app/app.module.ts new file mode 100644 index 0000000..f657163 --- /dev/null +++ b/src/app/app.module.ts @@ -0,0 +1,16 @@ +import { BrowserModule } from '@angular/platform-browser'; +import { NgModule } from '@angular/core'; + +import { AppComponent } from './app.component'; + +@NgModule({ + declarations: [ + AppComponent + ], + imports: [ + BrowserModule + ], + providers: [], + bootstrap: [AppComponent] +}) +export class AppModule { } diff --git a/src/app/example/example.module.ts b/src/app/example/example.module.ts new file mode 100644 index 0000000..ce91239 --- /dev/null +++ b/src/app/example/example.module.ts @@ -0,0 +1,10 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; + +@NgModule({ + declarations: [], + imports: [ + CommonModule + ] +}) +export class ExampleModule { } diff --git a/src/assets/.gitkeep b/src/assets/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/src/browserslist b/src/browserslist new file mode 100644 index 0000000..37371cb --- /dev/null +++ b/src/browserslist @@ -0,0 +1,11 @@ +# This file is currently used by autoprefixer to adjust CSS to support the below specified browsers +# For additional information regarding the format and rule options, please see: +# https://github.com/browserslist/browserslist#queries +# +# For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed + +> 0.5% +last 2 versions +Firefox ESR +not dead +not IE 9-11 \ No newline at end of file diff --git a/cli-diff-selector/src/environments/environment.prod.ts b/src/environments/environment.prod.ts similarity index 100% rename from cli-diff-selector/src/environments/environment.prod.ts rename to src/environments/environment.prod.ts diff --git a/src/environments/environment.ts b/src/environments/environment.ts new file mode 100644 index 0000000..7b4f817 --- /dev/null +++ b/src/environments/environment.ts @@ -0,0 +1,16 @@ +// This file can be replaced during build by using the `fileReplacements` array. +// `ng build --prod` replaces `environment.ts` with `environment.prod.ts`. +// The list of file replacements can be found in `angular.json`. + +export const environment = { + production: false +}; + +/* + * For easier debugging in development mode, you can import the following file + * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. + * + * This import should be commented out in production mode because it will have a negative impact + * on performance if an error is thrown. + */ +// import 'zone.js/dist/zone-error'; // Included with Angular CLI. diff --git a/cli-diff-selector/src/favicon.ico b/src/favicon.ico similarity index 100% rename from cli-diff-selector/src/favicon.ico rename to src/favicon.ico diff --git a/cli-diff-selector/src/index.html b/src/index.html similarity index 55% rename from cli-diff-selector/src/index.html rename to src/index.html index c75c055..bfc581b 100644 --- a/cli-diff-selector/src/index.html +++ b/src/index.html @@ -2,13 +2,11 @@ - CliDiffSelector + TestApp - - diff --git a/cli-diff-selector/karma.conf.js b/src/karma.conf.js similarity index 69% rename from cli-diff-selector/karma.conf.js rename to src/karma.conf.js index af139fa..96cc5a6 100644 --- a/cli-diff-selector/karma.conf.js +++ b/src/karma.conf.js @@ -4,30 +4,29 @@ module.exports = function (config) { config.set({ basePath: '', - frameworks: ['jasmine', '@angular/cli'], + frameworks: ['jasmine', '@angular-devkit/build-angular'], plugins: [ require('karma-jasmine'), require('karma-chrome-launcher'), require('karma-jasmine-html-reporter'), require('karma-coverage-istanbul-reporter'), - require('@angular/cli/plugins/karma') + require('@angular-devkit/build-angular/plugins/karma') ], - client:{ + client: { clearContext: false // leave Jasmine Spec Runner output visible in browser }, coverageIstanbulReporter: { - reports: [ 'html', 'lcovonly' ], + dir: require('path').join(__dirname, '../coverage/testApp'), + reports: ['html', 'lcovonly', 'text-summary'], fixWebpackSourcePaths: true }, - angularCli: { - environment: 'dev' - }, reporters: ['progress', 'kjhtml'], port: 9876, colors: true, logLevel: config.LOG_INFO, autoWatch: true, browsers: ['Chrome'], - singleRun: false + singleRun: false, + restartOnFileChange: true }); }; diff --git a/cli-diff-selector/src/main.ts b/src/main.ts similarity index 90% rename from cli-diff-selector/src/main.ts rename to src/main.ts index 91ec6da..c7b673c 100644 --- a/cli-diff-selector/src/main.ts +++ b/src/main.ts @@ -9,4 +9,4 @@ if (environment.production) { } platformBrowserDynamic().bootstrapModule(AppModule) - .catch(err => console.log(err)); + .catch(err => console.error(err)); diff --git a/src/polyfills.ts b/src/polyfills.ts new file mode 100644 index 0000000..75d6393 --- /dev/null +++ b/src/polyfills.ts @@ -0,0 +1,63 @@ +/** + * This file includes polyfills needed by Angular and is loaded before the app. + * You can add your own extra polyfills to this file. + * + * This file is divided into 2 sections: + * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. + * 2. Application imports. Files imported after ZoneJS that should be loaded before your main + * file. + * + * The current setup is for so-called "evergreen" browsers; the last versions of browsers that + * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), + * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. + * + * Learn more in https://angular.io/guide/browser-support + */ + +/*************************************************************************************************** + * BROWSER POLYFILLS + */ + +/** IE10 and IE11 requires the following for NgClass support on SVG elements */ +// import 'classlist.js'; // Run `npm install --save classlist.js`. + +/** + * Web Animations `@angular/platform-browser/animations` + * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari. + * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0). + */ +// import 'web-animations-js'; // Run `npm install --save web-animations-js`. + +/** + * By default, zone.js will patch all possible macroTask and DomEvents + * user can disable parts of macroTask/DomEvents patch by setting following flags + * because those flags need to be set before `zone.js` being loaded, and webpack + * will put import in the top of bundle, so user need to create a separate file + * in this directory (for example: zone-flags.ts), and put the following flags + * into that file, and then add the following code before importing zone.js. + * import './zone-flags.ts'; + * + * The flags allowed in zone-flags.ts are listed here. + * + * The following flags will work for all browsers. + * + * (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame + * (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick + * (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames + * + * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js + * with the following flag, it will bypass `zone.js` patch for IE/Edge + * + * (window as any).__Zone_enable_cross_context_check = true; + * + */ + +/*************************************************************************************************** + * Zone JS is required by default for Angular itself. + */ +import 'zone.js/dist/zone'; // Included with Angular CLI. + + +/*************************************************************************************************** + * APPLICATION IMPORTS + */ diff --git a/src/styles.css b/src/styles.css new file mode 100644 index 0000000..90d4ee0 --- /dev/null +++ b/src/styles.css @@ -0,0 +1 @@ +/* You can add global styles to this file, and also import other style files */ diff --git a/cli-diff-selector/src/test.ts b/src/test.ts similarity index 55% rename from cli-diff-selector/src/test.ts rename to src/test.ts index cd612ee..1631789 100644 --- a/cli-diff-selector/src/test.ts +++ b/src/test.ts @@ -1,24 +1,14 @@ // This file is required by karma.conf.js and loads recursively all the .spec and framework files -import 'zone.js/dist/long-stack-trace-zone'; -import 'zone.js/dist/proxy.js'; -import 'zone.js/dist/sync-test'; -import 'zone.js/dist/jasmine-patch'; -import 'zone.js/dist/async-test'; -import 'zone.js/dist/fake-async-test'; +import 'zone.js/dist/zone-testing'; import { getTestBed } from '@angular/core/testing'; import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing'; -// Unfortunately there's no typing for the `__karma__` variable. Just declare it as any. -declare const __karma__: any; declare const require: any; -// Prevent Karma from running prematurely. -__karma__.loaded = function () {}; - // First, initialize the Angular testing environment. getTestBed().initTestEnvironment( BrowserDynamicTestingModule, @@ -28,5 +18,3 @@ getTestBed().initTestEnvironment( const context = require.context('./', true, /\.spec\.ts$/); // And load the modules. context.keys().map(context); -// Finally, start Karma to run the tests. -__karma__.start(); diff --git a/cli-diff-selector/src/tsconfig.app.json b/src/tsconfig.app.json similarity index 78% rename from cli-diff-selector/src/tsconfig.app.json rename to src/tsconfig.app.json index 39ba8db..190fd30 100644 --- a/cli-diff-selector/src/tsconfig.app.json +++ b/src/tsconfig.app.json @@ -2,8 +2,6 @@ "extends": "../tsconfig.json", "compilerOptions": { "outDir": "../out-tsc/app", - "baseUrl": "./", - "module": "es2015", "types": [] }, "exclude": [ diff --git a/cli-diff-selector/src/tsconfig.spec.json b/src/tsconfig.spec.json similarity index 73% rename from cli-diff-selector/src/tsconfig.spec.json rename to src/tsconfig.spec.json index 63d89ff..de77336 100644 --- a/cli-diff-selector/src/tsconfig.spec.json +++ b/src/tsconfig.spec.json @@ -2,16 +2,14 @@ "extends": "../tsconfig.json", "compilerOptions": { "outDir": "../out-tsc/spec", - "baseUrl": "./", - "module": "commonjs", - "target": "es5", "types": [ "jasmine", "node" ] }, "files": [ - "test.ts" + "test.ts", + "polyfills.ts" ], "include": [ "**/*.spec.ts", diff --git a/src/tslint.json b/src/tslint.json new file mode 100644 index 0000000..aa7c3ee --- /dev/null +++ b/src/tslint.json @@ -0,0 +1,17 @@ +{ + "extends": "../tslint.json", + "rules": { + "directive-selector": [ + true, + "attribute", + "app", + "camelCase" + ], + "component-selector": [ + true, + "element", + "app", + "kebab-case" + ] + } +} diff --git a/cli-diff-selector/tsconfig.json b/tsconfig.json similarity index 79% rename from cli-diff-selector/tsconfig.json rename to tsconfig.json index a6c016b..b271fd9 100644 --- a/cli-diff-selector/tsconfig.json +++ b/tsconfig.json @@ -1,18 +1,21 @@ { "compileOnSave": false, "compilerOptions": { + "baseUrl": "./", "outDir": "./dist/out-tsc", "sourceMap": true, "declaration": false, + "module": "es2015", "moduleResolution": "node", "emitDecoratorMetadata": true, "experimentalDecorators": true, + "importHelpers": true, "target": "es5", "typeRoots": [ "node_modules/@types" ], "lib": [ - "es2017", + "es2018", "dom" ] } diff --git a/tslint.json b/tslint.json new file mode 100644 index 0000000..868ecba --- /dev/null +++ b/tslint.json @@ -0,0 +1,75 @@ +{ + "extends": "tslint:recommended", + "rulesDirectory": [ + "codelyzer" + ], + "rules": { + "array-type": false, + "arrow-parens": false, + "deprecation": { + "severity": "warn" + }, + "import-blacklist": [ + true, + "rxjs/Rx" + ], + "interface-name": false, + "max-classes-per-file": false, + "max-line-length": [ + true, + 140 + ], + "member-access": false, + "member-ordering": [ + true, + { + "order": [ + "static-field", + "instance-field", + "static-method", + "instance-method" + ] + } + ], + "no-consecutive-blank-lines": false, + "no-console": [ + true, + "debug", + "info", + "time", + "timeEnd", + "trace" + ], + "no-empty": false, + "no-inferrable-types": [ + true, + "ignore-params" + ], + "no-non-null-assertion": true, + "no-redundant-jsdoc": true, + "no-switch-case-fall-through": true, + "no-use-before-declare": true, + "no-var-requires": false, + "object-literal-key-quotes": [ + true, + "as-needed" + ], + "object-literal-sort-keys": false, + "ordered-imports": false, + "quotemark": [ + true, + "single" + ], + "trailing-comma": false, + "no-output-on-prefix": true, + "use-input-property-decorator": true, + "use-output-property-decorator": true, + "use-host-property-decorator": true, + "no-input-rename": true, + "no-output-rename": true, + "use-life-cycle-interface": true, + "use-pipe-transform-interface": true, + "component-class-suffix": true, + "directive-class-suffix": true + } +} diff --git a/util/git.js b/util/git.js deleted file mode 100644 index 2b83d85..0000000 --- a/util/git.js +++ /dev/null @@ -1,94 +0,0 @@ -const exec = require('child_process').exec; - -function _exec(cwd, command, cb) { - exec(command, {cwd}, (err, stdout) => { - if (err) { - cb(err); - return; - } - cb(null, stdout); - }); -} - -/** - * Provide some helpful methods to interact with a git repo in a directory. - * - * Note: None of these methods takes care of properly escaping the inputs! - * So make sure the strings are from trustworthy sources or properly escaped - * for usage in bash. - * - */ -module.exports = { - getRemoteUrl: (repoPath, cb) => { - _exec(repoPath, 'git config remote.origin.url', (err, data) => { - if (err) { - cb(err); - return; - } - cb(null, data.trim()); - }); - }, - fixOriginFetch: (repoPath, cb) => { - _exec(repoPath, 'git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"', cb); - }, - fetchAll: (repoPath, cb) => { - _exec(repoPath, 'git fetch --all', cb); - }, - getLocalBranches: (repoPath, cb) => { - _exec(repoPath, 'git branch', (err, data) => { - if (err) { - cb(err); - return; - } - cb(null, data.split('\n').map(line => line.replace(/^\* /, '').trim())); - }); - }, - getRemoteBranches: (repoPath, cb) => { - _exec(repoPath, 'git branch -r', (err, data) => { - if (err) { - cb(err); - return; - } - cb(null, data.split('\n').map(line => line.substr(line.indexOf('/') + 1).trim())); - }); - }, - getLocalTags: (repoPath, cb) => { - _exec(repoPath, 'git tag -l', (err, data) => { - if (err) { - cb(err); - return; - } - cb(null, data.split('\n').map(line => line.replace(/^\* /, '').trim())); - }); - }, - cloneRepo: (repoUrl, targetFolder, branch, cb) => { - _exec(undefined, 'git clone' + (branch ? ' -b ' + branch : '') + ' ' + repoUrl + (targetFolder ? ' ' + targetFolder : ''), cb); - }, - createBranch: (repoPath, branchName, startPoint, cb) => { - _exec(repoPath, 'git branch --track -f ' + branchName + (startPoint ? ' ' + startPoint : '') + ' && git checkout ' + branchName, cb); - }, - checkout: (repoPath, branchName, create, cb) => { - _exec(repoPath, 'git checkout ' + (create ? '-b ' : '') + branchName, cb); - }, - createTag: (repoPath, tagName, cb) => { - _exec(repoPath, 'git tag "' + tagName + '"', cb); - }, - addAllAndCommit: (repoPath, commitMessage, cb) => { - _exec(repoPath, 'git add --all . && git commit -m "' + commitMessage + '"', cb); - }, - merge: (repoPath, mergeBranch, cb) => { - _exec(repoPath, 'git merge --commit --ff "' + mergeBranch + '"', cb); - }, - pushToOrigin: (repoPath, cb) => { - _exec(repoPath, 'git push origin', cb); - }, - pushAllTo: (repoPath, pushTarget, cb) => { - _exec(repoPath, 'git push --all ' + pushTarget, cb); - }, - resetWithoutHeadMovement: (repoPath, base, head, cb) => { - _exec(repoPath, 'git reset --hard ' + base + ' && git reset --soft ' + head, cb); - }, - setUserData: (repoPath, username, userMail, cb) => { - _exec(repoPath, 'git config user.name "' + username + ' " && git config user.email "' + userMail + '"', cb); - } -}; diff --git a/util/ngcli.js b/util/ngcli.js deleted file mode 100644 index a070b14..0000000 --- a/util/ngcli.js +++ /dev/null @@ -1,196 +0,0 @@ -const path = require('path'); -const exec = require('child_process').exec; - -const move = require('glob-move'); -const rimraf = require('rimraf'); -const chalk = require('chalk'); -const async = require('async'); - -const npm = require('./npm'); -const gitUtil = require('./git'); - -const service = {}; -service.generateAndCommit = (basePath, appPath, generateArguments, commitMessage, cb) => { - exec('./../node_modules/.bin/ng ' + generateArguments, {cwd: appPath}, (error) => { - if (error) { - cb(error); - return; - } - gitUtil.addAllAndCommit(appPath, commitMessage, cb); - }); -}; -service.createApp = ({basePath, angularCliVersion, gitRemoteUrl, localMode, fullOutput}, cb) => { - const appPath = path.resolve(basePath, 'app'); - console.log(chalk.bold.magenta('Processing @angular/cli@' + angularCliVersion)); - - console.log(chalk.dim('Removing app and testApp folder')); - async.each(['app', 'testApp'], rimraf, (rmErr) => { - if (rmErr) { - console.warn(rmErr); - } - console.log(chalk.dim('Cloning ng/base branch into app folder')); - gitUtil.cloneRepo(gitRemoteUrl, 'app', 'ng/base', (cloneErr) => { - if (cloneErr) { - cb(cloneErr); - return; - } - console.log(chalk.dim('Will now empty the app directory')); - gitUtil.resetWithoutHeadMovement(appPath, 'ng-start', 'origin/ng/base', (resetErr, resetResult) => { - if (resetErr) { - cb(resetErr); - return; - } - console.log('Working copy successfully reset: ' + resetResult); - console.log(chalk.dim('Will install @angular/cli@' + angularCliVersion + ' now')); - npm('install', '@angular/cli@' + angularCliVersion, {cwd: basePath}, (npmInstallErr, output) => { - if (npmInstallErr) { - cb(npmInstallErr); - return; - } - console.log(chalk.green('Installed @angular/cli@' + angularCliVersion + ':')); - if (fullOutput) { - console.log(output); - } - console.log(chalk.dim('Creating new app branch')); - gitUtil.checkout(appPath, 'ng/' + angularCliVersion + '/app', true, (checkoutErr, checkoutOutput) => { - if (checkoutErr) { - cb(checkoutErr); - return; - } - if (fullOutput) { - console.log(checkoutOutput); - } - console.log(chalk.dim('Will generate a new app now')); - exec('./node_modules/.bin/ng new testApp --skip-install --skip-npm --skip-git --skip-commit --verbose', {cwd: basePath}, (ngNewErr, stdout) => { - if (ngNewErr) { - cb(ngNewErr); - return; - } - console.log(chalk.bgGreen('App successfully generated with @angular/cli@' + angularCliVersion)); - console.log(stdout); - console.log(chalk.dim('Moving testApp into app folder')); - move('testApp/*', 'app/', {dot: true}).then(() => { - console.log(chalk.dim('Configuring git repo and committing all changes')); - gitUtil.setUserData(appPath, 'Bot', '3458616+Nolanus@users.noreply.github.com', (setUserErr) => { - if (setUserErr) { - cb(setUserErr); - return; - } - gitUtil.addAllAndCommit(appPath, 'Generate app using @angular/cli v' + angularCliVersion, (commitAllErr, commitOutput) => { - if (commitAllErr) { - cb(commitAllErr); - return; - } - console.log(chalk.green('Successfully committed basic @angular/cli app')); - console.log(commitOutput); - - gitUtil.checkout(appPath, 'ng/base', false, (checkout2Err, checkout2Output) => { - if (checkout2Err) { - cb(checkout2Err); - return; - } - console.log(chalk.green('Successfully checked out the branch:')); - console.log(checkout2Output); - - console.log(chalk.dim('Merging ng/' + angularCliVersion + '/app into the current branch')); - gitUtil.merge(appPath, 'ng/' + angularCliVersion + '/app', (mergeErr, mergeOutput) => { - if (mergeErr) { - cb(mergeErr); - return; - } - - console.log(chalk.green('Successfully merged branches:')); - console.log(mergeOutput); - - console.log(chalk.dim('Changing back onto ng/' + angularCliVersion + '/app branch')); - gitUtil.checkout(appPath, 'ng/' + angularCliVersion + '/app', false, (checkout3Err, checkout3Output) => { - if (checkout3Err) { - cb(checkout3Err); - return; - } - console.log(chalk.green('Successfully checked out the branch')); - if (fullOutput) { - console.log(checkout3Output); - } - - // Now generate some things and commit them - async.eachLimit([ - ['service', 'generate service rebel', 'Service generation'], - ['component', 'generate component contact', 'Component generation'], - ['directive', 'generate directive foo', 'Directive generation'], - ['pipe', 'generate pipe drain', 'Pipe generation'], - ['enum', 'generate enum foo', 'Enum generation'], - ['module', 'generate module example', 'Module generation'], - ], 1, (data, eachCb) => { - console.log(chalk.dim('About to generate a ' + data[0])); - gitUtil.createBranch(appPath, 'ng/' + angularCliVersion + '/' + data[0], 'ng/' + angularCliVersion + '/app', (branchErr) => { - if (branchErr) { - eachCb(branchErr); - return; - } - service.generateAndCommit(basePath, appPath, data[1], data[2], (commitErr) => { - if (commitErr) { - console.error(chalk.red('Error while generating and committing, will continue anyway')); - console.error(commitErr); - } - if (localMode) { - console.log(chalk.yellow('In local mode, will skip pushing to origin')); - eachCb(null); - } else { - gitUtil.pushToOrigin(appPath, (pushErr) => { - if (pushErr) { - console.error(chalk.red('Error while pushing the generated component to origin, will continue anyway')); - console.error(pushErr); - } - console.log(chalk.green('Successfully generated ' + data[0] + ' branch and committed the changes')); - eachCb(null); - }); - } - }); - }); - }, (err) => { - if (err) { - console.error(chalk.red('One generation task seriously failed, will continue with next angular/cli version')); - console.error(err); - } - async.parallel({ - npmUninstall: (parallelCb) => { - // Uninstall this angular/cli version - console.log(chalk.dim('Uninstalling the current @angular/cli version')); - npm('uninstall', '@angular/cli', {}, parallelCb); - }, - gitPush: (parallelCb) => { - if (localMode) { - console.log(chalk.yellow('In local mode, will skip pushing to origin')); - parallelCb(null); - } else { - console.log(chalk.dim('Pushing changes to origin')); - gitUtil.pushAllTo(appPath, 'origin', (pushErr, pushOutput) => { - if (pushErr) { - console.error(chalk.red('Error while pushing changes, will continue anyway')); - console.error(pushErr); - } else { - console.log(chalk.green('New Branches successfully pushed:')); - console.log(pushOutput); - } - parallelCb(null); - }); - } - } - }, cb); - }); - }); - }); - }); - - }); - }); - }).catch(cb); - }); - }); - }); - }); - }); - }); -}; -module.exports = service; diff --git a/util/npm.js b/util/npm.js deleted file mode 100644 index 1ac6a78..0000000 --- a/util/npm.js +++ /dev/null @@ -1,13 +0,0 @@ -const npm = require('npm'); - -module.exports = function (command, argument, flags, cb) { - if (!flags) { - flags = {}; - } - if (flags.parseable === undefined) { - flags.parseable = true; - } - npm.load(flags, (err, npmInstance) => { - npmInstance.commands[command]([argument], cb); - }); -};