@exodus/analytics-validation 2.80.0 → 3.0.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/CHANGELOG.md CHANGED
@@ -3,6 +3,20 @@
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.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/analytics-validation@2.80.1...@exodus/analytics-validation@3.0.0) (2026-06-10)
7
+
8
+ ### ⚠ BREAKING CHANGES
9
+
10
+ - **analytics-validation:** convert to ESM (#17025)
11
+
12
+ - refactor(analytics-validation)!: convert to ESM (#17025)
13
+
14
+ ## [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)
15
+
16
+ ### Bug Fixes
17
+
18
+ - **analytics-validation:** keep ESM emit so schema compiles via babel ([#17003](https://github.com/ExodusMovement/exodus-hydra/issues/17003)) ([919a6a3](https://github.com/ExodusMovement/exodus-hydra/commit/919a6a38a69595fc12436ad5e70fc02eadb53ce2)), closes [#16840](https://github.com/ExodusMovement/exodus-hydra/issues/16840)
19
+
6
20
  ## [2.80.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/analytics-validation@2.79.0...@exodus/analytics-validation@2.80.0) (2026-06-04)
7
21
 
8
22
  ### Features
package/lib/index.js CHANGED
@@ -1,7 +1,2 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const main_schemasafe_json_1 = __importDefault(require("./main.schemasafe.json"));
7
- exports.default = main_schemasafe_json_1.default;
1
+ import validateEvent from './main.schemasafe.json';
2
+ export default validateEvent;
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@exodus/analytics-validation",
3
- "version": "2.80.0",
3
+ "version": "3.0.0",
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,12 +29,13 @@
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:generated": "node scripts/build-schemasafe.mjs && node scripts/build-types.mjs",
33
+ "build": "yarn build:generated && run -T tsc -p tsconfig.build.json",
32
34
  "build:watch": "yarn build -w",
33
35
  "clean": "run -T tsc --build --clean",
34
36
  "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
+ "test": "node scripts/build-schemasafe.mjs && run -T exodus-test --jest --esbuild",
38
+ "lint": "yarn build:generated && run -T tsc --noEmit && run -T eslint .",
37
39
  "lint:fix": "yarn lint --fix"
38
40
  },
39
41
  "devDependencies": {
@@ -53,5 +55,5 @@
53
55
  "access": "public",
54
56
  "provenance": false
55
57
  },
56
- "gitHead": "dd3752722508f48ded2cc75d9722e7550232448c"
58
+ "gitHead": "c9c9d0f5d4642f38d4055989160baefacc3f410e"
57
59
  }
@@ -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