mm_machine 3.1.9 → 3.2.1

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/manager.js CHANGED
@@ -703,27 +703,27 @@ Manager.prototype._loadSources = async function () {
703
703
  // 只有从注册表成功加载到模块时才跳过文件系统扫描,否则回退到文件系统
704
704
  if (this._loadFromRegistry()) {
705
705
  // 后台异步扫描文件系统,确保物理最新
706
- setImmediate(() => this._scanForUpdate());
706
+ setImmediate(() => this._scanForUpdate(false));
707
707
  return;
708
708
  }
709
709
  }
710
710
 
711
711
  // 注册表无匹配,走文件系统扫描
712
- await this._scanForUpdate();
712
+ await this._scanForUpdate(false);
713
713
  };
714
714
 
715
715
  /**
716
716
  * 后台扫描文件系统并同步到注册表
717
717
  * 不阻塞启动,让注册表始终与磁盘保持同步
718
718
  */
719
- Manager.prototype._scanForUpdate = async function () {
719
+ Manager.prototype._scanForUpdate = async function (clear = false) {
720
720
  var base_dir = this.getBaseDir();
721
721
  var dir = this.getDir();
722
722
  try {
723
723
  if (base_dir) {
724
- await Promise.all([this.call('update', base_dir, true), this.call('update', dir, false)]);
724
+ await Promise.all([this.call('update', base_dir, clear), this.call('update', dir, clear)]);
725
725
  } else {
726
- await this.call('update', dir, true);
726
+ await this.call('update', dir, clear);
727
727
  }
728
728
  if (this.config.use_registry) {
729
729
  $.registry.save();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mm_machine",
3
- "version": "3.1.9",
3
+ "version": "3.2.1",
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": {
package/registry.js CHANGED
@@ -28,7 +28,6 @@ class Registry {
28
28
  */
29
29
  Registry.prototype.newModel = function () {
30
30
  return {
31
- parent: '',
32
31
  name: '',
33
32
  title: '',
34
33
  description: '',