DX toolkit for Solana and EVM. Framework-agnostic DX tooling — polyfills, IDL sync, codegen, and workspace orchestration.
Works with React, Next.js, Svelte, SvelteKit, Remix, Nuxt, or any Vite/webpack project.
npm install polyq// vite.config.ts
import { polyqVite } from 'polyq/vite'
export default defineConfig({
plugins: [polyqVite()],
})// next.config.ts
import { withPolyq } from 'polyq/next'
const nextConfig = { /* ... */ }
export default withPolyq(nextConfig)// vite.config.ts
import { sveltekit } from '@sveltejs/kit/vite'
import { polyqSvelteKit } from 'polyq/sveltekit'
export default defineConfig({
plugins: [sveltekit(), ...polyqSvelteKit()],
})// vite.config.ts
import { vitePlugin as remix } from '@remix-run/dev'
import { polyqRemix } from 'polyq/remix'
export default defineConfig({
plugins: [remix(), ...polyqRemix()],
})// nuxt.config.ts
export default defineNuxtConfig({
modules: ['polyq/nuxt'],
polyq: {
polyfills: { buffer: true },
idlSync: {
mapping: { my_program: ['packages/sdk/src/idl.json'] },
},
},
})// webpack.config.js
import { polyqWebpack } from 'polyq/webpack'
const applyHelm = polyqWebpack()
export default applyHelm({
entry: './src/index.ts',
// ...
})Zero-config. Detects Solana dependencies and auto-configures:
global→globalThisbufferalias → npmbufferpackageoptimizeDeps(Vite) /resolve.fallback+ProvidePlugin(webpack)
SSR-aware — polyfills only apply to client builds.
Watch target/idl/ and auto-sync to your frontend on every anchor build:
// Any Vite-based framework
polyqVite({
idlSync: {
watchDir: 'target/idl',
mapping: {
my_program: ['packages/sdk/src/idl.json'],
},
},
})No manual copying, no page refresh. The Vite dev server picks up IDL changes via HMR.
Generate TypeScript clients from Anchor IDLs:
polyq codegen # All IDLs in target/idl/
polyq codegen --idl target/idl/my_program.json --out generated/
polyq codegen --watch # Watch + regenerateGenerates:
- Types — TypeScript interfaces from IDL type definitions
- PDAs —
deriveFoo()functions from IDL seed definitions - Instructions —
createFooInstruction()builders with typed accounts/args - Accounts — Discriminator constants and fetch stubs
- Errors — Error enum and lookup function
Stage-based dev environment orchestration with proper health check polling:
polyq dev # Docker → Validator → Build → Deploy → Init → DB → Dev Server
polyq dev --quick # Skip program builds
polyq dev --reset # Drop DB, clear ledger, full rebuild
polyq stop # Stop services
polyq stop --all # Also stop Docker
polyq status # Show what's running
polyq build # Build programs
polyq build --features local --parallelReplaces hundreds of lines of shell scripts with a single config:
// polyq.config.ts
import { defineHelmConfig } from 'polyq'
export default defineHelmConfig({
workspace: {
buildFeatures: ['local'],
docker: { services: ['postgres'] },
validator: { rpcUrl: 'http://127.0.0.1:8899' },
init: { script: 'scripts/init.ts' },
database: {
url: 'postgresql://dev:dev@localhost:5433/myapp',
migrationsDir: 'migrations',
seed: { script: 'seed:dev' },
},
devServer: { command: 'bun run dev' },
},
})| Feature | Vite (React, Svelte, etc.) | Next.js | SvelteKit | Remix | Nuxt |
|---|---|---|---|---|---|
| Auto Polyfills | polyqVite() |
withPolyq() |
polyqSvelteKit() |
polyqRemix() |
module |
| IDL Sync + HMR | yes | — | yes | yes | yes |
| Codegen (CLI) | yes | yes | yes | yes | yes |
| Smart Workspace | yes | yes | yes | yes | yes |
IDL Sync requires Vite's dev server for HMR. Next.js projects get polyfills + codegen + workspace, but not hot IDL reload.
MIT