UNPKG

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