{"id":31640498,"url":"https://github.com/evg4b/ts-morpheus","last_synced_at":"2026-01-20T17:00:55.789Z","repository":{"id":315305424,"uuid":"1058888585","full_name":"evg4b/ts-morpheus","owner":"evg4b","description":"A TypeScript library that provides utilities for working with Angular code using ts-morph","archived":false,"fork":false,"pushed_at":"2025-10-26T21:52:54.000Z","size":78,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-26T23:30:48.369Z","etag":null,"topics":["angular","ast","code-analysis","refactoring","ts-morph","typescript"],"latest_commit_sha":null,"homepage":"https://evg4b.github.io/ts-morpheus/","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/evg4b.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-17T17:27:00.000Z","updated_at":"2025-10-26T21:52:58.000Z","dependencies_parsed_at":"2025-09-17T21:46:25.058Z","dependency_job_id":"8a1ea9ce-7925-4660-aa94-eea7be1cd3b3","html_url":"https://github.com/evg4b/ts-morpheus","commit_stats":null,"previous_names":["evg4b/ts-morpheus"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/evg4b/ts-morpheus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evg4b%2Fts-morpheus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evg4b%2Fts-morpheus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evg4b%2Fts-morpheus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evg4b%2Fts-morpheus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/evg4b","download_url":"https://codeload.github.com/evg4b/ts-morpheus/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evg4b%2Fts-morpheus/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28607624,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T16:10:39.856Z","status":"ssl_error","status_checked_at":"2026-01-20T16:10:39.493Z","response_time":117,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["angular","ast","code-analysis","refactoring","ts-morph","typescript"],"created_at":"2025-10-07T02:42:22.685Z","updated_at":"2026-01-20T17:00:55.740Z","avatar_url":"https://github.com/evg4b.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ts-morpheus\n\n[![Node.js CI](https://github.com/evg4b/ts-morpheus/actions/workflows/node.js.yml/badge.svg?branch=main)](https://github.com/evg4b/ts-morpheus/actions/workflows/node.js.yml)\n\nA TypeScript library that provides utilities for working with Angular code\nusing [ts-morph](https://github.com/dsherret/ts-morph). This library offers a collection of helper functions to analyze,\nmanipulate, and transform Angular TypeScript code programmatically.\n\n## Features\n\n- **Angular Component Analysis**: Detect and work with Angular components, directives, pipes, modules, and services\n- **Import Management**: Add, remove, and modify TypeScript imports declaratively\n- **Type-Safe**: Built with TypeScript for full type safety\n- **ts-morph Integration**: Seamlessly works with ts-morph AST manipulation\n\n## Installation\n\n```bash\nnpm install ts-morpheus\n# or\nyarn add ts-morpheus\n```\n\n**Peer Dependencies:**\n\n- `ts-morph`: ^27.0.0\n\n## Modules\n\nThe library is organized into two main modules:\n\n- **`ts-morpheus/angular`** - Angular-specific utilities for components, directives, pipes, modules, and services\n- **`ts-morpheus/common`** - Common utilities for import management and general TypeScript manipulation\n\n## Usage\n\n### Angular Components\n\nThe `ts-morpheus/angular` module provides utilities for working with Angular-specific constructs:\n\n```typescript\nimport { isAngularComponent, getAngularComponentDecorator } from 'ts-morpheus/angular';\nimport { Project } from 'ts-morph';\n\nconst project = new Project();\nconst sourceFile = project.addSourceFileAtPath('path/to/component.ts');\nconst classDeclaration = sourceFile.getClasses()[0];\n\n// Check if class is an Angular component\nif (isAngularComponent(classDeclaration)) {\n  console.log('This is an Angular component!');\n}\n\n// Get the @Component decorator\nconst decorator = getAngularComponentDecorator(classDeclaration);\n```\n\n### Import Management\n\nThe `ts-morpheus/common` module provides utilities for managing TypeScript imports:\n\n```typescript\nimport { addImportDeclaration, removeNamedImports } from 'ts-morpheus/common';\nimport { Project } from 'ts-morph';\n\nconst project = new Project();\nconst sourceFile = project.addSourceFileAtPath('path/to/file.ts');\n\n// Add named imports\naddImportDeclaration(sourceFile, {\n  namedImports: ['Component', 'OnInit'],\n  module: '@angular/core'\n});\n\n// Remove specific named imports\nremoveNamedImports(sourceFile, '@angular/core', ['OnInit']);\n```\n\n## Development\n\n### Scripts\n\n```bash\n# Build the project\nyarn build\n\n# Run tests\nyarn test\n\n# Run linting\nyarn lint\n\n# Format code\nyarn format\n\n# Type checking\nyarn check\n\n# Generate documentation\nyarn docs\n\n# Development mode (watch)\nyarn dev\n```\n\n### Testing\n\nThe project uses [rstest](https://github.com/rsuite/rstest) for testing. Run tests with:\n\n```bash\nyarn test\n```\n\n## Contributing\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add some amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## API Reference\n\nFull API documentation is available at [https://evg4b.github.io/ts-morpheus/](https://evg4b.github.io/ts-morpheus/)\n\n## Related Projects\n\n- [ts-morph](https://github.com/dsherret/ts-morph) - TypeScript Compiler API wrapper\n- [Angular](https://angular.io/) - The web framework this library is designed to work with\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevg4b%2Fts-morpheus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fevg4b%2Fts-morpheus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevg4b%2Fts-morpheus/lists"}