-
-
Notifications
You must be signed in to change notification settings - Fork 626
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
Better ignores
implementation / documentation
#2017
Comments
Hey @davestewart, |
Great! Any preference regarding the prefix strategy? I know Content heavily uses unstorage, hence the Ultimately, this means any ignore pattern targets single folder / files names only. Would you prefer to document or expand this functionality? |
The prefix ignoring is adopted from Nuxt itself (Nuxt ignores files with What you mean by expanding it? I didn't get your idea here. |
Ah... sorry! I meant the new RegExp(`^${p}|:${p}`) This will match the start or any segment (i.e.
What I meant was, do you want to:
|
I thinks the second one is better approach. Users can design their pattern whatever they want. |
Is your feature request related to a problem?
Overview
The current ignores implementation has a few issues:
Implementation
Looking at the ignore code, it means ignore options can only ever be prefixes:
This makes sense in the terms of the supplied defaults:
But is limiting in terms of more flexible ignoring (unless you get quite creative with the input strings).
Docs
The docs actually don't mention the prefixing, they suggest you can ignore words:
This should be clarified.
File watching
It looks like the
ignores
config doesn't have any effect on the storage instance at the bottom ofsrc/module.ts
.Saving ignored files still triggers
refreshNuxtData()
via a sockets call.Describe the solution you'd like
To support the documented ignores format, change the default to:
And simplify the
contentIgnores
map to:Although, if prefixing is a specific design decision, then document it and provide a couple of examples:
To prevent triggering a refresh when changing ignored files, in the module watch use the same algorithm to prevent a sockets broadcast:
Finally, as the ignore functionality will be used three times at this point, consolidate into a reusable function:
Describe alternatives you've considered
I've been poring through the
ignores
code in the IDE and debugger, and pretty sure this is the only option.Additional context
Trying to optimise the updating code in Nuxt Content Assets:
Pretty sure I know enough about Nuxt Content's source now to do a PR.
The text was updated successfully, but these errors were encountered: