humalis 0.0.0-stage → 1.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 (123) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +15 -0
  3. package/README.en.md +148 -0
  4. package/README.md +145 -2
  5. package/dist/analyse/accessibilite.js +119 -0
  6. package/dist/analyse/analyse.js +2175 -0
  7. package/dist/analyse/carte.js +153 -0
  8. package/dist/analyse/couleurs.js +39 -0
  9. package/dist/analyse/diagnosticsQualite.js +21 -0
  10. package/dist/analyse/ecran.js +154 -0
  11. package/dist/analyse/elements.js +132 -0
  12. package/dist/analyse/erreurs.js +9 -0
  13. package/dist/analyse/fichiers.js +142 -0
  14. package/dist/analyse/interactions.js +351 -0
  15. package/dist/analyse/langues.js +321 -0
  16. package/dist/analyse/medias.js +294 -0
  17. package/dist/analyse/navigation.js +231 -0
  18. package/dist/analyse/noms.js +48 -0
  19. package/dist/analyse/portees.js +35 -0
  20. package/dist/analyse/serveur.js +83 -0
  21. package/dist/analyse/site.js +77 -0
  22. package/dist/analyse/sources.js +220 -0
  23. package/dist/analyse/styles.js +87 -0
  24. package/dist/analyse/suggestions.js +35 -0
  25. package/dist/analyse/types.js +58 -0
  26. package/dist/cibles/binaire.js +14 -0
  27. package/dist/cibles/commun/graphique/geometrie.js +339 -0
  28. package/dist/cibles/commun/mouvement.js +156 -0
  29. package/dist/cibles/desktop/projet.js +611 -0
  30. package/dist/cibles/format.js +304 -0
  31. package/dist/cibles/icones-donnees.js +115 -0
  32. package/dist/cibles/mobile/carte.js +79 -0
  33. package/dist/cibles/mobile/composants-ecran.js +110 -0
  34. package/dist/cibles/mobile/projet.js +1055 -0
  35. package/dist/cibles/mobile/rendu.js +217 -0
  36. package/dist/cibles/mobile/widgets.js +443 -0
  37. package/dist/cibles/publication.js +67 -0
  38. package/dist/cibles/serveur/projet.js +635 -0
  39. package/dist/cibles/sources.js +66 -0
  40. package/dist/cibles/statique/disposition.js +59 -0
  41. package/dist/cibles/statique/elements-js.js +243 -0
  42. package/dist/cibles/statique/graphique.js +99 -0
  43. package/dist/cibles/statique/html-elements.js +28 -0
  44. package/dist/cibles/statique/html.js +21 -0
  45. package/dist/cibles/statique/leaflet-donnees.js +14 -0
  46. package/dist/cibles/statique/page.js +1600 -0
  47. package/dist/cibles/statique/projet.js +1125 -0
  48. package/dist/cibles/statique/qrcode-donnees.js +9 -0
  49. package/dist/cibles/statique/valeurs.js +544 -0
  50. package/dist/cibles/statique/widgets.js +124 -0
  51. package/dist/cibles/web/carte.js +162 -0
  52. package/dist/cibles/web/css-ecran.js +112 -0
  53. package/dist/cibles/web/css-elements.js +91 -0
  54. package/dist/cibles/web/ecran.js +1995 -0
  55. package/dist/cibles/web/ecrivain.js +24 -0
  56. package/dist/cibles/web/fichiers.js +262 -0
  57. package/dist/cibles/web/graphique.js +300 -0
  58. package/dist/cibles/web/interactions.js +1043 -0
  59. package/dist/cibles/web/langue.js +164 -0
  60. package/dist/cibles/web/noms.js +37 -0
  61. package/dist/cibles/web/projet.js +1409 -0
  62. package/dist/cibles/web/sources.js +245 -0
  63. package/dist/cibles/web/styles.js +17 -0
  64. package/dist/cibles/web/theme.js +124 -0
  65. package/dist/cibles/web/valeurs.js +359 -0
  66. package/dist/cibles/web/widgets.js +382 -0
  67. package/dist/cli.js +590 -0
  68. package/dist/compilateur.js +12 -0
  69. package/dist/donnees/csv.js +95 -0
  70. package/dist/donnees/json.js +38 -0
  71. package/dist/fichiers.js +329 -0
  72. package/dist/i18n/langues.js +19 -0
  73. package/dist/i18n/messages.js +374 -0
  74. package/dist/image/entete.js +2 -0
  75. package/dist/lexer/lexer.js +281 -0
  76. package/dist/lexer/motsCles.js +64 -0
  77. package/dist/lexer/types.js +10 -0
  78. package/dist/medias/entetes-image.js +148 -0
  79. package/dist/outils/developpement.js +98 -0
  80. package/dist/outils/ecriture.js +20 -0
  81. package/dist/outils/formatage.js +61 -0
  82. package/dist/outils/nouveau.js +21 -0
  83. package/dist/outils/rapport-tests.js +48 -0
  84. package/dist/outils/tests-web.js +62 -0
  85. package/dist/outils/tests.js +97 -0
  86. package/dist/packs.js +83 -0
  87. package/dist/parser/ast.js +1 -0
  88. package/dist/parser/carte.js +76 -0
  89. package/dist/parser/elements.js +43 -0
  90. package/dist/parser/erreurs.js +8 -0
  91. package/dist/parser/fichier.js +106 -0
  92. package/dist/parser/fluxTokens.js +128 -0
  93. package/dist/parser/fonctionsActions.js +88 -0
  94. package/dist/parser/interactions.js +291 -0
  95. package/dist/parser/langues.js +89 -0
  96. package/dist/parser/medias.js +188 -0
  97. package/dist/parser/miseEnPage.js +128 -0
  98. package/dist/parser/navigation.js +72 -0
  99. package/dist/parser/parser.js +1642 -0
  100. package/dist/parser/site.js +102 -0
  101. package/dist/parser/source.js +221 -0
  102. package/dist/parser/test.js +85 -0
  103. package/dist/parser/theme.js +129 -0
  104. package/dist/ri/actions.js +29 -0
  105. package/dist/ri/construire.js +929 -0
  106. package/dist/ri/graphique.js +41 -0
  107. package/dist/ri/medias.js +92 -0
  108. package/dist/ri/types.js +4 -0
  109. package/dist/vocabulaire/icones.js +165 -0
  110. package/dist/vocabulaire/normaliser.js +7 -0
  111. package/dist/vocabulaire/recherche.js +77 -0
  112. package/dist/vocabulaire/table-ecran.js +397 -0
  113. package/dist/vocabulaire/table-interactions.js +265 -0
  114. package/dist/vocabulaire/table-langues.js +114 -0
  115. package/dist/vocabulaire/table-medias.js +324 -0
  116. package/dist/vocabulaire/table.js +2352 -0
  117. package/dist/vocabulaire/types.js +4 -0
  118. package/docs/guide.en.md +1837 -0
  119. package/docs/guide.md +1707 -0
  120. package/docs/logo/humalis-logo-sombre.svg +1 -0
  121. package/docs/logo/humalis-logo.svg +1 -0
  122. package/llms.txt +449 -0
  123. package/package.json +76 -4
package/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/NOTICE ADDED
@@ -0,0 +1,15 @@
1
+ Humalis
2
+ Copyright 2026 Les auteurs de Humalis
3
+
4
+ Humalis a été créé par kongo bola emmanouch.
5
+
6
+ Ce logiciel est distribué sous la licence Apache, version 2.0 : voir le
7
+ fichier LICENSE, ou https://www.apache.org/licenses/LICENSE-2.0.
8
+
9
+ Le nom « Humalis » et son logo ne sont pas couverts par cette licence
10
+ (article 6) : ils ne peuvent pas servir à présenter un autre produit
11
+ comme étant Humalis.
12
+
13
+ Le code que Humalis produit (sites, applications, serveurs) appartient à
14
+ la personne qui l'a écrit en Humalis, sans aucune obligation envers les
15
+ auteurs de Humalis.
package/README.en.md ADDED
@@ -0,0 +1,148 @@
1
+ <p align="center">
2
+ <picture>
3
+ <source media="(prefers-color-scheme: dark)" srcset="docs/logo/humalis-logo-sombre.svg">
4
+ <img src="docs/logo/humalis-logo.svg" alt="Humalis" width="360">
5
+ </picture>
6
+ </p>
7
+
8
+ <p align="center"><a href="README.md">Français</a> · <strong>English</strong></p>
9
+
10
+ # Humalis
11
+
12
+ **One language, in French, to build a complete application**: a website, a mobile app, a desktop app and its server, all from the same file.
13
+
14
+ ```humalis
15
+ page "shop" :
16
+ titre "Our products"
17
+ variable products = ["Book", "Pen", "Notebook"]
18
+ pour chaque name dans products :
19
+ texte name
20
+ bouton "Order"
21
+ quand l'utilisateur clique sur "Order" :
22
+ afficher "Thank you for your order!"
23
+ ```
24
+
25
+ The file reads like a sentence. Humalis turns it into a real project, with readable TypeScript code you can take over by hand. Its keywords are French (`titre` = title, `bouton` = button, `quand` = when); the texts your site shows can be in any language.
26
+
27
+ ## Learn the language
28
+
29
+ The **[complete guide](docs/guide.en.md)** explains the whole language, from the first title to the server, with a checked example for every construct, and a table of the French keywords with their English meaning. It is also available in [French](docs/guide.md).
30
+
31
+ ## Install
32
+
33
+ You need [Node.js](https://nodejs.org) 24 or later.
34
+
35
+ ```sh
36
+ npm install -g humalis
37
+ ```
38
+
39
+ ## First project
40
+
41
+ ```sh
42
+ humalis nouveau my-project
43
+ cd my-project
44
+ humalis developper
45
+ ```
46
+
47
+ `humalis nouveau` ("new") creates the project; `humalis developper` ("develop") runs the site locally and recompiles it on every save.
48
+
49
+ ## One source, several targets
50
+
51
+ ```sh
52
+ humalis compile my-project.humalis --cible web --sortie my-project-web
53
+ humalis compile my-project.humalis --cible statique --sortie my-project-static
54
+ humalis compile my-project.humalis --cible mobile --sortie my-project-mobile
55
+ humalis compile my-project.humalis --cible desktop --sortie my-project-desktop
56
+ humalis compile my-project.humalis --cible serveur --sortie my-project-server # if the file has a « serveur "…" : » block
57
+ ```
58
+
59
+ `--cible` is the target, `--sortie` the output folder.
60
+
61
+ | Target | What Humalis produces |
62
+ |---|---|
63
+ | `web` | a React + Vite project, prerendered (one HTML page per address) |
64
+ | `statique` | static HTML, CSS and JavaScript pages, no build step |
65
+ | `serveur` | a Node server with the Astratra packs (login, permissions, sessions) |
66
+ | `mobile` | an Expo app (iPhone, Android) |
67
+ | `desktop` | an Electron app (Mac, Windows, Linux) |
68
+
69
+ When a construct does not exist yet on a target, the compiler says so clearly instead of producing something wrong.
70
+
71
+ ### Running each generated project
72
+
73
+ Each generated folder contains a `LISEZMOI.md` (read me) with these commands.
74
+
75
+ **Web**: a prerendered site, to put on any static host.
76
+
77
+ ```sh
78
+ cd my-project-web && npm install
79
+ npm run dev # locally
80
+ npm run build # the final site, in dist/
81
+ ```
82
+
83
+ **Static**: nothing to install. Open `index.html` in a browser, or upload the folder as it is to a host.
84
+
85
+ **Mobile**: you need [Expo Go](https://expo.dev/go) on the phone, or the iPhone simulator (Xcode, on a Mac) or the Android emulator.
86
+
87
+ ```sh
88
+ cd my-project-mobile && npm install
89
+ npx expo start # then « i » for iPhone, « a » for Android, or scan the code with Expo Go
90
+ ```
91
+
92
+ **Desktop**: an Electron app, with a French menu.
93
+
94
+ ```sh
95
+ cd my-project-desktop && npm install
96
+ npm start # opens the app
97
+ npm run paquet # the installer, in paquets/: .dmg on Mac, .exe on Windows, AppImage on Linux
98
+ ```
99
+
100
+ The installer is built on the target system (the `.dmg` on a Mac, the `.exe` on Windows). To distribute it to other people, sign it (Apple or Windows certificate): see the [electron-builder](https://www.electron.build/code-signing) documentation.
101
+
102
+ **Server**: a Node server, generated from the file's `serveur "…" :` block. Its `LISEZMOI.md` lists the routes and who may do what.
103
+
104
+ ```sh
105
+ cd my-project-server && npm install
106
+ cp .env.exemple .env # then fill in JWT_SECRET and the administrator
107
+ npm test # checks every access rule
108
+ npm run build && npm start
109
+ ```
110
+
111
+ Without `DATABASE_URL`, data stays in memory; with it, data goes to PostgreSQL.
112
+
113
+ ## What the language can do
114
+
115
+ - **Pages and elements**: titles, text, images, buttons, links, forms, icons, tabs, carousel, charts, maps, sound.
116
+ - **Layout**: sections, rows, columns, grids, shared header and footer, content per device (`sur telephone :`).
117
+ - **Look**: a theme (colours, fonts, dark mode), named styles (`avec couleur bleu`), and your own CSS.
118
+ - **Logic**: variables, conditions (`si … et …`, `n'est pas`), loops, functions, lists (`trier`, `dont`, `grouper`), dates (`aujourd'hui plus 3 jours`), money (`{price en euros}`).
119
+ - **Data**: a server in the same file, or an existing API (`source "…"`), with loading and error states.
120
+ - **Interactions**: messages, dialogs and confirmations, keyboard shortcuts, search as you type, copy and share.
121
+ - **Quality**: accessibility checked at compile time, several languages (`titre "Welcome" en francais "Bienvenue"`), share previews and the sitemap.
122
+
123
+ Error messages are in French, with the line number, and often suggest the fix:
124
+
125
+ ```
126
+ Erreur, ligne 3 : le texte utilise {totl}, mais la variable « totl » n'est pas déclarée. Peut-être « total » ?
127
+ ```
128
+
129
+ ## Commands
130
+
131
+ | Command | Role |
132
+ |---|---|
133
+ | `humalis nouveau <name>` | creates a project |
134
+ | `humalis developper` | runs the site and recompiles it on every save |
135
+ | `humalis compile <file> --cible …` | generates a target's project |
136
+ | `humalis verifier <file>` | shows errors and warnings |
137
+ | `humalis formater <file>` | reformats the file |
138
+ | `humalis tester` | runs the tests written in Humalis (`*.test.humalis`) in a browser |
139
+
140
+ ## For AI assistants
141
+
142
+ The [`llms.txt`](llms.txt) file, shipped with the package, sums up the grammar, the pitfalls and the error messages, so that an assistant writes correct Humalis.
143
+
144
+ ## Licence
145
+
146
+ [Apache 2.0](LICENSE). Copyright 2026 The Humalis authors ("Les auteurs de Humalis"); Humalis was created by kongo bola emmanouch (see [`NOTICE`](NOTICE)).
147
+
148
+ The code Humalis produces (sites, apps, servers) belongs to you, with no obligations. The "Humalis" name and logo are not covered by the licence.
package/README.md CHANGED
@@ -1,3 +1,146 @@
1
- # Temporary Holding Version
1
+ <p align="center">
2
+ <picture>
3
+ <source media="(prefers-color-scheme: dark)" srcset="docs/logo/humalis-logo-sombre.svg">
4
+ <img src="docs/logo/humalis-logo.svg" alt="Humalis" width="360">
5
+ </picture>
6
+ </p>
2
7
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
8
+ <p align="center"><strong>Français</strong> · <a href="README.en.md">English</a></p>
9
+
10
+ # Humalis
11
+
12
+ **Un seul langage, en français, pour créer une application complète** : un site web, une application mobile, une application de bureau et son serveur, à partir du même fichier.
13
+
14
+ ```humalis
15
+ page "boutique" :
16
+ titre "Nos produits"
17
+ variable produits = ["Livre", "Stylo", "Cahier"]
18
+ pour chaque nom dans produits :
19
+ texte nom
20
+ bouton "Commander"
21
+ quand l'utilisateur clique sur "Commander" :
22
+ afficher "Merci pour ta commande !"
23
+ ```
24
+
25
+ Ce fichier se lit comme une phrase. Humalis le transforme en un vrai projet, avec du code TypeScript lisible que l'on peut reprendre à la main.
26
+
27
+ ## Apprendre le langage
28
+
29
+ Le **[guide complet](docs/guide.md)** explique tout le langage, du premier titre jusqu'au serveur, avec un exemple vérifié pour chaque construction. Il est aussi en [anglais](docs/guide.en.md).
30
+
31
+ ## Installer
32
+
33
+ Il faut [Node.js](https://nodejs.org) 24 ou plus récent.
34
+
35
+ ```sh
36
+ npm install -g humalis
37
+ ```
38
+
39
+ ## Premier projet
40
+
41
+ ```sh
42
+ humalis nouveau mon-projet
43
+ cd mon-projet
44
+ humalis developper
45
+ ```
46
+
47
+ `humalis developper` lance le site en local et le recompile à chaque enregistrement.
48
+
49
+ ## Une source, plusieurs cibles
50
+
51
+ ```sh
52
+ humalis compile mon-projet.humalis --cible web --sortie mon-projet-web
53
+ humalis compile mon-projet.humalis --cible statique --sortie mon-projet-statique
54
+ humalis compile mon-projet.humalis --cible mobile --sortie mon-projet-mobile
55
+ humalis compile mon-projet.humalis --cible desktop --sortie mon-projet-desktop
56
+ humalis compile mon-projet.humalis --cible serveur --sortie mon-projet-serveur # si le fichier a un bloc « serveur "…" : »
57
+ ```
58
+
59
+ | Cible | Ce que Humalis produit |
60
+ |---|---|
61
+ | `web` | un projet React + Vite, prérendu (une page HTML par adresse) |
62
+ | `statique` | des pages HTML, CSS et JavaScript, sans construction |
63
+ | `serveur` | un serveur Node avec les packs Astratra (connexion, droits, sessions) |
64
+ | `mobile` | une application Expo (iPhone, Android) |
65
+ | `desktop` | une application Electron (Mac, Windows, Linux) |
66
+
67
+ Quand une construction n'existe pas encore sur une cible, le compilateur le dit clairement au lieu de produire quelque chose de faux.
68
+
69
+ ### Lancer chaque projet produit
70
+
71
+ Chaque dossier produit contient un `LISEZMOI.md` qui reprend ces commandes.
72
+
73
+ **Web** : un site prérendu, à déposer chez n'importe quel hébergeur de fichiers.
74
+
75
+ ```sh
76
+ cd mon-projet-web && npm install
77
+ npm run dev # en local
78
+ npm run build # le site final, dans dist/
79
+ ```
80
+
81
+ **Statique** : rien à installer. Ouvre `index.html` dans un navigateur, ou déposez le dossier tel quel chez un hébergeur.
82
+
83
+ **Mobile** : il faut [Expo Go](https://expo.dev/go) sur le téléphone, ou le simulateur iPhone (Xcode, sur Mac) ou l'émulateur Android.
84
+
85
+ ```sh
86
+ cd mon-projet-mobile && npm install
87
+ npx expo start # puis « i » pour l'iPhone, « a » pour Android, ou scanne le code avec Expo Go
88
+ ```
89
+
90
+ **Desktop** : une application Electron, avec un menu en français.
91
+
92
+ ```sh
93
+ cd mon-projet-desktop && npm install
94
+ npm start # ouvre l'application
95
+ npm run paquet # l'installateur, dans paquets/ : .dmg sur Mac, .exe sur Windows, AppImage sous Linux
96
+ ```
97
+
98
+ L'installateur se construit sur le système visé (le `.dmg` sur un Mac, le `.exe` sur Windows). Pour le distribuer à d'autres personnes, il faut le signer (certificat Apple ou Windows) : voir la documentation d'[electron-builder](https://www.electron.build/code-signing).
99
+
100
+ **Serveur** : un serveur Node, produit depuis le bloc `serveur "…" :` du fichier. Son `LISEZMOI.md` liste les routes et qui a le droit de faire quoi.
101
+
102
+ ```sh
103
+ cd mon-projet-serveur && npm install
104
+ cp .env.exemple .env # puis remplir JWT_SECRET et l'administrateur
105
+ npm test # vérifie chaque règle d'accès
106
+ npm run build && npm start
107
+ ```
108
+
109
+ Sans `DATABASE_URL`, les données restent en mémoire ; avec, elles vont dans PostgreSQL.
110
+
111
+ ## Ce que le langage sait faire
112
+
113
+ - **Les pages et les éléments** : titres, textes, images, boutons, liens, formulaires, icônes, onglets, carrousel, graphiques, carte, son.
114
+ - **La mise en page** : sections, lignes, colonnes, grilles, en-tête et pied communs, affichage selon l'appareil (`sur telephone :`).
115
+ - **L'apparence** : un thème (couleurs, polices, mode sombre), des styles nommés (`avec couleur bleu`), et ton propre CSS.
116
+ - **La logique** : variables, conditions (`si … et …`, `n'est pas`), boucles, fonctions, listes (`trier`, `dont`, `grouper`), dates (`aujourd'hui plus 3 jours`), argent (`{prix en euros}`).
117
+ - **Les données** : un serveur dans le même fichier, ou une API existante (`source "…"`), avec les états de chargement et d'erreur.
118
+ - **Les interactions** : messages, fenêtres et confirmations, raccourcis clavier, recherche pendant la frappe, copier et partager.
119
+ - **La qualité** : l'accessibilité vérifiée à la compilation, plusieurs langues (`titre "Bienvenue" en anglais "Welcome"`), l'aperçu de partage et le plan du site.
120
+
121
+ Les messages d'erreur sont en français, avec la ligne, et proposent souvent la correction :
122
+
123
+ ```
124
+ Erreur, ligne 3 : le texte utilise {totl}, mais la variable « totl » n'est pas déclarée. Peut-être « total » ?
125
+ ```
126
+
127
+ ## Les commandes
128
+
129
+ | Commande | Rôle |
130
+ |---|---|
131
+ | `humalis nouveau <nom>` | crée un projet |
132
+ | `humalis developper` | lance le site et le recompile à chaque enregistrement |
133
+ | `humalis compile <fichier> --cible …` | produit le projet d'une cible |
134
+ | `humalis verifier <fichier>` | affiche les erreurs et les avertissements |
135
+ | `humalis formater <fichier>` | remet le fichier en forme |
136
+ | `humalis tester` | lance les tests écrits en Humalis (`*.test.humalis`) dans un navigateur |
137
+
138
+ ## Pour les assistants (IA)
139
+
140
+ Le fichier [`llms.txt`](llms.txt), livré avec le paquet, résume la grammaire, les pièges et les messages d'erreur, pour qu'un assistant écrive du Humalis juste.
141
+
142
+ ## Licence
143
+
144
+ [Apache 2.0](LICENSE). Copyright 2026 Les auteurs de Humalis ; Humalis a été créé par kongo bola emmanouch (voir [`NOTICE`](NOTICE)).
145
+
146
+ Le code que Humalis produit (sites, applications, serveurs) t'appartient, sans aucune obligation. Le nom « Humalis » et son logo ne sont pas couverts par la licence.
@@ -0,0 +1,119 @@
1
+ import { texteSimple } from './ecran.js';
2
+ import { contraste, encreSur, FOND_PAGE } from './couleurs.js';
3
+ import { COULEURS_CSS } from '../cibles/web/styles.js';
4
+ const SEUIL_NORMAL = 4.5;
5
+ const SEUIL_GRAND = 3;
6
+ const motsVides = new Set(['image', 'photo']);
7
+ /** Vérifications qui demandent une intention explicite de l'auteur. */
8
+ export function verifierAccessibilite(page, theme) {
9
+ const diagnostics = [];
10
+ const signaler = (gravite, message, ligne) => diagnostics.push({ gravite, categorie: 'accessibilite', message, ligne });
11
+ let titres = 0;
12
+ let niveauPrecedent = 1;
13
+ const liens = new Map();
14
+ const survols = [];
15
+ const clics = new Set();
16
+ const parcours = (instructions, champs = new Map()) => {
17
+ for (const instruction of instructions) {
18
+ if (instruction.type === 'Element') {
19
+ const element = instruction;
20
+ const texte = texteSimple(element.contenu);
21
+ const option = (nom) => element.styles.find((s) => s.propriete === nom);
22
+ if (['bouton', 'lien', 'champ'].includes(element.element) && texte !== undefined && texte.trim() === '') {
23
+ signaler('erreur', `le ${element.element} n'a pas de texte. Écrivez un libellé entre guillemets.`, element.ligne);
24
+ }
25
+ else if (element.element === 'champ' && texte !== undefined) {
26
+ if (!/\p{L}/u.test(texte))
27
+ signaler('avertissement', `le libellé « ${texte} » du champ ne contient aucune lettre.`, element.ligne);
28
+ const deja = champs.get(texte.toLocaleLowerCase('fr'));
29
+ if (deja !== undefined)
30
+ signaler('avertissement', `deux champs du même formulaire portent « ${texte} » (premier ligne ${deja}). Donnez-leur des libellés différents.`, element.ligne);
31
+ else
32
+ champs.set(texte.toLocaleLowerCase('fr'), element.ligne);
33
+ }
34
+ if (element.element === 'image') {
35
+ const description = option('description')?.valeur;
36
+ // Une image sans description ni « decoratif » est déjà une erreur (décision M4, src/analyse/medias.ts).
37
+ if (description !== undefined && (description.trim().length < 3 || motsVides.has(description.toLocaleLowerCase('fr')) || description === texte || /^IMG[_-]?\d+/i.test(description))) {
38
+ signaler('avertissement', `la description « ${description} » de l'image ne dit rien. Décrivez ce qu'elle montre.`, element.ligne);
39
+ }
40
+ }
41
+ if (element.element === 'icone' && !option('description') && !option('decoratif')) {
42
+ signaler('avertissement', 'cette icône seule n’a pas de description pour le lecteur d’écran. Ajoutez « avec description "…" » ou « avec decoratif ». ', element.ligne);
43
+ }
44
+ if (element.element === 'etoiles' && !option('description')) {
45
+ signaler('avertissement', 'ces étoiles n’ont pas de description explicite. Ajoutez « avec description "Note : 4 sur 5" ». ', element.ligne);
46
+ }
47
+ if (element.element === 'lien' && texte !== undefined && /^(ici|cliquez ici|lire la suite|en savoir plus)$/i.test(texte.trim())) {
48
+ const adresses = liens.get(texte.toLocaleLowerCase('fr')) ?? new Set();
49
+ if (adresses.size === 0 || !adresses.has(element.cible ?? ''))
50
+ signaler('avertissement', `le lien « ${texte} » n'explique pas sa destination. Écrivez un libellé plus précis.`, element.ligne);
51
+ adresses.add(element.cible ?? '');
52
+ liens.set(texte.toLocaleLowerCase('fr'), adresses);
53
+ }
54
+ if (element.element === 'titre') {
55
+ titres++;
56
+ if (titres > 1)
57
+ signaler('avertissement', `la page « ${page.nom} » a plusieurs titres principaux. Gardez un seul « titre ».`, element.ligne);
58
+ }
59
+ if (element.element === 'soustitre') {
60
+ const niveau = element.niveau ?? 2;
61
+ if (niveau < 2 || niveau > 6) {
62
+ signaler('erreur', 'le niveau d’un sous-titre doit être entre 2 et 6.', element.ligne);
63
+ continue;
64
+ }
65
+ if (titres === 0)
66
+ signaler('avertissement', 'ce sous-titre apparaît avant le titre principal de la page.', element.ligne);
67
+ if (niveau > niveauPrecedent + 1)
68
+ signaler('avertissement', `ce sous-titre fait un saut de niveau : après ${niveauPrecedent}, écrivez un niveau ${niveauPrecedent + 1}.`, element.ligne);
69
+ niveauPrecedent = niveau;
70
+ }
71
+ if (['texte', 'titre', 'bouton', 'lien', 'champ'].includes(element.element))
72
+ verifierContraste(element, theme, signaler);
73
+ }
74
+ else if (instruction.type === 'Formulaire')
75
+ parcours(instruction.corps, new Map());
76
+ else if (instruction.type === 'Evenement') {
77
+ if (instruction.genre === 'survol')
78
+ survols.push({ cible: instruction.cible, ligne: instruction.ligne });
79
+ if (instruction.genre === 'clic')
80
+ clics.add(instruction.cible);
81
+ parcours(instruction.corps, champs);
82
+ }
83
+ else if (instruction.type === 'Bloc' || instruction.type === 'Boucle')
84
+ parcours(instruction.corps, champs);
85
+ else if (instruction.type === 'Condition') {
86
+ parcours(instruction.alors, champs);
87
+ parcours(instruction.sinon, champs);
88
+ }
89
+ }
90
+ };
91
+ parcours(page.corps);
92
+ for (const survol of survols) {
93
+ if (!clics.has(survol.cible))
94
+ signaler('avertissement', 'ce survol n’a pas d’action au clic : le clavier et les écrans tactiles ne peuvent pas le déclencher.', survol.ligne);
95
+ }
96
+ if (titres === 0)
97
+ signaler('avertissement', `la page « ${page.nom} » n'a pas de titre principal. Ajoutez « titre "…" ».`, page.ligne);
98
+ return diagnostics;
99
+ }
100
+ function verifierContraste(element, theme, signaler) {
101
+ const valeur = (nom) => element.styles.find((s) => s.propriete === nom)?.valeur;
102
+ const couleur = valeur('couleur') ?? valeur('texte');
103
+ const fond = valeur('fond');
104
+ if (!couleur && !fond)
105
+ return;
106
+ const seuil = valeur('taille') === 'grande' ? SEUIL_GRAND : SEUIL_NORMAL;
107
+ for (const mode of ['clair', 'sombre']) {
108
+ const hex = (nom) => theme.get(nom)?.[mode] ?? COULEURS_CSS[nom]?.[mode];
109
+ const fondHex = fond ? hex(fond) : FOND_PAGE[mode];
110
+ const encreHex = couleur ? hex(couleur) : fondHex ? encreSur(fondHex) : undefined;
111
+ if (!fondHex || !encreHex)
112
+ continue;
113
+ const rapport = contraste(encreHex, fondHex);
114
+ if (rapport >= seuil)
115
+ continue;
116
+ const suggestions = Object.entries(COULEURS_CSS).filter(([, c]) => contraste(c[mode], fondHex) >= seuil).map(([nom]) => nom).slice(0, 3);
117
+ signaler('avertissement', `le contraste du texte en ${couleur ?? 'couleur calculée'} est ${rapport.toFixed(1).replace('.', ',')} en mode ${mode} ; il faut ${seuil.toString().replace('.', ',')}. Essayez ${suggestions.join(', ')}.`, element.ligne);
118
+ }
119
+ }