Google launched angularjs upgrade tool, which can quickly migrate to angular
mob604756fb8908 2021-07-20 04:35:07

License agreement :MIT

development language :TypeScript

operating system : Cross platform

Developer :Google

ngMigration Assistant Is an easy to use command line utility , Can scan AngularJS Application and suggest how to migrate to Angular.


globally Mode installation ngma


ngMigration Assistant Will scan the current working directory or input Directory

class : analysisTool

Analyze... On the directory provided , And return to choose which Angular Suggestions for migration paths . It looks at complexity 、 Source line (sloc)、 Anti pattern 、AngularJS Version and preparation for migration . It identifies the files that need to be modified and the specific changes that prepare the application for upgrade .

Method **

buildPathIgnoringGlobs() By using glob Delete and ignore globs Matching files to build a new file system , And return as an array of the new file system .

getGlobsFromGitignore() take .gitignore The file resolves into a set of globs And will default to globs Attach to array . Filter from an array to ! Pattern at the beginning , because ! It means never ignore , Return to ignore globs.

countLinesOfCode() Use node-sloc Traverse buildPathIgnoringGlobs() New file system returned asynchronous Calculation sloc . Returns a value that resolves to sloc Of promise.

runAnalysis() Traverse buildPathIgnoringGlobs() Filter file system returned , And call testFile() Run the tests .

runAntiPatternReport() asynchronous Create anti pattern reports and calculate rewriteThreshold runRecommendation() Use . Every time you find an antipattern , General instructions and documents that need to be corrected are attached to the preparation report . Returns a..., which is resolved to prepare a report promise.

runRecommendation() asynchronous It is recommended that the algorithm check the type of application (AngularJS、Angular Or mixed ), Check sloc Whether in rewriteThreshold under , And check to see if it passed ngUpgrade requirement . Return to suggestions and prepare reports .

Project details and source address access :

Please bring the original link to reprint ,thank
Similar articles