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

feat: add a plugin system #402

Open
wants to merge 43 commits into
base: main
Choose a base branch
from
Open

feat: add a plugin system #402

wants to merge 43 commits into from

Conversation

boneskull
Copy link
Owner

@boneskull boneskull commented Oct 10, 2023

This adds a plugin system so we can separate things like rules (and eventually package manager implementations from the main codebase), and others can write custom plugins providing the same.

All rules have moved into the @midnight-smoker/plugin-default package.

Pluginable Things

  • Package managers
  • Rules
  • Reporters

Limitations

Plugins currently cannot interact with each other nor declare dependencies on other plugins. Eventually I imagine someone might want to, say, override a rule.

TODO

  • List of plugins to load must be user-specified. Probably unwise to attempt automatic discovery (or make it opt-in). This will necessarily invoke multiple passes through options validation.
  • Rules created by 3rd party plugins must be scoped to the plugin name.
  • Need to assert the plugin name matches the package name.
  • Docs
    • Plugin guide
    • Usage guide
    • Getting started guide
    • Rules reference
    • CLI reference
    • Config reference
  • Anything else in the milestone

Future

  • Plugins should be allowed to define command-line options

@boneskull
Copy link
Owner Author

boneskull commented Oct 10, 2023

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @boneskull and the rest of your teammates on Graphite Graphite

Base automatically changed from monorepo to main October 10, 2023 02:08
@boneskull boneskull force-pushed the plugin-support branch 2 times, most recently from 181aead to d55ad27 Compare October 11, 2023 00:08
@boneskull boneskull self-assigned this Oct 11, 2023
@boneskull boneskull force-pushed the plugin-support branch 2 times, most recently from a5ad1ef to 1758954 Compare October 11, 2023 07:00
@boneskull boneskull marked this pull request as ready for review October 11, 2023 07:12
@boneskull boneskull changed the base branch from main to docsify October 11, 2023 21:40
@boneskull boneskull added the enhancement New feature or request label Oct 11, 2023
Base automatically changed from docsify to main October 11, 2023 21:58
@boneskull boneskull force-pushed the plugin-support branch 11 times, most recently from 4bd3120 to b9a5fd8 Compare October 13, 2023 04:27
This means--in theory--instead of using the callbacks, one can use e.g., RxJS to react to events.

hopefully made AbortSignal handling in reporter contexts less awful.
- fix lockfile
- fix wrong type in simple reporter
Because I don't remember why I set it, but I _think_ the problem involved linking a custom Starlight or TypeDoc plugin, or something?  I may re-enable it later.
- Separate component types from their schemas. Schemas should not be used outside of `midnight-smoker`; types can.
- Rename `NormalizePackageJson` to `PackageJson` since it's the only type we care about.
- Fix `readSmokerPkgJson()` to return a `PackageJson`
- remove `tinyexec`
- add `terminate`
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.

1 participant