All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Restored working implementation of
:nth-child()and:nth-last-child().
- Fixed the API signature of
map, so it only works on aSourceFile.
- Made the
printfunction public, it's useful when doingmapoperations.
- Add
@types/esquerytodependencies.
I had to use TSQuery recently and found a few bugs, and wanted to add a few ergonomic things, so here's a major release.
The big breaking change here is that visitAllChildren is now the default behaviour. Less-specific queries that may have worked in
previous versions may no longer work exactly the same. This is a pretty annoying change for a very early mistake, but I figured it
was time to pull off the band-aid.
scriptKindparameter toqueryso the caller can control how TypeScript parses the input code.includesto simply check if there are any selector matches within some code.- Direct exports of public functions, e.g.
import { ast } from '@phenomnomnominal/tquery'; - Type exports for types used in the public API. This includes types from
typescriptandesquery. - This CHANGELOG file to hopefully list all API changes going forward.
replacenow uses the TypeScriptPrinterto format the output code. This means that it will handle AST Node removal better, but also means that you may need to run any formatters (e.g. Prettier) on the result to have it match your codebase.:functionselector will now match aMethodDeclaration.
- TSQuery will now query all children by default. This means that less-specific queries that may have worked in previous versions may no longer work exactly the same.
- Deprecated the old API, will remove in v7. Prefer importing the specific functions.
- Deprecated the
syntaxKindNamefunction. This shouldn't have been in the public API. - Upgrade many dependencies.
visitAllChildrenoption. This is now the default behaviour.