@module-federation/dts-plugin 0.16.0 → 0.17.0
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/dist/CHANGELOG.md +10 -0
- package/dist/core.js +14 -3
- package/dist/dynamic-remote-type-hints-plugin.d.mts +2 -2
- package/dist/dynamic-remote-type-hints-plugin.d.ts +2 -2
- package/dist/esm/{chunk-4XXQY6FQ.js → chunk-7TWMRWVP.js} +1 -1
- package/dist/esm/{chunk-NLANHIXS.js → chunk-YD3XN4HU.js} +14 -3
- package/dist/esm/core.js +2 -2
- package/dist/esm/fork-dev-worker.js +2 -2
- package/dist/esm/fork-generate-dts.js +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/fork-dev-worker.js +14 -3
- package/dist/fork-generate-dts.js +14 -3
- package/dist/index.js +14 -3
- package/dist/package.json +1 -1
- package/package.json +6 -6
package/dist/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @module-federation/dts-plugin
|
|
2
2
|
|
|
3
|
+
## 0.17.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 1d691ef: fix(dts-plugin): add expose file imported files to tsconfig files
|
|
8
|
+
- @module-federation/sdk@0.17.0
|
|
9
|
+
- @module-federation/managers@0.17.0
|
|
10
|
+
- @module-federation/third-party-dts-extractor@0.17.0
|
|
11
|
+
- @module-federation/error-codes@0.17.0
|
|
12
|
+
|
|
3
13
|
## 0.16.0
|
|
4
14
|
|
|
5
15
|
### Minor Changes
|
package/dist/core.js
CHANGED
|
@@ -1900,6 +1900,12 @@ function getEffectiveRootDir(parsedCommandLine) {
|
|
|
1900
1900
|
throw new Error("Can not get effective rootDir, please set compilerOptions.rootDir !");
|
|
1901
1901
|
}
|
|
1902
1902
|
__name(getEffectiveRootDir, "getEffectiveRootDir");
|
|
1903
|
+
var getDependentFiles = /* @__PURE__ */ __name((rootFiles, configContent, rootDir) => {
|
|
1904
|
+
const program = import_typescript.default.createProgram(rootFiles, configContent.options);
|
|
1905
|
+
const sourceFiles = program.getSourceFiles();
|
|
1906
|
+
const dependentFiles = sourceFiles.map((file) => file.fileName).filter((file) => !file.endsWith(".d.ts") && file.startsWith(rootDir));
|
|
1907
|
+
return dependentFiles.length ? dependentFiles : rootFiles;
|
|
1908
|
+
}, "getDependentFiles");
|
|
1903
1909
|
var readTsConfig = /* @__PURE__ */ __name(({ tsConfigPath, typesFolder, compiledTypesFolder, context, additionalFilesToCompile, outputDir }, mapComponentsToExpose) => {
|
|
1904
1910
|
const resolvedTsConfigPath = (0, import_path5.resolve)(context, tsConfigPath);
|
|
1905
1911
|
const readResult = import_typescript.default.readConfigFile(resolvedTsConfigPath, import_typescript.default.sys.readFile);
|
|
@@ -1929,13 +1935,18 @@ var readTsConfig = /* @__PURE__ */ __name(({ tsConfigPath, typesFolder, compiled
|
|
|
1929
1935
|
".mdx",
|
|
1930
1936
|
".md"
|
|
1931
1937
|
];
|
|
1932
|
-
const
|
|
1938
|
+
const rootFiles = [
|
|
1933
1939
|
...Object.values(mapComponentsToExpose),
|
|
1934
|
-
...configContent.fileNames.filter((filename) => filename.endsWith(".d.ts") && !filename.startsWith(outDirWithoutTypesFolder)),
|
|
1935
1940
|
...additionalFilesToCompile
|
|
1936
1941
|
].filter((filename) => !excludeExtensions.some((ext) => filename.endsWith(ext)));
|
|
1942
|
+
const filesToCompile = [
|
|
1943
|
+
...getDependentFiles(rootFiles, configContent, rootDir),
|
|
1944
|
+
...configContent.fileNames.filter((filename) => filename.endsWith(".d.ts") && !filename.startsWith(outDirWithoutTypesFolder))
|
|
1945
|
+
];
|
|
1937
1946
|
rawTsConfigJson.include = [];
|
|
1938
|
-
rawTsConfigJson.files =
|
|
1947
|
+
rawTsConfigJson.files = [
|
|
1948
|
+
...new Set(filesToCompile)
|
|
1949
|
+
];
|
|
1939
1950
|
rawTsConfigJson.exclude = [];
|
|
1940
1951
|
"references" in rawTsConfigJson && delete rawTsConfigJson.references;
|
|
1941
1952
|
rawTsConfigJson.extends = resolvedTsConfigPath;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ModuleFederationRuntimePlugin } from '@module-federation/runtime/types';
|
|
2
2
|
|
|
3
|
-
declare function dynamicRemoteTypeHintsPlugin():
|
|
3
|
+
declare function dynamicRemoteTypeHintsPlugin(): ModuleFederationRuntimePlugin;
|
|
4
4
|
|
|
5
5
|
export { dynamicRemoteTypeHintsPlugin as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ModuleFederationRuntimePlugin } from '@module-federation/runtime/types';
|
|
2
2
|
|
|
3
|
-
declare function dynamicRemoteTypeHintsPlugin():
|
|
3
|
+
declare function dynamicRemoteTypeHintsPlugin(): ModuleFederationRuntimePlugin;
|
|
4
4
|
|
|
5
5
|
export { dynamicRemoteTypeHintsPlugin as default };
|
|
@@ -629,6 +629,12 @@ function getEffectiveRootDir(parsedCommandLine) {
|
|
|
629
629
|
throw new Error("Can not get effective rootDir, please set compilerOptions.rootDir !");
|
|
630
630
|
}
|
|
631
631
|
__name(getEffectiveRootDir, "getEffectiveRootDir");
|
|
632
|
+
var getDependentFiles = /* @__PURE__ */ __name((rootFiles, configContent, rootDir) => {
|
|
633
|
+
const program = typescript.createProgram(rootFiles, configContent.options);
|
|
634
|
+
const sourceFiles = program.getSourceFiles();
|
|
635
|
+
const dependentFiles = sourceFiles.map((file) => file.fileName).filter((file) => !file.endsWith(".d.ts") && file.startsWith(rootDir));
|
|
636
|
+
return dependentFiles.length ? dependentFiles : rootFiles;
|
|
637
|
+
}, "getDependentFiles");
|
|
632
638
|
var readTsConfig = /* @__PURE__ */ __name(({ tsConfigPath, typesFolder, compiledTypesFolder, context, additionalFilesToCompile, outputDir }, mapComponentsToExpose) => {
|
|
633
639
|
const resolvedTsConfigPath = resolve2(context, tsConfigPath);
|
|
634
640
|
const readResult = typescript.readConfigFile(resolvedTsConfigPath, typescript.sys.readFile);
|
|
@@ -658,13 +664,18 @@ var readTsConfig = /* @__PURE__ */ __name(({ tsConfigPath, typesFolder, compiled
|
|
|
658
664
|
".mdx",
|
|
659
665
|
".md"
|
|
660
666
|
];
|
|
661
|
-
const
|
|
667
|
+
const rootFiles = [
|
|
662
668
|
...Object.values(mapComponentsToExpose),
|
|
663
|
-
...configContent.fileNames.filter((filename) => filename.endsWith(".d.ts") && !filename.startsWith(outDirWithoutTypesFolder)),
|
|
664
669
|
...additionalFilesToCompile
|
|
665
670
|
].filter((filename) => !excludeExtensions.some((ext) => filename.endsWith(ext)));
|
|
671
|
+
const filesToCompile = [
|
|
672
|
+
...getDependentFiles(rootFiles, configContent, rootDir),
|
|
673
|
+
...configContent.fileNames.filter((filename) => filename.endsWith(".d.ts") && !filename.startsWith(outDirWithoutTypesFolder))
|
|
674
|
+
];
|
|
666
675
|
rawTsConfigJson.include = [];
|
|
667
|
-
rawTsConfigJson.files =
|
|
676
|
+
rawTsConfigJson.files = [
|
|
677
|
+
...new Set(filesToCompile)
|
|
678
|
+
];
|
|
668
679
|
rawTsConfigJson.exclude = [];
|
|
669
680
|
"references" in rawTsConfigJson && delete rawTsConfigJson.references;
|
|
670
681
|
rawTsConfigJson.extends = resolvedTsConfigPath;
|
package/dist/esm/core.js
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
consumeTypes,
|
|
4
4
|
generateTypesInChildProcess,
|
|
5
5
|
rpc_exports
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-7TWMRWVP.js";
|
|
7
7
|
import {
|
|
8
8
|
DTSManager,
|
|
9
9
|
HOST_API_TYPES_FILE_NAME,
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
retrieveTypesAssetsInfo,
|
|
20
20
|
retrieveTypesZipPath,
|
|
21
21
|
validateOptions
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-YD3XN4HU.js";
|
|
23
23
|
import "./chunk-WWV5RWOP.js";
|
|
24
24
|
import "./chunk-647HGGGS.js";
|
|
25
25
|
export {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
rpc_exports
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-7TWMRWVP.js";
|
|
4
4
|
import {
|
|
5
5
|
ModuleFederationDevServer,
|
|
6
6
|
createKoaServer,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
retrieveMfTypesPath,
|
|
10
10
|
retrieveRemoteConfig,
|
|
11
11
|
retrieveTypesZipPath
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-YD3XN4HU.js";
|
|
13
13
|
import {
|
|
14
14
|
fileLog,
|
|
15
15
|
getIPV4
|
package/dist/esm/index.js
CHANGED
|
@@ -2,14 +2,14 @@ import {
|
|
|
2
2
|
consumeTypes,
|
|
3
3
|
generateTypesInChildProcess,
|
|
4
4
|
rpc_exports
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-7TWMRWVP.js";
|
|
6
6
|
import {
|
|
7
7
|
cloneDeepOptions,
|
|
8
8
|
generateTypes,
|
|
9
9
|
isTSProject,
|
|
10
10
|
retrieveTypesAssetsInfo,
|
|
11
11
|
validateOptions
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-YD3XN4HU.js";
|
|
13
13
|
import {
|
|
14
14
|
getIPV4,
|
|
15
15
|
logger
|
package/dist/fork-dev-worker.js
CHANGED
|
@@ -2354,6 +2354,12 @@ function getEffectiveRootDir(parsedCommandLine) {
|
|
|
2354
2354
|
throw new Error("Can not get effective rootDir, please set compilerOptions.rootDir !");
|
|
2355
2355
|
}
|
|
2356
2356
|
__name(getEffectiveRootDir, "getEffectiveRootDir");
|
|
2357
|
+
var getDependentFiles = /* @__PURE__ */ __name((rootFiles, configContent, rootDir) => {
|
|
2358
|
+
const program = import_typescript.default.createProgram(rootFiles, configContent.options);
|
|
2359
|
+
const sourceFiles = program.getSourceFiles();
|
|
2360
|
+
const dependentFiles = sourceFiles.map((file) => file.fileName).filter((file) => !file.endsWith(".d.ts") && file.startsWith(rootDir));
|
|
2361
|
+
return dependentFiles.length ? dependentFiles : rootFiles;
|
|
2362
|
+
}, "getDependentFiles");
|
|
2357
2363
|
var readTsConfig = /* @__PURE__ */ __name(({ tsConfigPath, typesFolder, compiledTypesFolder, context, additionalFilesToCompile, outputDir }, mapComponentsToExpose) => {
|
|
2358
2364
|
const resolvedTsConfigPath = (0, import_path5.resolve)(context, tsConfigPath);
|
|
2359
2365
|
const readResult = import_typescript.default.readConfigFile(resolvedTsConfigPath, import_typescript.default.sys.readFile);
|
|
@@ -2383,13 +2389,18 @@ var readTsConfig = /* @__PURE__ */ __name(({ tsConfigPath, typesFolder, compiled
|
|
|
2383
2389
|
".mdx",
|
|
2384
2390
|
".md"
|
|
2385
2391
|
];
|
|
2386
|
-
const
|
|
2392
|
+
const rootFiles = [
|
|
2387
2393
|
...Object.values(mapComponentsToExpose),
|
|
2388
|
-
...configContent.fileNames.filter((filename) => filename.endsWith(".d.ts") && !filename.startsWith(outDirWithoutTypesFolder)),
|
|
2389
2394
|
...additionalFilesToCompile
|
|
2390
2395
|
].filter((filename) => !excludeExtensions.some((ext) => filename.endsWith(ext)));
|
|
2396
|
+
const filesToCompile = [
|
|
2397
|
+
...getDependentFiles(rootFiles, configContent, rootDir),
|
|
2398
|
+
...configContent.fileNames.filter((filename) => filename.endsWith(".d.ts") && !filename.startsWith(outDirWithoutTypesFolder))
|
|
2399
|
+
];
|
|
2391
2400
|
rawTsConfigJson.include = [];
|
|
2392
|
-
rawTsConfigJson.files =
|
|
2401
|
+
rawTsConfigJson.files = [
|
|
2402
|
+
...new Set(filesToCompile)
|
|
2403
|
+
];
|
|
2393
2404
|
rawTsConfigJson.exclude = [];
|
|
2394
2405
|
"references" in rawTsConfigJson && delete rawTsConfigJson.references;
|
|
2395
2406
|
rawTsConfigJson.extends = resolvedTsConfigPath;
|
|
@@ -202,6 +202,12 @@ function getEffectiveRootDir(parsedCommandLine) {
|
|
|
202
202
|
throw new Error("Can not get effective rootDir, please set compilerOptions.rootDir !");
|
|
203
203
|
}
|
|
204
204
|
__name(getEffectiveRootDir, "getEffectiveRootDir");
|
|
205
|
+
var getDependentFiles = /* @__PURE__ */ __name((rootFiles, configContent, rootDir) => {
|
|
206
|
+
const program = import_typescript.default.createProgram(rootFiles, configContent.options);
|
|
207
|
+
const sourceFiles = program.getSourceFiles();
|
|
208
|
+
const dependentFiles = sourceFiles.map((file) => file.fileName).filter((file) => !file.endsWith(".d.ts") && file.startsWith(rootDir));
|
|
209
|
+
return dependentFiles.length ? dependentFiles : rootFiles;
|
|
210
|
+
}, "getDependentFiles");
|
|
205
211
|
var readTsConfig = /* @__PURE__ */ __name(({ tsConfigPath, typesFolder, compiledTypesFolder, context, additionalFilesToCompile, outputDir }, mapComponentsToExpose) => {
|
|
206
212
|
const resolvedTsConfigPath = (0, import_path.resolve)(context, tsConfigPath);
|
|
207
213
|
const readResult = import_typescript.default.readConfigFile(resolvedTsConfigPath, import_typescript.default.sys.readFile);
|
|
@@ -231,13 +237,18 @@ var readTsConfig = /* @__PURE__ */ __name(({ tsConfigPath, typesFolder, compiled
|
|
|
231
237
|
".mdx",
|
|
232
238
|
".md"
|
|
233
239
|
];
|
|
234
|
-
const
|
|
240
|
+
const rootFiles = [
|
|
235
241
|
...Object.values(mapComponentsToExpose),
|
|
236
|
-
...configContent.fileNames.filter((filename) => filename.endsWith(".d.ts") && !filename.startsWith(outDirWithoutTypesFolder)),
|
|
237
242
|
...additionalFilesToCompile
|
|
238
243
|
].filter((filename) => !excludeExtensions.some((ext) => filename.endsWith(ext)));
|
|
244
|
+
const filesToCompile = [
|
|
245
|
+
...getDependentFiles(rootFiles, configContent, rootDir),
|
|
246
|
+
...configContent.fileNames.filter((filename) => filename.endsWith(".d.ts") && !filename.startsWith(outDirWithoutTypesFolder))
|
|
247
|
+
];
|
|
239
248
|
rawTsConfigJson.include = [];
|
|
240
|
-
rawTsConfigJson.files =
|
|
249
|
+
rawTsConfigJson.files = [
|
|
250
|
+
...new Set(filesToCompile)
|
|
251
|
+
];
|
|
241
252
|
rawTsConfigJson.exclude = [];
|
|
242
253
|
"references" in rawTsConfigJson && delete rawTsConfigJson.references;
|
|
243
254
|
rawTsConfigJson.extends = resolvedTsConfigPath;
|
package/dist/index.js
CHANGED
|
@@ -1929,6 +1929,12 @@ function getEffectiveRootDir(parsedCommandLine) {
|
|
|
1929
1929
|
throw new Error("Can not get effective rootDir, please set compilerOptions.rootDir !");
|
|
1930
1930
|
}
|
|
1931
1931
|
__name(getEffectiveRootDir, "getEffectiveRootDir");
|
|
1932
|
+
var getDependentFiles = /* @__PURE__ */ __name((rootFiles, configContent, rootDir) => {
|
|
1933
|
+
const program = import_typescript.default.createProgram(rootFiles, configContent.options);
|
|
1934
|
+
const sourceFiles = program.getSourceFiles();
|
|
1935
|
+
const dependentFiles = sourceFiles.map((file) => file.fileName).filter((file) => !file.endsWith(".d.ts") && file.startsWith(rootDir));
|
|
1936
|
+
return dependentFiles.length ? dependentFiles : rootFiles;
|
|
1937
|
+
}, "getDependentFiles");
|
|
1932
1938
|
var readTsConfig = /* @__PURE__ */ __name(({ tsConfigPath, typesFolder, compiledTypesFolder, context, additionalFilesToCompile, outputDir }, mapComponentsToExpose) => {
|
|
1933
1939
|
const resolvedTsConfigPath = (0, import_path5.resolve)(context, tsConfigPath);
|
|
1934
1940
|
const readResult = import_typescript.default.readConfigFile(resolvedTsConfigPath, import_typescript.default.sys.readFile);
|
|
@@ -1958,13 +1964,18 @@ var readTsConfig = /* @__PURE__ */ __name(({ tsConfigPath, typesFolder, compiled
|
|
|
1958
1964
|
".mdx",
|
|
1959
1965
|
".md"
|
|
1960
1966
|
];
|
|
1961
|
-
const
|
|
1967
|
+
const rootFiles = [
|
|
1962
1968
|
...Object.values(mapComponentsToExpose),
|
|
1963
|
-
...configContent.fileNames.filter((filename) => filename.endsWith(".d.ts") && !filename.startsWith(outDirWithoutTypesFolder)),
|
|
1964
1969
|
...additionalFilesToCompile
|
|
1965
1970
|
].filter((filename) => !excludeExtensions.some((ext) => filename.endsWith(ext)));
|
|
1971
|
+
const filesToCompile = [
|
|
1972
|
+
...getDependentFiles(rootFiles, configContent, rootDir),
|
|
1973
|
+
...configContent.fileNames.filter((filename) => filename.endsWith(".d.ts") && !filename.startsWith(outDirWithoutTypesFolder))
|
|
1974
|
+
];
|
|
1966
1975
|
rawTsConfigJson.include = [];
|
|
1967
|
-
rawTsConfigJson.files =
|
|
1976
|
+
rawTsConfigJson.files = [
|
|
1977
|
+
...new Set(filesToCompile)
|
|
1978
|
+
];
|
|
1968
1979
|
rawTsConfigJson.exclude = [];
|
|
1969
1980
|
"references" in rawTsConfigJson && delete rawTsConfigJson.references;
|
|
1970
1981
|
rawTsConfigJson.extends = resolvedTsConfigPath;
|
package/dist/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@module-federation/dts-plugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"author": "hanric <hanric.zhang@gmail.com>",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -60,10 +60,10 @@
|
|
|
60
60
|
"log4js": "6.9.1",
|
|
61
61
|
"node-schedule": "2.1.1",
|
|
62
62
|
"ws": "8.18.0",
|
|
63
|
-
"@module-federation/sdk": "0.
|
|
64
|
-
"@module-federation/managers": "0.
|
|
65
|
-
"@module-federation/third-party-dts-extractor": "0.
|
|
66
|
-
"@module-federation/error-codes": "0.
|
|
63
|
+
"@module-federation/sdk": "0.17.0",
|
|
64
|
+
"@module-federation/managers": "0.17.0",
|
|
65
|
+
"@module-federation/third-party-dts-extractor": "0.17.0",
|
|
66
|
+
"@module-federation/error-codes": "0.17.0"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"@types/ws": "8.5.12",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"@vue/tsconfig": "^0.7.0",
|
|
74
74
|
"vue-tsc": "^2.2.10",
|
|
75
75
|
"rimraf": "~6.0.1",
|
|
76
|
-
"@module-federation/runtime": "0.
|
|
76
|
+
"@module-federation/runtime": "0.17.0"
|
|
77
77
|
},
|
|
78
78
|
"peerDependencies": {
|
|
79
79
|
"typescript": "^4.9.0 || ^5.0.0",
|