sources/, config.yml and build.sh relocated under exemple/navigation/. Root now only contains template/ and exemple/. README updated to reflect the new structure. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
69 lines
2.1 KiB
Markdown
69 lines
2.1 KiB
Markdown
# Syn
|
|
|
|
Framework web minimaliste basé sur JavaScript vanilla et les Web Components.
|
|
Routage hash-based, composants déclarés dans `config.yml`, build via `build.sh`.
|
|
|
|
## Contenu du repo
|
|
|
|
```
|
|
├── template/ # Point de départ pour un nouveau projet
|
|
└── exemple/
|
|
└── navigation/ # Exemple complet avec side-nav et page dashboard
|
|
```
|
|
|
|
## Démarrer un projet
|
|
|
|
```bash
|
|
cp -r template/ mon-projet/
|
|
cd mon-projet/
|
|
./build.sh
|
|
python3 -m http.server 8000 --directory sources/
|
|
```
|
|
|
|
## 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
|
|
├── config.yml # Source de vérité
|
|
└── build.sh # Télécharge les remotes + génère les JSON
|
|
```
|
|
|
|
## 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 `config.yml`
|
|
3. Ajouter la route à `menu:` si visible dans la nav
|
|
4. `./build.sh`
|
|
|
|
## Ajouter un composant
|
|
|
|
1. Déclarer sous `components:` dans `config.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.
|