nicoalbanese / kirimase

Build full-stack Next.js apps, incredibly fast
https://kirimase.dev
MIT License
2.37k stars 107 forks source link

Add templates for Data table and columns #148

Open afogel opened 4 months ago

afogel commented 4 months ago

This PR is the first of a few to incorporate a data table for the index page when generating a new resource using kirimase.

It incorporates the Eta templating package in order to generate views and components. Additionally, it incorporates the tanstack react-table library, as per Shadcn's recommendations. I purposefully kept the table relatively barebones in this first attempt. It includes pagination and column hiding, alone.

I have a few outstanding questions re: incremental improvements, but I figure that smaller PRs that are easier to review are better than mammoth new PRs.

To test, generate a new next project: bun run reinstall && bun run createTesterApp

cd into the tester dir. then, generate a new resource using kirimase: kirimase g

follow the instructions. When you hit the index page for the newly created resource, you should see a table under the list of actions.

This should work when you generate a new project both with server actions as well as trpc.

Screenshots

Screenshot 2024-02-27 at 18 18 57 Screenshot 2024-02-27 at 18 18 48