Skip to content

Conversation

@EmericW
Copy link
Contributor

@EmericW EmericW commented Sep 22, 2025

This features allows you to include arbitrary static files into your registry as discussed here: #616

It works by adding a glob pattern referencing your desired files in your registry config under the includeFiles property. If a matching file is found in any of your blocks that are directories, it will be added to the manifest.

I currently don't have an automated test for the actual adding of the files to your directory. I have tested it manually and it does work out of the box, no changes where required to the add command. The setup to create this automated test seemed rather daunting.

As soon as this is approved i'll make a PR to document this feature as well.

@changeset-bot
Copy link

changeset-bot bot commented Sep 22, 2025

🦋 Changeset detected

Latest commit: e1faadc

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new
Copy link

pkg-pr-new bot commented Sep 22, 2025

Open in StackBlitz

pnpm dlx https://pkg.pr.new/jsrepojs/jsrepo@623

commit: e1faadc

@ieedan
Copy link
Collaborator

ieedan commented Sep 22, 2025

Thanks @EmericW this looks really good! Will give it a try when I have the chance.

The only other concern I would have would be in adding minimatch (not suggesting we write our own solution) but wondering if we could either use ignore instead or use minimatch in place of ignore as not to introduce unnecessary dependencies.

@EmericW
Copy link
Contributor Author

EmericW commented Sep 23, 2025

Thanks for the quick review.

I didn't realise what the ignore package was or did. I'll try and replace the minimatch library tonight.

@EmericW
Copy link
Contributor Author

EmericW commented Sep 23, 2025

minimatch has been replaced. It wasn't to difficult but slightly annoying.
I didn't want to recreate the ignore object in every call to the shouldIncludeFile method. But I also didn't want to create the ignore object outside of the shouldIncludeFile method. So I turned it into factory.

ieedan
ieedan previously approved these changes Sep 23, 2025
Copy link
Collaborator

@ieedan ieedan left a comment

Choose a reason for hiding this comment

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

LGTM! Just fix the formatting and I will merge rn!

@ieedan
Copy link
Collaborator

ieedan commented Sep 23, 2025

Thank you!

@ieedan ieedan merged commit 5985e18 into jsrepojs:main Sep 23, 2025
3 checks passed
@EmericW EmericW deleted the feature/add-include-files-config-option branch September 25, 2025 19:19
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