mm_machine 3.0.4 → 3.0.5

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 (2) hide show
  1. package/manager.js +6 -4
  2. package/package.json +1 -1
package/manager.js CHANGED
@@ -752,12 +752,14 @@ Manager.prototype._loadSources = async function () {
752
752
  $.registry.module_list &&
753
753
  $.registry.module_list.length > 0
754
754
  ) {
755
- this._loadFromRegistry(this.config.name);
756
- this.updateInfo();
757
- return;
755
+ // 只有从注册表成功加载到模块时才跳过文件系统扫描,否则回退到文件系统
756
+ if (this._loadFromRegistry(this.config.name)) {
757
+ this.updateInfo();
758
+ return;
759
+ }
758
760
  }
759
761
 
760
- // 无注册表缓存,走文件系统扫描
762
+ // 无注册表缓存或注册表无匹配模块,走文件系统扫描
761
763
  if (base_dir) {
762
764
  // base_dir 和 dir 并行扫描,互不依赖
763
765
  await Promise.all([this.call('update', base_dir, true), this.call('update', dir, false)]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mm_machine",
3
- "version": "3.0.4",
3
+ "version": "3.0.5",
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": {