0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-23 21:53:55 -05:00
astro/examples/component
Jonathan Neal 033b70a7f8
Add Component Example (#2203)
* Add Component Example

* chore(lint): Prettier fix

* nit: improve implementation

* nit: Update documentation

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2021-12-17 08:47:59 -05:00
..
demo Add Component Example (#2203) 2021-12-17 08:47:59 -05:00
packages/my-component Add Component Example (#2203) 2021-12-17 08:47:59 -05:00
.gitignore Add Component Example (#2203) 2021-12-17 08:47:59 -05:00
.npmrc Add Component Example (#2203) 2021-12-17 08:47:59 -05:00
.stackblitzrc Add Component Example (#2203) 2021-12-17 08:47:59 -05:00
astro.config.mjs Add Component Example (#2203) 2021-12-17 08:47:59 -05:00
package.json Add Component Example (#2203) 2021-12-17 08:47:59 -05:00
README.md Add Component Example (#2203) 2021-12-17 08:47:59 -05:00
sandbox.config.json Add Component Example (#2203) 2021-12-17 08:47:59 -05:00

Astro Starter Kit: Component

npm init astro -- --template component

Open in StackBlitz

🧑‍🚀 Seasoned astronaut? Delete this file. Have fun!

🚀 Project Structure

Inside of your Astro project, you'll see the following folders and files:

/
├── demo/
│   ├── public/
│   └── src/
│       └── pages/
│           └── index.astro
└── packages/
    └── my-component/
        ├── index.js
        └── package.json

This project uses workspaces to develop a single package, @example/my-component, from packages/my-component. It also includes a demo Astro site for testing and demonstrating the component.

🧞 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

👀 Want to learn more?

Feel free to check our documentation or jump into our Discord server.