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

auto-detect package manager in the plugin manager #821

Merged
merged 5 commits into from
Nov 1, 2023

Conversation

KonnorRogers
Copy link
Member

This is a 🙋 feature or enhancement.

Summary

Auto-detect how to install dependencies of plugins to improve the story of using any package manager

Context

Related to #609

This doesn't fix it. But this allows you to opt-out of yarn and use whatever package manager you want. We could also just bail if we can't find a yarn.lock or maybe check an ENV var like NO_YARN_INSTALL or something?

@render
Copy link

render bot commented Oct 29, 2023

@render
Copy link

render bot commented Oct 29, 2023

@sandstrom
Copy link
Contributor

Just to chime in, my suggestion would be that Bridgetown should be less concerned about the JS ecosystem and package managers.

Instead, it should provide generic primitives (hooks, etc) that any package manager can use.

I've explained my thinking in these two posts:

@jaredcwhite
Copy link
Member

@sandstrom Yeah I think we could easily extract all this stuff out to a more third-party-configurable module of some sort rather than buried in a core class.

@jaredcwhite
Copy link
Member

I want to get this merged in the meantime though. I think @KonnorRogers we just need the linting fixed and then we're good to go!

@sandstrom
Copy link
Contributor

I want to get this merged in the meantime though.

I understand, sounds good!

Yeah I think we could easily extract all this stuff out to a more third-party-configurable module of some sort rather than buried in a core class.

The whole ecosystem for JS/node moves fast, and trying to keep up is impossible.

Apart from the comments cited above, Middleman is another good example.

https://middlemanapp.com/advanced/external-pipeline/#webpack-example

They have the concept of an 'external pipeline' and try not to worry too much about JS/CSS/etc.

Bridgetown can still provide some helpful documentation on how to set it up, and even have the 'start new project' CLI tool generate some boilerplate code that set things up with webpack or esbuild.

But I think the framework should avoid trying to write a wrapper API around all the potential functionality that may go into an asset pipeline, and instead leave it to node-land tools.

@KonnorRogers
Copy link
Member Author

@jaredcwhite fixed

@jaredcwhite
Copy link
Member

@KonnorRogers Fantastic! I hope to cut another point release soon, so this will be a welcome improvement.

@sandstrom I think that's generally our position, but it's also easier to maintain tooling over time that's part of the framework's "runtime" than something that's part of a starter kit or whatever. That's why we don't simply generate a single esbuild config file and then wipe our hands forevermore, but instead the main portion of the config is part of a file "owned" by the framework that can get auto-updated. As someone who starts and operates dozens of Bridgetown sites, I take comfort knowing the esbuild config can always be easily brought up-to-date across all of them.

@jaredcwhite jaredcwhite merged commit 722cac7 into main Nov 1, 2023
@jaredcwhite jaredcwhite deleted the konnorrogers/auto-detect-package-manager branch November 1, 2023 18:25
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

Successfully merging this pull request may close these issues.

3 participants