@module-federation/dts-plugin
Advanced tools
Comparing version 0.0.0-next-20250224110717 to 0.0.0-next-20250226030124
@@ -1,3 +0,3 @@ | ||
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-484d9f4a.js'; | ||
export { j as DtsWorker, r as retrieveRemoteConfig } from './DtsWorker-484d9f4a.js'; | ||
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-edc3f145.js'; | ||
export { j as DtsWorker, r as retrieveRemoteConfig } from './DtsWorker-edc3f145.js'; | ||
import { H as HostOptions, R as RemoteInfo, a as RemoteOptions, D as DTSManagerOptions } from './DTSManagerOptions-c74c59ed.js'; | ||
@@ -4,0 +4,0 @@ import { moduleFederationPlugin } from '@module-federation/sdk'; |
@@ -6,3 +6,3 @@ import { | ||
rpc_exports | ||
} from "./chunk-Y3L33K2X.js"; | ||
} from "./chunk-PH6ITA7R.js"; | ||
import { | ||
@@ -23,3 +23,3 @@ DTSManager, | ||
validateOptions | ||
} from "./chunk-Q4PQD23H.js"; | ||
} from "./chunk-OAB3QVJR.js"; | ||
import "./chunk-KCWHOFI6.js"; | ||
@@ -26,0 +26,0 @@ import "./chunk-4CSLH7II.js"; |
import { | ||
rpc_exports | ||
} from "./chunk-Y3L33K2X.js"; | ||
} from "./chunk-PH6ITA7R.js"; | ||
import { | ||
@@ -12,3 +12,3 @@ ModuleFederationDevServer, | ||
retrieveTypesZipPath | ||
} from "./chunk-Q4PQD23H.js"; | ||
} from "./chunk-OAB3QVJR.js"; | ||
import { | ||
@@ -15,0 +15,0 @@ fileLog, |
@@ -5,3 +5,3 @@ import { | ||
generateTypes | ||
} from "./chunk-Q4PQD23H.js"; | ||
} from "./chunk-OAB3QVJR.js"; | ||
import "./chunk-KCWHOFI6.js"; | ||
@@ -8,0 +8,0 @@ import { |
@@ -5,3 +5,3 @@ import { | ||
rpc_exports | ||
} from "./chunk-Y3L33K2X.js"; | ||
} from "./chunk-PH6ITA7R.js"; | ||
import { | ||
@@ -13,3 +13,3 @@ cloneDeepOptions, | ||
validateOptions | ||
} from "./chunk-Q4PQD23H.js"; | ||
} from "./chunk-OAB3QVJR.js"; | ||
import { | ||
@@ -131,3 +131,3 @@ getIPV4, | ||
var _DevPlugin = class _DevPlugin { | ||
constructor(options, dtsOptions, generateTypesPromise, fetchRemoteTypeUrlsPromise) { | ||
constructor(options, dtsOptions, fetchTypesPromise) { | ||
__publicField(this, "name", "MFDevPlugin"); | ||
@@ -137,8 +137,6 @@ __publicField(this, "_options"); | ||
__publicField(this, "dtsOptions"); | ||
__publicField(this, "generateTypesPromise"); | ||
__publicField(this, "fetchRemoteTypeUrlsPromise"); | ||
__publicField(this, "fetchTypesPromise"); | ||
this._options = options; | ||
this.generateTypesPromise = generateTypesPromise; | ||
this.fetchTypesPromise = fetchTypesPromise; | ||
this.dtsOptions = dtsOptions; | ||
this.fetchRemoteTypeUrlsPromise = fetchRemoteTypeUrlsPromise; | ||
} | ||
@@ -261,12 +259,7 @@ static ensureLiveReloadEntry(options, filePath) { | ||
} | ||
Promise.all([ | ||
this.generateTypesPromise, | ||
this.fetchRemoteTypeUrlsPromise | ||
]).then(([_, remoteTypeUrls]) => { | ||
this.fetchTypesPromise.then(() => { | ||
this._devWorker = createDevWorker({ | ||
name, | ||
remote, | ||
host: __spreadProps(__spreadValues({}, host), { | ||
remoteTypeUrls | ||
}), | ||
host, | ||
extraOptions, | ||
@@ -291,3 +284,3 @@ disableLiveReload: normalizedDev.disableHotTypesReload, | ||
var _ConsumeTypesPlugin = class _ConsumeTypesPlugin { | ||
constructor(pluginOptions, dtsOptions, defaultOptions, fetchRemoteTypeUrlsResolve) { | ||
constructor(pluginOptions, dtsOptions, defaultOptions, callback) { | ||
__publicField(this, "pluginOptions"); | ||
@@ -297,12 +290,11 @@ __publicField(this, "dtsOptions"); | ||
__publicField(this, "callback"); | ||
__publicField(this, "fetchRemoteTypeUrlsResolve"); | ||
this.pluginOptions = pluginOptions; | ||
this.dtsOptions = dtsOptions; | ||
this.defaultOptions = defaultOptions; | ||
this.fetchRemoteTypeUrlsResolve = fetchRemoteTypeUrlsResolve; | ||
this.callback = callback; | ||
} | ||
apply(compiler) { | ||
const { dtsOptions, defaultOptions, pluginOptions, fetchRemoteTypeUrlsResolve } = this; | ||
const { dtsOptions, defaultOptions, pluginOptions, callback } = this; | ||
if (isPrd()) { | ||
fetchRemoteTypeUrlsResolve(void 0); | ||
callback(); | ||
return; | ||
@@ -312,3 +304,3 @@ } | ||
if (!normalizedConsumeTypes) { | ||
fetchRemoteTypeUrlsResolve(void 0); | ||
callback(); | ||
return; | ||
@@ -326,13 +318,6 @@ } | ||
validateOptions(finalOptions.host); | ||
const fetchRemoteTypeUrlsPromise = typeof normalizedConsumeTypes.remoteTypeUrls === "function" ? normalizedConsumeTypes.remoteTypeUrls() : Promise.resolve(normalizedConsumeTypes.remoteTypeUrls); | ||
const promise = fetchRemoteTypeUrlsPromise.then((remoteTypeUrls) => { | ||
consumeTypes(__spreadProps(__spreadValues({}, finalOptions), { | ||
host: __spreadProps(__spreadValues({}, finalOptions.host), { | ||
remoteTypeUrls | ||
}) | ||
})).then(() => { | ||
fetchRemoteTypeUrlsResolve(remoteTypeUrls); | ||
}).catch(() => { | ||
fetchRemoteTypeUrlsResolve(remoteTypeUrls); | ||
}); | ||
const promise = consumeTypes(finalOptions).then(() => { | ||
callback(); | ||
}).catch(() => { | ||
callback(); | ||
}); | ||
@@ -360,7 +345,7 @@ compiler.hooks.thisCompilation.tap("mf:generateTypes", (compilation) => { | ||
var _GenerateTypesPlugin = class _GenerateTypesPlugin { | ||
constructor(pluginOptions, dtsOptions, defaultOptions, fetchRemoteTypeUrlsPromise, callback) { | ||
constructor(pluginOptions, dtsOptions, defaultOptions, consumeTypesPromise, callback) { | ||
__publicField(this, "pluginOptions"); | ||
__publicField(this, "dtsOptions"); | ||
__publicField(this, "defaultOptions"); | ||
__publicField(this, "fetchRemoteTypeUrlsPromise"); | ||
__publicField(this, "consumeTypesPromise"); | ||
__publicField(this, "callback"); | ||
@@ -370,7 +355,7 @@ this.pluginOptions = pluginOptions; | ||
this.defaultOptions = defaultOptions; | ||
this.fetchRemoteTypeUrlsPromise = fetchRemoteTypeUrlsPromise; | ||
this.consumeTypesPromise = consumeTypesPromise; | ||
this.callback = callback; | ||
} | ||
apply(compiler) { | ||
const { dtsOptions, defaultOptions, pluginOptions, fetchRemoteTypeUrlsPromise, callback } = this; | ||
const { dtsOptions, defaultOptions, pluginOptions, consumeTypesPromise, callback } = this; | ||
const normalizedGenerateTypes = normalizeOptions3(true, defaultOptions, "mfOptions.dts.generateTypes")(dtsOptions.generateTypes); | ||
@@ -381,3 +366,2 @@ if (!normalizedGenerateTypes) { | ||
} | ||
const normalizedConsumeTypes = normalizeOptions3(true, defaultOptions, "mfOptions.dts.consumeTypes")(dtsOptions.consumeTypes); | ||
const finalOptions = { | ||
@@ -390,6 +374,2 @@ remote: __spreadValues({ | ||
}, normalizedGenerateTypes), | ||
host: normalizedConsumeTypes === false ? void 0 : __spreadValues({ | ||
context: compiler.context, | ||
moduleFederationConfig: pluginOptions | ||
}, normalizedGenerateTypes), | ||
extraOptions: dtsOptions.extraOptions || {}, | ||
@@ -502,3 +482,3 @@ displayErrorInTerminal: dtsOptions.displayErrorInTerminal | ||
}, () => __async(this, null, function* () { | ||
yield fetchRemoteTypeUrlsPromise; | ||
yield consumeTypesPromise; | ||
const emitTypesFilesPromise = emitTypesFiles(compilation); | ||
@@ -543,5 +523,5 @@ if (isProd) { | ||
} | ||
let fetchRemoteTypeUrlsResolve; | ||
const fetchRemoteTypeUrlsPromise = new Promise((resolve2) => { | ||
fetchRemoteTypeUrlsResolve = resolve2; | ||
let consumeTypesPromiseResolve; | ||
const consumeTypesPromise = new Promise((resolve2) => { | ||
consumeTypesPromiseResolve = resolve2; | ||
}); | ||
@@ -552,5 +532,5 @@ let generateTypesPromiseResolve; | ||
}); | ||
new DevPlugin(options, normalizedDtsOptions, generateTypesPromise, fetchRemoteTypeUrlsPromise).apply(compiler); | ||
new GenerateTypesPlugin(options, normalizedDtsOptions, defaultGenerateTypes, fetchRemoteTypeUrlsPromise, generateTypesPromiseResolve).apply(compiler); | ||
new ConsumeTypesPlugin(options, normalizedDtsOptions, defaultConsumeTypes, fetchRemoteTypeUrlsResolve).apply(compiler); | ||
new DevPlugin(options, normalizedDtsOptions, generateTypesPromise).apply(compiler); | ||
new GenerateTypesPlugin(options, normalizedDtsOptions, defaultGenerateTypes, consumeTypesPromise, generateTypesPromiseResolve).apply(compiler); | ||
new ConsumeTypesPlugin(options, normalizedDtsOptions, defaultConsumeTypes, consumeTypesPromiseResolve).apply(compiler); | ||
} | ||
@@ -557,0 +537,0 @@ }; |
@@ -1,2 +0,2 @@ | ||
import { k as DtsWorkerOptions } from './DtsWorker-484d9f4a.js'; | ||
import { k as DtsWorkerOptions } from './DtsWorker-edc3f145.js'; | ||
import 'child_process'; | ||
@@ -3,0 +3,0 @@ import './DTSManagerOptions-c74c59ed.js'; |
{ | ||
"name": "@module-federation/dts-plugin", | ||
"version": "0.0.0-next-20250224110717", | ||
"version": "0.0.0-next-20250226030124", | ||
"author": "hanric <hanric.zhang@gmail.com>", | ||
@@ -63,6 +63,6 @@ "main": "./dist/index.js", | ||
"ws": "8.18.0", | ||
"@module-federation/sdk": "0.0.0-next-20250224110717", | ||
"@module-federation/managers": "0.0.0-next-20250224110717", | ||
"@module-federation/third-party-dts-extractor": "0.0.0-next-20250224110717", | ||
"@module-federation/error-codes": "0.0.0-next-20250224110717" | ||
"@module-federation/sdk": "0.0.0-next-20250226030124", | ||
"@module-federation/managers": "0.0.0-next-20250226030124", | ||
"@module-federation/third-party-dts-extractor": "0.0.0-next-20250226030124", | ||
"@module-federation/error-codes": "0.0.0-next-20250226030124" | ||
}, | ||
@@ -77,3 +77,3 @@ "devDependencies": { | ||
"rimraf": "~3.0.2", | ||
"@module-federation/runtime": "0.0.0-next-20250224110717" | ||
"@module-federation/runtime": "0.0.0-next-20250226030124" | ||
}, | ||
@@ -80,0 +80,0 @@ "peerDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
590288
14631
+ Added@module-federation/error-codes@0.0.0-next-20250226030124(transitive)
+ Added@module-federation/managers@0.0.0-next-20250226030124(transitive)
+ Added@module-federation/sdk@0.0.0-next-20250226030124(transitive)
+ Added@module-federation/third-party-dts-extractor@0.0.0-next-20250226030124(transitive)
- Removed@module-federation/error-codes@0.0.0-next-20250224110717(transitive)
- Removed@module-federation/managers@0.0.0-next-20250224110717(transitive)
- Removed@module-federation/sdk@0.0.0-next-20250224110717(transitive)
- Removed@module-federation/third-party-dts-extractor@0.0.0-next-20250224110717(transitive)
- Removedisomorphic-rslog@0.0.7(transitive)
Updated@module-federation/error-codes@0.0.0-next-20250226030124
Updated@module-federation/managers@0.0.0-next-20250226030124
Updated@module-federation/third-party-dts-extractor@0.0.0-next-20250226030124