$ show nuxt-community/sentry-module
This repository is a Nuxt.js 2 module that integrates Sentry error tracking into Nuxt applications. It provides client-side and server-side Sentry initialization, lazy loading, performance tracing, release management, and extensive integration configuration. The module hooks into Nuxt's build process via a custom shim for @nuxt/kit, generating plugin templates and configuring webpack. It supports both JavaScript and TypeScript projects, with options for custom integrations and runtime configuration. The codebase is well-structured with clear separation of concerns (module entry, hooks, options resolution, utilities, templates) and includes a comprehensive test suite using vitest and playwright. However, it is specifically designed for Nuxt 2, which is now deprecated, and the official Sentry Nuxt module is recommended for Nuxt 3+. The repository appears to be in maintenance mode with the last release in September 2024 and no recent commits.
The LLM identified 2 files worth highlighting for reuse:
This file implements a shim for @nuxt/kit to enable Nuxt 3 module patterns (defineNuxtModule, addPlugin, addTemplate, extendWebpackConfig) on Nuxt 2. It is self-contained, imports only from standard Node.js and lightweight libraries (consola, defu, hash-sum, pathe), and demonstrates deep understanding of Nuxt's internal APIs. This component could be extracted and reused by any Nuxt 2 module that wants to use the modern Nuxt 3 module API, making it a valuable reusable asset.
This file resolves client and server Sentry options, including mapping integration names to import paths, handling lazy loading and tracing configurations, and processing custom integration files. It uses jiti for dynamic imports and defu for deep merging. While somewhat coupled to Sentry-specific types, the pattern of resolving complex configuration with validation, warnings, and dynamic imports is well-crafted and could be adapted for other SDK integration modules.