apex-dev-tools / apex-ls

Apex language server library
Other
2 stars 1 forks source link

Allow standard field declarations in gulped modules #155

Open nawforce opened 1 year ago

nawforce commented 1 year ago

This allows gulped modules to declare standard fields on standard and custom objects. It started as a way to eventually support person accounts which have additional fields by allowing them to be added to gulp modules. Later I am expecting we can enhance metdata-gulp to auto download standard fields to better handle different org shapes.

Along the way I ran into an old problem where we only record isGulped against packages and this is not granular enough to handle say unmanaged gulp modules alongside unmanaged code. To resolve I have moved the isGulped flag down one level to modules. This should have a nice side effect in that you should now be able to use a mix of gulped & local metadata that use the same namespace when doing package development.

I need to do some more manual testing on this to make sure there are no gotchas.

nawforce commented 1 year ago

@bmathewcertinia Could you take a look at the last commit on here. I have moved the isGulped flag from packages to modules and that got my some build issues with your changes in this area. I have attempted to resolve after reading https://github.com/apex-dev-tools/tooling-issues/issues/5 but just want to make sure I am understanding correctly. From looking at the changes it appears that we want dependent package metadata included for OPM.getDependencyCounts() but not for OPM.getDependencyGraph().

I am using the term 'dependent package' here to avoid thinking about if a module in the package is gulped or not. So for example, if we are just using unmanaged we may now mix some metadata we download with some we develop locally. In which case dependency counts and the graph really evaluate over both. Alternatively we could download some managed metadata and develop either unmanaged or managed metadata over that but in that case counts would include the downloaded and the graph would not.

bmathewcertinia commented 1 year ago

I think this is fine, so the original issue was the collector didn't have access to the gulped packages cause it was essentially filtered out IIRC. From the looks of this PR, it looks like some of thats ben handled elsewhere now so the modification in the last commit should be good