remix-validated-form 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- package/.eslintignore +1 -0
- package/.eslintrc.js +46 -0
- package/.github/workflows/test.yml +35 -0
- package/.husky/pre-commit +4 -0
- package/.prettierignore +8 -0
- package/LICENSE +21 -0
- package/README.md +3 -0
- package/jest.config.js +5 -0
- package/package.json +73 -0
- package/src/ValidatedForm.tsx +130 -0
- package/src/hooks.ts +27 -0
- package/src/index.ts +5 -0
- package/src/internal/formContext.ts +18 -0
- package/src/internal/util.ts +23 -0
- package/src/server.ts +5 -0
- package/src/validation/types.ts +12 -0
- package/src/validation/validation.test.ts +76 -0
- package/src/validation/withYup.ts +37 -0
- package/test-app/README.md +53 -0
- package/test-app/app/components/Input.tsx +24 -0
- package/test-app/app/components/SubmitButton.tsx +18 -0
- package/test-app/app/entry.client.tsx +4 -0
- package/test-app/app/entry.server.tsx +21 -0
- package/test-app/app/root.tsx +246 -0
- package/test-app/app/routes/default-values.tsx +34 -0
- package/test-app/app/routes/index.tsx +100 -0
- package/test-app/app/routes/noscript.tsx +10 -0
- package/test-app/app/routes/submission.alt.tsx +6 -0
- package/test-app/app/routes/submission.fetcher.tsx +6 -0
- package/test-app/app/routes/submission.tsx +47 -0
- package/test-app/app/routes/validation.tsx +40 -0
- package/test-app/app/styles/dark.css +7 -0
- package/test-app/app/styles/demos/about.css +26 -0
- package/test-app/app/styles/demos/remix.css +120 -0
- package/test-app/app/styles/global.css +98 -0
- package/test-app/cypress/fixtures/example.json +5 -0
- package/test-app/cypress/integration/default-values.ts +15 -0
- package/test-app/cypress/integration/sanity.ts +19 -0
- package/test-app/cypress/integration/submission.ts +26 -0
- package/test-app/cypress/integration/validation.ts +70 -0
- package/test-app/cypress/plugins/config.ts +38 -0
- package/test-app/cypress/plugins/index.ts +9 -0
- package/test-app/cypress/support/commands/index.ts +13 -0
- package/test-app/cypress/support/commands/types.d.ts +11 -0
- package/test-app/cypress/support/index.ts +20 -0
- package/test-app/cypress/tsconfig.json +11 -0
- package/test-app/cypress.json +3 -0
- package/test-app/package-lock.json +11675 -0
- package/test-app/package.json +40 -0
- package/test-app/public/favicon.ico +0 -0
- package/test-app/remix.config.js +10 -0
- package/test-app/remix.env.d.ts +2 -0
- package/test-app/tsconfig.json +18 -0
- package/tsconfig.json +15 -0
@@ -0,0 +1,40 @@
|
|
1
|
+
{
|
2
|
+
"private": true,
|
3
|
+
"name": "remix-app-template",
|
4
|
+
"description": "",
|
5
|
+
"license": "",
|
6
|
+
"scripts": {
|
7
|
+
"build": "remix build",
|
8
|
+
"dev": "start-server-and-test dev:remix http-get://localhost:3000 cy:open",
|
9
|
+
"test": "start-server-and-test dev:remix http-get://localhost:3000 cy:run",
|
10
|
+
"dev:remix": "remix dev",
|
11
|
+
"cy:open": "cypress open",
|
12
|
+
"cy:run": "cypress run",
|
13
|
+
"postinstall": "remix setup node",
|
14
|
+
"start": "remix-serve build"
|
15
|
+
},
|
16
|
+
"dependencies": {
|
17
|
+
"@remix-run/react": "^1.0.5",
|
18
|
+
"@remix-run/serve": "^1.0.5",
|
19
|
+
"@remix-run/server-runtime": "^1.0.5",
|
20
|
+
"react": "^17.0.2",
|
21
|
+
"react-dom": "^17.0.2",
|
22
|
+
"remix": "^1.0.5",
|
23
|
+
"yup": "^0.32.11"
|
24
|
+
},
|
25
|
+
"devDependencies": {
|
26
|
+
"@remix-run/dev": "^1.0.5",
|
27
|
+
"@testing-library/cypress": "^8.0.2",
|
28
|
+
"@types/react": "^17.0.24",
|
29
|
+
"@types/react-dom": "^17.0.9",
|
30
|
+
"cypress": "^9.1.0",
|
31
|
+
"har-validator": "^5.1.5",
|
32
|
+
"start-server-and-test": "^1.14.0",
|
33
|
+
"tiny-invariant": "^1.2.0",
|
34
|
+
"typescript": "^4.1.2"
|
35
|
+
},
|
36
|
+
"engines": {
|
37
|
+
"node": ">=14"
|
38
|
+
},
|
39
|
+
"sideEffects": false
|
40
|
+
}
|
Binary file
|
@@ -0,0 +1,18 @@
|
|
1
|
+
{
|
2
|
+
"include": ["remix.env.d.ts", "**/*.ts", "**/*.tsx"],
|
3
|
+
"compilerOptions": {
|
4
|
+
"lib": ["DOM", "DOM.Iterable", "ES2019"],
|
5
|
+
"esModuleInterop": true,
|
6
|
+
"jsx": "react-jsx",
|
7
|
+
"moduleResolution": "node",
|
8
|
+
"resolveJsonModule": true,
|
9
|
+
"target": "ES2019",
|
10
|
+
"strict": true,
|
11
|
+
"paths": {
|
12
|
+
"~/*": ["./app/*"]
|
13
|
+
},
|
14
|
+
|
15
|
+
// Remix takes care of building everything in `remix build`.
|
16
|
+
"noEmit": true
|
17
|
+
}
|
18
|
+
}
|
package/tsconfig.json
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
{
|
2
|
+
"compilerOptions": {
|
3
|
+
"allowJs": true,
|
4
|
+
"lib": ["DOM", "DOM.Iterable", "ES2019"],
|
5
|
+
"esModuleInterop": true,
|
6
|
+
"moduleResolution": "Node",
|
7
|
+
"target": "ES2019",
|
8
|
+
"strict": true,
|
9
|
+
"skipLibCheck": true,
|
10
|
+
"declaration": true,
|
11
|
+
"jsx": "react-jsx"
|
12
|
+
},
|
13
|
+
"exclude": ["node_modules"],
|
14
|
+
"include": ["src/**/*.ts", "src/**/*.tsx"]
|
15
|
+
}
|