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

@expozr/adapter-sdk

v2.2.0

Published

Shared SDK and utilities for Expozr bundler adapters

Readme

@expozr/adapter-sdk

Shared SDK and utilities for Expozr bundler adapters.

Overview

The Adapter SDK provides a common foundation for building bundler adapters in the Expozr ecosystem. It includes shared utilities, constants, configuration loaders, and base classes that ensure consistency across different bundler implementations.

Features

  • Configuration Management: Automatic loading and validation of Expozr configurations
  • Format Utilities: Support for multiple module formats (ESM, UMD, CJS) with proper naming conventions
  • External Dependencies: Centralized management of external dependencies and module mapping
  • Warning Suppression: Built-in patterns to suppress common bundler warnings for better DX
  • Plugin Architecture: Base classes for consistent plugin development
  • ESM Support: Specialized utilities for modern ESM compilation

Installation

npm install @expozr/adapter-sdk

Usage

Configuration Loading

import { loadExpozrConfig, loadHostConfig } from "@expozr/adapter-sdk";

// Load Expozr configuration
const { config, error } = await loadExpozrConfig({
  baseDir: process.cwd(),
  required: true,
});

// Load Host configuration
const hostResult = await loadHostConfig({
  configFile: "custom.config.js",
});

Format Utilities

import {
  createWebpackFormatConfig,
  createViteFormatConfig,
  normalizeFormats,
} from "@expozr/adapter-sdk";

// Create webpack configuration for UMD
const webpackUMD = createWebpackFormatConfig("umd", "MyLibrary");

// Create Vite configuration for ESM
const viteESM = createViteFormatConfig("esm");

// Normalize format arrays
const formats = normalizeFormats(["esm", "umd"]); // ['esm', 'umd']

External Configuration

import {
  createWebpackExternals,
  createViteExternals,
  createWebpackHostExternals,
} from "@expozr/adapter-sdk";

// Create externals for webpack warehouse
const externals = createWebpackExternals(moduleSystem, "web", {
  includeCommonExternals: true,
  additionalExternals: ["lodash"],
});

// Create externals for Vite warehouse
const viteExternals = createViteExternals(moduleSystem, "web");

Warning Suppression

import {
  createWebpackIgnoreWarnings,
  createViteWarningFilter,
} from "@expozr/adapter-sdk";

// Webpack warning suppression
const webpackConfig = {
  ignoreWarnings: createWebpackIgnoreWarnings(),
};

// Vite warning filtering
const viteConfig = {
  build: {
    rollupOptions: {
      onwarn: createViteWarningFilter(),
    },
  },
};

Plugin Base Classes

import { BaseExpozrPlugin, BaseHostPlugin } from "@expozr/adapter-sdk";

class MyBundlerPlugin extends BaseExpozrPlugin {
  constructor(options) {
    super(options);
  }

  async initialize() {
    // Load configuration
    await this.loadConfig(context);

    // Generate inventory
    const inventory = await this.generateInventory();

    // Write to filesystem
    await this.writeInventory(inventory, outputDir);
  }
}

Constants

The SDK provides numerous constants for consistent behavior:

import {
  EXPOZR_CONFIG_FILES,
  HOST_CONFIG_FILES,
  INVENTORY_FILE_NAME,
  DEFAULT_OUTPUT_DIR,
  SUPPORTED_EXTENSIONS,
  COMMON_EXTERNALS,
} from "@expozr/adapter-sdk";

ESM Utilities

For advanced ESM compilation support:

import {
  configureWebpackESM,
  configureWebpackUMD,
  createMultiFormatWebpackConfig,
  configureESMResolve,
} from "@expozr/adapter-sdk";

// Configure webpack for ESM
const esmConfig = configureWebpackESM(baseConfig, moduleSystem, {
  enableTreeShaking: true,
  targetEnvironment: "es2020",
});

Integration with Bundler Adapters

This SDK is designed to be used by:

  • @expozr/webpack-adapter
  • @expozr/vite-adapter
  • @expozr/rollup-adapter (future)
  • @expozr/esbuild-adapter (future)

API Reference

For detailed API documentation, please refer to the TypeScript definitions included with the package.

Contributing

When contributing to the SDK, ensure that:

  1. New utilities are bundler-agnostic
  2. Constants are properly typed and documented
  3. Base classes provide meaningful abstractions
  4. Changes maintain backward compatibility

License

MIT