-
-
Notifications
You must be signed in to change notification settings - Fork 0
Custom extractors and transformers #9
Copy link
Copy link
Closed
Labels
package: babel-pluginRelated to babel-plugin-saykitRelated to babel-plugin-saykitpackage: configRelated to @saykit/config and the CLIRelated to @saykit/config and the CLIrequestA request for a new feature or a change in behaviourA request for a new feature or a change in behaviour
Metadata
Metadata
Assignees
Labels
package: babel-pluginRelated to babel-plugin-saykitRelated to babel-plugin-saykitpackage: configRelated to @saykit/config and the CLIRelated to @saykit/config and the CLIrequestA request for a new feature or a change in behaviourA request for a new feature or a change in behaviour
Currently the supported syntaxs are JS/TS and JSX/TSX, cool and all, but if support for others (vue, svelte, ripple) is wanted, they have to be added directly to the babel plugin, and there is no way for consumers to create their own extractors/transformers.
The idea is the create the concept of "factories" (undecided on term). These factories follow a similar model to formatters, in that they provide a set of functions that can be called by the cli while extracting/compiling messages. Something like:
The extracting and transforming from the babel plugin would be split into two packages
@saykit/factory-jsand@saykit/factory-jsx, that can then be passed into the saykit config buckets. This allows for in the future@saykit/factory-vueand@saykit/factory-svelte. With this change, this means in order for the plugins to know how to transform the code, they will need to be able to access the config fromsaykit.config.ts(currently only the cli cares about the config).With this, I wonder if the number of packages should be reduced, e.g. combine
saykitand@saykit/configevery project that uses saykit would need its config and cli. I then do also wonder if every package should just become an export ofsaykit(saykit/react,saykit/carbon,saykit/format/po), I believe effect.ts did this recently, something to thing about. Todo, make another issue for this