Pure refactor. Move generated deserializer files for `napi/parser` into a `generated/deserialize` directory. This is to make room for more generated files (e.g. visitor, more specialized deserializers), without the number of file in root of the package exploding.
Part of #5068, suggested by @ematipico and @MichaReiser, where @leaysgur
and I explored using biome formatter as the base and made a success. All
credits to the old Rome and the new Biome team.
This PR is in a boilerplate state where some of the functions are marked
as `todo!()`.
I also made the following changes:
* changed the base to be less generic, removed the `Language` and
`Context` generics
* expanded the formatter lifetime to include an `'ast` lifetime
* added access to the source text and comments
* added a mechanism for tracking and accessing parent ast nodes (done by
our codegen)
* removed most of the unit tests because they no longer compile
* removed the `oxc_prettier` crate
Add 2 traits and implement them for AST types:
* `Dummy` trait creates a dummy node for an AST type.
* `TakeIn` replaces a node with a dummy.
Reason for 2 separate traits is that for some types we need to implement `Dummy`, but it'd be inappropriate to implement `TakeIn`. e.g.:
* Fieldless enums which are `Copy`: They should just be copied, rather than replaced.
* `Span`: Ditto.
* `Box<T>`: You should replace the *contents* of the `Box`, not the `Box` itself.
Ideally we wouldn't be implementing `TakeIn` for so many types. Some types are very expensive to generate a dummy for, so we'd ideally guide consumers away from that by not implementing `TakeIn` for those types.
But we want to replace the `TakeIn` trait in Rolldown with our own version. Because Rolldown implements `TakeIn` on many many types, it seemed to make sense to codegen `TakeIn` for pretty much all AST types, so we can migrate their code over to using our trait without too much hassle.
Pure refactor. Move the YAML file for AST changes watch list to a `generated` sub-directory. This follows our convention that all generated files go in a `generated` directory.