refine icon indicating copy to clipboard operation
refine copied to clipboard

[FEAT] Support Yarn 2 (specifically Plug n Play)

Open s1anden opened this issue 2 years ago • 8 comments

Is your feature request related to a problem? Please describe.

I see in the documentation that currently only Yarn 1 is supported by Refine:

Screenshot 2023-07-21 at 12 56 03 PM

I tested this a bit myself, and was in fact able to get a Refine project to run using Yarn Modern, but where it breaks down is in attempting to use the Plug 'n' Play. Specifically the first issue is here, where various .bin/ scripts that aren't listed as dependencies of the project are imported.

Are there any plans on the roadmap to add support for PNP?

Describe alternatives you've considered

No response

Additional context

No response

Describe the thing to improve

I'd like to be able to use Refine in a project that's using yarn Plug n Play!

s1anden avatar Jul 21 '23 17:07 s1anden

Hello @s1anden unfortunately, I don't have enough context atm, but would like to do some research and get back to you in couple of days. In the meantime, if you would like to contribute, feel free to do it! We are more than happy to assist you in the process.

BatuhanW avatar Jul 24 '23 17:07 BatuhanW

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 22 '23 20:09 stale[bot]

@s1anden thanks for the issue!

@omeraplak @BatuhanW in a Yarnv2 setup with multiple workspaces, I also tried to use npm but it still doesn't work. Would be great if this can be looked into :)

I do get this warning about npm config being ignored, I could be missing something

ignoring workspace config at /home/parent/child-app/.npmrc

I know for a fact that an earlier version of refine was working for me but that was a long time back. I'll try to find and if I do will share

achalagarwal avatar Nov 06 '23 14:11 achalagarwal

@achalagarwal, what's the error you're facing here? Can you give a bit more context about the problems you're having? I'm not sure if this related with the plug-n-play feature of yarn v2 or not 🤔

aliemir avatar Nov 06 '23 16:11 aliemir

Seems to be an issue with resolving the .bin dependency. Maybe I have to yarn dlx patch:add pathToRefineBin. Not sure and I have no idea what the path would be. Will continue using npm for now

Error: @refinedev/cli tried to access .bin, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.

Required package: .bin (via ".bin/vite")


Traces:

/home/B/A/.pnp.cjs:28668 Error.captureStackTrace(firstError); ^

Error: @refinedev/cli tried to access .bin, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.

Required package: .bin (via ".bin/vite") Required by: @refinedev/cli@npm:2.16.16 (via /home/B/A/.yarn/cache/@refinedev-cli-npm-2.16.16-6fa370b561-afaaa2ab71.zip/node_modules/@refinedev/cli/dist/)

Require stack:

  • /home/B/A/.yarn/cache/@refinedev-cli-npm-2.16.16-6fa370b561-afaaa2ab71.zip/node_modules/@refinedev/cli/dist/cli.js at require$$0.Module._resolveFilename (/home/B/A/.pnp.cjs:28668:13) at Function.resolve (node:internal/modules/cjs/helpers:127:19) at Object.getBin (/home/B/A/.yarn/cache/@refinedev-cli-npm-2.16.16-6fa370b561-afaaa2ab71.zip/node_modules/@refinedev/cli/dist/cli.js:4:953) at Command.mo (/home/B/A/.yarn/cache/@refinedev-cli-npm-2.16.16-6fa370b561-afaaa2ab71.zip/node_modules/@refinedev/cli/dist/cli.js:17:1347) at Command.listener [as _actionHandler] (/home/B/A/.yarn/cache/commander-npm-9.4.1-9deffb2749-bfb18e325a.zip/node_modules/commander/lib/command.js:482:17) at /home/B/A/.yarn/cache/commander-npm-9.4.1-9deffb2749-bfb18e325a.zip/node_modules/commander/lib/command.js:1264:65 at /home/B/A/.yarn/cache/commander-npm-9.4.1-9deffb2749-bfb18e325a.zip/node_modules/commander/lib/command.js:1155:33 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

achalagarwal avatar Nov 19 '23 18:11 achalagarwal

Hello @achalagarwal thanks for the inspection! Would you like to work on this issue with your findings?

BatuhanW avatar Nov 20 '23 07:11 BatuhanW

Had I known the solution, I would have pushed a fix 😔

achalagarwal avatar Nov 20 '23 08:11 achalagarwal

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jan 20 '24 10:01 stale[bot]