There are different ways to make a contribution to this extension. A few guidelines are provided here to keep the workflow and review process most efficient.
You may help by reporting bugs and feature requests. Before you do, please make sure you run the latest version of BootstrapComponents and you are not about to address a known-issue. Then check if a corresponding open bug already exists on the list of open bugs and if you have new information, comment on it. If the bug is not yet reported, open a new bug report.
When you report a bug, please include:
- Exact steps to reproduce the bug
- Expected result
- Observed result
- Versions of PHP, MediaWiki, BootstrapComponents, Browsers, other relevant software (web server, MediaWiki extensions)
- Other information that may be relevant
- If available a web link, where this bug can be seen
If in doubt, don't worry. You will be asked for what is missing.
MediaWiki has some more advice on how to report a bug.
- You would really help by creating, updating or amending the documentation of
the components in the
/docs
folder. Although the documentation is the main source of information for anybody who would want to use the extension it never gets the attention it deserves. (Stephan, you are so on point) - You may provide a screenshot of the component used on your wiki and add it to its documentation.
- Finally, you may help by providing translations via translatewiki.net. See their progress statistics to find out if there is still work to do for your language.
The BootstrapComponents extension is hosted on GitHub. To provide patches you need to get an account.
A few points to ease the process:
- Please ensure that patches are based on the current master.
- Code should be easily readable and if necessary be put into separate components (or classes). Also, please follow the MediaWiki coding conventions.
- Newly added features should not alter existing tests but instead provide additional test coverage to verify the expected new behaviour. For a description on how to write and run PHPUnit test, please consult the manual.
- If you want to add new components, follow the guidelines under Adding components.
- Every component gets its own class. Implement child of class
AbstractComponent
. Files for component classes are located in thesrc/Component
directory. - Add your class to the autoloader section of extension.json
- In class
ComponentLibrary
, look for the methodrawComponentsDefinition()
and add all necessary data for the new component - Create all necessary message entries in qqq.json and en.json.
- Document the new component in components.md
- Add tests for your new class. For guidelines on unit testing see information on mediawiki.org
- Adjust existing tests / provider:
AbstractComponentTest::allComponentsProvider()
ComponentLibraryTest::testCanCompileMagicWordsArray
ComponentLibraryTest::compileParserHookStringProvider
ComponentLibraryTest::componentNameAndClassProvider
ComponentLibraryTest::modulesForComponentsProvider
SetupTest::testHookParserFirstCallInit
[
(string)[component name, lower case] => [
'class' => (string)'\\BootstrapComponents\\Components\\[Component Class]',
'handlerType' => [self::HANDLER_TYPE_PARSER_FUNCTION or self::HANDLER_TYPE_TAG_EXTENSION],
'attributes' => [
'default' => (bool)true|false [does this component allow the default attributes]
(string)... [list of individual attributes, must be registered in AttributeManager]
],
'modules' => [
'default' => (string|array)[modules to load when this component is parsed]
'[skin name]' => (string|array)[modules to load when this component is parsed and [skin name] is active]
]
],
];
public function placeMe( $input ) {
...
return <(array|string) your component html code>
// see also https://www.mediawiki.org/wiki/Manual:Parser_functions#Controlling_the_parsing_of_output
}