@giteeteam/apps-cli 0.2.7 → 0.2.9
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/dist/index.js +59 -8
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -31,7 +31,7 @@ var execa__default = /*#__PURE__*/_interopDefaultLegacy(execa);
|
|
|
31
31
|
var child_process__default = /*#__PURE__*/_interopDefaultLegacy(child_process);
|
|
32
32
|
var chokidar__default = /*#__PURE__*/_interopDefaultLegacy(chokidar);
|
|
33
33
|
|
|
34
|
-
var version = "0.2.
|
|
34
|
+
var version = "0.2.9";
|
|
35
35
|
|
|
36
36
|
const packageApp = async ({ outputDir, manifest, copyFiles }) => {
|
|
37
37
|
const { resources } = manifest;
|
|
@@ -118,8 +118,9 @@ const execActionWithSpinner = async (message, action) => {
|
|
|
118
118
|
};
|
|
119
119
|
|
|
120
120
|
class Manifest {
|
|
121
|
-
constructor(
|
|
122
|
-
this.manifest = yaml.parse(
|
|
121
|
+
constructor(manifestString) {
|
|
122
|
+
this.manifest = yaml.parse(manifestString);
|
|
123
|
+
this.manifestString = manifestString;
|
|
123
124
|
}
|
|
124
125
|
get resources() {
|
|
125
126
|
return this.manifest.resources;
|
|
@@ -127,13 +128,63 @@ class Manifest {
|
|
|
127
128
|
get app() {
|
|
128
129
|
return this.manifest.app;
|
|
129
130
|
}
|
|
131
|
+
get tables() {
|
|
132
|
+
return this.manifest.tables;
|
|
133
|
+
}
|
|
134
|
+
getManifest() {
|
|
135
|
+
return this.manifest;
|
|
136
|
+
}
|
|
137
|
+
getManifestString() {
|
|
138
|
+
return this.manifestString;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* 获取所有自定义事项类型
|
|
142
|
+
*/
|
|
143
|
+
getCustomItemType() {
|
|
144
|
+
const { modules } = this.manifest;
|
|
145
|
+
return modules.customItemType || [];
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* 获取所有自定义字段类型
|
|
149
|
+
*/
|
|
150
|
+
getCustomFieldType() {
|
|
151
|
+
const { modules } = this.manifest;
|
|
152
|
+
return modules.customFieldType || [];
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* 获取所有自定义字段
|
|
156
|
+
*/
|
|
157
|
+
getCustomField() {
|
|
158
|
+
const { modules } = this.manifest;
|
|
159
|
+
return modules.customField || [];
|
|
160
|
+
}
|
|
130
161
|
/**
|
|
131
|
-
* 根据key获取执行的function
|
|
162
|
+
* 根据key获取执行的function
|
|
132
163
|
* @param key
|
|
133
164
|
* @returns
|
|
134
165
|
*/
|
|
135
166
|
getFunctionByKey(key) {
|
|
136
|
-
|
|
167
|
+
const functionKey = this.getFunctionKeyByKey(key);
|
|
168
|
+
if (functionKey) {
|
|
169
|
+
return this.getFunctionByFunctionKey(functionKey);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* 根据functionKey获取执行的function
|
|
174
|
+
* @param functionKey
|
|
175
|
+
* @returns
|
|
176
|
+
*/
|
|
177
|
+
getFunctionByFunctionKey(functionKey) {
|
|
178
|
+
var _a, _b;
|
|
179
|
+
return (_b = (_a = this.manifest.modules) === null || _a === void 0 ? void 0 : _a.function) === null || _b === void 0 ? void 0 : _b.find(f => f.key === functionKey);
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* 根据key获取执行的functionKey
|
|
183
|
+
* @param key
|
|
184
|
+
* @returns
|
|
185
|
+
*/
|
|
186
|
+
getFunctionKeyByKey(key) {
|
|
187
|
+
var _a, _b, _c;
|
|
137
188
|
const { modules } = this.manifest;
|
|
138
189
|
for (const k in modules) {
|
|
139
190
|
if (k === 'function') {
|
|
@@ -142,13 +193,13 @@ class Manifest {
|
|
|
142
193
|
else if (k === 'importer') {
|
|
143
194
|
// importer扩展点需要判断function和validate
|
|
144
195
|
if (key === ((_a = modules[k]) === null || _a === void 0 ? void 0 : _a.function) || key === ((_b = modules[k]) === null || _b === void 0 ? void 0 : _b.validate)) {
|
|
145
|
-
return
|
|
196
|
+
return key;
|
|
146
197
|
}
|
|
147
198
|
}
|
|
148
199
|
else if (Array.isArray(modules[k])) {
|
|
149
|
-
const targetModule = (
|
|
200
|
+
const targetModule = (_c = modules[k]) === null || _c === void 0 ? void 0 : _c.find(v => v.key === key);
|
|
150
201
|
if (targetModule) {
|
|
151
|
-
return
|
|
202
|
+
return targetModule.function;
|
|
152
203
|
}
|
|
153
204
|
}
|
|
154
205
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@giteeteam/apps-cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.9",
|
|
4
4
|
"description": "Giteeteam Apps cli",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@giteeteam/apps-bundler": "^0.1.7",
|
|
42
|
-
"@giteeteam/apps-manifest": "^0.1.
|
|
42
|
+
"@giteeteam/apps-manifest": "^0.1.2",
|
|
43
43
|
"archiver": "^5.3.1",
|
|
44
44
|
"chalk": "^4.1.2",
|
|
45
45
|
"chokidar": "^3.5.3",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"@types/inquirer": "^8.2.1",
|
|
60
60
|
"@types/uuid": "^8.3.4"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "6c5232720259d831d50a34cae6ba276c348e9f77"
|
|
63
63
|
}
|