add template + document framework in root README
template/README.md: stripped to a one-liner bootstrap command. README.md: full project docs (structure, add page, add component, build.sh). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
parent
0d5c2fbd35
commit
6796e102e0
16 changed files with 663 additions and 1 deletions
60
README.md
60
README.md
|
|
@ -1,3 +1,61 @@
|
|||
# Syn
|
||||
|
||||
Ce projet est un framwork web base sur un javascript tres simple.
|
||||
Framework web minimaliste basé sur JavaScript vanilla et les Web Components.
|
||||
Routage hash-based, composants déclarés dans `components.yml`, build via `build.sh`.
|
||||
|
||||
## Structure d'un projet
|
||||
|
||||
```
|
||||
├── sources/ # Code servi — déployer ce dossier
|
||||
│ ├── index.html
|
||||
│ ├── favicon.svg
|
||||
│ ├── config.json # Config runtime (api_url, tokens…)
|
||||
│ ├── core/ # Framework core
|
||||
│ ├── components/ # Téléchargés par build.sh (gitignored)
|
||||
│ ├── vendor/ # Libs tierces (gitignored)
|
||||
│ └── pages/
|
||||
│ └── <nom>/ # Une page = un dossier
|
||||
├── components.yml # Source de vérité
|
||||
└── build.sh # Télécharge les remotes + génère les JSON
|
||||
```
|
||||
|
||||
## Démarrer un projet
|
||||
|
||||
```bash
|
||||
cp -r template/ mon-projet/
|
||||
cd mon-projet/
|
||||
./build.sh
|
||||
python3 -m http.server 8000 --directory sources/
|
||||
```
|
||||
|
||||
## Ajouter une page
|
||||
|
||||
1. Créer `sources/pages/<nom>/` avec :
|
||||
- `manifest.json` — `{ "route", "label", "icon" }`
|
||||
- `index.html` — fragment HTML (ex. `<ma-page></ma-page>`)
|
||||
- `<nom>.js` — `customElements.define` + `export function init(main) {}`
|
||||
- `<nom>.css` — styles scopés à la page (optionnel)
|
||||
2. Déclarer sous `local_pages:` dans `components.yml`
|
||||
3. Ajouter la route à `menu:` si visible dans la nav
|
||||
4. `./build.sh`
|
||||
|
||||
## Ajouter un composant
|
||||
|
||||
1. Déclarer sous `components:` dans `components.yml` :
|
||||
```yaml
|
||||
components:
|
||||
- name: mon-composant
|
||||
repo: https://git.example.com/org/mon-composant
|
||||
ref: main
|
||||
```
|
||||
2. `./build.sh` — télécharge dans `sources/components/mon-composant/`
|
||||
|
||||
## build.sh
|
||||
|
||||
```
|
||||
./build.sh # build complet
|
||||
./build.sh --check # valide le manifest sans télécharger
|
||||
```
|
||||
|
||||
Dépendances : `yq` (mikefarah v4), `jq`, `curl`.
|
||||
Variable optionnelle : `GIT_TOKEN` pour les repos privés.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue