webpack-federation-types-plugin 1.4.0 → 1.4.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/FederationTypesPlugin.js +5 -0
- package/LICENSE +1 -1
- package/README.md +2 -0
- package/package.json +5 -5
package/FederationTypesPlugin.js
CHANGED
|
@@ -162,6 +162,11 @@ class FederationTypesPlugin {
|
|
|
162
162
|
.then((response) => response?.data)
|
|
163
163
|
.then((modulesNames) => {
|
|
164
164
|
if (!modulesNames) return
|
|
165
|
+
// Ensure modulesNames is an array
|
|
166
|
+
if (!Array.isArray(modulesNames)) {
|
|
167
|
+
logger.warn(`Expected array but got ${typeof modulesNames} for remote ${remoteName}`)
|
|
168
|
+
return
|
|
169
|
+
}
|
|
165
170
|
// for each remote module get his types
|
|
166
171
|
modulesNames.forEach((moduleName) => {
|
|
167
172
|
const moduleDeclarationFileUrl = federationTypesUrl + moduleName
|
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# webpack-federation-types-plugin
|
|
2
2
|
|
|
3
|
+
[](https://github.com/DanielAmenou/webpack-federation-types-plugin/blob/main/LICENSE) [](https://www.npmjs.com/package/webpack-federation-types-plugin) [](https://www.npmjs.com/package/webpack-federation-types-plugin)
|
|
4
|
+
|
|
3
5
|
This plugin generates TypeScript type declaration files for the modules exposed by a remote application. It enables the automatic creation, sharing, and fetching of type definitions for your modules across different applications in a Webpack Module Federation setup.
|
|
4
6
|
|
|
5
7
|
The plugin compiles the exposed modules into TypeScript declaration files and shares them as public assets. On the consumer side, it automatically fetches these remote type declaration files and places them in the standard node_modules/@types directory. This ensures that the consuming application can seamlessly access the type definitions without any additional setup, making the integration of remote types effortless and transparent.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "webpack-federation-types-plugin",
|
|
3
3
|
"description": "This plugin adds type definitions for remote modules",
|
|
4
|
-
"version": "1.4.
|
|
4
|
+
"version": "1.4.1",
|
|
5
5
|
"main": "FederationTypesPlugin.js",
|
|
6
6
|
"types": "types.d.ts",
|
|
7
7
|
"scripts": {
|
|
@@ -24,11 +24,11 @@
|
|
|
24
24
|
"author": "Daniel Amenou <amenou.daniel@gmail.com>",
|
|
25
25
|
"license": "MIT",
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"axios": "^1.
|
|
28
|
-
"fs-extra": "^11.
|
|
27
|
+
"axios": "^1.13.2",
|
|
28
|
+
"fs-extra": "^11.3.3",
|
|
29
29
|
"ms": "^2.1.3",
|
|
30
|
-
"schema-utils": "^4.3.
|
|
31
|
-
"typescript": "^
|
|
30
|
+
"schema-utils": "^4.3.3",
|
|
31
|
+
"typescript": "^5.9.3",
|
|
32
32
|
"webpack-merge": "^6.0.1"
|
|
33
33
|
}
|
|
34
34
|
}
|