Skip to content

3.0.0 Release - #89

Merged
jayakishore709 merged 55 commits into
mainfrom
feature/groundwater
Jul 14, 2026
Merged

3.0.0 Release#89
jayakishore709 merged 55 commits into
mainfrom
feature/groundwater

Conversation

@jayakishore709

Copy link
Copy Markdown
Contributor

No description provided.

marykruk and others added 30 commits October 8, 2024 11:50
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.
Use same logic as existing warning and apply only to surface water media
nlibera2 and others added 25 commits June 24, 2026 14:37
- 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.
… 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.
@jayakishore709
jayakishore709 merged commit 6744732 into main Jul 14, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants