diff --git a/package.json b/package.json index df71020..60a3d1c 100644 --- a/package.json +++ b/package.json @@ -538,9 +538,6 @@ "@ffmpeg-installer/ffmpeg": { "version": "*" }, - "@ffmpeg/ffmpeg": { - "version": "*" - }, "@ffprobe-installer/ffprobe": { "version": "*" }, @@ -691,9 +688,6 @@ "@istanbuljs/nyc-config-typescript": { "version": "*" }, - "@itchenliang/picture-rollup-local-plugin": { - "version": "*" - }, "@jccr/unzipper": { "version": "*" }, @@ -1135,9 +1129,6 @@ "@tweenjs/tween.js": { "version": "*" }, - "@tyllllll/gkd-subscription": { - "version": "*" - }, "@typography-org/react": { "version": "*" }, @@ -1186,9 +1177,6 @@ "@vvfx/resource-detection": { "version": "*" }, - "@waline/client": { - "version": "*" - }, "@walletconnect/web3-provider": { "version": "*" }, @@ -1225,9 +1213,6 @@ "@yangkeith/gkd_subscription": { "version": "*" }, - "@yarnpkg/lockfile": { - "version": "*" - }, "@yrobot/react-mobile-table": { "version": "*" }, diff --git a/test/index.js b/test/index.js index d038a99..43f26f3 100644 --- a/test/index.js +++ b/test/index.js @@ -47,3 +47,27 @@ test('should pkg.allowScopes work', () => { assert(scopes > 0); }); +// 解析 allowPackages 的每个包的组织和包名,如果该组织已存在 allowScopes 中,则不需要再添加具名包 +// 例如:@babel 已存在,那么 @babel/core 就不需要再添加 +test('check allowPackages and allowScopes', () => { + const duplicatedPackages = new Map(); + for (const name in pkg.allowPackages) { + if (name.startsWith('@')) { + const [scope] = name.split('/'); + if (pkg.allowScopes.includes(scope)) { + duplicatedPackages.set(scope, [ + ...(duplicatedPackages.get(scope) || []), + name + ]); + } + } + } + + if (duplicatedPackages.size > 0) { + console.log('Duplicated packages in allowScopes:'); + for (const [scope, packages] of duplicatedPackages) { + console.log(` - ${scope}: ${packages.join(', ')}`); + } + assert.fail('Duplicated packages in allowScopes'); + } +});