-
Notifications
You must be signed in to change notification settings - Fork 585
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
[rush] Deploy command is preserving workspace:* entries #2723
Comments
@octogonz - is this by design? |
Alisson asked the same question in this Zulip thread. I'm trying to get more details about what it would be used for. (It's not difficult to implement, but it's unclear why someone would need it.) |
In limited cloud environments like Google App Engine you don't have the luxury of PNPM and the environment strips the node_modules folder and forces a npm install, which doesn't recognize the workspace syntax in package.json. |
This was my question from Zulip:
@thelinuxlich could you give us some insight why you are requesting this feature? |
It's what I said above, limited cloud environments like Google force the |
Just in case this accomplishes something, some more details as requested. Google cloud functions and firebase cloud functions (and probably other google cloud things) have a fairly unique behavior where the build/ deploy workflow is
And nothing is configurable in any useful way, practically speaking this means that any code the cloud function needs to execute either needs to be a local file (not in node_modules) or be installable by npm install. Of course, this is 100% a dumb behavior from google cloud we're trying to work around, but there's definitely one of several configurations this project could support which would help. Here's an ungodly long issue on the firebase-cli repo firebase/firebase-tools#653 that describes the issue and the various workarounds people people have come up with. For the most part it boils down to one of two solutions with varying levels of complexity and re-usability.
Sooo... there's the usecase, basically working around poor design from google |
You might want to look into isolate-package and firebase-tools-with-isolate (which integrates the isolate process so that it only happens on deployment and you can still run the emulators as usual with HMR). They were developed specifically to solve the challenges with Firebase deployments (which I wrote about here), but isolate-package is generic enough to be useful for other scenarios like creating docker images. I use it for Cloud Run deployments. Both now support Rush monorepos. I have only tested it with PNPM because I don't use Rush myself, but I'm fairly confident that things will work with NPM and Yarn as well. This is the example repo I've tested it on. |
To answer the original question in this thread:
The inclusion of
To avoid confusion, perhaps we should retitle this GitHub issue or create a new GitHub issue. If I understand correctly, the request is: Could Is that correct? For example, one idea might be to create an NPM package tarball that with (1) NO package.json dependencies and (2) an Would that meet the requirements for Google App Engine? (Any other proposals?) |
Isolate-package can do this. It has a For PNPM the isolated output remains a workspace, because this is how PNPM likes to have things. When I tried to convert the So for PNPM the internal dependencies are moved to the isolated output folder, and are preserved as a workspace, and effectively it still is a monorepo setup but can be installed in a cloud environment as-is. The outputs for Yarn and NPM use |
Summary
I'm confused. I thought
rush deploy
was supposed to create a generic artifact to be deployed in restrict environments, like Google Cloud which doesn't support NPM. However, when I runrush deploy
I can see the package.json of the deployed projects incommon/deploy/packages/<project_name>
are still using the "workspace:*" syntax. Is this a bug or intended?Repro steps
Expected result: Generated package.json in deploy folder without "workspace:*" syntax
Actual result: Generated package.json still preserving exclusive PNPM syntax
Standard questions
Please answer these questions to help us investigate your issue more quickly:
@microsoft/rush
globally installed version?rushVersion
from rush.json?useWorkspaces
from rush.json?node -v
)?The text was updated successfully, but these errors were encountered: