@module-federation/dts-kit
Advanced tools
Comparing version 0.0.0-next-20240326102030 to 0.0.0-next-20240401040901
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); | ||
var _chunkPY5YIQFHjs = require('./chunk-PY5YIQFH.js'); | ||
var _chunkRBI5QTOHjs = require('./chunk-RBI5QTOH.js'); | ||
@@ -9,3 +9,3 @@ // packages/dts-kit/src/lib/forkGenerateDts.ts | ||
async function forkGenerateDts(options) { | ||
return _chunkPY5YIQFHjs.generateTypes.call(void 0, options); | ||
return _chunkRBI5QTOHjs.generateTypes.call(void 0, options); | ||
} | ||
@@ -22,5 +22,5 @@ process.on("message", (message) => { | ||
}); | ||
_chunkPY5YIQFHjs.exposeRpc.call(void 0, forkGenerateDts); | ||
_chunkRBI5QTOHjs.exposeRpc.call(void 0, forkGenerateDts); | ||
exports.forkGenerateDts = forkGenerateDts; |
@@ -30,2 +30,3 @@ import typescript from 'typescript'; | ||
generateAPITypes(mapComponentsToExpose: Record<string, string>): string; | ||
extractRemoteTypes(options: ReturnType<typeof retrieveRemoteConfig>): Promise<void>; | ||
generateTypes(): Promise<void>; | ||
@@ -32,0 +33,0 @@ requestRemoteManifest(remoteInfo: RemoteInfo): Promise<Required<RemoteInfo>>; |
@@ -15,3 +15,3 @@ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var _chunkPY5YIQFHjs = require('./chunk-PY5YIQFH.js'); | ||
var _chunkRBI5QTOHjs = require('./chunk-RBI5QTOH.js'); | ||
@@ -215,5 +215,4 @@ // packages/dts-kit/src/lib/DtsWorker.ts | ||
exit() { | ||
if (this._rpcWorker) { | ||
this._rpcWorker.terminate(); | ||
} | ||
var _a; | ||
(_a = this._rpcWorker) == null ? void 0 : _a.terminate(); | ||
} | ||
@@ -231,3 +230,3 @@ }; | ||
var _a; | ||
const DTSManagerConstructor = _chunkPY5YIQFHjs.getDTSManagerConstructor.call(void 0, | ||
const DTSManagerConstructor = _chunkRBI5QTOHjs.getDTSManagerConstructor.call(void 0, | ||
(_a = options.host) == null ? void 0 : _a.implementation | ||
@@ -254,2 +253,2 @@ ); | ||
exports.DTSManager = _chunkPY5YIQFHjs.DTSManager; exports.HOST_API_TYPES_FILE_NAME = _chunkPY5YIQFHjs.HOST_API_TYPES_FILE_NAME; exports.REMOTE_ALIAS_IDENTIFIER = _chunkPY5YIQFHjs.REMOTE_ALIAS_IDENTIFIER; exports.REMOTE_API_TYPES_FILE_NAME = _chunkPY5YIQFHjs.REMOTE_API_TYPES_FILE_NAME; exports.consumeTypes = consumeTypes; exports.generateTypes = _chunkPY5YIQFHjs.generateTypes; exports.generateTypesInChildProcess = generateTypesInChildProcess; exports.getDTSManagerConstructor = _chunkPY5YIQFHjs.getDTSManagerConstructor; exports.retrieveHostConfig = _chunkPY5YIQFHjs.retrieveHostConfig; exports.retrieveMfTypesPath = _chunkPY5YIQFHjs.retrieveMfTypesPath; exports.retrieveOriginalOutDir = _chunkPY5YIQFHjs.retrieveOriginalOutDir; exports.retrieveRemoteConfig = _chunkPY5YIQFHjs.retrieveRemoteConfig; exports.retrieveTypesAssetsInfo = _chunkPY5YIQFHjs.retrieveTypesAssetsInfo; exports.retrieveTypesZipPath = _chunkPY5YIQFHjs.retrieveTypesZipPath; exports.validateOptions = _chunkPY5YIQFHjs.validateOptions; | ||
exports.DTSManager = _chunkRBI5QTOHjs.DTSManager; exports.HOST_API_TYPES_FILE_NAME = _chunkRBI5QTOHjs.HOST_API_TYPES_FILE_NAME; exports.REMOTE_ALIAS_IDENTIFIER = _chunkRBI5QTOHjs.REMOTE_ALIAS_IDENTIFIER; exports.REMOTE_API_TYPES_FILE_NAME = _chunkRBI5QTOHjs.REMOTE_API_TYPES_FILE_NAME; exports.consumeTypes = consumeTypes; exports.generateTypes = _chunkRBI5QTOHjs.generateTypes; exports.generateTypesInChildProcess = generateTypesInChildProcess; exports.getDTSManagerConstructor = _chunkRBI5QTOHjs.getDTSManagerConstructor; exports.retrieveHostConfig = _chunkRBI5QTOHjs.retrieveHostConfig; exports.retrieveMfTypesPath = _chunkRBI5QTOHjs.retrieveMfTypesPath; exports.retrieveOriginalOutDir = _chunkRBI5QTOHjs.retrieveOriginalOutDir; exports.retrieveRemoteConfig = _chunkRBI5QTOHjs.retrieveRemoteConfig; exports.retrieveTypesAssetsInfo = _chunkRBI5QTOHjs.retrieveTypesAssetsInfo; exports.retrieveTypesZipPath = _chunkRBI5QTOHjs.retrieveTypesZipPath; exports.validateOptions = _chunkRBI5QTOHjs.validateOptions; |
@@ -28,2 +28,5 @@ { | ||
"author": "Matteo Pietro Dazzi <matteopietro.dazzi@gmail.com> (https://github.com/ilteoood)", | ||
"contributors": [ | ||
"zhanghang <hanric.zhang@gmail.com> https://github.com/2heal1" | ||
], | ||
"license": "MIT", | ||
@@ -39,3 +42,4 @@ "dependencies": { | ||
"@module-federation/managers": "workspace:*", | ||
"lodash.clonedeepwith": "4.5.0" | ||
"lodash.clonedeepwith": "4.5.0", | ||
"@module-federation/third-party-dts-extractor": "workspace:*" | ||
}, | ||
@@ -42,0 +46,0 @@ "peerDependencies": { |
# @module-federation/dts-kit | ||
- This kit provides utilities to support the implementation of Module Federation Types in your projects. | ||
## Usage | ||
```javascript | ||
import { generateTypes, generateTypesInChildProcess, consumeTypes, } from '@module-federation/dts-kit'; | ||
// generate types for expose modules | ||
generateTypes({ remote: RemoteOptions }) | ||
// generate types for expose modules in child process | ||
generateTypesInChildProcess({ remote: RemoteOptions }) | ||
// consume remote types | ||
consumeTypes({ host: HostOptions }) | ||
``` | ||
### Configuration | ||
```typescript | ||
interface DTSManagerOptions { | ||
remote?: RemoteOptions; | ||
host?: HostOptions; | ||
extraOptions?: Record<string, any>; | ||
} | ||
``` | ||
#### RemoteOptions | ||
```typescript | ||
interface RemoteOptions { | ||
tsConfigPath?: string; // path where the tsconfig file is located, default is ''./tsconfig.json' | ||
typesFolder?: string; // folder where all the files will be stored, default is '@mf-types', | ||
compiledTypesFolder?: string; // folder where the federated modules types will be stored, default is 'compiled-types' | ||
deleteTypesFolder?: boolean; // indicate if the types folder will be deleted when the job completes, default is 'true' | ||
additionalFilesToCompile?: string[]; // The path of each additional file which should be emitted | ||
compileInChildProcess?: boolean; // indicate if the types will be compiled in child process, default is 'false' | ||
compilerInstance?: 'tsc' | 'vue-tsc'; // The compiler to use to emit files, default is 'tsc' | ||
generateAPITypes?: boolean; // indicate if generate runtime api types, default is 'false' | ||
abortOnError?: boolean; // indicate if the job will be aborted if an error occurs, default is 'true' | ||
moduleFederationConfig: moduleFederationPlugin.ModuleFederationPluginOptions; // the configuration same configuration provided to the module federation plugin, it is MANDATORY | ||
context?: string; // the context of the tsconfig file, default is 'process.cwd()' | ||
implementation?: string; // the implementation of DTSManager | ||
hostRemoteTypesFolder?: string; // the folder where the remote types pathname, default is `@mf-types` | ||
} | ||
``` | ||
#### HostOptions | ||
```typescript | ||
interface HostOptions{ | ||
typesFolder?: string; // folder where all the files will be stored, default is '@mf-types', | ||
abortOnError?: boolean; // indicate if the job will be aborted if an error occurs, default is 'true' | ||
remoteTypesFolder?: string; // the folder where the remote types pathname, default is `@mf-types` | ||
deleteTypesFolder?: boolean; // indicate if the types folder will be deleted before the job starts, default is 'true' | ||
maxRetries?: number; // The number of times the plugin will try to download the types before failing, default is 3 | ||
moduleFederationConfig: moduleFederationPlugin.ModuleFederationPluginOptions; // the configuration same configuration provided to the module federation plugin, it is MANDATORY | ||
context?: string; // the context of the tsconfig file, default is 'process.cwd()' | ||
implementation?: string; // the implementation of DTSManager | ||
} | ||
``` |
{ | ||
"name": "@module-federation/dts-kit", | ||
"version": "0.0.0-next-20240326102030", | ||
"version": "0.0.0-next-20240401040901", | ||
"description": "Bundler federated types", | ||
@@ -28,2 +28,5 @@ "keywords": [ | ||
"author": "Matteo Pietro Dazzi <matteopietro.dazzi@gmail.com> (https://github.com/ilteoood)", | ||
"contributors": [ | ||
"zhanghang <hanric.zhang@gmail.com> https://github.com/2heal1" | ||
], | ||
"license": "MIT", | ||
@@ -37,5 +40,6 @@ "dependencies": { | ||
"lodash.clonedeepwith": "4.5.0", | ||
"@module-federation/dev-server": "0.0.0-next-20240326102030", | ||
"@module-federation/sdk": "0.0.0-next-20240326102030", | ||
"@module-federation/managers": "0.0.0-next-20240326102030" | ||
"@module-federation/dev-server": "0.0.0-next-20240401040901", | ||
"@module-federation/sdk": "0.0.0-next-20240401040901", | ||
"@module-federation/managers": "0.0.0-next-20240401040901", | ||
"@module-federation/third-party-dts-extractor": "0.0.0-next-20240401040901" | ||
}, | ||
@@ -42,0 +46,0 @@ "peerDependencies": { |
# @module-federation/dts-kit | ||
- This kit provides utilities to support the implementation of Module Federation Types in your projects. | ||
## Usage | ||
```javascript | ||
import { generateTypes, generateTypesInChildProcess, consumeTypes, } from '@module-federation/dts-kit'; | ||
// generate types for expose modules | ||
generateTypes({ remote: RemoteOptions }) | ||
// generate types for expose modules in child process | ||
generateTypesInChildProcess({ remote: RemoteOptions }) | ||
// consume remote types | ||
consumeTypes({ host: HostOptions }) | ||
``` | ||
### Configuration | ||
```typescript | ||
interface DTSManagerOptions { | ||
remote?: RemoteOptions; | ||
host?: HostOptions; | ||
extraOptions?: Record<string, any>; | ||
} | ||
``` | ||
#### RemoteOptions | ||
```typescript | ||
interface RemoteOptions { | ||
tsConfigPath?: string; // path where the tsconfig file is located, default is ''./tsconfig.json' | ||
typesFolder?: string; // folder where all the files will be stored, default is '@mf-types', | ||
compiledTypesFolder?: string; // folder where the federated modules types will be stored, default is 'compiled-types' | ||
deleteTypesFolder?: boolean; // indicate if the types folder will be deleted when the job completes, default is 'true' | ||
additionalFilesToCompile?: string[]; // The path of each additional file which should be emitted | ||
compileInChildProcess?: boolean; // indicate if the types will be compiled in child process, default is 'false' | ||
compilerInstance?: 'tsc' | 'vue-tsc'; // The compiler to use to emit files, default is 'tsc' | ||
generateAPITypes?: boolean; // indicate if generate runtime api types, default is 'false' | ||
abortOnError?: boolean; // indicate if the job will be aborted if an error occurs, default is 'true' | ||
moduleFederationConfig: moduleFederationPlugin.ModuleFederationPluginOptions; // the configuration same configuration provided to the module federation plugin, it is MANDATORY | ||
context?: string; // the context of the tsconfig file, default is 'process.cwd()' | ||
implementation?: string; // the implementation of DTSManager | ||
hostRemoteTypesFolder?: string; // the folder where the remote types pathname, default is `@mf-types` | ||
} | ||
``` | ||
#### HostOptions | ||
```typescript | ||
interface HostOptions{ | ||
typesFolder?: string; // folder where all the files will be stored, default is '@mf-types', | ||
abortOnError?: boolean; // indicate if the job will be aborted if an error occurs, default is 'true' | ||
remoteTypesFolder?: string; // the folder where the remote types pathname, default is `@mf-types` | ||
deleteTypesFolder?: boolean; // indicate if the types folder will be deleted before the job starts, default is 'true' | ||
maxRetries?: number; // The number of times the plugin will try to download the types before failing, default is 3 | ||
moduleFederationConfig: moduleFederationPlugin.ModuleFederationPluginOptions; // the configuration same configuration provided to the module federation plugin, it is MANDATORY | ||
context?: string; // the context of the tsconfig file, default is 'process.cwd()' | ||
implementation?: string; // the implementation of DTSManager | ||
} | ||
``` |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
91488
2266
65
12
5
+ Added@module-federation/third-party-dts-extractor@0.0.0-next-20240401040901
+ Added@module-federation/dev-server@0.0.0-next-20240401040901(transitive)
+ Added@module-federation/managers@0.0.0-next-20240401040901(transitive)
+ Added@module-federation/sdk@0.0.0-next-20240401040901(transitive)
+ Added@module-federation/third-party-dts-extractor@0.0.0-next-20240401040901(transitive)
+ Addedis-core-module@2.16.1(transitive)
+ Addedpath-parse@1.0.7(transitive)
+ Addedresolve@1.22.8(transitive)
+ Addedsupports-preserve-symlinks-flag@1.0.0(transitive)
- Removed@module-federation/dev-server@0.0.0-next-20240326102030(transitive)
- Removed@module-federation/managers@0.0.0-next-20240326102030(transitive)
- Removed@module-federation/sdk@0.0.0-next-20240326102030(transitive)
Updated@module-federation/dev-server@0.0.0-next-20240401040901
Updated@module-federation/managers@0.0.0-next-20240401040901