@signageos/cli 0.10.2 → 1.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.
- package/CHANGELOG.md +16 -0
- package/README.md +16 -1
- package/config/parameters.d.ts +1 -0
- package/config/parameters.js +4 -0
- package/dist/Applet/Generate/appletGenerateCommand.d.ts +44 -2
- package/dist/Applet/Generate/appletGenerateCommand.js +44 -35
- package/dist/Applet/Generate/appletGenerateCommand.js.map +1 -1
- package/dist/Applet/Start/appletStartCommand.d.ts +59 -2
- package/dist/Applet/Start/appletStartCommand.js +31 -22
- package/dist/Applet/Start/appletStartCommand.js.map +1 -1
- package/dist/Applet/Start/appletStartCommandHelper.d.ts +3 -2
- package/dist/Applet/Start/appletStartCommandHelper.js +5 -4
- package/dist/Applet/Start/appletStartCommandHelper.js.map +1 -1
- package/dist/Applet/Test/Upload/appletTestRunCommand.d.ts +52 -2
- package/dist/Applet/Test/Upload/appletTestRunCommand.js +44 -36
- package/dist/Applet/Test/Upload/appletTestRunCommand.js.map +1 -1
- package/dist/Applet/Test/Upload/appletTestRunFacade.js +2 -1
- package/dist/Applet/Test/Upload/appletTestRunFacade.js.map +1 -1
- package/dist/Applet/Test/Upload/appletTestUploadCommand.d.ts +42 -2
- package/dist/Applet/Test/Upload/appletTestUploadCommand.js +45 -37
- package/dist/Applet/Test/Upload/appletTestUploadCommand.js.map +1 -1
- package/dist/Applet/Test/Upload/appletTestUploadFacade.js +2 -1
- package/dist/Applet/Test/Upload/appletTestUploadFacade.js.map +1 -1
- package/dist/Applet/Test/appletTestCommand.d.ts +93 -2
- package/dist/Applet/Test/appletTestCommand.js +4 -2
- package/dist/Applet/Test/appletTestCommand.js.map +1 -1
- package/dist/Applet/Upload/appletUploadCommand.d.ts +63 -5
- package/dist/Applet/Upload/appletUploadCommand.js +142 -150
- package/dist/Applet/Upload/appletUploadCommand.js.map +1 -1
- package/dist/Applet/Upload/appletUploadCommandHelper.d.ts +17 -5
- package/dist/Applet/Upload/appletUploadCommandHelper.js +30 -47
- package/dist/Applet/Upload/appletUploadCommandHelper.js.map +1 -1
- package/dist/Applet/Upload/appletUploadFacade.d.ts +0 -7
- package/dist/Applet/Upload/appletUploadFacade.js +21 -23
- package/dist/Applet/Upload/appletUploadFacade.js.map +1 -1
- package/dist/Applet/Upload/appletUploadFacadeHelper.js +5 -4
- package/dist/Applet/Upload/appletUploadFacadeHelper.js.map +1 -1
- package/dist/Applet/appletCommand.d.ts +257 -2
- package/dist/Applet/appletCommand.js +4 -2
- package/dist/Applet/appletCommand.js.map +1 -1
- package/dist/Applet/appletFacade.d.ts +1 -3
- package/dist/Applet/appletFacade.js +28 -53
- package/dist/Applet/appletFacade.js.map +1 -1
- package/dist/Auth/loginCommand.d.ts +18 -2
- package/dist/Auth/loginCommand.js +16 -13
- package/dist/Auth/loginCommand.js.map +1 -1
- package/dist/Cache/tmpCache.js +1 -0
- package/dist/Cache/tmpCache.js.map +1 -1
- package/dist/Cli/helper.js +1 -0
- package/dist/Cli/helper.js.map +1 -1
- package/dist/Cli/packageVersion.d.ts +0 -6
- package/dist/Cli/packageVersion.js +10 -15
- package/dist/Cli/packageVersion.js.map +1 -1
- package/dist/Command/commandDefinition.d.ts +28 -0
- package/dist/Command/commandDefinition.js +8 -0
- package/dist/Command/commandDefinition.js.map +1 -0
- package/dist/Command/commandProcessor.d.ts +2 -10
- package/dist/Command/commandProcessor.js +13 -20
- package/dist/Command/commandProcessor.js.map +1 -1
- package/dist/Command/globalArgs.d.ts +2 -0
- package/dist/Command/globalArgs.js +16 -0
- package/dist/Command/globalArgs.js.map +1 -0
- package/dist/CommandLine/progressBarFactory.js +1 -0
- package/dist/CommandLine/progressBarFactory.js.map +1 -1
- package/dist/Device/Connect/connectCommand.d.ts +50 -2
- package/dist/Device/Connect/connectCommand.js +23 -18
- package/dist/Device/Connect/connectCommand.js.map +1 -1
- package/dist/Device/Connect/connectHelper.d.ts +0 -1
- package/dist/Device/Connect/connectHelper.js +39 -75
- package/dist/Device/Connect/connectHelper.js.map +1 -1
- package/dist/Device/Content/setContentCommand.d.ts +42 -2
- package/dist/Device/Content/setContentCommand.js +21 -13
- package/dist/Device/Content/setContentCommand.js.map +1 -1
- package/dist/Device/PowerAction/powerActionCommand.d.ts +42 -2
- package/dist/Device/PowerAction/powerActionCommand.js +17 -13
- package/dist/Device/PowerAction/powerActionCommand.js.map +1 -1
- package/dist/Device/deviceCommand.d.ts +129 -2
- package/dist/Device/deviceCommand.js +4 -2
- package/dist/Device/deviceCommand.js.map +1 -1
- package/dist/Device/deviceFacade.d.ts +11 -10
- package/dist/Device/deviceFacade.js +20 -15
- package/dist/Device/deviceFacade.js.map +1 -1
- package/dist/Emulator/createDomain.js +3 -2
- package/dist/Emulator/createDomain.js.map +1 -1
- package/dist/Emulator/emulatorFacade.d.ts +3 -1
- package/dist/Emulator/emulatorFacade.js +29 -27
- package/dist/Emulator/emulatorFacade.js.map +1 -1
- package/dist/Emulator/emulatorFactory.d.ts +3 -1
- package/dist/Emulator/emulatorFactory.js +19 -17
- package/dist/Emulator/emulatorFactory.js.map +1 -1
- package/dist/FileSystem/helper.js +21 -15
- package/dist/FileSystem/helper.js.map +1 -1
- package/dist/FileSystem/packageConfig.js +1 -0
- package/dist/FileSystem/packageConfig.js.map +1 -1
- package/dist/Firmware/Upload/firmwareUploadCommand.d.ts +48 -2
- package/dist/Firmware/Upload/firmwareUploadCommand.js +33 -20
- package/dist/Firmware/Upload/firmwareUploadCommand.js.map +1 -1
- package/dist/Firmware/Upload/firmwareUploadFacade.js +5 -4
- package/dist/Firmware/Upload/firmwareUploadFacade.js.map +1 -1
- package/dist/Firmware/Upload/firmwareUploadHelper.js +2 -2
- package/dist/Firmware/Upload/firmwareUploadHelper.js.map +1 -1
- package/dist/Firmware/firmwareCommand.d.ts +51 -2
- package/dist/Firmware/firmwareCommand.js +5 -8
- package/dist/Firmware/firmwareCommand.js.map +1 -1
- package/dist/Helper/localMachineHelper.d.ts +1 -0
- package/dist/Helper/localMachineHelper.js +94 -0
- package/dist/Helper/localMachineHelper.js.map +1 -0
- package/dist/Organization/Get/organizationGetCommand.d.ts +26 -2
- package/dist/Organization/Get/organizationGetCommand.js +11 -7
- package/dist/Organization/Get/organizationGetCommand.js.map +1 -1
- package/dist/Organization/List/organizationListCommand.d.ts +7 -2
- package/dist/Organization/List/organizationListCommand.js +6 -4
- package/dist/Organization/List/organizationListCommand.js.map +1 -1
- package/dist/Organization/SetDefault/organizationSetDefaultCommand.d.ts +18 -2
- package/dist/Organization/SetDefault/organizationSetDefaultCommand.js +12 -9
- package/dist/Organization/SetDefault/organizationSetDefaultCommand.js.map +1 -1
- package/dist/Organization/organizationCommand.d.ts +49 -2
- package/dist/Organization/organizationCommand.js +4 -2
- package/dist/Organization/organizationCommand.js.map +1 -1
- package/dist/Organization/organizationFacade.d.ts +20 -5
- package/dist/Organization/organizationFacade.js +60 -12
- package/dist/Organization/organizationFacade.js.map +1 -1
- package/dist/RunControl/runControlHelper.d.ts +1 -1
- package/dist/RunControl/runControlHelper.js +38 -14
- package/dist/RunControl/runControlHelper.js.map +1 -1
- package/dist/Stream/helper.js +1 -0
- package/dist/Stream/helper.js.map +1 -1
- package/dist/Timing/List/timingListCommand.d.ts +34 -2
- package/dist/Timing/List/timingListCommand.js +14 -10
- package/dist/Timing/List/timingListCommand.js.map +1 -1
- package/dist/Timing/timingCommand.d.ts +37 -2
- package/dist/Timing/timingCommand.js +4 -2
- package/dist/Timing/timingCommand.js.map +1 -1
- package/dist/generalCommand.d.ts +64 -0
- package/dist/generalCommand.js +46 -0
- package/dist/generalCommand.js.map +1 -0
- package/dist/helper.d.ts +6 -2
- package/dist/helper.js +13 -12
- package/dist/helper.js.map +1 -1
- package/dist/index.js +6 -18
- package/dist/index.js.map +1 -1
- package/package-lock.json +1094 -870
- package/package.json +14 -13
- package/dist/Command/ICommand.d.ts +0 -10
- package/dist/Command/ICommand.js +0 -3
- package/dist/Command/ICommand.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,22 @@ 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.0.0] - 2022-04-06
|
|
8
|
+
### Added
|
|
9
|
+
- The appletUid does not have to be hardcoded inside package.json and is auto-detected from current organization based on name
|
|
10
|
+
- Support for profiles inside the ~/.sosrc file using ini `[profile xxx]` sections and SOS_PROFILE env. var. or `--profile` argument
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
- When default organization is not set it asks for saving it to the current ~/.sosrc file
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
- The option `--no-update-package-config` is reversed into option `--update-package-config` and by default the package.json is not updated. See README.
|
|
17
|
+
- The `defaultOrganizationUid` is now always used as default for all commands instead of selecting one. Use argument `--no-default-organization` or remove line `defaultOrganizationUid` from `~/.sosrc` to prevent this.
|
|
18
|
+
|
|
19
|
+
## [0.10.3] - 2022-01-18
|
|
20
|
+
### Fixed
|
|
21
|
+
- Compatibility with peer dependency for front-display version 9.13.0+ (because of changed API)
|
|
22
|
+
|
|
7
23
|
## [0.10.2] - 2021-12-17
|
|
8
24
|
### Fixed
|
|
9
25
|
- Listing timings
|
package/README.md
CHANGED
|
@@ -17,6 +17,7 @@ and [gitbash](https://gitforwindows.org/), run it in [windows terminal](https://
|
|
|
17
17
|
| Argument | Description | Default value |
|
|
18
18
|
|----------------------------|---------------------------------|---------------------------------------------------|
|
|
19
19
|
| --api-url *(optional)* | URL address to use for REST API | ${SOS_API_URL~'https://api.signageos.io'} |
|
|
20
|
+
| --profile *(optional)* | Profile used for separation of credentials and other configurations set in the `~/.sosrc` file | ${SOS_PROFILE} |
|
|
20
21
|
|
|
21
22
|
### Login
|
|
22
23
|
```bash
|
|
@@ -30,6 +31,19 @@ sos login
|
|
|
30
31
|
|----------------------------|---------------------------------|----------------|
|
|
31
32
|
| --username *(required)* | Username or e-mail user for box | STDIN |
|
|
32
33
|
|
|
34
|
+
#### Run control file
|
|
35
|
+
There are file created when run command `sos login` in the path `~/.sosrc`. This file contains by default only following values (as default profile is used).
|
|
36
|
+
```ini
|
|
37
|
+
identification=xxxxxxxxxxxxxxxxxxxx
|
|
38
|
+
apiSecurityToken=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
|
39
|
+
```
|
|
40
|
+
If you'd like to manage more accounts/configurations on one machine, you can use environment variable `SOS_PROFILE` or argument `--profile`. The configuration file will uses a INI section `profile xxxx` for the profile named `xxxx`. You can use as many profiles as you want.
|
|
41
|
+
```ini
|
|
42
|
+
[profile xxxx]
|
|
43
|
+
identification=xxxxxxxxxxxxxxxxxxxx
|
|
44
|
+
apiSecurityToken=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
|
45
|
+
```
|
|
46
|
+
|
|
33
47
|
### Applet
|
|
34
48
|
```bash
|
|
35
49
|
sos applet --help
|
|
@@ -146,6 +160,7 @@ sos organization get
|
|
|
146
160
|
|
|
147
161
|
#### Organization Set Default
|
|
148
162
|
- Sets default organization for current logged in account. This organization will be used for example in webpack plugin of applet to register emulator
|
|
163
|
+
- If you not set default organization, by default will be used the organization you will be asked to select from list where you have access to.
|
|
149
164
|
```bash
|
|
150
165
|
sos organization set-default
|
|
151
166
|
```
|
|
@@ -220,7 +235,7 @@ sos device connect
|
|
|
220
235
|
| --ip *(required)* | Ip address of computer in local network | Automatically get from networkInterface|
|
|
221
236
|
| --device-uid *(required)* | Uid of device from box' | STDIN |
|
|
222
237
|
| --applet-dir *(required)* | Directory of the applet project | ${PWD}|
|
|
223
|
-
| --
|
|
238
|
+
| --update-package-config *(optional)* | Update package.json value `sos.appletUid` config when applet doesn't exists and is created | false |
|
|
224
239
|
|
|
225
240
|
## Contribution
|
|
226
241
|
Clone the repository and install dev dependencies
|
package/config/parameters.d.ts
CHANGED
package/config/parameters.js
CHANGED
|
@@ -9,6 +9,9 @@ const distPath = rootPath + '/dist';
|
|
|
9
9
|
|
|
10
10
|
dotenv.config({ path: path.join(rootPath, '.env') });
|
|
11
11
|
|
|
12
|
+
if (process.env.SOS_PROFILE) {
|
|
13
|
+
console.warn(`Environment variable SOS_PROFILE found. Will use non default profile from ~/.sosrc`);
|
|
14
|
+
}
|
|
12
15
|
if (process.env.SOS_API_IDENTIFICATION) {
|
|
13
16
|
console.warn(`Environment variable SOS_API_IDENTIFICATION found. Will override default credentials from ~/.sosrc`);
|
|
14
17
|
}
|
|
@@ -31,6 +34,7 @@ module.exports = {
|
|
|
31
34
|
testsPath,
|
|
32
35
|
distPath,
|
|
33
36
|
},
|
|
37
|
+
profile: process.env.SOS_PROFILE,
|
|
34
38
|
apiUrl: process.env.SOS_API_URL,
|
|
35
39
|
boxHost: process.env.SOS_BOX_HOST,
|
|
36
40
|
applet: {
|
|
@@ -1,2 +1,44 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { CommandLineOptions } from '../../Command/commandDefinition';
|
|
2
|
+
declare const OPTION_LIST: readonly [{
|
|
3
|
+
readonly name: "name";
|
|
4
|
+
readonly type: StringConstructor;
|
|
5
|
+
readonly description: `Applet name. Match RegExp: ${string}`;
|
|
6
|
+
}, {
|
|
7
|
+
readonly name: "applet-version";
|
|
8
|
+
readonly type: StringConstructor;
|
|
9
|
+
readonly description: "Applet initial version. Use semantic version";
|
|
10
|
+
readonly defaultValue: "0.0.0";
|
|
11
|
+
}, {
|
|
12
|
+
readonly name: "target-dir";
|
|
13
|
+
readonly type: StringConstructor;
|
|
14
|
+
readonly description: "Directory where will be the applet generated to";
|
|
15
|
+
}, {
|
|
16
|
+
readonly name: "npm-registry";
|
|
17
|
+
readonly type: StringConstructor;
|
|
18
|
+
readonly description: "NPM registry URL. If you have your private npm registry";
|
|
19
|
+
}];
|
|
20
|
+
export declare const appletGenerate: {
|
|
21
|
+
name: "generate";
|
|
22
|
+
description: string;
|
|
23
|
+
optionList: readonly [{
|
|
24
|
+
readonly name: "name";
|
|
25
|
+
readonly type: StringConstructor;
|
|
26
|
+
readonly description: `Applet name. Match RegExp: ${string}`;
|
|
27
|
+
}, {
|
|
28
|
+
readonly name: "applet-version";
|
|
29
|
+
readonly type: StringConstructor;
|
|
30
|
+
readonly description: "Applet initial version. Use semantic version";
|
|
31
|
+
readonly defaultValue: "0.0.0";
|
|
32
|
+
}, {
|
|
33
|
+
readonly name: "target-dir";
|
|
34
|
+
readonly type: StringConstructor;
|
|
35
|
+
readonly description: "Directory where will be the applet generated to";
|
|
36
|
+
}, {
|
|
37
|
+
readonly name: "npm-registry";
|
|
38
|
+
readonly type: StringConstructor;
|
|
39
|
+
readonly description: "NPM registry URL. If you have your private npm registry";
|
|
40
|
+
}];
|
|
41
|
+
commands: never[];
|
|
42
|
+
run(options: CommandLineOptions<typeof OPTION_LIST>): Promise<void>;
|
|
43
|
+
};
|
|
44
|
+
export {};
|
|
@@ -62,32 +62,40 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
62
62
|
}
|
|
63
63
|
return ar;
|
|
64
64
|
};
|
|
65
|
-
var
|
|
66
|
-
for (var
|
|
67
|
-
|
|
65
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
66
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
67
|
+
if (ar || !(i in from)) {
|
|
68
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
69
|
+
ar[i] = from[i];
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
68
73
|
};
|
|
69
74
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
75
|
+
exports.appletGenerate = void 0;
|
|
70
76
|
var fs = require("fs-extra");
|
|
71
77
|
var child_process = require("child_process");
|
|
72
78
|
var chalk_1 = require("chalk");
|
|
73
79
|
var path = require("path");
|
|
74
80
|
var prompts = require("prompts");
|
|
81
|
+
var commandDefinition_1 = require("../../Command/commandDefinition");
|
|
75
82
|
var NAME_REGEXP = /^\w(\w|\d|-)*\w$/;
|
|
76
83
|
var NPM_EXECUTABLE = 'npm';
|
|
77
|
-
|
|
84
|
+
var OPTION_LIST = [
|
|
85
|
+
{ name: 'name', type: String, description: "Applet name. Match RegExp: ".concat(NAME_REGEXP.toString()) },
|
|
86
|
+
{ name: 'applet-version', type: String, description: "Applet initial version. Use semantic version", defaultValue: '0.0.0' },
|
|
87
|
+
{ name: 'target-dir', type: String, description: 'Directory where will be the applet generated to' },
|
|
88
|
+
{ name: 'npm-registry', type: String, description: "NPM registry URL. If you have your private npm registry" },
|
|
89
|
+
];
|
|
90
|
+
exports.appletGenerate = (0, commandDefinition_1.createCommandDefinition)({
|
|
78
91
|
name: 'generate',
|
|
79
92
|
description: 'Generate basic applet sample',
|
|
80
|
-
optionList:
|
|
81
|
-
{ name: 'name', type: String, description: "Applet name. Match RegExp: " + NAME_REGEXP.toString() },
|
|
82
|
-
{ name: 'applet-version', type: String, description: "Applet initial version. Use semantic version", defaultValue: '0.0.0' },
|
|
83
|
-
{ name: 'target-dir', type: String, description: 'Directory where will be the applet generated to' },
|
|
84
|
-
{ name: 'npm-registry', type: String, description: "NPM registry URL. If you have your private npm registry" },
|
|
85
|
-
],
|
|
93
|
+
optionList: OPTION_LIST,
|
|
86
94
|
commands: [],
|
|
87
95
|
run: function (options) {
|
|
88
96
|
return __awaiter(this, void 0, void 0, function () {
|
|
89
|
-
var currentDirectory, appletName, response, appletRootDirectory, appletRootDirectoryName, entryFileName, dependencies, fileExtensions, imports, rules, plugins, generateFiles,
|
|
90
|
-
var e_1, _f;
|
|
97
|
+
var currentDirectory, appletName, response, appletRootDirectory, appletRootDirectoryName, entryFileName, dependencies, fileExtensions, imports, rules, plugins, generateFiles, _a, _b, _c, _d, generateFiles_1, generateFiles_1_1, generateFile, e_1_1, child;
|
|
98
|
+
var _e, e_1, _f;
|
|
91
99
|
return __generator(this, function (_g) {
|
|
92
100
|
switch (_g.label) {
|
|
93
101
|
case 0:
|
|
@@ -108,13 +116,13 @@ exports.appletGenerate = {
|
|
|
108
116
|
throw new Error("Missing argument --name <string>");
|
|
109
117
|
}
|
|
110
118
|
if (!NAME_REGEXP.test(appletName)) {
|
|
111
|
-
throw new Error("Name has to match RegExp: "
|
|
119
|
+
throw new Error("Name has to match RegExp: ".concat(NAME_REGEXP.toString()));
|
|
112
120
|
}
|
|
113
121
|
appletRootDirectory = options['target-dir'] || path.join(currentDirectory, appletName);
|
|
114
122
|
appletRootDirectoryName = options['target-dir'] || appletName;
|
|
115
123
|
entryFileName = 'index.js';
|
|
116
124
|
dependencies = [
|
|
117
|
-
'@signageos/front-applet@
|
|
125
|
+
'@signageos/front-applet@latest',
|
|
118
126
|
'@signageos/front-display@latest',
|
|
119
127
|
'@signageos/webpack-plugin@latest',
|
|
120
128
|
'@babel/core@7',
|
|
@@ -141,19 +149,15 @@ exports.appletGenerate = {
|
|
|
141
149
|
"\t\t\tnew SignageOSPlugin()",
|
|
142
150
|
];
|
|
143
151
|
generateFiles = [];
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
}
|
|
147
|
-
else {
|
|
152
|
+
// TODO typescript support
|
|
153
|
+
{
|
|
148
154
|
generateFiles.push({
|
|
149
155
|
path: path.join(appletRootDirectory, 'src', 'index.js'),
|
|
150
156
|
content: createIndexJs(),
|
|
151
157
|
});
|
|
152
158
|
}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
}
|
|
156
|
-
else {
|
|
159
|
+
// TODO sass support
|
|
160
|
+
{
|
|
157
161
|
generateFiles.push({
|
|
158
162
|
path: path.join(appletRootDirectory, 'src', 'index.css'),
|
|
159
163
|
content: createIndexCss(),
|
|
@@ -165,16 +169,18 @@ exports.appletGenerate = {
|
|
|
165
169
|
content: createNpmRunControl(options['npm-registry']),
|
|
166
170
|
});
|
|
167
171
|
}
|
|
168
|
-
|
|
172
|
+
if (!options['applet-version']) {
|
|
173
|
+
throw new Error('Argument --applet-version is required');
|
|
174
|
+
}
|
|
169
175
|
_b = (_a = generateFiles).push;
|
|
170
|
-
|
|
176
|
+
_e = {
|
|
171
177
|
path: path.join(appletRootDirectory, 'package.json')
|
|
172
178
|
};
|
|
173
|
-
|
|
174
|
-
return [4 /*yield*/, createPackageConfig(appletName, options[
|
|
179
|
+
_d = (_c = JSON).stringify;
|
|
180
|
+
return [4 /*yield*/, createPackageConfig(appletName, options['applet-version'])];
|
|
175
181
|
case 3:
|
|
176
|
-
_b.apply(_a, [(
|
|
177
|
-
|
|
182
|
+
_b.apply(_a, [(_e.content = _d.apply(_c, [_g.sent(), undefined, 2]) + '\n',
|
|
183
|
+
_e)]);
|
|
178
184
|
generateFiles.push({
|
|
179
185
|
path: path.join(appletRootDirectory, 'webpack.config.js'),
|
|
180
186
|
content: createWebpackConfig(entryFileName, fileExtensions, imports, rules, plugins),
|
|
@@ -221,20 +227,20 @@ exports.appletGenerate = {
|
|
|
221
227
|
return [7 /*endfinally*/];
|
|
222
228
|
case 13:
|
|
223
229
|
process.chdir(appletRootDirectory);
|
|
224
|
-
child = child_process.spawn(NPM_EXECUTABLE,
|
|
230
|
+
child = child_process.spawn(NPM_EXECUTABLE, __spreadArray(['install', '--save-dev'], __read(dependencies), false), {
|
|
225
231
|
stdio: 'inherit',
|
|
226
232
|
shell: true,
|
|
227
233
|
});
|
|
228
234
|
child.on('close', function () {
|
|
229
|
-
console.log("\nApplet "
|
|
230
|
-
console.log("use: cd "
|
|
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"));
|
|
231
237
|
});
|
|
232
238
|
return [2 /*return*/];
|
|
233
239
|
}
|
|
234
240
|
});
|
|
235
241
|
});
|
|
236
242
|
},
|
|
237
|
-
};
|
|
243
|
+
});
|
|
238
244
|
function createPackageConfig(name, version) {
|
|
239
245
|
return __awaiter(this, void 0, void 0, function () {
|
|
240
246
|
return __generator(this, function (_a) {
|
|
@@ -253,13 +259,16 @@ function createPackageConfig(name, version) {
|
|
|
253
259
|
connect: "webpack --watch",
|
|
254
260
|
},
|
|
255
261
|
files: ['dist'],
|
|
262
|
+
description: "signageOS applet",
|
|
263
|
+
repository: {},
|
|
264
|
+
license: "UNLICENSED",
|
|
256
265
|
}];
|
|
257
266
|
});
|
|
258
267
|
});
|
|
259
268
|
}
|
|
260
|
-
var createWebpackConfig = function (entryFileName, fileExtensions, imports, rules, plugins) { return "\n"
|
|
261
|
-
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>"
|
|
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\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 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"); };
|
|
262
271
|
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"; };
|
|
263
272
|
var createIndexCss = function () { return "\nbody {\n\tbackground-color: wheat;\n\ttext-align: center;\n}\n"; };
|
|
264
|
-
var createNpmRunControl = function (registryUrl) { return "\nregistry="
|
|
273
|
+
var createNpmRunControl = function (registryUrl) { return "\nregistry=".concat(registryUrl, "\nalways-auth=true\n"); };
|
|
265
274
|
//# sourceMappingURL=appletGenerateCommand.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appletGenerateCommand.js","sourceRoot":"","sources":["../../../src/Applet/Generate/appletGenerateCommand.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"appletGenerateCommand.js","sourceRoot":"","sources":["../../../src/Applet/Generate/appletGenerateCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6BAA+B;AAC/B,6CAA+C;AAC/C,+BAA0B;AAC1B,2BAA6B;AAC7B,iCAAmC;AACnC,qEAA8F;AAE9F,IAAM,WAAW,GAAG,kBAAkB,CAAC;AACvC,IAAM,cAAc,GAAG,KAAK,CAAC;AAO7B,IAAM,WAAW,GAAG;IACnB,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,qCAA8B,WAAW,CAAC,QAAQ,EAAE,CAAE,EAAE;IACnG,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,8CAA8C,EAAE,YAAY,EAAE,OAAO,EAAE;IAC5H,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,iDAAiD,EAA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BI,CAoBJ,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"}
|
|
@@ -1,2 +1,59 @@
|
|
|
1
|
-
import
|
|
2
|
-
export declare const
|
|
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: "port";
|
|
12
|
+
readonly type: NumberConstructor;
|
|
13
|
+
readonly description: "Port where will the applet run";
|
|
14
|
+
readonly defaultValue: 8090;
|
|
15
|
+
}, {
|
|
16
|
+
readonly name: "applet-path";
|
|
17
|
+
readonly type: StringConstructor;
|
|
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
|
+
}, {
|
|
24
|
+
readonly name: "entry-file-path";
|
|
25
|
+
readonly type: StringConstructor;
|
|
26
|
+
readonly description: "Path to the applet entry file. Relative to the command or absolute.";
|
|
27
|
+
}];
|
|
28
|
+
export declare const appletStart: {
|
|
29
|
+
name: "start";
|
|
30
|
+
description: string;
|
|
31
|
+
optionList: readonly [{
|
|
32
|
+
readonly name: "no-default-organization";
|
|
33
|
+
readonly type: BooleanConstructor;
|
|
34
|
+
readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc which were set using command sos organization set-default";
|
|
35
|
+
}, {
|
|
36
|
+
readonly name: "organization-uid";
|
|
37
|
+
readonly type: StringConstructor;
|
|
38
|
+
readonly description: "Organization UID";
|
|
39
|
+
}, {
|
|
40
|
+
readonly name: "port";
|
|
41
|
+
readonly type: NumberConstructor;
|
|
42
|
+
readonly description: "Port where will the applet run";
|
|
43
|
+
readonly defaultValue: 8090;
|
|
44
|
+
}, {
|
|
45
|
+
readonly name: "applet-path";
|
|
46
|
+
readonly type: StringConstructor;
|
|
47
|
+
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
|
+
}, {
|
|
53
|
+
readonly name: "entry-file-path";
|
|
54
|
+
readonly type: StringConstructor;
|
|
55
|
+
readonly description: "Path to the applet entry file. Relative to the command or absolute.";
|
|
56
|
+
}];
|
|
57
|
+
commands: never[];
|
|
58
|
+
run(options: CommandLineOptions<typeof OPTION_LIST>): Promise<void>;
|
|
59
|
+
};
|
|
@@ -36,51 +36,60 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.appletStart = exports.OPTION_LIST = void 0;
|
|
39
40
|
var emulatorFactory_1 = require("../../Emulator/emulatorFactory");
|
|
40
|
-
var appletUploadCommand_1 = require("../Upload/appletUploadCommand");
|
|
41
41
|
var appletUploadCommandHelper_1 = require("../Upload/appletUploadCommandHelper");
|
|
42
42
|
var appletStartCommandHelper_1 = require("./appletStartCommandHelper");
|
|
43
43
|
var emulatorFacade_1 = require("../../Emulator/emulatorFacade");
|
|
44
|
-
|
|
44
|
+
var commandDefinition_1 = require("../../Command/commandDefinition");
|
|
45
|
+
var organizationFacade_1 = require("../../Organization/organizationFacade");
|
|
46
|
+
exports.OPTION_LIST = [
|
|
47
|
+
organizationFacade_1.NO_DEFAULT_ORGANIZATION_OPTION,
|
|
48
|
+
organizationFacade_1.ORGANIZATION_UID_OPTION,
|
|
49
|
+
{ name: 'port', type: Number, description: "Port where will the applet run", defaultValue: 8090 },
|
|
50
|
+
appletUploadCommandHelper_1.APPLET_PATH_OPTION,
|
|
51
|
+
{ name: 'project-dir', type: String, description: 'Directory of the applet project' },
|
|
52
|
+
appletUploadCommandHelper_1.ENTRY_FILE_PATH_OPTION,
|
|
53
|
+
];
|
|
54
|
+
exports.appletStart = (0, commandDefinition_1.createCommandDefinition)({
|
|
45
55
|
name: 'start',
|
|
46
56
|
description: 'Start applet locally',
|
|
47
|
-
optionList:
|
|
48
|
-
{ name: 'port', type: Number, description: "Port where will the applet run", defaultValue: 8090 },
|
|
49
|
-
{ name: 'applet-dir', type: String, description: 'Directory of the applet to start' },
|
|
50
|
-
{ name: 'project-dir', type: String, description: 'Directory of the applet project' },
|
|
51
|
-
appletUploadCommand_1.ENTRY_FILE_PATH_OPTION,
|
|
52
|
-
],
|
|
57
|
+
optionList: exports.OPTION_LIST,
|
|
53
58
|
commands: [],
|
|
54
59
|
run: function (options) {
|
|
55
60
|
return __awaiter(this, void 0, void 0, function () {
|
|
56
|
-
var currentDirectory, emulatorServerPort, entryFileAbsolutePath, projectDirAbsolutePath, appletDirAbsolutePath, entryFileRelativePath, emulatorUid;
|
|
61
|
+
var currentDirectory, emulatorServerPort, entryFileAbsolutePath, projectDirAbsolutePath, appletDirAbsolutePath, entryFileRelativePath, emulatorUid, createEmulatorParams;
|
|
57
62
|
return __generator(this, function (_a) {
|
|
58
63
|
switch (_a.label) {
|
|
59
64
|
case 0:
|
|
60
65
|
currentDirectory = process.cwd();
|
|
66
|
+
if (!options.port) {
|
|
67
|
+
throw new Error('Argument --port is required');
|
|
68
|
+
}
|
|
61
69
|
emulatorServerPort = options.port;
|
|
62
|
-
return [4 /*yield*/, appletUploadCommandHelper_1.getAppletEntryFileAbsolutePath(currentDirectory, options)];
|
|
70
|
+
return [4 /*yield*/, (0, appletUploadCommandHelper_1.getAppletEntryFileAbsolutePath)(currentDirectory, options)];
|
|
63
71
|
case 1:
|
|
64
72
|
entryFileAbsolutePath = _a.sent();
|
|
65
|
-
return [4 /*yield*/, appletUploadCommandHelper_1.getAppletDirectoryAbsolutePath(currentDirectory, options)];
|
|
73
|
+
return [4 /*yield*/, (0, appletUploadCommandHelper_1.getAppletDirectoryAbsolutePath)(currentDirectory, options)];
|
|
66
74
|
case 2:
|
|
67
75
|
projectDirAbsolutePath = _a.sent();
|
|
68
|
-
return [4 /*yield*/, appletStartCommandHelper_1.getAppletDirAbsolutePath(currentDirectory, options)];
|
|
76
|
+
return [4 /*yield*/, (0, appletStartCommandHelper_1.getAppletDirAbsolutePath)(currentDirectory, options)];
|
|
69
77
|
case 3:
|
|
70
78
|
appletDirAbsolutePath = _a.sent();
|
|
71
|
-
return [4 /*yield*/, appletUploadCommandHelper_1.getAppletEntryFileRelativePath(entryFileAbsolutePath, appletDirAbsolutePath)];
|
|
79
|
+
return [4 /*yield*/, (0, appletUploadCommandHelper_1.getAppletEntryFileRelativePath)(entryFileAbsolutePath, appletDirAbsolutePath)];
|
|
72
80
|
case 4:
|
|
73
81
|
entryFileRelativePath = _a.sent();
|
|
74
|
-
return [4 /*yield*/, emulatorFacade_1.loadEmulatorOrCreateNewAndReturnUid()];
|
|
82
|
+
return [4 /*yield*/, (0, emulatorFacade_1.loadEmulatorOrCreateNewAndReturnUid)(options)];
|
|
75
83
|
case 5:
|
|
76
84
|
emulatorUid = _a.sent();
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
85
|
+
createEmulatorParams = {
|
|
86
|
+
emulatorUid: emulatorUid,
|
|
87
|
+
appletPath: appletDirAbsolutePath,
|
|
88
|
+
projectPath: projectDirAbsolutePath,
|
|
89
|
+
entryFileRelativePath: entryFileRelativePath,
|
|
90
|
+
emulatorServerPort: emulatorServerPort,
|
|
91
|
+
};
|
|
92
|
+
return [4 /*yield*/, (0, emulatorFactory_1.createEmulator)(createEmulatorParams, options)];
|
|
84
93
|
case 6:
|
|
85
94
|
_a.sent();
|
|
86
95
|
return [2 /*return*/];
|
|
@@ -88,5 +97,5 @@ exports.appletStart = {
|
|
|
88
97
|
});
|
|
89
98
|
});
|
|
90
99
|
},
|
|
91
|
-
};
|
|
100
|
+
});
|
|
92
101
|
//# sourceMappingURL=appletStartCommand.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appletStartCommand.js","sourceRoot":"","sources":["../../../src/Applet/Start/appletStartCommand.ts"],"names":[],"mappings":"
|
|
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,4EAAgH;AAEnG,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,WAAW,GAAG,IAAA,2CAAuB,EAAC;IAClD,IAAI,EAAE,OAAO;IACb,WAAW,EAAE,sBAAsB;IACnC,UAAU,EAAE,mBAAW;IACvB,QAAQ,EAAE,EAAE;IACN,GAAG,EAAT,UAAU,OAA+C;;;;;;wBAClD,gBAAgB,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;wBAEvC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE;4BAClB,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;yBAC/C;wBACK,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;wBACV,qBAAM,IAAA,0DAA8B,EAAC,gBAAgB,EAAE,OAAO,CAAC,EAAA;;wBAAvF,qBAAqB,GAAG,SAA+D;wBAC9D,qBAAM,IAAA,0DAAyB,EAAC,gBAAgB,EAAE,OAAO,CAAC,EAAA;;wBAAnF,sBAAsB,GAAG,SAA0D;wBAC3D,qBAAM,IAAA,mDAAwB,EAAC,gBAAgB,EAAE,OAAO,CAAC,EAAA;;wBAAjF,qBAAqB,GAAG,SAAyD;wBACzD,qBAAM,IAAA,0DAA8B,EAAC,qBAAqB,EAAE,qBAAqB,CAAC,EAAA;;wBAA1G,qBAAqB,GAAG,SAAkF;wBAC5F,qBAAM,IAAA,oDAAmC,EAAC,OAAO,CAAC,EAAA;;wBAAhE,WAAW,GAAG,SAAkD;wBAEhE,oBAAoB,GAAG;4BAC5B,WAAW,aAAA;4BACX,UAAU,EAAE,qBAAqB;4BACjC,WAAW,EAAE,sBAAsB;4BACnC,qBAAqB,uBAAA;4BACrB,kBAAkB,oBAAA;yBAClB,CAAC;wBACF,qBAAM,IAAA,gCAAc,EAAC,oBAAoB,EAAE,OAAO,CAAC,EAAA;;wBAAnD,SAAmD,CAAC;;;;;KACpD;CACD,CAAC,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import { CommandLineOptions } from '
|
|
1
|
+
import { CommandLineOptions } from '../../Command/commandDefinition';
|
|
2
|
+
import { APPLET_PATH_OPTION } from '../Upload/appletUploadCommandHelper';
|
|
2
3
|
export declare const DEFAULT_APPLET_DIR_PATH = "dist";
|
|
3
|
-
export declare function getAppletDirAbsolutePath(currentDirectory: string, options: CommandLineOptions): Promise<string>;
|
|
4
|
+
export declare function getAppletDirAbsolutePath(currentDirectory: string, options: CommandLineOptions<[typeof APPLET_PATH_OPTION]>): Promise<string>;
|
|
@@ -36,6 +36,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.getAppletDirAbsolutePath = exports.DEFAULT_APPLET_DIR_PATH = void 0;
|
|
39
40
|
var fs = require("fs-extra");
|
|
40
41
|
var path = require("path");
|
|
41
42
|
exports.DEFAULT_APPLET_DIR_PATH = 'dist';
|
|
@@ -45,7 +46,7 @@ function getAppletDirAbsolutePath(currentDirectory, options) {
|
|
|
45
46
|
return __generator(this, function (_a) {
|
|
46
47
|
switch (_a.label) {
|
|
47
48
|
case 0:
|
|
48
|
-
appletDirectoryPath = options['applet-
|
|
49
|
+
appletDirectoryPath = options['applet-path'];
|
|
49
50
|
if (!appletDirectoryPath) {
|
|
50
51
|
appletDirectoryPath = exports.DEFAULT_APPLET_DIR_PATH;
|
|
51
52
|
}
|
|
@@ -55,18 +56,18 @@ function getAppletDirAbsolutePath(currentDirectory, options) {
|
|
|
55
56
|
if (appletDirectoryPath.length > 1 && appletDirectoryPath[appletDirectoryPath.length - 1] === '/') {
|
|
56
57
|
appletDirectoryPath = appletDirectoryPath.substring(0, appletDirectoryPath.length - 1);
|
|
57
58
|
}
|
|
58
|
-
console.log("\nUse applet directory path: "
|
|
59
|
+
console.log("\nUse applet directory path: ".concat(appletDirectoryPath));
|
|
59
60
|
return [4 /*yield*/, fs.pathExists(appletDirectoryPath)];
|
|
60
61
|
case 1:
|
|
61
62
|
appletDirectoryPathExists = _a.sent();
|
|
62
63
|
if (!appletDirectoryPathExists) {
|
|
63
|
-
throw new Error("Applet directory not found: "
|
|
64
|
+
throw new Error("Applet directory not found: ".concat(appletDirectoryPath));
|
|
64
65
|
}
|
|
65
66
|
return [4 /*yield*/, fs.stat(appletDirectoryPath)];
|
|
66
67
|
case 2:
|
|
67
68
|
isDirectory = (_a.sent()).isDirectory();
|
|
68
69
|
if (!isDirectory) {
|
|
69
|
-
throw new Error("Applet path is not a directory: "
|
|
70
|
+
throw new Error("Applet path is not a directory: ".concat(appletDirectoryPath));
|
|
70
71
|
}
|
|
71
72
|
return [2 /*return*/, appletDirectoryPath];
|
|
72
73
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appletStartCommandHelper.js","sourceRoot":"","sources":["../../../src/Applet/Start/appletStartCommandHelper.ts"],"names":[],"mappings":"
|
|
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,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"}
|
|
@@ -1,2 +1,52 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { CommandLineOptions } from '../../../Command/commandDefinition';
|
|
2
|
+
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: "device-uid";
|
|
8
|
+
readonly type: StringConstructor;
|
|
9
|
+
readonly description: "Device UID";
|
|
10
|
+
}, {
|
|
11
|
+
readonly name: "organization-uid";
|
|
12
|
+
readonly type: StringConstructor;
|
|
13
|
+
readonly description: "Organization UID";
|
|
14
|
+
}, {
|
|
15
|
+
readonly name: "test";
|
|
16
|
+
readonly type: StringConstructor;
|
|
17
|
+
readonly multiple: true;
|
|
18
|
+
readonly description: "Specify the test identifiers/files to be run. If not specified, all will be run.";
|
|
19
|
+
}, {
|
|
20
|
+
readonly name: "yes";
|
|
21
|
+
readonly type: BooleanConstructor;
|
|
22
|
+
readonly description: "Allow to run applet test without confirmation step";
|
|
23
|
+
}];
|
|
24
|
+
export declare const appletTestRun: {
|
|
25
|
+
name: "run";
|
|
26
|
+
description: string;
|
|
27
|
+
optionList: readonly [{
|
|
28
|
+
readonly name: "no-default-organization";
|
|
29
|
+
readonly type: BooleanConstructor;
|
|
30
|
+
readonly description: "Prevent using the defaultOrganizationUid from ~/.sosrc which were set using command sos organization set-default";
|
|
31
|
+
}, {
|
|
32
|
+
readonly name: "device-uid";
|
|
33
|
+
readonly type: StringConstructor;
|
|
34
|
+
readonly description: "Device UID";
|
|
35
|
+
}, {
|
|
36
|
+
readonly name: "organization-uid";
|
|
37
|
+
readonly type: StringConstructor;
|
|
38
|
+
readonly description: "Organization UID";
|
|
39
|
+
}, {
|
|
40
|
+
readonly name: "test";
|
|
41
|
+
readonly type: StringConstructor;
|
|
42
|
+
readonly multiple: true;
|
|
43
|
+
readonly description: "Specify the test identifiers/files to be run. If not specified, all will be run.";
|
|
44
|
+
}, {
|
|
45
|
+
readonly name: "yes";
|
|
46
|
+
readonly type: BooleanConstructor;
|
|
47
|
+
readonly description: "Allow to run applet test without confirmation step";
|
|
48
|
+
}];
|
|
49
|
+
commands: never[];
|
|
50
|
+
run(options: CommandLineOptions<typeof OPTION_LIST>): Promise<void>;
|
|
51
|
+
};
|
|
52
|
+
export {};
|