Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[codemod][FP] nuxt/4/migration-recipe #1247

Closed
xmatthias opened this issue Aug 18, 2024 · 11 comments
Closed

[codemod][FP] nuxt/4/migration-recipe #1247

xmatthias opened this issue Aug 18, 2024 · 11 comments
Labels
codemod-issue Any issues related to a codemod, FP or FN.

Comments

@xmatthias
Copy link

xmatthias commented Aug 18, 2024

Original

import withNuxt from './.nuxt/eslint.config.mjs';

Expected

import withNuxt from './.nuxt/eslint.config.mjs';

Actual

import withNuxt from '.nuxt/eslint.config.mjs';

(nothing else in the eslint file was modified).

Estimated impact

Numbers about your specific codemod run:

  • Total number of files/instances transformed: 1
  • Number of files/instances missed by the codemod (FN): 0
  • Number of files/instances mistakenly transformed (FP): 1

Logs:

// Please insert the contents of a log file generated by the codemod run here.

Additional context

In a regular nuxt project with eslint using flatconfig configured, i'm running the following migration script (according to the nuxt docs).

npx codemod@latest nuxt/4/migration-recipe

This also updates eslint.config.mjs (wrongly)

image
Result:
image

Now unfortunately - the modification causes eslint to complain (quite loudly)

Oops! Something went wrong! :(c to cancel.

ESLint: 9.9.0

TypeError [ERR_INVALID_MODULE_SPECIFIER]: Invalid module ".nuxt/eslint.config.mjs" is not a valid package name imported from /home/xmatt/devel/javascript/nuxtfast/eslint.config.mjs
    at parsePackageName (node:internal/modules/esm/resolve:782:11)
    at packageResolve (node:internal/modules/esm/resolve:805:5)
    at moduleResolve (node:internal/modules/esm/resolve:927:18)
    at defaultResolve (node:internal/modules/esm/resolve:1169:11)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:383:12)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:352:25)
    at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:227:38)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:87:39)
    at link (node:internal/modules/esm/module_job:86:36)
 ELIFECYCLE  Command failed with exit code 2.

Reverting this line fixes the problem - though i guess this shouldn't happen for a smooth migration between nuxt3 to nuxt4.

@xmatthias xmatthias added the codemod-issue Any issues related to a codemod, FP or FN. label Aug 18, 2024
@alexbit-codemod alexbit-codemod changed the title [codemod][FP/FN] nuxt/4/migration-recipe [codemod][FP] nuxt/4/migration-recipe Aug 18, 2024
@mohab-sameh
Copy link
Contributor

Thanks for reporting this! We'll investigate this issue.

@all-contributors add @xmatthias for bugs

Copy link
Contributor

@mohab-sameh

I couldn't determine any contributions to add, did you specify any contributions?
Please make sure to use valid contribution names.

I've put up a pull request to add @xmatthias! 🎉

@xmatthias
Copy link
Author

Adding a bit more details here - it seems to happen in nuxt/4/file-structure - only leaving that part ticked yields the following output - somewhere in the middle.

Moving /home/xmatt/devel/javascript/projectdir/components/Pricing/Plans.vue to /home/xmatt/devel/javascript/projectdir/app/components/Pricing/Plans.vue

FILE /home/xmatt/devel/javascript/projectdir/eslint.config.mjs
import withNuxt from './.nuxt/eslint.config.mjs';
import withNuxt from '.nuxt/eslint.config.mjs';

Moving /home/xmatt/devel/javascript/projectdir/composables/useToast.ts to /home/xmatt/devel/javascript/projectdir/app/composables/useToast.ts
...

@xmatthias
Copy link
Author

xmatthias commented Oct 25, 2024

@arshcodemod has this been actualy fixed? (don't see a linked commit or PR for this - and the nuxt migrations seem to have been touched last 2 months ago...)

I've done a migration in this regard about a week (maybe two) ago and still encountered the same issue ... ?

so I'd not want this to be a "cleanup due to inactivity" - while it's in reality still a problem.

@arshcodemod
Copy link
Contributor

Hey @xmatthias , sorry for the confusion. This was mistakenly closed.Let me get back on this.

@arshcodemod arshcodemod reopened this Oct 25, 2024
@mohab-sameh
Copy link
Contributor

Closing as stale. If this issue persists, please report it to codemod-com/commons. Soon, Nuxt codemods may be moved to Nuxt's org. Hopefully, this will increase the potential community contributors who can address issues like these.

@xmatthias
Copy link
Author

xmatthias commented Dec 26, 2024

@mohab-sameh i wouldn't think it's stale just because nobody looked at it recently.

Feel free to move to another repository if you feel that's more appropriate, but i don't really see why it should be re-reported. It's reported here - and shouldn't be closed without adressing it.

Instead of closing it as stale - did you try to reproduce it? that would've been a better use of time.
It still reproduces perfectly fine - so it's clearly not fixed.
Please reopen, thanks.

edit never mind - i simply re-reported it.

@mohab-sameh
Copy link
Contributor

mohab-sameh commented Dec 26, 2024

Hi @xmatthias :) We're currently the midst of moving maintenance ownership to their respective organizations and codemod owners. We're collaborating with the Nuxt team to have all Nuxt's codemods moved to the Nuxt org as we're currently prioritizing working on the Codemod platform itself, and our core team doesn't have enough bandwidth to address packages issues.

I understand the confusion caused by this package's source previously being hosted in the codemod-com/codemod repo, but this proved to be non-ideal for maintenance and ownership clarity. Moving the package (alongside all reported issues) to the Nuxt org and community will increase visibility and have thousands of people interested in resolving the package issue.

Closing the issue on the Codemod org does not mean the issue does not need to be addressed. Sorry for the confusion. It means we're working bringing more clarity about maintenance ownership and focused on moving the packages to their respective communities. I noticed you opened a duplicate issue in this same repo. I initially meant moving it temporarily to the commons repo, not this repo. If you don't want to temporarily open the issue there, please wait until we open a Nuxt codemods repo and I'll personally move this issue there for you.

I will keep this thread and you updated when we move the packages to Nuxt's org so we can have the issue opened there and picked up by the community. @xmatthias

@xmatthias
Copy link
Author

xmatthias commented Dec 26, 2024

I initially meant moving it temporarily to the commons repo, not this repo. If you don't want to temporarily open the issue there,

Why didn't you move the issue there, if that's how you'd have liked it? you choose to close the issue - so i choose to re-open it.

@mohab-sameh the "commons" repository is in this organization. Nothing would've prevented you from moving the existing issue there.
You didn't do that - so i opened it here again (fully intentional) because the nuxt codemod code still lives here - so in my understanding, the issue also belongs here.


Instead of closing out random issues, causing confusion and having people re-report them (probably in hopes that they no longer care) - what you should do instead is once the code has been moved - move the issues, too (notice - move, not close) - essentially making that part of the move.

Quite honestly - very bad experience here at this moment.
From the response i got in that issue however, i'll also take it that what you're stating here is just your personal opinion - and fortunately (for the project) not the stance of this project / organization :)

@mohab-sameh
Copy link
Contributor

mohab-sameh commented Dec 26, 2024

@xmatthias no worries. I can copy your issue there if it's inconvenient for you :) My intention is to have you stay updated with progress and also be credited for finding issues, instead of the issue being under our name. I'll open an issue under Nuxt's org and mention you there as soon as the nuxt-codemods repo is opened.

The Nuxt codemod lives here temporarily until we move everything away to their respective orgs. They will eventually be ported away fully from our repo.

I understand that you care, and we're definitely not cleaning up issues in the hopes that people don't care. In fact, quite the opposite. We're doing our best to move codemod packages and maintenance responsibility to their respective communities so that you, and everyone else who uses the codemods, can continue having this and future issues resolved in a timely manner. For now, @amirabbas-gh will inspect this issue, if we're able to push a fix before the codemods are moved, I'll definitely let you know.

@xmatthias
Copy link
Author

xmatthias commented Dec 26, 2024

Sounds like an excuse to me, sorry (yes, i'm allergic against issue cleanups closing tons of issues as "stale" if it's just to get some metric improved)

I find the process you're applying completely broken and intransparent, with the silent hope that "issues go away" (you'll say that's not the case - but - actions over words.

It's near impossible to keep track which ones have still been open if they've all been closed out (been there, tried that)
You'll have say 100 issues about nuxt/4 ... 20 will still have been open - but in the issue tracker, they'll all still look the same - as all have been closed out (not even with a label "to migrate" or whatever).

So quite honestly - i have 0 trust that you'll remember which ones would've needed migration if you close them out at this point.

I'll expect my issue (the one that's still open) to either be fixed - or kept open until the actual code migration happens - at which point you can migrate the issues all the same (it's just a "transfer issue" click - if you know github a little :) ).

Then it's transparent that the issue is still present and open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
codemod-issue Any issues related to a codemod, FP or FN.
Projects
None yet
Development

No branches or pull requests

3 participants