diff --git a/package.json b/package.json index b63ef38..0dd3280 100644 --- a/package.json +++ b/package.json @@ -46,6 +46,7 @@ "prettier": "^3.4.2", "typescript": "^5.7.2", "vite": "^6.0.3", + "vite-tsconfig-paths": "^5.1.4", "vitest": "^2.1.8" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8af7276..797eff0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -65,6 +65,9 @@ importers: vite: specifier: ^6.0.3 version: 6.0.5(yaml@2.6.1) + vite-tsconfig-paths: + specifier: ^5.1.4 + version: 5.1.4(typescript@5.7.2)(vite@6.0.5(yaml@2.6.1)) vitest: specifier: ^2.1.8 version: 2.1.8(@vitest/ui@2.1.8)(jsdom@25.0.1) @@ -1136,6 +1139,9 @@ packages: resolution: {integrity: sha512-OkToC372DtlQeje9/zHIo5CT8lRP/FUgEOKBEhU4e0abL7J7CD24fD9ohiLN5hagG/kWCYj4K5oaxxtj2Z0Dig==} engines: {node: '>=18'} + globrex@0.1.2: + resolution: {integrity: sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==} + has-flag@4.0.0: resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} engines: {node: '>=8'} @@ -1678,6 +1684,16 @@ packages: resolution: {integrity: sha512-tk2G5R2KRwBd+ZN0zaEXpmzdKyOYksXwywulIX95MBODjSzMIuQnQ3m8JxgbhnL1LeVo7lqQKsYa1O3Htl7K5g==} engines: {node: '>=18'} + tsconfck@3.1.4: + resolution: {integrity: sha512-kdqWFGVJqe+KGYvlSO9NIaWn9jT1Ny4oKVzAJsKii5eoE9snzTJzL4+MMVOMn+fikWGFmKEylcXL710V/kIPJQ==} + engines: {node: ^18 || >=20} + hasBin: true + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true + tslib@2.8.1: resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} @@ -1704,6 +1720,14 @@ packages: engines: {node: ^18.0.0 || >=20.0.0} hasBin: true + vite-tsconfig-paths@5.1.4: + resolution: {integrity: sha512-cYj0LRuLV2c2sMqhqhGpaO3LretdtMn/BVX4cPLanIZuwwrkVl+lK84E/miEXkCHWXuq65rhNN4rXsBcOB3S4w==} + peerDependencies: + vite: '*' + peerDependenciesMeta: + vite: + optional: true + vite@5.4.11: resolution: {integrity: sha512-c7jFQRklXua0mTzneGW9QVyxFjUgwcihC4bXEtujIo2ouWCe1Ajt/amn2PCxYnhYfd5k09JX3SB7OYWFKYqj8Q==} engines: {node: ^18.0.0 || >=20.0.0} @@ -2848,6 +2872,8 @@ snapshots: globals@15.14.0: {} + globrex@0.1.2: {} + has-flag@4.0.0: {} html-encoding-sniffer@4.0.0: @@ -3367,6 +3393,10 @@ snapshots: dependencies: punycode: 2.3.1 + tsconfck@3.1.4(typescript@5.7.2): + optionalDependencies: + typescript: 5.7.2 + tslib@2.8.1: {} type-check@0.4.0: @@ -3403,6 +3433,17 @@ snapshots: - supports-color - terser + vite-tsconfig-paths@5.1.4(typescript@5.7.2)(vite@6.0.5(yaml@2.6.1)): + dependencies: + debug: 4.4.0 + globrex: 0.1.2 + tsconfck: 3.1.4(typescript@5.7.2) + optionalDependencies: + vite: 6.0.5(yaml@2.6.1) + transitivePeerDependencies: + - supports-color + - typescript + vite@5.4.11: dependencies: esbuild: 0.21.5 diff --git a/src/constants/htmlEventsName.ts b/src/constants/htmlEventsName.ts new file mode 100644 index 0000000..e1f1b5a --- /dev/null +++ b/src/constants/htmlEventsName.ts @@ -0,0 +1,11 @@ +export const htmlEventNames = [ + "click", + "change", + "submit", + "focus", + "blur", + "mouseover", + "keydown", + "keyup", + "focus", +] as const; diff --git a/src/types/event.ts b/src/types/event.ts new file mode 100644 index 0000000..1aeea4c --- /dev/null +++ b/src/types/event.ts @@ -0,0 +1,3 @@ +import { htmlEventNames } from "@/constants/htmlEventsName"; + +export type HTMLEventName = (typeof htmlEventNames)[number]; diff --git a/vite.config.js b/vite.config.js index c25aa0d..87fe24c 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,17 +1,10 @@ import { defineConfig as defineTestConfig, mergeConfig } from "vitest/config"; import { defineConfig } from "vite"; -import path from "path"; +import tsconfigPaths from "vite-tsconfig-paths"; export default mergeConfig( defineConfig({ - resolve: { - alias: [ - { - find: "@", - replacement: path.resolve(__dirname, "src"), - }, - ], - }, + plugins: [tsconfigPaths()], esbuild: { jsxFactory: "createVNode", },