Giter Club home page Giter Club logo

ngmigration-assistant's People

Contributors

ashclarke avatar cleavera avatar ellamaolson avatar liorcode avatar patrickjs avatar urish avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ngmigration-assistant's Issues

Assumes 1 component / controller per file

The component and controller counts presently assume that there is only 1 defined per file, but that's not a given. It should be counting all matches.

For example, my ES code base has the component and controller bodies exported. Module files then import them and feed them into the angular module.

angular.module('moduleName', [])
.component(Component1)
.component(Component2)
.controller(Controller1)
.controller(Controller2)

Naturally there are other valid approaches with multiple in a file that are fair game.

Question on removing $rootScope from angularJS application

First off - thanks for the efforts with this tool! It confirmed the path/approach we've been working on for our large angular applications. One of the items listed is to remove $rootScope from our application. For the most part we have done this, but we still use this in a couple services to execute some checks when the route changes by using $rootScope.$on('$routeChangeSuccess'. What would be the recommended way to move away from $rootScope but still be able to have a service execute code when a route changes?

We also have the same issue in that we also use $locationChangeSuccess to update some variables in Google Analytics (perhaps there is a better way to do this now, but it was the recommended approach at the time we wrote it).

Any thoughts/advice on how to handle this would be appreciated.

AngularJS Component decorators not recognized

There are a number of libraries offering Angular-style @component() decorators and are very helpful tools in preparing for the migration. These could easily be factored into the component count. Since this tool handles hybrid apps, the trick is to be able to distinguish between the Angular and AngularJS flavors. I suggest testing for the the decorator along with the absence of the @angular/core import.

JSON files counted as relevant

Not sure of the reasoning. I wouldn't think that you would have to worry much about JSON files in terms of the migration. My suggestion is to ignore them.

Error while starting ngma

Hi,
After installing ngma with npm install -g ngma I tried to run it on a old angularJS project.
Unfortunately I get this error:

`/usr/local/lib/node_modules/ngma/bin/analysisTool.js:112
allIgnoreGlobs = [...gitignore(rootpath + "/.gitignore"), ...defaultIgnoreGlobs].filter((pattern) => {
^^^

SyntaxError: Unexpected token ...
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:374:25)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
at Object. (/usr/local/lib/node_modules/ngma/bin/main.js:11:24)
at Module._compile (module.js:410:26)
at Object.Module._extensions..js (module.js:417:10)
`

Attempts to read directory as file

I'm getting this error:

Error 1:  Error: EISDIR: illegal operation on a directory, read
    at Object.readSync (node:fs:723:3)
    at tryReadSync (node:fs:433:20)
    at Object.readFileSync (node:fs:479:19)
    at AnalysisTool.testFile (C:\Users\maxim\AppData\Local\nvs\node\16.13.0\x64\node_modules\ngma\bin\analysisTool.js:196:38)
    at AnalysisTool.runAnalysis (C:\Users\maxim\AppData\Local\nvs\node\16.13.0\x64\node_modules\ngma\bin\analysisTool.js:174:18)
    at C:\Users\maxim\AppData\Local\nvs\node\16.13.0\x64\node_modules\ngma\bin\analysisTool.js:70:18
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5) {
  errno: -4068,
  syscall: 'read',
  code: 'EISDIR'
}

After debugging, found that this is because I have a folder named au_dcr.json.

Provide detailed documentation

I tested it and realized that there is (besides a very general intro) no helpful documentation provided.

Neither --help nor the readme explains what the suggestions mean exactly.
Also, no tests are there. So I have no way to figure out the exact meaning of the suggestions.

I guess this is because of a very early stage of this repo.

Anyway, GREAT work!!!

Thanks for your effort,
Michael

ngma not found

I'm probably missing something simple, but i get this on windows after doing the yarn add and trying to run ngma:
'ngma' is not recognized as an internal or external command,

Integrate migration assistant with create-angular-template utility

Hi all!

I really enjoy to see more projects related to the topic of AngularJS -> Angular migration. We all want to make jumping to the newer ship easier and faster. Since this project has much bigger chance to get more traction, I was wondering if it would be possible to integrate my toolkit with your solution.

As I see now, ngMigration-Assistant runs static analysis on top of given project to let you know which parts of it should be updated in order to work smoothly with newer Angular. While this knowledge is valuable, I think that we could automate whole process even more.

Few months ago I create two tools, which - I believe - could really enhance the current workflow of ngMigration-Assistant.

  1. https://github.com/psmyrdek/create-angular-template
  2. https://github.com/psmyrdek/ng-up

create-angular-template is a library which runs a set of transformations on your AngularJS templates preparing them for the new syntax. ng-if gets transformed into *ngIf, ng-repeat into *ngFor, etc. All of this makes the process of manual updates much easier.

To make it even easier to use, I also created ng-up, which is a CLI utility combined from create-angular-template and yet another module responsible for preparing Anuglar providers for AngularJS services.

I believe it would be possible to somehow integrate both tools (at least create-angular-template) to automate the migration process and reduce the amount of time you need to spend on it.

What do you think? I'm open for all kinds of suggestions.

EISDIR Error while running ngma

Error 1: ```
{ Error: EISDIR: illegal operation on a directory, read
at Object.fs.readSync (fs.js:675:18)
at tryReadSync (fs.js:540:20)
at Object.fs.readFileSync (fs.js:583:19)
at AnalysisTool.testFile (/usr/local/lib/node_modules/ngma/bin/analysisTool.js:196:38)
at AnalysisTool.runAnalysis (/usr/local/lib/node_modules/ngma/bin/analysisTool.js:174:18)
at AnalysisTool.countLinesOfCode.then.sourceLines (/usr/local/lib/node_modules/ngma/bin/analysisTool.js:70:18)
at
at process._tickCallback (internal/process/next_tick.js:188:7) errno: -21, code: 'EISDIR', syscall: 'read' }


Output:
App Statistics
  * **Complexity: 0 controllers, 0 AngularJS components,** 55 JavaScript files, and 0 Typescript files.

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.