For discussion of issue #198 (dont merge!) #202
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In order to add support for including optional IGNORE settings in
site.yaml
, It is necessary to make some rather large changes tofswalk
)... due to the various hidden dependancies surrounging isLegit and the whole configuration merging.
In order to make the changes i've also had to move isLegit out to a separate file and create a factory method to return an "isLegit" function to avoid having to pass the "ignores" with every invocation.
I'm not comfortable that this is the right way to inject global configuration/settings, and that some of the existing bootstrapping might need discussing and re-thinking.
I've created a PR so that these changes can be easily shared and discussed.
Changes to critical
fswalk
This PR also shows that allowing user configurations in site.yaml related to files, ends up requiring delicate changes to
fswalk
, a critical piece of code that we need to limit changes to. (imho)Hard code support for Cloudflare and leave user configuration for the next major release
Coverage is currently low; therefore for now, I recommend hard coding in support for excluding cloudflare worker functions folder, but leaving out the ability to customise it further with configurations in site.yaml.
I think a change to injecting global configuration settings requires a discussion, and might end up rethinking bootstrapping and be better to wait to include in a next major release? (hard coding solid good defaults for pit-of-sucess and idiot proofing the first version)
Hopefully the code changes in the discussion branch make sense; but it's a fairly chunky bit of changes, so I'll happy answer any questions if that will help.
I think that adding any other user overridable settings (in site.yaml) would end up requiring very similar changes, hence this PR for discussion only.
Your thoughts?
Alan
p.s. I've got all the tests passing here. So while this branch is for discussion, it's passing all the tests.
I had to change the
beforeAll
andAfterAll
tobeforeEach
andAfterEach
, because some tests overwrite the site.yaml, and cause side effects. I though it would slow down the tests, but BUN is just unbelievably fast and didnt slow down at all. Having that nice clean separation for these integration tests is important.After we've discussed this ... I'll create a new PR for hard coding support for ringfencing (protecting) cloudflare
functions
folder, and update the tests and bring in thebeforeEach
andafterEach
change into that PR.