Skip to content
Snippets Groups Projects
Commit fe5c5c48 authored by Jacob Rockowitz's avatar Jacob Rockowitz
Browse files

Update 'Steps for creating a new release'

parent c42b2966
No related branches found
No related tags found
No related merge requests found
Steps for creating a new release of this module
-------------------------------------------------------------------------------- Steps for creating a new release
--------------------------------
1. Apply short array syntax 1. Cleanup code
2. Inspect code 2. Review code
3. Run tests 3. Run tests
4. Generate and edit release notes 4. Generate release notes
5. Tag a release 5. Tag and create a new release
6. Update project page 6. Update project page
7. Create new release
--------------------------------------------------------------------------------
# Apply to short array syntax
wget https://raw.githubusercontent.com/thomasbachem/php-short-array-syntax-converter/master/convert.php 1. Cleanup code
find . -name "*.install" -exec php "convert.php" -w "{}" \; ---------------
find . -name "*.module" -exec php "convert.php" -w "{}" \;
find . -name "*.php" -exec php "convert.php" -w "{}" \;
find . -name "*.inc" -exec php "convert.php" -w "{}" \;
rm convert.php
-------------------------------------------------------------------------------- [Convert to short array syntax](https://www.drupal.org/project/short_array_syntax)
# Inspect code drush short-array-syntax toc_api
**References**
- [Installing Coder Sniffer](https://www.drupal.org/node/1419988) 2. Review code
--------------
**PHPStorm** [Online](http://pareview.sh)
- [Drupal Development using PhpStorm](https://confluence.jetbrains.com/display/PhpStorm/Drupal+Development+using+PhpStorm#DrupalDevelopmentusingPhpStorm-CoderandPHPCodeSnifferIntegration) http://git.drupal.org/project/toc_api.git 8.x-1.x
**Online** [Commandline](https://www.drupal.org/node/1587138)
- [pareview.sh](http://pareview.sh)
http://git.drupal.org/project/toc_api.git 8.x-1.x
**[Commandline](https://www.drupal.org/node/1587138)**
# Check Drupal coding standards # Check Drupal coding standards
phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,js,css,info,txt,md modules/sandbox/toc_api phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,js,css,info,txt,md,yml modules/sandbox/toc_api
# Check Drupal best practices # Check Drupal best practices
phpcs --standard=DrupalPractice --extensions=php,module,inc,install,test,profile,theme,js,css,info,txt,md modules/sandbox/toc_api phpcs --standard=DrupalPractice --extensions=php,module,inc,install,test,profile,theme,js,css,info,txt,md,yml modules/sandbox/toc_api
--------------------------------------------------------------------------------
# Run tests
**SimpleTest**
GUI (admin/config/development/testing) 3. Run tests
------------
Command-line (from site root) [SimpleTest](https://www.drupal.org/node/645286)
# Run all test included this module # Run all tests
php core/scripts/run-tests.sh --url http://localhost/d8_dev --module toc_api php core/scripts/run-tests.sh --url http://localhost/d8_dev --module toc_api
**PHPUnit tests**
PHPUnit tests needs to be run individual if this module is placed in a [PHPUnit](https://www.drupal.org/node/2116263)
modules sub-directory (ie module/contrib or modules/sandbox).
- [/core/phpunit.xml.dist only finds top-level contrib modules](https://www.drupal.org/node/2499239)
If the above patch is applied or this module is in the main /modules directory.
This command will execute all PHPUnit tests for this module
cd core
php ../vendor/phpunit/phpunit/phpunit --group TocApi
The below commands can be used to execute each individual PHPUnit test.
# Execute individual PHPUnit tests.
cd core cd core
php ../vendor/phpunit/phpunit/phpunit ../modules/sandbox/toc_api/tests/src/Unit/TocFormatterTest.php php ../vendor/phpunit/phpunit/phpunit ../modules/sandbox/toc_api/tests/src/Unit/TocFormatterTest.php
php ../vendor/phpunit/phpunit/phpunit ../modules/sandbox/toc_api/tests/src/Unit/TocTest.php php ../vendor/phpunit/phpunit/phpunit ../modules/sandbox/toc_api/tests/src/Unit/TocTest.php
--------------------------------------------------------------------------------
# Generate and edit release notes 4. Generate release notes
-------------------------
Git Release Notes for Drush (https://www.drupal.org/project/grn) [Git Release Notes for Drush](https://www.drupal.org/project/grn)
drush release-notes 8.x-1.0-N 8.x-1.x drush release-notes 8.x-1.0-VERSION 8.x-1.x
--------------------------------------------------------------------------------
# Tag a release
git tag 8.x-1.0-N
git push --tags
git push origin tag 8.x-1.0-N
-------------------------------------------------------------------------------- 5. Tag and create a new release
-------------------------------
# Update project page [Tag a release](https://www.drupal.org/node/1066342)
Steps for converting README.md to valid and supported HTML for this module's git tag 8.x-1.0-VERSION
Drupal.org project page. git push --tags
git push origin tag 8.x-1.0-VERSION
- [Convert Markdown to HTML](http://daringfireball.net/projects/markdown/dingus) [Create new release](https://www.drupal.org/node/add/project-release/2685977)
- [Tidy HTML](https://infohound.net/tidy/)
- No indent
- No wrap
- Manually cleanup
- Remove `<html>` tags.
- Remove 'Contents of this file'.
- Update example code and wrap in `<pre>` tag.
- Update project page](https://www.drupal.org/node/2685977/edit)
- Preview
- Save
--------------------------------------------------------------------------------
# Create new release 6. Update project page
----------------------
[Export README.md](https://www.drupal.org/project/readme)
drush readme-export toc_api
- [Create Release](https://www.drupal.org/node/add/project-release/2685977) [Edit project page](https://www.drupal.org/node/2685977/edit)
- [Administer releases](https://www.drupal.org/node/2685977/edit/releases)
...@@ -89,4 +89,3 @@ toc_api.toc_type.*: ...@@ -89,4 +89,3 @@ toc_api.toc_type.*:
type: ignore type: ignore
h6: h6:
type: ignore type: ignore
...@@ -78,6 +78,7 @@ abstract class TocBlockBase extends BlockBase { ...@@ -78,6 +78,7 @@ abstract class TocBlockBase extends BlockBase {
* can all be used as this block's plugin ID. * can all be used as this block's plugin ID.
* *
* @return string * @return string
* The current TOC block's plugin ID.
*/ */
protected function getCurrentTocId() { protected function getCurrentTocId() {
return $this->pluginId; return $this->pluginId;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment