subql
subql copied to clipboard
`codegen:generate` Unable to bypass comments in ts manifest
Description
Generate will not be able to filter existing functions/events if there are commented code. As it is using regex to process the ts-manifest. To solve this the best solution is to move away from Regex and instead use the Typescript AST to parse and modify the code.
To do this we can use the Typescript API or possibly even better is ts-morph
Example failing test
This test will be passing once the problem is fixed https://github.com/subquery/subql/blob/f95d987d833649fd6d984df435fef21620576395/packages/cli/src/controller/generate-controller.spec.ts#L582