Socket
Socket
Sign inDemoInstall

egg-core

Package Overview
Dependencies
Maintainers
12
Versions
137
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

egg-core - npm Package Compare versions

Comparing version 4.25.0 to 4.26.0

6

History.md
4.26.0 / 2022-09-07
==================
**features**
* [[`7c6353f`](http://github.com/eggjs/egg-core/commit/7c6353f1dfe2ed4ebf0d9ae432356608372664bd)] - feat: extract plugin loader method for override (#246) (TZ | 天猪 <<atian25@qq.com>>)
4.25.0 / 2022-09-07

@@ -3,0 +9,0 @@ ==================

38

lib/loader/mixin/plugin.js

@@ -62,5 +62,6 @@ 'use strict';

this.lookupDirs = this.getLookupDirs();
this.allPlugins = {};
this.eggPlugins = this.loadEggPlugins();
this.appPlugins = this.loadAppPlugins();
this.eggPlugins = this.loadEggPlugins();
this.customPlugins = this.loadCustomPlugins();

@@ -340,13 +341,3 @@

// Get the real plugin path
getPluginPath(plugin) {
if (plugin.path) {
return plugin.path;
}
if (plugin.package) {
assert(isValidatePackageName(plugin.package), `plugin ${plugin.name} invalid, use 'path' instead of package: "${plugin.package}"`);
}
const name = plugin.package || plugin.name;
getLookupDirs() {
const lookupDirs = new Set();

@@ -367,2 +358,21 @@

return lookupDirs;
},
// Get the real plugin path
getPluginPath(plugin) {
if (plugin.path) {
return plugin.path;
}
if (plugin.package) {
assert(isValidatePackageName(plugin.package), `plugin ${plugin.name} invalid, use 'path' instead of package: "${plugin.package}"`);
}
return this._resolvePluginPath(plugin);
},
_resolvePluginPath(plugin) {
const name = plugin.package || plugin.name;
try {

@@ -375,6 +385,6 @@ // should find the plugin directory

// 'node_modules/.pnpm/egg@2.33.1/node_modules', <- this is the sibling directory
const filePath = require.resolve(`${name}/package.json`, { paths: [ ...lookupDirs ] });
const filePath = require.resolve(`${name}/package.json`, { paths: [ ...this.lookupDirs ] });
return path.dirname(filePath);
} catch (_) {
throw new Error(`Can not find plugin ${name} in "${[ ...lookupDirs ].join(', ')}"`);
throw new Error(`Can not find plugin ${name} in "${[ ...this.lookupDirs ].join(', ')}"`);
}

@@ -381,0 +391,0 @@ },

{
"name": "egg-core",
"version": "4.25.0",
"version": "4.26.0",
"description": "A core Pluggable framework based on koa",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc