@wiztivi/dana-cli 0.0.11 → 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.
@@ -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="-cm --custom"
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("-cm, --custom", translation["command.component.customization"])
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("-cm, --custom", translation["command.component.customization"])
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("-cm, --custom", translation["command.component.customization"])
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);
@@ -86,6 +86,5 @@ const addDevice = async () => {
86
86
  }
87
87
  spinner.stop(translation["task.installation.end"]);
88
88
  prompts.outro("Everything is ready ! Don't forget to commit your change.");
89
- return;
90
89
  };
91
90
  export default addDevice;
@@ -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 { maxSatisfying } from "semver";
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
- let wtvAndroidVersion;
84
- try {
85
- const credentials = CredentialsHelper.get();
86
- const client = createCodeArtifactClient(credentials.aws);
87
- const command = new ListPackageVersionsCommand({
88
- package: "v8-runtime",
89
- domain: DOMAIN,
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
- export { AndroidDevice, AndroidConfig, TizenConf, WebosConf, WebosDevice };
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 Promise.resolve({
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;
@@ -20,4 +20,8 @@ export declare class AuthenticationManager {
20
20
  token: string;
21
21
  expiration?: Date;
22
22
  }>;
23
+ static loginGradle(organization: string, credentials: AwsCredentials): Promise<{
24
+ token: string;
25
+ expiration?: Date;
26
+ }>;
23
27
  }
@@ -3,10 +3,12 @@ import express from "express";
3
3
  import { CredentialsHelper } from "./helper/CredentialsHelper.js";
4
4
  import open from "open";
5
5
  import jwt from "jsonwebtoken";
6
- import { createCodeArtifactClient, getRepositoryEndpoint } from "./helper/CodeArtifactHelper.js";
6
+ import { createCodeArtifactClient, formatRepositoryString, getRepositoryEndpoint, } from "./helper/CodeArtifactHelper.js";
7
7
  import { GetAuthorizationTokenCommand } from "@aws-sdk/client-codeartifact";
8
8
  import { DOMAIN, DOMAIN_OWNER } from "./authentConst.js";
9
9
  import { execSync } from "node:child_process";
10
+ import fs from "node:fs";
11
+ import path from "node:path";
10
12
  export class AuthenticationManager {
11
13
  static getAPIURL(organization) {
12
14
  return `https://api.${organization}.dana-framework.com`; // Or http://localhost:3001
@@ -104,4 +106,45 @@ export class AuthenticationManager {
104
106
  expiration,
105
107
  };
106
108
  }
109
+ static async loginGradle(organization, credentials) {
110
+ const client = createCodeArtifactClient(credentials);
111
+ const tokenCommand = new GetAuthorizationTokenCommand({
112
+ domain: DOMAIN,
113
+ domainOwner: DOMAIN_OWNER,
114
+ });
115
+ const { authorizationToken, expiration } = await client.send(tokenCommand);
116
+ if (!authorizationToken) {
117
+ throw new Error("Authorization token not found");
118
+ }
119
+ const repository = formatRepositoryString(organization);
120
+ if (!fs.existsSync(path.join(process.env.HOME, ".gradle"))) {
121
+ fs.mkdirSync(path.join(process.env.HOME, ".gradle"));
122
+ }
123
+ const gradlePropertiesFilePath = path.join(process.env.HOME, ".gradle", "gradle.properties");
124
+ const gradlePropertiesFile = fs.existsSync(gradlePropertiesFilePath)
125
+ ? fs.readFileSync(gradlePropertiesFilePath, { encoding: "utf-8" })
126
+ : "";
127
+ const key = `dana.${repository}.token`;
128
+ let replaced = false;
129
+ let lastEmptyLine = 0;
130
+ const lines = gradlePropertiesFile.split("\n").reduce((lines, line, index) => {
131
+ if (line.startsWith(key + "=")) {
132
+ line = `${key}=${authorizationToken}`;
133
+ replaced = true;
134
+ }
135
+ else if (line === "" && index > lastEmptyLine) {
136
+ lastEmptyLine = index;
137
+ }
138
+ lines.push(line);
139
+ return lines;
140
+ }, []);
141
+ if (!replaced) {
142
+ lines.splice(lastEmptyLine, 0, `${key}=${authorizationToken}`);
143
+ }
144
+ fs.writeFileSync(gradlePropertiesFilePath, lines.join("\n"));
145
+ return {
146
+ token: authorizationToken,
147
+ expiration,
148
+ };
149
+ }
107
150
  }
@@ -14,6 +14,7 @@ const login = async ({ org }) => {
14
14
  const validCredentials = await AuthenticationManager.login(credentials.org);
15
15
  prompts.outro(colors.green("✓") + ` Login successful`);
16
16
  const npmToken = await AuthenticationManager.loginNPM(credentials.org, validCredentials.aws);
17
+ await AuthenticationManager.loginGradle(credentials.org, validCredentials.aws);
17
18
  let stepText = "Successfully logged in to npm repository.";
18
19
  if (npmToken.expiration) {
19
20
  stepText += `\nLogin expires in 12 hours at: ${npmToken.expiration.toLocaleString()}`;
@@ -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 = 20;
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 !")
@@ -19,6 +19,7 @@ declare class CreateFileHelper {
19
19
  selectedDevices: string[];
20
20
  directory: string;
21
21
  }) => Promise<string>;
22
+ private static runGruntCommand;
22
23
  /**
23
24
  * Execute grunt tasks
24
25
  */
@@ -11,9 +11,8 @@
11
11
  */
12
12
  import fs from "node:fs";
13
13
  import path from "node:path";
14
- import { execSync } from "node:child_process";
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
- let gruntOptions = `--appUrl="${registryAccount}" --organization="${credentials.org}" `;
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
- gruntOptions += `--${option}="${config.androidtv?.device[option]}" `;
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
- execSync(`cd ${directory} && grunt copyProjectAndroidTv ${gruntOptions.trim()}`);
85
+ const args = ["copyProjectTvos", `--jscVersion=${config.tvos?.jscVersion}`];
86
+ await CreateFileHelper.runGruntCommand(args, directory);
70
87
  }
71
- catch (e) {
72
- const message = e instanceof Error ? e.message : translation["error.common.start.message"];
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";
@@ -20,6 +20,7 @@ declare class InstallHelper {
20
20
  * Install grunt globally
21
21
  */
22
22
  static readonly installGrunt: () => Promise<string>;
23
+ private static runGitCommand;
23
24
  /**
24
25
  * Initialize git repository and do first commit
25
26
  * @returns {Promise<String>}
@@ -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
- exec(`npm i --prefix ${directory} --silent`, {}, (async () => {
26
- try {
27
- const dependenciesString = devDependencies.join(" ").trim();
28
- await InstallHelper.installSingleDependency(dependenciesString, directory);
29
- InstallHelper.updateSemver(directory);
30
- resolve("Dependencies updated");
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
- catch (error) {
33
- reject(new Error("Dependencies update failed : " +
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
- exec(`npm i ${depName} --prefix '${directory}' --save-dev --save-exact`, {}, (error) => {
49
- if (error) {
50
- rejectInstall(new Error(`FAILURE during ${depName} dependency installation ${error.message}`));
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
- resolveInstall();
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
- return new Promise((resolve, reject) => {
104
- try {
105
- exec(`cd ${directory} && git init && git add -A && git commit -m "Initial commit from Create DANA App"`, { maxBuffer: 1024 * 1024 * 64 }, // 64MB
106
- (error) => {
107
- if (error) {
108
- reject(error);
109
- }
110
- else {
111
- resolve("Git initialised");
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]?: never;
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.11",
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": "^3.859.0",
30
- "@clack/prompts": "0.10.0",
31
- "@wiztivi/dana-templates": "^0.0.11",
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": "11.1.x",
35
- "express": "^5.1.0",
36
- "get-port": "^7.1.0",
37
- "grunt-cli": "1.4.x",
38
- "handlebars": "^4.7.8",
39
- "jsonwebtoken": "^9.0.2",
40
- "open": "^10.1.2",
41
- "picocolors": "1.0.x",
42
- "url": "^0.11.4",
43
- "semver": "^7.7.1",
44
- "semver-ts": "^1.0.3"
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": "^5.0.3",
48
- "@types/jsonwebtoken": "^9.0.10"
47
+ "@types/express": "5.0.5",
48
+ "@types/jsonwebtoken": "9.0.10"
49
49
  }
50
50
  }