Skip to content

Commit 63c2cf7

Browse files
committed
docs(build-tools): enhance documentation on build tools and their usage
Expand the section on build tools to include popular tools, their features, and how to choose the right one for different projects.
1 parent 4ea52ab commit 63c2cf7

5 files changed

Lines changed: 296 additions & 20 deletions
Lines changed: 98 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,109 @@
11
# Build Tools
22

3-
Task runners automatically execute commands and carry out processes behind the scenes. This helps automate your workflow by performing mundane, repetitive tasks that you would otherwise waste an egregious amount of time repeating yourself.
3+
Automatically package and optimize your code for production using task runners and bundlers.
44

5-
Common usages of task runners include numerous development tasks such as: spinning up development servers, compiling code (ex. SCSS to CSS), running linters, serving files up from a local port on your computer, and many more!
5+
## What Are Build Tools?
66

7-
Visit the following resources to learn more:
7+
Build tools do repetitive work automatically. Instead of doing these tasks manually, you set them up once and they run whenever you need them.
88

9-
- [@article@webpack is a static module bundler for modern JavaScript applications](https://webpack.js.org/)
9+
## What Do They Do?
10+
11+
Here are common tasks build tools automate:
12+
13+
- **Bundling** - Combine all your code files into optimized packages browsers can download
14+
- **Compiling** - Convert TypeScript to JavaScript, SCSS to CSS, etc.
15+
- **Minification** - Remove unnecessary characters to make files smaller and faster
16+
- **Development server** - Run a local server while you develop so you can test immediately
17+
- **Asset optimization** - Compress images and other files
18+
- **Linting & formatting** - Run quality checks automatically
19+
20+
## Popular Build Tools
21+
22+
### Fast, Modern Tools (Recommended for New Projects)
23+
24+
#### Vite
25+
- **Speed:** Extremely fast development and builds
26+
- **Best for:** Modern web applications, React, Vue, Svelte projects
27+
- **Why use it:** Fastest development experience available
1028
- [@article@Vite Next Generation Frontend Tooling](https://vitejs.dev)
11-
- [@article@Parcel is a zero configuration build tool for the web](https://parceljs.org/)
29+
30+
#### Esbuild
31+
- **Speed:** Fastest JavaScript bundler available
32+
- **Best for:** Libraries, quick builds, or when you need raw speed
33+
- **Why use it:** Simple, incredibly fast, minimal configuration
1234
- [@article@esbuild is an extremely fast JavaScript bundler and minifier](https://esbuild.github.io/)
35+
36+
#### SWC
37+
- **Speed:** Super-fast compiler written in Rust
38+
- **Best for:** High-performance builds, large projects
39+
- **Why use it:** Written in Rust for maximum performance
1340
- [@article@swc is a super-fast compiler written in Rust](https://swc.rs/)
14-
- [@article@tsup is a zero-config TypeScript build tool](https://tsup.egoist.dev/)
41+
42+
### Established Tools
43+
44+
#### Webpack
45+
- **Features:** Most powerful and flexible
46+
- **Best for:** Complex applications with special build requirements
47+
- **Why use it:** Can handle almost any build scenario
48+
- [@article@webpack is a static module bundler for modern JavaScript applications](https://webpack.js.org/)
49+
50+
#### Rollup
51+
- **Best for:** Building libraries and packages
52+
- **Why use it:** Optimized for creating reusable code you'll distribute to others
1553
- [@article@Rollup is a module bundler for JavaScript](https://rollupjs.org/guide/en/)
54+
55+
### Zero-Config Tools (Simplicity)
56+
57+
#### Parcel
58+
- **Best for:** Simple projects where you don't want to think about configuration
59+
- **Why use it:** Works out-of-the-box with minimal setup
60+
- [@article@Parcel is a zero configuration build tool for the web](https://parceljs.org/)
61+
62+
#### tsup
63+
- **Best for:** TypeScript libraries and packages
64+
- **Why use it:** Handles TypeScript setup automatically, minimal config
65+
- [@article@tsup is a zero-config TypeScript build tool](https://tsup.egoist.dev/)
66+
67+
#### tsdx
68+
- **Best for:** Building TypeScript packages and CLI tools
69+
- **Why use it:** Everything pre-configured for TypeScript package development
1670
- [@article@tsdx is a zero-config CLI for TypeScript package development](https://tsdx.io/)
71+
72+
## How to Choose
73+
74+
### For Learning or Simple Projects
75+
Use **Parcel** - it just works with zero configuration.
76+
77+
### For Modern Web Apps
78+
Use **Vite** - fastest development experience, great defaults.
79+
80+
### For Building Libraries
81+
Use **tsup** or **Rollup** - optimized for package distribution.
82+
83+
### For Complex Applications
84+
Use **Webpack** - powerful, but more complex setup.
85+
86+
### For Maximum Speed
87+
Use **Esbuild** or **SWC** - if you need the absolute fastest builds.
88+
89+
## Quick Comparison
90+
91+
| Tool | Speed | Setup | Best For |
92+
|------|-------|-------|----------|
93+
| Vite | ⚡⚡⚡ | Simple | Modern web apps |
94+
| Esbuild | ⚡⚡⚡ | Simple | Speed-critical builds |
95+
| Webpack || Complex | Complex apps |
96+
| Parcel | ⚡⚡ | None | Simple projects |
97+
| tsup | ⚡⚡⚡ | Minimal | TypeScript libraries |
98+
| Rollup | ⚡⚡ | Medium | Library bundles |
99+
100+
## Getting Started
101+
102+
If you're just starting:
103+
1. **Learning?** Use Parcel (zero config needed)
104+
2. **Building a web app?** Use Vite (modern, fast, great tooling)
105+
3. **Creating a library?** Use tsup (built for TypeScript libraries)
106+
107+
Most tools can convert later if your needs change—start simple, upgrade if needed.
108+
17109
- [@feed@Explore top posts about Tools](https://app.daily.dev/tags/tools?ref=roadmapsh)
Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,28 @@
11
# Ecosystem
22

3-
Have a look at the linked nodes for different tools and frameworks that you can use to build your projects.
3+
The TypeScript ecosystem includes many tools and frameworks that make development easier and faster.
4+
5+
## What is an Ecosystem?
6+
7+
An ecosystem is a collection of tools, libraries, and frameworks that work together. Think of it as a toolkit—you don't need all of them, but knowing what's available helps you choose the right ones for your project.
8+
9+
## Why Explore the TypeScript Ecosystem?
10+
11+
- **Speed up development** - Use pre-built tools instead of writing everything from scratch
12+
- **Better code quality** - Tools handle linting, formatting, and testing for you
13+
- **Solve common problems** - Libraries let you focus on your app's unique features
14+
15+
## Main Categories
16+
17+
The TypeScript ecosystem includes tools for:
18+
19+
- **Building & bundling** - Package your code for production (webpack, Vite, Esbuild)
20+
- **Testing** - Make sure your code works correctly (Jest, Vitest)
21+
- **Linting & formatting** - Keep your code clean and consistent (ESLint, Prettier)
22+
- **Data validation** - Check that data is correct before using it (Zod)
23+
- **Server runtime** - Run TypeScript on servers (Node.js with ts-node)
24+
- **Web frameworks** - Build web applications faster (Next.js, Astro, SvelteKit)
25+
26+
## Getting Started
27+
28+
Check the linked nodes in the roadmap to learn about specific tools and frameworks. Each one solves different problems—explore them and find what works for your project.
Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,61 @@
11
# Formatting
22

3-
Prettier is an opinionated code formatter with support for JavaScript, HTML, CSS, YAML, Markdown, GraphQL Schemas. By far the biggest reason for adopting Prettier is to stop all the on-going debates over styles. Biome is a faster alternative to Prettier! (It also does linting!)
3+
Format your code automatically so you don't have to think about spacing, quotes, or indentation.
44

5-
Visit the following resources to learn more:
5+
## What is Code Formatting?
66

7+
Code formatting is about making your code look consistent—things like indentation, spacing, and quote style. A formatter automatically fixes these so you can focus on writing logic, not debating style.
8+
9+
## Why Use a Formatter?
10+
11+
- **No more style debates** - The tool decides the style, everyone follows it
12+
- **Save time** - You don't manually fix spacing or indentation
13+
- **Consistent code** - All code in your project looks the same
14+
- **Better focus** - Stop worrying about how code looks, focus on what it does
15+
16+
## Popular Formatters
17+
18+
### Prettier
19+
20+
An easy-to-use formatter that works with JavaScript, TypeScript, HTML, CSS, and more.
21+
22+
**Pros:**
23+
- Very simple to set up and use
24+
- Works with many file types
25+
- Extremely popular (used by thousands of projects)
26+
27+
**When to use:** When you want a quick, minimal-config formatter for most projects.
28+
29+
**Resources:**
730
- [@article@Prettier Website](https://prettier.io)
831
- [@article@Why Prettier](https://prettier.io/docs/en/why-prettier.html)
32+
33+
### Biome
34+
35+
A newer, faster alternative to Prettier that combines formatting AND linting in one tool.
36+
37+
**Pros:**
38+
- Much faster than Prettier (written in Rust)
39+
- Does both formatting and linting at once
40+
- Smaller setup
41+
42+
**When to use:** When you want better performance and don't want to manage separate formatter and linter tools.
43+
44+
**Resources:**
945
- [@article@BiomeJS Website](https://biomejs.dev)
46+
47+
## Quick Comparison
48+
49+
| Feature | Prettier | Biome |
50+
|---------|----------|-------|
51+
| Speed | Standard | Very fast |
52+
| Formatting |||
53+
| Linting |||
54+
| Setup | Simple | Simple |
55+
| Community | Very large | Growing |
56+
57+
## How to Choose
58+
59+
- **Just starting out?** Use Prettier—it's the most popular choice
60+
- **Want speed and less tools?** Try Biome
61+
- **Need deep customization?** Prettier has more options

src/data/roadmaps/typescript/content/linting@8PcAPOrKisKRYPWamz4nV.md

Lines changed: 56 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,62 @@
11
# Linting
22

3-
With ESLint you can impose the coding standard using a certain set of standalone rules.
3+
Catch bugs and code quality issues automatically while you write code.
44

5-
Visit the following resources to learn more:
5+
## What is Linting?
6+
7+
A linter is a tool that reads your code and points out problems before you run it. Think of it like a spell-checker for code—it finds mistakes automatically.
8+
9+
## Why Use a Linter?
10+
11+
- **Find bugs early** - Catch mistakes before they cause problems in production
12+
- **Enforce coding rules** - Make sure your team writes code the same way
13+
- **Better quality** - Avoid common programming mistakes automatically
14+
- **Save time** - You don't have to manually review code for these issues
15+
16+
## ESLint: The Standard Tool
17+
18+
ESLint is by far the most popular linter for JavaScript and TypeScript. You give it rules (standards for your code), and it checks every file against those rules.
19+
20+
## How It Works
21+
22+
1. **You define rules** - What coding standards matter to you? (No unused variables? No console.log in production? etc.)
23+
2. **Run ESLint** - Point it at your code
24+
3. **Get a report** - It lists every place where code breaks your rules
25+
4. **Fix issues** - Many issues can be fixed automatically with `--fix` flag
26+
27+
## Example Rules
28+
29+
Here are common rules teams use:
30+
31+
- Don't leave unused variables in your code
32+
- Always use `===` instead of `==`
33+
- Don't use `var`, use `const` or `let`
34+
- Warn if you use `console.log` (should only be in development)
35+
36+
## Getting Started
37+
38+
```bash
39+
# Install ESLint
40+
npm install --save-dev eslint
41+
42+
# Set up your first rules
43+
npx eslint --init
44+
45+
# Check your code
46+
npx eslint src/
47+
48+
# Auto-fix issues (when possible)
49+
npx eslint src/ --fix
50+
```
51+
52+
## Tips
53+
54+
- **Start small** - Don't enable too many rules at once
55+
- **Work with your team** - Agree on rules together
56+
- **Use presets** - Many projects share rule sets (like `eslint-config-airbnb`)
57+
- **Combine with formatter** - Use ESLint for code quality + Prettier for code style
58+
59+
## Learn More
660

761
- [@article@ESLint Official Website](https://eslint.org/)
862
- [@article@Introduction to ESLint](https://dev.to/shivambmgupta/eslint-what-why-when-how-5f1d)
Lines changed: 62 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,64 @@
11
# Useful Packages
22

3-
TypeScript has a large ecosystem of packages that can be used to extend the language or to add functionality to your project. Here is the list of some of the most useful packages.
4-
5-
- [@article@zod](https://zod.dev/): A TypeScript-first data validation library
6-
- [@opensource@ts-morph](https://github.com/dsherret/ts-morph): A TypeScript-first API for manipulating TypeScript code
7-
- [@article@ts-node](https://typestrong.org/ts-node/): A TypeScript execution and REPL for node.js
8-
- [@opensource@ts-jest](https://github.com/kulshekhar/ts-jest): A Jest transformer with source map support that lets you use Jest to test projects written in TypeScript.
9-
- [@opensource@typesync](https://github.com/jeffijoe/typesync): Install missing TypeScript typings for dependencies in your package.json.
10-
- [@opensource@tsd](https://github.com/SamVerschueren/tsd) - TypeScript Definition Manager
11-
- [@opensource@type-fest](https://github.com/sindresorhus/type-fest) - A collection of essential TypeScript types
3+
The TypeScript ecosystem has excellent packages that solve common problems. Here are some of the most popular ones to know about.
4+
5+
## Validation & Type Safety
6+
7+
### Zod
8+
- **What it does:** Checks that data is correct before you use it
9+
- **Why use it:** Ensures API responses, form inputs, and config files match what you expect
10+
- **When you need it:** Building APIs, processing user input, or working with external data
11+
- [@article@zod](https://zod.dev/)
12+
13+
## Development Tools
14+
15+
### ts-node
16+
- **What it does:** Run TypeScript directly without compiling to JavaScript first
17+
- **Why use it:** Great for scripts, CLI tools, and quick testing
18+
- **When you need it:** Building command-line tools or running one-off scripts
19+
- [@article@ts-node](https://typestrong.org/ts-node/)
20+
21+
### ts-jest
22+
- **What it does:** Use Jest (a testing framework) to test TypeScript code
23+
- **Why use it:** Makes it easy to write tests for TypeScript projects
24+
- **When you need it:** Setting up automated testing for your TypeScript code
25+
- [@opensource@ts-jest](https://github.com/kulshekhar/ts-jest)
26+
27+
### ts-morph
28+
- **What it does:** Read and edit TypeScript code programmatically
29+
- **Why use it:** Build tools that work with TypeScript source code itself
30+
- **When you need it:** Advanced: creating code generators or automated refactoring tools
31+
- [@opensource@ts-morph](https://github.com/dsherret/ts-morph)
32+
33+
## Type Utilities
34+
35+
### type-fest
36+
- **What it does:** Collection of helpful TypeScript utility types
37+
- **Why use it:** Avoid writing common type patterns yourself
38+
- **When you need it:** When you need advanced TypeScript types for your project
39+
- [@opensource@type-fest](https://github.com/sindresorhus/type-fest)
40+
41+
## Dependencies & Maintenance
42+
43+
### typesync
44+
- **What it does:** Automatically finds and installs type definitions for your packages
45+
- **Why use it:** Saves time—no need to manually find and install `@types/*` packages
46+
- **When you need it:** After adding new JavaScript packages to your project
47+
- [@opensource@typesync](https://github.com/jeffijoe/typesync)
48+
49+
### tsd
50+
- **What it does:** Write tests to check that your TypeScript type definitions are correct
51+
- **Why use it:** If you're publishing a library, ensure types work as expected
52+
- **When you need it:** Creating reusable TypeScript libraries or packages
53+
- [@opensource@tsd](https://github.com/SamVerschueren/tsd)
54+
55+
## Quick Start
56+
57+
Here's a typical setup for a new TypeScript project:
58+
59+
1. **Start with validation:** Use Zod for data validation
60+
2. **Add testing:** Use ts-jest for automated tests
61+
3. **Add utilities:** Use type-fest for common TypeScript types
62+
4. **Keep types updated:** Run typesync regularly
63+
64+
Remember: you don't need all of these packages for every project. Start with the basics and add what you need as your project grows.

0 commit comments

Comments
 (0)