@wiztivi/dana-cli 0.0.4 → 0.0.6

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 (72) hide show
  1. package/bin/dana.js +1 -1
  2. package/dist/commands/addComponent/addMenu/add-menu.js +20 -25
  3. package/dist/commands/addComponent/addMenu/addMenuDefinition.js +12 -17
  4. package/dist/commands/addComponent/addRail/add-rail.js +17 -22
  5. package/dist/commands/addComponent/addRail/addRailDefinition.js +19 -24
  6. package/dist/commands/addComponent/addScreen/add-screen.js +11 -49
  7. package/dist/commands/addComponent/addScreen/addScreenDefinition.js +9 -14
  8. package/dist/commands/addComponent/addScrollView/add-scrollView.js +17 -22
  9. package/dist/commands/addComponent/addScrollView/addScrollViewDefinition.js +11 -16
  10. package/dist/commands/addComponent/config/ComponentConfig.d.ts +2 -2
  11. package/dist/commands/addComponent/config/ComponentConfig.js +23 -61
  12. package/dist/commands/addComponent/config/componentTypes.js +1 -2
  13. package/dist/commands/addComponent/const/componentConst.js +8 -11
  14. package/dist/commands/addComponent/const/defaultConfig.d.ts +1 -1
  15. package/dist/commands/addComponent/const/defaultConfig.js +7 -10
  16. package/dist/commands/addComponent/const/navigationConst.d.ts +1 -1
  17. package/dist/commands/addComponent/const/navigationConst.js +7 -13
  18. package/dist/commands/addComponent/createComponent.d.ts +1 -1
  19. package/dist/commands/addComponent/createComponent.js +15 -54
  20. package/dist/commands/addComponent/helper/ComponentHelper.d.ts +2 -1
  21. package/dist/commands/addComponent/helper/ComponentHelper.js +22 -50
  22. package/dist/commands/addDevice/add-device.js +34 -72
  23. package/dist/commands/addDevice/addDeviceDefinition.js +9 -14
  24. package/dist/commands/addDevice/deviceConfig/androidtvConfig.d.ts +1 -1
  25. package/dist/commands/addDevice/deviceConfig/androidtvConfig.js +39 -77
  26. package/dist/commands/addDevice/deviceConfig/configTypes.js +1 -2
  27. package/dist/commands/addDevice/deviceConfig/deviceConfig.js +1 -3
  28. package/dist/commands/addDevice/deviceConfig/tizenConfig.d.ts +1 -1
  29. package/dist/commands/addDevice/deviceConfig/tizenConfig.js +10 -15
  30. package/dist/commands/addDevice/deviceConfig/tvosConfig.js +8 -13
  31. package/dist/commands/addDevice/deviceConfig/webosConfig.d.ts +1 -1
  32. package/dist/commands/addDevice/deviceConfig/webosConfig.js +25 -63
  33. package/dist/commands/addDevice/helper/addDeviceHelper.js +7 -12
  34. package/dist/commands/authentication/authDefinition.js +14 -19
  35. package/dist/commands/authentication/authHook.js +5 -9
  36. package/dist/commands/authentication/authentConst.js +4 -7
  37. package/dist/commands/authentication/commands/login.js +29 -67
  38. package/dist/commands/authentication/commands/status.js +12 -52
  39. package/dist/commands/authentication/helper/CodeArtifactHelper.d.ts +1 -1
  40. package/dist/commands/authentication/helper/CodeArtifactHelper.js +14 -20
  41. package/dist/commands/authentication/helper/CredentialsHelper.js +8 -15
  42. package/dist/commands/commandHelp/customHelp.js +6 -11
  43. package/dist/commands/completion/completion.js +15 -51
  44. package/dist/commands/completion/completionDefinition.js +8 -13
  45. package/dist/commands/createApp/const/setupConst.js +1 -5
  46. package/dist/commands/createApp/createApp.js +42 -80
  47. package/dist/commands/createApp/createAppDefinition.js +13 -18
  48. package/dist/commands/createApp/helpers/CreateAppHelper.d.ts +9 -9
  49. package/dist/commands/createApp/helpers/CreateAppHelper.js +20 -58
  50. package/dist/commands/createApp/helpers/SetupChecker.d.ts +1 -1
  51. package/dist/commands/createApp/helpers/SetupChecker.js +14 -52
  52. package/dist/common/commonConst.js +1 -4
  53. package/dist/common/const/deviceConst.js +1 -14
  54. package/dist/common/const/exitCodeConst.js +7 -10
  55. package/dist/common/helpers/CreateFileHelper.d.ts +1 -1
  56. package/dist/common/helpers/CreateFileHelper.js +22 -27
  57. package/dist/common/helpers/InputValidator.js +7 -15
  58. package/dist/common/helpers/InstallHelper.d.ts +1 -1
  59. package/dist/common/helpers/InstallHelper.js +13 -18
  60. package/dist/common/helpers/UpdateFileHelper.d.ts +1 -1
  61. package/dist/common/helpers/UpdateFileHelper.js +34 -39
  62. package/dist/common/helpers/UserInputGetter.d.ts +1 -1
  63. package/dist/common/helpers/UserInputGetter.js +20 -58
  64. package/dist/common/helpers/handlebarsHelper.js +12 -17
  65. package/dist/common/helpers/stringHelper.d.ts +1 -1
  66. package/dist/common/helpers/stringHelper.js +2 -7
  67. package/dist/common/translation/translation.js +3 -8
  68. package/dist/common/types/helperTypes.d.ts +2 -2
  69. package/dist/common/types/helperTypes.js +1 -3
  70. package/dist/index.js +2 -4
  71. package/dist/program.js +30 -35
  72. package/package.json +6 -2
package/bin/dana.js CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- require("../dist/index");
3
+ import("../dist/index.js");
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  /*
3
2
  * Copyright (c) 2014-2025 Wiztivi - contact@wiztivi.com
4
3
  * All Rights Reserved
@@ -10,18 +9,14 @@
10
9
  * This software MAY NOT be used, modified or rewritten without prior written permission from Wiztivi.
11
10
  *
12
11
  */
13
- var __importDefault = (this && this.__importDefault) || function (mod) {
14
- return (mod && mod.__esModule) ? mod : { "default": mod };
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- const componentConst_1 = require("../const/componentConst");
18
- const createComponent_1 = __importDefault(require("../createComponent"));
19
- const node_process_1 = __importDefault(require("node:process"));
20
- const node_path_1 = __importDefault(require("node:path"));
21
- const node_fs_1 = require("node:fs");
22
- const ComponentConfig_1 = __importDefault(require("../config/ComponentConfig"));
23
- const defaultConfig_1 = require("../const/defaultConfig");
24
- const commonConst_1 = require("../../../common/commonConst");
12
+ import { BUTTON_ITEM_VIEW } from "../const/componentConst.js";
13
+ import createComponent from "../createComponent.js";
14
+ import process from "node:process";
15
+ import path from "node:path";
16
+ import { cpSync } from "node:fs";
17
+ import ComponentConfig from "../config/ComponentConfig.js";
18
+ import { MENU_DEFAULT_CONFIG } from "../const/defaultConfig.js";
19
+ import ComponentHelper from "../helper/ComponentHelper.js";
25
20
  const addMenu = async (name, options) => {
26
21
  const data = { ...options };
27
22
  if (name) {
@@ -29,22 +24,22 @@ const addMenu = async (name, options) => {
29
24
  }
30
25
  const menuConfig = {
31
26
  ...data,
32
- ...(await ComponentConfig_1.default.menuConfig(data)),
27
+ ...(await ComponentConfig.menuConfig(data)),
33
28
  };
34
29
  const componentList = [menuConfig];
35
30
  if (!data.custom) {
36
- componentList.push({ type: componentConst_1.BUTTON_ITEM_VIEW, name: data.itemView ?? defaultConfig_1.MENU_DEFAULT_CONFIG.itemView });
31
+ componentList.push({ type: BUTTON_ITEM_VIEW, name: data.itemView ?? MENU_DEFAULT_CONFIG.itemView });
37
32
  }
38
- (0, createComponent_1.default)(componentList);
33
+ createComponent(componentList);
39
34
  if (!data.custom) {
40
- const currentDirectory = node_process_1.default.cwd();
41
- const modulePath = require.resolve(commonConst_1.TEMPLATE_MODULE);
42
- const mockPath = node_path_1.default.join(node_path_1.default.dirname(modulePath), "mocks", "menuMock.json");
43
- const iconPath = node_path_1.default.join(node_path_1.default.dirname(modulePath), "icons");
44
- const mockFinalPath = node_path_1.default.resolve(currentDirectory, "menuMock.json");
45
- const iconFinalPath = node_path_1.default.resolve(currentDirectory, "./images/icons");
46
- (0, node_fs_1.cpSync)(mockPath, mockFinalPath);
47
- (0, node_fs_1.cpSync)(iconPath, iconFinalPath, { recursive: true });
35
+ const currentDirectory = process.cwd();
36
+ const modulePath = ComponentHelper.getTemplatePath();
37
+ const mockPath = path.join(path.dirname(modulePath), "mocks", "menuMock.json");
38
+ const iconPath = path.join(path.dirname(modulePath), "icons");
39
+ const mockFinalPath = path.resolve(currentDirectory, "menuMock.json");
40
+ const iconFinalPath = path.resolve(currentDirectory, "./images/icons");
41
+ cpSync(mockPath, mockFinalPath);
42
+ cpSync(iconPath, iconFinalPath, { recursive: true });
48
43
  }
49
44
  };
50
- exports.default = addMenu;
45
+ export default addMenu;
@@ -1,21 +1,16 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const commander_1 = require("commander");
7
- const add_menu_1 = __importDefault(require("./add-menu"));
8
- const translation_1 = __importDefault(require("../../../common/translation/translation"));
1
+ import { Command } from "commander";
2
+ import addMenu from "./add-menu.js";
3
+ import translation from "../../../common/translation/translation.js";
9
4
  const addMenuDefinition = () => {
10
- const command = new commander_1.Command("add-menu");
5
+ const command = new Command("add-menu");
11
6
  command
12
- .description(translation_1.default["command.menu.description"])
13
- .argument("[name]", translation_1.default["command.component.name"])
14
- .option("-cm, --custom", translation_1.default["command.component.customization"])
15
- .option("-i, --itemView <itemView>", translation_1.default["command.menu.option.itemView"])
16
- .option("-m, --itemMargin <itemMargin>", translation_1.default["command.menu.option.itemMargin"])
17
- .option("-d, --direction <direction>", translation_1.default["command.rail.option.direction"])
18
- .action(add_menu_1.default);
7
+ .description(translation["command.menu.description"])
8
+ .argument("[name]", translation["command.component.name"])
9
+ .option("-cm, --custom", translation["command.component.customization"])
10
+ .option("-i, --itemView <itemView>", translation["command.menu.option.itemView"])
11
+ .option("-m, --itemMargin <itemMargin>", translation["command.menu.option.itemMargin"])
12
+ .option("-d, --direction <direction>", translation["command.rail.option.direction"])
13
+ .action(addMenu);
19
14
  return command;
20
15
  };
21
- exports.default = addMenuDefinition;
16
+ export default addMenuDefinition;
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  /*
3
2
  * Copyright (c) 2014-2025 Wiztivi - contact@wiztivi.com
4
3
  * All Rights Reserved
@@ -10,18 +9,14 @@
10
9
  * This software MAY NOT be used, modified or rewritten without prior written permission from Wiztivi.
11
10
  *
12
11
  */
13
- var __importDefault = (this && this.__importDefault) || function (mod) {
14
- return (mod && mod.__esModule) ? mod : { "default": mod };
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- const componentConst_1 = require("../const/componentConst");
18
- const createComponent_1 = __importDefault(require("../createComponent"));
19
- const node_process_1 = __importDefault(require("node:process"));
20
- const node_path_1 = __importDefault(require("node:path"));
21
- const node_fs_1 = require("node:fs");
22
- const ComponentConfig_1 = __importDefault(require("../config/ComponentConfig"));
23
- const defaultConfig_1 = require("../const/defaultConfig");
24
- const commonConst_1 = require("../../../common/commonConst");
12
+ import { TILE_VIEW } from "../const/componentConst.js";
13
+ import createComponent from "../createComponent.js";
14
+ import process from "node:process";
15
+ import path from "node:path";
16
+ import { cpSync } from "node:fs";
17
+ import ComponentConfig from "../config/ComponentConfig.js";
18
+ import { RAIL_DEFAULT_CONFIG } from "../const/defaultConfig.js";
19
+ import ComponentHelper from "../helper/ComponentHelper.js";
25
20
  const addRail = async (name, options) => {
26
21
  const data = { ...options };
27
22
  if (name) {
@@ -29,19 +24,19 @@ const addRail = async (name, options) => {
29
24
  }
30
25
  const railConfig = {
31
26
  ...data,
32
- ...(await ComponentConfig_1.default.railConfig(data)),
27
+ ...(await ComponentConfig.railConfig(data)),
33
28
  };
34
29
  const componentList = [railConfig];
35
30
  if (!data.custom) {
36
- componentList.push({ type: componentConst_1.TILE_VIEW, name: data.itemView ?? defaultConfig_1.RAIL_DEFAULT_CONFIG.itemView });
31
+ componentList.push({ type: TILE_VIEW, name: data.itemView ?? RAIL_DEFAULT_CONFIG.itemView });
37
32
  }
38
- (0, createComponent_1.default)(componentList);
33
+ createComponent(componentList);
39
34
  if (!data.custom) {
40
- const currentDirectory = node_process_1.default.cwd();
41
- const modulePath = require.resolve(commonConst_1.TEMPLATE_MODULE);
42
- const mockPath = node_path_1.default.join(node_path_1.default.dirname(modulePath), "mocks", "railMock.json");
43
- const finalPath = node_path_1.default.resolve(currentDirectory, "railMock.json");
44
- (0, node_fs_1.cpSync)(mockPath, finalPath);
35
+ const currentDirectory = process.cwd();
36
+ const modulePath = ComponentHelper.getTemplatePath();
37
+ const mockPath = path.join(path.dirname(modulePath), "mocks", "railMock.json");
38
+ const finalPath = path.resolve(currentDirectory, "railMock.json");
39
+ cpSync(mockPath, finalPath);
45
40
  }
46
41
  };
47
- exports.default = addRail;
42
+ export default addRail;
@@ -1,31 +1,26 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const commander_1 = require("commander");
7
- const add_rail_1 = __importDefault(require("./add-rail"));
8
- const navigationConst_1 = require("../const/navigationConst");
9
- const translation_1 = __importDefault(require("../../../common/translation/translation"));
10
- const stringHelper_1 = require("../../../common/helpers/stringHelper");
1
+ import { Command } from "commander";
2
+ import addRail from "./add-rail.js";
3
+ import { NAVIGATION_TYPES, DIRECTION_TYPES } from "../const/navigationConst.js";
4
+ import translation from "../../../common/translation/translation.js";
5
+ import { optionsListString } from "../../../common/helpers/stringHelper.js";
11
6
  const addRailDefinition = () => {
12
- const command = new commander_1.Command("add-rail");
7
+ const command = new Command("add-rail");
13
8
  command
14
- .description(translation_1.default["command.rail.description"])
15
- .argument("[name]", translation_1.default["command.component.name"])
16
- .option("-cm, --custom", translation_1.default["command.component.customization"])
17
- .option("-n, --navigation <navigation>", translation_1.default["command.rail.option.navigation"])
18
- .option("-d, --direction <direction>", translation_1.default["command.rail.option.direction"])
19
- .option("-c, --cyclic", translation_1.default["command.rail.option.cyclic"])
20
- .option("-i, --itemView <itemView>", translation_1.default["command.menu.option.itemView"])
9
+ .description(translation["command.rail.description"])
10
+ .argument("[name]", translation["command.component.name"])
11
+ .option("-cm, --custom", translation["command.component.customization"])
12
+ .option("-n, --navigation <navigation>", translation["command.rail.option.navigation"])
13
+ .option("-d, --direction <direction>", translation["command.rail.option.direction"])
14
+ .option("-c, --cyclic", translation["command.rail.option.cyclic"])
15
+ .option("-i, --itemView <itemView>", translation["command.menu.option.itemView"])
21
16
  .addHelpText("after", `
22
- ${translation_1.default["help.option.title"]}
23
- -navigation: ${(0, stringHelper_1.optionsListString)(navigationConst_1.NAVIGATION_TYPES)}
24
- -direction: ${(0, stringHelper_1.optionsListString)(navigationConst_1.DIRECTION_TYPES)}
17
+ ${translation["help.option.title"]}
18
+ -navigation: ${optionsListString(NAVIGATION_TYPES)}
19
+ -direction: ${optionsListString(DIRECTION_TYPES)}
25
20
 
26
- More about rail feature, ${translation_1.default["help.option.check"]} https://doc.dana-framework.com/docs/vendorcomponents/recycling-listview
21
+ More about rail feature, ${translation["help.option.check"]} https://doc.dana-framework.com/docs/vendorcomponents/recycling-listview
27
22
  `)
28
- .action(add_rail_1.default);
23
+ .action(addRail);
29
24
  return command;
30
25
  };
31
- exports.default = addRailDefinition;
26
+ export default addRailDefinition;
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  /*
3
2
  * Copyright (c) 2014-2025 Wiztivi - contact@wiztivi.com
4
3
  * All Rights Reserved
@@ -10,62 +9,25 @@
10
9
  * This software MAY NOT be used, modified or rewritten without prior written permission from Wiztivi.
11
10
  *
12
11
  */
13
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
- if (k2 === undefined) k2 = k;
15
- var desc = Object.getOwnPropertyDescriptor(m, k);
16
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
- desc = { enumerable: true, get: function() { return m[k]; } };
18
- }
19
- Object.defineProperty(o, k2, desc);
20
- }) : (function(o, m, k, k2) {
21
- if (k2 === undefined) k2 = k;
22
- o[k2] = m[k];
23
- }));
24
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
- Object.defineProperty(o, "default", { enumerable: true, value: v });
26
- }) : function(o, v) {
27
- o["default"] = v;
28
- });
29
- var __importStar = (this && this.__importStar) || (function () {
30
- var ownKeys = function(o) {
31
- ownKeys = Object.getOwnPropertyNames || function (o) {
32
- var ar = [];
33
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
34
- return ar;
35
- };
36
- return ownKeys(o);
37
- };
38
- return function (mod) {
39
- if (mod && mod.__esModule) return mod;
40
- var result = {};
41
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
42
- __setModuleDefault(result, mod);
43
- return result;
44
- };
45
- })();
46
- var __importDefault = (this && this.__importDefault) || function (mod) {
47
- return (mod && mod.__esModule) ? mod : { "default": mod };
48
- };
49
- Object.defineProperty(exports, "__esModule", { value: true });
50
- const componentConst_1 = require("../const/componentConst");
51
- const createComponent_1 = __importDefault(require("../createComponent"));
52
- const add_menu_1 = __importDefault(require("../addMenu/add-menu"));
53
- const add_scrollView_1 = __importDefault(require("../addScrollView/add-scrollView"));
54
- const prompts = __importStar(require("@clack/prompts"));
12
+ import { SCREEN, VOD_SCREEN } from "../const/componentConst.js";
13
+ import createComponent from "../createComponent.js";
14
+ import addMenu from "../addMenu/add-menu.js";
15
+ import addScrollView from "../addScrollView/add-scrollView.js";
16
+ import * as prompts from "@clack/prompts";
55
17
  const addScreen = async (name, options) => {
56
18
  try {
57
19
  const data = {
58
20
  name: name ?? "Mock",
59
- type: options?.screenType ?? componentConst_1.SCREEN,
21
+ type: options?.screenType ?? SCREEN,
60
22
  };
61
- if (options?.screenType === componentConst_1.VOD_SCREEN) {
62
- await (0, add_menu_1.default)(componentConst_1.VOD_SCREEN, {});
63
- await (0, add_scrollView_1.default)(componentConst_1.VOD_SCREEN, {});
23
+ if (options?.screenType === VOD_SCREEN) {
24
+ await addMenu(VOD_SCREEN, {});
25
+ await addScrollView(VOD_SCREEN, {});
64
26
  }
65
- (0, createComponent_1.default)([data]);
27
+ createComponent([data]);
66
28
  }
67
29
  catch (e) {
68
30
  prompts.log.info(`Error creating screen: ${e.message}`);
69
31
  }
70
32
  };
71
- exports.default = addScreen;
33
+ export default addScreen;
@@ -1,18 +1,13 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const commander_1 = require("commander");
7
- const translation_1 = __importDefault(require("../../../common/translation/translation"));
8
- const add_screen_1 = __importDefault(require("./add-screen"));
1
+ import { Command } from "commander";
2
+ import translation from "../../../common/translation/translation.js";
3
+ import addScreen from "./add-screen.js";
9
4
  const addScreenDefinition = () => {
10
- const command = new commander_1.Command("add-screen");
5
+ const command = new Command("add-screen");
11
6
  command
12
- .description(translation_1.default["command.screen.description"])
13
- .argument("[name]", translation_1.default["command.component.name"])
14
- .option("-s, --screenType [screenType]", translation_1.default["command.screen.option.type"])
15
- .action(add_screen_1.default);
7
+ .description(translation["command.screen.description"])
8
+ .argument("[name]", translation["command.component.name"])
9
+ .option("-s, --screenType [screenType]", translation["command.screen.option.type"])
10
+ .action(addScreen);
16
11
  return command;
17
12
  };
18
- exports.default = addScreenDefinition;
13
+ export default addScreenDefinition;
@@ -1,16 +1,11 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const componentConst_1 = require("../const/componentConst");
7
- const createComponent_1 = __importDefault(require("../createComponent"));
8
- const node_process_1 = __importDefault(require("node:process"));
9
- const node_path_1 = __importDefault(require("node:path"));
10
- const node_fs_1 = require("node:fs");
11
- const defaultConfig_1 = require("../const/defaultConfig");
12
- const ComponentConfig_1 = __importDefault(require("../config/ComponentConfig"));
13
- const commonConst_1 = require("../../../common/commonConst");
1
+ import { SCROLL_ITEM, TILE_VIEW } from "../const/componentConst.js";
2
+ import createComponent from "../createComponent.js";
3
+ import process from "node:process";
4
+ import path from "node:path";
5
+ import { cpSync } from "node:fs";
6
+ import { SCROLLVIEW_DEFAULT_CONFIG } from "../const/defaultConfig.js";
7
+ import ComponentConfig from "../config/ComponentConfig.js";
8
+ import ComponentHelper from "../helper/ComponentHelper.js";
14
9
  const addScrollView = async (name, options) => {
15
10
  const data = { ...options };
16
11
  if (name) {
@@ -18,19 +13,19 @@ const addScrollView = async (name, options) => {
18
13
  }
19
14
  const scrollViewConfig = {
20
15
  ...data,
21
- ...(await ComponentConfig_1.default.scrollViewConfig(data)),
16
+ ...(await ComponentConfig.scrollViewConfig(data)),
22
17
  };
23
18
  const componentList = [scrollViewConfig];
24
19
  if (!data.custom) {
25
- componentList.push({ type: componentConst_1.SCROLL_ITEM, name: data.itemView ?? defaultConfig_1.SCROLLVIEW_DEFAULT_CONFIG.itemView }, { type: componentConst_1.TILE_VIEW, name: "mockTile" });
20
+ componentList.push({ type: SCROLL_ITEM, name: data.itemView ?? SCROLLVIEW_DEFAULT_CONFIG.itemView }, { type: TILE_VIEW, name: "mockTile" });
26
21
  }
27
- (0, createComponent_1.default)(componentList);
22
+ createComponent(componentList);
28
23
  if (!data.custom) {
29
- const currentDirectory = node_process_1.default.cwd();
30
- const modulePath = require.resolve(commonConst_1.TEMPLATE_MODULE);
31
- const mockPath = node_path_1.default.join(node_path_1.default.dirname(modulePath), "mocks", "scrollViewMock.json");
32
- const finalPath = node_path_1.default.resolve(currentDirectory, "scrollViewMock.json");
33
- (0, node_fs_1.cpSync)(mockPath, finalPath);
24
+ const currentDirectory = process.cwd();
25
+ const modulePath = ComponentHelper.getTemplatePath();
26
+ const mockPath = path.join(path.dirname(modulePath), "mocks", "scrollViewMock.json");
27
+ const finalPath = path.resolve(currentDirectory, "scrollViewMock.json");
28
+ cpSync(mockPath, finalPath);
34
29
  }
35
30
  };
36
- exports.default = addScrollView;
31
+ export default addScrollView;
@@ -1,18 +1,13 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const commander_1 = require("commander");
7
- const add_scrollView_1 = __importDefault(require("./add-scrollView"));
8
- const translation_1 = __importDefault(require("../../../common/translation/translation"));
1
+ import { Command } from "commander";
2
+ import addScrollView from "./add-scrollView.js";
3
+ import translation from "../../../common/translation/translation.js";
9
4
  const addScrollViewDefinition = () => {
10
- return new commander_1.Command("add-scrollView")
11
- .description(translation_1.default["command.scrollView.description"])
12
- .argument("[name]", translation_1.default["command.component.name"])
13
- .option("-cm, --custom", translation_1.default["command.component.customization"])
14
- .option("-i, --itemView <itemView>", translation_1.default["command.menu.option.itemView"])
15
- .option("-m, --itemMargin <itemMargin>", translation_1.default["command.menu.option.itemMargin"])
16
- .action(add_scrollView_1.default);
5
+ return new Command("add-scrollView")
6
+ .description(translation["command.scrollView.description"])
7
+ .argument("[name]", translation["command.component.name"])
8
+ .option("-cm, --custom", translation["command.component.customization"])
9
+ .option("-i, --itemView <itemView>", translation["command.menu.option.itemView"])
10
+ .option("-m, --itemMargin <itemMargin>", translation["command.menu.option.itemMargin"])
11
+ .action(addScrollView);
17
12
  };
18
- exports.default = addScrollViewDefinition;
13
+ export default addScrollViewDefinition;
@@ -1,5 +1,5 @@
1
- import { RailConfig, MenuConfig, ScreenConfig, ScrollViewConfig } from "./componentTypes";
2
- import { ConfigOptions, OptionList } from "../../../common/types/helperTypes";
1
+ import { RailConfig, MenuConfig, ScreenConfig, ScrollViewConfig } from "./componentTypes.js";
2
+ import { ConfigOptions, OptionList } from "../../../common/types/helperTypes.js";
3
3
  interface AskComponentParam {
4
4
  componentOption: string;
5
5
  optionList: OptionList;
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  /*
3
2
  * Copyright (c) 2014-2025 Wiztivi - contact@wiztivi.com
4
3
  * All Rights Reserved
@@ -10,50 +9,13 @@
10
9
  * This software MAY NOT be used, modified or rewritten without prior written permission from Wiztivi.
11
10
  *
12
11
  */
13
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
- if (k2 === undefined) k2 = k;
15
- var desc = Object.getOwnPropertyDescriptor(m, k);
16
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
- desc = { enumerable: true, get: function() { return m[k]; } };
18
- }
19
- Object.defineProperty(o, k2, desc);
20
- }) : (function(o, m, k, k2) {
21
- if (k2 === undefined) k2 = k;
22
- o[k2] = m[k];
23
- }));
24
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
- Object.defineProperty(o, "default", { enumerable: true, value: v });
26
- }) : function(o, v) {
27
- o["default"] = v;
28
- });
29
- var __importStar = (this && this.__importStar) || (function () {
30
- var ownKeys = function(o) {
31
- ownKeys = Object.getOwnPropertyNames || function (o) {
32
- var ar = [];
33
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
34
- return ar;
35
- };
36
- return ownKeys(o);
37
- };
38
- return function (mod) {
39
- if (mod && mod.__esModule) return mod;
40
- var result = {};
41
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
42
- __setModuleDefault(result, mod);
43
- return result;
44
- };
45
- })();
46
- var __importDefault = (this && this.__importDefault) || function (mod) {
47
- return (mod && mod.__esModule) ? mod : { "default": mod };
48
- };
49
- Object.defineProperty(exports, "__esModule", { value: true });
50
- const prompts = __importStar(require("@clack/prompts"));
51
- const ComponentHelper_1 = __importDefault(require("../helper/ComponentHelper"));
52
- const navigationConst_1 = require("../const/navigationConst");
53
- const exitCodeConst_1 = require("../../../common/const/exitCodeConst");
54
- const InputValidator_1 = require("../../../common/helpers/InputValidator");
55
- const defaultConfig_1 = require("../const/defaultConfig");
56
- const stringHelper_1 = require("../../../common/helpers/stringHelper");
12
+ import * as prompts from "@clack/prompts";
13
+ import ComponentHelper from "../helper/ComponentHelper.js";
14
+ import { DIRECTION_TYPES, NAVIGATION_TYPES } from "../const/navigationConst.js";
15
+ import { CANCEL } from "../../../common/const/exitCodeConst.js";
16
+ import { validInputLength, validNumber } from "../../../common/helpers/InputValidator.js";
17
+ import { RAIL_DEFAULT_CONFIG, MENU_DEFAULT_CONFIG, SCROLLVIEW_DEFAULT_CONFIG } from "../const/defaultConfig.js";
18
+ import { capitalizeFirstLetter } from "../../../common/helpers/stringHelper.js";
57
19
  const ComponentConfig = class {
58
20
  /**
59
21
  * Get component or element name from user
@@ -64,9 +26,9 @@ const ComponentConfig = class {
64
26
  name = (await prompts.text({
65
27
  message: `${componentType} name`,
66
28
  placeholder: "Placeholder Name",
67
- validate: (value) => (0, InputValidator_1.validInputLength)(value, errorMessage),
29
+ validate: (value) => validInputLength(value, errorMessage),
68
30
  }));
69
- ComponentHelper_1.default.handleCancellation(name);
31
+ ComponentHelper.handleCancellation(name);
70
32
  }
71
33
  return name.trim();
72
34
  };
@@ -78,9 +40,9 @@ const ComponentConfig = class {
78
40
  const numberValue = (await prompts.text({
79
41
  message,
80
42
  placeholder: "00",
81
- validate: (value) => (0, InputValidator_1.validNumber)(value, errorMessage),
43
+ validate: (value) => validNumber(value, errorMessage),
82
44
  }));
83
- ComponentHelper_1.default.handleCancellation(numberValue);
45
+ ComponentHelper.handleCancellation(numberValue);
84
46
  return +numberValue;
85
47
  }
86
48
  return numberValue;
@@ -94,10 +56,10 @@ const ComponentConfig = class {
94
56
  */
95
57
  static askComponentOption = async (dataOption) => {
96
58
  const { componentOption, optionList, optionType } = dataOption;
97
- let finalOption = ComponentHelper_1.default.checkOption(componentOption, optionList, optionType);
59
+ let finalOption = ComponentHelper.checkOption(componentOption, optionList, optionType);
98
60
  if (!finalOption) {
99
- const selectionMessage = `${(0, stringHelper_1.capitalizeFirstLetter)(optionType)} option`;
100
- finalOption = await ComponentHelper_1.default.selectionFactory(optionType, optionList, selectionMessage);
61
+ const selectionMessage = `${capitalizeFirstLetter(optionType)} option`;
62
+ finalOption = await ComponentHelper.selectionFactory(optionType, optionList, selectionMessage);
101
63
  }
102
64
  return finalOption;
103
65
  };
@@ -106,31 +68,31 @@ const ComponentConfig = class {
106
68
  const cyclic = (await prompts.confirm({
107
69
  message: "Cyclic list ?",
108
70
  }));
109
- ComponentHelper_1.default.handleCancellation(cyclic);
71
+ ComponentHelper.handleCancellation(cyclic);
110
72
  return cyclic;
111
73
  }
112
74
  return data.cyclic;
113
75
  };
114
76
  static handlePromptCancel = () => {
115
77
  prompts.cancel("Operation cancelled.");
116
- process.exit(exitCodeConst_1.CANCEL);
78
+ process.exit(CANCEL);
117
79
  };
118
80
  static getDefaultConfig = (data, defaultConfig) => {
119
81
  return { ...defaultConfig, ...data, addMock: !data.custom };
120
82
  };
121
83
  static railConfig = async (data) => {
122
- const config = ComponentConfig.getDefaultConfig(data, defaultConfig_1.RAIL_DEFAULT_CONFIG);
84
+ const config = ComponentConfig.getDefaultConfig(data, RAIL_DEFAULT_CONFIG);
123
85
  if (data.custom) {
124
86
  const customConfig = await prompts.group({
125
87
  name: async () => await this.askName("rail", data.name),
126
88
  navigation: async () => await this.askComponentOption({
127
89
  componentOption: data.navigation,
128
- optionList: navigationConst_1.NAVIGATION_TYPES,
90
+ optionList: NAVIGATION_TYPES,
129
91
  optionType: "navigation",
130
92
  }),
131
93
  direction: async () => await this.askComponentOption({
132
94
  componentOption: data.direction,
133
- optionList: navigationConst_1.DIRECTION_TYPES,
95
+ optionList: DIRECTION_TYPES,
134
96
  optionType: "direction",
135
97
  }),
136
98
  isCyclic: async () => await this.askCyclic(data),
@@ -141,7 +103,7 @@ const ComponentConfig = class {
141
103
  return config;
142
104
  };
143
105
  static menuConfig = async (data) => {
144
- const config = ComponentConfig.getDefaultConfig(data, defaultConfig_1.MENU_DEFAULT_CONFIG);
106
+ const config = ComponentConfig.getDefaultConfig(data, MENU_DEFAULT_CONFIG);
145
107
  if (data.custom) {
146
108
  const customConfig = await prompts.group({
147
109
  name: async () => await this.askName("menu", data.name),
@@ -149,7 +111,7 @@ const ComponentConfig = class {
149
111
  itemMargin: async () => await this.askNumber("item margin", data.itemMargin),
150
112
  direction: async () => await this.askComponentOption({
151
113
  componentOption: data.direction,
152
- optionList: navigationConst_1.DIRECTION_TYPES,
114
+ optionList: DIRECTION_TYPES,
153
115
  optionType: "direction",
154
116
  }),
155
117
  }, { onCancel: () => ComponentConfig.handlePromptCancel() });
@@ -158,7 +120,7 @@ const ComponentConfig = class {
158
120
  return config;
159
121
  };
160
122
  static scrollViewConfig = async (data) => {
161
- const config = ComponentConfig.getDefaultConfig(data, defaultConfig_1.SCROLLVIEW_DEFAULT_CONFIG);
123
+ const config = ComponentConfig.getDefaultConfig(data, SCROLLVIEW_DEFAULT_CONFIG);
162
124
  if (data.custom) {
163
125
  const customConfig = await prompts.group({
164
126
  name: async () => await this.askName("scrollView", data.name),
@@ -175,4 +137,4 @@ const ComponentConfig = class {
175
137
  };
176
138
  };
177
139
  };
178
- exports.default = ComponentConfig;
140
+ export default ComponentConfig;
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  /*
3
2
  * Copyright (c) 2014-2025 Wiztivi - contact@wiztivi.com
4
3
  * All Rights Reserved
@@ -10,13 +9,11 @@
10
9
  * This software MAY NOT be used, modified or rewritten without prior written permission from Wiztivi.
11
10
  *
12
11
  */
13
- Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.VOD_SCREEN = exports.SCREEN = exports.BUTTON_ITEM_VIEW = exports.SCROLL_ITEM = exports.SCROLL_VIEW = exports.TILE_VIEW = exports.RAIL = exports.MENU = void 0;
15
- exports.MENU = "wtvMenuListView";
16
- exports.RAIL = "wtvRailListView";
17
- exports.TILE_VIEW = "tileView";
18
- exports.SCROLL_VIEW = "scrollView";
19
- exports.SCROLL_ITEM = "scrollItemView";
20
- exports.BUTTON_ITEM_VIEW = "ButtonItemView";
21
- exports.SCREEN = "screen";
22
- exports.VOD_SCREEN = "vod";
12
+ export const MENU = "wtvMenuListView";
13
+ export const RAIL = "wtvRailListView";
14
+ export const TILE_VIEW = "tileView";
15
+ export const SCROLL_VIEW = "scrollView";
16
+ export const SCROLL_ITEM = "scrollItemView";
17
+ export const BUTTON_ITEM_VIEW = "ButtonItemView";
18
+ export const SCREEN = "screen";
19
+ export const VOD_SCREEN = "vod";