From 26d88024263f85591b26ed20798884213f44bd03 Mon Sep 17 00:00:00 2001 From: Christian Risi <75698846+CnF-Gris@users.noreply.github.com> Date: Fri, 6 Dec 2024 14:44:56 +0000 Subject: [PATCH] Initial Working Commit --- README.md | 80 ++++++++++++++++++++++++++---- src/CustomCode/Components/.gitkeep | 0 src/CustomCode/Utils/.gitkeep | 0 3 files changed, 70 insertions(+), 10 deletions(-) create mode 100644 src/CustomCode/Components/.gitkeep create mode 100644 src/CustomCode/Utils/.gitkeep diff --git a/README.md b/README.md index b5b2950..b065ed7 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,82 @@ -# sv +# How to develop in Svelte using SvelteKit -Everything you need to build a Svelte project, powered by [`sv`](https://github.com/sveltejs/cli). +## New and Old Concepts -## Creating a project +### CustomCode Folder +Here we will place all of our code, to keep clean the environment -If you're seeing this, you've probably already done this step. Congrats! +#### Components +This is the folder where we'll make our components. + +Each file will have its component, so don't make more than 1 +component in the same file + + +Beware of not +make them all in the same folder, but to create subfolder to keep +code that logically is similar in the same folder: ```bash -# create a new project in the current directory -npx sv create +# This is ok +Components/ + +--Buttons/ + | +--MyButton1 + | +--MyButton2 -# create a new project in my-app -npx sv create my-app +# this is NOT +Components/ + +--MyButton1 + +--MyButton2 + +# this is NOT either (but at least better than the previous) +Components/ + +--MyButton1/ + | +--MyButton1.svelte + +--MyButton2/ + | +--MyButton2.svelte ``` -## Developing +#### Utils +Here we'll put some JS code as an Internal library. -Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server: +This folder will have pure code, so no components here. +As always, make folders according to a concept. + +Here it is **ENCOURAGED** to group code with similar meaning, +to avoid **Ravioli** code. However, if too long, consider splitting +the file is some smaller ones, to avoid **Spaghetti** code + +## Making new components +Follow guide on [Svelte Components](https://svelte.dev/tutorial/svelte/your-first-component) + +However, we basically have 3 main components following this order: +- `