@cabloy/module-glob 5.0.4 → 5.0.6
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.d.ts +0 -5
- package/dist/index.js +25 -16
- package/dist/interface.d.ts +3 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -5,10 +5,5 @@ export declare function glob(options: IModuleGlobOptions): Promise<{
|
|
|
5
5
|
suites: Record<string, ISuite>;
|
|
6
6
|
modules: Record<string, IModule>;
|
|
7
7
|
modulesArray: IModule[];
|
|
8
|
-
modulesLocal: Record<string, IModule>;
|
|
9
|
-
modulesGlobal: Record<string, IModule>;
|
|
10
|
-
modulesMonkey: Record<string, IModule>;
|
|
11
|
-
suitesLocal: Record<string, ISuite>;
|
|
12
|
-
suitesVendor: Record<string, ISuite>;
|
|
13
8
|
}>;
|
|
14
9
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -36,7 +36,7 @@ const boxenOptions = {
|
|
|
36
36
|
};
|
|
37
37
|
// type: front/backend
|
|
38
38
|
async function glob(options) {
|
|
39
|
-
const { projectPath, disabledModules, disabledSuites, log, projectMode
|
|
39
|
+
const { projectPath, disabledModules, disabledSuites, log, projectMode } = options;
|
|
40
40
|
// context
|
|
41
41
|
const context = {
|
|
42
42
|
options,
|
|
@@ -48,6 +48,8 @@ async function glob(options) {
|
|
|
48
48
|
modulesLocal: {},
|
|
49
49
|
modulesGlobal: {},
|
|
50
50
|
modulesMonkey: {},
|
|
51
|
+
modulesSync: {},
|
|
52
|
+
modulesIcon: {},
|
|
51
53
|
//
|
|
52
54
|
suitesLocal: {},
|
|
53
55
|
suitesVendor: {},
|
|
@@ -62,21 +64,14 @@ async function glob(options) {
|
|
|
62
64
|
// parse modules
|
|
63
65
|
const modules = __parseModules(context, projectPath);
|
|
64
66
|
// load package
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
await __loadPackage(modules);
|
|
68
|
-
}
|
|
67
|
+
await __loadPackage(suites);
|
|
68
|
+
await __loadPackage(modules);
|
|
69
69
|
// bind suites modules
|
|
70
70
|
__bindSuitesModules(suites, modules);
|
|
71
71
|
// check suites
|
|
72
72
|
__checkSuites(context, suites);
|
|
73
73
|
// order
|
|
74
|
-
|
|
75
|
-
__orderModules(context, modules);
|
|
76
|
-
}
|
|
77
|
-
else {
|
|
78
|
-
context.modules = modules;
|
|
79
|
-
}
|
|
74
|
+
__orderModules(context, modules);
|
|
80
75
|
// log
|
|
81
76
|
__logModules(context, log);
|
|
82
77
|
__logSuites(context, log);
|
|
@@ -86,12 +81,12 @@ async function glob(options) {
|
|
|
86
81
|
modules: context.modules,
|
|
87
82
|
modulesArray: context.modulesArray,
|
|
88
83
|
//
|
|
89
|
-
modulesLocal: context.modulesLocal,
|
|
90
|
-
modulesGlobal: context.modulesGlobal,
|
|
91
|
-
modulesMonkey: context.modulesMonkey,
|
|
84
|
+
// modulesLocal: context.modulesLocal,
|
|
85
|
+
// modulesGlobal: context.modulesGlobal,
|
|
86
|
+
// modulesMonkey: context.modulesMonkey,
|
|
92
87
|
//
|
|
93
|
-
suitesLocal: context.suitesLocal,
|
|
94
|
-
suitesVendor: context.suitesVendor,
|
|
88
|
+
// suitesLocal: context.suitesLocal,
|
|
89
|
+
// suitesVendor: context.suitesVendor,
|
|
95
90
|
};
|
|
96
91
|
}
|
|
97
92
|
exports.glob = glob;
|
|
@@ -228,6 +223,12 @@ function __logModules(context, log) {
|
|
|
228
223
|
if (module.info.monkey) {
|
|
229
224
|
context.modulesMonkey[relativeName] = module;
|
|
230
225
|
}
|
|
226
|
+
if (module.info.sync) {
|
|
227
|
+
context.modulesSync[relativeName] = module;
|
|
228
|
+
}
|
|
229
|
+
if (module.info.icon) {
|
|
230
|
+
context.modulesIcon[relativeName] = module;
|
|
231
|
+
}
|
|
231
232
|
if (module.info.public) {
|
|
232
233
|
context.modulesGlobal[relativeName] = module;
|
|
233
234
|
}
|
|
@@ -250,6 +251,14 @@ function __logModules(context, log) {
|
|
|
250
251
|
for (const key in context.modulesMonkey) {
|
|
251
252
|
console.log(chalk_1.default.cyan('> ' + key));
|
|
252
253
|
}
|
|
254
|
+
console.log(chalk_1.default.yellow('\n=== Sync Modules ==='));
|
|
255
|
+
for (const key in context.modulesSync) {
|
|
256
|
+
console.log(chalk_1.default.cyan('> ' + key));
|
|
257
|
+
}
|
|
258
|
+
console.log(chalk_1.default.yellow('\n=== Icon Modules ==='));
|
|
259
|
+
for (const key in context.modulesIcon) {
|
|
260
|
+
console.log(chalk_1.default.cyan('> ' + key));
|
|
261
|
+
}
|
|
253
262
|
console.log(chalk_1.default.keyword('orange')(`\n=== Total Modules: ${context.modulesArray.length} ===`));
|
|
254
263
|
// console.log('\n');
|
|
255
264
|
}
|
package/dist/interface.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { IModule, ISuite, TypeProjectMode } from '@cabloy/module-info';
|
|
2
2
|
export interface IModuleGlobOptions {
|
|
3
3
|
projectPath: string;
|
|
4
|
+
projectMode: TypeProjectMode;
|
|
4
5
|
disabledModules?: string[];
|
|
5
6
|
disabledSuites?: string[];
|
|
6
7
|
log?: boolean;
|
|
7
|
-
projectMode: TypeProjectMode;
|
|
8
|
-
loadPackage?: boolean;
|
|
9
8
|
}
|
|
10
9
|
export interface IModuleGlobContext {
|
|
11
10
|
options: IModuleGlobOptions;
|
|
@@ -16,6 +15,8 @@ export interface IModuleGlobContext {
|
|
|
16
15
|
modulesLocal: Record<string, IModule>;
|
|
17
16
|
modulesGlobal: Record<string, IModule>;
|
|
18
17
|
modulesMonkey: Record<string, IModule>;
|
|
18
|
+
modulesSync: Record<string, IModule>;
|
|
19
|
+
modulesIcon: Record<string, IModule>;
|
|
19
20
|
suitesLocal: Record<string, ISuite>;
|
|
20
21
|
suitesVendor: Record<string, ISuite>;
|
|
21
22
|
disabledModules: Record<string, boolean>;
|