@ekz/formix 2.0.0 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +32 -0
  2. package/package.json +24 -20
package/README.md ADDED
@@ -0,0 +1,32 @@
1
+ # @ekz/formix
2
+
3
+ Type-safe React forms for TypeScript.
4
+
5
+ **Documentation:** [https://docs.ekz.io/formix/](https://docs.ekz.io/formix/)
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm install @ekz/formix @ekz/option immutable react
11
+ ```
12
+
13
+ ## Quick example
14
+
15
+ ```tsx
16
+ import { defineField, useField, useForm, withForm } from '@ekz/formix';
17
+
18
+ const fields = { name: defineField('') };
19
+
20
+ function NameForm() {
21
+ const { value, setValue } = useField(fields.name);
22
+ const { valid } = useForm();
23
+
24
+ return (
25
+ <input value={value} onChange={(e) => setValue(e.target.value)} />
26
+ );
27
+ }
28
+
29
+ export const NameFormWithContext = withForm(NameForm);
30
+ ```
31
+
32
+ See the [docs](https://docs.ekz.io/formix/) for validation, array fields, and form shell patterns.
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "@ekz/formix",
3
- "version": "2.0.0",
3
+ "version": "2.1.1",
4
4
  "license": "MIT",
5
5
  "description": "Type-safe React form to be used with Typescript",
6
+ "homepage": "https://docs.ekz.io/formix/",
6
7
  "repository": {
7
8
  "type": "git",
8
9
  "url": "https://github.com/erkez/ekz.git",
@@ -36,54 +37,57 @@
36
37
  "type-safe"
37
38
  ],
38
39
  "peerDependencies": {
39
- "@ekz/option": "^2.0.0",
40
+ "@ekz/option": "^2.0.1",
40
41
  "immutable": "^4 || ^5",
41
42
  "react": "^16.8.0 || ^17 || ^18 || ^19",
42
- "typescript": "^4 || ^5"
43
+ "typescript": "^4 || ^5 || ^6 "
43
44
  },
44
45
  "devDependencies": {
45
46
  "@ekz/option": "workspace:^",
46
47
  "@testing-library/dom": "^10.4.1",
47
48
  "@testing-library/jest-dom": "^6.9.1",
48
49
  "@testing-library/react": "^16.3.2",
49
- "@testing-library/react-hooks": "^8.0.1",
50
50
  "@testing-library/user-event": "^14.6.1",
51
51
  "@types/jest": "^30.0.0",
52
- "@types/node": "^25.6.0",
53
- "@types/react": "18.3.28",
54
- "immutable": "^5.1.5",
55
- "jest": "^30.2.0",
56
- "jest-environment-jsdom": "^30.2.0",
52
+ "@types/node": "^25.9.4",
53
+ "@types/react": "19.2.17",
54
+ "immutable": "^5.1.8",
55
+ "jest": "^30.4.2",
56
+ "jest-environment-jsdom": "^30.4.1",
57
57
  "npm-run-all": "^4.1.5",
58
- "react": "^18.3.1",
59
- "react-dom": "^18.3.1",
60
- "ts-jest": "^29.4.6",
61
- "typescript": "^5.9.3"
58
+ "react": "^19.2.7",
59
+ "react-dom": "^19.2.7",
60
+ "ts-jest": "^29.4.11",
61
+ "typescript": "^6.0.3"
62
62
  },
63
63
  "scripts": {
64
64
  "clean": "rm -rf lib/* || true",
65
- "lint": "npx eslint --ext .ts --ext .tsx ./src/main/web",
65
+ "lint": "npx eslint ./src/main/web",
66
66
  "lint:fix": "yarn lint --fix",
67
67
  "compile": "run-p \"compile:*\"",
68
68
  "compile:esm": "tsc -p ./src/main/web --outDir ./lib/esm",
69
69
  "compile:cjs": "tsc -p ./src/main/web -m commonjs --verbatimModuleSyntax false --outDir ./lib/cjs",
70
70
  "compile:esnext": "tsc -p ./src/main/web -t esnext --outDir ./lib/esnext",
71
- "test": "jest",
71
+ "dev": "yarn compile:esm --watch",
72
+ "test": "yarn typecheck:tests && jest",
73
+ "typecheck:tests": "tsc -p tsconfig.test.json",
72
74
  "prepublish": "yarn clean && yarn test --ci --no-watchman && yarn lint && yarn compile"
73
75
  },
74
76
  "jest": {
75
77
  "preset": "ts-jest/presets/default",
76
78
  "testEnvironment": "jsdom",
77
79
  "roots": [
78
- "<rootDir>/__tests__"
80
+ "<rootDir>/src/main/web"
81
+ ],
82
+ "testMatch": [
83
+ "**/__tests__/**/*.test.ts",
84
+ "**/__tests__/**/*.test.tsx"
79
85
  ],
80
86
  "transform": {
81
- "^.+\\.tsx?$": [
87
+ "^.+\\.[jt]sx?$": [
82
88
  "ts-jest",
83
89
  {
84
- "tsconfig": {
85
- "jsx": "react"
86
- }
90
+ "tsconfig": "tsconfig.test.json"
87
91
  }
88
92
  ]
89
93
  }