Skip to content

Commit 688ebc2

Browse files
committed
feat: Display version in web app
1 parent 54eeee3 commit 688ebc2

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

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)