No description
Find a file
GnomeZworc 6185d8ea48
move working code to exemple/navigation/
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>
2026-06-07 13:16:42 +02:00
exemple/navigation move working code to exemple/navigation/ 2026-06-07 13:16:42 +02:00
template rename components.yml → config.yml 2026-06-07 13:08:50 +02:00
.gitignore add a gitignore 2026-06-06 23:17:43 +02:00
README.md move working code to exemple/navigation/ 2026-06-07 13:16:42 +02:00

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

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>.jscustomElements.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 :
    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.