Skip to content

Commit

Permalink
chore: initialize
Browse files Browse the repository at this point in the history
  • Loading branch information
nhedger committed Nov 14, 2023
0 parents commit dfb3fd0
Show file tree
Hide file tree
Showing 18 changed files with 6,450 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 = 4
indent_style = tab
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
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
85 changes: 85 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Nuxt Inngest

[![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]

[Inngest](https://inngest.com) integration for [Nuxt](https://nuxt.com).

- [✨ Release Notes](/CHANGELOG.md)

## Quick Setup

1. Add `nuxt-inngest` dependency to your project

```bash
# Using npm
npm install --save-dev nuxt-inngest

# Using pnpm
pnpm add -D nuxt-inngest

# Using yarn
yarn add --dev nuxt-inngest

# Using bun
bun add --D nuxt-inngest
```

2. Add `nuxt-inngest` to the `modules` section of `nuxt.config.ts`

```js
export default defineNuxtConfig({
modules: [
'nuxt-inngest'
]
})
```

Add the following configuration to your `.env` file replacing the value in `< >` with your Inngest API key.

```ini
NUXT_INNGEST_EVENT_KEY="<your_inngest_event_key>"
```

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

## Development

```bash
# Install dependencies
pnpm install

# Generate type stubs
pnpm run dev:prepare

# Develop with the playground
pnpm run dev

# Build the playground
pnpm run dev:build

# Run checks
pnpm run check

# Run Vitest
pnpm run test
pnpm run test:watch

# Release new version
pnpm run release
```

<!-- Badges -->
[npm-version-src]: https://img.shields.io/npm/v/nuxt-inngest/latest.svg?style=flat&colorA=18181B&colorB=28CF8D
[npm-version-href]: https://npmjs.com/package/nuxt-inngest

[npm-downloads-src]: https://img.shields.io/npm/dm/nuxt-inngest.svg?style=flat&colorA=18181B&colorB=28CF8D
[npm-downloads-href]: https://npmjs.com/package/nuxt-inngest

[license-src]: https://img.shields.io/npm/l/nuxt-inngest.svg?style=flat&colorA=18181B&colorB=28CF8D
[license-href]: https://npmjs.com/package/nuxt-inngest

[nuxt-src]: https://img.shields.io/badge/Nuxt-18181B?logo=nuxt.js
[nuxt-href]: https://nuxt.com
15 changes: 15 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"$schema": "https://biomejs.dev/schemas/1.3.3/schema.json",
"files": {
"ignore": [".nuxt", "node_modules", "dist"]
},
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
}
}
42 changes: 42 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"name": "nuxt-inngest",
"version": "0.0.0",
"description": "Inngest integration for Nuxt",
"repository": "nhedger/nuxt-inngest",
"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 prepare && 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": "pnpm run check && pnpm run prepack && changelogen --release && pnpm publish && git push --follow-tags",
"check": "biome check --apply ."
},
"dependencies": {
"@nuxt/kit": "^3.8.1",
"defu": "^6.1.3",
"inngest": "^3.6.0"
},
"devDependencies": {
"@biomejs/biome": "^1.3.3",
"@nuxt/devtools": "latest",
"@nuxt/module-builder": "^0.5.3",
"@nuxt/schema": "^3.8.1",
"@types/node": "^20.8.10",
"changelogen": "^0.5.5",
"nuxt": "^3.8.1"
}
}
1 change: 1 addition & 0 deletions playground/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
NUXT_inngest_API_KEY=
8 changes: 8 additions & 0 deletions playground/app.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<template>
<div>
Nuxt module playground!
</div>
</template>

<script setup>
</script>
7 changes: 7 additions & 0 deletions playground/nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default defineNuxtConfig({
modules: ["../src/module"],
inngest: {
apiKey: "YOUR_API_KEY",
},
devtools: { enabled: true },
});
13 changes: 13 additions & 0 deletions playground/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"private": true,
"name": "nuxt-inngest-playground",
"type": "module",
"scripts": {
"dev": "nuxi dev",
"build": "nuxi build",
"generate": "nuxi generate"
},
"devDependencies": {
"nuxt": "latest"
}
}
12 changes: 12 additions & 0 deletions playground/server/api/send.get.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export default defineEventHandler(async () => {
const { emails } = useinngest();

const result = await emails.send({
from: "Nicolas Hedger <nicolas@hedger.ch>",
to: ["nicolas@hedger.ch"],
subject: "Hello from Nuxt inngest",
text: "Hello world!",
});

console.log(result);
});
3 changes: 3 additions & 0 deletions playground/server/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "../.nuxt/tsconfig.server.json"
}
3 changes: 3 additions & 0 deletions playground/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "./.nuxt/tsconfig.json"
}
Loading

0 comments on commit dfb3fd0

Please sign in to comment.