mushroom-cli 1.1.0-alpha.4 → 1.1.0-alpha.5
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/gen/gen-api-docs.js +11 -1
- package/mr.js +1 -1
- package/package.json +1 -1
package/gen/gen-api-docs.js
CHANGED
|
@@ -9,6 +9,8 @@ function processGenDocs(aliasProject, entities, source, html, args, projectName,
|
|
|
9
9
|
console.log('Received html');
|
|
10
10
|
console.log("Parsing html");
|
|
11
11
|
|
|
12
|
+
const roles = aliasProject.allowRoles.includes("*") ? source.roles : source.roles?.filter(r => aliasProject.allowRoles.includes(r.name));
|
|
13
|
+
|
|
12
14
|
html = html.replace(/^\uFEFF/, '');
|
|
13
15
|
html = html.replace(/<script src=(["'])\/\//g, "<script src=$1http://");
|
|
14
16
|
html = html.replace("</body>", `<script data-mt-cond='{"x": 1}'>
|
|
@@ -16,9 +18,11 @@ function processGenDocs(aliasProject, entities, source, html, args, projectName,
|
|
|
16
18
|
window.data.description = ${JSON.stringify(source.description)};
|
|
17
19
|
window.data.rootUrl = ${JSON.stringify(common.getRootUrl(source))};
|
|
18
20
|
window.data.environmentVariables = ${JSON.stringify(source.environmentVariables)};
|
|
21
|
+
window.data.roles = ${JSON.stringify(roles)};
|
|
19
22
|
window.data.entities = ${JSON.stringify(entities)};
|
|
20
23
|
window.data.features = ${JSON.stringify(aliasProject.features)};
|
|
21
|
-
try{
|
|
24
|
+
try {
|
|
25
|
+
console.info("MUSHROOM-CLI: START");
|
|
22
26
|
window.generateDocument();
|
|
23
27
|
console.info("MUSHROOM-CLI: FINISH");
|
|
24
28
|
}
|
|
@@ -31,6 +35,12 @@ function processGenDocs(aliasProject, entities, source, html, args, projectName,
|
|
|
31
35
|
return new Promise((resolve, reject) => {
|
|
32
36
|
const virtualConsole = new jsdom.VirtualConsole();
|
|
33
37
|
virtualConsole.on("info", function(msg, err) {
|
|
38
|
+
if (typeof msg != "string") return;
|
|
39
|
+
|
|
40
|
+
if (msg.indexOf("MUSHROOM-CLI:") === 0) {
|
|
41
|
+
console.log("GenDocEngine:" + msg.substr("MUSHROOM-CLI:".length));
|
|
42
|
+
}
|
|
43
|
+
|
|
34
44
|
if (msg === "MUSHROOM-CLI: FAIL"){
|
|
35
45
|
dom = null;
|
|
36
46
|
reject(err);
|
package/mr.js
CHANGED
|
@@ -62,7 +62,7 @@ async function run(args) {
|
|
|
62
62
|
|
|
63
63
|
if (checkUpdateTask !== null)
|
|
64
64
|
try {
|
|
65
|
-
var data = await checkUpdateTask;
|
|
65
|
+
var data = await checkUpdateTask;
|
|
66
66
|
if (data["dist-tags"] && data["dist-tags"][currentDistTag] && data["dist-tags"][currentDistTag] !== package.version) {
|
|
67
67
|
console.warn(`YOUR mushroom-cli VERSION IS NOT LATEST (dist-tags: ${currentDistTag}). PLEASE RUN: npm i mushroom-cli@${data["dist-tags"][currentDistTag]}`);
|
|
68
68
|
}
|