Easier macro / templated fn to create custom SWC runtime binary
Describe the feature
While there are a lot of things to be improved though, path to writing a transform plugin is somewhat simplified via support of SWC upstream (swc_core's transform plugin macro and utilities).
There is another pillar to instantiate custom transforms on the other hand by creating a custom binary instead of relying on @swc/core. This is somewhat less documented, and requires some boilerplate to create necessary interfaces to work with. next-swc is a good example. For example, it have its own n-api interface definition like https://github.com/vercel/next.js/blob/d6cb795fc6842337e4ba836a399c8d97a8b3aea0/packages/next-swc/crates/napi/src/transform.rs which is somewhat similar to what @swc/core have : https://github.com/swc-project/swc/blob/c50b4f08aa30a0898a5a5a9d7f3ce4c275eaa454/crates/binding_core_node/src/transform.rs . And the only reason next-swc has repeated codes is to apply a few custom transform plugins + few custom configurations to support it.
As we aim swc_core to be a de-facto SDK to write any kind of custom codes for the SWC either custom runtime or plugin, it'd be preferred if we could expose some public interface to the factory to those repeated codes. Ideally, if possible having some sort of macros accepts a number of custom transforms & configuration options. The same applies for the minify, bundle and other api surfaces SWC supports.
It's not a must goal for the swc_core for now, rather a item to think about. It may not possible to achieve this.
Babel plugin or link to the feature description
No response
Additional context
No response