onebeyond / systemic

📦 A minimal dependency injection framework.
https://onebeyond.github.io/systemic
MIT License
56 stars 7 forks source link

limit published artifacts #44

Closed adjoinant closed 3 years ago

adjoinant commented 3 years ago

Hello,

I have recently come across this repository (and related guidesmiths packages) and I am a fan. Thanks for sharing them.

I have noticed that the published package is quite large, and it seems to include some CI/CD files that are probably not required - specifically, a cc-test-reporter file in the root of the package directory. I am aware that there can be different opinions on what exactly should be included in a published package. I personally prefer a minimal approach, but others often like to include more.

Could I propose the use of the files field in your package.json (instead of the deny-listing .npmignore) to ensure that only the intended files make their way in to the published package. I would be happy to open a branch and make a PR, if you give me some guidance on (a) if this proposal is acceptable, and (b) how much you would wish to see included in the (allow-listing) files field.

cressie176 commented 3 years ago

Hi @adjoinant,

Thanks for taking the time to raise this issue, pointing out the unnecessary files being published to npm, suggesting we use the files field in package.json and the offer of a PR. You are absolutely right about cc-test-reporter - I hadn't spotted that was being included in the package. I will sort it out promptly.

I'm generally reluctant to use files (in this or any other library) as think it's highly likely that at some point we would forget to update it when adding or renaming a file. This could result in a broken package, and a whole lot of problems, more serious that including a surplus.

I'm glad you're enjoying systemic et al.

Best,

Steve

adjoinant commented 3 years ago

Hi @cressie176,

Thanks for the swift response and for sharing your thoughts on files - was a fair and interesting point to consider.

Best,

Adam

cressie176 commented 3 years ago

Published as systemic@3.3.9. Down to 31.8 kB. Thanks once again for reporting. I checked a sample of other GuideSmiths packages and they were OK. I think systemic was different because we'd been experimenting with publishing from travis.