* 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
* 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/
* 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
Docker won't start up since the use of the property
target: and the mismatch with the version of the
docker-compose.yml (version: "2"). The minimum version
required to use target: is 2.3.
Changing the value of the version to 2.3 of the docker-compose.yml will
allow for the docker containers to start up.
Co-authored-by: david.zamora <m0YSvMxa9KoGTFEOf50L>
* refactor: Rename build-frontend make task as build-tagadmin
* feat: Split frontend app into its own container
* chore: Include static frontend build in webapp for compatibility
* chore: Run all tests on `make test`; add `make test-webapp`
* refactor: Rename "webapp" as "server"
* refactor: Use fronted build stage rather than duplicated Dockerfile
* chore: Rename run_server -> server_run also in docker/k8s-first-steps
* chore: Run ESLint & Prettier tasks also in frontend
* chore: Use new `make ci` to test & lint both frontend & server
Based on `make test-server`, that now only runs server tests.
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
This requires the container to have git, and the local .git folder. With those, running tests with jest automatically only runs the tests that have changed since the last commit.
* Fix bug 1478066 - Use volumes instead of symlinks in docker dev environment.
* Use docker-compose everywhere possible.
This also removes the new useless run_tests_in_docker.sh file, that was quite inconsistent with our use of the Makefile. Everything is a lot more streamlined and simple now.
* Add React frontend for Translate app.
This has been set up using create-react-app.
* Integrate new Translate app into django.
This provides a working prod and dev environment. In production, django will serve the index.html file as a template, and files built by webpack will be collected and distributed with other django static files. In development, all requests are proxied to the dev webpack server, allowing all dev niceties to be used.
* Add support for websockets.
* Add a bit of documentation specific to our use case.
* Add redux for state management.
* Show a very basic list of entities.
* Enable absolute path import.
* Add links to various resources.
* Rearchitecture code into modules.
All features should be self-contained into a module in src/modules/. All code that is shared amongst several modules should go into a module in src/core/.
* Remove unused assets.
* Add some architecture documentation.
* Add Flow to current code for type checking.
* Add unit testing with jest, enzyme and sinon.
* Extend documentation, talk about type checking, modules, and list tools we use.
* Move CSS rules closer to actual component.
* Add django-waffle and hide translate.next behind a switch.
* Better structure for the README file.
* Build and test frontend in travis.
* Of course it is better if dependencies are installed.
* Use pushd to run commands in frontend.
* Configure eslint and fix errors.
* Add more code comments.
* Improve documentation around local dev and Flow.
* Add tests for the Translate view.
* Improve documentation.
* Fix serving static files for development.
* Integrate Translate.Next with out docker setup.
* Remove debug.
* Use DEV instead of DEBUG.
* Much review.
Many comments.
Wow better!
* Flatter module public interfaces.
* Import correctly from modules.
* Fix docker webapp run.
* Fix bug 1456846 - Fix docker dev environment.
This commit ensures that:
- the assets/ folder is always created
- dependencies (Python and node) do not pollute the user's repository. They are now installed in a different folder inside the container
- webpack takes resources from the right place, and puts bundles in the right folder
This looks like a small patch but it was actually fairly complex. The reason is that our Dockerfile is made for a production deployment, meaning that it builds all the resources it needs to run in place. That's fine. However, when we run locally for development, using docker-compose, we override the /app folder with the user's local folder. That means all resources built during `make build` are lost.
This patch puts those resources in a different folder, and then links to that folder from the user's repository. This allows to keep a clean production build process, while having a working dev environment, and a clean local folder.
* Fixes bug 1376813 - THIS... IS... DOCKER! [WIP]
* Review comments, and fixed some issues.
* Added a first documentation.
* Fixed requirements.
* Added instruction to load a dump file into postgres.
* Added commands to run tests, and related documentation.
* Updated documentation for documentation and dependencies.
* Remove and create pontoon database before loading a dump.
* review comments.
* Fixed documentation.
Removes the git-specific username/password authentication and instead
assumes that SSH keys will already be set up for git/svn/hg to use.
Modifies the docker container to mount the user's SSH keys into the
container so that the VCS sync management commands run using the user's
local keys.
This isn't a significant change in security mainly because previously
the user's local keys were being used anyway since the app was run
locally instead of being run in a container.
Fixes an issue where static files were being collected every request and
weren't updating properly. Now we use the runserver command that serves
up static files automatically.
Also moves the STATIC_ROOT outside of the share volume, avoiding issues
with accidentally editing the collected static files instead of the
canonical ones.