@signageos/cli 1.1.4 → 1.2.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 (83) hide show
  1. package/.env +0 -3
  2. package/CHANGELOG.md +19 -0
  3. package/README.md +32 -6
  4. package/dist/Applet/Build/appletBuildCommand.d.ts +33 -0
  5. package/dist/Applet/Build/appletBuildCommand.js +99 -0
  6. package/dist/Applet/Build/appletBuildCommand.js.map +1 -0
  7. package/dist/Applet/Generate/appletGenerateCommand.js +4 -3
  8. package/dist/Applet/Generate/appletGenerateCommand.js.map +1 -1
  9. package/dist/Applet/Start/appletStartCommand.d.ts +34 -8
  10. package/dist/Applet/Start/appletStartCommand.js +90 -24
  11. package/dist/Applet/Start/appletStartCommand.js.map +1 -1
  12. package/dist/Applet/Start/appletStartCommandHelper.js +2 -1
  13. package/dist/Applet/Start/appletStartCommandHelper.js.map +1 -1
  14. package/dist/Applet/Test/Upload/appletTestRunCommand.js +8 -7
  15. package/dist/Applet/Test/Upload/appletTestRunCommand.js.map +1 -1
  16. package/dist/Applet/Test/Upload/appletTestUploadCommand.js +12 -11
  17. package/dist/Applet/Test/Upload/appletTestUploadCommand.js.map +1 -1
  18. package/dist/Applet/Upload/appletUploadCommand.js +84 -90
  19. package/dist/Applet/Upload/appletUploadCommand.js.map +1 -1
  20. package/dist/Applet/Upload/appletUploadCommandHelper.d.ts +0 -3
  21. package/dist/Applet/Upload/appletUploadCommandHelper.js +22 -13
  22. package/dist/Applet/Upload/appletUploadCommandHelper.js.map +1 -1
  23. package/dist/Applet/Upload/appletUploadFacade.js +4 -3
  24. package/dist/Applet/Upload/appletUploadFacade.js.map +1 -1
  25. package/dist/Applet/appletCommand.d.ts +64 -8
  26. package/dist/Applet/appletCommand.js +2 -0
  27. package/dist/Applet/appletCommand.js.map +1 -1
  28. package/dist/Applet/appletFacade.js +7 -6
  29. package/dist/Applet/appletFacade.js.map +1 -1
  30. package/dist/Applet/appletServerHelper.d.ts +18 -0
  31. package/dist/Applet/appletServerHelper.js +83 -0
  32. package/dist/Applet/appletServerHelper.js.map +1 -0
  33. package/dist/Auth/loginCommand.js +8 -6
  34. package/dist/Auth/loginCommand.js.map +1 -1
  35. package/dist/Cli/helper.d.ts +2 -2
  36. package/dist/Cli/helper.js +3 -3
  37. package/dist/Cli/helper.js.map +1 -1
  38. package/dist/Cli/packageVersion.js +4 -3
  39. package/dist/Cli/packageVersion.js.map +1 -1
  40. package/dist/Command/commandProcessor.js +8 -9
  41. package/dist/Command/commandProcessor.js.map +1 -1
  42. package/dist/Command/globalArgs.d.ts +1 -1
  43. package/dist/Device/Connect/connectCommand.d.ts +28 -12
  44. package/dist/Device/Connect/connectCommand.js +55 -29
  45. package/dist/Device/Connect/connectCommand.js.map +1 -1
  46. package/dist/Device/Connect/connectHelper.js +5 -4
  47. package/dist/Device/Connect/connectHelper.js.map +1 -1
  48. package/dist/Device/Content/setContentCommand.js +2 -1
  49. package/dist/Device/Content/setContentCommand.js.map +1 -1
  50. package/dist/Device/PowerAction/powerActionCommand.js +2 -1
  51. package/dist/Device/PowerAction/powerActionCommand.js.map +1 -1
  52. package/dist/Device/deviceCommand.d.ts +28 -12
  53. package/dist/Device/deviceFacade.d.ts +0 -2
  54. package/dist/Device/deviceFacade.js +1 -40
  55. package/dist/Device/deviceFacade.js.map +1 -1
  56. package/dist/Emulator/IEmulator.d.ts +1 -1
  57. package/dist/Emulator/emulatorFacade.js +6 -5
  58. package/dist/Emulator/emulatorFacade.js.map +1 -1
  59. package/dist/Emulator/emulatorFactory.d.ts +4 -2
  60. package/dist/Emulator/emulatorFactory.js +85 -73
  61. package/dist/Emulator/emulatorFactory.js.map +1 -1
  62. package/dist/FileSystem/helper.d.ts +5 -10
  63. package/dist/FileSystem/helper.js +26 -146
  64. package/dist/FileSystem/helper.js.map +1 -1
  65. package/dist/Firmware/Upload/firmwareUploadCommand.js +35 -9
  66. package/dist/Firmware/Upload/firmwareUploadCommand.js.map +1 -1
  67. package/dist/Organization/SetDefault/organizationSetDefaultCommand.js +2 -1
  68. package/dist/Organization/SetDefault/organizationSetDefaultCommand.js.map +1 -1
  69. package/dist/RunControl/runControlHelper.d.ts +5 -9
  70. package/dist/RunControl/runControlHelper.js +24 -103
  71. package/dist/RunControl/runControlHelper.js.map +1 -1
  72. package/dist/generalCommand.js +3 -3
  73. package/dist/generalCommand.js.map +1 -1
  74. package/dist/helper.d.ts +2 -2
  75. package/dist/helper.js +7 -3
  76. package/dist/helper.js.map +1 -1
  77. package/dist/parameters.d.ts +13 -0
  78. package/dist/parameters.js +68 -0
  79. package/dist/parameters.js.map +1 -0
  80. package/package.json +8 -17
  81. package/config/parameters.d.ts +0 -27
  82. package/config/parameters.js +0 -50
  83. package/package-lock.json +0 -8067
package/.env CHANGED
@@ -1,5 +1,2 @@
1
1
  SOS_API_URL=https://api.signageos.io
2
2
  SOS_BOX_HOST=box.signageos.io
3
- # use for localhost development and fry box
4
- #SOS_API_URL=http://localhost:3079
5
- #SOS_BOX_HOST=box.fry.office.signageos.io
package/CHANGELOG.md CHANGED
@@ -4,6 +4,25 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5
5
  and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [1.2.0] - 2023-03-29
8
+ ### Fixed
9
+ - Console output of `npm start` of generated applet shows correct URL of emulator
10
+ - The `--entry-file` can be now ommited when the `package.json` has the `main` property set
11
+ - The `sos device connect` is looking for the applet in server by `name` instead of required `uid` in `package.json` `sos.appletUid` property
12
+ - The `.git` folder is ignored automatically when the `.gitignore` file is used
13
+
14
+ ### Added
15
+ - Allow customize `--server-port` and `--server-public-url` for `sos device connect` command
16
+ - New `sos applet build` command that will build current applet as a `.package.zip` file (same that is built and used on device when uploading applet)
17
+
18
+ ### Deprecated
19
+ - Remove support of experimental version of webpack-plugin v0.2. Use version v1+ instead
20
+
21
+ ## [1.1.5] - 2023-01-02
22
+ ### Fixed
23
+ - Respect argument `--api-url` as priority over `SOS_API_URL` environment variable and default value
24
+ - Log info/warning output into stderr instead of stdout
25
+
7
26
  ## [1.1.4] - 2022-11-25
8
27
  ### Fixed
9
28
  - Removed unused `display.appcache` file from Emulator (replaced with `serviceWorker.js`)
package/README.md CHANGED
@@ -12,6 +12,15 @@ sos --help
12
12
  cli tool allows you to run commands interactively for best user experience, please use standard bash terminal on *nix systems
13
13
  and [gitbash](https://gitforwindows.org/), run it in [windows terminal](https://www.microsoft.com/en-us/p/windows-terminal/9n0dx20hk701?activetab=pivot:overviewtab).
14
14
 
15
+ ## Test
16
+ ```bash
17
+ cp .env.amy .env
18
+ # Unit tests
19
+ npm test
20
+ # Integration tests (against AMY environment)
21
+ npm run test-integration
22
+ ```
23
+
15
24
  ## API reference
16
25
  ### General
17
26
  | Argument | Description | Default value |
@@ -98,20 +107,34 @@ sos applet upload --applet-path=dist/index.html
98
107
  | --applet-path *(optional)* | Path of project directory | ${PWD} |
99
108
  | --entry-file-path *(optional)* | Path of applet entry file | ${PWD}/dist/index.html |
100
109
 
110
+ #### Applet Build
111
+ ```bash
112
+ sos applet build
113
+ # Build applet locally. The result is a zip file in the /tmp/signageos directory.
114
+ ```
115
+
116
+ | Argument | Description | Default value |
117
+ |--------------------------------|-------------------------------|------------------------|
118
+ | --applet-uid *(required)* | Applet UID | STDIN |
119
+ | --organization-uid *(required)* | Organization UID | STDIN |
120
+
101
121
  #### Applet Start
102
122
  ```bash
103
123
  sos applet start
104
124
  ```
105
125
  - It's meant to be used with applets not created using the cli
106
- - Doesn't have a hot reload at the moment
107
126
  - Default values work for applet created using the cli
108
127
 
109
128
  | Argument | Description | Default value |
110
129
  |--------------------------------|---------------------------------------|------------------------|
130
+ | --organization-uid *(required)* | Organization UID | STDIN |
111
131
  | --port *(optional)* | Port where the applet will run | 8090 |
112
- | --applet-dir *(optional)* | Root path of built applet | ${PWD}/dist |
113
- | --project-dir *(optional)* | Root path of applet project directory | ${PWD} |
132
+ | --applet-path *(optional)* | Root path of applet project | ${PWD}/dist |
114
133
  | --entry-file-path *(optional)* | Path of built applet entry file | ${PWD}/dist/index.html |
134
+ | --server-public-url *(optional)* | Public url of local machine server. Is useful when the local machine is behind a reverse proxy. | http://{CURRENT_REMOTE_ADDR}:{RANDOM_PORT} |
135
+ | --server-port *(optional)* | The custom server port for local machine server. | {RANDOM_PORT} |
136
+ | --hot-reload *(optional)* | Enable hot reload and build of applet | false |
137
+ | --force *(optional)* | Force start applet server of hot reload even if it is already running on a different port. Kill the running server first. | false |
115
138
 
116
139
  #### Applet Tests Upload
117
140
  ```bash
@@ -228,14 +251,17 @@ sos device set-content
228
251
  sos device connect
229
252
  # You will be provided with setting parameters
230
253
  # You should build and upload applet to box before connecting applet to device
231
- # This upload all files in actual directory as multifile applet
254
+ # The applet has to be at least uploaded once with the specific version
232
255
  ```
233
256
  | Argument | Description | Default value |
234
257
  |--------------------------------|---------------------------------------|------------------------|
235
- | --ip *(required)* | Ip address of computer in local network | Automatically get from networkInterface|
236
258
  | --device-uid *(required)* | Uid of device from box' | STDIN |
237
- | --applet-dir *(required)* | Directory of the applet project | ${PWD}|
259
+ | --applet-uid *(required)* | Applet UID | STDIN |
260
+ | --organization-uid *(required)* | Organization UID | STDIN |
238
261
  | --update-package-config *(optional)* | Update package.json value `sos.appletUid` config when applet doesn't exists and is created | false |
262
+ | --server-public-url *(optional)* | Public url of local machine server. Is useful when the local machine is behind a reverse proxy. | http://{CURRENT_REMOTE_ADDR}:{RANDOM_PORT} |
263
+ | --server-port *(optional)* | The custom server port for local machine server. | {RANDOM_PORT} |
264
+ | --force *(optional)* | Force start applet server even if it is already running on a different port. Kill the running server first. | false |
239
265
 
240
266
  ## Contribution
241
267
  Clone the repository and install dev dependencies
@@ -0,0 +1,33 @@
1
+ import { CommandLineOptions } from '../../Command/commandDefinition';
2
+ export declare const OPTION_LIST: readonly [{
3
+ readonly name: "no-default-organization";
4
+ readonly type: BooleanConstructor;
5
+ readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc which were set using command sos organization set-default";
6
+ }, {
7
+ readonly name: "organization-uid";
8
+ readonly type: StringConstructor;
9
+ readonly description: "Organization UID";
10
+ }, {
11
+ readonly name: "applet-uid";
12
+ readonly type: StringConstructor;
13
+ readonly description: "Applet UID";
14
+ }];
15
+ export declare const appletBuild: {
16
+ name: "build";
17
+ description: string;
18
+ optionList: readonly [{
19
+ readonly name: "no-default-organization";
20
+ readonly type: BooleanConstructor;
21
+ readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc which were set using command sos organization set-default";
22
+ }, {
23
+ readonly name: "organization-uid";
24
+ readonly type: StringConstructor;
25
+ readonly description: "Organization UID";
26
+ }, {
27
+ readonly name: "applet-uid";
28
+ readonly type: StringConstructor;
29
+ readonly description: "Applet UID";
30
+ }];
31
+ commands: never[];
32
+ run(options: CommandLineOptions<typeof OPTION_LIST>): Promise<void>;
33
+ };
@@ -0,0 +1,99 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (_) try {
18
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.appletBuild = exports.OPTION_LIST = void 0;
40
+ var chalk_1 = require("chalk");
41
+ var commandDefinition_1 = require("../../Command/commandDefinition");
42
+ var organizationFacade_1 = require("../../Organization/organizationFacade");
43
+ var helper_1 = require("../../helper");
44
+ var dist_1 = require("@signageos/sdk/dist");
45
+ var appletFacade_1 = require("../appletFacade");
46
+ var log_1 = require("@signageos/sdk/dist/Console/log");
47
+ var Debug = require("debug");
48
+ var debug = Debug('@signageos/cli:Applet:Build:appletBuildCommand');
49
+ exports.OPTION_LIST = [
50
+ organizationFacade_1.NO_DEFAULT_ORGANIZATION_OPTION,
51
+ organizationFacade_1.ORGANIZATION_UID_OPTION,
52
+ appletFacade_1.APPLET_UID_OPTION,
53
+ ];
54
+ exports.appletBuild = (0, commandDefinition_1.createCommandDefinition)({
55
+ name: 'build',
56
+ description: 'Build applet locally. The result is a zip file in the /tmp/signageos directory.',
57
+ optionList: exports.OPTION_LIST,
58
+ commands: [],
59
+ run: function (options) {
60
+ return __awaiter(this, void 0, void 0, function () {
61
+ var currentDirectory, organizationUid, organization, restApi, dev, appletUid, appletVersion, build;
62
+ return __generator(this, function (_a) {
63
+ switch (_a.label) {
64
+ case 0:
65
+ currentDirectory = process.cwd();
66
+ return [4 /*yield*/, (0, organizationFacade_1.getOrganizationUidOrDefaultOrSelect)(options)];
67
+ case 1:
68
+ organizationUid = _a.sent();
69
+ return [4 /*yield*/, (0, organizationFacade_1.getOrganization)(organizationUid)];
70
+ case 2:
71
+ organization = _a.sent();
72
+ return [4 /*yield*/, (0, helper_1.createOrganizationRestApi)(organization)];
73
+ case 3:
74
+ restApi = _a.sent();
75
+ dev = (0, dist_1.createDevelopment)({
76
+ organizationUid: organization.uid,
77
+ });
78
+ return [4 /*yield*/, (0, appletFacade_1.getAppletUid)(restApi, options)];
79
+ case 4:
80
+ appletUid = _a.sent();
81
+ return [4 /*yield*/, (0, appletFacade_1.getAppletVersion)(currentDirectory)];
82
+ case 5:
83
+ appletVersion = _a.sent();
84
+ return [4 /*yield*/, dev.applet.build.build({
85
+ appletUid: appletUid,
86
+ appletVersion: appletVersion,
87
+ appletPath: currentDirectory,
88
+ })];
89
+ case 6:
90
+ build = _a.sent();
91
+ (0, log_1.log)('info', "Applet ".concat(chalk_1.default.green(appletUid), "@").concat(chalk_1.default.green(appletVersion), " was built successfully into \"").concat(chalk_1.default.green(build.packageArchivePath), "\"."));
92
+ debug('Applet build result:', build);
93
+ return [2 /*return*/];
94
+ }
95
+ });
96
+ });
97
+ },
98
+ });
99
+ //# sourceMappingURL=appletBuildCommand.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"appletBuildCommand.js","sourceRoot":"","sources":["../../../src/Applet/Build/appletBuildCommand.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K,GAAG,SAIZ;wBAEF,IAAA,SAAG,EAAC,MAAM,EAAE,iBAAU,eAAK,CAAC,KAAK,CAAC,SAAS,CAAC,cAAI,eAAK,CAAC,KAAK,CAAC,aAAa,CAAC,4CAAiC,eAAK,CAAC,KAAK,CAAC,KAAK,CAAC,kBAAkB,CAAC,QAAI,CAAC,CAAC;wBACtJ,KAAK,CAAC,sBAAsB,EAAE,KAAK,CAAC,CAAC;;;;;KACrC;CACD,CAAC,CAAC"}
@@ -79,6 +79,7 @@ var chalk_1 = require("chalk");
79
79
  var path = require("path");
80
80
  var prompts = require("prompts");
81
81
  var commandDefinition_1 = require("../../Command/commandDefinition");
82
+ var log_1 = require("@signageos/sdk/dist/Console/log");
82
83
  var NAME_REGEXP = /^\w(\w|\d|-)*\w$/;
83
84
  var NPM_EXECUTABLE = 'npm';
84
85
  var OPTION_LIST = [
@@ -232,8 +233,8 @@ exports.appletGenerate = (0, commandDefinition_1.createCommandDefinition)({
232
233
  shell: true,
233
234
  });
234
235
  child.on('close', function () {
235
- console.log("\nApplet ".concat(chalk_1.default.green(appletName), " created!"));
236
- console.log("use: cd ".concat(chalk_1.default.green(appletRootDirectoryName), " and ").concat(chalk_1.default.green('npm start'), "\n"));
236
+ (0, log_1.log)('info', "\nApplet ".concat(chalk_1.default.green(appletName), " created!"));
237
+ (0, log_1.log)('info', "use: cd ".concat(chalk_1.default.green(appletRootDirectoryName), " and ").concat(chalk_1.default.green('npm start'), "\n"));
237
238
  });
238
239
  return [2 /*return*/];
239
240
  }
@@ -266,7 +267,7 @@ function createPackageConfig(name, version) {
266
267
  });
267
268
  });
268
269
  }
269
- var createWebpackConfig = function (entryFileName, fileExtensions, imports, rules, plugins) { return "\n".concat(imports.join(';\n'), "\n\nexports = module.exports = {\n\tentry: ").concat(JSON.stringify('./src/' + entryFileName), ",\n\ttarget: ").concat(JSON.stringify(['web', 'es5']), ",\n\toutput: {\n\t\tfilename: 'index.js',\n\t},\n\tresolve: {\n\t\textensions: ").concat(JSON.stringify(fileExtensions), ",\n\t},\n\tmodule: {\n\t\trules: [\n").concat(rules.join(',\n'), "\n\t\t],\n\t},\n\tplugins: [\n").concat(plugins.join(',\n'), "\n\t],\n};\n"); };
270
+ var createWebpackConfig = function (entryFileName, fileExtensions, imports, rules, plugins) { return "\n".concat(imports.join(';\n'), "\n\nexports = module.exports = {\n\tentry: ").concat(JSON.stringify('./src/' + entryFileName), ",\n\ttarget: ").concat(JSON.stringify(['web', 'es5']), ",\n\tinfrastructureLogging: {\n\t\tlevel: 'warn',\n\t},\n\toutput: {\n\t\tfilename: 'index.js',\n\t},\n\tresolve: {\n\t\textensions: ").concat(JSON.stringify(fileExtensions), ",\n\t},\n\tmodule: {\n\t\trules: [\n").concat(rules.join(',\n'), "\n\t\t],\n\t},\n\tplugins: [\n").concat(plugins.join(',\n'), "\n\t],\n};\n"); };
270
271
  var createIndexHtml = function (title) { return "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n\t<meta charset=\"utf-8\" />\n\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1, shrink-to-fit=no\" />\n\t<meta name=\"theme-color\" content=\"#000000\" />\n\t<title>".concat(title, "</title>\n</head>\n<body>\n\t<h1>Hello ").concat(title, "</h1>\n\t<div id=\"root\"></div>\n</body>\n</html>\n"); };
271
272
  var createIndexJs = function () { return "\nrequire('./index.css');\n\nimport sos from '@signageos/front-applet';\n\n// Wait on sos data are ready (https://docs.signageos.io/api/js/content/latest/js-applet-basics#onready)\nsos.onReady().then(async function () {\n\tconst contentElement = document.getElementById('root');\n\tconsole.log('sOS is ready');\n\tcontentElement.innerHTML = 'sOS is ready';\n});\n"; };
272
273
  var createIndexCss = function () { return "\nbody {\n\tbackground-color: wheat;\n\ttext-align: center;\n}\n"; };
@@ -1 +1 @@
1
- {"version":3,"file":"appletGenerateCommand.js","sourceRoot":"","sources":["../../../src/Applet/Generate/appletGenerateCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,CAAC,MAAM,CAAC;oBACf,WAAW,EAAE,kBAAkB;oBAC/B,UAAU,EAAE,EAAG;oBACf,OAAO,EAAE,YAAY;iBACrB,EAAC;;;CACF;AAED,IAAM,mBAAmB,GAAG,UAC3B,aAAqB,EACrB,cAAwB,EACxB,OAAiB,EACjB,KAAe,EACf,OAAiB,IACb,OAAA,YACH,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,wDAGX,IAAI,CAAC,SAAS,CAAC,QAAQ,GAAG,aAAa,CAAC,0BACvC,IAAI,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,kJAQzB,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,iDAI5C,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,2CAIjB,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,iBAGpB,EAxBI,CAwBJ,CAAC;AAEF,IAAM,eAAe,GAAG,UACvB,KAAa,IACT,OAAA,mPAMK,KAAK,oDAGF,KAAK,yDAIjB,EAbI,CAaJ,CAAC;AAEF,IAAM,aAAa,GAAG,cAAM,OAAA,6WAW3B,EAX2B,CAW3B,CAAC;AAEF,IAAM,cAAc,GAAG,cAAM,OAAA,kEAK5B,EAL4B,CAK5B,CAAC;AAEF,IAAM,mBAAmB,GAAG,UAAC,WAAmB,IAAK,OAAA,qBAC1C,WAAW,yBAErB,EAHoD,CAGpD,CAAC"}
@@ -16,14 +16,27 @@ export declare const OPTION_LIST: readonly [{
16
16
  readonly name: "applet-path";
17
17
  readonly type: StringConstructor;
18
18
  readonly description: "Path to the applet file or the project folder depending on the entry file. Relative to the command or absolute.";
19
- }, {
20
- readonly name: "project-dir";
21
- readonly type: StringConstructor;
22
- readonly description: "Directory of the applet project";
23
19
  }, {
24
20
  readonly name: "entry-file-path";
25
21
  readonly type: StringConstructor;
26
22
  readonly description: "Path to the applet entry file. Relative to the command or absolute.";
23
+ }, {
24
+ readonly name: "hot-reload";
25
+ readonly type: BooleanConstructor;
26
+ readonly description: "Enable hot reload and build of applet";
27
+ readonly defaultValue: false;
28
+ }, {
29
+ readonly name: "server-port";
30
+ readonly type: NumberConstructor;
31
+ readonly description: "The custom server port for local machine server. Default is detected from currently running applet server.";
32
+ }, {
33
+ readonly name: "server-public-url";
34
+ readonly type: StringConstructor;
35
+ readonly description: "Public url of local machine server. Is useful when the local machine is behind a reverse proxy.";
36
+ }, {
37
+ readonly name: "force";
38
+ readonly type: BooleanConstructor;
39
+ readonly description: "Force start applet server even if it is already running on a different port. Kill the running server first.";
27
40
  }];
28
41
  export declare const appletStart: {
29
42
  name: "start";
@@ -45,14 +58,27 @@ export declare const appletStart: {
45
58
  readonly name: "applet-path";
46
59
  readonly type: StringConstructor;
47
60
  readonly description: "Path to the applet file or the project folder depending on the entry file. Relative to the command or absolute.";
48
- }, {
49
- readonly name: "project-dir";
50
- readonly type: StringConstructor;
51
- readonly description: "Directory of the applet project";
52
61
  }, {
53
62
  readonly name: "entry-file-path";
54
63
  readonly type: StringConstructor;
55
64
  readonly description: "Path to the applet entry file. Relative to the command or absolute.";
65
+ }, {
66
+ readonly name: "hot-reload";
67
+ readonly type: BooleanConstructor;
68
+ readonly description: "Enable hot reload and build of applet";
69
+ readonly defaultValue: false;
70
+ }, {
71
+ readonly name: "server-port";
72
+ readonly type: NumberConstructor;
73
+ readonly description: "The custom server port for local machine server. Default is detected from currently running applet server.";
74
+ }, {
75
+ readonly name: "server-public-url";
76
+ readonly type: StringConstructor;
77
+ readonly description: "Public url of local machine server. Is useful when the local machine is behind a reverse proxy.";
78
+ }, {
79
+ readonly name: "force";
80
+ readonly type: BooleanConstructor;
81
+ readonly description: "Force start applet server even if it is already running on a different port. Kill the running server first.";
56
82
  }];
57
83
  commands: never[];
58
84
  run(options: CommandLineOptions<typeof OPTION_LIST>): Promise<void>;
@@ -37,19 +37,39 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.appletStart = exports.OPTION_LIST = void 0;
40
+ var chalk_1 = require("chalk");
40
41
  var emulatorFactory_1 = require("../../Emulator/emulatorFactory");
41
42
  var appletUploadCommandHelper_1 = require("../Upload/appletUploadCommandHelper");
42
- var appletStartCommandHelper_1 = require("./appletStartCommandHelper");
43
43
  var emulatorFacade_1 = require("../../Emulator/emulatorFacade");
44
44
  var commandDefinition_1 = require("../../Command/commandDefinition");
45
45
  var organizationFacade_1 = require("../../Organization/organizationFacade");
46
+ var dist_1 = require("@signageos/sdk/dist");
47
+ var wait_1 = require("../../Timer/wait");
48
+ var appletServerHelper_1 = require("../appletServerHelper");
49
+ var log_1 = require("@signageos/sdk/dist/Console/log");
50
+ var DEFAULT_PORT = 8090;
51
+ var PORT_OPTION = {
52
+ name: 'port',
53
+ type: Number,
54
+ description: "Port where will the applet run",
55
+ defaultValue: DEFAULT_PORT,
56
+ };
57
+ var HOT_RELOAD_OPTION = {
58
+ name: 'hot-reload',
59
+ type: Boolean,
60
+ description: "Enable hot reload and build of applet",
61
+ defaultValue: false,
62
+ };
46
63
  exports.OPTION_LIST = [
47
64
  organizationFacade_1.NO_DEFAULT_ORGANIZATION_OPTION,
48
65
  organizationFacade_1.ORGANIZATION_UID_OPTION,
49
- { name: 'port', type: Number, description: "Port where will the applet run", defaultValue: 8090 },
66
+ PORT_OPTION,
50
67
  appletUploadCommandHelper_1.APPLET_PATH_OPTION,
51
- { name: 'project-dir', type: String, description: 'Directory of the applet project' },
52
68
  appletUploadCommandHelper_1.ENTRY_FILE_PATH_OPTION,
69
+ HOT_RELOAD_OPTION,
70
+ appletServerHelper_1.SERVER_PORT_OPTION,
71
+ appletServerHelper_1.SERVER_PUBLIC_URL_OPTION,
72
+ appletServerHelper_1.SERVER_FORCE_OPTION,
53
73
  ];
54
74
  exports.appletStart = (0, commandDefinition_1.createCommandDefinition)({
55
75
  name: 'start',
@@ -57,44 +77,90 @@ exports.appletStart = (0, commandDefinition_1.createCommandDefinition)({
57
77
  optionList: exports.OPTION_LIST,
58
78
  commands: [],
59
79
  run: function (options) {
80
+ var _a;
60
81
  return __awaiter(this, void 0, void 0, function () {
61
- var currentDirectory, organizationUid, emulatorServerPort, entryFileAbsolutePath, projectDirAbsolutePath, appletDirAbsolutePath, entryFileRelativePath, emulatorUid, createEmulatorParams;
62
- return __generator(this, function (_a) {
63
- switch (_a.label) {
82
+ var currentDirectory, organizationUid, entryFileAbsolutePath, appletPath, entryFileRelativePath, emulatorUid, dev, emulatorServerPort, hotReloadEnabled, appletPort, appletPublicUrl, appletUid, appletVersion, e_1, appletHotReload, createEmulatorParams, emulator, stopServer;
83
+ var _b;
84
+ var _this = this;
85
+ return __generator(this, function (_c) {
86
+ switch (_c.label) {
64
87
  case 0:
65
88
  currentDirectory = process.cwd();
66
- if (!options.port) {
67
- throw new Error('Argument --port is required');
68
- }
69
89
  return [4 /*yield*/, (0, organizationFacade_1.getOrganizationUidOrDefaultOrSelect)(options)];
70
90
  case 1:
71
- organizationUid = _a.sent();
72
- emulatorServerPort = options.port;
91
+ organizationUid = _c.sent();
73
92
  return [4 /*yield*/, (0, appletUploadCommandHelper_1.getAppletEntryFileAbsolutePath)(currentDirectory, options)];
74
93
  case 2:
75
- entryFileAbsolutePath = _a.sent();
94
+ entryFileAbsolutePath = _c.sent();
76
95
  return [4 /*yield*/, (0, appletUploadCommandHelper_1.getAppletDirectoryAbsolutePath)(currentDirectory, options)];
77
96
  case 3:
78
- projectDirAbsolutePath = _a.sent();
79
- return [4 /*yield*/, (0, appletStartCommandHelper_1.getAppletDirAbsolutePath)(currentDirectory, options)];
97
+ appletPath = _c.sent();
98
+ entryFileRelativePath = (0, appletUploadCommandHelper_1.getAppletEntryFileRelativePath)(entryFileAbsolutePath, appletPath);
99
+ return [4 /*yield*/, (0, emulatorFacade_1.loadEmulatorOrCreateNewAndReturnUid)(organizationUid)];
80
100
  case 4:
81
- appletDirAbsolutePath = _a.sent();
82
- return [4 /*yield*/, (0, appletUploadCommandHelper_1.getAppletEntryFileRelativePath)(entryFileAbsolutePath, appletDirAbsolutePath)];
101
+ emulatorUid = _c.sent();
102
+ dev = (0, dist_1.createDevelopment)({
103
+ organizationUid: organizationUid,
104
+ });
105
+ emulatorServerPort = (_a = options[PORT_OPTION.name]) !== null && _a !== void 0 ? _a : DEFAULT_PORT;
106
+ hotReloadEnabled = options[HOT_RELOAD_OPTION.name];
107
+ appletPort = options[appletServerHelper_1.SERVER_PORT_OPTION.name];
108
+ appletPublicUrl = options[appletServerHelper_1.SERVER_PUBLIC_URL_OPTION.name];
109
+ _c.label = 5;
83
110
  case 5:
84
- entryFileRelativePath = _a.sent();
85
- return [4 /*yield*/, (0, emulatorFacade_1.loadEmulatorOrCreateNewAndReturnUid)(organizationUid)];
111
+ _c.trys.push([5, 7, , 8]);
112
+ return [4 /*yield*/, dev.applet.identification.getAppletUidAndVersion(appletPath)];
86
113
  case 6:
87
- emulatorUid = _a.sent();
114
+ (_b = _c.sent(), appletUid = _b.appletUid, appletVersion = _b.appletVersion);
115
+ return [3 /*break*/, 8];
116
+ case 7:
117
+ e_1 = _c.sent();
118
+ (0, log_1.log)('warning', chalk_1.default.yellow('Applet is not uploaded yet. It cannot be developed on real device.'));
119
+ return [3 /*break*/, 8];
120
+ case 8: return [4 /*yield*/, (0, appletServerHelper_1.killAppletServerIfRunningAndForceOption)(dev, options, appletUid, appletVersion, appletPort)];
121
+ case 9:
122
+ _c.sent();
123
+ if (!hotReloadEnabled) return [3 /*break*/, 11];
124
+ return [4 /*yield*/, dev.applet.startHotReload({
125
+ appletPath: appletPath,
126
+ port: appletPort,
127
+ publicUrl: appletPublicUrl,
128
+ })];
129
+ case 10:
130
+ appletHotReload = _c.sent();
131
+ _c.label = 11;
132
+ case 11:
88
133
  createEmulatorParams = {
89
134
  emulatorUid: emulatorUid,
90
- appletPath: appletDirAbsolutePath,
91
- projectPath: projectDirAbsolutePath,
135
+ appletUid: appletUid,
136
+ appletVersion: appletVersion,
137
+ appletPath: appletPath,
92
138
  entryFileRelativePath: entryFileRelativePath,
93
139
  emulatorServerPort: emulatorServerPort,
94
140
  };
95
- return [4 /*yield*/, (0, emulatorFactory_1.createEmulator)(createEmulatorParams, organizationUid)];
96
- case 7:
97
- _a.sent();
141
+ return [4 /*yield*/, (0, emulatorFactory_1.createEmulator)(createEmulatorParams, organizationUid, dev)];
142
+ case 12:
143
+ emulator = _c.sent();
144
+ stopServer = function () { return __awaiter(_this, void 0, void 0, function () {
145
+ return __generator(this, function (_a) {
146
+ switch (_a.label) {
147
+ case 0: return [4 /*yield*/, (appletHotReload === null || appletHotReload === void 0 ? void 0 : appletHotReload.stop())];
148
+ case 1:
149
+ _a.sent();
150
+ return [4 /*yield*/, emulator.stop()];
151
+ case 2:
152
+ _a.sent();
153
+ process.exit();
154
+ return [2 /*return*/];
155
+ }
156
+ });
157
+ }); };
158
+ process.on('SIGINT', stopServer);
159
+ process.on('SIGTERM', stopServer);
160
+ console.info('Press Ctrl+C to stop');
161
+ return [4 /*yield*/, (0, wait_1.default)(1e9)];
162
+ case 13:
163
+ _c.sent(); // Wait forever
98
164
  return [2 /*return*/];
99
165
  }
100
166
  });
@@ -1 +1 @@
1
- {"version":3,"file":"appletStartCommand.js","sourceRoot":"","sources":["../../../src/Applet/Start/appletStartCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kEAAgE;AAChE,iFAM6C;AAC7C,uEAAsE;AACtE,gEAAoF;AACpF,qEAA8F;AAC9F,4EAAqJ;AAExI,QAAA,WAAW,GAAG;IAC1B,mDAA8B;IAC9B,4CAAuB;IACvB,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,gCAAgC,EAAE,YAAY,EAAE,IAAI,EAAE;IACjG,8CAAkB;IAClB,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,iCAAiC,EAAE;IACrF,kDAAsB;CACb,CAAC;AAEE,QAAA,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BACV,qBAAqB,uBAAA;4BACrB,kBAAkB,oBAAA;yBAClB,CAAC;wBACe,qBAAM,IAAA,gCAAc,EAAC,oBAAoB,EAAE,eAAe,EAAE,GAAG,CAAC,EAAA;;wBAA3E,QAAQ,GAAG,SAAgE;wBAE3E,UAAU,GAAG;;;4CAClB,qBAAM,CAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,IAAI,EAAE,CAAA,EAAA;;wCAA7B,SAA6B,CAAC;wCAC9B,qBAAM,QAAQ,CAAC,IAAI,EAAE,EAAA;;wCAArB,SAAqB,CAAC;wCACtB,OAAO,CAAC,IAAI,EAAE,CAAC;;;;6BACf,CAAC;wBACF,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;wBACjC,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;wBAElC,OAAO,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;wBACrC,qBAAM,IAAA,cAAI,EAAC,GAAG,CAAC,EAAA;;wBAAf,SAAe,CAAC,CAAC,eAAe;;;;;KAChC;CACD,CAAC,CAAC"}
@@ -37,6 +37,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.getAppletDirAbsolutePath = exports.DEFAULT_APPLET_DIR_PATH = void 0;
40
+ var log_1 = require("@signageos/sdk/dist/Console/log");
40
41
  var fs = require("fs-extra");
41
42
  var path = require("path");
42
43
  exports.DEFAULT_APPLET_DIR_PATH = 'dist';
@@ -56,7 +57,7 @@ function getAppletDirAbsolutePath(currentDirectory, options) {
56
57
  if (appletDirectoryPath.length > 1 && appletDirectoryPath[appletDirectoryPath.length - 1] === '/') {
57
58
  appletDirectoryPath = appletDirectoryPath.substring(0, appletDirectoryPath.length - 1);
58
59
  }
59
- console.log("\nUse applet directory path: ".concat(appletDirectoryPath));
60
+ (0, log_1.log)('info', "\nUse applet directory path: ".concat(appletDirectoryPath));
60
61
  return [4 /*yield*/, fs.pathExists(appletDirectoryPath)];
61
62
  case 1:
62
63
  appletDirectoryPathExists = _a.sent();
@@ -1 +1 @@
1
- {"version":3,"file":"appletStartCommandHelper.js","sourceRoot":"","sources":["../../../src/Applet/Start/appletStartCommandHelper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6BAA+B;AAC/B,2BAA6B;AAIhB,QAAA,uBAAuB,GAAG,MAAM,CAAC;AAE9C,SAAsB,wBAAwB,CAC7C,gBAAwB,EACxB,OAAwD;;;;;;oBAEpD,mBAAmB,GAAuB,OAAO,CAAC,aAAa,CAAC,CAAC;oBAErE,IAAI,CAAC,mBAAmB,EAAE;wBACzB,mBAAmB,GAAG,+BAAuB,CAAC;qBAC9C;oBACD,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC,EAAE;wBAC1C,mBAAmB,GAAG,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,CAAC;qBACvE;oBACD,IAAI,mBAAmB,CAAC,MAAM,GAAG,CAAC,IAAI,mBAAmB,CAAC,mBAAmB,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,GAAG,EAAE;wBAClG,mBAAmB,GAAG,mBAAmB,CAAC,SAAS,CAAC,CAAC,EAAE,mBAAmB,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;qBACvF;oBACD,OAAO,CAAC,GAAG,CAAC,uCAAgC,mBAAmB,CAAE,CAAC,CAAC;oBAEjC,qBAAM,EAAE,CAAC,UAAU,CAAC,mBAAmB,CAAC,EAAA;;oBAApE,yBAAyB,GAAG,SAAwC;oBAC1E,IAAI,CAAC,yBAAyB,EAAE;wBAC/B,MAAM,IAAI,KAAK,CAAC,sCAA+B,mBAAmB,CAAE,CAAC,CAAC;qBACtE;oBAEoB,qBAAM,EAAE,CAAC,IAAI,CAAC,mBAAmB,CAAC,EAAA;;oBAAjD,WAAW,GA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CAA+B,mBAAmB,CAAE,CAAC,CAAC;qBACtE;oBAEoB,qBAAM,EAAE,CAAC,IAAI,CAAC,mBAAmB,CAAC,EAAA;;oBAAjD,WAAW,GAAG,CAAC,SAAkC,CAAC,CAAC,WAAW,EAAE;oBACtE,IAAI,CAAC,WAAW,EAAE;wBACjB,MAAM,IAAI,KAAK,CAAC,0CAAmC,mBAAmB,CAAE,CAAC,CAAC;qBAC1E;oBAED,sBAAO,mBAAmB,EAAC;;;;CAC3B;AA5BD,4DA4BC"}
@@ -72,6 +72,7 @@ var deviceFacade_1 = require("../../../Device/deviceFacade");
72
72
  var appletTestRunFacade_1 = require("./appletTestRunFacade");
73
73
  var wait_1 = require("../../../Timer/wait");
74
74
  var commandDefinition_1 = require("../../../Command/commandDefinition");
75
+ var log_1 = require("@signageos/sdk/dist/Console/log");
75
76
  var OPTION_LIST = [
76
77
  organizationFacade_1.NO_DEFAULT_ORGANIZATION_OPTION,
77
78
  deviceFacade_1.DEVICE_UID_OPTION,
@@ -203,18 +204,18 @@ exports.appletTestRun = (0, commandDefinition_1.createCommandDefinition)({
203
204
  },
204
205
  });
205
206
  function displaySuccessMessage(appletName, appletVersion, deviceAppletTest) {
206
- console.log("Applet ".concat(chalk_1.default.green(appletName), " version ").concat(chalk_1.default.green(appletVersion), " tests ").concat(chalk_1.default.green('succeeded'), "."));
207
- deviceAppletTest.successfulTests.forEach(function (file) { return console.log(chalk_1.default.green('✓ ' + file)); });
207
+ (0, log_1.log)('info', "Applet ".concat(chalk_1.default.green(appletName), " version ").concat(chalk_1.default.green(appletVersion), " tests ").concat(chalk_1.default.green('succeeded'), "."));
208
+ deviceAppletTest.successfulTests.forEach(function (file) { return (0, log_1.log)('info', chalk_1.default.green('✓ ' + file)); });
208
209
  }
209
210
  function displayFailureMessage(appletName, appletVersion, deviceAppletTest) {
210
- console.log("Applet ".concat(chalk_1.default.green(appletName), " version ").concat(chalk_1.default.green(appletVersion), " tests ").concat(chalk_1.default.red('failed'), "."));
211
- deviceAppletTest.failedTests.forEach(function (file) { return console.log(chalk_1.default.red('× ' + file)); });
212
- deviceAppletTest.successfulTests.forEach(function (file) { return console.log(chalk_1.default.green('✓ ' + file)); });
211
+ (0, log_1.log)('info', "Applet ".concat(chalk_1.default.green(appletName), " version ").concat(chalk_1.default.green(appletVersion), " tests ").concat(chalk_1.default.red('failed'), "."));
212
+ deviceAppletTest.failedTests.forEach(function (file) { return (0, log_1.log)('info', chalk_1.default.red('× ' + file)); });
213
+ deviceAppletTest.successfulTests.forEach(function (file) { return (0, log_1.log)('info', chalk_1.default.green('✓ ' + file)); });
213
214
  }
214
215
  function printRunTests(identifiers) {
215
216
  if (identifiers.length > 0) {
216
- console.log(chalk_1.default.yellow("Next test files are going to be run..."));
217
+ (0, log_1.log)('info', chalk_1.default.yellow("Next test files are going to be run..."));
217
218
  }
218
- identifiers.forEach(function (file) { return console.log(file); });
219
+ identifiers.forEach(function (file) { return (0, log_1.log)('info', file); });
219
220
  }
220
221
  //# sourceMappingURL=appletTestRunCommand.js.map