@module-federation/dts-plugin 0.8.5 → 0.8.6
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 +15 -5
- package/dist/{DTSManagerOptions-7109e8ac.d.ts → DTSManagerOptions-92108ee8.d.ts} +1 -0
- package/dist/{DtsWorker-17de6ba4.d.ts → DtsWorker-1bad6327.d.ts} +1 -1
- package/dist/core.d.mts +3 -3
- package/dist/core.d.ts +3 -3
- package/dist/core.js +4 -3
- package/dist/esm/{chunk-ILUYY5TQ.js → chunk-M7Q7FIFW.js} +4 -3
- package/dist/esm/{chunk-MUB6LSPO.js → chunk-PZ7TR7QG.js} +1 -1
- 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 +10 -5
- package/dist/fork-dev-worker.d.mts +1 -1
- package/dist/fork-dev-worker.d.ts +1 -1
- package/dist/fork-dev-worker.js +4 -3
- package/dist/fork-generate-dts.d.mts +2 -2
- package/dist/fork-generate-dts.d.ts +2 -2
- package/dist/fork-generate-dts.js +4 -3
- package/dist/index.js +12 -6
- package/dist/package.json +1 -1
- package/package.json +6 -6
package/dist/CHANGELOG.md
CHANGED
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
# @module-federation/dts-plugin
|
|
2
2
|
|
|
3
|
-
## 0.
|
|
3
|
+
## 0.8.6
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
- @module-federation/
|
|
9
|
-
- @module-federation/
|
|
10
|
-
- @module-federation/
|
|
7
|
+
- c90bba2: fix(dts-plugin): auto inject compiler output path to avoid duplicate zip file
|
|
8
|
+
- @module-federation/sdk@0.8.6
|
|
9
|
+
- @module-federation/managers@0.8.6
|
|
10
|
+
- @module-federation/third-party-dts-extractor@0.8.6
|
|
11
|
+
- @module-federation/error-codes@0.8.6
|
|
12
|
+
|
|
13
|
+
## 0.8.5
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- @module-federation/sdk@0.8.5
|
|
18
|
+
- @module-federation/managers@0.8.5
|
|
19
|
+
- @module-federation/third-party-dts-extractor@0.8.5
|
|
20
|
+
- @module-federation/error-codes@0.8.5
|
|
11
21
|
|
|
12
22
|
## 0.8.4
|
|
13
23
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChildProcess } from 'child_process';
|
|
2
|
-
import { a as RemoteOptions, D as DTSManagerOptions, R as RemoteInfo, H as HostOptions } from './DTSManagerOptions-
|
|
2
|
+
import { a as RemoteOptions, D as DTSManagerOptions, R as RemoteInfo, H as HostOptions } from './DTSManagerOptions-92108ee8.js';
|
|
3
3
|
import ts from 'typescript';
|
|
4
4
|
|
|
5
5
|
interface TsConfigJson {
|
package/dist/core.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { D as DTSManager, T as TsConfigJson, R as RpcRemoteMethod, a as RpcCallMessage, b as RpcGMCallTypes, c as RpcMessage, d as RpcMethod, e as RpcRejectMessage, f as RpcResolveMessage, g as RpcWorker, h as createRpcWorker, i as getRpcWorkerData } from './DtsWorker-
|
|
2
|
-
export { j as DtsWorker, r as retrieveRemoteConfig } from './DtsWorker-
|
|
3
|
-
import { H as HostOptions, R as RemoteInfo, a as RemoteOptions, D as DTSManagerOptions } from './DTSManagerOptions-
|
|
1
|
+
import { D as DTSManager, T as TsConfigJson, R as RpcRemoteMethod, a as RpcCallMessage, b as RpcGMCallTypes, c as RpcMessage, d as RpcMethod, e as RpcRejectMessage, f as RpcResolveMessage, g as RpcWorker, h as createRpcWorker, i as getRpcWorkerData } from './DtsWorker-1bad6327.js';
|
|
2
|
+
export { j as DtsWorker, r as retrieveRemoteConfig } from './DtsWorker-1bad6327.js';
|
|
3
|
+
import { H as HostOptions, R as RemoteInfo, a as RemoteOptions, D as DTSManagerOptions } from './DTSManagerOptions-92108ee8.js';
|
|
4
4
|
import { moduleFederationPlugin } from '@module-federation/sdk';
|
|
5
5
|
import { ChildProcess } from 'child_process';
|
|
6
6
|
import 'typescript';
|
package/dist/core.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { D as DTSManager, T as TsConfigJson, R as RpcRemoteMethod, a as RpcCallMessage, b as RpcGMCallTypes, c as RpcMessage, d as RpcMethod, e as RpcRejectMessage, f as RpcResolveMessage, g as RpcWorker, h as createRpcWorker, i as getRpcWorkerData } from './DtsWorker-
|
|
2
|
-
export { j as DtsWorker, r as retrieveRemoteConfig } from './DtsWorker-
|
|
3
|
-
import { H as HostOptions, R as RemoteInfo, a as RemoteOptions, D as DTSManagerOptions } from './DTSManagerOptions-
|
|
1
|
+
import { D as DTSManager, T as TsConfigJson, R as RpcRemoteMethod, a as RpcCallMessage, b as RpcGMCallTypes, c as RpcMessage, d as RpcMethod, e as RpcRejectMessage, f as RpcResolveMessage, g as RpcWorker, h as createRpcWorker, i as getRpcWorkerData } from './DtsWorker-1bad6327.js';
|
|
2
|
+
export { j as DtsWorker, r as retrieveRemoteConfig } from './DtsWorker-1bad6327.js';
|
|
3
|
+
import { H as HostOptions, R as RemoteInfo, a as RemoteOptions, D as DTSManagerOptions } from './DTSManagerOptions-92108ee8.js';
|
|
4
4
|
import { moduleFederationPlugin } from '@module-federation/sdk';
|
|
5
5
|
import { ChildProcess } from 'child_process';
|
|
6
6
|
import 'typescript';
|
package/dist/core.js
CHANGED
|
@@ -1751,7 +1751,8 @@ var defaultOptions2 = {
|
|
|
1751
1751
|
context: process.cwd(),
|
|
1752
1752
|
abortOnError: true,
|
|
1753
1753
|
extractRemoteTypes: false,
|
|
1754
|
-
extractThirdParty: false
|
|
1754
|
+
extractThirdParty: false,
|
|
1755
|
+
outputDir: ""
|
|
1755
1756
|
};
|
|
1756
1757
|
function getEffectiveRootDir(parsedCommandLine) {
|
|
1757
1758
|
const compilerOptions = parsedCommandLine.options;
|
|
@@ -1771,7 +1772,7 @@ function getEffectiveRootDir(parsedCommandLine) {
|
|
|
1771
1772
|
throw new Error("Can not get effective rootDir, please set compilerOptions.rootDir !");
|
|
1772
1773
|
}
|
|
1773
1774
|
__name(getEffectiveRootDir, "getEffectiveRootDir");
|
|
1774
|
-
var readTsConfig = /* @__PURE__ */ __name(({ tsConfigPath, typesFolder, compiledTypesFolder, context, additionalFilesToCompile }, mapComponentsToExpose) => {
|
|
1775
|
+
var readTsConfig = /* @__PURE__ */ __name(({ tsConfigPath, typesFolder, compiledTypesFolder, context, additionalFilesToCompile, outputDir }, mapComponentsToExpose) => {
|
|
1775
1776
|
const resolvedTsConfigPath = (0, import_path5.resolve)(context, tsConfigPath);
|
|
1776
1777
|
const readResult = import_typescript.default.readConfigFile(resolvedTsConfigPath, import_typescript.default.sys.readFile);
|
|
1777
1778
|
if (readResult.error) {
|
|
@@ -1780,7 +1781,7 @@ var readTsConfig = /* @__PURE__ */ __name(({ tsConfigPath, typesFolder, compiled
|
|
|
1780
1781
|
const rawTsConfigJson = readResult.config;
|
|
1781
1782
|
const configContent = import_typescript.default.parseJsonConfigFileContent(rawTsConfigJson, import_typescript.default.sys, (0, import_path5.dirname)(resolvedTsConfigPath));
|
|
1782
1783
|
const rootDir = getEffectiveRootDir(configContent);
|
|
1783
|
-
const outDir = (0, import_path5.resolve)(context, configContent.options.outDir || "dist", typesFolder, compiledTypesFolder);
|
|
1784
|
+
const outDir = (0, import_path5.resolve)(context, outputDir || configContent.options.outDir || "dist", typesFolder, compiledTypesFolder);
|
|
1784
1785
|
const defaultCompilerOptions = {
|
|
1785
1786
|
rootDir,
|
|
1786
1787
|
emitDeclarationOnly: true,
|
|
@@ -597,7 +597,8 @@ var defaultOptions = {
|
|
|
597
597
|
context: process.cwd(),
|
|
598
598
|
abortOnError: true,
|
|
599
599
|
extractRemoteTypes: false,
|
|
600
|
-
extractThirdParty: false
|
|
600
|
+
extractThirdParty: false,
|
|
601
|
+
outputDir: ""
|
|
601
602
|
};
|
|
602
603
|
function getEffectiveRootDir(parsedCommandLine) {
|
|
603
604
|
const compilerOptions = parsedCommandLine.options;
|
|
@@ -617,7 +618,7 @@ function getEffectiveRootDir(parsedCommandLine) {
|
|
|
617
618
|
throw new Error("Can not get effective rootDir, please set compilerOptions.rootDir !");
|
|
618
619
|
}
|
|
619
620
|
__name(getEffectiveRootDir, "getEffectiveRootDir");
|
|
620
|
-
var readTsConfig = /* @__PURE__ */ __name(({ tsConfigPath, typesFolder, compiledTypesFolder, context, additionalFilesToCompile }, mapComponentsToExpose) => {
|
|
621
|
+
var readTsConfig = /* @__PURE__ */ __name(({ tsConfigPath, typesFolder, compiledTypesFolder, context, additionalFilesToCompile, outputDir }, mapComponentsToExpose) => {
|
|
621
622
|
const resolvedTsConfigPath = resolve2(context, tsConfigPath);
|
|
622
623
|
const readResult = typescript.readConfigFile(resolvedTsConfigPath, typescript.sys.readFile);
|
|
623
624
|
if (readResult.error) {
|
|
@@ -626,7 +627,7 @@ var readTsConfig = /* @__PURE__ */ __name(({ tsConfigPath, typesFolder, compiled
|
|
|
626
627
|
const rawTsConfigJson = readResult.config;
|
|
627
628
|
const configContent = typescript.parseJsonConfigFileContent(rawTsConfigJson, typescript.sys, dirname2(resolvedTsConfigPath));
|
|
628
629
|
const rootDir = getEffectiveRootDir(configContent);
|
|
629
|
-
const outDir = resolve2(context, configContent.options.outDir || "dist", typesFolder, compiledTypesFolder);
|
|
630
|
+
const outDir = resolve2(context, outputDir || configContent.options.outDir || "dist", typesFolder, compiledTypesFolder);
|
|
630
631
|
const defaultCompilerOptions = {
|
|
631
632
|
rootDir,
|
|
632
633
|
emitDeclarationOnly: true,
|
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-PZ7TR7QG.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-M7Q7FIFW.js";
|
|
23
23
|
import "./chunk-KCWHOFI6.js";
|
|
24
24
|
import "./chunk-4CSLH7II.js";
|
|
25
25
|
export {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
rpc_exports
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-PZ7TR7QG.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-M7Q7FIFW.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-PZ7TR7QG.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-M7Q7FIFW.js";
|
|
13
13
|
import {
|
|
14
14
|
getIPV4,
|
|
15
15
|
logger
|
|
@@ -212,6 +212,7 @@ var _DevPlugin = class _DevPlugin {
|
|
|
212
212
|
const remote = normalizedGenerateTypes === false ? void 0 : __spreadProps(__spreadValues({
|
|
213
213
|
implementation: normalizedDtsOptions === false ? void 0 : normalizedDtsOptions.implementation,
|
|
214
214
|
context: compiler.context,
|
|
215
|
+
outputDir: path3.relative(compiler.context, compiler.outputPath || compiler.options.output.path),
|
|
215
216
|
moduleFederationConfig: __spreadValues({}, this._options),
|
|
216
217
|
hostRemoteTypesFolder: normalizedGenerateTypes.typesFolder || "@mf-types"
|
|
217
218
|
}, normalizedGenerateTypes), {
|
|
@@ -306,6 +307,7 @@ var _GenerateTypesPlugin = class _GenerateTypesPlugin {
|
|
|
306
307
|
remote: __spreadValues({
|
|
307
308
|
implementation: dtsOptions.implementation,
|
|
308
309
|
context: compiler.context,
|
|
310
|
+
outputDir: path4.relative(compiler.context, compiler.outputPath || compiler.options.output.path),
|
|
309
311
|
moduleFederationConfig: pluginOptions
|
|
310
312
|
}, normalizedGenerateTypes),
|
|
311
313
|
extraOptions: dtsOptions.extraOptions || {}
|
|
@@ -329,8 +331,11 @@ var _GenerateTypesPlugin = class _GenerateTypesPlugin {
|
|
|
329
331
|
}, "getGenerateTypesFn");
|
|
330
332
|
const generateTypesFn = getGenerateTypesFn();
|
|
331
333
|
let compiledOnce = false;
|
|
332
|
-
const
|
|
334
|
+
const emitTypesFilesDev = /* @__PURE__ */ __name(() => __async(this, null, function* () {
|
|
333
335
|
try {
|
|
336
|
+
if (!isDev()) {
|
|
337
|
+
return;
|
|
338
|
+
}
|
|
334
339
|
const { zipTypesPath, apiTypesPath, zipName, apiFileName } = retrieveTypesAssetsInfo(finalOptions.remote);
|
|
335
340
|
yield generateTypesFn(finalOptions);
|
|
336
341
|
const config = finalOptions.remote.moduleFederationConfig;
|
|
@@ -381,7 +386,7 @@ var _GenerateTypesPlugin = class _GenerateTypesPlugin {
|
|
|
381
386
|
} catch (err) {
|
|
382
387
|
console.error(err);
|
|
383
388
|
}
|
|
384
|
-
}), "
|
|
389
|
+
}), "emitTypesFilesDev");
|
|
385
390
|
compiler.hooks.thisCompilation.tap("mf:generateTypes", (compilation) => {
|
|
386
391
|
compilation.hooks.processAssets.tapPromise({
|
|
387
392
|
name: "mf:generateTypes",
|
|
@@ -395,7 +400,7 @@ var _GenerateTypesPlugin = class _GenerateTypesPlugin {
|
|
|
395
400
|
return;
|
|
396
401
|
}
|
|
397
402
|
if (compiledOnce) {
|
|
398
|
-
|
|
403
|
+
emitTypesFilesDev();
|
|
399
404
|
return;
|
|
400
405
|
}
|
|
401
406
|
const { zipTypesPath, apiTypesPath, zipName, apiFileName } = retrieveTypesAssetsInfo(finalOptions.remote);
|
package/dist/fork-dev-worker.js
CHANGED
|
@@ -2205,7 +2205,8 @@ var defaultOptions2 = {
|
|
|
2205
2205
|
context: process.cwd(),
|
|
2206
2206
|
abortOnError: true,
|
|
2207
2207
|
extractRemoteTypes: false,
|
|
2208
|
-
extractThirdParty: false
|
|
2208
|
+
extractThirdParty: false,
|
|
2209
|
+
outputDir: ""
|
|
2209
2210
|
};
|
|
2210
2211
|
function getEffectiveRootDir(parsedCommandLine) {
|
|
2211
2212
|
const compilerOptions = parsedCommandLine.options;
|
|
@@ -2225,7 +2226,7 @@ function getEffectiveRootDir(parsedCommandLine) {
|
|
|
2225
2226
|
throw new Error("Can not get effective rootDir, please set compilerOptions.rootDir !");
|
|
2226
2227
|
}
|
|
2227
2228
|
__name(getEffectiveRootDir, "getEffectiveRootDir");
|
|
2228
|
-
var readTsConfig = /* @__PURE__ */ __name(({ tsConfigPath, typesFolder, compiledTypesFolder, context, additionalFilesToCompile }, mapComponentsToExpose) => {
|
|
2229
|
+
var readTsConfig = /* @__PURE__ */ __name(({ tsConfigPath, typesFolder, compiledTypesFolder, context, additionalFilesToCompile, outputDir }, mapComponentsToExpose) => {
|
|
2229
2230
|
const resolvedTsConfigPath = (0, import_path5.resolve)(context, tsConfigPath);
|
|
2230
2231
|
const readResult = import_typescript.default.readConfigFile(resolvedTsConfigPath, import_typescript.default.sys.readFile);
|
|
2231
2232
|
if (readResult.error) {
|
|
@@ -2234,7 +2235,7 @@ var readTsConfig = /* @__PURE__ */ __name(({ tsConfigPath, typesFolder, compiled
|
|
|
2234
2235
|
const rawTsConfigJson = readResult.config;
|
|
2235
2236
|
const configContent = import_typescript.default.parseJsonConfigFileContent(rawTsConfigJson, import_typescript.default.sys, (0, import_path5.dirname)(resolvedTsConfigPath));
|
|
2236
2237
|
const rootDir = getEffectiveRootDir(configContent);
|
|
2237
|
-
const outDir = (0, import_path5.resolve)(context, configContent.options.outDir || "dist", typesFolder, compiledTypesFolder);
|
|
2238
|
+
const outDir = (0, import_path5.resolve)(context, outputDir || configContent.options.outDir || "dist", typesFolder, compiledTypesFolder);
|
|
2238
2239
|
const defaultCompilerOptions = {
|
|
2239
2240
|
rootDir,
|
|
2240
2241
|
emitDeclarationOnly: true,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { k as DtsWorkerOptions } from './DtsWorker-
|
|
1
|
+
import { k as DtsWorkerOptions } from './DtsWorker-1bad6327.js';
|
|
2
2
|
import 'child_process';
|
|
3
|
-
import './DTSManagerOptions-
|
|
3
|
+
import './DTSManagerOptions-92108ee8.js';
|
|
4
4
|
import '@module-federation/sdk';
|
|
5
5
|
import 'typescript';
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { k as DtsWorkerOptions } from './DtsWorker-
|
|
1
|
+
import { k as DtsWorkerOptions } from './DtsWorker-1bad6327.js';
|
|
2
2
|
import 'child_process';
|
|
3
|
-
import './DTSManagerOptions-
|
|
3
|
+
import './DTSManagerOptions-92108ee8.js';
|
|
4
4
|
import '@module-federation/sdk';
|
|
5
5
|
import 'typescript';
|
|
6
6
|
|
|
@@ -180,7 +180,8 @@ var defaultOptions = {
|
|
|
180
180
|
context: process.cwd(),
|
|
181
181
|
abortOnError: true,
|
|
182
182
|
extractRemoteTypes: false,
|
|
183
|
-
extractThirdParty: false
|
|
183
|
+
extractThirdParty: false,
|
|
184
|
+
outputDir: ""
|
|
184
185
|
};
|
|
185
186
|
function getEffectiveRootDir(parsedCommandLine) {
|
|
186
187
|
const compilerOptions = parsedCommandLine.options;
|
|
@@ -200,7 +201,7 @@ function getEffectiveRootDir(parsedCommandLine) {
|
|
|
200
201
|
throw new Error("Can not get effective rootDir, please set compilerOptions.rootDir !");
|
|
201
202
|
}
|
|
202
203
|
__name(getEffectiveRootDir, "getEffectiveRootDir");
|
|
203
|
-
var readTsConfig = /* @__PURE__ */ __name(({ tsConfigPath, typesFolder, compiledTypesFolder, context, additionalFilesToCompile }, mapComponentsToExpose) => {
|
|
204
|
+
var readTsConfig = /* @__PURE__ */ __name(({ tsConfigPath, typesFolder, compiledTypesFolder, context, additionalFilesToCompile, outputDir }, mapComponentsToExpose) => {
|
|
204
205
|
const resolvedTsConfigPath = (0, import_path.resolve)(context, tsConfigPath);
|
|
205
206
|
const readResult = import_typescript.default.readConfigFile(resolvedTsConfigPath, import_typescript.default.sys.readFile);
|
|
206
207
|
if (readResult.error) {
|
|
@@ -209,7 +210,7 @@ var readTsConfig = /* @__PURE__ */ __name(({ tsConfigPath, typesFolder, compiled
|
|
|
209
210
|
const rawTsConfigJson = readResult.config;
|
|
210
211
|
const configContent = import_typescript.default.parseJsonConfigFileContent(rawTsConfigJson, import_typescript.default.sys, (0, import_path.dirname)(resolvedTsConfigPath));
|
|
211
212
|
const rootDir = getEffectiveRootDir(configContent);
|
|
212
|
-
const outDir = (0, import_path.resolve)(context, configContent.options.outDir || "dist", typesFolder, compiledTypesFolder);
|
|
213
|
+
const outDir = (0, import_path.resolve)(context, outputDir || configContent.options.outDir || "dist", typesFolder, compiledTypesFolder);
|
|
213
214
|
const defaultCompilerOptions = {
|
|
214
215
|
rootDir,
|
|
215
216
|
emitDeclarationOnly: true,
|
package/dist/index.js
CHANGED
|
@@ -1773,7 +1773,8 @@ var defaultOptions2 = {
|
|
|
1773
1773
|
context: process.cwd(),
|
|
1774
1774
|
abortOnError: true,
|
|
1775
1775
|
extractRemoteTypes: false,
|
|
1776
|
-
extractThirdParty: false
|
|
1776
|
+
extractThirdParty: false,
|
|
1777
|
+
outputDir: ""
|
|
1777
1778
|
};
|
|
1778
1779
|
function getEffectiveRootDir(parsedCommandLine) {
|
|
1779
1780
|
const compilerOptions = parsedCommandLine.options;
|
|
@@ -1793,7 +1794,7 @@ function getEffectiveRootDir(parsedCommandLine) {
|
|
|
1793
1794
|
throw new Error("Can not get effective rootDir, please set compilerOptions.rootDir !");
|
|
1794
1795
|
}
|
|
1795
1796
|
__name(getEffectiveRootDir, "getEffectiveRootDir");
|
|
1796
|
-
var readTsConfig = /* @__PURE__ */ __name(({ tsConfigPath, typesFolder, compiledTypesFolder, context, additionalFilesToCompile }, mapComponentsToExpose) => {
|
|
1797
|
+
var readTsConfig = /* @__PURE__ */ __name(({ tsConfigPath, typesFolder, compiledTypesFolder, context, additionalFilesToCompile, outputDir }, mapComponentsToExpose) => {
|
|
1797
1798
|
const resolvedTsConfigPath = (0, import_path5.resolve)(context, tsConfigPath);
|
|
1798
1799
|
const readResult = import_typescript.default.readConfigFile(resolvedTsConfigPath, import_typescript.default.sys.readFile);
|
|
1799
1800
|
if (readResult.error) {
|
|
@@ -1802,7 +1803,7 @@ var readTsConfig = /* @__PURE__ */ __name(({ tsConfigPath, typesFolder, compiled
|
|
|
1802
1803
|
const rawTsConfigJson = readResult.config;
|
|
1803
1804
|
const configContent = import_typescript.default.parseJsonConfigFileContent(rawTsConfigJson, import_typescript.default.sys, (0, import_path5.dirname)(resolvedTsConfigPath));
|
|
1804
1805
|
const rootDir = getEffectiveRootDir(configContent);
|
|
1805
|
-
const outDir = (0, import_path5.resolve)(context, configContent.options.outDir || "dist", typesFolder, compiledTypesFolder);
|
|
1806
|
+
const outDir = (0, import_path5.resolve)(context, outputDir || configContent.options.outDir || "dist", typesFolder, compiledTypesFolder);
|
|
1806
1807
|
const defaultCompilerOptions = {
|
|
1807
1808
|
rootDir,
|
|
1808
1809
|
emitDeclarationOnly: true,
|
|
@@ -2390,6 +2391,7 @@ var _DevPlugin = class _DevPlugin {
|
|
|
2390
2391
|
const remote = normalizedGenerateTypes === false ? void 0 : __spreadProps(__spreadValues({
|
|
2391
2392
|
implementation: normalizedDtsOptions === false ? void 0 : normalizedDtsOptions.implementation,
|
|
2392
2393
|
context: compiler.context,
|
|
2394
|
+
outputDir: import_path8.default.relative(compiler.context, compiler.outputPath || compiler.options.output.path),
|
|
2393
2395
|
moduleFederationConfig: __spreadValues({}, this._options),
|
|
2394
2396
|
hostRemoteTypesFolder: normalizedGenerateTypes.typesFolder || "@mf-types"
|
|
2395
2397
|
}, normalizedGenerateTypes), {
|
|
@@ -2484,6 +2486,7 @@ var _GenerateTypesPlugin = class _GenerateTypesPlugin {
|
|
|
2484
2486
|
remote: __spreadValues({
|
|
2485
2487
|
implementation: dtsOptions.implementation,
|
|
2486
2488
|
context: compiler.context,
|
|
2489
|
+
outputDir: import_path9.default.relative(compiler.context, compiler.outputPath || compiler.options.output.path),
|
|
2487
2490
|
moduleFederationConfig: pluginOptions
|
|
2488
2491
|
}, normalizedGenerateTypes),
|
|
2489
2492
|
extraOptions: dtsOptions.extraOptions || {}
|
|
@@ -2507,8 +2510,11 @@ var _GenerateTypesPlugin = class _GenerateTypesPlugin {
|
|
|
2507
2510
|
}, "getGenerateTypesFn");
|
|
2508
2511
|
const generateTypesFn = getGenerateTypesFn();
|
|
2509
2512
|
let compiledOnce = false;
|
|
2510
|
-
const
|
|
2513
|
+
const emitTypesFilesDev = /* @__PURE__ */ __name(() => __async(this, null, function* () {
|
|
2511
2514
|
try {
|
|
2515
|
+
if (!isDev()) {
|
|
2516
|
+
return;
|
|
2517
|
+
}
|
|
2512
2518
|
const { zipTypesPath, apiTypesPath, zipName, apiFileName } = retrieveTypesAssetsInfo(finalOptions.remote);
|
|
2513
2519
|
yield generateTypesFn(finalOptions);
|
|
2514
2520
|
const config = finalOptions.remote.moduleFederationConfig;
|
|
@@ -2559,7 +2565,7 @@ var _GenerateTypesPlugin = class _GenerateTypesPlugin {
|
|
|
2559
2565
|
} catch (err) {
|
|
2560
2566
|
console.error(err);
|
|
2561
2567
|
}
|
|
2562
|
-
}), "
|
|
2568
|
+
}), "emitTypesFilesDev");
|
|
2563
2569
|
compiler.hooks.thisCompilation.tap("mf:generateTypes", (compilation) => {
|
|
2564
2570
|
compilation.hooks.processAssets.tapPromise({
|
|
2565
2571
|
name: "mf:generateTypes",
|
|
@@ -2573,7 +2579,7 @@ var _GenerateTypesPlugin = class _GenerateTypesPlugin {
|
|
|
2573
2579
|
return;
|
|
2574
2580
|
}
|
|
2575
2581
|
if (compiledOnce) {
|
|
2576
|
-
|
|
2582
|
+
emitTypesFilesDev();
|
|
2577
2583
|
return;
|
|
2578
2584
|
}
|
|
2579
2585
|
const { zipTypesPath, apiTypesPath, zipName, apiFileName } = retrieveTypesAssetsInfo(finalOptions.remote);
|
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.8.
|
|
3
|
+
"version": "0.8.6",
|
|
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.8.
|
|
64
|
-
"@module-federation/managers": "0.8.
|
|
65
|
-
"@module-federation/third-party-dts-extractor": "0.8.
|
|
66
|
-
"@module-federation/error-codes": "0.8.
|
|
63
|
+
"@module-federation/sdk": "0.8.6",
|
|
64
|
+
"@module-federation/managers": "0.8.6",
|
|
65
|
+
"@module-federation/third-party-dts-extractor": "0.8.6",
|
|
66
|
+
"@module-federation/error-codes": "0.8.6"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"@types/ws": "8.5.12",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"vue": "^3.4.29",
|
|
73
73
|
"@vue/tsconfig": "^0.5.1",
|
|
74
74
|
"vue-tsc": "^2.0.26",
|
|
75
|
-
"@module-federation/runtime": "0.8.
|
|
75
|
+
"@module-federation/runtime": "0.8.6"
|
|
76
76
|
},
|
|
77
77
|
"peerDependencies": {
|
|
78
78
|
"typescript": "^4.9.0 || ^5.0.0",
|