forked from binaryoverload/nuxt-sentry
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
299 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
dist | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"root": true, | ||
"extends": ["@nuxt/eslint-config"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
shamefully-hoist=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
imports.autoImport=false | ||
typescript.includeWorkspace=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,85 @@ | ||
# nuxt-sentry | ||
Nuxt 3 module for Sentry | ||
# Nuxt Sentry | ||
|
||
[![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] | ||
|
||
Nuxt 3 module for Sentry. | ||
|
||
- [✨ Release Notes](/CHANGELOG.md) | ||
<!-- - [🏀 Online playground](https://stackblitz.com/github/your-org/@falcondev-it/nuxt-sentry?file=playground%2Fapp.vue) --> | ||
<!-- - [📖 Documentation](https://example.com) --> | ||
|
||
## Features | ||
|
||
<!-- Highlight some of the features your module provide here --> | ||
- ⛰ Foo | ||
- 🚠 Bar | ||
- 🌲 Baz | ||
|
||
## Quick Setup | ||
|
||
1. Add `@falcondev-it/nuxt-sentry` dependency to your project | ||
|
||
```bash | ||
# Using pnpm | ||
pnpm add -D @falcondev-it/nuxt-sentry | ||
|
||
# Using yarn | ||
yarn add --dev @falcondev-it/nuxt-sentry | ||
|
||
# Using npm | ||
npm install --save-dev @falcondev-it/nuxt-sentry | ||
``` | ||
|
||
2. Add `@falcondev-it/nuxt-sentry` to the `modules` section of `nuxt.config.ts` | ||
|
||
```js | ||
export default defineNuxtConfig({ | ||
modules: [ | ||
'@falcondev-it/nuxt-sentry' | ||
] | ||
}) | ||
``` | ||
|
||
That's it! You can now use Nuxt Sentry in your Nuxt app ✨ | ||
|
||
## Development | ||
|
||
```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 | ||
``` | ||
|
||
<!-- Badges --> | ||
[npm-version-src]: https://img.shields.io/npm/v/@falcondev-it/nuxt-sentry/latest.svg?style=flat&colorA=18181B&colorB=28CF8D | ||
[npm-version-href]: https://npmjs.com/package/@falcondev-it/nuxt-sentry | ||
|
||
[npm-downloads-src]: https://img.shields.io/npm/dm/@falcondev-it/nuxt-sentry.svg?style=flat&colorA=18181B&colorB=28CF8D | ||
[npm-downloads-href]: https://npmjs.com/package/@falcondev-it/nuxt-sentry | ||
|
||
[license-src]: https://img.shields.io/npm/l/@falcondev-it/nuxt-sentry.svg?style=flat&colorA=18181B&colorB=28CF8D | ||
[license-href]: https://npmjs.com/package/@falcondev-it/nuxt-sentry | ||
|
||
[nuxt-src]: https://img.shields.io/badge/Nuxt-18181B?logo=nuxt.js | ||
[nuxt-href]: https://nuxt.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{ | ||
"name": "@falcondev-it/nuxt-sentry", | ||
"version": "0.1.0", | ||
"description": "Nuxt 3 module for Sentry", | ||
"repository": "https://github.com/falcondev-it/nuxt-sentry", | ||
"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", | ||
"dev": "nuxi dev playground", | ||
"dev:build": "nuxi build playground", | ||
"dev:prepare": "nuxt-module-build --stub && 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" | ||
}, | ||
"dependencies": { | ||
"@nuxt/kit": "^3.6.5" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^18.17.3", | ||
"@nuxt/devtools": "latest", | ||
"@nuxt/eslint-config": "^0.1.1", | ||
"@nuxt/module-builder": "^0.4.0", | ||
"@nuxt/schema": "^3.6.5", | ||
"@nuxt/test-utils": "^3.6.5", | ||
"changelogen": "^0.5.4", | ||
"eslint": "^8.46.0", | ||
"nuxt": "^3.6.5", | ||
"vitest": "^0.34.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<template> | ||
<div> | ||
Nuxt module playground! | ||
</div> | ||
</template> | ||
|
||
<script setup> | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export default defineNuxtConfig({ | ||
modules: ['../src/module'], | ||
myModule: {}, | ||
devtools: { enabled: true } | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"private": true, | ||
"name": "@falcondev-it/nuxt-sentry-playground", | ||
"type": "module", | ||
"scripts": { | ||
"dev": "nuxi dev", | ||
"build": "nuxi build", | ||
"generate": "nuxi generate" | ||
}, | ||
"devDependencies": { | ||
"nuxt": "latest" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": "../.nuxt/tsconfig.server.json" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": "./.nuxt/tsconfig.json" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { defineNuxtModule, addPlugin, createResolver } from "@nuxt/kit"; | ||
|
||
// Module options TypeScript interface definition | ||
export interface ModuleOptions {} | ||
|
||
export default defineNuxtModule<ModuleOptions>({ | ||
meta: { | ||
name: "@falcondev-it/nuxt-sentry", | ||
configKey: "myModule", | ||
}, | ||
// Default configuration options of the Nuxt module | ||
defaults: {}, | ||
setup(options, nuxt) { | ||
const resolver = createResolver(import.meta.url); | ||
|
||
// Do not add the extension since the `.ts` will be transpiled to `.mjs` after `npm run prepack` | ||
addPlugin(resolver.resolve("./runtime/plugin")); | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { defineNuxtPlugin } from "#app"; | ||
|
||
export default defineNuxtPlugin((nuxtApp) => { | ||
console.log("Plugin injected by @falcondev-it/nuxt-sentry!"); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { describe, it, expect } from 'vitest' | ||
import { fileURLToPath } from 'node:url' | ||
import { setup, $fetch } from '@nuxt/test-utils' | ||
|
||
describe('ssr', async () => { | ||
await setup({ | ||
rootDir: fileURLToPath(new URL('./fixtures/basic', import.meta.url)), | ||
}) | ||
|
||
it('renders the index page', async () => { | ||
// Get response to a server-rendered page with `$fetch`. | ||
const html = await $fetch('/') | ||
expect(html).toContain('<div>basic</div>') | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<template> | ||
<div>basic</div> | ||
</template> | ||
|
||
<script setup> | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import MyModule from '../../../src/module' | ||
|
||
export default defineNuxtConfig({ | ||
modules: [ | ||
MyModule | ||
] | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"private": true, | ||
"name": "basic", | ||
"type": "module" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": "./playground/.nuxt/tsconfig.json" | ||
} |