@geonosis/observability 1.0.0 → 1.1.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/bin/geonosis-observability.mjs +24 -1
- package/package.json +14 -4
|
@@ -1,4 +1,27 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// Committed, so `pnpm install` can link the bin on a fresh clone — before `pnpm build` has
|
|
3
3
|
// produced dist/. A bin that only exists after a build is a bin that is missing when you need it.
|
|
4
|
-
|
|
4
|
+
//
|
|
5
|
+
// In the repo, `src/` sits beside `dist/`, and a dist older than src answered for a fix it did not
|
|
6
|
+
// carry once (#62). The published package ships no src, so there the check is skipped.
|
|
7
|
+
import { existsSync, readdirSync, statSync } from 'node:fs'
|
|
8
|
+
import { dirname, join } from 'node:path'
|
|
9
|
+
import { fileURLToPath } from 'node:url'
|
|
10
|
+
|
|
11
|
+
const here = dirname(fileURLToPath(import.meta.url))
|
|
12
|
+
const newest = (dir) =>
|
|
13
|
+
existsSync(dir)
|
|
14
|
+
? readdirSync(dir, { withFileTypes: true }).reduce((most, entry) => {
|
|
15
|
+
const at = join(dir, entry.name)
|
|
16
|
+
return Math.max(most, entry.isDirectory() ? newest(at) : statSync(at).mtimeMs)
|
|
17
|
+
}, 0)
|
|
18
|
+
: 0
|
|
19
|
+
const src = join(here, '..', 'src')
|
|
20
|
+
if (existsSync(src) && newest(src) > newest(join(here, '..', 'dist'))) {
|
|
21
|
+
process.stderr.write(
|
|
22
|
+
'geonosis-observability: dist is older than src — run pnpm build before trusting this bin.\n',
|
|
23
|
+
)
|
|
24
|
+
process.exit(2)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
await import('../dist/observability-cli.js')
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geonosis/observability",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"types": "./dist/index.d.ts",
|
|
4
5
|
"description": "Ports whose answer can say failed: an ErrorSink and a Tracer returning Result, one attribute vocabulary (tenant as a group id, never a person), a memory sink, envelope-id dedupe, a PostHog adapter, a tiered health registry, and a probe that plants an error and names the trace id it arrived as.",
|
|
5
6
|
"keywords": [
|
|
6
7
|
"observability",
|
|
@@ -21,9 +22,18 @@
|
|
|
21
22
|
"type": "module",
|
|
22
23
|
"main": "dist/index.js",
|
|
23
24
|
"exports": {
|
|
24
|
-
".":
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
".": {
|
|
26
|
+
"types": "./dist/index.d.ts",
|
|
27
|
+
"default": "./dist/index.js"
|
|
28
|
+
},
|
|
29
|
+
"./health": {
|
|
30
|
+
"types": "./dist/health/index.d.ts",
|
|
31
|
+
"default": "./dist/health/index.js"
|
|
32
|
+
},
|
|
33
|
+
"./posthog": {
|
|
34
|
+
"types": "./dist/posthog/index.d.ts",
|
|
35
|
+
"default": "./dist/posthog/index.js"
|
|
36
|
+
}
|
|
27
37
|
},
|
|
28
38
|
"files": [
|
|
29
39
|
"bin",
|