mm_machine 2.4.8 → 2.5.0

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.
Files changed (3) hide show
  1. package/drive.js +0 -2
  2. package/index.js +9 -2
  3. package/package.json +1 -1
package/drive.js CHANGED
@@ -19,8 +19,6 @@ if (!$.prettyCode) {
19
19
  * @class
20
20
  */
21
21
  class Drive extends Mod {
22
- // 模块基础目录,用于放置脚本模板文件和配置模板文件
23
- static base_dir = '';
24
22
 
25
23
  // 配置项
26
24
  static config = {
package/index.js CHANGED
@@ -577,8 +577,14 @@ Manager.prototype._initManager = function () {
577
577
  */
578
578
  Manager.prototype._loadSources = async function () {
579
579
  // 通过更新函数加载资源信息
580
- await this.call('update', this.config.base_dir);
581
- await this.call('update', this.config.dir, false);
580
+ let { base_dir, dir } = this.config;
581
+ if (base_dir) {
582
+ await this.call('update', base_dir);
583
+ await this.call('update', dir, false);
584
+ }
585
+ else {
586
+ await this.call('update', dir);
587
+ }
582
588
  };
583
589
 
584
590
  /**
@@ -841,6 +847,7 @@ Manager.prototype.runWaterfall = async function (method, result, ...params) {
841
847
  module.exports = {
842
848
  Manager,
843
849
  Drive,
850
+ Mod,
844
851
  // 向后兼容
845
852
  Index: Manager,
846
853
  Item: Drive
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mm_machine",
3
- "version": "2.4.8",
3
+ "version": "2.5.0",
4
4
  "description": "A flexible Node.js plugin mechanism system for dynamic loading, management and execution of modules. Supports hot reload, lifecycle management, and modern JavaScript features.",
5
5
  "main": "index.js",
6
6
  "scripts": {