Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions apps/example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,5 @@ Copy `.env.example` and set:

## Wiring

- `server.ts` creates the Hono app via `createApp()` and passes the installed plugin package list explicitly
- the example app declares which installed plugin packages should be available at runtime via `pluginPackages`
- `nitro.config.ts` uses `juniorNitro()` so the build copies `app/**/*` plus installed plugin package manifests and skills into `.vercel/output/functions/__server.func`
- `nitro.config.ts` declares `pluginPackages` in `juniorNitro()` — this both copies plugin content at build time and makes the list available to `createApp()` at runtime via a virtual module
- `server.ts` creates the Hono app via `createApp()` — plugin packages are resolved automatically from the build config
241 changes: 0 additions & 241 deletions apps/example/index.html

This file was deleted.

1 change: 1 addition & 0 deletions apps/example/nitro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export default defineConfig({
"@sentry/junior-notion",
"@sentry/junior-sentry",
],
includeFiles: ["node_modules/@mariozechner/pi-ai/dist/providers/*.js"],
}),
],
routes: {
Expand Down
1 change: 1 addition & 0 deletions apps/example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
},
"devDependencies": {
"@types/node": "^25.5.0",
"jiti": "^2.6.1",
"nitro": "3.0.260311-beta",
"typescript": "^5.9.3"
}
Expand Down
9 changes: 1 addition & 8 deletions apps/example/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@ import { initSentry } from "@sentry/junior/instrumentation";

initSentry();

const app = await createApp({
pluginPackages: [
"@sentry/junior-agent-browser",
"@sentry/junior-github",
"@sentry/junior-notion",
"@sentry/junior-sentry",
],
});
const app = await createApp();

export default app;
8 changes: 3 additions & 5 deletions packages/docs/src/content/docs/extend/_plugin-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,12 @@ pnpm add @sentry/junior @sentry/junior-example

## Runtime setup

List the plugin in `createApp({ pluginPackages: [...] })`:
List the plugin in `juniorNitro({ pluginPackages: [...] })`:

```ts title="api/index.ts"
const app = await createApp({
```ts title="nitro.config.ts"
juniorNitro({
pluginPackages: ["@sentry/junior-example"],
});

export default handle(app);
```

## Configure environment variables
Expand Down
8 changes: 3 additions & 5 deletions packages/docs/src/content/docs/extend/agent-browser-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,12 @@ pnpm add @sentry/junior @sentry/junior-agent-browser

## Runtime setup

List the plugin in `createApp({ pluginPackages: [...] })`:
List the plugin in `juniorNitro({ pluginPackages: [...] })`:

```ts title="api/index.ts"
const app = await createApp({
```ts title="nitro.config.ts"
juniorNitro({
pluginPackages: ["@sentry/junior-agent-browser"],
});

export default handle(app);
```

## Configure environment variables
Expand Down
8 changes: 3 additions & 5 deletions packages/docs/src/content/docs/extend/github-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,12 @@ pnpm add @sentry/junior @sentry/junior-github

## Runtime setup

List the plugin in `createApp({ pluginPackages: [...] })`:
List the plugin in `juniorNitro({ pluginPackages: [...] })`:

```ts title="api/index.ts"
const app = await createApp({
```ts title="nitro.config.ts"
juniorNitro({
pluginPackages: ["@sentry/junior-github"],
});

export default handle(app);
```

## Configure environment variables
Expand Down
37 changes: 20 additions & 17 deletions packages/docs/src/content/docs/extend/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,24 +50,27 @@ For reuse across apps or teams, package plugin manifests + skills as npm package
pnpm add @sentry/junior @sentry/junior-github @sentry/junior-notion @sentry/junior-sentry
```

List the plugin packages explicitly in `createApp`:

```ts title="api/index.ts"
import { initSentry } from "@sentry/junior/instrumentation";
initSentry();

import { createApp } from "@sentry/junior";
import { handle } from "hono/vercel";

const app = await createApp({
pluginPackages: [
"@sentry/junior-github",
"@sentry/junior-notion",
"@sentry/junior-sentry",
List the plugin packages in `juniorNitro` so they are bundled at build time and available at runtime:

```ts title="nitro.config.ts"
import { defineConfig } from "nitro";
import { juniorNitro } from "@sentry/junior/nitro";

export default defineConfig({
preset: "vercel",
modules: [
juniorNitro({
pluginPackages: [
"@sentry/junior-github",
"@sentry/junior-notion",
"@sentry/junior-sentry",
],
}),
],
routes: {
"/api/**": { handler: "./server.ts" },
},
});

export default handle(app);
```

If you publish your own package, include `plugin.yaml` and `skills` in package `files`.
Expand Down Expand Up @@ -182,7 +185,7 @@ Then install it in the host app:
pnpm add @acme/junior-example
```

The `juniorNitro({ pluginPackages: [...] })` module includes `app/**/*` and the declared plugin package content in the deployed function bundle. Pass the same package list to both `createApp` and `juniorNitro`.
The `juniorNitro({ pluginPackages: [...] })` module includes `app/**/*` and the declared plugin package content in the deployed function bundle. The plugin list is automatically available at runtime via `createApp()` — no need to declare it twice.

## Validate extensions

Expand Down
Loading
Loading