Comments (4)
I'm not sure why you'd want to have these manual copy steps. I think the isolate command should handle everything if you configure it as part of the firebase.json "predeploy" configuration.
That being said there seems to be an issue with the yarn lockfile still, preventing it to be use in the deployment as-is, so I advise you to exclude the lockfile using the configuration settings.
For more info see:
https://github.com/0x80/isolate-package/#lockfiles
from isolate-package.
I'm hoping to find some time soon to really get deeper into the lockfile formats for PNPM and Yarn and see if it's possible to modify them to make the deployments work, but it might be difficult to achieve and I struggle to find time at the moment...
None of the manual workarounds solve this issue, and it's not a deal breaker for me, but I guess it depends on your situation and the kind of dependencies you deploy.
A temporary solution could maybe be to use exact versions in your package.json file. It doesn't lock the dependencies of your dependencies, like a lockfile would, but at least the direct dependencies of your project will be the same...
from isolate-package.
I did end up having to not include the lockfile for Firebase Functions deploy. Haven't run into problems with it for now but we plan to migrate away from Firebase Functions anyway.
The reason I was doing the manual copies was because some of the cache and config file live outside of the targetPackagePath
. In our Yarn monorepo, the individual workspace /functions
has its Yarn artifacts hoisted up to /
. I don't think isolate is accounting for that as far as I know. Both .yarn/releases
and .yarnrc.yml` are required to configure Yarn to run correctly.
I believe the issue with the lockfile is that the hash for a local file:
reference was not a stable identity after the upload to Firebase Functions and Cloud Build. I'm not sure how Yarn is generating that hash.
from isolate-package.
@darkmirage I'm happy to report that lockfile output for classic and modern version of Yarn is now supported in the latest version. At least I've tested it with v1 and v4.
For v4 it does not generate a yarn.lock file, but instead for modern yarn versions it falls back to using NPM. The generated packge-lock in the output is based on the installed node_modules and therefore should match all the versions of your original yarn lockfile. For more info see lockfiles
What package manager is used in the deployment probably shouldn't matter (as long as the locked versions match) so I think this is a viable solution.
I am also working on a typescript monorepo boilerplate which has a branch called use-yarn-modern
that you can check out if you want to see a working example with isolate-package integrated.
from isolate-package.
Related Issues (20)
- Asking for all dependencies when using node-linker=hoisted HOT 6
- Where pnpm is the package manager for the repo, would it makes sense to use 'pnpm pack' instead of 'npm pack'? HOT 6
- Firebase functions reloading not working HOT 3
- Patched dependencies are breaking GCP deployments using pnpm HOT 9
- Getting a ERR_MODULE_NOT_FOUND during firebase deploy HOT 9
- Do not include scripts for internal dependencies
- Add support for Rush monorepos HOT 17
- Add support for passing CLI arguments HOT 6
- pnpm overrides are breaking gcp deployments HOT 7
- Failing to pack with PNPM HOT 4
- There are types at 'isolate-package/dist/index.d.ts', but this result could not be resolved when respecting package.json "exports". HOT 7
- Isolate seem to be not copying the `.env` file HOT 2
- Remove excess packages from the list in pnpm lockfile
- Fix package registry logic for non-rush repositories
- Strip forceNpm option for sake of simplicity
- Reintroduce excludeLockfile
- Add support for pnpm v9 HOT 4
- trouble shooting some problems HOT 3
- Consistently use pnpm pack if suitable
- Adopt packageManager field from root manifest
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from isolate-package.