vue2-migration-helper icon indicating copy to clipboard operation
vue2-migration-helper copied to clipboard

Unclear how to use

Open grosenberg opened this issue 5 years ago • 8 comments

Remote: accessing the sandbox results in Request failed with status code 404.

Local: after installing using npm, the vue CLI does not recognize vue2-migration-helper as a runnable script.

What is the complete CLI statement necessary to invoke the script?

Thanks


Environment Info: ... Binaries: Node: 12.18.3 - C:\Program Files\Tools\nodejs\node.EXE npm: 6.14.8 - C:\Program Files\Tools\nodejs\npm.CMD npmPackages: ... vue: 2.6.11 => 2.6.11 (2.5.17, 2.6.12) ... vue2-migration-helper: ^0.3.8 => 0.3.8 ... npmGlobalPackages: @vue/cli: Not Found

grosenberg avatar Aug 30 '20 22:08 grosenberg

Issue Label Bot is not confident enough to auto-label this issue. See dashboard for more details.

issue-label-bot[bot] avatar Aug 30 '20 22:08 issue-label-bot[bot]

You should install it globally by npm i -g vue2-migration-helper

Then the command vue2-migration-helper will be registered globally and you can run it by:


vue2-migration-helper --help

Regards Muhammad Ubaid Raza

On Mon, Aug 31, 2020 at 3:43 AM issue-label-bot[bot] < [email protected]> wrote:

Issue Label Bot is not confident enough to auto-label this issue. See dashboard https://mlbot.net/data/mubaidr/vue2-migration-helper for more details.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mubaidr/vue2-migration-helper/issues/24#issuecomment-683479978, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQ6U3SJ5KXSBPNCJNPX6CTSDLIZ7ANCNFSM4QP4BXJA .

mubaidr avatar Aug 31 '20 03:08 mubaidr

Global install was required, thanks.

Unfortunately, it is rejecting my source path as invalid (and even more unfortunately, I am on Windows):

vue2-migration-helper --source="D:/DevFiles/Eclipse/Tools/NFlow/net.certiv.nflow/net.certiv.nflow.ui/src/main/resources/dev/x" --target="D:/DevFiles/Eclipse/Tools/NFlow/net.certiv.nflow/net.certiv.nflow.ui/src/main/resources/dev/y"

where the source directory contains copies of the files to convert and the target is currently empty.

Any hint of the proper form for a Windows path?

Thanks.

grosenberg avatar Aug 31 '20 04:08 grosenberg

That's weird. Please share error message.

Also can you please try with a single file as input?

mubaidr avatar Aug 31 '20 12:08 mubaidr

Please share error message.

Current working directory:

D:\DevFiles\Eclipse\Tools\NFlow\net.certiv.nflow\net.certiv.nflow.ui\attic\vue

The subdirectory "x" contains copies of 4 otherwise working SFCs; the first of these is "Dashboard.vue". The subdirectory "y" is empty.

The command line is

$ vue2-migration-helper --source="x" --target="y"

The error messsage is

☞ D:/DevFiles/Eclipse/Tools/NFlow/net.certiv.nflow/net.certiv.nflow.ui/attic/vue/x/Dashboard.vue
✔ D:\DevFiles\Eclipse\Tools\NFlow\net.certiv.nflow\net.certiv.nflow.ui\attic\vue\Dashboard.vue
C:\Users\Gbr\AppData\Roaming\npm\node_modules\vue2-migration-helper\build\main\src\lib\transformers\methods.js:37
values.forEach((value) => {
^
TypeError: Cannot read property 'forEach' of undefined
at Object.addMethods (C:\Users\Gbr\AppData\Roaming\npm\node_modules\vue2-migration-helper\build\main\src\lib\tra nsformers\methods.js:37:20)
at MigrationHelper.updateBody (C:\Users\Gbr\AppData\Roaming\npm\node_modules\vue2-migration-helper\build\main\sr c\lib\MigrationHelper.js:86:60)
at new MigrationHelper (C:\Users\Gbr\AppData\Roaming\npm\node_modules\vue2-migration-helper\build\main\src\lib\M igrationHelper.js:34:14)
at processFile (C:\Users\Gbr\AppData\Roaming\npm\node_modules\vue2-migration-helper\build\main\src\index.js:14:29)
at C:\Users\Gbr\AppData\Roaming\npm\node_modules\vue2-migration-helper\build\main\src\index.js:49:17
at Array.forEach ()
at C:\Users\Gbr\AppData\Roaming\npm\node_modules\vue2-migration-helper\build\main\src\index.js:48:21
at f (C:\Users\Gbr\AppData\Roaming\npm\node_modules\vue2-migration-helper\node_modules\once\once.js:25:25)
at Glob. (C:\Users\Gbr\AppData\Roaming\npm\node_modules\vue2-migration-helper\node_modules\glob\glob. js:151:7)
at Glob.emit (events.js:315:20)

grosenberg avatar Sep 02 '20 05:09 grosenberg

Also can you please try with a single file as input?

Also fails with essentially the same message when executed against a single file in "x".

But, works when I throw caution to the wind, risk damage and destruction, and try it against the original Dashboard.vue file, i.e., not a copy safely located in a temporary "attic" directory.

What is the minimum requirement for where copies of files to be converted can be located. Is it sufficient so long as they are in some subdirectory of my source directory?

Thanks.

grosenberg avatar Sep 02 '20 05:09 grosenberg

Sorry for inconvenience, I am working on improving path option. Also found some new error in the conversion process. Will push an update soon.

mubaidr avatar Sep 02 '20 18:09 mubaidr

I have updated the package with better handling of paths. Also you can check usage example here: https://github.com/mubaidr/vue2-migration-helper/blob/master/tests/lib/index.test.ts#L20

mubaidr avatar Sep 06 '20 16:09 mubaidr