Skip to content

Commit

Permalink
Merge pull request #92 from line/docs/update-migration-guide
Browse files Browse the repository at this point in the history
docs: update migration guide
  • Loading branch information
kazushisan authored Dec 10, 2024
2 parents 9a7510c + fce4e9a commit 4ccffcb
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions doc/migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4ccffcb

Please sign in to comment.