From 236af41e4c3b4d1eb1c7e2d1d0b3e61368c8596d Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Thu, 29 Feb 2024 16:10:50 -0500 Subject: [PATCH 1/4] fix(dep): Update import location for readAll, readerFromStreamReader --- bids-validator/src/deps/stream.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bids-validator/src/deps/stream.ts b/bids-validator/src/deps/stream.ts index a97c18586..f09b84092 100644 --- a/bids-validator/src/deps/stream.ts +++ b/bids-validator/src/deps/stream.ts @@ -1,4 +1,4 @@ export { readAll, readerFromStreamReader, -} from 'std/streams/mod.ts' +} from 'std/io/mod.ts' From 242a148184da68121da275151b679a41647a4340 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Thu, 29 Feb 2024 16:16:29 -0500 Subject: [PATCH 2/4] Upgrade deno.ladn/std@0.217.0 --- bids-validator/deno.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bids-validator/deno.json b/bids-validator/deno.json index 181d3e5b4..1ac3692b9 100644 --- a/bids-validator/deno.json +++ b/bids-validator/deno.json @@ -1,6 +1,6 @@ { "imports": { - "std/": "https://deno.land/std@0.214.0/" + "std/": "https://deno.land/std@0.217.0/" }, "tasks": { "test": "deno test -A src/tests/" From 0c53ce5d7f74b923b552bc3439320bcb0ae4eeb7 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Thu, 29 Feb 2024 16:27:38 -0500 Subject: [PATCH 3/4] fix(deps): deprecated path.separator.SEP --- bids-validator/src/deps/path.ts | 2 +- bids-validator/src/files/browser.ts | 4 ++-- bids-validator/src/validators/filenameIdentify.ts | 4 ++-- bids-validator/src/validators/filenameValidate.ts | 4 ++-- bids-validator/src/validators/isBidsy.ts | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/bids-validator/src/deps/path.ts b/bids-validator/src/deps/path.ts index cac5781f2..4d3eef024 100644 --- a/bids-validator/src/deps/path.ts +++ b/bids-validator/src/deps/path.ts @@ -7,5 +7,5 @@ export { extname, fromFileUrl, parse, + SEPARATOR, } from 'std/path/mod.ts' -export { SEP } from 'std/path/separator.ts' diff --git a/bids-validator/src/files/browser.ts b/bids-validator/src/files/browser.ts index c88045697..674eb341a 100644 --- a/bids-validator/src/files/browser.ts +++ b/bids-validator/src/files/browser.ts @@ -1,7 +1,7 @@ import { BIDSFile } from '../types/file.ts' import { FileTree } from '../types/filetree.ts' import { FileIgnoreRules } from './ignore.ts' -import { parse, join, SEP } from '../deps/path.ts' +import { parse, join, SEPARATOR } from '../deps/path.ts' /** * Browser implement of BIDSFile wrapping native File/FileList types @@ -60,7 +60,7 @@ export function fileListToTree(files: File[]): Promise { // Top level file tree.files.push(file) } else { - const levels = fPath.dir.split(SEP).slice(1) + const levels = fPath.dir.split(SEPARATOR).slice(1) let currentLevelTree = tree for (const level of levels) { const exists = currentLevelTree.directories.find( diff --git a/bids-validator/src/validators/filenameIdentify.ts b/bids-validator/src/validators/filenameIdentify.ts index f286f807f..033e37b4e 100644 --- a/bids-validator/src/validators/filenameIdentify.ts +++ b/bids-validator/src/validators/filenameIdentify.ts @@ -12,7 +12,7 @@ * object in the schema for reference. */ // @ts-nocheck -import { SEP } from '../deps/path.ts' +import { SEPARATOR } from '../deps/path.ts' import { GenericSchema, Schema } from '../types/schema.ts' import { BIDSContext } from '../schema/context.ts' import { lookupModality } from '../schema/modalities.ts' @@ -71,7 +71,7 @@ export async function datatypeFromDirectory(schema, context) { const subFormat = schema.objects.formats[subEntity.format] const sesEntity = schema.objects.entities.session.name const sesFormat = schema.objects.formats[sesEntity.format] - const parts = context.file.path.split(SEP) + const parts = context.file.path.split(SEPARATOR) let datatypeIndex = 2 if (parts[0] !== '') { // we assume paths have leading '/' diff --git a/bids-validator/src/validators/filenameValidate.ts b/bids-validator/src/validators/filenameValidate.ts index aaf8efce5..9a4d18506 100644 --- a/bids-validator/src/validators/filenameValidate.ts +++ b/bids-validator/src/validators/filenameValidate.ts @@ -2,7 +2,7 @@ import { CheckFunction, RuleCheckFunction } from '../types/check.ts' import { DatasetIssues } from '../issues/datasetIssues.ts' import { BIDSContext } from '../schema/context.ts' import { GenericSchema, Schema, Entity, Format } from '../types/schema.ts' -import { SEP } from '../deps/path.ts' +import { SEPARATOR } from '../deps/path.ts' import { hasProp } from '../utils/objectPathHandler.ts' const sidecarExtensions = ['.json', '.tsv', '.bvec', '.bval'] @@ -25,7 +25,7 @@ export async function filenameValidate( } export function isAtRoot(context: BIDSContext) { - if (context.file.path.split(SEP).length !== 2) { + if (context.file.path.split(SEPARATOR).length !== 2) { return false } return true diff --git a/bids-validator/src/validators/isBidsy.ts b/bids-validator/src/validators/isBidsy.ts index bfcd81799..0828accae 100644 --- a/bids-validator/src/validators/isBidsy.ts +++ b/bids-validator/src/validators/isBidsy.ts @@ -3,7 +3,7 @@ * derivatives to have the lowest common denomenator of bids like file names. */ // @ts-nocheck -import { SEP } from '../deps/path.ts' +import { SEPARATOR } from '../deps/path.ts' import { BIDSContext } from '../schema/context.ts' import { CheckFunction } from '../../types/check.ts' import { BIDSFile } from '../types/file.ts' From 5f1f015fa56763c07dba7475e4ab9459f75fe518 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Thu, 29 Feb 2024 16:32:23 -0500 Subject: [PATCH 4/4] fix(deps): deprecation of logger.warning --- bids-validator/src/deps/logger.ts | 6 +++--- bids-validator/src/utils/logger.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bids-validator/src/deps/logger.ts b/bids-validator/src/deps/logger.ts index 7d9fe959b..67e9717fd 100644 --- a/bids-validator/src/deps/logger.ts +++ b/bids-validator/src/deps/logger.ts @@ -1,14 +1,14 @@ export { + ConsoleHandler, critical, debug, error, getLogger, info, Logger, + LogLevelNames, LogLevels, setup, - warning, + warn, } from "std/log/mod.ts" -export { ConsoleHandler } from "std/log/console_handler.ts" -export { LogLevelNames } from "std/log/levels.ts" export type { LevelName } from "std/log/mod.ts" diff --git a/bids-validator/src/utils/logger.ts b/bids-validator/src/utils/logger.ts index 2349ccac5..1b6fe75ff 100644 --- a/bids-validator/src/utils/logger.ts +++ b/bids-validator/src/utils/logger.ts @@ -40,7 +40,7 @@ const loggerProxyHandler = { const callerLocation = parseStack(stack) logger.debug(`Logger invoked at "${callerLocation}"`) } - const logFunc = logger[prop] as typeof logger.warning + const logFunc = logger[prop] as typeof logger.warn return logFunc.bind(logger) }, }