@cabloy/module-glob 5.0.2 → 5.0.3

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 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, type, loadPackage } = options;
39
+ const { projectPath, disabledModules, disabledSuites, log, projectMode, loadPackage } = options;
40
40
  // context
41
41
  const context = {
42
42
  options,
@@ -55,7 +55,7 @@ async function glob(options) {
55
55
  disabledModules: __getDisabledModules(disabledModules),
56
56
  disabledSuites: __getDisabledSuites(disabledSuites),
57
57
  //
58
- pathsMeta: (0, meta_js_1.getPathsMeta)(type),
58
+ pathsMeta: (0, meta_js_1.getPathsMeta)(projectMode),
59
59
  };
60
60
  // parse suites
61
61
  const suites = __parseSuites(context, projectPath);
@@ -71,7 +71,7 @@ async function glob(options) {
71
71
  // check suites
72
72
  __checkSuites(context, suites);
73
73
  // order
74
- if (type === 'backend' && loadPackage !== false) {
74
+ if (projectMode === 'api' && loadPackage !== false) {
75
75
  __orderModules(context, modules);
76
76
  }
77
77
  else {
@@ -189,7 +189,7 @@ function __parseModules(context, projectPath) {
189
189
  continue;
190
190
  }
191
191
  // info
192
- const info = (0, module_info_1.parseInfo)(name, 'module');
192
+ const info = (0, module_info_1.parseInfoPro)(name, context.options.projectMode, 'module');
193
193
  if (!info) {
194
194
  throw new Error(`module name is not valid: ${name}`);
195
195
  }
@@ -301,7 +301,7 @@ function __parseSuites(context, projectPath) {
301
301
  continue;
302
302
  }
303
303
  // info
304
- const info = (0, module_info_1.parseInfo)(name, 'suite');
304
+ const info = (0, module_info_1.parseInfoPro)(name, context.options.projectMode, 'suite');
305
305
  if (!info) {
306
306
  throw new Error(`suite name is not valid: ${name}`);
307
307
  }
@@ -1,10 +1,10 @@
1
- import { IModule, ISuite } from '@cabloy/module-info';
1
+ import { IModule, ISuite, TypeProjectMode } from '@cabloy/module-info';
2
2
  export interface IModuleGlobOptions {
3
3
  projectPath: string;
4
4
  disabledModules?: string[];
5
5
  disabledSuites?: string[];
6
6
  log?: boolean;
7
- type: 'front' | 'backend';
7
+ projectMode: TypeProjectMode;
8
8
  loadPackage?: boolean;
9
9
  }
10
10
  export interface IModuleGlobContext {
package/dist/meta.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { TypeProjectMode } from '@cabloy/module-info';
1
2
  import { IModuleGlobPathsMeta } from './interface.js';
2
- export declare function getPathsMeta(type: any): IModuleGlobPathsMeta;
3
+ export declare function getPathsMeta(projectMode: TypeProjectMode): IModuleGlobPathsMeta;
3
4
  //# sourceMappingURL=meta.d.ts.map
package/dist/meta.js CHANGED
@@ -29,17 +29,17 @@ const __pathsModules = [
29
29
  vendor: true,
30
30
  },
31
31
  ];
32
- function getPathsMeta(type) {
32
+ function getPathsMeta(projectMode) {
33
33
  const suites = __pathSuites.concat([
34
34
  {
35
- prefix: type === 'backend' ? 'node_modules/cabloy-suite-api-' : 'node_modules/cabloy-suite-front-',
35
+ prefix: `node_modules/cabloy-suite-${projectMode}-`,
36
36
  vendor: true,
37
37
  node_modules: true,
38
38
  },
39
39
  ]);
40
40
  const modules = __pathsModules.concat([
41
41
  {
42
- prefix: type === 'backend' ? 'node_modules/cabloy-module-api-' : 'node_modules/cabloy-module-front-',
42
+ prefix: `node_modules/cabloy-module-${projectMode}-`,
43
43
  vendor: true,
44
44
  node_modules: true,
45
45
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cabloy/module-glob",
3
- "version": "5.0.2",
3
+ "version": "5.0.3",
4
4
  "description": "cabloy module-glob",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -31,7 +31,7 @@
31
31
  "dependencies": {
32
32
  "boxen": "^4.2.0",
33
33
  "egg-born-utils": "^1.1.9",
34
- "@cabloy/module-info": "^1.0.7"
34
+ "@cabloy/module-info": "^1.0.9"
35
35
  },
36
36
  "scripts": {
37
37
  "lint": "eslint ."