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

Add TypoScript support #85

Merged
merged 9 commits into from
Jun 22, 2024
Merged

Add TypoScript support #85

merged 9 commits into from
Jun 22, 2024

Conversation

andreaswolf
Copy link
Owner

No description provided.

@andreaswolf andreaswolf changed the base branch from main to 14-skip-rules May 20, 2024 16:28
@andreaswolf andreaswolf force-pushed the 25-typoscript-support branch 3 times, most recently from a9d8430 to 5ef798e Compare May 20, 2024 17:34
@sabbelasichon sabbelasichon force-pushed the 14-skip-rules branch 3 times, most recently from 4bc3af8 to a1bc229 Compare May 22, 2024 07:06
Base automatically changed from 14-skip-rules to main May 22, 2024 07:07
@andreaswolf andreaswolf force-pushed the 25-typoscript-support branch 2 times, most recently from 2b1af1c to 150f0db Compare June 19, 2024 19:00
@andreaswolf
Copy link
Owner Author

One thing to solve here: how should a single Fractor communicate its result back to the caller? There is no clear rule for that right now, so @simonschaufi and me discussed that today. We came to the following conclusion:

  • null = don't change anything
  • a node or a list of nodes = replace the current node with that
  • an integer = do something else (specific to each file type?), e.g. remove the node, stop traversal of the node (and possibly its children)

This is at least similar to what Rector does, probably it's 100% the same; I did not check that again for now.

Compared to the XML Fractor, an additional challenge with TS is that we need to return a list of nodes from the iterator, since there is no document node that will automatically collect all changed nodes (either directly or implicitly in its children). This needs to be solved, but is not a big deal.

Deciding if a node can be handled and recording the changes and who changed what is part of the abstract base Fractor, so it must basically be reimplemented for each file type. That's not easy to change, so we accept that for now (and it leaves us more leeway to adapt things for file types where it is needed).

@andreaswolf andreaswolf force-pushed the 25-typoscript-support branch 2 times, most recently from cee7a2c to 5e016f0 Compare June 21, 2024 14:39
@andreaswolf
Copy link
Owner Author

@simonschaufi I just resolved all remarks that will be fixed by our pipeline. No need to comment those :)

@andreaswolf andreaswolf force-pushed the 25-typoscript-support branch 4 times, most recently from 30cee97 to 08ca0bc Compare June 21, 2024 18:50
@andreaswolf andreaswolf changed the title WIP Add TypoScript support Add TypoScript support Jun 21, 2024
@andreaswolf andreaswolf requested a review from simonschaufi June 21, 2024 18:54
@simonschaufi
Copy link
Collaborator

A highly requested feature is missing: formatting the result with space or tab indentation. Can this be configured or is this not possible?

@andreaswolf andreaswolf force-pushed the 25-typoscript-support branch from 4ba282a to 23e6dfe Compare June 22, 2024 07:29
Also extends the e2e test script to run multiple tests and to compare
the CLI output of Fractor
@andreaswolf andreaswolf force-pushed the 25-typoscript-support branch from d7a4b6e to 1caa2ac Compare June 22, 2024 07:48
@andreaswolf
Copy link
Owner Author

A highly requested feature is missing: formatting the result with space or tab indentation. Can this be configured or is this not possible?

Should be possible, I'll have a look.

@andreaswolf andreaswolf force-pushed the 25-typoscript-support branch 2 times, most recently from 764433b to 1696201 Compare June 22, 2024 09:31
@andreaswolf
Copy link
Owner Author

A highly requested feature is missing: formatting the result with space or tab indentation. Can this be configured or is this not possible?

I would open an issue and postpone that for now, so we can get this merged now.

@simonschaufi simonschaufi force-pushed the 25-typoscript-support branch from 1696201 to a4006bc Compare June 22, 2024 12:46
@simonschaufi simonschaufi merged commit b06a5d1 into main Jun 22, 2024
9 checks passed
@simonschaufi simonschaufi deleted the 25-typoscript-support branch June 22, 2024 12:52
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