JET Pack Metadata
Oracle® JavaScript Extension Toolkit (JET)
17.1.0
G12196-01
Overview
As development teams become more familiar with JET and gain experience with implementing and packaging reusable bits of application functionality as custom JET Web Components, they encounter more complex use cases where multiple components have dependencies upon a set of shared development resources, including: related Components, JavaScript base and utility classes, CSS files, icons, translation bundles, etc.
The following JET component types can assist both JET Web Component producers and consumers with managing these complex use cases:
- JET Component Packs, or JET Packs, define versioned sets of JET Web Components that can be managed, packaged, and delivered as a whole. JET Packs consist of metadata and additional artifacts that allow downstream consumers, such as Oracle Visual Builder or the JET Command Line interface, to automate the configuration and initialization of deployed applications that are built with these Components, including shared resources (e.g., CSS resources, utility JavaScript files, base JavaScript classes extended by multiple Web Components, etc.), and information about 3rd party packages.
- JET Reference Components define a versioned external 3rd party library dependency – JET Packs, JET Resource Components, and individual JET Web Components can include
a JET Reference Component as part of their
dependencies
metadata. JET Reference Components consist of metadata for automating the installation of the corresponding 3rd party library, as well as the necessary RequireJS configuration for calling into this 3rd party library from a deployed JET application. - JET Resource Components define and package resources shared by a set of JET Web Components – JET Packs, other JET Resource Components, and individual JET Web Components
can include a JET Resource Component as part of their
dependencies
metadata. Shared resources can include shared CSS, JavaScript base classes & utility code, icons, translation bundles, etc.
Metadata Structure
Metatata for JET Packs, JET Reference Components, and JET Resource Components is specified in a component.json file that is expected at the root of the Component's packaging. Metadata properties like "name", "version", "jetVersion", "description", and "displayName" should be familiar from the metadata JSON that is defined for JET Web Components. The complete metadata structure for JET Packs, JET Reference Components, and JET Resource Components is as follows:
Key | Required | Type | Description | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
name | yes | {string} | The component name.
The component name must meet the following requirements (based upon the W3C Custom Element spec):
Note:The full name of a component consists of itspack metadata value and its name metadata value, appended
together with a hyphen separating them: [pack_value]-[name_value] . For both JET Core
Components and for JET Custom Components, this full name corresponds to the Component's custom element tag name. The names of
standalone custom JET Web Components (i.e., custom components that are not members of a JET Pack, nor are JET Packs themselves) have
the following additional requirements:
|
||||||||||||||||||||||||||||||
version | yes | {string} | The component version (following semantic version rules). Note that changes to the metadata even for minor updates like updating the jetVersion should result in at least a patch component version change, e.g. 1.0.0 -> 1.0.1. | ||||||||||||||||||||||||||||||
jetVersion | no | {string} | The semantic version of the supported JET version(s).
JET Component authors should not specify a semantic version range that includes unreleased JET major versions
as major releases may contain non backwards compatible changes. Authors should instead recertify components
with each major release and update the metadata or release a new version that is compatible with the new
release changes.
NOTE: Only valid for JET Packs and JET Resource Components. |
||||||||||||||||||||||||||||||
bundles | no | {Object} | Optional RequireJS-style bundles configuration metadata that applies to
JET Packs and JET Reference Components:
The configuration object has the following properties:
bundles property into the application’s RequireJS config
at build time, thus allowing the application to run against the bundled artifacts.
Example:Assuming we have an “oj-foo” JET Pack that defines two bundles, the bundles property might be configured as follows:
|
||||||||||||||||||||||||||||||
dependencies | no | {Object} | Dependency to semantic version mapping for JET Component dependencies.
Example:
Note:
|
||||||||||||||||||||||||||||||
description | no | {string} | A high-level description for the component. | ||||||||||||||||||||||||||||||
displayName | no | {string} | A user friendly, translatable name of the component. | ||||||||||||||||||||||||||||||
extension | no | {Object} | Placeholder for Extension metadata. Each section is identified by a key that specifies the downstream tool that will process this metadata.
For example:
|
||||||||||||||||||||||||||||||
help | no | {string} | This optional metadata property is only valid for JET Packs. It specifies a URL to detailed API documentation for this JET Pack. If unspecified, downstream consumers can look for a default docs/index.html file off of the root of
the JET Pack package.
|
||||||||||||||||||||||||||||||
license | no | {string} | A reference to the license under which use of the component is granted. The value can be:
|
||||||||||||||||||||||||||||||
pack | no | {string} | Identifies the component as belonging to the specified JET Pack.
A JET Pack is a versioned set of JET Components with additional metadata that enables applications to easily install and configure path mappings to the artifacts in that JET Pack.
|
||||||||||||||||||||||||||||||
package | no | {string} | This metadata property is only valid for JET Reference Components, where it is a REQUIRED property.
Specifies the name of the AMD-compatible npm package that is referenced by this component. This is needed to allow the consuming application to identify the 3rd party library, for conflict resolution purposes as well as for security scanning and patching. |
||||||||||||||||||||||||||||||
paths | no | {Object | Array<{Object}>} | Specifies path metadata that is used to generate RequireJS path mappings.
Each object is defined as follows:
Notes:
|
||||||||||||||||||||||||||||||
publicModules | no | {Array<{string}>} | This metadata property is only valid for JET Resource Components.
JET Resource Components define and package resources shared by a set of JET Web Components, typically collected into a JET Pack. By default, these shared resources are considered private, but sometimes it makes sense for a JET Resource Component to provide public utility modules that can be independently imported into a JET application. The The full path to the public module to be imported takes the form: Example:Assuming anoj-foo-utils Resource Component, which is a dependency for an oj-foo JET Pack:
Importing fooValidatorFactory into a JET application written in JavaScript:
Importing fooValidatorFactory into a JET application written in TypeScript:
|
||||||||||||||||||||||||||||||
type | no | {"composite" | "core" | "pack" | "reference" | "resource"}
Default: "composite" |
Identifies the type of this JET Component.
Supported values are:
Metadata for JET Web Components are described in more detail in the JET Metadata topic. |