From 1927b14b6616e69507a510574b3fd2c9f02e83ad Mon Sep 17 00:00:00 2001 From: Ayo Date: Sat, 1 Oct 2022 13:07:05 +0200 Subject: [PATCH] initial demo app --- demo/.gitignore | 19 +++++++++++++++ demo/.vscode/extensions.json | 4 ++++ demo/.vscode/launch.json | 11 +++++++++ demo/README.md | 45 ++++++++++++++++++++++++++++++++++++ demo/astro.config.mjs | 4 ++++ demo/package.json | 29 +++++++++++++++++++++++ demo/public/favicon.svg | 13 +++++++++++ demo/src/env.d.ts | 1 + demo/src/pages/index.astro | 36 +++++++++++++++++++++++++++++ demo/tsconfig.json | 3 +++ 10 files changed, 165 insertions(+) create mode 100644 demo/.gitignore create mode 100644 demo/.vscode/extensions.json create mode 100644 demo/.vscode/launch.json create mode 100644 demo/README.md create mode 100644 demo/astro.config.mjs create mode 100644 demo/package.json create mode 100644 demo/public/favicon.svg create mode 100644 demo/src/env.d.ts create mode 100644 demo/src/pages/index.astro create mode 100644 demo/tsconfig.json diff --git a/demo/.gitignore b/demo/.gitignore new file mode 100644 index 0000000..02f6e50 --- /dev/null +++ b/demo/.gitignore @@ -0,0 +1,19 @@ +# 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 diff --git a/demo/.vscode/extensions.json b/demo/.vscode/extensions.json new file mode 100644 index 0000000..22a1505 --- /dev/null +++ b/demo/.vscode/extensions.json @@ -0,0 +1,4 @@ +{ + "recommendations": ["astro-build.astro-vscode"], + "unwantedRecommendations": [] +} diff --git a/demo/.vscode/launch.json b/demo/.vscode/launch.json new file mode 100644 index 0000000..d642209 --- /dev/null +++ b/demo/.vscode/launch.json @@ -0,0 +1,11 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "command": "./node_modules/.bin/astro dev", + "name": "Development server", + "request": "launch", + "type": "node-terminal" + } + ] +} diff --git a/demo/README.md b/demo/README.md new file mode 100644 index 0000000..da4f712 --- /dev/null +++ b/demo/README.md @@ -0,0 +1,45 @@ +# Astro Starter Kit: Minimal + +``` +npm create astro@latest -- --template minimal +``` + +[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/astro/tree/latest/examples/minimal) + +> 🧑‍🚀 **Seasoned astronaut?** Delete this file. Have fun! + +## 🚀 Project Structure + +Inside of your Astro project, you'll see the following folders and files: + +``` +/ +├── public/ +├── src/ +│ └── pages/ +│ └── index.astro +└── package.json +``` + +Astro looks for `.astro` or `.md` files in the `src/pages/` directory. Each page is exposed as a route based on its file name. + +There's nothing special about `src/components/`, but that's where we like to put any Astro/React/Vue/Svelte/Preact components. + +Any static assets, like images, can be placed in the `public/` directory. + +## 🧞 Commands + +All commands are run from the root of the project, from a terminal: + +| Command | Action | +| :--------------------- | :----------------------------------------------- | +| `npm install` | Installs dependencies | +| `npm run dev` | Starts local dev server at `localhost:3000` | +| `npm run build` | Build your production site to `./dist/` | +| `npm run preview` | Preview your build locally, before deploying | +| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` | +| `npm run astro --help` | Get help using the Astro CLI | + +## 👀 Want to learn more? + +Feel free to check [our documentation](https://docs.astro.build) or jump into our [Discord server](https://astro.build/chat). diff --git a/demo/astro.config.mjs b/demo/astro.config.mjs new file mode 100644 index 0000000..882e651 --- /dev/null +++ b/demo/astro.config.mjs @@ -0,0 +1,4 @@ +import { defineConfig } from 'astro/config'; + +// https://astro.build/config +export default defineConfig({}); diff --git a/demo/package.json b/demo/package.json new file mode 100644 index 0000000..9c315f6 --- /dev/null +++ b/demo/package.json @@ -0,0 +1,29 @@ +{ + "name": "@example/minimal", + "type": "module", + "version": "0.0.1", + "private": true, + "scripts": { + "dev": "astro dev", + "start": "astro dev", + "build": "astro build", + "preview": "astro preview", + "astro": "astro" + }, + "dependencies": { + "astro": "^1.4.2" + }, + "description": "``` npm create astro@latest -- --template minimal ```", + "main": "index.js", + "devDependencies": {}, + "repository": { + "type": "git", + "url": "git+https://github.com/ayoayco/astro-reactive-form.git" + }, + "author": "Ayo Ayco", + "license": "ISC", + "bugs": { + "url": "https://github.com/ayoayco/astro-reactive-form/issues" + }, + "homepage": "https://github.com/ayoayco/astro-reactive-form#readme" +} diff --git a/demo/public/favicon.svg b/demo/public/favicon.svg new file mode 100644 index 0000000..0f39062 --- /dev/null +++ b/demo/public/favicon.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + diff --git a/demo/src/env.d.ts b/demo/src/env.d.ts new file mode 100644 index 0000000..f964fe0 --- /dev/null +++ b/demo/src/env.d.ts @@ -0,0 +1 @@ +/// diff --git a/demo/src/pages/index.astro b/demo/src/pages/index.astro new file mode 100644 index 0000000..620d6b4 --- /dev/null +++ b/demo/src/pages/index.astro @@ -0,0 +1,36 @@ +--- +import Form, { FormGroup } from '../../../'; +const form = new FormGroup([ + { + name: 'username', + label: 'Username', + }, + { + name: 'password', + label: 'Password', + type: 'password', + }, +]); + +form.name = 'Simple Form'; + +form.controls.push({ + type: 'checkbox', + name: 'is-awesome', + label: 'is Awesome?', +}); +--- + + + + + + + + Astro + + +

Astro Reactive Form

+
+ + diff --git a/demo/tsconfig.json b/demo/tsconfig.json new file mode 100644 index 0000000..3fd7ae6 --- /dev/null +++ b/demo/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "astro/tsconfigs/strictest" +} \ No newline at end of file