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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@lolocompany/ra-lolo-cli

v0.2.3

Published

CLI tool to build react-admin components based on json-schema

Downloads

58

Readme

ra-lolo-cli

ra-lolo-cli is a command-line tool for generating React-Admin resources dynamically based on JSON schemas. It simplifies the creation of components and views for React-Admin projects by automating the resource generation process.


Features

  • Dynamic Resource Generation: Automatically generates React-Admin fields and views based on JSON schemas.
  • Customizable Output: Generated files are clean and modular, allowing users to modify implementations manually as needed. This flexibility ensures that custom business logic can be added post-generation without restrictions.
  • Interactive CLI: Prompts for resources to be generated.

Prerequisites

Before using ra-lolo-cli, ensure the following requirements are met:

  1. Node.js: Make sure Node.js (v16 or above) is installed on your system.
  2. React-Admin Project: This CLI is designed to work with React-Admin version 5.

Installation

To install and use the CLI globally:

npm install -g @lolocompany/ra-lolo-cli

Or you can run it without installation using npx:

npx @lolocompany/ra-lolo-cli

Usage

To generate resources, run the following command in your project directory:

npx @lolocompany/ra-lolo-cli generate

The CLI will prompt you to enter the resources you want to generate. You can provide a comma-separated list of resource names (e.g., users, posts, comments).


Environment Variables

The following environment variables need to be set for ra-lolo-cli to function properly:

Required Variables

| Variable Name | Description | | -------------- | ---------------------------------------------------------------------------------------------------- | | LO_API_KEY | The LoLo API key for authentication.Documentation | | LO_API | The base URL used to create your CRUD 4 app. |

Example .env File

Create a .env file in the root directory of your project with the following content:

LO_API_KEY=your-lolo-api-key
LO_API=https://your-crud4-app-base-url

Customizable Output

Once the CLI generates the resource files, you can customize them manually to suit your specific needs. The generated code is designed to be clean and modular, making it easy to:

  • Add custom validation or formatting logic.
  • Modify input and output components for your resources.
  • Adjust layouts or data fetching methods.

This approach ensures you have full control over the implementation, allowing the generated files to serve as a starting point rather than a rigid template.


Troubleshooting

If you encounter any issues:

  • Ensure all environment variables are correctly set.
  • Verify the LoLo API key is valid and the base URL is accessible.
  • Check that you are running the CLI within a valid React-Admin project.

For additional support, feel free to open an issue on the GitHub repository.


Contribution

Contributions are welcome! If you'd like to add new features or fix bugs, please fork the repository and submit a pull request.


Happy coding! 🚀