UNPKG

4.78 kBMarkdownView Raw
1# CH5 Utilities
2
3> Archiving and distribution utilities to be used for the applications implemented with CH5 library.
4
5## Table of Contents
6
7- [Background](#background)
8- [Setup](#setup)
9- [Commands](#commands)
10- [Configuration](#configuration)
11- [License](#license)
12
13## Background
14
15The purpose of the library is to satisfy three functions:
16
17- archiving - create a package that can distributed manually or with the utility
18- distribution - deploy a package built with the utility
19- archive & distribute - single command for both of the above
20
21The final result of the archiving will be a .ch5z package.
22This contains two files:
23
24- *.ch5 - the actual package
25- *_manifest.json - a manifest file describing the .ch5 file ( project name, timestamp, hash and any other optional details)
26
27## Setup
28
29Install the required packages.
30```
31yarn install
32```
33
34Build the library.
35```
36yarn build
37```
38
39Publish the ch5-utilities library for local usage.
40```
41yarn link
42```
43
44## Commands
45
46The commands is for development, debugging, and testing purposes only.
47
48Before running, make sure that all the values are properly modified for local usage, in the `config` variable in `start.ts`.
49
50#### yarn start
51
52Running `yarn start` will run the **archive&deploy** functions based on the config in the `src/start.ts` file.
53
54#### yarn start:archive
55
56Running `yarn start:archive` will run the **archive** function based on the config in the `src/start.ts` file.
57
58#### yarn start:distribute
59
60Running `yarn start:distribute` will run the **distribute** function based on the config in the `src/start.ts` file.
61
62#### yarn start:js
63
64Same as `yarn start`, but will run the bundled JS version of the library ( the one in the ``build`` directory ).
65
66#### yarn start:js:archive
67
68Same as `yarn start:archive`, but will run the bundled JS version of the library ( the one in the ``build`` directory ).
69
70#### yarn start:js:distribute
71
72Same as `yarn start:distribute`, but will run the bundled JS version of the library ( the one in the ``build`` directory ).
73
74#### yarn publish:local
75
76After the initial setup, you can use this command to rebuild and publish changes in the library.
77
78## Configuration
79
80The methods `archiver` and `distributor` from `src/index.ts` expect a to get a configuration of type `IConfigOptions`.
81
82Below we describe each property, their purpose and possible values.
83
84#### projectName
85
86Required.
87
88The name of the project will set the package name and the manifest details for the project.
89It should be set according to the delivered package.
90
91Default value is ``crestron-system``.
92
93#### directoryName
94
95Required.
96
97This is the path to the directory that contains the deliverables.
98
99Currently this is the showcase-app dist directory.
100
101The path can be absolute or should be relative to the location from which the command is run in the CLI.
102
103#### outputDirectory
104
105Required.
106
107This is the path where the package files will be copied to.
108
109The path can be absolute or should be relative to the location from which the command is run in the CLI.
110
111#### outputLevel
112
113Optional
114
115This sets the level of CLI logging that is required.
116
117Possible values are: ``quiet | normal | verbose``.
118
119#### additionalAppuiManifestParameters
120
121Optional.
122
123This is a key-value collection that can be used to set extra details in the app ( in this case showcase-app ) manifest JSON file.
124
125#### additionalProjectManifestParameters
126
127Optional.
128
129This is a key-value collection that can be used to set extra details in the project manifest JSON file.
130
131#### controlSystemHost
132
133Required.
134
135This should be the hostname or IP address of the device where the package will be deployed.
136
137#### promptForCredential
138
139This will always be set to true, since the utility will always prompt for the credentials in the CLI.
140
141#### sftpDirectory
142
143Required.
144
145This is the target directory on the ``controlSystemHost``.
146
147It must be relative to the SFTP root directory.
148
149It will be ``display`` for the showcase-app, or ``HTML`` for CCS.
150
151#### deviceType
152
153Required.
154
155This should be set based on the ``controlSystemHost``, depending on what kind of device you are targeting for the deploy.
156
157Possible values are: ``touchscreen | controlsystem | web``.
158
159## License
160
161Copyright (C) 2018 to the present, Crestron Electronics, Inc.
162All rights reserved.
163No part of this software may be reproduced in any form, machine
164or natural, without the express written consent of Crestron Electronics.
165Use of this source code is subject to the terms of the Crestron Software
166Development Tools License Agreement under which you licensed this source code.
167
168If you did not accept the terms of the license agreement,
169you are not authorized to use this software. For the terms of the license,
170please see the license agreement between you and Crestron at http://www.crestron.com/sla.