From 1786e79ee730247bb679c3efa93c73b7bac719bd Mon Sep 17 00:00:00 2001 From: Anjie Li Date: Tue, 24 Oct 2023 17:15:02 +0800 Subject: [PATCH] Update build --- package.json | 14 ++++++++++++-- src/index.ts | 4 ++-- tsconfig.json | 9 +++------ 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 25b9b83..8ccc086 100644 --- a/package.json +++ b/package.json @@ -2,13 +2,22 @@ "name": "zustand-rhf-sync", "version": "0.0.2", "description": "Syncs the state of react-hook-form and zustand so that changes in one is updated in the other", - "main": "index.js", "author": "lenwhite", "license": "MIT", "dependencies": { "react-hook-form": "^7.45.2", "zustand": "^4.4.0" }, + "main": "dist/index.js", + "repository": { + "type": "git", + "url": "git+https://github.com/lenwhite/zustand-rhf-sync.git" + }, + "typings": "dist/index.d.ts", + "files": [ + "dist", + "package.json" + ], "devDependencies": { "@testing-library/jest-dom": "^6.1.4", "@testing-library/react": "^14.0.0", @@ -51,6 +60,7 @@ "scripts": { "test": "jest", "prettier": "prettier \"*.{js,json,md}\" \"{examples,src,tests,docs}/**/*.{js,jsx,ts,tsx,md,mdx}\" --write", - "eslint": "eslint --no-eslintrc --c .eslintrc.json --fix '*.{js,json,ts}' '{src,tests}/**/*.{ts,tsx}'" + "eslint": "eslint --no-eslintrc --c .eslintrc.json --fix '*.{js,json,ts}' '{src,tests}/**/*.{ts,tsx}'", + "build": "tsup" } } diff --git a/src/index.ts b/src/index.ts index b3b5193..29728a0 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,2 +1,2 @@ -import { useSyncRHFWithStore } from "./hook"; -export { useSyncRHFWithStore }; +import { useFormWithStore, useSyncRHFWithStore } from "./hook"; +export { useSyncRHFWithStore, useFormWithStore }; diff --git a/tsconfig.json b/tsconfig.json index bd6bde9..153d491 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,10 +3,8 @@ "jsx": "react-jsx", "target": "esnext", - "types": [ - "jest", - "@testing-library/jest-dom" - ], + "moduleResolution": "node", + "types": ["jest", "@testing-library/jest-dom"], "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */, "forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */, @@ -14,9 +12,8 @@ "skipLibCheck": true /* Skip type checking all .d.ts files. */, "noUncheckedIndexedAccess": true, "noEmit": true, - "baseUrl": "./src", + "baseUrl": "./src" }, "include": ["src"], "exclude": ["node_modules", "dist"] - }