Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@module-federation/dts-kit

Package Overview
Dependencies
Maintainers
8
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@module-federation/dts-kit

Bundler federated types

  • 0.0.0-next-20240401073754
  • npm
  • Socket score

Version published
Weekly downloads
29
increased by70.59%
Maintainers
8
Weekly downloads
 
Created
Source

@module-federation/dts-kit

  • This kit provides utilities to support the implementation of Module Federation Types in your projects.

Usage

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

interface DTSManagerOptions {
  remote?: RemoteOptions;
  host?: HostOptions;
  extraOptions?: Record<string, any>;
}
RemoteOptions
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

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
}

Keywords

FAQs

Package last updated on 01 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc