wediaportal cli, hot-config and .wediaportalrc
Starting from 2022.2.0 we have changed the way the portal application is built and served locally (for development purposes). We have tried to smoothen the migration process, but you might find useful a bit of documentation.
wediaportal cli
wediaportalcli is a shell client based on yargs to provide tools around portal.
it can be invoked by running an npm command:
npm run wediaportal
As we are invoking the cli through npm, we need to pass a double hyphen (--
) to pass arguments. For instance, accessing the help would be done like this
npm run wediaportal -- --help
or
npm run wediaportal -- -h
The wediaportal cli provides commands. You must pass a command with this pattern :
Available commands can be retrieved by running help or by not providing a command. In such case, the cli will return the list of available commands and a brief description.
Most wediaportal commands require an environment on which to perform the action. The environment is passed as the second positional argument (first is command). If you don’t pass an environment, the cli will assume you want to work on your default environment.
For instance, assuming the resolved .wediaportalrc
file has the following shape:
Following commands are equivalent:
(and because default is an alias without changes of “my-customer”, it is also equivalent to
npm shortcuts
The npm commands build
and serve
have been rewired to use wediaportal
:
serve
You can still pass options to npm run serve
:
build
You can still pass options to npm run build
:
It is possible to build several targets with only one command:
will build plugins for both environments
When specifying multiple environments, property vue_apps_base_url.portal
must be common among all environments
Common options of the cli
The cli provides many optional arguments. Some of them are common and early resolved:
--verbose or -v trace|debug|info|warn|error
Allows to define a verbosity level
--log-depth <number=2>
Define max depth for logging objects and arrays
hot-config.html
When serving portal on development, a special URL can be accessed through the browser:
/hot-config.html
This URL allows you to make hot changes to your running configuration.
.wediaportalrc
What is the .wediaportalrc
file?
The .wediaportalrc
is a JSON file that contains environment configuration for serving and building the portal application.
NOTE: when parsed, a JSON5 parser is used ; this means that the JSON stream is much more permissive than a regular JSON is expected to be ; in particular, you are allowed to add single line comments //
, block comments /* */
, un-ambiguous keys are not to be double-quoted…
Extending a .wediaportalrc
Starting from 2023.3, .wediaportalrc
files can be extended. Using the root property extends
, you can specify which wediaportalrc file the current file is extending.
This can be useful especially when different members of the team are running their local server with different configurations.
Interface of a .wediaportalrc
file
Overview
The .wediaportalrc
file can be described with the following typescript definition:
Detailed documentation for WediaEnvironment
property | type | default | description |
---|---|---|---|
|
|
| Server to which plugin(s) should be deployed → Change with a value such as |
|
|
| Should landing pages be served by JSPs → You should not override |
|
|
| The name of the plugin holding the portal source file |
|
|
| The → You should not override |
|
|
| The → You should not override |
|
|
| The → You should not override |
|
| (empty) | The path to the api service (useful only in dev) → Only override for development |
|
|
| |
|
|
| (DEPRECIATED since 2023.5.0) Server’s base path for accessing portal. |
|
|
| (DEPRECIATED since 2023.5.0) Server’s base path for accessing picker. |
|
|
| (DEPRECIATED since 2023.5.0) Server’s base path for accessing wedia-config. |
|
|
| (DEPRECIATED since 2023.5.0) Server’s base path for accessing office content picker (except outlook). |
|
|
| (DEPRECIATED since 2023.5.0) Server’s base path for accessing office outlook content picker. |
|
|
| Bundle path for portal resources → You should not override |
|
|
| Name of the mapping used by portal application |
|
|
| DEPRECATED Name of the plugin holding the configuration. |
|
|
| The vue application context. Allows to always get an extra parameter to be used for bases for instance → You should not override |
|
|
| see |
|
|
| see |
|
|
| Use cookie auth → You should not override |
|
|
| Default application title |
|
|
| The key to use by the application |
|
|
| The default app name |
|
| (not shown) | the secret for the app |
|
|
| Is the application configuration handled by server ? |
|
|
| Default bases → You should not override |
|
|
| The plugin computing configurations → You should not override |