@@ -10,7 +10,7 @@ import {
1010import { pipe } from 'fp-ts/function' ;
1111import * as TE from 'fp-ts/TaskEither' ;
1212import { reflectApexSource } from '../reflection/apex/reflect-apex-source' ;
13- import { Changelog , hasChanges , processChangelog , VersionManifest } from './process-changelog' ;
13+ import { Changelog , hasChanges , ParsedType , processChangelog , VersionManifest } from './process-changelog' ;
1414import { convertToRenderableChangelog , RenderableChangelog } from './renderable-changelog' ;
1515import { CompilationRequest , Template } from '../template' ;
1616import { changelogTemplate } from './templates/changelog-template' ;
@@ -19,14 +19,9 @@ import { apply } from '#utils/fp';
1919import { filterScope } from '../reflection/apex/filter-scope' ;
2020import { isInSource , isSkip , passThroughHook , skip , toFrontmatterString } from '../shared/utils' ;
2121import { reflectCustomFieldsAndObjectsAndMetadataRecords } from '../reflection/sobject/reflectCustomFieldsAndObjectsAndMetadataRecords' ;
22- import { CustomObjectMetadata } from '../reflection/sobject/reflect-custom-object-sources' ;
23- import { Type } from '@cparra/apex-reflection' ;
2422import { filterApexSourceFiles , filterCustomObjectsFieldsAndMetadataRecords } from '#utils/source-bundle-utils' ;
25- import { CustomFieldMetadata } from '../reflection/sobject/reflect-custom-field-source' ;
2623import { hookableTemplate } from '../markdown/templates/hookable' ;
2724import changelogToSourceChangelog from './helpers/changelog-to-source-changelog' ;
28- import { CustomMetadataMetadata } from '../reflection/sobject/reflect-custom-metadata-source' ;
29- import { TriggerMetadata } from '../reflection/trigger/reflect-trigger-source' ;
3025import { reflectTriggerSource } from '../reflection/trigger/reflect-trigger-source' ;
3126import { filterTriggerFiles } from '#utils/source-bundle-utils' ;
3227
@@ -81,7 +76,6 @@ function reflect(bundles: UnparsedSourceBundle[], config: Omit<UserDefinedChange
8176 TE . map ( ( parsedObjectFiles ) => [ ...parsedApexFiles , ...parsedObjectFiles ] ) ,
8277 ) ;
8378 } ) ,
84- // Add trigger reflection
8579 TE . chain ( ( parsedFiles ) => {
8680 return pipe (
8781 reflectTriggerSource ( filterTriggerFiles ( bundles ) ) ,
@@ -94,26 +88,14 @@ function reflect(bundles: UnparsedSourceBundle[], config: Omit<UserDefinedChange
9488function toManifests ( { oldVersion, newVersion } : { oldVersion : ParsedFile [ ] ; newVersion : ParsedFile [ ] } ) {
9589 function parsedFilesToManifest ( parsedFiles : ParsedFile [ ] ) : VersionManifest {
9690 return {
97- types : parsedFiles . reduce (
98- (
99- previousValue : (
100- | Type
101- | CustomObjectMetadata
102- | CustomFieldMetadata
103- | CustomMetadataMetadata
104- | TriggerMetadata
105- ) [ ] ,
106- parsedFile : ParsedFile ,
107- ) => {
108- if ( ! isInSource ( parsedFile . source ) && parsedFile . type . type_name === 'customobject' ) {
109- // When we are dealing with a custom object that was not in the source (for extension fields), we return all
110- // of its fields.
111- return [ ...previousValue , ...parsedFile . type . fields ] ;
112- }
113- return [ ...previousValue , parsedFile . type ] ;
114- } ,
115- [ ] as ( Type | CustomObjectMetadata | CustomFieldMetadata | CustomMetadataMetadata | TriggerMetadata ) [ ] ,
116- ) ,
91+ types : parsedFiles . reduce ( ( previousValue : ParsedType [ ] , parsedFile : ParsedFile ) => {
92+ if ( ! isInSource ( parsedFile . source ) && parsedFile . type . type_name === 'customobject' ) {
93+ // When we are dealing with a custom object that was not in the source (for extension fields), we return all
94+ // of its fields.
95+ return [ ...previousValue , ...parsedFile . type . fields ] ;
96+ }
97+ return [ ...previousValue , parsedFile . type ] ;
98+ } , [ ] as ParsedType [ ] ) ,
11799 } ;
118100 }
119101
0 commit comments