@sentry/junior 0.12.0 → 0.13.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/dist/app.js +11 -8
- package/dist/{chunk-IH4T747D.js → chunk-7YFFZCL4.js} +4 -2
- package/dist/{chunk-SCG4PCEG.js → chunk-C4N7XWDT.js} +11 -2
- package/dist/{chunk-Y2LVMCQ3.js → chunk-WZXIUH5S.js} +38 -591
- package/dist/chunk-XH7TV4JS.js +560 -0
- package/dist/cli/check.js +3 -2
- package/dist/cli/init.js +36 -10
- package/dist/cli/snapshot-warmup.js +3 -2
- package/dist/nitro.d.ts +27 -0
- package/dist/nitro.js +66 -0
- package/dist/vercel.d.ts +2 -8
- package/dist/vercel.js +10 -5
- package/package.json +2 -1
- package/dist/chunk-ZLVM4R7R.js +0 -25
package/dist/nitro.js
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import {
|
|
2
|
+
discoverInstalledPluginPackageContent
|
|
3
|
+
} from "./chunk-XH7TV4JS.js";
|
|
4
|
+
import "./chunk-2KG3PWR4.js";
|
|
5
|
+
|
|
6
|
+
// src/nitro.ts
|
|
7
|
+
import { cpSync, existsSync, mkdirSync } from "fs";
|
|
8
|
+
import path from "path";
|
|
9
|
+
function copyAppAndPluginContent(cwd, serverRoot) {
|
|
10
|
+
copyIfExists(path.join(cwd, "app"), path.join(serverRoot, "app"));
|
|
11
|
+
const packagedContent = discoverInstalledPluginPackageContent(cwd);
|
|
12
|
+
for (const root of packagedContent.manifestRoots) {
|
|
13
|
+
if (existsSync(path.join(root, "plugin.yaml"))) {
|
|
14
|
+
const relative = path.relative(cwd, root);
|
|
15
|
+
if (!relative || path.isAbsolute(relative) || relative.startsWith("..")) {
|
|
16
|
+
continue;
|
|
17
|
+
}
|
|
18
|
+
copyIfExists(
|
|
19
|
+
path.join(root, "plugin.yaml"),
|
|
20
|
+
path.join(serverRoot, relative, "plugin.yaml")
|
|
21
|
+
);
|
|
22
|
+
continue;
|
|
23
|
+
}
|
|
24
|
+
copyRootIntoServerOutput(cwd, serverRoot, root);
|
|
25
|
+
}
|
|
26
|
+
for (const root of packagedContent.skillRoots) {
|
|
27
|
+
copyRootIntoServerOutput(cwd, serverRoot, root);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function copyIfExists(source, target) {
|
|
31
|
+
if (!existsSync(source)) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
mkdirSync(path.dirname(target), { recursive: true });
|
|
35
|
+
cpSync(source, target, { recursive: true });
|
|
36
|
+
}
|
|
37
|
+
function copyRootIntoServerOutput(cwd, serverRoot, root) {
|
|
38
|
+
const relative = path.relative(cwd, root);
|
|
39
|
+
if (!relative || path.isAbsolute(relative) || relative.startsWith("..")) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
copyIfExists(root, path.join(serverRoot, relative));
|
|
43
|
+
}
|
|
44
|
+
function juniorNitroConfig(options = {}) {
|
|
45
|
+
const cwd = path.resolve(options.cwd ?? process.cwd());
|
|
46
|
+
return {
|
|
47
|
+
preset: "vercel",
|
|
48
|
+
vercel: {
|
|
49
|
+
functions: {
|
|
50
|
+
maxDuration: options.maxDuration ?? 800
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
modules: [
|
|
54
|
+
{
|
|
55
|
+
setup(nitro) {
|
|
56
|
+
nitro.hooks.hook("compiled", () => {
|
|
57
|
+
copyAppAndPluginContent(cwd, nitro.options.output.serverDir);
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
export {
|
|
65
|
+
juniorNitroConfig
|
|
66
|
+
};
|
package/dist/vercel.d.ts
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
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
1
|
interface JuniorVercelConfigOptions {
|
|
5
|
-
entrypoint?: string;
|
|
6
|
-
maxDuration?: number;
|
|
7
|
-
includeFiles?: string;
|
|
8
2
|
buildCommand?: string | null;
|
|
9
3
|
}
|
|
10
|
-
/** Return
|
|
4
|
+
/** Return a minimal Vercel config for scaffolded Junior apps. */
|
|
11
5
|
declare function juniorVercelConfig(options?: JuniorVercelConfigOptions): Record<string, unknown>;
|
|
12
6
|
|
|
13
|
-
export {
|
|
7
|
+
export { type JuniorVercelConfigOptions, juniorVercelConfig };
|
package/dist/vercel.js
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
DEFAULT_INCLUDE_FILES,
|
|
3
|
-
juniorVercelConfig
|
|
4
|
-
} from "./chunk-ZLVM4R7R.js";
|
|
5
1
|
import "./chunk-2KG3PWR4.js";
|
|
2
|
+
|
|
3
|
+
// src/vercel.ts
|
|
4
|
+
function juniorVercelConfig(options = {}) {
|
|
5
|
+
const buildCommand = options.buildCommand === void 0 ? "pnpm build" : options.buildCommand;
|
|
6
|
+
const config = {};
|
|
7
|
+
if (buildCommand !== null) {
|
|
8
|
+
config.buildCommand = buildCommand;
|
|
9
|
+
}
|
|
10
|
+
return config;
|
|
11
|
+
}
|
|
6
12
|
export {
|
|
7
|
-
DEFAULT_INCLUDE_FILES,
|
|
8
13
|
juniorVercelConfig
|
|
9
14
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/junior",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
"exports": {
|
|
13
13
|
".": "./dist/app.js",
|
|
14
14
|
"./instrumentation": "./dist/instrumentation.js",
|
|
15
|
+
"./nitro": "./dist/nitro.js",
|
|
15
16
|
"./vercel": "./dist/vercel.js"
|
|
16
17
|
},
|
|
17
18
|
"files": [
|
package/dist/chunk-ZLVM4R7R.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
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
|
-
};
|