@wiztivi/dana-cli 0.0.1 → 0.0.2
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/bin/dana.js +3 -0
- package/dana_completion.sh +153 -0
- package/dist/commands/add-device.d.ts +2 -0
- package/dist/commands/add-device.js +126 -0
- package/dist/commands/add-menu.d.ts +7 -0
- package/dist/commands/add-menu.js +51 -0
- package/dist/commands/add-rail.d.ts +10 -0
- package/dist/commands/add-rail.js +48 -0
- package/dist/commands/add-screen.d.ts +5 -0
- package/dist/commands/add-screen.js +71 -0
- package/dist/commands/add-scrollView.d.ts +7 -0
- package/dist/commands/add-scrollView.js +37 -0
- package/dist/commands/auth/login.d.ts +5 -0
- package/dist/commands/auth/login.js +141 -0
- package/dist/commands/auth/status.d.ts +11 -0
- package/dist/commands/auth/status.js +76 -0
- package/dist/commands/commandDefinitions/addDeviceDefinition.d.ts +3 -0
- package/dist/commands/commandDefinitions/addDeviceDefinition.js +16 -0
- package/dist/commands/commandDefinitions/addMenuDefinition.d.ts +3 -0
- package/dist/commands/commandDefinitions/addMenuDefinition.js +21 -0
- package/dist/commands/commandDefinitions/addRailDefinition.d.ts +3 -0
- package/dist/commands/commandDefinitions/addRailDefinition.js +31 -0
- package/dist/commands/commandDefinitions/addScreenDefinition.d.ts +3 -0
- package/dist/commands/commandDefinitions/addScreenDefinition.js +18 -0
- package/dist/commands/commandDefinitions/addScrollViewDefinition.d.ts +3 -0
- package/dist/commands/commandDefinitions/addScrollViewDefinition.js +18 -0
- package/dist/commands/commandDefinitions/authDefinition.d.ts +3 -0
- package/dist/commands/commandDefinitions/authDefinition.js +23 -0
- package/dist/commands/commandDefinitions/completionDefinition.d.ts +3 -0
- package/dist/commands/commandDefinitions/completionDefinition.js +17 -0
- package/dist/commands/commandDefinitions/createAppDefinition.d.ts +3 -0
- package/dist/commands/commandDefinitions/createAppDefinition.js +22 -0
- package/dist/commands/completion.d.ts +2 -0
- package/dist/commands/completion.js +84 -0
- package/dist/commands/createApp.d.ts +6 -0
- package/dist/commands/createApp.js +130 -0
- package/dist/commands/createComponent.d.ts +3 -0
- package/dist/commands/createComponent.js +81 -0
- package/dist/commands/help/customHelp.d.ts +3 -0
- package/dist/commands/help/customHelp.js +31 -0
- package/dist/commands/hooks/authHook.d.ts +1 -0
- package/dist/commands/hooks/authHook.js +23 -0
- package/dist/configs/ComponentConfig.d.ts +32 -0
- package/dist/configs/ComponentConfig.js +178 -0
- package/dist/configs/deviceConfig/androidtvConfig.d.ts +37 -0
- package/dist/configs/deviceConfig/androidtvConfig.js +186 -0
- package/dist/configs/deviceConfig/deviceConfig.d.ts +14 -0
- package/dist/configs/deviceConfig/deviceConfig.js +35 -0
- package/dist/configs/deviceConfig/tizenConfig.d.ts +31 -0
- package/dist/configs/deviceConfig/tizenConfig.js +56 -0
- package/dist/configs/deviceConfig/tvosConfig.d.ts +13 -0
- package/dist/configs/deviceConfig/tvosConfig.js +32 -0
- package/dist/configs/deviceConfig/webosConfig.d.ts +59 -0
- package/dist/configs/deviceConfig/webosConfig.js +179 -0
- package/dist/const/authentConst.d.ts +3 -0
- package/dist/const/authentConst.js +6 -0
- package/dist/const/componentConst.d.ts +8 -0
- package/dist/const/componentConst.js +22 -0
- package/dist/const/createApp/deviceConst.d.ts +23 -0
- package/dist/const/createApp/deviceConst.js +73 -0
- package/dist/const/createApp/setupConst.d.ts +3 -0
- package/dist/const/createApp/setupConst.js +18 -0
- package/dist/const/defaultConfig.d.ts +4 -0
- package/dist/const/defaultConfig.js +27 -0
- package/dist/const/exitCodeConst.d.ts +7 -0
- package/dist/const/exitCodeConst.js +10 -0
- package/dist/const/navigationConst.d.ts +3 -0
- package/dist/const/navigationConst.js +36 -0
- package/dist/dana_completion.sh +153 -0
- package/dist/helpers/CliHelper.d.ts +13 -0
- package/dist/helpers/CliHelper.js +39 -0
- package/dist/helpers/CodeArtifactHelper.d.ts +12 -0
- package/dist/helpers/CodeArtifactHelper.js +52 -0
- package/dist/helpers/ComponentHelper.d.ts +12 -0
- package/dist/helpers/ComponentHelper.js +105 -0
- package/dist/helpers/CredentialsHelper.d.ts +27 -0
- package/dist/helpers/CredentialsHelper.js +22 -0
- package/dist/helpers/createApp/CreateFileHelper.d.ts +31 -0
- package/dist/helpers/createApp/CreateFileHelper.js +84 -0
- package/dist/helpers/createApp/InputValidator.d.ts +5 -0
- package/dist/helpers/createApp/InputValidator.js +60 -0
- package/dist/helpers/createApp/InstallHelper.d.ts +30 -0
- package/dist/helpers/createApp/InstallHelper.js +112 -0
- package/dist/helpers/createApp/ScriptHelper.d.ts +116 -0
- package/dist/helpers/createApp/ScriptHelper.js +142 -0
- package/dist/helpers/createApp/SetupChecker.d.ts +25 -0
- package/dist/helpers/createApp/SetupChecker.js +128 -0
- package/dist/helpers/createApp/UpdateFileHelper.d.ts +40 -0
- package/dist/helpers/createApp/UpdateFileHelper.js +121 -0
- package/dist/helpers/createApp/UserInputGetter.d.ts +49 -0
- package/dist/helpers/createApp/UserInputGetter.js +145 -0
- package/dist/helpers/handlebarsHelper.d.ts +2 -0
- package/dist/helpers/handlebarsHelper.js +26 -0
- package/dist/helpers/stringHelper.d.ts +3 -0
- package/dist/helpers/stringHelper.js +11 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +16 -0
- package/dist/program.d.ts +2 -0
- package/dist/program.js +42 -0
- package/dist/translation/en.json +62 -0
- package/dist/translation/translation.d.ts +2 -0
- package/dist/translation/translation.js +8 -0
- package/dist/types/componentTypes.d.ts +31 -0
- package/dist/types/componentTypes.js +2 -0
- package/dist/types/createApp/configTypes.d.ts +27 -0
- package/dist/types/createApp/configTypes.js +13 -0
- package/dist/types/createApp/helperTypes.d.ts +35 -0
- package/dist/types/createApp/helperTypes.js +14 -0
- package/dist/types/genericTypes.d.ts +17 -0
- package/dist/types/genericTypes.js +2 -0
- package/package.json +41 -22
- package/README.md +0 -5
- package/index.js +0 -1
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
/*
|
|
40
|
+
* Copyright (c) 2014-2025 Wiztivi - contact@wiztivi.com
|
|
41
|
+
* All Rights Reserved
|
|
42
|
+
*
|
|
43
|
+
* All information contained herein is proprietary and confidential.
|
|
44
|
+
* Dissemination of this information or reproduction of this file or material, via any medium is strictly forbidden unless
|
|
45
|
+
* prior written permission is obtained from Wiztivi.
|
|
46
|
+
* No warranty, explicit or implicit, provided.
|
|
47
|
+
* This software MAY NOT be used, modified or rewritten without prior written permission from Wiztivi.
|
|
48
|
+
*
|
|
49
|
+
*/
|
|
50
|
+
const fs_1 = __importDefault(require("fs"));
|
|
51
|
+
const path_1 = __importDefault(require("path"));
|
|
52
|
+
const deviceConfig_1 = __importDefault(require("./deviceConfig"));
|
|
53
|
+
const setupConst_1 = require("../../const/createApp/setupConst");
|
|
54
|
+
const ComponentHelper_1 = __importDefault(require("../../helpers/ComponentHelper"));
|
|
55
|
+
const prompts = __importStar(require("@clack/prompts"));
|
|
56
|
+
const picocolors_1 = __importDefault(require("picocolors"));
|
|
57
|
+
const semver_ts_1 = require("semver-ts");
|
|
58
|
+
const semver_1 = require("semver");
|
|
59
|
+
const InputValidator_1 = require("../../helpers/createApp/InputValidator");
|
|
60
|
+
const translation_1 = __importDefault(require("../../translation/translation"));
|
|
61
|
+
const CredentialsHelper_1 = require("../../helpers/CredentialsHelper");
|
|
62
|
+
const client_codeartifact_1 = require("@aws-sdk/client-codeartifact");
|
|
63
|
+
const CodeArtifactHelper_1 = require("../../helpers/CodeArtifactHelper");
|
|
64
|
+
const authentConst_1 = require("../../const/authentConst");
|
|
65
|
+
const AndroidtvConfig = class extends deviceConfig_1.default {
|
|
66
|
+
/**
|
|
67
|
+
* Get the app icon url
|
|
68
|
+
*/
|
|
69
|
+
static _getAppIcon = () => {
|
|
70
|
+
return Promise.resolve(setupConst_1.DEFAULT_IMAGE_URL);
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* Ask the appId
|
|
74
|
+
*/
|
|
75
|
+
static _askAppId = async () => {
|
|
76
|
+
const appId = (await prompts.text({
|
|
77
|
+
message: "What is the appId ?",
|
|
78
|
+
placeholder: "com.yourname.ui",
|
|
79
|
+
validate: (value) => (0, InputValidator_1.validAppId)(value),
|
|
80
|
+
}));
|
|
81
|
+
ComponentHelper_1.default.handleCancellation(appId);
|
|
82
|
+
return appId;
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* Ask the appName
|
|
86
|
+
*/
|
|
87
|
+
static _askAppName = async () => {
|
|
88
|
+
const errorMessage = "App name is required !";
|
|
89
|
+
const appName = (await prompts.text({
|
|
90
|
+
message: "What is the appName ?",
|
|
91
|
+
placeholder: "Dana",
|
|
92
|
+
validate: (value) => (0, InputValidator_1.validInputLength)(value, errorMessage),
|
|
93
|
+
}));
|
|
94
|
+
ComponentHelper_1.default.handleCancellation(appName);
|
|
95
|
+
return appName;
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* Ask the appVersion
|
|
99
|
+
*/
|
|
100
|
+
static _askAppVersion = async () => {
|
|
101
|
+
const appVersion = (await prompts.text({
|
|
102
|
+
message: "What is the app version ?",
|
|
103
|
+
placeholder: "1.0.0",
|
|
104
|
+
initialValue: "1.0.0",
|
|
105
|
+
validate: (value) => (0, InputValidator_1.validAppVersion)(value),
|
|
106
|
+
}));
|
|
107
|
+
ComponentHelper_1.default.handleCancellation(appVersion);
|
|
108
|
+
return (0, semver_ts_1.clean)(appVersion) ?? "";
|
|
109
|
+
};
|
|
110
|
+
/**
|
|
111
|
+
* Ask the appVersion code
|
|
112
|
+
*/
|
|
113
|
+
static _askAppVersionCode = async () => {
|
|
114
|
+
const appVersionCode = (await prompts.text({
|
|
115
|
+
message: "What is the app version code ?",
|
|
116
|
+
placeholder: "1000",
|
|
117
|
+
initialValue: "1000",
|
|
118
|
+
validate: (value) => (0, InputValidator_1.validAppVersionCode)(value),
|
|
119
|
+
}));
|
|
120
|
+
ComponentHelper_1.default.handleCancellation(appVersionCode);
|
|
121
|
+
return Number(appVersionCode);
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* Call aws to get latest android version
|
|
125
|
+
*/
|
|
126
|
+
static _getWtvAndroidVersion = async () => {
|
|
127
|
+
let wtvAndroidVersion;
|
|
128
|
+
try {
|
|
129
|
+
const credentials = CredentialsHelper_1.CredentialsHelper.get();
|
|
130
|
+
const client = (0, CodeArtifactHelper_1.createCodeArtifactClient)(credentials.aws);
|
|
131
|
+
const command = new client_codeartifact_1.ListPackageVersionsCommand({
|
|
132
|
+
package: "v8-runtime",
|
|
133
|
+
domain: authentConst_1.DOMAIN,
|
|
134
|
+
domainOwner: authentConst_1.DOMAIN_OWNER,
|
|
135
|
+
repository: (0, CodeArtifactHelper_1.formatRepositoryString)(credentials.org),
|
|
136
|
+
format: "maven",
|
|
137
|
+
namespace: "com.dana.androidtv",
|
|
138
|
+
});
|
|
139
|
+
const response = await client.send(command);
|
|
140
|
+
const versionListArray = response.versions?.map((v) => v.version).filter(Boolean);
|
|
141
|
+
// need to use semver-ts to avoid this error
|
|
142
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-assignment
|
|
143
|
+
wtvAndroidVersion = (0, semver_1.maxSatisfying)(versionListArray, "*");
|
|
144
|
+
if (wtvAndroidVersion) {
|
|
145
|
+
return Promise.resolve(wtvAndroidVersion);
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
throw new Error(translation_1.default["command.device.version.error"]);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
catch (error) {
|
|
152
|
+
return Promise.reject(new Error(error.message ?? translation_1.default["error.common.start.message"]));
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
static getConfig = async () => {
|
|
156
|
+
prompts.log.info(picocolors_1.default.bold("Let's configure Android !"));
|
|
157
|
+
const config = {
|
|
158
|
+
device: await prompts.group({
|
|
159
|
+
appId: () => this._askAppId(),
|
|
160
|
+
appName: () => this._askAppName(),
|
|
161
|
+
appVersion: () => this._askAppVersion(),
|
|
162
|
+
appVersionCode: () => this._askAppVersionCode(),
|
|
163
|
+
icon: () => this._getAppIcon(),
|
|
164
|
+
wtvAndroidVersion: () => this._getWtvAndroidVersion(),
|
|
165
|
+
}, {
|
|
166
|
+
onCancel: () => {
|
|
167
|
+
prompts.cancel("Android configuration cancelled.");
|
|
168
|
+
process.exit(0);
|
|
169
|
+
},
|
|
170
|
+
}),
|
|
171
|
+
};
|
|
172
|
+
return Promise.resolve(config);
|
|
173
|
+
};
|
|
174
|
+
static setConfig = async ({ directory, config, }) => {
|
|
175
|
+
await this.updateProfileJson(directory, config);
|
|
176
|
+
return Promise.resolve("Android config done");
|
|
177
|
+
};
|
|
178
|
+
static updateProfileJson = async (directory, config) => {
|
|
179
|
+
const filePath = path_1.default.join(directory, "profiles", "app.config.androidtv.json");
|
|
180
|
+
const jsonData = JSON.parse(fs_1.default.readFileSync(filePath).toString());
|
|
181
|
+
jsonData["base-android"].device = { ...jsonData["base-android"].device, ...config.device };
|
|
182
|
+
fs_1.default.writeFileSync(filePath, JSON.stringify(jsonData, null, 4));
|
|
183
|
+
return Promise.resolve("Profile.json updated");
|
|
184
|
+
};
|
|
185
|
+
};
|
|
186
|
+
exports.default = AndroidtvConfig;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A generic class for device configuration
|
|
3
|
+
*/
|
|
4
|
+
declare const DeviceConfig: {
|
|
5
|
+
new (): {};
|
|
6
|
+
readonly appConfig: {};
|
|
7
|
+
getConfig(..._: string[]): Promise<unknown>;
|
|
8
|
+
setConfig(..._: unknown[]): Promise<string>;
|
|
9
|
+
/**
|
|
10
|
+
* Add renderers configuration to json
|
|
11
|
+
*/
|
|
12
|
+
updateProfileJsonWithRenderers(jsonData: Record<string, unknown>, renderers: string[]): object;
|
|
13
|
+
};
|
|
14
|
+
export default DeviceConfig;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
/**
|
|
15
|
+
* A generic class for device configuration
|
|
16
|
+
*/
|
|
17
|
+
const DeviceConfig = class {
|
|
18
|
+
static appConfig = {};
|
|
19
|
+
static getConfig(..._) {
|
|
20
|
+
return Promise.resolve({});
|
|
21
|
+
}
|
|
22
|
+
static setConfig(..._) {
|
|
23
|
+
return Promise.resolve("Device configuration done");
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Add renderers configuration to json
|
|
27
|
+
*/
|
|
28
|
+
static updateProfileJsonWithRenderers(jsonData, renderers) {
|
|
29
|
+
renderers.forEach((renderer) => {
|
|
30
|
+
jsonData = { ...jsonData, ...this.appConfig[renderer] };
|
|
31
|
+
});
|
|
32
|
+
return jsonData;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
exports.default = DeviceConfig;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { TizenConf } from "../../types/createApp/configTypes";
|
|
2
|
+
declare const TizenConfig: {
|
|
3
|
+
new (): {};
|
|
4
|
+
readonly appConfig: {
|
|
5
|
+
css: {
|
|
6
|
+
"template-tizen_css": {
|
|
7
|
+
mixins: string[];
|
|
8
|
+
base: {
|
|
9
|
+
name: string;
|
|
10
|
+
vendors: string[];
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
lightning: {
|
|
15
|
+
"template-tizen_lightning": {
|
|
16
|
+
mixins: string[];
|
|
17
|
+
base: {
|
|
18
|
+
name: string;
|
|
19
|
+
vendors: string[];
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
readonly getConfig: () => Promise<TizenConf>;
|
|
25
|
+
readonly setConfig: ({ directory, config }: {
|
|
26
|
+
directory: string;
|
|
27
|
+
config: TizenConf;
|
|
28
|
+
}) => Promise<string>;
|
|
29
|
+
updateProfileJsonWithRenderers(jsonData: Record<string, unknown>, renderers: string[]): object;
|
|
30
|
+
};
|
|
31
|
+
export default TizenConfig;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
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
|
+
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 fs_1 = __importDefault(require("fs"));
|
|
18
|
+
const path_1 = __importDefault(require("path"));
|
|
19
|
+
const deviceConfig_1 = __importDefault(require("./deviceConfig"));
|
|
20
|
+
const deviceConst_1 = require("../../const/createApp/deviceConst");
|
|
21
|
+
const TizenConfig = class extends deviceConfig_1.default {
|
|
22
|
+
static appConfig = {
|
|
23
|
+
css: {
|
|
24
|
+
"template-tizen_css": {
|
|
25
|
+
mixins: ["default", "tizen"],
|
|
26
|
+
base: {
|
|
27
|
+
name: "Tizen",
|
|
28
|
+
vendors: ["@dana/engine-html5", "@dana/renderer-css", "@dana/vendor-tizen"],
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
lightning: {
|
|
33
|
+
"template-tizen_lightning": {
|
|
34
|
+
mixins: ["default", "tizen"],
|
|
35
|
+
base: {
|
|
36
|
+
name: "Tizen",
|
|
37
|
+
vendors: ["@dana/engine-html5", "@dana/renderer-lightning-html5", "@dana/vendor-tizen"],
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
static getConfig = async () => {
|
|
43
|
+
const tizenConfig = {
|
|
44
|
+
renderers: [deviceConst_1.LIGHTNING],
|
|
45
|
+
};
|
|
46
|
+
return Promise.resolve(tizenConfig);
|
|
47
|
+
};
|
|
48
|
+
static setConfig = ({ directory, config }) => {
|
|
49
|
+
const filePath = path_1.default.join(directory, "profiles", "app.config.tizen.json");
|
|
50
|
+
let jsonData = JSON.parse(fs_1.default.readFileSync(filePath).toString());
|
|
51
|
+
jsonData = this.updateProfileJsonWithRenderers(jsonData, config.renderers);
|
|
52
|
+
fs_1.default.writeFileSync(filePath, JSON.stringify(jsonData, null, 4));
|
|
53
|
+
return Promise.resolve("Tizen configuration done");
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
exports.default = TizenConfig;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare const TvosConfig: {
|
|
2
|
+
new (): {};
|
|
3
|
+
/**
|
|
4
|
+
* Set config for TVOS
|
|
5
|
+
*/
|
|
6
|
+
readonly setConfig: ({ directory }: {
|
|
7
|
+
directory: string;
|
|
8
|
+
}) => Promise<string>;
|
|
9
|
+
readonly appConfig: {};
|
|
10
|
+
getConfig(..._: string[]): Promise<unknown>;
|
|
11
|
+
updateProfileJsonWithRenderers(jsonData: Record<string, unknown>, renderers: string[]): object;
|
|
12
|
+
};
|
|
13
|
+
export default TvosConfig;
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
/*
|
|
7
|
+
* Copyright (c) 2014-2025 Wiztivi - contact@wiztivi.com
|
|
8
|
+
* All Rights Reserved
|
|
9
|
+
*
|
|
10
|
+
* All information contained herein is proprietary and confidential.
|
|
11
|
+
* Dissemination of this information or reproduction of this file or material, via any medium is strictly forbidden unless
|
|
12
|
+
* prior written permission is obtained from Wiztivi.
|
|
13
|
+
* No warranty, explicit or implicit, provided.
|
|
14
|
+
* This software MAY NOT be used, modified or rewritten without prior written permission from Wiztivi.
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
const fs_1 = __importDefault(require("fs"));
|
|
18
|
+
const deviceConfig_1 = __importDefault(require("./deviceConfig"));
|
|
19
|
+
const path_1 = __importDefault(require("path"));
|
|
20
|
+
const TvosConfig = class extends deviceConfig_1.default {
|
|
21
|
+
/**
|
|
22
|
+
* Set config for TVOS
|
|
23
|
+
*/
|
|
24
|
+
static setConfig = async ({ directory }) => {
|
|
25
|
+
const update = `\n# For TVOS\napp_tvos/build \napp_tvos/libs`;
|
|
26
|
+
const filePath = path_1.default.join(directory, ".gitignore");
|
|
27
|
+
const data = fs_1.default.readFileSync(filePath, { encoding: "utf8" });
|
|
28
|
+
fs_1.default.writeFileSync(filePath, data + update);
|
|
29
|
+
return Promise.resolve(".gitignore updated");
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
exports.default = TvosConfig;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { WebosConf, WebosDevice } from "../../types/createApp/configTypes";
|
|
2
|
+
declare const WebosConfig: {
|
|
3
|
+
new (): {};
|
|
4
|
+
readonly appConfig: {
|
|
5
|
+
css: {
|
|
6
|
+
"template-webos_css": {
|
|
7
|
+
mixins: string[];
|
|
8
|
+
base: {
|
|
9
|
+
name: string;
|
|
10
|
+
vendors: string[];
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
lightning: {
|
|
15
|
+
"template-webos_lightning": {
|
|
16
|
+
mixins: string[];
|
|
17
|
+
base: {
|
|
18
|
+
name: string;
|
|
19
|
+
vendors: string[];
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Ask the appId
|
|
26
|
+
*/
|
|
27
|
+
readonly _askAppId: () => Promise<string>;
|
|
28
|
+
/**
|
|
29
|
+
* Ask the vendor name
|
|
30
|
+
*/
|
|
31
|
+
readonly _askVendorName: () => Promise<string>;
|
|
32
|
+
/**
|
|
33
|
+
* Ask the app title
|
|
34
|
+
* @returns {Promise<String>}
|
|
35
|
+
*/
|
|
36
|
+
readonly _askAppTitle: () => Promise<string>;
|
|
37
|
+
/**
|
|
38
|
+
* Get the app icon url
|
|
39
|
+
* @returns {String}
|
|
40
|
+
*/
|
|
41
|
+
readonly _getAppIcon: () => Promise<string>;
|
|
42
|
+
/**
|
|
43
|
+
* Ask back handling
|
|
44
|
+
* @returns {Promise<boolean>}
|
|
45
|
+
*/
|
|
46
|
+
readonly _askBackHistory: () => Promise<boolean>;
|
|
47
|
+
/**
|
|
48
|
+
* Asks for mandatory app.config properties
|
|
49
|
+
* @returns {Promise<Object>}
|
|
50
|
+
*/
|
|
51
|
+
readonly getAppConfigProperties: () => Promise<WebosDevice>;
|
|
52
|
+
readonly getConfig: () => Promise<WebosConf>;
|
|
53
|
+
readonly setConfig: ({ directory, config, }: {
|
|
54
|
+
directory: string;
|
|
55
|
+
config: WebosConf;
|
|
56
|
+
}) => Promise<string>;
|
|
57
|
+
updateProfileJsonWithRenderers(jsonData: Record<string, unknown>, renderers: string[]): object;
|
|
58
|
+
};
|
|
59
|
+
export default WebosConfig;
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
/*
|
|
40
|
+
* Copyright (c) 2014-2025 Wiztivi - contact@wiztivi.com
|
|
41
|
+
* All Rights Reserved
|
|
42
|
+
*
|
|
43
|
+
* All information contained herein is proprietary and confidential.
|
|
44
|
+
* Dissemination of this information or reproduction of this file or material, via any medium is strictly forbidden unless
|
|
45
|
+
* prior written permission is obtained from Wiztivi.
|
|
46
|
+
* No warranty, explicit or implicit, provided.
|
|
47
|
+
* This software MAY NOT be used, modified or rewritten without prior written permission from Wiztivi.
|
|
48
|
+
*
|
|
49
|
+
*/
|
|
50
|
+
const prompts = __importStar(require("@clack/prompts"));
|
|
51
|
+
const ComponentHelper_1 = __importDefault(require("../../helpers/ComponentHelper"));
|
|
52
|
+
const fs_1 = __importDefault(require("fs"));
|
|
53
|
+
const path_1 = __importDefault(require("path"));
|
|
54
|
+
const deviceConfig_1 = __importDefault(require("./deviceConfig"));
|
|
55
|
+
const picocolors_1 = __importDefault(require("picocolors"));
|
|
56
|
+
const setupConst_1 = require("../../const/createApp/setupConst");
|
|
57
|
+
const InputValidator_1 = require("../../helpers/createApp/InputValidator");
|
|
58
|
+
const deviceConst_1 = require("../../const/createApp/deviceConst");
|
|
59
|
+
const WebosConfig = class extends deviceConfig_1.default {
|
|
60
|
+
static appConfig = {
|
|
61
|
+
css: {
|
|
62
|
+
"template-webos_css": {
|
|
63
|
+
mixins: ["default", "webos"],
|
|
64
|
+
base: {
|
|
65
|
+
name: "Webos",
|
|
66
|
+
vendors: ["@dana/vendor-components", "@dana/vendor-shaka", "@dana/vendor-webos-css"],
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
lightning: {
|
|
71
|
+
"template-webos_lightning": {
|
|
72
|
+
mixins: ["default", "webos"],
|
|
73
|
+
base: {
|
|
74
|
+
name: "Webos",
|
|
75
|
+
vendors: ["@dana/vendor-components", "@dana/vendor-shaka", "@dana/vendor-webos-lightning"],
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* Ask the appId
|
|
82
|
+
*/
|
|
83
|
+
static _askAppId = async () => {
|
|
84
|
+
const errorMessage = "AppId is required !";
|
|
85
|
+
const appId = (await prompts.text({
|
|
86
|
+
message: "What is the appId ?",
|
|
87
|
+
placeholder: "com.yourname.ui",
|
|
88
|
+
validate: (value) => (0, InputValidator_1.validInputLength)(value, errorMessage),
|
|
89
|
+
}));
|
|
90
|
+
ComponentHelper_1.default.handleCancellation(appId);
|
|
91
|
+
return appId;
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* Ask the vendor name
|
|
95
|
+
*/
|
|
96
|
+
static _askVendorName = async () => {
|
|
97
|
+
const errorMessage = "VendorName is required !";
|
|
98
|
+
const vendor = (await prompts.text({
|
|
99
|
+
message: "What is the vendor name?",
|
|
100
|
+
placeholder: "Wiztivi",
|
|
101
|
+
initialValue: "Wiztivi",
|
|
102
|
+
validate: (value) => (0, InputValidator_1.validInputLength)(value, errorMessage),
|
|
103
|
+
}));
|
|
104
|
+
ComponentHelper_1.default.handleCancellation(vendor);
|
|
105
|
+
return vendor;
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* Ask the app title
|
|
109
|
+
* @returns {Promise<String>}
|
|
110
|
+
*/
|
|
111
|
+
static _askAppTitle = async () => {
|
|
112
|
+
const errorMessage = "App title is required !";
|
|
113
|
+
const appTitle = (await prompts.text({
|
|
114
|
+
message: "What is app name (to be displayed on store and webOS devices)?",
|
|
115
|
+
placeholder: "My app",
|
|
116
|
+
initialValue: "Dana UI",
|
|
117
|
+
validate: (value) => (0, InputValidator_1.validInputLength)(value, errorMessage),
|
|
118
|
+
}));
|
|
119
|
+
ComponentHelper_1.default.handleCancellation(appTitle);
|
|
120
|
+
return appTitle;
|
|
121
|
+
};
|
|
122
|
+
/**
|
|
123
|
+
* Get the app icon url
|
|
124
|
+
* @returns {String}
|
|
125
|
+
*/
|
|
126
|
+
static _getAppIcon = () => {
|
|
127
|
+
return Promise.resolve(setupConst_1.DEFAULT_IMAGE_URL);
|
|
128
|
+
};
|
|
129
|
+
/**
|
|
130
|
+
* Ask back handling
|
|
131
|
+
* @returns {Promise<boolean>}
|
|
132
|
+
*/
|
|
133
|
+
static _askBackHistory = async () => {
|
|
134
|
+
const backHistory = (await prompts.confirm({
|
|
135
|
+
message: "Does your app handle the back button manually ?",
|
|
136
|
+
}));
|
|
137
|
+
ComponentHelper_1.default.handleCancellation(backHistory);
|
|
138
|
+
return backHistory;
|
|
139
|
+
};
|
|
140
|
+
/**
|
|
141
|
+
* Asks for mandatory app.config properties
|
|
142
|
+
* @returns {Promise<Object>}
|
|
143
|
+
*/
|
|
144
|
+
static getAppConfigProperties = async () => {
|
|
145
|
+
const data = (await prompts.group({
|
|
146
|
+
appId: () => this._askAppId(),
|
|
147
|
+
appVendor: () => this._askVendorName(),
|
|
148
|
+
appTitle: () => this._askAppTitle(),
|
|
149
|
+
icon: () => this._getAppIcon(),
|
|
150
|
+
largeIcon: () => this._getAppIcon(),
|
|
151
|
+
disableBackHistoryAPI: () => this._askBackHistory(),
|
|
152
|
+
}, {
|
|
153
|
+
onCancel: () => {
|
|
154
|
+
prompts.cancel("Webos configuration cancelled.");
|
|
155
|
+
process.exit(0);
|
|
156
|
+
},
|
|
157
|
+
}));
|
|
158
|
+
ComponentHelper_1.default.handleCancellation(data);
|
|
159
|
+
return data;
|
|
160
|
+
};
|
|
161
|
+
static getConfig = async () => {
|
|
162
|
+
prompts.log.info(picocolors_1.default.bold("Let's configure LG"));
|
|
163
|
+
const webosConfig = {
|
|
164
|
+
renderers: [deviceConst_1.CSS],
|
|
165
|
+
device: await this.getAppConfigProperties(),
|
|
166
|
+
};
|
|
167
|
+
return Promise.resolve(webosConfig);
|
|
168
|
+
};
|
|
169
|
+
static setConfig = async ({ directory, config, }) => {
|
|
170
|
+
const filePath = path_1.default.join(directory, "profiles", "app.config.webos.json");
|
|
171
|
+
let jsonData = JSON.parse(fs_1.default.readFileSync(filePath).toString());
|
|
172
|
+
jsonData.webos ??= { device: {} };
|
|
173
|
+
jsonData.webos.device = { ...jsonData.webos?.device, ...config.device };
|
|
174
|
+
jsonData = this.updateProfileJsonWithRenderers(jsonData, config.renderers);
|
|
175
|
+
fs_1.default.writeFileSync(filePath, JSON.stringify(jsonData, null, 4));
|
|
176
|
+
return Promise.resolve("Webos configuration done");
|
|
177
|
+
};
|
|
178
|
+
};
|
|
179
|
+
exports.default = WebosConfig;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const MENU = "wtvMenuListView";
|
|
2
|
+
export declare const RAIL = "wtvRailListView";
|
|
3
|
+
export declare const TILE_VIEW = "tileView";
|
|
4
|
+
export declare const SCROLL_VIEW = "scrollView";
|
|
5
|
+
export declare const SCROLL_ITEM = "scrollItemView";
|
|
6
|
+
export declare const BUTTON_ITEM_VIEW = "ButtonItemView";
|
|
7
|
+
export declare const SCREEN = "screen";
|
|
8
|
+
export declare const VOD_SCREEN = "vod";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
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
|
+
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";
|