@sentry/junior 0.10.3 → 0.11.0

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 CHANGED
@@ -1,37 +1,39 @@
1
1
  # @sentry/junior
2
2
 
3
- `@sentry/junior` is a Slack bot package for Next.js apps.
3
+ `@sentry/junior` is a Slack bot package built on [Hono](https://hono.dev/).
4
4
 
5
5
  ## Install
6
6
 
7
7
  ```bash
8
- pnpm add @sentry/junior
9
- pnpm add next react react-dom @sentry/nextjs
8
+ pnpm add @sentry/junior hono @sentry/node
10
9
  ```
11
10
 
12
11
  ## Quick usage
13
12
 
14
- `app/api/[...path]/route.js`:
13
+ `server.ts`:
15
14
 
16
- ```js
17
- export { GET, POST } from "@sentry/junior/handler";
18
- export const runtime = "nodejs";
15
+ ```ts
16
+ import { initSentry } from "@sentry/junior/instrumentation";
17
+ initSentry();
18
+
19
+ import { createApp } from "@sentry/junior";
20
+
21
+ const app = await createApp();
22
+
23
+ export default app;
19
24
  ```
20
25
 
21
- `next.config.mjs`:
26
+ `nitro.config.ts`:
22
27
 
23
- ```js
24
- import { withJunior } from "@sentry/junior/config";
28
+ ```ts
29
+ import { juniorNitroConfig } from "@sentry/junior/nitro";
30
+ import { defineConfig } from "nitro";
25
31
 
26
- export default withJunior({
27
- pluginPackages: [
28
- "@sentry/junior-github",
29
- "@sentry/junior-notion",
30
- "@sentry/junior-sentry",
31
- ],
32
- });
32
+ export default defineConfig(juniorNitroConfig());
33
33
  ```
34
34
 
35
+ Installed `@sentry/junior-*` plugin packages are discovered automatically. Use `createApp({ pluginPackages: [...] })` only when you need to restrict discovery to a specific allowlist.
36
+
35
37
  ## Full docs
36
38
 
37
39
  Canonical docs: **https://junior.sentry.dev/**
package/dist/app.d.ts ADDED
@@ -0,0 +1,13 @@
1
+ import { Hono } from 'hono';
2
+
3
+ /** Callback to schedule background work that must finish before the function exits. */
4
+ type WaitUntilFn = (task: Promise<unknown> | (() => Promise<unknown>)) => void;
5
+
6
+ interface JuniorAppOptions {
7
+ pluginPackages?: string[];
8
+ waitUntil?: WaitUntilFn;
9
+ }
10
+ /** Create a Hono app with all Junior routes mounted under `/api`. */
11
+ declare function createApp(options?: JuniorAppOptions): Promise<Hono>;
12
+
13
+ export { type JuniorAppOptions, createApp };