bids-standard / legacy-validator

Validator for the Brain Imaging Data Structure
https://bids-standard.github.io/legacy-validator/
MIT License
186 stars 111 forks source link

feat(deno): Retrieve version from import.meta.url or git, when possible #1985

Closed effigies closed 5 months ago

effigies commented 5 months ago
❯ deno run --reload --allow-all https://github.com/effigies/bids-validator/raw/enh/deno-version/bids-validator/src/bids-validator.ts --version
bids-validator enh/deno-version
❯ deno run --allow-all bids-validator/src/bids-validator.ts --version
bids-validator v1.14.7-dev.0-38-g5314ea00

Should emit the right version for released versions on deno.land. We can improve it for untagged versions in the future.

codecov[bot] commented 5 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 85.68%. Comparing base (07cbca5) to head (748cf3c).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1985 +/- ## ======================================= Coverage 85.68% 85.68% ======================================= Files 91 91 Lines 3792 3792 Branches 1220 1220 ======================================= Hits 3249 3249 Misses 457 457 Partials 86 86 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

effigies commented 5 months ago

Bummer...

x Build failed in 2.07s
error during build:
Error: [vite:esbuild-transpile] Transform failed with 1 error:
assets/index-!~{001}~.js:5620:43: ERROR: Top-level await is not available in the configured target environment ("chrome87", "edge88", "es2020", "firefox78", "safari14" + 2 overrides)

Top-level await is not available in the configured target environment ("chrome87", "edge88", "es2020", "firefox78", "safari14" + 2 overrides)
5618|  new Command().name("bids-validator").type("debugLevel", new EnumType(LogLevelNames)).description(
5619|    "This tool checks if a dataset in a given directory is compatible with the Brain Imaging Data Structure specification. To learn more about Brain Imaging Data Structure visit http://bids.neuroimaging.io/"
5620|  ).arguments("<dataset_directory>").version(await getVersion()).option("--json", "Output machine readable JSON").option(
   |                                             ^
5621|    "-s, --schema <type:string>",
5622|    "Specify a schema version to use for validation",
effigies commented 5 months ago

I think this should be good to go.

effigies commented 5 months ago

Rebased to resolve tests (I hope).