Skip to content

Commit

Permalink
Update missing documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
kabaros committed Jun 4, 2020
1 parent e59f226 commit f66d306
Show file tree
Hide file tree
Showing 10 changed files with 99 additions and 3 deletions.
1 change: 0 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
*
* It parses the arguments passed to the command line tool and decides which module to invoke
*/

const minimist = require('minimist')
const shell = require('shelljs')

Expand Down
11 changes: 11 additions & 0 deletions src/bump/readVersionFIle.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
/**
* @file src/bump/readVersionFile.js
*
* Copyright (c) 2020 Simon Fraser University
* Distributed under the GNU GPL v3. For full terms see the file LICENSE.
*
* @brief Helper for reading the version of the plugin
*
* This helper is used by the bump command (pkp-plugin bump) to read the current version of the plugin
* from version.xml.
*/
const { readFile } = require('../utils/files')

const readVersionFile = async fileName => {
Expand Down
12 changes: 12 additions & 0 deletions src/release/buildRelease.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
/**
* @file src/release/buildRelease.js
*
* Copyright (c) 2020 Simon Fraser University
* Distributed under the GNU GPL v3. For full terms see the file LICENSE.
*
* @brief Helper for building a release (used by pkp-plugin release command)
*
* This helper performs these actions:
* - prompts the user to run any extra build commands in the current folder (gulp build, composer install etc..)
* - creates a Tar file from the current folder (in preparation to uploading it as an asset to the Github release)
*/
const { error, log, info } = require('../utils/log')
const inquirer = require('inquirer')
const execa = require('execa')
Expand Down
18 changes: 18 additions & 0 deletions src/release/createGithubRelease.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/**
* @file src/release/createGithubRelease.js
*
* Copyright (c) 2020 Simon Fraser University
* Distributed under the GNU GPL v3. For full terms see the file LICENSE.
*
* @brief Helper for building a release (used by pkp-plugin release command)
*
* This helper performs these actions:
* - Prompts the user to confirm they want to create a release on Github
* - Opens the URL for Github release prepopulated with the release info
* - Waits for the user to confirm they have published the release
*
* @notes
* - We can not automatically know when the user has published the release so we require manual confirmation
* - using open({wait: true}) could be used but it triggers when the browser is closed (not the tab),
* also it does not work on windows
*/
const inquirer = require('inquirer')
const execa = require('execa')
const open = require('open')
Expand Down
13 changes: 13 additions & 0 deletions src/release/createTag.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/**
* @file src/release/createTag.js
*
* Copyright (c) 2020 Simon Fraser University
* Distributed under the GNU GPL v3. For full terms see the file LICENSE.
*
* @brief Helper for building a release (used by pkp-plugin release command)
*
* This helper performs these actions:
* - commit the change
* - tags the commit (the user can update the default tag suggested)
* - push the tag to Github
*/
const inquirer = require('inquirer')
const execa = require('execa')
const process = require('process')
Expand Down
4 changes: 2 additions & 2 deletions src/release/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
*
* @brief Entry point for release command
*
* This command (pkp-plugin release) is to be implemented
* This entry point only parses arguments. Orchestrating the work is handled by publishRelease module.
*
*/

const { warn, info } = require('../utils/log')
const publishRelease = require('./publishRelease')

Expand Down
13 changes: 13 additions & 0 deletions src/release/publishRelease.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/**
* @file src/release/index.js
*
* Copyright (c) 2020 Simon Fraser University
* Distributed under the GNU GPL v3. For full terms see the file LICENSE.
*
* @brief Helper for building a release (used by pkp-plugin release command)
*
* This helper is the actual entry point for the operations performed by the command.
* It was abstracted in a separate module to separate from parsing command lines argument
* in cases where the command is executed when prompted after running pkp-plugin bump
* (as opposed to when it's run with pkp-plugin release newversion 2.0.0)
*/
const execa = require('execa')
const buildRelease = require('./buildRelease')
const git = require('../utils/git')
Expand Down
12 changes: 12 additions & 0 deletions src/release/uploadRelease.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
/**
* @file src/release/uploadRelease.js
*
* Copyright (c) 2020 Simon Fraser University
* Distributed under the GNU GPL v3. For full terms see the file LICENSE.
*
* @brief Helper for uploading a release to Github (used by pkp-plugin release command)
*
* This helper performs these actions:
* - prompts the user for Github token (or uses the one from env variable)
* - uses Github API to upload the release tar file (built by buildRelease in previous step) to Github
*/
const inquirer = require('inquirer')
const { Octokit } = require('@octokit/rest')
const chalk = require('chalk')
Expand Down
9 changes: 9 additions & 0 deletions src/utils/getNextVersion.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
/**
* @file src/utils/getNextVersion.js
*
* Copyright (c) 2020 Simon Fraser University
* Distributed under the GNU GPL v3. For full terms see the file LICENSE.
*
* @brief Helper to try and guess the next version of a plugin based on the current version (found in version.xml)
*
*/
const getNextVersion = currentVersion => {
try {
const numbers = currentVersion.split('.').map(char => Number(char))
Expand Down
9 changes: 9 additions & 0 deletions src/utils/git.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
/**
* @file src/utils/git.js
*
* Copyright (c) 2020 Simon Fraser University
* Distributed under the GNU GPL v3. For full terms see the file LICENSE.
*
* @brief Git helpers for some operations needed by the tool
*
*/
const execa = require('execa')
const githubUrlFromGit = require('github-url-from-git')
const { log } = require('./log')
Expand Down

0 comments on commit f66d306

Please sign in to comment.