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

@agentreins/adapter-js

v0.20.0

Published

JavaScript/TypeScript language adapter for reins (Vite + React, Next).

Readme

@agentreins/adapter-js

The JavaScript/TypeScript adapter of reins: it reads the import graph of Vite + React and Next projects so reins check can enforce your architecture.

Install

Install it next to the CLI, in the root of your project (Node.js 22 or newer):

npm install -D @agentreins/cli @agentreins/adapter-js
# pnpm add -D @agentreins/cli @agentreins/adapter-js
# yarn add -D @agentreins/cli @agentreins/adapter-js

npx reins install
npx reins init

You never import this package yourself: the reins command finds it from adapters: [js] in .reins/architecture.yml.

Supported projects

| Preset | Project | Detected from | | --- | --- | --- | | vite-react | Vite + React single page app | vite.config.* | | next-app | Next.js, app router | next.config.* and an app/ folder | | next-pages | Next.js, pages router | next.config.* and a pages/ folder | | inertia-react | Vite frontend inside a Rails app (Inertia), code in app/frontend or app/javascript | vite.config.* next to a Gemfile and config/application.rb. Use it with @agentreins/adapter-rails |

Plain JS/JSX or TypeScript, with or without src/, single package or monorepo workspaces. reins init detects the preset; force one with reins init --preset <name>.

What it does

  • Reads imports with dependency-cruiser: static, dynamic (import()) and type-only imports, each tagged so rules can treat them differently (ignore_kinds in architecture.yml).
  • Resolves aliases such as @/ from jsconfig.json/tsconfig.json (paths, baseUrl, following extends and references) and from vite.config resolve.alias. Config files are read as text, never executed.
  • Reads re-export barrels (components/index.js) and reports what each importer really uses through them, so reins init can tell which domain owns a folder and reins impact can count importers behind a barrel as consumers of the real file. The import graph alone would make every importer use everything behind a barrel.
  • Warns about local imports it can't resolve, so a broken alias never turns into a silently green check.
  • Knows framework entry points (Next's page, layout, route..., Vite's main), so they are never reported as orphans.
  • Monorepos: workspace packages resolve, including packages that only declare exports and symlinked workspaces.
  • Base version for the pull request map (prepareCheckout): links node_modules into a temporary checkout of the merge base entry by entry, so workspace packages resolve to their base code and nothing is installed (pnpm, npm and yarn node_modules layouts; Yarn PnP gets a warning).
  • Scans the whole repo except node_modules, .git, .next, .reins and build output (dist, build, out, coverage, .turbo, .vercel, .cache, storybook-static); layers decide what matters.
  • Presets give reins init a starting plan: layers (app > features > components > shared) and domains from features/* or modules/*, or from route folders when there are none. Route groups ((main)) are looked through, and the import graph decides which folders join each route (components/pages/dashboard/ joins routes/dashboard/). A one-file route is a domain only when it owns a folder elsewhere, and one-file routes sharing a feature folder only they use become one domain.
  • Optional rule next-server-client: a 'use client' file must not reach, directly or through its imports, a module that imports server-only or next/headers.

TypeScript

TypeScript projects use the typescript package they already have; it is an optional peer dependency. If the project has .ts/.tsx files and typescript is missing, reins check stops with an error instead of skipping those files.

Learn more

License

MIT