Git Product home page Git Product logo

ngmigration-assistant's Introduction

ngMigration Assistant

ngMigration Assistant is an easy-to-use command line utility that scans an AngularJS application and recommends how to migrate to Angular.

ajs-app-dark-slow

Getting Started

Installing

Whether you are using npm or yarn package manager, install ngma globally.

npm install -g ngma
yarn global add ngma

Run the program

ngMigration Assistant will scan the current working directory or the input directory.

ngma <your_angularjs_app>

App Composition

Class: analysisTool

Runs the analysis on the provided directory and returns a recommendation on which migration path to take to Angular. It looks at the complexity, source lines of code (sloc), antipatterns, AngularJS version, and preparation necessary for migration. It identifies the files that need to be modified and the specific changes that will prepare the app for upgrading.

Methods

  • buildPathIgnoringGlobs() Builds a new filesystem by removing files matching the ignore globs using glob. Returns as an array of the new filesystem.
  • getGlobsFromGitignore() Parses .gitignore file into an array of globs and appends default globs to the array. Filters out patterns starting with ! from the array because ! means to never ignore. Returns the globs to ignore.
  • countLinesOfCode() asynchronous Counts sloc using node-sloc to traverse new filesystem returned by buildPathIgnoringGlobs(). Returns a promise that resolves to sloc.
  • runAnalysis() Traverses through filtered filesystem returned by buildPathIgnoringGlobs() and calls testFile() to run the individual tests.
  • runAntiPatternReport() asynchronous Creates the anti-pattern report and calculates the rewriteThreshold runRecommendation() uses. Each time an anti-pattern is found, general instructions and files needing corrections are appended to the preparation report. Returns a promise that resolves to the preparation report.
  • runRecommendation() asynchronous Recommendation algorithm that checks type of application (AngularJS, Angular, or hybrid), checks if sloc is under the rewriteThreshold, and checks if passes the ngUpgrade requirements. Returns a recommendation and preparation report.

Built With

Authors

Elana Olson - ellamaolson

License

Copyright Google Inc. All Rights Reserved. Use of this source code is governed by an MIT-style license that can be found in the LICENSE file at https://angular.io/license

ngmigration-assistant's People

Contributors

ellamaolson avatar liorcode avatar cleavera avatar patrickjs avatar urish avatar

Watchers

James Cloos avatar Ziyun avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.