diff --git a/README.md b/README.md index a38eff7..1fb1113 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Syn 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`. +Routage hash-based, composants déclarés dans `config.yml`, build via `build.sh`. ## Structure d'un projet @@ -15,7 +15,7 @@ Routage hash-based, composants déclarés dans `components.yml`, build via `buil │ ├── vendor/ # Libs tierces (gitignored) │ └── pages/ │ └── / # Une page = un dossier -├── components.yml # Source de vérité +├── config.yml # Source de vérité └── build.sh # Télécharge les remotes + génère les JSON ``` @@ -35,13 +35,13 @@ python3 -m http.server 8000 --directory sources/ - `index.html` — fragment HTML (ex. ``) - `.js` — `customElements.define` + `export function init(main) {}` - `.css` — styles scopés à la page (optionnel) -2. Déclarer sous `local_pages:` dans `components.yml` +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 `components.yml` : +1. Déclarer sous `components:` dans `config.yml` : ```yaml components: - name: mon-composant diff --git a/build.sh b/build.sh index aa754dc..a25ce23 100755 --- a/build.sh +++ b/build.sh @@ -1,10 +1,10 @@ #!/usr/bin/env bash -# Build the web UI component set from components.yml. +# Build the web UI component set from config.yml. # # ./build.sh build (download remote components + generate components.json) # ./build.sh --check validate manifest and entry files without downloading # -# Reads components.yml, downloads each remote component into components// +# Reads config.yml, downloads each remote component into components// # at the requested ref, then generates components.json (runtime load list) and # components.lock.json (resolved commit pins). # @@ -16,7 +16,7 @@ set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" WEB_DIR="${SCRIPT_DIR}/sources" -MANIFEST="${SCRIPT_DIR}/components.yml" +MANIFEST="${SCRIPT_DIR}/config.yml" COMPONENTS_DIR="${WEB_DIR}/components" OUTPUT="${WEB_DIR}/components.json" LOCKFILE="${WEB_DIR}/components.lock.json" diff --git a/components.yml b/config.yml similarity index 100% rename from components.yml rename to config.yml diff --git a/sources/core/router.js b/sources/core/router.js index d23777c..7f9920f 100644 --- a/sources/core/router.js +++ b/sources/core/router.js @@ -1,5 +1,5 @@ // Hash-based SPA router. -// Reads pages.json (generated by build.sh from components.yml). +// Reads pages.json (generated by build.sh from config.yml). // Each page is an HTML fragment (index.html) + optional CSS + optional JS module. // // Load order enforced by index.html: diff --git a/template/build.sh b/template/build.sh index aa754dc..a25ce23 100755 --- a/template/build.sh +++ b/template/build.sh @@ -1,10 +1,10 @@ #!/usr/bin/env bash -# Build the web UI component set from components.yml. +# Build the web UI component set from config.yml. # # ./build.sh build (download remote components + generate components.json) # ./build.sh --check validate manifest and entry files without downloading # -# Reads components.yml, downloads each remote component into components// +# Reads config.yml, downloads each remote component into components// # at the requested ref, then generates components.json (runtime load list) and # components.lock.json (resolved commit pins). # @@ -16,7 +16,7 @@ set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" WEB_DIR="${SCRIPT_DIR}/sources" -MANIFEST="${SCRIPT_DIR}/components.yml" +MANIFEST="${SCRIPT_DIR}/config.yml" COMPONENTS_DIR="${WEB_DIR}/components" OUTPUT="${WEB_DIR}/components.json" LOCKFILE="${WEB_DIR}/components.lock.json" diff --git a/template/components.yml b/template/config.yml similarity index 100% rename from template/components.yml rename to template/config.yml