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,15 +1,16 @@
|
|
|
1
1
|
import { existsSync, mkdirSync, readFileSync, readdirSync, writeFileSync } from "node:fs";
|
|
2
|
-
import { randomBytes } from "node:crypto";
|
|
2
|
+
import { randomBytes, randomInt } from "node:crypto";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { pointeursInstructions } from "../agentTargets.js";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
6
6
|
import { Eta } from "eta";
|
|
7
|
-
import { NODE_ENGINE_LABEL, createAppCommand } from "../installCommand.js";
|
|
7
|
+
import { NODE_ENGINE_LABEL, createAppCommand, demoAppCommand } from "../installCommand.js";
|
|
8
8
|
import { IMAGE_NODEFONY_BIN } from "../nodefonyBin.js";
|
|
9
9
|
import { findProjectRoot } from "../projectRoot.js";
|
|
10
10
|
import { hasWorkspaceRun, isPackageManagerName, needsWorkspaceProtocol, packageManagerCommandLines, packageManagerToolchain, packageManagerWorkspaceRun, resolvePackageManager } from "../packageManager.js";
|
|
11
11
|
import { resolveInfra } from "../../config/infra.js";
|
|
12
12
|
import { envFileOrder } from "../../runtime/loadEnv.js";
|
|
13
|
+
import { LOGIN_PAGE_PATH, LOGIN_PAGE_SKINS } from "../../runtime/authRoutes.js";
|
|
13
14
|
import { testDatabaseName, testDatabaseUrl } from "../../runtime/e2eDatabase.js";
|
|
14
15
|
import { isPlainObject } from "../../runtime/isPlainObject.js";
|
|
15
16
|
import { resolveModuleLayout } from "./moduleLayout.js";
|
|
@@ -24,6 +25,7 @@ import { writeBrandAssets } from "./brandAssets.js";
|
|
|
24
25
|
import { manifestFileWith, withoutComments } from "../../kernel/checks/sourceText.js";
|
|
25
26
|
import { CONTROLLER_KIND_CHOICES, FRONTEND_CHOICES, flagFor, getScaffoldSpec } from "./spec.js";
|
|
26
27
|
import { openSiblingRoutes } from "./routePaths.js";
|
|
28
|
+
import { describeInvisibleChars } from "./invisibleChars.js";
|
|
27
29
|
import { nodefonyImports } from "../../kernel/checks/packageDeps.js";
|
|
28
30
|
import { connectorVersionsMigrations } from "../../kernel/migrationsLayout.js";
|
|
29
31
|
// src/cli/scaffold/engine.ts
|
|
@@ -83,16 +85,47 @@ const DEMO_VIDEO_ASSET = path.join("assets", "demo-video.mp4");
|
|
|
83
85
|
*/
|
|
84
86
|
const DEMO_VIDEO_FILE = path.join("media", "sample.mp4");
|
|
85
87
|
/**
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
*
|
|
93
|
-
*
|
|
88
|
+
* Lettres et chiffres du mot de passe de développement, sans les caractères
|
|
89
|
+
* qu'on confond en les recopiant (`0/o`, `1/l/i`).
|
|
90
|
+
*/
|
|
91
|
+
const DEV_PASSWORD_LETTERS = "abcdefghjkmnpqrstuvwxyz";
|
|
92
|
+
const DEV_PASSWORD_DIGITS = "23456789";
|
|
93
|
+
/**
|
|
94
|
+
* Tire le mot de passe du compte `admin` qu'une application générée sème en
|
|
95
|
+
* développement — UNE fois, à `create app`, propre à chaque application.
|
|
96
|
+
*
|
|
97
|
+
* Une valeur fixe était publiée avec le framework, et un serveur démarré sans
|
|
98
|
+
* `NODE_ENV` tourne en développement (`engineEnvironment.ts#DEFAULT_ENGINE_ENVIRONMENT`) :
|
|
99
|
+
* il créait donc un compte administrateur dont tout le monde connaissait le mot
|
|
100
|
+
* de passe. Le tirage le rend propre à l'application, sans rien coûter au
|
|
101
|
+
* développeur, qui le lit sur l'accueil, dans le `.env` et dans le README.
|
|
102
|
+
*
|
|
103
|
+
* Forme `xxxx-xxxx-xxxx`, chaque groupe = trois lettres et UN chiffre à une
|
|
104
|
+
* place tirée (~52 bits) : il se TAPE au premier login, il doit donc se lire et
|
|
105
|
+
* se recopier sans ambiguïté. Le chiffre n'est pas décoratif : la politique
|
|
106
|
+
* refuse quatre touches consécutives (`abcd`, `2345`, `qsdf`), et un groupe
|
|
107
|
+
* de quatre lettres tirées au hasard en tombe une de temps en temps — l'app
|
|
108
|
+
* ne semait alors pas son compte. Aucune suite refusée ne mêle lettres et
|
|
109
|
+
* chiffres, donc aucun groupe n'en est une, sans recopier la règle ici.
|
|
110
|
+
* 14 caractères passent `minLength` (10) ; jamais « admin ».
|
|
111
|
+
*
|
|
112
|
+
* Seule source : chaque gabarit le rend par `<%= it.devAdminPassword %>`, et
|
|
113
|
+
* `create app` l'annonce depuis `IScaffoldResult.devAdminPassword`.
|
|
114
|
+
*
|
|
115
|
+
* @returns un mot de passe neuf à chaque appel
|
|
94
116
|
*/
|
|
95
|
-
|
|
117
|
+
function drawDevAdminPassword() {
|
|
118
|
+
let out = "";
|
|
119
|
+
for (let group = 0; group < 3; group++) {
|
|
120
|
+
if (group > 0) out += "-";
|
|
121
|
+
const digitAt = randomInt(4);
|
|
122
|
+
for (let i = 0; i < 4; i++) {
|
|
123
|
+
const set = i === digitAt ? DEV_PASSWORD_DIGITS : DEV_PASSWORD_LETTERS;
|
|
124
|
+
out += set[randomInt(set.length)];
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
return out;
|
|
128
|
+
}
|
|
96
129
|
/** Fichiers dont le nom rendu diffère du template (npm strip les dotfiles publiés). */
|
|
97
130
|
const RENAMES = {
|
|
98
131
|
gitignore: ".gitignore",
|
|
@@ -148,6 +181,14 @@ const FRONTEND_PARAMS = {
|
|
|
148
181
|
subpath: "nodefony/react",
|
|
149
182
|
doc: "react-hooks.md",
|
|
150
183
|
marker: "react"
|
|
184
|
+
},
|
|
185
|
+
pageFile: "frontend/src/App.tsx",
|
|
186
|
+
badge: {
|
|
187
|
+
name: "React",
|
|
188
|
+
color: "#61dafb",
|
|
189
|
+
versionImport: "import { version } from \"react\";",
|
|
190
|
+
versionExpr: "version",
|
|
191
|
+
logo: "M14.23 12.004a2.236 2.236 0 0 1-2.235 2.236 2.236 2.236 0 0 1-2.236-2.236 2.236 2.236 0 0 1 2.235-2.236 2.236 2.236 0 0 1 2.236 2.236zm2.648-10.69c-1.346 0-3.107.96-4.888 2.622-1.78-1.653-3.542-2.602-4.887-2.602-.41 0-.783.093-1.106.278-1.375.793-1.683 3.264-.973 6.365C1.98 8.917 0 10.42 0 12.004c0 1.59 1.99 3.097 5.043 4.03-.704 3.113-.39 5.588.988 6.38.32.187.69.275 1.102.275 1.345 0 3.107-.96 4.888-2.624 1.78 1.654 3.542 2.603 4.887 2.603.41 0 .783-.09 1.106-.275 1.374-.792 1.683-3.263.973-6.365C22.02 15.096 24 13.59 24 12.004c0-1.59-1.99-3.097-5.043-4.032.704-3.11.39-5.587-.988-6.38-.318-.184-.688-.277-1.092-.278zm-.005 1.09v.006c.225 0 .406.044.558.127.666.382.955 1.835.73 3.704-.054.46-.142.945-.25 1.44-.96-.236-2.006-.417-3.107-.534-.66-.905-1.345-1.727-2.035-2.447 1.592-1.48 3.087-2.292 4.105-2.295zm-9.77.02c1.012 0 2.514.808 4.11 2.28-.686.72-1.37 1.537-2.02 2.442-1.107.117-2.154.298-3.113.538-.112-.49-.195-.964-.254-1.42-.23-1.868.054-3.32.714-3.707.19-.09.4-.127.563-.132zm4.882 3.05c.455.468.91.992 1.36 1.564-.44-.02-.89-.034-1.345-.034-.46 0-.915.01-1.36.034.44-.572.895-1.096 1.345-1.565zM12 8.1c.74 0 1.477.034 2.202.093.406.582.802 1.203 1.183 1.86.372.64.71 1.29 1.018 1.946-.308.655-.646 1.31-1.013 1.95-.38.66-.773 1.288-1.18 1.87-.728.063-1.466.098-2.21.098-.74 0-1.477-.035-2.202-.093-.406-.582-.802-1.204-1.183-1.86-.372-.64-.71-1.29-1.018-1.946.303-.657.646-1.313 1.013-1.954.38-.66.773-1.286 1.18-1.868.728-.064 1.466-.098 2.21-.098zm-3.635.254c-.24.377-.48.763-.704 1.16-.225.39-.435.782-.635 1.174-.265-.656-.49-1.31-.676-1.947.64-.15 1.315-.283 2.015-.386zm7.26 0c.695.103 1.365.23 2.006.387-.18.632-.405 1.282-.66 1.933-.2-.39-.41-.783-.64-1.174-.225-.392-.465-.774-.705-1.146zm3.063.675c.484.15.944.317 1.375.498 1.732.74 2.852 1.708 2.852 2.476-.005.768-1.125 1.74-2.857 2.475-.42.18-.88.342-1.355.493-.28-.958-.646-1.956-1.1-2.98.45-1.017.81-2.01 1.085-2.964zm-13.395.004c.278.96.645 1.957 1.1 2.98-.45 1.017-.812 2.01-1.086 2.964-.484-.15-.944-.318-1.37-.5-1.732-.737-2.852-1.706-2.852-2.474 0-.768 1.12-1.742 2.852-2.476.42-.18.88-.342 1.356-.494zm11.678 4.28c.265.657.49 1.312.676 1.948-.64.157-1.316.29-2.016.39.24-.375.48-.762.705-1.158.225-.39.435-.788.636-1.18zm-9.945.02c.2.392.41.783.64 1.175.23.39.465.772.705 1.143-.695-.102-1.365-.23-2.006-.386.18-.63.406-1.282.66-1.933zM17.92 16.32c.112.493.2.968.254 1.423.23 1.868-.054 3.32-.714 3.708-.147.09-.338.128-.563.128-1.012 0-2.514-.807-4.11-2.28.686-.72 1.37-1.536 2.02-2.44 1.107-.118 2.154-.3 3.113-.54zm-11.83.01c.96.234 2.006.415 3.107.532.66.905 1.345 1.727 2.035 2.446-1.595 1.483-3.092 2.295-4.11 2.295-.22-.005-.406-.05-.553-.132-.666-.38-.955-1.834-.73-3.703.054-.46.142-.944.25-1.438zm4.56.64c.44.02.89.034 1.345.034.46 0 .915-.01 1.36-.034-.44.572-.895 1.095-1.345 1.565-.455-.47-.91-.993-1.36-1.565z"
|
|
151
192
|
}
|
|
152
193
|
},
|
|
153
194
|
vue: {
|
|
@@ -163,6 +204,14 @@ const FRONTEND_PARAMS = {
|
|
|
163
204
|
subpath: "nodefony/vue",
|
|
164
205
|
doc: "vue-composables.md",
|
|
165
206
|
marker: "vue"
|
|
207
|
+
},
|
|
208
|
+
pageFile: "frontend/src/App.vue",
|
|
209
|
+
badge: {
|
|
210
|
+
name: "Vue",
|
|
211
|
+
color: "#4fc08d",
|
|
212
|
+
versionImport: "import { version } from \"vue\";",
|
|
213
|
+
versionExpr: "version",
|
|
214
|
+
logo: "M24,1.61H14.06L12,5.16,9.94,1.61H0L12,22.39ZM12,14.08,5.16,2.23H9.59L12,6.41l2.41-4.18h4.43Z"
|
|
166
215
|
}
|
|
167
216
|
},
|
|
168
217
|
angular: {
|
|
@@ -178,6 +227,14 @@ const FRONTEND_PARAMS = {
|
|
|
178
227
|
subpath: "nodefony/angular",
|
|
179
228
|
doc: "angular-services.md",
|
|
180
229
|
marker: "@angular/core"
|
|
230
|
+
},
|
|
231
|
+
pageFile: "frontend/src/app/app.component.ts",
|
|
232
|
+
badge: {
|
|
233
|
+
name: "Angular",
|
|
234
|
+
color: "#dd0031",
|
|
235
|
+
versionImport: "import { VERSION } from \"@angular/core\";",
|
|
236
|
+
versionExpr: "VERSION.full",
|
|
237
|
+
logo: "M16.712 17.711H7.288l-1.204 2.916L12 24l5.916-3.373-1.204-2.916ZM14.692 0l7.832 16.855.814-12.856L14.692 0ZM9.308 0 .662 3.999l.814 12.856L9.308 0Zm-.405 13.93h6.198L12 6.396 8.903 13.93Z"
|
|
181
238
|
}
|
|
182
239
|
},
|
|
183
240
|
svelte: {
|
|
@@ -193,6 +250,14 @@ const FRONTEND_PARAMS = {
|
|
|
193
250
|
subpath: "nodefony/svelte",
|
|
194
251
|
doc: "svelte-reactivite.md",
|
|
195
252
|
marker: "svelte"
|
|
253
|
+
},
|
|
254
|
+
pageFile: "frontend/src/App.svelte",
|
|
255
|
+
badge: {
|
|
256
|
+
name: "Svelte",
|
|
257
|
+
color: "#ff3e00",
|
|
258
|
+
versionImport: "import { version } from \"svelte/package.json\";",
|
|
259
|
+
versionExpr: "version",
|
|
260
|
+
logo: "M10.354 21.125a4.44 4.44 0 0 1-4.765-1.767 4.109 4.109 0 0 1-.703-3.107 3.898 3.898 0 0 1 .134-.522l.105-.321.287.21a7.21 7.21 0 0 0 2.186 1.092l.208.063-.02.208a1.253 1.253 0 0 0 .226.83 1.337 1.337 0 0 0 1.435.533 1.231 1.231 0 0 0 .343-.15l5.59-3.562a1.164 1.164 0 0 0 .524-.778 1.242 1.242 0 0 0-.211-.937 1.338 1.338 0 0 0-1.435-.533 1.23 1.23 0 0 0-.343.15l-2.133 1.36a4.078 4.078 0 0 1-1.135.499 4.44 4.44 0 0 1-4.765-1.766 4.108 4.108 0 0 1-.702-3.108 3.855 3.855 0 0 1 1.742-2.582l5.589-3.563a4.072 4.072 0 0 1 1.135-.499 4.44 4.44 0 0 1 4.765 1.767 4.109 4.109 0 0 1 .703 3.107 3.943 3.943 0 0 1-.134.522l-.105.321-.286-.21a7.204 7.204 0 0 0-2.187-1.093l-.208-.063.02-.207a1.255 1.255 0 0 0-.226-.831 1.337 1.337 0 0 0-1.435-.532 1.231 1.231 0 0 0-.343.15L8.62 9.368a1.162 1.162 0 0 0-.524.778 1.24 1.24 0 0 0 .211.937 1.338 1.338 0 0 0 1.435.533 1.235 1.235 0 0 0 .344-.151l2.132-1.36a4.067 4.067 0 0 1 1.135-.498 4.44 4.44 0 0 1 4.765 1.766 4.108 4.108 0 0 1 .702 3.108 3.857 3.857 0 0 1-1.742 2.583l-5.589 3.562a4.072 4.072 0 0 1-1.135.499m10.358-17.95C18.484-.015 14.082-.96 10.9 1.068L5.31 4.63a6.412 6.412 0 0 0-2.896 4.295 6.753 6.753 0 0 0 .666 4.336 6.43 6.43 0 0 0-.96 2.396 6.833 6.833 0 0 0 1.168 5.167c2.229 3.19 6.63 4.135 9.812 2.108l5.59-3.562a6.41 6.41 0 0 0 2.896-4.295 6.756 6.756 0 0 0-.665-4.336 6.429 6.429 0 0 0 .958-2.396 6.831 6.831 0 0 0-1.167-5.168Z"
|
|
196
261
|
}
|
|
197
262
|
}
|
|
198
263
|
};
|
|
@@ -562,6 +627,18 @@ function linkLocalPeers(moduleDir, workspaces, writer, packageManager) {
|
|
|
562
627
|
return linked.sort();
|
|
563
628
|
}
|
|
564
629
|
/**
|
|
630
|
+
* La phrase qui nomme un caractère invisible d'une valeur refusée, précédée
|
|
631
|
+
* d'un point — chaîne vide quand il n'y en a pas. Un point, pas un saut de
|
|
632
|
+
* ligne : le rendu du refus replie le paragraphe, et y collerait la phrase.
|
|
633
|
+
*
|
|
634
|
+
* @param value - la valeur refusée
|
|
635
|
+
* @returns le complément du message de refus
|
|
636
|
+
*/
|
|
637
|
+
function invisibleNote(value) {
|
|
638
|
+
const note = describeInvisibleChars(value);
|
|
639
|
+
return note === null ? "" : `. ${note}`;
|
|
640
|
+
}
|
|
641
|
+
/**
|
|
565
642
|
* Complète et VALIDE des réponses partielles contre la spec d'un type : défauts
|
|
566
643
|
* appliqués, patterns vérifiés, choix contraints à leur liste. Le contexte des
|
|
567
644
|
* templates est donc complet PAR CONSTRUCTION (eta ne rend jamais un `undefined`
|
|
@@ -593,10 +670,10 @@ function resolveAnswers(spec, partial, caps) {
|
|
|
593
670
|
if (q.type === "choice") {
|
|
594
671
|
if (!q.choices?.some((c) => c.value === str)) {
|
|
595
672
|
const allowed = q.choices?.map((c) => c.value).join(" | ") ?? "";
|
|
596
|
-
throw new Error(`${q.key} invalide « ${str} » — attendu : ${allowed}`);
|
|
673
|
+
throw new Error(`${q.key} invalide « ${str} » — attendu : ${allowed}${invisibleNote(str)}`);
|
|
597
674
|
}
|
|
598
675
|
}
|
|
599
|
-
if (q.pattern && !new RegExp(q.pattern, "u").test(str)) throw new Error(`${q.key} invalide « ${str} » — ${q.patternHint ?? q.pattern}`);
|
|
676
|
+
if (q.pattern && !new RegExp(q.pattern, "u").test(str)) throw new Error(`${q.key} invalide « ${str} » — ${q.patternHint ?? q.pattern}${invisibleNote(str)}`);
|
|
600
677
|
answers[q.key] = str;
|
|
601
678
|
}
|
|
602
679
|
return answers;
|
|
@@ -645,10 +722,6 @@ function renderLayer(eta, srcDir, destDir, data, written, writer, tokens) {
|
|
|
645
722
|
withFileTypes: true,
|
|
646
723
|
recursive: true
|
|
647
724
|
});
|
|
648
|
-
const scope = {
|
|
649
|
-
devAdminPassword: DEV_ADMIN_PASSWORD,
|
|
650
|
-
...data
|
|
651
|
-
};
|
|
652
725
|
for (const entry of entries) {
|
|
653
726
|
if (!entry.isFile() || !entry.name.endsWith(".tpl")) continue;
|
|
654
727
|
const abs = path.join(entry.parentPath, entry.name);
|
|
@@ -659,13 +732,23 @@ function renderLayer(eta, srcDir, destDir, data, written, writer, tokens) {
|
|
|
659
732
|
const base = entry.name.replace(/\.tpl$/u, "");
|
|
660
733
|
let rel = path.join(relDir, RENAMES[base] ?? base);
|
|
661
734
|
for (const [token, value] of Object.entries(tokens ?? {})) rel = rel.replaceAll(token, value);
|
|
662
|
-
|
|
663
|
-
if (rendered.includes("<%")) throw new Error(`tag eta résiduel dans ${rel}`);
|
|
664
|
-
if (rendered.trim() === "") continue;
|
|
665
|
-
writer.write(path.join(destDir, rel), rendered);
|
|
666
|
-
if (!written.includes(rel)) written.push(rel);
|
|
735
|
+
renderTemplateFile(eta, abs, destDir, rel, data, written, writer);
|
|
667
736
|
}
|
|
668
737
|
}
|
|
738
|
+
/**
|
|
739
|
+
* Rend UN gabarit (`*.tpl`) vers `rel` sous `destDir` — le geste de chaque
|
|
740
|
+
* fichier d'un layer, appelable seul quand un gabarit partagé doit être posé
|
|
741
|
+
* ailleurs que dans son layer (la feuille de l'accueil d'une app sans front).
|
|
742
|
+
*
|
|
743
|
+
* @throws si un tag eta survit au rendu (gabarit cassé)
|
|
744
|
+
*/
|
|
745
|
+
function renderTemplateFile(eta, abs, destDir, rel, data, written, writer) {
|
|
746
|
+
const rendered = eta.renderString(readFileSync(abs, "utf8"), data);
|
|
747
|
+
if (rendered.includes("<%")) throw new Error(`tag eta résiduel dans ${rel}`);
|
|
748
|
+
if (rendered.trim() === "") return;
|
|
749
|
+
writer.write(path.join(destDir, rel), rendered);
|
|
750
|
+
if (!written.includes(rel)) written.push(rel);
|
|
751
|
+
}
|
|
669
752
|
/** Marqueurs du bloc que le framework possède dans `AGENTS.md`. */
|
|
670
753
|
const NODEFONY_BLOCK_START = "<!-- nodefony:start -->";
|
|
671
754
|
const NODEFONY_BLOCK_END = "<!-- nodefony:end -->";
|
|
@@ -1339,6 +1422,13 @@ function dispatchScaffold(request, version, writer, internal = {}) {
|
|
|
1339
1422
|
pascal: toPascalCase(String(answers.name)),
|
|
1340
1423
|
entryName: answers.name,
|
|
1341
1424
|
nodefonyVersion: version,
|
|
1425
|
+
installCommand: createAppCommand("", version),
|
|
1426
|
+
learnCommand: demoAppCommand(version),
|
|
1427
|
+
nodeRange: NODE_ENGINE_LABEL,
|
|
1428
|
+
loginPage: {
|
|
1429
|
+
path: LOGIN_PAGE_PATH,
|
|
1430
|
+
skins: LOGIN_PAGE_SKINS
|
|
1431
|
+
},
|
|
1342
1432
|
pmAudit: packageManagerCommandLines(packageManager).audit,
|
|
1343
1433
|
pmExec: packageManagerCommandLines(packageManager).exec,
|
|
1344
1434
|
pkg: SCAFFOLD_VERSIONS,
|
|
@@ -1357,6 +1447,7 @@ function dispatchScaffold(request, version, writer, internal = {}) {
|
|
|
1357
1447
|
NF_CSRF_SECRET: randomBytes(32).toString("base64")
|
|
1358
1448
|
},
|
|
1359
1449
|
realtime: { backplaneSecret: randomBytes(32).toString("base64") },
|
|
1450
|
+
devAdminPassword: drawDevAdminPassword(),
|
|
1360
1451
|
keycloak: {
|
|
1361
1452
|
clientSecret: `${String(answers.name)}-dev-keycloak-secret`,
|
|
1362
1453
|
machineSecret: `${String(answers.name)}-machine-dev-secret`
|
|
@@ -1369,7 +1460,11 @@ function dispatchScaffold(request, version, writer, internal = {}) {
|
|
|
1369
1460
|
renderLayer(eta, path.join(templates, "base"), dest, data, written, writer);
|
|
1370
1461
|
renderLayer(eta, path.join(templates, "licenses", license), dest, data, written, writer);
|
|
1371
1462
|
written.push(...writeBrandAssets(writer, packageRoot, dest, front ? ["favicon"] : ["logo", "favicon"]));
|
|
1372
|
-
if (!front)
|
|
1463
|
+
if (!front) {
|
|
1464
|
+
renderLayer(eta, path.join(templates, "home"), dest, data, written, writer);
|
|
1465
|
+
const shared = path.join(templates, "frontend", "shared", "frontend", "src");
|
|
1466
|
+
for (const [file, rel] of [["showcase.css.tpl", path.join("public", "showcase.css")], ["homeContent.ts.tpl", path.join("nodefony", "home", "homeContent.ts")]]) renderTemplateFile(eta, path.join(shared, file), dest, rel, data, written, writer);
|
|
1467
|
+
}
|
|
1373
1468
|
if (preset !== "complete") renderLayer(eta, path.join(packageRoot, "templates", "service"), dest, {
|
|
1374
1469
|
pascal: EXAMPLE_SERVICE,
|
|
1375
1470
|
camel: EXAMPLE_SERVICE.charAt(0).toLowerCase() + EXAMPLE_SERVICE.slice(1),
|
|
@@ -1443,7 +1538,8 @@ function dispatchScaffold(request, version, writer, internal = {}) {
|
|
|
1443
1538
|
return {
|
|
1444
1539
|
dest,
|
|
1445
1540
|
files: written.sort(),
|
|
1446
|
-
linked
|
|
1541
|
+
linked,
|
|
1542
|
+
devAdminPassword: data.devAdminPassword
|
|
1447
1543
|
};
|
|
1448
1544
|
}
|
|
1449
1545
|
/**
|
|
@@ -2022,7 +2118,12 @@ function renderDemoFront(eta, packageRoot, dest, appName, version, writer) {
|
|
|
2022
2118
|
const front = FRONTEND_PARAMS[DEMO_FRONTEND];
|
|
2023
2119
|
const data = {
|
|
2024
2120
|
installCommand: createAppCommand("", version),
|
|
2121
|
+
learnCommand: demoAppCommand(version),
|
|
2025
2122
|
nodeRange: NODE_ENGINE_LABEL,
|
|
2123
|
+
loginPage: {
|
|
2124
|
+
path: LOGIN_PAGE_PATH,
|
|
2125
|
+
skins: LOGIN_PAGE_SKINS
|
|
2126
|
+
},
|
|
2026
2127
|
nameClass: "DemoPageController",
|
|
2027
2128
|
pascal: "Demo",
|
|
2028
2129
|
kebab: DEMO_MODULE,
|
|
@@ -3891,7 +3992,14 @@ function runFrontScaffold(request, answers, packageRoot, nodefonyVersion, writer
|
|
|
3891
3992
|
frontend,
|
|
3892
3993
|
front,
|
|
3893
3994
|
appName: target.name,
|
|
3894
|
-
complete
|
|
3995
|
+
complete,
|
|
3996
|
+
installCommand: createAppCommand("", nodefonyVersion),
|
|
3997
|
+
learnCommand: demoAppCommand(nodefonyVersion),
|
|
3998
|
+
nodeRange: NODE_ENGINE_LABEL,
|
|
3999
|
+
loginPage: {
|
|
4000
|
+
path: LOGIN_PAGE_PATH,
|
|
4001
|
+
skins: LOGIN_PAGE_SKINS
|
|
4002
|
+
}
|
|
3895
4003
|
};
|
|
3896
4004
|
const tokens = {
|
|
3897
4005
|
__NAME__: nameClass,
|
|
@@ -4012,4 +4120,4 @@ function wireKernelBootCall(indexPath, fnName, importPath, writer) {
|
|
|
4012
4120
|
writer.write(indexPath, wired);
|
|
4013
4121
|
return null;
|
|
4014
4122
|
}
|
|
4015
|
-
export { DATABASE_PARAMS, DEMO_FRONT_DEV_DEPS, DEMO_SERVER_DEV_DEPS,
|
|
4123
|
+
export { DATABASE_PARAMS, DEMO_FRONT_DEV_DEPS, DEMO_SERVER_DEV_DEPS, FRONTEND_PARAMS, MONGOOSE_CONNECTOR, ScaffoldConflictError, appDockerfileData, assertNoSqlOnlyOptions, declareWorkspaceDependency, drawDevAdminPassword, ensureWorkspaces, filterProbe, findModuleClassAnchor, findPackageRoot, findProjectRoot, getScaffoldContext, hoistModuleFrontDeps, hydrateQuestion, importsName, invalidBodyOf, lastImportEnd, linkLocalDeps, linkLocalPeers, listTargets, localLinkSpecifier, malformedProbe, ormDependencyNames, promotionKeyOf, refreshAgentsGuide, renderAppDockerfile, renderDemoModule, resolveAnswers, resolveDatabase, resolveEntityOrm, resolveLocalWorkspaces, runScaffold, sampleValue, scaffoldCaps, toKebabCase, toNativeRelativePath, toPascalCase, wireCommandCall, wireDecoratorList, wireEntitiesDecorator, wireGrantableScope, wireKernelBootCall, wireModuleManifest, wireRoleHierarchy, writeAgentPointers };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// src/cli/scaffold/invisibleChars.ts
|
|
2
|
+
/**
|
|
3
|
+
* Caractères qui ne se VOIENT pas dans un terminal, nommés pour un humain.
|
|
4
|
+
*
|
|
5
|
+
* Un copier-coller depuis une messagerie, une page web ou un traitement de
|
|
6
|
+
* texte glisse souvent un espace insécable (macOS : Alt + Espace) là où l'on
|
|
7
|
+
* croit avoir tapé un espace. Le refus est juste — `brice-app` suivi de U+00A0
|
|
8
|
+
* n'est pas un nom kebab-case —, mais un message qui affiche `« brice-app »`
|
|
9
|
+
* comme invalide envoie chercher au mauvais endroit : la faute est à l'écran,
|
|
10
|
+
* et l'on ne la voit pas.
|
|
11
|
+
*
|
|
12
|
+
* `Map` : table fixe, lue caractère par caractère sur une valeur courte, et
|
|
13
|
+
* seulement quand une validation a DÉJÀ échoué — rien sur le chemin nominal.
|
|
14
|
+
*/
|
|
15
|
+
const INVISIBLE_CHARS = /* @__PURE__ */ new Map([
|
|
16
|
+
["\xA0", "espace insécable"],
|
|
17
|
+
[" ", "espace fine insécable"],
|
|
18
|
+
[" ", "espace tabulaire"],
|
|
19
|
+
[" ", "espace fine"],
|
|
20
|
+
[" ", "espace ultrafine"],
|
|
21
|
+
["", "espace sans chasse"],
|
|
22
|
+
["", "antiliant sans chasse"],
|
|
23
|
+
["", "liant sans chasse"],
|
|
24
|
+
["", "gluon de mots"],
|
|
25
|
+
["", "trait d'union conditionnel"],
|
|
26
|
+
[" ", "espace idéographique"],
|
|
27
|
+
["", "indicateur d'ordre des octets"]
|
|
28
|
+
]);
|
|
29
|
+
/**
|
|
30
|
+
* Décrit les caractères invisibles d'une valeur saisie, ou `null` s'il n'y en a pas.
|
|
31
|
+
*
|
|
32
|
+
* Rend une phrase à ajouter à un message de refus : le code Unicode, le nom du
|
|
33
|
+
* caractère et sa position (1 = premier caractère), puis le geste — retaper.
|
|
34
|
+
*
|
|
35
|
+
* @param value - la valeur refusée, telle que reçue
|
|
36
|
+
* @returns la phrase, ou `null` si la valeur ne contient aucun caractère invisible
|
|
37
|
+
*/
|
|
38
|
+
function describeInvisibleChars(value) {
|
|
39
|
+
const found = [];
|
|
40
|
+
let position = 0;
|
|
41
|
+
for (const char of value) {
|
|
42
|
+
position++;
|
|
43
|
+
const name = INVISIBLE_CHARS.get(char);
|
|
44
|
+
if (name !== void 0) {
|
|
45
|
+
const code = char.codePointAt(0)?.toString(16).toUpperCase().padStart(4, "0");
|
|
46
|
+
found.push(`U+${code} (${name}) en position ${position}`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
if (found.length === 0) return null;
|
|
50
|
+
return `La valeur contient ${found.length > 1 ? "des caractères INVISIBLES" : "un caractère INVISIBLE"} : ${found.join(", ")} — souvent laissé par un copier-coller ; retape-la au clavier`;
|
|
51
|
+
}
|
|
52
|
+
export { describeInvisibleChars };
|
|
@@ -43,18 +43,18 @@ const SCAFFOLD_VERSIONS = {
|
|
|
43
43
|
"@types/three": "^0.187.0",
|
|
44
44
|
"highlight.js": "^11.12.0",
|
|
45
45
|
katex: "^0.19.1",
|
|
46
|
-
vue: "^3.5.
|
|
46
|
+
vue: "^3.5.46",
|
|
47
47
|
"@vitejs/plugin-vue": "^6.0.11",
|
|
48
|
-
svelte: "^5.58.
|
|
48
|
+
svelte: "^5.58.1",
|
|
49
49
|
"@sveltejs/vite-plugin-svelte": "^7.3.1",
|
|
50
50
|
"vue-tsc": "^3.3.14",
|
|
51
51
|
"svelte-check": "^4.7.8",
|
|
52
|
-
"@angular/core": "~22.
|
|
53
|
-
"@angular/common": "~22.
|
|
54
|
-
"@angular/platform-browser": "~22.
|
|
52
|
+
"@angular/core": "~22.3.0",
|
|
53
|
+
"@angular/common": "~22.3.0",
|
|
54
|
+
"@angular/platform-browser": "~22.3.0",
|
|
55
55
|
"@analogjs/vite-plugin-angular": "^2.9.7",
|
|
56
|
-
"@angular/build": "~22.
|
|
57
|
-
"@angular/compiler-cli": "~22.
|
|
56
|
+
"@angular/build": "~22.3.0",
|
|
57
|
+
"@angular/compiler-cli": "~22.3.0"
|
|
58
58
|
};
|
|
59
59
|
/**
|
|
60
60
|
* Version d'un paquet du catalogue — lève si le paquet n'y figure pas.
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
// src/cli/startPanel.ts
|
|
2
|
+
/** Largeur du filet : tient dans un terminal de 80 colonnes. */
|
|
3
|
+
const RULE_WIDTH = 64;
|
|
4
|
+
/** Colonne où commence le contenu d'une étape. */
|
|
5
|
+
const LABEL_WIDTH = 15;
|
|
6
|
+
/** L'adresse annoncée : le port peut changer, le démarrage dit le vrai. */
|
|
7
|
+
const DEV_ORIGIN = "https://127.0.0.1:5152";
|
|
8
|
+
/**
|
|
9
|
+
* Rend le bloc « Pour commencer ».
|
|
10
|
+
*
|
|
11
|
+
* @param input - l'état de l'application générée
|
|
12
|
+
* @param bold - mise en relief du titre et des intitulés (identité par
|
|
13
|
+
* défaut : la sortie reste lisible sans couleur, et testable)
|
|
14
|
+
* @returns le bloc, filets compris, terminé par un saut de ligne
|
|
15
|
+
*/
|
|
16
|
+
function renderStartPanel(input, bold = (text) => text) {
|
|
17
|
+
const { commands } = input;
|
|
18
|
+
const nodefony = commands.exec("nodefony");
|
|
19
|
+
const steps = [];
|
|
20
|
+
const start = [];
|
|
21
|
+
if (input.relDest !== ".") start.push(`cd ${input.relDest}`);
|
|
22
|
+
if (!input.installed) start.push(commands.install);
|
|
23
|
+
if (!input.built) start.push(commands.run("build"));
|
|
24
|
+
if (input.infra !== null) start.push(`${commands.run("infra:up")} # docker : ${input.infra} + Redis`);
|
|
25
|
+
if (input.migrationPending) {
|
|
26
|
+
start.push(`${nodefony} orm:generate --name init`);
|
|
27
|
+
start.push(`${nodefony} orm:migrate`);
|
|
28
|
+
}
|
|
29
|
+
start.push(commands.run("dev"));
|
|
30
|
+
start.push(`→ ${DEV_ORIGIN} (port réel : voir le démarrage)`);
|
|
31
|
+
steps.push({
|
|
32
|
+
label: "Démarrer",
|
|
33
|
+
lines: start
|
|
34
|
+
});
|
|
35
|
+
if (input.admin !== null) steps.push({
|
|
36
|
+
label: "Se connecter",
|
|
37
|
+
lines: [
|
|
38
|
+
`${input.admin.user} / ${input.admin.password} (développement seulement)`,
|
|
39
|
+
"console d'administration : /nodefony",
|
|
40
|
+
"défini dans nodefony/security/provisionUsers.ts"
|
|
41
|
+
]
|
|
42
|
+
});
|
|
43
|
+
if (input.addFrontend !== null) steps.push({
|
|
44
|
+
label: "Une page web",
|
|
45
|
+
lines: [
|
|
46
|
+
`${nodefony} create front --frontend <moteur>`,
|
|
47
|
+
`moteur : ${input.addFrontend.join(" · ")}`,
|
|
48
|
+
"page, connexion, temps réel LIVRÉS — ne les écris pas"
|
|
49
|
+
]
|
|
50
|
+
});
|
|
51
|
+
steps.push({
|
|
52
|
+
label: "Ton agent IA",
|
|
53
|
+
lines: input.agent.kind === "wired" ? ["porte MCP câblée, jeton posé dans .env (NF_MCP_TOKEN)", "app démarrée, agent relancé ; il lit AGENTS.md d'abord"] : input.agent.kind === "token-missing" ? [`${nodefony} security:mcp:token --write`, "porte câblée, jeton à poser — la base doit répondre"] : [`${nodefony} ai:mcp`, "porte MCP + jeton ; il lit AGENTS.md d'abord"]
|
|
54
|
+
});
|
|
55
|
+
steps.push({
|
|
56
|
+
label: "Apprendre",
|
|
57
|
+
lines: input.demo.installed ? [`${DEV_ORIGIN}/demo`, "chaque démo montre le code qui la fait tourner"] : [input.demo.command, "une app jetable avec les démos commentées"]
|
|
58
|
+
});
|
|
59
|
+
const pad = " ".repeat(19);
|
|
60
|
+
const out = ["", `──${bold(" Pour commencer ")}${"─".repeat(46)}`];
|
|
61
|
+
steps.forEach((step, index) => {
|
|
62
|
+
out.push("");
|
|
63
|
+
step.lines.forEach((line, i) => {
|
|
64
|
+
out.push(i === 0 ? ` ${String(index + 1)} ${bold(step.label.padEnd(LABEL_WIDTH))}${line}` : `${pad}${line}`);
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
out.push("", "─".repeat(RULE_WIDTH), "");
|
|
68
|
+
return out.join("\n");
|
|
69
|
+
}
|
|
70
|
+
export { renderStartPanel };
|
package/dist/node/index.js
CHANGED
|
@@ -81,9 +81,9 @@ import { readOrmHealth, readOrmRich, setOrmHealthProvider, setOrmRichProvider }
|
|
|
81
81
|
import { ClusterManager, computeBackoff, readWorkerSlot } from "./service/cluster/ClusterManager.js";
|
|
82
82
|
import { ClusterRelay } from "./service/cluster/ClusterRelay.js";
|
|
83
83
|
import { ClusterProbeAggregator } from "./service/cluster/ClusterProbeAggregator.js";
|
|
84
|
+
import { CLUSTER_IPC_ADVANCED, CLUSTER_IPC_SERIALIZATION_ENV, CLUSTER_PROBE_CTL_KIND, CLUSTER_PROBE_ENRICH_KIND, CLUSTER_PROBE_KIND, CLUSTER_PROBE_SNAPSHOT_KIND, CLUSTER_RT_KIND, isClusterMessage, isClusterProbeCtl, isClusterProbeEnrich } from "./service/cluster/clusterMessage.js";
|
|
84
85
|
import { FileTransport } from "./syslog/transports/FileTransport.js";
|
|
85
86
|
import { BatchingHttpTransport } from "./syslog/transports/BatchingHttpTransport.js";
|
|
86
|
-
import { CLUSTER_IPC_ADVANCED, CLUSTER_IPC_SERIALIZATION_ENV, CLUSTER_PROBE_CTL_KIND, CLUSTER_PROBE_ENRICH_KIND, CLUSTER_PROBE_KIND, CLUSTER_PROBE_SNAPSHOT_KIND, CLUSTER_RT_KIND, isClusterMessage, isClusterProbeCtl, isClusterProbeEnrich } from "./service/cluster/clusterMessage.js";
|
|
87
87
|
import RequestContext from "./runtime/RequestContext.js";
|
|
88
88
|
import { redactSecrets, redactUrlCredentials } from "./runtime/redact.js";
|
|
89
89
|
import { identityHint } from "./runtime/identityHint.js";
|
|
@@ -191,8 +191,18 @@ function checkPackageDeps(options) {
|
|
|
191
191
|
* `node_modules` arrive déjà construit, alors qu'un frère du dépôt doit
|
|
192
192
|
* l'être AVANT. Dans une application, cet ensemble ne contient que ses
|
|
193
193
|
* propres modules — la règle n'y mord donc jamais sur `nodefony`.
|
|
194
|
+
*
|
|
195
|
+
* 🔴 Sauf HOMONYMIE : une application peut porter le nom d'un paquet dont
|
|
196
|
+
* elle dépend — la vitrine `nodefony/nodefony` s'appelle `nodefony` et
|
|
197
|
+
* installe `nodefony`. Un paquet ne dépend jamais de lui-même : s'il déclare
|
|
198
|
+
* son propre nom, ce nom désigne le paquet EXTERNE, venu de `node_modules`
|
|
199
|
+
* déjà construit, et non un frère. Sans cette exclusion, chaque module de
|
|
200
|
+
* l'application qui importe `nodefony` en peer était déclaré fautif (#796).
|
|
194
201
|
*/
|
|
195
|
-
const siblings = new Set(packages.
|
|
202
|
+
const siblings = new Set(packages.filter(({ manifest, name }) => DEP_FIELDS.every((k) => {
|
|
203
|
+
const deps = manifest[k];
|
|
204
|
+
return !(typeof deps === "object" && deps !== null && Object.hasOwn(deps, name));
|
|
205
|
+
})).map((p) => p.name));
|
|
196
206
|
for (const { dir, manifest, name } of packages) {
|
|
197
207
|
const declared = new Set(DEP_FIELDS.flatMap((k) => Object.keys(manifest[k] ?? {})));
|
|
198
208
|
const members = workspaceMembers(dir, manifest);
|
|
@@ -39,3 +39,13 @@ export declare function packageSpec(name: string, version?: string): string;
|
|
|
39
39
|
* @returns la commande, prête à copier
|
|
40
40
|
*/
|
|
41
41
|
export declare function createAppCommand(appName: string, version?: string): string;
|
|
42
|
+
/**
|
|
43
|
+
* Commande qui crée une application JETABLE portant la démo :
|
|
44
|
+
* `npm create nodefony essai -- --demo`. La démo sert à apprendre, pas à
|
|
45
|
+
* rester — on ne l'ajoute pas à une application, on en crée une pour elle.
|
|
46
|
+
* Une seule règle pour la fin de `create app` et l'accueil de développement.
|
|
47
|
+
*
|
|
48
|
+
* @param version - version du framework ; défaut : celle du paquet qui tourne
|
|
49
|
+
* @returns la commande, prête à copier
|
|
50
|
+
*/
|
|
51
|
+
export declare function demoAppCommand(version?: string): string;
|
|
@@ -1,15 +1,29 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
3
|
+
* Tire le mot de passe du compte `admin` qu'une application générée sème en
|
|
4
|
+
* développement — UNE fois, à `create app`, propre à chaque application.
|
|
5
|
+
*
|
|
6
|
+
* Une valeur fixe était publiée avec le framework, et un serveur démarré sans
|
|
7
|
+
* `NODE_ENV` tourne en développement (`engineEnvironment.ts#DEFAULT_ENGINE_ENVIRONMENT`) :
|
|
8
|
+
* il créait donc un compte administrateur dont tout le monde connaissait le mot
|
|
9
|
+
* de passe. Le tirage le rend propre à l'application, sans rien coûter au
|
|
10
|
+
* développeur, qui le lit sur l'accueil, dans le `.env` et dans le README.
|
|
11
|
+
*
|
|
12
|
+
* Forme `xxxx-xxxx-xxxx`, chaque groupe = trois lettres et UN chiffre à une
|
|
13
|
+
* place tirée (~52 bits) : il se TAPE au premier login, il doit donc se lire et
|
|
14
|
+
* se recopier sans ambiguïté. Le chiffre n'est pas décoratif : la politique
|
|
15
|
+
* refuse quatre touches consécutives (`abcd`, `2345`, `qsdf`), et un groupe
|
|
16
|
+
* de quatre lettres tirées au hasard en tombe une de temps en temps — l'app
|
|
17
|
+
* ne semait alors pas son compte. Aucune suite refusée ne mêle lettres et
|
|
18
|
+
* chiffres, donc aucun groupe n'en est une, sans recopier la règle ici.
|
|
19
|
+
* 14 caractères passent `minLength` (10) ; jamais « admin ».
|
|
20
|
+
*
|
|
21
|
+
* Seule source : chaque gabarit le rend par `<%= it.devAdminPassword %>`, et
|
|
22
|
+
* `create app` l'annonce depuis `IScaffoldResult.devAdminPassword`.
|
|
23
|
+
*
|
|
24
|
+
* @returns un mot de passe neuf à chaque appel
|
|
11
25
|
*/
|
|
12
|
-
export declare
|
|
26
|
+
export declare function drawDevAdminPassword(): string;
|
|
13
27
|
import { findProjectRoot } from "../projectRoot.js";
|
|
14
28
|
import { type IPackageManagerToolchain } from "../packageManager.js";
|
|
15
29
|
import type { PackageManagerName } from "../../Cli.js";
|
|
@@ -51,6 +65,11 @@ export interface IScaffoldResult {
|
|
|
51
65
|
linked: string[];
|
|
52
66
|
/** Points d'entrée utiles du scaffold (routes, canaux…) — affichés tels quels. */
|
|
53
67
|
notes?: string[];
|
|
68
|
+
/**
|
|
69
|
+
* Mot de passe du compte `admin` de développement tiré pour CETTE application
|
|
70
|
+
* (`create app` seulement) — celui que `create app` annonce.
|
|
71
|
+
*/
|
|
72
|
+
devAdminPassword?: string;
|
|
54
73
|
/**
|
|
55
74
|
* Dépendances AJOUTÉES au `package.json` du projet par cette génération.
|
|
56
75
|
*
|
|
@@ -155,6 +174,21 @@ interface IFrontendClientPort {
|
|
|
155
174
|
*/
|
|
156
175
|
marker: string;
|
|
157
176
|
}
|
|
177
|
+
/**
|
|
178
|
+
* Badge d'un front sur l'accueil de développement : son nom, sa couleur de
|
|
179
|
+
* marque et son logo (tracé simple-icons, CC0), et de quoi lire sa version À
|
|
180
|
+
* L'EXÉCUTION — une version recopiée ici mentirait dès la mise à jour.
|
|
181
|
+
*/
|
|
182
|
+
interface IFrontendBadge {
|
|
183
|
+
name: string;
|
|
184
|
+
color: string;
|
|
185
|
+
/** Import qui fournit la version du moteur, rendu tel quel dans `devHome.ts`. */
|
|
186
|
+
versionImport: string;
|
|
187
|
+
/** Expression qui la lit (`version`, `VERSION.full`). */
|
|
188
|
+
versionExpr: string;
|
|
189
|
+
/** Tracé SVG (viewBox 0 0 24 24). */
|
|
190
|
+
logo: string;
|
|
191
|
+
}
|
|
158
192
|
/**
|
|
159
193
|
* Paramètres frontend par framework — type registerEntry, entry, nœud de
|
|
160
194
|
* montage, ET les dépendances npm (SOURCE UNIQUE : consommée par le
|
|
@@ -200,6 +234,10 @@ export declare const FRONTEND_PARAMS: Record<Exclude<TFrontendChoice, "none">, {
|
|
|
200
234
|
deps: Record<string, string>;
|
|
201
235
|
devDeps: Record<string, string>;
|
|
202
236
|
client: IFrontendClientPort;
|
|
237
|
+
/** Le fichier de la page d'accueil, relatif à la cible — nommé par l'accueil (« C'est ta page »). */
|
|
238
|
+
pageFile: string;
|
|
239
|
+
/** Badge du front sur l'accueil de développement (`devHome.ts`). */
|
|
240
|
+
badge: IFrontendBadge;
|
|
203
241
|
}>;
|
|
204
242
|
/**
|
|
205
243
|
* Paramètres de la base SQL retenue au scaffold — SOURCE UNIQUE du service
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Décrit les caractères invisibles d'une valeur saisie, ou `null` s'il n'y en a pas.
|
|
3
|
+
*
|
|
4
|
+
* Rend une phrase à ajouter à un message de refus : le code Unicode, le nom du
|
|
5
|
+
* caractère et sa position (1 = premier caractère), puis le geste — retaper.
|
|
6
|
+
*
|
|
7
|
+
* @param value - la valeur refusée, telle que reçue
|
|
8
|
+
* @returns la phrase, ou `null` si la valeur ne contient aucun caractère invisible
|
|
9
|
+
*/
|
|
10
|
+
export declare function describeInvisibleChars(value: string): string | null;
|