@sentry/junior 0.88.0 → 0.89.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 +16 -5
- package/dist/cli/init.js +30 -36
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -10,6 +10,14 @@ pnpm add @sentry/junior hono @sentry/node
|
|
|
10
10
|
|
|
11
11
|
## Quick usage
|
|
12
12
|
|
|
13
|
+
`plugins.ts`:
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import { defineJuniorPlugins } from "@sentry/junior";
|
|
17
|
+
|
|
18
|
+
export const plugins = defineJuniorPlugins([]);
|
|
19
|
+
```
|
|
20
|
+
|
|
13
21
|
`server.ts`:
|
|
14
22
|
|
|
15
23
|
```ts
|
|
@@ -17,8 +25,11 @@ import { initSentry } from "@sentry/junior/instrumentation";
|
|
|
17
25
|
initSentry();
|
|
18
26
|
|
|
19
27
|
import { createApp } from "@sentry/junior";
|
|
28
|
+
import { plugins } from "./plugins.ts";
|
|
20
29
|
|
|
21
|
-
const app = await createApp(
|
|
30
|
+
const app = await createApp({
|
|
31
|
+
plugins,
|
|
32
|
+
});
|
|
22
33
|
|
|
23
34
|
export default app;
|
|
24
35
|
```
|
|
@@ -26,10 +37,10 @@ export default app;
|
|
|
26
37
|
Run `junior init my-bot` to scaffold a complete project including `vercel.json` for Vercel deployment.
|
|
27
38
|
|
|
28
39
|
Use `defineJuniorPlugins([...])` in a runtime-safe plugin module, then point
|
|
29
|
-
`juniorNitro({ plugins: "./plugins" })` at that module
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
40
|
+
`juniorNitro({ plugins: "./plugins" })` at that module and pass the same set to
|
|
41
|
+
`createApp({ plugins })`. Manifest-only packages use package-name strings;
|
|
42
|
+
factories such as `githubPlugin()` register their manifest and in-process hooks
|
|
43
|
+
together.
|
|
33
44
|
|
|
34
45
|
## Full docs
|
|
35
46
|
|
package/dist/cli/init.js
CHANGED
|
@@ -9,28 +9,20 @@ import path from "path";
|
|
|
9
9
|
function writeServerEntry(targetDir) {
|
|
10
10
|
fs.writeFileSync(
|
|
11
11
|
path.join(targetDir, "server.ts"),
|
|
12
|
-
`import {
|
|
13
|
-
initSentry
|
|
12
|
+
`import { createApp } from "@sentry/junior";
|
|
13
|
+
import { initSentry } from "@sentry/junior/instrumentation";
|
|
14
|
+
import { plugins } from "./plugins.ts";
|
|
14
15
|
|
|
15
|
-
|
|
16
|
+
initSentry();
|
|
16
17
|
|
|
17
|
-
const app = await createApp(
|
|
18
|
+
const app = await createApp({
|
|
19
|
+
plugins,
|
|
20
|
+
});
|
|
18
21
|
|
|
19
22
|
export default app;
|
|
20
23
|
`
|
|
21
24
|
);
|
|
22
25
|
}
|
|
23
|
-
function writeQueueConsumerEntry(targetDir) {
|
|
24
|
-
const queueConsumerDir = path.join(targetDir, "api", "internal", "agent");
|
|
25
|
-
fs.mkdirSync(queueConsumerDir, { recursive: true });
|
|
26
|
-
fs.writeFileSync(
|
|
27
|
-
path.join(queueConsumerDir, "continue.ts"),
|
|
28
|
-
`import app from "../../../server.ts";
|
|
29
|
-
|
|
30
|
-
export const POST = (request: Request) => app.fetch(request);
|
|
31
|
-
`
|
|
32
|
-
);
|
|
33
|
-
}
|
|
34
26
|
function writePluginsFile(targetDir) {
|
|
35
27
|
fs.writeFileSync(
|
|
36
28
|
path.join(targetDir, "plugins.ts"),
|
|
@@ -64,18 +56,17 @@ export default defineConfig({
|
|
|
64
56
|
`
|
|
65
57
|
);
|
|
66
58
|
}
|
|
67
|
-
function
|
|
59
|
+
function writeTsConfig(targetDir) {
|
|
68
60
|
fs.writeFileSync(
|
|
69
|
-
path.join(targetDir, "
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
});
|
|
61
|
+
path.join(targetDir, "tsconfig.json"),
|
|
62
|
+
`${JSON.stringify(
|
|
63
|
+
{
|
|
64
|
+
extends: "nitro/tsconfig",
|
|
65
|
+
compilerOptions: {}
|
|
66
|
+
},
|
|
67
|
+
null,
|
|
68
|
+
2
|
|
69
|
+
)}
|
|
79
70
|
`
|
|
80
71
|
);
|
|
81
72
|
}
|
|
@@ -110,7 +101,7 @@ jobs:
|
|
|
110
101
|
with:
|
|
111
102
|
node-version: 24
|
|
112
103
|
cache: pnpm
|
|
113
|
-
- run: pnpm install
|
|
104
|
+
- run: pnpm install
|
|
114
105
|
- run: pnpm check
|
|
115
106
|
- run: pnpm build
|
|
116
107
|
`
|
|
@@ -140,21 +131,23 @@ async function runInit(dir, log = console.log) {
|
|
|
140
131
|
private: true,
|
|
141
132
|
type: "module",
|
|
142
133
|
scripts: {
|
|
143
|
-
dev: "
|
|
134
|
+
dev: "nitro dev",
|
|
144
135
|
check: "junior check",
|
|
145
|
-
build: "junior snapshot create &&
|
|
136
|
+
build: "junior snapshot create && nitro build",
|
|
137
|
+
preview: "nitro preview",
|
|
138
|
+
typecheck: "tsc --noEmit"
|
|
146
139
|
},
|
|
147
140
|
dependencies: {
|
|
148
141
|
"@sentry/junior": "latest",
|
|
149
142
|
"@sentry/junior-memory": "latest",
|
|
150
143
|
"@sentry/junior-maintenance": "latest",
|
|
151
|
-
hono: "^4.12.
|
|
144
|
+
hono: "^4.12.22"
|
|
152
145
|
},
|
|
153
146
|
devDependencies: {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
147
|
+
"@types/node": "^25.9.1",
|
|
148
|
+
jiti: "^2.7.0",
|
|
149
|
+
nitro: "3.0.260522-beta",
|
|
150
|
+
typescript: "^6.0.3"
|
|
158
151
|
}
|
|
159
152
|
};
|
|
160
153
|
fs.writeFileSync(
|
|
@@ -213,6 +206,8 @@ AI_EMBEDDING_MODEL=
|
|
|
213
206
|
MEMORY_RECALL_MAX_VECTOR_DISTANCE=
|
|
214
207
|
AI_VISION_MODEL=
|
|
215
208
|
AI_WEB_SEARCH_MODEL=
|
|
209
|
+
DATABASE_URL=
|
|
210
|
+
JUNIOR_DATABASE_DRIVER=
|
|
216
211
|
REDIS_URL=
|
|
217
212
|
CRON_SECRET=
|
|
218
213
|
SENTRY_DSN=
|
|
@@ -220,10 +215,9 @@ SENTRY_ORG_SLUG=
|
|
|
220
215
|
`
|
|
221
216
|
);
|
|
222
217
|
writeServerEntry(target);
|
|
223
|
-
writeQueueConsumerEntry(target);
|
|
224
218
|
writePluginsFile(target);
|
|
225
219
|
writeNitroConfig(target);
|
|
226
|
-
|
|
220
|
+
writeTsConfig(target);
|
|
227
221
|
writeVercelJson(target);
|
|
228
222
|
writeGitHubWorkflow(target);
|
|
229
223
|
log(`Created ${name} at ${target}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/junior",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.89.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"pg": "^8.16.3",
|
|
79
79
|
"yaml": "^2.9.0",
|
|
80
80
|
"zod": "^4.4.3",
|
|
81
|
-
"@sentry/junior-plugin-api": "0.
|
|
81
|
+
"@sentry/junior-plugin-api": "0.89.0"
|
|
82
82
|
},
|
|
83
83
|
"devDependencies": {
|
|
84
84
|
"@emnapi/core": "^1.10.0",
|
|
@@ -94,10 +94,10 @@
|
|
|
94
94
|
"typescript": "^6.0.3",
|
|
95
95
|
"vercel": "^54.4.0",
|
|
96
96
|
"vitest": "^4.1.7",
|
|
97
|
-
"@sentry/junior-github": "0.
|
|
98
|
-
"@sentry/junior-memory": "0.
|
|
99
|
-
"@sentry/junior-
|
|
100
|
-
"@sentry/junior-
|
|
97
|
+
"@sentry/junior-github": "0.89.0",
|
|
98
|
+
"@sentry/junior-memory": "0.89.0",
|
|
99
|
+
"@sentry/junior-testing": "0.0.0",
|
|
100
|
+
"@sentry/junior-scheduler": "0.89.0"
|
|
101
101
|
},
|
|
102
102
|
"scripts": {
|
|
103
103
|
"build": "tsup && tsc -p tsconfig.build.json --emitDeclarationOnly",
|