prototypey.org - atproto lexicon typescript toolkit - mirror https://github.com/tylersayshi/prototypey

add attest

Tyler 91f6817e 0aafa030

+402 -2
+7
.github/workflows/ci.yml
··· 35 35 - uses: actions/checkout@v4 36 36 - uses: ./.github/actions/prepare 37 37 - run: pnpm test 38 + benchmark_types: 39 + name: Benchmark Types 40 + runs-on: ubuntu-latest 41 + steps: 42 + - uses: actions/checkout@v4 43 + - uses: ./.github/actions/prepare 44 + - run: pnpm test:bench 38 45 39 46 name: CI 40 47
+1
.gitignore
··· 1 1 /lib 2 2 /node_modules 3 + /.attest
+2 -1
eslint.config.js
··· 2 2 import tseslint from "typescript-eslint"; 3 3 4 4 export default tseslint.config( 5 - { ignores: ["lib", "node_modules", "pnpm-lock.yaml"] }, 5 + { ignores: ["lib", "node_modules", "pnpm-lock.yaml", "setup-vitest.ts"] }, 6 6 { linterOptions: { reportUnusedDisableDirectives: "error" } }, 7 7 eslint.configs.recommended, 8 8 { ··· 21 21 files: ["**/*.test.ts"], 22 22 rules: { 23 23 "@typescript-eslint/no-floating-promises": "off", 24 + "@typescript-eslint/no-unused-vars": "off", 24 25 }, 25 26 }, 26 27 );
+3
package.json
··· 24 24 "format": "prettier .", 25 25 "lint": "eslint . --max-warnings 0", 26 26 "test": "vitest run", 27 + "test:bench": "vitest bench", 28 + "test:update-snapshots": "vitest run -u", 27 29 "tsc": "tsc" 28 30 }, 29 31 "devDependencies": { 32 + "@ark/attest": "^0.49.0", 30 33 "@eslint/js": "9.29.0", 31 34 "@types/node": "24.0.4", 32 35 "eslint": "9.29.0",
+268
pnpm-lock.yaml
··· 8 8 9 9 .: 10 10 devDependencies: 11 + '@ark/attest': 12 + specifier: ^0.49.0 13 + version: 0.49.0(typescript@5.8.3) 11 14 '@eslint/js': 12 15 specifier: 9.29.0 13 16 version: 9.29.0 ··· 35 38 36 39 packages: 37 40 41 + '@ark/attest@0.49.0': 42 + resolution: {integrity: sha512-LYAJe4iwgA4GY+WLcSZ2ObTgr7F9lSwoQm4hR+B5ko0TfB3gqolXv04hA+7UtoP5HrGR1lVS+0DdwtWNnaSGnQ==} 43 + hasBin: true 44 + peerDependencies: 45 + typescript: '*' 46 + 47 + '@ark/fs@0.49.0': 48 + resolution: {integrity: sha512-AEjAQS/bu1CGIRiKK/XLaQ73cSJHixfexq28wNt+kBpQ0h1RwVIVzaGsn/+5IWw6DEbR7LB+3hil5gzrzEeyZQ==} 49 + 50 + '@ark/schema@0.49.0': 51 + resolution: {integrity: sha512-GphZBLpW72iS0v4YkeUtV3YIno35Gimd7+ezbPO9GwEi9kzdUrPVjvf6aXSBAfHikaFc/9pqZOpv3pOXnC71tw==} 52 + 53 + '@ark/util@0.49.0': 54 + resolution: {integrity: sha512-/BtnX7oCjNkxi2vi6y1399b+9xd1jnCrDYhZ61f0a+3X8x8DxlK52VgEEzyuC2UQMPACIfYrmHkhD3lGt2GaMA==} 55 + 38 56 '@babel/generator@7.28.3': 39 57 resolution: {integrity: sha512-3lSpxGgvnmZznmBkCRnVREPUFJv2wrv9iAoFDvADJc0ypmdOxdUtcLeBgBJ6zE0PMeTKnxeQzyk0xTBq4Ep7zw==} 40 58 engines: {node: '>=6.9.0'} ··· 314 332 '@oxc-project/types@0.72.2': 315 333 resolution: {integrity: sha512-il5RF8AP85XC0CMjHF4cnVT9nT/v/ocm6qlZQpSiAR9qBbQMGkFKloBZwm7PcnOdiUX97yHgsKM7uDCCWCu3tg==} 316 334 335 + '@prettier/sync@0.5.5': 336 + resolution: {integrity: sha512-6BMtNr7aQhyNcGzmumkL0tgr1YQGfm9d7ZdmRpWqWuqpc9vZBind4xMe5NMiRECOhjuSiWHfBWLBnXkpeE90bw==} 337 + peerDependencies: 338 + prettier: '*' 339 + 317 340 '@quansync/fs@0.1.5': 318 341 resolution: {integrity: sha512-lNS9hL2aS2NZgNW7BBj+6EBl4rOf8l+tQ0eRY6JWCI8jI2kc53gSoqbjojU0OnAWhzoXiOjFyGsHcDGePB3lhA==} 319 342 ··· 567 590 resolution: {integrity: sha512-zTh2+1Y8ZpmeQaQVIc/ZZxsx8UzgKJyNg1PTvjzC7WMhPSVS8bfDX34k1SrwOf016qd5RU3az2UxUNue3IfQ5g==} 568 591 engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} 569 592 593 + '@typescript/analyze-trace@0.10.1': 594 + resolution: {integrity: sha512-RnlSOPh14QbopGCApgkSx5UBgGda5MX1cHqp2fsqfiDyCwGL/m1jaeB9fzu7didVS81LQqGZZuxFBcg8YU8EVw==} 595 + hasBin: true 596 + 597 + '@typescript/vfs@1.6.1': 598 + resolution: {integrity: sha512-JwoxboBh7Oz1v38tPbkrZ62ZXNHAk9bJ7c9x0eI5zBfBnBYGhURdbnh7Z4smN/MV48Y5OCcZb58n972UtbazsA==} 599 + peerDependencies: 600 + typescript: '*' 601 + 570 602 '@vitest/expect@3.2.4': 571 603 resolution: {integrity: sha512-Io0yyORnB6sikFlt8QW5K7slY4OjqNX9jmJQ02QDda8lyM6B5oNgVWoSoKPac8/kgnCUzuHQKrSLtu/uOqqrig==} 572 604 ··· 609 641 ajv@6.12.6: 610 642 resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} 611 643 644 + ansi-regex@5.0.1: 645 + resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} 646 + engines: {node: '>=8'} 647 + 612 648 ansi-styles@4.3.0: 613 649 resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} 614 650 engines: {node: '>=8'} ··· 619 655 620 656 argparse@2.0.1: 621 657 resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} 658 + 659 + arktype@2.1.22: 660 + resolution: {integrity: sha512-xdzl6WcAhrdahvRRnXaNwsipCgHuNoLobRqhiP8RjnfL9Gp947abGlo68GAIyLtxbD+MLzNyH2YR4kEqioMmYQ==} 622 661 623 662 assertion-error@2.0.1: 624 663 resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} ··· 668 707 resolution: {integrity: sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==} 669 708 engines: {node: '>= 14.16.0'} 670 709 710 + cliui@7.0.4: 711 + resolution: {integrity: sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==} 712 + 671 713 color-convert@2.0.1: 672 714 resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} 673 715 engines: {node: '>=7.0.0'} ··· 714 756 oxc-resolver: 715 757 optional: true 716 758 759 + emoji-regex@8.0.0: 760 + resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} 761 + 717 762 empathic@1.1.0: 718 763 resolution: {integrity: sha512-rsPft6CK3eHtrlp9Y5ALBb+hfK+DWnA4WFebbazxjWyx8vSm3rZeoM3z9irsjcqO3PYRzlfv27XIB4tz2DV7RA==} 719 764 engines: {node: '>=14'} ··· 725 770 resolution: {integrity: sha512-9RiGKvCwaqxO2owP61uQ4BgNborAQskMR6QusfWzQqv7AZOg5oGehdY2pRJMTKuwxd1IDBP4rSbI5lHzU7SMsQ==} 726 771 engines: {node: '>=18'} 727 772 hasBin: true 773 + 774 + escalade@3.2.0: 775 + resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==} 776 + engines: {node: '>=6'} 728 777 729 778 escape-string-regexp@4.0.0: 730 779 resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} ··· 775 824 resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} 776 825 engines: {node: '>=0.10.0'} 777 826 827 + exit@0.1.2: 828 + resolution: {integrity: sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==} 829 + engines: {node: '>= 0.8.0'} 830 + 778 831 expect-type@1.2.2: 779 832 resolution: {integrity: sha512-JhFGDVJ7tmDJItKhYgJCGLOWjuK9vPxiXoUFLwLDc99NlmklilbiQJwoctZtt13+xMw91MCk/REan6MWHqDjyA==} 780 833 engines: {node: '>=12.0.0'} ··· 828 881 engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} 829 882 os: [darwin] 830 883 884 + get-caller-file@2.0.5: 885 + resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} 886 + engines: {node: 6.* || 8.* || >= 10.*} 887 + 831 888 get-tsconfig@4.12.0: 832 889 resolution: {integrity: sha512-LScr2aNr2FbjAjZh2C6X6BxRx1/x+aTDExct/xyq2XKbYOiG5c0aK7pMsSuyc0brz3ibr/lbQiHD9jzt4lccJw==} 833 890 ··· 869 926 resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} 870 927 engines: {node: '>=0.8.19'} 871 928 929 + inherits@2.0.4: 930 + resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} 931 + 872 932 is-extglob@2.1.1: 873 933 resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} 874 934 engines: {node: '>=0.10.0'} 935 + 936 + is-fullwidth-code-point@3.0.0: 937 + resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} 938 + engines: {node: '>=8'} 875 939 876 940 is-glob@4.0.3: 877 941 resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} ··· 909 973 json-stable-stringify-without-jsonify@1.0.1: 910 974 resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} 911 975 976 + jsonparse@1.3.1: 977 + resolution: {integrity: sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==} 978 + engines: {'0': node >= 0.2.0} 979 + 980 + jsonstream-next@3.0.0: 981 + resolution: {integrity: sha512-aAi6oPhdt7BKyQn1SrIIGZBt0ukKuOUE1qV6kJ3GgioSOYzsRc8z9Hfr1BVmacA/jLe9nARfmgMGgn68BqIAgg==} 982 + engines: {node: '>=10'} 983 + hasBin: true 984 + 912 985 keyv@4.5.4: 913 986 resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} 914 987 ··· 928 1001 929 1002 magic-string@0.30.19: 930 1003 resolution: {integrity: sha512-2N21sPY9Ws53PZvsEpVtNuSW+ScYbQdp4b9qUaL+9QkHUrGFKo56Lg9Emg5s9V/qrtNBmiR01sYhUOwu3H+VOw==} 1004 + 1005 + make-synchronized@0.4.2: 1006 + resolution: {integrity: sha512-EwEJSg8gSGLicKXp/VzNi1tvzhdmNBxOzslkkJSoNUCQFZKH/NIUIp7xlfN+noaHrz4BJDN73gne8IHnjl/F/A==} 931 1007 932 1008 merge2@1.4.1: 933 1009 resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} ··· 1005 1081 resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} 1006 1082 engines: {node: '>= 0.8.0'} 1007 1083 1084 + prettier@3.5.3: 1085 + resolution: {integrity: sha512-QQtaxnoDJeAkDvDKWCLiwIXkTgRhwYDEQCghU9Z6q03iyek/rxRh/2lC3HB7P8sWT2xC/y5JDctPLBIGzHKbhw==} 1086 + engines: {node: '>=14'} 1087 + hasBin: true 1088 + 1008 1089 prettier@3.6.1: 1009 1090 resolution: {integrity: sha512-5xGWRa90Sp2+x1dQtNpIpeOQpTDBs9cZDmA/qs2vDNN2i18PdapqY7CmBeyLlMuGqXJRIOPaCaVZTLNQRWUH/A==} 1010 1091 engines: {node: '>=14'} ··· 1020 1101 queue-microtask@1.2.3: 1021 1102 resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} 1022 1103 1104 + readable-stream@3.6.2: 1105 + resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} 1106 + engines: {node: '>= 6'} 1107 + 1023 1108 readdirp@4.1.2: 1024 1109 resolution: {integrity: sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==} 1025 1110 engines: {node: '>= 14.18.0'} 1111 + 1112 + require-directory@2.1.1: 1113 + resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} 1114 + engines: {node: '>=0.10.0'} 1026 1115 1027 1116 resolve-from@4.0.0: 1028 1117 resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} ··· 1063 1152 run-parallel@1.2.0: 1064 1153 resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} 1065 1154 1155 + safe-buffer@5.2.1: 1156 + resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} 1157 + 1066 1158 semver@7.7.3: 1067 1159 resolution: {integrity: sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==} 1068 1160 engines: {node: '>=10'} ··· 1083 1175 resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} 1084 1176 engines: {node: '>=0.10.0'} 1085 1177 1178 + split2@3.2.2: 1179 + resolution: {integrity: sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg==} 1180 + 1086 1181 stackback@0.0.2: 1087 1182 resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} 1088 1183 1089 1184 std-env@3.9.0: 1090 1185 resolution: {integrity: sha512-UGvjygr6F6tpH7o2qyqR6QYpwraIjKSdtzyBdyytFOHmPZY917kwdwLG0RbOjWOnKmnm3PeHjaoLLMie7kPLQw==} 1091 1186 1187 + string-width@4.2.3: 1188 + resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} 1189 + engines: {node: '>=8'} 1190 + 1191 + string_decoder@1.3.0: 1192 + resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} 1193 + 1194 + strip-ansi@6.0.1: 1195 + resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} 1196 + engines: {node: '>=8'} 1197 + 1092 1198 strip-json-comments@3.1.1: 1093 1199 resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} 1094 1200 engines: {node: '>=8'} ··· 1099 1205 supports-color@7.2.0: 1100 1206 resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} 1101 1207 engines: {node: '>=8'} 1208 + 1209 + through2@4.0.2: 1210 + resolution: {integrity: sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==} 1102 1211 1103 1212 tinybench@2.9.0: 1104 1213 resolution: {integrity: sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==} ··· 1129 1238 resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} 1130 1239 engines: {node: '>=8.0'} 1131 1240 1241 + treeify@1.1.0: 1242 + resolution: {integrity: sha512-1m4RA7xVAJrSGrrXGs0L3YTwyvBs2S8PbRHaLZAkFw7JR8oIFwYtysxlBZhYIa7xSyiYJKZ3iGrrk55cGA3i9A==} 1243 + engines: {node: '>=0.6'} 1244 + 1132 1245 ts-api-utils@2.1.0: 1133 1246 resolution: {integrity: sha512-CUgTZL1irw8u29bzrOD/nH85jqyc74D6SshFgujOIA7osm2Rz7dYH77agkx7H4FBNxDq7Cjf+IjaX/8zwFW+ZQ==} 1134 1247 engines: {node: '>=18.12'} ··· 1184 1297 1185 1298 uri-js@4.4.1: 1186 1299 resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} 1300 + 1301 + util-deprecate@1.0.2: 1302 + resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} 1187 1303 1188 1304 vite-node@3.2.4: 1189 1305 resolution: {integrity: sha512-EbKSKh+bh1E1IFxeO0pg1n4dvoOTt0UDiXMd/qn++r98+jPO1xtJilvXldeuQ8giIB5IkpjCgMleHMNEsGH6pg==} ··· 1272 1388 resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==} 1273 1389 engines: {node: '>=0.10.0'} 1274 1390 1391 + wrap-ansi@7.0.0: 1392 + resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} 1393 + engines: {node: '>=10'} 1394 + 1395 + y18n@5.0.8: 1396 + resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} 1397 + engines: {node: '>=10'} 1398 + 1399 + yargs-parser@20.2.9: 1400 + resolution: {integrity: sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==} 1401 + engines: {node: '>=10'} 1402 + 1403 + yargs@16.2.0: 1404 + resolution: {integrity: sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==} 1405 + engines: {node: '>=10'} 1406 + 1275 1407 yocto-queue@0.1.0: 1276 1408 resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} 1277 1409 engines: {node: '>=10'} 1278 1410 1279 1411 snapshots: 1280 1412 1413 + '@ark/attest@0.49.0(typescript@5.8.3)': 1414 + dependencies: 1415 + '@ark/fs': 0.49.0 1416 + '@ark/util': 0.49.0 1417 + '@prettier/sync': 0.5.5(prettier@3.5.3) 1418 + '@typescript/analyze-trace': 0.10.1 1419 + '@typescript/vfs': 1.6.1(typescript@5.8.3) 1420 + arktype: 2.1.22 1421 + prettier: 3.5.3 1422 + typescript: 5.8.3 1423 + transitivePeerDependencies: 1424 + - supports-color 1425 + 1426 + '@ark/fs@0.49.0': {} 1427 + 1428 + '@ark/schema@0.49.0': 1429 + dependencies: 1430 + '@ark/util': 0.49.0 1431 + 1432 + '@ark/util@0.49.0': {} 1433 + 1281 1434 '@babel/generator@7.28.3': 1282 1435 dependencies: 1283 1436 '@babel/parser': 7.28.4 ··· 1488 1641 '@oxc-project/runtime@0.72.2': {} 1489 1642 1490 1643 '@oxc-project/types@0.72.2': {} 1644 + 1645 + '@prettier/sync@0.5.5(prettier@3.5.3)': 1646 + dependencies: 1647 + make-synchronized: 0.4.2 1648 + prettier: 3.5.3 1491 1649 1492 1650 '@quansync/fs@0.1.5': 1493 1651 dependencies: ··· 1710 1868 '@typescript-eslint/types': 8.35.0 1711 1869 eslint-visitor-keys: 4.2.1 1712 1870 1871 + '@typescript/analyze-trace@0.10.1': 1872 + dependencies: 1873 + chalk: 4.1.2 1874 + exit: 0.1.2 1875 + jsonparse: 1.3.1 1876 + jsonstream-next: 3.0.0 1877 + p-limit: 3.1.0 1878 + split2: 3.2.2 1879 + treeify: 1.1.0 1880 + yargs: 16.2.0 1881 + 1882 + '@typescript/vfs@1.6.1(typescript@5.8.3)': 1883 + dependencies: 1884 + debug: 4.4.3 1885 + typescript: 5.8.3 1886 + transitivePeerDependencies: 1887 + - supports-color 1888 + 1713 1889 '@vitest/expect@3.2.4': 1714 1890 dependencies: 1715 1891 '@types/chai': 5.2.2 ··· 1765 1941 json-schema-traverse: 0.4.1 1766 1942 uri-js: 4.4.1 1767 1943 1944 + ansi-regex@5.0.1: {} 1945 + 1768 1946 ansi-styles@4.3.0: 1769 1947 dependencies: 1770 1948 color-convert: 2.0.1 ··· 1772 1950 ansis@4.2.0: {} 1773 1951 1774 1952 argparse@2.0.1: {} 1953 + 1954 + arktype@2.1.22: 1955 + dependencies: 1956 + '@ark/schema': 0.49.0 1957 + '@ark/util': 0.49.0 1775 1958 1776 1959 assertion-error@2.0.1: {} 1777 1960 ··· 1820 2003 dependencies: 1821 2004 readdirp: 4.1.2 1822 2005 2006 + cliui@7.0.4: 2007 + dependencies: 2008 + string-width: 4.2.3 2009 + strip-ansi: 6.0.1 2010 + wrap-ansi: 7.0.0 2011 + 1823 2012 color-convert@2.0.1: 1824 2013 dependencies: 1825 2014 color-name: 1.1.4 ··· 1848 2037 1849 2038 dts-resolver@2.1.2: {} 1850 2039 2040 + emoji-regex@8.0.0: {} 2041 + 1851 2042 empathic@1.1.0: {} 1852 2043 1853 2044 es-module-lexer@1.7.0: {} ··· 1880 2071 '@esbuild/win32-arm64': 0.25.10 1881 2072 '@esbuild/win32-ia32': 0.25.10 1882 2073 '@esbuild/win32-x64': 0.25.10 2074 + 2075 + escalade@3.2.0: {} 1883 2076 1884 2077 escape-string-regexp@4.0.0: {} 1885 2078 ··· 1956 2149 1957 2150 esutils@2.0.3: {} 1958 2151 2152 + exit@0.1.2: {} 2153 + 1959 2154 expect-type@1.2.2: {} 1960 2155 1961 2156 fast-deep-equal@3.1.3: {} ··· 2003 2198 fsevents@2.3.3: 2004 2199 optional: true 2005 2200 2201 + get-caller-file@2.0.5: {} 2202 + 2006 2203 get-tsconfig@4.12.0: 2007 2204 dependencies: 2008 2205 resolve-pkg-maps: 1.0.0 ··· 2034 2231 2035 2232 imurmurhash@0.1.4: {} 2036 2233 2234 + inherits@2.0.4: {} 2235 + 2037 2236 is-extglob@2.1.1: {} 2237 + 2238 + is-fullwidth-code-point@3.0.0: {} 2038 2239 2039 2240 is-glob@4.0.3: 2040 2241 dependencies: ··· 2060 2261 2061 2262 json-stable-stringify-without-jsonify@1.0.1: {} 2062 2263 2264 + jsonparse@1.3.1: {} 2265 + 2266 + jsonstream-next@3.0.0: 2267 + dependencies: 2268 + jsonparse: 1.3.1 2269 + through2: 4.0.2 2270 + 2063 2271 keyv@4.5.4: 2064 2272 dependencies: 2065 2273 json-buffer: 3.0.1 ··· 2080 2288 magic-string@0.30.19: 2081 2289 dependencies: 2082 2290 '@jridgewell/sourcemap-codec': 1.5.5 2291 + 2292 + make-synchronized@0.4.2: {} 2083 2293 2084 2294 merge2@1.4.1: {} 2085 2295 ··· 2145 2355 2146 2356 prelude-ls@1.2.1: {} 2147 2357 2358 + prettier@3.5.3: {} 2359 + 2148 2360 prettier@3.6.1: {} 2149 2361 2150 2362 punycode@2.3.1: {} ··· 2152 2364 quansync@0.2.11: {} 2153 2365 2154 2366 queue-microtask@1.2.3: {} 2367 + 2368 + readable-stream@3.6.2: 2369 + dependencies: 2370 + inherits: 2.0.4 2371 + string_decoder: 1.3.0 2372 + util-deprecate: 1.0.2 2155 2373 2156 2374 readdirp@4.1.2: {} 2157 2375 2376 + require-directory@2.1.1: {} 2377 + 2158 2378 resolve-from@4.0.0: {} 2159 2379 2160 2380 resolve-pkg-maps@1.0.0: {} ··· 2230 2450 dependencies: 2231 2451 queue-microtask: 1.2.3 2232 2452 2453 + safe-buffer@5.2.1: {} 2454 + 2233 2455 semver@7.7.3: {} 2234 2456 2235 2457 shebang-command@2.0.0: ··· 2242 2464 2243 2465 source-map-js@1.2.1: {} 2244 2466 2467 + split2@3.2.2: 2468 + dependencies: 2469 + readable-stream: 3.6.2 2470 + 2245 2471 stackback@0.0.2: {} 2246 2472 2247 2473 std-env@3.9.0: {} 2248 2474 2475 + string-width@4.2.3: 2476 + dependencies: 2477 + emoji-regex: 8.0.0 2478 + is-fullwidth-code-point: 3.0.0 2479 + strip-ansi: 6.0.1 2480 + 2481 + string_decoder@1.3.0: 2482 + dependencies: 2483 + safe-buffer: 5.2.1 2484 + 2485 + strip-ansi@6.0.1: 2486 + dependencies: 2487 + ansi-regex: 5.0.1 2488 + 2249 2489 strip-json-comments@3.1.1: {} 2250 2490 2251 2491 strip-literal@3.1.0: ··· 2255 2495 supports-color@7.2.0: 2256 2496 dependencies: 2257 2497 has-flag: 4.0.0 2498 + 2499 + through2@4.0.2: 2500 + dependencies: 2501 + readable-stream: 3.6.2 2258 2502 2259 2503 tinybench@2.9.0: {} 2260 2504 ··· 2277 2521 dependencies: 2278 2522 is-number: 7.0.0 2279 2523 2524 + treeify@1.1.0: {} 2525 + 2280 2526 ts-api-utils@2.1.0(typescript@5.8.3): 2281 2527 dependencies: 2282 2528 typescript: 5.8.3 ··· 2335 2581 uri-js@4.4.1: 2336 2582 dependencies: 2337 2583 punycode: 2.3.1 2584 + 2585 + util-deprecate@1.0.2: {} 2338 2586 2339 2587 vite-node@3.2.4(@types/node@24.0.4)(jiti@2.6.1): 2340 2588 dependencies: ··· 2421 2669 stackback: 0.0.2 2422 2670 2423 2671 word-wrap@1.2.5: {} 2672 + 2673 + wrap-ansi@7.0.0: 2674 + dependencies: 2675 + ansi-styles: 4.3.0 2676 + string-width: 4.2.3 2677 + strip-ansi: 6.0.1 2678 + 2679 + y18n@5.0.8: {} 2680 + 2681 + yargs-parser@20.2.9: {} 2682 + 2683 + yargs@16.2.0: 2684 + dependencies: 2685 + cliui: 7.0.4 2686 + escalade: 3.2.0 2687 + get-caller-file: 2.0.5 2688 + require-directory: 2.1.1 2689 + string-width: 4.2.3 2690 + y18n: 5.0.8 2691 + yargs-parser: 20.2.9 2424 2692 2425 2693 yocto-queue@0.1.0: {}
+11
setup-vitest.ts
··· 1 + import { setup } from "@ark/attest"; 2 + 3 + // config options can be passed here 4 + export default () => 5 + setup({ 6 + // Set to true during development to skip type checking (faster) 7 + skipTypes: false, 8 + 9 + // Fail if benchmarks deviate by more than 20% 10 + benchPercentThreshold: 20, 11 + });
+1
src/index.ts
··· 1 1 export * from "./lib.ts"; 2 + export * from "./infer.ts";
+38
src/tests/infer.bench.ts
··· 1 + import { bench } from "@ark/attest"; 2 + import type { InferNS } from "../infer.ts"; 3 + import { lx } from "../lib.ts"; 4 + 5 + bench("InferNS with simple object", () => { 6 + const schema = lx.namespace("test.simple", { 7 + main: lx.object({ 8 + id: lx.string({ required: true }), 9 + name: lx.string({ required: true }), 10 + }), 11 + }); 12 + 13 + return null as unknown as InferNS<typeof schema>; 14 + }).types([63, "instantiations"]); 15 + 16 + bench("InferNS with complex nested structure", () => { 17 + const schema = lx.namespace("test.complex", { 18 + post: lx.record({ 19 + key: "tid", 20 + record: lx.object({ 21 + author: lx.ref("test.complex#user", { required: true }), 22 + replies: lx.array(lx.ref("test.complex#reply")), 23 + content: lx.string({ required: true }), 24 + createdAt: lx.string({ required: true, format: "datetime" }), 25 + }), 26 + }), 27 + user: lx.object({ 28 + handle: lx.string({ required: true }), 29 + displayName: lx.string(), 30 + }), 31 + reply: lx.object({ 32 + text: lx.string({ required: true }), 33 + author: lx.ref("test.complex#user", { required: true }), 34 + }), 35 + }); 36 + 37 + return null as unknown as InferNS<typeof schema>; 38 + }).types([125, "instantiations"]);
+69
src/tests/infer.test.ts
··· 1 + import { test } from "vitest"; 2 + import { attest } from "@ark/attest"; 3 + import type { InferNS } from "../infer.ts"; 4 + import { lx } from "../lib.ts"; 5 + 6 + test("InferNS produces expected type shape", () => { 7 + const exampleLexicon = lx.namespace("com.example.post", { 8 + main: lx.record({ 9 + key: "tid", 10 + record: lx.object({ 11 + text: lx.string({ required: true }), 12 + createdAt: lx.string({ required: true, format: "datetime" }), 13 + likes: lx.integer(), 14 + tags: lx.array(lx.string(), { maxLength: 5 }), 15 + }), 16 + }), 17 + }); 18 + 19 + type Result = InferNS<typeof exampleLexicon>; 20 + 21 + // Type snapshot - this captures how types appear on hover 22 + const result = {} as Result; 23 + attest(result).type.toString.snap(`{ 24 + main: { 25 + createdAt?: string | undefined 26 + tags?: string[] | undefined 27 + text?: string | undefined 28 + likes?: number | undefined 29 + } 30 + }`); 31 + }); 32 + 33 + test("InferObject handles required fields", () => { 34 + const schema = lx.object({ 35 + required: lx.string({ required: true }), 36 + optional: lx.string(), 37 + }); 38 + 39 + type Result = InferNS<{ 40 + lexicon: 1; 41 + id: "test"; 42 + defs: { main: typeof schema }; 43 + }>; 44 + 45 + const result = {} as Result; 46 + attest(result).type.toString.snap(`{ 47 + main: { 48 + required?: string | undefined 49 + optional?: string | undefined 50 + } 51 + }`); 52 + }); 53 + 54 + test("InferObject handles nullable fields", () => { 55 + const schema = lx.object({ 56 + nullable: lx.string({ nullable: true, required: true }), 57 + }); 58 + 59 + type Result = InferNS<{ 60 + lexicon: 1; 61 + id: "test"; 62 + defs: { main: typeof schema }; 63 + }>; 64 + 65 + const result = {} as Result; 66 + attest(result).type.toString.snap( 67 + "{ main: { nullable?: string | undefined } }", 68 + ); 69 + });
+1 -1
tsdown.config.ts
··· 2 2 3 3 export default defineConfig({ 4 4 dts: true, 5 - entry: ["src/**/*.ts"], 5 + entry: ["src/index.ts"], 6 6 outDir: "lib", 7 7 unbundle: true, 8 8 });
+1
vitest.config.ts
··· 3 3 export default defineConfig({ 4 4 test: { 5 5 include: ["src/**/*.test.ts"], 6 + globalSetup: ["setup-vitest.ts"], 6 7 }, 7 8 });