nodefony 10.0.0 → 10.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.ai/symbols.json +91 -30
- package/CHANGELOG.md +25 -0
- package/assets/login.css +26 -1
- package/dist/bin/nodefony.js +1 -1
- package/dist/client/client/debugbar/DebugBar.js +2 -2
- package/dist/client/debugbar.standalone.js +2 -2
- package/dist/login/login.css +26 -1
- package/dist/node/cli/create.js +30 -10
- package/dist/node/cli/installCommand.js +13 -1
- package/dist/node/cli/scaffold/engine.js +134 -26
- package/dist/node/cli/scaffold/invisibleChars.js +52 -0
- package/dist/node/cli/scaffold/versions.js +7 -7
- package/dist/node/cli/startPanel.js +70 -0
- package/dist/node/index.js +1 -1
- package/dist/node/kernel/checks/packageDeps.js +11 -1
- package/dist/node/package.json.js +1 -1
- package/dist/types/cli/installCommand.d.ts +10 -0
- package/dist/types/cli/scaffold/engine.d.ts +47 -9
- package/dist/types/cli/scaffold/invisibleChars.d.ts +10 -0
- package/dist/types/cli/startPanel.d.ts +75 -0
- package/man/nodefony.1 +1 -1
- package/package.json +6 -6
- package/templates/app/base/README.md.tpl +1 -1
- package/templates/app/base/env.ts.tpl +7 -4
- package/templates/app/base/nodefony.config.ts.tpl +12 -3
- package/templates/app/complete/env.example.tpl +4 -4
- package/templates/app/frontend/angular/frontend/src/accent.css.tpl +7 -39
- package/templates/app/frontend/angular/frontend/src/app/app.component.ts.tpl +276 -25
- package/templates/app/frontend/react/frontend/src/App.tsx.tpl +313 -44
- package/templates/app/frontend/react/frontend/src/accent.css.tpl +7 -35
- package/templates/app/frontend/shared/frontend/src/brand.ts.tpl +12 -9
- package/templates/app/frontend/shared/frontend/src/devHome.ts.tpl +45 -0
- package/templates/app/frontend/shared/frontend/src/homeContent.ts.tpl +229 -0
- package/templates/app/frontend/shared/frontend/src/homeEffects.ts.tpl +115 -0
- package/templates/app/frontend/shared/frontend/src/showcase.css.tpl +729 -205
- package/templates/app/frontend/shared/nodefony/controllers/AppController.ts.tpl +17 -7
- package/templates/app/frontend/svelte/frontend/src/App.svelte.tpl +248 -29
- package/templates/app/frontend/svelte/frontend/src/accent.css.tpl +7 -39
- package/templates/app/frontend/vue/frontend/src/App.vue.tpl +255 -28
- package/templates/app/frontend/vue/frontend/src/accent.css.tpl +7 -39
- package/templates/app/home/nodefony/controllers/HomeController.ts.tpl +40 -25
- package/templates/app/home/nodefony/home/homePage.ts.tpl +163 -0
- package/templates/controller/duplex/nodefony/controllers/__NAME__.ts.tpl +1 -1
- package/templates/controller/realtime/nodefony/controllers/__NAME__.ts.tpl +1 -1
- package/templates/controller/rest/nodefony/controllers/__NAME__.ts.tpl +1 -1
- package/templates/demo/front/frontend/src/App.tsx.tpl +57 -84
- package/templates/demo/front/frontend/src/demo.css.tpl +12 -134
- package/templates/demo/front/frontend/src/effects.ts.tpl +5 -36
- package/templates/entity/controller/nodefony/controllers/__PASCAL__Controller.ts.tpl +1 -1
- package/templates/demo/front/frontend/src/debugBar.ts.tpl +0 -56
- package/templates/demo/front/frontend/src/kit/theme.ts.tpl +0 -51
|
@@ -1,27 +1,204 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Page d'accueil de <%= it.appName %> —
|
|
2
|
+
* Page d'accueil de <%= it.appName %> — c'est TA page.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* d'administration.
|
|
4
|
+
* Ce que voit tout visiteur : la marque, le thème<% if (it.complete) { %>, la session<% } %>, puis le nom de
|
|
5
|
+
* l'application. Rien de plus en production : ni mot de passe, ni version, ni
|
|
6
|
+
* lien vers la console d'administration.
|
|
8
7
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
8
|
+
* En DÉVELOPPEMENT seulement : la présentation du framework, les liens utiles
|
|
9
|
+
* et où personnaliser la page. Ce contenu vit dans `devHome.ts`, qui vaut
|
|
10
|
+
* `null` dans le build de production — c'est là qu'est la garde, pas ici.
|
|
12
11
|
*/
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
import { useEffect, useState } from "react";
|
|
13
|
+
<% if (it.complete) { %>// La liaison React de la connexion : l'état de session en hook, la page de
|
|
15
14
|
// connexion servie par le framework (jamais un formulaire recopié ici).
|
|
16
15
|
import { useNodefonyLogin } from "nodefony/react";
|
|
17
16
|
import { loginPagePath } from "nodefony/client";
|
|
18
17
|
<% } %>import { NODEFONY_LOGO } from "./brand";
|
|
18
|
+
import {
|
|
19
|
+
DEV_HOME,
|
|
20
|
+
type IHomeCard,
|
|
21
|
+
type IHomeSection,
|
|
22
|
+
type IHomeText,
|
|
23
|
+
} from "./devHome";
|
|
24
|
+
import {
|
|
25
|
+
applyDarkTheme,
|
|
26
|
+
findDebugBar,
|
|
27
|
+
findDemo,
|
|
28
|
+
readDarkTheme,
|
|
29
|
+
startPointerLight,
|
|
30
|
+
type IDebugBarHandle,
|
|
31
|
+
} from "./homeEffects";
|
|
19
32
|
import "./showcase.css";
|
|
20
33
|
import "./accent.css";
|
|
21
34
|
|
|
22
|
-
|
|
35
|
+
const MOON = (
|
|
36
|
+
<svg
|
|
37
|
+
viewBox="0 0 24 24"
|
|
38
|
+
fill="none"
|
|
39
|
+
stroke="currentColor"
|
|
40
|
+
strokeWidth="2"
|
|
41
|
+
aria-hidden="true"
|
|
42
|
+
>
|
|
43
|
+
<path d="M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z" />
|
|
44
|
+
</svg>
|
|
45
|
+
);
|
|
46
|
+
const SUN = (
|
|
47
|
+
<svg
|
|
48
|
+
viewBox="0 0 24 24"
|
|
49
|
+
fill="none"
|
|
50
|
+
stroke="currentColor"
|
|
51
|
+
strokeWidth="2"
|
|
52
|
+
aria-hidden="true"
|
|
53
|
+
>
|
|
54
|
+
<circle cx="12" cy="12" r="4" />
|
|
55
|
+
<path d="M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4" />
|
|
56
|
+
</svg>
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
/** Thème clair/sombre : suit le système, un clic l'impose, retenu par ce navigateur. */
|
|
60
|
+
function useDarkTheme(): [boolean, () => void] {
|
|
61
|
+
const [dark, setDark] = useState(readDarkTheme);
|
|
62
|
+
useEffect(() => {
|
|
63
|
+
applyDarkTheme(dark, false);
|
|
64
|
+
}, [dark]);
|
|
65
|
+
const toggle = (): void => {
|
|
66
|
+
applyDarkTheme(!dark);
|
|
67
|
+
setDark(!dark);
|
|
68
|
+
};
|
|
69
|
+
return [dark, toggle];
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* UN bouton pour la barre de debug : la cacher ou la montrer. La réduire en
|
|
74
|
+
* pastille est le geste de la barre elle-même.
|
|
75
|
+
*/
|
|
76
|
+
function DebugBarButton() {
|
|
77
|
+
const [bar, setBar] = useState<IDebugBarHandle | null>(null);
|
|
78
|
+
const [visible, setVisible] = useState(true);
|
|
79
|
+
useEffect(() => {
|
|
80
|
+
// La barre est injectée à côté de la page : sa poignée arrive après le rendu.
|
|
81
|
+
const frame = requestAnimationFrame(() => {
|
|
82
|
+
const found = findDebugBar();
|
|
83
|
+
setBar(found);
|
|
84
|
+
if (found !== null) setVisible(found.isVisible());
|
|
85
|
+
});
|
|
86
|
+
return () => cancelAnimationFrame(frame);
|
|
87
|
+
}, []);
|
|
88
|
+
if (bar === null) return null;
|
|
89
|
+
return (
|
|
90
|
+
<button
|
|
91
|
+
type="button"
|
|
92
|
+
className="nf-tool"
|
|
93
|
+
aria-pressed={!visible}
|
|
94
|
+
aria-label="Cacher la barre de debug"
|
|
95
|
+
title="Cacher la barre de debug"
|
|
96
|
+
onClick={() => {
|
|
97
|
+
bar.setVisible(!visible);
|
|
98
|
+
setVisible(!visible);
|
|
99
|
+
}}
|
|
100
|
+
>
|
|
101
|
+
<svg
|
|
102
|
+
viewBox="0 0 24 24"
|
|
103
|
+
fill="none"
|
|
104
|
+
stroke="currentColor"
|
|
105
|
+
strokeWidth="2"
|
|
106
|
+
strokeLinecap="round"
|
|
107
|
+
aria-hidden="true"
|
|
108
|
+
>
|
|
109
|
+
<path d="M8 2l1.9 1.9M16 2l-1.9 1.9" />
|
|
110
|
+
<rect x="7" y="6" width="10" height="14" rx="5" />
|
|
111
|
+
<path d="M12 10v10M3 13h4M17 13h4M4 7l3 2M20 7l-3 2M4 19l3-2M20 19l-3-2" />
|
|
112
|
+
</svg>
|
|
113
|
+
</button>
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/** Un texte de l'accueil : ses fragments de code rendus dans `<code>`. */
|
|
118
|
+
function Rich({ text }: { text: readonly IHomeText[] }) {
|
|
119
|
+
return (
|
|
120
|
+
<>
|
|
121
|
+
{text.map((part, i) =>
|
|
122
|
+
part.code ? <code key={i}>{part.text}</code> : part.text,
|
|
123
|
+
)}
|
|
124
|
+
</>
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/** Une carte de l'accueil, lien ou non. */
|
|
129
|
+
function Card({ card }: { card: IHomeCard }) {
|
|
130
|
+
const className = card.tone === "safe" ? "nf-card nf-safe" : "nf-card";
|
|
131
|
+
const body = (
|
|
132
|
+
<>
|
|
133
|
+
<h3>{card.title}</h3>
|
|
134
|
+
{card.creds !== null && (
|
|
135
|
+
<p className="nf-creds">
|
|
136
|
+
<code>{card.creds.user}</code>
|
|
137
|
+
{card.creds.password !== null && (
|
|
138
|
+
<>
|
|
139
|
+
{" / "}
|
|
140
|
+
<code>{card.creds.password}</code>
|
|
141
|
+
</>
|
|
142
|
+
)}
|
|
143
|
+
</p>
|
|
144
|
+
)}
|
|
145
|
+
<p>
|
|
146
|
+
<Rich text={card.text} />
|
|
147
|
+
</p>
|
|
148
|
+
{card.go !== null && <span className="nf-go">{card.go}</span>}
|
|
149
|
+
{card.skins !== null && (
|
|
150
|
+
<form className="nf-skins" action={card.skins.action} method="get">
|
|
151
|
+
<select
|
|
152
|
+
name="skin"
|
|
153
|
+
defaultValue={card.skins.selected}
|
|
154
|
+
aria-label="Habillage de la page de connexion"
|
|
155
|
+
>
|
|
156
|
+
{card.skins.options.map((skin) => (
|
|
157
|
+
<option key={skin} value={skin}>
|
|
158
|
+
{skin}
|
|
159
|
+
</option>
|
|
160
|
+
))}
|
|
161
|
+
</select>
|
|
162
|
+
<button type="submit">Voir</button>
|
|
163
|
+
</form>
|
|
164
|
+
)}
|
|
165
|
+
</>
|
|
166
|
+
);
|
|
167
|
+
return card.href !== null ? (
|
|
168
|
+
<a className={className} href={card.href}>
|
|
169
|
+
{body}
|
|
170
|
+
</a>
|
|
171
|
+
) : (
|
|
172
|
+
<div className={className}>{body}</div>
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/** Une section de l'accueil : son titre, son accroche, ses cartes. */
|
|
177
|
+
function Section({ section }: { section: IHomeSection }) {
|
|
178
|
+
const titleId = `${section.id}-title`;
|
|
179
|
+
return (
|
|
180
|
+
<section
|
|
181
|
+
className={section.band ? "nf-section nf-band" : "nf-section"}
|
|
182
|
+
aria-labelledby={titleId}
|
|
183
|
+
>
|
|
184
|
+
<div className="nf-sec-head">
|
|
185
|
+
<p className="nf-kicker">{section.kicker}</p>
|
|
186
|
+
<h2 id={titleId}>{section.title}</h2>
|
|
187
|
+
<p>{section.intro}</p>
|
|
188
|
+
</div>
|
|
189
|
+
<div className="nf-grid">
|
|
190
|
+
{section.cards.map((card) => (
|
|
191
|
+
<Card key={card.title} card={card} />
|
|
192
|
+
))}
|
|
193
|
+
</div>
|
|
194
|
+
{section.note !== null && <p className="nf-note">{section.note}</p>}
|
|
195
|
+
</section>
|
|
196
|
+
);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/** Accueil : la marque<% if (it.complete) { %> et la session<% } %> ; en développement, de quoi démarrer. */
|
|
23
200
|
export function App() {
|
|
24
|
-
<% if (it.
|
|
201
|
+
<% if (it.complete) { %> const { state: login, flow } = useNodefonyLogin();
|
|
25
202
|
// Reprend la session existante au montage (cookie de session, s'il y en a un).
|
|
26
203
|
useEffect(() => {
|
|
27
204
|
void flow.me();
|
|
@@ -31,41 +208,133 @@ export function App() {
|
|
|
31
208
|
const providerLogout = await flow.logout();
|
|
32
209
|
if (providerLogout !== null) window.location.assign(providerLogout);
|
|
33
210
|
};
|
|
34
|
-
<% } %>
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
211
|
+
<% } %> const [dark, toggleTheme] = useDarkTheme();
|
|
212
|
+
// La démo est-elle chargée ? Le serveur le dit dans la page (développement).
|
|
213
|
+
const demo = DEV_HOME === null ? null : findDemo();
|
|
214
|
+
useEffect(() => startPointerLight(".nf-card"), []);
|
|
215
|
+
const dev = DEV_HOME;
|
|
216
|
+
return (
|
|
217
|
+
<>
|
|
218
|
+
<header className="nf-topbar">
|
|
219
|
+
<a className="nf-brand" href="/">
|
|
220
|
+
<img src={NODEFONY_LOGO} alt="" width={30} height={30} />
|
|
221
|
+
<span><%= it.appName %></span>
|
|
222
|
+
{dev !== null && <span className="nf-tag">développement</span>}
|
|
223
|
+
</a>
|
|
224
|
+
{dev !== null && (
|
|
225
|
+
<nav className="nf-topnav" aria-label="Liens de développement">
|
|
226
|
+
{dev.console !== null && (
|
|
227
|
+
<>
|
|
228
|
+
<a href={dev.console.href}>{dev.console.label}</a>
|
|
229
|
+
<span className="nf-topnav-sep" aria-hidden="true" />
|
|
230
|
+
</>
|
|
231
|
+
)}
|
|
232
|
+
{dev.external.map((link) => (
|
|
233
|
+
<a key={link.href} className="nf-ext" href={link.href}>
|
|
234
|
+
{link.label}
|
|
235
|
+
</a>
|
|
236
|
+
))}
|
|
237
|
+
</nav>
|
|
238
|
+
)}
|
|
239
|
+
<div className="nf-topbar-tools">
|
|
240
|
+
<div className="nf-tools" role="group" aria-label="Affichage">
|
|
51
241
|
<button
|
|
52
242
|
type="button"
|
|
53
|
-
className="nf-
|
|
54
|
-
onClick={
|
|
243
|
+
className="nf-tool"
|
|
244
|
+
onClick={toggleTheme}
|
|
245
|
+
aria-pressed={dark}
|
|
246
|
+
aria-label="Thème sombre"
|
|
247
|
+
title="Thème sombre"
|
|
55
248
|
>
|
|
56
|
-
|
|
249
|
+
{dark ? SUN : MOON}
|
|
57
250
|
</button>
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
className="nf-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
251
|
+
{dev !== null && <DebugBarButton />}
|
|
252
|
+
</div>
|
|
253
|
+
<% if (it.complete) { %> {login.step === "authenticated" && login.user ? (
|
|
254
|
+
<span className="nf-account">
|
|
255
|
+
<span className="nf-session">{login.user.identifier}</span>
|
|
256
|
+
<button
|
|
257
|
+
type="button"
|
|
258
|
+
className="nf-account-out"
|
|
259
|
+
onClick={() => void logout()}
|
|
260
|
+
>
|
|
261
|
+
Se déconnecter
|
|
262
|
+
</button>
|
|
263
|
+
</span>
|
|
264
|
+
) : (
|
|
265
|
+
<a
|
|
266
|
+
className="nf-login"
|
|
267
|
+
href={loginPagePath(location.pathname + location.search)}
|
|
268
|
+
>
|
|
269
|
+
Se connecter
|
|
270
|
+
</a>
|
|
271
|
+
)}
|
|
272
|
+
<% } %> </div>
|
|
273
|
+
</header>
|
|
274
|
+
|
|
275
|
+
<main className="nf-main">
|
|
276
|
+
<div className="nf-hero">
|
|
277
|
+
<img
|
|
278
|
+
className="nf-hero-logo"
|
|
279
|
+
src={NODEFONY_LOGO}
|
|
280
|
+
alt=""
|
|
281
|
+
width={80}
|
|
282
|
+
height={80}
|
|
283
|
+
/>
|
|
284
|
+
{dev !== null ? (
|
|
285
|
+
<>
|
|
286
|
+
<h1>{dev.hero.title}</h1>
|
|
287
|
+
<p className="nf-sub">{dev.hero.sub}</p>
|
|
288
|
+
<p className="nf-sig">{dev.hero.sig}</p>
|
|
289
|
+
<div className="nf-badges">
|
|
290
|
+
<span className="nf-badge nf-agentic">{dev.hero.lead}</span>
|
|
291
|
+
<span className="nf-badge nf-front">
|
|
292
|
+
<svg
|
|
293
|
+
viewBox="0 0 24 24"
|
|
294
|
+
fill="currentColor"
|
|
295
|
+
aria-hidden="true"
|
|
296
|
+
>
|
|
297
|
+
<path d={dev.front.logo} />
|
|
298
|
+
</svg>
|
|
299
|
+
{dev.front.name} {dev.front.version}
|
|
300
|
+
</span>
|
|
301
|
+
{dev.hero.badges.map((badge) => (
|
|
302
|
+
<span key={badge} className="nf-badge">
|
|
303
|
+
{badge}
|
|
304
|
+
</span>
|
|
305
|
+
))}
|
|
306
|
+
</div>
|
|
307
|
+
<div
|
|
308
|
+
className="nf-install"
|
|
309
|
+
role="img"
|
|
310
|
+
aria-label={`Commande d'installation : ${dev.hero.install.command} ${dev.hero.install.arg}`}
|
|
311
|
+
>
|
|
312
|
+
<span className="nf-p">$</span>
|
|
313
|
+
<span>
|
|
314
|
+
{dev.hero.install.command} <b>{dev.hero.install.arg}</b>
|
|
315
|
+
</span>
|
|
316
|
+
</div>
|
|
317
|
+
{demo !== null ? (
|
|
318
|
+
<div className="nf-cta">
|
|
319
|
+
<a className="nf-btn nf-primary" href={demo}>
|
|
320
|
+
{dev.demoLabel}
|
|
321
|
+
</a>
|
|
322
|
+
</div>
|
|
323
|
+
) : (
|
|
324
|
+
<p className="nf-learn">
|
|
325
|
+
{dev.learn.label} : <code>{dev.learn.command}</code> —{" "}
|
|
326
|
+
{dev.learn.note}
|
|
327
|
+
</p>
|
|
328
|
+
)}
|
|
329
|
+
</>
|
|
330
|
+
) : (
|
|
331
|
+
<h1><%= it.appName %></h1>
|
|
332
|
+
)}
|
|
333
|
+
</div>
|
|
334
|
+
{dev?.sections.map((section) => (
|
|
335
|
+
<Section key={section.id} section={section} />
|
|
336
|
+
))}
|
|
337
|
+
</main>
|
|
338
|
+
</>
|
|
70
339
|
);
|
|
71
340
|
}
|
|
@@ -1,41 +1,13 @@
|
|
|
1
1
|
/*
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* `showcase.css`, PARTAGÉE par les trois vitrines : seules ces variables
|
|
6
|
-
* changent d'un framework à l'autre.
|
|
2
|
+
* La couleur du front de cette page — la SEULE chose qui change d'un front à
|
|
3
|
+
* l'autre. La mise en page, la palette et le mouvement vivent dans
|
|
4
|
+
* `showcase.css`, partagée, qui lit `--nf-front` pour le badge du front.
|
|
7
5
|
*
|
|
8
6
|
* Pourquoi un fichier CSS et non le bloc de styles du composant : Angular
|
|
9
|
-
* renomme
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* Vite injecte globalement.
|
|
7
|
+
* renomme ce qu'il déclare dans `styles: [...]` (encapsulation de vue). Les
|
|
8
|
+
* quatre fronts utilisent donc le même mécanisme, un import CSS que Vite
|
|
9
|
+
* injecte globalement.
|
|
13
10
|
*/
|
|
14
|
-
|
|
15
11
|
:root {
|
|
16
|
-
--nf-
|
|
17
|
-
/* Encre : la MÊME teinte, assez foncée pour être lue SUR le lavis.
|
|
18
|
-
La couleur de marque ne se négocie pas ; sa luminosité, si — écrire
|
|
19
|
-
`--nf-accent` sur `--nf-accent-wash` donnait 2,78:1, sous le seuil AA. */
|
|
20
|
-
--nf-accent-ink: #0b6a8a;
|
|
21
|
-
--nf-accent-glow: rgba(97, 218, 251, 0.35);
|
|
22
|
-
--nf-accent-wash: rgba(97, 218, 251, 0.14);
|
|
23
|
-
--nf-accent-line: rgba(97, 218, 251, 0.35);
|
|
24
|
-
--nf-logo-anim: nf-spin 16s linear infinite;
|
|
25
|
-
}
|
|
26
|
-
/* 🔴 L'encre du THÈME SOMBRE. La correction d'origine n'avait couvert qu'un
|
|
27
|
-
seul des deux thèmes : sur fond sombre, le lavis devient foncé et cette
|
|
28
|
-
encre-là, choisie pour être lue sur du clair, tombait à 2,21:1 — bien
|
|
29
|
-
plus bas que le 2,78:1 qui avait motivé sa création. Mesuré par `axe-core`
|
|
30
|
-
sur une application générée, pas déduit du CSS.
|
|
31
|
-
Sur un fond sombre il faut une encre CLAIRE : #29a7cf → 4,84:1. */
|
|
32
|
-
@media (prefers-color-scheme: dark) {
|
|
33
|
-
:root {
|
|
34
|
-
--nf-accent-ink: #29a7cf;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
@keyframes nf-spin {
|
|
38
|
-
to {
|
|
39
|
-
transform: rotate(360deg);
|
|
40
|
-
}
|
|
12
|
+
--nf-front: <%= it.front.badge.color %>;
|
|
41
13
|
}
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Logo de la
|
|
3
|
-
* logo officiel.
|
|
4
|
-
*
|
|
5
|
-
*
|
|
2
|
+
* Logo de la page — IMPORTÉ depuis le paquet `nodefony`, source unique du
|
|
3
|
+
* logo officiel. C'est l'idiome à suivre pour toute image du front
|
|
4
|
+
* (`import x from "./x.png"`, ou `url(./x.png)` en CSS) : Vite la sert en
|
|
5
|
+
* développement, puis au build de production l'inscrit dans le bundle si elle
|
|
6
|
+
* pèse moins de 4 Ko, ou l'émet en fichier à empreinte sinon.
|
|
6
7
|
*
|
|
7
|
-
* Le
|
|
8
|
-
*
|
|
9
|
-
* d'
|
|
8
|
+
* Le SVG, et non le PNG (`nodefony/assets/nodefony-logo.png`) : le logo du
|
|
9
|
+
* hero est l'élément le plus grand de la page (LCP). Vectoriel, il reste net
|
|
10
|
+
* à toute densité d'écran ; sous 1 Ko, il part dans le bundle et ne coûte
|
|
11
|
+
* aucune requête — en PNG, le navigateur ne le découvrait qu'après le
|
|
12
|
+
* JavaScript, et le chargement mobile perdait des points à Lighthouse.
|
|
10
13
|
*
|
|
11
|
-
* Pour poser ta marque : place ton image à côté (`./logo.
|
|
14
|
+
* Pour poser ta marque : place ton image à côté (`./logo.svg`) et importe-la
|
|
12
15
|
* ici à la place.
|
|
13
16
|
*/
|
|
14
|
-
import logoUrl from "nodefony/assets/nodefony-logo.
|
|
17
|
+
import logoUrl from "nodefony/assets/nodefony-logo.svg";
|
|
15
18
|
|
|
16
19
|
export const NODEFONY_LOGO: string = logoUrl;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ce que l'accueil montre en DÉVELOPPEMENT seulement — et la garde qui l'empêche
|
|
3
|
+
* de partir en production.
|
|
4
|
+
*
|
|
5
|
+
* 🔴 La garde est ICI, sur les données, et pas dans la page : `DEV_HOME` vaut
|
|
6
|
+
* `null` dès que Vite construit pour la production (`import.meta.env.DEV` est
|
|
7
|
+
* remplacé par `false`) ; `homeContent()` n'est alors jamais appelée, et le
|
|
8
|
+
* minifieur la retire avec tout ce qu'elle porte — textes, liens et mot de
|
|
9
|
+
* passe compris. Une garde posée dans le gabarit de la page ne suffirait pas :
|
|
10
|
+
* Vue et Angular compilent les textes de leurs gabarits dans le bundle,
|
|
11
|
+
* qu'ils soient affichés ou non.
|
|
12
|
+
*
|
|
13
|
+
* Les textes eux-mêmes vivent dans `homeContent.ts`.
|
|
14
|
+
*/
|
|
15
|
+
<%= it.front.badge.versionImport %>
|
|
16
|
+
import { homeContent, type IHomeContent } from "./homeContent";
|
|
17
|
+
|
|
18
|
+
export type {
|
|
19
|
+
IHomeCard,
|
|
20
|
+
IHomeContent,
|
|
21
|
+
IHomeSection,
|
|
22
|
+
IHomeText,
|
|
23
|
+
} from "./homeContent";
|
|
24
|
+
|
|
25
|
+
/** Le contenu de développement, et le front de cette page. */
|
|
26
|
+
export interface IDevHome extends IHomeContent {
|
|
27
|
+
/** Le front de cette page : nom, version lue à l'exécution, logo. */
|
|
28
|
+
readonly front: {
|
|
29
|
+
readonly name: string;
|
|
30
|
+
readonly version: string;
|
|
31
|
+
readonly logo: string;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** Contenu de développement de l'accueil — `null` en production. */
|
|
36
|
+
export const DEV_HOME: IDevHome | null = import.meta.env.DEV
|
|
37
|
+
? {
|
|
38
|
+
...homeContent(),
|
|
39
|
+
front: {
|
|
40
|
+
name: "<%= it.front.badge.name %>",
|
|
41
|
+
version: <%= it.front.badge.versionExpr %>,
|
|
42
|
+
logo: "<%= it.front.badge.logo %>",
|
|
43
|
+
},
|
|
44
|
+
}
|
|
45
|
+
: null;
|