{"id":50841054,"url":"https://github.com/tetherto/wdk-worklet-bundler","last_synced_at":"2026-06-14T06:35:23.558Z","repository":{"id":345836247,"uuid":"1122355475","full_name":"tetherto/wdk-worklet-bundler","owner":"tetherto","description":"A CLI utility for generating WDK worklet bundles for Bare Kit runtime.","archived":false,"fork":false,"pushed_at":"2026-04-17T17:03:30.000Z","size":554,"stargazers_count":0,"open_issues_count":4,"forks_count":9,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-17T18:39:43.639Z","etag":null,"topics":["bare-runtime","wdk","worklet"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tetherto.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-24T14:59:09.000Z","updated_at":"2026-04-17T17:03:27.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/tetherto/wdk-worklet-bundler","commit_stats":null,"previous_names":["tetherto/wdk-worklet-bundler"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/tetherto/wdk-worklet-bundler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tetherto%2Fwdk-worklet-bundler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tetherto%2Fwdk-worklet-bundler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tetherto%2Fwdk-worklet-bundler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tetherto%2Fwdk-worklet-bundler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tetherto","download_url":"https://codeload.github.com/tetherto/wdk-worklet-bundler/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tetherto%2Fwdk-worklet-bundler/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34312072,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-14T02:00:07.365Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bare-runtime","wdk","worklet"],"created_at":"2026-06-14T06:35:22.294Z","updated_at":"2026-06-14T06:35:23.545Z","avatar_url":"https://github.com/tetherto.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @tetherto/wdk-worklet-bundler\n\nCLI 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.\n\nThis architecture ensures:\n*   **Performance:** Heavy cryptographic operations do not block the UI thread.\n*   **Compatibility:** Provides a Node.js-like environment (via `bare-node-runtime`) for standard crypto libraries.\n*   **Isolation:** Securely encapsulates wallet logic and private keys.\n\n## Installation\n\n```bash\n# Global installation\nnpm install -g @tetherto/wdk-worklet-bundler\n\n# Or as a project dependency (recommended)\nnpm install --save-dev @tetherto/wdk-worklet-bundler\n\n# Or run directly without installation\nnpx @tetherto/wdk-worklet-bundler\n```\n\n## Quick Start\n\n1.  **Initialize** a configuration in your React Native project:\n    ```bash\n    wdk-worklet-bundler init\n    ```\n\n2.  **Configure** your networks in `wdk.config.js`:\n    ```javascript\n    module.exports = {\n      networks: {\n        ethereum: {\n          package: '@tetherto/wdk-wallet-evm-erc-4337'\n        },\n        bitcoin: {\n          package: '@tetherto/wdk-wallet-btc'\n        }\n      }\n    };\n    ```\n\n3.  **Generate** the bundle:\n    ```bash\n    # Automatically installs missing WDK modules to your dependencies\n    wdk-worklet-bundler generate --install\n    ```\n\n4.  **Use** it in your App:\n    ```typescript\n    import { WdkAppProvider } from '@tetherto/pear-wrk-wdk';\n    // Import the generated bundle asset (handled by metro/webpack as a static asset)\n    const workletBundle = require('./.wdk-bundle/wdk-worklet.bundle.js');\n\n    function App() {\n      return (\n        \u003cWdkAppProvider bundle={{ bundle: workletBundle }}\u003e\n          {/* Your App Content */}\n        \u003c/WdkAppProvider\u003e\n      );\n    }\n    ```\n\n## Architecture\n\nThe bundler orchestrates the creation of a standalone JavaScript environment (\"Worklet\") that communicates with your main application.\n\n*   **Host (React Native App):** Your UI layer. It loads the generated bundle and communicates with it via HRPC (Host-Remote Procedure Call).\n*   **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).\n*   **Bundler (The Chef):** This CLI tool. It resolves dependencies, generates the entry point code, and compiles everything using `bare-pack`.\n\nWe 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.\n\n## Commands\n\n### `generate`\nBuilds the worklet bundle.\n\n```bash\nwdk-worklet-bundler generate [options]\n```\n\n**Options:**\n*   `-c, --config \u003cpath\u003e`: Path to config file.\n*   `--install`: Automatically install missing modules listed in your config (saves to `devDependencies`).\n*   `--keep-artifacts`: Keep the intermediate `.wdk/` folder (useful for debugging generated source code). By default, this is cleaned up.\n*   `--source-only`: Generate the entry files but skip the final `bare-pack` bundling step.\n*   `--skip-generation`: Skip artifact generation and use existing files.\n*   `--dry-run`: Print what would happen without writing files.\n*   `--no-types`: Skip generating TypeScript definitions (`index.d.ts`).\n*   `-v, --verbose`: Show verbose output.\n\n### `init`\nCreates a fresh `wdk.config.js` file.\n\n```bash\nwdk-worklet-bundler init [options]\n```\n\n**Options:**\n*   `-y, --yes`: Use defaults without prompting.\n\n### `validate`\nChecks if your configuration is valid and if all required dependencies are installed.\n\n```bash\nwdk-worklet-bundler validate [options]\n```\n\n**Options:**\n*   `-c, --config \u003cpath\u003e`: Path to config file.\n\n### `list-modules`\nList available WDK modules.\n\n```bash\nwdk-worklet-bundler list-modules [options]\n```\n\n**Options:**\n*   `--json`: Output as JSON.\n\n### `clean`\nRemove generated `.wdk` folder.\n\n```bash\nwdk-worklet-bundler clean [options]\n```\n\n**Options:**\n*   `-y, --yes`: Skip confirmation.\n\n## Configuration Reference (`wdk.config.js`)\n\n```javascript\nmodule.exports = {\n  // Map logical network names to WDK wallet packages\n  networks: {\n    ethereum: { \n      package: '@tetherto/wdk-wallet-evm-erc-4337' \n    },\n    local_dev: {\n      package: './local-packages/my-custom-wallet' // Local paths supported\n    }\n  },\n\n  // Map logical protocol names to WDK protocol packages\n  protocols: {\n    aaveEvm: {\n      package: '@tetherto/wdk-protocol-aave-lending-evm'\n    }\n  },\n\n  // Native addons to preload (e.g. for specific crypto requirements)\n  preloadModules: [\n    'spark-frost-bare-addon'\n  ],\n\n  // Customize output locations\n  output: {\n    bundle: './.wdk-bundle/wdk-worklet.bundle.js',\n    types: './.wdk/index.d.ts'\n  },\n\n  // Build options\n  options: {\n    minify: false, // Optional: Minify the bundle\n    sourceMaps: false, // Optional: Generate source maps\n    targets: ['ios-arm64', 'android-arm64'] // bare-pack targets\n  }\n};\n```\n\n## Troubleshooting\n\n**\"Module not found\" during generation:**\nRun `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`.\n\n**\"Missing dependency\" inside the worklet:**\nIf 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.\n\n## License\n\nApache-2.0","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftetherto%2Fwdk-worklet-bundler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftetherto%2Fwdk-worklet-bundler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftetherto%2Fwdk-worklet-bundler/lists"}