From 9029588590bea8b10451575c5142dcde77ecd1b5 Mon Sep 17 00:00:00 2001 From: 简律纯 Date: Fri, 3 Nov 2023 21:25:40 +0800 Subject: chore: delete useless files --- packages/turbo-codemod/src/transforms/README.md | 36 ------------------------- 1 file changed, 36 deletions(-) delete mode 100644 packages/turbo-codemod/src/transforms/README.md (limited to 'packages/turbo-codemod/src/transforms/README.md') diff --git a/packages/turbo-codemod/src/transforms/README.md b/packages/turbo-codemod/src/transforms/README.md deleted file mode 100644 index 8e4430f..0000000 --- a/packages/turbo-codemod/src/transforms/README.md +++ /dev/null @@ -1,36 +0,0 @@ -# `@turbo/codemod` Transformers - -## Adding new transformers - -Add new transformers using the [plopjs](https://github.com/plopjs/plop) template by running: - -```bash -pnpm add-transformer -``` - -New Transformers will be automatically surfaced to the `transform` CLI command and used by the `migrate` CLI command when appropriate. - -## How it works - -Transformers are loaded automatically from the `src/transforms/` directory via the [`loadTransforms`](../utils/loadTransformers.ts) function. - -All new transformers must contain a default export that matches the [`Transformer`](../types.ts) type: - -```ts -export type Transformer = { - name: string; - value: string; - introducedIn: string; - transformer: (args: TransformerArgs) => TransformerResults; -}; -``` - -## Writing a Transform - -Transforms are ran using the [TransformRunner](../runner/Runner.ts). This class is designed to make writing transforms as simple as possible by abstracting away all of the boilerplate that determines what should be logged, saved, or output as a result. - -To use the TransformRunner: - -1. Transform each file in memory (do not write it back to disk `TransformRunner` takes care of this depending on the options passed in by the user), and pass to `TransformRunner.modifyFile` method. -2. If the transform encounters an unrecoverable error, pass it to the `TransformRunner.abortTransform` method. -3. When all files have been modified and passed to `TransformRunner.modifyFile`, call `TransformRunner.finish` method to write the files to disk (when not running in `dry` mode) and log the results. -- cgit v1.2.3-70-g09d2