@wiztivi/dana-cli 0.0.13 → 0.0.14-beta.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/dist/commands/addDevice/deviceConfig/configTypes.d.ts +12 -7
- package/dist/commands/addDevice/deviceConfig/titanosConfig.d.ts +9 -0
- package/dist/commands/addDevice/deviceConfig/titanosConfig.js +14 -0
- package/dist/commands/addDevice/deviceConfig/vidaaConfig.d.ts +9 -0
- package/dist/commands/addDevice/deviceConfig/vidaaConfig.js +14 -0
- package/dist/commands/authentication/AuthenticationManager.d.ts +15 -3
- package/dist/commands/authentication/AuthenticationManager.js +28 -11
- package/dist/commands/authentication/authDefinition.js +2 -0
- package/dist/commands/authentication/authHook.js +2 -2
- package/dist/commands/authentication/authentConst.d.ts +2 -0
- package/dist/commands/authentication/authentConst.js +2 -0
- package/dist/commands/authentication/commands/login.d.ts +3 -1
- package/dist/commands/authentication/commands/login.js +2 -2
- package/dist/commands/authentication/commands/logout.js +1 -1
- package/dist/commands/authentication/helper/CredentialsHelper.d.ts +5 -1
- package/dist/commands/authentication/helper/CredentialsHelper.js +17 -2
- package/dist/commands/createApp/helpers/CreateAppHelper.d.ts +6 -0
- package/dist/commands/createApp/helpers/CreateAppHelper.js +6 -0
- package/dist/common/const/deviceConst.d.ts +3 -1
- package/dist/common/const/deviceConst.js +9 -1
- package/dist/common/helpers/CreateFileHelper.js +1 -1
- package/dist/common/helpers/InstallHelper.js +5 -2
- package/dist/common/helpers/UserInputGetter.js +1 -1
- package/dist/common/translation/en.json +5 -1
- package/dist/common/types/helperTypes.d.ts +4 -2
- package/dist/common/types/helperTypes.js +1 -1
- package/package.json +3 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
interface AndroidDevice {
|
|
1
|
+
export interface AndroidDevice {
|
|
2
2
|
appId: string;
|
|
3
3
|
appName: string;
|
|
4
4
|
appVersion: string;
|
|
@@ -6,17 +6,17 @@ interface AndroidDevice {
|
|
|
6
6
|
icon: string;
|
|
7
7
|
wtvAndroidVersion: string;
|
|
8
8
|
}
|
|
9
|
-
interface AndroidConfig {
|
|
9
|
+
export interface AndroidConfig {
|
|
10
10
|
device: AndroidDevice;
|
|
11
11
|
}
|
|
12
|
-
interface TizenConf {
|
|
12
|
+
export interface TizenConf {
|
|
13
13
|
renderers: string[];
|
|
14
14
|
}
|
|
15
|
-
interface WebosConf {
|
|
15
|
+
export interface WebosConf {
|
|
16
16
|
device: WebosDevice;
|
|
17
17
|
renderers: string[];
|
|
18
18
|
}
|
|
19
|
-
interface WebosDevice {
|
|
19
|
+
export interface WebosDevice {
|
|
20
20
|
appId: string;
|
|
21
21
|
appVendor: string;
|
|
22
22
|
appTitle: string;
|
|
@@ -24,7 +24,12 @@ interface WebosDevice {
|
|
|
24
24
|
largeIcon: string;
|
|
25
25
|
disableBackHistoryAPI: boolean;
|
|
26
26
|
}
|
|
27
|
-
interface TvosConf {
|
|
27
|
+
export interface TvosConf {
|
|
28
28
|
jscVersion: string;
|
|
29
29
|
}
|
|
30
|
-
export
|
|
30
|
+
export interface VidaaConf {
|
|
31
|
+
renderers: string[];
|
|
32
|
+
}
|
|
33
|
+
export interface TitanosConf {
|
|
34
|
+
renderers: string[];
|
|
35
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TitanosConf } from "./configTypes.js";
|
|
2
|
+
declare const TitanosConfig: {
|
|
3
|
+
new (): {};
|
|
4
|
+
readonly getConfig: () => Promise<TitanosConf>;
|
|
5
|
+
readonly setConfig: () => Promise<string>;
|
|
6
|
+
readonly appConfig: {};
|
|
7
|
+
updateProfileJsonWithRenderers(jsonData: Record<string, unknown>, renderers: string[]): object;
|
|
8
|
+
};
|
|
9
|
+
export default TitanosConfig;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import DeviceConfig from "./deviceConfig.js";
|
|
2
|
+
import { LIGHTNING, CSS } from "../../../common/const/deviceConst.js";
|
|
3
|
+
const TitanosConfig = class extends DeviceConfig {
|
|
4
|
+
// eslint-disable-next-line @typescript-eslint/require-await
|
|
5
|
+
static getConfig = async () => {
|
|
6
|
+
return {
|
|
7
|
+
renderers: [LIGHTNING, CSS],
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
static setConfig = () => {
|
|
11
|
+
return Promise.resolve("TitanOS configuration done");
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export default TitanosConfig;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { VidaaConf } from "./configTypes.js";
|
|
2
|
+
declare const VidaaConfig: {
|
|
3
|
+
new (): {};
|
|
4
|
+
readonly getConfig: () => Promise<VidaaConf>;
|
|
5
|
+
readonly setConfig: () => Promise<string>;
|
|
6
|
+
readonly appConfig: {};
|
|
7
|
+
updateProfileJsonWithRenderers(jsonData: Record<string, unknown>, renderers: string[]): object;
|
|
8
|
+
};
|
|
9
|
+
export default VidaaConfig;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import DeviceConfig from "./deviceConfig.js";
|
|
2
|
+
import { LIGHTNING, CSS } from "../../../common/const/deviceConst.js";
|
|
3
|
+
const VidaaConfig = class extends DeviceConfig {
|
|
4
|
+
// eslint-disable-next-line @typescript-eslint/require-await
|
|
5
|
+
static getConfig = async () => {
|
|
6
|
+
return {
|
|
7
|
+
renderers: [LIGHTNING, CSS],
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
static setConfig = () => {
|
|
11
|
+
return Promise.resolve("Vidaa configuration done");
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export default VidaaConfig;
|
|
@@ -9,12 +9,24 @@ export interface AuthCredentials {
|
|
|
9
9
|
aws: AwsCredentials;
|
|
10
10
|
dana: DanaToken;
|
|
11
11
|
org: string;
|
|
12
|
+
isRemote: boolean;
|
|
13
|
+
port?: number;
|
|
12
14
|
}
|
|
13
15
|
export declare class AuthenticationManager {
|
|
14
16
|
private static getAPIURL;
|
|
15
|
-
static login(organization: string): Promise<AuthCredentials>;
|
|
16
|
-
static logout(organization: string, creds?: Partial<DanaToken
|
|
17
|
-
static refresh(organization: string, token: string): Promise<
|
|
17
|
+
static login(organization: string, isRemote: boolean, userPort?: number): Promise<AuthCredentials>;
|
|
18
|
+
static logout(organization: string, creds?: Partial<DanaToken>, isRemote?: boolean): Promise<void>;
|
|
19
|
+
static refresh(organization: string, token: string, isRemote: boolean, port?: number): Promise<{
|
|
20
|
+
aws: AwsCredentials;
|
|
21
|
+
dana: {
|
|
22
|
+
refresh_token: string;
|
|
23
|
+
id_token: string;
|
|
24
|
+
access_token: string;
|
|
25
|
+
expires_in: number;
|
|
26
|
+
token_type: string;
|
|
27
|
+
};
|
|
28
|
+
org: string;
|
|
29
|
+
}>;
|
|
18
30
|
static isTokenExpired(token: string): boolean;
|
|
19
31
|
static loginNPM(organization: string, credentials: AwsCredentials): Promise<{
|
|
20
32
|
token: string;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import getPort from "get-port";
|
|
2
2
|
import express from "express";
|
|
3
3
|
import { CredentialsHelper } from "./helper/CredentialsHelper.js";
|
|
4
|
+
import { log } from "@clack/prompts";
|
|
5
|
+
import translation from "../../common/translation/translation.js";
|
|
4
6
|
import open from "open";
|
|
5
7
|
import jwt from "jsonwebtoken";
|
|
6
8
|
import { createCodeArtifactClient, formatRepositoryString, getRepositoryEndpoint, } from "./helper/CodeArtifactHelper.js";
|
|
7
9
|
import { GetAuthorizationTokenCommand } from "@aws-sdk/client-codeartifact";
|
|
8
|
-
import { DOMAIN, DOMAIN_OWNER } from "./authentConst.js";
|
|
10
|
+
import { DOMAIN, DOMAIN_OWNER, DEFAULT_PORT_1, DEFAULT_PORT_2 } from "./authentConst.js";
|
|
9
11
|
import { execSync } from "node:child_process";
|
|
10
12
|
import fs from "node:fs";
|
|
11
13
|
import path from "node:path";
|
|
@@ -13,7 +15,7 @@ export class AuthenticationManager {
|
|
|
13
15
|
static getAPIURL(organization) {
|
|
14
16
|
return `https://api.${organization}.dana-framework.com`; // Or http://localhost:3001
|
|
15
17
|
}
|
|
16
|
-
static async login(organization) {
|
|
18
|
+
static async login(organization, isRemote, userPort) {
|
|
17
19
|
const app = express();
|
|
18
20
|
app.disable("x-powered-by");
|
|
19
21
|
const promise = new Promise((resolve, reject) => {
|
|
@@ -29,9 +31,9 @@ export class AuthenticationManager {
|
|
|
29
31
|
}
|
|
30
32
|
const token = JSON.parse(req.query.token);
|
|
31
33
|
const awsCredentials = JSON.parse(req.query.aws);
|
|
32
|
-
const creds = { aws: awsCredentials, dana: token, org: organization };
|
|
34
|
+
const creds = { aws: awsCredentials, dana: token, org: organization, isRemote, port: userPort };
|
|
33
35
|
res.send("Login successful! You can close this window.");
|
|
34
|
-
CredentialsHelper.store(creds);
|
|
36
|
+
CredentialsHelper.store(creds, isRemote, userPort);
|
|
35
37
|
resolve(creds);
|
|
36
38
|
}
|
|
37
39
|
catch (err) {
|
|
@@ -40,15 +42,24 @@ export class AuthenticationManager {
|
|
|
40
42
|
}
|
|
41
43
|
});
|
|
42
44
|
});
|
|
43
|
-
const
|
|
45
|
+
const defaultPortList = [DEFAULT_PORT_1, DEFAULT_PORT_2];
|
|
46
|
+
const portList = userPort ? [userPort].concat(defaultPortList) : defaultPortList;
|
|
47
|
+
const port = await getPort({ port: portList });
|
|
44
48
|
const server = app.listen(port);
|
|
45
|
-
|
|
49
|
+
if (isRemote) {
|
|
50
|
+
log.info(translation["command.auth.remoteMode"] + `Port: ${port}`);
|
|
51
|
+
log.info(translation["command.auth.accessBrowserUrl"] +
|
|
52
|
+
` ${AuthenticationManager.getAPIURL(organization)}/login?port=${port}`);
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
await open(`${AuthenticationManager.getAPIURL(organization)}/login?port=${port}`);
|
|
56
|
+
}
|
|
46
57
|
return promise.finally(() => {
|
|
47
58
|
server.closeAllConnections();
|
|
48
59
|
server.close();
|
|
49
60
|
});
|
|
50
61
|
}
|
|
51
|
-
static async logout(organization, creds) {
|
|
62
|
+
static async logout(organization, creds, isRemote) {
|
|
52
63
|
const url = new URL(`${AuthenticationManager.getAPIURL(organization)}/logout`);
|
|
53
64
|
if (creds?.id_token) {
|
|
54
65
|
url.searchParams.append("id_token", creds.id_token);
|
|
@@ -56,13 +67,19 @@ export class AuthenticationManager {
|
|
|
56
67
|
if (creds?.refresh_token) {
|
|
57
68
|
url.searchParams.append("refresh_token", creds.refresh_token);
|
|
58
69
|
}
|
|
59
|
-
|
|
70
|
+
if (isRemote) {
|
|
71
|
+
log.info(translation["command.auth.remoteMode"]);
|
|
72
|
+
log.info(translation["command.auth.accessBrowserUrl"] + `${url.toString()}`);
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
await open(url.toString());
|
|
76
|
+
}
|
|
60
77
|
CredentialsHelper.delete(organization);
|
|
61
78
|
}
|
|
62
|
-
static async refresh(organization, token) {
|
|
79
|
+
static async refresh(organization, token, isRemote, port) {
|
|
63
80
|
const data = await fetch(`${AuthenticationManager.getAPIURL(organization)}/login?refresh_token=${token}`);
|
|
64
81
|
if (!data.ok) {
|
|
65
|
-
return AuthenticationManager.login(organization);
|
|
82
|
+
return AuthenticationManager.login(organization, isRemote, port);
|
|
66
83
|
}
|
|
67
84
|
const refreshedCreds = (await data.json());
|
|
68
85
|
const creds = {
|
|
@@ -73,7 +90,7 @@ export class AuthenticationManager {
|
|
|
73
90
|
},
|
|
74
91
|
org: organization,
|
|
75
92
|
};
|
|
76
|
-
CredentialsHelper.store(creds);
|
|
93
|
+
CredentialsHelper.store(creds, isRemote, port);
|
|
77
94
|
return creds;
|
|
78
95
|
}
|
|
79
96
|
static isTokenExpired(token) {
|
|
@@ -10,6 +10,8 @@ const addAuthDefinition = () => {
|
|
|
10
10
|
const loginCmd = new Command("login")
|
|
11
11
|
.description(translation["command.auth.login.description"])
|
|
12
12
|
.option("-o, --org <organization>", translation["command.auth.login.option.org"])
|
|
13
|
+
.option("-r, --remote", translation["command.auth.login.option.remote"])
|
|
14
|
+
.option("-p, --port <port>", translation["command.auth.login.option.port"])
|
|
13
15
|
.action(login);
|
|
14
16
|
command.addCommand(loginCmd);
|
|
15
17
|
const logoutCmd = new Command("logout")
|
|
@@ -17,12 +17,12 @@ export const authHook = async () => {
|
|
|
17
17
|
const credentials = CredentialsHelper.get();
|
|
18
18
|
try {
|
|
19
19
|
if (!credentials.dana?.id_token || !credentials.dana?.refresh_token) {
|
|
20
|
-
await AuthenticationManager.login(credentials.org);
|
|
20
|
+
await AuthenticationManager.login(credentials.org, credentials.isRemote, credentials?.port);
|
|
21
21
|
return;
|
|
22
22
|
}
|
|
23
23
|
if (AuthenticationManager.isTokenExpired(credentials.dana.id_token) ||
|
|
24
24
|
(credentials.aws && new Date(credentials.aws.expiration) < new Date())) {
|
|
25
|
-
await AuthenticationManager.refresh(credentials.org, credentials.dana.refresh_token);
|
|
25
|
+
await AuthenticationManager.refresh(credentials.org, credentials.dana.refresh_token, credentials.isRemote, credentials?.port);
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
catch (error) {
|
|
@@ -2,3 +2,5 @@ export declare const DOMAIN = "dana";
|
|
|
2
2
|
export declare const DOMAIN_OWNER = "733912940672";
|
|
3
3
|
export declare const REGION = "eu-central-1";
|
|
4
4
|
export declare const DEFAULT_ORG = "public";
|
|
5
|
+
export declare const DEFAULT_PORT_1 = 10032;
|
|
6
|
+
export declare const DEFAULT_PORT_2 = 10064;
|
|
@@ -7,11 +7,11 @@ import { handleError } from "../helper/CommandHelper.js";
|
|
|
7
7
|
Login to DANA backend (with aws and cognito) and connect to npm codeartifact
|
|
8
8
|
More info: https://github.com/wiztivi-rd/dana-cli/wiki/Login
|
|
9
9
|
*/
|
|
10
|
-
const login = async ({ org }) => {
|
|
10
|
+
const login = async ({ org, port, remote = false }) => {
|
|
11
11
|
const credentials = CredentialsHelper.get(org);
|
|
12
12
|
try {
|
|
13
13
|
prompts.intro(`Login to organization ${credentials.org} ...`);
|
|
14
|
-
const validCredentials = await AuthenticationManager.login(credentials.org);
|
|
14
|
+
const validCredentials = await AuthenticationManager.login(credentials.org, remote, port);
|
|
15
15
|
prompts.outro(colors.green("✓") + ` Login successful`);
|
|
16
16
|
const npmToken = await AuthenticationManager.loginNPM(credentials.org, validCredentials.aws);
|
|
17
17
|
await AuthenticationManager.loginGradle(credentials.org, validCredentials.aws);
|
|
@@ -10,7 +10,7 @@ const logout = async ({ org }) => {
|
|
|
10
10
|
const credentials = CredentialsHelper.get(org);
|
|
11
11
|
try {
|
|
12
12
|
prompts.intro(`Logout from ${credentials.org}...`);
|
|
13
|
-
await AuthenticationManager.logout(credentials.org, credentials.dana);
|
|
13
|
+
await AuthenticationManager.logout(credentials.org, credentials.dana, credentials.isRemote);
|
|
14
14
|
prompts.outro(colors.green("✓") + ` Logout successful. You are now being logged out in your browser.`);
|
|
15
15
|
}
|
|
16
16
|
catch (error) {
|
|
@@ -20,6 +20,8 @@ export interface DanaConfig {
|
|
|
20
20
|
lastUsedOrg: string;
|
|
21
21
|
version: number;
|
|
22
22
|
credentials: Record<string, OrgCredentials>;
|
|
23
|
+
port?: number;
|
|
24
|
+
isRemote: boolean;
|
|
23
25
|
}
|
|
24
26
|
export declare const CURRENT_DANA_JSON_VERSION = 2;
|
|
25
27
|
export declare class CredentialsHelper {
|
|
@@ -30,11 +32,13 @@ export declare class CredentialsHelper {
|
|
|
30
32
|
aws: AwsCredentials;
|
|
31
33
|
dana: DanaToken;
|
|
32
34
|
org: string;
|
|
33
|
-
}): void;
|
|
35
|
+
}, isRemote: boolean, port?: number): void;
|
|
34
36
|
static get(org?: string): {
|
|
35
37
|
aws?: AwsCredentials;
|
|
36
38
|
dana?: DanaToken;
|
|
37
39
|
org: string;
|
|
40
|
+
isRemote: boolean;
|
|
41
|
+
port?: number;
|
|
38
42
|
};
|
|
39
43
|
static delete(org: string): void;
|
|
40
44
|
}
|
|
@@ -28,16 +28,26 @@ export class CredentialsHelper {
|
|
|
28
28
|
aws: v1.aws,
|
|
29
29
|
},
|
|
30
30
|
},
|
|
31
|
+
isRemote: false,
|
|
31
32
|
version: CURRENT_DANA_JSON_VERSION,
|
|
32
33
|
};
|
|
33
34
|
}
|
|
34
35
|
return config;
|
|
35
36
|
}
|
|
36
|
-
static store(credentials) {
|
|
37
|
+
static store(credentials, isRemote, port) {
|
|
37
38
|
let config = this.getConfig();
|
|
38
|
-
config ??= {
|
|
39
|
+
config ??= {
|
|
40
|
+
lastUsedOrg: credentials.org,
|
|
41
|
+
credentials: {},
|
|
42
|
+
version: CURRENT_DANA_JSON_VERSION,
|
|
43
|
+
isRemote: false,
|
|
44
|
+
};
|
|
39
45
|
config.credentials ??= {};
|
|
40
46
|
config.lastUsedOrg = credentials.org;
|
|
47
|
+
if (port) {
|
|
48
|
+
config.port = port;
|
|
49
|
+
}
|
|
50
|
+
config.isRemote = isRemote;
|
|
41
51
|
config.credentials[credentials.org] = { aws: credentials.aws, dana: credentials.dana };
|
|
42
52
|
writeFileSync(this.filePath, JSON.stringify(config, null, 4));
|
|
43
53
|
}
|
|
@@ -46,6 +56,7 @@ export class CredentialsHelper {
|
|
|
46
56
|
const organization = org ?? config?.lastUsedOrg ?? DEFAULT_ORG;
|
|
47
57
|
const creds = {
|
|
48
58
|
org: organization,
|
|
59
|
+
isRemote: false,
|
|
49
60
|
};
|
|
50
61
|
if (config?.credentials?.[organization]?.aws) {
|
|
51
62
|
creds.aws = config?.credentials[organization]?.aws;
|
|
@@ -53,6 +64,10 @@ export class CredentialsHelper {
|
|
|
53
64
|
if (config?.credentials?.[organization]?.dana) {
|
|
54
65
|
creds.dana = config?.credentials[organization]?.dana;
|
|
55
66
|
}
|
|
67
|
+
if (config?.port) {
|
|
68
|
+
creds.port = config.port;
|
|
69
|
+
}
|
|
70
|
+
creds.isRemote = !!config?.isRemote;
|
|
56
71
|
return creds;
|
|
57
72
|
}
|
|
58
73
|
static delete(org) {
|
|
@@ -103,6 +103,12 @@ declare const CreateAppHelper: {
|
|
|
103
103
|
readonly updateProfileJson: (directory: string, config: import("../../addDevice/deviceConfig/configTypes.js").AndroidConfig) => Promise<string>;
|
|
104
104
|
readonly appConfig: {};
|
|
105
105
|
updateProfileJsonWithRenderers(jsonData: Record<string, unknown>, renderers: string[]): object;
|
|
106
|
+
} | {
|
|
107
|
+
new (): {};
|
|
108
|
+
readonly getConfig: () => Promise<import("../../addDevice/deviceConfig/configTypes.js").VidaaConf>;
|
|
109
|
+
readonly setConfig: () => Promise<string>;
|
|
110
|
+
readonly appConfig: {};
|
|
111
|
+
updateProfileJsonWithRenderers(jsonData: Record<string, unknown>, renderers: string[]): object;
|
|
106
112
|
};
|
|
107
113
|
readonly promptUnavailableDevices: (unavailableDevices: string[]) => void;
|
|
108
114
|
readonly promptSelectDevices: (devices: SelectionArray, required?: boolean) => Promise<string[]>;
|
|
@@ -18,6 +18,8 @@ import DeviceConfig from "../../addDevice/deviceConfig/deviceConfig.js";
|
|
|
18
18
|
import AndroidtvConfig from "../../addDevice/deviceConfig/androidtvConfig.js";
|
|
19
19
|
import colors from "picocolors";
|
|
20
20
|
import translation from "../../../common/translation/translation.js";
|
|
21
|
+
import VidaaConfig from "../../addDevice/deviceConfig/vidaaConfig.js";
|
|
22
|
+
import TitanosConfig from "../../addDevice/deviceConfig/titanosConfig.js";
|
|
21
23
|
const CreateAppHelper = class {
|
|
22
24
|
/**
|
|
23
25
|
* Manage cancellation with CTRL+C
|
|
@@ -53,6 +55,10 @@ const CreateAppHelper = class {
|
|
|
53
55
|
return TvosConfig;
|
|
54
56
|
case deviceConst.ANDROIDTV:
|
|
55
57
|
return AndroidtvConfig;
|
|
58
|
+
case deviceConst.VIDAA:
|
|
59
|
+
return VidaaConfig;
|
|
60
|
+
case deviceConst.TITANOS:
|
|
61
|
+
return TitanosConfig;
|
|
56
62
|
default:
|
|
57
63
|
return DeviceConfig;
|
|
58
64
|
}
|
|
@@ -4,6 +4,8 @@ declare const WEBOS = "webos";
|
|
|
4
4
|
declare const ANDROIDTV = "androidtv";
|
|
5
5
|
declare const CSS = "css";
|
|
6
6
|
declare const LIGHTNING = "lightning";
|
|
7
|
+
declare const VIDAA = "vidaa";
|
|
8
|
+
declare const TITANOS = "titanos";
|
|
7
9
|
declare const BASIC_DEPENDENCIES: string[];
|
|
8
10
|
/**
|
|
9
11
|
* @property {String} label - user-friendly displayed name
|
|
@@ -20,4 +22,4 @@ declare const BASIC_SETUP: Record<string, PlatformConfig>;
|
|
|
20
22
|
declare const EXTENDED_SETUP: Record<string, PlatformConfig>;
|
|
21
23
|
declare const PLATFORM_CONFIG: Record<string, PlatformConfig>;
|
|
22
24
|
declare const RENDERERS: string[];
|
|
23
|
-
export { TVOS, TIZEN, WEBOS, ANDROIDTV, BASIC_DEPENDENCIES, PLATFORM_CONFIG, RENDERERS, BASIC_SETUP, EXTENDED_SETUP, LIGHTNING, CSS, };
|
|
25
|
+
export { TVOS, TIZEN, WEBOS, ANDROIDTV, VIDAA, TITANOS, BASIC_DEPENDENCIES, PLATFORM_CONFIG, RENDERERS, BASIC_SETUP, EXTENDED_SETUP, LIGHTNING, CSS, };
|
|
@@ -15,6 +15,8 @@ const WEBOS = "webos";
|
|
|
15
15
|
const ANDROIDTV = "androidtv";
|
|
16
16
|
const CSS = "css";
|
|
17
17
|
const LIGHTNING = "lightning";
|
|
18
|
+
const VIDAA = "vidaa";
|
|
19
|
+
const TITANOS = "titanos";
|
|
18
20
|
const BASIC_DEPENDENCIES = [
|
|
19
21
|
"@dana/renderer-css",
|
|
20
22
|
"@dana/renderer-lightning-html5",
|
|
@@ -36,6 +38,7 @@ const BASIC_SETUP = {
|
|
|
36
38
|
},
|
|
37
39
|
};
|
|
38
40
|
//Devices that need a subscription to be added in project
|
|
41
|
+
//package is used to check if user is entitled to the device
|
|
39
42
|
const EXTENDED_SETUP = {
|
|
40
43
|
[TVOS]: {
|
|
41
44
|
label: "TV OS",
|
|
@@ -57,7 +60,12 @@ const EXTENDED_SETUP = {
|
|
|
57
60
|
package: "@dana/engine-android",
|
|
58
61
|
dependencies: ["@dana/engine-android", "@dana/renderer-android", "@dana/tools-android-grunt"],
|
|
59
62
|
},
|
|
63
|
+
[VIDAA]: {
|
|
64
|
+
label: "Vidaa",
|
|
65
|
+
package: "@dana/vendor-vidaa",
|
|
66
|
+
dependencies: ["@dana/vendor-vidaa", "@dana/tools-smarttv-grunt"],
|
|
67
|
+
},
|
|
60
68
|
};
|
|
61
69
|
const PLATFORM_CONFIG = { ...BASIC_SETUP, ...EXTENDED_SETUP };
|
|
62
70
|
const RENDERERS = [CSS, LIGHTNING];
|
|
63
|
-
export { TVOS, TIZEN, WEBOS, ANDROIDTV, BASIC_DEPENDENCIES, PLATFORM_CONFIG, RENDERERS, BASIC_SETUP, EXTENDED_SETUP, LIGHTNING, CSS, };
|
|
71
|
+
export { TVOS, TIZEN, WEBOS, ANDROIDTV, VIDAA, TITANOS, BASIC_DEPENDENCIES, PLATFORM_CONFIG, RENDERERS, BASIC_SETUP, EXTENDED_SETUP, LIGHTNING, CSS, };
|
|
@@ -49,7 +49,7 @@ class CreateFileHelper {
|
|
|
49
49
|
return Promise.resolve("Config file(s) copied");
|
|
50
50
|
};
|
|
51
51
|
static runGruntCommand(args, directory) {
|
|
52
|
-
const gruntAndroid = spawnSync("grunt", args, { cwd: directory });
|
|
52
|
+
const gruntAndroid = spawnSync("grunt", args, { shell: true, cwd: directory });
|
|
53
53
|
if (gruntAndroid.status === 0) {
|
|
54
54
|
return Promise.resolve("Grunt task(s) done");
|
|
55
55
|
}
|
|
@@ -22,7 +22,7 @@ class InstallHelper {
|
|
|
22
22
|
static installDependencies = ({ directory, selectedDevices, config, }) => {
|
|
23
23
|
const devDependencies = InstallHelper.getDependenciesList(selectedDevices, config);
|
|
24
24
|
return new Promise((resolve, reject) => {
|
|
25
|
-
const npmInstall = spawn("npm", ["i", "--
|
|
25
|
+
const npmInstall = spawn("npm", ["i", "--silent"], { shell: true, cwd: directory });
|
|
26
26
|
npmInstall.on("close", (code) => {
|
|
27
27
|
if (code === 0) {
|
|
28
28
|
InstallHelper.installSingleDependency(devDependencies, directory)
|
|
@@ -53,7 +53,10 @@ class InstallHelper {
|
|
|
53
53
|
}
|
|
54
54
|
static installSingleDependency = (depName, directory) => {
|
|
55
55
|
return new Promise((resolveInstall, rejectInstall) => {
|
|
56
|
-
const npmInstall = spawn("npm", ["i", ...depName, "--
|
|
56
|
+
const npmInstall = spawn("npm", ["i", ...depName, "--save-dev", "--save-exact"], {
|
|
57
|
+
cwd: directory,
|
|
58
|
+
shell: true,
|
|
59
|
+
});
|
|
57
60
|
npmInstall.on("close", (code) => {
|
|
58
61
|
if (code === 0) {
|
|
59
62
|
resolveInstall();
|
|
@@ -24,6 +24,10 @@
|
|
|
24
24
|
"command.auth.login.description": "Login to Dana",
|
|
25
25
|
"command.auth.logout.description": "Logout from Dana",
|
|
26
26
|
"command.auth.login.option.org": "Organization to login/logout",
|
|
27
|
+
"command.auth.login.option.remote": "Allow connexion to dana authentication stack when working on remote server. Display login url",
|
|
28
|
+
"command.auth.login.option.port": "Provide a port for login server",
|
|
29
|
+
"command.auth.remoteMode": "You are in remote mode. Verify you are forwarding the right port to the host machine.",
|
|
30
|
+
"command.auth.accessBrowserUrl": "You can complete the operation by accessing the following url in the browser.",
|
|
27
31
|
"command.auth.status.description": "Get login status",
|
|
28
32
|
"command.auth.get-packages-token.description": "Get token for packages repository",
|
|
29
33
|
"command.scrollView.description": "Add a scrollView of rails",
|
|
@@ -47,7 +51,7 @@
|
|
|
47
51
|
"setup.ok": "Configuration ok",
|
|
48
52
|
"setup.ko": "Prerequisite not met",
|
|
49
53
|
"device.unavailable": "Enhance your experience by adding device(s) to your subscription:",
|
|
50
|
-
"device.selection": "Press
|
|
54
|
+
"device.selection": "Press SPACE KEY to select additional device(s).",
|
|
51
55
|
"renderer.selection": "Select AT LEAST one renderer for",
|
|
52
56
|
"input.name": "What is your project's name ?",
|
|
53
57
|
"input.aws.error": "You need to have an AWS account.\nSee:https://dana-framework.com/guides/getting-started#configure-aws-connection",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ANDROIDTV, TIZEN, TVOS, WEBOS } from "../const/deviceConst.js";
|
|
2
|
-
import { AndroidConfig, AndroidDevice, TizenConf, WebosConf, WebosDevice, TvosConf } from "../../commands/addDevice/deviceConfig/configTypes.js";
|
|
1
|
+
import { ANDROIDTV, TITANOS, TIZEN, TVOS, VIDAA, WEBOS } from "../const/deviceConst.js";
|
|
2
|
+
import { AndroidConfig, AndroidDevice, TizenConf, WebosConf, WebosDevice, TvosConf, VidaaConf, TitanosConf } from "../../commands/addDevice/deviceConfig/configTypes.js";
|
|
3
3
|
interface Task {
|
|
4
4
|
title: string;
|
|
5
5
|
task: () => Promise<string>;
|
|
@@ -17,6 +17,8 @@ interface Config {
|
|
|
17
17
|
[ANDROIDTV]?: AndroidConfig;
|
|
18
18
|
[WEBOS]?: WebosConf;
|
|
19
19
|
[TIZEN]?: TizenConf;
|
|
20
|
+
[VIDAA]?: VidaaConf;
|
|
21
|
+
[TITANOS]?: TitanosConf;
|
|
20
22
|
}
|
|
21
23
|
interface DeviceConf {
|
|
22
24
|
device?: WebosDevice | AndroidDevice;
|
|
@@ -9,4 +9,4 @@
|
|
|
9
9
|
* This software MAY NOT be used, modified or rewritten without prior written permission from Wiztivi.
|
|
10
10
|
*
|
|
11
11
|
*/
|
|
12
|
-
import { ANDROIDTV, TIZEN, TVOS, WEBOS } from "../const/deviceConst.js";
|
|
12
|
+
import { ANDROIDTV, TITANOS, TIZEN, TVOS, VIDAA, WEBOS } from "../const/deviceConst.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wiztivi/dana-cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.14-beta.2",
|
|
4
4
|
"description": "Dana create app CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./dist/index.js",
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
"README.md"
|
|
27
27
|
],
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@aws-sdk/client-codeartifact": "3.
|
|
29
|
+
"@aws-sdk/client-codeartifact": "3.940.0",
|
|
30
30
|
"@clack/prompts": "0.11.0",
|
|
31
|
-
"@wiztivi/dana-templates": "^0.0.
|
|
31
|
+
"@wiztivi/dana-templates": "^0.0.14-beta.2",
|
|
32
32
|
"child_process": "1.0.x",
|
|
33
33
|
"command-exists": "1.2.9",
|
|
34
34
|
"commander": "14.0.x",
|