ts-migrate
dependency-cruiser
Our great sponsors
ts-migrate | dependency-cruiser | |
---|---|---|
15 | 8 | |
5,287 | 4,914 | |
0.5% | - | |
4.6 | 9.3 | |
5 months ago | 4 days ago | |
TypeScript | JavaScript | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
ts-migrate
-
How to Do a TypeScript Conversion: an opinionated take on gradual conversions
Airbnb converted many millions of lines gradually using automation and wrote about it:
https://medium.com/airbnb-engineering/ts-migrate-a-tool-for-...
And also open sourced the tooling:
-
A Comparison of Node.js Environment Managers
When you migrate your entire project over to TypeScript, errors like "undefined is not a function", syntax errors, or reference errors should no longer exist in your codebase. Thankfully, this is not as daunting as it sounds. Migrating your entire Node.js application to TypeScript can be done incrementally so that you can start reaping the rewards immediately in crucial parts of the codebase. You can also adopt a tool like ts-migrate if you intend to perform the migration in one go.
-
How We Migrated from Javascript and Flow to TypeScript at Osome
Flow to ts — helps to produce raw migration from Flow to TS files and reduces monkey job. TS migrate — helps convert JS files to Typescript files. A great introduction can be found here.
- Should a team of one (me) with some TS experience attempt to refactor a mid-size fullstack app (React & Node) to TypeScript?
-
The Best Integration Testing Library for Serverless Projects Now Supports Typescript!
💡 I typed it using ts-migrate ts-migrate is a tool I strongly recommend. It's been developed by Airbnb to help to migrate easily JavaScript projects to TypeScript.
-
Should I migrate to TS?
When you decide to migrate, I recommend checking https://github.com/airbnb/ts-migrate may speed few migration steps (but it wont solve missing types/interfaces)
-
How to Overcome Your TypeScriptoPhobia
You can use AirBnb's ts-migrate tool or try a more direct tactic following the Migrating from JavaScript guide.
-
[AskJS] Would a Javascript to Typescript Converter Be Useful?
Take a look at https://github.com/airbnb/ts-migrate
-
A Comprehensive Guide To Error Handling In Node.js
When you migrate your entire project over to TypeScript, errors like "undefined is not a function", syntax errors, or reference errors should no longer exist in your codebase. Thankfully, this is not as daunting as it sounds. Migrating your entire Node.js application to TypeScript can be done incrementally so that you can start reaping the rewards immediately in crucial parts of the codebase. You can also adopt a tool like ts-migrate if you intend to perform the migration in one go.
- Using Typescript in a Javascript React app
dependency-cruiser
-
Taking Frontend Architecture Serious with dependency-cruiser
With dependency-cruiser, you can enforce which imports are allowed. This enables you to create an architecture fitness function that ensures your code continues to adhere to the initial design. You can also visualize your dependencies to gain a clearer understanding of your code's actual structure, allowing you to compare it with your mental model and make improvements where necessary.
-
Visualisation tool
something like https://github.com/sverweij/dependency-cruiser maybe https://github.com/pahen/madge or https://github.com/antoine-coulon/skott
-
[AskJS] What ESLint rules do you use to achieve better isolation of components?
I've personally fallen in love with Dependency Cruiser, which lets you set any arbitrary import rules you want on your repository. With it, you can enforce common things, like, "You can only import through the index file, if one exists", but you can also make custom-tailored rules for your specific project. For example, maybe your project is divided into three large folders - folder1 is allowed to import from folder2 and folder3, folder2 can import from folder3, and folder3 can not import from anyone else. Well, you can enforce that too, or whatever you need.
-
Best Practices for TypeScript Monorepo
Dependency Cruiser works great, can even render visuals:
https://github.com/sverweij/dependency-cruiser
NX[0] also has logic for handling this issue
[0]: https://nx.dev/
-
Deprank: Use PageRank to find the most important files in your codebase
Great project!
One feature request: Running the npx command searched only for the js files, not for the ts files. When I built deprank locally with yarn, it also showed the ts files. After looking at dependency-cruiser figure it has to do with what typescript compilers are available where.
It would be great if the npx command you provide in your readme would work regardless of my local setup - dependency-cruiser has documentation and one example of a suitable npx command here: https://github.com/sverweij/dependency-cruiser/blob/develop/...
My suggestion would be to check if any ts file is part of the extension option (i.e. --ext=".js,.jsx, .ts, .tsx") and only then do the magic needed to also show ts files.
-
How We Migrated from Javascript and Flow to TypeScript at Osome
The first step is to install dependency-cruiser.
-
Is it possible to generate a flow diagram from Javascript code?
You may have a look at dependency cruiser.
What are some alternatives?
emerge - Emerge is a browser-based interactive codebase and dependency visualization tool for many different programming languages. It supports some basic code quality and graph metrics and provides a simple and intuitive way to explore and analyze a codebase by using graph structures.
madge - Create graphs from your CommonJS, AMD or ES6 module dependencies
TypeStat - Converts JavaScript to TypeScript and TypeScript to better TypeScript.
jscodeshift - A JavaScript codemod toolkit.
flow-to-ts - Convert flow code to typescript
flow-to-typescript-codemod - Codemod Stripe used to migrate 6.5m+ lines of code from Flow to TypeScript
react-border-wrapper - A wrapper for placing elements along div borders.
prettier-plugin-organize-imports - Make Prettier organize your imports using the TypeScript language service API.
vue-tsx-support - TSX (JSX for TypeScript) support library for Vue
mocha - ☕️ simple, flexible, fun javascript test framework for node.js & the browser
astx - Super powerful structural search and replace for JavaScript and TypeScript to automate your refactoring
workload-discovery-on-aws - Workload Discovery on AWS is a solution to visualize AWS Cloud workloads. With it you can build, customize, and share architecture diagrams of your workloads based on live data from AWS. The solution maintains an inventory of the AWS resources across your accounts and regions, mapping their relationships and displaying them in the user interface.