@contractspec/lib.analytics 3.7.5 → 3.7.7

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/README.md CHANGED
@@ -1,13 +1,74 @@
1
1
  # @contractspec/lib.analytics
2
2
 
3
- Website: https://contractspec.io/
3
+ Website: https://contractspec.io
4
4
 
5
+ **Product analytics and growth metrics.**
5
6
 
6
- Zero-dependency analytics toolkit used by Phase 2 AI-Native Ops. It ingests telemetry events and outputs:
7
+ ## What It Provides
7
8
 
8
- - Funnel conversion reports with drop-off detection.
9
- - Cohort retention curves and LTV summaries.
10
- - Churn predictors that flag risky accounts.
11
- - Growth hypothesis generator that suggests experiments.
9
+ - **Layer**: lib.
10
+ - **Consumers**: bundles, apps.
11
+ - Related ContractSpec packages include `@contractspec/lib.contracts-integrations`, `@contractspec/lib.contracts-spec`, `@contractspec/lib.lifecycle`, `@contractspec/tool.bun`, `@contractspec/tool.typescript`.
12
+ - Related ContractSpec packages include `@contractspec/lib.contracts-integrations`, `@contractspec/lib.contracts-spec`, `@contractspec/lib.lifecycle`, `@contractspec/tool.bun`, `@contractspec/tool.typescript`.
12
13
 
13
- All utilities operate on plain JSON events so they can run in jobs, background workers, or MCP agents without a warehouse.
14
+ ## Installation
15
+
16
+ `npm install @contractspec/lib.analytics`
17
+
18
+ or
19
+
20
+ `bun add @contractspec/lib.analytics`
21
+
22
+ ## Usage
23
+
24
+ Import the root entrypoint from `@contractspec/lib.analytics`, or choose a documented subpath when you only need one part of the package surface.
25
+
26
+ ## Architecture
27
+
28
+ - `src/churn` is part of the package's public or composition surface.
29
+ - `src/cohort` is part of the package's public or composition surface.
30
+ - `src/funnel` is part of the package's public or composition surface.
31
+ - `src/growth` is part of the package's public or composition surface.
32
+ - `src/index.ts` is the root public barrel and package entrypoint.
33
+ - `src/lifecycle` is part of the package's public or composition surface.
34
+ - `src/posthog` is part of the package's public or composition surface.
35
+ - `src/types.ts` is shared public type definitions.
36
+
37
+ ## Public Entry Points
38
+
39
+ - Export `.` resolves through `./src/index.ts`.
40
+ - Export `./churn` resolves through `./src/churn/index.ts`.
41
+ - Export `./churn/predictor` resolves through `./src/churn/predictor.ts`.
42
+ - Export `./cohort` resolves through `./src/cohort/index.ts`.
43
+ - Export `./cohort/tracker` resolves through `./src/cohort/tracker.ts`.
44
+ - Export `./funnel` resolves through `./src/funnel/index.ts`.
45
+ - Export `./funnel/analyzer` resolves through `./src/funnel/analyzer.ts`.
46
+ - Export `./growth` resolves through `./src/growth/index.ts`.
47
+ - Export `./growth/hypothesis-generator` resolves through `./src/growth/hypothesis-generator.ts`.
48
+ - Export `./lifecycle` resolves through `./src/lifecycle/index.ts`.
49
+ - The package publishes 16 total export subpaths; keep docs aligned with `package.json`.
50
+
51
+ ## Local Commands
52
+
53
+ - `bun run dev` — contractspec-bun-build dev
54
+ - `bun run build` — bun run prebuild && bun run build:bundle && bun run build:types
55
+ - `bun run test` — bun test --pass-with-no-tests
56
+ - `bun run lint` — bun lint:fix
57
+ - `bun run lint:check` — biome check .
58
+ - `bun run lint:fix` — biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .
59
+ - `bun run typecheck` — tsc --noEmit
60
+ - `bun run publish:pkg` — bun publish --tolerate-republish --ignore-scripts --verbose
61
+ - `bun run publish:pkg:canary` — bun publish:pkg --tag canary
62
+ - `bun run clean` — rimraf dist .turbo
63
+ - `bun run build:bundle` — contractspec-bun-build transpile
64
+ - `bun run build:types` — contractspec-bun-build types
65
+ - `bun run prebuild` — contractspec-bun-build prebuild
66
+
67
+ ## Recent Updates
68
+
69
+ - Replace eslint+prettier by biomejs to optimize speed.
70
+
71
+ ## Notes
72
+
73
+ - Event naming conventions must stay consistent with PostHog taxonomy.
74
+ - Metric calculations affect live dashboards; verify formulas before changing.
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- export * from './types';
2
- export * from './funnel';
3
- export * from './cohort';
4
1
  export * from './churn';
2
+ export * from './cohort';
3
+ export * from './funnel';
5
4
  export * from './growth';
6
5
  export * from './lifecycle';
7
6
  export * from './posthog';
7
+ export * from './types';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contractspec/lib.analytics",
3
- "version": "3.7.5",
3
+ "version": "3.7.7",
4
4
  "description": "Product analytics and growth metrics",
5
5
  "keywords": [
6
6
  "contractspec",
@@ -25,22 +25,22 @@
25
25
  "dev": "contractspec-bun-build dev",
26
26
  "clean": "rimraf dist .turbo",
27
27
  "lint": "bun lint:fix",
28
- "lint:fix": "eslint src --fix",
29
- "lint:check": "eslint src",
28
+ "lint:fix": "biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .",
29
+ "lint:check": "biome check .",
30
30
  "test": "bun test --pass-with-no-tests",
31
31
  "prebuild": "contractspec-bun-build prebuild",
32
32
  "typecheck": "tsc --noEmit"
33
33
  },
34
34
  "dependencies": {
35
- "@contractspec/lib.contracts-spec": "3.7.5",
36
- "@contractspec/lib.contracts-integrations": "3.7.5",
37
- "@contractspec/lib.lifecycle": "3.7.5",
35
+ "@contractspec/lib.contracts-spec": "4.0.0",
36
+ "@contractspec/lib.contracts-integrations": "3.7.7",
37
+ "@contractspec/lib.lifecycle": "3.7.7",
38
38
  "dayjs": "^1.11.13"
39
39
  },
40
40
  "devDependencies": {
41
- "@contractspec/tool.typescript": "3.7.5",
41
+ "@contractspec/tool.typescript": "3.7.6",
42
42
  "typescript": "^5.9.3",
43
- "@contractspec/tool.bun": "3.7.5"
43
+ "@contractspec/tool.bun": "3.7.6"
44
44
  },
45
45
  "exports": {
46
46
  ".": {