Skip to content

Commit 22127ee

Browse files
chore(node): lint
1 parent 29f6d73 commit 22127ee

34 files changed

+203
-131
lines changed

packages/enhanced/src/declarations/plugins/sharing/SharePlugin.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,8 @@ export interface SharedConfig {
8383
* Layer for the shared module.
8484
*/
8585
layer?: string;
86+
/**
87+
* The actual request to use for importing the module. Defaults to the property name.
88+
*/
89+
request?: string;
8690
}

packages/enhanced/src/lib/sharing/SharePlugin.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ class SharePlugin {
5454
eager: options.eager,
5555
issuerLayer: options.issuerLayer,
5656
layer: options.layer,
57+
request: options.request || key,
5758
},
5859
}),
5960
);
@@ -68,20 +69,20 @@ class SharePlugin {
6869
requiredVersion: options.requiredVersion,
6970
strictVersion: options.strictVersion,
7071
singleton: options.singleton,
72+
layer: options.layer,
73+
request: options.request || key,
7174
},
7275
}));
73-
//@ts-ignore
74-
this._shareScope = options.shareScope;
76+
this._shareScope = options.shareScope as string;
7577
this._consumes = consumes;
7678
this._provides = provides;
7779
}
7880

7981
/**
80-
* Apply the plugin
81-
* @param {Compiler} compiler the compiler instance
82-
* @returns {void}
82+
* Applies the plugin to the webpack compiler instance
83+
* @param compiler - The webpack compiler instance
8384
*/
84-
apply(compiler: Compiler) {
85+
apply(compiler: Compiler): void {
8586
process.env['FEDERATION_WEBPACK_PATH'] =
8687
process.env['FEDERATION_WEBPACK_PATH'] || getWebpackPath(compiler);
8788

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules/.federation
2+
dist

packages/enhanced/test/configCases/sharing/layers-share-plugin/index.js

Lines changed: 0 additions & 13 deletions
This file was deleted.

packages/enhanced/test/configCases/sharing/layers-share-plugin/loaders/different-layer-loader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
* Loader that injects a different layer name as an export
33
*/
44
module.exports = function differentLayerLoader(source) {
5-
return [source, 'export const layer = "different-layer";'].join('\n');
5+
return [source, 'export const layer = "differing-layer";'].join('\n');
66
};
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/**
2+
* Loader that injects the multi-pkg layer name as an export
3+
*/
4+
module.exports = function multiPkgLayerLoader(source) {
5+
return [source, 'export const layer = "multi-pkg-layer";'].join('\n');
6+
};
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/**
2+
* Loader that injects the React layer name as an export
3+
*/
4+
module.exports = function reactLayerLoader(source) {
5+
return [source, 'export const layer = "react-layer";'].join('\n');
6+
};

packages/enhanced/test/configCases/sharing/layers-share-plugin/node_modules/lib1/index.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/enhanced/test/configCases/sharing/layers-share-plugin/node_modules/lib1/package.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

packages/enhanced/test/configCases/sharing/layers-share-plugin/node_modules/lib2/index.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)