@exodus/analytics-validation 2.80.1 → 3.0.1

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/CHANGELOG.md CHANGED
@@ -3,6 +3,18 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [3.0.1](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/analytics-validation@3.0.0...@exodus/analytics-validation@3.0.1) (2026-06-19)
7
+
8
+ **Note:** Version bump only for package @exodus/analytics-validation
9
+
10
+ ## [3.0.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/analytics-validation@2.80.1...@exodus/analytics-validation@3.0.0) (2026-06-10)
11
+
12
+ ### ⚠ BREAKING CHANGES
13
+
14
+ - **analytics-validation:** convert to ESM (#17025)
15
+
16
+ - refactor(analytics-validation)!: convert to ESM (#17025)
17
+
6
18
  ## [2.80.1](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/analytics-validation@2.80.0...@exodus/analytics-validation@2.80.1) (2026-06-05)
7
19
 
8
20
  ### Bug Fixes
package/README.md CHANGED
@@ -21,7 +21,7 @@ flowchart TD
21
21
  B(You're done!)
22
22
  C{Does it only require\n the 'origin' property?}
23
23
  C -->|Yes| B
24
- C -->|No| E[Generate a new JSON Schema: \nyarn generate analytics-validation]
24
+ C -->|No| E[Generate a new JSON Schema: \npnpm generate analytics-validation]
25
25
  E --> D[Adjust the schema and tests]
26
26
  D --> B
27
27
 
@@ -32,7 +32,7 @@ flowchart TD
32
32
  To add a new schema run
33
33
 
34
34
  ```bash
35
- yarn generate analytics-validation
35
+ pnpm generate analytics-validation
36
36
  ```
37
37
 
38
38
  in the project root. The CLI tool will ask you for all details needed.
package/lib/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import validateEvent from './main.schemasafe.json';
2
1
  export type * from '../lib/events.js';
3
- export default validateEvent;
2
+ declare const _default: (event: unknown) => void;
3
+ export default _default;
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@exodus/analytics-validation",
3
- "version": "2.80.1",
3
+ "version": "3.0.1",
4
+ "type": "module",
4
5
  "description": "JSON schemas for analytics events, to prevent sensitive data from being sent up to the infamous cloud",
5
6
  "author": "Exodus Movement, Inc.",
6
7
  "repository": {
@@ -28,13 +29,15 @@
28
29
  "./schemasafe.config.js": "./schemasafe.config.js"
29
30
  },
30
31
  "scripts": {
31
- "build": "node scripts/build-schemasafe.js && node scripts/build-types.mjs && run -T tsc -p tsconfig.build.json",
32
- "build:watch": "yarn build -w",
33
- "clean": "run -T tsc --build --clean",
34
- "prepublishOnly": "yarn run -T build --scope @exodus/analytics-validation",
35
- "test": "node scripts/build-schemasafe.js && run -T exodus-test --jest --esbuild",
36
- "lint": "node scripts/build-schemasafe.js && run -T tsc --noEmit && run -T eslint .",
37
- "lint:fix": "yarn lint --fix"
32
+ "build:generated": "node scripts/build-schemasafe.mjs && node scripts/build-types.mjs",
33
+ "build": "pnpm run build:generated && pnpm exec tsc -p tsconfig.build.json",
34
+ "build:watch": "pnpm run build -- -w",
35
+ "clean": "pnpm exec tsc --build --clean",
36
+ "prepublishOnly": "pnpm -w run build --scope @exodus/analytics-validation",
37
+ "test": "node scripts/build-schemasafe.mjs && pnpm exec exodus-test --jest --esbuild",
38
+ "typecheck": "node scripts/build-schemasafe.mjs && pnpm exec tsc --noEmit",
39
+ "lint": "pnpm run build:generated && pnpm exec tsc --noEmit && pnpm exec eslint .",
40
+ "lint:fix": "pnpm run lint --fix"
38
41
  },
39
42
  "devDependencies": {
40
43
  "@exodus/schemasafe": "^1.0.0"
@@ -53,5 +56,5 @@
53
56
  "access": "public",
54
57
  "provenance": false
55
58
  },
56
- "gitHead": "c4b115b9768e67dc6480cd272c6a27d5fec33d13"
59
+ "gitHead": "ee6464c5bf85444f08089966a7d032e33de4cfc4"
57
60
  }
@@ -1,5 +1,6 @@
1
- const fs = require('fs')
2
- const path = require('path')
1
+ import fs from 'node:fs'
2
+ import path from 'node:path'
3
+ import { fileURLToPath } from 'node:url'
3
4
 
4
5
  const schemas = {}
5
6
 
@@ -22,6 +23,8 @@ const getSchemas = ({ schemaDir, schemaNames }) => {
22
23
  }
23
24
  }
24
25
 
26
+ const __filename = fileURLToPath(import.meta.url)
27
+ const __dirname = path.dirname(__filename)
25
28
  const schemaDir = path.join(__dirname, './lib')
26
29
  const schemaNames = fs.readdirSync(schemaDir)
27
30
 
@@ -34,13 +37,15 @@ const semVerRegEx =
34
37
  const localeRegEx = /^[A-Za-z]{2,8}([_-][\dA-Za-z]{1,8}){0,2}$/u
35
38
  // NOTE: this is exported so consumers can use the same settings at runtime
36
39
  // as were used to compile schemas at build time
37
- module.exports = {
38
- extraFormats: true,
39
- formats: {
40
- 'any-string': (str) => typeof str === 'string',
41
- 'semver-string': semVerRegEx,
42
- locale: localeRegEx,
43
- },
44
- schemas,
45
- mode: 'default',
40
+ export const extraFormats = true
41
+ export const formats = {
42
+ 'any-string': (str) => typeof str === 'string',
43
+ 'semver-string': semVerRegEx,
44
+ locale: localeRegEx,
46
45
  }
46
+ export const mode = 'default'
47
+ export { schemas }
48
+
49
+ const schemasafeConfig = { extraFormats, formats, schemas, mode }
50
+
51
+ export default schemasafeConfig