@safeki/nuxt 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,84 @@
1
+ <!--
2
+ Get your module up and running quickly.
3
+
4
+ Find and replace all on all files (CMD+SHIFT+F):
5
+ - Name: My Module
6
+ - Package name: @safeki/nuxt
7
+ - Description: My new Nuxt module
8
+ -->
9
+
10
+ # My Module
11
+
12
+ [![npm version][npm-version-src]][npm-version-href]
13
+ [![npm downloads][npm-downloads-src]][npm-downloads-href]
14
+ [![License][license-src]][license-href]
15
+ [![Nuxt][nuxt-src]][nuxt-href]
16
+
17
+ My new Nuxt module for doing amazing things.
18
+
19
+ - [✨ &nbsp;Release Notes](/CHANGELOG.md)
20
+ <!-- - [🏀 Online playground](https://stackblitz.com/github/your-org/@safeki/nuxt?file=playground%2Fapp.vue) -->
21
+ <!-- - [📖 &nbsp;Documentation](https://example.com) -->
22
+
23
+ ## Features
24
+
25
+ <!-- Highlight some of the features your module provide here -->
26
+ - ⛰ &nbsp;Foo
27
+ - 🚠 &nbsp;Bar
28
+ - 🌲 &nbsp;Baz
29
+
30
+ ## Quick Setup
31
+
32
+ Install the module to your Nuxt application with one command:
33
+
34
+ ```bash
35
+ npx nuxt module add @safeki/nuxt
36
+ ```
37
+
38
+ That's it! You can now use My Module in your Nuxt app ✨
39
+
40
+
41
+ ## Contribution
42
+
43
+ <details>
44
+ <summary>Local development</summary>
45
+
46
+ ```bash
47
+ # Install dependencies
48
+ npm install
49
+
50
+ # Generate type stubs
51
+ npm run dev:prepare
52
+
53
+ # Develop with the playground
54
+ npm run dev
55
+
56
+ # Build the playground
57
+ npm run dev:build
58
+
59
+ # Run ESLint
60
+ npm run lint
61
+
62
+ # Run Vitest
63
+ npm run test
64
+ npm run test:watch
65
+
66
+ # Release new version
67
+ npm run release
68
+ ```
69
+
70
+ </details>
71
+
72
+
73
+ <!-- Badges -->
74
+ [npm-version-src]: https://img.shields.io/npm/v/@safeki/nuxt/latest.svg?style=flat&colorA=020420&colorB=00DC82
75
+ [npm-version-href]: https://npmjs.com/package/@safeki/nuxt
76
+
77
+ [npm-downloads-src]: https://img.shields.io/npm/dm/@safeki/nuxt.svg?style=flat&colorA=020420&colorB=00DC82
78
+ [npm-downloads-href]: https://npm.chart.dev/@safeki/nuxt
79
+
80
+ [license-src]: https://img.shields.io/npm/l/@safeki/nuxt.svg?style=flat&colorA=020420&colorB=00DC82
81
+ [license-href]: https://npmjs.com/package/@safeki/nuxt
82
+
83
+ [nuxt-src]: https://img.shields.io/badge/Nuxt-020420?logo=nuxt
84
+ [nuxt-href]: https://nuxt.com
@@ -0,0 +1,23 @@
1
+ import * as _nuxt_schema from '@nuxt/schema';
2
+ import { ModuleOptions as ModuleOptions$1 } from '@sentry/nuxt/module';
3
+
4
+ interface SafekitSentryClientOptions {
5
+ dsn?: string;
6
+ environment?: string;
7
+ release?: string;
8
+ debug?: boolean;
9
+ sendDefaultPii?: boolean;
10
+ tracesSampleRate?: number;
11
+ replaysSessionSampleRate?: number;
12
+ replaysOnErrorSampleRate?: number;
13
+ tracePropagationTargets?: string[];
14
+ }
15
+ interface ModuleOptions {
16
+ sentry?: ModuleOptions$1 & {
17
+ client?: SafekitSentryClientOptions;
18
+ };
19
+ }
20
+ declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
21
+
22
+ export { _default as default };
23
+ export type { ModuleOptions, SafekitSentryClientOptions };
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "@safeki/nuxt",
3
+ "configKey": "nuxtSafekit",
4
+ "version": "0.1.1",
5
+ "builder": {
6
+ "@nuxt/module-builder": "1.0.2",
7
+ "unbuild": "3.6.1"
8
+ }
9
+ }
@@ -0,0 +1,27 @@
1
+ import { defineNuxtModule, createResolver, installModule } from '@nuxt/kit';
2
+
3
+ const module$1 = defineNuxtModule({
4
+ meta: {
5
+ name: "@safeki/nuxt",
6
+ configKey: "nuxtSafekit"
7
+ },
8
+ // Default configuration options of the Nuxt module
9
+ defaults: {},
10
+ async setup(options, nuxt) {
11
+ const resolver = createResolver(import.meta.url);
12
+ const { client = {}, ...sentryModuleOptions } = options.sentry || {};
13
+ nuxt.options.runtimeConfig.public.nuxtSafekit = {
14
+ ...nuxt.options.runtimeConfig.public.nuxtSafekit || {},
15
+ sentry: {
16
+ client
17
+ }
18
+ };
19
+ await installModule("@sentry/nuxt/module", {
20
+ autoInjectServerSentry: "top-level-import",
21
+ configDir: resolver.resolve("./runtime"),
22
+ ...sentryModuleOptions
23
+ });
24
+ }
25
+ });
26
+
27
+ export { module$1 as default };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,33 @@
1
+ import { useRuntimeConfig } from "#imports";
2
+ import * as Sentry from "@sentry/nuxt";
3
+ const {
4
+ dsn,
5
+ environment,
6
+ release,
7
+ debug,
8
+ sendDefaultPii,
9
+ tracesSampleRate,
10
+ replaysSessionSampleRate,
11
+ replaysOnErrorSampleRate,
12
+ tracePropagationTargets
13
+ } = useRuntimeConfig().public.nuxtSafekit.sentry.client;
14
+ if (dsn) {
15
+ Sentry.init({
16
+ dsn,
17
+ environment,
18
+ release,
19
+ debug,
20
+ sendDefaultPii,
21
+ tracesSampleRate,
22
+ tracePropagationTargets,
23
+ integrations: [
24
+ Sentry.replayIntegration({
25
+ maskAllText: true,
26
+ maskAllInputs: true,
27
+ blockAllMedia: true
28
+ })
29
+ ],
30
+ replaysSessionSampleRate,
31
+ replaysOnErrorSampleRate
32
+ });
33
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,12 @@
1
+ import * as Sentry from "@sentry/nuxt";
2
+ const dsn = process.env.SENTRY_DSN;
3
+ if (dsn) {
4
+ Sentry.init({
5
+ dsn,
6
+ environment: process.env.SENTRY_ENVIRONMENT,
7
+ release: process.env.SENTRY_RELEASE,
8
+ debug: process.env.SENTRY_DEBUG === "true",
9
+ sendDefaultPii: process.env.SENTRY_SEND_DEFAULT_PII === "true",
10
+ tracesSampleRate: process.env.SENTRY_TRACES_SAMPLE_RATE ? Number(process.env.SENTRY_TRACES_SAMPLE_RATE) : void 0
11
+ });
12
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "extends": "../../../.nuxt/tsconfig.server.json",
3
+ }
@@ -0,0 +1,3 @@
1
+ export { default } from './module.mjs'
2
+
3
+ export { type ModuleOptions, type SafekitSentryClientOptions } from './module.mjs'
package/package.json ADDED
@@ -0,0 +1,58 @@
1
+ {
2
+ "name": "@safeki/nuxt",
3
+ "version": "0.1.1",
4
+ "description": "My new Nuxt module",
5
+ "repository": "your-org/@safeki/nuxt",
6
+ "license": "MIT",
7
+ "type": "module",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/types.d.mts",
11
+ "import": "./dist/module.mjs"
12
+ }
13
+ },
14
+ "main": "./dist/module.mjs",
15
+ "typesVersions": {
16
+ "*": {
17
+ ".": [
18
+ "./dist/types.d.mts"
19
+ ]
20
+ }
21
+ },
22
+ "files": [
23
+ "dist"
24
+ ],
25
+ "workspaces": [
26
+ "playground"
27
+ ],
28
+ "scripts": {
29
+ "prepack": "nuxt-module-build build",
30
+ "dev": "npm run dev:prepare && nuxt dev playground",
31
+ "dev:build": "nuxt build playground",
32
+ "dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxt prepare playground",
33
+ "release": "npm run lint && npm run test && npm run prepack && changelogen --release && npm publish && git push --follow-tags",
34
+ "lint": "eslint .",
35
+ "lint:fix": "eslint . --fix",
36
+ "test": "vitest run",
37
+ "test:watch": "vitest watch",
38
+ "test:types": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit"
39
+ },
40
+ "dependencies": {
41
+ "@nuxt/kit": "^4.4.7",
42
+ "@sentry/nuxt": "^10.56.0"
43
+ },
44
+ "devDependencies": {
45
+ "@nuxt/devtools": "^3.2.4",
46
+ "@nuxt/eslint-config": "^1.15.2",
47
+ "@nuxt/module-builder": "^1.0.2",
48
+ "@nuxt/schema": "^4.4.7",
49
+ "@nuxt/test-utils": "^4.0.3",
50
+ "@types/node": "latest",
51
+ "changelogen": "^0.6.2",
52
+ "eslint": "^10.4.1",
53
+ "nuxt": "^4.4.6",
54
+ "typescript": "~6.0.3",
55
+ "vitest": "^4.1.8",
56
+ "vue-tsc": "^3.3.3"
57
+ }
58
+ }