Socket
Socket
Sign inDemoInstall

egg-core

Package Overview
Dependencies
Maintainers
15
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.21.0 to 4.22.0

6

History.md
4.22.0 / 2022-01-07
==================
**features**
* [[`43f15ad`](http://github.com/eggjs/egg-core/commit/43f15ada7291734aa583c274a8af5e321688deb5)] - feat: support pnpm node_modules style (#237) (TZ | 天猪 <<atian25@qq.com>>)
4.21.0 / 2021-11-24

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

21

lib/loader/mixin/plugin.js

@@ -334,18 +334,25 @@ 'use strict';

const name = plugin.package || plugin.name;
const lookupDirs = [];
const lookupDirs = new Set();
// 尝试在以下目录找到匹配的插件
// try to locate the plugin in the following directories
// -> {APP_PATH}/node_modules
// -> {EGG_PATH}/node_modules
// -> $CWD/node_modules
lookupDirs.push(path.join(this.options.baseDir, 'node_modules'));
lookupDirs.add(path.join(this.options.baseDir, 'node_modules'));
// 到 egg 中查找,优先从外往里查找
// try to locate the plugin at framework from upper to lower
for (let i = this.eggPaths.length - 1; i >= 0; i--) {
const eggPath = this.eggPaths[i];
lookupDirs.push(path.join(eggPath, 'node_modules'));
lookupDirs.add(path.join(eggPath, 'node_modules'));
// should find the siblings directory of framework when using pnpm
// 'node_modules/.pnpm/yadan@2.0.0/node_modules/yadan/node_modules',
// 'node_modules/.pnpm/yadan@2.0.0/node_modules', <- this is the sibling directory
// 'node_modules/.pnpm/egg@2.33.1/node_modules/egg/node_modules',
// 'node_modules/.pnpm/egg@2.33.1/node_modules', <- this is the sibling directory
lookupDirs.add(path.dirname(eggPath));
}
// should find the $cwd/node_modules when test the plugins under npm3
lookupDirs.push(path.join(process.cwd(), 'node_modules'));
lookupDirs.add(path.join(process.cwd(), 'node_modules'));

@@ -359,3 +366,3 @@ for (let dir of lookupDirs) {

throw new Error(`Can not find plugin ${name} in "${lookupDirs.join(', ')}"`);
throw new Error(`Can not find plugin ${name} in "${[ ...lookupDirs ].join(', ')}"`);
},

@@ -362,0 +369,0 @@

{
"name": "egg-core",
"version": "4.21.0",
"version": "4.22.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