@sentry/junior 0.11.1 → 0.12.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.
@@ -0,0 +1,25 @@
1
+ // src/vercel.ts
2
+ var DEFAULT_INCLUDE_FILES = "{./app/**,./node_modules/@sentry/junior*/plugin.yaml,./node_modules/@sentry/junior*/skills/**,./node_modules/@sentry/junior*/plugins/**}";
3
+ function juniorVercelConfig(options = {}) {
4
+ const entrypoint = options.entrypoint ?? "server.ts";
5
+ const maxDuration = options.maxDuration ?? 800;
6
+ const buildCommand = options.buildCommand === void 0 ? "pnpm build" : options.buildCommand;
7
+ const config = {
8
+ framework: "hono",
9
+ functions: {
10
+ [entrypoint]: {
11
+ maxDuration,
12
+ includeFiles: options.includeFiles ?? DEFAULT_INCLUDE_FILES
13
+ }
14
+ }
15
+ };
16
+ if (buildCommand !== null) {
17
+ config.buildCommand = buildCommand;
18
+ }
19
+ return config;
20
+ }
21
+
22
+ export {
23
+ DEFAULT_INCLUDE_FILES,
24
+ juniorVercelConfig
25
+ };
package/dist/cli/check.js CHANGED
@@ -1,11 +1,10 @@
1
1
  import {
2
2
  parseSkillFile
3
- } from "../chunk-WELSSJJU.js";
3
+ } from "../chunk-IH4T747D.js";
4
4
  import {
5
5
  parsePluginManifest
6
- } from "../chunk-ZYB3U7Q4.js";
6
+ } from "../chunk-Y2LVMCQ3.js";
7
7
  import "../chunk-Z3YD6NHK.js";
8
- import "../chunk-XH7TV4JS.js";
9
8
  import "../chunk-2KG3PWR4.js";
10
9
 
11
10
  // src/cli/check.ts
package/dist/cli/init.js CHANGED
@@ -1,3 +1,6 @@
1
+ import {
2
+ juniorVercelConfig
3
+ } from "../chunk-ZLVM4R7R.js";
1
4
  import "../chunk-2KG3PWR4.js";
2
5
 
3
6
  // src/cli/init.ts
@@ -6,7 +9,9 @@ import path from "path";
6
9
  function writeServerEntry(targetDir) {
7
10
  fs.writeFileSync(
8
11
  path.join(targetDir, "server.ts"),
9
- `import { initSentry } from "@sentry/junior/instrumentation";
12
+ `// Static import so Vercel's NFT traces hono (used internally by @sentry/junior).
13
+ import "hono";
14
+ import { initSentry } from "@sentry/junior/instrumentation";
10
15
  initSentry();
11
16
 
12
17
  import { createApp } from "@sentry/junior";
@@ -17,28 +22,11 @@ export default app;
17
22
  `
18
23
  );
19
24
  }
20
- function writeNitroConfig(targetDir) {
25
+ function writeVercelJson(targetDir) {
26
+ const config = juniorVercelConfig();
21
27
  fs.writeFileSync(
22
- path.join(targetDir, "nitro.config.ts"),
23
- `import { juniorNitroConfig } from "@sentry/junior/nitro";
24
- import { defineConfig } from "nitro";
25
-
26
- export default defineConfig(juniorNitroConfig());
27
- `
28
- );
29
- }
30
- function writeViteConfig(targetDir) {
31
- fs.writeFileSync(
32
- path.join(targetDir, "vite.config.ts"),
33
- `import { defineConfig } from "vite";
34
- import { nitro } from "nitro/vite";
35
-
36
- export default defineConfig({
37
- server: {
38
- allowedHosts: true,
39
- },
40
- plugins: [nitro()],
41
- });
28
+ path.join(targetDir, "vercel.json"),
29
+ `${JSON.stringify(config, null, 2)}
42
30
  `
43
31
  );
44
32
  }
@@ -66,8 +54,7 @@ async function runInit(dir, log = console.log) {
66
54
  private: true,
67
55
  type: "module",
68
56
  scripts: {
69
- dev: "vite dev",
70
- build: "junior snapshot create && vite build"
57
+ build: "junior snapshot create"
71
58
  },
72
59
  dependencies: {
73
60
  "@sentry/junior": "latest",
@@ -75,9 +62,8 @@ async function runInit(dir, log = console.log) {
75
62
  hono: "^4.12.0"
76
63
  },
77
64
  devDependencies: {
78
- nitro: "3.0.260311-beta",
79
65
  typescript: "^5.9.0",
80
- vite: "^8.0.0"
66
+ vercel: "^50.37.0"
81
67
  }
82
68
  };
83
69
  fs.writeFileSync(
@@ -111,8 +97,6 @@ Describe what ${name} helps users do.
111
97
  path.join(target, ".gitignore"),
112
98
  `node_modules/
113
99
  .vercel/
114
- .output/
115
- .nitro/
116
100
  .env
117
101
  .env.local
118
102
  `
@@ -129,11 +113,10 @@ SENTRY_DSN=
129
113
  `
130
114
  );
131
115
  writeServerEntry(target);
132
- writeNitroConfig(target);
133
- writeViteConfig(target);
116
+ writeVercelJson(target);
134
117
  log(`Created ${name} at ${target}`);
135
118
  log("");
136
- log(` cd ${targetDir} && pnpm install && pnpm dev`);
119
+ log(` cd ${targetDir} && pnpm install && vercel dev`);
137
120
  log("");
138
121
  }
139
122
  export {
@@ -1,14 +1,13 @@
1
1
  import {
2
2
  disconnectStateAdapter,
3
3
  resolveRuntimeDependencySnapshot
4
- } from "../chunk-IRE2LOEJ.js";
4
+ } from "../chunk-SCG4PCEG.js";
5
5
  import {
6
6
  getPluginProviders,
7
7
  getPluginRuntimeDependencies,
8
8
  getPluginRuntimePostinstall
9
- } from "../chunk-ZYB3U7Q4.js";
9
+ } from "../chunk-Y2LVMCQ3.js";
10
10
  import "../chunk-Z3YD6NHK.js";
11
- import "../chunk-XH7TV4JS.js";
12
11
  import "../chunk-2KG3PWR4.js";
13
12
 
14
13
  // src/cli/snapshot-warmup.ts
@@ -0,0 +1,13 @@
1
+ /** Default glob for bundling app content and plugin packages into the Vercel function. */
2
+ /** Default glob for bundling app content and plugin package assets into the Vercel function. */
3
+ declare const DEFAULT_INCLUDE_FILES = "{./app/**,./node_modules/@sentry/junior*/plugin.yaml,./node_modules/@sentry/junior*/skills/**,./node_modules/@sentry/junior*/plugins/**}";
4
+ interface JuniorVercelConfigOptions {
5
+ entrypoint?: string;
6
+ maxDuration?: number;
7
+ includeFiles?: string;
8
+ buildCommand?: string | null;
9
+ }
10
+ /** Return the default Vercel config used by scaffolded Junior apps. */
11
+ declare function juniorVercelConfig(options?: JuniorVercelConfigOptions): Record<string, unknown>;
12
+
13
+ export { DEFAULT_INCLUDE_FILES, type JuniorVercelConfigOptions, juniorVercelConfig };
package/dist/vercel.js ADDED
@@ -0,0 +1,9 @@
1
+ import {
2
+ DEFAULT_INCLUDE_FILES,
3
+ juniorVercelConfig
4
+ } from "./chunk-ZLVM4R7R.js";
5
+ import "./chunk-2KG3PWR4.js";
6
+ export {
7
+ DEFAULT_INCLUDE_FILES,
8
+ juniorVercelConfig
9
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/junior",
3
- "version": "0.11.1",
3
+ "version": "0.12.1",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -12,7 +12,7 @@
12
12
  "exports": {
13
13
  ".": "./dist/app.js",
14
14
  "./instrumentation": "./dist/instrumentation.js",
15
- "./nitro": "./dist/nitro.js"
15
+ "./vercel": "./dist/vercel.js"
16
16
  },
17
17
  "files": [
18
18
  "dist",