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-rulesto 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-customshould exportCustomExtension.remirror-extension-new-rulesshould exportNewRulesExtension.
- Extensions that only support a specific framework should use the pattern `remirror-extension-[FRAMEWORK]-[NAME].
remirror-extension-react-toggle-buttonand exportsReactToggleButtonExtension.remirror-extension-angular-splitand exportsAngularSplitExtension.
- Extensions which take options should export their options interface. The name should replace
Extensionfrom the exported extension class withOptions.remirror-extension-awesomebecomesAwesomeOptions.- 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-rulesto 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-customshould exportCustomPreset.remirror-preset-new-rulesshould exportNewRulesPreset.
- Presets that only support a specific framework should use the pattern `remirror-preset-[FRAMEWORK]-[NAME].
remirror-preset-react-toggle-buttonand exportsReactToggleButtonPreset.remirror-preset-angular-splitand exportsAngularSplitPreset.
- Presets which take options should export their options interface. The name should replace
Presetfrom the exported preset class withOptions.remirror-preset-awesomebecomesAwesomeOptions.
- Presets which also export extensions should follow the naming conventions highlighted in the extension section.