Skip to content
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: allow extension of helper app plists with extendHelperInfo #1233

Merged
merged 4 commits into from
Jul 27, 2021

Conversation

MarshallOfSound
Copy link
Member

For apps that want to customize the Helper app plist files they currently have to do so in an afterCopy or other out-of-band step. Adding extendHelperInfo to match extendInfo makes it much easier to extend these plist files.

This PR also ensures we set CFBundleShortVersionString and CFBundleVersion on helper plists.

@codecov
Copy link

codecov bot commented Apr 1, 2021

Codecov Report

Merging #1233 (a4ce519) into main (7d9b958) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##              main     #1233   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           14        14           
  Lines          716       729   +13     
=========================================
+ Hits           716       729   +13     
Impacted Files Coverage Δ
src/mac.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7d9b958...a4ce519. Read the comment docs.

Copy link
Member

@ckerr ckerr left a comment

Choose a reason for hiding this comment

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

I made some readability suggestions / nits but nothing major. Overall looks reasonable.

src/mac.js Show resolved Hide resolved
src/mac.js Outdated Show resolved Hide resolved
const updateIfExists = [
['helperRendererPlist', '(Renderer)', true],
['helperPluginPlist', '(Plugin)', true],
['helperGPUPlist', '(GPU)', true],
['helperEHPlist', 'EH'],
['helperNPPlist', 'NP']
]

for (const [plistKey] of [...updateIfExists, ['helperPlist']]) {
Copy link
Member

Choose a reason for hiding this comment

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

The first arg of each array in updateIfExists is used as a key. Maybe this variable should be an object instead of an array of arrays e.g.

    const updateIfExists = { 
      'helperRendererPlist': ['(Renderer)', true],
      'helperPluginPlist': ['(Plugin)', true],
      'helperGPUPlist': ['(GPU)', true],
      'helperEHPlist': ['EH'],
      'helperNPPlist': ['NP']
    }

Not a big deal but it would make the code that uses it a little easier to read

Copy link
Member Author

Choose a reason for hiding this comment

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

It's used as a key on a different object, I think this would be harder to read because you'd have to pull the keys and values separately via entries() or with two calls two keys() and values(). Also code hasn't been introduced here, in the spirit of minimal and related changes we probably shouldn't refactor here.

src/mac.js Outdated Show resolved Hide resolved
Copy link
Member

@malept malept left a comment

Choose a reason for hiding this comment

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

I'll take a closer look once Charles's comments are addressed.

NEWS.md Outdated Show resolved Hide resolved
src/index.d.ts Outdated Show resolved Hide resolved
@MarshallOfSound
Copy link
Member Author

Updated as per PR comments @ckerr @malept

Copy link
Member

@malept malept left a comment

Choose a reason for hiding this comment

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

This looks good conceptually. Just some cleanup needed, then we should be good to merge.

NEWS.md Outdated Show resolved Hide resolved
src/index.d.ts Outdated Show resolved Hide resolved
src/mac.js Outdated Show resolved Hide resolved
src/mac.js Outdated Show resolved Hide resolved
src/mac.js Outdated Show resolved Hide resolved
src/mac.js Outdated Show resolved Hide resolved
@malept malept merged commit 33b60b6 into main Jul 27, 2021
@malept malept deleted the helper-plist-extend branch July 27, 2021 21:28
@LarryKlugerDS
Copy link

Hi @MarshallOfSound , This looks great!
Can it be used to set the info.plist for an app's private protocol? (Set via app.setAsDefaultProtocolClient)

Can you supply instructions on how to do so?
Many thanks, Larry

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.

None yet

4 participants