@wiztivi/dana-cli 0.0.2 → 0.0.4
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/dist/commands/{add-menu.js → addComponent/addMenu/add-menu.js} +12 -13
- package/dist/commands/{commandDefinitions → addComponent/addMenu}/addMenuDefinition.js +2 -2
- package/dist/commands/{add-rail.js → addComponent/addRail/add-rail.js} +9 -10
- package/dist/commands/{commandDefinitions → addComponent/addRail}/addRailDefinition.js +4 -4
- package/dist/commands/{add-screen.js → addComponent/addScreen/add-screen.js} +5 -5
- package/dist/commands/{commandDefinitions → addComponent/addScreen}/addScreenDefinition.js +2 -2
- package/dist/commands/{add-scrollView.js → addComponent/addScrollView/add-scrollView.js} +9 -10
- package/dist/commands/{commandDefinitions → addComponent/addScrollView}/addScrollViewDefinition.js +3 -3
- package/dist/{configs → commands/addComponent/config}/ComponentConfig.d.ts +2 -2
- package/dist/{configs → commands/addComponent/config}/ComponentConfig.js +6 -6
- package/dist/{const → commands/addComponent/const}/defaultConfig.d.ts +1 -1
- package/dist/{const → commands/addComponent/const}/navigationConst.d.ts +1 -1
- package/dist/commands/{createComponent.d.ts → addComponent/createComponent.d.ts} +1 -1
- package/dist/commands/{createComponent.js → addComponent/createComponent.js} +11 -12
- package/dist/{helpers → commands/addComponent/helper}/ComponentHelper.d.ts +1 -1
- package/dist/{helpers → commands/addComponent/helper}/ComponentHelper.js +2 -2
- package/dist/commands/{add-device.js → addDevice/add-device.js} +18 -18
- package/dist/commands/{commandDefinitions → addDevice}/addDeviceDefinition.js +3 -3
- package/dist/{configs → commands/addDevice}/deviceConfig/androidtvConfig.d.ts +1 -1
- package/dist/{configs → commands/addDevice}/deviceConfig/androidtvConfig.js +18 -18
- package/dist/{configs → commands/addDevice}/deviceConfig/deviceConfig.js +2 -2
- package/dist/{configs → commands/addDevice}/deviceConfig/tizenConfig.d.ts +1 -1
- package/dist/{configs → commands/addDevice}/deviceConfig/tizenConfig.js +7 -7
- package/dist/{configs → commands/addDevice}/deviceConfig/tvosConfig.js +6 -6
- package/dist/{configs → commands/addDevice}/deviceConfig/webosConfig.d.ts +2 -2
- package/dist/{configs → commands/addDevice}/deviceConfig/webosConfig.js +11 -12
- package/dist/{helpers/CliHelper.d.ts → commands/addDevice/helper/addDeviceHelper.d.ts} +2 -2
- package/dist/{helpers/CliHelper.js → commands/addDevice/helper/addDeviceHelper.js} +6 -6
- package/dist/commands/{commandDefinitions → authentication}/authDefinition.js +5 -4
- package/dist/commands/{hooks → authentication}/authHook.js +2 -2
- package/dist/{const → commands/authentication}/authentConst.d.ts +1 -0
- package/dist/{const → commands/authentication}/authentConst.js +2 -1
- package/dist/commands/{auth → authentication/commands}/login.js +8 -8
- package/dist/commands/{auth → authentication/commands}/status.js +2 -2
- package/dist/{helpers → commands/authentication/helper}/CodeArtifactHelper.js +2 -2
- package/dist/commands/{help → commandHelp}/customHelp.js +2 -2
- package/dist/commands/{completion.js → completion/completion.js} +7 -7
- package/dist/commands/{commandDefinitions → completion}/completionDefinition.js +2 -2
- package/dist/commands/createApp/const/setupConst.d.ts +3 -0
- package/dist/{const/createApp → commands/createApp/const}/setupConst.js +1 -1
- package/dist/commands/{createApp.js → createApp/createApp.js} +19 -19
- package/dist/commands/{commandDefinitions → createApp}/createAppDefinition.js +3 -3
- package/dist/{helpers/createApp/ScriptHelper.d.ts → commands/createApp/helpers/CreateAppHelper.d.ts} +15 -13
- package/dist/{helpers/createApp/ScriptHelper.js → commands/createApp/helpers/CreateAppHelper.js} +14 -13
- package/dist/{helpers/createApp → commands/createApp/helpers}/SetupChecker.d.ts +1 -1
- package/dist/{helpers/createApp → commands/createApp/helpers}/SetupChecker.js +6 -6
- package/dist/common/commonConst.d.ts +1 -0
- package/dist/common/commonConst.js +4 -0
- package/dist/{helpers/createApp → common/helpers}/CreateFileHelper.d.ts +1 -1
- package/dist/{helpers/createApp → common/helpers}/CreateFileHelper.js +19 -19
- package/dist/{helpers/createApp → common/helpers}/InputValidator.js +1 -1
- package/dist/{helpers/createApp → common/helpers}/InstallHelper.d.ts +1 -1
- package/dist/{helpers/createApp → common/helpers}/InstallHelper.js +15 -12
- package/dist/{helpers/createApp → common/helpers}/UpdateFileHelper.d.ts +1 -1
- package/dist/{helpers/createApp → common/helpers}/UpdateFileHelper.js +42 -34
- package/dist/{helpers/createApp → common/helpers}/UserInputGetter.d.ts +2 -1
- package/dist/{helpers/createApp → common/helpers}/UserInputGetter.js +21 -13
- package/dist/{helpers → common/helpers}/handlebarsHelper.js +2 -2
- package/dist/{helpers → common/helpers}/stringHelper.d.ts +1 -1
- package/dist/{translation → common/translation}/translation.js +1 -1
- package/dist/{types/createApp → common/types}/helperTypes.d.ts +17 -5
- package/dist/{types/createApp → common/types}/helperTypes.js +1 -1
- package/dist/program.js +14 -14
- package/package.json +2 -3
- package/dist/const/createApp/setupConst.d.ts +0 -3
- package/dist/types/genericTypes.d.ts +0 -17
- package/dist/types/genericTypes.js +0 -2
- /package/dist/commands/{add-menu.d.ts → addComponent/addMenu/add-menu.d.ts} +0 -0
- /package/dist/commands/{commandDefinitions → addComponent/addMenu}/addMenuDefinition.d.ts +0 -0
- /package/dist/commands/{add-rail.d.ts → addComponent/addRail/add-rail.d.ts} +0 -0
- /package/dist/commands/{commandDefinitions → addComponent/addRail}/addRailDefinition.d.ts +0 -0
- /package/dist/commands/{add-screen.d.ts → addComponent/addScreen/add-screen.d.ts} +0 -0
- /package/dist/commands/{commandDefinitions → addComponent/addScreen}/addScreenDefinition.d.ts +0 -0
- /package/dist/commands/{add-scrollView.d.ts → addComponent/addScrollView/add-scrollView.d.ts} +0 -0
- /package/dist/commands/{commandDefinitions → addComponent/addScrollView}/addScrollViewDefinition.d.ts +0 -0
- /package/dist/{types → commands/addComponent/config}/componentTypes.d.ts +0 -0
- /package/dist/{types → commands/addComponent/config}/componentTypes.js +0 -0
- /package/dist/{const → commands/addComponent/const}/componentConst.d.ts +0 -0
- /package/dist/{const → commands/addComponent/const}/componentConst.js +0 -0
- /package/dist/{const → commands/addComponent/const}/defaultConfig.js +0 -0
- /package/dist/{const → commands/addComponent/const}/navigationConst.js +0 -0
- /package/dist/commands/{add-device.d.ts → addDevice/add-device.d.ts} +0 -0
- /package/dist/commands/{commandDefinitions → addDevice}/addDeviceDefinition.d.ts +0 -0
- /package/dist/{types/createApp → commands/addDevice/deviceConfig}/configTypes.d.ts +0 -0
- /package/dist/{types/createApp → commands/addDevice/deviceConfig}/configTypes.js +0 -0
- /package/dist/{configs → commands/addDevice}/deviceConfig/deviceConfig.d.ts +0 -0
- /package/dist/{configs → commands/addDevice}/deviceConfig/tvosConfig.d.ts +0 -0
- /package/dist/commands/{commandDefinitions → authentication}/authDefinition.d.ts +0 -0
- /package/dist/commands/{hooks → authentication}/authHook.d.ts +0 -0
- /package/dist/commands/{auth → authentication/commands}/login.d.ts +0 -0
- /package/dist/commands/{auth → authentication/commands}/status.d.ts +0 -0
- /package/dist/{helpers → commands/authentication/helper}/CodeArtifactHelper.d.ts +0 -0
- /package/dist/{helpers → commands/authentication/helper}/CredentialsHelper.d.ts +0 -0
- /package/dist/{helpers → commands/authentication/helper}/CredentialsHelper.js +0 -0
- /package/dist/commands/{help → commandHelp}/customHelp.d.ts +0 -0
- /package/dist/commands/{completion.d.ts → completion/completion.d.ts} +0 -0
- /package/dist/commands/{commandDefinitions → completion}/completionDefinition.d.ts +0 -0
- /package/dist/commands/{createApp.d.ts → createApp/createApp.d.ts} +0 -0
- /package/dist/commands/{commandDefinitions → createApp}/createAppDefinition.d.ts +0 -0
- /package/dist/{const/createApp → common/const}/deviceConst.d.ts +0 -0
- /package/dist/{const/createApp → common/const}/deviceConst.js +0 -0
- /package/dist/{const → common/const}/exitCodeConst.d.ts +0 -0
- /package/dist/{const → common/const}/exitCodeConst.js +0 -0
- /package/dist/{helpers/createApp → common/helpers}/InputValidator.d.ts +0 -0
- /package/dist/{helpers → common/helpers}/handlebarsHelper.d.ts +0 -0
- /package/dist/{helpers → common/helpers}/stringHelper.js +0 -0
- /package/dist/{translation → common/translation}/en.json +0 -0
- /package/dist/{translation → common/translation}/translation.d.ts +0 -0
|
@@ -15,13 +15,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
const componentConst_1 = require("../const/componentConst");
|
|
18
|
-
const createComponent_1 = __importDefault(require("
|
|
18
|
+
const createComponent_1 = __importDefault(require("../createComponent"));
|
|
19
19
|
const node_process_1 = __importDefault(require("node:process"));
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
const ComponentConfig_1 = __importDefault(require("../configs/ComponentConfig"));
|
|
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"));
|
|
24
23
|
const defaultConfig_1 = require("../const/defaultConfig");
|
|
24
|
+
const commonConst_1 = require("../../../common/commonConst");
|
|
25
25
|
const addMenu = async (name, options) => {
|
|
26
26
|
const data = { ...options };
|
|
27
27
|
if (name) {
|
|
@@ -38,14 +38,13 @@ const addMenu = async (name, options) => {
|
|
|
38
38
|
(0, createComponent_1.default)(componentList);
|
|
39
39
|
if (!data.custom) {
|
|
40
40
|
const currentDirectory = node_process_1.default.cwd();
|
|
41
|
-
const
|
|
42
|
-
const
|
|
43
|
-
const
|
|
44
|
-
const
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
(0,
|
|
48
|
-
(0, fs_1.cpSync)(iconPath, iconFinalPath, { recursive: true });
|
|
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 });
|
|
49
48
|
}
|
|
50
49
|
};
|
|
51
50
|
exports.default = addMenu;
|
|
@@ -4,8 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const commander_1 = require("commander");
|
|
7
|
-
const add_menu_1 = __importDefault(require("
|
|
8
|
-
const translation_1 = __importDefault(require("
|
|
7
|
+
const add_menu_1 = __importDefault(require("./add-menu"));
|
|
8
|
+
const translation_1 = __importDefault(require("../../../common/translation/translation"));
|
|
9
9
|
const addMenuDefinition = () => {
|
|
10
10
|
const command = new commander_1.Command("add-menu");
|
|
11
11
|
command
|
|
@@ -15,13 +15,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
const componentConst_1 = require("../const/componentConst");
|
|
18
|
-
const createComponent_1 = __importDefault(require("
|
|
18
|
+
const createComponent_1 = __importDefault(require("../createComponent"));
|
|
19
19
|
const node_process_1 = __importDefault(require("node:process"));
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
const ComponentConfig_1 = __importDefault(require("../configs/ComponentConfig"));
|
|
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"));
|
|
24
23
|
const defaultConfig_1 = require("../const/defaultConfig");
|
|
24
|
+
const commonConst_1 = require("../../../common/commonConst");
|
|
25
25
|
const addRail = async (name, options) => {
|
|
26
26
|
const data = { ...options };
|
|
27
27
|
if (name) {
|
|
@@ -38,11 +38,10 @@ const addRail = async (name, options) => {
|
|
|
38
38
|
(0, createComponent_1.default)(componentList);
|
|
39
39
|
if (!data.custom) {
|
|
40
40
|
const currentDirectory = node_process_1.default.cwd();
|
|
41
|
-
const
|
|
42
|
-
const
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
(0, fs_1.cpSync)(mockPath, finalPath);
|
|
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);
|
|
46
45
|
}
|
|
47
46
|
};
|
|
48
47
|
exports.default = addRail;
|
|
@@ -4,10 +4,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const commander_1 = require("commander");
|
|
7
|
-
const add_rail_1 = __importDefault(require("
|
|
8
|
-
const navigationConst_1 = require("
|
|
9
|
-
const translation_1 = __importDefault(require("
|
|
10
|
-
const stringHelper_1 = require("
|
|
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");
|
|
11
11
|
const addRailDefinition = () => {
|
|
12
12
|
const command = new commander_1.Command("add-rail");
|
|
13
13
|
command
|
|
@@ -48,9 +48,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
48
48
|
};
|
|
49
49
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
50
|
const componentConst_1 = require("../const/componentConst");
|
|
51
|
-
const createComponent_1 = __importDefault(require("
|
|
52
|
-
const add_menu_1 = __importDefault(require("
|
|
53
|
-
const add_scrollView_1 = __importDefault(require("
|
|
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
54
|
const prompts = __importStar(require("@clack/prompts"));
|
|
55
55
|
const addScreen = async (name, options) => {
|
|
56
56
|
try {
|
|
@@ -64,8 +64,8 @@ const addScreen = async (name, options) => {
|
|
|
64
64
|
}
|
|
65
65
|
(0, createComponent_1.default)([data]);
|
|
66
66
|
}
|
|
67
|
-
catch {
|
|
68
|
-
prompts.log.info(
|
|
67
|
+
catch (e) {
|
|
68
|
+
prompts.log.info(`Error creating screen: ${e.message}`);
|
|
69
69
|
}
|
|
70
70
|
};
|
|
71
71
|
exports.default = addScreen;
|
|
@@ -4,8 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const commander_1 = require("commander");
|
|
7
|
-
const translation_1 = __importDefault(require("
|
|
8
|
-
const add_screen_1 = __importDefault(require("
|
|
7
|
+
const translation_1 = __importDefault(require("../../../common/translation/translation"));
|
|
8
|
+
const add_screen_1 = __importDefault(require("./add-screen"));
|
|
9
9
|
const addScreenDefinition = () => {
|
|
10
10
|
const command = new commander_1.Command("add-screen");
|
|
11
11
|
command
|
|
@@ -4,13 +4,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const componentConst_1 = require("../const/componentConst");
|
|
7
|
-
const createComponent_1 = __importDefault(require("
|
|
7
|
+
const createComponent_1 = __importDefault(require("../createComponent"));
|
|
8
8
|
const node_process_1 = __importDefault(require("node:process"));
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const fs_1 = require("fs");
|
|
9
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
10
|
+
const node_fs_1 = require("node:fs");
|
|
12
11
|
const defaultConfig_1 = require("../const/defaultConfig");
|
|
13
|
-
const ComponentConfig_1 = __importDefault(require("../
|
|
12
|
+
const ComponentConfig_1 = __importDefault(require("../config/ComponentConfig"));
|
|
13
|
+
const commonConst_1 = require("../../../common/commonConst");
|
|
14
14
|
const addScrollView = async (name, options) => {
|
|
15
15
|
const data = { ...options };
|
|
16
16
|
if (name) {
|
|
@@ -27,11 +27,10 @@ const addScrollView = async (name, options) => {
|
|
|
27
27
|
(0, createComponent_1.default)(componentList);
|
|
28
28
|
if (!data.custom) {
|
|
29
29
|
const currentDirectory = node_process_1.default.cwd();
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
(0, fs_1.cpSync)(mockPath, finalPath);
|
|
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);
|
|
35
34
|
}
|
|
36
35
|
};
|
|
37
36
|
exports.default = addScrollView;
|
package/dist/commands/{commandDefinitions → addComponent/addScrollView}/addScrollViewDefinition.js
RENAMED
|
@@ -4,10 +4,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const commander_1 = require("commander");
|
|
7
|
-
const add_scrollView_1 = __importDefault(require("
|
|
8
|
-
const translation_1 = __importDefault(require("
|
|
7
|
+
const add_scrollView_1 = __importDefault(require("./add-scrollView"));
|
|
8
|
+
const translation_1 = __importDefault(require("../../../common/translation/translation"));
|
|
9
9
|
const addScrollViewDefinition = () => {
|
|
10
|
-
return new commander_1.Command("add-
|
|
10
|
+
return new commander_1.Command("add-scrollView")
|
|
11
11
|
.description(translation_1.default["command.scrollView.description"])
|
|
12
12
|
.argument("[name]", translation_1.default["command.component.name"])
|
|
13
13
|
.option("-cm, --custom", translation_1.default["command.component.customization"])
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { RailConfig, MenuConfig, ScreenConfig, ScrollViewConfig } from "
|
|
2
|
-
import { ConfigOptions, OptionList } from "
|
|
1
|
+
import { RailConfig, MenuConfig, ScreenConfig, ScrollViewConfig } from "./componentTypes";
|
|
2
|
+
import { ConfigOptions, OptionList } from "../../../common/types/helperTypes";
|
|
3
3
|
interface AskComponentParam {
|
|
4
4
|
componentOption: string;
|
|
5
5
|
optionList: OptionList;
|
|
@@ -48,12 +48,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
48
48
|
};
|
|
49
49
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
50
|
const prompts = __importStar(require("@clack/prompts"));
|
|
51
|
-
const ComponentHelper_1 = __importDefault(require("../
|
|
51
|
+
const ComponentHelper_1 = __importDefault(require("../helper/ComponentHelper"));
|
|
52
52
|
const navigationConst_1 = require("../const/navigationConst");
|
|
53
|
-
const exitCodeConst_1 = require("
|
|
54
|
-
const InputValidator_1 = require("
|
|
53
|
+
const exitCodeConst_1 = require("../../../common/const/exitCodeConst");
|
|
54
|
+
const InputValidator_1 = require("../../../common/helpers/InputValidator");
|
|
55
55
|
const defaultConfig_1 = require("../const/defaultConfig");
|
|
56
|
-
const stringHelper_1 = require("
|
|
56
|
+
const stringHelper_1 = require("../../../common/helpers/stringHelper");
|
|
57
57
|
const ComponentConfig = class {
|
|
58
58
|
/**
|
|
59
59
|
* Get component or element name from user
|
|
@@ -73,8 +73,8 @@ const ComponentConfig = class {
|
|
|
73
73
|
static askNumber = async (valueType, numberValue) => {
|
|
74
74
|
const errorMessage = `${valueType} should be a number`;
|
|
75
75
|
const basicMessage = `Enter a value for ${valueType}`;
|
|
76
|
-
const message = numberValue && isNaN(numberValue) ? `${numberValue} is not a number. ${basicMessage}` : basicMessage;
|
|
77
|
-
if (!numberValue || isNaN(numberValue)) {
|
|
76
|
+
const message = numberValue && Number.isNaN(numberValue) ? `${numberValue} is not a number. ${basicMessage}` : basicMessage;
|
|
77
|
+
if (!numberValue || Number.isNaN(numberValue)) {
|
|
78
78
|
const numberValue = (await prompts.text({
|
|
79
79
|
message,
|
|
80
80
|
placeholder: "00",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MenuConfig, RailConfig, ScrollViewConfig } from "../
|
|
1
|
+
import { MenuConfig, RailConfig, ScrollViewConfig } from "../config/componentTypes";
|
|
2
2
|
export declare const RAIL_DEFAULT_CONFIG: RailConfig;
|
|
3
3
|
export declare const MENU_DEFAULT_CONFIG: MenuConfig;
|
|
4
4
|
export declare const SCROLLVIEW_DEFAULT_CONFIG: ScrollViewConfig;
|
|
@@ -47,20 +47,20 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
47
47
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
48
48
|
};
|
|
49
49
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
|
-
const ComponentHelper_1 = __importDefault(require("
|
|
51
|
-
const
|
|
52
|
-
const
|
|
53
|
-
const handlebarsHelper_1 = require("
|
|
50
|
+
const ComponentHelper_1 = __importDefault(require("./helper/ComponentHelper"));
|
|
51
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
52
|
+
const node_fs_1 = require("node:fs");
|
|
53
|
+
const handlebarsHelper_1 = require("../../common/helpers/handlebarsHelper");
|
|
54
54
|
const prompts = __importStar(require("@clack/prompts"));
|
|
55
|
-
const exitCodeConst_1 = require("
|
|
56
|
-
const
|
|
57
|
-
const
|
|
55
|
+
const exitCodeConst_1 = require("../../common/const/exitCodeConst");
|
|
56
|
+
const translation_1 = __importDefault(require("../../common/translation/translation"));
|
|
57
|
+
const commonConst_1 = require("../../common/commonConst");
|
|
58
58
|
const createSingleComponent = (data, currentDirectory, modulePath) => {
|
|
59
59
|
try {
|
|
60
|
-
const templatePath =
|
|
60
|
+
const templatePath = node_path_1.default.join(node_path_1.default.dirname(modulePath), "components", `${data.type}.js.hbs`);
|
|
61
61
|
const output = (0, handlebarsHelper_1.templateGenerator)(templatePath, data);
|
|
62
|
-
const finalPath =
|
|
63
|
-
(0,
|
|
62
|
+
const finalPath = node_path_1.default.resolve(currentDirectory, ComponentHelper_1.default.normalizeFileName(data.type, data.name));
|
|
63
|
+
(0, node_fs_1.writeFileSync)(finalPath, output, { encoding: "utf-8" });
|
|
64
64
|
prompts.log.success(`${data.name} ${translation_1.default["component.creation.success"]}`);
|
|
65
65
|
}
|
|
66
66
|
catch (e) {
|
|
@@ -72,8 +72,7 @@ const createSingleComponent = (data, currentDirectory, modulePath) => {
|
|
|
72
72
|
};
|
|
73
73
|
const createComponent = (componentList) => {
|
|
74
74
|
const currentDirectory = process.cwd();
|
|
75
|
-
const
|
|
76
|
-
const modulePath = require.resolve("@wiztivi/dana-templates");
|
|
75
|
+
const modulePath = require.resolve(commonConst_1.TEMPLATE_MODULE);
|
|
77
76
|
for (const data of componentList) {
|
|
78
77
|
createSingleComponent(data, currentDirectory, modulePath);
|
|
79
78
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OptionList, SelectionArray } from "
|
|
1
|
+
import { OptionList, SelectionArray } from "../../../common/types/helperTypes";
|
|
2
2
|
declare const ComponentHelper: {
|
|
3
3
|
new (): {};
|
|
4
4
|
readonly selectionFactory: (name: string, options: SelectionArray, message: string) => Promise<string>;
|
|
@@ -46,8 +46,8 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
46
46
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
47
47
|
const prompts = __importStar(require("@clack/prompts"));
|
|
48
48
|
const componentConst_1 = require("../const/componentConst");
|
|
49
|
-
const stringHelper_1 = require("
|
|
50
|
-
const exitCodeConst_1 = require("
|
|
49
|
+
const stringHelper_1 = require("../../../common/helpers/stringHelper");
|
|
50
|
+
const exitCodeConst_1 = require("../../../common/const/exitCodeConst");
|
|
51
51
|
const ComponentHelper = class {
|
|
52
52
|
static selectionFactory = async (name, options, message) => {
|
|
53
53
|
options = options.map((el) => {
|
|
@@ -47,37 +47,37 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
47
47
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
48
48
|
};
|
|
49
49
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
|
-
const UserInputGetter_1 = __importDefault(require("
|
|
51
|
-
const UpdateFileHelper_1 = __importDefault(require("
|
|
52
|
-
const InstallHelper_1 = __importDefault(require("
|
|
53
|
-
const
|
|
54
|
-
const CreateFileHelper_1 = __importDefault(require("
|
|
55
|
-
const
|
|
50
|
+
const UserInputGetter_1 = __importDefault(require("../../common/helpers/UserInputGetter"));
|
|
51
|
+
const UpdateFileHelper_1 = __importDefault(require("../../common/helpers/UpdateFileHelper"));
|
|
52
|
+
const InstallHelper_1 = __importDefault(require("../../common/helpers/InstallHelper"));
|
|
53
|
+
const CreateAppHelper_1 = __importDefault(require("../createApp/helpers/CreateAppHelper"));
|
|
54
|
+
const CreateFileHelper_1 = __importDefault(require("../../common/helpers/CreateFileHelper"));
|
|
55
|
+
const addDeviceHelper_1 = __importDefault(require("./helper/addDeviceHelper"));
|
|
56
56
|
const prompts = __importStar(require("@clack/prompts"));
|
|
57
|
-
const
|
|
57
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
58
58
|
const picocolors_1 = __importDefault(require("picocolors"));
|
|
59
|
-
const exitCodeConst_1 = require("
|
|
59
|
+
const exitCodeConst_1 = require("../../common/const/exitCodeConst");
|
|
60
60
|
const node_process_1 = __importDefault(require("node:process"));
|
|
61
|
-
const translation_1 = __importDefault(require("
|
|
62
|
-
const CredentialsHelper_1 = require("../
|
|
61
|
+
const translation_1 = __importDefault(require("../../common/translation/translation"));
|
|
62
|
+
const CredentialsHelper_1 = require("../authentication/helper/CredentialsHelper");
|
|
63
63
|
const addDevice = async () => {
|
|
64
|
-
prompts.intro(`Add device(s) to ${
|
|
64
|
+
prompts.intro(`Add device(s) to ${node_path_1.default.basename(node_process_1.default.cwd())} !`);
|
|
65
65
|
const data = {};
|
|
66
66
|
try {
|
|
67
67
|
data.directory = "./";
|
|
68
68
|
data.awsProfile = CredentialsHelper_1.CredentialsHelper.get().org;
|
|
69
69
|
const { availableDevices, unavailableDevices } = await UserInputGetter_1.default.getAvailableDevices();
|
|
70
|
-
const installedDevices =
|
|
70
|
+
const installedDevices = addDeviceHelper_1.default.getInstalledDevices(data.directory);
|
|
71
71
|
const filteredAvailableDevices = availableDevices.filter((el) => !installedDevices.includes(el.value));
|
|
72
72
|
if (unavailableDevices.length) {
|
|
73
|
-
|
|
73
|
+
CreateAppHelper_1.default.promptUnavailableDevices(unavailableDevices);
|
|
74
74
|
}
|
|
75
75
|
if (filteredAvailableDevices.length) {
|
|
76
|
-
data.selectedDevices = await
|
|
76
|
+
data.selectedDevices = await CreateAppHelper_1.default.promptSelectDevices(filteredAvailableDevices);
|
|
77
77
|
}
|
|
78
78
|
if (!data.selectedDevices?.length) {
|
|
79
79
|
prompts.outro(translation_1.default["command.device.no_selection"]);
|
|
80
|
-
return
|
|
80
|
+
return;
|
|
81
81
|
}
|
|
82
82
|
data.config = await UserInputGetter_1.default.getDevicesConfig(data);
|
|
83
83
|
}
|
|
@@ -87,7 +87,7 @@ const addDevice = async () => {
|
|
|
87
87
|
node_process_1.default.exit(exitCodeConst_1.DEVICE_ERROR);
|
|
88
88
|
}
|
|
89
89
|
try {
|
|
90
|
-
await
|
|
90
|
+
await CreateAppHelper_1.default.installation([
|
|
91
91
|
{
|
|
92
92
|
title: "Update package.json",
|
|
93
93
|
task: async () => UpdateFileHelper_1.default.updatePackageJson(data),
|
|
@@ -115,12 +115,12 @@ const addDevice = async () => {
|
|
|
115
115
|
]);
|
|
116
116
|
}
|
|
117
117
|
catch (e) {
|
|
118
|
-
|
|
118
|
+
addDeviceHelper_1.default.cleanOnError();
|
|
119
119
|
const message = e instanceof Error ? e.message : e;
|
|
120
120
|
prompts.outro(picocolors_1.default.red(`${translation_1.default["error.common.start.message"]} ${message}`));
|
|
121
121
|
node_process_1.default.exit(exitCodeConst_1.DEVICE_ERROR);
|
|
122
122
|
}
|
|
123
123
|
prompts.outro("Everything is ready ! Don't forget to commit your change.");
|
|
124
|
-
return
|
|
124
|
+
return;
|
|
125
125
|
};
|
|
126
126
|
exports.default = addDevice;
|
|
@@ -4,9 +4,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const commander_1 = require("commander");
|
|
7
|
-
const add_device_1 = __importDefault(require("
|
|
8
|
-
const translation_1 = __importDefault(require("../../translation/translation"));
|
|
9
|
-
const authHook_1 = require("../
|
|
7
|
+
const add_device_1 = __importDefault(require("./add-device"));
|
|
8
|
+
const translation_1 = __importDefault(require("../../common/translation/translation"));
|
|
9
|
+
const authHook_1 = require("../authentication/authHook");
|
|
10
10
|
const addDeviceDefinition = () => {
|
|
11
11
|
return new commander_1.Command("add-device")
|
|
12
12
|
.description(translation_1.default["command.device.description"])
|
|
@@ -47,21 +47,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
47
47
|
* This software MAY NOT be used, modified or rewritten without prior written permission from Wiztivi.
|
|
48
48
|
*
|
|
49
49
|
*/
|
|
50
|
-
const
|
|
51
|
-
const
|
|
50
|
+
const node_fs_1 = __importDefault(require("node:fs"));
|
|
51
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
52
52
|
const deviceConfig_1 = __importDefault(require("./deviceConfig"));
|
|
53
|
-
const setupConst_1 = require("../../const/
|
|
54
|
-
const ComponentHelper_1 = __importDefault(require("../../
|
|
53
|
+
const setupConst_1 = require("../../createApp/const/setupConst");
|
|
54
|
+
const ComponentHelper_1 = __importDefault(require("../../addComponent/helper/ComponentHelper"));
|
|
55
55
|
const prompts = __importStar(require("@clack/prompts"));
|
|
56
56
|
const picocolors_1 = __importDefault(require("picocolors"));
|
|
57
57
|
const semver_ts_1 = require("semver-ts");
|
|
58
58
|
const semver_1 = require("semver");
|
|
59
|
-
const InputValidator_1 = require("
|
|
60
|
-
const translation_1 = __importDefault(require("
|
|
61
|
-
const CredentialsHelper_1 = require("../../
|
|
59
|
+
const InputValidator_1 = require("../../../common/helpers/InputValidator");
|
|
60
|
+
const translation_1 = __importDefault(require("../../../common/translation/translation"));
|
|
61
|
+
const CredentialsHelper_1 = require("../../authentication/helper/CredentialsHelper");
|
|
62
62
|
const client_codeartifact_1 = require("@aws-sdk/client-codeartifact");
|
|
63
|
-
const CodeArtifactHelper_1 = require("../../
|
|
64
|
-
const authentConst_1 = require("../../
|
|
63
|
+
const CodeArtifactHelper_1 = require("../../authentication/helper/CodeArtifactHelper");
|
|
64
|
+
const authentConst_1 = require("../../authentication/authentConst");
|
|
65
65
|
const AndroidtvConfig = class extends deviceConfig_1.default {
|
|
66
66
|
/**
|
|
67
67
|
* Get the app icon url
|
|
@@ -132,7 +132,7 @@ const AndroidtvConfig = class extends deviceConfig_1.default {
|
|
|
132
132
|
package: "v8-runtime",
|
|
133
133
|
domain: authentConst_1.DOMAIN,
|
|
134
134
|
domainOwner: authentConst_1.DOMAIN_OWNER,
|
|
135
|
-
repository:
|
|
135
|
+
repository: "internal-android-repository",
|
|
136
136
|
format: "maven",
|
|
137
137
|
namespace: "com.dana.androidtv",
|
|
138
138
|
});
|
|
@@ -142,14 +142,14 @@ const AndroidtvConfig = class extends deviceConfig_1.default {
|
|
|
142
142
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-assignment
|
|
143
143
|
wtvAndroidVersion = (0, semver_1.maxSatisfying)(versionListArray, "*");
|
|
144
144
|
if (wtvAndroidVersion) {
|
|
145
|
-
return
|
|
145
|
+
return wtvAndroidVersion;
|
|
146
146
|
}
|
|
147
147
|
else {
|
|
148
148
|
throw new Error(translation_1.default["command.device.version.error"]);
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
151
|
catch (error) {
|
|
152
|
-
|
|
152
|
+
throw new Error(error.message ?? translation_1.default["error.common.start.message"]);
|
|
153
153
|
}
|
|
154
154
|
};
|
|
155
155
|
static getConfig = async () => {
|
|
@@ -169,17 +169,17 @@ const AndroidtvConfig = class extends deviceConfig_1.default {
|
|
|
169
169
|
},
|
|
170
170
|
}),
|
|
171
171
|
};
|
|
172
|
-
return
|
|
172
|
+
return config;
|
|
173
173
|
};
|
|
174
174
|
static setConfig = async ({ directory, config, }) => {
|
|
175
175
|
await this.updateProfileJson(directory, config);
|
|
176
|
-
return
|
|
176
|
+
return "Android config done";
|
|
177
177
|
};
|
|
178
|
-
static updateProfileJson =
|
|
179
|
-
const filePath =
|
|
180
|
-
const jsonData = JSON.parse(
|
|
178
|
+
static updateProfileJson = (directory, config) => {
|
|
179
|
+
const filePath = node_path_1.default.join(directory, "profiles", "app.config.androidtv.json");
|
|
180
|
+
const jsonData = JSON.parse(node_fs_1.default.readFileSync(filePath).toString());
|
|
181
181
|
jsonData["base-android"].device = { ...jsonData["base-android"].device, ...config.device };
|
|
182
|
-
|
|
182
|
+
node_fs_1.default.writeFileSync(filePath, JSON.stringify(jsonData, null, 4));
|
|
183
183
|
return Promise.resolve("Profile.json updated");
|
|
184
184
|
};
|
|
185
185
|
};
|
|
@@ -26,9 +26,9 @@ const DeviceConfig = class {
|
|
|
26
26
|
* Add renderers configuration to json
|
|
27
27
|
*/
|
|
28
28
|
static updateProfileJsonWithRenderers(jsonData, renderers) {
|
|
29
|
-
|
|
29
|
+
for (const renderer of renderers) {
|
|
30
30
|
jsonData = { ...jsonData, ...this.appConfig[renderer] };
|
|
31
|
-
}
|
|
31
|
+
}
|
|
32
32
|
return jsonData;
|
|
33
33
|
}
|
|
34
34
|
};
|
|
@@ -14,10 +14,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
const
|
|
18
|
-
const
|
|
17
|
+
const node_fs_1 = __importDefault(require("node:fs"));
|
|
18
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
19
19
|
const deviceConfig_1 = __importDefault(require("./deviceConfig"));
|
|
20
|
-
const deviceConst_1 = require("
|
|
20
|
+
const deviceConst_1 = require("../../../common/const/deviceConst");
|
|
21
21
|
const TizenConfig = class extends deviceConfig_1.default {
|
|
22
22
|
static appConfig = {
|
|
23
23
|
css: {
|
|
@@ -39,17 +39,17 @@ const TizenConfig = class extends deviceConfig_1.default {
|
|
|
39
39
|
},
|
|
40
40
|
},
|
|
41
41
|
};
|
|
42
|
-
static getConfig =
|
|
42
|
+
static getConfig = () => {
|
|
43
43
|
const tizenConfig = {
|
|
44
44
|
renderers: [deviceConst_1.LIGHTNING],
|
|
45
45
|
};
|
|
46
46
|
return Promise.resolve(tizenConfig);
|
|
47
47
|
};
|
|
48
48
|
static setConfig = ({ directory, config }) => {
|
|
49
|
-
const filePath =
|
|
50
|
-
let jsonData = JSON.parse(
|
|
49
|
+
const filePath = node_path_1.default.join(directory, "profiles", "app.config.tizen.json");
|
|
50
|
+
let jsonData = JSON.parse(node_fs_1.default.readFileSync(filePath).toString());
|
|
51
51
|
jsonData = this.updateProfileJsonWithRenderers(jsonData, config.renderers);
|
|
52
|
-
|
|
52
|
+
node_fs_1.default.writeFileSync(filePath, JSON.stringify(jsonData, null, 4));
|
|
53
53
|
return Promise.resolve("Tizen configuration done");
|
|
54
54
|
};
|
|
55
55
|
};
|
|
@@ -14,18 +14,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
14
14
|
* This software MAY NOT be used, modified or rewritten without prior written permission from Wiztivi.
|
|
15
15
|
*
|
|
16
16
|
*/
|
|
17
|
-
const
|
|
17
|
+
const node_fs_1 = __importDefault(require("node:fs"));
|
|
18
18
|
const deviceConfig_1 = __importDefault(require("./deviceConfig"));
|
|
19
|
-
const
|
|
19
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
20
20
|
const TvosConfig = class extends deviceConfig_1.default {
|
|
21
21
|
/**
|
|
22
22
|
* Set config for TVOS
|
|
23
23
|
*/
|
|
24
|
-
static setConfig =
|
|
24
|
+
static setConfig = ({ directory }) => {
|
|
25
25
|
const update = `\n# For TVOS\napp_tvos/build \napp_tvos/libs`;
|
|
26
|
-
const filePath =
|
|
27
|
-
const data =
|
|
28
|
-
|
|
26
|
+
const filePath = node_path_1.default.join(directory, ".gitignore");
|
|
27
|
+
const data = node_fs_1.default.readFileSync(filePath, { encoding: "utf8" });
|
|
28
|
+
node_fs_1.default.writeFileSync(filePath, data + update);
|
|
29
29
|
return Promise.resolve(".gitignore updated");
|
|
30
30
|
};
|
|
31
31
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { WebosConf, WebosDevice } from "
|
|
1
|
+
import { WebosConf, WebosDevice } from "./configTypes";
|
|
2
2
|
declare const WebosConfig: {
|
|
3
3
|
new (): {};
|
|
4
4
|
readonly appConfig: {
|
|
@@ -50,7 +50,7 @@ declare const WebosConfig: {
|
|
|
50
50
|
*/
|
|
51
51
|
readonly getAppConfigProperties: () => Promise<WebosDevice>;
|
|
52
52
|
readonly getConfig: () => Promise<WebosConf>;
|
|
53
|
-
readonly setConfig: ({ directory, config
|
|
53
|
+
readonly setConfig: ({ directory, config }: {
|
|
54
54
|
directory: string;
|
|
55
55
|
config: WebosConf;
|
|
56
56
|
}) => Promise<string>;
|