@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.
- package/README.md +1 -8
- package/dist/app.js +252 -317
- package/dist/{chunk-WELSSJJU.js → chunk-IH4T747D.js} +26 -34
- package/dist/{chunk-IRE2LOEJ.js → chunk-SCG4PCEG.js} +1 -1
- package/dist/{chunk-ZYB3U7Q4.js → chunk-Y2LVMCQ3.js} +611 -42
- package/dist/chunk-ZLVM4R7R.js +25 -0
- package/dist/cli/check.js +2 -3
- package/dist/cli/init.js +14 -31
- package/dist/cli/snapshot-warmup.js +2 -3
- package/dist/vercel.d.ts +13 -0
- package/dist/vercel.js +9 -0
- package/package.json +2 -2
- package/dist/chunk-XH7TV4JS.js +0 -560
- package/dist/nitro.d.ts +0 -27
- package/dist/nitro.js +0 -62
|
@@ -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-
|
|
3
|
+
} from "../chunk-IH4T747D.js";
|
|
4
4
|
import {
|
|
5
5
|
parsePluginManifest
|
|
6
|
-
} from "../chunk-
|
|
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
|
-
|
|
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
|
|
25
|
+
function writeVercelJson(targetDir) {
|
|
26
|
+
const config = juniorVercelConfig();
|
|
21
27
|
fs.writeFileSync(
|
|
22
|
-
path.join(targetDir, "
|
|
23
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
133
|
-
writeViteConfig(target);
|
|
116
|
+
writeVercelJson(target);
|
|
134
117
|
log(`Created ${name} at ${target}`);
|
|
135
118
|
log("");
|
|
136
|
-
log(` cd ${targetDir} && pnpm install &&
|
|
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-
|
|
4
|
+
} from "../chunk-SCG4PCEG.js";
|
|
5
5
|
import {
|
|
6
6
|
getPluginProviders,
|
|
7
7
|
getPluginRuntimeDependencies,
|
|
8
8
|
getPluginRuntimePostinstall
|
|
9
|
-
} from "../chunk-
|
|
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
|
package/dist/vercel.d.ts
ADDED
|
@@ -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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/junior",
|
|
3
|
-
"version": "0.
|
|
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
|
-
"./
|
|
15
|
+
"./vercel": "./dist/vercel.js"
|
|
16
16
|
},
|
|
17
17
|
"files": [
|
|
18
18
|
"dist",
|