зеркало из https://github.com/mozilla/pontoon.git
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:
Родитель
8fc9f94348
Коммит
fbf931b665
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче