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.
- package/.github/dependabot.yml +43 -0
- package/.github/labeler.yml +30 -0
- package/.github/workflows/bump.yml +51 -0
- package/.github/workflows/ci-cd.yml +110 -0
- package/.github/workflows/dependabot-automerge-call.yml +13 -0
- package/.nvmrc +1 -0
- package/.prettierignore +4 -0
- package/.prettierrc +4 -0
- package/CODEOWNERS +5 -0
- package/README.md +50 -2
- package/bin/bump.js +48 -0
- package/eslint.config.mjs +12 -0
- package/images/vodScreen1.png +0 -0
- package/package.json +53 -5
- package/sonar-project.properties +20 -0
- package/tools/cli/README.md +51 -0
- package/tools/cli/__mocks__/fs/promises.cjs +4 -0
- package/tools/cli/bin/dana.js +3 -0
- package/tools/cli/dana_completion.sh +156 -0
- package/tools/cli/eslint.config.mjs +14 -0
- package/tools/cli/package.json +67 -0
- package/tools/cli/rollup.config.mjs +26 -0
- package/tools/cli/src/commands/addComponent/addMenu/add-menu.ts +65 -0
- package/tools/cli/src/commands/addComponent/addMenu/addMenuDefinition.ts +21 -0
- package/tools/cli/src/commands/addComponent/addRail/add-rail.ts +59 -0
- package/tools/cli/src/commands/addComponent/addRail/addRailDefinition.ts +34 -0
- package/tools/cli/src/commands/addComponent/addScreen/add-screen.ts +42 -0
- package/tools/cli/src/commands/addComponent/addScreen/addScreenDefinition.ts +17 -0
- package/tools/cli/src/commands/addComponent/addScrollView/add-scrollView.ts +48 -0
- package/tools/cli/src/commands/addComponent/addScrollView/addScrollViewDefinition.ts +16 -0
- package/tools/cli/src/commands/addComponent/config/ComponentConfig.ts +169 -0
- package/tools/cli/src/commands/addComponent/config/componentTypes.ts +38 -0
- package/tools/cli/src/commands/addComponent/const/componentConst.ts +20 -0
- package/tools/cli/src/commands/addComponent/const/defaultConfig.ts +28 -0
- package/tools/cli/src/commands/addComponent/const/navigationConst.ts +36 -0
- package/tools/cli/src/commands/addComponent/createComponent.ts +45 -0
- package/tools/cli/src/commands/addComponent/helper/ComponentHelper.ts +98 -0
- package/tools/cli/src/commands/addDevice/add-device.ts +106 -0
- package/tools/cli/src/commands/addDevice/addDeviceDefinition.ts +13 -0
- package/tools/cli/src/commands/addDevice/deviceConfig/androidtvConfig.ts +142 -0
- package/tools/cli/src/commands/addDevice/deviceConfig/configTypes.ts +44 -0
- package/tools/cli/src/commands/addDevice/deviceConfig/deviceConfig.ts +38 -0
- package/tools/cli/src/commands/addDevice/deviceConfig/titanosConfig.ts +17 -0
- package/tools/cli/src/commands/addDevice/deviceConfig/tizenConfig.ts +64 -0
- package/tools/cli/src/commands/addDevice/deviceConfig/tvosConfig.ts +50 -0
- package/tools/cli/src/commands/addDevice/deviceConfig/vidaaConfig.ts +17 -0
- package/tools/cli/src/commands/addDevice/deviceConfig/webosConfig.ts +64 -0
- package/tools/cli/src/commands/addDevice/helper/addDeviceHelper.ts +121 -0
- package/tools/cli/src/commands/addDianaSkills/add-dianaSkills.ts +55 -0
- package/tools/cli/src/commands/addDianaSkills/addDianaSkillsDefinition.ts +13 -0
- package/tools/cli/src/commands/addDianaSkills/dianaDependencies.ts +15 -0
- package/tools/cli/src/commands/addModule/add-module.ts +46 -0
- package/tools/cli/src/commands/addModule/addModuleDefinition.ts +17 -0
- package/tools/cli/src/commands/addModule/moduleConst.ts +18 -0
- package/tools/cli/src/commands/authentication/AuthenticationManager.ts +255 -0
- package/tools/cli/src/commands/authentication/authDefinition.ts +51 -0
- package/tools/cli/src/commands/authentication/authHook.ts +50 -0
- package/tools/cli/src/commands/authentication/authentConst.ts +6 -0
- package/tools/cli/src/commands/authentication/commands/get-packages-token.ts +40 -0
- package/tools/cli/src/commands/authentication/commands/login.ts +63 -0
- package/tools/cli/src/commands/authentication/commands/logout.ts +26 -0
- package/tools/cli/src/commands/authentication/commands/status.ts +47 -0
- package/tools/cli/src/commands/authentication/helper/CodeArtifactHelper.ts +66 -0
- package/tools/cli/src/commands/authentication/helper/CommandHelper.ts +9 -0
- package/tools/cli/src/commands/authentication/helper/CredentialsHelper.ts +176 -0
- package/tools/cli/src/commands/authentication/helper/SPM.ts +95 -0
- package/tools/cli/src/commands/authentication/tokenHook.ts +30 -0
- package/tools/cli/src/commands/commandHelp/customHelp.ts +31 -0
- package/tools/cli/src/commands/completion/completion.ts +53 -0
- package/tools/cli/src/commands/completion/completionDefinition.ts +16 -0
- package/tools/cli/src/commands/createApp/const/createAppTasks.ts +133 -0
- package/tools/cli/src/commands/createApp/const/setupConst.ts +16 -0
- package/tools/cli/src/commands/createApp/const/templateConst.ts +10 -0
- package/tools/cli/src/commands/createApp/createApp.ts +60 -0
- package/tools/cli/src/commands/createApp/createAppDefinition.ts +26 -0
- package/tools/cli/src/commands/createApp/helpers/CreateAppHelper.ts +167 -0
- package/tools/cli/src/commands/createApp/helpers/SetupChecker.ts +98 -0
- package/tools/cli/src/commands/hooks/checkDanaProjectHook.ts +30 -0
- package/tools/cli/src/commands/zip/zip.ts +26 -0
- package/tools/cli/src/commands/zip/zipDefinition.ts +13 -0
- package/tools/cli/src/common/commonConst.ts +1 -0
- package/tools/cli/src/common/const/deviceConst.ts +110 -0
- package/tools/cli/src/common/const/exitCodeConst.ts +12 -0
- package/tools/cli/src/common/helpers/CreateArchiveHelper.ts +55 -0
- package/tools/cli/src/common/helpers/CreateFileHelper.ts +199 -0
- package/tools/cli/src/common/helpers/InputValidator.ts +58 -0
- package/tools/cli/src/common/helpers/InstallHelper.ts +202 -0
- package/tools/cli/src/common/helpers/UpdateFileHelper.ts +239 -0
- package/tools/cli/src/common/helpers/UserInputGetter.ts +145 -0
- package/tools/cli/src/common/helpers/handlebarsHelper.ts +31 -0
- package/tools/cli/src/common/helpers/stringHelper.ts +25 -0
- package/tools/cli/src/common/translation/en.json +87 -0
- package/tools/cli/src/common/translation/translation.ts +6 -0
- package/tools/cli/src/common/types/helperTypes.ts +79 -0
- package/tools/cli/src/index.ts +16 -0
- package/tools/cli/src/program.ts +59 -0
- package/tools/cli/tests/commands/addComponent/addMenu/add-menu.test.ts +96 -0
- package/tools/cli/tests/commands/addComponent/addRail/add-rail.test.ts +57 -0
- package/tools/cli/tests/commands/addComponent/addScreen/add-screen.test.ts +55 -0
- package/tools/cli/tests/commands/addComponent/addScrollView/add-scrollView.test.ts +89 -0
- package/tools/cli/tests/commands/addComponent/config/ComponentConfig.test.ts +261 -0
- package/tools/cli/tests/commands/addComponent/createComponent.test.ts +87 -0
- package/tools/cli/tests/commands/addComponent/helper/ComponentHelper.test.ts +110 -0
- package/tools/cli/tests/commands/addDevice/add-device.test.ts +117 -0
- package/tools/cli/tests/commands/addDevice/deviceConfig/androidtvConfig.test.ts +184 -0
- package/tools/cli/tests/commands/addDevice/deviceConfig/deviceConfig.test.ts +30 -0
- package/tools/cli/tests/commands/addDevice/deviceConfig/titanosConfig.test.ts +20 -0
- package/tools/cli/tests/commands/addDevice/deviceConfig/tizenConfig.test.ts +63 -0
- package/tools/cli/tests/commands/addDevice/deviceConfig/tvosConfig.test.ts +47 -0
- package/tools/cli/tests/commands/addDevice/deviceConfig/vidaaConfig.test.ts +20 -0
- package/tools/cli/tests/commands/addDevice/deviceConfig/webosConfig.test.ts +74 -0
- package/tools/cli/tests/commands/addDevice/helper/addDeviceHelper.test.ts +144 -0
- package/tools/cli/tests/commands/addDianaSkills/add-dianaSkills.test.ts +72 -0
- package/tools/cli/tests/commands/addModule/add-module.test.ts +108 -0
- package/tools/cli/tests/commands/authentication/AuthenticationManager.test.ts +756 -0
- package/tools/cli/tests/commands/authentication/commands/authDefinition.test.ts +53 -0
- package/tools/cli/tests/commands/authentication/commands/authHook.test.ts +94 -0
- package/tools/cli/tests/commands/authentication/commands/get-packages-token.test.ts +69 -0
- package/tools/cli/tests/commands/authentication/commands/login.test.ts +170 -0
- package/tools/cli/tests/commands/authentication/commands/logout.test.ts +77 -0
- package/tools/cli/tests/commands/authentication/commands/status.test.ts +73 -0
- package/tools/cli/tests/commands/authentication/helper/CredentialsHelper.test.ts +352 -0
- package/tools/cli/tests/commands/authentication/helper/SPM.test.ts +229 -0
- package/tools/cli/tests/commands/cliHelp/customHelp.test.ts +24 -0
- package/tools/cli/tests/commands/completion/completion.test.ts +76 -0
- package/tools/cli/tests/commands/createApp/const/createAppTasks.test.ts +70 -0
- package/tools/cli/tests/commands/createApp/createApp.test.ts +116 -0
- package/tools/cli/tests/commands/createApp/helpers/CreateAppHelper.test.ts +197 -0
- package/tools/cli/tests/commands/createApp/helpers/SetupChecker.test.ts +152 -0
- package/tools/cli/tests/commands/createApp/helpers/fixtures/myApp/scripts/app/ui/screens/SplashScreen.js +70 -0
- package/tools/cli/tests/commands/hooks/checkDanaProjectHook.test.ts +55 -0
- package/tools/cli/tests/commands/zip/zip.test.ts +51 -0
- package/tools/cli/tests/common/helpers/CreateArchiveHelper.test.ts +69 -0
- package/tools/cli/tests/common/helpers/CreateFileHelper.test.ts +359 -0
- package/tools/cli/tests/common/helpers/InputValidator.test.ts +93 -0
- package/tools/cli/tests/common/helpers/InstallHelper.test.ts +262 -0
- package/tools/cli/tests/common/helpers/UpdateFileHelper.test.ts +288 -0
- package/tools/cli/tests/common/helpers/UserInputGetter.test.ts +182 -0
- package/tools/cli/tests/common/helpers/handlebarsHelper.test.ts +87 -0
- package/tools/cli/tests/common/helpers/stringHelper.test.ts +35 -0
- package/tools/cli/tests/program.test.ts +215 -0
- package/tools/cli/tsconfig.json +19 -0
- package/tools/cli/tsconfig.test.json +4 -0
- package/tools/cli/vitest.config.ts +4 -0
- package/tools/templates/app-template/.dana/.gitkeep +0 -0
- package/tools/templates/app-template/Gruntfile.js +31 -0
- package/tools/templates/app-template/README.md +17 -0
- package/tools/templates/app-template/app.config.json +56 -0
- package/tools/templates/app-template/editorconfigTemplate.hbs +18 -0
- package/tools/templates/app-template/eslintrc.jsonTemplate.hbs +5 -0
- package/tools/templates/app-template/gitignoreTemplate.hbs +27 -0
- package/tools/templates/app-template/i18n/LocaleStringEnUS.json +7 -0
- package/tools/templates/app-template/i18n/README.md +32 -0
- package/tools/templates/app-template/images/dana.png +0 -0
- package/tools/templates/app-template/images/dana_logo.png +0 -0
- package/tools/templates/app-template/images/dana_logo_light.png +0 -0
- package/tools/templates/app-template/images/loading.png +0 -0
- package/tools/templates/app-template/nvmrcTemplate.hbs +1 -0
- package/tools/templates/app-template/package.json +33 -0
- package/tools/templates/app-template/profiles/app.config.browser-css.json +16 -0
- package/tools/templates/app-template/profiles/app.config.browser-lightning.json +16 -0
- package/tools/templates/app-template/scripts/app/README.md +6 -0
- package/tools/templates/app-template/scripts/app/TemplateAppRoutes.js.hbs +18 -0
- package/tools/templates/app-template/scripts/app/app.js.hbs +17 -0
- package/tools/templates/app-template/scripts/app/theme/AppTheme.js +57 -0
- package/tools/templates/app-template/scripts/app/ui/screens/AppScreen.js +106 -0
- package/tools/templates/app-template/scripts/app/ui/screens/SplashScreen.js +70 -0
- package/tools/templates/app-template/scripts/app/ui/views/LoaderView.js +31 -0
- package/tools/templates/app-template/styles/fonts/Roboto-Bold.ttf +0 -0
- package/tools/templates/app-template/styles/fonts/Roboto-Regular.ttf +0 -0
- package/tools/templates/app-template/tests/README.md +70 -0
- package/tools/templates/app-template/tests/automation/features/splash.feature +5 -0
- package/tools/templates/app-template/tests/automation/init.js +20 -0
- package/tools/templates/app-template/tests/automation/steps-definitions/dictionary.js +31 -0
- package/tools/templates/app-template/tests/automation/steps-definitions/helpers.js +9 -0
- package/tools/templates/app-template/tests/unit/README.md +7 -0
- package/tools/templates/app-template/tests/unit/app/TemplateAppRoutes.js.hbs +24 -0
- package/tools/templates/assets/fonts/fa-solid-900.ttf +0 -0
- package/tools/templates/components/ButtonItemView.js.hbs +69 -0
- package/tools/templates/components/ButtonView.js.hbs +65 -0
- package/tools/templates/components/ScrollItemView.js.hbs +53 -0
- package/tools/templates/components/ScrollView.js.hbs +43 -0
- package/tools/templates/components/TileView.js.hbs +55 -0
- package/tools/templates/components/screen.js.hbs +74 -0
- package/tools/templates/components/settings.js.hbs +74 -0
- package/tools/templates/components/vod.js.hbs +104 -0
- package/tools/templates/components/wtvMenuListView.js.hbs +38 -0
- package/tools/templates/components/wtvRailListView.js.hbs +44 -0
- package/tools/templates/index.ts +3 -0
- package/tools/templates/mocks/menuMock.json +29 -0
- package/tools/templates/mocks/railMock.json +101 -0
- package/tools/templates/mocks/scrollViewMock.json +165 -0
- package/tools/templates/modules/fip/images/12.png +0 -0
- package/tools/templates/modules/fip/images/audioD.png +0 -0
- package/tools/templates/modules/fip/package.json +5 -0
- package/tools/templates/modules/fip/scripts/FipModule.js +19 -0
- package/tools/templates/modules/fip/scripts/FipRoutes.js +19 -0
- package/tools/templates/modules/fip/scripts/services/mock/fipMock.json +12 -0
- package/tools/templates/modules/fip/scripts/ui/screens/FipScreen.js +169 -0
- package/tools/templates/modules/fip/scripts/ui/views/FipContentInfoView.js +77 -0
- package/tools/templates/modules/fip/scripts/ui/views/InfoDetailImageView.js +35 -0
- package/tools/templates/modules/fip/scripts/ui/views/InfoDetailTextView.js +39 -0
- package/tools/templates/modules/fip/scripts/ui/views/InfoListView.js +57 -0
- package/tools/templates/modules/fip/scripts/ui/views/PlayButtonView.js +63 -0
- package/tools/templates/modules/home/package.json +5 -0
- package/tools/templates/modules/home/scripts/HomeModule.js +19 -0
- package/tools/templates/modules/home/scripts/HomeRoutes.js +19 -0
- package/tools/templates/modules/home/scripts/services/mock/highlightMock.json +40 -0
- package/tools/templates/modules/home/scripts/services/mock/homeScrollViewMock.json +170 -0
- package/tools/templates/modules/home/scripts/ui/screens/HomeScreen.js +258 -0
- package/tools/templates/modules/home/scripts/ui/views/highlight/DotsListItemView.js +37 -0
- package/tools/templates/modules/home/scripts/ui/views/highlight/DotsListView.js +22 -0
- package/tools/templates/modules/home/scripts/ui/views/highlight/HighlightContentDescriptionView.js +99 -0
- package/tools/templates/modules/home/scripts/ui/views/highlight/HighlightPlayButtonView.js +63 -0
- package/tools/templates/modules/home/scripts/ui/views/highlight/HighlightRailItemView.js +186 -0
- package/tools/templates/modules/home/scripts/ui/views/scrollview/HomeMockTileView.js +67 -0
- package/tools/templates/modules/home/scripts/ui/views/scrollview/HomeRailScrollView.js +53 -0
- package/tools/templates/modules/home/scripts/ui/views/scrollview/HomeScrollView.js +22 -0
- package/tools/templates/modules/menu/images/profile.png +0 -0
- package/tools/templates/modules/menu/package.json +5 -0
- package/tools/templates/modules/menu/scripts/MenuModule.js +18 -0
- package/tools/templates/modules/menu/scripts/MenuRoutes.js +14 -0
- package/tools/templates/modules/menu/scripts/services/menuMock.json +24 -0
- package/tools/templates/modules/menu/scripts/ui/const/MenuIcons.js +16 -0
- package/tools/templates/modules/menu/scripts/ui/views/MenuButtonView.js +101 -0
- package/tools/templates/modules/menu/scripts/ui/views/MenuListView.js +60 -0
- package/tools/templates/modules/menu/scripts/ui/views/MenuView.js +87 -0
- package/tools/templates/modules/menu/scripts/ui/views/ProfileImageView.js +30 -0
- package/tools/templates/modules/player/package.json +5 -0
- package/tools/templates/modules/player/scripts/PlayerModule.js +19 -0
- package/tools/templates/modules/player/scripts/PlayerRoutes.js +19 -0
- package/tools/templates/modules/player/scripts/ui/const/PlayerIcons.js +19 -0
- package/tools/templates/modules/player/scripts/ui/screens/PlayerScreen.js +361 -0
- package/tools/templates/modules/player/scripts/ui/views/PlayerControlButtonView.js +69 -0
- package/tools/templates/modules/player/scripts/ui/views/PlayerControlsView.js +173 -0
- package/tools/templates/modules/player/scripts/ui/views/ProgressBarView.js +53 -0
- package/tools/templates/modules/search/package.json +5 -0
- package/tools/templates/modules/search/scripts/SearchModule.js +18 -0
- package/tools/templates/modules/search/scripts/SearchRoutes.js +16 -0
- package/tools/templates/modules/search/scripts/ui/const/EnglishKeyboardData.js +31 -0
- package/tools/templates/modules/search/scripts/ui/const/SearchIcons.js +14 -0
- package/tools/templates/modules/search/scripts/ui/const/SearchKeyboardLayout.js +19 -0
- package/tools/templates/modules/search/scripts/ui/primitives/SearchTextPrimitive.js +36 -0
- package/tools/templates/modules/search/scripts/ui/screens/SearchScreen.js +234 -0
- package/tools/templates/modules/search/scripts/ui/services/MockSearchService.js +39 -0
- package/tools/templates/modules/search/scripts/ui/services/SearchVirtualKeyboardService.js +33 -0
- package/tools/templates/modules/search/scripts/ui/services/mock/searchMock.json +172 -0
- package/tools/templates/modules/search/scripts/ui/views/SearchView.js +62 -0
- package/tools/templates/modules/search/scripts/ui/views/keyboard/SearchKeyboardRowItemView.js +92 -0
- package/tools/templates/modules/search/scripts/ui/views/keyboard/SearchKeyboardRowListView.js +33 -0
- package/tools/templates/modules/search/scripts/ui/views/keyboard/SearchKeyboardView.js +63 -0
- package/tools/templates/modules/search/scripts/ui/views/rail/SearchScrollRailView.js +53 -0
- package/tools/templates/modules/search/scripts/ui/views/rail/SearchScrollView.js +22 -0
- package/tools/templates/modules/search/scripts/ui/views/rail/SearchTileView.js +68 -0
- package/tools/templates/modules/search/styles/styles/fonts/fa-solid-900.ttf +0 -0
- package/tools/templates/modules/settings/package.json +5 -0
- package/tools/templates/modules/settings/scripts/SettingsModule.js +19 -0
- package/tools/templates/modules/settings/scripts/SettingsRoutes.js +19 -0
- package/tools/templates/modules/settings/scripts/ui/screens/SettingsScreen.js +200 -0
- package/tools/templates/modules/settings/scripts/ui/views/SettingsListItemView.js +85 -0
- package/tools/templates/modules/settings/scripts/ui/views/SettingsListView.js +56 -0
- package/tools/templates/modules/vod/package.json +5 -0
- package/tools/templates/modules/vod/scripts/VodModule.js +19 -0
- package/tools/templates/modules/vod/scripts/VodRoutes.js +19 -0
- package/tools/templates/modules/vod/scripts/services/mock/scrollViewMock.json +172 -0
- package/tools/templates/modules/vod/scripts/ui/screens/VodScreen.js +204 -0
- package/tools/templates/modules/vod/scripts/ui/views/MockTileView.js +69 -0
- package/tools/templates/modules/vod/scripts/ui/views/RailScrollItemView.js +53 -0
- package/tools/templates/modules/vod/scripts/ui/views/VodScrollView.js +22 -0
- package/tools/templates/package.json +14 -0
- package/tools/templates/profiles/app.config.androidtv.json +17 -0
- package/tools/templates/profiles/app.config.titanos.json +24 -0
- package/tools/templates/profiles/app.config.tizen.json +52 -0
- package/tools/templates/profiles/app.config.tvos.json +18 -0
- package/tools/templates/profiles/app.config.vidaa.json +24 -0
- package/tools/templates/profiles/app.config.webos.json +21 -0
- package/tools/templates/tutorial/modules/fip/package.json +4 -0
- package/tools/templates/tutorial/modules/fip/scripts/FipModule.js +18 -0
- package/tools/templates/tutorial/modules/fip/scripts/FipRoutes.js +19 -0
- package/tools/templates/tutorial/modules/fip/scripts/ui/screens/FipContentScreen.js +146 -0
- package/tools/templates/tutorial/modules/fip/scripts/ui/views/ElevatorView.js +66 -0
- package/tools/templates/tutorial/modules/fip/scripts/ui/views/FipContentInfoView.js +90 -0
- package/tools/templates/tutorial/modules/fip/scripts/ui/views/PlayButtonView.js +58 -0
- package/tools/templates/tutorial/vendors/customBE/package.json +5 -0
- package/tools/templates/tutorial/vendors/customBE/scripts/datas/contents.json +749 -0
- package/tools/templates/tutorial/vendors/customBE/scripts/services/CustomBEVodService.js +70 -0
- package/tsconfig.json +8 -0
- package/vitest.config.ts +19 -0
|
@@ -0,0 +1,239 @@
|
|
|
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 fs from "node:fs/promises";
|
|
14
|
+
import path from "node:path";
|
|
15
|
+
import CreateAppHelper from "@/commands/createApp/helpers/CreateAppHelper.js";
|
|
16
|
+
import { Config, DeviceConf, JsonType } from "@/common/types/helperTypes.js";
|
|
17
|
+
import { templateGenerator } from "./handlebarsHelper.js";
|
|
18
|
+
import { CredentialsHelper } from "@/commands/authentication/helper/CredentialsHelper.js";
|
|
19
|
+
import { getRepositoryEndpoint } from "@/commands/authentication/helper/CodeArtifactHelper.js";
|
|
20
|
+
import { REGISTRY_KEY } from "@/commands/createApp/const/setupConst.js";
|
|
21
|
+
import { formatToCamelCase } from "./stringHelper.js";
|
|
22
|
+
import { ICON_FONT } from "@/commands/createApp/const/templateConst.js";
|
|
23
|
+
|
|
24
|
+
interface PackageJson {
|
|
25
|
+
name: string;
|
|
26
|
+
scripts: Record<string, string>;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
interface TemplateFile {
|
|
30
|
+
fromPath: string;
|
|
31
|
+
config: Record<string, string>;
|
|
32
|
+
toPath: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface AppTheme {
|
|
36
|
+
fonts: Record<string, Font>;
|
|
37
|
+
defaultFont?: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
interface Font {
|
|
41
|
+
family: string;
|
|
42
|
+
path: string;
|
|
43
|
+
weight?: number;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
class UpdateFileHelper {
|
|
47
|
+
/**
|
|
48
|
+
* Update app.Config files with mandatory Data
|
|
49
|
+
* @returns {Promise}
|
|
50
|
+
*/
|
|
51
|
+
static readonly updateAppConfigFile = async function ({ directory }: { directory: string }): Promise<string> {
|
|
52
|
+
const dirPath: string = path.join(directory, "profiles");
|
|
53
|
+
const filePath: string = path.join(directory, "app.config.json");
|
|
54
|
+
const rawProfileList = await fs.readdir(dirPath, { withFileTypes: true });
|
|
55
|
+
const profileList = rawProfileList
|
|
56
|
+
.filter((item) => !item.isDirectory())
|
|
57
|
+
.map((item) => path.join("profiles", item.name));
|
|
58
|
+
const rawJson = (await fs.readFile(filePath)).toString();
|
|
59
|
+
const jsonData = JSON.parse(rawJson) as JsonType;
|
|
60
|
+
jsonData.includes = profileList;
|
|
61
|
+
await fs.writeFile(filePath, JSON.stringify(jsonData, null, 4));
|
|
62
|
+
return "Config file(s) updated";
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
static readonly addModuleToAppConfig = async function (
|
|
66
|
+
{ directory }: { directory: string },
|
|
67
|
+
{ modules, shouldAddIconFont }: { modules: string[]; shouldAddIconFont: boolean },
|
|
68
|
+
) {
|
|
69
|
+
const filePath: string = path.join(directory, "app.config.json");
|
|
70
|
+
try {
|
|
71
|
+
const rawJson = (await fs.readFile(filePath)).toString();
|
|
72
|
+
const jsonData = JSON.parse(rawJson) as JsonType;
|
|
73
|
+
const defaultObj = jsonData.default as Record<string, unknown>;
|
|
74
|
+
defaultObj.base ??= {};
|
|
75
|
+
const defaultConfig = defaultObj.base as Record<string, unknown>;
|
|
76
|
+
defaultConfig.modules ??= [];
|
|
77
|
+
const modulesList = defaultConfig.modules as string[];
|
|
78
|
+
for (const moduleName of modules) {
|
|
79
|
+
if (!modulesList.includes(moduleName)) {
|
|
80
|
+
modulesList.push(moduleName);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
if (shouldAddIconFont) {
|
|
84
|
+
const jsonTheme = defaultObj.AppTheme as AppTheme;
|
|
85
|
+
jsonTheme.fonts.MockIcons = ICON_FONT;
|
|
86
|
+
}
|
|
87
|
+
await fs.writeFile(filePath, JSON.stringify(jsonData, null, 4));
|
|
88
|
+
return "App config modules updated";
|
|
89
|
+
} catch (e) {
|
|
90
|
+
throw new Error(`Failed to parse or update app config: ${(e as Error).message}`);
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
static readonly updateAppTheme = async function ({ directory }: { directory: string }, update: string) {
|
|
95
|
+
const filePath: string = path.join(directory, "scripts", "app", "theme", "AppTheme.js");
|
|
96
|
+
let content = await fs.readFile(filePath, "utf-8");
|
|
97
|
+
//"@TODO ASTgenerator";
|
|
98
|
+
content = content.replace(`${update}: "`, `${update}: "${update}`);
|
|
99
|
+
await fs.writeFile(filePath, content);
|
|
100
|
+
return "AppTheme statics updated";
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Update .npmrc with proper registry key
|
|
105
|
+
*/
|
|
106
|
+
static readonly updateNpmrcFile = async function ({ directory }: { directory: string }) {
|
|
107
|
+
const credentials = await CredentialsHelper.get();
|
|
108
|
+
const registryAccount = await getRepositoryEndpoint({
|
|
109
|
+
organization: credentials.org,
|
|
110
|
+
credentials: credentials?.aws,
|
|
111
|
+
format: "npm",
|
|
112
|
+
});
|
|
113
|
+
const filePath: string = path.join(directory, ".npmrc");
|
|
114
|
+
await fs.writeFile(filePath, `${REGISTRY_KEY}=${registryAccount}`);
|
|
115
|
+
return "AWS profile updated";
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Update package.json with the right project name and add scripts if necessary
|
|
120
|
+
*/
|
|
121
|
+
static readonly updatePackageJson = async function ({
|
|
122
|
+
name,
|
|
123
|
+
directory,
|
|
124
|
+
selectedDevices,
|
|
125
|
+
config,
|
|
126
|
+
}: {
|
|
127
|
+
name: string;
|
|
128
|
+
directory: string;
|
|
129
|
+
selectedDevices: string[];
|
|
130
|
+
config: Config;
|
|
131
|
+
}) {
|
|
132
|
+
const filePath: string = path.join(directory, "package.json");
|
|
133
|
+
const rawPackage = (await fs.readFile(filePath)).toString();
|
|
134
|
+
const packageJson = JSON.parse(rawPackage) as PackageJson;
|
|
135
|
+
|
|
136
|
+
if (name) {
|
|
137
|
+
//https://docs.npmjs.com/cli/v10/configuring-npm/package-json?v=true
|
|
138
|
+
const unsafeCharRegex = /[^A-Za-z0-9._-]/g;
|
|
139
|
+
packageJson.name = name.replaceAll(unsafeCharRegex, "").toLowerCase();
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
for (const device of selectedDevices) {
|
|
143
|
+
const deviceConfig = config[device] as DeviceConf;
|
|
144
|
+
if (deviceConfig?.renderers) {
|
|
145
|
+
for (const renderer of deviceConfig.renderers) {
|
|
146
|
+
const profileName = `${device}_${renderer}`;
|
|
147
|
+
packageJson.scripts[`start:${profileName}`] = UpdateFileHelper.setScriptValue(profileName);
|
|
148
|
+
}
|
|
149
|
+
} else {
|
|
150
|
+
packageJson.scripts[`start:${device}`] = UpdateFileHelper.setScriptValue(device);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
await fs.writeFile(filePath, JSON.stringify(packageJson, null, 4));
|
|
154
|
+
return "Package updated";
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* set specific configuration for selected devices
|
|
159
|
+
*/
|
|
160
|
+
static readonly setDevicesConfig = async function ({
|
|
161
|
+
directory,
|
|
162
|
+
config,
|
|
163
|
+
selectedDevices,
|
|
164
|
+
awsProfile,
|
|
165
|
+
}: {
|
|
166
|
+
directory: string;
|
|
167
|
+
config: Config;
|
|
168
|
+
selectedDevices: string[];
|
|
169
|
+
awsProfile: string;
|
|
170
|
+
}): Promise<string> {
|
|
171
|
+
for (const device of selectedDevices) {
|
|
172
|
+
const obj = config[device] as DeviceConf;
|
|
173
|
+
//@ts-expect-error @typescript-eslint/ban-ts-comment
|
|
174
|
+
await CreateAppHelper.getDeviceConfig(device).setConfig({ directory, awsProfile, config: obj });
|
|
175
|
+
}
|
|
176
|
+
return "Configuration done";
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
static readonly setScriptValue = (value: string): string => {
|
|
180
|
+
return `grunt serve --profile=template-${value}`;
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
static readonly applyTemplatesToFiles = async function ({
|
|
184
|
+
directory,
|
|
185
|
+
name,
|
|
186
|
+
}: {
|
|
187
|
+
directory: string;
|
|
188
|
+
name: string;
|
|
189
|
+
}): Promise<string> {
|
|
190
|
+
const routesFilePath = path.join(directory, "scripts", "app");
|
|
191
|
+
const appName = `${formatToCamelCase(name)}`;
|
|
192
|
+
const filesToUpdate: TemplateFile[] = [
|
|
193
|
+
{
|
|
194
|
+
fromPath: path.join(routesFilePath, "TemplateAppRoutes.js.hbs"),
|
|
195
|
+
config: { appName },
|
|
196
|
+
toPath: path.join(routesFilePath, `${appName}AppRoutes.js`),
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
fromPath: path.join(routesFilePath, "app.js.hbs"),
|
|
200
|
+
config: { appName },
|
|
201
|
+
toPath: path.join(routesFilePath, "app.js"),
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
fromPath: path.join(directory, "tests", "unit", "app", "TemplateAppRoutes.js.hbs"),
|
|
205
|
+
config: { appName },
|
|
206
|
+
toPath: path.join(directory, "tests", "unit", "app", `${appName}AppRoutes.js`),
|
|
207
|
+
},
|
|
208
|
+
];
|
|
209
|
+
|
|
210
|
+
const finalListToUpdate = filesToUpdate.concat(UpdateFileHelper.getConfigFileOutput(directory));
|
|
211
|
+
|
|
212
|
+
for (const file of finalListToUpdate) {
|
|
213
|
+
const updatedContent = await templateGenerator(file.fromPath, file.config);
|
|
214
|
+
await fs.writeFile(file.toPath, updatedContent);
|
|
215
|
+
await fs.unlink(file.fromPath);
|
|
216
|
+
}
|
|
217
|
+
return "Files templated";
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
static readonly getConfigFileOutput = function (directory: string) {
|
|
221
|
+
const configFiles = [
|
|
222
|
+
"gitignoreTemplate.hbs",
|
|
223
|
+
"editorconfigTemplate.hbs",
|
|
224
|
+
"eslintrc.jsonTemplate.hbs",
|
|
225
|
+
"nvmrcTemplate.hbs",
|
|
226
|
+
];
|
|
227
|
+
const filesToUpdate: TemplateFile[] = [];
|
|
228
|
+
for (const configFile of configFiles) {
|
|
229
|
+
filesToUpdate.push({
|
|
230
|
+
fromPath: path.join(directory, configFile),
|
|
231
|
+
config: {},
|
|
232
|
+
toPath: path.join(directory, `.${configFile.replace("Template.hbs", "")}`),
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
return filesToUpdate;
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
export default UpdateFileHelper;
|
|
@@ -0,0 +1,145 @@
|
|
|
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 { execSync } from "node:child_process";
|
|
15
|
+
import CreateAppHelper from "@/commands/createApp/helpers/CreateAppHelper.js";
|
|
16
|
+
import { EXTENDED_SETUP, BASIC_SETUP } from "@/common/const/deviceConst.js";
|
|
17
|
+
import { validInputLength } from "./InputValidator.js";
|
|
18
|
+
import { DeviceConf, Config } from "@/common/types/helperTypes.js";
|
|
19
|
+
import translation from "@/common/translation/translation.js";
|
|
20
|
+
import { capitalizeFirstLetter } from "./stringHelper.js";
|
|
21
|
+
|
|
22
|
+
type SelectionArray = { value: string; label: string }[];
|
|
23
|
+
interface SelectObject {
|
|
24
|
+
message: string;
|
|
25
|
+
options: SelectionArray;
|
|
26
|
+
required: boolean;
|
|
27
|
+
}
|
|
28
|
+
interface DataResults {
|
|
29
|
+
name: string;
|
|
30
|
+
}
|
|
31
|
+
class UserInputGetter {
|
|
32
|
+
/**
|
|
33
|
+
* Get project Data from user
|
|
34
|
+
*/
|
|
35
|
+
static getPrompts(argsName: string, shouldAddDevices: boolean) {
|
|
36
|
+
return {
|
|
37
|
+
name: () => this.askProjectName(argsName),
|
|
38
|
+
directory: ({ results }: { results: DataResults }) => this.getProjectDirectory(results.name),
|
|
39
|
+
selectedDevices: () => this.askDevices(shouldAddDevices),
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Ask the project name
|
|
45
|
+
*/
|
|
46
|
+
static async askProjectName(name?: string): Promise<string> {
|
|
47
|
+
if (name != null) {
|
|
48
|
+
return UserInputGetter.formatAppName(name);
|
|
49
|
+
}
|
|
50
|
+
const errorMessage = "Project name is mandatory !";
|
|
51
|
+
name = (await prompts.text({
|
|
52
|
+
message: translation["input.name"],
|
|
53
|
+
placeholder: "Placeholder Name",
|
|
54
|
+
validate: (value) => validInputLength(errorMessage, value),
|
|
55
|
+
})) as string;
|
|
56
|
+
|
|
57
|
+
CreateAppHelper.handleCancellation(name);
|
|
58
|
+
return UserInputGetter.formatAppName(name);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
static formatAppName(input: string): string {
|
|
62
|
+
const separatorRegex = /[ /]+/;
|
|
63
|
+
return input
|
|
64
|
+
.trim()
|
|
65
|
+
.split(separatorRegex)
|
|
66
|
+
.map((el, index) => (index === 0 ? el : capitalizeFirstLetter(el)))
|
|
67
|
+
.join("");
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
static async getProjectDirectory(projectName: string): Promise<string> {
|
|
71
|
+
return Promise.resolve(`./${projectName}`);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Get a list of subscribed and non subscribed devices
|
|
76
|
+
*/
|
|
77
|
+
static getAvailableDevices() {
|
|
78
|
+
const availableDevices: SelectionArray = [];
|
|
79
|
+
const unavailableDevices: string[] = [];
|
|
80
|
+
const spinner = prompts.spinner();
|
|
81
|
+
spinner.start();
|
|
82
|
+
for (const [key, value] of Object.entries(EXTENDED_SETUP)) {
|
|
83
|
+
try {
|
|
84
|
+
execSync(`npm view ${value.package} --silent`, { encoding: "utf-8" });
|
|
85
|
+
availableDevices.push({ value: key, label: EXTENDED_SETUP[key].label });
|
|
86
|
+
} catch {
|
|
87
|
+
unavailableDevices.push(EXTENDED_SETUP[key].label);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
spinner.stop("Available devices checked");
|
|
91
|
+
return Promise.resolve({ availableDevices, unavailableDevices });
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Ask for a list of devices
|
|
96
|
+
*/
|
|
97
|
+
static async askDevices(shouldAddDevices: boolean): Promise<string[]> {
|
|
98
|
+
let selectedDevices: string[] = this.getBasicDevices();
|
|
99
|
+
if (!shouldAddDevices) {
|
|
100
|
+
return selectedDevices;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const { availableDevices, unavailableDevices } = await this.getAvailableDevices();
|
|
104
|
+
|
|
105
|
+
if (unavailableDevices.length) {
|
|
106
|
+
CreateAppHelper.promptUnavailableDevices(unavailableDevices);
|
|
107
|
+
}
|
|
108
|
+
if (availableDevices.length) {
|
|
109
|
+
const selectObject: SelectObject = {
|
|
110
|
+
message: translation["device.selection"],
|
|
111
|
+
options: availableDevices,
|
|
112
|
+
required: false,
|
|
113
|
+
};
|
|
114
|
+
selectedDevices = selectedDevices.concat((await prompts.multiselect(selectObject)) as string[]);
|
|
115
|
+
}
|
|
116
|
+
CreateAppHelper.handleCancellation(selectedDevices);
|
|
117
|
+
return selectedDevices;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Get devices natively included in user subscription
|
|
122
|
+
*/
|
|
123
|
+
static getBasicDevices(): string[] {
|
|
124
|
+
return Object.keys(BASIC_SETUP);
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* get specific configuration for selected devices
|
|
128
|
+
* @returns {Promise<any>}
|
|
129
|
+
*/
|
|
130
|
+
static async getDevicesConfig({
|
|
131
|
+
selectedDevices,
|
|
132
|
+
awsProfile,
|
|
133
|
+
}: {
|
|
134
|
+
selectedDevices: string[];
|
|
135
|
+
awsProfile: string;
|
|
136
|
+
}): Promise<Config> {
|
|
137
|
+
const config = {} as Config;
|
|
138
|
+
for (const device of selectedDevices) {
|
|
139
|
+
config[device] = (await CreateAppHelper.getDeviceConfig(device).getConfig(awsProfile)) as DeviceConf;
|
|
140
|
+
}
|
|
141
|
+
return config;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export default UserInputGetter;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import Handlebars from "handlebars";
|
|
2
|
+
import { readFile } from "node:fs/promises";
|
|
3
|
+
import { capitalizeFirstLetter } from "./stringHelper.js";
|
|
4
|
+
|
|
5
|
+
Handlebars.registerHelper("ifEqTo", (arg1, arg2) => {
|
|
6
|
+
return arg1 === arg2;
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
Handlebars.registerHelper("ifNotEqTo", (arg1, arg2) => {
|
|
10
|
+
return arg1 !== arg2;
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
Handlebars.registerHelper("normalizeName", (arg1: string, arg2: string) => {
|
|
14
|
+
let name = arg1.replaceAll(/[-_.]/g, "").toLowerCase();
|
|
15
|
+
if (name.endsWith(arg2.toLowerCase())) {
|
|
16
|
+
name = name.slice(0, name.length - arg2.length);
|
|
17
|
+
}
|
|
18
|
+
return `${capitalizeFirstLetter(name)}${arg2}`;
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
Handlebars.registerHelper("capitalize", (arg1: string) => {
|
|
22
|
+
return capitalizeFirstLetter(arg1);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
async function templateGenerator(templatePath: string, config: object): Promise<string> {
|
|
26
|
+
const templateString = await readFile(templatePath, "utf-8");
|
|
27
|
+
const template = Handlebars.compile(templateString);
|
|
28
|
+
return template(config);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export { templateGenerator };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { OptionList } from "@/common/types/helperTypes.js";
|
|
2
|
+
|
|
3
|
+
export const capitalizeFirstLetter = (input: string): string => {
|
|
4
|
+
return `${input[0].toUpperCase()}${input.substring(1)}`;
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export const optionsListString = (input: OptionList): string => {
|
|
8
|
+
return input.map((option) => option.command).join(", ");
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Remove separator characters from string and convert it to camelCase
|
|
13
|
+
*/
|
|
14
|
+
export const formatToCamelCase = (input: string): string => {
|
|
15
|
+
const separatorRegex = /[./_\-\\ ]/g;
|
|
16
|
+
|
|
17
|
+
return input
|
|
18
|
+
.trim()
|
|
19
|
+
.split(separatorRegex)
|
|
20
|
+
.map((el, index) => (index === 0 ? el.toLowerCase() : formatWordToCamelCase(el)))
|
|
21
|
+
.join("");
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const formatWordToCamelCase = (input: string): string =>
|
|
25
|
+
`${input[0].toUpperCase()}${input.substring(1).toLowerCase()}`;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
{
|
|
2
|
+
"program.usage": "A CLI to help you build dana applications",
|
|
3
|
+
"program.help.footer": "For more information, visit https://doc.dana-framework.com or contact us.",
|
|
4
|
+
"component.creation.success": "component created successfully.",
|
|
5
|
+
"component.creation.error": "Failed to create component",
|
|
6
|
+
"command.rail.description": "Add a rail",
|
|
7
|
+
"command.component.name": "Component's name",
|
|
8
|
+
"command.component.customization": "Full or partial customization. MANDATORY to not use default configuration.",
|
|
9
|
+
"command.rail.option.navigation": "Navigation type. Default: fixed",
|
|
10
|
+
"command.rail.option.direction": "Navigation direction. Default: horizontal",
|
|
11
|
+
"command.rail.option.cyclic": "True if cyclic. Default: false",
|
|
12
|
+
"command.device.description": "Add device(s) to your Dana app",
|
|
13
|
+
"command.device.version.error": "No version found.",
|
|
14
|
+
"command.device.no_selection": "Nothing selected or no device available. Exit",
|
|
15
|
+
"command.device.installed_devices": "Based on your profiles, the following devices are already supported:",
|
|
16
|
+
"command.device.profiles.tips": "All profiles are listed in: app.config.json/includes",
|
|
17
|
+
"command.device.all_already_installed": "All available devices in your subscription are already installed. Exit",
|
|
18
|
+
"command.ai.description": "Add AI skills to your DANA app",
|
|
19
|
+
"help.custom.devices": "Use the CLI to add the following devices:",
|
|
20
|
+
"help.custom.commands": "Add devices and built-in components to your DANA app:",
|
|
21
|
+
"help.option.title": "Available command options:",
|
|
22
|
+
"help.option.check": "check:",
|
|
23
|
+
"command.menu.description": "Add horizontal menu",
|
|
24
|
+
"command.menu.option.itemView": "Item to be used in the menu",
|
|
25
|
+
"command.menu.option.itemMargin": "Margin between items. Default: 20",
|
|
26
|
+
"helper.git.status.error": "Git status is not clean or an error occurred. Try to commit your change.",
|
|
27
|
+
"command.auth.description": "Authenticate to Dana framework",
|
|
28
|
+
"command.auth.login.description": "Login to Dana",
|
|
29
|
+
"command.auth.logout.description": "Logout from Dana",
|
|
30
|
+
"command.auth.login.option.org": "Organization to login/logout",
|
|
31
|
+
"command.auth.login.option.remote": "Allow connexion to dana authentication stack when working on remote server. Display login url",
|
|
32
|
+
"command.auth.login.option.port": "Provide a port for login server",
|
|
33
|
+
"command.auth.login.option.token": "Provide a dana token for login server",
|
|
34
|
+
"command.auth.login.token.error": "Invalid dana token. Token should start with 'dana_'",
|
|
35
|
+
"command.hook.login.org.error": "Login with dana token requires -org option",
|
|
36
|
+
"command.auth.remoteMode": "You are in remote mode. Verify you are forwarding the right port to the host machine.",
|
|
37
|
+
"command.auth.accessBrowserUrl": "You can complete the operation by accessing the following url in the browser.",
|
|
38
|
+
"command.auth.status.description": "Get login status",
|
|
39
|
+
"command.auth.get-packages-token.description": "Get token for packages repository",
|
|
40
|
+
"command.scrollView.description": "Add a scrollView of rails",
|
|
41
|
+
"command.scrollView.option.itemView": "Item to be used in the scrollView. Default: pre-made rail",
|
|
42
|
+
"command.scrollView.option.itemMargin": "Margin between items. Default: 550",
|
|
43
|
+
"command.screen.description": "Add a screen",
|
|
44
|
+
"command.create_app.description": "Create a new Dana app",
|
|
45
|
+
"command.create_app.name": "Project's name",
|
|
46
|
+
"command.create_app.directory": "Project directory",
|
|
47
|
+
"command.create_app.type": "Choose app type",
|
|
48
|
+
"command.create_app.template_type": "Template type",
|
|
49
|
+
"command.create_app.screen_template_type.error": "Error: A template type can only be provided with the 'templated' option",
|
|
50
|
+
"command.create_app.devices": "Add device(s) when creating the project",
|
|
51
|
+
"command.create_app.skills": "Add skills for AI agents when creating the project",
|
|
52
|
+
"command.create_app.aws_profile": "Aws profile",
|
|
53
|
+
"command.create_app.beta": "Allow beta version",
|
|
54
|
+
"command.create_app.aws_repository": "Aws repository provided during registration. Name is XXX in \"dana-XXX-repository\".",
|
|
55
|
+
"command.zip.description": "Generate an archive for a Dana app",
|
|
56
|
+
"command.zip.creation.start": "Creation",
|
|
57
|
+
"command.zip.creation.end": "Creation complete. New archive available here: ",
|
|
58
|
+
"command.zip.final": "Archive is complete and can be uploaded on dana cloud services platform.",
|
|
59
|
+
"task.installation.start": "Installation",
|
|
60
|
+
"task.installation.end": "Installation complete.",
|
|
61
|
+
"creation.final": "Everything is ready.",
|
|
62
|
+
"script.run.title": "Now you can just run:",
|
|
63
|
+
"git.error": "Git is not installed or not available in the PATH. You must install it to continue.",
|
|
64
|
+
"aws.cli.error": "AWS cli is not installed or not available in the PATH. You must install it to continue.",
|
|
65
|
+
"node.error": "Node version should be >=",
|
|
66
|
+
"setup.ok": "Configuration ok",
|
|
67
|
+
"setup.ko": "Prerequisite not met",
|
|
68
|
+
"device.unavailable": "Enhance your experience by adding device(s) to your subscription:",
|
|
69
|
+
"device.selection": "Press SPACE KEY to select additional device(s).",
|
|
70
|
+
"renderer.selection": "Select AT LEAST one renderer for",
|
|
71
|
+
"input.name": "What is your project's name ?",
|
|
72
|
+
"input.aws.error": "You need to have an AWS account.\nSee:https://dana-framework.com/guides/getting-started#configure-aws-connection",
|
|
73
|
+
"input.aws.profile": "Select your AWS profile",
|
|
74
|
+
"aws.login.error": "Please log to AWS before trying again",
|
|
75
|
+
"error.common.start.message": "An error occurred",
|
|
76
|
+
"command.completion.description": "Install shell completion (bash or zsh)",
|
|
77
|
+
"command.completion.argument": "Shell. Bash or zsh",
|
|
78
|
+
"command.completion.success": "Completion installed to ",
|
|
79
|
+
"login.info.token_expired": "Your token has expired.",
|
|
80
|
+
"login.info.please_login": "Please run 'dana auth login' command",
|
|
81
|
+
"login.error.not_logged": "You're not logged in.",
|
|
82
|
+
"login.info.logged": "You're currently logged in to Dana",
|
|
83
|
+
"command.hook.dana_project": "Can not execute command outside a Dana project: no '.dana' folder found.\nYou can add it to the root of your Dana project if needed",
|
|
84
|
+
"command.settings.description": "Add settings features in the Settings Screen",
|
|
85
|
+
"command.module": "Add a module",
|
|
86
|
+
"command.module.name": "Module's name"
|
|
87
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
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 { ANDROIDTV, TITANOS, TIZEN, TVOS, VIDAA, WEBOS } from "@/common/const/deviceConst.js";
|
|
14
|
+
import {
|
|
15
|
+
AndroidConfig,
|
|
16
|
+
AndroidDevice,
|
|
17
|
+
TizenConf,
|
|
18
|
+
WebosConf,
|
|
19
|
+
TvosConf,
|
|
20
|
+
VidaaConf,
|
|
21
|
+
TitanosConf,
|
|
22
|
+
} from "@/commands/addDevice/deviceConfig/configTypes.js";
|
|
23
|
+
|
|
24
|
+
interface Task {
|
|
25
|
+
title: string;
|
|
26
|
+
task: () => Promise<string>;
|
|
27
|
+
condition?: boolean;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
interface Data {
|
|
31
|
+
skills: boolean;
|
|
32
|
+
name: string;
|
|
33
|
+
config: Config;
|
|
34
|
+
directory: string;
|
|
35
|
+
selectedDevices: string[];
|
|
36
|
+
awsProfile: string;
|
|
37
|
+
allowBeta: boolean;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
interface Config {
|
|
41
|
+
[TVOS]?: TvosConf;
|
|
42
|
+
[ANDROIDTV]?: AndroidConfig;
|
|
43
|
+
[WEBOS]?: WebosConf;
|
|
44
|
+
[TIZEN]?: TizenConf;
|
|
45
|
+
[VIDAA]?: VidaaConf;
|
|
46
|
+
[TITANOS]?: TitanosConf;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
interface DeviceConf {
|
|
50
|
+
device?: AndroidDevice;
|
|
51
|
+
renderers?: string[];
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
type JsonType = Record<string, unknown>;
|
|
55
|
+
interface SelectionItem {
|
|
56
|
+
value: string;
|
|
57
|
+
label: string;
|
|
58
|
+
}
|
|
59
|
+
type SelectionArray = SelectionItem[];
|
|
60
|
+
interface SelectObject {
|
|
61
|
+
message: string;
|
|
62
|
+
options: SelectionArray;
|
|
63
|
+
required: boolean;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
type ConfigOptions = {
|
|
67
|
+
cyclic?: boolean;
|
|
68
|
+
itemMargin?: number;
|
|
69
|
+
custom?: boolean;
|
|
70
|
+
} & Record<string, string>;
|
|
71
|
+
|
|
72
|
+
interface OptionItem {
|
|
73
|
+
label: string;
|
|
74
|
+
value: string;
|
|
75
|
+
command: string;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
type OptionList = OptionItem[];
|
|
79
|
+
export { Task, Data, Config, DeviceConf, JsonType, SelectObject, SelectionArray, ConfigOptions, OptionList };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2014-2025 Wiztivi - contact@wiztivi.com
|
|
4
|
+
* All Rights Reserved
|
|
5
|
+
*
|
|
6
|
+
* All information contained herein is proprietary and confidential.
|
|
7
|
+
* Dissemination of this information or reproduction of this file or material, via any medium is strictly forbidden unless
|
|
8
|
+
* prior written permission is obtained from Wiztivi.
|
|
9
|
+
* No warranty, explicit or implicit, provided.
|
|
10
|
+
* This software MAY NOT be used, modified or rewritten without prior written permission from Wiztivi.
|
|
11
|
+
*
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { makeProgram } from "./program.js";
|
|
15
|
+
|
|
16
|
+
(await makeProgram()).parse();
|