rename components.yml → config.yml
The manifest covers components, pages, vendors and menu — config.yml is a more accurate name. Updated build.sh (both project and template), router.js comment, and README. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
parent
6796e102e0
commit
f49eae6c31
6 changed files with 11 additions and 11 deletions
|
|
@ -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/
|
||||
│ └── <nom>/ # 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. `<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`
|
||||
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
|
||||
|
|
|
|||
6
build.sh
6
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/<name>/
|
||||
# Reads config.yml, downloads each remote component into components/<name>/
|
||||
# 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"
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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/<name>/
|
||||
# Reads config.yml, downloads each remote component into components/<name>/
|
||||
# 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"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue