Граф коммитов

26 Коммитов

Автор SHA1 Сообщение Дата
Francesco Lodolo 4b6e839447
Update workflows and docker to Python 3.11 (#3188)
* Use Python 3.11

* Run pyupgrade with Python 3.11+

* Update pyupgrade to latest version

* Update Celery and python-dateutil

Celery is not compatible with Python 3.11, leading to test failures. Need to update also python-dateutil to install the latest version.
2024-04-25 12:31:24 +02:00
Eemeli Aro 6cd5b3e968
Do not use an inner container for CI backend tests (#3164)
* Drop test setup with tr_tr collation creation
* Use postgres 15
2024-04-03 16:17:42 +03:00
Francesco Lodolo 9cf89026f2
Update to Python 3.10 (#3112)
In:
* GitHub workflows
* Docker
* Heroku

Also make related flake8, black and pyupgrade fixes (some actually only needed in future versions of python).
2024-02-22 19:33:05 +01:00
Francesco Lodolo e4b4946298
Update actions in workflows to latest versions (#3111) 2024-02-22 10:46:36 +01:00
Eemeli Aro 5b6af5fcfd
Improve Pontoon RTL editing (#2926)
* Add dir=ltr and style=white-space:pre to syntax

* Limit dir=ltr to explicitly known node names

* Fix directionality in nested contexts (e.g. tag -> quoted value -> placeholder)

* Update CodeMirror dependencies

* Use new EditorView.bidiIsolatedRanges

* Refactor decorator plugin to iterate tree only once

* Update all JS CI actions to use Node.js 18

* Update CodeMirror dependencies again

* Drop "unicode-bidi: isolate" style as unnecessary given the dir attribute

* Fix padding in editor for left/right scrolling
2023-10-12 16:57:16 +02:00
Eemeli Aro 1de4919051
Update "master" references to "main" (#2963) 2023-09-19 13:39:03 +02:00
Eemeli Aro 641c90c14e
Update to compare-locales 9.0.1, fluent-syntax 0.19.0, pip-tools 6.13.0 (#2817)
* Update to compare-locales 9.0.1, fluent-syntax 0.19.0, pip-tools 6.13.0

The transitive dependency typing-extensions is also updated to 4.5.0

* ci: Use codecov action rather than the removed/deprecated pypi & npm packages
2023-04-18 07:42:52 +03:00
Eemeli Aro cda3dbab5e
Enable `strict: true` in TypeScript config, refactor as necessary (#2439)
* chore: Specify TS typings better (no JS changes)

* fix: Use the right null/undefined, and assume less about possibly undefined values

* refactor: Simplify core/utils/fluent/{extractAccessKeyCandidates,getSimplePreview}, dropping lodash.flattendeep dependency

* refactor: core/l10n/pseudolocalization

* refactor: New code, same external behaviour

* fix(AddComment): Serialize mentions without url using their contents

* fix(EntityDetails): Do not try to update status if selectedEntity is undefined

* chore: Use @ts-ignore for configureStore() & react-linkify import

* chore: Set strict:true in tsonfig.json

* ci: Drop ts-strict test & check-tsc action as superfluous

* Apply suggestions from code review

Co-authored-by: Axel Hecht <axel@pike.org>
2022-03-11 11:55:19 +02:00
Eemeli Aro 9fc9430cc7
Refactor the frontend build (#2437)
* feat!(frontend): Drop react-scripts

* chore(frontend): Add missing dependency on escape-html

* refactor(frontend): Use ~ to prefix paths from src/ root

* chore(frontend): Add & configure jest & ts-jest

* chore(frontend): Fix bugs & tests revealed by updated jest, skipping EntityDetails

* chore(frontend): Add ESLint as explicit dev dependency; satisfy linter

* chore(frontend): Clean up dependencies, using caret ^ range for all

* chore(frontend): Switch from yarn to npm & configure as a workspace

Prettier & ESLint dependencies are now defined in the root package.json

Changing package management means that many path & minor updates are
simultaneously applied via the caret ^ ranges.

The local/pontoon-frontend Docker image now uses node:16 as a base
and /app/frontend rather than /frontend for its contents & workdir,
in order to accommodate the changed topography.

* chore: Collect devDependencies in root package.json

* chore(tag-admin): Move Babel config to repo root

* feat(frontend): Adjust public/ for being served as Django static files

* chore(frontend): Add build with Rollup

* feat(pontoon): Drop frontend proxy, server static files normally, add pipeline for frontend

* chore(server): Add dependencies via pontoon/package.json; clean up Dockerfile

* chore: Add build:prod targets for frontend & tag-admin

frontend image droapped from Dockerfile as unused

styled-components updated to v5 to avoid a broken import in v4.

* chore: Add watch targets for workspaces & root, using concurrently

* chore: Code review & CI-identified fixes

* chore: Refresh lockfiles, dropping frontend/yaml.lock

* chore: Add /bin/watch.sh to watch all builds; refactor `make run`

* ci: Fix frontend TS test CLI args due to yarn -> npm change

* chore: Use `npm start` rather than `npm run watch`

* chore(pontoon): Mark django-pipeline JS dependencies as devDependencies

* refactor: Rename frontend/ as translate/
2022-03-02 16:10:42 +01:00
Eemeli Aro d26c91487e
Handle the `tags/admin/` client as an npm workspace at `/tag-admin/` (#2430)
* Move tag-admin sources & tests to /tag-admin/src/

Import paths are modified to use relative, fully qualified file names.

* Configure tag-admin as an npm workspace

* Fix build & CI issues

Consistently call 'npm ci' and 'npm run build' where appropriate

* Apply lint & style rules to tag-admin/webpack.config.js

* Fix permissions for /tag-admin/ in Dockerfile

* ci: Rename "non-frontend-js" action as "tag-admin"

* docs(tag-admin): Add README
2022-02-16 16:47:32 +02:00
Eemeli Aro a2a6232b7d
ci: Add worflow_dispatch triggers for all actions (#2429) 2022-02-16 00:18:45 +01:00
Axel Hecht 0d6d94b2de
No bug, use in-tree action to group tsc checks output (#1994) 2021-08-31 17:52:26 +02:00
Axel Hecht 134580c495 No bug, add automation to go through some stricter TSC settings 2021-08-29 20:29:16 +02:00
Matjaž Horvat 0dea497104
Include .ts and .tsx files in GH Workflow lint (#1986) 2021-08-20 08:48:54 +02:00
Ranieri Althoff e08dd14825
Upgrade Python to 3.9.6 (#1971)
Also run pyupgrade to improve syntax
2021-07-15 18:24:58 +02:00
Axel Hecht a77b8cdb67
Bug 1685565: convert frontend production code to TypeScript (#1949)
* Pre-flight flow to ts

* Automatically convert non-test code to TypeScript with flow-to-ts.
Manually clean up the diff, address the known @ts-expect-errors.

* Use internal Slate types in AddComments

* Make build and eslint work

* Remove TypeScript workflow

* Remove flow from documentation and build/automation

* Fix eslint job in automation

* Enable type checking again, with an entry point to get all errors.

There were some problems with the intermediate configuration, which
didn't report errors at all. This one works, both on tsc and yarn build.
Sadly, yarn build only reports one error, so I'm hooking up tsc
independently to get the full list of errors.

* Remove more flow traces

* Remove flowisms from js tests

* Cleanup on diff of top-level sources files

* Remove flow-related comments and docs

* Remove flow-isms from eslint config

* Make optional args and types a tad stricter for simple cases.

See also https://www.typescriptlang.org/docs/handbook/2/functions.html#optional-parameters
for why optional args are type | undefined by default.

* Update for slatejs update

* Fix prettier automation and formatting
2021-05-31 17:25:44 +02:00
Axel Hecht 400e1918f5
Bug 1685565: TypeScript fixes and expected errors (#1945)
Also put types in the right place in modules/history.
2021-05-17 10:46:33 +02:00
Axel Hecht 5012eb82ba
Bug 1685565: various typing fixes related to React (#1942)
* Various typing fixes related to React, incl. AbstractComponent > ComponentType
* Use React.Element instead of React.Node for JSX elements
* Narrow types when using Event.target, or use currentTarget. When using Event.target, we don't know which kind of element the event is coming from from the typing system. Thus, explicitly narrow the types to the ones we have in practice if we rely on them. Or use currentTarget, which type we know.
2021-05-09 10:18:40 +02:00
Axel Hecht f8bfbfb252
Keep tests in plain javascript during TypeScript conversion (#1936) 2021-05-06 20:12:43 +02:00
Axel Hecht 6dddf2d8fe
Make optional function arguments optional for TypeScript (#1919)
Also: Use --pretty to get error stats in flow-to-ts.
2021-04-19 15:55:06 +02:00
Axel Hecht c349a272e5
Fix bug 1697462, update node dependencies (#1895)
* Bug 1697462, update node dependencies

* Update babel and eslint

* Fix more references to lint-frontend

* Get make test to work again

* npm update

* yarn upgrade

* browserslist --update-db

* yarn upgrade react-scripts --latest

* Remove last Translate.Next in Makefile

* yarn upgrade tlds --latest

* yarn upgrade sinon --latest

* yarn upgrade enzyme-adapter-react-16 --latest

* Use yarn in workflow to stick to pinned versions

* Install top-level, too, as that has @babel/eslint-parser
2021-03-17 18:18:09 +01:00
Axel Hecht fbf931b665
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.
2021-03-16 08:42:07 +01:00
Axel Hecht 5ebd22eda8
Bug 1698074, run flow-to-ts in automation to keep track of errors (#1891) 2021-03-12 14:54:03 +01:00
Axel Hecht 70642cfac3
Fix bug 1696146 - Add linting for pyupgrade (#1886)
Also add pyupgrade to format.
2021-03-03 21:48:49 +01:00
Axel Hecht 956762c541
Fix bug 1685558: Use carryforward flags to deal with skipped test runs (#1801) 2021-01-21 19:42:05 +01:00
Axel Hecht 278e49fa04
Fix bug 1683619 - Migrate automation from Travis to GitHub Actions (#1784)
Also:
* Refactor requirements to allow only linting reqs to be installed.
* Expose requirements to docker, so pip-compile can be run there.
* Remove codecov dependency in docker container
* Add coverage for frontend
2020-12-22 13:16:25 +01:00