Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pnpm install

## Building

Run [**tsup**](https://tsup.egoist.dev) locally to build source files from `src/` into output files in `lib/`:
Run [**tsdown**](https://tsdown.dev) locally to build source files from `src/` into output files in `lib/`:

```shell
pnpm build
Expand Down
8 changes: 4 additions & 4 deletions docs/Blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,16 @@ This table summarizes each block and which base levels they're included in:
| Renovate | `--add-renovate`, `--exclude-renovate` | | | 💯 |
| Security Docs | `--add-security-docs`, `--exclude-security-docs` | ✔️ | ✅ | 💯 |
| Templated With | `--add-templated-with`, `--exclude-templated-with` | ✔️ | ✅ | 💯 |
| TSup | `--add-tsup`, `--exclude-tsup` | ✔️ | ✅ | 💯 |
| TSDown | `--add-tsdown`, `--exclude-tsdown` | ✔️ | ✅ | 💯 |
| TypeScript | `--add-typescript`, `--exclude-typescript` | ✔️ | ✅ | 💯 |
| Vitest | `--add-vitest`, `--exclude-vitest` | | ✅ | 💯 |
| VS Code | `--add-vs-code`, `--exclude-vs-code` | | | 💯 |
| Web-ext | `--add-web-ext`, `--exclude-web-ext` | | | |

For example, this uses ncc instead of the default tsup builder:
For example, this uses ncc instead of the default tsdown builder:

```shell
npx create-typescript-app --add-ncc --exclude-tsup
npx create-typescript-app --add-ncc --exclude-tsdown
```

See also [CLI](./CLI.md) for customizing templated repositories when running `npx create-typescript-app`.
Expand All @@ -82,7 +82,7 @@ We strongly recommend using at least the [_"common"_ base level](#common-base-le

### Building

[**tsup**](https://tsup.egoist.dev): Builds output definitions and JavaScript files using [esbuild](https://esbuild.github.io).
[**tsdown**](https://tsdown.dev): Builds output definitions and JavaScript files.
Each `*.ts` source file within `src/` is built into `.d.ts` and `.js` output files in `lib/`.

Building once:
Expand Down
10 changes: 5 additions & 5 deletions docs/FAQs.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,17 @@ Here we'll outline the steps required to migrate a CTA app to a GitHub Action:
</details>

- GitHub Actions run without installing package dependencies.
Replace `tsup` with [`ncc`](https://github.com/vercel/ncc) to build source files and dependencies into a single JS file.
Delete `tsup.config.ts` then execute the following commands:
Replace `tsdown` with [`ncc`](https://github.com/vercel/ncc) to build source files and dependencies into a single JS file.
Delete `tsdown.config.ts` then execute the following commands:

```bash
pnpm remove tsup
pnpm remove tsdown
pnpm add @vercel/ncc -D
```
- Now we need to update the `build` script in our `package.json`:

```diff
-"build": "tsup",
-"build": "tsdown",
+"build": "ncc build src/index.ts -o dist --license licenses.txt",
```
- Our build now emits to the `dist` directory; so we'll want to avoid linting that directory by adding the following to `.eslintignore` and our `.prettierignore`:
Expand All @@ -102,7 +102,7 @@ First, I'd suggest reading [TypeScript Handbook > Modules - Introduction](https:

Then:

1. In `tsup.config.ts`, change the [tsup `format` option](https://tsup.egoist.dev/#bundle-formats) from `["esm"]` to `["cjs", "esm"]`
1. In `tsdown.config.ts`, change the [tsdown `format` option](https://tsdown.dev/options/output-format) from `["esm"]` to `["cjs", "esm"]`
2. Add a [`package.json` `"exports"` entry](https://nodejs.org/api/packages.html#subpath-exports) like:

<!-- eslint-disable jsonc/sort-keys -->
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"package.json"
],
"scripts": {
"build": "tsup",
"build": "tsdown",
"format": "prettier .",
"lint": "eslint . --max-warnings 0",
"lint:knip": "knip",
Expand Down Expand Up @@ -113,7 +113,7 @@
"prettier-plugin-sh": "0.17.4",
"release-it": "19.0.3",
"sentences-per-line": "0.3.0",
"tsup": "8.5.0",
"tsdown": "0.12.7",
"typescript": "5.8.3",
"typescript-eslint": "8.35.0",
"vitest": "3.2.4"
Expand Down
Loading