Skip to content

Commit

Permalink
feat(form): Added the createFormStore factory function
Browse files Browse the repository at this point in the history
  • Loading branch information
sullivanpj committed Jun 28, 2024
1 parent 0a1d2ed commit b8b1cd8
Show file tree
Hide file tree
Showing 13 changed files with 29,861 additions and 20,101 deletions.
8 changes: 4 additions & 4 deletions packages/form/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
## 0.9.0 (2024-06-20)


### 🚀 Features

- **monorepo:** Upgrade base storm packages ([8b461be](https://github.com/storm-software/cyclone-ui/commit/8b461be))
- **monorepo:** Upgrade base storm packages
([8b461be](https://github.com/storm-software/cyclone-ui/commit/8b461be))

## 0.8.0 (2024-06-19)


### 🚀 Features

- **form:** Added the `useForm` hook to generate an API object ([a499b30](https://github.com/storm-software/cyclone-ui/commit/a499b30))
- **form:** Added the `useForm` hook to generate an API object
([a499b30](https://github.com/storm-software/cyclone-ui/commit/a499b30))

## 0.7.0 (2024-06-19)

Expand Down
132 changes: 132 additions & 0 deletions packages/form/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,33 @@
<!-- START header -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->


<div align="center"><img src="https://pub-761b436209f44a4d886487c917806c08.r2.dev/logo-banner.png" width="100%" alt="Storm Software" /></div>

<br />
<div align="center">
<a href="https://stormsoftware.com" target="_blank">Website</a> | <a href="https://stormsoftware.com/contact" target="_blank">Contact</a> | <a href="https://github.com/storm-software/cyclone-ui" target="_blank">Repository</a> | <a href="https://stormstack.github.io/stormstack/" target="_blank">Documentation</a> | <a href="https://github.com/storm-software/cyclone-ui/issues/new?assignees=&labels=bug&template=bug-report.yml&title=Bug Report%3A+">Report a Bug</a> | <a href="https://github.com/storm-software/cyclone-ui/issues/new?assignees=&labels=enhancement&template=feature-request.yml&title=Feature Request%3A+">Request a Feature</a> | <a href="https://github.com/storm-software/cyclone-ui/issues/new?assignees=&labels=documentation&template=documentation.yml&title=Documentation Request%3A+">Request Documentation</a> | <a href="https://github.com/storm-software/cyclone-ui/discussions">Ask a Question</a>
</div>

<br />
This package is part of the <b>⚡cyclone-ui</b> monorepo. The cyclone-ui packages include CLI utility applications, tools, and various libraries used to create modern, scalable web applications.
<br />

<h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />

[![Version](https://img.shields.io/badge/version-0.9.0-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;
[![Nx](https://img.shields.io/badge/Nx-17.0.2-lightgrey?style=for-the-badge&logo=nx&logoWidth=20&&color=1fb2a6)](http://nx.dev/)&nbsp;[![NextJs](https://img.shields.io/badge/Next.js-14.0.2-lightgrey?style=for-the-badge&logo=nextdotjs&logoWidth=20&color=1fb2a6)](https://nextjs.org/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;[![documented with docusaurus](https://img.shields.io/badge/documented_with-docusaurus-success.svg?style=for-the-badge&logo=readthedocs&color=1fb2a6)](https://docusaurus.io/)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/storm-ops/cr.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)

> [!IMPORTANT]
> This repository, and the apps, libraries, and tools contained within, is still in it's initial development phase. As a result, bugs and issues are expected with it's usage. When the main development phase completes, a proper release will be performed, the packages will be availible through NPM (and other distributions), and this message will be removed. However, in the meantime, please feel free to report any issues you may come across.
<br />


<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->

<!-- END header -->

# form
Expand Down Expand Up @@ -60,4 +89,107 @@ Run `nx test form` to execute the unit tests via [Jest](https://jestjs.io).
Run `nx lint form` to run [ESLint](https://eslint.org/) on the package.

<!-- START footer -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->


## Storm Workspaces

Storm workspaces are built using <a href="https://nx.dev/" target="_blank">Nx</a>, a set of extensible dev tools for monorepos, which helps you develop like Google, Facebook, and Microsoft. Building on top of Nx, the Open System provides a set of tools and patterns that help you scale your monorepo to many teams while keeping the codebase maintainable.

## Roadmap

See the [open issues](https://github.com/storm-software/cyclone-ui/issues) for a list of proposed features (and known issues).

- [Top Feature Requests](https://github.com/storm-software/cyclone-ui/issues?q=label%3Aenhancement+is%3Aopen+sort%3Areactions-%2B1-desc) (Add your votes using the 👍 reaction)
- [Top Bugs](https://github.com/storm-software/cyclone-ui/issues?q=is%3Aissue+is%3Aopen+label%3Abug+sort%3Areactions-%2B1-desc) (Add your votes using the 👍 reaction)
- [Newest Bugs](https://github.com/storm-software/cyclone-ui/issues?q=is%3Aopen+is%3Aissue+label%3Abug)

## Support

Reach out to the maintainer at one of the following places:

- [Contact](https://stormsoftware.com/contact)
- [GitHub discussions](https://github.com/storm-software/cyclone-ui/discussions)
- <[email protected]>

## License

This project is licensed under the **Apache License 2.0**. Feel free to edit and distribute this template as you like.

See [LICENSE](LICENSE) for more information.

## Changelog

This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). Every release, along with the migration instructions, is documented in the [CHANGELOG](CHANGELOG.md) file

## Contributing

First off, thanks for taking the time to contribute! Contributions are what makes the open-source community such an amazing place to learn, inspire, and create. Any contributions you make will benefit everybody else and are **greatly appreciated**.

Please try to create bug reports that are:

- _Reproducible._ Include steps to reproduce the problem.
- _Specific._ Include as much detail as possible: which version, what environment, etc.
- _Unique._ Do not duplicate existing opened issues.
- _Scoped to a Single Bug._ One bug per report.

Please adhere to this project's [code of conduct](.github/CODE_OF_CONDUCT.md).

You can use [markdownlint-cli](https://github.com/storm-software/cyclone-ui/markdownlint-cli) to check for common markdown style inconsistency.

## Contributors

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->

<table>
<tbody>
<tr>
<td align="center" valign="top" width="14.28%"><a href="http://www.sullypat.com/"><img src="https://avatars.githubusercontent.com/u/99053093?v=4?s=100" width="100px;" alt="Patrick Sullivan"/><br /><sub><b>Patrick Sullivan</b></sub></a><br /><a href="#design-sullivanpj" title="Design">🎨</a> <a href="https://github.com/storm-software/storm-ops/commits?author=sullivanpj" title="Code">💻</a> <a href="#tool-sullivanpj" title="Tools">🔧</a> <a href="https://github.com/storm-software/storm-ops/commits?author=sullivanpj" title="Documentation">📖</a> <a href="https://github.com/storm-software/storm-ops/commits?author=sullivanpj" title="Tests">⚠️</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://tylerbenning.com/"><img src="https://avatars.githubusercontent.com/u/7265547?v=4?s=100" width="100px;" alt="Tyler Benning"/><br /><sub><b>Tyler Benning</b></sub></a><br /><a href="#design-tbenning" title="Design">🎨</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://stormsoftware.com"><img src="https://avatars.githubusercontent.com/u/149802440?v=4?s=100" width="100px;" alt="Stormie"/><br /><sub><b>Stormie</b></sub></a><br /><a href="#maintenance-stormie-bot" title="Maintenance">🚧</a></td>
</tr>
</tbody>
<tfoot>
<tr>
<td align="center" size="13px" colspan="7">
<img src="https://raw.githubusercontent.com/all-contributors/all-contributors-cli/1b8533af435da9854653492b1327a23a4dbd0a10/assets/logo-small.svg">
<a href="https://all-contributors.js.org/docs/en/bot/usage">Add your contributions</a>
</img>
</td>
</tr>
</tfoot>
</table>

<!-- ALL-CONTRIBUTORS-LIST:END -->

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!

<br />
<br />
<div align="center">
<img src="https://pub-761b436209f44a4d886487c917806c08.r2.dev/logo-banner.png" width="100%" altText="Storm Software" />
</div>
<br />

<div align="center">
<a href="https://stormsoftware.com" target="_blank">Website</a> | <a href="https://stormsoftware.com/contact" target="_blank">Contact</a> | <a href="https://linkedin.com/in/patrick-sullivan-865526b0" target="_blank">LinkedIn</a> | <a href="https://medium.com/@pat.joseph.sullivan" target="_blank">Medium</a> | <a href="https://github.com/storm-software" target="_blank">GitHub</a> | <a href="https://keybase.io/sullivanp" target="_blank">OpenPGP Key</a>
</div>

<div align="center">
<p><b>Fingerprint:</b> 1BD2 7192 7770 2549 F4C9 F238 E6AD C420 DA5C 4C2D</p>
</div>

Storm Software is an open source software development organization and creator of Acidic, StormStack and StormCloud. Our mission is to make software development more accessible. Our ideal future is one where anyone can create software without years of prior development experience serving as a barrier to entry. We hope to achieve this via LLMs, Generative AI, and intuitive, high-level data modeling/programming languagues.

If this sounds interesting, and you would like to help us in creating the next generation of development tools, please reach out on our website!

<h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br /><br />


<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->

<!-- END footer -->
9 changes: 5 additions & 4 deletions packages/form/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,21 @@
"peerDependencies": {
"react": "19.0.0-rc-fb9a90fa48-20240614",
"react-dom": "19.0.0-rc-fb9a90fa48-20240614",
"react-native": "0.73.2"
"react-native": "0.73.2",
"zustand": ">=4.3.9"
},
"dependencies": {
"@tamagui/core": "^1.98.0",
"@tamagui/lucide-icons": "^1.98.0",
"@tamagui/web": "^1.98.0",
"@tanstack/form-core": "^0.21.0",
"@tanstack/react-form": "^0.21.0",
"decode-formdata": "^0.7.5",
"react-native-svg": "^15.2.0"
},
"devDependencies": {
"react": "19.0.0-rc-fb9a90fa48-20240614",
"react-dom": "19.0.0-rc-fb9a90fa48-20240614",
"react-native": "0.73.2"
"react-native": "0.73.2",
"zustand": ">=4.3.9"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/form/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"tsConfig": "packages/form/tsconfig.json",
"project": "packages/form/package.json",
"defaultConfiguration": "production",
"external": ["@cyclone-ui/*", "react", "react-native"],
"external": ["@cyclone-ui/*", "react", "react-dom", "react-native"],
"assets": [
{
"input": "packages/form",
Expand Down
9 changes: 9 additions & 0 deletions packages/form/src/create-form-factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ import {
FormOptions,
createFormFactory as reactFormCreateFormFactory
} from "@tanstack/react-form";
import type { FormOptions } from "./form-api";
import type { Validator } from "./types";

export function getFormOptions<
TFormData,
TFormValidator extends Validator<TFormData, unknown> | undefined = undefined
>(defaultOpts?: FormOptions<TFormData, TFormValidator>) {
return defaultOpts;
}

export const DEFAULT_FORM_OPTIONS = {
asyncDebounceMs: 250
Expand Down
Loading

0 comments on commit b8b1cd8

Please sign in to comment.