Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

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 :

npm run wediaportal -- <command>

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:

{
  "environments": {
    "my-customer": {
      // ...
    },
    "other-customer": {
      // ...
    }
  },
  "aliases": {
    "default": "my-customer"
  }
}

Following commands are equivalent:

npm run wediaportal -- serve
npm run wediaportal -- serve default

(and because default is an alias without changes of “my-customer”, it is also equivalent to

npm run wediaportal -- serve my-customer

npm shortcuts

The npm commands build and serve have been rewired to use wediaportal:

serve

npm run serve 
# is equivalent to
npm run wediaportal -- serve 

You can still pass options to npm run serve :

npm run serve -- other-customer
# is equivalent to
npm run wediaportal -- serve other-customer

build

npm run build 
# is equivalent to
npm run wediaportal -- build 

You can still pass options to npm run build :

npm run build -- other-customer
# is equivalent to
npm run wediaportal -- build other-customer

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…

Interface of a .wediaportalrc file

Overview

The .wediaportalrc file can be described with the following typescript definition:

type WediaConfig = Record<string, string>;
interface WediaEnvironment {
  appConfigs?: WediaConfig
  deploy_server?: string
  jspMode?: boolean
  plugin_name?: string
  vue_app_analytics_session_name?: string
  vue_app_analytics_session_name_asset_picker?: string
  vue_app_analytics_session_name_office_picker?: string
  vue_app_api_path?: string
  vue_app_base_url?: string
  vue_app_base_url_asset_picker?: string
  vue_app_base_url_config?: string
  vue_app_base_url_office_picker?: string
  vue_app_base_url_office_outlook_picker?: string
  vue_app_bundle_basename?: string
  vue_app_config_path?: string
  vue_app_config_plugin?: string
  vue_app_context?: string
  vue_app_context_asset_picker?: string
  vue_app_context_office_asset_picker?: string
  vue_app_cookie_auth?: string
  vue_app_default_title?: string
  vue_app_key?: string
  vue_app_name?: string
  vue_app_secret?: string
  vue_app_config_server?: boolean
  configBases?: string[]
  configResolverPlugin?: string
}

type TypedWediaEnvironments = {
  ""?: WediaEnvironment
  "local"?: WediaEnvironment
  "development"?: WediaEnvironment
  "development-local"?: WediaEnvironment
}

type WediaAlias = string | {
  of: string,
  override: TypedWediaEnvironments & {
    "*"?: WediaEnvironment
  }
}

export interface WediaPortalRcFile {
  environments: TypedWediaEnvironments
  aliases: Record<string, WediaAlias>
}

Detailed documentation for WediaEnvironment

property

type

default

description

deploy_server

string

http://localhost:8080

Server to which plugin(s) should be deployed

→ Change with a value such as https://<customer>-int.wedia-group.com

jspMode

boolean

true

Should landing pages be served by JSPs

→ You should not override

plugin_name

string

PACKAGED_Portal

The name of the plugin holding the portal source file

vue_app_analytics_session_name

string

portal

The type session attribute to use for analytics when using the portal application

→ You should not override

vue_app_analytics_session_name_asset_picker

string

assetpicker

The type session attribute to use for analytics when using the picker application

→ You should not override

vue_app_analytics_session_name_office_picker

string

officepicker

The type session attribute to use for analytics when using the officepicker application

→ You should not override

vue_app_api_path

string

(empty)

The path to the api service (useful only in dev)

→ Only override for development

vue_app_base_url

string

/portal/

Server’s base path for accessing portal.

Must start and end with a /

→ You should not override

vue_app_base_url_asset_picker

string

/asset-picker/

Server’s base path for accessing picker.

Must start and end with a /

→ You should not override

vue_app_base_url_config

string

/wedia-config/

Server’s base path for accessing wedia-config.

Must start and end with a /

→ You should not override

vue_app_base_url_office_picker

string

/office-picker/

Server’s base path for accessing office content picker (except outlook)

Must start and end with a /

→ You should not override

vue_app_base_url_office_outlook_picker

string

/office-outlook-asset-picker/

Server’s base path for accessing office outlook content picker

Must start and end with a /

→ You should not override

vue_app_bundle_basename

string

/_plugins/PACKAGED_VueAppI18n/config/plugin

Bundle path for portal resources

→ You should not override

vue_app_config_path

string

portal

Name of the mapping used by portal application

vue_app_config_plugin

string

PACKAGED_Portal

DEPRECATED

Name of the plugin holding the configuration.

vue_app_context

string

portal

The vue application context. Allows to always get an extra parameter to be used for bases for instance

→ You should not override

vue_app_context_asset_picker

string

assetpicker

see vue_app_context

vue_app_context_office_asset_picker

string

officeassetpicker

see vue_app_context

vue_app_cookie_auth

string

true

Use cookie auth

→ You should not override

vue_app_default_title

string

Wedia - Portal - Starter Kit

Default application title

vue_app_key

string

3c0122ccdc01abec45184bb7fcc344317c2c33d1

The key to use by the application

vue_app_name

string

portal-app

The default app name

vue_app_secret

string

(not shown)

the secret for the app

vue_app_config_server

boolean

false

Is the application configuration handled by server ?

configBases

string[]

['_portal', 'starter-kit']

Default bases

→ You should not override

configResolverPlugin

string

WXM_CONFIG_RESOLVER

The plugin computing configurations

→ You should not override

  • No labels