@yumerijs/loader 1.2.0 → 1.2.2

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/dist/index.js +9 -3
  2. package/package.json +2 -4
package/dist/index.js CHANGED
@@ -90,9 +90,15 @@ class PluginLoader {
90
90
  }
91
91
  }
92
92
  try {
93
- const plugin = await this.loadPluginFromPath(pluginPath, isLocalPlugin);
94
- this.pluginCache[pluginName] = plugin;
95
- return plugin;
93
+ if (isLocalPlugin) {
94
+ const plugin = await this.loadPluginFromPath(pluginPath, isLocalPlugin);
95
+ this.pluginCache[pluginName] = plugin;
96
+ return plugin;
97
+ }
98
+ else {
99
+ const plugin = await Promise.resolve(`${pluginName}`).then(s => __importStar(require(s)));
100
+ return plugin.default || plugin;
101
+ }
96
102
  }
97
103
  catch (e) {
98
104
  this.logger.error(`Failed to load plugin from ${pluginPath}:`, e);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yumerijs/loader",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "description": "Module loader for yumeri",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -26,14 +26,12 @@
26
26
  "homepage": "https://github.com/yumerijs/yumeri#readme",
27
27
  "devDependencies": {
28
28
  "@types/node": "^22.13.10",
29
- "@types/semver": "^7.5.8",
30
29
  "esbuild": "^0.25.9",
31
30
  "esbuild-register": "^3.6.0",
32
31
  "typescript": "^5.8.2"
33
32
  },
34
33
  "dependencies": {
35
34
  "@yumerijs/core": "^1.2.0",
36
- "chokidar": "^4.0.3",
37
- "semver": "^7.7.1"
35
+ "chokidar": "^4.0.3"
38
36
  }
39
37
  }