chore: clean up monorepo

This commit is contained in:
Ayo 2022-10-01 15:44:39 +02:00
parent c6dc470b07
commit eddf262add
11 changed files with 395 additions and 391 deletions

19
demo/.gitignore vendored
View file

@ -1,19 +0,0 @@
# build output
dist/
# dependencies
node_modules/
# logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# environment variables
.env
.env.production
# macOS-specific files
.DS_Store

View file

@ -1,5 +1,6 @@
{ {
"name": "@example/minimal", "name": "demo-astro-reactive-form",
"description": "Demo App for Astro Reactive Form",
"type": "module", "type": "module",
"version": "0.0.1", "version": "0.0.1",
"private": true, "private": true,
@ -14,7 +15,6 @@
"astro": "^1.4.2", "astro": "^1.4.2",
"astro-reactive-form": "^0.1.1" "astro-reactive-form": "^0.1.1"
}, },
"description": "``` npm create astro@latest -- --template minimal ```",
"main": "index.js", "main": "index.js",
"repository": { "repository": {
"type": "git", "type": "git",

View file

@ -1,45 +1,47 @@
--- ---
import { FormGroup, Submit } from 'astro-reactive-form/core'; import { FormGroup, Submit } from "astro-reactive-form/core";
import Form from 'astro-reactive-form'; import Form from "astro-reactive-form";
const form = new FormGroup([ const form = new FormGroup([
{ {
name: 'username', name: "username",
label: 'Username', label: "Username",
}, },
{ {
name: 'password', name: "password",
label: 'Password', label: "Password",
type: 'password', type: "password",
}, },
]); ]);
form.name = 'Simple Form'; form.name = "Simple Form";
form.controls.push({ form.controls.push({
type: 'checkbox', type: "checkbox",
name: 'is-awesome', name: "is-awesome",
label: 'is Awesome?', label: "is Awesome?",
labelPosition: "right",
value: "checked",
}); });
form.controls.push({ form.controls.push({
type: 'submit', type: "submit",
name: 'submit', name: "submit",
value: 'Submit', value: "Submit",
callBack: () => console.log('hey'), callBack: () => console.log("hey"),
} as Submit); } as Submit);
--- ---
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" /> <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="viewport" content="width=device-width" /> <meta name="viewport" content="width=device-width" />
<meta name="generator" content={Astro.generator} /> <meta name="generator" content={Astro.generator} />
<title>Astro</title> <title>Astro</title>
</head> </head>
<body> <body>
<h1>Astro Reactive Form</h1> <h1>Astro Reactive Form</h1>
<Form formGroups={[form]} /> <Form formGroups={[form]} />
</body> </body>
</html> </html>

681
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -14,11 +14,6 @@
"url": "https://ayco.io" "url": "https://ayco.io"
}, },
"scripts": { "scripts": {
"test": "mocha --parallel --timeout 15000",
"test:watch": "mocha --watch --parallel --timeout 15000",
"format": "prettier -w .",
"lint": "eslint . --ext .ts,.js",
"lint:fix": "eslint --fix . --ext .ts,.js",
"demo": "npm run dev -w demo" "demo": "npm run dev -w demo"
}, },
"license": "ISC", "license": "ISC",
@ -26,5 +21,8 @@
"demo", "demo",
"packages/astro-reactive-form", "packages/astro-reactive-form",
"packages/astro-reactive-validator" "packages/astro-reactive-validator"
] ],
"dependencies": {
"astro": "^1.4.2"
}
} }

View file

@ -9,6 +9,8 @@ export interface Props {
const { formGroups } = Astro.props; const { formGroups } = Astro.props;
--- ---
<form> {
{formGroups.map((group) => <FieldSet group={group} />)} <form>
</form> {formGroups?.map((group) => <FieldSet group={group} />)}
</form>
}

View file

@ -2,9 +2,7 @@
"compilerOptions": { "compilerOptions": {
"moduleResolution": "node", "moduleResolution": "node",
"module": "ESNext", "module": "ESNext",
"allowJs": true,
"noEmit": true "noEmit": true
}, },
"include": ["index.ts", "src"],
"extends": "astro/tsconfigs/strictest" "extends": "astro/tsconfigs/strictest"
} }