Releases: hed-standard/hed-javascript
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
hed-validator v3.15.2
The main feature of this release is a complete rewrite of the tag conversion code, merging it with the main parsing modules. A few bugs related to parsing were also fixed.
What's Changed
- Rewrite short/long converter by @happy5214 in #157
Full Changelog: v3.15.1...v3.15.2
hed-validator v3.15.1
This version contains no substantive changes to the code. An indirect dependency was bumped to satisfy npm audit
, and a GitHub Action was added to (hopefully) directly publish GitHub releases to npm. This should also remove an extraneous testing module that was left in several prior releases, which bloated their sizes.
What's Changed
- Bump get-func-name dependency to fix npm audit hit by @happy5214 in #160
- Publish npm releases from GitHub Actions by @happy5214 in #161
Full Changelog: v3.15.0...v3.15.1
hed-validator v3.15.0
This version introduces a revamped interface for BIDS dataset validation. The recommended method of validating BIDS data is now as follows:
- Construct a
BidsJsonFile
object fordataset_description.json
. - Construct a
Schemas
object withbuildBidsSchema()
. - For each file to be validated, construct a
BidsSidecar
orBidsTsvFile
(as appropriate) and call itsvalidate()
method.
Version 8.3.0 of the HED standard schema is now bundled with this validator.
What's Changed
- More async usage by @happy5214 in #154
- Add dataset_description.json as file for certain internal errors by @happy5214 in #155
- Bump braces from 3.0.2 to 3.0.3 by @dependabot in #156
- Add to BIDS interface by @happy5214 in #158
- Add HED standard v8.3.0 schema by @happy5214 in #159
Full Changelog: v3.14.0...v3.15.0
hed-validator v3.14.0
This release includes support for lazily merging partnered schemas into a single Schema
object.
Several interfaces related to schema loading that were deprecated in version 3.13.5 have been removed. The only official method of directly building a Schemas
object is now by passing a SchemasSpec
object to hedValidator.validator.buildSchemas()
and resolving the resulting Promise
. A Schemas
object is also generated internally by hedValidator.bids.validateBidsDataset()
, using either a SchemasSpec
object passed as the second parameter to that function or the "HEDVersion"
field of the BidsDataset
object's "dataset_description.json"
BidsJsonFile
.
HED-2G support is officially deprecated with this release, and it will be removed in version 4. Any aspect of HED-2G that was unused "in the field" may be removed earlier at the development team's discretion.
What's Changed
- Implement support for merging lazy partnered schemas by @happy5214 in #147
- Remove experimental schema loading code by @happy5214 in #152
Full Changelog: v3.13.5...v3.14.0
hed-validator v3.13.5
This is an intermediate release while the lazy partnered schema functionality (planned for version 3.14.0) is being finished. Features include the inclusion of line numbers for most issues in BIDS TSV files (fixing a long-lived request), fixing downloads of remotely loaded schemas from GitHub (ones which aren't bundled with the validator itself or loaded from a local file), and various other small fixes. The dependency list has been comprehensively updated, with all dependencies now referring to their latest versions except ESLint and Chai (which are incompatible with the minimum Node version for this validator).
As of this release, all interfaces related to schema loading that do not correspond to the current HED 3 specification, which were all provisional and unofficial, are now deprecated and will be removed in 3.14.0.
What's Changed
- Add TSV line numbers to TSV-related issue messages by @happy5214 in #144
- Switch HTTP requests from then-request to Fetch API by @happy5214 in #148
- Various fixes ported from the lazy partnered schemas branch by @happy5214 in #149
Full Changelog: v3.13.4...v3.13.5