@theholocron/holocron-plugin-sentry 5.0.0-alpha.352 → 5.0.0-alpha.354
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/index.mjs +6 -4
- package/package.json +10 -7
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AuthError, ProviderApiError, connectionProbe, createFeatureResolver, createResolveToken } from "@theholocron/cli";
|
|
2
|
+
import { createEnvLookup } from "@theholocron/env-utils/lookup";
|
|
2
3
|
import { randomUUID } from "node:crypto";
|
|
3
4
|
import { createSentryClient } from "@theholocron/sentry-client";
|
|
4
5
|
import { errorMessage } from "@theholocron/misc-utils";
|
|
@@ -385,7 +386,7 @@ const TO = 10;
|
|
|
385
386
|
/** The detector the throwaway rule hangs on: the issue stream of `HOLOCRON_SENTRY_PROBE_PROJECT`, else of any project. */
|
|
386
387
|
async function detectorFor(deps, org) {
|
|
387
388
|
const client = deps.client();
|
|
388
|
-
const slug = (deps.env
|
|
389
|
+
const slug = createEnvLookup(deps.env).get("HOLOCRON_SENTRY_PROBE_PROJECT");
|
|
389
390
|
const [detectors, projects] = await Promise.all([client.workflows.detectors(org), slug ? client.projects.list(org) : Promise.resolve([])]);
|
|
390
391
|
const streams = detectors.filter((d) => d.type === "issue_stream");
|
|
391
392
|
if (slug) {
|
|
@@ -510,9 +511,10 @@ function rulesProbe(deps) {
|
|
|
510
511
|
// src/probes/send-error.ts
|
|
511
512
|
/** Which DSN to send to: `SENTRY_DSN`, else the first client key of the project named in `HOLOCRON_SENTRY_PROBE_PROJECT`. */
|
|
512
513
|
async function dsnFor(deps) {
|
|
513
|
-
const env = deps.env
|
|
514
|
-
|
|
515
|
-
|
|
514
|
+
const env = createEnvLookup(deps.env);
|
|
515
|
+
const configured = env.get("SENTRY_DSN");
|
|
516
|
+
if (configured) return configured;
|
|
517
|
+
const project = env.get("HOLOCRON_SENTRY_PROBE_PROJECT");
|
|
516
518
|
if (!project) throw new Error("set SENTRY_DSN, or HOLOCRON_SENTRY_PROBE_PROJECT to a project slug, to say where to send the error");
|
|
517
519
|
const dsn = (await deps.client().projects.keys(requireOrg(deps), project))[0]?.dsn.public;
|
|
518
520
|
if (!dsn) throw new Error(`project \`${project}\` has no client key`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theholocron/holocron-plugin-sentry",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.354",
|
|
4
4
|
"description": "Holocron plugin for Sentry. Implements the errors capability against Sentry's management API — project provisioning and DSN retrieval.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"errors",
|
|
@@ -29,6 +29,9 @@
|
|
|
29
29
|
"files": [
|
|
30
30
|
"dist"
|
|
31
31
|
],
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@theholocron/env-utils": "^1.17.0-alpha.1"
|
|
34
|
+
},
|
|
32
35
|
"devDependencies": {
|
|
33
36
|
"@types/node": "^26",
|
|
34
37
|
"@vitest/coverage-v8": "^5.0.5",
|
|
@@ -41,19 +44,19 @@
|
|
|
41
44
|
"tsx": "4.23.15",
|
|
42
45
|
"typescript": "^5.9.3",
|
|
43
46
|
"vitest": "^5.0.5",
|
|
44
|
-
"@theholocron/cli": "5.0.0-alpha.
|
|
45
|
-
"@theholocron/eslint-config": "^8.9.0-alpha.8",
|
|
46
|
-
"@theholocron/http-client": "^1.58.0-alpha.11",
|
|
47
|
-
"@theholocron/misc-utils": "^1.17.0-alpha.1",
|
|
47
|
+
"@theholocron/cli": "5.0.0-alpha.354",
|
|
48
48
|
"@theholocron/sentry-client": "^1.58.0-alpha.11",
|
|
49
|
+
"@theholocron/misc-utils": "^1.17.0-alpha.1",
|
|
50
|
+
"@theholocron/eslint-config": "^8.9.0-alpha.8",
|
|
49
51
|
"@theholocron/tsconfig": "^8.9.0-alpha.8",
|
|
50
52
|
"@theholocron/tsdown-config": "^8.9.0-alpha.8",
|
|
51
|
-
"@theholocron/vitest-config": "^8.9.0-alpha.8"
|
|
53
|
+
"@theholocron/vitest-config": "^8.9.0-alpha.8",
|
|
54
|
+
"@theholocron/http-client": "^1.58.0-alpha.11"
|
|
52
55
|
},
|
|
53
56
|
"peerDependencies": {
|
|
54
57
|
"@theholocron/misc-utils": "^1.16.0",
|
|
55
58
|
"@theholocron/sentry-client": "^1.56.0",
|
|
56
|
-
"@theholocron/cli": "5.0.0-alpha.
|
|
59
|
+
"@theholocron/cli": "5.0.0-alpha.354"
|
|
57
60
|
},
|
|
58
61
|
"peerDependenciesMeta": {
|
|
59
62
|
"@theholocron/sentry-client": {}
|