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

@tetherto/wdk-worklet-bundler

v1.0.0-beta.3

Published

CLI tool for generating WDK worklet bundles

Downloads

1,758

Readme

@tetherto/wdk-worklet-bundler

CLI tool for generating optimized WDK worklet bundles. This tool packages specific blockchain modules (Wallets, Protocols) into a single artifact designed to run in a separate Bare runtime thread, isolated from your main React Native application loop.

This architecture ensures:

  • Performance: Heavy cryptographic operations do not block the UI thread.
  • Compatibility: Provides a Node.js-like environment (via bare-node-runtime) for standard crypto libraries.
  • Isolation: Securely encapsulates wallet logic and private keys.

Installation

# Global installation
npm install -g @tetherto/wdk-worklet-bundler

# Or as a project dependency (recommended)
npm install --save-dev @tetherto/wdk-worklet-bundler

# Or run directly without installation
npx @tetherto/wdk-worklet-bundler

Quick Start

  1. Initialize a configuration in your React Native project:

    wdk-worklet-bundler init
  2. Configure your networks in wdk.config.js:

    module.exports = {
      networks: {
        ethereum: {
          package: '@tetherto/wdk-wallet-evm-erc-4337'
        },
        bitcoin: {
          package: '@tetherto/wdk-wallet-btc'
        }
      }
    };
  3. Generate the bundle:

    # Automatically installs missing WDK modules to your dependencies
    wdk-worklet-bundler generate --install
  4. Use it in your App:

    import { WdkAppProvider } from '@tetherto/pear-wrk-wdk';
    // Import the generated bundle asset (handled by metro/webpack as a static asset)
    const workletBundle = require('./.wdk-bundle/wdk-worklet.bundle.js');
    
    function App() {
      return (
        <WdkAppProvider bundle={{ bundle: workletBundle }}>
          {/* Your App Content */}
        </WdkAppProvider>
      );
    }

Architecture

The bundler orchestrates the creation of a standalone JavaScript environment ("Worklet") that communicates with your main application.

  • Host (React Native App): Your UI layer. It loads the generated bundle and communicates with it via HRPC (Host-Remote Procedure Call).
  • Guest (Worklet Bundle): A compact, optimized bundle containing your selected Wallet and Protocol modules. It runs inside the Bare runtime (a minimal Node.js-compatible runtime for mobile).
  • Bundler (The Chef): This CLI tool. It resolves dependencies, generates the entry point code, and compiles everything using bare-pack.

We recommend installing all WDK modules and the core library as dependencies. The bundler compiles them into the separate worklet artifact, but having them in dependencies ensures proper resolution and type availability.

Commands

generate

Builds the worklet bundle.

wdk-worklet-bundler generate [options]

Options:

  • -c, --config <path>: Path to config file.
  • --install: Automatically install missing modules listed in your config (saves to devDependencies).
  • --keep-artifacts: Keep the intermediate .wdk/ folder (useful for debugging generated source code). By default, this is cleaned up.
  • --source-only: Generate the entry files but skip the final bare-pack bundling step.
  • --skip-generation: Skip artifact generation and use existing files.
  • --dry-run: Print what would happen without writing files.
  • --no-types: Skip generating TypeScript definitions (index.d.ts).
  • -v, --verbose: Show verbose output.

init

Creates a fresh wdk.config.js file.

wdk-worklet-bundler init [options]

Options:

  • -y, --yes: Use defaults without prompting.

validate

Checks if your configuration is valid and if all required dependencies are installed.

wdk-worklet-bundler validate [options]

Options:

  • -c, --config <path>: Path to config file.

list-modules

List available WDK modules.

wdk-worklet-bundler list-modules [options]

Options:

  • --json: Output as JSON.

clean

Remove generated .wdk folder.

wdk-worklet-bundler clean [options]

Options:

  • -y, --yes: Skip confirmation.

Configuration Reference (wdk.config.js)

module.exports = {
  // Map logical network names to WDK wallet packages
  networks: {
    ethereum: { 
      package: '@tetherto/wdk-wallet-evm-erc-4337' 
    },
    local_dev: {
      package: './local-packages/my-custom-wallet' // Local paths supported
    }
  },

  // Map logical protocol names to WDK protocol packages
  protocols: {
    aaveEvm: {
      package: '@tetherto/wdk-protocol-aave-lending-evm'
    }
  },

  // Native addons to preload (e.g. for specific crypto requirements)
  preloadModules: [
    'spark-frost-bare-addon'
  ],

  // Customize output locations
  output: {
    bundle: './.wdk-bundle/wdk-worklet.bundle.js',
    types: './.wdk/index.d.ts'
  },

  // Build options
  options: {
    minify: false, // Optional: Minify the bundle
    sourceMaps: false, // Optional: Generate source maps
    targets: ['ios-arm64', 'android-arm64'] // bare-pack targets
  }
};

Troubleshooting

"Module not found" during generation: Run wdk-worklet-bundler generate --install. This ensures all packages defined in your config (plus the core @tetherto/pear-wrk-wdk) are present in your node_modules.

"Missing dependency" inside the worklet: If you see runtime errors about missing modules inside the worklet, ensure pear-wrk-wdk is properly installed. The bundler treats it as an external dependency that must be present.

License

Apache-2.0