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

Provide a yarn add step for gem plugins with the relevant metadata when they get loaded #8

Merged
merged 1 commit into from Apr 20, 2020

Conversation

jaredcwhite
Copy link
Member

This lets you use an NPM package which will get installed and run alongside your plugin. The way it works is, from the docs:


Let's assume you've been building an awesome plugin called, unsurprisingly,
MyAwesomePlugin. In your my-awesome-plugin.gemspec file, all you need to do is
add the yarn-add metadata matching the NPM package name and keeping the version
the same as the Gem version:

  spec.metadata = { "yarn-add" => "my-awesome-plugin@#{MyAwesomePlugin::VERSION}" }

With that bit of metadata, Bridgetown will know always to look for that package in
the users' package.json file when they load Bridgetown, and it will trigger a
yarn add command if the package and exact version number isn't present.

@jaredcwhite jaredcwhite added the enhancement New feature or request label Apr 19, 2020
@jaredcwhite jaredcwhite merged commit 2d851d3 into master Apr 20, 2020
@jaredcwhite
Copy link
Member Author

Ship it! :shipit:

@jaredcwhite jaredcwhite deleted the yarn-add-for-gems-with-metadata branch May 20, 2020 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant