{"id":16860474,"url":"https://github.com/webpro/ts-morph-helpers","last_synced_at":"2025-03-22T06:31:42.659Z","repository":{"id":66134207,"uuid":"540836165","full_name":"webpro/ts-morph-helpers","owner":"webpro","description":"Helpers for ts-morph","archived":false,"fork":false,"pushed_at":"2022-11-26T09:31:19.000Z","size":66,"stargazers_count":22,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-18T09:04:12.663Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/webpro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-24T13:20:15.000Z","updated_at":"2024-12-27T05:24:23.000Z","dependencies_parsed_at":"2023-07-15T22:01:03.045Z","dependency_job_id":null,"html_url":"https://github.com/webpro/ts-morph-helpers","commit_stats":{"total_commits":50,"total_committers":1,"mean_commits":50.0,"dds":0.0,"last_synced_commit":"a89fb34c92d1fdebb1f186573ddb3db36828cfdf"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webpro%2Fts-morph-helpers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webpro%2Fts-morph-helpers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webpro%2Fts-morph-helpers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webpro%2Fts-morph-helpers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/webpro","download_url":"https://codeload.github.com/webpro/ts-morph-helpers/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244918500,"owners_count":20531682,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T14:24:26.402Z","updated_at":"2025-03-22T06:31:37.650Z","avatar_url":"https://github.com/webpro.png","language":"TypeScript","readme":"# Helpers for ts-morph\n\nHelpers for [ts-morph](https://ts-morph.com).\n\n## List\n\n```\nexperimental/findJsxIdentifiersInJsxExpressions\nexperimental/findJsxSymbolsInJsxExpressions\nexperimental/getRealSourceFilesForImportDeclarations\nexperimental/getReferencedSourceFiles\nexperimental/hasSymbol\nexperimental/isBarrel\nexpressions/findCallExpressionsByName\nexpressions/findCallExpressionsWithArg\nfile/getRealSourceFileForImportDeclaration\nfile/getSourceFilesForNodes\njsx/findJsxNodeByName\njsx/findJsxNodes\njsx/isJsx\nmodule/findDuplicateExportedNames\nmodule/findExportDeclarationByIdentifier\nmodule/findExportDeclarationByName\nmodule/findExportIdentifierByName\nmodule/findExportSpecifierByName\nmodule/findImportIdentifierByName\nmodule/findImportSpecifierByName\nmodule/findReferencingNamespaceExports\nmodule/findReferencingNamespaceImports\nmodule/findReferencingNamespaceNodes\nmodule/getImportDeclarationsForSymbols\nmodule/hasReferencingDefaultImport\nnode/getDeclarationsForSymbols\nnode/getSymbolsOfNodes\nreact/findContextProviderIdentifierByContextName\nreact/findHookCallExpressions\nreact/findHookIdentifierByContextName\n```\n\n## Naming Is Hard\n\n### Terminology\n\nWhen looking at this example code...\n\n```ts\nimport { a } from './a';\nimport { b } from 'b';\nconst c = a + b;\nconst d = b(c);\nexport { c };\n```\n\n...we can apply the following (incomplete) list of terms:\n\n| Name               | Description                                             | Example                                      |\n| ------------------ | ------------------------------------------------------- | -------------------------------------------- |\n| Symbol             | Named declaration, connects declaration nodes.          | `a`, `b`, `c`, `d`                           |\n| Identifier         | Node, references a symbol                               | `a` (2x), `b` (3x), `c` (2x), `d` (1x)       |\n| Specifier          | More specific classification of identifier              | `ImportSpecifier` `a`, `ExportSpecifier` `c` |\n| Call expression    | Function call with arguments                            | `b(c)`                                       |\n| Import declaration | An import declaration with named and/or default imports | `import { b } from 'b'`                      |\n| Export declaration | An export declaration with named (not default) exports  | `export { b } from 'b'`                      |\n\nHere is the\n[example code in the TypeScript AST Viewer](https://ts-ast-viewer.com/#code/JYWwDg9gTgLgBAbzgQzgXzgMyhEcDkAdAPTL4DcAUKJLInAEbpY574MWUDGEAdgM7wucALwo4AakZUeA+ABNRjABRcAlFQCmAD1rwkwtFSA)\nto see the nodes as described.\n\n### Additional terminology\n\n- SourceFile: The AST of a given source file\n- Program: Collection of source files, and its main entry\n\n### Conventions\n\nThe following conventions are used to name the helper functions:\n\n- To `get` something means the thing is a reference expected to be there (upwards and/or linked).\n- To `find` something means to query for things from a certain starting point (downwards).\n- To get things `For` something expresses an `AncestorForDescendant` hierarchy.\n- To get things `Of` something means the opposite: `descendantOfAncestor`.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebpro%2Fts-morph-helpers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebpro%2Fts-morph-helpers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebpro%2Fts-morph-helpers/lists"}