@module-federation/dts-plugin
Advanced tools
Comparing version 0.0.0-next-20240523121007 to 0.0.0-next-20240523224941
@@ -1,3 +0,3 @@ | ||
import { D as DTSManager, 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-31f58bd6.js'; | ||
export { j as DtsWorker, r as retrieveRemoteConfig } from './DtsWorker-31f58bd6.js'; | ||
import { D as DTSManager, 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-d731dc2b.js'; | ||
export { j as DtsWorker, H as HOST_API_TYPES_FILE_NAME, k as REMOTE_ALIAS_IDENTIFIER, l as REMOTE_API_TYPES_FILE_NAME, U as UpdateMode, r as retrieveRemoteConfig } from './DtsWorker-d731dc2b.js'; | ||
import { H as HostOptions, R as RemoteInfo, a as RemoteOptions, D as DTSManagerOptions } from './DTSManagerOptions-c0728719.js'; | ||
@@ -7,3 +7,2 @@ import { moduleFederationPlugin } from '@module-federation/sdk'; | ||
import { ChildProcess } from 'child_process'; | ||
import './constant-b161da6e.js'; | ||
@@ -43,5 +42,5 @@ declare const retrieveHostConfig: (options: HostOptions) => { | ||
declare class RpcExitError extends Error { | ||
readonly code?: string | number | null; | ||
readonly signal?: string | null; | ||
constructor(message: string, code?: string | number | null, signal?: string | null); | ||
readonly code?: string | number | null | undefined; | ||
readonly signal?: string | null | undefined; | ||
constructor(message: string, code?: string | number | null | undefined, signal?: string | null | undefined); | ||
} | ||
@@ -88,6 +87,2 @@ | ||
declare const REMOTE_ALIAS_IDENTIFIER = "REMOTE_ALIAS_IDENTIFIER"; | ||
declare const REMOTE_API_TYPES_FILE_NAME = "apis.d.ts"; | ||
declare const HOST_API_TYPES_FILE_NAME = "index.d.ts"; | ||
export { DTSManager, DTSManagerOptions, HOST_API_TYPES_FILE_NAME, HostOptions, REMOTE_ALIAS_IDENTIFIER, REMOTE_API_TYPES_FILE_NAME, RemoteOptions, consumeTypes, generateTypes, generateTypesInChildProcess, getDTSManagerConstructor, isTSProject, retrieveHostConfig, retrieveMfTypesPath, retrieveOriginalOutDir, retrieveTypesAssetsInfo, retrieveTypesZipPath, index as rpc, validateOptions }; | ||
export { DTSManager, DTSManagerOptions, HostOptions, RemoteOptions, consumeTypes, generateTypes, generateTypesInChildProcess, getDTSManagerConstructor, isTSProject, retrieveHostConfig, retrieveMfTypesPath, retrieveOriginalOutDir, retrieveTypesAssetsInfo, retrieveTypesZipPath, index as rpc, validateOptions }; |
@@ -0,10 +1,3 @@ | ||
"use strict"; | ||
(() => { | ||
var __defProp = Object.defineProperty; | ||
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; | ||
var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); | ||
var __publicField = (obj, key, value) => { | ||
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); | ||
return value; | ||
}; | ||
// node_modules/.pnpm/isomorphic-ws@5.0.0_ws@8.5.0/node_modules/isomorphic-ws/browser.js | ||
@@ -28,14 +21,6 @@ var ws = null; | ||
var WEB_SOCKET_CONNECT_MAGIC_ID = "1hpzW-zo2z-o8io-gfmV1-2cb1d82"; | ||
var UpdateMode; | ||
(function(UpdateMode2) { | ||
UpdateMode2["POSITIVE"] = "POSITIVE"; | ||
UpdateMode2["PASSIVE"] = "PASSIVE"; | ||
})(UpdateMode || (UpdateMode = {})); | ||
// packages/dts-plugin/src/server/message/Message.ts | ||
var _Message = class _Message { | ||
var Message = class { | ||
constructor(type, kind) { | ||
__publicField(this, "type"); | ||
__publicField(this, "kind"); | ||
__publicField(this, "time"); | ||
this.type = type; | ||
@@ -46,21 +31,7 @@ this.kind = kind; | ||
}; | ||
__name(_Message, "Message"); | ||
var Message = _Message; | ||
// packages/dts-plugin/src/server/message/Action/Action.ts | ||
var ActionKind; | ||
(function(ActionKind2) { | ||
ActionKind2["ADD_SUBSCRIBER"] = "ADD_SUBSCRIBER"; | ||
ActionKind2["EXIT_SUBSCRIBER"] = "EXIT_SUBSCRIBER"; | ||
ActionKind2["ADD_PUBLISHER"] = "ADD_PUBLISHER"; | ||
ActionKind2["UPDATE_PUBLISHER"] = "UPDATE_PUBLISHER"; | ||
ActionKind2["NOTIFY_SUBSCRIBER"] = "NOTIFY_SUBSCRIBER"; | ||
ActionKind2["EXIT_PUBLISHER"] = "EXIT_PUBLISHER"; | ||
ActionKind2["ADD_WEB_CLIENT"] = "ADD_WEB_CLIENT"; | ||
ActionKind2["NOTIFY_WEB_CLIENT"] = "NOTIFY_WEB_CLIENT"; | ||
})(ActionKind || (ActionKind = {})); | ||
var _Action = class _Action extends Message { | ||
var Action = class extends Message { | ||
constructor(content, kind) { | ||
super("Action", kind); | ||
__publicField(this, "payload"); | ||
const { payload } = content; | ||
@@ -70,36 +41,19 @@ this.payload = payload; | ||
}; | ||
__name(_Action, "Action"); | ||
var Action = _Action; | ||
// packages/dts-plugin/src/server/message/Action/Update.ts | ||
var UpdateKind; | ||
(function(UpdateKind2) { | ||
UpdateKind2["UPDATE_TYPE"] = "UPDATE_TYPE"; | ||
UpdateKind2["RELOAD_PAGE"] = "RELOAD_PAGE"; | ||
})(UpdateKind || (UpdateKind = {})); | ||
// packages/dts-plugin/src/server/message/Action/AddWebClient.ts | ||
var _AddWebClientAction = class _AddWebClientAction extends Action { | ||
var AddWebClientAction = class extends Action { | ||
constructor(payload) { | ||
super({ | ||
payload | ||
}, ActionKind.ADD_WEB_CLIENT); | ||
super( | ||
{ | ||
payload | ||
}, | ||
"ADD_WEB_CLIENT" /* ADD_WEB_CLIENT */ | ||
); | ||
} | ||
}; | ||
__name(_AddWebClientAction, "AddWebClientAction"); | ||
var AddWebClientAction = _AddWebClientAction; | ||
// packages/dts-plugin/src/server/message/API/API.ts | ||
var APIKind; | ||
(function(APIKind2) { | ||
APIKind2["UPDATE_SUBSCRIBER"] = "UPDATE_SUBSCRIBER"; | ||
APIKind2["RELOAD_WEB_CLIENT"] = "RELOAD_WEB_CLIENT"; | ||
})(APIKind || (APIKind = {})); | ||
// packages/dts-plugin/src/server/WebClient.ts | ||
var _WebClient = class _WebClient { | ||
var WebClient = class { | ||
constructor(options) { | ||
__publicField(this, "_webSocket", null); | ||
__publicField(this, "_name"); | ||
__publicField(this, "logPrefix"); | ||
this._webSocket = null; | ||
this._name = options.name; | ||
@@ -110,6 +64,12 @@ this.logPrefix = options.logPrefix || ""; | ||
_connect() { | ||
console.log(`${this.logPrefix}Trying to connect to {cyan ws://127.0.0.1:${DEFAULT_WEB_SOCKET_PORT}}...}`); | ||
this._webSocket = new browser_default(`ws://127.0.0.1:${DEFAULT_WEB_SOCKET_PORT}?WEB_SOCKET_CONNECT_MAGIC_ID=${WEB_SOCKET_CONNECT_MAGIC_ID}`); | ||
console.log( | ||
`${this.logPrefix}Trying to connect to {cyan ws://127.0.0.1:${DEFAULT_WEB_SOCKET_PORT}}...}` | ||
); | ||
this._webSocket = new browser_default( | ||
`ws://127.0.0.1:${DEFAULT_WEB_SOCKET_PORT}?WEB_SOCKET_CONNECT_MAGIC_ID=${WEB_SOCKET_CONNECT_MAGIC_ID}` | ||
); | ||
this._webSocket.onopen = () => { | ||
console.log(`${this.logPrefix}Connected to {cyan ws://127.0.0.1:${DEFAULT_WEB_SOCKET_PORT}} success!`); | ||
console.log( | ||
`${this.logPrefix}Connected to {cyan ws://127.0.0.1:${DEFAULT_WEB_SOCKET_PORT}} success!` | ||
); | ||
const startWebClient = new AddWebClientAction({ | ||
@@ -122,6 +82,10 @@ name: this._name | ||
console.log(message); | ||
const parsedMessage = JSON.parse(message.data.toString()); | ||
const parsedMessage = JSON.parse( | ||
message.data.toString() | ||
); | ||
if (parsedMessage.type === "API") { | ||
if (parsedMessage.kind === APIKind.RELOAD_WEB_CLIENT) { | ||
const { payload: { name } } = parsedMessage; | ||
if (parsedMessage.kind === "RELOAD_WEB_CLIENT" /* RELOAD_WEB_CLIENT */) { | ||
const { | ||
payload: { name } | ||
} = parsedMessage; | ||
if (name !== this._name) { | ||
@@ -143,4 +107,2 @@ return; | ||
}; | ||
__name(_WebClient, "WebClient"); | ||
var WebClient = _WebClient; | ||
@@ -147,0 +109,0 @@ // packages/dts-plugin/src/server/launchWebClient.ts |
@@ -25,6 +25,2 @@ { | ||
}, | ||
"./server": { | ||
"import": "./dist/server.js", | ||
"require": "./dist/server.js" | ||
}, | ||
"./*": "./*" | ||
@@ -39,5 +35,2 @@ }, | ||
"./dist/core.d.ts" | ||
], | ||
"server": [ | ||
"./dist/server.d.ts" | ||
] | ||
@@ -44,0 +37,0 @@ } |
{ | ||
"name": "@module-federation/dts-plugin", | ||
"version": "0.0.0-next-20240523121007", | ||
"version": "0.0.0-next-20240523224941", | ||
"author": "hanric <hanric.zhang@gmail.com>", | ||
@@ -25,6 +25,2 @@ "main": "./dist/index.js", | ||
}, | ||
"./server": { | ||
"import": "./dist/server.js", | ||
"require": "./dist/server.js" | ||
}, | ||
"./*": "./*" | ||
@@ -39,5 +35,2 @@ }, | ||
"./dist/core.d.ts" | ||
], | ||
"server": [ | ||
"./dist/server.d.ts" | ||
] | ||
@@ -59,5 +52,5 @@ } | ||
"ws": "8.5.0", | ||
"@module-federation/sdk": "0.0.0-next-20240523121007", | ||
"@module-federation/managers": "0.0.0-next-20240523121007", | ||
"@module-federation/third-party-dts-extractor": "0.0.0-next-20240523121007" | ||
"@module-federation/sdk": "0.0.0-next-20240523224941", | ||
"@module-federation/managers": "0.0.0-next-20240523224941", | ||
"@module-federation/third-party-dts-extractor": "0.0.0-next-20240523224941" | ||
}, | ||
@@ -64,0 +57,0 @@ "devDependencies": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
59
15
325855
20
9456
+ Added@module-federation/managers@0.0.0-next-20240523224941(transitive)
+ Added@module-federation/sdk@0.0.0-next-20240523224941(transitive)
+ Added@module-federation/third-party-dts-extractor@0.0.0-next-20240523224941(transitive)
- Removed@module-federation/managers@0.0.0-next-20240523121007(transitive)
- Removed@module-federation/sdk@0.0.0-next-20240523121007(transitive)
- Removed@module-federation/third-party-dts-extractor@0.0.0-next-20240523121007(transitive)
Updated@module-federation/managers@0.0.0-next-20240523224941
Updated@module-federation/third-party-dts-extractor@0.0.0-next-20240523224941