You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bundle gem is currently helpful in creating some of the things most gems should start out with, such as CI config. But I'd like to suggest a few more features that I think should be part of bundle gem before I start working on them:
A pattern for top-level configuration of a gem, e.g. being able to call YourGem.config to have a Struct you can query and modify to set options. Optionally, you could also depend on ActiveSupport if you're not shy of that and use its OrderedOptions class to provide this in the same way Rails does.
Exposure of this config to a Rails app via an engine initializer, as is done here. It's of note that at present, ViewComponent is configured via mattr_accessors on the class, rather than by its own config object, so those config options need to be manually mirrored to Rails.application.config.view_component.
Providing a means of generating a documentation site that can be shared, for example, on GitHub Pages
Providing a means of generating a changelog, e.g. with git-chglog
CI configuration for pushing new versions of gems to registries
CI configuration for running RuboCop, SimpleCov and RSpec if not already provided
Some of these things are opinionated and may be optional, but it would be better to make as many defaults as possible so that we can guide folks towards making better gems that provide a good framework for themselves to grow.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
bundle gem
is currently helpful in creating some of the things most gems should start out with, such as CI config. But I'd like to suggest a few more features that I think should be part ofbundle gem
before I start working on them:YourGem.config
to have aStruct
you can query and modify to set options. Optionally, you could also depend onActiveSupport
if you're not shy of that and use itsOrderedOptions
class to provide this in the same way Rails does.mattr_accessor
s on the class, rather than by its own config object, so those config options need to be manually mirrored toRails.application.config.view_component
.git-chglog
Some of these things are opinionated and may be optional, but it would be better to make as many defaults as possible so that we can guide folks towards making better gems that provide a good framework for themselves to grow.
Beta Was this translation helpful? Give feedback.
All reactions