From fce4e9a9db630a1b2df4f6570077b04f3edc624b Mon Sep 17 00:00:00 2001 From: Kazushi Konosu Date: Wed, 11 Dec 2024 01:52:28 +0900 Subject: [PATCH] docs: update migration guide --- doc/migration.md | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/doc/migration.md b/doc/migration.md index 33a7f34..5725ee9 100644 --- a/doc/migration.md +++ b/doc/migration.md @@ -2,34 +2,36 @@ This document will cover the migration process from v0 to v1. -## `@line/ts-remove-unused` is renamed to `tsr` +## Breaking Changes -The unnecessary parts from the name `@line/ts-remove-unused` is removed, renaming the tool to `tsr` 😉 +### `@line/ts-remove-unused` is renamed to `tsr` + +`tsr` is the new name, removing the unnecessary parts from the name `@line/ts-remove-unused` 😉 ``` npm i tsr ``` -## `--check` is the default behavior +### `--check` is the default behavior -In v0, the default behavior of the CLI was to apply the edits. This was reasonable because the command was long `npx @line/ts-remove-unused`. `--check` will be the default behavior, and the editing feature will be provided with `--write` in order to prevent accidental code edits when executing `npx tsx`. +In v0, the default behavior of the CLI was to edit files in place. This was reasonable because the command was long `npx @line/ts-remove-unused`. However, the rename from `@line/ts-remove-unused` to `tsr` will likely increase the risk of accidentally executing the CLI with `npx tsr`. In order to reduce the possibility of this, `--check` will be the new default behavior, and the editing feature will be available with `--write`. ```bash npx tsr --write 'src/main\.ts$' ## use --write to edit files ``` -## `--skip` is removed with variadic arguments +### `--skip` is replaced with variadic arguments -The `--skip` option has been removed with variadic arguments to simplify the command line interface. +The `--skip` option has been replaced with variadic arguments to simplify the command line interface. ```bash npx @line/ts-remove-unused --skip 'src/main\.ts$' ## v0 -npx tsx 'src/main\.ts$' ## v1 +npx tsr 'src/main\.ts$' ## v1 ``` -## JavaScript API has changed +### JavaScript API has changed -The name has changed. +The JavaScript API has changed. ```typescript import { remove } from '@line/ts-remove-unused'; // before