xpulse.json Schema
Pflichtfelder
| Key |
Typ |
Beschreibung |
name |
string |
Eindeutiger Projektname, z.B. xpulse-chat |
Standard-Keys mit Fallbacks
| Key |
Typ |
Fallback |
type |
string |
'tool' |
theme.default |
string |
'dark' |
i18n.default |
string |
'de' |
i18n.locales |
string[] |
['de'] |
paths.pages |
string |
'pages/' |
paths.templates |
string |
'templates/' |
paths.locales |
string |
'locales/' |
paths.public |
string |
'public/' |
http.port |
string |
process.env.PORT || '3000' |
Vollständiges Beispiel
| 1 | { |
| 2 | "name": "xpulse-web", |
| 3 | "type": "tool", |
| 4 | |
| 5 | "http": { |
| 6 | "port": "${PORT}" |
| 7 | }, |
| 8 | |
| 9 | "theme": { |
| 10 | "default": "platform" |
| 11 | }, |
| 12 | |
| 13 | "i18n": { |
| 14 | "default": "de", |
| 15 | "locales": ["de", "en"] |
| 16 | }, |
| 17 | |
| 18 | "paths": { |
| 19 | "pages": "pages/", |
| 20 | "templates": "templates/", |
| 21 | "locales": "locales/", |
| 22 | "public": "public/" |
| 23 | }, |
| 24 | |
| 25 | "sources": { |
| 26 | "chat": { |
| 27 | "name": "xPulse Chat", |
| 28 | "url": "${CHAT_URL}", |
| 29 | "repo": "https://bitbucket.org/xpulse1/xpulse-chat.git", |
| 30 | "type": "tool", |
| 31 | "docs": true |
| 32 | } |
| 33 | } |
| 34 | } |
Custom Keys
Unbekannte Keys werden ignoriert und ohne Warnung durchgereicht.
Sie sind via config.get() abrufbar:
| 1 | { |
| 2 | "name": "xpulse-chat", |
| 3 | "release": { |
| 4 | "current": "1.3.0", |
| 5 | "codename": "Abomasnow" |
| 6 | } |
| 7 | } |
| 1 | config.get('release.current') |
| 2 | config.get('release.codename') |
Convention: Custom Keys sollten sprechend benannt sein um Konflikte
mit zukünftigen Standard-Keys zu vermeiden.
Minimales Beispiel (Component)
| 1 | { |
| 2 | "name": "xpulse-config", |
| 3 | "type": "component" |
| 4 | } |