-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: registryCustomizations #1217
Conversation
.filter(existsOrDoesntMatchIgnored(this.forceIgnoredPaths)) | ||
.filter((info) => !this.forceIgnoredPaths.has(info.output)) | ||
.map((info) => { | ||
if (info.shouldDelete) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
writeInfo can now delete files. This was an easier approach than the existing partialDelete for bundles and I think I'd like those to eventually move to this approach.
this.deleted
accumulates the delete side effects.
output: SourcePath; | ||
source: Readable; | ||
}; | ||
export type WriteInfo = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now writeInfo can delete things
@@ -23,8 +23,8 @@ export class RegistryAccess { | |||
private folderContentTypes?: MetadataType[]; | |||
private aliasTypes?: MetadataType[]; | |||
|
|||
public constructor(registry: MetadataRegistry = defaultRegistry) { | |||
this.registry = registry; | |||
public constructor(registry?: MetadataRegistry, projectDir?: string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
support for passing in a projectDir to avoid the default cwd behavior
@@ -32,7 +34,7 @@ export class MetadataConverter { | |||
public constructor(registry = new RegistryAccess()) { | |||
this.registry = registry; | |||
} | |||
// eslint-disable-next-line complexity |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so refactor out a method
import { MetadataType } from '../registry/types'; | ||
/** handle wide-open reading of values from elements inside any metadata xml file...we don't know the type | ||
* Return the value of the matching element if supplied, or defaults `fullName` then `name` */ | ||
export const extractUniqueElementValue = (xml: JsonMap, uniqueId?: string): string | undefined => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when CustomObjects were the only decomposed thing, we relied on some default behaviors (xml names match filenames, directories are the xml elements, there's always a fullName) but that's not true across other types that we will support decomposing
let parent = component; | ||
if (!parent) { | ||
parent = new SourceComponent( | ||
if (strategy === 'folderPerType' || strategy === 'topLevel' || isResolvingSource) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why remove the DecompositionStrategy
enum?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer union types over string enums. Better dev/compiler experience, keeps types separated from js code (ts enums get compiled into js).
I made notes for some others I'd like to be rid of eventually. Why would you want one?
What does this PR do?
allow entire fragments of registry to be added in
sfdx-project.json
.[this is the "low-level" part of the feature]
Add 4 presets (see Presets.md)
lots of refactoring
lots of snapshot test for the preset/fragment behaviors for various types
What issues does this PR fix or reference?
@W-14608972@
@W-14608988@
@W-14609001@
also includes a small fix for @W-15253267@