Skip to content

Commit

Permalink
Merge pull request #1685 from happy5214/bump-hed-validator-3.9.0
Browse files Browse the repository at this point in the history
Bump hed-validator dependency to v3.9.0
  • Loading branch information
rwblair authored Jun 29, 2023
2 parents 079546c + 280e6ab commit 0acd109
Show file tree
Hide file tree
Showing 11 changed files with 19,944 additions and 27,395 deletions.
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"root": true,
"plugins": ["prettier"],
"parserOptions": {
"ecmaVersion": 2018,
Expand Down
3 changes: 3 additions & 0 deletions bids-validator-web/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["eslint:recommended", "prettier", "next"],
}
5 changes: 2 additions & 3 deletions bids-validator-web/components/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ import bowser from 'bowser'
import Issues from '../components/Issues'
import BrowserWarning from './BrowserWarning'
import Validate from '../components/Validate'
import validate from 'bids-validator'
import validatorPackageJson from 'bids-validator/package.json'
import validate from '../../bids-validator'
import validatorPackageJson from 'bids-validator/package.json' assert { type: 'json' }
const version = validatorPackageJson.version

// component setup -----------------------------------------------------------

const initState = () => ({
dirName: '',
list: {},
Expand Down
9 changes: 5 additions & 4 deletions bids-validator-web/components/Issues.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@ class Issues extends React.Component {
let dirName = this.props.dirName

// counts
let totalErrors = 0
// let totalErrors = 0
let totalWarnings = 0
let warningCount, errorCount
let warningCount = 0
// let errorCount = 0
if (errors !== 'Invalid') {
totalErrors = errors.length
// totalErrors = errors.length
totalWarnings = warnings.length
warningCount = totalWarnings + ' ' + pluralize('Warning', totalWarnings)
errorCount = totalErrors + ' ' + pluralize('Error', totalErrors)
// errorCount = totalErrors + ' ' + pluralize('Error', totalErrors)
}
// messages
let specLink = (
Expand Down
28 changes: 4 additions & 24 deletions bids-validator-web/components/Upload.jsx
Original file line number Diff line number Diff line change
@@ -1,51 +1,31 @@
// dependencies -------------------------------------------------------

import React from 'react'
import ReactDOM from 'react-dom'

class Upload extends React.Component {
// life cycle events --------------------------------------------------

componentDidMount() {
ReactDOM.findDOMNode(this).setAttribute('webkitdirectory', true)
ReactDOM.findDOMNode(this).setAttribute('directory', true)
this._setRefs(this.refs)
}

render() {
return (
<input
type="file"
className="dirUpload-btn"
onClick={this._click.bind(this)}
onClick={this.props.onClick}
onChange={this._onFileSelect.bind(this)}
ref="fileSelect"
ref={this.fileSelectRef}
directory=""
webkitdirectory=""
/>
)
}

// custom methods -----------------------------------------------------

_click(e) {
ReactDOM.findDOMNode(this.refs.fileSelect).value = null
if (this.props.onClick) {
this.props.onClick(e)
}
}

_onFileSelect(e) {
if (e.target && e.target.files.length > 0) {
let files = e.target.files
let results = { list: files }
this.props.onChange(results)
}
}

_setRefs(refs) {
if (this.props.setRefs) {
this.props.setRefs(refs)
}
}
}

export default Upload
10 changes: 4 additions & 6 deletions bids-validator-web/next.config.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
// next.config.js
const withTM = require('next-transpile-modules')

module.exports = withTM({
transpileModules: ['bids-validator'],
module.exports = {
transpilePackages: ['bids-validator'],
assetPrefix: './',
webpack5: false,
webpack: (config, {}) => {
config.resolve.symlinks = false
config.watchOptions.ignored = '**/node_modules'
return config
},
})
}
11 changes: 7 additions & 4 deletions bids-validator-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,20 @@
"@babel/runtime": "^7.16.7",
"bootstrap": "^4.3.0",
"bowser": "^1.0.0",
"next": "^11.1.2",
"next-transpile-modules": "^2.3.1",
"eslint-config-next": "^13.4.7",
"next": "^13.4.7",
"pluralize": "^8.0.0",
"react": "^17.0.2",
"react": "^18.2.0",
"react-bootstrap": "^1.0.0-beta.5",
"react-dom": "^17.0.2",
"react-dom": "^18.2.0",
"sass": "^1.32.8"
},
"scripts": {
"dev": "next",
"build": "next build",
"start": "next start"
},
"devDependencies": {
"@next/eslint-plugin-next": "^13.4.7"
}
}
11 changes: 8 additions & 3 deletions bids-validator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
},
"./utils/consoleFormat": {
"require": "./dist/commonjs/consoleFormat.js"
}
},
"./package.json": "./package.json"
},
"scripts": {
"build": "node ./esbuild.mjs",
Expand Down Expand Up @@ -44,12 +45,15 @@
"date-fns": "^2.7.0",
"events": "^3.3.0",
"exifreader": "^4.1.0",
"hed-validator": "^3.8.0",
"hed-validator": "^3.10.0",
"ignore": "^4.0.2",
"is-utf8": "^0.2.1",
"jest": "^29.5.0",
"jshint": "^2.9.6",
"lerna": "^6.4.1",
"lodash": "^4.17.21",
"minimatch": "3.0.5",
"next": "13.4.7",
"nifti-js": "^1.0.1",
"p-limit": "^2.1.0",
"pako": "^1.0.6",
Expand All @@ -58,6 +62,7 @@
"semver": "^7.3.2",
"stream-browserify": "^3.0.0",
"table": "^5.2.3",
"util": "^0.12.5",
"xml2js": "^0.5.0",
"yaml": "^1.10.2",
"yargs": "^16.2.0"
Expand All @@ -71,7 +76,7 @@
"eslint": "^8.17.0",
"eslint-config-prettier": "^2.9.0",
"eslint-plugin-prettier": "^2.6.2",
"husky": "^1.0.0-rc.13",
"husky": "^8.0.3",
"lockfile": "^1.0.4",
"sync-request": "6.0.0"
},
Expand Down
7 changes: 6 additions & 1 deletion bids-validator/validators/events/hed.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@ export default function checkHedStrings(events, jsonContents, jsonFiles, dir) {
const eventData = constructEventData(events, jsonContents)
const sidecarData = constructSidecarData(events, jsonContents, jsonFiles)
const hedDataExists = detectHed(eventData, sidecarData)
console.log("in hed...")

Check failure on line 12 in bids-validator/validators/events/hed.js

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 14)

Unexpected console statement

Check failure on line 12 in bids-validator/validators/events/hed.js

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 14)

Replace `"in·hed..."` with `'in·hed...'`

Check failure on line 12 in bids-validator/validators/events/hed.js

View workflow job for this annotation

GitHub Actions / build (macos-latest, 14)

Unexpected console statement

Check failure on line 12 in bids-validator/validators/events/hed.js

View workflow job for this annotation

GitHub Actions / build (macos-latest, 14)

Replace `"in·hed..."` with `'in·hed...'`

Check failure on line 12 in bids-validator/validators/events/hed.js

View workflow job for this annotation

GitHub Actions / build (windows-latest, 14)

Unexpected console statement

Check failure on line 12 in bids-validator/validators/events/hed.js

View workflow job for this annotation

GitHub Actions / build (windows-latest, 14)

Replace `"in·hed..."` with `'in·hed...'`
console.log(jsonContents)

Check failure on line 13 in bids-validator/validators/events/hed.js

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 14)

Unexpected console statement

Check failure on line 13 in bids-validator/validators/events/hed.js

View workflow job for this annotation

GitHub Actions / build (macos-latest, 14)

Unexpected console statement

Check failure on line 13 in bids-validator/validators/events/hed.js

View workflow job for this annotation

GitHub Actions / build (windows-latest, 14)

Unexpected console statement
if (!hedDataExists) {
return Promise.resolve([])
}
console.log("heddata exists...")

Check failure on line 17 in bids-validator/validators/events/hed.js

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 14)

Unexpected console statement

Check failure on line 17 in bids-validator/validators/events/hed.js

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 14)

Replace `"heddata·exists..."` with `'heddata·exists...'`

Check failure on line 17 in bids-validator/validators/events/hed.js

View workflow job for this annotation

GitHub Actions / build (macos-latest, 14)

Unexpected console statement

Check failure on line 17 in bids-validator/validators/events/hed.js

View workflow job for this annotation

GitHub Actions / build (macos-latest, 14)

Replace `"heddata·exists..."` with `'heddata·exists...'`

Check failure on line 17 in bids-validator/validators/events/hed.js

View workflow job for this annotation

GitHub Actions / build (windows-latest, 14)

Unexpected console statement

Check failure on line 17 in bids-validator/validators/events/hed.js

View workflow job for this annotation

GitHub Actions / build (windows-latest, 14)

Replace `"heddata·exists..."` with `'heddata·exists...'`

const datasetDescription = jsonContents['/dataset_description.json']
const datasetDescriptionData = new hedValidator.validator.BidsJsonFile(
Expand Down Expand Up @@ -106,7 +109,9 @@ function sidecarValueHasHed(sidecarValue) {
return (
sidecarValue !== null &&
typeof sidecarValue === 'object' &&
sidecarValue.HED !== undefined
Object.values(sidecar).some(x => {

Check failure on line 112 in bids-validator/validators/events/hed.js

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 14)

'sidecar' is not defined

Check failure on line 112 in bids-validator/validators/events/hed.js

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 14)

Replace `x` with `(x)`

Check failure on line 112 in bids-validator/validators/events/hed.js

View workflow job for this annotation

GitHub Actions / build (macos-latest, 14)

'sidecar' is not defined

Check failure on line 112 in bids-validator/validators/events/hed.js

View workflow job for this annotation

GitHub Actions / build (macos-latest, 14)

Replace `x` with `(x)`

Check failure on line 112 in bids-validator/validators/events/hed.js

View workflow job for this annotation

GitHub Actions / build (windows-latest, 14)

'sidecar' is not defined

Check failure on line 112 in bids-validator/validators/events/hed.js

View workflow job for this annotation

GitHub Actions / build (windows-latest, 14)

Replace `x` with `(x)`
return x.HED !== undefined
})
)
}

Expand Down
Loading

0 comments on commit 0acd109

Please sign in to comment.