-
-
Notifications
You must be signed in to change notification settings - Fork 20
Fix metafile copying when lock file is not found #64
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
Conversation
How about we then drop |
Yes, agree. Let's do that |
Should be all good |
You still have conflicts, seems you have to rebase |
what the fuck did I do |
Okay looks like we can't rebase this PR, but we can squash it. Idk what the hell i've done |
So again ahah, we have a problem with the metafiles copying : if the lockfile does not exist, copying the meta files will fail. To recap, here's the problem I encountered:
package-lock.json
to the build folder. However, I'm usingpnpm
so I don't have apackage-lock.json
file.The problem is that we copy the metafiles + package.json + lockfile in a single call to
cpy
: https://github.com/adonisjs/assembler/blob/fix/metafiles-cpy/src/bundler.ts#L223Then we ignore ENOENT errors:
https://github.com/adonisjs/assembler/blob/fix/metafiles-cpy/src/bundler.ts#L105
And, when trying to copy metafiles + package.json + lockfile, since the lock file is missing,
cpy
will just throw an error and not copy anything.So i am not sure how we should handle this, hence my PR with just a test that showcase the error.
I've opened a PR to the core that adds automatic detection of the package manager, which help to avoiding this error
Also, I wonder if we shouldn't find an alternative to
cpy
given the message added to their README: https://github.com/sindresorhus/cpy/releases/tag/v11.0.0Feel free to give any directive and I can implement a fix