Tag: npm

  • pocketbase-schema

    Type-safe PocketBase development — automatically.

    pocketbase-schema is a utility that generates TypeScript types from your PocketBase collections. It’s built for developers who want safety, clarity, and DX improvements when building apps on top of PocketBase.


    Features

    • Automatic Type Generation: Pull your PocketBase schema and generate complete TypeScript definitions for collections and records.
    • Collections Enum: Access collection names as constants instead of raw strings.
    • Field Type Enums: Automatically generate enums for select field options.
    • Flexible CLI & API: Run it as a script or import it into your toolchain. It supports both approaches cleanly.
    • Local-First Config: Uses cosmiconfig so you can configure it with pocketbase-schema.config.js, package.json, or a custom location.

    Installation

    npm install @sparkstone/pocketbase-schema --save-dev

    or

    pnpm add @sparkstone/pocketbase-schema --save-dev

    Usage

    Once installed, run the CLI to generate types from your schema export:

    pocketbase-schema generate --input=pb_schema.json --output=src/lib/pb-types.ts

    You can also run it programmatically in a Node script:

    import { generate } from '@sparkstone/pocketbase-schema';
    
    generate({
      input: './pb_schema.json',
      output: './src/lib/pb-types.ts',
    });
    

    “We built pocketbase-schema because we love PocketBase — and we wanted full type safety without manual copy-pasting.”
    — The Sparkstone Team

    View source

  • version-json

    Effortless versioning for your JSON payloads.

    version-json is a lightweight utility designed to help developers manage and upgrade long-lived JSON data structures seamlessly. By defining transformation functions for each version, it ensures your data remains consistent and up-to-date across different versions.


    What It Does

    • Version-Aware Transformations: Define a series of transformations that upgrade your JSON payloads from one version to the next, ensuring compatibility and consistency.
    • Flexible Version Detection: Utilize a specific version field or implement a custom function to determine the version of your data, providing adaptability to various data structures.
    • Simple Integration: With an intuitive API, integrating version-json into your project is straightforward, allowing you to focus on building features rather than handling data migrations.

    “We created version-json to simplify the process of managing evolving JSON data structures, making data migrations effortless and reliable.”
    — The Sparkstone Team

    View source

  • solid-validation

    solid-validation

    Lightweight, flexible form validation for Solid.js.

    solid-validation is a validation library built for Solid.js. It offers a clean, reactive API for handling form input validation, submission state, and error messaging — with support for custom logic and backend integration. It’s fast, ergonomic, and integrates seamlessly with real-world workflows.


    Installation

    npm install @sparkstone/solid-validation

    or

    pnpm add @sparkstone/solid-validation

    Features

    • Simple form handling: Hook into form submission and manage input-level and global errors with built-in helpers.
    • Reactive state: Track isSubmitting, isSubmitted, and live validation errors as part of your UI.
    • Custom validators: Use your own validation functions alongside native input validation.
    • PocketBase support: Includes helpers to integrate with PocketBase forms and handle server-side validation errors cleanly.

    “We made solid-validation to give Solid.js devs a simple, ergonomic way to handle forms — no dependencies, no fuss.”
    — The Sparkstone Team


    View source

  • Dawei

    Minimal, flexible state management for React.

    dawei is a tiny but powerful state management library for React. Inspired by Zustand and Recoil, it offers a simple API that works without context — with support for deeply nested values, subscriptions, and scoped stores. It’s built for projects that want fine-grained control without boilerplate.


    Features

    • Minimal API: No providers, no reducers, no boilerplate. Just a clean createStore() and store.use() pattern.
    • Deep State Access: Subscribe to and modify deeply nested keys like 'company.name' — even if they don’t exist yet.
    • Global Reactivity: All components stay in sync with the store automatically. No selectors or memo worries.
    • Direct Control: Update the store from anywhere in your app with store.set() or listen for changes with store.subscribe().

    Installation

    npm install dawei

    or

    yarn add dawei

    Usage Example

    import { createStore } from 'dawei';
    
    const formStore = createStore({});
    
    const Input = () => {
      const [name, setName] = formStore.use('name');
      const [email, setEmail] = formStore.use('email');
      const [companyName, setCompanyName] = formStore.use('company.name');
    
      return (
        
           setName(e.target.value)} />
           setEmail(e.target.value)} />
           setCompanyName(e.target.value)} />
        
      );
    };
    
    function randomBitOfApi() {
      formStore.set({ saved: true });
    }
    
    let unsubscribe = formStore.subscribe(state => {
      console.log('formStore changed', state);
    });
        

    “Dawei gives us the store behavior we want — without the noise.”
    — The Sparkstone Team

    View source