JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 67
  • Score
    100M100P100Q85087F
  • License Apache-2.0

Generates TypeScript code from RONIN models.

Package Exports

  • @ronin/codegen
  • @ronin/codegen/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@ronin/codegen) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

RONIN Codegen

tests code coverage install size

This package generates TypeScript code based on RONIN models.

Usage

import { generate } from '@ronin/codegen';
import { model, string } from 'ronin/schema';

const User = model({
  slug: 'user',
  pluralSlug: 'users',
  fields: {
    name: string(),
    email: string({ required: true }),
  },
});

const generateCode = generate([User]);
//       ^? string

Testing

Use the following command to run the test suite:

bun test