Skip to content

Commit

Permalink
chore: Update valibot to latest version and fix
Browse files Browse the repository at this point in the history
deprecations
  • Loading branch information
LekoArts committed Nov 3, 2023
1 parent aad55c7 commit b591967
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 13 deletions.
5 changes: 5 additions & 0 deletions .changeset/loud-swans-dance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"secco": patch
---

Update `valibot` to latest version and handle deprecations
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"dev-cli",
"developer-tools"
],
"exports": "dist/cli.mjs",
"exports": "./dist/cli.mjs",
"bin": {
"secco": "dist/cli.mjs"
},
Expand Down Expand Up @@ -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"
},
Expand Down
8 changes: 4 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions src/utils/config.ts
Original file line number Diff line number Diff line change
@@ -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'

Expand All @@ -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)
Expand Down Expand Up @@ -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'),
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"module": "ESNext",
"moduleResolution": "Bundler",
"types": ["vitest/globals"],
"strict": true,
"allowSyntheticDefaultImports": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true
},
"include": ["src/**/*", "integration/**/*"],
Expand Down

0 comments on commit b591967

Please # to comment.