@tramvai/tools-migrate 0.5.128 → 0.5.129

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +21 -19
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,22 +1,26 @@
1
- # Инструмент миграции кода
1
+ # Tool for code migrations
2
2
 
3
- Утилита для выполнения миграции для трамвайный модулей.
3
+ Tool for executing code migrations for the tramvai modules.
4
4
 
5
- Принцип работы:
5
+ How does it work:
6
6
 
7
- - в опубликованном модуле в папке `__migrations__` находятся файлы миграций для выполнения
8
- - найденные и ранее не исполненные миграции выполняются
9
- - миграции могут изменять файлы 'package.json', 'tramvai.json' и исходный код проекта
10
- - после выполнения миграции информация о выполненной миграции добавится в файл '.tramvai-migrate-applied.json' в корень проекта
11
- - все измененные файлы после миграции добавляются в гит и комитятся как часть обновления пакетов
7
+ - in published module folder `__migrations__` contains migrations files for the execution
8
+ - found migrations that were have not been executed before are running
9
+ - migrations can change files `package.json`, `tramvai.json` and project source code
10
+ - after migration run information about executed migrations is added to file `.tramvai-migrate-applied.json` to the project root
11
+ - all of the changed files after migrations should be added and committed to remote repository
12
12
 
13
- ## Отключение выполнения миграций
13
+ ## How to
14
+
15
+ ### Disable migrations
14
16
 
15
- Для отключения миграций можно проставить переменную окружения `SKIP_TRAMVAI_MIGRATIONS`.
17
+ To disable migration add environment variable `SKIP_TRAMVAI_MIGRATIONS`.
16
18
 
17
- ## Добавление новой миграции
19
+ ### Add new migration
18
20
 
19
- Добавить новую миграцию можно с помощью команды `yarn generate:migration` после чего потребуется указать имя пакета для которого предназначена миграция и имя новой миграции. Также для этого пакета потребуется добавить в `package.json` в поле `files` папку с собранными миграциями, если они не были указаны ранее:
21
+ You can add new migration with command `yarn generate:migration`. You will need to specify package name for the migration and the migration name itself.
22
+
23
+ Also add to this package's `package.json` folder with the built migrations to the field `files` if it wasn't specified before:
20
24
 
21
25
  ```json
22
26
  "files": [
@@ -25,19 +29,17 @@
25
29
  ],
26
30
  ```
27
31
 
28
- ## Реализация миграции
29
-
30
- Миграция представляет собой функцию, принимающую специальное апи с помощью которого можно осуществлять изменения кода или конфигов.
32
+ Migration is a function that accepts special api using which it implements changes to the source code or configs.
31
33
 
32
34
  ```tsx
33
35
  export interface Api {
34
- packageJSON: PackageJSON; // объект-представление корневого package.json
35
- tramvaiJSON: TramvaiJSON; // объект-представление файла tramvai.json или platform.json
36
- transform: (transformer: Transform, pathTransformer?: PathTransformer) => Promise<void>; // функция принимающая функцию-траснформер для jscodeshift и функцию-трансформер для переименования файлов
36
+ packageJSON: PackageJSON; // object represented root package.json
37
+ tramvaiJSON: TramvaiJSON; // object represented tramvai.json
38
+ transform: (transformer: Transform, pathTransformer?: PathTransformer) => Promise<void>; // function that accepts transform function for `jscodeshift` and transform function for the file renames
37
39
  }
38
40
  ```
39
41
 
40
- Трансформация кода осуществляется с помощью [jscodeshift](https://github.com/facebook/jscodeshift)
42
+ Code transformations is done with [jscodeshift](https://github.com/facebook/jscodeshift)
41
43
 
42
44
  ## How to
43
45
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tramvai/tools-migrate",
3
- "version": "0.5.128",
3
+ "version": "0.5.129",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "bin": {