Skip to content

Commit ed6b68d

Browse files
Shuunenjordan-boyer
authored andcommitted
chore: update dependencies and use strip types
1 parent 2ca5ec1 commit ed6b68d

File tree

8 files changed

+40
-36
lines changed

8 files changed

+40
-36
lines changed

.vscode/settings.json

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
{
2-
"editor.quickSuggestions": {
3-
"strings": "on"
4-
},
5-
// prioritize ArkType's "type" for autoimports
6-
"typescript.preferences.autoImportSpecifierExcludeRegexes": [
7-
"^(node:)?os$"
8-
],
9-
"cSpell.words": [
10-
"arktype",
11-
"valibot"
12-
],
2+
"cSpell.words": [
3+
"arktype",
4+
"valibot"
5+
],
6+
"editor.quickSuggestions": {
7+
"strings": "on"
8+
},
9+
// prioritize ArkType's "type" for autoimports
10+
"typescript.preferences.autoImportSpecifierExcludeRegexes": [
11+
"^(node:)?os$"
12+
],
13+
"typescript.tsdk": "node_modules\\typescript\\lib"
1314
}

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ Make sure you have [Bun](https://bun.sh) v1.1.x then :
1818
# install the dependencies
1919
bun install
2020
# run each file once just to verify that everything is working as expected
21-
bun bench --runs 1
21+
bun check:once
2222
# run the benchmarks
23-
bun bench --runs 50
23+
bun bench
2424
```
2525

2626
At the time of writing, Node 22 is around 2 times slower than Bun v1 ^^'

bun.lock

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,36 @@
33
"workspaces": {
44
"": {
55
"dependencies": {
6-
"arktype": "^2.0",
6+
"arktype": "^2.1",
77
"valibot": "latest",
88
"zod": "^3.24",
99
},
1010
"devDependencies": {
1111
"@tsconfig/strictest": "^2.0",
1212
"@types/bun": "latest",
13-
"repo-check": "^1.40",
14-
"typescript": "^5.7",
13+
"repo-check": "^1.42",
14+
"typescript": "^5.8",
1515
},
1616
},
1717
},
1818
"packages": {
19-
"@ark/schema": ["@ark/schema@0.39.0", "", { "dependencies": { "@ark/util": "0.39.0" } }, "sha512-LQbQUb3Sj461LgklXObAyUJNtsUUCBxZlO2HqRLYvRSqpStm0xTMrXn51DwBNNxeSULvKVpXFwoxiSec9kwKww=="],
19+
"@ark/schema": ["@ark/schema@0.43.1", "", { "dependencies": { "@ark/util": "0.43.1" } }, "sha512-B28ceusolthB9bmHQEG9Lp16keUTt5JhuoB9Uhaw7MQh9+ODSbH4d2KJDD/yrMSeoXiNqEGuWmhlR6YO2pdNvA=="],
2020

21-
"@ark/util": ["@ark/util@0.39.0", "", {}, "sha512-90APHVklk8BP4kku7hIh1BgrhuyKYqoZ4O7EybtFRo7cDl9mIyc/QUbGvYDg//73s0J2H0I/gW9pzroA1R4IBQ=="],
21+
"@ark/util": ["@ark/util@0.43.1", "", {}, "sha512-sRx5bZiNoilA7mr5lAu78ZHOJx88nCagLER9Ns1FfoWWHrDWj8J8xU+VFj0g1ujJrAxWsVJRVElOEZ0XzXCrDw=="],
2222

2323
"@tsconfig/strictest": ["@tsconfig/[email protected]", "", {}, "sha512-ec4tjL2Rr0pkZ5hww65c+EEPYwxOi4Ryv+0MtjeaSQRJyq322Q27eOQiFbuNgw2hpL4hB1/W/HBGk3VKS43osg=="],
2424

25-
"@types/bun": ["@types/[email protected].2", "", { "dependencies": { "bun-types": "1.2.2" } }, "sha512-tr74gdku+AEDN5ergNiBnplr7hpDp3V1h7fqI2GcR/rsUaM39jpSeKH0TFibRvU0KwniRx5POgaYnaXbk0hU+w=="],
25+
"@types/bun": ["@types/[email protected].4", "", { "dependencies": { "bun-types": "1.2.4" } }, "sha512-QtuV5OMR8/rdKJs213iwXDpfVvnskPXY/S0ZiFbsTjQZycuqPbMW8Gf/XhLfwE5njW8sxI2WjISURXPlHypMFA=="],
2626

2727
"@types/node": ["@types/[email protected]", "", { "dependencies": { "undici-types": "~6.20.0" } }, "sha512-ywP2X0DYtX3y08eFVx5fNIw7/uIv8hYUKgXoK8oayJlLnKcRfEYCxWMVE1XagUdVtCJlZT1AU4LXEABW+L1Peg=="],
2828

2929
"@types/ws": ["@types/[email protected]", "", { "dependencies": { "@types/node": "*" } }, "sha512-bd/YFLW+URhBzMXurx7lWByOu+xzU9+kb3RboOteXYDfW+tr+JZa99OyNmPINEGB/ahzKrEuc8rcv4gnpJmxTw=="],
3030

3131
"arg": ["[email protected]", "", {}, "sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg=="],
3232

33-
"arktype": ["arktype@2.0.4", "", { "dependencies": { "@ark/schema": "0.39.0", "@ark/util": "0.39.0" } }, "sha512-S68rWVDnJauwH7/QCm8zCUM3aTe9Xk6oRihdcc3FSUAtxCo/q1Fwq46JhcwB5Ufv1YStwdQRz+00Y/URlvbhAQ=="],
33+
"arktype": ["arktype@2.1.2", "", { "dependencies": { "@ark/schema": "0.43.1", "@ark/util": "0.43.1" } }, "sha512-+uwghWzB1C0WoN6TpVB6wqXpshbRu19LykgddVcD8fk2SZHSgXWcxaTnq+cHnAqtZZOfJ/OI/QDTBmf9SiUFCw=="],
3434

35-
"bun-types": ["[email protected].2", "", { "dependencies": { "@types/node": "*", "@types/ws": "~8.5.10" } }, "sha512-RCbMH5elr9gjgDGDhkTTugA21XtJAy/9jkKe/G3WR2q17VPGhcquf9Sir6uay9iW+7P/BV0CAHA1XlHXMAVKHg=="],
35+
"bun-types": ["[email protected].4", "", { "dependencies": { "@types/node": "*", "@types/ws": "~8.5.10" } }, "sha512-nDPymR207ZZEoWD4AavvEaa/KZe/qlrbMSchqpQwovPZCKc7pwMoENjEtHgMKaAjJhy+x6vfqSBA1QU3bJgs0Q=="],
3636

3737
"detect-indent": ["[email protected]", "", {}, "sha512-rlpvsxUtM0PQvy9iZe640/IWwWYyBsTApREbA1pHOpmOUIl9MkP/U4z7vTtg4Oaojvqhxt7sdufnT0EzGaR31g=="],
3838

@@ -44,19 +44,19 @@
4444

4545
"minimist": ["[email protected]", "", {}, "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA=="],
4646

47-
"repo-check": ["repo-check@1.40.0", "", { "dependencies": { "arg": "5.0", "shuutils": "10.1", "sort-json": "2.0" }, "bin": { "repo-check": "dist/repo-check.min.cjs" } }, "sha512-EO5AKEYlUU8cRDq/9PVEkTsQ19371lCdw38KTHVWH48Nxq7kS6uJXYEHBii/AQ0kXRVxJP57uMi84lGH5zNRZQ=="],
47+
"repo-check": ["repo-check@1.42.0", "", { "dependencies": { "arg": "5.0", "shuutils": "10.5", "sort-json": "2.0" }, "bin": { "repo-check": "dist/repo-check.cjs" } }, "sha512-AsmKM/MNM26fjJPqob8oMw+7m28/pLUMpH8u05AF1yHLOeW2S1+Hhx6iPSN1T3XBOsO0d7ol1WgCcVF75ZjTYA=="],
4848

49-
"shuutils": ["shuutils@10.1.0", "", { "dependencies": { "tiny-glob": "0.2" }, "bin": { "unique-mark": "dist/unique-mark.cjs" } }, "sha512-Q+8PaUIik4W3bEE2xtDMZvYC7y4B8mnh3x7cneXPJmry0esVRir+hSZHh5Kjh6rtV0pYj+eKtAXBxJ8LDqPZhA=="],
49+
"shuutils": ["shuutils@10.5.0", "", { "dependencies": { "tiny-glob": "0.2" }, "bin": { "unique-mark": "dist/unique-mark.cjs" } }, "sha512-XIBlpWI8zIRYV1f1hdIApAPtsThzqBkIoLfBpmbQY+RVTwDn3mtfJ/ir3ifhdsnoQjcDKkcdiJGdnoLje/KU3w=="],
5050

5151
"sort-json": ["[email protected]", "", { "dependencies": { "detect-indent": "^5.0.0", "detect-newline": "^2.1.0", "minimist": "^1.2.0" }, "bin": { "sort-json": "app/cmd.js" } }, "sha512-s8cs2bcsQCzo/P2T/uoU6Js4dS/jnX8+4xunziNoq9qmSpZNCrRIAIvp4avsz0ST18HycV4z/7myJ7jsHWB2XQ=="],
5252

5353
"tiny-glob": ["[email protected]", "", { "dependencies": { "globalyzer": "0.1.0", "globrex": "^0.1.2" } }, "sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg=="],
5454

55-
"typescript": ["typescript@5.7.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw=="],
55+
"typescript": ["typescript@5.8.2", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ=="],
5656

5757
"undici-types": ["[email protected]", "", {}, "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg=="],
5858

59-
"valibot": ["[email protected].1", "", { "peerDependencies": { "typescript": ">=5" }, "optionalPeers": ["typescript"] }, "sha512-bTHNpeeQ403xS7qGHF/tw3EC/zkZOU5VdkfIsmRDu1Sp+BJNTNCm6m5HlwOgyW/03lofP+uQiq3R+Poo9wiCEg=="],
59+
"valibot": ["[email protected].3", "", { "peerDependencies": { "typescript": ">=5" }, "optionalPeers": ["typescript"] }, "sha512-LT0REa7Iqx4QGcaHLiTiTkcmJqJ9QdpOy89HALFFBJgejTS64GQFRIbDF7e4f6pauQbo/myfKGmWXCLhMeM6+g=="],
6060

6161
"zod": ["[email protected]", "", {}, "sha512-lY7CDW43ECgW9u1TcT3IoXHflywfVqDYze4waEz812jR/bZ8FHDsl7pFQoSZTz5N+2NqRXs8GBwnAwo3ZNxqhQ=="],
6262
}

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@
1212
}
1313
],
1414
"dependencies": {
15-
"arktype": "^2.0",
15+
"arktype": "^2.1",
1616
"valibot": "latest",
1717
"zod": "^3.24"
1818
},
1919
"description": "Comparison of different TypeScript validation libraries",
2020
"devDependencies": {
2121
"@tsconfig/strictest": "^2.0",
2222
"@types/bun": "latest",
23-
"repo-check": "^1.40",
24-
"typescript": "^5.7"
23+
"repo-check": "^1.42",
24+
"typescript": "^5.8"
2525
},
2626
"files": [
2727
"dist"
@@ -45,11 +45,12 @@
4545
"bench": "bun bench:bun --warmup 5 --runs 25",
4646
"bench:bun": "hyperfine 'bun src/arktype.ts' 'bun src/valibot.ts' 'bun src/zod.ts'",
4747
"bench:node": "hyperfine --runs 30 'node dist/arktype.js' 'node dist/valibot.js' 'node dist/zod.js'",
48+
"bench:node:strip": "hyperfine --runs 30 'node --experimental-strip-types src/arktype.ts' 'node --experimental-strip-types src/valibot.ts' 'node --experimental-strip-types src/zod.ts'",
4849
"build": "bun scripts/build.ts && echo build success",
4950
"check": "repo-check && bun check:tsc && bun run build && bun check:once && echo check success",
5051
"check:once": "bun bench:bun --runs 1 && echo check:once success",
5152
"check:tsc": "tsc --noEmit && echo check:tsc success"
5253
},
5354
"type": "module",
5455
"version": "1.0.0"
55-
}
56+
}

scripts/build.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ function showFileSize (path: string) {
1616
function build (file: string) {
1717
const entrypoints = [`./src/${file}`]
1818
Bun.build({ entrypoints, outdir, minify: true }).then((data) => {
19-
showFileSize(data.outputs[0].path)
19+
if (data.outputs[0]?.path) showFileSize(data.outputs[0].path)
2020
}).catch((err) => { console.error('Build failed:', err) })
2121
}
2222

2323
for await (const file of glob.scan("./src")) {
2424
if (ignore.includes(file)) continue
2525
build(file)
26-
}
26+
}

src/arktype.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { type } from "arktype"
2-
import { checkUserA, checkUserB, checkUserC } from './utils'
2+
import { checkUserA, checkUserB, checkUserC } from './utils.ts'
33

44
const userSchema = type({
55
name: type.string,
@@ -27,4 +27,4 @@ checkUserB(userB)
2727
const userC = createUser({ name: "Romain", age: "35" })
2828
checkUserC(userC)
2929

30-
console.log('All tests passed successfully.')
30+
console.log('All tests passed successfully.')

src/zod.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { z } from "zod"
2-
import { checkUserA, checkUserB, checkUserC } from './utils'
2+
import { checkUserA, checkUserB, checkUserC } from './utils.ts'
33

44
const userSchema = z.object({
55
name: z.string(),
@@ -26,4 +26,4 @@ checkUserB(userB)
2626
const userC = createUser({ name: "Romain", age: "35" })
2727
checkUserC(userC)
2828

29-
console.log('All tests passed successfully.')
29+
console.log('All tests passed successfully.')

tsconfig.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"compilerOptions": {
44
"allowImportingTsExtensions": true,
55
"allowJs": true,
6+
"erasableSyntaxOnly": true,
67
"forceConsistentCasingInFileNames": true,
78
"jsx": "react-jsx",
89
"lib": [
@@ -24,6 +25,7 @@
2425
},
2526
"extends": "@tsconfig/strictest/tsconfig.json",
2627
"include": [
28+
"scripts",
2729
"src"
2830
]
29-
}
31+
}

0 commit comments

Comments
 (0)