@sentry/junior 0.11.0 → 0.12.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 +1 -8
- package/dist/app.js +251 -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 +13 -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 -18
- package/dist/nitro.js +0 -59
|
@@ -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,8 @@ import path from "path";
|
|
|
6
9
|
function writeServerEntry(targetDir) {
|
|
7
10
|
fs.writeFileSync(
|
|
8
11
|
path.join(targetDir, "server.ts"),
|
|
9
|
-
`import
|
|
12
|
+
`import "hono";
|
|
13
|
+
import { initSentry } from "@sentry/junior/instrumentation";
|
|
10
14
|
initSentry();
|
|
11
15
|
|
|
12
16
|
import { createApp } from "@sentry/junior";
|
|
@@ -17,28 +21,11 @@ export default app;
|
|
|
17
21
|
`
|
|
18
22
|
);
|
|
19
23
|
}
|
|
20
|
-
function
|
|
24
|
+
function writeVercelJson(targetDir) {
|
|
25
|
+
const config = juniorVercelConfig();
|
|
21
26
|
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
|
-
});
|
|
27
|
+
path.join(targetDir, "vercel.json"),
|
|
28
|
+
`${JSON.stringify(config, null, 2)}
|
|
42
29
|
`
|
|
43
30
|
);
|
|
44
31
|
}
|
|
@@ -66,8 +53,7 @@ async function runInit(dir, log = console.log) {
|
|
|
66
53
|
private: true,
|
|
67
54
|
type: "module",
|
|
68
55
|
scripts: {
|
|
69
|
-
|
|
70
|
-
build: "junior snapshot create && vite build"
|
|
56
|
+
build: "junior snapshot create"
|
|
71
57
|
},
|
|
72
58
|
dependencies: {
|
|
73
59
|
"@sentry/junior": "latest",
|
|
@@ -75,9 +61,8 @@ async function runInit(dir, log = console.log) {
|
|
|
75
61
|
hono: "^4.12.0"
|
|
76
62
|
},
|
|
77
63
|
devDependencies: {
|
|
78
|
-
nitro: "3.0.260311-beta",
|
|
79
64
|
typescript: "^5.9.0",
|
|
80
|
-
|
|
65
|
+
vercel: "^50.37.0"
|
|
81
66
|
}
|
|
82
67
|
};
|
|
83
68
|
fs.writeFileSync(
|
|
@@ -111,8 +96,6 @@ Describe what ${name} helps users do.
|
|
|
111
96
|
path.join(target, ".gitignore"),
|
|
112
97
|
`node_modules/
|
|
113
98
|
.vercel/
|
|
114
|
-
.output/
|
|
115
|
-
.nitro/
|
|
116
99
|
.env
|
|
117
100
|
.env.local
|
|
118
101
|
`
|
|
@@ -129,11 +112,10 @@ SENTRY_DSN=
|
|
|
129
112
|
`
|
|
130
113
|
);
|
|
131
114
|
writeServerEntry(target);
|
|
132
|
-
|
|
133
|
-
writeViteConfig(target);
|
|
115
|
+
writeVercelJson(target);
|
|
134
116
|
log(`Created ${name} at ${target}`);
|
|
135
117
|
log("");
|
|
136
|
-
log(` cd ${targetDir} && pnpm install &&
|
|
118
|
+
log(` cd ${targetDir} && pnpm install && vercel dev`);
|
|
137
119
|
log("");
|
|
138
120
|
}
|
|
139
121
|
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.0",
|
|
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",
|