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(plugin-core): new plugin-core package #1193

Merged
merged 11 commits into from
Sep 27, 2023
Merged

Conversation

BethanyBerkowitz
Copy link
Contributor

@BethanyBerkowitz BethanyBerkowitz commented Sep 20, 2023

Status

READY

Description

Part of #1013.

This PR creates a plugin-core package, which extracts the aspects of the rollup-plugin and webpack packages that can be shared between the two. This will mean that we have consistency between these two packages (and any further build plugins) in the following areas:

  1. Config options (defining required options and cleaning them)
  2. Uploading sourcemaps to HB API
  3. Uploading deploy notifications

This package includes aspects of both existing packages, mostly from https://github.com/honeybadger-io/honeybadger-js/blob/master/packages/rollup-plugin/src/hbUtils.ts and https://github.com/honeybadger-io/honeybadger-js/blob/master/packages/webpack/src/resolvePromiseWithWorkers.js.

There will be follow-up PRs to have webpack and rollup-plugin depend on plugin-core.

Todos

  • Tests
  • Documentation

@BethanyBerkowitz BethanyBerkowitz changed the title feat: new plugin-core package feat(plugin-core): new plugin-core package Sep 20, 2023
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would go for type declaration instead of interfaces:

export type HbPluginOptions = {
  // ....
}

packages/plugin-core/tsconfig.json Show resolved Hide resolved

## Usage

You shouldn't need to use this package directly. This package serves as the core implementation of shared functionality meant to be used within Honeybadger's plugins for JS build/bundling systems such as [webpack](https://github.com/honeybadger-io/honeybadger-js/tree/master/packages/webpack) and [rollup](https://github.com/honeybadger-io/honeybadger-js/tree/master/packages/rollup-plugin).
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@subzero10 I modeled this README on the core package, which is available to the public but not encouraged for people to use. I think we actually may find circumstances later in which this may be useful for people to use directly... basically any time we recommend someone hit the sourcemap upload or deploy notification API in JS-land, they could probably use this instead. But I'd say let's use it for our own purposes first, and then decide if we want our users to use it or not later.

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.

2 participants