Repository navigation
Convert project from JavaScript to TypeScript - #174
Conversation
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 7.3.1 to 7.3.2. - [Release notes](https://github.com/vitejs/vite/releases) - [Changelog](https://github.com/vitejs/vite/blob/v7.3.2/packages/vite/CHANGELOG.md) - [Commits](https://github.com/vitejs/vite/commits/v7.3.2/packages/vite) --- updated-dependencies: - dependency-name: vite dependency-version: 7.3.2 dependency-type: direct:development ... Signed-off-by: dependabot[bot] <support@github.com>
Agent-Logs-Url: https://github.com/Enterwell/react-form-validation/sessions/d32bd755-2b97-431a-bda4-4cade686a26a Co-authored-by: AleksandarDev <643171+AleksandarDev@users.noreply.github.com>
Add repository contribution guide
- Convert src/validationFunctions.js → src/validationFunctions.ts - Convert src/formUtils.js → src/formUtils.ts - Convert src/useValidation.js → src/useValidation.ts - Convert src/index.js → src/index.ts with type re-exports - Remove manual types/index.d.ts (now auto-generated via vite-plugin-dts) - Add tsconfig.json with strict mode - Update vite.config.js to use .ts entry and dts plugin - Update package.json types field to point to dist/index.d.ts - Add typescript and vite-plugin-dts as dev dependencies - Update cypress test imports to remove .js extensions Agent-Logs-Url: https://github.com/Enterwell/react-form-validation/sessions/024b1f72-0daf-4fca-813d-93f6e09775eb Co-authored-by: AleksandarDev <643171+AleksandarDev@users.noreply.github.com>
|
@copilot remove any types that TS can resolve types from return/response |
….3.2 Bump vite from 7.3.1 to 7.3.2
Agent-Logs-Url: https://github.com/Enterwell/react-form-validation/sessions/6aa6fff8-c2de-4be5-b7ef-15aa6fe8d981 Co-authored-by: AleksandarDev <643171+AleksandarDev@users.noreply.github.com>
Removed all redundant return type annotations across all three source files in |
|
@copilot export type ExtractedValues<TFields extends Record<string, Field>> = { and implementaiton like this export const extractValues = <
take into account these suggestions and if appropriate apply changes in this PR so we get more TS features on next release |
|
@copilot can we make changes to extractValues helper so it infers value types from fields using a few helpers like this export type ExtractedValues<TFields extends Record<string, Field>> = { and implementaiton like this export const extractValues = < ( take into account these suggestions and if appropriate apply changes in this PR so we get more TS features on next release Also fix merge conflicts and update branch from latest main. |
|
@Copilot Version should be bumped! |
|
@copilot Fix the package build so this library can be consumed correctly by both ESM and CommonJS projects. |
|
@copilot Fix the package build so this library can be consumed correctly by both ESM and CommonJS projects. |
Head branch was pushed to by a user without write access
Done in the latest commit. Changes made:
The shared |
|
@Copilot Version should be bumped! |
Pull request was converted to draft
|
@copilot resolve the merge conflicts in this pull request |
…ect-to-typescript # Conflicts: # pnpm-lock.yaml
Done. Merged |
Convert all source files from JS to TS with strict mode, replacing the hand-maintained
types/index.d.tswith auto-generated declarations.Source conversion
src/{formUtils,useValidation,validationFunctions,index}.js→.tsunknownoveranyfor validation function parametersField<T>interface so consumers get typed valuesFieldConfig,Field,Fieldsexported as first-class typesType generation
vite-plugin-dtswithrollupTypes: true— produces a single rolled-updist/index.d.tstypes/index.d.tsandtypesfromfilesinpackage.jsonBuild config
tsconfig.json: strict, ES2020, bundler module resolutionvite.config.js: entry updated tosrc/index.ts, dts plugin added, dual ESM/CJS output (index.mjs+index.cjs)package.json:exportsfield withimport/requireconditions for ESM and CJS consumers;main→./dist/index.cjs;module→./dist/index.mjs;types→./dist/index.d.tsTest fixup
.jsextensions from explicit source imports in cypress tests