Skip to content

Commit

Permalink
Updated Version, readme.md and publish workflow with concurrency rule
Browse files Browse the repository at this point in the history
  • Loading branch information
k8pai committed Sep 24, 2023
1 parent 6dc4b83 commit 4b7f012
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ on:
push:
branches:
- 'k8pai'

concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
changesets:
runs-on: ubuntu-latest
Expand Down
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -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"
},
Expand Down
72 changes: 66 additions & 6 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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 <router-type> --provider <provider> --adapter <adapter> --secret --env --ts
```

### Svelteauth

2. **For Sveltekit Projects**

```bash
svelteauth --provider <provider> --adapter <adapter> --dynamic --secret --env --ts
```

### Solidauth

3. **For Solid | Solid-start Projects**

```bash
solidauth --provider <provider> --adapter <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.**

Expand Down Expand Up @@ -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.

Expand Down

0 comments on commit 4b7f012

Please sign in to comment.