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

@aginix/vulcan-data-provider

v0.1.0

Published

React Admin data provider for APIs built with @aginix/adonis-vulcan

Readme

@aginix/vulcan-data-provider

React Admin data provider for APIs built with @aginix/adonis-vulcan's BaseResourceController.

It speaks the same PostgREST-style filter grammar that BaseResourceController parses on the server side (?status=eq.active&age=gte.18), so any controller that extends BaseResourceController is wired up automatically.

Install

pnpm add @aginix/vulcan-data-provider react-admin

react-admin (or ra-core) is a peer dependency.

Usage

import { Admin, Resource, fetchUtils } from 'react-admin'
import { vulcanDataProvider } from '@aginix/vulcan-data-provider'

import { PostList, PostEdit, PostCreate } from './posts'

const dataProvider = vulcanDataProvider({
  apiUrl: '/api',
  httpClient: fetchUtils.fetchJson,
})

export const App = () => (
  <Admin dataProvider={dataProvider}>
    <Resource name="posts" list={PostList} edit={PostEdit} create={PostCreate} />
  </Admin>
)

How it maps to the API

| react-admin call | HTTP method + URL | | ------------------- | --------------------------------------------------- | | getList | GET /<resource>?page=&perPage=&order=&<filters> | | getOne | GET /<resource>/<id> | | getMany | GET /<resource>?id=in.(...)&page=1&perPage=<n> | | getManyReference | GET /<resource>?<target>=eq.<id>&... | | create | POST /<resource> | | update | PUT /<resource>/<id> (only changed fields) | | updateMany | PUT /<resource>/<id> looped (no batch endpoint) | | delete | DELETE /<resource>/<id> | | deleteMany | DELETE /<resource>/<id> looped |

Response envelope (matches ResourceSerializer / Lucid pagination):

// list
{ "data": [...], "metadata": { "total": 99, "perPage": 25, "currentPage": 1, ... } }

// single
{ "data": { ... } }

// destroy → 204 No Content

Filter grammar

The data provider reads react-admin's filter object and emits PostgREST-flavored query strings that @aginix/adonis-vulcan's FilterParser understands.

| Filter shape | URL fragment | | ------------------------------------------------- | ----------------------------------------- | | { status: 'active' } | status=eq.active | | { 'age@gt': 18 } | age=gt.18 | | { 'name@like': 'foo bar' } | name=like.*foo*&name=like.*bar* | | { tags: ['admin', 'user'] } | tags=in.(admin,user) | | { q: 'search' } | q=search (no operator) | | { faculty: { name: 'CS' } } | faculty.name=eq.CS (embedded filter) | | { 'curriculums.exists': 'true' } | curriculums.exists=true (special key) |

Set defaultListOp on the config to change the implicit operator from eq to something else (e.g. 'ilike' for free-text fields).

Compound primary keys

For resources whose primary key is more than one column, register the column list when constructing the provider:

import { vulcanDataProvider, defaultPrimaryKeys } from '@aginix/vulcan-data-provider'

defaultPrimaryKeys.set('enrollments', ['student_id', 'course_id'])

const dataProvider = vulcanDataProvider({
  apiUrl: '/api',
  httpClient: fetchUtils.fetchJson,
  primaryKeys: defaultPrimaryKeys,
})

The provider then synthesizes a virtual id (a JSON-encoded array of the key parts) so react-admin's record-by-id flow keeps working transparently.

Configuration

type VulcanDataProviderConfig = {
  apiUrl: string
  httpClient: (url: string, options?: any) => Promise<{ status, headers, body, json }>
  defaultListOp?: VulcanOperator           // default: 'eq'
  sortOrder?: VulcanSortOrder              // default: ASC nullsLast / DESC nullsFirst
  primaryKeys?: Map<string, readonly string[]>  // default: ['id'] for every resource
  pageParam?: string                       // default: 'page'
  perPageParam?: string                    // default: 'perPage'
}