@cabloy/module-glob 5.2.55 → 5.2.57
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 +32 -12
- package/dist/interface.d.ts +1 -0
- package/package.json +14 -14
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import path from 'node:path';
|
|
2
1
|
import { parseInfoPro } from '@cabloy/module-info';
|
|
3
2
|
import { checkMeta } from '@cabloy/utils';
|
|
4
3
|
import boxen from 'boxen';
|
|
5
4
|
import chalk from 'chalk';
|
|
6
5
|
import fse from 'fs-extra';
|
|
7
6
|
import { globbySync } from 'globby';
|
|
7
|
+
import path from 'node:path';
|
|
8
8
|
import semver from 'semver';
|
|
9
9
|
|
|
10
10
|
const __pathSuites = [{
|
|
@@ -115,6 +115,9 @@ async function glob(options) {
|
|
|
115
115
|
// order
|
|
116
116
|
__orderModules(context, modules);
|
|
117
117
|
|
|
118
|
+
// check disables, after __orderModules
|
|
119
|
+
__checkModulesDisables(context);
|
|
120
|
+
|
|
118
121
|
// log
|
|
119
122
|
__logModules(context, log);
|
|
120
123
|
__logSuites(context, log);
|
|
@@ -136,6 +139,21 @@ async function glob(options) {
|
|
|
136
139
|
function getPackageModuleNode(projectMode) {
|
|
137
140
|
return ['zova', 'vona'].includes(projectMode) ? `${projectMode}Module` : 'cabloyModule';
|
|
138
141
|
}
|
|
142
|
+
function __checkModulesDisables(context) {
|
|
143
|
+
for (const key of Object.keys(context.modules)) {
|
|
144
|
+
const module = context.modules[key];
|
|
145
|
+
if (!module) continue;
|
|
146
|
+
const disables = module.package.zovaModule?.disables ?? module.package.vonaModule?.disables;
|
|
147
|
+
if (!disables) continue;
|
|
148
|
+
for (const name of disables) {
|
|
149
|
+
delete context.modules[name];
|
|
150
|
+
const index = context.modulesArray.findIndex(item => item.info.relativeName === name);
|
|
151
|
+
if (index > -1) {
|
|
152
|
+
context.modulesArray.splice(index, 1);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
139
157
|
async function __loadPackage(context, modules) {
|
|
140
158
|
const promises = [];
|
|
141
159
|
const modulesArray = [];
|
|
@@ -212,17 +230,19 @@ function __orderDependencies(context, modules, module, moduleRelativeName) {
|
|
|
212
230
|
let enabled = true;
|
|
213
231
|
const dependencies = module.package[moduleNode].dependencies;
|
|
214
232
|
for (const key in dependencies) {
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
233
|
+
if (context.options.check !== false) {
|
|
234
|
+
const subModule = modules[key];
|
|
235
|
+
if (!subModule) {
|
|
236
|
+
const message = `${chalk.keyword('orange')(`module ${moduleRelativeName} disabled`)}, because ${chalk.keyword('cyan')(`module ${key} not exists`)}`;
|
|
237
|
+
console.log(`\n${boxen(message, boxenOptions)}\n`);
|
|
238
|
+
enabled = false; // process.exit(0);
|
|
239
|
+
continue;
|
|
240
|
+
}
|
|
241
|
+
const subModuleVersion = dependencies[key];
|
|
242
|
+
if (semver.lt(subModule.package.version, subModuleVersion)) {
|
|
243
|
+
console.warn(chalk.cyan(`module ${key} is old`));
|
|
244
|
+
process.exit(0);
|
|
245
|
+
}
|
|
226
246
|
}
|
|
227
247
|
if (!__pushModule(context, modules, key)) {
|
|
228
248
|
enabled = false;
|
package/dist/interface.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cabloy/module-glob",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
3
|
+
"version": "5.2.57",
|
|
4
|
+
"gitHead": "0eab9dc4a5622caffe89e7b1b3f02c08ccbc4c4b",
|
|
5
5
|
"description": "cabloy module-glob",
|
|
6
|
-
"publishConfig": {
|
|
7
|
-
"access": "public"
|
|
8
|
-
},
|
|
9
|
-
"author": "zhennann",
|
|
10
6
|
"keywords": [
|
|
11
|
-
"
|
|
12
|
-
"
|
|
7
|
+
"cabloy",
|
|
8
|
+
"framework"
|
|
9
|
+
],
|
|
10
|
+
"author": "zhennann",
|
|
11
|
+
"files": [
|
|
12
|
+
"dist"
|
|
13
13
|
],
|
|
14
|
+
"type": "module",
|
|
14
15
|
"exports": {
|
|
15
16
|
".": {
|
|
16
17
|
"types": [
|
|
@@ -21,19 +22,18 @@
|
|
|
21
22
|
},
|
|
22
23
|
"./package.json": "./package.json"
|
|
23
24
|
},
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
|
|
25
|
+
"publishConfig": {
|
|
26
|
+
"access": "public"
|
|
27
|
+
},
|
|
27
28
|
"dependencies": {
|
|
28
|
-
"@cabloy/module-info": "^
|
|
29
|
-
"@cabloy/utils": "^2.0.
|
|
29
|
+
"@cabloy/module-info": "^2.0.0",
|
|
30
|
+
"@cabloy/utils": "^2.0.24",
|
|
30
31
|
"boxen": "^4.2.0",
|
|
31
32
|
"chalk": "^3.0.0",
|
|
32
33
|
"fs-extra": "^11.3.0",
|
|
33
34
|
"globby": "^16.0.0",
|
|
34
35
|
"semver": "^7.7.1"
|
|
35
36
|
},
|
|
36
|
-
"gitHead": "0eab9dc4a5622caffe89e7b1b3f02c08ccbc4c4b",
|
|
37
37
|
"scripts": {
|
|
38
38
|
"clean": "rimraf dist tsconfig.tsbuildinfo",
|
|
39
39
|
"tsc:publish": "npm run clean && vona :bin:buildGeneral && tsc"
|