Skip to content

Commit 3c61f46

Browse files
authored
Merge pull request #208 from effigies/feat/display-version
feat: Display version in web app
2 parents 2e6a949 + cf06757 commit 3c61f46

File tree

3 files changed

+54
-2
lines changed

3 files changed

+54
-2
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<!--
2+
A new scriv changelog fragment.
3+
4+
Uncomment the section that is right (remove the HTML comment wrapper).
5+
For top level release notes, leave all the headers commented out.
6+
-->
7+
8+
### Added
9+
10+
- Display version in web app
11+
12+
<!--
13+
### Changed
14+
15+
- A bullet item for the Changed category.
16+
17+
-->
18+
<!--
19+
### Fixed
20+
21+
- A bullet item for the Fixed category.
22+
23+
-->
24+
<!--
25+
### Deprecated
26+
27+
- A bullet item for the Deprecated category.
28+
29+
-->
30+
<!--
31+
### Removed
32+
33+
- A bullet item for the Removed category.
34+
35+
-->
36+
<!--
37+
### Security
38+
39+
- A bullet item for the Security category.
40+
41+
-->
42+
<!--
43+
### Infrastructure
44+
45+
- A bullet item for the Infrastructure category.
46+
47+
-->

src/main.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { consoleFormat, resultToJSONStr } from './utils/output.ts'
1010
import { setupLogging } from './utils/logger.ts'
1111
import type { ValidationResult } from './types/validation-result.ts'
1212
export type { ValidationResult } from './types/validation-result.ts'
13+
export { getVersion } from './version.ts'
1314

1415
/**
1516
* Validation entrypoint intended for command line usage with Deno

web/src/App.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import React, { useState } from "react"
22
import "./App.css"
33
import { directoryOpen } from "https://esm.sh/[email protected]"
4-
import confetti, { create } from 'https://cdn.jsdelivr.net/npm/[email protected]/dist/confetti.module.mjs';
5-
import { fileListToTree, validate } from "../dist/validator/main.js"
4+
import confetti from 'https://cdn.jsdelivr.net/npm/[email protected]/dist/confetti.module.mjs';
5+
import { fileListToTree, validate, getVersion } from "../dist/validator/main.js"
66
import type { ValidationResult } from "../../src/types/validation-result.ts"
77
import { Collapse } from "./Collapse.tsx"
88
import { Summary } from "./Summary.tsx"
@@ -57,6 +57,9 @@ function App() {
5757
setValidation(await validate(fileTree, {}))
5858
}
5959

60+
const [version, setVersion] = useState<string>()
61+
getVersion().then((v) => { setVersion(v) })
62+
6063
let validatorOutput
6164

6265
if (validation) {
@@ -130,6 +133,7 @@ function App() {
130133
<>
131134
<h1>BIDS Validator</h1>
132135
{validatorOutput}
136+
<div><em>BIDS Validator version: {version}</em></div>
133137
<div>
134138
Note: Selecting a dataset only performs validation. Files are never
135139
uploaded.

0 commit comments

Comments
 (0)