AuraDefinitionBundle

Represents an Aura definition bundle. A bundle contains an Aura definition, such as an Aura component, and its related resources, such as a JavaScript controller. The definition can be a component, application, event, interface, or a tokens collection.

Parent Type 

This type extends Metadata and inherits its fields.

File Suffix and Directory Location 

An AuraDefinitionBundle component is a folder that contains definition files. Unlike most other metadata components, an AuraDefinitionBundle component isn’t a single file, it’s a collection of files. Each file represents a resource in a bundle, such as markup, applications, code files (including controllers and helpers), events, documentation, and interfaces. For example, this directory structure shows the hierarchy of the folders and files for two bundles: bundle1 and bundle2.

1aura
2    bundle1
3        bundle1.cmp
4        bundle1Controller.js
5    bundle2
6        bundle2.app
7        bundle2Controller.js
8        bundle2.auradoc

Aura definition bundles must be under a top-level folder named aura. Each bundle must have its own subfolder under the aura folder. The name of each definition file must start with the bundle name.

A bundle doesn’t have a suffix. Definition files can have one of these suffixes:

SuffixComponent Type
.appApplication
.cmpComponent
.designDesign
.evtEvent
.intfInterface
.jsController, Helper, or Renderer
.svgSVG image
.cssStyle
.auradocDocumentation
.tokensTokens collection

Each bundle can have only one file each with a suffix of .app, .cmp, .design, .evt, .intf, or .tokens.

Version 

Introduced in API version 32.0.

Design and SVG components are available in API version 33.0 and later.

In API version 45.0 and later, there are two types of Lightning component: Aura components and Lightning web components. This metadata type describes an Aura component.

Special Access Rules 

Definitions can be created only in organizations with defined namespaces.

Fields 

apiVersion 

  • Type: double
  • Required: No
  • Introduced: API version 35.0
  • Description: The API version for this definition bundle. When you create an Aura bundle, you can specify the API version to save it with.

auraDefinitions 

  • Type: AuraDefinitions
  • Required: No
  • Description: Reserved for internal use.

controllerContent 

  • Type: base64Binary
  • Required: No
  • Description: The content of a JavaScript client-side controller.

description 

  • Type: string
  • Required: No
  • Introduced: API version 35.0
  • Description: The specification of the Aura bundle.

designContent 

  • Type: base64Binary
  • Required: No
  • Description: The content of a design definition. Only valid inside a component bundle.

documentationContent 

  • Type: base64Binary
  • Required: No
  • Description: The content of a documentation definition.

helperContent 

  • Type: base64Binary
  • Required: No
  • Description: The content of a JavaScript helper.

markup 

  • Type: base64Binary
  • Required: No
  • Description: The content of the markup for a definition.

modelContent 

  • Type: base64Binary
  • Required: No
  • Description: Deprecated. Do not use.

packageVersions 

  • Type: PackageVersion[]
  • Required: No
  • Introduced: API version 35.0
  • Description: The list of installed managed package versions that this Aura definition bundle references.

rendererContent 

  • Type: base64Binary
  • Required: No
  • Description: The content of a JavaScript client-side renderer.

styleContent 

  • Type: base64Binary
  • Required: No
  • Description: The CSS for the definition.

SVGContent 

  • Type: base64Binary
  • Required: No
  • Description: The SVG image for the definition.

testsuiteContent 

  • Type: base64Binary
  • Required: No
  • Description: Reserved for internal use.

type 

  • Type: AuraBundleType (enumeration of type string)
  • Required: No
  • Description: The definition type.
  • Possible values:
    • Application
    • Component
    • Event
    • Interface
    • Tokens

AuraDefinition Type 

Fields 

defType 

  • Type: string
  • Required: Yes

source 

  • Type: base64Binary
  • Required: Yes

AuraDefinitions Type 

Fields 

auraDefinition 

Declarative Metadata Sample Definition 

This example shows the directory structure of an AuraDefinitionBundle component.

1aura
2    sampleCmp
3        sampleCmp.cmp
4        sampleCmpController.js

The following samples show the contents of the metadata definition files that correspond to the sample aura directory.

Content of sampleCmp.cmp:

1<aura:component>
2    <aura:attribute name="val1" type="String" default="Value"/>
3    <aura:attribute name="val2" type="String" />
4    <aura:handler name="init" value="{!this}" action="{!c.myAction}"/>
5        <ui:outputText value='Hello world!'/>
6        <ui:outputText value='{!v.val1}'/>
7        <ui:outputText value='{!v.val2}'/>
8</aura:component>

Content of sampleCmpController.js:

1({  
2  myAction : function(component) {
3    component.set('v.val1','Value1');
4    component.set('v.val2','Value2');
5  }
6})

This package.xml references the definitions of all Lightning components that are present in the sampleCmp bundle.

1<?xml version="1.0" encoding="UTF-8"?>
2<Package xmlns="http://soap.sforce.com/2006/04/metadata">
3    <types>
4        <members>sampleCmp</members>
5        <name>AuraDefinitionBundle</name>
6    </types>
7    <version>68.0</version>
8</Package>

Wildcard Support in the Manifest File 

This metadata type supports the wildcard character * (asterisk) in the package.xml manifest file. For information about using the manifest file, see Deploying and Retrieving Metadata with the Zip File.