@elo/elo-cli 1.0.2
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/3rdpartylicenses.txt +7471 -175
- package/LICENSE.txt +14 -0
- package/README.md +765 -0
- package/dist/index.js +3827 -0
- package/dist/testHelper/testHelper.cjs +5 -0
- package/dist/testHelper/testHelper.d.cts +145 -0
- package/package.json +81 -0
- package/sbom.json +1 -0
package/README.md
ADDED
|
@@ -0,0 +1,765 @@
|
|
|
1
|
+
# elo-cli
|
|
2
|
+
|
|
3
|
+
This Command Line Interface supports the development of single-page web applications with Node.js and offers the following features:
|
|
4
|
+
|
|
5
|
+
- **[setup](#setup)**: Configures the ELO-CLI for further use.
|
|
6
|
+
- **[init](#init)**: Connects the application to an ELOwf during development to enable login and ELO session.
|
|
7
|
+
- **[build](#build)**: Prepares a built app for use as an ELO app.
|
|
8
|
+
- **[deploy](#deploy)**: Deploys a built app as an ELO app on the ELOwf.
|
|
9
|
+
- **[localize](#localize)**: Converts language files (.properties) into a JavaScript file so that the entries can be used directly in the application.
|
|
10
|
+
- **[import](#import)**: Imports workflows, entries, or packages into the system.
|
|
11
|
+
- **[export](#export)**: Exports ELO packages or archive areas from the system.
|
|
12
|
+
- **[TestHelpers](#test_helpers)**: Helper class for easy access to ELO-CLI configuration data within tests or development servers.
|
|
13
|
+
|
|
14
|
+
Without ELO relevance, the CLI additionally offers the following features (used internally in some cases):
|
|
15
|
+
- **[publish](#publish)**: Publishes built projects to an npm repository manager.
|
|
16
|
+
- **[license](#license_cmd)**: Creates a 3rdPartyLicense.txt that clearly summarizes all project licenses used.
|
|
17
|
+
- **[link](#link)**: Allows linking and building of ELO libraries to always develop with the current master state.
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
## Installation & Usage
|
|
21
|
+
<a id="installation"></a>
|
|
22
|
+
|
|
23
|
+
The CLI can be installed globally as a npm package:
|
|
24
|
+
|
|
25
|
+
npm install -g @elo/elo-cli
|
|
26
|
+
|
|
27
|
+
Afterwards, the elo command is available globally and can be used directly.
|
|
28
|
+
|
|
29
|
+
elo <command> --<flag>
|
|
30
|
+
|
|
31
|
+
When you need to import the TestHelpers into your project, we recommend installing the package as a development dependency:
|
|
32
|
+
|
|
33
|
+
npm install --save-dev @elo/elo-cli
|
|
34
|
+
|
|
35
|
+
You can then use it like this:
|
|
36
|
+
|
|
37
|
+
npx elo <command> --<flag>
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
## Getting Started
|
|
41
|
+
<a id="getting_started"></a>
|
|
42
|
+
|
|
43
|
+
### Creating an App
|
|
44
|
+
|
|
45
|
+
Create an app with a framework of your choice. We recommend the current technology stack of
|
|
46
|
+
[Vue.js](https://vuejs.org/).
|
|
47
|
+
|
|
48
|
+
Follow the instructions there to create a new Vue.js app:
|
|
49
|
+
[Quick Start](https://vuejs.org/guide/quick-start.html#creating-a-vue-application).
|
|
50
|
+
|
|
51
|
+
**Please note**: Since we have no influence on this stack, changes may occur at any time that
|
|
52
|
+
affect the use of elo-cli.
|
|
53
|
+
|
|
54
|
+
**Please note**: When using other technology stacks (React, Angular, etc.), there may be deviations in the
|
|
55
|
+
use of elo-cli that are not described here. Usage with other frameworks is not tested.
|
|
56
|
+
|
|
57
|
+
Summary of recommended steps:
|
|
58
|
+
|
|
59
|
+
- Create an app with the default tools:
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
npm create vue@latest
|
|
63
|
+
|
|
64
|
+
Recommended options:
|
|
65
|
+
- Typescript
|
|
66
|
+
- Vitest
|
|
67
|
+
- End-to-End Testing (Playwright)
|
|
68
|
+
- ESLint
|
|
69
|
+
- Prettier
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
cd my-project
|
|
73
|
+
npm install
|
|
74
|
+
npm run format
|
|
75
|
+
npm run dev
|
|
76
|
+
|
|
77
|
+
### Installing and Setting Up the ELO-CLI
|
|
78
|
+
|
|
79
|
+
Install elo-cli as a development dependency in the project:
|
|
80
|
+
|
|
81
|
+
npm install -D @elo/elo-cli
|
|
82
|
+
|
|
83
|
+
(ELO internal)
|
|
84
|
+
|
|
85
|
+
npm install -D @elo/elo-cli@main
|
|
86
|
+
|
|
87
|
+
This installs elo-cli as a devDependency so it can be used in the project context. The cli command
|
|
88
|
+
**elo** is not directly available, but can only be used via npx elo or an npm script.
|
|
89
|
+
|
|
90
|
+
For the initial setup, a global settings file must be created. This is done with the [setup](setup.md) command.
|
|
91
|
+
|
|
92
|
+
npx elo setup
|
|
93
|
+
|
|
94
|
+
Inputs see [Setup](setup.md).
|
|
95
|
+
|
|
96
|
+
This creates a file `.elo-cli-settings.json` in the user directory. It stores a default developer archive access
|
|
97
|
+
and general (typically unchanging) development data (default language, namespace, etc.).
|
|
98
|
+
|
|
99
|
+
For our project, we directly create a specific archive access for development. This is done with the
|
|
100
|
+
flag `--repository` and the name of the access (in this case 'dev').
|
|
101
|
+
|
|
102
|
+
npx elo setup --repository dev
|
|
103
|
+
|
|
104
|
+
Inputs see [Setup](setup.md).
|
|
105
|
+
|
|
106
|
+
Specific archives for the project are stored in the `.elo-repository` directory. This makes it possible to store separate
|
|
107
|
+
connection data for CI/CD or shared ELO servers and to check them into source control together with the app code.
|
|
108
|
+
|
|
109
|
+
If a developer works alone against their local test ELO installation, the global access can be used.
|
|
110
|
+
|
|
111
|
+
For the following steps, an ELO archive with ixUrl http://elo:9090/repository/ix is assumed.
|
|
112
|
+
|
|
113
|
+
### Initialization
|
|
114
|
+
|
|
115
|
+
To establish a connection with the archive and use helper functions in the app, the app should use the
|
|
116
|
+
library @elo/elo-base-lib.
|
|
117
|
+
|
|
118
|
+
npm install @elo/elo-base-lib
|
|
119
|
+
|
|
120
|
+
Connect the app to the ELOwf; the app will be marked as 'In Development'.
|
|
121
|
+
This instructs the ELOwf to allow the app during a login attempt and redirect to the local
|
|
122
|
+
development server. Use the [init](init.md) command with the flag --repository and the name of the
|
|
123
|
+
archive access (in this case 'dev').
|
|
124
|
+
|
|
125
|
+
npx elo init --repository dev
|
|
126
|
+
|
|
127
|
+
Inputs:
|
|
128
|
+
- **use_sordType_icons**: n Are Sord type icons needed in the app (injects a CSS file from ELOwf).
|
|
129
|
+
- **use_archive_icons**: n Are archive icons needed in the app (injects a CSS file from ELOwf).
|
|
130
|
+
- **indexHtmlPath**: public/
|
|
131
|
+
- **id**: my-project
|
|
132
|
+
- **build_number**: 0
|
|
133
|
+
- **useELOSession**: y
|
|
134
|
+
- **dev_redirect**: http://localhost:5173
|
|
135
|
+
|
|
136
|
+
After initialization, the following files are present in the project:
|
|
137
|
+
- manifest.json - contains the metadata of the ELO app
|
|
138
|
+
- devData.js - development code for the app (needed to load icons, for example, as long as the app is not running inside ELOwf).
|
|
139
|
+
- modified index.html - contains references to devData.js and styles.
|
|
140
|
+
- .elo-current-repository - contains the name of the currently used repository (in this case 'dev').
|
|
141
|
+
|
|
142
|
+
The following files still need to be adjusted; this is also indicated in the console:
|
|
143
|
+
- main.ts - contains the code for loading the ELO libraries.
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
import { createApp } from 'vue'
|
|
147
|
+
import { initEloBaseServices, ixService, logger } from '@elo/elo-base-lib';
|
|
148
|
+
import { LockC, EditInfoC } from '@elo/ix-client-typescript';
|
|
149
|
+
...
|
|
150
|
+
import App from './App.vue'
|
|
151
|
+
|
|
152
|
+
// Initialize the elo base services
|
|
153
|
+
try {
|
|
154
|
+
await initEloBaseServices() // perform redirect to ELO login if not authenticated.
|
|
155
|
+
|
|
156
|
+
// --- example call to ix: checkout root repository folder.
|
|
157
|
+
const sord = await ixService.callIxEndpoint('checkoutSord', {
|
|
158
|
+
objId: "1",
|
|
159
|
+
editInfoZ: EditInfoC.mbSord,
|
|
160
|
+
lockZ: LockC.NO
|
|
161
|
+
})
|
|
162
|
+
logger.info("Checked out sord:", sord.sord!.name);
|
|
163
|
+
// ---
|
|
164
|
+
|
|
165
|
+
createApp(App).mount('#app') // <- mount the app after initialization is complete
|
|
166
|
+
} catch (error) {
|
|
167
|
+
logger.error('Failed to initialize ELO Base Lib:', error);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
**vite.config.ts** - contains proxy settings for accessing the ELOwf during development; additionally, the
|
|
173
|
+
base path is set to ''. This links scripts relatively and ensures that the app works both in
|
|
174
|
+
ELOwf and on the local development server. The TestHelpers allow access to the
|
|
175
|
+
archive configuration of the setup command.
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
import { defineConfig, ProxyOptions } from 'vite'
|
|
179
|
+
import TestHelpers from '@elo/elo-cli'; // load global config from elo-cli
|
|
180
|
+
...
|
|
181
|
+
|
|
182
|
+
TestHelpers.init(); //repository is optional
|
|
183
|
+
|
|
184
|
+
const config = {
|
|
185
|
+
...,
|
|
186
|
+
base: '',
|
|
187
|
+
server: {
|
|
188
|
+
...,
|
|
189
|
+
port: 5173, // port from dev Redirect in manifest.json
|
|
190
|
+
proxy: {} as Record<string, string | ProxyOptions>
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
config.server.proxy[TestHelpers.getIxContext()] = {
|
|
194
|
+
target: TestHelpers.getIxServer(),
|
|
195
|
+
changeOrigin: true
|
|
196
|
+
};
|
|
197
|
+
export default defineConfig(config);
|
|
198
|
+
|
|
199
|
+
### Localization
|
|
200
|
+
|
|
201
|
+
To equip the app with language files, we use .properties files. These are known from the Java environment
|
|
202
|
+
and widely used.
|
|
203
|
+
|
|
204
|
+
Create a *locales* folder in the app directory and place the language files there:
|
|
205
|
+
|
|
206
|
+
locales/
|
|
207
|
+
messages.properties
|
|
208
|
+
|
|
209
|
+
The entries in this file should be written in the default language (see manifest.json):
|
|
210
|
+
|
|
211
|
+
APP.GREETINGS=Hello World!
|
|
212
|
+
APP.FAREWELL=Goodbye!
|
|
213
|
+
|
|
214
|
+
To use the language files in the app, they must be converted into a JavaScript file. This
|
|
215
|
+
is done with the [localize](localize.md) command:
|
|
216
|
+
|
|
217
|
+
npx elo localize --src locales/ --dist src/jsLocales/
|
|
218
|
+
|
|
219
|
+
The target directory is completely overwritten. The generated file *all_locales.js* can then be imported and used in
|
|
220
|
+
the app (main.ts):
|
|
221
|
+
|
|
222
|
+
import './jsLocales/all_locales'
|
|
223
|
+
|
|
224
|
+
The entries can then be accessed via the singleton instance ``text.getText(key)``:
|
|
225
|
+
|
|
226
|
+
import { text } from '@elo/elo-base-lib';
|
|
227
|
+
...
|
|
228
|
+
logger.info(text.getText("APP.NAME");
|
|
229
|
+
|
|
230
|
+
### Starting the App
|
|
231
|
+
|
|
232
|
+
To start the app on a local development server, use the command:
|
|
233
|
+
|
|
234
|
+
npm run dev
|
|
235
|
+
|
|
236
|
+
The server starts on the port specified in vite.config.ts (here 5173) and sets up a proxy to the ELO archive
|
|
237
|
+
as specified in dev.json.
|
|
238
|
+
|
|
239
|
+
A request to http://localhost:5173 starts the app, a request to http://localhost:5173/repository/* is
|
|
240
|
+
forwarded to the ELO archive http://elo:9090/repository/*.
|
|
241
|
+
|
|
242
|
+
### Build and Deployment
|
|
243
|
+
|
|
244
|
+
Build the app with the command:
|
|
245
|
+
|
|
246
|
+
npm run build
|
|
247
|
+
|
|
248
|
+
The built app is located in the *dist/* directory.
|
|
249
|
+
|
|
250
|
+
To prepare the app for deployment, use the [build](build.md) command:
|
|
251
|
+
|
|
252
|
+
npx elo build
|
|
253
|
+
|
|
254
|
+
This adjusts the index.html so that devData.js is no longer loaded and the data is loaded via relative ELOwf URLs.
|
|
255
|
+
|
|
256
|
+
The app can now be packaged as a ZIP file and deployed in ELOwf. This is done via the [deploy](deploy.md)
|
|
257
|
+
command:
|
|
258
|
+
|
|
259
|
+
npx elo deploy --repository dev
|
|
260
|
+
|
|
261
|
+
The app is now available in ELOwf and can be used there. To test this, the app can be opened in the AppManager.
|
|
262
|
+
There, the app is listed under 'In Development'.
|
|
263
|
+
|
|
264
|
+
Using the 'Archive' button, it can be transferred to the repository and is in the 'Installed' state.
|
|
265
|
+
In the archive, the app can be found under Administration/ELOapps/Apps/<namespace>.<id>. In this directory, the
|
|
266
|
+
**access** folder was also created, which regulates the app's access rights.
|
|
267
|
+
|
|
268
|
+
### Further Development of the App
|
|
269
|
+
|
|
270
|
+
To further develop the app, the steps Initialization, Localization, Build, and Deployment
|
|
271
|
+
can be repeated as often as desired.
|
|
272
|
+
|
|
273
|
+
With the [init](init.md) command, the installed app is removed and the manifest with the devRedirect is re-imported.
|
|
274
|
+
The app remains in the archive and is again in the 'In Development' state. It can then either be overwritten with a new
|
|
275
|
+
version via elo-cli (deploy) or reset to the archived version (install) via AppManager.
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
## Command: help
|
|
279
|
+
<a id="help"></a>
|
|
280
|
+
|
|
281
|
+
The help command displays all available commands and their short descriptions in the console.
|
|
282
|
+
|
|
283
|
+
**Example:**
|
|
284
|
+
|
|
285
|
+
elo help
|
|
286
|
+
|
|
287
|
+
To display the available options and flags for a specific command, the --help flag can be used after the respective command.
|
|
288
|
+
|
|
289
|
+
**Example:**
|
|
290
|
+
|
|
291
|
+
elo <command> --help
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
## Command: setup
|
|
295
|
+
<a id="setup"></a>
|
|
296
|
+
|
|
297
|
+
The `setup` command configures the ELO CLI for further use. This step is required to be able to use all other functions.
|
|
298
|
+
|
|
299
|
+
**Optional flags:**
|
|
300
|
+
- `--repository <repoName>`: Creates a local repository for projects. Without this flag, the setup data is stored globally.
|
|
301
|
+
- `--config <path>`: Executes the setup automatically based on a configuration file.
|
|
302
|
+
|
|
303
|
+
**Multiple archives:**
|
|
304
|
+
|
|
305
|
+
It is possible to create additional local configuration archives within a project, in addition to the user-dependent
|
|
306
|
+
global archive. All relevant commands can then be executed with the parameter --repository <name> to use the
|
|
307
|
+
corresponding configuration.
|
|
308
|
+
|
|
309
|
+
The last used configuration is stored in the file .elo-current-repository. This file should be added to .gitignore.
|
|
310
|
+
If the global configuration is used, the value ELO_GLOBAL is stored in this file.
|
|
311
|
+
|
|
312
|
+
Project-specific configurations are stored in the .elo-repository/ folder of the respective project.
|
|
313
|
+
|
|
314
|
+
**Example:**
|
|
315
|
+
|
|
316
|
+
elo setup --repository <string>
|
|
317
|
+
|
|
318
|
+
**Interactive inputs on first run**
|
|
319
|
+
|
|
320
|
+
If the setup is run without a configuration file, the CLI will prompt for the following parameters:
|
|
321
|
+
|
|
322
|
+
- **wf_url**: URL to the ELOwf, e.g. `http://server:9090/ix-Archiv/plugin/de.elo.ix.plugin.proxy/wf/`. Required for login and deployment.
|
|
323
|
+
- **index_html**: Name of the HTML file into which the CLI injects code (e.g. for redirects). Default is `index.html`, but can be changed.
|
|
324
|
+
- **src**: Relative path to the app's source folder (contains the HTML file).
|
|
325
|
+
- **dist**: Relative path to the app's build folder (final application).
|
|
326
|
+
- **namespace**: Default namespace for apps. Can be adjusted per app in the manifest.
|
|
327
|
+
- **default_lang**: Default language for the initial language file and as fallback.
|
|
328
|
+
- **server_url**: URL to the index server, the current development system. E.g. `http://server:9090/repository/`.
|
|
329
|
+
- **admin_name**: Administrator username for development logins.
|
|
330
|
+
- **admin_pw**: Administrator password (stored encrypted).
|
|
331
|
+
|
|
332
|
+
The configuration is saved in the file `.elo-cli-settings.json` in the user's home directory (e.g.
|
|
333
|
+
`C:/Users/<username>/.elo-cli-settings.json`). The setup can be run again at any time or the file can be edited manually.
|
|
334
|
+
|
|
335
|
+
All parameters can alternatively be passed directly as flags, e.g.:
|
|
336
|
+
|
|
337
|
+
elo setup --server_url http://server:9090/ix-Archiv/
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
## Command: initialization
|
|
341
|
+
<a id="init"></a>
|
|
342
|
+
|
|
343
|
+
To connect a project with an archive, it must be initialized using the `init` command. This creates the `manifest.json`
|
|
344
|
+
file, which stores important data for processing with the CLI.
|
|
345
|
+
|
|
346
|
+
**Optional flags:**
|
|
347
|
+
- `--repository <repoName>`
|
|
348
|
+
|
|
349
|
+
Using the `--repository` flag, initialization can be performed against a different archive. From this point on, the app
|
|
350
|
+
will use the specified archive when starting.
|
|
351
|
+
|
|
352
|
+
**Example:**
|
|
353
|
+
|
|
354
|
+
elo init --repository <string>
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
**Interactive inputs on first run**
|
|
358
|
+
|
|
359
|
+
On the first run, the data for the manifest file (`manifest.json`) is requested:
|
|
360
|
+
|
|
361
|
+
- **use_sordType_icons**: `y|n` Indicates whether the app needs icons for entry types. If yes, these are loaded via
|
|
362
|
+
`devData.js` and a corresponding tag is added to `dist/index.html` during deployment. The icons are then available
|
|
363
|
+
as CSS classes.
|
|
364
|
+
- **use_archive_icons**: `y|n` Indicates whether the app needs archive icons. If yes, these are loaded via `devData.js`
|
|
365
|
+
and a corresponding tag is added to `dist/index.html` during deployment. The icons are then available as CSS classes.
|
|
366
|
+
- **indexHtmlPath**: Relative path to the `index.html` file.
|
|
367
|
+
- **id**: The ID of the ELO app, required for registration in ELOwf.
|
|
368
|
+
- **build_number**: The build number of the app, required for ELOwf.
|
|
369
|
+
- **use_elo_session**: `y|n` Indicates whether an ELO session is required. If yes, a redirect to the ELOwf login occurs
|
|
370
|
+
if the session is missing.
|
|
371
|
+
- **dev_redirect**: Redirect URL that is called after successful login in ELOwf. Typically, this is the address where
|
|
372
|
+
the app is accessible during development (e.g. `http://localhost:8082`).
|
|
373
|
+
|
|
374
|
+
After initialization, or if the `manifest.json` already exists, the following actions are performed:
|
|
375
|
+
|
|
376
|
+
- The `index.html` is adjusted to allow access to the manifest data in JavaScript. Additionally, the script `devData.js`
|
|
377
|
+
is included, which executes additional code during development.
|
|
378
|
+
- The file `devData.js` is created. It contains development code that, for example, dynamically injects entry icons and
|
|
379
|
+
makes requests to the ELOwf to obtain data as with normal ELO apps.
|
|
380
|
+
- For Vue.js applications, an attempt is made to find `main.js` / `main.ts` and inject code there to load the ELO libraries.
|
|
381
|
+
- The app is registered with the ELOwf so that the ELOwf login page knows the app and can redirect to the specified
|
|
382
|
+
redirect URL after successful login.
|
|
383
|
+
|
|
384
|
+
After successful initialization, the app can be started and a connection to the ELOwf can be established. If necessary,
|
|
385
|
+
proxy settings or further configurations may need to be made.
|
|
386
|
+
|
|
387
|
+
The `elo init` command should be executed again during development if changes are made to the archive or the `manifest.json`.
|
|
388
|
+
|
|
389
|
+
All parameters can also be passed directly as flags, e.g.:
|
|
390
|
+
|
|
391
|
+
elo init --use_sordType_icons y --use_elo_session y ...
|
|
392
|
+
|
|
393
|
+
|
|
394
|
+
## Command: build
|
|
395
|
+
<a id="build"></a>
|
|
396
|
+
|
|
397
|
+
Once development has reached a stage where the application should be used as an ELO app, the application can be prepared
|
|
398
|
+
for deployment using the `build` command. During this process, the `index.html` in the `/dist` folder is modified: the
|
|
399
|
+
development file `devData.js` is removed and the data is instead loaded via relative ELOwf URLs.
|
|
400
|
+
|
|
401
|
+
With the parameters `--key <key>` and `--value <value>`, any key/value pairs can be set or overwritten in the
|
|
402
|
+
`manifest.json` that are relevant for the build:
|
|
403
|
+
|
|
404
|
+
**Optional flags:**
|
|
405
|
+
- `--key <string>`: Sets or overwrites the specified key in the `manifest.json`.
|
|
406
|
+
- `--value <string>`: Sets or overwrites the value of the key/value pair in the `manifest.json` defined with `--key`.
|
|
407
|
+
|
|
408
|
+
Any number of key/value pairs can be added by executing the command multiple times, each with a `--key` and `--value`.
|
|
409
|
+
|
|
410
|
+
**Examples:**
|
|
411
|
+
|
|
412
|
+
Manifest.json before the build:
|
|
413
|
+
|
|
414
|
+
{
|
|
415
|
+
"version": "0.1.8",
|
|
416
|
+
// ...
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
Add a key/value pair:
|
|
420
|
+
|
|
421
|
+
elo build --key noBuild --value true
|
|
422
|
+
|
|
423
|
+
Manifest.json after execution:
|
|
424
|
+
|
|
425
|
+
{
|
|
426
|
+
"version": "0.1.8",
|
|
427
|
+
"noBuild": true
|
|
428
|
+
// ...
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
Overwrite an existing key/value pair:
|
|
432
|
+
|
|
433
|
+
elo build --key version --value 0.1.0
|
|
434
|
+
|
|
435
|
+
Manifest.json after execution:
|
|
436
|
+
|
|
437
|
+
{
|
|
438
|
+
"version": "0.1.0",
|
|
439
|
+
"noBuild": true
|
|
440
|
+
// ...
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
Remove a key/value pair:
|
|
444
|
+
|
|
445
|
+
elo build --key noBuild --value undefined
|
|
446
|
+
|
|
447
|
+
Manifest.json after execution:
|
|
448
|
+
|
|
449
|
+
{
|
|
450
|
+
"version": "0.1.0"
|
|
451
|
+
// ...
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
To use the original `manifest.json` for the build, all set key/value pairs can be discarded by simply running `elo build`:
|
|
455
|
+
|
|
456
|
+
elo build
|
|
457
|
+
|
|
458
|
+
Manifest.json:
|
|
459
|
+
|
|
460
|
+
{
|
|
461
|
+
"version": "0.1.8"
|
|
462
|
+
// ...
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
|
|
466
|
+
## Command: deploy
|
|
467
|
+
<a id="deploy"></a>
|
|
468
|
+
|
|
469
|
+
To transfer the app directly to the ELOwf, use the `deploy` command. This first performs all steps of the `build`
|
|
470
|
+
command and then sends the built application to the ELOwf. After successful deployment, the app can be accessed via
|
|
471
|
+
the App Manager.
|
|
472
|
+
|
|
473
|
+
**Optional flags:**
|
|
474
|
+
- `--repository <string>` Allows deployment to a specific archive.
|
|
475
|
+
- `--neon` Required to deploy Neon extensions on the ELOwf. INTERNAL USE ONLY.
|
|
476
|
+
- `--key <string>` Sets or overwrites a key in the `manifest.json`.
|
|
477
|
+
- `--value <string>` Sets or overwrites the value of the key/value pair in the `manifest.json` specified with `--key`.
|
|
478
|
+
|
|
479
|
+
Any number of key/value pairs can be added by executing the command multiple times, each with a `--key` and `--value`.
|
|
480
|
+
|
|
481
|
+
**Examples:**
|
|
482
|
+
|
|
483
|
+
Manifest.json before deployment:
|
|
484
|
+
|
|
485
|
+
{
|
|
486
|
+
"version": "0.1.8"
|
|
487
|
+
// ...
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
Add a key/value pair:
|
|
491
|
+
|
|
492
|
+
elo deploy --key noBuild --value true
|
|
493
|
+
|
|
494
|
+
Manifest.json after execution:
|
|
495
|
+
|
|
496
|
+
{
|
|
497
|
+
"version": "0.1.8",
|
|
498
|
+
"noBuild": true
|
|
499
|
+
// ...
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
Overwrite an existing key/value pair:
|
|
503
|
+
|
|
504
|
+
elo deploy --key version --value 0.1.0
|
|
505
|
+
|
|
506
|
+
Manifest.json after execution:
|
|
507
|
+
|
|
508
|
+
{
|
|
509
|
+
"version": "0.1.0",
|
|
510
|
+
"noBuild": true
|
|
511
|
+
// ...
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
Remove a key/value pair:
|
|
515
|
+
|
|
516
|
+
elo deploy --key noBuild --value undefined
|
|
517
|
+
|
|
518
|
+
Manifest.json after execution:
|
|
519
|
+
|
|
520
|
+
{
|
|
521
|
+
"version": "0.1.0"
|
|
522
|
+
// ...
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
To use the original `manifest.json` for deployment, all set key/value pairs can be discarded by simply running `elo deploy`:
|
|
526
|
+
|
|
527
|
+
elo deploy
|
|
528
|
+
|
|
529
|
+
Manifest.json:
|
|
530
|
+
|
|
531
|
+
{
|
|
532
|
+
"version": "0.1.8"
|
|
533
|
+
// ...
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
|
|
537
|
+
## Command: localize
|
|
538
|
+
<a id="localize"></a>
|
|
539
|
+
|
|
540
|
+
With the `localize` command, all `.properties` language files in a folder can be converted into a central JavaScript
|
|
541
|
+
file (`all_locales.js`). This file can be directly included and used in the application.
|
|
542
|
+
|
|
543
|
+
At runtime, the CLI checks the completeness of the used keys and creates a report about missing, redundant, or
|
|
544
|
+
duplicate entries.
|
|
545
|
+
|
|
546
|
+
**Required flags:**
|
|
547
|
+
- `--src <path>`: Path to the folder containing the properties files.
|
|
548
|
+
- `--dist <path>`: Output path for the generated `all_locales.js` file.
|
|
549
|
+
|
|
550
|
+
**Optional flags:**
|
|
551
|
+
- `--report`: Creates a report about missing, redundant, and duplicate keys. The report is saved in the root directory.
|
|
552
|
+
|
|
553
|
+
**Example:**
|
|
554
|
+
|
|
555
|
+
elo localize --src <path-to-folder> --dist <path-to-target-file> --report
|
|
556
|
+
|
|
557
|
+
|
|
558
|
+
## Command: import
|
|
559
|
+
<a id="import"></a>
|
|
560
|
+
|
|
561
|
+
The `import` command allows you to import workflows, entries, or packages into the system. The command is flexible and
|
|
562
|
+
supports various import modes:
|
|
563
|
+
|
|
564
|
+
**General options:**
|
|
565
|
+
- `--src <string>`: Path to the file to be imported.
|
|
566
|
+
|
|
567
|
+
**Examples:**
|
|
568
|
+
|
|
569
|
+
### Importing an ELO package
|
|
570
|
+
|
|
571
|
+
Imports an ELO package from a file:
|
|
572
|
+
|
|
573
|
+
elo import --src <path-to-file>
|
|
574
|
+
|
|
575
|
+
### Importing an export record
|
|
576
|
+
|
|
577
|
+
Imports an export record into a specific archive:
|
|
578
|
+
|
|
579
|
+
- `--guid <string>`: Target parent ID for the import (format: `"(54F8BE3A-B860-31B4-3224-077FFDE546A9)"`)
|
|
580
|
+
- `--guidMode <number>`: Optional, sets the GUID mode (default: 1)
|
|
581
|
+
|
|
582
|
+
|
|
583
|
+
elo import --mode archive --src <path-to-file> --guid <guid>
|
|
584
|
+
|
|
585
|
+
### Importing a workflow
|
|
586
|
+
|
|
587
|
+
Imports a workflow from a `.ewf` file. Optionally, a template name and a user GUID can be specified:
|
|
588
|
+
|
|
589
|
+
- `--flowName <string>`: Optional, name of the workflow template
|
|
590
|
+
- `--guid <string>`: Optional, user GUID for unknown user nodes
|
|
591
|
+
|
|
592
|
+
|
|
593
|
+
elo import --mode workflow --src <path-to-file> [--flowName <name>] [--guid <userid>]
|
|
594
|
+
|
|
595
|
+
### Importing an entry
|
|
596
|
+
|
|
597
|
+
Imports an entry into a specific archive:
|
|
598
|
+
|
|
599
|
+
- `--guid <string>`: Target parent ID (format: `"(54F8BE3A-B860-31B4-3224-077FFDE546A9)"`)
|
|
600
|
+
|
|
601
|
+
elo import --mode entry --src <path-to-file> --guid <guid>
|
|
602
|
+
|
|
603
|
+
|
|
604
|
+
## Command: export
|
|
605
|
+
<a id="export"></a>
|
|
606
|
+
|
|
607
|
+
With the `export` command, you can export an ELO package or an archive area.
|
|
608
|
+
|
|
609
|
+
**Required flags:**
|
|
610
|
+
- `--guid <string>`: Name or GUID of the package or GUID of the archive area to be exported.
|
|
611
|
+
- `--dist <string>`: Path and name of the export file.
|
|
612
|
+
|
|
613
|
+
**Example:**
|
|
614
|
+
|
|
615
|
+
elo export --guid <string> --dist <string>
|
|
616
|
+
|
|
617
|
+
|
|
618
|
+
## TestHelpers
|
|
619
|
+
<a id="test_helpers"></a>
|
|
620
|
+
|
|
621
|
+
The `TestHelpers` class provides access to the ELO-CLI repository data within tests or development configurations.
|
|
622
|
+
|
|
623
|
+
|
|
624
|
+
|
|
625
|
+
## Internal use
|
|
626
|
+
<a id="internal_use"></a>
|
|
627
|
+
|
|
628
|
+
The following commands are intended for internal use and may not be of use.
|
|
629
|
+
|
|
630
|
+
### Command: publish
|
|
631
|
+
<a id="publish"></a>
|
|
632
|
+
|
|
633
|
+
With the `publish` command, built projects can be published to a repository manager such as `Nexus`. The command
|
|
634
|
+
supports single projects as well as mono- and multirepos using a configuration file.
|
|
635
|
+
|
|
636
|
+
After publishing, the CLI checks whether the latest version is available under the specified tag on the repository manager.
|
|
637
|
+
|
|
638
|
+
**Required flags:**
|
|
639
|
+
- `--tag <string>`: Tag under which the project is published (e.g. `master`, `main` or following the scheme
|
|
640
|
+
`release-<majorVersion>-<minorVersion?>`). The `minorVersion` is optional.
|
|
641
|
+
- `--server <string>`: URL of the repository manager including the path to the repository, e.g.
|
|
642
|
+
`https://nexus.example.de/repository/your-repo/`
|
|
643
|
+
|
|
644
|
+
**Optional flags:**
|
|
645
|
+
- `--delay <number>`: Delay in seconds between publishing the projects and checking, if the projects are available on
|
|
646
|
+
the repository manager (default is 0).
|
|
647
|
+
- `--latest`: If set the publish command will also set the latest flag for the published version.
|
|
648
|
+
- `--multirepoconfig <string>`: Path to the configuration file containing the names and paths of the projects in the
|
|
649
|
+
mono-/multirepo.
|
|
650
|
+
|
|
651
|
+
In multirepo mode, the dependencies in the respective `package.json` files are automatically adjusted so that the
|
|
652
|
+
currently published version is always set as a dependency.
|
|
653
|
+
|
|
654
|
+
**Example for the configuration file (`elo-cli-multirepo.json`):**
|
|
655
|
+
|
|
656
|
+
[
|
|
657
|
+
{
|
|
658
|
+
"name": "example-project",
|
|
659
|
+
"path": "./packages/example-project"
|
|
660
|
+
}
|
|
661
|
+
// more projects
|
|
662
|
+
]
|
|
663
|
+
|
|
664
|
+
|
|
665
|
+
**Note:**
|
|
666
|
+
The `publish` command is intended for automated publishing in CI/CD pipelines. A `.npmrc` file with a valid auth token
|
|
667
|
+
must be present in the root directory of the project to be published.
|
|
668
|
+
|
|
669
|
+
**Example for the publish command:**
|
|
670
|
+
|
|
671
|
+
elo publish --tag release-1-2 --server https://nexus.example.de/repository/my-repo/ --multirepoconfig ./elo-cli-multirepo.json
|
|
672
|
+
|
|
673
|
+
|
|
674
|
+
### Command: license
|
|
675
|
+
<a id="license_cmd"></a>
|
|
676
|
+
|
|
677
|
+
The `license` command creates a `3rdPartyLicenses.txt` file that clearly summarizes all productive dependency licenses
|
|
678
|
+
of the project.
|
|
679
|
+
|
|
680
|
+
**Optional flags:**
|
|
681
|
+
- `--path <string>`: Specifies an additional directory to search for further licenses.
|
|
682
|
+
|
|
683
|
+
**Example:**
|
|
684
|
+
|
|
685
|
+
elo license --path ./3rdpartylicenses
|
|
686
|
+
|
|
687
|
+
The structure of the directory specified with the `--path` flag should be as follows:
|
|
688
|
+
|
|
689
|
+
path/
|
|
690
|
+
dependency-name/
|
|
691
|
+
version(/)
|
|
692
|
+
License[.txt]
|
|
693
|
+
[Notice[.txt]]
|
|
694
|
+
dependency-name/
|
|
695
|
+
version/
|
|
696
|
+
License[.txt]
|
|
697
|
+
[Notice[.txt]]
|
|
698
|
+
[...]
|
|
699
|
+
|
|
700
|
+
The CLI automatically detects the package manager used and takes the respective dependencies into account. Currently
|
|
701
|
+
supported: `npm`, `pnpm`, and `yarn`.
|
|
702
|
+
|
|
703
|
+
|
|
704
|
+
### Command: link
|
|
705
|
+
<a id="link"></a>
|
|
706
|
+
|
|
707
|
+
With the `link` command, the ELO components listed under `eloDependencies` in the `package.json` can be automatically
|
|
708
|
+
linked. The script reads the entries and links the corresponding NPM modules in the `node_modules/@elo` folder.
|
|
709
|
+
Optionally, a build command (`npm run <command>`) can be executed for each component.
|
|
710
|
+
|
|
711
|
+
**Conditionally required flags:**
|
|
712
|
+
- `--source_path <path>`: Must be specified if the folder with the components (e.g., `elo-vue-libs`) is not in the
|
|
713
|
+
default path. The path must contain the folder where the components are located (e.g., `elo-cli`, `elo-core`, etc.).
|
|
714
|
+
|
|
715
|
+
**Optional flags:**
|
|
716
|
+
- `--no_build`: Skips the build command specified in the entry.
|
|
717
|
+
- `--no_source_link`: Skips executing `npm link` in the respective component folder.
|
|
718
|
+
|
|
719
|
+
**Example:**
|
|
720
|
+
|
|
721
|
+
elo link
|
|
722
|
+
|
|
723
|
+
**Example for `eloDependencies` in the `package.json`:**
|
|
724
|
+
|
|
725
|
+
"eloDependencies": [
|
|
726
|
+
{
|
|
727
|
+
"name": "elo-cli",
|
|
728
|
+
"folder": "elo-cli",
|
|
729
|
+
"buildCommand": "NONE"
|
|
730
|
+
},
|
|
731
|
+
{
|
|
732
|
+
"name": "core",
|
|
733
|
+
"folder": "elo-core",
|
|
734
|
+
"buildCommand": "build"
|
|
735
|
+
},
|
|
736
|
+
{
|
|
737
|
+
"name": "ui",
|
|
738
|
+
"folder": "elo-ui-components",
|
|
739
|
+
"buildCommand": "build:lib"
|
|
740
|
+
}
|
|
741
|
+
]
|
|
742
|
+
|
|
743
|
+
Note: The order of the entries is relevant for correct linking.
|
|
744
|
+
|
|
745
|
+
- `name`: NPM package name of the component (from its `package.json`)
|
|
746
|
+
- `folder`: Name of the folder within the project (not a path)
|
|
747
|
+
- `buildCommand`: Optional; if specified, `npm run <buildCommand>` is executed for the component
|
|
748
|
+
|
|
749
|
+
**Process of the link command:**
|
|
750
|
+
|
|
751
|
+
For each entry in `eloDependencies`:
|
|
752
|
+
1. Change to `<source_path>/<folder>`, execute `npm run <buildCommand>` if applicable, and then `npm link`.
|
|
753
|
+
2. Link the component in the main project with `npm link @elo/<name>`.
|
|
754
|
+
|
|
755
|
+
|
|
756
|
+
## License
|
|
757
|
+
<a id="license"></a>
|
|
758
|
+
|
|
759
|
+
This project is licensed under the MIT License.
|
|
760
|
+
See [LICENSE.txt](./LICENSE.txt) of this package.
|
|
761
|
+
|
|
762
|
+
## Version history
|
|
763
|
+
<a id="version history"></a>
|
|
764
|
+
|
|
765
|
+
See the full change history in versionhistory.txt in the package or [npm](https://www.npmjs.com/package/@elo/elo-cli?activeTab=code).
|