wikiploy 2.0.1 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.building your project.md +2 -4
- package/README.md +3 -2
- package/package.json +1 -1
- package/src/index.js +2 -1
- package/src/userPrompt.js +24 -1
package/README.md
CHANGED
|
@@ -7,8 +7,9 @@ After the initial setup, you can quickly build and deploy your user scripts and
|
|
|
7
7
|
|
|
8
8
|
See also:
|
|
9
9
|
|
|
10
|
-
- [
|
|
11
|
-
- [
|
|
10
|
+
- [Wikiploy project template](https://github.com/Eccenux/wikiploy-rollout-example/releases) — quick start for you gadgets.
|
|
11
|
+
- [README: building your project](https://github.com/Eccenux/Wikiploy/blob/main/README.building%20your%20project.md) — recommendation on how to build JS and CSS for your gadgets (includes unit testing setup).
|
|
12
|
+
- [Wikipedia:Wikiploy on pl.wiki](https://pl.wikipedia.org/wiki/Wikipedia:Wikiploy) — Polish description.
|
|
12
13
|
- (more links on the bottom)
|
|
13
14
|
|
|
14
15
|
## New capabilities
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import DeployConfig from './DeployConfig.js';
|
|
2
2
|
import WikiployLite from './WikiployLite.js';
|
|
3
3
|
import * as verlib from './version.js';
|
|
4
|
-
import { userPrompt } from './userPrompt.js';
|
|
4
|
+
import { userPrompt, setupSummary } from './userPrompt.js';
|
|
5
5
|
|
|
6
6
|
const Wikiploy = WikiployLite;
|
|
7
7
|
|
|
@@ -9,6 +9,7 @@ export {
|
|
|
9
9
|
DeployConfig,
|
|
10
10
|
verlib,
|
|
11
11
|
userPrompt,
|
|
12
|
+
setupSummary,
|
|
12
13
|
WikiployLite,
|
|
13
14
|
Wikiploy
|
|
14
15
|
};
|
package/src/userPrompt.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import readline from 'node:readline';
|
|
2
2
|
import { stdin as input, stdout as output } from 'node:process';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Prompt for summary.
|
|
6
|
+
* @param {String} prompt Prompt information to display.
|
|
7
|
+
* @returns
|
|
8
|
+
*/
|
|
4
9
|
const userPrompt = (prompt) => {
|
|
5
10
|
const rl = readline.createInterface({ input, output });
|
|
6
11
|
|
|
@@ -13,4 +18,22 @@ const userPrompt = (prompt) => {
|
|
|
13
18
|
});
|
|
14
19
|
};
|
|
15
20
|
|
|
16
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Read (prompt) and setup summary.
|
|
23
|
+
* @param {WikiployLite} ployBot Bot object (required to setup `summary()`).
|
|
24
|
+
* @param {Number} version Gadget version.
|
|
25
|
+
* @param {String} standardSummary Standard summary (aside from version).
|
|
26
|
+
*/
|
|
27
|
+
async function setupSummary(ployBot, version = '', standardSummary = 'changes from Github') {
|
|
28
|
+
let info = version.length ? `(empty for a standard summary prefixed with v${version})` : `(empty for a standard summary)`;
|
|
29
|
+
let summary = await userPrompt(`Summary of changes ${info}:`);
|
|
30
|
+
if (typeof summary !== 'string' || !summary.length) {
|
|
31
|
+
summary = standardSummary;
|
|
32
|
+
}
|
|
33
|
+
ployBot.summary = () => {
|
|
34
|
+
return version.length ? `v${version}: ${summary}` : summary;
|
|
35
|
+
};
|
|
36
|
+
console.log(`[INFO] summary: »${ployBot.summary()}«\n`);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export { userPrompt, setupSummary };
|