Bug 1698074, follow-up for prettier and diff (#1896)

* Bump diff file limit to make diff work.
* Prettified version from flow-to-ts strips newlines - move the prettier call separate.
* Rewire prettier to ts(x) in frontend.
This commit is contained in:
Axel Hecht 2021-03-16 08:42:07 +01:00 коммит произвёл GitHub
Родитель 8fc9f94348
Коммит fbf931b665
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 14 добавлений и 9 удалений

23
.github/workflows/frontend.yml поставляемый
Просмотреть файл

@ -67,25 +67,30 @@ jobs:
- name: Install globals
run: |
npm install -g yarn @khanacademy/flow-to-ts
- name: npm install
run: npm install
- name: Pre-flight switches
working-directory: frontend
run: |
yarn remove flow-bin
yarn add -D typescript @types/jest @types/node @types/react @types/react-dom
- name: Redirect prettier
run: |
python -c "from pathlib import Path;pack_path=Path('package.json');pack_path.write_text(pack_path.read_text().replace('**/frontend/**/*.{js,css}','**/frontend/**/*.{ts,tsx,css}'))"
- name: Pre-flight diff
run: git diff
- name: Pre-flight commit
run: git commit -am"Pre-flight flow to ts"
- name: flow-to-ts
working-directory: frontend
run: flow-to-ts --prettier --write --delete-source 'src/**/*.js'
# Git diff doesn't do anything constructive on gh actions, disable for now
# - name: Stage
# run: |
# git add frontend
# git commit -m'flow-to-ts'
# - name: flow-to-ts diff
# run: git show HEAD
run: flow-to-ts --write --delete-source 'frontend/src/**/*.js'
- name: prettier
run: npm run prettier
- name: Stage
run: |
git add frontend
git commit -m'flow-to-ts'
- name: flow-to-ts diff
run: git -c diff.renameLimit=36000 show HEAD
- name: tsc
working-directory: frontend
run: ./node_modules/.bin/tsc -b no-tsconfig.json