Skip to content

Commit b59bb69

Browse files
author
antoniopangallo
committed
createFormStore-workspace
1 parent e797c22 commit b59bb69

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+3614
-501
lines changed

.github/workflows/github-actions.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
default: "false"
1212

1313
env:
14-
NODE_VERSION: 18.20.8
14+
NODE_VERSION: 20.19.0
1515

1616
jobs:
1717
tests:
@@ -79,6 +79,9 @@ jobs:
7979
cypress-test:
8080
name: Automation Tests 🌐
8181
runs-on: ubuntu-latest
82+
strategy:
83+
matrix:
84+
browser: [chrome, firefox, edge, electron]
8285
env:
8386
TERM: xterm
8487
CI: true
@@ -102,18 +105,19 @@ jobs:
102105
- name: Wait for server ⏳
103106
run: npx wait-on http://localhost:3000/index_react_16.13.0.html --timeout 120000
104107

105-
- name: Run Cypress Tests 🧪
108+
- name: Run Cypress Tests on ${{ matrix.browser }} 🧪
106109
uses: cypress-io/github-action@v6
107110
env:
108111
CI: true
109112
with:
110-
command: yarn cy:run
113+
browser: ${{ matrix.browser }}
114+
command: yarn cy:run --browser ${{ matrix.browser }}
111115

112116
- name: Upload Cypress Artifacts 📂
113117
if: always()
114118
uses: actions/upload-artifact@v4
115119
with:
116-
name: cypress-artifacts-${{ github.run_number }}-${{ github.sha }}
120+
name: cypress-artifacts-${{ matrix.browser }}-${{ github.run_number }}-${{ github.sha }}
117121
path: |
118122
cypress/videos
119123
cypress/screenshots
@@ -205,6 +209,7 @@ jobs:
205209
- name: Extract current version
206210
id: version
207211
run: echo "VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV
212+
working-directory: workspaces/usetheform
208213

209214
- name: 🏷️ Check if tag already exists
210215
run: |

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v18.20.8
1+
v20.19.0

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,28 @@
11
# Changelog
22

3+
## [v4.0.0](https://github.com/iusehooks/usetheform/releases/tag/v4.0.0)
4+
5+
### Improvements:
6+
7+
- Added `createFormStore`: create and manage reactive form state with a store and selector hook — no provider needed.
8+
9+
Need to read or manipulate Form's Fields anywhere outside Form context?
10+
11+
**Example:**
12+
13+
```javascript
14+
import { createFormStore } from 'usetheform';
15+
16+
const [formStore, useFormSelector] = createFormStore({ counter: 0 });
17+
18+
export const awesomeFormStore = formStore;
19+
export const useAwesomeFormSelector = useFormSelector;
20+
```
21+
22+
### Fixes:
23+
24+
- Fixed issues with React 18+ strict mode in certain edge cases when using the `<Collection array />`
25+
326
## [v3.6.0](https://github.com/iusehooks/usetheform/releases/tag/v3.6.0)
427

528
### Improvements:

CONTRIBUTING.md

Lines changed: 68 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,86 @@
11
# Contributing to UseTheForm
22

3-
🎉 First off, thanks for taking the time to contribute! 🎉
3+
🎉 First off, **thank you** for taking the time to contribute — your help is what keeps this project growing! 🎉
44

5-
With the aim of ensuring that `usetheform` lives and continues to grow we would like to encourage everyone to help and support this library by contributing.
5+
We welcome all contributions, whether you're fixing bugs, adding new features, improving documentation, or simply spreading the word. Let's build something great together.
66

7-
## Pull Request Process
7+
## Prerequisites
88

9-
1. Fork and clone the repo to your local machine
9+
Before getting started, make sure you have the following tools installed:
1010

11-
2. Create a new branch from `master` with a meaningful name for a new feature or an issue you want to work on: `git checkout -b your-meaningful-branch-name`
11+
- **Node.js** (v20.19.0 is recommended)
12+
Make sure you have Node.js installed. You can manage multiple versions of Node.js using [nvm](https://github.com/nvm-sh/nvm).
1213

13-
3. Install packages by running:
14+
- **Corepack** (which comes bundled with Node.js v16.9 and later)
15+
Corepack allows you to manage Yarn versions per project without requiring a global installation of Yarn.
1416

15-
> npm i
16-
17-
4. If you have added/removed code ensure that test suite still passes.
17+
## 🚀 Getting Started
1818

19-
> npm test
20-
21-
5. Write some unit tests to cover as much of your code as possible.
19+
1. **Fork** the repository and **clone** it to your local machine:
20+
```bash
21+
git clone https://github.com/your-username/usetheform.git
22+
```
2223

23-
6. Ensure your code lints without errors.
24+
2. **Enable Yarn via Corepack** (required for newer versions of Node.js):
2425

25-
> npm run lint
26-
27-
7. Ensure build passes.
26+
If you don’t have Yarn installed globally, just enable it with:
27+
```bash
28+
corepack enable
29+
```
2830

29-
> npm run build
30-
31-
8. Push your branch: `git push -u origin your-meaningful-branch-name`
31+
> 💡 `corepack` comes bundled with Node.js (v16.10+), and helps manage Yarn versions.
3232
33-
9. Submit a pull request to the upstream usetheform repository.
33+
3. **Install dependencies**:
34+
```bash
35+
yarn
36+
```
3437

35-
10. Choose a descriptive title and describe your changes briefly.
38+
4. **Create a new branch** from `master` with a meaningful name:
39+
```bash
40+
git checkout -b your-feature-or-fix-name
41+
```
3642

37-
## Coding style
43+
## ✅ Development Checklist
3844

39-
UseTheForm uses eslint and prettier. As suggestion, you might enable the eslint and prettier plugins in your editor to get real-time feedback. To execute the linting manually, run the following command: `npm run lint`
45+
Before submitting your pull request, please make sure to:
4046

41-
## License
47+
-**Run tests** to ensure everything works as expected:
48+
```bash
49+
yarn test
50+
```
4251

43-
By contributing your code to the usetheform GitHub repository, you agree to license your code under the MIT license.
52+
-**Write unit tests** for your changes where applicable.
53+
54+
-**Lint your code** for formatting and style issues:
55+
```bash
56+
yarn lint
57+
```
58+
59+
-**Build the project** to verify that everything compiles:
60+
```bash
61+
yarn build
62+
```
63+
64+
-**Push your branch** to your forked repo:
65+
```bash
66+
git push -u origin your-feature-or-fix-name
67+
```
68+
69+
-**Open a Pull Request** against the `master` branch in the main repository.
70+
- Use a **clear title** and **brief description** of your changes.
71+
72+
## 🧑‍💻 Code Style
73+
74+
UseTheForm follows consistent styling via **ESLint** and **Prettier**.
75+
76+
👉 We recommend enabling their plugins in your code editor for real-time feedback.
77+
78+
Run manually:
79+
80+
```bash
81+
yarn lint
82+
```
83+
84+
## 📄 License
85+
86+
By contributing to this project, you agree to license your work under the [MIT License](../LICENSE.md), in line with the rest of the repository.

0 commit comments

Comments
 (0)