Naming Conventions
This document is for extension developers who wish to create their own extensions.
Interfaces
Destructured object parameter is postfixed with Props
. For interfaces with a single property e.g. EditorViewProp
the postfix is the singular Prop
to signify that the interface is designed to be composed with other interfaces.
Extensions
- Packages must supply the following keywords -
remirror
,extension
. - Packages should be named
remirror-extension-[NAME]
.- The name should be hyphen deliniated
remirror-extension-new-rules
to separate words.
- The name should be hyphen deliniated
- Should export a named extension which uses the pascal version of the npm package name.
remirror-extension-custom
should exportCustomExtension
.remirror-extension-new-rules
should exportNewRulesExtension.
- Extensions that only support a specific framework should use the pattern `remirror-extension-[FRAMEWORK]-[NAME].
remirror-extension-react-toggle-button
and exportsReactToggleButtonExtension
.remirror-extension-angular-split
and exportsAngularSplitExtension
.
- Extensions which take options should export their options interface. The name should replace
Extension
from the exported extension class withOptions
.remirror-extension-awesome
becomesAwesomeOptions
.- This is not a hard requirement and can be ignored when there are naming conflicts.
Presets
- Packages must supply the following keywords -
remirror
,preset
. - Packages should be named
remirror-preset-[NAME]
.- The name should be hyphen deliniated
remirror-preset-new-rules
to separate words.
- The name should be hyphen deliniated
- Should export a named preset which uses the pascal version of the npm package name.
remirror-preset-custom
should exportCustomPreset
.remirror-preset-new-rules
should exportNewRulesPreset
.
- Presets that only support a specific framework should use the pattern `remirror-preset-[FRAMEWORK]-[NAME].
remirror-preset-react-toggle-button
and exportsReactToggleButtonPreset
.remirror-preset-angular-split
and exportsAngularSplitPreset
.
- Presets which take options should export their options interface. The name should replace
Preset
from the exported preset class withOptions
.remirror-preset-awesome
becomesAwesomeOptions
.
- Presets which also export extensions should follow the naming conventions highlighted in the extension section.