Skip to content

Conversation

brpowell
Copy link
Contributor

@brpowell brpowell commented Mar 29, 2021

What does this PR do?

Updates the signature for the manifest initializer with the following:

  • Supports passing in a single path to a manifest file
  • Supports passing in an options object to specify behavior of the initialization

Refactors some functionality:

  • Moves component resolution for manifests to a ManifestResolver class to mirror the one we have for resolving source (should be renamed to SourceResovler perhaps). This cleans and simplifies the ComponentSet class a bit more.

Breaks some stuff:

  • Renamed to ComponentSet.fromManifest()
  • Renamed resolve option to resolveSourcePaths
  • Renamed literalWildcard option to forceAddWildcards

Adds better documentation:

  • Adds more robust docstring for fromManifest
  • Adds docstrings for options to elaborate on usage.

What issues does this PR fix or reference?

@W-9070541@

Functionality Before

const set = ComponentSet.fromManifestFile('/project/package.xml', {
  resolve: ['/project/force-app'],
  literalWildcard: true
})

Functionality After

// single path with default options
const set = ComponentSet.fromManifest('/project/package.xml')

// or options object
const set = ComponentSet.fromManifest({
  manifestPath: '/project/package.xml',
  resolveSourcePaths: ['/project/force-app', '/project/test-app'],
  forceAddWildcards: true
})

@brpowell brpowell requested a review from a team as a code owner March 29, 2021 20:41
resolveSourcePaths?: string[];
/**
* By default, wildcard members encoutered in the manifest are added to the set
* e.g. `{ fullName: '*', type: 'ApexClass' }`. If `resolvePaths` is set,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is resolvePaths referring to resolveSourcePaths?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indeed it is, good catch

Copy link
Contributor

@sfsholden sfsholden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor doc updates - rest looks good.

Bryan Powell and others added 3 commits April 2, 2021 11:35
Co-authored-by: Shelby Holden <45604118+sfsholden@users.noreply.github.com>
@brpowell brpowell merged commit ba2b242 into develop Apr 2, 2021
@brpowell brpowell deleted the bp/fromManifestUpdates branch April 2, 2021 17:33
sfsholden pushed a commit that referenced this pull request Apr 7, 2021
sfsholden pushed a commit that referenced this pull request Apr 7, 2021
sfsholden pushed a commit that referenced this pull request May 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants