jstack icon indicating copy to clipboard operation
jstack copied to clipboard

feat(cli): prisma template

Open jcodog opened this issue 1 month ago • 0 comments

This pull request adds Prisma ORM support to the CLI, alongside Drizzle, and introduces several improvements to dependency management and project scaffolding. The most significant changes are the addition of a Prisma installer, updates to prompts and types to support Prisma, and the use of wildcard dependency versions for greater flexibility. The PR also improves the developer experience by automatically initializing a git repository for new projects.

Prisma ORM Integration:

  • Added Prisma as a supported ORM in the CLI prompts, types, and installer map, allowing users to select Prisma during project setup. (cli/src/cli/index.ts [1] [2] [3] cli/src/installers/index.ts [4] [5]
  • Implemented a prismaInstaller that sets up all required Prisma dependencies, copies configuration and helper files, adds JStack middleware, and updates package.json scripts for Prisma workflows. (cli/src/installers/prisma.ts cli/src/installers/prisma.tsR1-R64)

Dependency Management Improvements:

  • Changed all dependency versions in both the CLI's dependency map and the base project templates to use wildcards (*), ensuring the latest versions are always installed. (cli/src/installers/dep-version-map.ts [1] cli/template/base-assets/base-package.json [2]
  • Added new dependencies to support Prisma and CLI enhancements, such as picocolors and execa. (cli/package.json [1] cli/src/helpers/install-base-template.ts [2]

Project Scaffolding Enhancements:

  • The CLI now automatically initializes a git repository and makes an initial commit after scaffolding a new project, streamlining the setup process for users. (cli/src/helpers/install-base-template.ts cli/src/helpers/install-base-template.tsR107-R115)
  • Added a default wrangler.json configuration to the base template to facilitate Cloudflare Workers compatibility. (cli/template/base/wrangler.json cli/template/base/wrangler.jsonR1-R30)

These changes provide a more flexible and modern developer experience, making it easier to start projects with either Drizzle or Prisma ORM and ensuring up-to-date dependencies by default.

jcodog avatar Oct 29 '25 13:10 jcodog