Skip to content

Commit e5f6007

Browse files
committed
chore: initial commit
0 parents  commit e5f6007

40 files changed

+7926
-0
lines changed

.editorconfig

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true

.gitattributes

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto eol=lf

.gitignore

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
2+
# See https://help.github.com/ignore-files/ for more about ignoring files.
3+
4+
# dependencies
5+
node_modules
6+
package-lock.json
7+
yarn.lock
8+
9+
# builds
10+
build
11+
coverage
12+
dist
13+
14+
# misc
15+
.DS_Store
16+
.env
17+
.env.local
18+
.env.development.local
19+
.env.test.local
20+
.env.production.local
21+
.next
22+
23+
npm-debug.log*
24+
yarn-debug.log*
25+
yarn-error.log*
26+
.history
27+
size-plugin.json
28+
stats-hydration.json
29+
stats.json
30+
stats.html
31+
.vscode/settings.json
32+
33+
*.log
34+
.cache
35+
.idea
36+
.nx/cache
37+
.nx/workspace-data
38+
.pnpm-store
39+
.tsup
40+
41+
vite.config.js.timestamp-*
42+
vite.config.ts.timestamp-*

.npmrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
link-workspace-packages=true
2+
prefer-workspace-packages=true
3+
provenance=true

.nvmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
20.15.1

.prettierignore

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
**/.next
2+
**/.nx/cache
3+
**/.svelte-kit
4+
**/build
5+
**/coverage
6+
**/dist
7+
**/docs
8+
**/codemods/**/__testfixtures__
9+
pnpm-lock.yaml

.prettierrc

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"semi": false,
3+
"singleQuote": true,
4+
"trailingComma": "all"
5+
}

CONTRIBUTING.md

+195
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,195 @@
1+
# Contributing
2+
3+
## Questions
4+
5+
If you have questions about implementation details, help or support, then please use our dedicated community forum at [GitHub Discussions](https://github.com/TanStack/form/discussions) **PLEASE NOTE:** If you choose to instead open an issue for your question, your issue will be immediately closed and redirected to the forum.
6+
7+
## Reporting Issues
8+
9+
If you have found what you think is a bug, please [file an issue](https://github.com/TanStack/form/issues/new/choose). **PLEASE NOTE:** Issues that are identified as implementation questions or non-issues will be immediately closed and redirected to [GitHub Discussions](https://github.com/TanStack/form/discussions)
10+
11+
## Suggesting new features
12+
13+
If you are here to suggest a feature, first create an issue if it does not already exist. From there, we will discuss use-cases for the feature and then finally discuss how it could be implemented.
14+
15+
## Development
16+
17+
If you have been assigned to fix an issue or develop a new feature, please follow these steps to get started:
18+
19+
- Fork this repository.
20+
- Install dependencies by running `$ pnpm install`.
21+
- We use [pnpm](https://pnpm.io/) v7 for package management.
22+
- We use [nvm](https://github.com/nvm-sh/nvm) to manage node versions - please make sure to use the version mentioned in `.nvmrc`.
23+
- Run development server using `pnpm run watch`.
24+
- Implement your changes and tests to files in the `src/` directory and corresponding test files.
25+
- Document your changes in the appropriate doc page.
26+
- Git stage your required changes and commit (see below commit guidelines).
27+
- Submit PR for review.
28+
29+
### Editing the docs locally and previewing the changes
30+
31+
The documentations for all the TanStack projects are hosted on [tanstack.com](https://tanstack.com), which is a Remix application (https://github.com/TanStack/tanstack.com). You need to run this app locally to preview your changes in the `TanStack/form` docs.
32+
33+
> [!NOTE]
34+
> The Remix app fetches the doc pages from GitHub in production, and searches for them at `../form/docs` in development. Your local clone of `TanStack/form` needs to be in the same directory as the local clone of `TansStack/tanstack.com`.
35+
36+
You can follow these steps to set up the docs for local development:
37+
38+
1. Make a new directory called `tanstack`.
39+
40+
```sh
41+
mkdir tanstack
42+
```
43+
44+
2. Enter that directory and clone the [`TanStack/form`](https://github.com/TanStack/form) and [`TanStack/tanstack.com`](https://github.com/TanStack/tanstack.com) repos.
45+
46+
```sh
47+
cd tanstack
48+
git clone [email protected]:TanStack/form.git
49+
# We probably don't need all the branches and commit history
50+
# from the `tanstack.com` repo, so let's just create a shallow
51+
# clone of the latest version of the `main` branch.
52+
# Read more about shallow clones here:
53+
# https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone/#user-content-shallow-clones
54+
git clone [email protected]:TanStack/tanstack.com.git --depth=1 --single-branch --branch=main
55+
```
56+
57+
> [!NOTE]
58+
> Your `tanstack` directory should look like this:
59+
>
60+
> ```
61+
> tanstack/
62+
> |
63+
> +-- form/ (<-- this directory cannot be called anything else!)
64+
> |
65+
> +-- tanstack.com/
66+
> ```
67+
68+
3. Enter the `tanstack/tanstack.com` directory, install the dependencies and run the app in dev mode:
69+
70+
```sh
71+
cd tanstack.com
72+
pnpm i
73+
# The app will run on https://localhost:3000 by default
74+
pnpm dev
75+
```
76+
77+
4. Now you can visit http://localhost:3000/form/latest/docs/overview in the browser and see the changes you make in `tanstack/form/docs` there.
78+
79+
> [!WARNING]
80+
> You will need to update the `docs/config.json` file (in `TanStack/form`) if you add a new documentation page!
81+
82+
You can see the whole process in the screen capture below:
83+
84+
https://github.com/fulopkovacs/form/assets/43729152/9d35a3c3-8153-4e74-9cb2-af275f7a269b
85+
86+
### Running examples
87+
88+
- Make sure you've installed the dependencies by running `$ pnpm install` in the repo's root directory.
89+
- If you want to run the example against your local changes, run `pnpm run watch` in the repo's root directory. Otherwise, it will be run against the latest TanStack Form release.
90+
- Run `pnpm run dev` in the selected examples' directory.
91+
92+
#### Note on `examples/react-native`
93+
94+
React Native example requires Expo to work. Please follow the instructions from example's README.md file to learn more.
95+
96+
#### Note on standalone execution
97+
98+
If you want to run an example without installing dependencies for the whole repo, just follow instructions from the example's README.md file. It will be then run against the latest TanStack Form release.
99+
100+
## Online one-click setup
101+
102+
You can use Gitpod (An Online Open Source VS Code like IDE which is free for Open Source) for developing online. With a single click it will start a workspace and automatically:
103+
104+
- clone the `TanStack/form` repo.
105+
- install all the dependencies in `/` and `/docs`.
106+
- run `npm start` in the root(`/`) to Auto-build files.
107+
- run `npm run dev` in `/docs`.
108+
109+
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/TanStack/form)
110+
111+
## Commit message conventions
112+
113+
`TanStack/form` is using [Angular Commit Message Conventions](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#-git-commit-guidelines).
114+
115+
We have very precise rules over how our git commit messages can be formatted. This leads to **more readable messages** that are easy to follow when looking through the **project history**.
116+
117+
### Commit Message Format
118+
119+
Each commit message consists of a **header**, a **body** and a **footer**. The header has a special
120+
format that includes a **type**, a **scope** and a **subject**:
121+
122+
```
123+
<type>(<scope>): <subject>
124+
<BLANK LINE>
125+
<body>
126+
<BLANK LINE>
127+
<footer>
128+
```
129+
130+
The **header** is mandatory and the **scope** of the header is optional.
131+
132+
Any line of the commit message cannot be longer than 100 characters! This allows the message to be easier to read on GitHub as well as in various git tools.
133+
134+
### Type
135+
136+
Must be one of the following:
137+
138+
- **feat**: A new feature
139+
- **fix**: A bug fix
140+
- **docs**: Documentation only changes
141+
- **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing
142+
semi-colons, etc)
143+
- **refactor**: A code change that neither fixes a bug nor adds a feature
144+
- **perf**: A code change that improves performance
145+
- **test**: Adding missing or correcting existing tests
146+
- **chore**: Changes to the build process or auxiliary tools and libraries such as documentation
147+
generation
148+
149+
### Scope
150+
151+
The scope could be anything specifying place of the commit change. For example `useForm`, `useMutation` etc...
152+
153+
You can use `*` when the change affects more than a single scope.
154+
155+
### Subject
156+
157+
The subject contains succinct description of the change:
158+
159+
- use the imperative, present tense: "change" not "changed" nor "changes"
160+
- don't capitalize first letter
161+
- no dot (.) at the end
162+
163+
### Body
164+
165+
Just as in the **subject**, use the imperative, present tense: "change" not "changed" nor "changes". The body should include the motivation for the change and contrast this with previous behavior.
166+
167+
### Footer
168+
169+
The footer should contain any information about **Breaking Changes** and is also the place to [reference GitHub issues that this commit closes](https://help.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue).
170+
171+
**Breaking Changes** should start with the word `BREAKING CHANGE:` with a space or two newlines. The rest of the commit message is then used for this.
172+
173+
### Example
174+
175+
Here is an example of the release type that will be done based on a commit messages:
176+
177+
| Commit message | Release type |
178+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------- |
179+
| `fix(pencil): stop graphite breaking when too much pressure applied` | Patch Release |
180+
| `feat(pencil): add 'graphiteWidth' option` | ~~Minor~~ Feature Release |
181+
| `perf(pencil): remove graphiteWidth option`<br><br>`BREAKING CHANGE: The graphiteWidth option has been removed.`<br>`The default graphite width of 10mm is always used for performance reasons.` | ~~Major~~ Breaking Release |
182+
183+
### Revert
184+
185+
If the commit reverts a previous commit, it should begin with `revert:`, followed by the header of the reverted commit. In the body it should say: `This reverts commit <hash>.`, where the hash is the SHA of the commit being reverted.
186+
187+
## Pull requests
188+
189+
Maintainers merge pull requests by squashing all commits and editing the commit message if necessary using the GitHub user interface.
190+
191+
Use an appropriate commit type. Be especially careful with breaking changes.
192+
193+
## Releases
194+
195+
For each new commit added to `main` with `git push` or by merging a pull request or merging from another branch, a GitHub action is triggered and runs the `semantic-release` command to make a release if there are codebase changes since the last release that affect the package functionalities.

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021-present Tanner Linsley
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

codecov.yml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
coverage:
2+
status:
3+
project:
4+
default:
5+
target: 90%
6+
threshold: 1%

eslint.config.js

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// @ts-check
2+
3+
// @ts-ignore Needed due to moduleResolution Node vs Bundler
4+
import { tanstackConfig } from '@tanstack/config/eslint'
5+
6+
export default [
7+
...tanstackConfig,
8+
{
9+
name: 'tanstack/temp',
10+
rules: {
11+
'@typescript-eslint/array-type': 'off',
12+
'@typescript-eslint/method-signature-style': 'off',
13+
'@typescript-eslint/naming-convention': 'off',
14+
'@typescript-eslint/no-unnecessary-type-assertion': 'off',
15+
'@typescript-eslint/no-unsafe-function-type': 'off',
16+
'@typescript-eslint/require-await': 'off',
17+
'no-async-promise-executor': 'off',
18+
'no-empty': 'off',
19+
},
20+
},
21+
]

examples/vue/simple/.gitignore

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
node_modules
2+
.DS_Store
3+
dist
4+
dist-ssr
5+
*.local
6+
7+
package-lock.json
8+
yarn.lock
9+
pnpm-lock.yaml

examples/vue/simple/README.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Basic example
2+
3+
To run this example:
4+
5+
- `npm install` or `yarn` or `pnpm i`
6+
- `npm run dev` or `yarn dev` or `pnpm dev`

examples/vue/simple/index.html

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title>TanStack Form Vue Simple Example App</title>
7+
</head>
8+
<body>
9+
<div id="app"></div>
10+
<script type="module" src="/src/main.ts"></script>
11+
</body>
12+
</html>

examples/vue/simple/package.json

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"name": "vue-redux-demo-simple",
3+
"private": true,
4+
"type": "module",
5+
"scripts": {
6+
"dev": "vite",
7+
"build": "vite build",
8+
"build:dev": "vite build -m development",
9+
"test:types": "vue-tsc",
10+
"serve": "vite preview"
11+
},
12+
"dependencies": {
13+
"vue-redux": "^0.0.1",
14+
"redux": "^5.0.1",
15+
"@reduxjs/toolkit": "^2.2.7",
16+
"vue": "^3.3.4"
17+
},
18+
"devDependencies": {
19+
"@vitejs/plugin-vue": "^5.1.3",
20+
"typescript": "5.4.2",
21+
"vite": "^5.4.2",
22+
"vue-tsc": "^2.0.26"
23+
}
24+
}

examples/vue/simple/src/App.vue

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<template>
2+
<p>Testing</p>
3+
</template>

examples/vue/simple/src/main.ts

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { createApp } from 'vue'
2+
3+
import App from './App.vue'
4+
5+
createApp(App).mount('#app')
+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
declare module '*.vue' {
2+
import { DefineComponent } from 'vue'
3+
const component: DefineComponent<{}, {}, any>
4+
export default component
5+
}

0 commit comments

Comments
 (0)