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

@ic-reactor/codegen

v0.9.0

Published

Shared code generation utilities for IC Reactor

Downloads

374

Readme

@ic-reactor/codegen

shared code generation pipeline and utilities for IC Reactor.

This package contains the core machinery for generating TypeScript declarations, reactor instances, and client managers from Candid files. It is primarily used by:

  • @ic-reactor/cli: For manual/CLI-based generation
  • @ic-reactor/vite-plugin: For automatic build-time generation

API

The main entry point is the runCanisterPipeline function, which orchestrates the generation process.

import { runCanisterPipeline } from "@ic-reactor/codegen"

await runCanisterPipeline({
  canisterConfig: {
    name: "backend",
    mode: "DisplayReactor",
    didFile: "./backend.did",
  },
  projectRoot: process.cwd(),
  globalConfig: {
    outDir: "src/declarations",
    clientManagerPath: "../../clients",
    target: "react",
  },
  generateReactor: true,
})

Reactor Class Configuration

Set canisterConfig.mode to choose the generated reactor class:

  • DisplayReactor (default)
  • Reactor
  • CandidReactor
  • CandidDisplayReactor
  • MetadataDisplayReactor

Set target to control whether generated files include React hooks:

  • react (default): generates the reactor plus bound createActorHooks exports
  • core: generates only the typed reactor exports with no @ic-reactor/react dependency

Codegen now writes two files per canister: a managed index.generated.ts implementation that is regenerated on every run, and an index.ts entry wrapper. The wrapper is created once, then preserved unless it still matches the default generated wrapper or an older generated scaffold that can be migrated automatically.

Set generateReactor: false if you only want the bindgen/declaration output and need to skip index.generated.ts and index.ts.

Generators

You can also use individual generators if you need more granular control:

  • generateDeclarations: Generates .js (factory), .d.ts (types), and .did copy.
  • generateReactorFile: Generates the managed index.generated.ts implementation using either DisplayReactor or Reactor.
  • generateReactorEntryFile: Generates the stable index.ts wrapper that re-exports from index.generated.ts.
  • generateClientFile: Generates a ClientManager boilerplate file.

Utilities

  • parseDIDFile: Parses a .did file and extracts method signatures.
  • toPascalCase / toCamelCase: Naming helpers.

License

MIT