Releases: hed-standard/hed-javascript
hed-validator v4.1.4
📦 Release Highlights
This release merges the ESM build configurations, which were split in version 4.1.0, using the browser configuration as a base. This should hopefully fix the remaining build issues.
👥 Contributors
Thanks to everyone who contributed to this release:
Let us know if you run into any issues, and stay tuned for further improvements!
Full Changelog: v4.1.3...v4.1.4
hed-validator v4.1.3
📦 Release Highlights
This release replaces the cross-fetch
dependency with Node's built-in fetch
implementation. As a result, the Node requirement was bumped from 18 to 22. It also excludes the JSON spec tests from the main test runner, so that they only run with npm run testSpecs
.
👥 Contributors
Thanks to everyone who contributed to this release:
Let us know if you run into any issues, and stay tuned for further improvements!
Full Changelog: v4.1.2...v4.1.3
hed-validator v4.1.2
📦 Release Highlights
This release replaces the xml2js
XML parser with fast-xml-parser
. xml2js
was causing multiple build issues, both downstream and with this package. We also took the opportunity to simplify the schema XML parsing code, including merging the mini-XPath parser into the main parser class and refactoring several methods. We also made several non-code and formatting changes, including updating the CI actions to use OpenID Connect instead of long-lived tokens.
👥 Contributors
Thanks to everyone who contributed to this release:
Let us know if you run into any issues, and stay tuned for further improvements!
Full Changelog: v4.1.1...v4.1.2
hed-validator v4.1.1
📦 Release Highlights
This patch release is primarily intended to fix type declaration issues discovered in version 4.1.0.
🛠️ Refactoring and Fixes
- Fixed type declarations to match intended interface and BIDS validator code (#524).
- Fixed potential null-pointer issues in
BidsFile
subclasses (#524). - Changed Windows CR-LF line endings to Unix LF endings (#525).
👥 Contributors
Thanks to everyone who contributed to this release:
Let us know if you run into any issues!
Full Changelog: v4.1.0...v4.1.1
hed-validator v4.1.0
📦 Release Highlights
This release includes major progress on support for browser-based HED validation, significant documentation improvements, refactoring, testing enhancements, and dependency upgrades to keep the codebase current.
🚀 Major Features
-
Initial implementation of browser-based HED validation:
-
Bundled HED schemas updated and expanded:
Bundled schemas now include the latest versions (e.g., 8.4.0), with proper access across environments.
See: #381, #443, #496 -
Initial implementation of TypeScript type declarations for the public API.
🧪 Testing & CI Improvements
- Split test framework: Separate testing paths for Node and browser environments.
- New GitHub Actions workflows: CI updates, browser test automation, and deployment flow stabilization.
- Code coverage tools reconfigured: Includes move to Qlty configuration and replacement for Code Climate.
Related PRs:
#344, #520, #445, #446
📘 Documentation
- Reorganized and enhanced API documentation using TypeDoc.
- Jekyll-based site created for GitHub Pages hosting of the documentation and browser validator.
- Improved error message specificity and context in the validation output.
🛠️ Refactoring and Fixes
- Reorganized internal structure for file loading, schema parsing, and better environment separation.
- Added static methods for constructing BIDS file objects from paths.
- Improved tokenizer and sidecar context-based error reporting.
- Removed legacy dependencies and improved Jest and Vite configuration.
📦 Dependency Updates
Numerous updates to keep dependencies current and secure. Notable upgrades include:
- ESLint:
9.22.0 → 9.31.0
- TypeDoc:
0.28.0 → 0.28.7
- TypeScript:
5.8.2 → 5.8.3
- Jest:
29.7.0 → 30.0.5
- Prettier:
3.5.3 → 3.6.2
- esbuild:
0.25.1 → 0.25.8
- Plus related plugins (
eslint-plugin-prettier
,eslint-config-prettier
, etc.)
Most updates were handled via Dependabot.
👥 Contributors
Thanks to everyone who contributed to this release:
- @VisLab
- @happy5214
- @dependabot[bot]
Let us know if you run into any issues, and stay tuned for further improvements to the web interface and validation tools!
Full Changelog: v4.0.1...v4.1.0
hed-validator v4.0.1
This release fixes a minor bug with validating tag groups in splices in sidecars. Private fields/methods have also been reverted to underscore syntax due to a lack of tool support for number-sign private fields/methods.
What's Changed
- Bump eslint-config-prettier from 10.0.2 to 10.1.1 by @dependabot in #317
- Bump esbuild from 0.25.0 to 0.25.1 by @dependabot in #316
- Bump pretty-quick from 4.0.0 to 4.1.1 by @dependabot in #315
- Bump @eslint/js from 9.21.0 to 9.22.0 by @dependabot in #314
- Bump eslint from 9.21.0 to 9.22.0 by @dependabot in #313
- Added tests for n/a handling in onset column by @VisLab in #319
- Fixed issue with top-level tag used in splice issue #321 by @VisLab in #322
- Several Code Climate fixes by @happy5214 in #320
- Restructure the GitHub Action test configuration by @happy5214 in #323
- Fixed group bug reported in #321 by @VisLab in #324
- Bump typedoc from 0.27.9 to 0.28.0 by @dependabot in #325
- Added a stronger check of spliced group issues by @VisLab in #326
- Updated the tests and docs by @VisLab in #327
- Version 4.0.1 code by @happy5214 in #328
- Version 4.0.1 tag by @happy5214 in #329
Full Changelog: v4.0.0...v4.0.1
hed-validator v4.0.0
NOTE: This was inadvertently released to NPM as version 5.0.0 due to a typo in the package.json
. That release has been pulled. Please use this release instead.
This fourth major version of hed-validator is a substantial rewrite of the code and interface. It provides feature-completeness, including full compliance with the current version of the HED-3G specification. Support for earlier generations of HED and syntax-only validation has been removed.
Previous versions did not properly implement definition or temporal tag validation. This version completely reimplements the validation code, fixing these and other bugs. The validator now fails as soon as it finds an error, rather than trying to return all errors. This reduces spurious errors that make no sense.
Reliability is now assured by overlapping sets of testcases. The original JavaScript-based tests were completely rewritten to use JSON-based datasets and templated scripts, while the specification itself also provides a rich set of JSON-based tests, shared with the Python-based HED validator, that ensures conformance with the HED-3G standard.
API
The API has been completely remodeled and greatly reduced compared to version 3 of this validator. The original APIs, which allowed direct access to the validator's parsing, schema-loading, and validation code, have been removed entirely. The API to validate entire BIDS datasets at once has also been removed, due to issues that arose when validating large BIDS datasets using that model.
The version 4.0.0 API only supports validating BIDS-format files, specifically JSON and TSV files. The API is as follows:
BidsSidecar
- JSON sidecarsBidsJsonFile
- Non-sidecar JSON filesBidsTsvFile
- TSV filesBidsHedIssue
- The generated issues returned from the validator, type-compatible with the BIDSIssue
type.buildBidsSchemas(datasetDescription)
- Anasync
function which returns aSchemas
object (this type is not part of the public API and should be treated as opaque).datasetDescription
is aBidsJsonFile
object representingdataset_description.json
.
The constructors of BidsSidecar
and BidsJsonFile
take three arguments as part of the public API:
- The name of the file.
- An object representing the file itself.
- The parsed contents of the JSON file in object form.
The constructor of BidsTsvFile
takes four arguments as part of the public API:
- The name of the file.
- An object representing the file itself.
- The parsed contents of the TSV file (preferably as either a string of the entire file contents, or as a
Map
, with the column names as keys and the column values in an array as values). - (Optional) The merged sidecar contents in object form.
The constructor of BidsHedIssue
should not be called from external code. buildBidsSchemas()
may throw IssueError
objects (another opaque internal type), which should be passed, along with the file object of the dataset_description.json
BidsJsonFile
, to the static method BidsHedIssue.fromHedIssues()
, which will return an array of BidsHedIssue
objects. This is a bug in the interface that will be fixed in a future release.
Validation is performed by calling the BidsFile.validate(schemas)
method on any file object (BidsSidecar
, BidsJsonFile
, and BidsTsvFile
are all subclasses of BidsFile
), passing the Schemas
object returned by buildBidsSchemas()
. This method returns an array of BidsHedIssue
objects corresponding to the validation issues found.
Further changes to the API may be considered in a future release.
What's Changed
- Updated the config to include score 2.0.0 by @VisLab in #204
- Added develop branch to github ci action by @VisLab in #207
- Rewrite of tokenizer and introduction of object-based test cases by @VisLab in #208
- Working on separating the data from the tests by @VisLab in #209
- Reorganized the tests, eliminating internal log by @VisLab in #210
- General cleanup of schemas and schema parsing by @happy5214 in #211
- Update tokenizer -- removed extra delimiter tests in parser by @VisLab in #212
- Update tokenizer to handle (, x by @VisLab in #213
- Remove HED 2 support and reorganize code by @happy5214 in #216
- Updating of the tests by @VisLab in #215
- Added additional tests to bidsTests.spec by @VisLab in #217
- Started on the parsedHedTag tests by @VisLab in #218
- First pass at the update of the hed tag parsing by @VisLab in #219
- Rewrote jsonTests to eliminate the local log and simplify by @VisLab in #220
- Minor cleanup and change of bids/validator class names back by @VisLab in #221
- First pass at pulling unit validation down to tag level by @VisLab in #222
- First pass at value class validation in ParsedHedTag by @VisLab in #223
- Next pass at refactoring -- eliminating redundancies in validator section by @VisLab in #224
- Updated the validator -- now ready to work on definitions by @VisLab in #225
- Progressing on validation of special tags using a JSON specification of properties by @VisLab in #226
- Update tokenizer with more checks for special tags in sting parser by @VisLab in #227
- Refactored special and added more tests by @VisLab in #228
- Revised validator by @VisLab in #234
- Removal of unused portions of code by @VisLab in #235
- Added the spec-tests to the coverage by @VisLab in #236
- Added handling of duplicates across onset rows by @VisLab in #237
- Corrected handling of delay with temporal tag by @VisLab in #238
- Duration should be allowed in files without timeline by @VisLab in #239
- Updated action to correct code-climate complaint by @VisLab in #240
- Simplified the group checking and added separate definition syntax ch… by @VisLab in #243
- Create and use setters for private fields in SchemaTag by @happy5214 in #241
- revised the docs -- first pass by @VisLab in #245
- Second pass at fixing the readthedocs errors by @VisLab in #246
- Additional corrections of jsDoc for readthedocs by @VisLab in #247
- Delete unused RegexClass class by @happy5214 in #244
- Reorganized the source code under src/ by @VisLab in #248
- Removed sphinx-js because of security violations by @VisLab in #249
- Remove "sphinx" dev dependency by @happy5214 in #250
- Move issues to top level of src/ by @happy5214 in #251
- Delete last two skipped tests (in HED utility tests) by @happy5214 in #252
- Add Dependabot configuration by @happy5214 in #254
- Bump typedoc from 0.25.13 to 0.27.6 by @dependabot in #255
- Bump husky from 9.0.11 to 9.1.7 by @dependabot in #256
- Bump cross-fetch from 4.0.0 to 4.1.0 by @dependabot in #259
- Bump eslint-config-prettier from 9.1.0 to 10.0.1 by @dependabot in #258
- Bump semver from 7.6.0 to 7.6.3 by @dependabot in #257
- Bump unicode-name from 1.0.2 to 1.0.4 by @dependabot in #262
- Bump eslint-plugin-prettier from 5.1.3 to 5.2.3 by @dependabot in #263
- Bump date-fns from 3.6.0 to 4.1.0 by @dependabot in #264
- Bump typescript from 5.4.5 to 5.7.3 by @dependabot in #260
- Bump eslint from 8.22.0 to 9.18.0 by @dependabot in #261
- Bump date-and-time from 3.1.1 to 3.6.0 by @dependabot in #265
- Bump esbuild from 0.20.2 to 0.24.2 by @dependabot in #267
- Bump prettier from 3.2.5 to 3.4.2 by @d...
hed-validator v3.15.5
This release, which is nominally a patch release because it really contains no new user-facing features, is filled with a massive amount of bug fixes and code improvements. Highlights include:
- The tag parsing code above the tokenizer has been refactored into two classes.
- The
Memoizer
mixin was simplified back into a plain superclass. - JSON spec testing was added.
- Most of the plain
Error
objects thrown throughout the code have been replaced withIssueError
objects. - Validation of the
requireChild
schema attribute now occurs during tag conversion for HED 3 data. - Several other bugs were fixed.
- The CI was simplified.
What's Changed
- Streamline commands in package.json by @happy5214 in #166
- Fix XML file transformation by @happy5214 in #167
- Use commaMissing issue for missing comma before tag group by @happy5214 in #170
- Added codespell to the repository by @VisLab in #172
- Corrected COMMA MISSING hedCode to be COMMA_MISSING by @VisLab in #174
- Updated the NODE VERSION to latest for CI by @VisLab in #181
- Check if extension tag has valid name (allow UTF-8) by @VisLab in #185
- Initial commit of the spec testing by @VisLab in #186
- Separated the spec-tests into separate github action by @VisLab in #187
- Added Score 2.0.0 to the internal data by @VisLab in #188
- Started the implementation of special tag handling by @VisLab in #189
- Updated spec and corrected syntax error by @VisLab in #191
- Fix duplicate tag check by @happy5214 in #192
- Fix sidecar syntax issues by @happy5214 in #193
- Fix bug with tag group equivalence that was causing tests to fail by @happy5214 in #194
- Update spec -- corrected several tests and update JSON regex for value validation by @VisLab in #195
- Add isError method to Issue class by @happy5214 in #197
- Convert Memoizer back to plain class by @happy5214 in #199
- Move all throws of IssueError to new static method by @happy5214 in #201
- Throw errors from ParsedHedTag constructors instead of using field by @happy5214 in #200
- Move HED 3 requireChild testing to TagConverter and refactor that class by @happy5214 in #202
- Rewrite HED string parsing and splitting as classes by @happy5214 in #203
Full Changelog: v3.15.4...v3.15.5
hed-validator v3.15.4
This release revamps the internal error reporting by using a standard HED issue with the code internalError
(HED code GENERIC_ERROR
). This should help downstream users fix bugs.
The CI actions were also updated in a development-only fix.
What's Changed
- Update CI config by @happy5214 in #165
- Use BidsHedIssue and Issue for internal error reporting by @happy5214 in #164
Full Changelog: v3.15.3...v3.15.4
hed-validator v3.15.3
There are two small changes in this release. Almost all remaining direct uses of promises in the tests have been replaced with async
/await
syntax. Also, a type-checking bug in the BidsTsvFile
constructor preventing the direct use of Map
s as TSV data has been fixed.
What's Changed
- Replace remaining possible uses of promises with async/await by @happy5214 in #162
- Fix type-checking bug in BidsTsvFile constructor by @happy5214 in #163
Full Changelog: v3.15.2...v3.15.3