Skip to content

Commit

Permalink
feat(@W-17522423): enable 2gp and source tracking for contenttypebund…
Browse files Browse the repository at this point in the history
…le (#1506)

Co-authored-by: rishabh.upadhyay <rishabh.upadhyay@salesforce.com>
  • Loading branch information
luciferru and rishabhUpa authored Feb 13, 2025
1 parent f153573 commit e2c8edf
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
8 changes: 8 additions & 0 deletions scripts/update-registry/describe.json
Original file line number Diff line number Diff line change
Expand Up @@ -1084,6 +1084,14 @@
"metaFile": false,
"hasChildren": false
},
"ContentTypeBundle": {
"name": "ContentTypeBundle",
"directoryName": "contentTypes",
"suffix": "contentType",
"inFolder": false,
"metaFile": false,
"hasChildren": false
},
"CorsWhitelistOrigin": {
"name": "CorsWhitelistOrigin",
"directoryName": "corsWhitelistOrigins",
Expand Down
13 changes: 13 additions & 0 deletions src/registry/metadataRegistry.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"botBlocks": "botblock",
"botTemplates": "bottemplate",
"bots": "bot",
"contentTypes": "contenttypebundle",
"documents": "document",
"emailservices": "emailservicesfunction",
"experiencePropertyTypeBundles": "experiencepropertytypebundle",
Expand Down Expand Up @@ -4741,6 +4742,18 @@
},
"supportsPartialDelete": true
},
"contenttypebundle": {
"id": "contenttypebundle",
"name": "ContentTypeBundle",
"directoryName": "contentTypes",
"inFolder": false,
"strictDirectoryName": true,
"metaFileSuffix": "schema.json",
"strategies": {
"adapter": "bundle"
},
"supportsPartialDelete": true
},
"annotationextensionset": {
"id": "annotationextensionset",
"name": "AnnotationExtensionSet",
Expand Down
2 changes: 1 addition & 1 deletion src/resolve/metadataResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ const parseAsMetadata =
if (tree.isDirectory(fsPath)) {
return;
}
return ['DigitalExperience', 'ExperiencePropertyTypeBundle', 'LightningTypeBundle']
return ['DigitalExperience', 'ExperiencePropertyTypeBundle', 'LightningTypeBundle', 'ContentTypeBundle']
.map((type) => registry.getTypeByName(type))
.find((type) => fsPath.split(sep).includes(type.directoryName))?.name;
};
Expand Down
3 changes: 2 additions & 1 deletion src/utils/filePathGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,12 @@ export const filePathsFromMetadataComponent = (
];
}

// lwc, aura, waveTemplate, experiencePropertyType, lightningTypeBundle
// lwc, aura, waveTemplate, experiencePropertyType, lightningTypeBundle, contentTypeBundle
if (type.strategies?.adapter === 'bundle') {
const mappings = new Map<string, string[]>([
['ExperiencePropertyTypeBundle', [join(packageDirWithTypeDir, `${fullName}${sep}schema.json`)]],
['LightningTypeBundle', [join(packageDirWithTypeDir, `${fullName}${sep}schema.json`)]],
['ContentTypeBundle', [join(packageDirWithTypeDir, `${fullName}${sep}schema.json`)]],
['WaveTemplateBundle', [join(packageDirWithTypeDir, `${fullName}${sep}template-info.json`)]],
['LightningComponentBundle', [join(packageDirWithTypeDir, `${fullName}${sep}${fullName}.js${META_XML_SUFFIX}`)]],
['AuraDefinitionBundle', [join(packageDirWithTypeDir, `${fullName}${sep}${fullName}.cmp${META_XML_SUFFIX}`)]],
Expand Down

0 comments on commit e2c8edf

Please sign in to comment.