@wagq/wa-cli 0.5.10 → 0.5.11
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/lib/daml/async.js +18 -3
- package/package.json +1 -1
package/lib/daml/async.js
CHANGED
|
@@ -3,7 +3,7 @@ const Prompt = require("inquirer");
|
|
|
3
3
|
const log = require("../../utils/log");
|
|
4
4
|
|
|
5
5
|
const typePath = {
|
|
6
|
-
"逻辑编辑器": "actions.actionList
|
|
6
|
+
"逻辑编辑器": "actions.actionList",
|
|
7
7
|
"变量编辑器": "dataSource.dataList"
|
|
8
8
|
}
|
|
9
9
|
|
|
@@ -52,8 +52,23 @@ const getFiles = async () => {
|
|
|
52
52
|
})
|
|
53
53
|
.then((res) => {
|
|
54
54
|
const daml = JSON.parse(res.data.daml);
|
|
55
|
-
const
|
|
56
|
-
const
|
|
55
|
+
const pages = daml.app.subapps[0].actions.actionList;
|
|
56
|
+
const variables = daml.app.subapps[0].dataSource.dataList;
|
|
57
|
+
switch (type) {
|
|
58
|
+
case "逻辑编辑器":
|
|
59
|
+
pages.forEach(({ content, name: fileName }) => {
|
|
60
|
+
fs.writeFileSync(`${name}/${fileName}.js`, content, {
|
|
61
|
+
cwd: process.cwd(),
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
break;
|
|
65
|
+
case "变量编辑器":
|
|
66
|
+
variables.forEach(({ key, value: variableValue }) => {
|
|
67
|
+
fs.writeFileSync(`${name}/${key}.js`, variableValue, {
|
|
68
|
+
cwd: process.cwd(),
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
}
|
|
57
72
|
|
|
58
73
|
pages.forEach(({ content, name: fileName }) => {
|
|
59
74
|
fs.writeFileSync(`${name}/${fileName}.js`, content, {
|