@eggjs/utils 3.0.0 → 3.0.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/README.md CHANGED
@@ -5,19 +5,19 @@
5
5
  [![Test coverage][codecov-image]][codecov-url]
6
6
  [![npm download][download-image]][download-url]
7
7
 
8
- [npm-image]: https://img.shields.io/npm/v/egg-utils.svg?style=flat-square
9
- [npm-url]: https://npmjs.org/package/egg-utils
8
+ [npm-image]: https://img.shields.io/npm/v/@eggjs/utils.svg?style=flat-square
9
+ [npm-url]: https://npmjs.org/package/@eggjs/utils
10
10
  [codecov-image]: https://codecov.io/github/eggjs/egg-utils/coverage.svg?branch=master
11
11
  [codecov-url]: https://codecov.io/github/eggjs/egg-utils?branch=master
12
- [download-image]: https://img.shields.io/npm/dm/egg-utils.svg?style=flat-square
13
- [download-url]: https://npmjs.org/package/egg-utils
12
+ [download-image]: https://img.shields.io/npm/dm/@eggjs/utils.svg?style=flat-square
13
+ [download-url]: https://npmjs.org/package/@eggjs/utils
14
14
 
15
15
  Utils for all egg projects.
16
16
 
17
17
  ## Installation
18
18
 
19
19
  ```bash
20
- npm i egg-utils
20
+ npm i @eggjs/utils
21
21
  ```
22
22
 
23
23
  ## API
@@ -48,3 +48,15 @@ npm i egg-utils
48
48
  ## License
49
49
 
50
50
  [MIT](LICENSE)
51
+
52
+ <!-- GITCONTRIBUTOR_START -->
53
+
54
+ ## Contributors
55
+
56
+ |[<img src="https://avatars.githubusercontent.com/u/360661?v=4" width="100px;"/><br/><sub><b>popomore</b></sub>](https://github.com/popomore)<br/>|[<img src="https://avatars.githubusercontent.com/u/156269?v=4" width="100px;"/><br/><sub><b>fengmk2</b></sub>](https://github.com/fengmk2)<br/>|[<img src="https://avatars.githubusercontent.com/u/32174276?v=4" width="100px;"/><br/><sub><b>semantic-release-bot</b></sub>](https://github.com/semantic-release-bot)<br/>|[<img src="https://avatars.githubusercontent.com/u/5345266?v=4" width="100px;"/><br/><sub><b>a526672351</b></sub>](https://github.com/a526672351)<br/>|[<img src="https://avatars.githubusercontent.com/u/2842176?v=4" width="100px;"/><br/><sub><b>XadillaX</b></sub>](https://github.com/XadillaX)<br/>|[<img src="https://avatars.githubusercontent.com/u/1974254?v=4" width="100px;"/><br/><sub><b>maqic</b></sub>](https://github.com/maqic)<br/>|
57
+ | :---: | :---: | :---: | :---: | :---: | :---: |
58
+ [<img src="https://avatars.githubusercontent.com/u/7284558?v=4" width="100px;"/><br/><sub><b>duncup</b></sub>](https://github.com/duncup)<br/>
59
+
60
+ This project follows the git-contributor [spec](https://github.com/xudafeng/git-contributor), auto updated at `Mon May 29 2023 14:07:36 GMT+0800`.
61
+
62
+ <!-- GITCONTRIBUTOR_END -->
package/lib/framework.js CHANGED
@@ -58,7 +58,14 @@ function assertAndReturn(frameworkName, moduleDir) {
58
58
  ]);
59
59
  try {
60
60
  // find framework from global, especially for monorepo
61
- const globalModuleDir = node_path_1.default.join(require.resolve(`${frameworkName}/package.json`), '../..');
61
+ let globalModuleDir;
62
+ // if frameworkName is scoped package, like @ali/egg
63
+ if (frameworkName.startsWith('@') && frameworkName.includes('/')) {
64
+ globalModuleDir = node_path_1.default.join(require.resolve(`${frameworkName}/package.json`), '../../..');
65
+ }
66
+ else {
67
+ globalModuleDir = node_path_1.default.join(require.resolve(`${frameworkName}/package.json`), '../..');
68
+ }
62
69
  moduleDirs.add(globalModuleDir);
63
70
  }
64
71
  catch (err) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eggjs/utils",
3
- "version": "3.0.0",
3
+ "version": "3.0.1",
4
4
  "description": "Utils for all egg projects",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -15,7 +15,8 @@
15
15
  "ci": "egg-bin cov",
16
16
  "tsc": "tsc",
17
17
  "clean": "tsc --build --clean",
18
- "prepublishOnly": "npm run clean && npm run tsc"
18
+ "prepublishOnly": "npm run clean && npm run tsc",
19
+ "contributor": "git-contributor"
19
20
  },
20
21
  "keywords": [
21
22
  "egg",
@@ -36,6 +37,7 @@
36
37
  "egg-bin": "^6.4.0",
37
38
  "eslint": "^8.41.0",
38
39
  "eslint-config-egg": "^12.2.1",
40
+ "git-contributor": "^2.1.5",
39
41
  "mm": "^3.3.0",
40
42
  "npm": "^9.6.7",
41
43
  "npminstall": "^7.9.0",