@xovris/core 0.1.0 → 0.1.2

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.d.ts CHANGED
@@ -169,7 +169,10 @@ export declare function shared(): Shared;
169
169
  * a thrown string or number is remembered for one second (two handlers seeing one rejection, not two real failures). */
170
170
  export declare function firstSighting(err: unknown, now: number): boolean;
171
171
  export declare function createClient(o: ClientOptions): Client;
172
- /** Release and environment from what the platform already knows (Vercel first, then generic variables). */
172
+ /** Release and environment from what the platform already knows: XOVRIS_RELEASE, then the commit each host or build service names for the
173
+ * code it deployed (D01.03, 14 Nov - Vercel and GitHub alone left an app on Netlify, Render, Railway, Heroku, Cloudflare Pages, Amplify or
174
+ * a CI build with no release, so its first real event was never verified). A Node app falls back to its own git commit (@xovris/node). */
175
+ export declare const HOST_COMMIT: string[];
173
176
  export declare function releaseFrom(env: Record<string, string | undefined>): string | undefined;
174
177
  export declare function environmentFrom(env: Record<string, string | undefined>): string | undefined;
175
178
  export {};
package/dist/index.js CHANGED
@@ -269,9 +269,24 @@ export function createClient(o) {
269
269
  },
270
270
  };
271
271
  }
272
- /** Release and environment from what the platform already knows (Vercel first, then generic variables). */
272
+ /** Release and environment from what the platform already knows: XOVRIS_RELEASE, then the commit each host or build service names for the
273
+ * code it deployed (D01.03, 14 Nov - Vercel and GitHub alone left an app on Netlify, Render, Railway, Heroku, Cloudflare Pages, Amplify or
274
+ * a CI build with no release, so its first real event was never verified). A Node app falls back to its own git commit (@xovris/node). */
275
+ // KEEP: machine format - each host's own name for the deployed commit; the code's own .git is the open reading behind it (release.ts)
276
+ // G105.01.C132: the same list @xovris/stacks HOST_COMMIT holds for the OpenTelemetry stacks - a lane keeps the two equal
277
+ export const HOST_COMMIT = ['VERCEL_GIT_COMMIT_SHA', 'NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA', 'GITHUB_SHA', 'COMMIT_REF', 'CF_PAGES_COMMIT_SHA', 'RENDER_GIT_COMMIT',
278
+ 'RAILWAY_GIT_COMMIT_SHA', 'HEROKU_SLUG_COMMIT', 'SOURCE_VERSION', 'AWS_COMMIT_ID', 'CODEBUILD_RESOLVED_SOURCE_VERSION', 'CI_COMMIT_SHA', 'BITBUCKET_COMMIT',
279
+ 'CIRCLE_SHA1', 'BUILD_SOURCEVERSION', 'BUILDKITE_COMMIT', 'DRONE_COMMIT_SHA', 'GIT_COMMIT', 'SOURCE_COMMIT'];
273
280
  export function releaseFrom(env) {
274
- return env.XOVRIS_RELEASE ?? env.VERCEL_GIT_COMMIT_SHA ?? env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA ?? env.GITHUB_SHA ?? undefined;
281
+ const own = env.XOVRIS_RELEASE?.trim();
282
+ if (own)
283
+ return own;
284
+ for (const k of HOST_COMMIT) {
285
+ const v = env[k]?.trim();
286
+ if (v)
287
+ return v;
288
+ }
289
+ return undefined;
275
290
  }
276
291
  export function environmentFrom(env) {
277
292
  return env.XOVRIS_ENVIRONMENT ?? env.VERCEL_ENV ?? env.NEXT_PUBLIC_VERCEL_ENV ?? env.NODE_ENV ?? undefined;
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@xovris/core",
3
+ "gitHead": "8c4ea16632dacbd3d42aa498287016ff8445a668",
3
4
  "description": "Error capture, stack frames, breadcrumbs and Sentry-protocol envelopes for the Xovris SDK layer (ADR 0011).",
4
- "version": "0.1.0",
5
+ "version": "0.1.2",
5
6
  "license": "Apache-2.0",
6
7
  "type": "module",
7
8
  "files": [
@@ -10,7 +11,8 @@
10
11
  "exports": {
11
12
  ".": {
12
13
  "types": "./dist/index.d.ts",
13
- "import": "./dist/index.js"
14
+ "import": "./dist/index.js",
15
+ "default": "./dist/index.js"
14
16
  }
15
17
  },
16
18
  "publishConfig": {