Skip to content

Commit

Permalink
fix(valibot-validator): use tsup and fix esm/cjs (#753)
Browse files Browse the repository at this point in the history
* fix(valibot-validator): use `tsup` and fix esm/cjs

* chore(valibot-validator): remove build tsconfigs

* chore(.changeset): add changeset

* fix(valibot-validator): replace jest config extension with `.cjs`
  • Loading branch information
MonsterDeveloper authored Sep 28, 2024
1 parent cb126e0 commit 9639103
Show file tree
Hide file tree
Showing 7 changed files with 96 additions and 24 deletions.
5 changes: 5 additions & 0 deletions .changeset/violet-tools-flow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@hono/valibot-validator': patch
---

Fix ESM/CJS exports and use `tsup` for building
File renamed without changes.
18 changes: 11 additions & 7 deletions packages/valibot-validator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,21 @@
"name": "@hono/valibot-validator",
"version": "0.3.0",
"description": "Validator middleware using Valibot",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"types": "dist/esm/index.d.ts",
"type": "module",
"main": "dist/index.js",
"exports": {
"./package.json": "./package.json",
".": {
"import": "./dist/index.js",
"default": "./dist/index.cjs"
}
},
"files": [
"dist"
],
"scripts": {
"test": "jest",
"build:cjs": "tsc -p tsconfig.cjs.json",
"build:esm": "tsc -p tsconfig.esm.json",
"build": "rimraf dist && yarn build:cjs && yarn build:esm",
"build": "tsup",
"prerelease": "yarn build && yarn test",
"release": "yarn publish"
},
Expand All @@ -33,7 +37,7 @@
"devDependencies": {
"hono": "^4.5.1",
"jest": "^29.7.0",
"rimraf": "^5.0.5",
"tsup": "^8.3.0",
"valibot": "^0.31.0"
}
}
8 changes: 0 additions & 8 deletions packages/valibot-validator/tsconfig.cjs.json

This file was deleted.

8 changes: 0 additions & 8 deletions packages/valibot-validator/tsconfig.esm.json

This file was deleted.

9 changes: 9 additions & 0 deletions packages/valibot-validator/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { defineConfig } from "tsup";

export default defineConfig({
entryPoints: ["src/index.ts"],
format: ["cjs", "esm"],
dts: true,
outDir: "dist",
clean: true,
});
72 changes: 71 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2686,7 +2686,7 @@ __metadata:
dependencies:
hono: "npm:^4.5.1"
jest: "npm:^29.7.0"
rimraf: "npm:^5.0.5"
tsup: "npm:^8.3.0"
valibot: "npm:^0.31.0"
peerDependencies:
hono: ">=3.9.0"
Expand Down Expand Up @@ -9749,6 +9749,18 @@ __metadata:
languageName: node
linkType: hard

"fdir@npm:^6.3.0":
version: 6.3.0
resolution: "fdir@npm:6.3.0"
peerDependencies:
picomatch: ^3 || ^4
peerDependenciesMeta:
picomatch:
optional: true
checksum: be91cd6ab2edbc6df457a69b79672ee9345996986821918ef01908ce9619b8cbecd9c6c13d4ca5d0aeb548b162050d68c599f45bb3fbff194a91e16f25e646b5
languageName: node
linkType: hard

"fecha@npm:^4.2.0":
version: 4.2.3
resolution: "fecha@npm:4.2.3"
Expand Down Expand Up @@ -16092,6 +16104,13 @@ __metadata:
languageName: node
linkType: hard

"picomatch@npm:^4.0.2":
version: 4.0.2
resolution: "picomatch@npm:4.0.2"
checksum: 7c51f3ad2bb42c776f49ebf964c644958158be30d0a510efd5a395e8d49cb5acfed5b82c0c5b365523ce18e6ab85013c9ebe574f60305892ec3fa8eee8304ccc
languageName: node
linkType: hard

"pidtree@npm:^0.6.0":
version: 0.6.0
resolution: "pidtree@npm:0.6.0"
Expand Down Expand Up @@ -18566,6 +18585,16 @@ __metadata:
languageName: node
linkType: hard

"tinyglobby@npm:^0.2.1":
version: 0.2.6
resolution: "tinyglobby@npm:0.2.6"
dependencies:
fdir: "npm:^6.3.0"
picomatch: "npm:^4.0.2"
checksum: d7b5eb4c5b9c341f961c1d3c30624f9a1e22b27b48a79a65b48120245a77c143827f75f5854628fef1a4bd4bc3cfaf06ce76497f3a574e3f933229c5e556e5fe
languageName: node
linkType: hard

"tinypool@npm:^0.7.0":
version: 0.7.0
resolution: "tinypool@npm:0.7.0"
Expand Down Expand Up @@ -19080,6 +19109,47 @@ __metadata:
languageName: node
linkType: hard

"tsup@npm:^8.3.0":
version: 8.3.0
resolution: "tsup@npm:8.3.0"
dependencies:
bundle-require: "npm:^5.0.0"
cac: "npm:^6.7.14"
chokidar: "npm:^3.6.0"
consola: "npm:^3.2.3"
debug: "npm:^4.3.5"
esbuild: "npm:^0.23.0"
execa: "npm:^5.1.1"
joycon: "npm:^3.1.1"
picocolors: "npm:^1.0.1"
postcss-load-config: "npm:^6.0.1"
resolve-from: "npm:^5.0.0"
rollup: "npm:^4.19.0"
source-map: "npm:0.8.0-beta.0"
sucrase: "npm:^3.35.0"
tinyglobby: "npm:^0.2.1"
tree-kill: "npm:^1.2.2"
peerDependencies:
"@microsoft/api-extractor": ^7.36.0
"@swc/core": ^1
postcss: ^8.4.12
typescript: ">=4.5.0"
peerDependenciesMeta:
"@microsoft/api-extractor":
optional: true
"@swc/core":
optional: true
postcss:
optional: true
typescript:
optional: true
bin:
tsup: dist/cli-default.js
tsup-node: dist/cli-node.js
checksum: 7f7132e48fca2284fd721077c6462c440dabdc95bcacf2e9837f81d2ca9771f804ff4f8b81a743e8fc6c3def856cf3ae99421c0568a7f030196abdc9e12e97e8
languageName: node
linkType: hard

"tsutils@npm:^3.21.0":
version: 3.21.0
resolution: "tsutils@npm:3.21.0"
Expand Down

0 comments on commit 9639103

Please sign in to comment.