diff --git a/docs2/.gitignore b/docs2/.gitignore new file mode 100644 index 00000000..016b59ea --- /dev/null +++ b/docs2/.gitignore @@ -0,0 +1,24 @@ +# build output +dist/ + +# generated types +.astro/ + +# 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 + +# jetbrains setting folder +.idea/ diff --git a/docs2/README.md b/docs2/README.md new file mode 100644 index 00000000..1db3fb39 --- /dev/null +++ b/docs2/README.md @@ -0,0 +1,54 @@ +# Astro Starter Kit: Basics + +```sh +npm create astro@latest -- --template basics +``` + +[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/astro/tree/latest/examples/basics) +[![Open with CodeSandbox](https://assets.codesandbox.io/github/button-edit-lime.svg)](https://codesandbox.io/p/sandbox/github/withastro/astro/tree/latest/examples/basics) +[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/withastro/astro?devcontainer_path=.devcontainer/basics/devcontainer.json) + +> 🧑🚀 **Seasoned astronaut?** Delete this file. Have fun! + +![just-the-basics](https://github.com/withastro/astro/assets/2244813/a0a5533c-a856-4198-8470-2d67b1d7c554) + +## 🚀 Project Structure + +Inside of your Astro project, you'll see the following folders and files: + +```text +/ +├── public/ +│ └── favicon.svg +├── src/ +│ ├── components/ +│ │ └── Card.astro +│ ├── layouts/ +│ │ └── Layout.astro +│ └── 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:4321` | +| `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/docs2/astro.config.mjs b/docs2/astro.config.mjs new file mode 100644 index 00000000..7ecb96df --- /dev/null +++ b/docs2/astro.config.mjs @@ -0,0 +1,8 @@ +import { defineConfig } from 'astro/config'; + +import tailwind from '@astrojs/tailwind'; + +// https://astro.build/config +export default defineConfig({ + integrations: [tailwind()] +}); \ No newline at end of file diff --git a/docs2/package.json b/docs2/package.json new file mode 100644 index 00000000..6d762420 --- /dev/null +++ b/docs2/package.json @@ -0,0 +1,17 @@ +{ + "name": "", + "type": "module", + "version": "0.0.1", + "scripts": { + "dev": "astro dev", + "start": "astro dev", + "build": "astro build", + "preview": "astro preview", + "astro": "astro" + }, + "dependencies": { + "@astrojs/tailwind": "^5.1.2", + "astro": "^4.16.12", + "tailwindcss": "^3.4.14" + } +} diff --git a/docs2/src/components/CodeBlock.astro b/docs2/src/components/CodeBlock.astro new file mode 100644 index 00000000..db536435 --- /dev/null +++ b/docs2/src/components/CodeBlock.astro @@ -0,0 +1,17 @@ +--- +import Code from '../icons/Code.astro'; +--- +
+ {Astro.props.title}
+ + {Astro.props.code} ++
{Astro.props.subtitle}
} +{Astro.props.description}
+
,
+ title: "TYPE_SAFE.sys",
+ description: "Bulletproof typing that would make even a robot proud"
+ },
+ {
+ icon:
+ With Finite State Machines the term state
might
+ not mean what you think. In the frontend we tend to think of state to mean all of
+ the variables that control the UI. When we say state
in
+ Finite State Machines, we mean a higher-level sort of state.
+
+ For example, on the GitHub issue page, the issue titles can be edited by the issue creator + and repo maintainers. Initially a title is displayed like this: +
+ + + ++ The edit button (in red) changes the view so that the title is in an input for editing, + and the buttons change as well: +
+ + + ++ This state machine captures all the possible states our title component can be in: + viewing, editing, and saving. Each state has clear transitions to other states based + on user actions or API responses. +
+ ++ The resulting code is cleaner and more predictable. The state machine ensures we can't + end up in impossible states, like showing both the input and the title at once. +
++ Robot provides built-in support for state charts, allowing you to visualize and understand + complex state machines. State charts extend finite state machines with features like: +
+ +