dana-cli 0.0.0-stage → 0.0.26

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 (288) hide show
  1. package/.github/dependabot.yml +43 -0
  2. package/.github/labeler.yml +30 -0
  3. package/.github/workflows/bump.yml +51 -0
  4. package/.github/workflows/ci-cd.yml +110 -0
  5. package/.github/workflows/dependabot-automerge-call.yml +13 -0
  6. package/.nvmrc +1 -0
  7. package/.prettierignore +4 -0
  8. package/.prettierrc +4 -0
  9. package/CODEOWNERS +5 -0
  10. package/README.md +50 -2
  11. package/bin/bump.js +48 -0
  12. package/eslint.config.mjs +12 -0
  13. package/images/vodScreen1.png +0 -0
  14. package/package.json +53 -5
  15. package/sonar-project.properties +20 -0
  16. package/tools/cli/README.md +51 -0
  17. package/tools/cli/__mocks__/fs/promises.cjs +4 -0
  18. package/tools/cli/bin/dana.js +3 -0
  19. package/tools/cli/dana_completion.sh +156 -0
  20. package/tools/cli/eslint.config.mjs +14 -0
  21. package/tools/cli/package.json +67 -0
  22. package/tools/cli/rollup.config.mjs +26 -0
  23. package/tools/cli/src/commands/addComponent/addMenu/add-menu.ts +65 -0
  24. package/tools/cli/src/commands/addComponent/addMenu/addMenuDefinition.ts +21 -0
  25. package/tools/cli/src/commands/addComponent/addRail/add-rail.ts +59 -0
  26. package/tools/cli/src/commands/addComponent/addRail/addRailDefinition.ts +34 -0
  27. package/tools/cli/src/commands/addComponent/addScreen/add-screen.ts +42 -0
  28. package/tools/cli/src/commands/addComponent/addScreen/addScreenDefinition.ts +17 -0
  29. package/tools/cli/src/commands/addComponent/addScrollView/add-scrollView.ts +48 -0
  30. package/tools/cli/src/commands/addComponent/addScrollView/addScrollViewDefinition.ts +16 -0
  31. package/tools/cli/src/commands/addComponent/config/ComponentConfig.ts +169 -0
  32. package/tools/cli/src/commands/addComponent/config/componentTypes.ts +38 -0
  33. package/tools/cli/src/commands/addComponent/const/componentConst.ts +20 -0
  34. package/tools/cli/src/commands/addComponent/const/defaultConfig.ts +28 -0
  35. package/tools/cli/src/commands/addComponent/const/navigationConst.ts +36 -0
  36. package/tools/cli/src/commands/addComponent/createComponent.ts +45 -0
  37. package/tools/cli/src/commands/addComponent/helper/ComponentHelper.ts +98 -0
  38. package/tools/cli/src/commands/addDevice/add-device.ts +106 -0
  39. package/tools/cli/src/commands/addDevice/addDeviceDefinition.ts +13 -0
  40. package/tools/cli/src/commands/addDevice/deviceConfig/androidtvConfig.ts +142 -0
  41. package/tools/cli/src/commands/addDevice/deviceConfig/configTypes.ts +44 -0
  42. package/tools/cli/src/commands/addDevice/deviceConfig/deviceConfig.ts +38 -0
  43. package/tools/cli/src/commands/addDevice/deviceConfig/titanosConfig.ts +17 -0
  44. package/tools/cli/src/commands/addDevice/deviceConfig/tizenConfig.ts +64 -0
  45. package/tools/cli/src/commands/addDevice/deviceConfig/tvosConfig.ts +50 -0
  46. package/tools/cli/src/commands/addDevice/deviceConfig/vidaaConfig.ts +17 -0
  47. package/tools/cli/src/commands/addDevice/deviceConfig/webosConfig.ts +64 -0
  48. package/tools/cli/src/commands/addDevice/helper/addDeviceHelper.ts +121 -0
  49. package/tools/cli/src/commands/addDianaSkills/add-dianaSkills.ts +55 -0
  50. package/tools/cli/src/commands/addDianaSkills/addDianaSkillsDefinition.ts +13 -0
  51. package/tools/cli/src/commands/addDianaSkills/dianaDependencies.ts +15 -0
  52. package/tools/cli/src/commands/addModule/add-module.ts +46 -0
  53. package/tools/cli/src/commands/addModule/addModuleDefinition.ts +17 -0
  54. package/tools/cli/src/commands/addModule/moduleConst.ts +18 -0
  55. package/tools/cli/src/commands/authentication/AuthenticationManager.ts +255 -0
  56. package/tools/cli/src/commands/authentication/authDefinition.ts +51 -0
  57. package/tools/cli/src/commands/authentication/authHook.ts +50 -0
  58. package/tools/cli/src/commands/authentication/authentConst.ts +6 -0
  59. package/tools/cli/src/commands/authentication/commands/get-packages-token.ts +40 -0
  60. package/tools/cli/src/commands/authentication/commands/login.ts +63 -0
  61. package/tools/cli/src/commands/authentication/commands/logout.ts +26 -0
  62. package/tools/cli/src/commands/authentication/commands/status.ts +47 -0
  63. package/tools/cli/src/commands/authentication/helper/CodeArtifactHelper.ts +66 -0
  64. package/tools/cli/src/commands/authentication/helper/CommandHelper.ts +9 -0
  65. package/tools/cli/src/commands/authentication/helper/CredentialsHelper.ts +176 -0
  66. package/tools/cli/src/commands/authentication/helper/SPM.ts +95 -0
  67. package/tools/cli/src/commands/authentication/tokenHook.ts +30 -0
  68. package/tools/cli/src/commands/commandHelp/customHelp.ts +31 -0
  69. package/tools/cli/src/commands/completion/completion.ts +53 -0
  70. package/tools/cli/src/commands/completion/completionDefinition.ts +16 -0
  71. package/tools/cli/src/commands/createApp/const/createAppTasks.ts +133 -0
  72. package/tools/cli/src/commands/createApp/const/setupConst.ts +16 -0
  73. package/tools/cli/src/commands/createApp/const/templateConst.ts +10 -0
  74. package/tools/cli/src/commands/createApp/createApp.ts +60 -0
  75. package/tools/cli/src/commands/createApp/createAppDefinition.ts +26 -0
  76. package/tools/cli/src/commands/createApp/helpers/CreateAppHelper.ts +167 -0
  77. package/tools/cli/src/commands/createApp/helpers/SetupChecker.ts +98 -0
  78. package/tools/cli/src/commands/hooks/checkDanaProjectHook.ts +30 -0
  79. package/tools/cli/src/commands/zip/zip.ts +26 -0
  80. package/tools/cli/src/commands/zip/zipDefinition.ts +13 -0
  81. package/tools/cli/src/common/commonConst.ts +1 -0
  82. package/tools/cli/src/common/const/deviceConst.ts +110 -0
  83. package/tools/cli/src/common/const/exitCodeConst.ts +12 -0
  84. package/tools/cli/src/common/helpers/CreateArchiveHelper.ts +55 -0
  85. package/tools/cli/src/common/helpers/CreateFileHelper.ts +199 -0
  86. package/tools/cli/src/common/helpers/InputValidator.ts +58 -0
  87. package/tools/cli/src/common/helpers/InstallHelper.ts +202 -0
  88. package/tools/cli/src/common/helpers/UpdateFileHelper.ts +239 -0
  89. package/tools/cli/src/common/helpers/UserInputGetter.ts +145 -0
  90. package/tools/cli/src/common/helpers/handlebarsHelper.ts +31 -0
  91. package/tools/cli/src/common/helpers/stringHelper.ts +25 -0
  92. package/tools/cli/src/common/translation/en.json +87 -0
  93. package/tools/cli/src/common/translation/translation.ts +6 -0
  94. package/tools/cli/src/common/types/helperTypes.ts +79 -0
  95. package/tools/cli/src/index.ts +16 -0
  96. package/tools/cli/src/program.ts +59 -0
  97. package/tools/cli/tests/commands/addComponent/addMenu/add-menu.test.ts +96 -0
  98. package/tools/cli/tests/commands/addComponent/addRail/add-rail.test.ts +57 -0
  99. package/tools/cli/tests/commands/addComponent/addScreen/add-screen.test.ts +55 -0
  100. package/tools/cli/tests/commands/addComponent/addScrollView/add-scrollView.test.ts +89 -0
  101. package/tools/cli/tests/commands/addComponent/config/ComponentConfig.test.ts +261 -0
  102. package/tools/cli/tests/commands/addComponent/createComponent.test.ts +87 -0
  103. package/tools/cli/tests/commands/addComponent/helper/ComponentHelper.test.ts +110 -0
  104. package/tools/cli/tests/commands/addDevice/add-device.test.ts +117 -0
  105. package/tools/cli/tests/commands/addDevice/deviceConfig/androidtvConfig.test.ts +184 -0
  106. package/tools/cli/tests/commands/addDevice/deviceConfig/deviceConfig.test.ts +30 -0
  107. package/tools/cli/tests/commands/addDevice/deviceConfig/titanosConfig.test.ts +20 -0
  108. package/tools/cli/tests/commands/addDevice/deviceConfig/tizenConfig.test.ts +63 -0
  109. package/tools/cli/tests/commands/addDevice/deviceConfig/tvosConfig.test.ts +47 -0
  110. package/tools/cli/tests/commands/addDevice/deviceConfig/vidaaConfig.test.ts +20 -0
  111. package/tools/cli/tests/commands/addDevice/deviceConfig/webosConfig.test.ts +74 -0
  112. package/tools/cli/tests/commands/addDevice/helper/addDeviceHelper.test.ts +144 -0
  113. package/tools/cli/tests/commands/addDianaSkills/add-dianaSkills.test.ts +72 -0
  114. package/tools/cli/tests/commands/addModule/add-module.test.ts +108 -0
  115. package/tools/cli/tests/commands/authentication/AuthenticationManager.test.ts +756 -0
  116. package/tools/cli/tests/commands/authentication/commands/authDefinition.test.ts +53 -0
  117. package/tools/cli/tests/commands/authentication/commands/authHook.test.ts +94 -0
  118. package/tools/cli/tests/commands/authentication/commands/get-packages-token.test.ts +69 -0
  119. package/tools/cli/tests/commands/authentication/commands/login.test.ts +170 -0
  120. package/tools/cli/tests/commands/authentication/commands/logout.test.ts +77 -0
  121. package/tools/cli/tests/commands/authentication/commands/status.test.ts +73 -0
  122. package/tools/cli/tests/commands/authentication/helper/CredentialsHelper.test.ts +352 -0
  123. package/tools/cli/tests/commands/authentication/helper/SPM.test.ts +229 -0
  124. package/tools/cli/tests/commands/cliHelp/customHelp.test.ts +24 -0
  125. package/tools/cli/tests/commands/completion/completion.test.ts +76 -0
  126. package/tools/cli/tests/commands/createApp/const/createAppTasks.test.ts +70 -0
  127. package/tools/cli/tests/commands/createApp/createApp.test.ts +116 -0
  128. package/tools/cli/tests/commands/createApp/helpers/CreateAppHelper.test.ts +197 -0
  129. package/tools/cli/tests/commands/createApp/helpers/SetupChecker.test.ts +152 -0
  130. package/tools/cli/tests/commands/createApp/helpers/fixtures/myApp/scripts/app/ui/screens/SplashScreen.js +70 -0
  131. package/tools/cli/tests/commands/hooks/checkDanaProjectHook.test.ts +55 -0
  132. package/tools/cli/tests/commands/zip/zip.test.ts +51 -0
  133. package/tools/cli/tests/common/helpers/CreateArchiveHelper.test.ts +69 -0
  134. package/tools/cli/tests/common/helpers/CreateFileHelper.test.ts +359 -0
  135. package/tools/cli/tests/common/helpers/InputValidator.test.ts +93 -0
  136. package/tools/cli/tests/common/helpers/InstallHelper.test.ts +262 -0
  137. package/tools/cli/tests/common/helpers/UpdateFileHelper.test.ts +288 -0
  138. package/tools/cli/tests/common/helpers/UserInputGetter.test.ts +182 -0
  139. package/tools/cli/tests/common/helpers/handlebarsHelper.test.ts +87 -0
  140. package/tools/cli/tests/common/helpers/stringHelper.test.ts +35 -0
  141. package/tools/cli/tests/program.test.ts +215 -0
  142. package/tools/cli/tsconfig.json +19 -0
  143. package/tools/cli/tsconfig.test.json +4 -0
  144. package/tools/cli/vitest.config.ts +4 -0
  145. package/tools/templates/app-template/.dana/.gitkeep +0 -0
  146. package/tools/templates/app-template/Gruntfile.js +31 -0
  147. package/tools/templates/app-template/README.md +17 -0
  148. package/tools/templates/app-template/app.config.json +56 -0
  149. package/tools/templates/app-template/editorconfigTemplate.hbs +18 -0
  150. package/tools/templates/app-template/eslintrc.jsonTemplate.hbs +5 -0
  151. package/tools/templates/app-template/gitignoreTemplate.hbs +27 -0
  152. package/tools/templates/app-template/i18n/LocaleStringEnUS.json +7 -0
  153. package/tools/templates/app-template/i18n/README.md +32 -0
  154. package/tools/templates/app-template/images/dana.png +0 -0
  155. package/tools/templates/app-template/images/dana_logo.png +0 -0
  156. package/tools/templates/app-template/images/dana_logo_light.png +0 -0
  157. package/tools/templates/app-template/images/loading.png +0 -0
  158. package/tools/templates/app-template/nvmrcTemplate.hbs +1 -0
  159. package/tools/templates/app-template/package.json +33 -0
  160. package/tools/templates/app-template/profiles/app.config.browser-css.json +16 -0
  161. package/tools/templates/app-template/profiles/app.config.browser-lightning.json +16 -0
  162. package/tools/templates/app-template/scripts/app/README.md +6 -0
  163. package/tools/templates/app-template/scripts/app/TemplateAppRoutes.js.hbs +18 -0
  164. package/tools/templates/app-template/scripts/app/app.js.hbs +17 -0
  165. package/tools/templates/app-template/scripts/app/theme/AppTheme.js +57 -0
  166. package/tools/templates/app-template/scripts/app/ui/screens/AppScreen.js +106 -0
  167. package/tools/templates/app-template/scripts/app/ui/screens/SplashScreen.js +70 -0
  168. package/tools/templates/app-template/scripts/app/ui/views/LoaderView.js +31 -0
  169. package/tools/templates/app-template/styles/fonts/Roboto-Bold.ttf +0 -0
  170. package/tools/templates/app-template/styles/fonts/Roboto-Regular.ttf +0 -0
  171. package/tools/templates/app-template/tests/README.md +70 -0
  172. package/tools/templates/app-template/tests/automation/features/splash.feature +5 -0
  173. package/tools/templates/app-template/tests/automation/init.js +20 -0
  174. package/tools/templates/app-template/tests/automation/steps-definitions/dictionary.js +31 -0
  175. package/tools/templates/app-template/tests/automation/steps-definitions/helpers.js +9 -0
  176. package/tools/templates/app-template/tests/unit/README.md +7 -0
  177. package/tools/templates/app-template/tests/unit/app/TemplateAppRoutes.js.hbs +24 -0
  178. package/tools/templates/assets/fonts/fa-solid-900.ttf +0 -0
  179. package/tools/templates/components/ButtonItemView.js.hbs +69 -0
  180. package/tools/templates/components/ButtonView.js.hbs +65 -0
  181. package/tools/templates/components/ScrollItemView.js.hbs +53 -0
  182. package/tools/templates/components/ScrollView.js.hbs +43 -0
  183. package/tools/templates/components/TileView.js.hbs +55 -0
  184. package/tools/templates/components/screen.js.hbs +74 -0
  185. package/tools/templates/components/settings.js.hbs +74 -0
  186. package/tools/templates/components/vod.js.hbs +104 -0
  187. package/tools/templates/components/wtvMenuListView.js.hbs +38 -0
  188. package/tools/templates/components/wtvRailListView.js.hbs +44 -0
  189. package/tools/templates/index.ts +3 -0
  190. package/tools/templates/mocks/menuMock.json +29 -0
  191. package/tools/templates/mocks/railMock.json +101 -0
  192. package/tools/templates/mocks/scrollViewMock.json +165 -0
  193. package/tools/templates/modules/fip/images/12.png +0 -0
  194. package/tools/templates/modules/fip/images/audioD.png +0 -0
  195. package/tools/templates/modules/fip/package.json +5 -0
  196. package/tools/templates/modules/fip/scripts/FipModule.js +19 -0
  197. package/tools/templates/modules/fip/scripts/FipRoutes.js +19 -0
  198. package/tools/templates/modules/fip/scripts/services/mock/fipMock.json +12 -0
  199. package/tools/templates/modules/fip/scripts/ui/screens/FipScreen.js +169 -0
  200. package/tools/templates/modules/fip/scripts/ui/views/FipContentInfoView.js +77 -0
  201. package/tools/templates/modules/fip/scripts/ui/views/InfoDetailImageView.js +35 -0
  202. package/tools/templates/modules/fip/scripts/ui/views/InfoDetailTextView.js +39 -0
  203. package/tools/templates/modules/fip/scripts/ui/views/InfoListView.js +57 -0
  204. package/tools/templates/modules/fip/scripts/ui/views/PlayButtonView.js +63 -0
  205. package/tools/templates/modules/home/package.json +5 -0
  206. package/tools/templates/modules/home/scripts/HomeModule.js +19 -0
  207. package/tools/templates/modules/home/scripts/HomeRoutes.js +19 -0
  208. package/tools/templates/modules/home/scripts/services/mock/highlightMock.json +40 -0
  209. package/tools/templates/modules/home/scripts/services/mock/homeScrollViewMock.json +170 -0
  210. package/tools/templates/modules/home/scripts/ui/screens/HomeScreen.js +258 -0
  211. package/tools/templates/modules/home/scripts/ui/views/highlight/DotsListItemView.js +37 -0
  212. package/tools/templates/modules/home/scripts/ui/views/highlight/DotsListView.js +22 -0
  213. package/tools/templates/modules/home/scripts/ui/views/highlight/HighlightContentDescriptionView.js +99 -0
  214. package/tools/templates/modules/home/scripts/ui/views/highlight/HighlightPlayButtonView.js +63 -0
  215. package/tools/templates/modules/home/scripts/ui/views/highlight/HighlightRailItemView.js +186 -0
  216. package/tools/templates/modules/home/scripts/ui/views/scrollview/HomeMockTileView.js +67 -0
  217. package/tools/templates/modules/home/scripts/ui/views/scrollview/HomeRailScrollView.js +53 -0
  218. package/tools/templates/modules/home/scripts/ui/views/scrollview/HomeScrollView.js +22 -0
  219. package/tools/templates/modules/menu/images/profile.png +0 -0
  220. package/tools/templates/modules/menu/package.json +5 -0
  221. package/tools/templates/modules/menu/scripts/MenuModule.js +18 -0
  222. package/tools/templates/modules/menu/scripts/MenuRoutes.js +14 -0
  223. package/tools/templates/modules/menu/scripts/services/menuMock.json +24 -0
  224. package/tools/templates/modules/menu/scripts/ui/const/MenuIcons.js +16 -0
  225. package/tools/templates/modules/menu/scripts/ui/views/MenuButtonView.js +101 -0
  226. package/tools/templates/modules/menu/scripts/ui/views/MenuListView.js +60 -0
  227. package/tools/templates/modules/menu/scripts/ui/views/MenuView.js +87 -0
  228. package/tools/templates/modules/menu/scripts/ui/views/ProfileImageView.js +30 -0
  229. package/tools/templates/modules/player/package.json +5 -0
  230. package/tools/templates/modules/player/scripts/PlayerModule.js +19 -0
  231. package/tools/templates/modules/player/scripts/PlayerRoutes.js +19 -0
  232. package/tools/templates/modules/player/scripts/ui/const/PlayerIcons.js +19 -0
  233. package/tools/templates/modules/player/scripts/ui/screens/PlayerScreen.js +361 -0
  234. package/tools/templates/modules/player/scripts/ui/views/PlayerControlButtonView.js +69 -0
  235. package/tools/templates/modules/player/scripts/ui/views/PlayerControlsView.js +173 -0
  236. package/tools/templates/modules/player/scripts/ui/views/ProgressBarView.js +53 -0
  237. package/tools/templates/modules/search/package.json +5 -0
  238. package/tools/templates/modules/search/scripts/SearchModule.js +18 -0
  239. package/tools/templates/modules/search/scripts/SearchRoutes.js +16 -0
  240. package/tools/templates/modules/search/scripts/ui/const/EnglishKeyboardData.js +31 -0
  241. package/tools/templates/modules/search/scripts/ui/const/SearchIcons.js +14 -0
  242. package/tools/templates/modules/search/scripts/ui/const/SearchKeyboardLayout.js +19 -0
  243. package/tools/templates/modules/search/scripts/ui/primitives/SearchTextPrimitive.js +36 -0
  244. package/tools/templates/modules/search/scripts/ui/screens/SearchScreen.js +234 -0
  245. package/tools/templates/modules/search/scripts/ui/services/MockSearchService.js +39 -0
  246. package/tools/templates/modules/search/scripts/ui/services/SearchVirtualKeyboardService.js +33 -0
  247. package/tools/templates/modules/search/scripts/ui/services/mock/searchMock.json +172 -0
  248. package/tools/templates/modules/search/scripts/ui/views/SearchView.js +62 -0
  249. package/tools/templates/modules/search/scripts/ui/views/keyboard/SearchKeyboardRowItemView.js +92 -0
  250. package/tools/templates/modules/search/scripts/ui/views/keyboard/SearchKeyboardRowListView.js +33 -0
  251. package/tools/templates/modules/search/scripts/ui/views/keyboard/SearchKeyboardView.js +63 -0
  252. package/tools/templates/modules/search/scripts/ui/views/rail/SearchScrollRailView.js +53 -0
  253. package/tools/templates/modules/search/scripts/ui/views/rail/SearchScrollView.js +22 -0
  254. package/tools/templates/modules/search/scripts/ui/views/rail/SearchTileView.js +68 -0
  255. package/tools/templates/modules/search/styles/styles/fonts/fa-solid-900.ttf +0 -0
  256. package/tools/templates/modules/settings/package.json +5 -0
  257. package/tools/templates/modules/settings/scripts/SettingsModule.js +19 -0
  258. package/tools/templates/modules/settings/scripts/SettingsRoutes.js +19 -0
  259. package/tools/templates/modules/settings/scripts/ui/screens/SettingsScreen.js +200 -0
  260. package/tools/templates/modules/settings/scripts/ui/views/SettingsListItemView.js +85 -0
  261. package/tools/templates/modules/settings/scripts/ui/views/SettingsListView.js +56 -0
  262. package/tools/templates/modules/vod/package.json +5 -0
  263. package/tools/templates/modules/vod/scripts/VodModule.js +19 -0
  264. package/tools/templates/modules/vod/scripts/VodRoutes.js +19 -0
  265. package/tools/templates/modules/vod/scripts/services/mock/scrollViewMock.json +172 -0
  266. package/tools/templates/modules/vod/scripts/ui/screens/VodScreen.js +204 -0
  267. package/tools/templates/modules/vod/scripts/ui/views/MockTileView.js +69 -0
  268. package/tools/templates/modules/vod/scripts/ui/views/RailScrollItemView.js +53 -0
  269. package/tools/templates/modules/vod/scripts/ui/views/VodScrollView.js +22 -0
  270. package/tools/templates/package.json +14 -0
  271. package/tools/templates/profiles/app.config.androidtv.json +17 -0
  272. package/tools/templates/profiles/app.config.titanos.json +24 -0
  273. package/tools/templates/profiles/app.config.tizen.json +52 -0
  274. package/tools/templates/profiles/app.config.tvos.json +18 -0
  275. package/tools/templates/profiles/app.config.vidaa.json +24 -0
  276. package/tools/templates/profiles/app.config.webos.json +21 -0
  277. package/tools/templates/tutorial/modules/fip/package.json +4 -0
  278. package/tools/templates/tutorial/modules/fip/scripts/FipModule.js +18 -0
  279. package/tools/templates/tutorial/modules/fip/scripts/FipRoutes.js +19 -0
  280. package/tools/templates/tutorial/modules/fip/scripts/ui/screens/FipContentScreen.js +146 -0
  281. package/tools/templates/tutorial/modules/fip/scripts/ui/views/ElevatorView.js +66 -0
  282. package/tools/templates/tutorial/modules/fip/scripts/ui/views/FipContentInfoView.js +90 -0
  283. package/tools/templates/tutorial/modules/fip/scripts/ui/views/PlayButtonView.js +58 -0
  284. package/tools/templates/tutorial/vendors/customBE/package.json +5 -0
  285. package/tools/templates/tutorial/vendors/customBE/scripts/datas/contents.json +749 -0
  286. package/tools/templates/tutorial/vendors/customBE/scripts/services/CustomBEVodService.js +70 -0
  287. package/tsconfig.json +8 -0
  288. package/vitest.config.ts +19 -0
@@ -0,0 +1,60 @@
1
+ import * as prompts from "@clack/prompts";
2
+ import colors from "picocolors";
3
+ import SetupChecker from "./helpers/SetupChecker.js";
4
+ import UserInputGetter from "@/common/helpers/UserInputGetter.js";
5
+ import { Data, Task } from "@/common/types/helperTypes.js";
6
+ import CreateAppHelper from "./helpers/CreateAppHelper.js";
7
+ import { rm } from "node:fs/promises";
8
+ import ComponentConfig from "@/commands/addComponent/config/ComponentConfig.js";
9
+ import translation from "@/common/translation/translation.js";
10
+ import { APP_CREATION_ERROR } from "@/common/const/exitCodeConst.js";
11
+ import { CredentialsHelper } from "@/commands/authentication/helper/CredentialsHelper.js";
12
+ import { AppType } from "./const/templateConst.js";
13
+ import { createAppTasks } from "./const/createAppTasks.js";
14
+
15
+ export interface ProgramOptions {
16
+ devices: boolean;
17
+ type: AppType;
18
+ beta?: boolean;
19
+ skills: boolean;
20
+ }
21
+
22
+ const createApp = async (projectName: string, options?: ProgramOptions) => {
23
+ const { devices, type, skills }: ProgramOptions = options!;
24
+ const customWord = type === AppType.BARE ? "" : type;
25
+
26
+ prompts.intro(colors.inverse(`Let's create a ${customWord} Dana application !`));
27
+ await SetupChecker.checkSetup();
28
+ const data = (await prompts.group(UserInputGetter.getPrompts(projectName, devices), {
29
+ onCancel: () => ComponentConfig.handlePromptCancel(),
30
+ })) as Data;
31
+ data.config = await UserInputGetter.getDevicesConfig(data);
32
+ data.awsProfile = (await CredentialsHelper.get()).org;
33
+ data.allowBeta = !!options?.beta;
34
+ data.skills = type === AppType.TUTORIAL ? false : skills;
35
+
36
+ const spinner = prompts.spinner();
37
+ try {
38
+ spinner.start(translation["task.installation.start"]);
39
+ const taskList: Task[] = await createAppTasks(data, type);
40
+ await CreateAppHelper.installation(taskList, spinner);
41
+
42
+ spinner.stop(translation["task.installation.end"]);
43
+ } catch (error) {
44
+ const message = error instanceof Error ? error.message : "Error";
45
+ spinner.stop(message);
46
+ await rm(`./${data.directory}`, { recursive: true, force: true });
47
+ prompts.outro(
48
+ colors.red(`${translation["error.common.start.message"]}: `) +
49
+ colors.yellow(`\n${data.directory} folder has been removed.`),
50
+ );
51
+ process.exit(APP_CREATION_ERROR);
52
+ }
53
+
54
+ prompts.outro(translation["creation.final"]);
55
+
56
+ prompts.intro(colors.inverse(translation["script.run.title"]));
57
+ CreateAppHelper.printNpmCommandForUser(data);
58
+ prompts.outro("---");
59
+ };
60
+ export default createApp;
@@ -0,0 +1,26 @@
1
+ import { Command, Option } from "commander";
2
+ import createApp from "./createApp.js";
3
+ import translation from "@/common/translation/translation.js";
4
+ import { authHook } from "@/commands/authentication/authHook.js";
5
+ import { AppType } from "./const/templateConst.js";
6
+
7
+ const createAppDefinition = () => {
8
+ const command = new Command("create-app");
9
+
10
+ command
11
+ .description(translation["command.create_app.description"])
12
+ .argument("[projectName]", translation["command.create_app.name"])
13
+ .addOption(
14
+ new Option("-t, --type <type>", translation["command.create_app.type"])
15
+ .choices([AppType.BARE, AppType.TUTORIAL, AppType.TEMPLATED])
16
+ .default(AppType.BARE),
17
+ )
18
+ .option("-d, --devices", translation["command.create_app.devices"])
19
+ .option("--beta", translation["command.create_app.beta"], false)
20
+ .option("--no-skills", translation["command.create_app.skills"])
21
+ .hook("preAction", authHook)
22
+ .action(createApp);
23
+ return command;
24
+ };
25
+
26
+ export default createAppDefinition;
@@ -0,0 +1,167 @@
1
+ /*
2
+ * Copyright (c) 2014-2025 Wiztivi - contact@wiztivi.com
3
+ * All Rights Reserved
4
+ *
5
+ * All information contained herein is proprietary and confidential.
6
+ * Dissemination of this information or reproduction of this file or material, via any medium is strictly forbidden unless
7
+ * prior written permission is obtained from Wiztivi.
8
+ * No warranty, explicit or implicit, provided.
9
+ * This software MAY NOT be used, modified or rewritten without prior written permission from Wiztivi.
10
+ *
11
+ */
12
+ import * as prompts from "@clack/prompts";
13
+ import * as deviceConst from "@/common/const/deviceConst.js";
14
+ import * as parser from "@babel/parser";
15
+ import traverse, { NodePath } from "@babel/traverse";
16
+ import * as template from "@babel/template";
17
+ import * as t from "@babel/types";
18
+ import generate from "@babel/generator";
19
+ import { readFile, writeFile } from "node:fs/promises";
20
+ import path from "node:path";
21
+ import colors from "picocolors";
22
+ import { SelectObject, Task, SelectionArray, Data, DeviceConf } from "@/common/types/helperTypes.js";
23
+ import translation from "@/common/translation/translation.js";
24
+ //DEVICE CONFIG
25
+ import VidaaConfig from "@/commands/addDevice/deviceConfig/vidaaConfig.js";
26
+ import TitanosConfig from "@/commands/addDevice/deviceConfig/titanosConfig.js";
27
+ import WebosConfig from "@/commands/addDevice/deviceConfig/webosConfig.js";
28
+ import TizenConfig from "@/commands/addDevice/deviceConfig/tizenConfig.js";
29
+ import TvosConfig from "@/commands/addDevice/deviceConfig/tvosConfig.js";
30
+ import DeviceConfig from "@/commands/addDevice/deviceConfig/deviceConfig.js";
31
+ import AndroidtvConfig from "@/commands/addDevice/deviceConfig/androidtvConfig.js";
32
+
33
+ export type Spinner = ReturnType<typeof prompts.spinner>;
34
+ interface TemplateModule {
35
+ expression: (code: string) => () => t.Expression;
36
+ }
37
+
38
+ const CreateAppHelper = class {
39
+ /**
40
+ * Manage cancellation with CTRL+C
41
+ */
42
+ static readonly handleCancellation = function (value: unknown) {
43
+ if (prompts.isCancel(value)) {
44
+ prompts.cancel("Operation cancelled.");
45
+ process.exit(0);
46
+ }
47
+ };
48
+
49
+ /**
50
+ * Get selected renderers for smartTV
51
+ */
52
+ static readonly askHtmlRenderers = async (device: string): Promise<string[]> => {
53
+ const options: { value: string; label: string }[] = deviceConst.RENDERERS.map((el) => {
54
+ return { value: el, label: el };
55
+ });
56
+ const selection = (await prompts.multiselect({
57
+ message: `${translation["renderer.selection"]} ${device}`,
58
+ required: true,
59
+ options,
60
+ })) as string[];
61
+ this.handleCancellation(selection);
62
+ return selection;
63
+ };
64
+
65
+ static readonly getDeviceConfig = (device: string) => {
66
+ switch (device) {
67
+ case deviceConst.WEBOS:
68
+ return WebosConfig;
69
+ case deviceConst.TIZEN:
70
+ return TizenConfig;
71
+ case deviceConst.TVOS:
72
+ return TvosConfig;
73
+ case deviceConst.ANDROIDTV:
74
+ return AndroidtvConfig;
75
+ case deviceConst.VIDAA:
76
+ return VidaaConfig;
77
+ case deviceConst.TITANOS:
78
+ return TitanosConfig;
79
+ default:
80
+ return DeviceConfig;
81
+ }
82
+ };
83
+
84
+ static readonly promptUnavailableDevices = (unavailableDevices: string[]): void => {
85
+ prompts.log.warn(
86
+ colors.bold(
87
+ colors.yellow(translation["device.unavailable"]) + "\n" + colors.magenta(unavailableDevices.join(", ")),
88
+ ),
89
+ );
90
+ };
91
+
92
+ static readonly promptSelectDevices = async (devices: SelectionArray, required = false): Promise<string[]> => {
93
+ const selectObject: SelectObject = {
94
+ message: colors.bold(translation["device.selection"]),
95
+ options: devices,
96
+ required,
97
+ };
98
+ const selectedDevices = await prompts.multiselect(selectObject);
99
+ this.handleCancellation(selectedDevices);
100
+ return selectedDevices as string[];
101
+ };
102
+
103
+ /**
104
+ * Iterate on a list of tasks
105
+ */
106
+ static readonly installation = async function (tasks: Task[], s?: Spinner) {
107
+ for (const item of tasks) {
108
+ if (item.condition == null || item.condition) {
109
+ s?.message(item.title);
110
+ await item.task();
111
+ }
112
+ }
113
+ };
114
+
115
+ /**
116
+ * Prompt all script commands to launch subscribed devices
117
+ */
118
+ static readonly printNpmCommandForUser = function (data: Data) {
119
+ const commandLine = `cd ${data.directory} && npm run`;
120
+ prompts.log.info(colors.bold(`For browser:`));
121
+ prompts.log.message(`${commandLine} start`);
122
+
123
+ for (const device of data.selectedDevices) {
124
+ prompts.log.info(colors.bold(`For ${device}: `));
125
+ if (device === deviceConst.TIZEN || device === deviceConst.WEBOS) {
126
+ prompts.log.warn(`You MUST update app.config.${device}.json with your own parameters`);
127
+ }
128
+ const deviceConfig = data.config[device] as DeviceConf;
129
+ if (deviceConfig?.renderers) {
130
+ for (const renderer of deviceConfig.renderers) {
131
+ prompts.log.message(`${commandLine} start:${device}_${renderer}`);
132
+ }
133
+ } else {
134
+ prompts.log.message(`${commandLine} start:${device}`);
135
+ }
136
+ }
137
+ };
138
+ static readonly setFirstRoute = async function ({ directory }: { directory: string }) {
139
+ const filePath = path.resolve(directory, "scripts", "app", "ui", "screens", "SplashScreen.js");
140
+ const sourceFile = await readFile(filePath, "utf8");
141
+ const templateExpr = (template as { default: TemplateModule }).default.expression;
142
+ const routeStatement = templateExpr('this.route("home")');
143
+ const ast = parser.parse(sourceFile, { sourceType: "module" });
144
+
145
+ //Search for BeforeShow function
146
+ traverse(ast, {
147
+ enter(path: NodePath<t.Node>) {
148
+ if (t.isObjectProperty(path.parent) && t.isIdentifier(path.parent.key, { name: "beforeShow" })) {
149
+ //Once in beforeShow, traverse the AST and look for "console"
150
+ path.traverse({
151
+ CallExpression(innerPath: NodePath<t.CallExpression>) {
152
+ const callee = innerPath.node.callee;
153
+ if (t.isMemberExpression(callee) && t.isIdentifier(callee.object, { name: "console" })) {
154
+ //replace full console.log statement with proper route to first screen
155
+ innerPath.replaceWith(routeStatement());
156
+ }
157
+ },
158
+ });
159
+ }
160
+ },
161
+ });
162
+ const output = generate(ast, { retainLines: true }).code;
163
+ await writeFile(filePath, output);
164
+ return "first route set";
165
+ };
166
+ };
167
+ export default CreateAppHelper;
@@ -0,0 +1,98 @@
1
+ /*
2
+ * Copyright (c) 2014-2025 Wiztivi - contact@wiztivi.com
3
+ * All Rights Reserved
4
+ *
5
+ * All information contained herein is proprietary and confidential.
6
+ * Dissemination of this information or reproduction of this file or material, via any medium is strictly forbidden unless
7
+ * prior written permission is obtained from Wiztivi.
8
+ * No warranty, explicit or implicit, provided.
9
+ * This software MAY NOT be used, modified or rewritten without prior written permission from Wiztivi.
10
+ *
11
+ */
12
+
13
+ import * as prompts from "@clack/prompts";
14
+ import colors from "picocolors";
15
+ import { exec } from "node:child_process";
16
+ import { Task } from "@/common/types/helperTypes.js";
17
+ import translation from "@/common/translation/translation.js";
18
+ import { SETUP_ERROR } from "@/common/const/exitCodeConst.js";
19
+
20
+ class SetupChecker {
21
+ static readonly checkSetup = async (): Promise<void> => {
22
+ try {
23
+ await this.executeCheck([
24
+ {
25
+ title: "Node version validation",
26
+ task: async () => this.validateNodeVersion(),
27
+ },
28
+ {
29
+ title: "Git install validation",
30
+ task: async () => this.validateGitInstallation(),
31
+ },
32
+ {
33
+ title: "AWS install validation",
34
+ task: async () => this.validateAwsInstallation(),
35
+ },
36
+ ]);
37
+ prompts.log.success(colors.green("✔ ") + translation["setup.ok"]);
38
+ } catch (error) {
39
+ prompts.outro(`${colors.red(translation["setup.ko"])}: ${(error as Error).message ?? ""}`);
40
+ process.exit(SETUP_ERROR);
41
+ }
42
+ };
43
+
44
+ /**
45
+ * Iterate on a list of setup tasks
46
+ * @param {Array} tasks
47
+ */
48
+ static async executeCheck(tasks: Task[]) {
49
+ for (const item of tasks) {
50
+ await item.task();
51
+ }
52
+ }
53
+
54
+ /**
55
+ * Check if everything is set up correctly for the installation
56
+ * @returns {Promise}
57
+ */
58
+ static async validateNodeVersion(): Promise<string> {
59
+ const minimalNodeVersion = 22;
60
+ const currentVersion = Number.parseInt(process.version.slice(1).split(".")[0], 10);
61
+
62
+ return currentVersion >= minimalNodeVersion
63
+ ? Promise.resolve("Node version ok !")
64
+ : Promise.reject(new Error(`${translation["node.error"]} ${minimalNodeVersion}`));
65
+ }
66
+
67
+ /**
68
+ * Check if git cli is installed
69
+ * @returns {Promise<String>}
70
+ */
71
+ static async validateGitInstallation(): Promise<string> {
72
+ return new Promise((resolve, reject) => {
73
+ exec("git --version", {}, (error) => {
74
+ if (error != null) {
75
+ reject(new Error(translation["git.error"]));
76
+ }
77
+ resolve("Git installation ok !");
78
+ });
79
+ });
80
+ }
81
+
82
+ /**
83
+ * Check if aws cli is installed
84
+ * @returns {Promise<String>}
85
+ */
86
+ static async validateAwsInstallation(): Promise<string> {
87
+ return new Promise((resolve, reject) => {
88
+ exec("aws --version", {}, (error) => {
89
+ if (error != null) {
90
+ reject(new Error(translation["aws.cli.error"]));
91
+ }
92
+ resolve("AWS installation ok !");
93
+ });
94
+ });
95
+ }
96
+ }
97
+
98
+ export default SetupChecker;
@@ -0,0 +1,30 @@
1
+ /*
2
+ * Copyright (c) 2014-2025 Wiztivi - contact@wiztivi.com
3
+ * All Rights Reserved
4
+ *
5
+ * All information contained herein is proprietary and confidential.
6
+ * Dissemination of this information or reproduction of this file or material, via any medium is strictly forbidden unless
7
+ * prior written permission is obtained from Wiztivi.
8
+ * No warranty, explicit or implicit, provided.
9
+ * This software MAY NOT be used, modified or rewritten without prior written permission from Wiztivi.
10
+ *
11
+ */
12
+
13
+ import { Command } from "commander";
14
+ import * as prompts from "@clack/prompts";
15
+ import translation from "@/common/translation/translation.js";
16
+ import { DANA_PROJECT_HOOK_ERROR } from "@/common/const/exitCodeConst.js";
17
+ import { findUp } from "find-up";
18
+
19
+ export const checkDanaProjectHook = async (_command: Command, subCommand: Command) => {
20
+ const allowedCommands = ["create-app", "auth"];
21
+ if (allowedCommands.includes(subCommand.name())) {
22
+ return;
23
+ }
24
+ const folderPath = await findUp(".dana", { type: "directory" });
25
+ const isDanaProject = !!folderPath;
26
+ if (!isDanaProject) {
27
+ prompts.log.error(translation["command.hook.dana_project"]);
28
+ process.exit(DANA_PROJECT_HOOK_ERROR);
29
+ }
30
+ };
@@ -0,0 +1,26 @@
1
+ import * as prompts from "@clack/prompts";
2
+ import colors from "picocolors";
3
+ import translation from "@/common/translation/translation.js";
4
+ import process from "node:process";
5
+ import { GENERATE_ARCHIVE_ERROR } from "@/common/const/exitCodeConst.js";
6
+ import { generateArchive } from "@/common/helpers/CreateArchiveHelper.js";
7
+
8
+ const zipCommand = async () => {
9
+ prompts.intro(colors.inverse(`Creating an uploadable archive !`));
10
+
11
+ const spinner = prompts.spinner();
12
+ try {
13
+ spinner.start(translation["command.zip.creation.start"]);
14
+ const zipFileName = await generateArchive();
15
+ spinner.stop(translation["command.zip.creation.end"] + zipFileName);
16
+ } catch (error) {
17
+ const message = error instanceof Error ? error.message : "Error";
18
+ spinner.stop(message);
19
+ prompts.outro(colors.red(`${translation["error.common.start.message"]}: `));
20
+ process.exit(GENERATE_ARCHIVE_ERROR);
21
+ }
22
+
23
+ prompts.outro(translation["command.zip.final"]);
24
+ };
25
+
26
+ export default zipCommand;
@@ -0,0 +1,13 @@
1
+ import { Command } from "commander";
2
+ import translation from "@/common/translation/translation.js";
3
+ import zipCommand from "./zip.js";
4
+
5
+ const zipDefinition = () => {
6
+ const command = new Command("zip-code");
7
+
8
+ command.description(translation["command.zip.description"]).action(zipCommand);
9
+
10
+ return command;
11
+ };
12
+
13
+ export default zipDefinition;
@@ -0,0 +1 @@
1
+ export const TEMPLATE_MODULE = "@wiztivi/dana-templates";
@@ -0,0 +1,110 @@
1
+ /*
2
+ * Copyright (c) 2014-2025 Wiztivi - contact@wiztivi.com
3
+ * All Rights Reserved
4
+ *
5
+ * All information contained herein is proprietary and confidential.
6
+ * Dissemination of this information or reproduction of this file or material, via any medium is strictly forbidden unless
7
+ * prior written permission is obtained from Wiztivi.
8
+ * No warranty, explicit or implicit, provided.
9
+ * This software MAY NOT be used, modified or rewritten without prior written permission from Wiztivi.
10
+ *
11
+ */
12
+ const TVOS = "tvos";
13
+ const TIZEN = "tizen";
14
+ const WEBOS = "webos";
15
+ const ANDROIDTV = "androidtv";
16
+ const CSS = "css";
17
+ const LIGHTNING = "lightning";
18
+ const VIDAA = "vidaa";
19
+ const TITANOS = "titanos";
20
+
21
+ const BASIC_DEPENDENCIES = [
22
+ "@dana/renderer-css",
23
+ "@dana/renderer-lightning-html5",
24
+ "@dana/tools-grunt",
25
+ "@dana/vendor-test",
26
+ "@dana/engine-nodejs",
27
+ "@dana/vendor-components",
28
+ "@wiztivi/dana-templates",
29
+ "@dana/core",
30
+ "@dana/renderer-lightning",
31
+ "@dana/engine-html5",
32
+ "@dana/vendor-fake-native",
33
+ ];
34
+
35
+ /**
36
+ * @property {String} label - user-friendly displayed name
37
+ * @property {String} package - package name used to check if user is subscribed (vendor or engine)
38
+ * @property {array<string>} dependencies - Dependencies to be added to BASIC_DEP
39
+ */
40
+
41
+ interface PlatformConfig {
42
+ label: string;
43
+ package: string;
44
+ dependencies: string[];
45
+ renderers?: Record<string, string[]>;
46
+ }
47
+
48
+ //Devices included by default in subscription
49
+ const BASIC_SETUP: Record<string, PlatformConfig> = {
50
+ [TIZEN]: {
51
+ label: "Samsung",
52
+ package: "@dana/vendor-tizen",
53
+ dependencies: ["@dana/vendor-tizen", "@dana/vendor-shaka", "@dana/tools-smarttv-grunt"],
54
+ },
55
+ [WEBOS]: {
56
+ label: "LG",
57
+ package: "@dana/vendor-webos",
58
+ dependencies: [
59
+ "@dana/vendor-webos",
60
+ "@dana/vendor-shaka",
61
+ "@dana/tools-smarttv-grunt",
62
+ "@dana/vendor-webos-css",
63
+ ],
64
+ },
65
+ [VIDAA]: {
66
+ label: "Vidaa",
67
+ package: "@dana/vendor-vidaa",
68
+ dependencies: ["@dana/vendor-vidaa", "@dana/tools-smarttv-grunt"],
69
+ },
70
+ [TITANOS]: {
71
+ label: "TitanOs",
72
+ package: "@dana/vendor-titanos",
73
+ dependencies: ["@dana/vendor-titanos"],
74
+ },
75
+ };
76
+
77
+ //Devices that need a subscription to be added in project
78
+ //package is used to check if user is entitled to the device
79
+ const EXTENDED_SETUP: Record<string, PlatformConfig> = {
80
+ [TVOS]: {
81
+ label: "TV OS",
82
+ package: "@dana/engine-tvos",
83
+ dependencies: ["@dana/engine-tvos", "@dana/renderer-tvos", "@dana/tools-apple-grunt"],
84
+ },
85
+ [ANDROIDTV]: {
86
+ label: "Android",
87
+ package: "@dana/engine-android",
88
+ dependencies: ["@dana/engine-android", "@dana/renderer-android", "@dana/tools-android-grunt"],
89
+ },
90
+ };
91
+
92
+ const PLATFORM_CONFIG: Record<string, PlatformConfig> = { ...BASIC_SETUP, ...EXTENDED_SETUP };
93
+
94
+ const RENDERERS: string[] = [CSS, LIGHTNING];
95
+
96
+ export {
97
+ TVOS,
98
+ TIZEN,
99
+ WEBOS,
100
+ ANDROIDTV,
101
+ VIDAA,
102
+ TITANOS,
103
+ BASIC_DEPENDENCIES,
104
+ PLATFORM_CONFIG,
105
+ RENDERERS,
106
+ BASIC_SETUP,
107
+ EXTENDED_SETUP,
108
+ LIGHTNING,
109
+ CSS,
110
+ };
@@ -0,0 +1,12 @@
1
+ export const APP_CREATION_ERROR = 1;
2
+ export const TEMPLATE_OPTION_ERROR = 2;
3
+ export const COMPONENT_ERROR = 3;
4
+ export const CANCEL = 4;
5
+ export const DEVICE_ERROR = 5;
6
+ export const LOGIN_ERROR = 6;
7
+ export const COMMAND_ERROR = 7;
8
+ export const SETUP_ERROR = 8;
9
+ export const GET_PACKAGES_TOKEN_ERROR = 9;
10
+ export const DANA_PROJECT_HOOK_ERROR = 10;
11
+ export const GENERATE_ARCHIVE_ERROR = 11;
12
+ export const MODULE_ERROR = 12;
@@ -0,0 +1,55 @@
1
+ /*
2
+ * Copyright (c) 2014-2025 Wiztivi - contact@wiztivi.com
3
+ * All Rights Reserved
4
+ *
5
+ * All information contained herein is proprietary and confidential.
6
+ * Dissemination of this information or reproduction of this file or material, via any medium is strictly forbidden unless
7
+ * prior written permission is obtained from Wiztivi.
8
+ * No warranty, explicit or implicit, provided.
9
+ * This software MAY NOT be used, modified or rewritten without prior written permission from Wiztivi.
10
+ *
11
+ */
12
+
13
+ import AdmZip from "adm-zip";
14
+ import { findUp } from "find-up";
15
+ import { basename, dirname, sep } from "node:path";
16
+
17
+ const excludedList = [
18
+ ".git",
19
+ ".github",
20
+ ".idea",
21
+ "doc",
22
+ "generated",
23
+ "node_modules",
24
+ "dist",
25
+ "build",
26
+ "coverage",
27
+ "templates",
28
+ "tests",
29
+ ];
30
+
31
+ export async function generateArchive(): Promise<string> {
32
+ const modulesPath = await findUp(".dana", { type: "directory" });
33
+ if (!modulesPath) {
34
+ throw new Error(
35
+ "Unable to get your dana project directory name. Please run the command from the root directory of the project",
36
+ );
37
+ }
38
+ const dir = dirname(modulesPath);
39
+ const projectName = basename(dir);
40
+ const zip = new AdmZip();
41
+ const now = Date.now();
42
+ const zipFileName = `archive-${projectName}-${now}.zip`;
43
+
44
+ zip.addLocalFolder(dir, undefined, (filename: string) => !isZipFile(filename) && !isExcluded(filename));
45
+ zip.writeZip(zipFileName);
46
+ return zipFileName;
47
+ }
48
+
49
+ function isZipFile(filename: string) {
50
+ return filename.endsWith(".zip");
51
+ }
52
+
53
+ function isExcluded(filename: string) {
54
+ return excludedList.some((excluded) => filename.split(sep).includes(excluded));
55
+ }