@kumologica/sdk 3.2.2 → 3.3.0-beta1
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/cli/commands/doc-commands/html.js +31 -10
- package/package.json +4 -4
- package/cli/.DS_Store +0 -0
- package/fixtures/.DS_Store +0 -0
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
// kl doc html --serve
|
|
2
|
+
const express = require('express');
|
|
3
|
+
const chalk = require('chalk');
|
|
4
|
+
|
|
1
5
|
exports.command = 'html';
|
|
2
6
|
exports.desc = `Generates html documentation of kumologica flow.`;
|
|
3
7
|
|
|
@@ -20,7 +24,13 @@ exports.builder = {
|
|
|
20
24
|
alias: 'c',
|
|
21
25
|
default: 'docs',
|
|
22
26
|
nargs: 1
|
|
23
|
-
}
|
|
27
|
+
},
|
|
28
|
+
"serve": {
|
|
29
|
+
describe: "\nServe the resulting documentation via an HTTP server (port: 3000).",
|
|
30
|
+
type: 'boolean',
|
|
31
|
+
alias: 's',
|
|
32
|
+
default: false
|
|
33
|
+
}
|
|
24
34
|
}
|
|
25
35
|
|
|
26
36
|
function validate(argv) {
|
|
@@ -34,27 +44,38 @@ function validate(argv) {
|
|
|
34
44
|
function display(argv) {
|
|
35
45
|
console.log('Parameters:');
|
|
36
46
|
console.log(' documentation-directory: %s', argv["documentation-directory"]||'');
|
|
37
|
-
console.log('
|
|
38
|
-
console.log('
|
|
47
|
+
console.log(' project-directory: %s', argv["project-directory"]||`${__dirname}`);
|
|
48
|
+
console.log(' flow-file-name: %s', argv["flow-file-name"]||'(auto-search)');
|
|
49
|
+
console.log(' serve: %s', argv["serve"]||'false');
|
|
39
50
|
}
|
|
40
51
|
|
|
41
52
|
exports.handler = async function (argv) {
|
|
42
|
-
console.log('\nGenerating html documentation\n');
|
|
43
53
|
display(argv);
|
|
44
54
|
validate(argv);
|
|
45
55
|
|
|
46
|
-
const chalk = require('chalk');
|
|
47
|
-
|
|
48
56
|
try {
|
|
49
57
|
const { doc } = require('@kumologica/builder');
|
|
50
58
|
const docsDirectory = doc("html", argv);
|
|
51
|
-
console.log(chalk.greenBright(
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
59
|
+
console.log(chalk.greenBright(`Documentation generated successfully: ${docsDirectory}`));
|
|
60
|
+
if (argv.serve){
|
|
61
|
+
serve(docsDirectory);
|
|
62
|
+
}else{
|
|
63
|
+
process.exit(0);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
|
|
55
67
|
} catch (e) {
|
|
56
68
|
|
|
57
69
|
console.log(`${chalk.redBright(e.message)}`);
|
|
58
70
|
process.exit(1);
|
|
59
71
|
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function serve(websiteDir) {
|
|
75
|
+
const app = express();
|
|
76
|
+
const port = 3000;
|
|
77
|
+
app.use(express.static(websiteDir));
|
|
78
|
+
app.listen(port, () => {
|
|
79
|
+
console.log(chalk.yellowBright(`Documentation available at http://localhost:${port}`));
|
|
80
|
+
})
|
|
60
81
|
}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"productName": "Kumologica Designer",
|
|
4
4
|
"copyright": "Copyright 2020 Kumologica Pty Ltd, All Rights Reserved.",
|
|
5
5
|
"author": "Kumologica Pty Ltd <contact@kumologica.com>",
|
|
6
|
-
"version": "3.
|
|
6
|
+
"version": "3.3.0-beta1",
|
|
7
7
|
"description": "Kumologica Designer, harnessing Serverless for your cloud integration needs",
|
|
8
8
|
"main": "src/app/main.js",
|
|
9
9
|
"files": [
|
|
@@ -64,9 +64,9 @@
|
|
|
64
64
|
"license": "Proprietary",
|
|
65
65
|
"dependencies": {
|
|
66
66
|
"@electron/remote": "^2.0.8",
|
|
67
|
-
"@kumologica/builder": "3.
|
|
68
|
-
"@kumologica/devkit": "3.
|
|
69
|
-
"@kumologica/runtime": "3.
|
|
67
|
+
"@kumologica/builder": "3.3.0-beta1",
|
|
68
|
+
"@kumologica/devkit": "3.3.0-beta1",
|
|
69
|
+
"@kumologica/runtime": "3.3.0-beta1",
|
|
70
70
|
"adm-zip": "0.4.13",
|
|
71
71
|
"ajv": "8.10.0",
|
|
72
72
|
"archive-type": "^4.0.0",
|
package/cli/.DS_Store
DELETED
|
Binary file
|
package/fixtures/.DS_Store
DELETED
|
Binary file
|