@webos-tools/cli 3.0.0

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.
Files changed (177) hide show
  1. package/.eslintignore +1 -0
  2. package/.eslintrc.js +52 -0
  3. package/APIs.js +79 -0
  4. package/CHANGELOG.md +110 -0
  5. package/LICENSE +201 -0
  6. package/README.md +218 -0
  7. package/bin/ares-config.js +199 -0
  8. package/bin/ares-device-info.js +30 -0
  9. package/bin/ares-device.js +219 -0
  10. package/bin/ares-generate.js +270 -0
  11. package/bin/ares-inspect.js +179 -0
  12. package/bin/ares-install.js +223 -0
  13. package/bin/ares-launch.js +318 -0
  14. package/bin/ares-log.js +255 -0
  15. package/bin/ares-novacom.js +223 -0
  16. package/bin/ares-package.js +336 -0
  17. package/bin/ares-pull.js +156 -0
  18. package/bin/ares-push.js +155 -0
  19. package/bin/ares-server.js +174 -0
  20. package/bin/ares-setup-device.js +520 -0
  21. package/bin/ares-shell.js +132 -0
  22. package/bin/ares.js +166 -0
  23. package/files/conf/ares.json +49 -0
  24. package/files/conf/command-service.json +73 -0
  25. package/files/conf/config.json +22 -0
  26. package/files/conf/ipk.json +30 -0
  27. package/files/conf/novacom-devices.json +35 -0
  28. package/files/conf/query/query-app.json +14 -0
  29. package/files/conf/query/query-hosted.json +18 -0
  30. package/files/conf/query/query-package.json +10 -0
  31. package/files/conf/query/query-service.json +6 -0
  32. package/files/conf/sdk.json +8 -0
  33. package/files/conf/template.json +57 -0
  34. package/files/conf/webos_emul +27 -0
  35. package/files/conf-base/env/sdk-ose.json +8 -0
  36. package/files/conf-base/env/sdk-tv.json +8 -0
  37. package/files/conf-base/profile/config-ose.json +21 -0
  38. package/files/conf-base/profile/config-tv.json +22 -0
  39. package/files/conf-base/query/query-app.json +14 -0
  40. package/files/conf-base/query/query-hosted.json +18 -0
  41. package/files/conf-base/query/query-package.json +10 -0
  42. package/files/conf-base/query/query-service.json +6 -0
  43. package/files/conf-base/template-conf/ose-templates.json +67 -0
  44. package/files/conf-base/template-conf/tv-sdk-templates.json +57 -0
  45. package/files/help/ares-config.help +43 -0
  46. package/files/help/ares-device.help +94 -0
  47. package/files/help/ares-generate.help +65 -0
  48. package/files/help/ares-inspect.help +70 -0
  49. package/files/help/ares-install.help +90 -0
  50. package/files/help/ares-launch.help +100 -0
  51. package/files/help/ares-log-pmlogd.help +84 -0
  52. package/files/help/ares-log.help +101 -0
  53. package/files/help/ares-novacom.help +68 -0
  54. package/files/help/ares-package.help +101 -0
  55. package/files/help/ares-pull.help +38 -0
  56. package/files/help/ares-push.help +38 -0
  57. package/files/help/ares-server.help +39 -0
  58. package/files/help/ares-setup-device.help +75 -0
  59. package/files/help/ares-shell.help +42 -0
  60. package/files/help/ares.help +47 -0
  61. package/files/help/readme.help +23 -0
  62. package/files/schema/ApplicationDescription.schema +319 -0
  63. package/files/schema/NovacomDevices.schema +61 -0
  64. package/files/templates/ose-sdk-templates/appinfo/appinfo.json +10 -0
  65. package/files/templates/ose-sdk-templates/bootplate-web/index.html +88 -0
  66. package/files/templates/ose-sdk-templates/hosted-webapp/index.html +14 -0
  67. package/files/templates/ose-sdk-templates/icon/icon.png +0 -0
  68. package/files/templates/ose-sdk-templates/js-service/helloclient.js +31 -0
  69. package/files/templates/ose-sdk-templates/js-service/helloworld_webos_service.js +188 -0
  70. package/files/templates/ose-sdk-templates/qml-app/main.qml +68 -0
  71. package/files/templates/ose-sdk-templates/qmlappinfo/appinfo.json +10 -0
  72. package/files/templates/ose-sdk-templates/serviceinfo/package.json +11 -0
  73. package/files/templates/ose-sdk-templates/serviceinfo/services.json +8 -0
  74. package/files/templates/tv-sdk-templates/appinfo/appinfo.json +10 -0
  75. package/files/templates/tv-sdk-templates/bootplate-web/index.html +58 -0
  76. package/files/templates/tv-sdk-templates/bootplate-web/webOSTVjs-1.2.4/LICENSE-2.0.txt +202 -0
  77. package/files/templates/tv-sdk-templates/bootplate-web/webOSTVjs-1.2.4/webOSTV-dev.js +1 -0
  78. package/files/templates/tv-sdk-templates/bootplate-web/webOSTVjs-1.2.4/webOSTV.js +1 -0
  79. package/files/templates/tv-sdk-templates/hosted-webapp/index.html +14 -0
  80. package/files/templates/tv-sdk-templates/js-service/helloworld_service.js +37 -0
  81. package/files/templates/tv-sdk-templates/packageinfo/packageinfo.json +4 -0
  82. package/files/templates/tv-sdk-templates/serviceinfo/package.json +11 -0
  83. package/files/templates/tv-sdk-templates/serviceinfo/services.json +8 -0
  84. package/files/templates/tv-sdk-templates/webicon/icon.png +0 -0
  85. package/files/templates/tv-sdk-templates/webicon/largeIcon.png +0 -0
  86. package/lib/base/ares.html +40 -0
  87. package/lib/base/cli-appdata.js +289 -0
  88. package/lib/base/cli-control.js +44 -0
  89. package/lib/base/common-tools.js +29 -0
  90. package/lib/base/error-handler.js +265 -0
  91. package/lib/base/file-watcher.js +155 -0
  92. package/lib/base/help-format.js +147 -0
  93. package/lib/base/luna.js +178 -0
  94. package/lib/base/novacom.js +1191 -0
  95. package/lib/base/sdkenv.js +59 -0
  96. package/lib/base/server.js +137 -0
  97. package/lib/base/setup-device.js +324 -0
  98. package/lib/base/version-tools.js +79 -0
  99. package/lib/com.sdk.ares.hostedapp.ipk +0 -0
  100. package/lib/device.js +1419 -0
  101. package/lib/generator.js +377 -0
  102. package/lib/inspect.js +494 -0
  103. package/lib/install.js +463 -0
  104. package/lib/launch.js +605 -0
  105. package/lib/log.js +584 -0
  106. package/lib/package.js +2129 -0
  107. package/lib/pull.js +231 -0
  108. package/lib/pusher.js +210 -0
  109. package/lib/session.js +74 -0
  110. package/lib/shell.js +193 -0
  111. package/lib/tar-filter-pack.js +62 -0
  112. package/lib/util/copy.js +31 -0
  113. package/lib/util/createFileName.js +40 -0
  114. package/lib/util/eof.js +30 -0
  115. package/lib/util/json.js +63 -0
  116. package/lib/util/merge.js +14 -0
  117. package/lib/util/objclone.js +40 -0
  118. package/lib/util/spinner.js +37 -0
  119. package/npm-shrinkwrap.json +85 -0
  120. package/package.json +98 -0
  121. package/spec/helpers/reporter.js +65 -0
  122. package/spec/jsSpecs/apiTest/generator.spec.js +372 -0
  123. package/spec/jsSpecs/apiTest/inspector.spec.js +89 -0
  124. package/spec/jsSpecs/apiTest/installer.spec.js +67 -0
  125. package/spec/jsSpecs/apiTest/launcher.spec.js +150 -0
  126. package/spec/jsSpecs/apiTest/packager.spec.js +194 -0
  127. package/spec/jsSpecs/apiTest/puller.spec.js +101 -0
  128. package/spec/jsSpecs/apiTest/pusher.spec.js +103 -0
  129. package/spec/jsSpecs/apiTest/server.spec.js +115 -0
  130. package/spec/jsSpecs/apiTest/setupDevice.spec.js +93 -0
  131. package/spec/jsSpecs/apiTest/shell.spec.js +49 -0
  132. package/spec/jsSpecs/ares-config.spec.js +78 -0
  133. package/spec/jsSpecs/ares-device.spec.js +443 -0
  134. package/spec/jsSpecs/ares-generate.spec.js +397 -0
  135. package/spec/jsSpecs/ares-inspect.spec.js +252 -0
  136. package/spec/jsSpecs/ares-install.spec.js +150 -0
  137. package/spec/jsSpecs/ares-launch.spec.js +301 -0
  138. package/spec/jsSpecs/ares-log.spec.js +824 -0
  139. package/spec/jsSpecs/ares-novacom.spec.js +149 -0
  140. package/spec/jsSpecs/ares-package.spec.js +1211 -0
  141. package/spec/jsSpecs/ares-pull.spec.js +157 -0
  142. package/spec/jsSpecs/ares-push.spec.js +146 -0
  143. package/spec/jsSpecs/ares-server.spec.js +160 -0
  144. package/spec/jsSpecs/ares-setup-device.spec.js +281 -0
  145. package/spec/jsSpecs/ares-shell.spec.js +220 -0
  146. package/spec/jsSpecs/ares.spec.js +83 -0
  147. package/spec/jsSpecs/common-spec.js +169 -0
  148. package/spec/support/jasmine.json +22 -0
  149. package/spec/tempFiles/com.jasmine.native.app_0.0.1_arm.ipk +0 -0
  150. package/spec/tempFiles/com.jasmine.native.app_0.0.1_x86.ipk +0 -0
  151. package/spec/tempFiles/com.jasmine.web.app_0.0.1_all.ipk +0 -0
  152. package/spec/tempFiles/com.logtest.web.app_1.0.0_all.ipk +0 -0
  153. package/spec/tempFiles/copyFiles/helloFile.txt +1 -0
  154. package/spec/tempFiles/copyFiles/testFile.txt +1 -0
  155. package/spec/tempFiles/ipks/com.sample.echo_0.0.1_all.ipk +0 -0
  156. package/spec/tempFiles/ipks/com.web.app_1.0.0_all.ipk +0 -0
  157. package/spec/tempFiles/nativeApp/auto/pkg_arm64/GLES2 +0 -0
  158. package/spec/tempFiles/nativeApp/auto/pkg_arm64/appinfo.json +9 -0
  159. package/spec/tempFiles/nativeApp/auto/pkg_arm64/icon.png +0 -0
  160. package/spec/tempFiles/nativeApp/auto/pkg_arm64/largeIcon.png +0 -0
  161. package/spec/tempFiles/nativeApp/ose/pkg_arm/Hello +0 -0
  162. package/spec/tempFiles/nativeApp/ose/pkg_arm/appinfo.json +9 -0
  163. package/spec/tempFiles/nativeApp/ose/pkg_arm/icon.png +0 -0
  164. package/spec/tempFiles/nativeApp/ose/pkg_arm/largeIcon.png +0 -0
  165. package/spec/tempFiles/nativeApp/ose/pkg_arm/package.properties +2 -0
  166. package/spec/tempFiles/nativeApp/oseEmul/pkg_x86/Hello +0 -0
  167. package/spec/tempFiles/nativeApp/oseEmul/pkg_x86/appinfo.json +9 -0
  168. package/spec/tempFiles/nativeApp/oseEmul/pkg_x86/icon.png +0 -0
  169. package/spec/tempFiles/nativeApp/oseEmul/pkg_x86/largeIcon.png +0 -0
  170. package/spec/tempFiles/nativeApp/rsi/pkg_x86/GLES2 +0 -0
  171. package/spec/tempFiles/nativeApp/rsi/pkg_x86/appinfo.json +9 -0
  172. package/spec/tempFiles/nativeApp/rsi/pkg_x86/icon.png +0 -0
  173. package/spec/tempFiles/nativeApp/rsi/pkg_x86/largeIcon.png +0 -0
  174. package/spec/tempFiles/sign/sign.crt +32 -0
  175. package/spec/tempFiles/sign/signPriv.key +52 -0
  176. package/spec/test_data/ares-generate.json +41 -0
  177. package/spec/test_data/ares.json +33 -0
package/.eslintignore ADDED
@@ -0,0 +1 @@
1
+ node_modules
package/.eslintrc.js ADDED
@@ -0,0 +1,52 @@
1
+ module.exports = {
2
+ env: {
3
+ es6: true, // sets the 'ecmaVersion' parser option to 6
4
+ node: true
5
+ },
6
+ extends: ['eslint:recommended'],
7
+ plugins: ['import'],
8
+ rules: {
9
+ 'no-console': 0,
10
+ 'no-control-regex': 0,
11
+ 'no-regex-spaces': 0,
12
+ 'block-scoped-var': 1,
13
+ 'no-eval': 1,
14
+ 'no-extra-bind': 1,
15
+ 'no-new-func': 2,
16
+ 'no-new-wrappers': 2,
17
+ 'no-new': 1,
18
+ 'no-octal-escape': 1,
19
+ 'no-proto': 2,
20
+ 'no-throw-literal': 2,
21
+ 'no-shadow': [2, {builtinGlobals: false, hoist: 'all', allow: ['context','next']}],
22
+ 'no-use-before-define': [2, {functions: false}],
23
+ 'new-cap': [2, {capIsNew: false}],
24
+ 'no-array-constructor': 2,
25
+ 'no-lonely-if': 1,
26
+ 'no-unneeded-ternary': 1,
27
+ 'spaced-comment': [1, 'always', {markers: ['*']}],
28
+ 'no-var': 1,
29
+ 'prefer-const': 1,
30
+ 'semi':1,
31
+ 'import/no-unresolved': [2, {commonjs: true, caseSensitive: true, ignore: ['webos-service']}],
32
+ 'import/named': 2,
33
+ 'import/first': 1,
34
+ 'import/no-duplicates': 2,
35
+ eqeqeq: [1, 'smart']
36
+ },
37
+ globals: {
38
+ 'afterAll': false,
39
+ 'afterEach': false,
40
+ 'beforeAll': false,
41
+ 'beforeEach': false,
42
+ 'describe': false,
43
+ 'expect': false,
44
+ 'it': false,
45
+ 'pending': false,
46
+ 'jasmine': false,
47
+ 'fail': false
48
+ },
49
+ "parserOptions": {
50
+ "ecmaVersion": 2017
51
+ }
52
+ };
package/APIs.js ADDED
@@ -0,0 +1,79 @@
1
+ /*
2
+ * Copyright (c) 2023-2024 LG Electronics Inc.
3
+ *
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+
7
+ /* eslint new-cap: ["error", { "newIsCap": false }] */
8
+
9
+ const {promisify} = require('util'),
10
+ aresGenerator = require('./lib/generator'),
11
+ aresInspector = require('./lib/inspect'),
12
+ aresInstaller = require('./lib/install'),
13
+ aresLauncher = require('./lib/launch'),
14
+ aresPackager = require('./lib/package'),
15
+ aresPuller = require('./lib/pull'),
16
+ aresPusher = require('./lib/pusher'),
17
+ aresShell = require('./lib/shell'),
18
+ aresServer = require('./lib/base/server'),
19
+ aresSetupDevice = require('./lib/base/setup-device');
20
+
21
+ const Generator = new aresGenerator();
22
+
23
+ const Inspector = {
24
+ inspect: promisify(aresInspector.inspect),
25
+ stop: promisify(aresInspector.stop)
26
+ };
27
+
28
+ const Installer = {
29
+ install: promisify(aresInstaller.install),
30
+ remove: promisify(aresInstaller.remove),
31
+ list: promisify(aresInstaller.list)
32
+ };
33
+
34
+ const Launcher = {
35
+ close: promisify(aresLauncher.close),
36
+ launch: promisify(aresLauncher.launch),
37
+ listRunningApp: promisify(aresLauncher.listRunningApp)
38
+ };
39
+
40
+ const Packager = new aresPackager.Packager();
41
+
42
+ const Puller = {
43
+ pull: promisify(aresPuller.pull)
44
+ };
45
+
46
+ const Pusher = new aresPusher();
47
+
48
+ const Server = {
49
+ openBrowser: promisify(aresServer.openBrowser),
50
+ runServer: promisify(aresServer.runServer),
51
+ stop: promisify(aresServer.stop)
52
+ };
53
+
54
+ const Shell = {
55
+ remoteRun: promisify(aresShell.remoteRun),
56
+ shell: promisify(aresShell.shell)
57
+ };
58
+
59
+ const SetupDevice = {
60
+ modifyDevice: promisify(aresSetupDevice.modifyDeviceInfo),
61
+ removeDevice: promisify(aresSetupDevice.removeDeviceInfo),
62
+ resetDeviceList: promisify(aresSetupDevice.resetDeviceList),
63
+ setDefaultDevice: promisify(aresSetupDevice.setDefaultDevice),
64
+ showDeviceList: promisify(aresSetupDevice.showDeviceList),
65
+ showDeviceListFull: promisify(aresSetupDevice.showDeviceListFull),
66
+ };
67
+
68
+ module.exports = {
69
+ Generator,
70
+ Inspector,
71
+ Installer,
72
+ Launcher,
73
+ Packager,
74
+ Puller,
75
+ Pusher,
76
+ Server,
77
+ Shell,
78
+ SetupDevice
79
+ };
package/CHANGELOG.md ADDED
@@ -0,0 +1,110 @@
1
+ ## 3.0.0 (March 4, 2024)
2
+ ### ares-config
3
+ * Added as a new command for showing or changing the profile of CLI.
4
+
5
+ ### ares-launch
6
+ * Supports to live reloading using `--hosted` option.
7
+
8
+ ### ares-novacom
9
+ * Added as a new command for controlling TV devices.(This is written based on differences compared to v2.4.0.)
10
+ * Supported only when using the TV profile.
11
+
12
+ ### ares-pacakge
13
+ * Fixed to minify by default for js files in service directory.
14
+
15
+ ### Common
16
+ * Moved repository from @webosose/ares-cli to @webos-tools/cli.
17
+ * Integrated with the webOS TV CLI. In the future, we plan to support multiple webOS platforms with a single CLI.
18
+ * Added the profile for changing support platform, default profile is tv. The commands, options, help, and templates supported for each profile are different.
19
+ * Supports Node v16.20.2.
20
+ * Supports unit test to verify tv profile.
21
+
22
+ ### Meta files
23
+ * Updated the README file.
24
+
25
+
26
+ ## 2.4.0 (February 16, 2023)
27
+ ### ares-device
28
+ * Supports to show node version usage using `--system-info` option.
29
+ * Fixed a bug that js service is not listed-up when ares-device `--resource-monitor --list` option.
30
+
31
+ ### ares-inspect
32
+ * Updated displayed guide text during js service inspection using `--service` option.
33
+
34
+ ### Common
35
+ * Supports features of below commands as APIs(total 10s)
36
+ : ares-generate, ares-inspect, ares-install, ares-launch, ares-package, ares-pull, ares-push, ares-server, ares-setup-device, ares-shell
37
+ * Added unit test to verify APIs
38
+
39
+
40
+ ## 2.3.0 (February 7, 2022)
41
+ ### ares-log
42
+ * Supports to show logs of pmlogd and added options to support related features.
43
+ * Added option to check(`--current-daemon`) and select(`--select-daemon`) log daemon.
44
+ * Supports to print the help message by selected log daemon.
45
+
46
+ ### ares-device
47
+ * Supports to monitor resource usage using `--resouce-monitor` option and provides related features through the options of `--time-interval`, `--list`, `--id` and `--save`.
48
+ * Fixed a bug related to the directory permission when using `capture-screen` option.
49
+
50
+ ### ares-pacakge
51
+ * Supports to analyze the pacakge file(.ipk) using `--info` and `--info-detail` options.
52
+ * Fixed a bug related to the callback function error.
53
+
54
+ ### ares-inspect
55
+ * Fixed a bug that prevented opening the browser specified in the environment variables when using `--open` option.
56
+
57
+ ### Common
58
+ * Updated the minimum supported node version from v8.12.0 to v10.24.1.
59
+ * Added a feature to print information of the connected target device.
60
+ * Added a feature to print the progress when the command takes a long time to execute.
61
+ * Cleaned up all log levels of all source code and supports to show level-applied logs using `--level` option of each command.
62
+ * Added a feature to manually set time interval when running unit tests.
63
+
64
+ ### Meta files
65
+ * Updated the README file.
66
+
67
+
68
+ ## 2.2.0 (June 21, 2021)
69
+ ### ares-log
70
+ * Added as a new command for showing or saving logs of webOS apps and services.
71
+
72
+ ### ares-setup-device
73
+ * Updated the naming rule for the DEVICE_NAME parameter.
74
+
75
+ ### ares-install
76
+ * Enhanced the readability of the results of the --listfull option.
77
+
78
+ ### Common
79
+ * Categorized error messages and added user tips according to each error message.
80
+
81
+ ### Meta files
82
+ * Updated the README file.
83
+
84
+
85
+ ## 2.1.0 (April 2, 2021)
86
+ ### ares-device
87
+ * Supports screen capture using the `--capture-screen` option.
88
+
89
+ ### ares-generate
90
+ * Updated the template of appinfo.json to apply new ACG groups. Template files generated by CLI v2.0.3 or older are not compatible with the latest webOS OSE.
91
+ * Added '/' to config method in js_service templates.
92
+
93
+ ### ares-shell
94
+ * Fixed an issue that environment variables using the `ares-shell -r` command were different from environment variables of the target device.
95
+
96
+
97
+ ## 2.0.3 (January 22, 2021)
98
+ ### ares
99
+ * Updated help message.
100
+
101
+ ### Meta files
102
+ * Updated the README file.
103
+
104
+
105
+ ## 2.0.2 (December 29, 2020)
106
+ * Supports Node v14.15.1.
107
+
108
+
109
+ ## 2.0.0 (December 11, 2020)
110
+ * Initial github release.
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,218 @@
1
+ # @webos-tools/cli
2
+
3
+ **@webos-tools/cli** is a Command-Line Interface (CLI) for webOS. It provides a collection of commands for creating, packaging, installing, and launching webOS apps or services in a command-line environment. With @webos-tools/cli, you can develop and test your app or service without using any IDE.
4
+
5
+ ## Announcement
6
+
7
+ **We moved here from @webosose/ares-cli.** In the future, we plan to develop and maintain a single webOS CLI here to support webOS.
8
+
9
+ We are releasing a single CLI that supports both webOS OSE and webOS TV through this released CLI (v3.0.0). You can switch to CLI for OSE or TV by installing one CLI and changing only the profile. For more details, see [Profile Settings](#profile-settings).
10
+
11
+ ## Installation
12
+
13
+ > [!IMPORTANT]
14
+ > If @webosose/ares-cli is installed globally, uninstall it before install globally @webos-tools/cli.
15
+ >
16
+ > ``` shell
17
+ > # Uninstall globally @webosose/ares-cli
18
+ > $ npm uninstall -g @webosose/ares-cli
19
+ > ```
20
+ >
21
+ > ``` shell
22
+ > # Check whether uninstall @webosose/ares-cli
23
+ > $ ares -V
24
+ > ares: command not found
25
+ > ```
26
+
27
+ The @webos-tools/cli is installed using `npm`.
28
+
29
+ > Note: @webos-tools/cli was tested on Node.js v14.15.1 and v16.20.2.
30
+
31
+ You can install @webos-tools/cli using the following command. We recommend installing it globally. For Linux and macOS, you might need the `sudo` command.
32
+
33
+ ``` shell
34
+ $ npm install -g @webos-tools/cli
35
+ ```
36
+
37
+ ## Profile Settings
38
+
39
+ You can change the profile to `tv` or `ose`. The default profile is `tv` (webOS TV).
40
+
41
+ ``` shell
42
+ $ ares-config --profile ose
43
+ profile and config data is changed to ose
44
+ ```
45
+
46
+ You can change the profile at any time while using the CLI by using the above command.
47
+
48
+ ## Compatibility
49
+
50
+ The release cycle of @webos-tools/cli is independent from that of webOS OSE or webOS TV. The latest CLI is compatible with the latest webOS OSE and webOS TV. So, we recommend using the latest version of CLI.
51
+
52
+ If you want to use previous version of CLI, check the compatibility table for each platform.
53
+
54
+ - [Compatibility of webOS OSE CLI](https://www.webosose.org/docs/tools/sdk/cli/cli-release-notes/#compatibility)
55
+ - [Compatibility of webOS TV CLI](https://webostv.developer.lge.com/develop/tools/sdk-introduction#compatible-sdkversiontools-by-release-year)
56
+
57
+ ## Command List
58
+
59
+ The following table shows a list supported commands. For more details, refer to user guides in [Documentation](#documentation).
60
+
61
+ | Command | Description | OSE | TV |
62
+ |-------------------|--------------------------------------------------------------------------------|:---:|:--:|
63
+ | ares-config | Configures webOS CLI. | v | v |
64
+ | ares | Displays the help information for ares commands. | v | v |
65
+ | ares-generate | Creates a webOS app or service from templates. | v | v |
66
+ | ares-package | Packages the app or services into a package file. | v | v |
67
+ | ares-setup-device | Manages the target devices. | v | v |
68
+ | ares-novacom | Command Line Tool to control the device. | | v |
69
+ | ares-install | Installs the app or service on the target device. | v | v |
70
+ | ares-launch | Launches or terminates the app. | v | v |
71
+ | ares-inspect | Enables Web Inspector or Node's Inspector for debugging web app or JS service. | v | v |
72
+ | ares-server | Runs the Web server for testing local app file. | v | v |
73
+ | ares-shell | Executes shell commands in the target device. | v | |
74
+ | ares-push | Pushes file(s) from a host machine to a target device. | v | |
75
+ | ares-pull | Pulls file(s) from a target device to a host machine. | v | |
76
+ | ares-device | Displays the device information. | v | v |
77
+ | ares-log | Shows or saves logs of webOS apps and services. | v | |
78
+
79
+ ## Documentation
80
+
81
+ For `ose` profile:
82
+
83
+ - How to use webOS OSE CLI, see the [webOS OSE CLI User Guide](https://www.webosose.org/docs/tools/sdk/cli/cli-user-guide/).
84
+ - How to develop external Web/QML/Native apps or JS/Native services for webOS OSE, see the [webOS OSE Tutorials](https://www.webosose.org/docs/tutorials/).
85
+
86
+ For `tv` profile:
87
+
88
+ - How to use webOS TV CLI, see the [webOS TV CLI Introduction](https://webostv.developer.lge.com/develop/tools/cli-introduction).
89
+ - How to develop web apps or JS services for webOS TV, see the [webOS TV Developer Guide](https://webostv.developer.lge.com/develop/tools/cli-dev-guide).
90
+
91
+ ## Testing
92
+
93
+ You can test the @webos-tools/cli commands and their options to check their validity. Tests are performed by `jasmine`.
94
+
95
+ ### Prerequisites
96
+
97
+ 1. Turn on the webOS device.
98
+ 2. Check the IP address and SSH port number.
99
+ 3. (Only for webOS TV) Enable the developer mode. See [App Testing with Developer Mode App](https://webostv.developer.lge.com/develop/getting-started/developer-mode-app)
100
+
101
+ ### Performing the Test
102
+
103
+ The following table lists the default configurations for the test.
104
+
105
+ | Parameter | Value |
106
+ | :-------: | :-------: |
107
+ | profile | ose |
108
+ | device | emulator |
109
+ | ip | 127.0.0.1 |
110
+ | port | 6622 |
111
+
112
+ - Test with default configurations.
113
+
114
+ ``` shell
115
+ $ jasmine
116
+ ```
117
+
118
+ or
119
+
120
+ ``` shell
121
+ $ jasmine --profile=ose --device=emulator --ip=127.0.0.1 --port=6622
122
+ ```
123
+
124
+ - Test with specific configurations. (The port number can be omitted when using port 22.)
125
+
126
+ ``` shell
127
+ $ jasmine --profile=ose --device=webOSOSE --ip=192.168.0.12
128
+ ```
129
+
130
+ - Test with specific port configurations.
131
+
132
+ ``` shell
133
+ $ jasmine --profile=ose --device=webOSOSE --ip=192.168.0.12 --port=24
134
+ ```
135
+
136
+ - Test ares-generate command.
137
+
138
+ ``` shell
139
+ $ jasmine --profile=ose --device=webOSOSE --ip=192.168.0.12 --port=24 spec/jsSpec/ares-generate.js
140
+ ```
141
+
142
+ - Test the `tv` profile. `passPhrase` must be entered as an input parameter. See [Turning Developer Mode on](https://webostv.developer.lge.com/develop/getting-started/developer-mode-app#installing-developer-mode-app).
143
+
144
+ ``` shell
145
+ $ jasmine --profile=tv --device=webOSTV --ip=192.168.0.12 --port=9922 --passPhrase=AB12CD
146
+ ```
147
+
148
+ ## Contributing
149
+
150
+ You can contribute your source codes to our repository.
151
+
152
+ The step-by-step guide is as follows:
153
+
154
+ 1. Fork the [@webos-tools/cli repository](#). Make sure that you fork the whole repository.
155
+ 2. Create a new branch from the develop branch.
156
+ 3. Implement the source codes and `git push` the changes to the new branch.
157
+ 4. Create a pull request. When you write the description for the pull request, make sure you follow [Pull Request Description Guidelines](#pull-request-description-guide).
158
+ 5. Submit the pull request to the owner.
159
+
160
+ ### Pull Request Description Guide
161
+
162
+ The following is an example of the pull reqeust description
163
+
164
+ ```
165
+ Change ares-device-info to ares-device
166
+
167
+ :Release Notes:
168
+ Expand the scope of ares-device-info command by changing its name
169
+
170
+ :Detailed Notes:
171
+ For now, the scope of the ares-device-info command seems to narrow,
172
+ so it is hard to add other options to the command (such as capture)
173
+ - Rename ares-device-info.js to ares-device.js
174
+ - Add --system-info and --session-info options
175
+ - Update ares-device TC
176
+
177
+ :Testing Performed:
178
+ 1. All unit test passed
179
+ 2. ESLint done
180
+ 3. Check the below commands
181
+ $ ares-device
182
+ $ ares-device --system-info
183
+ $ ares-device --session-info
184
+
185
+ :Issues Addressed:
186
+ [ISSUE-1] Change ares-device-info to ares-device
187
+ ```
188
+
189
+ - Summary: Describe the summary of this pull request. Make sure you capitalize the first letter of the summary.
190
+ - Release Notes: Describe what this pull request implements.
191
+ - Detailed Notes: Describe the problems of this pull request and how to fix them.
192
+ - Testing Performed: Describe tests you performed.
193
+ - Unit test: Run CLI unit test via `jasmine` on the target device or emulator and write the result. All unit tests must be passed.
194
+ - ESlint: Run `eslint` on @webos-tools/cli root directory and write the result. No warning or error would be allowed.
195
+ - Detailed test steps for changes: Write commands that can test your changes. Make sure that maintainers can verify your changes using these steps.
196
+ - Issues Addressed: Write issue numbers and those summary.
197
+
198
+ ## Copyright and License Information
199
+
200
+ Unless otherwise specified, all content, including all source code files and documentation files in this repository are:
201
+
202
+ Copyright (c) 2020-2024 LG Electronics, Inc.
203
+
204
+ All content, including all source code files and documentation files in this repository except otherwise noted are:
205
+
206
+ Licensed under the Apache License, Version 2.0 (the "License");
207
+ you may not use this file except in compliance with the License.
208
+ You may obtain a copy of the License at
209
+
210
+ http://www.apache.org/licenses/LICENSE-2.0
211
+
212
+ Unless required by applicable law or agreed to in writing, software
213
+ distributed under the License is distributed on an "AS IS" BASIS,
214
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
215
+ See the License for the specific language governing permissions and
216
+ limitations under the License.
217
+
218
+ SPDX-License-Identifier: Apache-2.0