You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(enhanced): implement version-based filtering for ProvideSharedPlugin and ConsumeSharedPlugin
- Add include/exclude version filtering support to ProvideSharedPlugin
- Add include/exclude version filtering support to ConsumeSharedPlugin
- Implement proper filtering logic that prevents filtered modules from being shared
- Add type definitions for IncludeExcludeOptions interface
- Update provide-filters integration test with proper share scope initialization
- Fix unit test mock compilation to extend actual Compilation class
- All tests passing (7/7 provide-filters tests, 13/13 unit tests)
This implements PR4 (Basic Share Filtering - Include/Exclude by Version) requirements
by allowing filtering of shared modules based on semantic version ranges.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
details=`No resolve data provided from resolver.`;
181
-
}else{
182
-
constdescriptionFileData=
183
-
resourceResolveData.descriptionFileData;
184
-
if(!descriptionFileData){
185
-
details=
186
-
'No description file (usually package.json) found. Add description file with name and version, or manually specify version in shared config.';
187
-
}elseif(!descriptionFileData.version){
188
-
details=`No version in description file (usually package.json). Add version to description file ${resourceResolveData.descriptionFilePath}, or manually specify version in shared config.`;
189
-
}else{
190
-
version=descriptionFileData.version;
191
-
}
192
-
}
193
-
if(!version){
194
-
consterror=newWebpackError(
195
-
`No version specified and unable to automatically determine one. ${details}`,
196
-
);
197
-
error.file=`shared module ${key} -> ${resource}`;
198
-
compilation.warnings.push(error);
199
-
}
200
-
}
201
-
202
-
// Apply version filters if defined
203
-
if(version&&typeofversion==='string'){
204
-
// Check include version filter
205
-
if(config.include?.version){
206
-
constincludeVersion=config.include.version;
207
-
if(typeofincludeVersion==='string'){
208
-
if(!satisfy(version,includeVersion)){
209
-
consterror=newWebpackError(
210
-
`Provided module "${key}" version "${version}" does not satisfy include filter "${includeVersion}"`,
211
-
);
212
-
error.file=`shared module ${key} -> ${resource}`;
213
-
compilation.warnings.push(error);
214
-
return;// Skip providing this module
215
-
}
216
-
}
217
-
}
218
-
219
-
// Check exclude version filter
220
-
if(config.exclude?.version){
221
-
constexcludeVersion=config.exclude.version;
222
-
if(typeofexcludeVersion==='string'){
223
-
if(satisfy(version,excludeVersion)){
224
-
consterror=newWebpackError(
225
-
`Provided module "${key}" version "${version}" matches exclude filter "${excludeVersion}"`,
'No description file (usually package.json) found. Add description file with name and version, or manually specify version in shared config.';
343
+
}elseif(!descriptionFileData.version){
344
+
details=`No version in description file (usually package.json). Add version to description file ${resourceResolveData.descriptionFilePath}, or manually specify version in shared config.`;
345
+
}else{
346
+
version=descriptionFileData.version;
347
+
}
348
+
}
349
+
if(!version){
350
+
consterror=newWebpackError(
351
+
`No version specified and unable to automatically determine one. ${details}`,
0 commit comments