From b5919678e8af4b8b02bfe253d5bddf79062889a6 Mon Sep 17 00:00:00 2001 From: LekoArts Date: Fri, 3 Nov 2023 11:44:31 +0100 Subject: [PATCH] chore: Update valibot to latest version and fix deprecations --- .changeset/loud-swans-dance.md | 5 +++++ package.json | 4 ++-- pnpm-lock.yaml | 8 ++++---- src/utils/config.ts | 12 ++++++------ tsconfig.json | 2 +- 5 files changed, 18 insertions(+), 13 deletions(-) create mode 100644 .changeset/loud-swans-dance.md diff --git a/.changeset/loud-swans-dance.md b/.changeset/loud-swans-dance.md new file mode 100644 index 0000000..9958d2b --- /dev/null +++ b/.changeset/loud-swans-dance.md @@ -0,0 +1,5 @@ +--- +"secco": patch +--- + +Update `valibot` to latest version and handle deprecations diff --git a/package.json b/package.json index 7f9b99a..0d36c1b 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "dev-cli", "developer-tools" ], - "exports": "dist/cli.mjs", + "exports": "./dist/cli.mjs", "bin": { "secco": "dist/cli.mjs" }, @@ -63,7 +63,7 @@ "pathe": "^1.1.1", "rc9": "^2.1.1", "signal-exit": "^4.1.0", - "valibot": "^0.20.0", + "valibot": "^0.20.1", "verdaccio": "^5.27.0", "yargs": "^17.7.2" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index caae57c..dc7ecaa 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -48,8 +48,8 @@ dependencies: specifier: ^4.1.0 version: 4.1.0 valibot: - specifier: ^0.20.0 - version: 0.20.0 + specifier: ^0.20.1 + version: 0.20.1 verdaccio: specifier: ^5.27.0 version: 5.27.0(typanion@3.14.0) @@ -5642,8 +5642,8 @@ packages: hasBin: true dev: false - /valibot@0.20.0: - resolution: {integrity: sha512-a2Vy4oPIHvrwfPZF0Cl83yBn17Zgekp6IQ0PzdUFTPWtlwWFCJNHtOm/nypzv5o/6llKBsIEErswWHbvjNGzNw==} + /valibot@0.20.1: + resolution: {integrity: sha512-7lToTLG5wtK76u32gq8dUK0bAw7bknTGbeNSKRJunAC2soGVnNrKngg+38Jjt6FOwH+MshUONHoFz+LgmjeYKQ==} dev: false /validate-npm-package-license@3.0.4: diff --git a/src/utils/config.ts b/src/utils/config.ts index 510c1a2..2ee4aa3 100644 --- a/src/utils/config.ts +++ b/src/utils/config.ts @@ -1,7 +1,7 @@ import process from 'node:process' import { isAbsolute } from 'node:path' import { read, write } from 'rc9' -import { type Output, ValiError, object, parse, safeParse, strict, string, toTrimmed } from 'valibot' +import { type Output, ValiError, never, object, parse, safeParse, string, toTrimmed } from 'valibot' import { CLI_NAME, CONFIG_FILE_NAME } from '../constants' import { logger } from './logger' @@ -13,7 +13,7 @@ export const configOptions = { flat: false, } -const EmptyObjectSchema = strict(object({})) +const EmptyObjectSchema = object({}, never()) function isEmpty(input: unknown) { const result = safeParse(EmptyObjectSchema, input) @@ -60,11 +60,11 @@ function sourcePathSchema(name: string) { ]) } -const ConfigSchema = strict(object({ - source: strict(object({ +const ConfigSchema = object({ + source: object({ path: sourcePathSchema('source.path'), - })), -})) + }, never()), +}, never()) const envSchema = object({ SECCO_SOURCE_PATH: sourcePathSchema('SECCO_SOURCE_PATH'), diff --git a/tsconfig.json b/tsconfig.json index 44f894c..3c311ac 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,9 +5,9 @@ "module": "ESNext", "moduleResolution": "Bundler", "types": ["vitest/globals"], + "strict": true, "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, - "strict": true, "skipLibCheck": true }, "include": ["src/**/*", "integration/**/*"],