@analogjs/platform 3.0.0-alpha.2 → 3.0.0-alpha.21

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 (292) hide show
  1. package/package.json +16 -18
  2. package/src/index.d.ts +5 -2
  3. package/src/index.js +9 -3
  4. package/src/index.js.map +1 -0
  5. package/src/lib/clear-client-page-endpoint.d.ts +2 -2
  6. package/src/lib/clear-client-page-endpoint.js +22 -32
  7. package/src/lib/clear-client-page-endpoint.js.map +1 -0
  8. package/src/lib/content/marked/index.d.ts +5 -5
  9. package/src/lib/content/marked/index.js +10 -6
  10. package/src/lib/content/marked/index.js.map +1 -0
  11. package/src/lib/content/marked/marked-content-highlighter.d.ts +2 -4
  12. package/src/lib/content/marked/marked-content-highlighter.js +6 -3
  13. package/src/lib/content/marked/marked-content-highlighter.js.map +1 -0
  14. package/src/lib/content/marked/marked-setup.service.d.ts +8 -8
  15. package/src/lib/content/marked/marked-setup.service.js +44 -54
  16. package/src/lib/content/marked/marked-setup.service.js.map +1 -0
  17. package/src/lib/content/prism/angular.d.ts +1 -0
  18. package/src/lib/content/prism/angular.js +18 -19
  19. package/src/lib/content/prism/angular.js.map +1 -0
  20. package/src/lib/content/prism/index.d.ts +1 -1
  21. package/src/lib/content/prism/index.js +10 -7
  22. package/src/lib/content/prism/index.js.map +1 -0
  23. package/src/lib/content/prism/options.d.ts +1 -1
  24. package/src/lib/content/prism/prism-highlighter.d.ts +5 -5
  25. package/src/lib/content/prism/prism-highlighter.js +33 -33
  26. package/src/lib/content/prism/prism-highlighter.js.map +1 -0
  27. package/src/lib/content/shiki/index.d.ts +3 -3
  28. package/src/lib/content/shiki/index.js +19 -28
  29. package/src/lib/content/shiki/index.js.map +1 -0
  30. package/src/lib/content/shiki/options.d.ts +7 -7
  31. package/src/lib/content/shiki/shiki-highlighter.d.ts +13 -13
  32. package/src/lib/content/shiki/shiki-highlighter.js +45 -44
  33. package/src/lib/content/shiki/shiki-highlighter.js.map +1 -0
  34. package/src/lib/content-plugin.d.ts +19 -19
  35. package/src/lib/content-plugin.js +178 -196
  36. package/src/lib/content-plugin.js.map +1 -0
  37. package/src/lib/deps-plugin.d.ts +2 -2
  38. package/src/lib/deps-plugin.js +73 -82
  39. package/src/lib/deps-plugin.js.map +1 -0
  40. package/src/lib/json-ld-manifest-plugin.d.ts +41 -0
  41. package/src/lib/json-ld-manifest-plugin.js +84 -0
  42. package/src/lib/json-ld-manifest-plugin.js.map +1 -0
  43. package/src/lib/nx-plugin/builders.json +7 -0
  44. package/src/lib/nx-plugin/executors.json +5 -0
  45. package/src/lib/nx-plugin/generators.json +25 -0
  46. package/src/lib/nx-plugin/package.json +1 -5
  47. package/src/lib/nx-plugin/src/executors/vite/compat.d.ts +3 -2
  48. package/src/lib/nx-plugin/src/executors/vite/compat.js +6 -6
  49. package/src/lib/nx-plugin/src/executors/vite/compat.js.map +1 -1
  50. package/src/lib/nx-plugin/src/executors/vite/schema.d.ts +1 -1
  51. package/src/lib/nx-plugin/src/executors/vite/vite.impl.d.ts +1 -1
  52. package/src/lib/nx-plugin/src/executors/vite/vite.impl.js +5 -4
  53. package/src/lib/nx-plugin/src/executors/vite/vite.impl.js.map +1 -1
  54. package/src/lib/nx-plugin/src/executors/vite-dev-server/compat.d.ts +3 -2
  55. package/src/lib/nx-plugin/src/executors/vite-dev-server/compat.js +6 -6
  56. package/src/lib/nx-plugin/src/executors/vite-dev-server/compat.js.map +1 -1
  57. package/src/lib/nx-plugin/src/executors/vite-dev-server/schema.d.ts +1 -1
  58. package/src/lib/nx-plugin/src/executors/vite-dev-server/vite-dev-server.impl.d.ts +1 -1
  59. package/src/lib/nx-plugin/src/executors/vite-dev-server/vite-dev-server.impl.js +5 -4
  60. package/src/lib/nx-plugin/src/executors/vite-dev-server/vite-dev-server.impl.js.map +1 -1
  61. package/src/lib/nx-plugin/src/executors/vitest/compat.d.ts +3 -2
  62. package/src/lib/nx-plugin/src/executors/vitest/compat.js +6 -6
  63. package/src/lib/nx-plugin/src/executors/vitest/compat.js.map +1 -1
  64. package/src/lib/nx-plugin/src/executors/vitest/schema.d.ts +1 -1
  65. package/src/lib/nx-plugin/src/executors/vitest/vitest.impl.d.ts +1 -1
  66. package/src/lib/nx-plugin/src/executors/vitest/vitest.impl.js +5 -4
  67. package/src/lib/nx-plugin/src/executors/vitest/vitest.impl.js.map +1 -1
  68. package/src/lib/nx-plugin/src/generators/app/compat.d.ts +9 -2
  69. package/src/lib/nx-plugin/src/generators/app/compat.js +17 -6
  70. package/src/lib/nx-plugin/src/generators/app/compat.js.map +1 -1
  71. package/src/lib/nx-plugin/src/generators/app/files/root/tsconfig.base.json +3 -6
  72. package/src/lib/nx-plugin/src/generators/app/files/template-angular/src/test-setup.ts__template__ +1 -0
  73. package/src/lib/nx-plugin/src/generators/app/files/template-angular/tsconfig.app.json__template__ +1 -3
  74. package/src/lib/nx-plugin/src/generators/app/files/template-angular/tsconfig.json__template__ +2 -1
  75. package/src/lib/nx-plugin/src/generators/app/files/template-angular/vite.config.ts__template__ +6 -0
  76. package/src/lib/nx-plugin/src/generators/app/files/template-angular-v17/src/app/app.config.ts__template__ +0 -6
  77. package/src/lib/nx-plugin/src/generators/app/files/template-angular-v17/tsconfig.json__template__ +4 -2
  78. package/src/lib/nx-plugin/src/generators/app/files/template-angular-v17/vite.config.ts__template__ +0 -18
  79. package/src/lib/nx-plugin/src/generators/app/files/template-angular-v18/src/app/app.config.ts__template__ +0 -6
  80. package/src/lib/nx-plugin/src/generators/app/files/template-angular-v18/tsconfig.json__template__ +4 -2
  81. package/src/lib/nx-plugin/src/generators/app/files/template-angular-v18/vite.config.ts__template__ +0 -18
  82. package/src/lib/nx-plugin/src/generators/app/files/template-angular-v19/src/app/app.config.ts__template__ +0 -6
  83. package/src/lib/nx-plugin/src/generators/app/files/template-angular-v19/tsconfig.app.json__template__ +1 -3
  84. package/src/lib/nx-plugin/src/generators/app/files/template-angular-v19/tsconfig.json__template__ +4 -2
  85. package/src/lib/nx-plugin/src/generators/app/files/template-angular-v19/vite.config.ts__template__ +0 -9
  86. package/src/lib/nx-plugin/src/generators/app/generator.d.ts +11 -11
  87. package/src/lib/nx-plugin/src/generators/app/generator.js +78 -88
  88. package/src/lib/nx-plugin/src/generators/app/generator.js.map +1 -1
  89. package/src/lib/nx-plugin/src/generators/app/lib/add-analog-dependencies.d.ts +1 -1
  90. package/src/lib/nx-plugin/src/generators/app/lib/add-analog-project-config.d.ts +1 -1
  91. package/src/lib/nx-plugin/src/generators/app/lib/add-analog-project-config.js +72 -89
  92. package/src/lib/nx-plugin/src/generators/app/lib/add-analog-project-config.js.map +1 -1
  93. package/src/lib/nx-plugin/src/generators/app/lib/add-angular-app.d.ts +2 -2
  94. package/src/lib/nx-plugin/src/generators/app/lib/add-angular-app.js +24 -58
  95. package/src/lib/nx-plugin/src/generators/app/lib/add-angular-app.js.map +1 -1
  96. package/src/lib/nx-plugin/src/generators/app/lib/add-eslint.d.ts +2 -2
  97. package/src/lib/nx-plugin/src/generators/app/lib/add-files.d.ts +2 -2
  98. package/src/lib/nx-plugin/src/generators/app/lib/add-files.js +15 -16
  99. package/src/lib/nx-plugin/src/generators/app/lib/add-files.js.map +1 -1
  100. package/src/lib/nx-plugin/src/generators/app/lib/add-home-page.d.ts +2 -2
  101. package/src/lib/nx-plugin/src/generators/app/lib/add-home-page.js +14 -13
  102. package/src/lib/nx-plugin/src/generators/app/lib/add-home-page.js.map +1 -1
  103. package/src/lib/nx-plugin/src/generators/app/lib/add-tailwind-config.d.ts +7 -7
  104. package/src/lib/nx-plugin/src/generators/app/lib/add-tailwind-config.js +15 -30
  105. package/src/lib/nx-plugin/src/generators/app/lib/add-tailwind-config.js.map +1 -1
  106. package/src/lib/nx-plugin/src/generators/app/lib/add-tailwind-helpers.d.ts +3 -5
  107. package/src/lib/nx-plugin/src/generators/app/lib/add-tailwind-helpers.js +49 -147
  108. package/src/lib/nx-plugin/src/generators/app/lib/add-tailwind-helpers.js.map +1 -1
  109. package/src/lib/nx-plugin/src/generators/app/lib/add-vite-plugin.d.ts +1 -1
  110. package/src/lib/nx-plugin/src/generators/app/lib/cleanup-files.d.ts +2 -2
  111. package/src/lib/nx-plugin/src/generators/app/lib/cleanup-files.js +17 -20
  112. package/src/lib/nx-plugin/src/generators/app/lib/cleanup-files.js.map +1 -1
  113. package/src/lib/nx-plugin/src/generators/app/lib/initialize-analog-workspace.d.ts +2 -2
  114. package/src/lib/nx-plugin/src/generators/app/lib/update-index-html.d.ts +1 -1
  115. package/src/lib/nx-plugin/src/generators/app/lib/update-index-html.js +14 -12
  116. package/src/lib/nx-plugin/src/generators/app/lib/update-index-html.js.map +1 -1
  117. package/src/lib/nx-plugin/src/generators/app/versions/minimum-supported-versions.d.ts +4 -5
  118. package/src/lib/nx-plugin/src/generators/app/versions/minimum-supported-versions.js +6 -10
  119. package/src/lib/nx-plugin/src/generators/app/versions/minimum-supported-versions.js.map +1 -1
  120. package/src/lib/nx-plugin/src/generators/app/versions/nx-dependencies.d.ts +0 -3
  121. package/src/lib/nx-plugin/src/generators/app/versions/nx_17_X/versions.d.ts +0 -5
  122. package/src/lib/nx-plugin/src/generators/app/versions/nx_18_X/versions.d.ts +9 -16
  123. package/src/lib/nx-plugin/src/generators/app/versions/nx_18_X/versions.js +7 -37
  124. package/src/lib/nx-plugin/src/generators/app/versions/nx_18_X/versions.js.map +1 -1
  125. package/src/lib/nx-plugin/src/generators/app/versions/tailwind-dependencies.d.ts +1 -1
  126. package/src/lib/nx-plugin/src/generators/app/versions/tailwind-dependencies.js +9 -15
  127. package/src/lib/nx-plugin/src/generators/app/versions/tailwind-dependencies.js.map +1 -1
  128. package/src/lib/nx-plugin/src/generators/app/versions.d.ts +0 -28
  129. package/src/lib/nx-plugin/src/generators/init/compat.d.ts +9 -2
  130. package/src/lib/nx-plugin/src/generators/init/compat.js +17 -6
  131. package/src/lib/nx-plugin/src/generators/init/compat.js.map +1 -1
  132. package/src/lib/nx-plugin/src/generators/init/generator.d.ts +3 -3
  133. package/src/lib/nx-plugin/src/generators/init/generator.js +54 -55
  134. package/src/lib/nx-plugin/src/generators/init/generator.js.map +1 -1
  135. package/src/lib/nx-plugin/src/generators/init/lib/add-analog-dependencies.d.ts +1 -1
  136. package/src/lib/nx-plugin/src/generators/init/lib/add-analog-dependencies.js +19 -20
  137. package/src/lib/nx-plugin/src/generators/init/lib/add-analog-dependencies.js.map +1 -1
  138. package/src/lib/nx-plugin/src/generators/init/lib/update-app-tsconfig.d.ts +2 -2
  139. package/src/lib/nx-plugin/src/generators/init/lib/update-app-tsconfig.js +20 -18
  140. package/src/lib/nx-plugin/src/generators/init/lib/update-app-tsconfig.js.map +1 -1
  141. package/src/lib/nx-plugin/src/generators/init/lib/update-build-target.d.ts +2 -2
  142. package/src/lib/nx-plugin/src/generators/init/lib/update-build-target.js +56 -57
  143. package/src/lib/nx-plugin/src/generators/init/lib/update-build-target.js.map +1 -1
  144. package/src/lib/nx-plugin/src/generators/init/lib/update-git-ignore.d.ts +1 -1
  145. package/src/lib/nx-plugin/src/generators/init/lib/update-git-ignore.js +12 -11
  146. package/src/lib/nx-plugin/src/generators/init/lib/update-git-ignore.js.map +1 -1
  147. package/src/lib/nx-plugin/src/generators/init/lib/update-index-html.d.ts +2 -2
  148. package/src/lib/nx-plugin/src/generators/init/lib/update-index-html.js +17 -15
  149. package/src/lib/nx-plugin/src/generators/init/lib/update-index-html.js.map +1 -1
  150. package/src/lib/nx-plugin/src/generators/init/lib/update-main.d.ts +2 -2
  151. package/src/lib/nx-plugin/src/generators/init/lib/update-main.js +12 -12
  152. package/src/lib/nx-plugin/src/generators/init/lib/update-main.js.map +1 -1
  153. package/src/lib/nx-plugin/src/generators/init/lib/update-package-json.d.ts +2 -2
  154. package/src/lib/nx-plugin/src/generators/init/lib/update-package-json.js +19 -25
  155. package/src/lib/nx-plugin/src/generators/init/lib/update-package-json.js.map +1 -1
  156. package/src/lib/nx-plugin/src/generators/init/lib/update-serve-target.d.ts +2 -2
  157. package/src/lib/nx-plugin/src/generators/init/lib/update-serve-target.js +43 -45
  158. package/src/lib/nx-plugin/src/generators/init/lib/update-serve-target.js.map +1 -1
  159. package/src/lib/nx-plugin/src/generators/init/lib/update-test-target.d.ts +2 -2
  160. package/src/lib/nx-plugin/src/generators/init/lib/update-test-target.js +27 -28
  161. package/src/lib/nx-plugin/src/generators/init/lib/update-test-target.js.map +1 -1
  162. package/src/lib/nx-plugin/src/generators/init/lib/update-test-tsconfig.d.ts +2 -2
  163. package/src/lib/nx-plugin/src/generators/init/lib/update-test-tsconfig.js +19 -17
  164. package/src/lib/nx-plugin/src/generators/init/lib/update-test-tsconfig.js.map +1 -1
  165. package/src/lib/nx-plugin/src/generators/init/test-files/src/test-setup.ts__template__ +1 -0
  166. package/src/lib/nx-plugin/src/generators/page/compat.d.ts +9 -0
  167. package/src/lib/nx-plugin/src/generators/page/compat.js +18 -0
  168. package/src/lib/nx-plugin/src/generators/page/compat.js.map +1 -0
  169. package/src/lib/nx-plugin/src/generators/page/generator.d.ts +3 -4
  170. package/src/lib/nx-plugin/src/generators/page/generator.js +33 -44
  171. package/src/lib/nx-plugin/src/generators/page/generator.js.map +1 -1
  172. package/src/lib/nx-plugin/src/generators/preset/__snapshots__/generator.spec.ts.snap +5 -3
  173. package/src/lib/nx-plugin/src/generators/preset/generator.d.ts +3 -3
  174. package/src/lib/nx-plugin/src/generators/preset/generator.js +17 -43
  175. package/src/lib/nx-plugin/src/generators/preset/generator.js.map +1 -1
  176. package/src/lib/nx-plugin/src/generators/setup-vitest/compat.d.ts +9 -2
  177. package/src/lib/nx-plugin/src/generators/setup-vitest/compat.js +17 -6
  178. package/src/lib/nx-plugin/src/generators/setup-vitest/compat.js.map +1 -1
  179. package/src/lib/nx-plugin/src/generators/setup-vitest/files/src/test-setup.ts__template__ +1 -0
  180. package/src/lib/nx-plugin/src/generators/setup-vitest/generator.d.ts +3 -3
  181. package/src/lib/nx-plugin/src/generators/setup-vitest/generator.js +35 -32
  182. package/src/lib/nx-plugin/src/generators/setup-vitest/generator.js.map +1 -1
  183. package/src/lib/nx-plugin/src/generators/setup-vitest/lib/add-analog-dependencies.d.ts +1 -1
  184. package/src/lib/nx-plugin/src/generators/setup-vitest/lib/add-analog-dependencies.js +7 -7
  185. package/src/lib/nx-plugin/src/generators/setup-vitest/lib/add-analog-dependencies.js.map +1 -1
  186. package/src/lib/nx-plugin/src/generators/setup-vitest/lib/update-test-target.d.ts +2 -2
  187. package/src/lib/nx-plugin/src/generators/setup-vitest/lib/update-test-target.js +20 -21
  188. package/src/lib/nx-plugin/src/generators/setup-vitest/lib/update-test-target.js.map +1 -1
  189. package/src/lib/nx-plugin/src/generators/setup-vitest/lib/update-tsconfig.d.ts +2 -2
  190. package/src/lib/nx-plugin/src/generators/setup-vitest/lib/update-tsconfig.js +19 -19
  191. package/src/lib/nx-plugin/src/generators/setup-vitest/lib/update-tsconfig.js.map +1 -1
  192. package/src/lib/nx-plugin/src/index.js +0 -1
  193. package/src/lib/nx-plugin/src/utils/version-utils.d.ts +1 -1
  194. package/src/lib/nx-plugin/src/utils/version-utils.js +20 -18
  195. package/src/lib/nx-plugin/src/utils/version-utils.js.map +1 -1
  196. package/src/lib/nx-plugin/src/utils/versions/dependencies.js +42 -62
  197. package/src/lib/nx-plugin/src/utils/versions/dependencies.js.map +1 -1
  198. package/src/lib/nx-plugin/src/utils/versions/dev-dependencies.js +49 -83
  199. package/src/lib/nx-plugin/src/utils/versions/dev-dependencies.js.map +1 -1
  200. package/src/lib/nx-plugin/src/utils/versions/ng_17_X/versions.js +33 -20
  201. package/src/lib/nx-plugin/src/utils/versions/ng_17_X/versions.js.map +1 -1
  202. package/src/lib/nx-plugin/src/utils/versions/ng_18_X/versions.js +33 -20
  203. package/src/lib/nx-plugin/src/utils/versions/ng_18_X/versions.js.map +1 -1
  204. package/src/lib/nx-plugin/src/utils/versions/ng_19_X/versions.d.ts +7 -7
  205. package/src/lib/nx-plugin/src/utils/versions/ng_19_X/versions.js +37 -23
  206. package/src/lib/nx-plugin/src/utils/versions/ng_19_X/versions.js.map +1 -1
  207. package/src/lib/options.d.ts +158 -80
  208. package/src/lib/platform-plugin.d.ts +2 -2
  209. package/src/lib/platform-plugin.js +67 -61
  210. package/src/lib/platform-plugin.js.map +1 -0
  211. package/src/lib/route-file-discovery.d.ts +23 -0
  212. package/src/lib/route-file-discovery.js +114 -0
  213. package/src/lib/route-file-discovery.js.map +1 -0
  214. package/src/lib/route-generation-plugin.d.ts +3 -0
  215. package/src/lib/route-generation-plugin.js +34 -0
  216. package/src/lib/route-generation-plugin.js.map +1 -0
  217. package/src/lib/route-manifest.d.ts +120 -0
  218. package/src/lib/route-manifest.js +411 -0
  219. package/src/lib/route-manifest.js.map +1 -0
  220. package/src/lib/router-plugin.d.ts +19 -19
  221. package/src/lib/router-plugin.js +193 -150
  222. package/src/lib/router-plugin.js.map +1 -0
  223. package/src/lib/ssr/inject-html-plugin.d.ts +1 -1
  224. package/src/lib/ssr/inject-html-plugin.js +25 -25
  225. package/src/lib/ssr/inject-html-plugin.js.map +1 -0
  226. package/src/lib/ssr/ssr-build-plugin.d.ts +18 -2
  227. package/src/lib/ssr/ssr-build-plugin.js +54 -30
  228. package/src/lib/ssr/ssr-build-plugin.js.map +1 -0
  229. package/src/lib/tailwind-preprocessor.d.ts +23 -0
  230. package/src/lib/tailwind-preprocessor.js +33 -0
  231. package/src/lib/tailwind-preprocessor.js.map +1 -0
  232. package/src/lib/typed-routes-plugin.d.ts +50 -0
  233. package/src/lib/typed-routes-plugin.js +204 -0
  234. package/src/lib/typed-routes-plugin.js.map +1 -0
  235. package/src/lib/utils/rolldown.d.ts +3 -0
  236. package/src/lib/utils/rolldown.js +15 -0
  237. package/src/lib/utils/rolldown.js.map +1 -0
  238. package/src/server-mode-plugin.d.ts +6 -6
  239. package/src/server-mode-plugin.js +16 -18
  240. package/src/server-mode-plugin.js.map +1 -0
  241. package/README.md +0 -5
  242. package/src/lib/content/prism/options.js +0 -1
  243. package/src/lib/content/shiki/options.js +0 -1
  244. package/src/lib/nx-plugin/README.md +0 -23
  245. package/src/lib/nx-plugin/src/generators/app/files/tailwind/v2/postcss.config.cjs__template__ +0 -10
  246. package/src/lib/nx-plugin/src/generators/app/files/tailwind/v2/tailwind.config.cjs__template__ +0 -14
  247. package/src/lib/nx-plugin/src/generators/app/files/tailwind/v3/postcss.config.cjs__template__ +0 -10
  248. package/src/lib/nx-plugin/src/generators/app/files/tailwind/v3/tailwind.config.ts__template__ +0 -14
  249. package/src/lib/nx-plugin/src/generators/app/files/tailwind/v4/.postcssrc.json +0 -5
  250. package/src/lib/nx-plugin/src/generators/app/files/tailwind/v4/tailwind.config.ts__template__ +0 -14
  251. package/src/lib/nx-plugin/src/generators/app/files/template-angular-v15/index.html__template__ +0 -15
  252. package/src/lib/nx-plugin/src/generators/app/files/template-angular-v15/src/app/app.component.spec.ts__template__ +0 -17
  253. package/src/lib/nx-plugin/src/generators/app/files/template-angular-v15/src/app/app.component.ts__template__ +0 -10
  254. package/src/lib/nx-plugin/src/generators/app/files/template-angular-v15/src/favicon.ico__template__ +0 -0
  255. package/src/lib/nx-plugin/src/generators/app/files/template-angular-v15/src/main.providers.ts__template__ +0 -5
  256. package/src/lib/nx-plugin/src/generators/app/files/template-angular-v15/src/main.server.ts__template__ +0 -23
  257. package/src/lib/nx-plugin/src/generators/app/files/template-angular-v15/src/main.ts__template__ +0 -17
  258. package/src/lib/nx-plugin/src/generators/app/files/template-angular-v15/src/public/assets/.gitkeep__template__ +0 -0
  259. package/src/lib/nx-plugin/src/generators/app/files/template-angular-v15/src/public/assets/analog.svg__template__ +0 -1
  260. package/src/lib/nx-plugin/src/generators/app/files/template-angular-v15/src/public/assets/vite.svg__template__ +0 -1
  261. package/src/lib/nx-plugin/src/generators/app/files/template-angular-v15/src/server/routes/v1/hello.ts__template__ +0 -3
  262. package/src/lib/nx-plugin/src/generators/app/files/template-angular-v15/src/styles.css__template__ +0 -4
  263. package/src/lib/nx-plugin/src/generators/app/files/template-angular-v15/src/test-setup.ts__template__ +0 -12
  264. package/src/lib/nx-plugin/src/generators/app/files/template-angular-v15/src/vite-env.d.ts__template__ +0 -1
  265. package/src/lib/nx-plugin/src/generators/app/files/template-angular-v15/tsconfig.app.json__template__ +0 -16
  266. package/src/lib/nx-plugin/src/generators/app/files/template-angular-v15/tsconfig.editor.json__template__ +0 -7
  267. package/src/lib/nx-plugin/src/generators/app/files/template-angular-v15/tsconfig.json__template__ +0 -32
  268. package/src/lib/nx-plugin/src/generators/app/files/template-angular-v15/tsconfig.spec.json__template__ +0 -14
  269. package/src/lib/nx-plugin/src/generators/app/files/template-angular-v15/vite.config.ts__template__ +0 -69
  270. package/src/lib/nx-plugin/src/generators/app/lib/add-analog-dependencies.js +0 -15
  271. package/src/lib/nx-plugin/src/generators/app/lib/add-analog-dependencies.js.map +0 -1
  272. package/src/lib/nx-plugin/src/generators/app/lib/add-eslint.js +0 -58
  273. package/src/lib/nx-plugin/src/generators/app/lib/add-eslint.js.map +0 -1
  274. package/src/lib/nx-plugin/src/generators/app/lib/add-vite-plugin.js +0 -47
  275. package/src/lib/nx-plugin/src/generators/app/lib/add-vite-plugin.js.map +0 -1
  276. package/src/lib/nx-plugin/src/generators/app/lib/initialize-analog-workspace.js +0 -107
  277. package/src/lib/nx-plugin/src/generators/app/lib/initialize-analog-workspace.js.map +0 -1
  278. package/src/lib/nx-plugin/src/generators/app/versions/dependencies.js +0 -56
  279. package/src/lib/nx-plugin/src/generators/app/versions/dependencies.js.map +0 -1
  280. package/src/lib/nx-plugin/src/generators/app/versions/dev-dependencies.js +0 -72
  281. package/src/lib/nx-plugin/src/generators/app/versions/dev-dependencies.js.map +0 -1
  282. package/src/lib/nx-plugin/src/generators/app/versions/nx-dependencies.js +0 -46
  283. package/src/lib/nx-plugin/src/generators/app/versions/nx-dependencies.js.map +0 -1
  284. package/src/lib/nx-plugin/src/generators/app/versions/nx_17_X/versions.js +0 -37
  285. package/src/lib/nx-plugin/src/generators/app/versions/nx_17_X/versions.js.map +0 -1
  286. package/src/lib/nx-plugin/src/generators/app/versions.js +0 -43
  287. package/src/lib/nx-plugin/src/generators/app/versions.js.map +0 -1
  288. package/src/lib/nx-plugin/src/index.d.ts +0 -0
  289. package/src/lib/nx-plugin/src/index.js.map +0 -1
  290. package/src/lib/options.js +0 -1
  291. package/src/lib/ssr/ssr-xhr-plugin.d.ts +0 -2
  292. package/src/lib/ssr/ssr-xhr-plugin.js +0 -28
@@ -1,61 +1,27 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.addAngularApp = addAngularApp;
37
- const devkit_1 = require("@nx/devkit");
1
+ let _nx_devkit = require("@nx/devkit");
2
+ //#region packages/nx-plugin/src/generators/app/lib/add-angular-app.ts
38
3
  async function addAngularApp(tree, options) {
39
- const isNx = tree.exists('/nx.json');
40
- const appsDir = isNx ? (0, devkit_1.getWorkspaceLayout)(tree).appsDir : 'projects';
41
- const appOptions = {
42
- name: options.analogAppName,
43
- directory: `${appsDir}/${options.analogAppName}`,
44
- linter: !isNx || process.env['NODE_ENV'] === 'test' ? 'none' : 'eslint',
45
- unitTestRunner: 'vitest',
46
- standalone: true,
47
- ssr: false,
48
- bundler: 'esbuild',
49
- serverRouting: false,
50
- skipFormat: true,
51
- tags: options.tags,
52
- };
53
- await (await Promise.resolve().then(() => __importStar(require(
54
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
55
- // @ts-ignore
56
- '@nx/angular/generators')))).applicationGenerator(tree, {
57
- ...appOptions,
58
- directory: `${appsDir}/${options.analogAppName}`,
59
- });
4
+ const isNx = tree.exists("/nx.json");
5
+ const appsDir = isNx ? (0, _nx_devkit.getWorkspaceLayout)(tree).appsDir : "projects";
6
+ const appOptions = {
7
+ name: options.analogAppName,
8
+ directory: `${appsDir}/${options.analogAppName}`,
9
+ linter: !isNx || process.env.NODE_ENV === "test" ? "none" : "eslint",
10
+ e2eTestRunner: "none",
11
+ unitTestRunner: "vitest",
12
+ standalone: true,
13
+ ssr: false,
14
+ bundler: "esbuild",
15
+ serverRouting: false,
16
+ skipFormat: true,
17
+ tags: options.tags
18
+ };
19
+ await (await import("@nx/angular/generators")).applicationGenerator(tree, {
20
+ ...appOptions,
21
+ directory: `${appsDir}/${options.analogAppName}`
22
+ });
60
23
  }
24
+ //#endregion
25
+ exports.addAngularApp = addAngularApp;
26
+
61
27
  //# sourceMappingURL=add-angular-app.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"add-angular-app.js","sourceRoot":"","sources":["../../../../../../../../../../packages/nx-plugin/src/generators/app/lib/add-angular-app.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,sCA4BC;AA/BD,uCAAsD;AAG/C,KAAK,UAAU,aAAa,CAAC,IAAU,EAAE,OAA0B;IACxE,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IACrC,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,IAAA,2BAAkB,EAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC;IAErE,MAAM,UAAU,GACd;QACE,IAAI,EAAE,OAAO,CAAC,aAAa;QAC3B,SAAS,EAAE,GAAG,OAAO,IAAI,OAAO,CAAC,aAAa,EAAE;QAChD,MAAM,EAAE,CAAC,IAAI,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ;QACvE,cAAc,EAAE,QAAQ;QACxB,UAAU,EAAE,IAAI;QAChB,GAAG,EAAE,KAAK;QACV,OAAO,EAAE,SAAS;QAClB,aAAa,EAAE,KAAK;QACpB,UAAU,EAAE,IAAI;QAChB,IAAI,EAAE,OAAO,CAAC,IAAI;KACnB,CAAC;IAEJ,MAAM,CACJ;IACE,6DAA6D;IAC7D,aAAa;IACb,wBAAwB,GACzB,CACF,CAAC,oBAAoB,CAAC,IAAI,EAAE;QAC3B,GAAG,UAAU;QACb,SAAS,EAAE,GAAG,OAAO,IAAI,OAAO,CAAC,aAAa,EAAE;KACjD,CAAC,CAAC;AACL,CAAC"}
1
+ {"version":3,"file":"add-angular-app.js","names":[],"sources":["../../../../../../../../../nx-plugin/src/generators/app/lib/add-angular-app.ts"],"sourcesContent":["import { getWorkspaceLayout, Tree } from '@nx/devkit';\nimport { NormalizedOptions } from '../generator';\n\nexport async function addAngularApp(\n tree: Tree,\n options: NormalizedOptions,\n): Promise<void> {\n const isNx = tree.exists('/nx.json');\n const appsDir = isNx ? getWorkspaceLayout(tree).appsDir : 'projects';\n\n const appOptions: typeof import('@nx/angular/src/generators/application/schema') =\n {\n name: options.analogAppName,\n directory: `${appsDir}/${options.analogAppName}`,\n linter: !isNx || process.env['NODE_ENV'] === 'test' ? 'none' : 'eslint',\n e2eTestRunner: 'none',\n unitTestRunner: 'vitest',\n standalone: true,\n ssr: false,\n bundler: 'esbuild',\n serverRouting: false,\n skipFormat: true,\n tags: options.tags,\n };\n\n await (\n await import(\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n '@nx/angular/generators'\n )\n ).applicationGenerator(tree, {\n ...appOptions,\n directory: `${appsDir}/${options.analogAppName}`,\n });\n}\n"],"mappings":";;AAGA,eAAsB,cACpB,MACA,SACe;CACf,MAAM,OAAO,KAAK,OAAO,WAAW;CACpC,MAAM,UAAU,QAAA,GAAA,WAAA,oBAA0B,KAAK,CAAC,UAAU;CAE1D,MAAM,aACJ;EACE,MAAM,QAAQ;EACd,WAAW,GAAG,QAAQ,GAAG,QAAQ;EACjC,QAAQ,CAAC,QAAA,QAAA,IAAA,aAAoC,SAAS,SAAS;EAC/D,eAAe;EACf,gBAAgB;EAChB,YAAY;EACZ,KAAK;EACL,SAAS;EACT,eAAe;EACf,YAAY;EACZ,MAAM,QAAQ;EACf;AAEH,QACE,MAAM,OAGJ,2BAEF,qBAAqB,MAAM;EAC3B,GAAG;EACH,WAAW,GAAG,QAAQ,GAAG,QAAQ;EAClC,CAAC"}
@@ -1,3 +1,3 @@
1
- import { Tree } from '@nx/devkit';
2
- import { NormalizedOptions } from '../generator';
1
+ import { Tree } from "@nx/devkit";
2
+ import { NormalizedOptions } from "../generator";
3
3
  export declare function addEslint(tree: Tree, majorNxVersion: number, options: NormalizedOptions): Promise<void>;
@@ -1,3 +1,3 @@
1
- import { Tree } from '@nx/devkit';
2
- import { NormalizedOptions } from '../generator';
1
+ import { Tree } from "@nx/devkit";
2
+ import { NormalizedOptions } from "../generator";
3
3
  export declare function addFiles(tree: Tree, options: NormalizedOptions, majorAngularVersion: number): void;
@@ -1,19 +1,18 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addFiles = addFiles;
4
- const devkit_1 = require("@nx/devkit");
5
- const node_path_1 = require("node:path");
1
+ let _nx_devkit = require("@nx/devkit");
2
+ let node_path = require("node:path");
3
+ //#region packages/nx-plugin/src/generators/app/lib/add-files.ts
6
4
  function addFiles(tree, options, majorAngularVersion) {
7
- const isNx = tree.exists('/nx.json');
8
- const templateOptions = {
9
- ...options,
10
- template: '',
11
- tsconfig: isNx ? 'tsconfig.base.json' : 'tsconfig.json',
12
- majorAngularVersion,
13
- };
14
- (0, devkit_1.generateFiles)(tree, (0, node_path_1.join)(__dirname, '..', 'files', 'template-angular'), options.projectRoot, templateOptions);
15
- if (!tree.exists('/angular.json') && !tree.exists('/tsconfig.base.json')) {
16
- (0, devkit_1.generateFiles)(tree, (0, node_path_1.join)(__dirname, '..', 'files', 'root'), '.', templateOptions);
17
- }
5
+ const isNx = tree.exists("/nx.json");
6
+ const templateOptions = {
7
+ ...options,
8
+ template: "",
9
+ tsconfig: isNx ? "tsconfig.base.json" : "tsconfig.json",
10
+ majorAngularVersion
11
+ };
12
+ (0, _nx_devkit.generateFiles)(tree, (0, node_path.join)(__dirname, "..", "files", "template-angular"), options.projectRoot, templateOptions);
13
+ if (!tree.exists("/angular.json") && !tree.exists("/tsconfig.base.json")) (0, _nx_devkit.generateFiles)(tree, (0, node_path.join)(__dirname, "..", "files", "root"), ".", templateOptions);
18
14
  }
15
+ //#endregion
16
+ exports.addFiles = addFiles;
17
+
19
18
  //# sourceMappingURL=add-files.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"add-files.js","sourceRoot":"","sources":["../../../../../../../../../../packages/nx-plugin/src/generators/app/lib/add-files.ts"],"names":[],"mappings":";;AAIA,4BA2BC;AA/BD,uCAAiD;AACjD,yCAAiC;AAGjC,SAAgB,QAAQ,CACtB,IAAU,EACV,OAA0B,EAC1B,mBAA2B;IAE3B,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IACrC,MAAM,eAAe,GAAG;QACtB,GAAG,OAAO;QACV,QAAQ,EAAE,EAAE;QACZ,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,eAAe;QACvD,mBAAmB;KACpB,CAAC;IACF,IAAA,sBAAa,EACX,IAAI,EACJ,IAAA,gBAAI,EAAC,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,kBAAkB,CAAC,EAClD,OAAO,CAAC,WAAW,EACnB,eAAe,CAChB,CAAC;IAEF,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,qBAAqB,CAAC,EAAE,CAAC;QACzE,IAAA,sBAAa,EACX,IAAI,EACJ,IAAA,gBAAI,EAAC,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,EACtC,GAAG,EACH,eAAe,CAChB,CAAC;IACJ,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"add-files.js","names":[],"sources":["../../../../../../../../../nx-plugin/src/generators/app/lib/add-files.ts"],"sourcesContent":["import { generateFiles, Tree } from '@nx/devkit';\nimport { join } from 'node:path';\nimport { NormalizedOptions } from '../generator';\n\nexport function addFiles(\n tree: Tree,\n options: NormalizedOptions,\n majorAngularVersion: number,\n): void {\n const isNx = tree.exists('/nx.json');\n const templateOptions = {\n ...options,\n template: '',\n tsconfig: isNx ? 'tsconfig.base.json' : 'tsconfig.json',\n majorAngularVersion,\n };\n generateFiles(\n tree,\n join(__dirname, '..', 'files', 'template-angular'),\n options.projectRoot,\n templateOptions,\n );\n\n if (!tree.exists('/angular.json') && !tree.exists('/tsconfig.base.json')) {\n generateFiles(\n tree,\n join(__dirname, '..', 'files', 'root'),\n '.',\n templateOptions,\n );\n }\n}\n"],"mappings":";;;AAIA,SAAgB,SACd,MACA,SACA,qBACM;CACN,MAAM,OAAO,KAAK,OAAO,WAAW;CACpC,MAAM,kBAAkB;EACtB,GAAG;EACH,UAAU;EACV,UAAU,OAAO,uBAAuB;EACxC;EACD;AACD,EAAA,GAAA,WAAA,eACE,OAAA,GAAA,UAAA,MACK,WAAW,MAAM,SAAS,mBAAmB,EAClD,QAAQ,aACR,gBACD;AAED,KAAI,CAAC,KAAK,OAAO,gBAAgB,IAAI,CAAC,KAAK,OAAO,sBAAsB,CACtE,EAAA,GAAA,WAAA,eACE,OAAA,GAAA,UAAA,MACK,WAAW,MAAM,SAAS,OAAO,EACtC,KACA,gBACD"}
@@ -1,3 +1,3 @@
1
- import { Tree } from '@nx/devkit';
2
- import { NormalizedOptions } from '../generator';
1
+ import { Tree } from "@nx/devkit";
2
+ import { NormalizedOptions } from "../generator";
3
3
  export declare function addHomePage(tree: Tree, options: NormalizedOptions, majorAngularVersion: number): void;
@@ -1,16 +1,17 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addHomePage = addHomePage;
4
- const devkit_1 = require("@nx/devkit");
5
- const node_path_1 = require("node:path");
1
+ let _nx_devkit = require("@nx/devkit");
2
+ let node_path = require("node:path");
3
+ //#region packages/nx-plugin/src/generators/app/lib/add-home-page.ts
6
4
  function addHomePage(tree, options, majorAngularVersion) {
7
- const templateOptions = {
8
- ...options,
9
- template: '',
10
- majorAngularVersion,
11
- };
12
- (0, devkit_1.generateFiles)(tree, (0, node_path_1.join)(__dirname, '..', 'files', 'index-page'), options.projectRoot, templateOptions);
13
- const pageDirectory = options.addTailwind ? 'tailwind' : 'css';
14
- (0, devkit_1.generateFiles)(tree, (0, node_path_1.join)(__dirname, '..', 'files', 'welcome-components', pageDirectory), options.projectRoot, templateOptions);
5
+ const templateOptions = {
6
+ ...options,
7
+ template: "",
8
+ majorAngularVersion
9
+ };
10
+ (0, _nx_devkit.generateFiles)(tree, (0, node_path.join)(__dirname, "..", "files", "index-page"), options.projectRoot, templateOptions);
11
+ const pageDirectory = options.addTailwind ? "tailwind" : "css";
12
+ (0, _nx_devkit.generateFiles)(tree, (0, node_path.join)(__dirname, "..", "files", "welcome-components", pageDirectory), options.projectRoot, templateOptions);
15
13
  }
14
+ //#endregion
15
+ exports.addHomePage = addHomePage;
16
+
16
17
  //# sourceMappingURL=add-home-page.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"add-home-page.js","sourceRoot":"","sources":["../../../../../../../../../../packages/nx-plugin/src/generators/app/lib/add-home-page.ts"],"names":[],"mappings":";;AAIA,kCA0BC;AA9BD,uCAAiD;AACjD,yCAAiC;AAGjC,SAAgB,WAAW,CACzB,IAAU,EACV,OAA0B,EAC1B,mBAA2B;IAE3B,MAAM,eAAe,GAAG;QACtB,GAAG,OAAO;QACV,QAAQ,EAAE,EAAE;QACZ,mBAAmB;KACpB,CAAC;IAEF,IAAA,sBAAa,EACX,IAAI,EACJ,IAAA,gBAAI,EAAC,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,YAAY,CAAC,EAC5C,OAAO,CAAC,WAAW,EACnB,eAAe,CAChB,CAAC;IAEF,MAAM,aAAa,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC;IAE/D,IAAA,sBAAa,EACX,IAAI,EACJ,IAAA,gBAAI,EAAC,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,oBAAoB,EAAE,aAAa,CAAC,EACnE,OAAO,CAAC,WAAW,EACnB,eAAe,CAChB,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"add-home-page.js","names":[],"sources":["../../../../../../../../../nx-plugin/src/generators/app/lib/add-home-page.ts"],"sourcesContent":["import { generateFiles, Tree } from '@nx/devkit';\nimport { join } from 'node:path';\nimport { NormalizedOptions } from '../generator';\n\nexport function addHomePage(\n tree: Tree,\n options: NormalizedOptions,\n majorAngularVersion: number,\n): void {\n const templateOptions = {\n ...options,\n template: '',\n majorAngularVersion,\n };\n\n generateFiles(\n tree,\n join(__dirname, '..', 'files', 'index-page'),\n options.projectRoot,\n templateOptions,\n );\n\n const pageDirectory = options.addTailwind ? 'tailwind' : 'css';\n\n generateFiles(\n tree,\n join(__dirname, '..', 'files', 'welcome-components', pageDirectory),\n options.projectRoot,\n templateOptions,\n );\n}\n"],"mappings":";;;AAIA,SAAgB,YACd,MACA,SACA,qBACM;CACN,MAAM,kBAAkB;EACtB,GAAG;EACH,UAAU;EACV;EACD;AAED,EAAA,GAAA,WAAA,eACE,OAAA,GAAA,UAAA,MACK,WAAW,MAAM,SAAS,aAAa,EAC5C,QAAQ,aACR,gBACD;CAED,MAAM,gBAAgB,QAAQ,cAAc,aAAa;AAEzD,EAAA,GAAA,WAAA,eACE,OAAA,GAAA,UAAA,MACK,WAAW,MAAM,SAAS,sBAAsB,cAAc,EACnE,QAAQ,aACR,gBACD"}
@@ -1,13 +1,13 @@
1
- import { GeneratorCallback, Tree } from '@nx/devkit';
1
+ import { GeneratorCallback, Tree } from "@nx/devkit";
2
2
  export declare function addTailwindConfig(tree: Tree, projectName: string): Promise<void>;
3
3
  export interface GeneratorOptions {
4
- project: string;
5
- buildTarget?: string;
6
- skipFormat?: boolean;
7
- stylesEntryPoint?: string;
8
- skipPackageJson?: boolean;
4
+ project: string;
5
+ buildTarget?: string;
6
+ skipFormat?: boolean;
7
+ stylesEntryPoint?: string;
8
+ skipPackageJson?: boolean;
9
9
  }
10
10
  export interface NormalizedGeneratorOptions extends GeneratorOptions {
11
- buildTarget: string;
11
+ buildTarget: string;
12
12
  }
13
13
  export declare function setupTailwindGenerator(tree: Tree, rawOptions: GeneratorOptions): Promise<GeneratorCallback>;
@@ -1,35 +1,20 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addTailwindConfig = addTailwindConfig;
4
- exports.setupTailwindGenerator = setupTailwindGenerator;
5
- const devkit_1 = require("@nx/devkit");
6
- const add_tailwind_helpers_1 = require("./add-tailwind-helpers");
1
+ const require_add_tailwind_helpers = require("./add-tailwind-helpers.js");
2
+ let _nx_devkit = require("@nx/devkit");
3
+ //#region packages/nx-plugin/src/generators/app/lib/add-tailwind-config.ts
7
4
  async function addTailwindConfig(tree, projectName) {
8
- await setupTailwindGenerator(tree, {
9
- project: projectName,
10
- });
5
+ await setupTailwindGenerator(tree, { project: projectName });
11
6
  }
12
7
  async function setupTailwindGenerator(tree, rawOptions) {
13
- const options = (0, add_tailwind_helpers_1.normalizeOptions)(rawOptions);
14
- const project = (0, devkit_1.readProjectConfiguration)(tree, options.project);
15
- const tailwindInstalledVersion = (0, add_tailwind_helpers_1.detectTailwindInstalledVersion)(tree);
16
- // eslint-disable-next-line @typescript-eslint/no-empty-function
17
- let installTask = () => { };
18
- if (!options.skipPackageJson) {
19
- if (tailwindInstalledVersion === undefined) {
20
- installTask = (0, add_tailwind_helpers_1.addTailwindRequiredPackages)(tree);
21
- }
22
- }
23
- (0, add_tailwind_helpers_1.addTailwindConfigFile)(tree, options, project);
24
- if (project.projectType === 'application') {
25
- (0, add_tailwind_helpers_1.updateApplicationStyles)(tree, options, project);
26
- }
27
- else if (project.projectType === 'library') {
28
- (0, add_tailwind_helpers_1.addTailwindConfigPathToProject)(tree, options, project);
29
- }
30
- if (!options.skipFormat) {
31
- await (0, devkit_1.formatFiles)(tree);
32
- }
33
- return installTask;
8
+ const options = require_add_tailwind_helpers.normalizeOptions(rawOptions);
9
+ const project = (0, _nx_devkit.readProjectConfiguration)(tree, options.project);
10
+ require_add_tailwind_helpers.detectTailwindInstalledVersion(tree);
11
+ let installTask = () => {};
12
+ if (!options.skipPackageJson) installTask = require_add_tailwind_helpers.addTailwindRequiredPackages(tree);
13
+ if (project.projectType === "application") require_add_tailwind_helpers.updateApplicationStyles(tree, options, project);
14
+ if (!options.skipFormat) await (0, _nx_devkit.formatFiles)(tree);
15
+ return installTask;
34
16
  }
17
+ //#endregion
18
+ exports.addTailwindConfig = addTailwindConfig;
19
+
35
20
  //# sourceMappingURL=add-tailwind-config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"add-tailwind-config.js","sourceRoot":"","sources":["../../../../../../../../../../packages/nx-plugin/src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AACrB,CAAC"}
1
+ {"version":3,"file":"add-tailwind-config.js","names":[],"sources":["../../../../../../../../../nx-plugin/src/generators/app/lib/add-tailwind-config.ts"],"sourcesContent":["import {\n formatFiles,\n GeneratorCallback,\n readProjectConfiguration,\n Tree,\n} from '@nx/devkit';\nimport {\n addTailwindRequiredPackages,\n detectTailwindInstalledVersion,\n normalizeOptions,\n updateApplicationStyles,\n} from './add-tailwind-helpers';\n\nexport async function addTailwindConfig(\n tree: Tree,\n projectName: string,\n): Promise<void> {\n await setupTailwindGenerator(tree, {\n project: projectName,\n });\n}\n\nexport interface GeneratorOptions {\n project: string;\n buildTarget?: string;\n skipFormat?: boolean;\n stylesEntryPoint?: string;\n skipPackageJson?: boolean;\n}\n\nexport interface NormalizedGeneratorOptions extends GeneratorOptions {\n buildTarget: string;\n}\n\nexport async function setupTailwindGenerator(\n tree: Tree,\n rawOptions: GeneratorOptions,\n): Promise<GeneratorCallback> {\n const options = normalizeOptions(rawOptions);\n const project = readProjectConfiguration(tree, options.project);\n\n // TODO: use return value for v5+ branching when needed\n detectTailwindInstalledVersion(tree);\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n let installTask: GeneratorCallback = () => {};\n if (!options.skipPackageJson) {\n installTask = addTailwindRequiredPackages(tree);\n }\n\n if (project.projectType === 'application') {\n updateApplicationStyles(tree, options, project);\n }\n\n if (!options.skipFormat) {\n await formatFiles(tree);\n }\n\n return installTask;\n}\n"],"mappings":";;;AAaA,eAAsB,kBACpB,MACA,aACe;AACf,OAAM,uBAAuB,MAAM,EACjC,SAAS,aACV,CAAC;;AAeJ,eAAsB,uBACpB,MACA,YAC4B;CAC5B,MAAM,UAAU,6BAAA,iBAAiB,WAAW;CAC5C,MAAM,WAAA,GAAA,WAAA,0BAAmC,MAAM,QAAQ,QAAQ;AAG/D,8BAAA,+BAA+B,KAAK;CAGpC,IAAI,oBAAuC;AAC3C,KAAI,CAAC,QAAQ,gBACX,eAAc,6BAAA,4BAA4B,KAAK;AAGjD,KAAI,QAAQ,gBAAgB,cAC1B,8BAAA,wBAAwB,MAAM,SAAS,QAAQ;AAGjD,KAAI,CAAC,QAAQ,WACX,QAAA,GAAA,WAAA,aAAkB,KAAK;AAGzB,QAAO"}
@@ -1,8 +1,6 @@
1
- import { Tree, GeneratorCallback, ProjectConfiguration } from '@nx/devkit';
2
- import { GeneratorOptions, NormalizedGeneratorOptions } from './add-tailwind-config';
1
+ import { Tree, GeneratorCallback, ProjectConfiguration } from "@nx/devkit";
2
+ import { GeneratorOptions, NormalizedGeneratorOptions } from "./add-tailwind-config";
3
3
  export declare function normalizeOptions(options: GeneratorOptions): NormalizedGeneratorOptions;
4
- export declare function detectTailwindInstalledVersion(tree: Tree): '2' | '3' | '4' | undefined;
4
+ export declare function detectTailwindInstalledVersion(tree: Tree): "4" | "5" | undefined;
5
5
  export declare function addTailwindRequiredPackages(tree: Tree): GeneratorCallback;
6
6
  export declare function updateApplicationStyles(tree: Tree, options: NormalizedGeneratorOptions, project: ProjectConfiguration): void;
7
- export declare function addTailwindConfigPathToProject(tree: Tree, options: NormalizedGeneratorOptions, project: ProjectConfiguration): void;
8
- export declare function addTailwindConfigFile(tree: Tree, options: GeneratorOptions, project: ProjectConfiguration): void;
@@ -1,160 +1,62 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.normalizeOptions = normalizeOptions;
4
- exports.detectTailwindInstalledVersion = detectTailwindInstalledVersion;
5
- exports.addTailwindRequiredPackages = addTailwindRequiredPackages;
6
- exports.updateApplicationStyles = updateApplicationStyles;
7
- exports.addTailwindConfigPathToProject = addTailwindConfigPathToProject;
8
- exports.addTailwindConfigFile = addTailwindConfigFile;
9
- const semver_1 = require("@nx/devkit/src/utils/semver");
10
- const tailwind_dependencies_1 = require("../versions/tailwind-dependencies");
11
- const semver_2 = require("semver");
12
- const devkit_1 = require("@nx/devkit");
13
- const node_path_1 = require("node:path");
1
+ const require_tailwind_dependencies = require("../versions/tailwind-dependencies.js");
2
+ let _nx_devkit = require("@nx/devkit");
3
+ let semver = require("semver");
4
+ let _nx_devkit_src_utils_semver = require("@nx/devkit/src/utils/semver");
5
+ //#region packages/nx-plugin/src/generators/app/lib/add-tailwind-helpers.ts
14
6
  function normalizeOptions(options) {
15
- return {
16
- ...options,
17
- buildTarget: options.buildTarget || 'build',
18
- };
7
+ return {
8
+ ...options,
9
+ buildTarget: options.buildTarget || "build"
10
+ };
19
11
  }
20
12
  function detectTailwindInstalledVersion(tree) {
21
- const { dependencies, devDependencies } = (0, devkit_1.readJson)(tree, 'package.json');
22
- const tailwindVersion = dependencies?.tailwindcss ?? devDependencies?.tailwindcss;
23
- if (!tailwindVersion) {
24
- return undefined;
25
- }
26
- const version = (0, semver_1.checkAndCleanWithSemver)('tailwindcss', tailwindVersion);
27
- if ((0, semver_2.lt)(version, '2.0.0')) {
28
- throw new Error(`The Tailwind CSS version "${tailwindVersion}" is not supported. Please upgrade to v2.0.0 or higher.`);
29
- }
30
- if ((0, semver_2.lt)(version, '3.0.0')) {
31
- return '2';
32
- }
33
- return (0, semver_2.lt)(version, '4.0.0') ? '3' : '4';
13
+ const { dependencies, devDependencies } = (0, _nx_devkit.readJson)(tree, "package.json");
14
+ const tailwindVersion = dependencies?.tailwindcss ?? devDependencies?.tailwindcss;
15
+ if (!tailwindVersion) return;
16
+ const version = (0, _nx_devkit_src_utils_semver.checkAndCleanWithSemver)("tailwindcss", tailwindVersion);
17
+ if ((0, semver.lt)(version, "4.0.0")) throw new Error(`The Tailwind CSS version "${tailwindVersion}" is not supported. Please upgrade to v4.0.0 or higher.`);
18
+ return (0, semver.lt)(version, "5.0.0") ? "4" : "5";
34
19
  }
35
20
  function addTailwindRequiredPackages(tree) {
36
- const pkgVersions = (0, tailwind_dependencies_1.getTailwindDependencies)();
37
- return (0, devkit_1.addDependenciesToPackageJson)(tree, {
38
- postcss: pkgVersions.postcss,
39
- tailwindcss: pkgVersions.tailwindcss,
40
- '@tailwindcss/postcss': pkgVersions['@tailwindcss/postcss'],
41
- }, {});
21
+ const pkgVersions = require_tailwind_dependencies.getTailwindDependencies();
22
+ return (0, _nx_devkit.addDependenciesToPackageJson)(tree, {
23
+ tailwindcss: pkgVersions.tailwindcss,
24
+ "@tailwindcss/vite": pkgVersions["@tailwindcss/vite"]
25
+ }, {});
42
26
  }
43
27
  function updateApplicationStyles(tree, options, project) {
44
- const tailwindInstalledVersion = detectTailwindInstalledVersion(tree);
45
- let stylesEntryPoint = options.stylesEntryPoint;
46
- if (stylesEntryPoint && !tree.exists(stylesEntryPoint)) {
47
- throw new Error(`The provided styles entry point "${stylesEntryPoint}" could not be found.`);
48
- }
49
- if (!stylesEntryPoint) {
50
- stylesEntryPoint = findStylesEntryPoint(tree, options, project);
51
- if (!stylesEntryPoint) {
52
- throw new Error((0, devkit_1.stripIndents) `Could not find a styles entry point for project "${options.project}".
28
+ let stylesEntryPoint = options.stylesEntryPoint;
29
+ if (stylesEntryPoint && !tree.exists(stylesEntryPoint)) throw new Error(`The provided styles entry point "${stylesEntryPoint}" could not be found.`);
30
+ if (!stylesEntryPoint) {
31
+ stylesEntryPoint = findStylesEntryPoint(tree, options, project);
32
+ if (!stylesEntryPoint) throw new Error(_nx_devkit.stripIndents`Could not find a styles entry point for project "${options.project}".
53
33
  Please specify a styles entry point using the "--stylesEntryPoint" option.`);
54
- }
55
- }
56
- const stylesEntryPointContent = tree.read(stylesEntryPoint, 'utf-8');
57
- if (tailwindInstalledVersion < '4') {
58
- tree.write(stylesEntryPoint, (0, devkit_1.stripIndents) `@tailwind base;
59
- @tailwind components;
60
- @tailwind utilities;
34
+ }
35
+ if (!stylesEntryPoint.endsWith(".css")) throw new Error(`Tailwind CSS v4 is not compatible with any css preprocessors like sass or less. Please use a css file as the styles entry point.`);
36
+ const stylesEntryPointContent = tree.read(stylesEntryPoint, "utf-8");
37
+ tree.write(stylesEntryPoint, _nx_devkit.stripIndents`@import "tailwindcss";
61
38
 
62
- ${stylesEntryPointContent}`);
63
- }
64
- else {
65
- if (!isStyleEntryPointCss(stylesEntryPoint)) {
66
- throw new Error(`Tailwind CSS v4 is not compatible with any css preprocessors like sass or less. Please use a css file as the styles entry point.`);
67
- }
68
- tree.write(stylesEntryPoint, (0, devkit_1.stripIndents) `@import "tailwindcss";
69
39
 
70
-
71
- ${stylesEntryPointContent}`);
72
- }
73
- }
74
- function isStyleEntryPointCss(stylesEntryPoint) {
75
- return stylesEntryPoint.endsWith('.css');
40
+ ${stylesEntryPointContent}`);
76
41
  }
77
42
  function findStylesEntryPoint(tree, options, project) {
78
- // first check for common names
79
- const possibleStylesEntryPoints = [
80
- (0, devkit_1.joinPathFragments)(project.sourceRoot ?? project.root, 'styles.css'),
81
- (0, devkit_1.joinPathFragments)(project.sourceRoot ?? project.root, 'styles.scss'),
82
- (0, devkit_1.joinPathFragments)(project.sourceRoot ?? project.root, 'styles.sass'),
83
- (0, devkit_1.joinPathFragments)(project.sourceRoot ?? project.root, 'styles.less'),
84
- ];
85
- const stylesEntryPoint = possibleStylesEntryPoints.find((s) => tree.exists(s));
86
- if (stylesEntryPoint) {
87
- return stylesEntryPoint;
88
- }
89
- // then check for the specified styles in the build configuration if it exists
90
- const styles = project.targets?.[options.buildTarget].options?.styles;
91
- if (!styles) {
92
- return undefined;
93
- }
94
- // find the first style that belongs to the project source
95
- const style = styles.find((s) => typeof s === 'string'
96
- ? s.startsWith(project.root) && tree.exists(s)
97
- : s.input.startsWith(project.root) &&
98
- s.inject !== false &&
99
- tree.exists(s.input));
100
- if (!style) {
101
- return undefined;
102
- }
103
- return typeof style === 'string' ? style : style.input;
104
- }
105
- function addTailwindConfigPathToProject(tree, options, project) {
106
- const buildTarget = project.targets?.[options.buildTarget];
107
- if (!buildTarget) {
108
- throw new Error((0, devkit_1.stripIndents) `The target "${options.buildTarget}" was not found for project "${options.project}".
109
- If you are using a different build target, please provide it using the "--buildTarget" option.
110
- If the project is not a buildable or publishable library, you don't need to setup TailwindCSS for it.`);
111
- }
112
- if (buildTarget.options?.tailwindConfig &&
113
- tree.exists(buildTarget.options.tailwindConfig)) {
114
- throw new Error((0, devkit_1.stripIndents) `The "${buildTarget.options.tailwindConfig}" file is already configured for the project "${options.project}". Are you sure this is the right project to set up Tailwind?
115
- If you are sure, you can remove the configuration and re-run the generator.`);
116
- }
117
- const tailwindInstalledVersion = detectTailwindInstalledVersion(tree);
118
- if (tailwindInstalledVersion === '2') {
119
- buildTarget.options = {
120
- ...buildTarget.options,
121
- tailwindConfig: (0, devkit_1.joinPathFragments)(project.root, 'tailwind.config.js'),
122
- };
123
- }
124
- else {
125
- buildTarget.options = {
126
- ...buildTarget.options,
127
- tailwindConfig: (0, devkit_1.joinPathFragments)(project.root, 'tailwind.config.ts'),
128
- };
129
- }
130
- (0, devkit_1.updateProjectConfiguration)(tree, options.project, project);
131
- }
132
- function addTailwindConfigFile(tree, options, project) {
133
- if (tree.exists((0, devkit_1.joinPathFragments)(project.root, 'tailwind.config.js'))) {
134
- throw new Error((0, devkit_1.stripIndents) `The "tailwind.config" file already exists in the project "${options.project}". Are you sure this is the right project to set up Tailwind?
135
- If you are sure, you can remove the existing file and re-run the generator.`);
136
- }
137
- const tailwindInstalledVersion = detectTailwindInstalledVersion(tree);
138
- if (tailwindInstalledVersion === '2') {
139
- (0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, '..', 'files', 'tailwind/v2'), project.root, {
140
- relativeSourceRoot: (0, node_path_1.relative)(project.root, project.sourceRoot),
141
- template: '',
142
- });
143
- return;
144
- }
145
- if (tailwindInstalledVersion === '3') {
146
- (0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, '..', 'files', 'tailwind/v3'), project.root, {
147
- relativeSourceRoot: (0, node_path_1.relative)(project.root, project.sourceRoot),
148
- template: '',
149
- });
150
- return;
151
- }
152
- if (tailwindInstalledVersion === '4') {
153
- (0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, '..', 'files', 'tailwind/v4'), project.root, {
154
- relativeSourceRoot: (0, node_path_1.relative)(project.root, project.sourceRoot),
155
- template: '',
156
- });
157
- return;
158
- }
159
- }
43
+ const stylesEntryPoint = [
44
+ (0, _nx_devkit.joinPathFragments)(project.sourceRoot ?? project.root, "styles.css"),
45
+ (0, _nx_devkit.joinPathFragments)(project.sourceRoot ?? project.root, "styles.scss"),
46
+ (0, _nx_devkit.joinPathFragments)(project.sourceRoot ?? project.root, "styles.sass"),
47
+ (0, _nx_devkit.joinPathFragments)(project.sourceRoot ?? project.root, "styles.less")
48
+ ].find((s) => tree.exists(s));
49
+ if (stylesEntryPoint) return stylesEntryPoint;
50
+ const styles = project.targets?.[options.buildTarget].options?.styles;
51
+ if (!styles) return;
52
+ const style = styles.find((s) => typeof s === "string" ? s.startsWith(project.root) && tree.exists(s) : s.input.startsWith(project.root) && s.inject !== false && tree.exists(s.input));
53
+ if (!style) return;
54
+ return typeof style === "string" ? style : style.input;
55
+ }
56
+ //#endregion
57
+ exports.addTailwindRequiredPackages = addTailwindRequiredPackages;
58
+ exports.detectTailwindInstalledVersion = detectTailwindInstalledVersion;
59
+ exports.normalizeOptions = normalizeOptions;
60
+ exports.updateApplicationStyles = updateApplicationStyles;
61
+
160
62
  //# sourceMappingURL=add-tailwind-helpers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"add-tailwind-helpers.js","sourceRoot":"","sources":["../../../../../../../../../../packages/nx-plugin/src/generators/app/lib/add-tailwind-helpers.ts"],"names":[],"mappings":";;AAoBA,4CAOC;AAED,wEAqBC;AAED,kEAWC;AAED,0DAoDC;AAkDD,wEAwCC;AAED,sDAmDC;AApQD,wDAAsE;AACtE,6EAA4E;AAC5E,mCAA4B;AAC5B,uCAUoB;AAKpB,yCAAqC;AAErC,SAAgB,gBAAgB,CAC9B,OAAyB;IAEzB,OAAO;QACL,GAAG,OAAO;QACV,WAAW,EAAE,OAAO,CAAC,WAAW,IAAI,OAAO;KAC5C,CAAC;AACJ,CAAC;AAED,SAAgB,8BAA8B,CAC5C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wind-helpers.ts"],"sourcesContent":["import { checkAndCleanWithSemver } from '@nx/devkit/src/utils/semver';\nimport { getTailwindDependencies } from '../versions/tailwind-dependencies';\nimport { lt } from 'semver';\nimport {\n Tree,\n readJson,\n addDependenciesToPackageJson,\n GeneratorCallback,\n ProjectConfiguration,\n joinPathFragments,\n stripIndents,\n} from '@nx/devkit';\nimport {\n GeneratorOptions,\n NormalizedGeneratorOptions,\n} from './add-tailwind-config';\n\nexport function normalizeOptions(\n options: GeneratorOptions,\n): NormalizedGeneratorOptions {\n return {\n ...options,\n buildTarget: options.buildTarget || 'build',\n };\n}\n\nexport function detectTailwindInstalledVersion(\n tree: Tree,\n): '4' | '5' | undefined {\n const { dependencies, devDependencies } = readJson(tree, 'package.json');\n const tailwindVersion =\n dependencies?.tailwindcss ?? devDependencies?.tailwindcss;\n\n if (!tailwindVersion) {\n return undefined;\n }\n\n const version = checkAndCleanWithSemver('tailwindcss', tailwindVersion);\n if (lt(version, '4.0.0')) {\n throw new Error(\n `The Tailwind CSS version \"${tailwindVersion}\" is not supported. Please upgrade to v4.0.0 or higher.`,\n );\n }\n return lt(version, '5.0.0') ? '4' : '5';\n}\n\nexport function addTailwindRequiredPackages(tree: Tree): GeneratorCallback {\n const pkgVersions = getTailwindDependencies();\n return addDependenciesToPackageJson(\n tree,\n {\n tailwindcss: pkgVersions.tailwindcss,\n '@tailwindcss/vite': pkgVersions['@tailwindcss/vite'],\n },\n {},\n );\n}\n\nexport function updateApplicationStyles(\n tree: Tree,\n options: NormalizedGeneratorOptions,\n project: ProjectConfiguration,\n): void {\n let stylesEntryPoint = options.stylesEntryPoint;\n\n if (stylesEntryPoint && !tree.exists(stylesEntryPoint)) {\n throw new Error(\n `The provided styles entry point \"${stylesEntryPoint}\" could not be found.`,\n );\n }\n\n if (!stylesEntryPoint) {\n stylesEntryPoint = findStylesEntryPoint(tree, options, project);\n\n if (!stylesEntryPoint) {\n throw new Error(\n stripIndents`Could not find a styles entry point for project \"${options.project}\".\n Please specify a styles entry point using the \"--stylesEntryPoint\" option.`,\n );\n }\n }\n\n if (!stylesEntryPoint.endsWith('.css')) {\n throw new Error(\n `Tailwind CSS v4 is not compatible with any css preprocessors like sass or less. Please use a css file as the styles entry point.`,\n );\n }\n\n const stylesEntryPointContent = tree.read(stylesEntryPoint, 'utf-8');\n\n tree.write(\n stylesEntryPoint,\n stripIndents`@import \"tailwindcss\";\n\n\n ${stylesEntryPointContent}`,\n );\n}\n\nfunction findStylesEntryPoint(\n tree: Tree,\n options: NormalizedGeneratorOptions,\n project: ProjectConfiguration,\n): string | undefined {\n // first check for common names\n const possibleStylesEntryPoints = [\n joinPathFragments(project.sourceRoot ?? project.root, 'styles.css'),\n joinPathFragments(project.sourceRoot ?? project.root, 'styles.scss'),\n joinPathFragments(project.sourceRoot ?? project.root, 'styles.sass'),\n joinPathFragments(project.sourceRoot ?? project.root, 'styles.less'),\n ];\n\n const stylesEntryPoint = possibleStylesEntryPoints.find((s) =>\n tree.exists(s),\n );\n if (stylesEntryPoint) {\n return stylesEntryPoint;\n }\n\n // then check for the specified styles in the build configuration if it exists\n const styles: Array<string | { input: string; inject: boolean }> =\n project.targets?.[options.buildTarget].options?.styles;\n\n if (!styles) {\n return undefined;\n }\n\n // find the first style that belongs to the project source\n const style = styles.find((s) =>\n typeof s === 'string'\n ? s.startsWith(project.root) && tree.exists(s)\n : s.input.startsWith(project.root) &&\n s.inject !== false &&\n tree.exists(s.input),\n );\n\n if (!style) {\n return undefined;\n }\n\n return typeof style === 'string' ? style : style.input;\n}\n"],"mappings":";;;;;AAiBA,SAAgB,iBACd,SAC4B;AAC5B,QAAO;EACL,GAAG;EACH,aAAa,QAAQ,eAAe;EACrC;;AAGH,SAAgB,+BACd,MACuB;CACvB,MAAM,EAAE,cAAc,qBAAA,GAAA,WAAA,UAA6B,MAAM,eAAe;CACxE,MAAM,kBACJ,cAAc,eAAe,iBAAiB;AAEhD,KAAI,CAAC,gBACH;CAGF,MAAM,WAAA,GAAA,4BAAA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QAAQ,KAAK,IAAI,KAAK,OAAO,EAAE,GAC5C,EAAE,MAAM,WAAW,QAAQ,KAAK,IAChC,EAAE,WAAW,SACb,KAAK,OAAO,EAAE,MAAM,CACzB;AAED,KAAI,CAAC,MACH;AAGF,QAAO,OAAO,UAAU,WAAW,QAAQ,MAAM"}
@@ -1,2 +1,2 @@
1
- import { Tree } from '@nx/devkit';
1
+ import { Tree } from "@nx/devkit";
2
2
  export declare function initVite(tree: Tree): Promise<void>;
@@ -1,3 +1,3 @@
1
- import { Tree } from '@nx/devkit';
2
- import { NormalizedOptions } from '../generator';
1
+ import { Tree } from "@nx/devkit";
2
+ import { NormalizedOptions } from "../generator";
3
3
  export declare function cleanupFiles(tree: Tree, options: NormalizedOptions): void;