Skip to content

Commit

Permalink
setupSummary doc
Browse files Browse the repository at this point in the history
  • Loading branch information
Eccenux committed Mar 3, 2024
1 parent 2307af9 commit 8740c54
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 3 deletions.
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,43 @@ See also:

## New capabilities

### setupSummary (v2.1)

A helper function that can replace your usages of `userPrompt`. It prompts a user and then supplies
The `setupSummary` function initializes a summary for a given bot. It requires a `Wikiploy` bot object and optionally takes a gadget version and a standard summary text.

#### Parameters

- `ployBot`: A `Wikiploy` bot object. This is required to setup the `summary()` function.
- `version` (optional): The version of your gadget. Defaults to an empty string if not provided.
- `standardSummary` (optional): A string that provides a standard summary aside from the version. Defaults to "changes from Github".

For a prompt answer: "fixed bug #123", you would get: "v5.6.0: fixed bug #123" (`v${version}: ${summary}`).

#### Usage

Basic usage:
```js
// custom summary from a prompt
await setupSummary(ployBot);
```

Version from package:
```js
(async () => {
// custom summary from a prompt
let version = await readVersion('package.json');
await setupSummary(ployBot, version);

// [...]

await ployBot.deploy(configs);
})().catch(err => {
console.error(err);
process.exit(1);
});
```

### Lightweight Dependencies (v2.0)

We had a good run, but it's time to bid farewell to [Puppeteer](https://pptr.dev/) and free the puppets ;). Obviously, this might be a breaking change if you really need to use it. However, the Wikiploy API doesn't really change...
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wikiploy",
"version": "2.1.0",
"version": "2.1.1",
"description": "User scripts and gadgets deployment for MediaWiki (Wikipedia).",
"main": "src/index.js",
"type": "module",
Expand Down

0 comments on commit 8740c54

Please sign in to comment.