This article describes how to create the basic module structure and a module.json file.
The Module Directory
- Create the basic module structure, as follows:
- If your module will contain a widget, also create a
widgetssubdirectory when you add thepatternssubdirectory, and a subdirectory for the widget’s files. Complete the
module.jsonfile. See the instructions in the next section.EchoInk recommends placing a single widget in a module to maintain independent versioning per widget.
- Add either non-widget patterns or a widget with its associated pattern to the module. See the Add a pattern and Add a widget and a widget pattern topics.
The module.json File
Each module must contain a module.json file. This file provides Inkling with metadata about the module, helping uniquely identify it.
The example below shows the fields EchoInk recommends adding to this file, and the table below provides details.
- Open the
module.jsonfile that you created in the previous section in a text editor. - Add the following fields and set their values to the required values for the module.
- Verify that you have correctly formatted this file, as follows:
- All keys and values must be enclosed within straight quotes.
- All lines must end with a comma, except for the last line.
- All values must be in lowercase, with the exception of
displayNamevalues. - Version numbers must be three-digit numbers separated by periods.
| Field | Required? | Description |
|---|---|---|
name | Yes | String that uses only alphanumeric lowercase characters, underscores, and hyphens, and does not exceed a maximum of 30 characters. Each module in your organization must have a unique name. |
organization | Yes | Short version of your organization's name; also called organization code. Contact your EchoInk Module Administrator or EchoInk representative for the correct value for this field. |
version | Yes | String that must comply with the Semantic Versioning Specification. |
displayName | Recommended | String that identifies the module in the Module Management Interface; supports uppercase and lowercase characters. Generally, it is a well-formatted version of the name field. Although displayName values do not need to be unique, we recommend making them descriptive to enable easy module identification. |