3.0.0 Release - #89
Merged
Merged
Conversation
Add groundwater-related fields to the schema - Add 17 new field definitions with Strict/Loose enum patterns - Add WQX mappings and custom field support in build-lib.js - Refactor build-values.js to process custom (non-WQX) fields - Update all schema flavors with new properties and dependencies - Add toFriendlyName() utility with unit tests
Updates ajv-cmd to 0.13.0 and refactors source schema $ids and $refs so
that JSON Schema URL resolution works without relying on cwd-based
filesystem fallbacks (removed in @apidevtools/json-schema-ref-parser v15).
Schema changes:
- Top-level $ids in src/{primary,extract,frontend,backend,quality-control,
definitions}.json now end in .json, mirroring filenames so relative refs
resolve correctly under standard URL resolution.
- bin/build-values.js generates value-file $ids matching their filenames
(.legacy.json/.primary.json) instead of .loose.json/.strict.json.
- Fixed leaf $id drift in logic/ResultUnit-Salinity.json and
quality-control/ResultDetectionQuantitationLimitMeasure-Minimum.json.
- $refs to wqx switched from filesystem path to its $id URL
(https://epa.gov/wqx/definitions.json).
- $refs to ./values/* in definitions.json switched to absolute URLs to
sidestep a ref-parser v15 bug that misroutes relative refs in the root
document to FileResolver.
Build changes:
- bin/build: dropped `cd src` indirection in deref step; added -r flags
for wqx, definitions, logic, quality-control, and values so installFetch
Cache resolves all referenced schemas locally.
BREAKING CHANGE: published $ids changed (e.g. https://datastream.org/
schema/data/backend → https://datastream.org/schema/data/backend.json).
Consumers must update their $refs accordingly when
bumping @datastreamapp/data-schema.
Replace AVA with `node --test` and `node:assert/strict`. Tests use only a small subset of AVA's API (t.is, t.true, t.false, t.deepEqual, t.pass) which maps cleanly onto node:assert. Coverage now uses Node's built-in --experimental-test-coverage instead of c8.
also improved unit tests
Use same logic as existing warning and apply only to surface water media
- New error rule CharacteristicName-Depth-ActivityDepthHeightMeasure forbids ActivityDepthHeightMeasure/Unit when CharacteristicName measures depth (e.g. "Depth of water column"). - New QC warning ResultStatusID-Deprecated for the retired values "Final" and "Accepted" (use Preliminary, Provisional, or Validated). - Split the AnalysisStartTime/AnalysisStartTimeZone co-dependency — time without timezone is now a QC warning; timezone without time stays an error.
Q2 2026 Updates
… updates - ActivityGroupType: drop the WQX base and generate from additions (keep Other); 7 values - Promote ActivityMediaName-ActivityDepthHeightMeasure-Maximum to a blocking error - Trim the matching QC warning to Groundwater/Porewater only - Remove Sample-Depletion Replicate from the ActivityType allowed subset - Map Water level elevation and Nitrobenzene-D5 to CharacteristicWQXGroups - Add a build-time check for subset ActivityTypes missing a group mapping - Regenerate values for the wqx 3.0.276 bump; update tests and CHANGELOG
reformat all hand-maintained source JSON and JS. Build-generated src/values and src/locales are excluded via .prettierignore.
Five locale files (ResultAnalyticalMethodContext, ResultSampleFraction, MonitoringLocationType, MonitoringLocationHorizontalCoordinateReferenceSystem, ResultStatusID) each held their data twice — once under a top-level wrapper key and once flat. A wrapped file left build-locales.js with no top-level `values`, so its `??=` fill appended a fresh flat block on every build. Collapse each back to a single flat name/description/values structure, preserving the human translations and current enum membership. Harden build-locales.js with a two-phase, fail-fast pass: load and validate every file (rejecting any unexpected top-level key) before writing any, so a malformed file aborts the build instead of silently duplicating — and can never truncate a good file via a mid-run throw.
…e fields Bring EventID, WellID, AquiferCode, SampleCollectionMethodID, and SampleCollectionMethodName to parity with existing text columns like LaboratorySampleID: add them to the CSVInjection logic rule and add a WhiteSpace quality-control rule for each.
…vityGroupType Add French names for the six current ActivityGroupType values and remove the five deprecated entries (Field Set, QC Sample, Replicate, Subsample, Trip) that are no longer in the enum.
Keep errorMessage in the shared definitions build (so frontend/extract inherit it) and strip it only for the published json-schema/definitions.json copy, which stays byte-identical. primary/backend still strip per-flavour. Add regression tests asserting the friendly messages surface.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.