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

@aihu/compiler

v1.3.13

Published

Single File Component (.aihu) compiler — Rust binary + JS glue.

Readme

@aihu/compiler

Aihu — agentic discovery and interaction, for human purpose.

Single File Component (.aihu) compiler — Rust binary + JS glue.

Part of the compiler + toolchain layer of Aihu. Build-time only — does not ship to the client. The compiler reads .aihu SFC source (per the Block Structure spec) and emits standards-compliant Web Components.

The package exposes the compiler plugin and transform API from its root entry point. Migration tools are available as stable subpath exports so framework tooling does not need to import compiler source files:

import { migrate } from '@aihu/compiler/codemods/macro-simplification'
import { migrateStateWrappers } from '@aihu/compiler/codemods/state-wrapper'
import { migrateTemplateGrammar } from '@aihu/compiler/codemods/template-grammar-v2'

CSS providers

CSS integration is opt-in. The default plugin behavior continues to discover @aihu/css-engine when it is installed. A project that uses another CSS engine can provide its own complete stylesheet producer without importing the legacy engine:

import { aihuCompilerPlugin, type AihuCssProvider } from '@aihu/compiler'

const cssProvider: AihuCssProvider = ({ source, id, shadowMode, target, lightScopeId }) => {
  return myCssEngine.compileAihu({ source, id, shadowMode, target, lightScopeId })
}

export default {
  plugins: [aihuCompilerPlugin({ cssProvider })],
}

The provider receives the source and file id plus the compiler's resolved shadowMode ('light' or 'shadow'), build target, and optional light-DOM scope id. A non-empty result is authoritative: it must be the complete stylesheet for that SFC, including utility rules, tokens, and authored @style rules that should ship. The compiler replaces the component's shadow stylesheet with it, or sends it through the Vite CSS pipeline for light DOM. Return an empty string, null, or undefined to emit no provider stylesheet.

The explicit provider replaces automatic css-engine resolution for that plugin instance, so alternate CSS engines remain independent and opt-in.

Programmatic API

Outside the Vite plugin, the root entry also exports functions for tooling that needs to drive the compiler directly (editor integrations, the router's build-time route scan, @aihu/tsc):

import { compileRouteMeta, compileToAst, transform } from '@aihu/compiler'

const { code } = transform(source, id, { target: 'universal' }) // compiled JS
const ast = compileToAst(source, id) // parsed SFC AST (SfcAst)
const route = compileRouteMeta(source, id) // `@route` metadata, or null

All three spawn (or reuse, via an in-process memo) the same aihu-compile binary the Vite plugin uses internally.

Install

npm install @aihu/compiler
# or
bun add @aihu/compiler

Auto-generated against @aihu/[email protected].

Package facts

| | | |---|---| | Version | 1.3.11 | | Tier | D — Compiler — Single-File Component (.aihu) → Web Component | | Published files | 4 entries | | License | MIT |

Auto-generated against @aihu/[email protected].

Exports

| Subpath | ESM | CJS | |---|---|---| | . | ./dist/index.js | — | | ./codemods/macro-simplification | ./dist/codemods/macro-simplification.js | — | | ./codemods/state-wrapper | ./dist/codemods/state-wrapper.js | — | | ./codemods/template-grammar-v2 | ./dist/codemods/template-grammar-v2.js | — |

Auto-generated against @aihu/[email protected].

Dependencies

Peer dependencies:

  • vite — >=5.0.0
  • @aihu/css-engine — >=0.6.1

Optional dependencies (platform-specific):

  • @aihu/compiler-darwin-arm64 — 1.3.11
  • @aihu/compiler-darwin-x64 — 1.3.11
  • @aihu/compiler-linux-x64-gnu — 1.3.11
  • @aihu/compiler-linux-arm64-gnu — 1.3.11
  • @aihu/compiler-win32-x64-msvc — 1.3.11
  • @aihu/compiler-native-darwin-arm64 — 1.3.11
  • @aihu/compiler-native-darwin-x64 — 1.3.11
  • @aihu/compiler-native-linux-x64-gnu — 1.3.11
  • @aihu/compiler-native-linux-arm64-gnu — 1.3.11
  • @aihu/compiler-native-win32-x64-msvc — 1.3.11

Auto-generated against @aihu/[email protected].

See also

Auto-generated against @aihu/[email protected].

License

MIT — see LICENSE.

Auto-generated against @aihu/[email protected].