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

Improve support for bundling/deploying individual packages as self-contained, minimal-footprint bundles #2077

Closed
tommedema opened this issue May 8, 2019 · 9 comments

Comments

@tommedema
Copy link

I believe #1589 by @ajhool should be re-opened. Reasoning is:

  • npm publish is to publish a package to the npm registry, which is not what is needed for serverless applications; instead a flat bundle of non-hoisted dependencies is needed
  • npm publish does not package dependencies or dependencies of dependencies
  • adding all dependencies to "bundledDependencies" is cumbersome and error-prone, and does not resolve the issue anyway, as dependencies of dependencies are still not bundled
@evocateur
Copy link
Member

What exactly stops you from npm install the local package into a build target and archiving/uploading that? Lerna manages npm packages, not serverless applications.

@ajhool
Copy link
Contributor

ajhool commented May 14, 2019

FWIW, one of the main statements in that original issue was:

Expected Behavior
If this functionality is currently supported, it would be helpful to provide a deploy section in the README that would make deploying microservices a first-class feature, alongside publishing.

If serverless deployment with Lerna is trivial (eg. npm install the local package into a build target and upload that), then why not expand the scope of Lerna to include that process? IIRC, it is more complicated than that due to private packages and symlinks. IIRC local references actually make more sense than Lerna for serverless monorepos.

The tagline of Lerna is: "A tool for managing JavaScript projects with multiple packages." Serverless monorepos are javascript projects with multiple packages and serverless monorepos are becoming increasingly common. So, it seems reasonable to support that use-case or to provide a note in the README.md along the lines of your comment in #1061 that "If you aren't deploying packages, you shouldn't use Lerna" or "Lerna is not a serverless deployment tool".

@evocateur
Copy link
Member

why not expand the scope of Lerna

I'm the only active maintainer. Are you volunteering?

I'll say it again: Lerna is not a deployment tool. For anything.

@tommedema
Copy link
Author

@evocateur I see your point, though I believe this wouldn't make lerna a deployment tool.

Lerna's scope is to manage packages within a mono repo, right? Now, an issue is that existing deployment tools (such as the serverless framework) look at the node_modules folder to do their deployment. Lerna, being a package manager, has broken these tools by managing packages in an unexpected way. What I'm interested in is to see if this can be fixed, perhaps using symlinks or other solutions.

@tommedema
Copy link
Author

also @ajhool can we discuss a way forward somewhere else? seems like we've both been struggling with mono repos for several years without much progress; I'm open to contributing to lerna or npm or starting a fork etc. see my github profile for contact details

@ajhool
Copy link
Contributor

ajhool commented May 15, 2019

@tommedema I had simply moved on to other areas of my project but am returning to lambda function development within the coming weeks because everything else is finished. I have mostly been using the AWS Amplify framework to manage functions (there are typescript incompatibility issues there, though), but I do have several functions that might belong in their own monorepo. As I approach lambda monorepo development again, what I'd first like to do is survey the existing technologies and identify exactly where the gaps are. If there is no existing solution for lambda monorepo development, then it would certainly be a worthwhile project to take on.

I'll contact you through your other channels.

@ajhool
Copy link
Contributor

ajhool commented May 16, 2019

why not expand the scope of Lerna

I'm the only active maintainer. Are you volunteering?

I'll say it again: Lerna is not a deployment tool. For anything.

I'm not surprised that nobody else is interested in actively maintaining a project with you. Most popular open source projects have no trouble finding help

@evocateur
Copy link
Member

Lerna, being a package manager, has broken these tools [...]

@tommedema: Lerna is not a package manager. It is a tool that coordinates package managers (npm, yarn, etc).

I'm not surprised that nobody else is interested in actively maintaining a project with you.

Stay classy, @ajhool. If you actually maintained any popular packages, you might discover otherwise.

@evocateur
Copy link
Member

Anyway, for future intrepid explorers into why Lerna sucks at Serverless, maybe serverless-jetpack will help you out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants