@theholocron/holocron-plugin-sentry 5.0.0-alpha.351 → 5.0.0-alpha.353

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.
Files changed (2) hide show
  1. package/dist/index.mjs +6 -4
  2. 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 ?? process.env)["HOLOCRON_SENTRY_PROBE_PROJECT"];
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 ?? process.env;
514
- if (env["SENTRY_DSN"]) return env["SENTRY_DSN"];
515
- const project = env["HOLOCRON_SENTRY_PROBE_PROJECT"];
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.351",
3
+ "version": "5.0.0-alpha.353",
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.351",
45
47
  "@theholocron/eslint-config": "^8.9.0-alpha.8",
46
- "@theholocron/http-client": "^1.58.0-alpha.11",
48
+ "@theholocron/cli": "5.0.0-alpha.353",
47
49
  "@theholocron/misc-utils": "^1.17.0-alpha.1",
48
- "@theholocron/tsconfig": "^8.9.0-alpha.8",
50
+ "@theholocron/http-client": "^1.58.0-alpha.11",
49
51
  "@theholocron/sentry-client": "^1.58.0-alpha.11",
50
- "@theholocron/vitest-config": "^8.9.0-alpha.8",
51
- "@theholocron/tsdown-config": "^8.9.0-alpha.8"
52
+ "@theholocron/tsconfig": "^8.9.0-alpha.8",
53
+ "@theholocron/tsdown-config": "^8.9.0-alpha.8",
54
+ "@theholocron/vitest-config": "^8.9.0-alpha.8"
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.351"
59
+ "@theholocron/cli": "5.0.0-alpha.353"
57
60
  },
58
61
  "peerDependenciesMeta": {
59
62
  "@theholocron/sentry-client": {}