Skip to content

Commit

Permalink
feat: initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
joshdonnell committed Aug 4, 2024
0 parents commit b24ac0f
Show file tree
Hide file tree
Showing 32 changed files with 9,287 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
indent_size = 2
indent_style = space
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
45 changes: 45 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: ci

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 20

- name: Install dependencies
run: npx nypm@latest i

- name: Lint
run: npm run lint

test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 20

- name: Install dependencies
run: npx nypm@latest i

- name: Playground prepare
run: npm run dev:prepare

- name: Test
run: npm run test
56 changes: 56 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Dependencies
node_modules

# Logs
*.log*

# Temp directories
.temp
.tmp
.cache

# Yarn
**/.yarn/cache
**/.yarn/*state*

# Generated dirs
dist

# Nuxt
.nuxt
.output
.data
.vercel_build_output
.build-*
.netlify

# Env
.env

# Testing
reports
coverage
*.lcov
.nyc_output

# VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets

# Intellij idea
*.iml
.idea

# OSX
.DS_Store
.AppleDouble
.LSOverride
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
shamefully-hoist=true
strict-peer-dependencies=false
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"eslint.experimental.useFlatConfig": true
}
85 changes: 85 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Changelog


## v0.0.2

[compare changes](https://github.com/JoshDonnell/nuxt-auth-laravel/compare/v0.0.2...v0.0.2)

### 🩹 Fixes

- Version ([f79d7a5](https://github.com/JoshDonnell/nuxt-auth-laravel/commit/f79d7a5))

### ❤️ Contributors

- Josh Donnell <[email protected]>

## v0.0.2


### 🚀 Enhancements

- Init commit ([a8801da](https://github.com/JoshDonnell/nuxt-auth-laravel/commit/a8801da))

### 🩹 Fixes

- Update package name ([1311257](https://github.com/JoshDonnell/nuxt-auth-laravel/commit/1311257))
- Readme paths ([4679de1](https://github.com/JoshDonnell/nuxt-auth-laravel/commit/4679de1))
- Add export import for laravel auth ([ba0cd67](https://github.com/JoshDonnell/nuxt-auth-laravel/commit/ba0cd67))
- Type issue wth AsyncDataExecuteOptions ([357e4bc](https://github.com/JoshDonnell/nuxt-auth-laravel/commit/357e4bc))

### 🏡 Chore

- **release:** V0.0.2 ([6276bde](https://github.com/JoshDonnell/nuxt-auth-laravel/commit/6276bde))
- **release:** V0.0.3 ([1c4878f](https://github.com/JoshDonnell/nuxt-auth-laravel/commit/1c4878f))
- **release:** V0.0.2 ([9144f1d](https://github.com/JoshDonnell/nuxt-auth-laravel/commit/9144f1d))
- **release:** V0.0.3 ([c92d034](https://github.com/JoshDonnell/nuxt-auth-laravel/commit/c92d034))

### ❤️ Contributors

- Josh Donnell <[email protected]>

## v0.0.3

[compare changes](https://github.com/JoshDonnell/nuxt-auth-laravel/compare/v0.0.3...v0.0.3)

### 🩹 Fixes

- Update package name ([1311257](https://github.com/JoshDonnell/nuxt-auth-laravel/commit/1311257))
- Readme paths ([4679de1](https://github.com/JoshDonnell/nuxt-auth-laravel/commit/4679de1))
- Add export import for laravel auth ([ba0cd67](https://github.com/JoshDonnell/nuxt-auth-laravel/commit/ba0cd67))

### 🏡 Chore

- **release:** V0.0.2 ([9144f1d](https://github.com/JoshDonnell/nuxt-auth-laravel/commit/9144f1d))

### ❤️ Contributors

- Josh Donnell <[email protected]>

## v0.0.2

[compare changes](https://github.com/JoshDonnell/nuxt-auth-laravel/compare/v0.0.3...v0.0.2)

### 🩹 Fixes

- Update package name ([1311257](https://github.com/JoshDonnell/nuxt-auth-laravel/commit/1311257))

### ❤️ Contributors

- Josh Donnell <[email protected]>

## v0.0.3

[compare changes](https://github.com/your-org/my-module/compare/v0.0.2...v0.0.3)

## v0.0.2


### 🚀 Enhancements

- Init commit ([a8801da](https://github.com/your-org/my-module/commit/a8801da))

### ❤️ Contributors

- Josh Donnell <[email protected]>

103 changes: 103 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
<!--
Get your module up and running quickly.
Find and replace all on all files (CMD+SHIFT+F):
- Name: Nuxt Laravel Auth
- Package name: nuxt-auth-laravel
- Description: My new Nuxt module
-->

# Nuxt Laravel Auth

[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![License][license-src]][license-href]
[![Nuxt][nuxt-src]][nuxt-href]

A Nuxt module is used to manage authentication and data from Laravel. Features include full sanctum and passport support with support for separate auth and data apps which can be used when running a separate SSO application.

- [&nbsp;Release Notes](/CHANGELOG.md)
<!-- - [🏀 Online playground](https://stackblitz.com/github/your-org/nuxt-auth-laravel?file=playground%2Fapp.vue) -->
<!-- - [📖 &nbsp;Documentation](https://example.com) -->

## Features

<!-- Highlight some of the features your module provide here -->

- Sanctum Auth support
- Socialite Social Auth support
- Supports seperate data and SSO apps
- Included pagination handler
- Laravel Error Handler
- SSR support
- Full Typescript support

## Quick Setup

1. Install the module to your Nuxt application with one command:

```bash
npx nuxi module add auth-laravel
```

2.Add variables to .env or nuxt.config

```bash
.env
LARAVEL_BASE_URL='http://localhost:8000'

nuxt.config.ts
laravel {
baseUrl: 'http://localhost:8000'
}
```

That's it! You can now use Nuxt Laravel Auth in your Nuxt app ✨

See below for a full list of config setting that are acepted by Nuxt Laravel auth

## Coming Soon

A full feature guide and docs are coming very soon...

## Contribution

<details>
<summary>Local development</summary>

```bash
# Install dependencies
npm install

# Generate type stubs
npm run dev:prepare

# Develop with the playground
npm run dev

# Build the playground
npm run dev:build

# Run ESLint
npm run lint

# Run Vitest
npm run test
npm run test:watch

# Release new version
npm run release
```

</details>

<!-- Badges -->

[npm-version-src]: https://img.shields.io/npm/v/nuxt-auth-laravel/latest.svg?style=flat&colorA=020420&colorB=00DC82
[npm-version-href]: https://npmjs.com/package/nuxt-auth-laravel
[npm-downloads-src]: https://img.shields.io/npm/dm/nuxt-auth-laravel.svg?style=flat&colorA=020420&colorB=00DC82
[npm-downloads-href]: https://npmjs.com/package/nuxt-auth-laravel
[license-src]: https://img.shields.io/npm/l/nuxt-auth-laravel.svg?style=flat&colorA=020420&colorB=00DC82
[license-href]: https://npmjs.com/package/nuxt-auth-laravel
[nuxt-src]: https://img.shields.io/badge/Nuxt-020420?logo=nuxt.js
[nuxt-href]: https://nuxt.com
23 changes: 23 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// @ts-check
import { createConfigForNuxt } from '@nuxt/eslint-config/flat'

// Run `npx @eslint/config-inspector` to inspect the resolved config interactively
export default createConfigForNuxt({
features: {
// Rules for module authors
tooling: true,
// Rules for formatting
stylistic: false,
},
dirs: {
src: ['./playground'],
},
}).append(
// your custom flat config here...
{
rules: {
'vue/html-self-closing': 'off',
'vue/multi-word-component-names': 0,
},
}
)
49 changes: 49 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"name": "nuxt-auth-laravel",
"version": "0.0.1",
"description": "A Nuxt module is used to manage authentication and data from Laravel. Features include full sanctum and passport support with support for separate auth and data apps which can be used when running a separate SSO application.",
"repository": "JoshDonnell/nuxt-auth-laravel",
"license": "MIT",
"type": "module",
"exports": {
".": {
"types": "./dist/types.d.ts",
"import": "./dist/module.mjs",
"require": "./dist/module.cjs"
}
},
"main": "./dist/module.cjs",
"types": "./dist/types.d.ts",
"files": [
"dist"
],
"scripts": {
"prepack": "nuxt-module-build build",
"dev": "nuxi dev playground",
"dev:build": "nuxi build playground",
"dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground",
"release": "npm run lint && npm run test && npm run prepack && changelogen --release && npm publish && git push --follow-tags",
"lint": "eslint .",
"test": "vitest run",
"test:watch": "vitest watch",
"test:types": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit"
},
"dependencies": {
"@nuxt/kit": "^3.12.4",
"defu": "^6.1.4"
},
"devDependencies": {
"@nuxt/devtools": "^1.3.9",
"@nuxt/eslint-config": "^0.4.0",
"@nuxt/module-builder": "^0.8.1",
"@nuxt/schema": "^3.12.4",
"@nuxt/test-utils": "^3.14.0",
"@types/node": "^22.0.2",
"changelogen": "^0.5.5",
"eslint": "^9.8.0",
"nuxt": "^3.12.4",
"typescript": "latest",
"vitest": "^2.0.5",
"vue-tsc": "^2.0.29"
}
}
5 changes: 5 additions & 0 deletions playground/app/app.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<template>
<div>
<NuxtPage />
</div>
</template>
Loading

0 comments on commit b24ac0f

Please sign in to comment.