@wiztivi/dana-cli 0.0.12 → 0.0.13
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/dana_completion.sh +1 -1
- package/dist/commands/addComponent/addMenu/addMenuDefinition.js +1 -1
- package/dist/commands/addComponent/addRail/addRailDefinition.js +1 -1
- package/dist/commands/addComponent/addScrollView/addScrollViewDefinition.js +1 -1
- package/dist/commands/addDevice/add-device.js +0 -1
- package/dist/commands/addDevice/deviceConfig/androidtvConfig.js +8 -34
- package/dist/commands/addDevice/deviceConfig/configTypes.d.ts +4 -1
- package/dist/commands/addDevice/deviceConfig/tizenConfig.js +3 -2
- package/dist/commands/addDevice/deviceConfig/tvosConfig.d.ts +6 -1
- package/dist/commands/addDevice/deviceConfig/tvosConfig.js +19 -1
- package/dist/commands/addDevice/helper/addDeviceHelper.d.ts +7 -0
- package/dist/commands/addDevice/helper/addDeviceHelper.js +35 -0
- package/dist/commands/createApp/helpers/CreateAppHelper.d.ts +2 -1
- package/dist/commands/createApp/helpers/SetupChecker.js +1 -1
- package/dist/common/helpers/CreateFileHelper.d.ts +1 -0
- package/dist/common/helpers/CreateFileHelper.js +25 -9
- package/dist/common/helpers/InstallHelper.d.ts +1 -0
- package/dist/common/helpers/InstallHelper.js +53 -33
- package/dist/common/types/helperTypes.d.ts +2 -2
- package/package.json +17 -17
package/dana_completion.sh
CHANGED
|
@@ -23,7 +23,7 @@ direction_opts="-d --direction"
|
|
|
23
23
|
navigation_opts="-n --navigation"
|
|
24
24
|
cyclic_opts="-c --cyclic"
|
|
25
25
|
margin_opts="-m --itemMargin"
|
|
26
|
-
custom_opts="
|
|
26
|
+
custom_opts="--cm --custom"
|
|
27
27
|
item_view_opts="-i --itemView"
|
|
28
28
|
org_opts="-o --org"
|
|
29
29
|
device_opts="-d --device"
|
|
@@ -6,7 +6,7 @@ const addMenuDefinition = () => {
|
|
|
6
6
|
command
|
|
7
7
|
.description(translation["command.menu.description"])
|
|
8
8
|
.argument("[name]", translation["command.component.name"])
|
|
9
|
-
.option("
|
|
9
|
+
.option("--cm, --custom", translation["command.component.customization"])
|
|
10
10
|
.option("-i, --itemView <itemView>", translation["command.menu.option.itemView"])
|
|
11
11
|
.option("-m, --itemMargin <itemMargin>", translation["command.menu.option.itemMargin"])
|
|
12
12
|
.option("-d, --direction <direction>", translation["command.rail.option.direction"])
|
|
@@ -8,7 +8,7 @@ const addRailDefinition = () => {
|
|
|
8
8
|
command
|
|
9
9
|
.description(translation["command.rail.description"])
|
|
10
10
|
.argument("[name]", translation["command.component.name"])
|
|
11
|
-
.option("
|
|
11
|
+
.option("--cm, --custom", translation["command.component.customization"])
|
|
12
12
|
.option("-n, --navigation <navigation>", translation["command.rail.option.navigation"])
|
|
13
13
|
.option("-d, --direction <direction>", translation["command.rail.option.direction"])
|
|
14
14
|
.option("-c, --cyclic", translation["command.rail.option.cyclic"])
|
|
@@ -5,7 +5,7 @@ const addScrollViewDefinition = () => {
|
|
|
5
5
|
return new Command("add-scrollView")
|
|
6
6
|
.description(translation["command.scrollView.description"])
|
|
7
7
|
.argument("[name]", translation["command.component.name"])
|
|
8
|
-
.option("
|
|
8
|
+
.option("--cm, --custom", translation["command.component.customization"])
|
|
9
9
|
.option("-i, --itemView <itemView>", translation["command.menu.option.itemView"])
|
|
10
10
|
.option("-m, --itemMargin <itemMargin>", translation["command.menu.option.itemMargin"])
|
|
11
11
|
.action(addScrollView);
|
|
@@ -16,13 +16,7 @@ import ComponentHelper from "../../addComponent/helper/ComponentHelper.js";
|
|
|
16
16
|
import * as prompts from "@clack/prompts";
|
|
17
17
|
import colors from "picocolors";
|
|
18
18
|
import { clean } from "semver-ts";
|
|
19
|
-
import {
|
|
20
|
-
import { validInputLength, validAppId, validAppVersion, validAppVersionCode, } from "../../../common/helpers/InputValidator.js";
|
|
21
|
-
import translation from "../../../common/translation/translation.js";
|
|
22
|
-
import { CredentialsHelper } from "../../authentication/helper/CredentialsHelper.js";
|
|
23
|
-
import { ListPackageVersionsCommand } from "@aws-sdk/client-codeartifact";
|
|
24
|
-
import { createCodeArtifactClient } from "../../authentication/helper/CodeArtifactHelper.js";
|
|
25
|
-
import { DOMAIN, DOMAIN_OWNER } from "../../authentication/authentConst.js";
|
|
19
|
+
import { validAppId, validAppVersion, validAppVersionCode, validInputLength, } from "../../../common/helpers/InputValidator.js";
|
|
26
20
|
import addDeviceHelper from "../helper/addDeviceHelper.js";
|
|
27
21
|
const AndroidtvConfig = class extends DeviceConfig {
|
|
28
22
|
/**
|
|
@@ -80,33 +74,13 @@ const AndroidtvConfig = class extends DeviceConfig {
|
|
|
80
74
|
* Call aws to get latest android version
|
|
81
75
|
*/
|
|
82
76
|
static _getWtvAndroidVersion = async () => {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
domainOwner: DOMAIN_OWNER,
|
|
91
|
-
repository: "internal-android-repository",
|
|
92
|
-
format: "maven",
|
|
93
|
-
namespace: "com.dana.androidtv",
|
|
94
|
-
});
|
|
95
|
-
const response = await client.send(command);
|
|
96
|
-
const versionListArray = response.versions?.map((v) => v.version).filter(Boolean);
|
|
97
|
-
// need to use semver-ts to avoid this error
|
|
98
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-assignment
|
|
99
|
-
wtvAndroidVersion = maxSatisfying(versionListArray, "*");
|
|
100
|
-
if (wtvAndroidVersion) {
|
|
101
|
-
return wtvAndroidVersion;
|
|
102
|
-
}
|
|
103
|
-
else {
|
|
104
|
-
throw new Error(translation["command.device.version.error"]);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
catch (error) {
|
|
108
|
-
throw new Error(error.message ?? translation["error.common.start.message"]);
|
|
109
|
-
}
|
|
77
|
+
const requestParams = {
|
|
78
|
+
packageName: "v8-runtime",
|
|
79
|
+
repository: "internal-android-repository",
|
|
80
|
+
format: "maven",
|
|
81
|
+
namespace: "com.dana.androidtv",
|
|
82
|
+
};
|
|
83
|
+
return await addDeviceHelper.getLatestPackageVersion(requestParams);
|
|
110
84
|
};
|
|
111
85
|
static getConfig = async () => {
|
|
112
86
|
prompts.log.info(colors.bold("Let's configure Android !"));
|
|
@@ -24,4 +24,7 @@ interface WebosDevice {
|
|
|
24
24
|
largeIcon: string;
|
|
25
25
|
disableBackHistoryAPI: boolean;
|
|
26
26
|
}
|
|
27
|
-
|
|
27
|
+
interface TvosConf {
|
|
28
|
+
jscVersion: string;
|
|
29
|
+
}
|
|
30
|
+
export { AndroidDevice, AndroidConfig, TizenConf, WebosConf, WebosDevice, TvosConf };
|
|
@@ -34,10 +34,11 @@ const TizenConfig = class extends DeviceConfig {
|
|
|
34
34
|
},
|
|
35
35
|
},
|
|
36
36
|
};
|
|
37
|
+
// eslint-disable-next-line @typescript-eslint/require-await
|
|
37
38
|
static getConfig = async () => {
|
|
38
|
-
return
|
|
39
|
+
return {
|
|
39
40
|
renderers: [LIGHTNING],
|
|
40
|
-
}
|
|
41
|
+
};
|
|
41
42
|
};
|
|
42
43
|
static setConfig = ({ directory, config }) => {
|
|
43
44
|
const filePath = path.join(directory, "profiles", "app.config.tizen.json");
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { TvosConf } from "./configTypes.js";
|
|
1
2
|
declare const TvosConfig: {
|
|
2
3
|
new (): {};
|
|
3
4
|
/**
|
|
@@ -6,8 +7,12 @@ declare const TvosConfig: {
|
|
|
6
7
|
readonly setConfig: ({ directory }: {
|
|
7
8
|
directory: string;
|
|
8
9
|
}) => Promise<string>;
|
|
10
|
+
readonly getConfig: () => Promise<TvosConf>;
|
|
11
|
+
/**
|
|
12
|
+
* Call aws to get latest jsc version
|
|
13
|
+
*/
|
|
14
|
+
readonly getJscVersion: () => Promise<string>;
|
|
9
15
|
readonly appConfig: {};
|
|
10
|
-
getConfig(..._: string[]): Promise<unknown>;
|
|
11
16
|
updateProfileJsonWithRenderers(jsonData: Record<string, unknown>, renderers: string[]): object;
|
|
12
17
|
};
|
|
13
18
|
export default TvosConfig;
|
|
@@ -12,16 +12,34 @@
|
|
|
12
12
|
import fs from "node:fs";
|
|
13
13
|
import DeviceConfig from "./deviceConfig.js";
|
|
14
14
|
import path from "node:path";
|
|
15
|
+
import addDeviceHelper from "../helper/addDeviceHelper.js";
|
|
15
16
|
const TvosConfig = class extends DeviceConfig {
|
|
16
17
|
/**
|
|
17
18
|
* Set config for TVOS
|
|
18
19
|
*/
|
|
19
|
-
static setConfig = ({ directory }) => {
|
|
20
|
+
static setConfig = async ({ directory }) => {
|
|
20
21
|
const update = `\n# For TVOS\napp_tvos/build \napp_tvos/libs`;
|
|
21
22
|
const filePath = path.join(directory, ".gitignore");
|
|
22
23
|
const data = fs.readFileSync(filePath, { encoding: "utf8" });
|
|
23
24
|
fs.writeFileSync(filePath, data + update);
|
|
24
25
|
return Promise.resolve(".gitignore updated");
|
|
25
26
|
};
|
|
27
|
+
static getConfig = async () => {
|
|
28
|
+
return {
|
|
29
|
+
jscVersion: await TvosConfig.getJscVersion(),
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Call aws to get latest jsc version
|
|
34
|
+
*/
|
|
35
|
+
static getJscVersion = async () => {
|
|
36
|
+
const requestParams = {
|
|
37
|
+
packageName: "jscmodule",
|
|
38
|
+
repository: "internal-apple-repository",
|
|
39
|
+
format: "swift",
|
|
40
|
+
namespace: "dana",
|
|
41
|
+
};
|
|
42
|
+
return await addDeviceHelper.getLatestPackageVersion(requestParams);
|
|
43
|
+
};
|
|
26
44
|
};
|
|
27
45
|
export default TvosConfig;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PackageFormat } from "@aws-sdk/client-codeartifact";
|
|
1
2
|
export interface PromptFactoryParams {
|
|
2
3
|
errorMessage?: string;
|
|
3
4
|
promptMessage: string;
|
|
@@ -21,5 +22,11 @@ declare const AddDeviceHelper: {
|
|
|
21
22
|
*/
|
|
22
23
|
readonly getAppIcon: () => Promise<string>;
|
|
23
24
|
readonly promptTextFactory: ({ errorMessage, promptMessage, validationFunction, placeholder, initialValue, }: PromptFactoryParams) => Promise<string>;
|
|
25
|
+
readonly getLatestPackageVersion: ({ packageName, repository, format, namespace, }: {
|
|
26
|
+
packageName: string;
|
|
27
|
+
repository: string;
|
|
28
|
+
format: PackageFormat;
|
|
29
|
+
namespace: string;
|
|
30
|
+
}) => Promise<string>;
|
|
24
31
|
};
|
|
25
32
|
export default AddDeviceHelper;
|
|
@@ -4,6 +4,12 @@ import path from "node:path";
|
|
|
4
4
|
import * as prompts from "@clack/prompts";
|
|
5
5
|
import { DEFAULT_IMAGE_URL } from "../../createApp/const/setupConst.js";
|
|
6
6
|
import ComponentHelper from "../../addComponent/helper/ComponentHelper.js";
|
|
7
|
+
import { CredentialsHelper } from "../../authentication/helper/CredentialsHelper.js";
|
|
8
|
+
import { createCodeArtifactClient } from "../../authentication/helper/CodeArtifactHelper.js";
|
|
9
|
+
import { ListPackageVersionsCommand } from "@aws-sdk/client-codeartifact";
|
|
10
|
+
import { DOMAIN, DOMAIN_OWNER } from "../../authentication/authentConst.js";
|
|
11
|
+
import translation from "../../../common/translation/translation.js";
|
|
12
|
+
import { maxSatisfying } from "semver";
|
|
7
13
|
const AddDeviceHelper = class {
|
|
8
14
|
/**
|
|
9
15
|
* clean on error
|
|
@@ -49,5 +55,34 @@ const AddDeviceHelper = class {
|
|
|
49
55
|
ComponentHelper.handleCancellation(result);
|
|
50
56
|
return result;
|
|
51
57
|
};
|
|
58
|
+
static getLatestPackageVersion = async ({ packageName, repository, format, namespace, }) => {
|
|
59
|
+
let packageVersion;
|
|
60
|
+
try {
|
|
61
|
+
const credentials = CredentialsHelper.get();
|
|
62
|
+
const client = createCodeArtifactClient(credentials.aws);
|
|
63
|
+
const command = new ListPackageVersionsCommand({
|
|
64
|
+
package: packageName,
|
|
65
|
+
domain: DOMAIN,
|
|
66
|
+
domainOwner: DOMAIN_OWNER,
|
|
67
|
+
repository,
|
|
68
|
+
format,
|
|
69
|
+
namespace,
|
|
70
|
+
});
|
|
71
|
+
const response = await client.send(command);
|
|
72
|
+
const versionListArray = response.versions?.map((v) => v.version).filter(Boolean);
|
|
73
|
+
// need to use semver-ts to avoid this error
|
|
74
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-assignment
|
|
75
|
+
packageVersion = maxSatisfying(versionListArray, "*");
|
|
76
|
+
if (packageVersion) {
|
|
77
|
+
return packageVersion;
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
throw new Error(translation["command.device.version.error"]);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
catch (error) {
|
|
84
|
+
throw new Error(error.message ?? translation["error.common.start.message"]);
|
|
85
|
+
}
|
|
86
|
+
};
|
|
52
87
|
};
|
|
53
88
|
export default AddDeviceHelper;
|
|
@@ -84,8 +84,9 @@ declare const CreateAppHelper: {
|
|
|
84
84
|
readonly setConfig: ({ directory }: {
|
|
85
85
|
directory: string;
|
|
86
86
|
}) => Promise<string>;
|
|
87
|
+
readonly getConfig: () => Promise<import("../../addDevice/deviceConfig/configTypes.js").TvosConf>;
|
|
88
|
+
readonly getJscVersion: () => Promise<string>;
|
|
87
89
|
readonly appConfig: {};
|
|
88
|
-
getConfig(..._: string[]): Promise<unknown>;
|
|
89
90
|
updateProfileJsonWithRenderers(jsonData: Record<string, unknown>, renderers: string[]): object;
|
|
90
91
|
} | {
|
|
91
92
|
new (): {};
|
|
@@ -52,7 +52,7 @@ class SetupChecker {
|
|
|
52
52
|
* @returns {Promise}
|
|
53
53
|
*/
|
|
54
54
|
static async validateNodeVersion() {
|
|
55
|
-
const minimalNodeVersion =
|
|
55
|
+
const minimalNodeVersion = 22;
|
|
56
56
|
const currentVersion = Number.parseInt(process.version.slice(1).split(".")[0], 10);
|
|
57
57
|
return currentVersion >= minimalNodeVersion
|
|
58
58
|
? Promise.resolve("Node version ok !")
|
|
@@ -11,9 +11,8 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import fs from "node:fs";
|
|
13
13
|
import path from "node:path";
|
|
14
|
-
import {
|
|
15
|
-
import { ANDROIDTV } from "../const/deviceConst.js";
|
|
16
|
-
import translation from "../translation/translation.js";
|
|
14
|
+
import { spawnSync } from "node:child_process";
|
|
15
|
+
import { ANDROIDTV, TVOS } from "../const/deviceConst.js";
|
|
17
16
|
import { CredentialsHelper } from "../../commands/authentication/helper/CredentialsHelper.js";
|
|
18
17
|
import { getRepositoryEndpoint } from "../../commands/authentication/helper/CodeArtifactHelper.js";
|
|
19
18
|
import ComponentHelper from "../../commands/addComponent/helper/ComponentHelper.js";
|
|
@@ -49,6 +48,15 @@ class CreateFileHelper {
|
|
|
49
48
|
}
|
|
50
49
|
return Promise.resolve("Config file(s) copied");
|
|
51
50
|
};
|
|
51
|
+
static runGruntCommand(args, directory) {
|
|
52
|
+
const gruntAndroid = spawnSync("grunt", args, { cwd: directory });
|
|
53
|
+
if (gruntAndroid.status === 0) {
|
|
54
|
+
return Promise.resolve("Grunt task(s) done");
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
throw new Error("Grunt task(s) failed");
|
|
58
|
+
}
|
|
59
|
+
}
|
|
52
60
|
/**
|
|
53
61
|
* Execute grunt tasks
|
|
54
62
|
*/
|
|
@@ -60,17 +68,25 @@ class CreateFileHelper {
|
|
|
60
68
|
credentials: credentials?.aws,
|
|
61
69
|
format: "maven",
|
|
62
70
|
});
|
|
63
|
-
|
|
71
|
+
const args = ["copyProjectAndroidTv", `--appUrl=${registryAccount}`, `--organization=${credentials.org}`];
|
|
64
72
|
const optionsToAdd = ["appId", "appName", "appVersion", "appVersionCode", "wtvAndroidVersion"];
|
|
65
73
|
for (const option of optionsToAdd) {
|
|
66
|
-
|
|
74
|
+
args.push(`--${option}=${config.androidtv?.device[option]}`);
|
|
75
|
+
}
|
|
76
|
+
try {
|
|
77
|
+
await CreateFileHelper.runGruntCommand(args, directory);
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
throw new Error(`Failed to execute grunt tasks: ${error.message}`);
|
|
67
81
|
}
|
|
82
|
+
}
|
|
83
|
+
if (selectedDevices.includes(TVOS)) {
|
|
68
84
|
try {
|
|
69
|
-
|
|
85
|
+
const args = ["copyProjectTvos", `--jscVersion=${config.tvos?.jscVersion}`];
|
|
86
|
+
await CreateFileHelper.runGruntCommand(args, directory);
|
|
70
87
|
}
|
|
71
|
-
catch (
|
|
72
|
-
|
|
73
|
-
throw new Error(message);
|
|
88
|
+
catch (error) {
|
|
89
|
+
throw new Error(`Failed to execute grunt tasks: ${error.message}`);
|
|
74
90
|
}
|
|
75
91
|
}
|
|
76
92
|
return "Grunt task(s) done";
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* This software MAY NOT be used, modified or rewritten without prior written permission from Wiztivi.
|
|
10
10
|
*
|
|
11
11
|
*/
|
|
12
|
-
import { exec } from "node:child_process";
|
|
12
|
+
import { exec, spawn } from "node:child_process";
|
|
13
13
|
import { BASIC_DEPENDENCIES, PLATFORM_CONFIG } from "../const/deviceConst.js";
|
|
14
14
|
import translation from "../translation/translation.js";
|
|
15
15
|
import path from "node:path";
|
|
@@ -22,18 +22,26 @@ 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
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
const npmInstall = spawn("npm", ["i", "--prefix", directory, "--silent"]);
|
|
26
|
+
npmInstall.on("close", (code) => {
|
|
27
|
+
if (code === 0) {
|
|
28
|
+
InstallHelper.installSingleDependency(devDependencies, directory)
|
|
29
|
+
.then(() => {
|
|
30
|
+
InstallHelper.updateSemver(directory);
|
|
31
|
+
resolve("Dependencies updated");
|
|
32
|
+
})
|
|
33
|
+
.catch((error) => {
|
|
34
|
+
reject(new Error("Dependencies update failed : " +
|
|
35
|
+
(error.message ?? translation["error.common.start.message"])));
|
|
36
|
+
});
|
|
31
37
|
}
|
|
32
|
-
|
|
33
|
-
reject(new Error("
|
|
34
|
-
(error.message ?? translation["error.common.start.message"])));
|
|
38
|
+
else {
|
|
39
|
+
reject(new Error("FAILURE during dependencies installation"));
|
|
35
40
|
}
|
|
36
|
-
})
|
|
41
|
+
});
|
|
42
|
+
npmInstall.on("error", (data) => {
|
|
43
|
+
reject(new Error(`FAILURE during dependency installation : ${data}`));
|
|
44
|
+
});
|
|
37
45
|
});
|
|
38
46
|
};
|
|
39
47
|
static getDependenciesList(selectedDevices, config) {
|
|
@@ -45,14 +53,18 @@ class InstallHelper {
|
|
|
45
53
|
}
|
|
46
54
|
static installSingleDependency = (depName, directory) => {
|
|
47
55
|
return new Promise((resolveInstall, rejectInstall) => {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
56
|
+
const npmInstall = spawn("npm", ["i", ...depName, "--prefix", directory, "--save-dev", "--save-exact"]);
|
|
57
|
+
npmInstall.on("close", (code) => {
|
|
58
|
+
if (code === 0) {
|
|
59
|
+
resolveInstall();
|
|
51
60
|
}
|
|
52
61
|
else {
|
|
53
|
-
|
|
62
|
+
rejectInstall(new Error(`FAILURE during dependency installation`));
|
|
54
63
|
}
|
|
55
64
|
});
|
|
65
|
+
npmInstall.on("error", (error) => {
|
|
66
|
+
rejectInstall(new Error(`FAILURE during dependency installation : ${error.message}`));
|
|
67
|
+
});
|
|
56
68
|
});
|
|
57
69
|
};
|
|
58
70
|
static updateSemver = (directory) => {
|
|
@@ -95,28 +107,36 @@ class InstallHelper {
|
|
|
95
107
|
});
|
|
96
108
|
});
|
|
97
109
|
};
|
|
110
|
+
static runGitCommand(args, directory) {
|
|
111
|
+
return new Promise((resolve, reject) => {
|
|
112
|
+
const gitProcess = spawn("git", args, { cwd: directory });
|
|
113
|
+
gitProcess.on("close", (code) => {
|
|
114
|
+
if (code === 0) {
|
|
115
|
+
resolve();
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
reject(new Error(`Git ${args[0]} failed`));
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
gitProcess.on("error", (error) => {
|
|
122
|
+
reject(new Error(`Git ${args[0]} failed: ${error.message}`));
|
|
123
|
+
});
|
|
124
|
+
});
|
|
125
|
+
}
|
|
98
126
|
/**
|
|
99
127
|
* Initialize git repository and do first commit
|
|
100
128
|
* @returns {Promise<String>}
|
|
101
129
|
*/
|
|
102
|
-
static initGit = function ({ directory }) {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
catch (e) {
|
|
116
|
-
const message = e instanceof Error ? e.message : translation["error.common.start.message"];
|
|
117
|
-
reject(new Error("Git hasn't been initialised" + message));
|
|
118
|
-
}
|
|
119
|
-
});
|
|
130
|
+
static initGit = async function ({ directory }) {
|
|
131
|
+
try {
|
|
132
|
+
await InstallHelper.runGitCommand(["init"], directory);
|
|
133
|
+
await InstallHelper.runGitCommand(["add", "."], directory);
|
|
134
|
+
await InstallHelper.runGitCommand(["commit", "-m", "Initial commit from Create DANA App"], directory);
|
|
135
|
+
return "Git initialized";
|
|
136
|
+
}
|
|
137
|
+
catch (e) {
|
|
138
|
+
throw new Error("Git hasn't been initialised: " + e.message);
|
|
139
|
+
}
|
|
120
140
|
};
|
|
121
141
|
}
|
|
122
142
|
export default InstallHelper;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ANDROIDTV, TIZEN, TVOS, WEBOS } from "../const/deviceConst.js";
|
|
2
|
-
import { AndroidConfig, AndroidDevice, TizenConf, WebosConf, WebosDevice } from "../../commands/addDevice/deviceConfig/configTypes.js";
|
|
2
|
+
import { AndroidConfig, AndroidDevice, TizenConf, WebosConf, WebosDevice, TvosConf } from "../../commands/addDevice/deviceConfig/configTypes.js";
|
|
3
3
|
interface Task {
|
|
4
4
|
title: string;
|
|
5
5
|
task: () => Promise<string>;
|
|
@@ -13,7 +13,7 @@ interface Data {
|
|
|
13
13
|
awsProfile: string;
|
|
14
14
|
}
|
|
15
15
|
interface Config {
|
|
16
|
-
[TVOS]?:
|
|
16
|
+
[TVOS]?: TvosConf;
|
|
17
17
|
[ANDROIDTV]?: AndroidConfig;
|
|
18
18
|
[WEBOS]?: WebosConf;
|
|
19
19
|
[TIZEN]?: TizenConf;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wiztivi/dana-cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.13",
|
|
4
4
|
"description": "Dana create app CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": "./dist/index.js",
|
|
@@ -26,25 +26,25 @@
|
|
|
26
26
|
"README.md"
|
|
27
27
|
],
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@aws-sdk/client-codeartifact": "
|
|
30
|
-
"@clack/prompts": "0.
|
|
31
|
-
"@wiztivi/dana-templates": "^0.0.
|
|
29
|
+
"@aws-sdk/client-codeartifact": "3.936.0",
|
|
30
|
+
"@clack/prompts": "0.11.0",
|
|
31
|
+
"@wiztivi/dana-templates": "^0.0.13",
|
|
32
32
|
"child_process": "1.0.x",
|
|
33
33
|
"command-exists": "1.2.9",
|
|
34
|
-
"commander": "
|
|
35
|
-
"express": "
|
|
36
|
-
"get-port": "
|
|
37
|
-
"grunt-cli": "1.
|
|
38
|
-
"handlebars": "
|
|
39
|
-
"jsonwebtoken": "
|
|
40
|
-
"open": "
|
|
41
|
-
"picocolors": "1.
|
|
42
|
-
"url": "
|
|
43
|
-
"semver": "
|
|
44
|
-
"semver-ts": "
|
|
34
|
+
"commander": "14.0.x",
|
|
35
|
+
"express": "5.1.0",
|
|
36
|
+
"get-port": "7.1.0",
|
|
37
|
+
"grunt-cli": "1.5.x",
|
|
38
|
+
"handlebars": "4.7.8",
|
|
39
|
+
"jsonwebtoken": "9.0.2",
|
|
40
|
+
"open": "11.0.0",
|
|
41
|
+
"picocolors": "1.1.x",
|
|
42
|
+
"url": "0.11.4",
|
|
43
|
+
"semver": "7.7.3",
|
|
44
|
+
"semver-ts": "1.0.3"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@types/express": "
|
|
48
|
-
"@types/jsonwebtoken": "
|
|
47
|
+
"@types/express": "5.0.5",
|
|
48
|
+
"@types/jsonwebtoken": "9.0.10"
|
|
49
49
|
}
|
|
50
50
|
}
|