@nutin/cli 1.3.1 → 2.1.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 (289) hide show
  1. package/CHANGELOG.md +106 -9
  2. package/README.md +17 -35
  3. package/bin/add-feature.mjs +9 -0
  4. package/bin/cli.mjs +8 -0
  5. package/bin/create-app.mjs +5 -4
  6. package/bin/update-app.mjs +9 -0
  7. package/lib/index.mjs +76 -25
  8. package/lib/src/add-feature/feature-adder.mjs +83 -0
  9. package/lib/src/add-feature/feature-context-builder.mjs +25 -0
  10. package/lib/src/add-feature/nutin-config-updater.mjs +29 -0
  11. package/lib/src/add-feature/package-json-updater.mjs +49 -0
  12. package/lib/src/common/feature-registry.mjs +11 -0
  13. package/lib/src/common/file-generator.mjs +159 -0
  14. package/lib/src/common/meta-bootstrap-prompt.mjs +33 -0
  15. package/lib/src/common/package-data.mjs +10 -0
  16. package/lib/src/common/package-json-helper.mjs +103 -0
  17. package/lib/src/common/project-meta.mjs +54 -0
  18. package/lib/src/create-app/context-builder.mjs +21 -0
  19. package/lib/src/{git-manager.mjs → create-app/git-manager.mjs} +2 -2
  20. package/lib/src/create-app/json-manager.mjs +73 -0
  21. package/lib/src/{prompts.mjs → create-app/new-app-prompt.mjs} +6 -6
  22. package/lib/src/{project-generator.mjs → create-app/project-generator.mjs} +10 -8
  23. package/lib/src/create-app/success-message.mjs +13 -0
  24. package/lib/src/update-app/conflict-report-writer.mjs +31 -0
  25. package/lib/src/update-app/fetch-old-templates.mjs +61 -0
  26. package/lib/src/update-app/project-updater.mjs +142 -0
  27. package/lib/src/update-app/template-differ.mjs +124 -0
  28. package/lib/src/update-app/update-context-builder.mjs +25 -0
  29. package/lib/src/update-app/update-summary-printer.mjs +22 -0
  30. package/lib/src/update-app/version-compare.mjs +12 -0
  31. package/lib/src/utils/print.mjs +36 -0
  32. package/lib/src/utils/promise-exec-alias.mjs +4 -0
  33. package/package.json +17 -12
  34. package/templates/base/.gitignore.hbs +6 -1
  35. package/templates/base/AGENTS.md.hbs +168 -0
  36. package/templates/base/GETTING_STARTED.md.hbs +199 -0
  37. package/templates/base/README.md.hbs +8 -17
  38. package/templates/base/config/languages.json.hbs +6 -0
  39. package/templates/base/config/seo.json.hbs +12 -0
  40. package/templates/base/nutin.config.js.hbs +44 -0
  41. package/templates/base/src/app/components/index.ts.hbs +1 -2
  42. package/templates/base/src/app/globals.d.ts.hbs +3 -19
  43. package/templates/base/src/{libs/guards → app}/guards.ts.hbs +1 -5
  44. package/templates/base/src/app/main.ts.hbs +6 -26
  45. package/templates/base/src/app/services/index.ts.hbs +1 -1
  46. package/templates/base/src/app/views/home/home.view.html.hbs +7 -0
  47. package/templates/base/src/app/views/home/home.view.ts.hbs +2 -57
  48. package/templates/base/src/app/views/index.ts.hbs +1 -0
  49. package/templates/base/src/app/views/not-found/not-found.view.html.hbs +8 -0
  50. package/templates/base/src/app/views/not-found/not-found.view.ts.hbs +5 -38
  51. package/templates/base/src/core/base-classes/base-component/base-component.test.js.hbs +158 -0
  52. package/templates/base/src/core/base-classes/base-component/base-component.ts.hbs +68 -35
  53. package/templates/base/src/core/base-classes/base-component/helpers/catalog.helper.test.js.hbs +124 -0
  54. package/templates/base/src/core/base-classes/base-component/helpers/catalog.helper.ts.hbs +9 -8
  55. package/templates/base/src/core/base-classes/base-component/helpers/children.helper.test.js.hbs +96 -0
  56. package/templates/base/src/core/base-classes/base-component/helpers/children.helper.ts.hbs +6 -3
  57. package/templates/base/src/core/base-classes/base-component/helpers/dom.helper.test.js.hbs +151 -0
  58. package/templates/base/src/core/base-classes/base-component/helpers/dom.helper.ts.hbs +8 -2
  59. package/templates/base/src/core/base-classes/base-component/helpers/event.helper.test.js.hbs +88 -0
  60. package/templates/base/src/core/base-classes/base-component/helpers/event.helper.ts.hbs +2 -2
  61. package/templates/base/src/core/base-classes/base-component/helpers/i18n.helper.test.js.hbs +62 -0
  62. package/templates/base/src/core/base-classes/base-component/helpers/pipe.helper.test.js.hbs +89 -0
  63. package/templates/base/src/core/base-classes/base-component/helpers/pipe.helper.ts.hbs +4 -1
  64. package/templates/base/src/core/base-classes/base-component/helpers/security.helper.test.js.hbs +142 -0
  65. package/templates/base/src/core/base-classes/base-component/helpers/security.helper.ts.hbs +67 -22
  66. package/templates/base/src/core/base-classes/base-component/helpers/token.helper.test.js.hbs +183 -0
  67. package/templates/base/src/core/base-classes/component/component.test.js.hbs +85 -0
  68. package/templates/base/src/core/base-classes/component/component.ts.hbs +24 -33
  69. package/templates/base/src/core/base-classes/component/helpers/config.helper.test.js.hbs +58 -0
  70. package/templates/base/src/core/base-classes/component/helpers/data-binding.helper.test.js.hbs +75 -0
  71. package/templates/base/src/core/base-classes/service/service.test.js.hbs +150 -0
  72. package/templates/base/src/core/base-classes/service/service.ts.hbs +26 -20
  73. package/templates/base/src/core/base-classes/view/view.test.js.hbs +71 -0
  74. package/templates/base/src/core/base-classes/view/view.ts.hbs +24 -49
  75. package/templates/base/src/core/config.ts.hbs +10 -0
  76. package/templates/base/src/core/index.ts.hbs +0 -3
  77. package/templates/base/src/core/internals.d.ts.hbs +27 -0
  78. package/templates/base/src/core/nutin-config.d.ts.hbs +4 -0
  79. package/templates/base/src/core/services/event-bus/event-bus.test.js.hbs +67 -3
  80. package/templates/base/src/core/services/event-bus/event-bus.ts.hbs +9 -4
  81. package/templates/base/src/core/services/event-bus/index.ts.hbs +3 -0
  82. package/templates/base/src/core/services/event-bus/lifecycle.facade.test.js.hbs +123 -0
  83. package/templates/base/src/core/services/event-bus/lifecycle.facade.ts.hbs +61 -0
  84. package/templates/base/src/core/services/event-bus/navigation.facade.test.js.hbs +46 -0
  85. package/templates/base/src/core/services/event-bus/navigation.facade.ts.hbs +25 -0
  86. package/templates/base/src/core/services/globals/globals.test.js.hbs +187 -0
  87. package/templates/base/src/core/services/globals/globals.ts.hbs +104 -0
  88. package/templates/base/src/core/services/http-client/helpers/http-builder.helper.test.js.hbs +25 -0
  89. package/templates/base/src/core/services/http-client/helpers/http-manager.helper.test.js.hbs +20 -0
  90. package/templates/base/src/core/services/http-client/http-client.test.js.hbs +73 -2
  91. package/templates/base/src/core/services/http-client/http-client.ts.hbs +4 -1
  92. package/templates/base/src/core/services/i18n/i18n.test.js.hbs +270 -0
  93. package/templates/{features/i18n → base}/src/core/services/i18n/i18n.ts.hbs +22 -4
  94. package/templates/base/src/core/services/index.ts.hbs +5 -6
  95. package/templates/base/src/core/services/pipe-registry/pipe-registry.test.js.hbs +60 -1
  96. package/templates/base/src/core/services/pipe-registry/pipe-registry.ts.hbs +1 -1
  97. package/templates/base/src/core/services/pipe-registry/pipes.test.js.hbs +128 -0
  98. package/templates/base/src/{libs/pipes → core/services/pipe-registry}/pipes.ts.hbs +8 -5
  99. package/templates/base/src/core/services/router/helpers/navigation-manager.helper.test.js.hbs +257 -6
  100. package/templates/base/src/core/services/router/helpers/navigation-manager.helper.ts.hbs +56 -29
  101. package/templates/base/src/core/services/router/helpers/route-guard-manager.helper.test.js.hbs +27 -0
  102. package/templates/base/src/core/services/router/helpers/view-render-manager.helper.test.js.hbs +83 -17
  103. package/templates/base/src/core/services/router/helpers/view-render-manager.helper.ts.hbs +14 -38
  104. package/templates/base/src/core/services/router/router.test.js.hbs +304 -2
  105. package/templates/base/src/core/services/router/router.ts.hbs +47 -12
  106. package/templates/base/src/index.html.hbs +2 -6
  107. package/templates/base/src/styles/_styles.scss.hbs +102 -43
  108. package/templates/base/src/styles/base/_variables.scss.hbs +1 -86
  109. package/templates/base/src/styles/main.scss.hbs +1 -18
  110. package/templates/base/src/styles/tailwind.css.hbs +2 -0
  111. package/templates/base/tools/builder/builder.config.js.hbs +40 -0
  112. package/templates/base/tools/builder/builder.js.hbs +24 -26
  113. package/templates/base/tools/builder/core/app/binary-extensions.test.js.hbs +16 -0
  114. package/templates/base/tools/builder/core/app/compile-ts.js.hbs +16 -0
  115. package/templates/base/tools/builder/core/{copy-static.js.hbs → app/copy-static.js.hbs} +27 -34
  116. package/templates/base/tools/builder/core/app/validate-routes.js.hbs +77 -0
  117. package/templates/base/tools/builder/core/finalize-build.js.hbs +16 -7
  118. package/templates/base/tools/builder/core/{add-tags.js.hbs → html-index/add-tags.js.hbs} +2 -2
  119. package/templates/base/tools/builder/core/html-index/add-tags.test.js.hbs +56 -0
  120. package/templates/base/tools/builder/core/{validate-html.js.hbs → html-index/validate-html.js.hbs} +5 -11
  121. package/templates/base/tools/builder/core/html-templates/merge-templates.js.hbs +152 -0
  122. package/templates/base/tools/builder/core/html-templates/minify-html.js.hbs +15 -0
  123. package/templates/base/tools/builder/core/html-templates/process-html-templates.js.hbs +8 -0
  124. package/templates/{features/i18n/tools/builder/core → base/tools/builder/core/i18n}/build-i18n.js.hbs +6 -17
  125. package/templates/base/tools/builder/core/prod-bundle/compress-files.js.hbs +37 -0
  126. package/templates/base/tools/builder/core/prod-bundle/esbuild.js.hbs +30 -0
  127. package/templates/base/tools/builder/core/{hash-files.js.hbs → prod-bundle/hash-files.js.hbs} +14 -11
  128. package/templates/base/tools/builder/core/seo/generate-robots-txt.js.hbs +51 -0
  129. package/templates/base/tools/builder/core/seo/generate-seo-files.js.hbs +16 -0
  130. package/templates/base/tools/builder/core/seo/generate-seo-html.js.hbs +128 -0
  131. package/templates/base/tools/builder/core/seo/generate-sitemap-xml.js.hbs +43 -0
  132. package/templates/base/tools/builder/core/seo/html-substitutions.js.hbs +99 -0
  133. package/templates/base/tools/builder/core/seo/i18n-resolution.js.hbs +66 -0
  134. package/templates/base/tools/builder/core/seo/route-output.js.hbs +64 -0
  135. package/templates/base/tools/builder/core/seo/ssr/ssr-bundle.js.hbs +54 -0
  136. package/templates/base/tools/builder/core/seo/ssr/ssr-polyfills.js.hbs +132 -0
  137. package/templates/base/tools/builder/core/seo/ssr/ssr-render.js.hbs +95 -0
  138. package/templates/base/tools/builder/core/styles/sass.js.hbs +40 -0
  139. package/templates/base/tools/builder/core/styles/tailwind.js.hbs +84 -0
  140. package/templates/base/tools/dev/dev-serve.js.hbs +26 -18
  141. package/templates/base/tools/dev/serve.js.hbs +11 -1
  142. package/templates/base/tools/dev/watcher.js.hbs +14 -6
  143. package/templates/base/tools/generator/generator.js.hbs +44 -47
  144. package/templates/base/tools/generator/handle-file.js.hbs +17 -44
  145. package/templates/base/tools/generator/handle-file.test.js.hbs +72 -0
  146. package/templates/base/tools/generator/templates/{component.template.js.hbs → component/component.template.js.hbs} +3 -2
  147. package/templates/base/tools/generator/templates/component/component.template.test.js.hbs +23 -0
  148. package/templates/base/tools/generator/templates/html/html.template.js.hbs +2 -0
  149. package/templates/base/tools/generator/templates/html/html.template.test.js.hbs +7 -0
  150. package/templates/base/tools/generator/templates/index.js.hbs +7 -12
  151. package/templates/base/tools/generator/templates/locale/locale.template.js.hbs +8 -0
  152. package/templates/base/tools/generator/templates/locale/locale.template.test.js.hbs +17 -0
  153. package/templates/base/tools/generator/templates/scss/scss.template.js.hbs +1 -0
  154. package/templates/base/tools/generator/templates/scss/scss.template.test.js.hbs +7 -0
  155. package/templates/base/tools/generator/templates/service/service.template.js.hbs +17 -0
  156. package/templates/base/tools/generator/templates/service/service.template.test.js.hbs +22 -0
  157. package/templates/base/tools/generator/templates/test/test.template.js.hbs +10 -0
  158. package/templates/base/tools/generator/templates/test/test.template.test.js.hbs +27 -0
  159. package/templates/base/tools/generator/templates/{view.template.js.hbs → view/view.template.js.hbs} +4 -3
  160. package/templates/base/tools/generator/templates/view/view.template.test.js.hbs +24 -0
  161. package/templates/base/tools/testin-nutin/core/coverage/collect-coverage.js.hbs +39 -0
  162. package/templates/base/tools/testin-nutin/core/coverage/compute-coverage.js.hbs +115 -0
  163. package/templates/base/tools/testin-nutin/core/coverage/compute-coverage.test.js.hbs +74 -0
  164. package/templates/base/tools/testin-nutin/core/coverage/write-summary-report.js.hbs +54 -0
  165. package/templates/base/tools/testin-nutin/core/coverage/write-uncovered-report.js.hbs +44 -0
  166. package/templates/{features/testinNutin/testin-nutin/core/src → base/tools/testin-nutin/core}/globals/assertion-lib.js.hbs +62 -24
  167. package/templates/base/tools/testin-nutin/core/globals/clock.js.hbs +206 -0
  168. package/templates/{features/testinNutin/testin-nutin/core/src → base/tools/testin-nutin/core}/globals/jsdom-setup.js.hbs +19 -6
  169. package/templates/{features/testinNutin/testin-nutin/core/src → base/tools/testin-nutin/core}/globals/register-test-globals.js.hbs +13 -4
  170. package/templates/base/tools/testin-nutin/core/globals/silence-console.js.hbs +23 -0
  171. package/templates/{features/testinNutin/testin-nutin/core/src → base/tools/testin-nutin/core}/globals/spyon.js.hbs +2 -0
  172. package/templates/base/tools/testin-nutin/core/index.js.hbs +9 -0
  173. package/templates/base/tools/testin-nutin/core/printer.js.hbs +85 -0
  174. package/templates/base/tools/testin-nutin/core/queue/queue.test.js.hbs +46 -0
  175. package/templates/base/tools/testin-nutin/core/queue/test-discovery.test.js.hbs +46 -0
  176. package/templates/base/tools/testin-nutin/core/queue/test-queue.js.hbs +154 -0
  177. package/templates/{features/testinNutin → base/tools}/testin-nutin/core/tests/assertions.test.js.hbs +27 -0
  178. package/templates/base/tools/testin-nutin/core/tests/clock.test.js.hbs +118 -0
  179. package/templates/base/tools/testin-nutin/core/tests/globals-each-all.test.js.hbs +28 -0
  180. package/templates/{features/testinNutin → base/tools}/testin-nutin/mocks/create-mock-method.js.hbs +2 -1
  181. package/templates/base/tools/testin-nutin/mocks/create-mock-method.test.js.hbs +64 -0
  182. package/templates/{features/testinNutin → base/tools}/testin-nutin/mocks/mock-event-bus.js.hbs +3 -2
  183. package/templates/base/tools/testin-nutin/mocks/mock-event-bus.test.js.hbs +66 -0
  184. package/templates/base/tools/testin-nutin/mocks/mock-http-client.test.js.hbs +26 -0
  185. package/templates/base/tools/testin-nutin/mocks/mock-i18n.test.js.hbs +61 -0
  186. package/templates/base/tools/testin-nutin/mocks/mock-router.test.js.hbs +29 -0
  187. package/templates/base/tools/testin-nutin/runner.js.hbs +100 -0
  188. package/templates/base/tools/testin-nutin/watch-tests.js.hbs +37 -0
  189. package/templates/base/tools/utils/error-exit.js.hbs +8 -0
  190. package/templates/base/tools/utils/format.js.hbs +10 -10
  191. package/templates/base/tools/utils/format.test.js.hbs +45 -0
  192. package/templates/base/tools/utils/get-files-recursive.js.hbs +6 -1
  193. package/templates/base/tools/utils/get-files-recursive.test.js.hbs +49 -0
  194. package/templates/base/tools/utils/get-rel-to-core.test.js.hbs +18 -0
  195. package/templates/base/tools/utils/index.js.hbs +1 -3
  196. package/templates/base/tools/utils/languages.js.hbs +15 -0
  197. package/templates/base/tools/utils/languages.test.js.hbs +16 -0
  198. package/templates/base/tools/utils/print.js.hbs +19 -13
  199. package/templates/base/tools/utils/print.test.js.hbs +60 -0
  200. package/templates/base/tools/utils/prompt-boolean.js.hbs +7 -0
  201. package/templates/base/tools/utils/prompt-boolean.test.js.hbs +54 -0
  202. package/templates/base/tools/utils/run-command.js.hbs +4 -2
  203. package/templates/base/tools/utils/run-command.test.js.hbs +19 -0
  204. package/templates/base/tools/utils/run-script.js.hbs +14 -3
  205. package/templates/base/tools/utils/run-script.test.js.hbs +40 -0
  206. package/templates/features/{deployHelper → docker}/.dockerignore.hbs +4 -4
  207. package/templates/features/docker/tools/docker/Dockerfile.template.hbs +51 -0
  208. package/templates/features/{deployHelper/tools/deployment/nginx.conf.hbs → docker/tools/docker/nginx.conf.template} +4 -2
  209. package/templates/features/docker/tools/docker/scripts/docker-build.js.hbs +20 -0
  210. package/templates/features/docker/tools/docker/scripts/docker-ports.js.hbs +48 -0
  211. package/templates/features/docker/tools/docker/scripts/docker-ports.test.js.hbs +52 -0
  212. package/templates/features/docker/tools/docker/scripts/docker-run.js.hbs +28 -0
  213. package/templates/features/docker/tools/docker/scripts/render-docker-template.js.hbs +23 -0
  214. package/templates/features/docker/tools/docker/scripts/render-docker-template.test.js.hbs +60 -0
  215. package/templates/features/docker/tools/docker/scripts/validate-docker.js.hbs +30 -0
  216. package/lib/src/context-builder.mjs +0 -40
  217. package/lib/src/file-generator.mjs +0 -109
  218. package/lib/src/json-generator.mjs +0 -31
  219. package/lib/src/package-manager.mjs +0 -139
  220. package/lib/src/print.mjs +0 -32
  221. package/lib/src/utils.mjs +0 -18
  222. package/lib/src/version.mjs +0 -1
  223. package/templates/base/builder.config.js.hbs +0 -36
  224. package/templates/base/src/app/components/common/anchor/anchor.component.ts.hbs +0 -32
  225. package/templates/base/src/app/components/common/button/button.component.ts.hbs +0 -40
  226. package/templates/base/src/app/dom.test.js.hbs +0 -13
  227. package/templates/base/src/app/services/example/example.service.ts.hbs +0 -18
  228. package/templates/base/src/app/views/home/home.view.test.js.hbs +0 -26
  229. package/templates/base/src/core/services/store/store.test.js.hbs +0 -8
  230. package/templates/base/src/core/services/store/store.ts.hbs +0 -39
  231. package/templates/base/src/core/utils/anchor-manager/anchor-manager.utils.test.js.hbs +0 -0
  232. package/templates/base/src/core/utils/anchor-manager/anchor-manager.utils.ts.hbs +0 -113
  233. package/templates/base/src/core/utils/button-manager/button-manager.utils.test.js.hbs +0 -249
  234. package/templates/base/src/core/utils/button-manager/button-manager.utils.ts.hbs +0 -131
  235. package/templates/base/src/core/utils/helpers/attributes.helper.ts.hbs +0 -50
  236. package/templates/base/src/core/utils/index.ts.hbs +0 -2
  237. package/templates/base/src/libs/index.ts.hbs +0 -4
  238. package/templates/base/src/libs/popover/helpers/focus-trap.helper.ts.hbs +0 -197
  239. package/templates/base/src/libs/popover/helpers/popover-dom.helper.ts.hbs +0 -75
  240. package/templates/base/src/libs/popover/popover.ts.hbs +0 -138
  241. package/templates/base/src/libs/snackbar/snackbar.ts.hbs +0 -75
  242. package/templates/base/src/styles/base/_functions.scss.hbs +0 -9
  243. package/templates/base/src/styles/core/_anchors.scss.hbs +0 -10
  244. package/templates/base/src/styles/core/_index.scss.hbs +0 -6
  245. package/templates/base/src/styles/core/_popover.scss.hbs +0 -96
  246. package/templates/base/src/styles/core/_snackbar.scss.hbs +0 -50
  247. package/templates/base/tools/builder/core/esbuild.js.hbs +0 -25
  248. package/templates/base/tools/builder/core/minify-html.js.hbs +0 -60
  249. package/templates/base/tools/builder/core/sass.js.hbs +0 -22
  250. package/templates/base/tools/builder/core/tsc.js.hbs +0 -12
  251. package/templates/base/tools/generator/templates/service.template.js.hbs +0 -17
  252. package/templates/base/tools/utils/export-flags.js.hbs +0 -6
  253. package/templates/features/deployHelper/tools/builder/core/compress-files.js.hbs +0 -56
  254. package/templates/features/deployHelper/tools/deployment/Dockerfile.hbs +0 -30
  255. package/templates/features/i18n/src/app/views/home/locales/en.json.hbs +0 -9
  256. package/templates/features/i18n/src/app/views/not-found/locales/en.json +0 -8
  257. package/templates/features/i18n/src/app/views/not-found/locales/fr.json +0 -8
  258. package/templates/features/i18n/src/core/config.ts.hbs +0 -3
  259. package/templates/features/i18n/src/core/services/i18n/i18n.test.js.hbs +0 -125
  260. package/templates/features/i18n/tools/generator/templates/json.template.js.hbs +0 -8
  261. package/templates/features/i18n/tools/utils/languages.js.hbs +0 -7
  262. package/templates/features/stylinNutin/src/styles/_custom-classes.scss.hbs +0 -9
  263. package/templates/features/stylinNutin/src/styles/base/_mixins.scss.hbs +0 -372
  264. package/templates/features/stylinNutin/src/styles/components/_index.scss.hbs +0 -3
  265. package/templates/features/stylinNutin/src/styles/core/_utilities.scss.hbs +0 -254
  266. package/templates/features/stylinNutin/src/styles/views/_index.scss.hbs +0 -0
  267. package/templates/features/stylinNutin/tools/generator/templates/scss.template.js.hbs +0 -4
  268. package/templates/features/template/src/app/views/home/home.view.html.hbs +0 -56
  269. package/templates/features/template/src/app/views/not-found/not-found.view.html.hbs +0 -19
  270. package/templates/features/template/tools/builder/core/merge-templates.js.hbs +0 -49
  271. package/templates/features/template/tools/generator/templates/html.template.js.hbs +0 -2
  272. package/templates/features/testinNutin/testin-nutin/core/index.js.hbs +0 -5
  273. package/templates/features/testinNutin/testin-nutin/core/src/utils/print.js.hbs +0 -64
  274. package/templates/features/testinNutin/testin-nutin/core/src/utils/test-queue.js.hbs +0 -64
  275. package/templates/features/testinNutin/testin-nutin/core/tests/globals-each-all.test.js.hbs +0 -28
  276. package/templates/features/testinNutin/testin-nutin/mocks/mock-store.js.hbs +0 -38
  277. package/templates/features/testinNutin/testin-nutin/runner.js.hbs +0 -36
  278. package/templates/features/testinNutin/testin-nutin/watch-tests.js.hbs +0 -21
  279. package/templates/features/testinNutin/testin-nutin.config.js.hbs +0 -14
  280. /package/lib/src/{template-compiler.mjs → common/template-compiler.mjs} +0 -0
  281. /package/templates/{features/i18n → base}/src/core/base-classes/base-component/helpers/i18n.helper.ts.hbs +0 -0
  282. /package/templates/{features/i18n → base}/src/core/services/i18n/languages.ts.hbs +0 -0
  283. /package/templates/base/tools/builder/{variables → core/app}/binary-extensions.js.hbs +0 -0
  284. /package/templates/base/tools/builder/core/{paths.js.hbs → app/paths.js.hbs} +0 -0
  285. /package/templates/{features/testinNutin/testin-nutin/core/src/utils → base/tools/testin-nutin/core/queue}/queue.js.hbs +0 -0
  286. /package/templates/{features/testinNutin/testin-nutin/core/src/utils → base/tools/testin-nutin/core/queue}/test-discovery.js.hbs +0 -0
  287. /package/templates/{features/testinNutin → base/tools}/testin-nutin/mocks/mock-http-client.js.hbs +0 -0
  288. /package/templates/{features/testinNutin → base/tools}/testin-nutin/mocks/mock-i18n.js.hbs +0 -0
  289. /package/templates/{features/testinNutin → base/tools}/testin-nutin/mocks/mock-router.js.hbs +0 -0
@@ -1,7 +1,309 @@
1
- import { AppRouter } from '#root/dist/src/core/services/index.js'
1
+ import { AppRouter, Navigation, I18nService } from '#root/dist/src/core/services/index.js';
2
+ import { CONFIG } from '#root/dist/src/core/config.js';
3
+
4
+ function makeView(name) {
5
+ const calls = [];
6
+ const el = document.createElement('div');
7
+ return {
8
+ viewName: name,
9
+ calls,
10
+ getElement: () => el,
11
+ setRouteParams: (params) => calls.push(['setRouteParams', params]),
12
+ render: () => { calls.push(['render']); return el; },
13
+ onEnter: () => calls.push(['onEnter']),
14
+ onExit: () => calls.push(['onExit']),
15
+ destroy: () => calls.push(['destroy']),
16
+ };
17
+ }
2
18
 
3
19
  describe('Router', () => {
20
+ let router = null;
21
+
22
+ beforeEach(() => {
23
+ CONFIG.i18n = false;
24
+ CONFIG.generateSEOFiles = false;
25
+ window.history.pushState({}, '', '/');
26
+ });
27
+
28
+ afterEach(() => {
29
+ if (router) {
30
+ router.dispose();
31
+ router = null;
32
+ }
33
+ CONFIG.i18n = false;
34
+ CONFIG.generateSEOFiles = false;
35
+ window.history.pushState({}, '', '/');
36
+ });
37
+
4
38
  it('should be defined', () => {
5
39
  expect(AppRouter).toBeDefined();
6
40
  });
7
- })
41
+
42
+ it('AppRouter returns the same singleton instance on repeated getInstance() calls', async () => {
43
+ const home = makeView('home');
44
+ router = AppRouter({ '/': () => home });
45
+ await flushPromises();
46
+
47
+ const again = router.constructor.getInstance();
48
+ expect(again).toBe(router);
49
+ });
50
+
51
+ it('navigate() matches a route and renders its view (via the initial construction-time navigate)', async () => {
52
+ const home = makeView('home');
53
+ router = AppRouter({ '/': () => home });
54
+ await flushPromises();
55
+
56
+ expect(home.calls).toEqual([
57
+ ['setRouteParams', {}],
58
+ ['render'],
59
+ ['onEnter'],
60
+ ]);
61
+ });
62
+
63
+ it('navigate() passes matched route params to the rendered view', async () => {
64
+ const home = makeView('home');
65
+ const userView = makeView('user');
66
+ router = AppRouter({ '/': () => home, '/users/:id': () => userView });
67
+ await flushPromises();
68
+
69
+ await router.navigate('/users/42');
70
+
71
+ expect(userView.calls[0]).toEqual(['setRouteParams', { id: '42' }]);
72
+ expect(router.getCurrentParams()).toEqual({ id: '42' });
73
+ expect(router.getParam('id')).toBe('42');
74
+ });
75
+
76
+ it('navigate() renders the /404 route when no pattern matches', async () => {
77
+ const home = makeView('home');
78
+ const notFound = makeView('not-found');
79
+ router = AppRouter({ '/': () => home, '/404': () => notFound });
80
+ await flushPromises();
81
+
82
+ await router.navigate('/nope');
83
+
84
+ expect(notFound.calls.some(c => c[0] === 'render')).toBe(true);
85
+ });
86
+
87
+ it('navigate() logs an error and renders nothing when no route matches and there is no /404 route', async () => {
88
+ const home = makeView('home');
89
+ router = AppRouter({ '/': () => home });
90
+ await flushPromises();
91
+
92
+ const errSpy = spyOn(console, 'error');
93
+ errSpy.andCallFake(() => {});
94
+
95
+ await router.navigate('/nope');
96
+
97
+ expect(errSpy.callCount).toBe(1);
98
+ errSpy.restore();
99
+ });
100
+
101
+ it('navigate() blocks navigation when a guard returns false', async () => {
102
+ const home = makeView('home');
103
+ const secret = makeView('secret');
104
+ router = AppRouter({
105
+ '/': () => home,
106
+ '/secret': { view: () => secret, guards: [() => false] },
107
+ });
108
+ await flushPromises();
109
+
110
+ await router.navigate('/secret');
111
+
112
+ expect(secret.calls.length).toBe(0);
113
+ });
114
+
115
+ it('navigate() redirects when a guard returns a redirect path', async () => {
116
+ const home = makeView('home');
117
+ const login = makeView('login');
118
+ const secret = makeView('secret');
119
+ router = AppRouter({
120
+ '/': () => home,
121
+ '/login': () => login,
122
+ '/secret': { view: () => secret, guards: [() => '/login'] },
123
+ });
124
+ await flushPromises();
125
+
126
+ await router.navigate('/secret');
127
+
128
+ expect(login.calls.some(c => c[0] === 'render')).toBe(true);
129
+ expect(secret.calls.length).toBe(0);
130
+ });
131
+
132
+ it('navigate() renders the view when all guards pass', async () => {
133
+ const home = makeView('home');
134
+ const dashboard = makeView('dashboard');
135
+ router = AppRouter({
136
+ '/': () => home,
137
+ '/dashboard': { view: () => dashboard, guards: [() => true] },
138
+ });
139
+ await flushPromises();
140
+
141
+ await router.navigate('/dashboard');
142
+
143
+ expect(dashboard.calls.some(c => c[0] === 'render')).toBe(true);
144
+ });
145
+
146
+ it('reload() re-navigates to the current path without pushing a new history entry', async () => {
147
+ const home = makeView('home');
148
+ router = AppRouter({ '/': () => home });
149
+ await flushPromises();
150
+ home.calls.length = 0;
151
+
152
+ await router.reload();
153
+
154
+ expect(home.calls.some(c => c[0] === 'render')).toBe(true);
155
+ });
156
+
157
+ it('responds to a popstate event by re-navigating to the new current path', async () => {
158
+ const home = makeView('home');
159
+ const about = makeView('about');
160
+ router = AppRouter({ '/': () => home, '/about': () => about });
161
+ await flushPromises();
162
+
163
+ window.history.pushState({}, '', '/about');
164
+ window.dispatchEvent(new window.PopStateEvent('popstate'));
165
+ await flushPromises();
166
+
167
+ expect(about.calls.some(c => c[0] === 'render')).toBe(true);
168
+ });
169
+
170
+ it('switches the language on popstate when the URL locale differs from the current one', async () => {
171
+ CONFIG.i18n = true;
172
+ I18nService['_LANGUAGES'] = ['en', 'fr'];
173
+ I18nService['_currentLanguage'] = 'en';
174
+
175
+ const home = makeView('home');
176
+ router = AppRouter({ '/': () => home });
177
+ await flushPromises();
178
+
179
+ const setLangSpy = spyOn(I18nService, 'setCurrentLanguage');
180
+ setLangSpy.andCallFake(async (lang) => { I18nService['_currentLanguage'] = lang; });
181
+
182
+ window.history.pushState({}, '', '/fr');
183
+ window.dispatchEvent(new window.PopStateEvent('popstate'));
184
+ await flushPromises();
185
+
186
+ expect(setLangSpy).toHaveBeenCalledWith('fr');
187
+
188
+ setLangSpy.restore();
189
+ I18nService['_currentLanguage'] = 'en';
190
+ });
191
+
192
+ it('wires Navigation.navigateTo() through to router.navigate()', async () => {
193
+ const home = makeView('home');
194
+ const about = makeView('about');
195
+ router = AppRouter({ '/': () => home, '/about': () => about });
196
+ await flushPromises();
197
+
198
+ Navigation.navigateTo('/about');
199
+ await flushPromises();
200
+
201
+ expect(about.calls.some(c => c[0] === 'render')).toBe(true);
202
+ });
203
+
204
+ it('wires Navigation.reload() through to router.reload()', async () => {
205
+ const home = makeView('home');
206
+ router = AppRouter({ '/': () => home });
207
+ await flushPromises();
208
+ home.calls.length = 0;
209
+
210
+ Navigation.reload();
211
+ await flushPromises();
212
+
213
+ expect(home.calls.some(c => c[0] === 'render')).toBe(true);
214
+ });
215
+
216
+ it('sets document.title to the view\'s viewName when generateSEOFiles is disabled', async () => {
217
+ CONFIG.generateSEOFiles = false;
218
+ CONFIG.seo = { routes: [{ path: '/', title: 'Should not be used' }] };
219
+
220
+ const home = makeView('home');
221
+ router = AppRouter({ '/': () => home });
222
+ await flushPromises();
223
+
224
+ expect(document.title).toBe('home');
225
+ });
226
+
227
+ it('falls back to the view\'s viewName when generateSEOFiles is enabled but no seo.json route matches', async () => {
228
+ CONFIG.generateSEOFiles = true;
229
+ CONFIG.seo = { routes: [] };
230
+
231
+ const home = makeView('home');
232
+ router = AppRouter({ '/': () => home });
233
+ await flushPromises();
234
+
235
+ expect(document.title).toBe('home');
236
+ });
237
+
238
+ it('sets document.title from config/seo.json when generateSEOFiles is enabled and a route matches', async () => {
239
+ CONFIG.generateSEOFiles = true;
240
+ CONFIG.seo = { routes: [{ path: '/', title: 'My App — Home' }] };
241
+
242
+ const home = makeView('home');
243
+ router = AppRouter({ '/': () => home });
244
+ await flushPromises();
245
+
246
+ expect(document.title).toBe('My App — Home');
247
+ });
248
+
249
+ it('sets document.title for the /404 route', async () => {
250
+ CONFIG.generateSEOFiles = true;
251
+ CONFIG.seo = { routes: [{ path: '/404', title: 'Not Found' }] };
252
+
253
+ const home = makeView('home');
254
+ const notFound = makeView('not-found');
255
+ router = AppRouter({ '/': () => home, '/404': () => notFound });
256
+ await flushPromises();
257
+
258
+ await router.navigate('/nope');
259
+
260
+ expect(document.title).toBe('Not Found');
261
+ });
262
+
263
+ it('resolves a per-language title when i18n is enabled', async () => {
264
+ CONFIG.i18n = true;
265
+ CONFIG.generateSEOFiles = true;
266
+ CONFIG.seo = { routes: [{ path: '/', title: { en: 'Home', fr: 'Accueil' } }] };
267
+ I18nService['_LANGUAGES'] = ['en', 'fr'];
268
+ I18nService['_currentLanguage'] = 'fr';
269
+
270
+ const home = makeView('home');
271
+ router = AppRouter({ '/': () => home });
272
+ await flushPromises();
273
+
274
+ expect(document.title).toBe('Accueil');
275
+
276
+ I18nService['_currentLanguage'] = 'en';
277
+ });
278
+
279
+ it('falls back to the view\'s locale title when i18n is enabled and no seo.json route matches', async () => {
280
+ CONFIG.i18n = true;
281
+ I18nService['_translations'] = { home: { title: 'Accueil' } };
282
+
283
+ const home = makeView('home');
284
+ router = AppRouter({ '/': () => home });
285
+ await flushPromises();
286
+
287
+ expect(document.title).toBe('Accueil');
288
+
289
+ I18nService['_translations'] = {};
290
+ });
291
+
292
+ it('removeEventListeners() stops the router from responding to further navigate/popstate events', async () => {
293
+ const home = makeView('home');
294
+ const about = makeView('about');
295
+ router = AppRouter({ '/': () => home, '/about': () => about });
296
+ await flushPromises();
297
+
298
+ router.removeEventListeners();
299
+
300
+ Navigation.navigateTo('/about');
301
+ await flushPromises();
302
+ expect(about.calls.length).toBe(0);
303
+
304
+ window.history.pushState({}, '', '/about');
305
+ window.dispatchEvent(new window.PopStateEvent('popstate'));
306
+ await flushPromises();
307
+ expect(about.calls.length).toBe(0);
308
+ });
309
+ });
@@ -1,4 +1,5 @@
1
- import { View, AppEventBus } from '../../index.js';
1
+ import { View, Navigation, Service, I18nService, AppEventBus } from '../../index.js';
2
+ import { Language } from '../i18n/languages.js';
2
3
  import { Routes, RouteConfig, RouteGuardsManager, GuardResult } from './helpers/route-guard-manager.helper.js';
3
4
  import { ViewRenderManager } from './helpers/view-render-manager.helper.js';
4
5
  import { NavigationManager } from './helpers/navigation-manager.helper.js';
@@ -14,15 +15,30 @@ export type IRouter = InstanceType<typeof Router>;
14
15
  export interface RouteMatch {
15
16
  route: RouteConfig;
16
17
  params: Record<string, string>;
18
+ pattern: string;
17
19
  }
18
20
 
19
- class Router {
21
+ class Router extends Service<Router> {
20
22
  private _currentView: View | null = null;
21
23
  private _currentParams: Record<string, string> = {};
24
+ private onPopState = () => this.handlePopState();
25
+ private onNavigate = (data: { path: string }) => this.navigate(data.path);
26
+ private onReload = () => this.reload();
27
+ private _busSubscriptions: Array<() => void> = [];
22
28
 
23
29
  constructor(private routes: Routes) {
30
+ super();
24
31
  this.initializeEventListeners();
25
32
  this.navigate(NavigationManager.getCurrentPath());
33
+ this.registerCleanup(this.removeEventListeners);
34
+ }
35
+
36
+ public removeEventListeners(): void {
37
+ this._busSubscriptions.forEach((callback) => {
38
+ callback();
39
+ });
40
+ this._busSubscriptions = [];
41
+ window.removeEventListener('popstate', this.onPopState);
26
42
  }
27
43
 
28
44
  public async reload(): Promise<void> {
@@ -54,12 +70,13 @@ class Router {
54
70
  this._currentView = await ViewRenderManager.transitionOutCurrentView(this._currentView);
55
71
  this._currentParams = routeMatch.params;
56
72
  this._currentView = ViewRenderManager.renderNewView(
57
- guardResult.viewConstructor!,
73
+ guardResult.viewConstructor!,
58
74
  routeMatch.params
59
75
  );
60
-
61
- NavigationManager.updateMetaContent(this._currentView);
76
+
77
+ NavigationManager.updateDocumentTitle(this._currentView, routeMatch.pattern);
62
78
  NavigationManager.updateHistory(normalizedPath, currentPath, pushState);
79
+ window.scrollTo({ top: 0 });
63
80
  }
64
81
 
65
82
  public getCurrentParams(): Record<string, string> {
@@ -71,12 +88,29 @@ class Router {
71
88
  }
72
89
 
73
90
  private initializeEventListeners(): void {
74
- window.addEventListener('popstate', () => this.handlePopState());
75
- AppEventBus.subscribe('navigate', (path: string) => this.navigate(path));
76
- AppEventBus.subscribe('reload', () => this.reload());
91
+ this.initializeNavigationEvents();
92
+ this.initializeI18nEvents();
93
+ }
94
+
95
+ private initializeNavigationEvents(): void {
96
+ window.addEventListener('popstate', this.onPopState);
97
+ const unsubOnNav = Navigation.onNavigate(this.onNavigate);
98
+ const unsubOnReload = Navigation.onReload(this.onReload);
99
+ this._busSubscriptions.push(unsubOnNav, unsubOnReload);
77
100
  }
78
101
 
79
- private handlePopState(): void {
102
+ private initializeI18nEvents(): void {
103
+ const onLangChanged = () => NavigationManager.updateLocaleInUrl();
104
+ AppEventBus.subscribe('language-changed', onLangChanged);
105
+ const unsubOnLang = () => AppEventBus.off('language-changed', onLangChanged);
106
+ this._busSubscriptions.push(unsubOnLang);
107
+ }
108
+
109
+ private async handlePopState(): Promise<void> {
110
+ const newLocale = NavigationManager.getCurrentLocale();
111
+ if (newLocale && newLocale !== I18nService.currentLanguage) {
112
+ await I18nService.setCurrentLanguage(newLocale as Language);
113
+ }
80
114
  this.navigate(NavigationManager.getCurrentPath(), false);
81
115
  }
82
116
 
@@ -90,7 +124,7 @@ class Router {
90
124
  for (const [pattern, routeConfig] of Object.entries(this.routes)) {
91
125
  const match = NavigationManager.matchPattern(pattern, path);
92
126
  if (match) {
93
- return { route: routeConfig, params: match };
127
+ return { route: routeConfig, params: match, pattern };
94
128
  }
95
129
  }
96
130
  return null;
@@ -113,7 +147,8 @@ class Router {
113
147
  this._currentView = await ViewRenderManager.transitionOutCurrentView(this._currentView);
114
148
  this._currentParams = {};
115
149
  this._currentView = ViewRenderManager.renderNewView(notFoundConstructor, {});
116
-
150
+
151
+ NavigationManager.updateDocumentTitle(this._currentView, '/404');
117
152
  NavigationManager.updateHistory(normalizedPath, currentPath, pushState);
118
153
  }
119
154
 
@@ -141,4 +176,4 @@ class Router {
141
176
  }
142
177
  }
143
178
 
144
- export const AppRouter = (routes: Routes) => new Router(routes);
179
+ export const AppRouter = (routes: Routes) => Router.getInstance(routes);
@@ -1,14 +1,10 @@
1
1
  <!DOCTYPE html>
2
- <html>
2
+ <html lang="en">
3
3
  <head>
4
4
  <meta charset="UTF-8">
5
- <meta name="description" content="{{projectName}}">
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
- <link rel="stylesheet" href="/main.css">
8
5
  <link rel="icon" type="image/x-icon" href="/favicon.ico" />
9
- <title>{{projectName}}</title>
10
6
  </head>
11
7
  <body>
12
8
  <main id="app"></main>
13
9
  </body>
14
- </html>
10
+ </html>
@@ -1,54 +1,113 @@
1
1
  @use "variables" as *;
2
- {{#if stylinNutin}}
3
- @use "sass:map";
4
- @use "mixins";
5
- {{/if}}
6
2
 
7
- // css reset
8
- html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video, button, input, textarea {
3
+ /* ===========
4
+ CSS Reset
5
+ =========== */
6
+
7
+ /* Box sizing */
8
+
9
+ *,
10
+ *::before,
11
+ *::after {
12
+ box-sizing: border-box;
13
+ }
14
+
15
+ /* Remove default spacing */
16
+
17
+ * {
9
18
  margin: 0;
10
19
  padding: 0;
11
- border: 0;
20
+ }
21
+
22
+ /* Document */
23
+
24
+ html {
12
25
  font-size: 100%;
26
+ -webkit-text-size-adjust: 100%;
27
+ }
28
+
29
+ body {
30
+ min-height: 100vh;
13
31
  font: inherit;
14
- vertical-align: baseline;
32
+ line-height: 1.5;
15
33
  }
16
34
 
17
- *,
18
- *::before,
19
- *::after {
20
- box-sizing: border-box;
35
+ /* Media */
36
+
37
+ img,
38
+ picture,
39
+ svg,
40
+ canvas,
41
+ video {
42
+ display: block;
43
+ max-width: 100%;
44
+ }
45
+
46
+ /* Forms */
47
+
48
+ button,
49
+ input,
50
+ select,
51
+ textarea {
52
+ font: inherit;
53
+ color: inherit;
54
+ }
55
+
56
+ button {
57
+ background: none;
58
+ border: none;
59
+ cursor: pointer;
60
+ }
61
+
62
+ textarea {
63
+ resize: vertical;
64
+ }
65
+
66
+ /* Tables */
67
+
68
+ table {
69
+ border-collapse: collapse;
70
+ border-spacing: 0;
71
+ }
72
+
73
+ /* Lists */
74
+
75
+ ul,
76
+ ol {
77
+ list-style: none;
78
+ }
79
+
80
+ /* Links */
81
+
82
+ a {
83
+ color: inherit;
84
+ text-decoration: none;
85
+ }
86
+
87
+ /* Quotes */
88
+
89
+ blockquote,
90
+ q {
91
+ quotes: none;
92
+ }
93
+
94
+ blockquote::before,
95
+ blockquote::after,
96
+ q::before,
97
+ q::after {
98
+ content: "";
99
+ }
100
+
101
+ /* Miscellaneous */
102
+
103
+ hr {
104
+ border: none;
105
+ }
106
+
107
+ fieldset {
108
+ border: none;
21
109
  }
22
110
 
23
- // Global styles
24
- :root {
25
- body {
26
- background-color: $background-color;
27
- color: $text-color;
28
- min-height: 100vh;
29
- cursor: default;
30
- {{#if stylinNutin}}
31
- line-height: 1.6;
32
- font-family: $primary-font;
33
- font-size: map.get($font-sizes, medium);
34
- {{else}}
35
- font-family: Arial, Helvetica, sans-serif;
36
- font-size: 1rem;
37
- {{/if}}
38
- }
39
-
40
- {{#if stylinNutin}}
41
- h1 {
42
- font-size: map.get($font-sizes, largest);
43
- font-family: $secondary-font;
44
- }
45
-
46
- a, button {
47
- cursor: pointer;
48
- }
49
-
50
- a {
51
- text-decoration: none;
52
- }
53
- {{/if}}
111
+ :where([hidden]) {
112
+ display: none !important;
54
113
  }
@@ -1,86 +1 @@
1
- /*
2
- Variables used in libs (snackbar, popover){{#if stylinNutin}} and utility classes{{/if}}
3
- Adapt to customize
4
- */
5
-
6
- // colours (RGB)
7
- $background-color: rgb(255 255 255); // WHITE
8
- $text-color: rgb(0 0 0); // BLACK
9
- $primary-color: rgb(0 0 0); // BLACK
10
- $secondary-color: rgb(0 0 0); // BLACK
11
- $accent-color: rgb(0 0 0); // BLACK
12
-
13
- // snackbar colours
14
- $snack-success: rgb(76 175 80);
15
- $snack-error: rgb(244 67 54);
16
- $snack-info: rgb(33 150 243);
17
- $snack-default: rgb(153 153 153);
18
-
19
- {{#if stylinNutin}}
20
- /*
21
- Variables used in utility classes
22
- Adapt to customize
23
- */
24
-
25
- // fonts
26
- $primary-font: Arial, Helvetica, sans-serif;
27
- $secondary-font: Arial, Helvetica, sans-serif;
28
-
29
- // font sizes
30
- $font-sizes: (
31
- smallest: 0.75rem, // 12px
32
- small: 0.875rem, // 14px
33
- medium: 1rem, // 16px (base)
34
- large: 1.5rem, // 24px
35
- largest: 2rem, // 32px
36
- );
37
-
38
- // spacing (margin / padding / gap)
39
- $spacings: (
40
- smallest: 0.25rem, // 4px
41
- small: 0.5rem, // 8px
42
- medium: 1rem, // 16px
43
- large: 1.5rem, // 24px
44
- largest: 2rem, // 32px
45
- );
46
-
47
- // border radius
48
- $border-radius: (
49
- small: 2px,
50
- medium: 4px,
51
- large: 8px,
52
- pill: 9999px,
53
- );
54
-
55
- // box sizes
56
- $box-sizes: (
57
- small: 32px,
58
- medium: 64px,
59
- large: 128px,
60
- largest: 256px,
61
- );
62
-
63
- // shadows
64
- $shadows: (
65
- small: 0 1px 2px rgba(0, 0, 0, 0.05),
66
- medium: 0 4px 6px rgba(0, 0, 0, 0.1),
67
- large: 0 10px 15px rgba(0, 0, 0, 0.15),
68
- );
69
-
70
- // breakpoints
71
- $breakpoints: (
72
- small: 576px,
73
- medium: 768px,
74
- large: 992px,
75
- largest: 1201px,
76
- );
77
-
78
- // animations
79
- // transition Duration
80
- $transitions: (
81
- fast: 0.2s,
82
- normal: 0.3s,
83
- slow: 0.5s,
84
- );
85
-
86
- {{/if}}
1
+ // variables
@@ -1,19 +1,2 @@
1
- // Libraries styles (snackbar, popover){{#if transition}}, view transition styles{{/if}}.
2
- @use "core";
3
-
4
- {{#if stylinNutin}}
5
- // built-in classes
6
- @use "utilities";
7
-
8
- {{/if}}
9
- // global styles
1
+ // CSS reset & global styles
10
2
  @use "styles";
11
-
12
- {{#if stylinNutin}}
13
- // custom classes
14
- @use "custom-classes";
15
- // components styles
16
- @use "components";
17
- // views styles
18
- @use "views";
19
- {{/if}}