@signageos/cli 2.3.2 → 2.4.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 (59) hide show
  1. package/README.md +53 -19
  2. package/dist/Applet/Generate/Templates/CHANGELOG.md.template +7 -0
  3. package/dist/Applet/Generate/Templates/README.md.template +3 -0
  4. package/dist/Applet/Generate/appletGenerateCommand.js +47 -13
  5. package/dist/Applet/Start/appletStartCommand.js +1 -1
  6. package/dist/Applet/Test/Upload/appletTestRunCommand.js +1 -1
  7. package/dist/Applet/Test/Upload/appletTestRunFacade.js +1 -2
  8. package/dist/Applet/Test/Upload/appletTestUploadCommand.js +5 -5
  9. package/dist/Applet/Test/Upload/appletTestUploadFacade.js +19 -10
  10. package/dist/Applet/Upload/appletUploadCommandHelper.js +36 -16
  11. package/dist/Applet/Upload/appletUploadFacade.js +19 -9
  12. package/dist/Applet/Upload/appletUploadFacadeHelper.js +19 -10
  13. package/dist/Applet/appletCommand.d.ts +3 -95
  14. package/dist/Applet/appletFacade.js +25 -15
  15. package/dist/Applet/appletServerHelper.js +2 -2
  16. package/dist/Auth/loginCommand.d.ts +2 -2
  17. package/dist/Auth/loginCommand.js +19 -9
  18. package/dist/Cache/tmpCache.js +19 -10
  19. package/dist/Cli/helper.js +2 -3
  20. package/dist/Cli/packageVersion.js +24 -15
  21. package/dist/Command/Autocomplete/Install/installAutocompleteCommand.d.ts +10 -0
  22. package/dist/Command/Autocomplete/Install/installAutocompleteCommand.js +39 -0
  23. package/dist/Command/Autocomplete/Install/installAutocompleteCommand.ts +30 -0
  24. package/dist/Command/Autocomplete/Install/sos-completion.sh +63 -0
  25. package/dist/Command/Autocomplete/Uninstall/uninstallAutocompleteCommand.d.ts +8 -0
  26. package/dist/Command/Autocomplete/Uninstall/uninstallAutocompleteCommand.js +120 -0
  27. package/dist/Command/Autocomplete/autocompleteCommand.d.ts +22 -0
  28. package/dist/Command/Autocomplete/autocompleteCommand.js +32 -0
  29. package/dist/Command/autoComplete.d.ts +4 -0
  30. package/dist/Command/autoComplete.js +184 -0
  31. package/dist/Command/commandDefinition.d.ts +9 -9
  32. package/dist/Command/commandDefinition.js +1 -2
  33. package/dist/Command/commandProcessor.js +3 -4
  34. package/dist/Command/globalArgs.js +2 -3
  35. package/dist/CommandLine/progressBarFactory.d.ts +1 -1
  36. package/dist/CommandLine/progressBarFactory.js +18 -9
  37. package/dist/CustomScript/Generate/customScriptGenerateFacade.js +19 -10
  38. package/dist/CustomScript/customScriptCommand.d.ts +1 -9
  39. package/dist/CustomScript/customScriptFacade.d.ts +2 -2
  40. package/dist/CustomScript/customScriptFacade.js +27 -18
  41. package/dist/Device/Connect/connectCommand.js +1 -1
  42. package/dist/Device/deviceFacade.js +4 -4
  43. package/dist/Emulator/createDomain.d.ts +0 -1
  44. package/dist/Emulator/createDomain.js +18 -9
  45. package/dist/Emulator/emulatorFacade.js +2 -3
  46. package/dist/Emulator/emulatorFactory.js +19 -10
  47. package/dist/Firmware/Upload/firmwareUploadFacade.js +18 -9
  48. package/dist/Firmware/Upload/firmwareUploadHelper.js +18 -8
  49. package/dist/Lib/archive.js +18 -9
  50. package/dist/Lib/childProcess.js +17 -7
  51. package/dist/Lib/fileSystem.js +21 -12
  52. package/dist/Lib/git.js +23 -14
  53. package/dist/Organization/organizationFacade.js +6 -6
  54. package/dist/RunControl/runControlHelper.js +3 -4
  55. package/dist/Timer/wait.js +1 -1
  56. package/dist/helper.d.ts +4 -4
  57. package/dist/helper.js +13 -13
  58. package/dist/index.js +4 -1
  59. package/package.json +43 -46
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # CLI program
1
+ # signageOS CLI
2
2
 
3
3
  signageOS command-line interface which helps you develop your applets locally and manage devices from terminal.
4
4
 
@@ -12,6 +12,39 @@ 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
+ ### Autocomplete
16
+ signageOS CLI offers tab completion for commands and options, which enhances the user experience by making it easier to discover and use available commands.
17
+
18
+ #### Installation
19
+ To enable autocomplete in your shell, use the following command:
20
+ ```sh
21
+ sos autocomplete install
22
+ ```
23
+
24
+ This will install a completion script in your home directory and add a source line to your shell configuration file (`.zshrc`, `.bashrc`, or `.bash_profile`, depending on your shell).
25
+
26
+ To start using autocomplete immediately without restarting your terminal, run:
27
+ ```sh
28
+ source ~/.sos-completion.sh
29
+ ```
30
+
31
+ #### Usage
32
+ Once autocomplete is installed, you can use the TAB key to discover and complete commands:
33
+ ```sh
34
+ sos [TAB] # Show all top-level commands
35
+ sos applet [TAB] # Show all applet subcommands
36
+ sos applet up[TAB] # Autocomplete to "sos applet upload"
37
+ ```
38
+
39
+ #### Uninstallation
40
+ If you want to disable autocomplete, use:
41
+ ```sh
42
+ sos autocomplete uninstall
43
+ ```
44
+
45
+ This will remove the completion script and the source line from your shell configuration file.
46
+
47
+
15
48
  ## Test
16
49
  ```bash
17
50
  cp .env.amy .env
@@ -22,7 +55,7 @@ npm test
22
55
  ### General
23
56
  | Argument | Description | Default value |
24
57
  |----------------------------|---------------------------------|---------------------------------------------------|
25
- | --api-url *(optional)* | URL address to use for REST API | ${SOS_API_URL~'https://api.signageos.io'} |
58
+ | --api-url *(optional)* | URL address to use for REST API | ${SOS_API_URL='https://api.signageos.io'} |
26
59
  | --profile *(optional)* | Profile used for separation of credentials and other configurations set in the `~/.sosrc` file | ${SOS_PROFILE} |
27
60
 
28
61
  ### Login
@@ -32,21 +65,21 @@ npm test
32
65
  ```bash
33
66
  sos login
34
67
  ```
35
- - Login account to allow use REST API commands
68
+ - Login account to allow you to use REST API commands
36
69
  - Logged account credentials are stored in `~/.sosrc` file.
37
- - You override login credentials using environment variables `SOS_API_IDENTIFICATION` & `SOS_API_SECURITY_TOKEN`. Go to https://box.signageos.io/settings to generate the token.
70
+ - You can override login credentials using environment variables `SOS_API_IDENTIFICATION` & `SOS_API_SECURITY_TOKEN`. Go to https://box.signageos.io/settings to generate the token.
38
71
 
39
72
  | Argument | Description | Default value |
40
73
  |----------------------------|---------------------------------|----------------|
41
74
  | --username *(required)* | Username or e-mail user for box | STDIN |
42
75
 
43
76
  #### Run control file
44
- 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).
77
+ There is a file created when running command `sos login` in the path `~/.sosrc`. This file contains by default only the following values (as default profile is used).
45
78
  ```ini
46
79
  identification=xxxxxxxxxxxxxxxxxxxx
47
80
  apiSecurityToken=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
48
81
  ```
49
- 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.
82
+ 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 use an INI section `profile xxxx` for the profile named `xxxx`. You can use as many profiles as you want.
50
83
  ```ini
51
84
  [profile xxxx]
52
85
  identification=xxxxxxxxxxxxxxxxxxxx
@@ -79,9 +112,9 @@ npm run build
79
112
  | --packager *(optional)* | Use preferred package manager "npm", "pnpm", "bun", "yarn" | npm |
80
113
 
81
114
  > ! Windows users note:
82
- > There are unresolved issue with NPX tool on Windows clients when your username contains spaces (e.g.: `John Doe`).
115
+ > There is an unresolved issue with NPX tool on Windows clients when your username contains spaces (e.g.: `John Doe`).
83
116
  > https://stackoverflow.com/a/58354623/4609457
84
- > To prevent this issue there is simple hotfix. Run following command in your Command Line (replace `John` with your real first name):
117
+ > To prevent this issue there is a simple hotfix. Run following command in your Command Line (replace `John` with your real first name):
85
118
  > Sometimes the Administrator privileges are required (Run as Administrator)
86
119
  ```cmd
87
120
  npm config set cache "C:\Users\John~1\AppData\Roaming\npm-cache" --global
@@ -96,7 +129,7 @@ npm run upload
96
129
  #Deprecated
97
130
  sos applet upload --applet-path=dist/index.html
98
131
  # This will upload only the one specified file
99
- # Rest of the files will be removed from our servers
132
+ # The rest of the files will be removed from our servers
100
133
  ```
101
134
  - If applet is not created yet, it will create it
102
135
  - The applet version is used from `package.json`
@@ -104,7 +137,7 @@ sos applet upload --applet-path=dist/index.html
104
137
  - You can use SOS_APPLET_UID as environment variable to specify appletUid to upload to (sos.appletUid of package.json will be overlooked).
105
138
  - You can use SOS_APPLET_VERSION as environment variable to specify applet version to upload to (version of package.json will be overlooked).
106
139
  - Ignore files priority (from top to bottom) `.sosignore` > `.npmignore` > `.gitignore`
107
- - Only one ignore file is used or non
140
+ - Only one ignore file is used or none
108
141
 
109
142
  | Argument | Description | Default value |
110
143
  |--------------------------------|-------------------------------|------------------------|
@@ -139,7 +172,7 @@ sos applet start
139
172
  | --server-port *(optional)* | The custom server port for local machine server. | {RANDOM_PORT} |
140
173
  | --hot-reload *(optional)* | Enable hot reload and build of applet | false |
141
174
  | --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 |
142
- | --detach *(optional)* | Run the applet HTTP server in the background (detached proccess) | false |
175
+ | --detach *(optional)* | Run the applet HTTP server in the background (detached process) | false |
143
176
  | --forward-server-url *(optional)* | Custom forward server URL for `sos device connect` command. | https://forward.signageos.io |
144
177
 
145
178
  #### Applet Tests Upload
@@ -188,12 +221,12 @@ sos organization get
188
221
  | --organization-uid *(required)* | Organization UID | STDIN |
189
222
 
190
223
  #### Organization Set Default
191
- - Sets default organization for current logged in account. This organization will be used for example in webpack plugin of applet to register emulator
192
- - 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.
224
+ - Sets default organization for current logged in account. This organization will be used for example in the webpack plugin of applet to register emulator
225
+ - If you do not set default organization, by default will be used the organization you will be asked to select from list where you have access to.
193
226
  ```bash
194
227
  sos organization set-default
195
228
  ```
196
- - You override default organization using environment variable `SOS_ORGANIZATION_UID`. Go to https://box.signageos.io/organizations to git the organizationUid.
229
+ - You can override default organization using environment variable `SOS_ORGANIZATION_UID`. Go to https://box.signageos.io/organizations to get the organizationUid.
197
230
 
198
231
  | Argument | Description | Default value |
199
232
  |---------------------------------|------------------------------|----------------|
@@ -235,7 +268,7 @@ sos device power-action
235
268
  |---------------------------------|------------------------------|
236
269
  | reload | Applet Reload |
237
270
  | displayOn | Display power On |
238
- | displayOff | Display power Of |
271
+ | displayOff | Display power Off |
239
272
  | restart | Application restart |
240
273
  | disable | Applet disable |
241
274
  | enable | Applet enable |
@@ -261,19 +294,20 @@ sos device connect
261
294
  ```
262
295
  | Argument | Description | Default value |
263
296
  |--------------------------------|---------------------------------------|------------------------|
264
- | --device-uid *(required)* | Uid of device from box' | STDIN |
297
+ | --device-uid *(required)* | Uid of device from box | STDIN |
265
298
  | --applet-uid *(required)* | Applet UID | STDIN |
266
299
  | --organization-uid *(required)* | Organization UID | STDIN |
267
- | --update-package-config *(optional)* | Update package.json value `sos.appletUid` config when applet doesn't exists and is created | false |
300
+ | --update-package-config *(optional)* | Update package.json value `sos.appletUid` config when applet doesn't exist and is created | false |
268
301
  | --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} or https://forward.signageos.io/{random-hash} |
269
302
  | --use-forward-server *(optional)* | Use forward server to connect to the device instead of the local network (LAN) (https://forward.signageos.io/{random-hash}). It's useful when the device is not in the same network as the local machine. | false |
270
303
  | --server-port *(optional)* | The custom server port for local machine server. | {RANDOM_PORT} |
271
304
  | --force *(optional)* | Force start applet server even if it is already running on a different port. Kill the running server first. | false |
272
305
  | --applet-path *(optional)* | Root path of applet project | ${PWD}/dist |
273
- | --detach *(optional)* | Run the applet HTTP server in the background (detached proccess) | false |
306
+ | --detach *(optional)* | Run the applet HTTP server in the background (detached process) | false |
274
307
  | --forward-server-url *(optional)* | Custom forward server URL. | https://forward.signageos.io |
275
308
  | --hot-reload *(optional)* | Enable hot reload and build of applet | false |
276
309
 
310
+
277
311
  ## Debugging
278
312
 
279
313
  To enable debugging for the `@signageos/cli:Applet:Upload:appletUploadFacade` module, use:
@@ -288,7 +322,7 @@ If you want to enable debugging for all modules under `@signageos`, use the aste
288
322
  DEBUG=@signageos/* sos applet upload
289
323
  ```
290
324
 
291
- You can use `export DEBUG=@signageos/*`, though.
325
+ You can use `export DEBUG=@signageos/*` as well.
292
326
 
293
327
  ## Contribution
294
328
  Clone the repository and install dev dependencies
@@ -0,0 +1,7 @@
1
+ # Changelog
2
+ All notable changes to this project will be documented in this file.
3
+
4
+ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5
+ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [Unreleased]
@@ -0,0 +1,3 @@
1
+ # SignageOS Applet
2
+
3
+ A digital signage applet for displaying ...
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
36
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
37
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -288,7 +298,7 @@ exports.appletGenerate = (0, commandDefinition_1.createCommandDefinition)({
288
298
  prepare: 'pnpm run clean && pnpm run build',
289
299
  upload: 'sos applet upload',
290
300
  clean: 'pnpx rimraf dist',
291
- escheck: 'pnpx es-check --module es5 dist/**/*.js',
301
+ escheck: 'pnpx es-check --module es5 "./dist/**/*.js"',
292
302
  postbuild: 'pnpm run escheck',
293
303
  };
294
304
  break;
@@ -298,7 +308,7 @@ exports.appletGenerate = (0, commandDefinition_1.createCommandDefinition)({
298
308
  prepare: 'yarn run clean && yarn run build',
299
309
  upload: 'sos applet upload',
300
310
  clean: 'npx rimraf dist',
301
- escheck: 'npx es-check --module es5 dist/**/*.js',
311
+ escheck: 'npx es-check --module es5 "./dist/**/*.js"',
302
312
  postbuild: 'npm run escheck',
303
313
  };
304
314
  break;
@@ -308,7 +318,7 @@ exports.appletGenerate = (0, commandDefinition_1.createCommandDefinition)({
308
318
  prepare: 'bun run clean && bun run build',
309
319
  upload: 'sos applet upload',
310
320
  clean: 'bunx rimraf dist',
311
- escheck: 'bunx es-check --module es5 dist/**/*.js',
321
+ escheck: 'bunx es-check --module es5 "./dist/**/*.js"',
312
322
  postbuild: 'bun run escheck',
313
323
  };
314
324
  break;
@@ -364,6 +374,14 @@ exports.appletGenerate = (0, commandDefinition_1.createCommandDefinition)({
364
374
  path: path.join(appletRootDirectory, 'package.json'),
365
375
  content: JSON.stringify(yield createPackageConfig(appletName, String(options['applet-version']), bundler, language), undefined, 2) + '\n',
366
376
  });
377
+ generateFiles.push({
378
+ path: path.join(appletRootDirectory, 'CHANGELOG.md'),
379
+ content: createChangelogFile(),
380
+ });
381
+ generateFiles.push({
382
+ path: path.join(appletRootDirectory, 'README.md'),
383
+ content: createReadmeFile(),
384
+ });
367
385
  // Configure bundler
368
386
  switch (bundler) {
369
387
  case Bundler.Rspack:
@@ -414,12 +432,25 @@ exports.appletGenerate = (0, commandDefinition_1.createCommandDefinition)({
414
432
  // Ensure the default .npmrc file will be loaded from project root
415
433
  // Yarn 2+ uses .yarnrc.yml, but we can use this flag to override user's .npmrc
416
434
  const packagerPrefix = ''; // 'NPM_CONFIG_USERCONFIG=/dev/null';
417
- const configFlag = packager === Packager.Yarn ? '--no-default-rc' : '';
435
+ // Apply packager specific options
436
+ let configFlag = '';
437
+ switch (packager) {
438
+ case Packager.Yarn:
439
+ // Prevent Yarn from automatically detecting yarnrc and npmrc files
440
+ configFlag = '--no-default-rc';
441
+ break;
442
+ case Packager.Bun:
443
+ // Prevent Bun from failing on issues related to lockfile permissions
444
+ configFlag = '--frozen-lockfile';
445
+ break;
446
+ default:
447
+ // Other packagers (npm, pnpm) currently do not require any special config
448
+ }
418
449
  const installCommand = packager === Packager.Yarn ? 'add' : 'install';
419
450
  // Log the command being executed
420
451
  console.info(`Installing dependencies: ${packagerPrefix} ${PACKAGER_EXECUTABLE} ${installCommand} ${configFlag} --save-dev ${mergedDeps.join(' ')}`);
421
452
  const child = child_process.spawn(PACKAGER_EXECUTABLE, [packagerPrefix, installCommand, configFlag, '--save-dev', ...mergedDeps], {
422
- stdio: 'pipe',
453
+ stdio: 'pipe', // Use 'pipe' to capture stdout and stderr
423
454
  shell: true,
424
455
  });
425
456
  // Capture and log stdout
@@ -477,9 +508,10 @@ const createPackageConfig = (name, version, bundler, language) => __awaiter(void
477
508
  return {
478
509
  name,
479
510
  version,
511
+ author: '',
480
512
  main: 'dist/index.html',
481
513
  scripts: scriptDef,
482
- files: ['dist'],
514
+ files: ['dist', 'CHANGELOG.md', 'README.md'],
483
515
  description: 'signageOS applet',
484
516
  repository: {},
485
517
  license: 'UNLICENSED',
@@ -494,6 +526,8 @@ const createIndexCss = () => importFileAsString('./Templates/index.css.template'
494
526
  const createIndexJs = () => importFileAsString('./Templates/index.js.template');
495
527
  const createIndexTs = () => createIndexJs(); // There is currently no difference
496
528
  const createTsConfig = () => importFileAsString('./Templates/tsconfig.js.template');
529
+ const createChangelogFile = () => importFileAsString('./Templates/CHANGELOG.md.template');
530
+ const createReadmeFile = () => importFileAsString('./Templates/README.md.template');
497
531
  const createNpmRunControl = (registryUrl) => `
498
532
  registry=${registryUrl}
499
533
  always-auth=true
@@ -50,8 +50,8 @@ exports.appletStart = (0, commandDefinition_1.createCommandDefinition)({
50
50
  optionList: exports.OPTION_LIST,
51
51
  commands: [],
52
52
  run(options) {
53
- var _a, _b;
54
53
  return __awaiter(this, void 0, void 0, function* () {
54
+ var _a, _b;
55
55
  const currentDirectory = process.cwd();
56
56
  const organizationUid = yield (0, organizationFacade_1.getOrganizationUidOrDefaultOrSelect)(options);
57
57
  const entryFileAbsolutePath = yield (0, appletUploadCommandHelper_1.getAppletEntryFileAbsolutePath)(currentDirectory, options);
@@ -47,8 +47,8 @@ exports.appletTestRun = (0, commandDefinition_1.createCommandDefinition)({
47
47
  optionList: OPTION_LIST,
48
48
  commands: [],
49
49
  run(options) {
50
- var _a, _b, _c, _d;
51
50
  return __awaiter(this, void 0, void 0, function* () {
51
+ var _a, _b, _c, _d;
52
52
  const skipConfirmation = !!options.yes;
53
53
  let tests = options.test;
54
54
  const currentDirectory = process.cwd();
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.validateTestIdentifiers = void 0;
3
+ exports.validateTestIdentifiers = validateTestIdentifiers;
4
4
  function validateTestIdentifiers(identifiers, suites) {
5
5
  const existingIdentifiers = suites.map((suite) => suite.identifier);
6
6
  for (const identifier of identifiers) {
@@ -9,4 +9,3 @@ function validateTestIdentifiers(identifiers, suites) {
9
9
  }
10
10
  }
11
11
  }
12
- exports.validateTestIdentifiers = validateTestIdentifiers;
@@ -44,8 +44,8 @@ exports.appletTestUpload = (0, commandDefinition_1.createCommandDefinition)({
44
44
  optionList: OPTION_LIST,
45
45
  commands: [],
46
46
  run(options) {
47
- var _a;
48
47
  return __awaiter(this, void 0, void 0, function* () {
48
+ var _a;
49
49
  const isVerbose = !!options.verbose;
50
50
  const skipConfirmation = !!options.yes;
51
51
  const currentDirectory = process.cwd();
@@ -93,17 +93,17 @@ exports.appletTestUpload = (0, commandDefinition_1.createCommandDefinition)({
93
93
  });
94
94
  yield Promise.all([
95
95
  ...identifiersToCreate.map((identifier) => __awaiter(this, void 0, void 0, function* () {
96
- var _b;
96
+ var _a;
97
97
  yield restApi.applet.tests.create(applet.uid, appletVersion.version, {
98
98
  identifier,
99
- binary: (_b = testFilesContents[identifier]) !== null && _b !== void 0 ? _b : '',
99
+ binary: (_a = testFilesContents[identifier]) !== null && _a !== void 0 ? _a : '',
100
100
  });
101
101
  progressBar.update({ add: 1 });
102
102
  })),
103
103
  ...identifiersToUpdate.map((identifier) => __awaiter(this, void 0, void 0, function* () {
104
- var _c;
104
+ var _a;
105
105
  yield restApi.applet.tests.update(applet.uid, appletVersion.version, identifier, {
106
- binary: (_c = testFilesContents[identifier]) !== null && _c !== void 0 ? _c : '',
106
+ binary: (_a = testFilesContents[identifier]) !== null && _a !== void 0 ? _a : '',
107
107
  });
108
108
  progressBar.update({ add: 1 });
109
109
  })),
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
36
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
37
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -32,7 +42,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
32
42
  });
33
43
  };
34
44
  Object.defineProperty(exports, "__esModule", { value: true });
35
- exports.loadTestFilesContents = exports.validateTestFiles = void 0;
45
+ exports.validateTestFiles = validateTestFiles;
46
+ exports.loadTestFilesContents = loadTestFilesContents;
36
47
  const fs = __importStar(require("fs-extra"));
37
48
  const path = __importStar(require("path"));
38
49
  function validateTestFiles(currentDirectory, testFiles) {
@@ -45,7 +56,6 @@ function validateTestFiles(currentDirectory, testFiles) {
45
56
  }
46
57
  });
47
58
  }
48
- exports.validateTestFiles = validateTestFiles;
49
59
  function loadTestFilesContents(currentDirectory, testFiles) {
50
60
  return __awaiter(this, void 0, void 0, function* () {
51
61
  const contentsMap = {};
@@ -57,4 +67,3 @@ function loadTestFilesContents(currentDirectory, testFiles) {
57
67
  return contentsMap;
58
68
  });
59
69
  }
60
- exports.loadTestFilesContents = loadTestFilesContents;
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
36
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
37
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -35,7 +45,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
35
45
  return (mod && mod.__esModule) ? mod : { "default": mod };
36
46
  };
37
47
  Object.defineProperty(exports, "__esModule", { value: true });
38
- exports.getAppletEntryFileRelativePath = exports.getAppletEntryFileAbsolutePath = exports.getAppletBinaryFileAbsolutePath = exports.getAppletDirectoryAbsolutePath = exports.APPLET_PATH_OPTION = exports.ENTRY_FILE_PATH_OPTION = void 0;
48
+ exports.APPLET_PATH_OPTION = exports.ENTRY_FILE_PATH_OPTION = void 0;
49
+ exports.getAppletDirectoryAbsolutePath = getAppletDirectoryAbsolutePath;
50
+ exports.getAppletBinaryFileAbsolutePath = getAppletBinaryFileAbsolutePath;
51
+ exports.getAppletEntryFileAbsolutePath = getAppletEntryFileAbsolutePath;
52
+ exports.getAppletEntryFileRelativePath = getAppletEntryFileRelativePath;
39
53
  const log_1 = require("@signageos/sdk/dist/Console/log");
40
54
  const fs = __importStar(require("fs-extra"));
41
55
  const path = __importStar(require("path"));
@@ -63,8 +77,10 @@ function getAppletDirectoryAbsolutePath(currentDirectory, options) {
63
77
  if (!path.isAbsolute(appletDirectoryPath)) {
64
78
  appletDirectoryPath = path.join(currentDirectory, appletDirectoryPath);
65
79
  }
66
- if (appletDirectoryPath.length > 1 && appletDirectoryPath[appletDirectoryPath.length - 1] === '/') {
67
- appletDirectoryPath = appletDirectoryPath.substring(0, appletDirectoryPath.length - 1);
80
+ // Handle trailing slashes (both / and \) for cross-platform compatibility
81
+ appletDirectoryPath = path.normalize(appletDirectoryPath);
82
+ if (appletDirectoryPath.length > 1 && (appletDirectoryPath.endsWith('/') || appletDirectoryPath.endsWith('\\'))) {
83
+ appletDirectoryPath = appletDirectoryPath.slice(0, -1);
68
84
  }
69
85
  (0, log_1.log)('info', `\nUse applet project directory path: ${appletDirectoryPath}`);
70
86
  const appletDirectoryPathExists = yield fs.pathExists(appletDirectoryPath);
@@ -78,7 +94,6 @@ function getAppletDirectoryAbsolutePath(currentDirectory, options) {
78
94
  return appletDirectoryPath;
79
95
  });
80
96
  }
81
- exports.getAppletDirectoryAbsolutePath = getAppletDirectoryAbsolutePath;
82
97
  function getAppletBinaryFileAbsolutePath(currentDirectory, options) {
83
98
  return __awaiter(this, void 0, void 0, function* () {
84
99
  let appletBinaryFilePath = options['applet-path'];
@@ -88,6 +103,8 @@ function getAppletBinaryFileAbsolutePath(currentDirectory, options) {
88
103
  if (!path.isAbsolute(appletBinaryFilePath)) {
89
104
  appletBinaryFilePath = path.join(currentDirectory, appletBinaryFilePath);
90
105
  }
106
+ // Normalize the path for cross-platform compatibility
107
+ appletBinaryFilePath = path.normalize(appletBinaryFilePath);
91
108
  (0, log_1.log)('info', `\nUse applet binary file: ${appletBinaryFilePath}`);
92
109
  const appletBinaryFilePathExists = yield fs.pathExists(appletBinaryFilePath);
93
110
  if (!appletBinaryFilePathExists) {
@@ -100,7 +117,6 @@ function getAppletBinaryFileAbsolutePath(currentDirectory, options) {
100
117
  return appletBinaryFilePath;
101
118
  });
102
119
  }
103
- exports.getAppletBinaryFileAbsolutePath = getAppletBinaryFileAbsolutePath;
104
120
  function getAppletEntryFileAbsolutePath(currentDirectory, options) {
105
121
  return __awaiter(this, void 0, void 0, function* () {
106
122
  let appletEntryFilePath = options['entry-file-path'];
@@ -114,6 +130,8 @@ function getAppletEntryFileAbsolutePath(currentDirectory, options) {
114
130
  if (!path.isAbsolute(appletEntryFilePath)) {
115
131
  appletEntryFilePath = path.join(currentDirectory, appletEntryFilePath);
116
132
  }
133
+ // Normalize the path for cross-platform compatibility
134
+ appletEntryFilePath = path.normalize(appletEntryFilePath);
117
135
  (0, log_1.log)('info', `\nUse applet entry file: ${appletEntryFilePath}`);
118
136
  const appletEntryFilePathExists = yield fs.pathExists(appletEntryFilePath);
119
137
  if (!appletEntryFilePathExists) {
@@ -126,8 +144,8 @@ function getAppletEntryFileAbsolutePath(currentDirectory, options) {
126
144
  return appletEntryFilePath;
127
145
  });
128
146
  }
129
- exports.getAppletEntryFileAbsolutePath = getAppletEntryFileAbsolutePath;
130
147
  function getAppletEntryFileRelativePath(entryFileAbsolutePath, appletDirectoryAbsolutePath) {
148
+ // Normalize paths to ensure consistent handling across platforms
131
149
  const appletDirectoryAbsolutePathNormalized = path.normalize(appletDirectoryAbsolutePath);
132
150
  const entryFileAbsolutePathNormalized = path.normalize(entryFileAbsolutePath);
133
151
  if (!path.isAbsolute(entryFileAbsolutePathNormalized)) {
@@ -136,13 +154,15 @@ function getAppletEntryFileRelativePath(entryFileAbsolutePath, appletDirectoryAb
136
154
  if (!path.isAbsolute(appletDirectoryAbsolutePathNormalized)) {
137
155
  throw new Error(`Internal Error: Try input relative applet directory path. Current path: ${appletDirectoryAbsolutePathNormalized}`);
138
156
  }
157
+ // Use startsWith with normalized paths for cross-platform path checking
139
158
  const isEntryFileInAppletDir = entryFileAbsolutePathNormalized.startsWith(appletDirectoryAbsolutePathNormalized);
140
159
  if (!isEntryFileInAppletDir) {
141
160
  throw new Error(`Applet entry file must be in the applet directory.` +
142
161
  `\nEntry file path: ${entryFileAbsolutePathNormalized}` +
143
162
  `\nApplet directory path: ${appletDirectoryAbsolutePathNormalized}`);
144
163
  }
145
- const entryFileRelativePath = entryFileAbsolutePathNormalized.substring(appletDirectoryAbsolutePathNormalized.length + 1);
146
- return entryFileRelativePath;
164
+ // Use path.relative to get the relative path with correct platform separators
165
+ const entryFileRelativePath = path.relative(appletDirectoryAbsolutePathNormalized, entryFileAbsolutePathNormalized);
166
+ // Ensure forward slashes for cross-platform compatibility in returned paths
167
+ return entryFileRelativePath.split(path.sep).join('/');
147
168
  }
148
- exports.getAppletEntryFileRelativePath = getAppletEntryFileRelativePath;
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
36
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
37
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -35,7 +45,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
35
45
  return (mod && mod.__esModule) ? mod : { "default": mod };
36
46
  };
37
47
  Object.defineProperty(exports, "__esModule", { value: true });
38
- exports.createMultiFileFileApplet = exports.createSingleFileApplet = exports.updateMultiFileApplet = exports.updateSingleFileApplet = void 0;
48
+ exports.createMultiFileFileApplet = exports.createSingleFileApplet = exports.updateMultiFileApplet = void 0;
49
+ exports.updateSingleFileApplet = updateSingleFileApplet;
39
50
  const path = __importStar(require("path"));
40
51
  const fs = __importStar(require("fs-extra"));
41
52
  const chalk_1 = __importDefault(require("chalk"));
@@ -55,7 +66,6 @@ function updateSingleFileApplet(parameters) {
55
66
  });
56
67
  });
57
68
  }
58
- exports.updateSingleFileApplet = updateSingleFileApplet;
59
69
  const updateMultiFileApplet = (parameters) => __awaiter(void 0, void 0, void 0, function* () {
60
70
  var _a, _b;
61
71
  const { restApi, applet, progressBar } = parameters;