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

3 Коммитов

Автор SHA1 Сообщение Дата
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 9faea69c20
Set `tabWidth: 2` in Prettier config (#2438)
* chore: Update Prettier config, setting tabWidth:2

* style: Apply updated Prettier styles

If you need to rebase work past this style change, do as follows:

0. Consider this to be commit `commitA`, replacing that with its id in the following.
1. To make sure mistakes aren't fatal, assign a second branch to your current work.
2. Rebase your branch on the commit immediately before this one, commitA~
3. Run the following command at the root of the repo:

    git rebase --strategy-option=theirs \
      --exec 'npx prettier --write . && git add -u && git commit --amend --no-edit' \
      commitA

That will take a short while esp. if you have multiple commits,
as it runs Prettier on everything for every commit.
If you've deleted files, the rebase may drop down to interactive mode
and have you `git rm` as appropriate, then `git rebase --continue`.

You should end up with just your changes in your branch,
prettily formatted. To validate that,
apply the same Prettier config change to your original branch,
reformat the files with `npm run prettier`,
and then compare the results with the rebased branch.

* chore: Clean up lint configs
2022-03-03 09:46:35 +01: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