diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 9fc9fb2..266d96c 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -3,6 +3,8 @@ on: push: branches: - 'k8pai' + +concurrency: ${{ github.workflow }}-${{ github.ref }} jobs: changesets: runs-on: ubuntu-latest diff --git a/CHANGELOG.md b/CHANGELOG.md index 695cbc6..595395d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,25 @@ # nextauth-cli +## 0.0.6 + +### Patch Changes + +- ### Patch Changes + + - #### Updates on `svelteauth` Command + + - Added new `--dynamic` for platform based env variables. + - `src` based Template Generations for configuration files. + - Stable Prompt Support. + + - #### Updates on `solidauth` Command + + - `src` based Template Generations for configuration files. + - Stable Prompt Support. + + - #### General Updates + - Included Latest Providers and Adapters from `Authjs` + ## 0.0.5 ### Patch Changes diff --git a/package.json b/package.json index 3e7a101..0cf88f8 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { "name": "nextauth-cli", - "version": "0.0.5", + "version": "0.0.6", "description": "A nextauth cli to setup a basic application Setup running", - "exports": "./dist/index.js", + "exports": null, "bin": { "solidauth": "./dist/solid.js", "nextauth": "./dist/nextauth.js", "svelteauth": "./dist/sveltekit.js" }, "scripts": { - "build": "tsup src --format cjs,esm --minify --dts", + "build": "tsup src --format cjs,esm, --minify --dts", "link": "yarn --global unlink nextauth-cli && yarn --global link", "dev": "tsc -W" }, diff --git a/readme.md b/readme.md index c578a6a..1c4cefe 100644 --- a/readme.md +++ b/readme.md @@ -5,6 +5,10 @@ NextAuth CLI is a command-line interface tool designed to simplify the process o ## Table of Contents - [Installation](#installation) +- [Commands](#commands) + - [Next.js Specific Commands](#nextauth) + - [Sveletekit Specific Commands](#svelteauth) + - [Solid Specific Commands](#solidauth) - [Usage](#usage) - [Example](#example) - [Contributing](#contributing) @@ -18,9 +22,37 @@ To install the NextAuth CLI, you can use npm: npm i -g nextauth-cli@latest ``` +## Commands + +The CLI provides a set of commands to streamline the setup process for **NextAuth.js**, **Sveltekit** and **Solid** | **Solid-start** projects. Below are the available commands for each project type: + +### Nextauth + +1. **For Nextjs Projects** + +```bash +nextauth --router --provider --adapter --secret --env --ts +``` + +### Svelteauth + +2. **For Sveltekit Projects** + +```bash +svelteauth --provider --adapter --dynamic --secret --env --ts +``` + +### Solidauth + +3. **For Solid | Solid-start Projects** + +```bash +solidauth --provider --adapter --secret --env --ts +``` + ## Usage -The CLI provides a set of commands to streamline the setup process for NextAuth.js projects. Here are the available commands: +Efficiently set up your authentication flow with **NextAuth.js**, **Sveltekit**, or **Solid** | **Solid-start** projects using the provided CLI commands: 1. **Commands with flags.** @@ -131,26 +163,54 @@ Creates a new project with the the specified Next.js base template. Options for 2. **Commands with prompts support.** +The CLI ensures a seamless setup process by offering a prompt-based support to configure your specific project requirements. This interactive approach allows you to customize the authentication flow according to your needs effortlessly. + +## Example + +**Nextjs** + ```bash -nextauth +nextauth --router app --provider Google --adapter mongodb --env --ts --secret ``` -Initializes the NextAuth.js base template with **prompts** support. +In this example: -## Example +- `--router app`: Specifies that the project will use the Next.js router with the "**app**" type. +- `--provider Google`: Specifies that Google authentication will be used. +- `--adapter mongodb`: Specifies that the project will use MongoDB as the database adapter. +- `--env`: Indicates that an additional `.env.example` file will be generated. +- `--ts`: Specifies that the project will be configured for TypeScript. +- `--secret`: Indicates that NextAuth options will include a secret field. + +**Sveltekit** ```bash -nextauth --router app --provider Google --adapter mongodb --env --ts --secret +svelteauth --provider Google --adapter mongodb --env --ts --secret --dynamic ``` In this example: -- `--router app`: Specifies that the project will use the Next.js router with the "app" type. - `--provider Google`: Specifies that Google authentication will be used. - `--adapter mongodb`: Specifies that the project will use MongoDB as the database adapter. - `--env`: Indicates that an additional `.env.example` file will be generated. - `--ts`: Specifies that the project will be configured for TypeScript. - `--secret`: Indicates that NextAuth options will include a secret field. +- `--dynamic`: Specifies that the module provides access to runtime environment variables, as defined by the platform you're running on. + +**Solid** + +```bash +solidauth --provider Google --adapter prisma --env --ts --secret --db mongodb +``` + +In this example: + +- `--provider Google`: Specifies that Google authentication will be used. +- `--adapter prisma`: Specifies that the project will use Prisma as the database adapter. +- `--db mongodb`: Specifies that Prisma adapter uses `MongoDb` as it's database. +- `--env`: Indicates that an additional `.env.example` file will be generated. +- `--ts`: Specifies that the project will be configured for TypeScript. +- `--secret`: Indicates that NextAuth options will include a secret field. Feel free to modify the options and values based on your specific use case.