ata-validator 0.13.2 → 0.13.4
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 +21 -0
- package/index.js +6 -0
- package/package.json +3 -2
- package/prebuilds/ata-darwin-arm64/node-napi-v10.node +0 -0
- package/prebuilds/ata-linux-arm64/node-napi-v10.node +0 -0
- package/prebuilds/ata-linux-arm64-musl/node-napi-v10.node +0 -0
- package/prebuilds/ata-linux-x64/node-napi-v10.node +0 -0
- package/prebuilds/ata-linux-x64-musl/node-napi-v10.node +0 -0
- package/prebuilds/ata-win32-x64/node-napi-v10.node +0 -0
- package/scripts/check-prebuilds.js +54 -0
- package/prebuilds/darwin-arm64/ata-validator.node +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to ata-validator are documented here. The format follows [Keep a Changelog](https://keepachangelog.com/), and this project adheres to semantic versioning.
|
|
4
4
|
|
|
5
|
+
## 0.13.4 — 2026-05-14
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- **macOS arm64 prebuild shipped with an invalid code signature.** The release workflow runs `pkg-prebuilds-copy --strip`, which on macOS runs `strip -Sx` on the addon. `strip` rewrites the Mach-O and invalidates the ad-hoc signature the linker applied, and it does not re-sign. arm64 macOS refuses to load unsigned code, so `require('ata-validator')` was killed with `SIGKILL (Code Signature Invalid)` the moment the binding loader called into the addon. Only `0.12.6` reached users this way because it was the one release published through CI rather than locally. The workflow now re-signs and verifies the macOS prebuild after `strip`, and `codesign --verify` gates the job so a broken signature cannot ship. Fixes #23.
|
|
10
|
+
- **macOS x64 prebuild was never produced.** The prebuild matrix used `macos-14` for the x64 leg, but `macos-14` runners are Apple Silicon only, so that leg built an arm64 binary mislabeled as x64 and no `darwin-x64` prebuild ever ended up in the tarball.
|
|
11
|
+
|
|
12
|
+
### Removed
|
|
13
|
+
|
|
14
|
+
- **macOS x64 prebuild.** `macos-13` GitHub runners, the only ones that build x64 natively, are no longer reliably available. Since no published version ever shipped a working `darwin-x64` prebuild, this is not a regression. Intel Mac users fall back to the JS engine, which still works, only the buffer APIs are slower.
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
|
|
18
|
+
- **`prepublishOnly` now blocks tarballs missing platform prebuilds.** A local `npm publish` only carries the publisher's own platform, silently dropping every other prebuild. Publishing now fails unless all seven platform prebuilds are present, and when run on a Mac it also verifies the darwin code signatures.
|
|
19
|
+
|
|
20
|
+
## 0.13.3 — 2026-05-13
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
|
|
24
|
+
- **`Validator.bundleStandalone` dropped hoisted anyOf/oneOf branch helpers from the bundle output.** Schemas whose codegen hoists branch functions like `_af1_b0` to the per-schema preamble (e.g. allOf wrapping an anyOf, or schemas pulled into a cross-`$ref` bundle) emitted JS that referenced these helpers without defining them, so loading the bundle threw `ReferenceError: _af1_b0 is not defined` on first validation. The standalone preamble now propagates through to the bundle alongside the format-closure serialization that was already there. `toStandalone` (single-schema) was unaffected. Fixes #24.
|
|
25
|
+
|
|
5
26
|
## 0.13.2 — 2026-05-09
|
|
6
27
|
|
|
7
28
|
### Fixed
|
package/index.js
CHANGED
|
@@ -1256,6 +1256,12 @@ Validator.bundleStandalone = function (schemas, opts) {
|
|
|
1256
1256
|
.map(({ name, fn }) => `var ${name}=${fn.toString()};`)
|
|
1257
1257
|
.join('\n');
|
|
1258
1258
|
}
|
|
1259
|
+
// Include hoisted anyOf/oneOf branch helpers (e.g. `_af1_b0`) so the
|
|
1260
|
+
// bundle output is self-contained. `toStandalone` emits this same source
|
|
1261
|
+
// for single-schema standalone output.
|
|
1262
|
+
if (jsFn._preambleSource) {
|
|
1263
|
+
preamble = preamble ? `${preamble}\n${jsFn._preambleSource}` : jsFn._preambleSource;
|
|
1264
|
+
}
|
|
1259
1265
|
if (opts && opts.verbose) {
|
|
1260
1266
|
// Embed the schema and a small resolver so errors carry parentSchema.
|
|
1261
1267
|
const schemaLit = JSON.stringify(typeof schema === 'string' ? JSON.parse(schema) : schema);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ata-validator",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.4",
|
|
4
4
|
"description": "Ultra-fast JSON Schema validator. 5x faster validation, 159,000x faster compilation. Works without native addon. Cross-schema $ref, Draft 2020-12 + Draft 7, V8-optimized JS codegen, simdjson, RE2, multi-core. Standard Schema V1 compatible.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.mjs",
|
|
@@ -36,11 +36,12 @@
|
|
|
36
36
|
},
|
|
37
37
|
"scripts": {
|
|
38
38
|
"install": "node scripts/install.js",
|
|
39
|
+
"prepublishOnly": "node scripts/check-prebuilds.js",
|
|
39
40
|
"build": "cmake-js build --target ata",
|
|
40
41
|
"rebuild": "cmake-js rebuild --target ata",
|
|
41
42
|
"prebuild": "pkg-prebuilds-copy --baseDir build/Release --source ata.node --name=ata --strip --napi_version=10",
|
|
42
43
|
"prebuild-all": "npm run prebuild -- --arch x64 && npm run prebuild -- --arch arm64",
|
|
43
|
-
"test": "node test.js && node tests/test_no_native.js && node tests/test_aot_build.js && node tests/test_aot_differential.js && node tests/test_aot_cli_build.js && node tests/test_aot_cli_smoke.js",
|
|
44
|
+
"test": "node test.js && node tests/test_no_native.js && node tests/test_aot_build.js && node tests/test_aot_differential.js && node tests/test_aot_cli_build.js && node tests/test_aot_cli_smoke.js && node tests/test_bundle_standalone.js",
|
|
44
45
|
"test:suite": "node tests/run_suite.js",
|
|
45
46
|
"test:compat": "node tests/test_compat.js",
|
|
46
47
|
"test:standard-schema": "node tests/test_standard_schema.js",
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// Refuse to publish a tarball that is missing platform prebuilds.
|
|
4
|
+
// Local `npm publish` only carries whatever the publisher's machine built,
|
|
5
|
+
// which silently drops every other platform's prebuild from the tarball.
|
|
6
|
+
// Publishing must go through the release workflow so all platforms are present.
|
|
7
|
+
|
|
8
|
+
const fs = require('fs');
|
|
9
|
+
const path = require('path');
|
|
10
|
+
const cp = require('child_process');
|
|
11
|
+
|
|
12
|
+
const required = [
|
|
13
|
+
'ata-linux-x64',
|
|
14
|
+
'ata-linux-arm64',
|
|
15
|
+
'ata-linux-x64-musl',
|
|
16
|
+
'ata-linux-arm64-musl',
|
|
17
|
+
'ata-darwin-arm64',
|
|
18
|
+
'ata-win32-x64',
|
|
19
|
+
];
|
|
20
|
+
|
|
21
|
+
const root = path.resolve(__dirname, '..');
|
|
22
|
+
const missing = required.filter(
|
|
23
|
+
(dir) => !fs.existsSync(path.join(root, 'prebuilds', dir, 'node-napi-v10.node')),
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
if (missing.length) {
|
|
27
|
+
console.error(
|
|
28
|
+
'\n[ata-validator] Refusing to publish, missing prebuilds:\n' +
|
|
29
|
+
missing.map((d) => ' - ' + d).join('\n') +
|
|
30
|
+
'\n\nPublish through the GitHub release workflow so every platform is built.\n',
|
|
31
|
+
);
|
|
32
|
+
process.exit(1);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// When publishing from a Mac, verify the darwin code signatures too. strip
|
|
36
|
+
// invalidates the linker signature, and an unsigned arm64 addon is killed on
|
|
37
|
+
// load. The release workflow re-signs and verifies, this is the local net.
|
|
38
|
+
if (process.platform === 'darwin') {
|
|
39
|
+
for (const dir of required) {
|
|
40
|
+
if (!dir.startsWith('ata-darwin-')) continue;
|
|
41
|
+
const f = path.join(root, 'prebuilds', dir, 'node-napi-v10.node');
|
|
42
|
+
const r = cp.spawnSync('codesign', ['--verify', f], { encoding: 'utf8' });
|
|
43
|
+
if (r.status !== 0) {
|
|
44
|
+
console.error(
|
|
45
|
+
'\n[ata-validator] Refusing to publish, invalid code signature:\n' +
|
|
46
|
+
' ' + f + '\n' + (r.stderr || '').trim() +
|
|
47
|
+
'\n\nRe-sign with: codesign --force --sign - "' + f + '"\n',
|
|
48
|
+
);
|
|
49
|
+
process.exit(1);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
console.log('[ata-validator] prebuilds present for all ' + required.length + ' platforms');
|
|
Binary file
|