nodefony 10.0.0-beta.9 → 10.0.0

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.
Files changed (118) hide show
  1. package/.ai/symbols.json +24 -2
  2. package/CHANGELOG.md +15 -0
  3. package/README.md +8 -15
  4. package/dist/bin/nodefony.js +1 -1
  5. package/dist/client/client/angular/index.js +1 -1
  6. package/dist/client/client/react/index.js +1 -1
  7. package/dist/client/client/sse/NodefonySse.js +1 -1
  8. package/dist/client/client/svelte/index.js +1 -1
  9. package/dist/client/client/vue/index.js +1 -1
  10. package/dist/client/debugbar.standalone.js +1 -1
  11. package/dist/client/realtime/base64url.js +1 -1
  12. package/dist/client/realtime/codec/decode.js +1 -1
  13. package/dist/client/realtime/codec/encode.js +3 -4
  14. package/dist/client/realtime/throughputProbe.js +1 -1
  15. package/dist/node/Cli.js +6 -6
  16. package/dist/node/Error.js +3 -3
  17. package/dist/node/Event.js +1 -1
  18. package/dist/node/FileClass.js +3 -3
  19. package/dist/node/Nodefony.js +1 -1
  20. package/dist/node/bundler/index.js +1 -1
  21. package/dist/node/cli/agentTargets.js +2 -2
  22. package/dist/node/cli/aiMcp.js +2 -2
  23. package/dist/node/cli/aiSync.js +2 -2
  24. package/dist/node/cli/card.js +2 -2
  25. package/dist/node/cli/cliFreshness.js +1 -1
  26. package/dist/node/cli/completion.js +4 -4
  27. package/dist/node/cli/contributions.js +5 -6
  28. package/dist/node/cli/create.js +4 -5
  29. package/dist/node/cli/env.js +4 -4
  30. package/dist/node/cli/gitHooks.js +3 -3
  31. package/dist/node/cli/image/index.js +1 -1
  32. package/dist/node/cli/image/tarLayers.js +1 -1
  33. package/dist/node/cli/installCommand.js +16 -4
  34. package/dist/node/cli/installedPackages.js +2 -2
  35. package/dist/node/cli/licenses.js +3 -3
  36. package/dist/node/cli/man.js +2 -2
  37. package/dist/node/cli/manPage.js +1 -1
  38. package/dist/node/cli/outdated.js +1 -1
  39. package/dist/node/cli/progress.js +1 -1
  40. package/dist/node/cli/projectRoot.js +1 -1
  41. package/dist/node/cli/prompts.js +1 -1
  42. package/dist/node/cli/scaffold/engine.js +5 -5
  43. package/dist/node/cli/scaffold/format.js +1 -1
  44. package/dist/node/cli/scaffold/interactive.js +1 -1
  45. package/dist/node/cli/scaffold/versions.js +4 -4
  46. package/dist/node/cli/see.js +3 -3
  47. package/dist/node/cli/symbols.js +2 -2
  48. package/dist/node/cli/symbolsGenerate.js +3 -3
  49. package/dist/node/cli/upgrade.js +66 -52
  50. package/dist/node/command/Builder.js +3 -3
  51. package/dist/node/command/Command.js +1 -1
  52. package/dist/node/config/defineEnv.js +1 -1
  53. package/dist/node/finder/Finder.js +2 -2
  54. package/dist/node/kernel/CliKernel.js +2 -2
  55. package/dist/node/kernel/Kernel.js +5 -5
  56. package/dist/node/kernel/Module.js +3 -3
  57. package/dist/node/kernel/checks/deep.js +3 -3
  58. package/dist/node/kernel/checks/freshness.js +3 -3
  59. package/dist/node/kernel/checks/gating.js +1 -1
  60. package/dist/node/kernel/checks/guards.js +1 -1
  61. package/dist/node/kernel/checks/lastBoot.js +1 -1
  62. package/dist/node/kernel/checks/managerDrift.js +2 -2
  63. package/dist/node/kernel/checks/packageDeps.js +1 -1
  64. package/dist/node/kernel/checks/projectScope.js +2 -2
  65. package/dist/node/kernel/checks/readiness.js +2 -2
  66. package/dist/node/kernel/checks/renderReport.js +1 -1
  67. package/dist/node/kernel/checks/runDoctor.js +3 -3
  68. package/dist/node/kernel/checks/surface.js +2 -2
  69. package/dist/node/kernel/checks/wiring.js +2 -2
  70. package/dist/node/kernel/commands/BuildCommand.js +1 -1
  71. package/dist/node/kernel/commands/ClusterCommand.js +1 -1
  72. package/dist/node/kernel/commands/LicensesCommand.js +2 -2
  73. package/dist/node/kernel/commands/MenuCommand.js +3 -3
  74. package/dist/node/kernel/commands/OutdatedCommand.js +4 -4
  75. package/dist/node/kernel/commands/ProdCommand.js +1 -1
  76. package/dist/node/kernel/commands/UpgradeCommand.js +1 -1
  77. package/dist/node/kernel/commands/runtimeLauncher.js +1 -1
  78. package/dist/node/kernel/decorators/kernelDecorator.js +1 -1
  79. package/dist/node/kernel/injector/injector.js +1 -1
  80. package/dist/node/kernel/injector/serviceOrder.js +1 -1
  81. package/dist/node/kernel/kernelCluster.js +1 -1
  82. package/dist/node/kernel/kernelLog.js +2 -2
  83. package/dist/node/kernel/storeManifest.js +2 -2
  84. package/dist/node/package.json.js +1 -1
  85. package/dist/node/realtime/base64url.js +1 -1
  86. package/dist/node/realtime/codec/decode.js +1 -1
  87. package/dist/node/realtime/codec/encode.js +3 -4
  88. package/dist/node/realtime/throughputProbe.js +1 -1
  89. package/dist/node/runtime/loadEnv.js +1 -1
  90. package/dist/node/runtime/scanPage.js +8 -8
  91. package/dist/node/service/cluster/ClusterManager.js +1 -1
  92. package/dist/node/service/cluster/clusterMaster.js +1 -1
  93. package/dist/node/service/cluster/cpuQuota.js +1 -1
  94. package/dist/node/service/cluster/richProcessProbe.js +1 -1
  95. package/dist/node/service/cluster/topology.js +1 -1
  96. package/dist/node/service/dev/BootReporter.js +1 -1
  97. package/dist/node/service/dev/DevSupervisor.js +5 -5
  98. package/dist/node/service/dev/DevTerminal.js +1 -1
  99. package/dist/node/service/dev/clipboard.js +1 -1
  100. package/dist/node/service/dev/detachedStart.js +5 -5
  101. package/dist/node/service/dev/devProcess.js +2 -2
  102. package/dist/node/service/dev/devProjects.js +2 -2
  103. package/dist/node/service/dev/devStatusReport.js +2 -2
  104. package/dist/node/service/dev/devStop.js +2 -2
  105. package/dist/node/service/dev/devTranscript.js +1 -1
  106. package/dist/node/service/dev/startupScreen.js +1 -1
  107. package/dist/node/syslog/Syslog.js +1 -1
  108. package/dist/node/syslog/drivers/ClusterFileLogDriver.js +2 -2
  109. package/dist/node/syslog/drivers/FileLogDriver.js +1 -1
  110. package/dist/node/syslog/drivers/builtinLogDrivers.js +1 -1
  111. package/dist/node/testing/index.js +5 -5
  112. package/dist/node/testing/stopChildTree.js +1 -1
  113. package/dist/types/cli/installCommand.d.ts +10 -0
  114. package/dist/types/cli/upgrade.d.ts +10 -0
  115. package/dist/types/kernel/commands/UpgradeCommand.d.ts +1 -1
  116. package/man/nodefony.1 +1 -1
  117. package/package.json +5 -5
  118. package/templates/app/base/README.md.tpl +1 -1
package/.ai/symbols.json CHANGED
@@ -4,12 +4,12 @@
4
4
  "repoRoot": ".",
5
5
  "stats": {
6
6
  "files": 1138,
7
- "symbols": 5045,
7
+ "symbols": 5047,
8
8
  "classes": 396,
9
9
  "interfaces": 1316,
10
10
  "types": 566,
11
11
  "enums": 2,
12
- "functions": 2049,
12
+ "functions": 2051,
13
13
  "constants": 716
14
14
  },
15
15
  "symbols": {
@@ -2315,6 +2315,14 @@
2315
2315
  "module": "@nodefony/core",
2316
2316
  "description": "Canal npm (dist-tag) qui sert une version : l'identifiant de sa préversion (`10.0.0-beta.8` → `beta`), sinon `latest`."
2317
2317
  },
2318
+ "packageSpec": {
2319
+ "name": "packageSpec",
2320
+ "kind": "function",
2321
+ "file": "src/nodefony/src/cli/installCommand.ts",
2322
+ "exported": true,
2323
+ "module": "@nodefony/core",
2324
+ "description": "Spécificateur npm d'un paquet du framework pour la version donnée, canal NOMMÉ tant que c'est une préversion (`@nodefony/http@beta`), nu pour une stable — `latest` est alors la ligne de cette version."
2325
+ },
2318
2326
  "createAppCommand": {
2319
2327
  "name": "createAppCommand",
2320
2328
  "kind": "function",
@@ -5312,6 +5320,14 @@
5312
5320
  "extends": null,
5313
5321
  "description": "Ce que `nodefony upgrade` a fait — ou ferait, en `--check`/`--dry-run`."
5314
5322
  },
5323
+ "upgradeUsage": {
5324
+ "name": "upgradeUsage",
5325
+ "kind": "function",
5326
+ "file": "src/nodefony/src/cli/upgrade.ts",
5327
+ "exported": true,
5328
+ "module": "@nodefony/core",
5329
+ "description": "La page d'aide de `nodefony upgrade` pour une version du framework."
5330
+ },
5315
5331
  "isUpgradePending": {
5316
5332
  "name": "isUpgradePending",
5317
5333
  "kind": "function",
@@ -46208,6 +46224,12 @@
46208
46224
  "TypeScriptApi": [
46209
46225
  "src/nodefony/src/cli/symbolsGenerate.ts"
46210
46226
  ],
46227
+ "npmChannelOf": [
46228
+ "src/nodefony/src/cli/upgrade.ts"
46229
+ ],
46230
+ "packageSpec": [
46231
+ "src/nodefony/src/cli/upgrade.ts"
46232
+ ],
46211
46233
  "syncEnvExample": [
46212
46234
  "src/nodefony/src/cli/upgrade.ts"
46213
46235
  ],
package/CHANGELOG.md CHANGED
@@ -8,6 +8,21 @@ Les sections naissent d'un BROUILLON rendu par `npm run release` depuis les mess
8
8
  de commit, puis sont RÉÉCRITES à la main : un journal git est écrit pour l'auteur,
9
9
  un changelog pour celui qui met à jour.
10
10
 
11
+ ## 10.0.0 - 2026-11-18
12
+
13
+ _La première version stable de Nodefony 10 : le framework réécrit en TypeScript strict sur les serveurs natifs de Node (`node:http`, `node:http2`, WebSocket), où le WebSocket partage le pipeline, les routes et la sécurité du HTTP, et où chaque requête reçoit son propre conteneur de services. Seize paquets à la même version, sous le canal `latest` : `npm create nodefony mon-app` suffit, sans nommer de canal. Elle reprend la beta.9 sans rupture d'API mesurée ; les ruptures de la ligne 10 sont annoncées bêta par bêta ci-dessous, chacune avec son geste de migration. Une application de la série 7 (JavaScript, dépréciée) ne se monte pas : les deux API n'ont rien de commun._
14
+
15
+ ### Changed
16
+
17
+ - **cli:** Générer les applications avec rolldown `^1.3.3`, vitest `^5.1.1` et svelte `^5.58.0` (26477502d)
18
+ - **devkit:** Ne plus faire nommer le canal `beta` par le skill `nodefony-upgrade` livré aux applications : `npm install nodefony` suit `latest`, et une version précise s'écrit la même sur tous les paquets (f9dacd969)
19
+
20
+ ### Fixed
21
+
22
+ - **cli:** Calculer le canal dans l'aide de `nodefony upgrade`, qui affirmait en dur que `latest` servait la série 7 (#782) (840b49447)
23
+
24
+ <!-- Surface publique mesurée depuis 10.0.0-beta.9 (npm) : 0 retrait sur 2 935 déclarations ; 1 à relire, relue — `NODEFONY_CLIENT` de ./angular (extensions des import() du .d.ts brut, rétablies au pack). Détail : npm run release:api-diff -- --from 10.0.0-beta.9 --details -->
25
+
11
26
  ## 10.0.0-beta.9 - 2026-11-18
12
27
 
13
28
  _Une bêta de correctifs avant la stable : une faille de révocation de sessions sur Redis corrigée, une image d'application qui s'ouvre aux paquets système et se met à jour avec le framework, et une CI générée qui éprouve aussi l'arm64. Aucune rupture d'API mesurée._
package/README.md CHANGED
@@ -30,15 +30,14 @@ _Une action de contrôleur. Deux transports. La même session, la même sécurit
30
30
 
31
31
  > **Ce paquet est le CŒUR du framework** — noyau, injection de dépendances, modules, journalisation,
32
32
  > interface en ligne de commande, client temps réel et codec CBOR. Il s'installe rarement seul : une
33
- > application le reçoit par `npm create nodefony@beta`, et les autres paquets (`@nodefony/http`,
33
+ > application le reçoit par `npm create nodefony`, et les autres paquets (`@nodefony/http`,
34
34
  > `@nodefony/framework`, `@nodefony/security`…) le déclarent en dépendance de pair.
35
35
 
36
36
  ```bash
37
- npm install nodefony@beta
37
+ npm install nodefony
38
38
  ```
39
39
 
40
- > Le dist-tag est OBLIGATOIRE tant que la série 10 est en préversion : `latest` sert encore la
41
- > `7.0.2`, écrite en JavaScript, dont l'API n'a aucun rapport avec ce qui suit.
40
+ > La série 7, écrite en JavaScript, n'a aucun rapport d'API avec ce qui suit.
42
41
 
43
42
  ---
44
43
 
@@ -74,7 +73,7 @@ documentés, pas encore générés — [Docker et cloud](https://nodefony.net/do
74
73
  <div align="center">
75
74
 
76
75
  ```bash
77
- npm create nodefony@beta mon-app
76
+ npm create nodefony mon-app
78
77
  ```
79
78
 
80
79
  </div>
@@ -269,7 +268,7 @@ sur invitation, sonde industrielle, tableau de bord partagé, notification priv
269
268
 
270
269
  JSON reste le format par défaut. Dès que des octets circulent — image, son, mesures de capteur,
271
270
  état d'une partie —, le serveur accepte **CBOR**, un JSON binaire. Nodefony embarque son propre
272
- codec : isomorphe, sans dépendance, environ 5,5 Ko compressés, et téléchargé seulement par la page
271
+ codec : isomorphe, sans dépendance, environ 6 Ko compressés, et téléchargé seulement par la page
273
272
  qui l'importe. Il rend exactement ce que JSON rendrait, à une exception près : un `Uint8Array`
274
273
  voyage en octets et revient en `Uint8Array`. Un message ordinaire pèse 30 à 45 % de moins, et 64 Ko
275
274
  d'octets en occupent 65,6 au lieu des 87,4 du base64.
@@ -370,21 +369,15 @@ appeler.
370
369
 
371
370
  ## Démarrage
372
371
 
373
- Une préversion `10.0.0-beta.9` est en ligne sous le canal `beta`. Une bêta n'est pas une version
374
- stable : une rupture reste possible d'une bêta à la suivante — chacune est alors annoncée en tête
375
- du [CHANGELOG](https://github.com/nodefony/nodefony-core/blob/main/CHANGELOG.md) — et elle n'est pas destinée à la production. Elle s'installe en
376
- nommant ce canal :
372
+ La version `10.0.0` est en ligne. Les ruptures n'arrivent qu'aux versions majeures, annoncées en
373
+ tête du [CHANGELOG](https://github.com/nodefony/nodefony-core/blob/main/CHANGELOG.md). Une application se crée en une commande :
377
374
 
378
375
  ```bash
379
- npm create nodefony@beta mon-app
376
+ npm create nodefony mon-app
380
377
  cd mon-app
381
378
  npm run dev
382
379
  ```
383
380
 
384
- Le canal se nomme tant que la 10 n'est pas stable : c'est lui qui garantit de recevoir la
385
- préversion, et non la `7.0.2` que `npm install nodefony` sert encore — la version JavaScript
386
- d'avant, sans rapport avec ce que cette page décrit.
387
-
388
381
  L'application répond sur `http://127.0.0.1:5151` — ou le premier port libre, annoncé au
389
382
  démarrage — et la console d'administration sur `/nodefony`.
390
383
 
@@ -2849,7 +2849,7 @@ function detectEnvironmentFromArgv(argv) {
2849
2849
  }
2850
2850
  }
2851
2851
  // package.json
2852
- var version = "10.0.0-beta.9";
2852
+ var version = "10.0.0";
2853
2853
  // src/bin/nodefony.ts
2854
2854
  /**
2855
2855
  * Résout le **mode runtime** (dev/prod) AVANT le kernel : `NODE_ENV` (ambiant)
@@ -1,9 +1,9 @@
1
+ import { DestroyRef, InjectionToken, NgZone, assertInInjectionContext, effect, inject, makeEnvironmentProviders, signal, untracked } from "@angular/core";
1
2
  import { EMPTY_PRESENCE } from "../../realtime/presenceView.js";
2
3
  import { adaptiveRebindKey, connectShared, observeChannel, observeChannelStats, observeIdentity, observeKernelIdentity, observeKernelState, observeNoticeLog, observeNotices, observePresence, observeSnapshot, observeState, observeSyslog, requireChannelHandler } from "../realtime/observe.js";
3
4
  import { initialSseSnapshot, observeSse } from "../sse/observe.js";
4
5
  import { NodefonyLogin, observeLogin } from "../auth/NodefonyLogin.js";
5
6
  import { isRateChannel, parseRate, rateChannel } from "../../realtime/channelRate.js";
6
- import { DestroyRef, InjectionToken, NgZone, assertInInjectionContext, effect, inject, makeEnvironmentProviders, signal, untracked } from "@angular/core";
7
7
  // src/client/angular/index.ts
8
8
  /**
9
9
  * `nodefony/angular` — liaisons **Angular** du client temps réel isomorphe.
@@ -1,8 +1,8 @@
1
+ import * as React from "react";
1
2
  import { adaptiveRebindKey, connectShared, observeChannel, observeChannelStats, observeIdentity, observeKernelIdentity, observeKernelState, observeNoticeLog, observeNotices, observePresence, observeSnapshot, observeState, observeSyslog, requireChannelHandler } from "../realtime/observe.js";
2
3
  import { NodefonyLogin } from "../auth/NodefonyLogin.js";
3
4
  import { initialSseSnapshot, observeSse, sseRebindKey } from "../sse/observe.js";
4
5
  import { isRateChannel, parseRate, rateChannel } from "../../realtime/channelRate.js";
5
- import * as React from "react";
6
6
  // src/client/react/index.ts
7
7
  /**
8
8
  * `nodefony/react` — bindings React **fins** du client temps réel isomorphe.
@@ -29,7 +29,7 @@ const DEFAULT_RETRY_MS = 3e3;
29
29
  * celui de `setTimeout`, au-delà duquel Node ramène le délai à 1 ms.
30
30
  */
31
31
  const MIN_RETRY_MS = 250;
32
- const MAX_RETRY_MS = 2147483647;
32
+ const MAX_RETRY_MS = 0x7fffffff;
33
33
  /** Délai d'ouverture par défaut (ms) — cf {@link NodefonySseOptions.connectTimeout}. */
34
34
  const DEFAULT_CONNECT_TIMEOUT_MS = 1e4;
35
35
  /** Délai de reconnexion ramené dans ses bornes. */
@@ -1,9 +1,9 @@
1
+ import { createSubscriber } from "svelte/reactivity";
1
2
  import { EMPTY_PRESENCE } from "../../realtime/presenceView.js";
2
3
  import { adaptiveRebindKey, connectShared, observeChannel, observeChannelStats, observeIdentity, observeKernelIdentity, observeKernelState, observeNoticeLog, observeNotices, observePresence, observeSnapshot, observeState, observeSyslog, requireChannelHandler } from "../realtime/observe.js";
3
4
  import { initialSseSnapshot, observeSse } from "../sse/observe.js";
4
5
  import { NodefonyLogin, observeLogin } from "../auth/NodefonyLogin.js";
5
6
  import { isRateChannel, parseRate, rateChannel } from "../../realtime/channelRate.js";
6
- import { createSubscriber } from "svelte/reactivity";
7
7
  // src/client/svelte/index.ts
8
8
  /**
9
9
  * `nodefony/svelte` — liaisons **Svelte 5** du client temps réel isomorphe.
@@ -1,9 +1,9 @@
1
+ import { getCurrentScope, inject, isRef, markRaw, onScopeDispose, shallowRef, toValue, watch } from "vue";
1
2
  import { EMPTY_PRESENCE } from "../../realtime/presenceView.js";
2
3
  import { adaptiveRebindKey, connectShared, observeChannel, observeChannelStats, observeIdentity, observeKernelIdentity, observeKernelState, observeNoticeLog, observeNotices, observePresence, observeSnapshot, observeState, observeSyslog, requireChannelHandler } from "../realtime/observe.js";
3
4
  import { initialSseSnapshot, observeSse } from "../sse/observe.js";
4
5
  import { NodefonyLogin, observeLogin } from "../auth/NodefonyLogin.js";
5
6
  import { isRateChannel, parseRate, rateChannel } from "../../realtime/channelRate.js";
6
- import { getCurrentScope, inject, isRef, markRaw, onScopeDispose, shallowRef, toValue, watch } from "vue";
7
7
  // src/client/vue/index.ts
8
8
  /**
9
9
  * `nodefony/vue` — liaisons **Vue 3** du client temps réel isomorphe.
@@ -623,7 +623,7 @@ function fromBase64Url(text) {
623
623
  const code = text.charCodeAt(i);
624
624
  const v = code < 128 ? DECODE_TABLE[code] ?? -1 : -1;
625
625
  if (v < 0) throw invalid(i);
626
- acc = (acc << 6 | v) & 16777215;
626
+ acc = (acc << 6 | v) & 0xffffff;
627
627
  bits += 6;
628
628
  if (bits >= 8) {
629
629
  bits -= 8;
@@ -65,7 +65,7 @@ function fromBase64Url(text) {
65
65
  const code = text.charCodeAt(i);
66
66
  const v = code < 128 ? DECODE_TABLE[code] ?? -1 : -1;
67
67
  if (v < 0) throw invalid(i);
68
- acc = (acc << 6 | v) & 16777215;
68
+ acc = (acc << 6 | v) & 0xffffff;
69
69
  bits += 6;
70
70
  if (bits >= 8) {
71
71
  bits -= 8;
@@ -212,7 +212,7 @@ function readNegative(ai, at) {
212
212
  const lo = u32(p + 4);
213
213
  p += 8;
214
214
  if (hi < 2097152) return -1 - (hi * 4294967296 + lo);
215
- return lo === 4294967295 ? -((hi + 1) * 4294967296) : -(hi * 4294967296 + (lo + 1));
215
+ return lo === 0xffffffff ? -((hi + 1) * 4294967296) : -(hi * 4294967296 + (lo + 1));
216
216
  }
217
217
  /** Longueur annoncée d'une chaîne, d'un tableau ou d'une map (ai < 31) ; une longueur ≥ 2^32 est refusée d'emblée. */
218
218
  function readLength(ai, at) {
@@ -40,7 +40,7 @@ const ARENA_RETAIN_MAX_BYTES = ARENA_BYTES * 4;
40
40
  const DIRECT_COPY_MIN_BYTES = VIEW_MAX_BYTES;
41
41
  /** Au-delà de cette longueur (en caractères), une chaîne passe par `TextEncoder.encodeInto`. */
42
42
  const INLINE_TEXT_MAX_CHARS = 64;
43
- const MAX_SAFE_INTEGER = 9007199254740991;
43
+ const MAX_SAFE_INTEGER = 0x1fffffffffffff;
44
44
  const utf8 = new TextEncoder();
45
45
  let scratch = /* @__PURE__ */ new Uint8Array(0);
46
46
  let view = new DataView(scratch.buffer);
@@ -283,8 +283,7 @@ function writeObject(o) {
283
283
  if (!isKeyed(o)) return;
284
284
  enter(o);
285
285
  const keys = Object.keys(o);
286
- const candidates = keys.length;
287
- const reserved = headSize(candidates);
286
+ const reserved = headSize(keys.length);
288
287
  ensure(reserved);
289
288
  const startOffset = pos - base;
290
289
  pos += reserved;
@@ -363,7 +362,7 @@ function writeHead(major, n) {
363
362
  * → `null` (comme JSON) ; sinon le flottant le plus court qui conserve la valeur.
364
363
  */
365
364
  function writeNumber(v) {
366
- if (Number.isInteger(v) && v >= -9007199254740991 && v <= MAX_SAFE_INTEGER) {
365
+ if (Number.isInteger(v) && v >= -0x1fffffffffffff && v <= MAX_SAFE_INTEGER) {
367
366
  if (v >= 0) writeHead(0, v);
368
367
  else writeHead(1, -1 - v);
369
368
  return;
@@ -34,7 +34,7 @@ function isThroughputPayloadSize(value) {
34
34
  * @param seed - graine non nulle ; même graine → mêmes octets.
35
35
  * @returns un tampon neuf de `size` octets.
36
36
  */
37
- function createThroughputPayload(size, seed = 2654435769) {
37
+ function createThroughputPayload(size, seed = 0x9e3779b9) {
38
38
  const bytes = new Uint8Array(size);
39
39
  const words = new Uint32Array(bytes.buffer, 0, size >>> 2);
40
40
  let x = seed >>> 0 || 1;
package/dist/node/Cli.js CHANGED
@@ -1,3 +1,9 @@
1
+ import path from "node:path";
2
+ import fs from "node:fs";
3
+ import { Command } from "commander";
4
+ import { spawn, spawnSync } from "node:child_process";
5
+ import semver from "semver";
6
+ import Table from "cli-table3";
1
7
  import clc from "./colors.js";
2
8
  import Service from "./Service.js";
3
9
  import { DEFAULT_ENGINE_ENVIRONMENT, defaultEngineEnvironment } from "./runtime/engineEnvironment.js";
@@ -8,12 +14,6 @@ import Event from "./Event.js";
8
14
  import Syslog from "./syslog/Syslog.js";
9
15
  import { portableSpawn } from "./cli/execPortable.js";
10
16
  import { onTerminalResize } from "./runtime/isTerminal.js";
11
- import fs from "node:fs";
12
- import path from "node:path";
13
- import { Command } from "commander";
14
- import { spawn, spawnSync } from "node:child_process";
15
- import semver from "semver";
16
- import Table from "cli-table3";
17
17
  // src/Cli.ts
18
18
  let figletModule = null;
19
19
  /**
@@ -1,10 +1,10 @@
1
1
  import { constructorName } from "./runtime/constructorName.js";
2
+ import assert from "node:assert";
2
3
  import { Nodefony } from "./Nodefony.js";
3
4
  import { typeOf } from "./Tools.js";
4
- import clc from "./colors.js";
5
- import { inspect } from "node:util";
6
- import assert from "node:assert";
7
5
  import { STATUS_CODES } from "node:http";
6
+ import { inspect } from "node:util";
7
+ import clc from "./colors.js";
8
8
  // src/Error.ts
9
9
  Object.defineProperty(Error.prototype, "toJSON", {
10
10
  configurable: true,
@@ -1,5 +1,5 @@
1
- import { unrefTimer } from "./runtime/unrefTimer.js";
2
1
  import { EventEmitter } from "node:events";
2
+ import { unrefTimer } from "./runtime/unrefTimer.js";
3
3
  // src/Event.ts
4
4
  const regListenOn = /^on(.*)$/;
5
5
  /**
@@ -1,9 +1,9 @@
1
- import { extend } from "./Tools.js";
1
+ import mime from "mime-types";
2
2
  import crypto from "node:crypto";
3
- import fs from "node:fs";
4
3
  import path from "node:path";
5
- import mime from "mime-types";
4
+ import fs from "node:fs";
6
5
  import fsp from "node:fs/promises";
6
+ import { extend } from "./Tools.js";
7
7
  // src/FileClass.ts
8
8
  const checkPath = function(myPath) {
9
9
  if (!myPath) throw new Error(`Bad path`);
@@ -1,6 +1,6 @@
1
1
  import { version } from "./package.json.js";
2
- import { registerPackageInstance } from "./runtime/packageInstances.js";
3
2
  import { randomUUID, randomUUIDv7 } from "node:crypto";
3
+ import { registerPackageInstance } from "./runtime/packageInstances.js";
4
4
  // src/Nodefony.ts
5
5
  registerPackageInstance(import.meta.url, version);
6
6
  /**
@@ -1,7 +1,7 @@
1
- import { buildReportDevtools } from "./buildReport.js";
2
1
  import { globSync, readFileSync } from "node:fs";
3
2
  import path from "node:path";
4
3
  import { defineConfig } from "rolldown";
4
+ import { buildReportDevtools } from "./buildReport.js";
5
5
  // src/bundler/index.ts
6
6
  /**
7
7
  * nodefony/bundler — config rolldown partagée des packages ET des applications Nodefony.
@@ -1,7 +1,7 @@
1
+ import path from "node:path";
2
+ import { homedir } from "node:os";
1
3
  import { MCP_CONFIG_FILE, MCP_SERVER_KEY, MCP_TOKEN_ENV } from "./aiMcpReport.js";
2
4
  import { isPlainObject } from "../runtime/isPlainObject.js";
3
- import { homedir } from "node:os";
4
- import path from "node:path";
5
5
  // src/cli/agentTargets.ts
6
6
  /**
7
7
  * Les agents de développement, et ce que Nodefony sait faire pour eux.
@@ -1,3 +1,5 @@
1
+ import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
2
+ import path from "node:path";
1
3
  import { printUsage, printUsageError } from "./usageReport.js";
2
4
  import { writeAgentPointers } from "./scaffold/engine.js";
3
5
  import "./sysexits.js";
@@ -11,8 +13,6 @@ import { AGENT_TARGETS, agentRoot, agentsPresents, litVariable, planAgentDeclara
11
13
  import { spawnedOutput } from "../runtime/spawnedOutput.js";
12
14
  import { isTerminal } from "../runtime/isTerminal.js";
13
15
  import { stripTrailingSlashes } from "../Tools.js";
14
- import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
15
- import path from "node:path";
16
16
  // src/cli/aiMcp.ts
17
17
  /**
18
18
  * `nodefony ai:mcp` — déclare le serveur MCP de cette application à ton agent.
@@ -1,11 +1,11 @@
1
+ import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
2
+ import path from "node:path";
1
3
  import { printUsage, printUsageError } from "./usageReport.js";
2
4
  import "./sysexits.js";
3
5
  import { findProjectRoot } from "./projectRoot.js";
4
6
  import { installedPackageRoots, listDir } from "./installedPackages.js";
5
7
  import { SKILLS_DIR, planSync, renderPlan } from "./aiSyncReport.js";
6
8
  import { stripGlobalCliFlags } from "./globalFlags.js";
7
- import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
8
- import path from "node:path";
9
9
  // src/cli/aiSync.ts
10
10
  /** La page d'aide — `nodefony ai:sync --help`, et le rappel après un refus. */
11
11
  const AI_SYNC_USAGE = {
@@ -1,10 +1,10 @@
1
+ import { readFileSync, readdirSync } from "node:fs";
2
+ import path from "node:path";
1
3
  import "./sysexits.js";
2
4
  import { findProjectRoot } from "./projectRoot.js";
3
5
  import { printUsage, printUsageError } from "./usageReport.js";
4
6
  import { stripGlobalCliFlags } from "./globalFlags.js";
5
7
  import { buildCard, renderCard } from "./cardReport.js";
6
- import { readFileSync, readdirSync } from "node:fs";
7
- import path from "node:path";
8
8
  // src/cli/card.ts
9
9
  /**
10
10
  * `nodefony card [--json]` — qui répond, et où aller ensuite.
@@ -1,5 +1,5 @@
1
- import { RESERVED_ENV } from "../config/reservedEnv.js";
2
1
  import semver from "semver";
2
+ import { RESERVED_ENV } from "../config/reservedEnv.js";
3
3
  // src/cli/cliFreshness.ts
4
4
  /** Délai maximal accordé au registre : au-delà, on se tait. */
5
5
  const FRESHNESS_TIMEOUT_MS = 1500;
@@ -1,11 +1,11 @@
1
+ import { rename, writeFile } from "node:fs/promises";
2
+ import { mkdirSync, readFileSync, readdirSync, rmSync, writeFileSync, writeSync } from "node:fs";
3
+ import os from "node:os";
4
+ import path from "node:path";
1
5
  import "./sysexits.js";
2
6
  import { printUsage, printUsageError } from "./usageReport.js";
3
7
  import { OPTION_SUGGESTIONS } from "../command/Command.js";
4
8
  import { stripGlobalCliFlags } from "./globalFlags.js";
5
- import { mkdirSync, readFileSync, readdirSync, rmSync, writeFileSync, writeSync } from "node:fs";
6
- import os from "node:os";
7
- import path from "node:path";
8
- import { rename, writeFile } from "node:fs/promises";
9
9
  // src/cli/completion.ts
10
10
  /** Chemin du manifest cache — même dossier que le pidfile superviseur. */
11
11
  function cliManifestFile(cwd) {
@@ -1,4 +1,8 @@
1
1
  import { isPlainObject } from "../runtime/isPlainObject.js";
2
+ import { existsSync, mkdirSync, readFileSync, readdirSync, writeFileSync } from "node:fs";
3
+ import { createHash } from "node:crypto";
4
+ import path from "node:path";
5
+ import { pathToFileURL } from "node:url";
2
6
  import { printUsage, printUsageError } from "./usageReport.js";
3
7
  import "./sysexits.js";
4
8
  import { findProjectRoot } from "./projectRoot.js";
@@ -7,10 +11,6 @@ import { stripGlobalCliFlags } from "./globalFlags.js";
7
11
  import "../Tools.js";
8
12
  import { CONTRIBUTE_FIELD, declaredPackageEntry, resolveInside } from "./packageManifest.js";
9
13
  import { manifestString, parsePackageManifest } from "./scaffold/packageManifest.js";
10
- import { createHash } from "node:crypto";
11
- import { existsSync, mkdirSync, readFileSync, readdirSync, writeFileSync } from "node:fs";
12
- import path from "node:path";
13
- import { pathToFileURL } from "node:url";
14
14
  // src/cli/contributions.ts
15
15
  /** Le nom du registre de provenance, à la racine de l'application. */
16
16
  const SCAFFOLD_LOCK_FILE = "scaffold.lock.json";
@@ -227,8 +227,7 @@ async function runAppContributions(appRoot, dryRun = false, update = false) {
227
227
  const entry = resolveInside(pkg.dir, declared.replace(/^\.\//u, ""));
228
228
  const loaded = await import(pathToFileURL(entry).href);
229
229
  if (typeof loaded.contribute !== "function") throw new Error(`${declared} n'exporte pas de fonction « contribute »`);
230
- const contribute = loaded.contribute;
231
- await contribute(run.context);
230
+ await (0, loaded.contribute)(run.context);
232
231
  } catch (e) {
233
232
  error = e instanceof Error ? e.message : String(e);
234
233
  }
@@ -1,5 +1,8 @@
1
+ import path from "node:path";
1
2
  import { printUsage, printUsageError } from "./usageReport.js";
2
3
  import { usageCatalog, usagePageFor } from "./scaffold/help.js";
4
+ import { existsSync, readFileSync, readdirSync, writeFileSync } from "node:fs";
5
+ import { spawnSync } from "node:child_process";
3
6
  import { portableSpawn } from "./execPortable.js";
4
7
  import { envForOtherProject } from "../runtime/loadEnv.js";
5
8
  import { isPackageManagerName, packageManagerCommandLines, packageManagerExecArgs, packageManagerUpdateInstallArgs, resolvePackageManager } from "./packageManager.js";
@@ -28,9 +31,6 @@ import { reportIsClear } from "../kernel/checks/renderReport.js";
28
31
  import { isTerminal } from "../runtime/isTerminal.js";
29
32
  import { spawnedOutput } from "../runtime/spawnedOutput.js";
30
33
  import { isolatedGitEnv } from "./gitEnv.js";
31
- import { existsSync, readFileSync, readdirSync, writeFileSync } from "node:fs";
32
- import path from "node:path";
33
- import { spawnSync } from "node:child_process";
34
34
  // src/cli/create.ts
35
35
  /**
36
36
  * Adaptateur CLI du scaffold `nodefony create <type> [name]` — front n°1 et n°2
@@ -1342,8 +1342,7 @@ async function runCreateCommand(argv) {
1342
1342
  } else if (migration !== void 0 && parsed.install && parsed.migrate && depsInstall !== "failed") {
1343
1343
  const root = findProjectRoot(process.cwd());
1344
1344
  if (root !== null) {
1345
- const pm = resolvePackageManager({ dir: root }).name;
1346
- const step = runEntityMigration(root, pm, migration);
1345
+ const step = runEntityMigration(root, resolvePackageManager({ dir: root }).name, migration);
1347
1346
  migrationStep = step.outcome;
1348
1347
  migrationLine = `\n🗄️ migration : ${step.note}\n`;
1349
1348
  if (step.reached === "written") silenced = [migration.advice.command];
@@ -1,4 +1,8 @@
1
+ import { existsSync, readFileSync, writeFileSync } from "node:fs";
2
+ import { parseEnv } from "node:util";
3
+ import path from "node:path";
1
4
  import { printUsage, printUsageError } from "./usageReport.js";
5
+ import { pathToFileURL } from "node:url";
2
6
  import "./sysexits.js";
3
7
  import { findProjectRoot } from "./projectRoot.js";
4
8
  import { appEnvironment, configInconsistencies } from "../kernel/checks/projectScope.js";
@@ -16,10 +20,6 @@ import { renderEnvReport } from "./envRender.js";
16
20
  import { isTerminal } from "../runtime/isTerminal.js";
17
21
  import { shouldColorize, usableWidth } from "../kernel/checks/report.js";
18
22
  import { buildEnvReport } from "./envReport.js";
19
- import { parseEnv } from "node:util";
20
- import { existsSync, readFileSync, writeFileSync } from "node:fs";
21
- import path from "node:path";
22
- import { pathToFileURL } from "node:url";
23
23
  // src/cli/env.ts
24
24
  /** Parse l'argv après le mot `env`. */
25
25
  function parseEnvArgv(argv) {
@@ -1,12 +1,12 @@
1
+ import { chmodSync, mkdirSync, readFileSync, realpathSync, writeFileSync } from "node:fs";
2
+ import { execFileSync } from "node:child_process";
3
+ import path from "node:path";
1
4
  import { printUsage, printUsageError } from "./usageReport.js";
2
5
  import "./sysexits.js";
3
6
  import { isolatedGitEnv } from "./gitEnv.js";
4
7
  import { findProjectRoot } from "./projectRoot.js";
5
8
  import { stripGlobalCliFlags } from "./globalFlags.js";
6
9
  import { GIT_HOOKS_DIR, planGitHooks, renderGitHooksPlan } from "./gitHooksReport.js";
7
- import { chmodSync, mkdirSync, readFileSync, realpathSync, writeFileSync } from "node:fs";
8
- import path from "node:path";
9
- import { execFileSync } from "node:child_process";
10
10
  // src/cli/gitHooks.ts
11
11
  /** La page d'aide — `nodefony git:hooks --help`, et le rappel après un refus. */
12
12
  const GIT_HOOKS_USAGE = {
@@ -1,9 +1,9 @@
1
+ import fs from "node:fs";
1
2
  import "../sysexits.js";
2
3
  import { stripGlobalCliFlags } from "../globalFlags.js";
3
4
  import { printUsage, printUsageError } from "../usageReport.js";
4
5
  import { detectSuspectImageFiles } from "./suspectFiles.js";
5
6
  import { BlindCheckError, imageContents, saveImage } from "./tarLayers.js";
6
- import fs from "node:fs";
7
7
  // src/cli/image/index.ts
8
8
  /**
9
9
  * **`nodefony image:check` — refuser une image de conteneur qui embarque un
@@ -1,8 +1,8 @@
1
1
  import fs from "node:fs";
2
2
  import os from "node:os";
3
3
  import path from "node:path";
4
- import { spawnSync } from "node:child_process";
5
4
  import zlib from "node:zlib";
5
+ import { spawnSync } from "node:child_process";
6
6
  // src/cli/image/tarLayers.ts
7
7
  /**
8
8
  * **Lire les COUCHES d'une image de conteneur** — pas son arborescence finale.
@@ -58,6 +58,19 @@ function npmChannelOf(version) {
58
58
  return dot === -1 ? prerelease : prerelease.slice(0, dot);
59
59
  }
60
60
  /**
61
+ * Spécificateur npm d'un paquet du framework pour la version donnée, canal
62
+ * NOMMÉ tant que c'est une préversion (`@nodefony/http@beta`), nu pour une
63
+ * stable — `latest` est alors la ligne de cette version.
64
+ *
65
+ * @param name - nom npm du paquet (`nodefony`, `@nodefony/http`…)
66
+ * @param version - version du framework ; défaut : celle du paquet qui tourne
67
+ * @returns le spécificateur, prêt à écrire dans une commande
68
+ */
69
+ function packageSpec(name, version$1 = version) {
70
+ const channel = npmChannelOf(version$1);
71
+ return channel === null || channel === "latest" ? name : `${name}@${channel}`;
72
+ }
73
+ /**
61
74
  * Commande qui crée une application de la version donnée, canal NOMMÉ tant que
62
75
  * c'est une préversion : `npm create nodefony@beta mon-app`. Une stable
63
76
  * s'écrit sans canal, `latest` étant alors la ligne de cette version.
@@ -66,9 +79,8 @@ function npmChannelOf(version) {
66
79
  * @param version - version du framework ; défaut : celle du paquet qui tourne
67
80
  * @returns la commande, prête à copier
68
81
  */
69
- function createAppCommand(appName, version$1 = version) {
70
- const channel = npmChannelOf(version$1);
71
- const spec = channel === null || channel === "latest" ? "nodefony" : `nodefony@${channel}`;
82
+ function createAppCommand(appName, version$2 = version) {
83
+ const spec = packageSpec("nodefony", version$2);
72
84
  return appName === "" ? `npm create ${spec}` : `npm create ${spec} ${appName}`;
73
85
  }
74
- export { NODE_ENGINE_LABEL, NODE_ENGINE_RANGE, createAppCommand, describeNodeRange, npmChannelOf };
86
+ export { NODE_ENGINE_LABEL, NODE_ENGINE_RANGE, createAppCommand, describeNodeRange, npmChannelOf, packageSpec };
@@ -1,7 +1,7 @@
1
- import { isPlainObject } from "../runtime/isPlainObject.js";
2
- import { manifestString, parsePackageManifest } from "./scaffold/packageManifest.js";
3
1
  import { readFileSync, readdirSync } from "node:fs";
4
2
  import path from "node:path";
3
+ import { isPlainObject } from "../runtime/isPlainObject.js";
4
+ import { manifestString, parsePackageManifest } from "./scaffold/packageManifest.js";
5
5
  // src/cli/installedPackages.ts
6
6
  /**
7
7
  * Les paquets que CE projet produit lui-même — ses espaces de travail.
@@ -1,9 +1,9 @@
1
+ import { spawnSync } from "node:child_process";
2
+ import fs from "node:fs";
3
+ import path from "node:path";
1
4
  import { portableSpawn } from "./execPortable.js";
2
5
  import { spawnedOutput } from "../runtime/spawnedOutput.js";
3
6
  import { isPlainObject } from "../runtime/isPlainObject.js";
4
- import fs from "node:fs";
5
- import path from "node:path";
6
- import { spawnSync } from "node:child_process";
7
7
  // src/cli/licenses.ts
8
8
  /**
9
9
  * Le relevé des licences d'un arbre de production — et la décision de ce qui est acceptable.
@@ -1,9 +1,9 @@
1
+ import path from "node:path";
2
+ import { spawnSync } from "node:child_process";
1
3
  import { printUsage, printUsageError } from "./usageReport.js";
2
4
  import "./sysexits.js";
3
5
  import { stripGlobalCliFlags } from "./globalFlags.js";
4
6
  import { findPackageRoot } from "./scaffold/engine.js";
5
- import path from "node:path";
6
- import { spawnSync } from "node:child_process";
7
7
  // src/cli/man.ts
8
8
  /** La page d'aide — `nodefony man --help`, et le rappel après un refus. */
9
9
  const MAN_USAGE = {