generated from tjx666/unplugin-starter
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: can't recognize one package same version but different directory
- Loading branch information
Showing
14 changed files
with
323 additions
and
4,243 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ dist | |
|
||
docs/.vitepress/dist | ||
docs/.vitepress/cache | ||
**/stats.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,41 @@ You can use the `jsdoc` to check option `description` and `default value`. | |
::: | ||
|
||
````ts | ||
/** | ||
* ```plaintext | ||
* { | ||
* 'axios' => Map(2) { | ||
* '1.4.0' => Map(1) { | ||
* 'node_modules/.pnpm/[email protected]/node_modules/axios' => Set(1) ['tests/fixtures/mono/packages/pkg2/index.js'] | ||
* }, | ||
* '0.27.2' => Map(1) { | ||
* 'node_modules/.pnpm/[email protected]/node_modules/axios' => Set(1) ['tests/fixtures/mono/packages/pkg1/index.js'] | ||
* } | ||
* }, | ||
* '@yutengjing/foo' => Map(1) { | ||
* '1.0.3' => Map(2) { | ||
* 'node_modules/.pnpm/@[email protected][email protected]/node_modules/@yutengjing/foo' => Set(1) ['tests/fixtures/mono/packages/pkg1/index.js'], | ||
* 'node_modules/.pnpm/@[email protected][email protected]/node_modules/@yutengjing/foo' => Set(1) ['tests/fixtures/mono/packages/pkg2/index.js'] | ||
* } | ||
* } | ||
* } | ||
* ``` | ||
*/ | ||
export type PackagesInfo = Map< | ||
// pkg name | ||
string, | ||
Map< | ||
// pkg version | ||
string, | ||
Map< | ||
// pkg directory | ||
string, | ||
// importers | ||
Set<string> | ||
> | ||
> | ||
>; | ||
|
||
export interface Options { | ||
/** | ||
* Config the duplicated dependencies which will be ignored, you can pass `*` as version to ignore all versions | ||
|
@@ -44,24 +79,7 @@ export interface Options { | |
|
||
/** | ||
* Custom the error message when exists duplicated deps | ||
* | ||
* @example | ||
* | ||
* ```txt | ||
* packageToVersionsMap structure: | ||
* | ||
* Map(2) { | ||
* '@pixi/utils' => Map(2) { | ||
* '7.0.0' => Set(1) { 'tests/fixtures/mono/packages/pkg2/index.js' }, | ||
* '7.2.4' => Set(1) { 'tests/fixtures/mono/packages/pkg1/index.js' } | ||
* }, | ||
* 'axios' => Map(2) { | ||
* '0.27.2' => Set(1) { 'tests/fixtures/mono/packages/pkg2/index.js' }, | ||
* '1.4.0' => Set(1) { 'tests/fixtures/mono/packages/pkg1/index.js' } | ||
* } | ||
* } | ||
* ``` | ||
*/ | ||
customErrorMessage?: (packageToVersionsMap: Map<string, Map<string, Set<string>>>) => string; | ||
customErrorMessage?: (packageToVersionsMap: PackagesInfo) => string; | ||
} | ||
```` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.