When cloning a new project from the examples dir via create-payload-app, the corresponding `.env` file is not being generated. This is because the `--example` flag does not prompt for database credentials, which ultimately skips this step. For example: ```bash npx create-payload-app --example live-preview ``` The result will include the provided `.env.example`, but lacks a `.env`. We were previously writing to the `.env.example` file, which is unexpected. We should only be writing to the `.env` file itself. To do this, we only write the `.env.example` to memory as needed, instead of the file system. This PR also simplifies the logic needed to set default vars, and improves the testing coverage overall.
Create Payload App
CLI for easily starting new Payload project
Usage
USAGE
$ npx create-payload-app
$ npx create-payload-app my-project
$ npx create-payload-app -n my-project -t website
OPTIONS
-n my-payload-app Set project name
-t template_name Choose specific template
Available templates:
blank Blank Template
website Website Template
ecommerce E-commerce Template
plugin Template for creating a Payload plugin
payload-demo Payload demo site at https://demo.payloadcms.com
payload-website Payload website CMS at https://payloadcms.com
--use-npm Use npm to install dependencies
--use-yarn Use yarn to install dependencies
--use-pnpm Use pnpm to install dependencies
--no-deps Do not install any dependencies
-h Show help