npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

zephyr-xpack-internal

v1.0.1

Published

Xpack internals for Zephyr

Downloads

16,761

Readme

Zephyr XPack Internal (Internal)

Zephyr Cloud | Zephyr Docs | Discord | Twitter | LinkedIn

Internal Package - Shared types, Module Federation capabilities, and utilities for bundlers built on top of Webpack or Rspack. This package provides common functionality for Webpack-compatible bundlers.

Note: This is an internal package used by Webpack and Rspack plugins. It is not intended for direct use by end users.

Overview

The Zephyr XPack Internal package provides shared functionality for Webpack-compatible bundlers:

  • Module Federation: Advanced Module Federation capabilities and utilities
  • Federation Dashboard: Build-time analytics and federation insights
  • XPack Extraction: Asset and configuration extraction for Webpack/Rspack
  • Lifecycle Events: Build lifecycle hooks and event management
  • Shared Types: Common TypeScript interfaces and types

Package Structure

Federation Dashboard Legacy (federation-dashboard-legacy/)

  • Legacy Module Federation dashboard functionality
  • Build statistics collection and analysis
  • Dependency graph conversion and visualization
  • Federation metadata processing

Hooks (hooks/)

  • Build lifecycle event hooks
  • Deployment setup and logging configuration
  • Integration points for build processes

Lifecycle Events (lifecycle-events/)

  • Standardized build lifecycle management
  • Event dispatching and handling
  • Plugin coordination during builds

XPack Extract (xpack-extract/)

  • Webpack/Rspack asset extraction utilities
  • Module Federation configuration extraction
  • Runtime code generation for federation
  • Federation dependency analysis

Federation Dashboard

Advanced Module Federation analytics and insights:

Build Statistics

interface FederationBuildStats {
  modules: ModuleInfo[];
  dependencies: DependencyInfo[];
  remotes: RemoteInfo[];
  exposes: ExposeInfo[];
  shared: SharedInfo[];
  buildTime: number;
  bundleSize: number;
}

Dependency Graph Conversion

// Convert webpack stats to federation graph
const graph = convertToGraph(webpackStats, {
  includeModules: true,
  includeDependencies: true,
  includeChunks: true,
});

License Extraction

// Extract license information from modules
const licenses = getLicenses(modules, {
  includeDevDependencies: false,
  groupByLicense: true,
});

Module Federation Utilities

Federation Config Extraction

// Extract federation configuration from webpack config
const federationConfig = extractFederationConfig(webpackConfig);

// Iterate through remote configurations
const remotes = iterateFederatedRemoteConfig(federationConfig);

// Process federation dependencies
const deps = extractFederatedDependencyPairs(config);

Runtime Code Generation

// Create Module Federation runtime code
const runtimeCode = createMfRuntimeCode({
  remotes: federationConfig.remotes,
  shared: federationConfig.shared,
  exposes: federationConfig.exposes,
});

Plugin Detection

// Detect Module Federation plugin in webpack config
const isModuleFederation = isModuleFederationPlugin(plugin);

// Extract federation plugin options
const options = makeCopyOfModuleFederationOptions(plugin);

Asset Management

Webpack Assets Map

// Build comprehensive assets map
const assetsMap = buildWebpackAssetsMap(compilation, {
  includeSourceMaps: true,
  includeChunks: true,
  includeModules: true,
});

Asset Upload

// Upload agent for assets
const uploadAgent = new ZeXpackUploadAgent({
  assets: assetsMap,
  federation: federationConfig,
  buildStats: stats,
});

await uploadAgent.upload();

Version Strategy

Compute versioning strategy for federated modules:

// Compute version strategy for federation
const versionStrategy = computeVersionStrategy({
  packageJson: packageInfo,
  gitInfo: gitContext,
  buildContext: buildInfo,
});

Graph Merging

Merge multiple federation graphs:

// Merge federation graphs from multiple builds
const mergedGraph = mergeGraphs([hostGraph, remoteGraph1, remoteGraph2], {
  deduplicateModules: true,
  preserveMetadata: true,
});

Integration with Bundlers

Webpack Integration

// Webpack plugin integration
class ZephyrWebpackPlugin {
  apply(compiler) {
    // Use xpack utilities
    const federationConfig = extractFederationConfig(compiler.options);
    const assetsMap = buildWebpackAssetsMap(compilation);
  }
}

Rspack Integration

// Rspack plugin integration
class ZephyrRspackPlugin {
  apply(compiler) {
    // Reuse webpack-compatible utilities
    const federationConfig = extractFederationConfig(compiler.options);
    const stats = convertToGraph(compilation.getStats());
  }
}

Advanced Features

Federation Dashboard Plugin

// Advanced federation analytics
const dashboardPlugin = new FederationDashboardPlugin({
  filename: 'federation-stats.json',
  includeModules: true,
  includeDependencies: true,
  computeVersionStrategy: true,
});

Runtime Requirements

// Add runtime requirements for federation
addRuntimeRequirementToPromiseExternal(compilation, 'federation-runtime');

Development Utilities

Mock Data

  • Comprehensive test data for federation scenarios
  • Mock configurations for testing plugins
  • Sample build statistics and dependency graphs

Validation

// Validate federation parameters
const isValid = validateParams({
  federationConfig,
  webpackConfig,
  buildContext,
});

Usage by Plugins

Webpack and Rspack plugins use this package:

import { extractFederationConfig, buildWebpackAssetsMap, convertToGraph, FederationDashboardPlugin } from 'zephyr-xpack-internal';

// In webpack/rspack plugin
const federationConfig = extractFederationConfig(compiler.options);
const assetsMap = buildWebpackAssetsMap(compilation);
const graph = convertToGraph(stats);

Development

For internal development:

# Build the package
npm run build

# Run tests
npm run test

# Test with mock data
npm run test:integration

Contributing

This is an internal package. Contributions should be made through the main Zephyr plugins repository. Please read our contributing guidelines for more information.

License

Licensed under the Apache-2.0 License. See LICENSE for more information.