chore(i18n,docs): processed translations (#52285)

This commit is contained in:
camperbot
2023-11-08 19:51:10 +05:30
committed by GitHub
parent b90ce3452e
commit 5b339784e8
96 changed files with 2596 additions and 1852 deletions

View File

@@ -303,19 +303,19 @@ You should keep the VMs up to date by performing updates and upgrades. This will
Update package information
```console
```bash
sudo apt update
```
Upgrade installed packages
```console
```bash
sudo apt upgrade -y
```
Cleanup unused packages
```console
```bash
sudo apt autoremove -y
```
@@ -331,7 +331,7 @@ Provisioning VMs with the Code
1. Install NGINX and configure from repository.
```console
```bash
sudo su
cd /var/www/html
@@ -352,7 +352,7 @@ Provisioning VMs with the Code
Move over existing certificates:
```console
```bash
# Local
scp -r username@source-server-public-ip:/etc/nginx/ssl ./
scp -pr ./ssl username@target-server-public-ip:/tmp/
@@ -364,7 +364,7 @@ Provisioning VMs with the Code
Update Upstream Configurations:
```console
```bash
vi configs/upstreams.conf
```
@@ -382,7 +382,7 @@ Provisioning VMs with the Code
1. Check status for NGINX service using the below command:
```console
```bash
sudo systemctl status nginx
```
@@ -396,13 +396,13 @@ Config changes to our NGINX instances are maintained on GitHub, these should be
1. SSH into the instance and enter sudo
```console
```bash
sudo su
```
2. Get the latest config code.
```console
```bash
cd /etc/nginx
git fetch --all --prune
git reset --hard origin/main
@@ -410,7 +410,7 @@ git reset --hard origin/main
3. Test and reload the config [with Signals](https://docs.nginx.com/nginx/admin-guide/basic-functionality/runtime-control/#controlling-nginx).
```console
```bash
nginx -t
nginx -s reload
```
@@ -419,7 +419,7 @@ nginx -s reload
1. Install build tools for node binaries (`node-gyp`) etc.
```console
```bash
sudo apt install build-essential
```
@@ -431,19 +431,19 @@ Provisioning VMs with the Code
2. Install pnpm globally.
```console
```bash
npm install -g pnpm
```
3. Install pm2 globally.
```console
```bash
npm install -g pm2
```
4. Clone freeCodeCamp, set up env, and keys.
```console
```bash
git clone https://github.com/freeCodeCamp/freeCodeCamp.git
cd freeCodeCamp
git checkout prod-current # or any other branch to be deployed
@@ -453,36 +453,36 @@ git checkout prod-current # or any other branch to be deployed
6. Install dependencies
```console
```bash
pnpm install
```
7. Setup pm2 `logrotate` and startup on boot
```console
```bash
pm2 install pm2-logrotate
pm2 startup
```
8. Build the server
```console
```bash
pnpm prebuild && pnpm build:curriculum && pnpm build:server
```
9. Start Instances
```console
```bash
pnpm start:server
```
### Logging and Monitoring
```console
```bash
pm2 logs
```
```console
```bash
pm2 monit
```
@@ -496,31 +496,31 @@ Code changes need to be deployed to the API instances from time to time. It can
1. Stop all instances
```console
```bash
pm2 stop all
```
2. Install dependencies
```console
```bash
pnpm install
```
3. Build the server
```console
```bash
pnpm prebuild && pnpm build:curriculum && pnpm build:server
```
4. Start Instances
```console
```bash
pnpm start:server && pm2 logs
```
#### 2. Rolling updates - Used for logical changes to code.
```console
```bash
pnpm reload:server && pm2 logs
```
@@ -532,7 +532,7 @@ pnpm reload:server && pm2 logs
2. Update pm2 to use the new version
```console
```bash
pm2 update
```
@@ -540,7 +540,7 @@ pm2 update
1. Install build tools for node binaries (`node-gyp`) etc.
```console
```bash
sudo apt install build-essential
```
@@ -552,7 +552,7 @@ Provisioning VMs with the Code
2. Update `npm` and install PM2 and setup `logrotate` and startup on boot
```console
```bash
npm i -g npm@8
npm i -g pm2@4
npm install -g serve@13
@@ -562,7 +562,7 @@ Provisioning VMs with the Code
3. Clone client config, setup env and keys.
```console
```bash
git clone https://github.com/freeCodeCamp/client-config.git client
cd client
```
@@ -571,7 +571,7 @@ Provisioning VMs with the Code
> Todo: This setup needs to move to S3 or Azure Blob storage
>
> ```console
> ```bash
> echo "serve -c ../serve.json -p 50505 www" > client-start-primary.sh
> chmod +x client-start-primary.sh
> pm2 delete client-primary
@@ -584,11 +584,11 @@ Provisioning VMs with the Code
### Logging and Monitoring
```console
```bash
pm2 logs
```
```console
```bash
pm2 monit
```
@@ -602,7 +602,7 @@ Code changes need to be deployed to the API instances from time to time. It can
1. Stop all instances
```console
```bash
pm2 stop all
```
@@ -610,13 +610,13 @@ Code changes need to be deployed to the API instances from time to time. It can
3. Start Instances
```console
```bash
pm2 start all --update-env && pm2 logs
```
#### 2. Rolling updates - Used for logical changes to code.
```console
```bash
pm2 reload all --update-env && pm2 logs
```
@@ -636,7 +636,7 @@ Provisioning VMs with the Code
1. Install NGINX and configure from repository.
```console
```bash
sudo su
cd /var/www/html
@@ -657,7 +657,7 @@ Provisioning VMs with the Code
Move over existing certificates:
```console
```bash
# Local
scp -r username@source-server-public-ip:/etc/nginx/ssl ./
scp -pr ./ssl username@target-server-public-ip:/tmp/
@@ -669,7 +669,7 @@ Provisioning VMs with the Code
Update Upstream Configurations:
```console
```bash
vi configs/upstreams.conf
```
@@ -687,7 +687,7 @@ Provisioning VMs with the Code
1. Install Docker and configure from the repository
```console
```bash
git clone https://github.com/freeCodeCamp/chat-config.git chat
cd chat
```
@@ -696,7 +696,7 @@ Provisioning VMs with the Code
3. Run rocket-chat server
```console
```bash
docker-compose config
docker-compose up -d
```
@@ -705,13 +705,13 @@ Provisioning VMs with the Code
1. Check status for NGINX service using the below command:
```console
```bash
sudo systemctl status nginx
```
2. Check status for running docker instances with:
```console
```bash
docker ps
```
@@ -723,13 +723,13 @@ Config changes to our NGINX instances are maintained on GitHub, these should be
1. SSH into the instance and enter sudo
```console
```bash
sudo su
```
2. Get the latest config code.
```console
```bash
cd /etc/nginx
git fetch --all --prune
git reset --hard origin/main
@@ -737,7 +737,7 @@ Config changes to our NGINX instances are maintained on GitHub, these should be
3. Test and reload the config [with Signals](https://docs.nginx.com/nginx/admin-guide/basic-functionality/runtime-control/#controlling-nginx).
```console
```bash
nginx -t
nginx -s reload
```
@@ -746,44 +746,44 @@ Config changes to our NGINX instances are maintained on GitHub, these should be
1. SSH into the instance and navigate to the chat config path
```console
```bash
cd ~/chat
```
2. Get the latest config code.
```console
```bash
git fetch --all --prune
git reset --hard origin/main
```
3. Pull down the latest docker image for Rocket.Chat
```console
```bash
docker-compose pull
```
4. Update the running instances
```console
```bash
docker-compose up -d
```
5. Validate the instances are up
```console
```bash
docker ps
```
6. Cleanup extraneous resources
```console
```bash
docker system prune --volumes
```
Output:
```console
```bash
WARNING! This will remove:
- all stopped containers
- all networks not used by at least one container
@@ -802,7 +802,7 @@ Config changes to our NGINX instances are maintained on GitHub, these should be
ssh into the VM (hosted on Digital Ocean).
```console
```bash
cd tools
git pull origin master
pnpm install
@@ -814,7 +814,7 @@ pm2 restart contribute-app
List currently installed node & npm versions
```console
```bash
nvm -v
node -v
npm -v
@@ -824,25 +824,25 @@ nvm ls
Install the latest Node.js LTS, and reinstall any global packages
```console
```bash
nvm install --lts --reinstall-packages-from=default
```
Verify installed packages
```console
```bash
npm ls -g --depth=0
```
Alias the `default` Node.js version to the current LTS (pinned to the latest major version)
```console
```bash
nvm alias default 16
```
(Optional) Uninstall old versions
```console
```bash
nvm uninstall <version>
```
@@ -852,31 +852,31 @@ nvm uninstall <version>
Get the uninstall instructions/commands with the `unstartup` command and use the output to remove the systemctl services
```console
```bash
pm2 unstartup
```
Get the install instructions/commands with the `startup` command and use the output to add the systemctl services
```console
```bash
pm2 startup
```
Quick commands for PM2 to list, resurrect saved processes, etc.
```console
```bash
pm2 ls
```
```console
```bash
pm2 resurrect
```
```console
```bash
pm2 save
```
```console
```bash
pm2 logs
```
@@ -898,32 +898,32 @@ Currently updating agents requires them to be removed and reconfigured. This is
1. Navigate and check status of the service
```console
```bash
cd ~/azagent
sudo ./svc.sh status
```
2. Stop the service
```console
```bash
sudo ./svc.sh stop
```
3. Uninstall the service
```console
```bash
sudo ./svc.sh uninstall
```
4. Remove the agent from the pipeline pool
```console
```bash
./config.sh remove
```
5. Remove the config files
```console
```bash
cd ~
rm -rf ~/azagent
```
@@ -938,7 +938,7 @@ We use [a CLI tool](https://github.com/freecodecamp/sendgrid-email-blast) to sen
2. Set up the script to fetch the email list.
```console
```bash
cd /home/freecodecamp/scripts/emails
cp sample.env .env
```
@@ -947,7 +947,7 @@ We use [a CLI tool](https://github.com/freecodecamp/sendgrid-email-blast) to sen
3. Run the script.
```console
```bash
node get-emails.js emails.csv
```

View File

@@ -26,25 +26,25 @@ To run tests against production builds, replace `dev` with `prd` below.
- To run all tests in the `./cypress` directory:
```console
```bash
pnpm run cypress:dev:run
```
- To run a single test:
```console
```bash
pnpm run cypress run --spec=cypress/<path_to_test_file>
```
For example:
```console
```bash
pnpm run cypress run --spec=cypress/e2e/default/landing.ts
```
- To create a development build, start the development server, and run all existing cypress end-to-end tests:
```console
```bash
pnpm run e2e:dev:run
```
@@ -57,25 +57,25 @@ If starting the Gitpod environment did not automatically develop the environment
- Follow the [MongoDB installation guide](https://www.mongodb.com/basics/get-started).
- Create a config file.
```console
```bash
pnpm run create:shared
```
- Seed the database
```console
```bash
pnpm run seed
```
- Develop the server and client
```console
```bash
pnpm run develop
```
### 2. Install Cypress Build Tools
```console
```bash
pnpm run cypress:install-build-tools
```

View File

@@ -4,7 +4,7 @@
To install Playwright run:
```console
```bash
pnpm run playwright:install-build-tools
```
@@ -181,49 +181,49 @@ To run tests with Playwright check the following below
- Make sure you navigate to the e2e repo first
```console
```bash
cd e2e
```
- To run tests in UI helper mode:
```console
```bash
npx playwright test --ui
```
- To run a single test:
```console
```bash
npx playwright test <filename>
```
For example:
```console
```bash
npx playwright test landing-page.spec.ts
```
- Run a set of test files in respective folders:
```console
```bash
npx playwright test <pathToFolder1> <pathToFolder2>
```
For example:
```console
```bash
npx playwright test tests/todo-page/ tests/landing-page/
```
- Run the test with the title:
```console
```bash
npx playwright test -g <title>
```
For example:
```console
```bash
npx playwright test -g "add a todo item"
```
@@ -233,13 +233,13 @@ Since Playwright runs in Node.js, you can debug it with your debugger of choice
- Debugging all tests:
```console
```bash
npx playwright test --debug
```
- Debugging one test file:
```console
```bash
npx playwright test example.spec.ts --debug
```
@@ -247,7 +247,7 @@ Since Playwright runs in Node.js, you can debug it with your debugger of choice
The HTML Reporter shows you a full report of your tests allowing you to filter the report by browsers, passed tests, failed tests, skipped tests and flaky tests.
```console
```bash
npx playwright show-report
```
@@ -257,13 +257,13 @@ Playwright is generally a solid bullet-proof tool. The contributor has already c
- (MacOs and Linux) If running Playwright results in an error due to kernel dependencies, run the following command:
```console
```bash
pnpm run playwright:install-build-tools-linux
```
- A common error seen in playwright is as follows:
```console
```bash
Error: page.goto: Could not connect: Connection refused
=========================== logs ===========================
navigating to "https://127.0.0.1:8000/", waiting until "load"
@@ -284,7 +284,7 @@ Playwright is generally a solid bullet-proof tool. The contributor has already c
- Another common error seen in playwright is as follows:
```console
```bash
Protocol error (Network.getResponseBody): Request content was evicted from inspector cache
```
@@ -305,25 +305,25 @@ If starting the Gitpod environment did not automatically develop the environment
- Create the .env
```console
```bash
cp sample.env .env
```
- Create a config file.
```console
```bash
pnpm run create:shared
```
- Seed the database
```console
```bash
pnpm run seed
```
- Develop the server and client
```console
```bash
pnpm run develop
```
@@ -331,7 +331,7 @@ If starting the Gitpod environment did not automatically develop the environment
To install necessary dependencies for running Playwright run the following command:
```console
```bash
pnpm run playwright:install-build-tools
```
@@ -339,6 +339,6 @@ pnpm run playwright:install-build-tools
To run all Playwright tests, run the following command:
```console
```bash
npx playwright test
```

View File

@@ -10,13 +10,13 @@ Follow these steps:
1. Validate that you are on the `main` branch:
```console
```bash
git status
```
You should get an output like this:
```console
```bash
On branch main
Your branch is up-to-date with 'origin/main'.
@@ -25,7 +25,7 @@ Follow these steps:
If you got a different message, then you aren't on main or your working directory isn't clean, resolve any outstanding files/commits and checkout `main`:
```console
```bash
git checkout main
```
@@ -39,25 +39,25 @@ Follow these steps:
Update your copy of the freeCodeCamp upstream repository:
```console
```bash
git fetch upstream
```
Hard reset your main branch with the freeCodeCamp main:
```console
```bash
git reset --hard upstream/main
```
Push your main branch to your origin to have a clean history on your fork on GitHub:
```console
```bash
git push origin main --force
```
You can validate that your current main matches the upstream/main by performing a diff:
```console
```bash
git diff upstream/main
```
@@ -69,7 +69,7 @@ Follow these steps:
Check that you are on `main` as explained previously, and branch off from there:
```console
```bash
git checkout -b fix/update-guide-for-xyz
```
@@ -93,13 +93,13 @@ Follow these steps:
7. Check and confirm the files you are updating:
```console
```bash
git status
```
This should show a list of `unstaged` files that you have edited.
```console
```bash
On branch feat/documentation
Your branch is up to date with 'upstream/feat/documentation'.
@@ -118,25 +118,25 @@ Follow these steps:
In this step, you should only mark files that you have edited or added yourself. You can perform a reset and resolve files that you did not intend to change if needed.
```console
```bash
git add path/to/my/changed/file.ext
```
Or you can add all the `unstaged` files to the staging area:
```console
```bash
git add .
```
Only the files that were moved to the staging area will be added when you make a commit.
```console
```bash
git status
```
Output:
```console
```bash
On branch feat/documentation
Your branch is up to date with 'upstream/feat/documentation'.
@@ -151,7 +151,7 @@ Follow these steps:
Now, you can commit your changes with a short message like so:
```console
```bash
git commit -m "fix: my short commit message"
```
@@ -181,7 +181,7 @@ Follow these steps:
9. If you realize that you need to edit a file or update the commit message after making a commit you can do so after editing the files with:
```console
```bash
git commit --amend
```
@@ -189,7 +189,7 @@ Follow these steps:
10. Next, you can push your changes to your fork:
```console
```bash
git push origin branch/name-here
```

View File

@@ -115,14 +115,14 @@ When you are working on regular bugs and features on our development branch `mai
1. Rebase your local copy:
```console
```bash
git checkout <pr-branch>
git pull --rebase upstream main
```
2. Resolve any conflicts and add / edit commits
```console
```bash
# Either
git add .
git commit -m "chore: resolve conflicts"
@@ -134,7 +134,7 @@ When you are working on regular bugs and features on our development branch `mai
3. Push back your changes to the PR
```console
```bash
git push --force origin <pr-branch>
```
@@ -144,7 +144,7 @@ When you are working on features for our upcoming curriculum `next-*` branches,
1. Make sure your upstream comes in sync with your local:
```console
```bash
git checkout main
git fetch --all --prune
git checkout next-python-projects
@@ -155,7 +155,7 @@ When you are working on features for our upcoming curriculum `next-*` branches,
a. Either delete your local branch after taking a backup (if you still have it locally):
```console
```bash
git checkout <pr-branch-name>
# example:
@@ -171,7 +171,7 @@ When you are working on features for our upcoming curriculum `next-*` branches,
b. Or just a backup of your PR branch (if you do not have it locally):
```console
```bash
git checkout -b <backup-branch-name> origin/<pr-branch-name>
# example:
@@ -180,14 +180,14 @@ When you are working on features for our upcoming curriculum `next-*` branches,
3. Start off with a clean slate:
```console
```bash
git checkout -b <pr-branch-name> next-python-projects
git cherry-pick <commit-hash>
```
4. Resolve any conflicts, cleanup, and install dependencies and run tests
```console
```bash
pnpm run clean
pnpm install
@@ -201,6 +201,6 @@ When you are working on features for our upcoming curriculum `next-*` branches,
5. If everything looks good, push back to the PR
```console
```bash
git push --force origin <pr-branch-name>
```

View File

@@ -75,7 +75,7 @@ We primarily support development on Linux and Unix-based systems like Ubuntu and
If Node.js is already installed on your machine, run the following commands to validate the versions:
```console
```bash
node -v
pnpm -v
```
@@ -142,7 +142,7 @@ Run these commands on your local machine:
2. Clone your fork of freeCodeCamp, replacing `YOUR_USER_NAME` with your GitHub Username
```console
```bash
git clone --depth=1 https://github.com/YOUR_USER_NAME/freeCodeCamp.git
```
@@ -160,25 +160,25 @@ You need a reference from your local clone to the `upstream` repository in addit
1. Change the directory to the new freeCodeCamp directory:
```console
```bash
cd freeCodeCamp
```
2. Add a remote reference to the main freeCodeCamp repository:
```console
```bash
git remote add upstream https://github.com/freeCodeCamp/freeCodeCamp.git
```
3. Ensure the configuration looks correct:
```console
```bash
git remote -v
```
The output should look something like below (replacing `YOUR_USER_NAME` with your GitHub username):
```console
```bash
origin https://github.com/YOUR_USER_NAME/freeCodeCamp.git (fetch)
origin https://github.com/YOUR_USER_NAME/freeCodeCamp.git (push)
upstream https://github.com/freeCodeCamp/freeCodeCamp.git (fetch)
@@ -203,12 +203,12 @@ And as always, feel free to ask questions on the ['Contributors' category on our
The default API keys and environment variables are stored in the file `sample.env`. This file needs to be copied to a new file named `.env` that is accessed dynamically during the installation step.
```console
```bash
# Create a copy of the "sample.env" and name it ".env".
# Populate it with the necessary API keys and secrets
```
```console
```bash
cp sample.env .env
```
@@ -220,7 +220,7 @@ The keys in the `.env` file are _not_ required to be changed to run the app loca
This step will install the dependencies required for the application to run:
```console
```bash
pnpm install && pnpm run create:shared
```
@@ -234,7 +234,7 @@ Before you can run the application locally, you will need to start the MongoDB s
Start the MongoDB server in a separate terminal:
```console
```bash
mongod
```
@@ -242,15 +242,14 @@ mongod
Next, let's seed the database. In this step, we run the below command that fills the MongoDB server with some initial data sets that are required by services. These include a few schemas, among other things.
```console
```bash
pnpm run seed
```
By default, you will be signed in as a new user without any completed certifications. Run the following commands if you need to develop with completed certifications:
```console
```bash
pnpm run seed:certified-user
pnpm run seed:exams
```
> [!WARNING] Running `pnpm run seed:certified-user` will log you out. You will have to clear your browser cookies and sign in again.
@@ -259,7 +258,7 @@ pnpm run seed:exams
You can now start up the API server and the client applications.
```console
```bash
pnpm run develop
```
@@ -279,11 +278,12 @@ If you have issues while installing it, check out the [troubleshooting section](
A quick reference to the commands that you will need when working locally.
| command | description |
| ------------------------------ | ------------------------------------------------------------------------------------------------- |
| `pnpm install` | Installs / re-installs all dependencies and bootstraps the different services. |
| `pnpm run seed` | Creates authorized test users and inserts them into MongoDB. |
| `pnpm run seed:certified-user` | Creates authorized test users with certifications fully completed, and inserts them into MongoDB. |
| `pnpm run seed:exams` | Creates exams and inserts them into MongoDB. |
| `pnpm run develop` | Starts the freeCodeCamp API Server and Client Applications. |
| `pnpm run clean` | Uninstalls all dependencies and cleans up caches. |
| command | description |
| ------------------------------ | ------------------------------------------------------------------------------------------------------------- |
| `pnpm install` | Installs / re-installs all dependencies and bootstraps the different services. |
| `pnpm run seed` | Creates authorized test users and inserts them into MongoDB. Also runs `seed:exams` and `seed:surveys` below. |
| `pnpm run seed:certified-user` | Creates authorized test users with certifications fully completed, and inserts them into MongoDB. |
| `pnpm run seed:exams` | Creates exams and inserts them into MongoDB. |
| `pnpm run seed:surveys` | Creates surveys for defaults users and inserts them into MongoDB. |
| `pnpm run develop` | Starts the freeCodeCamp API Server and Client Applications. |
| `pnpm run clean` | Uninstalls all dependencies and cleans up caches. |

View File

@@ -17,7 +17,7 @@ Start by installing the prerequisite software for your operating system.
If Flutter is already installed on your machine, run the following commands to validate the versions:
```console
```bash
flutter --version
dart --version
```
@@ -70,7 +70,7 @@ Run these commands on your local machine:
2. Clone your fork of freeCodeCamp, replacing `YOUR_USER_NAME` with your GitHub Username
```console
```bash
git clone --depth=1 https://github.com/YOUR_USER_NAME/mobile.git
```
@@ -88,25 +88,25 @@ You need a reference from your local clone to the `upstream` repository in addit
1. Change directory to the new `mobile` directory:
```console
```bash
cd mobile
```
2. Add a remote reference to the main freeCodeCamp mobile repository:
```console
```bash
git remote add upstream https://github.com/freeCodeCamp/mobile.git
```
3. Ensure the configuration looks correct:
```console
```bash
git remote -v
```
The output should look something like below (replacing `YOUR_USER_NAME` with your GitHub username):
```console
```bash
origin https://github.com/YOUR_USER_NAME/mobile.git (fetch)
origin https://github.com/YOUR_USER_NAME/mobile.git (push)
upstream https://github.com/freeCodeCamp/mobile.git (fetch)
@@ -129,20 +129,20 @@ And as always, feel free to ask questions on the ['Contributors' category on our
The default API keys and environment variables are stored in the file `sample.env`. This file needs to be copied to a new file named `.env` which is accessed dynamically during the installation step. Remember to change the directory to `mobile-app` before running the following commands.
```console
```bash
# Create a copy of the "sample.env" and name it ".env".
# Populate it with the necessary API keys and secrets:
```
#### **macOS/Linux**
```console
```bash
cp sample.env .env
```
#### **Windows**
```console
```bash
copy sample.env .env
```
@@ -152,7 +152,7 @@ The keys in the `.env` file are _not_ required to be changed to run the app loca
This step will install the dependencies required for the application to run:
```console
```bash
flutter pub get
```
@@ -162,7 +162,7 @@ Start the emulator of your choice(Android or iOS) and wait for the bootup proces
You can now start the app by running the following command:
```console
```bash
flutter run
```
@@ -176,13 +176,13 @@ Follow these steps:
1. Validate that you are on the `main` branch:
```console
```bash
git status
```
You should get an output like this:
```console
```bash
On branch main
Your branch is up-to-date with 'origin/main'.
@@ -191,7 +191,7 @@ Follow these steps:
If you are not on main or your working directory is not clean, resolve any outstanding files/commits and checkout `main`:
```console
```bash
git checkout main
```
@@ -205,25 +205,25 @@ Follow these steps:
Update your local copy of the freeCodeCamp mobile upstream repository:
```console
```bash
git fetch upstream
```
Hard reset your main branch with the freeCodeCamp mobile main:
```console
```bash
git reset --hard upstream/main
```
Push your main branch to your origin to have a clean history on your fork on GitHub:
```console
```bash
git push origin main --force
```
You can validate that your current main matches the upstream/main by performing a diff:
```console
```bash
git diff upstream/main
```
@@ -235,7 +235,7 @@ Follow these steps:
Check that you are on `main` as explained previously, and branch off from there:
```console
```bash
git checkout -b fix/update-guide-for-xyz
```
@@ -259,13 +259,13 @@ Follow these steps:
7. Check and confirm the files you are updating:
```console
```bash
git status
```
This should show a list of `unstaged` files that you have edited.
```console
```bash
On branch feat/documentation
Your branch is up to date with 'upstream/feat/documentation'.
@@ -282,25 +282,25 @@ Follow these steps:
In this step, you should only mark files that you have edited or added yourself. You can perform a reset and resolve files that you did not intend to change if needed.
```console
```bash
git add path/to/my/changed/file.ext
```
Or you can add all the `unstaged` files to the staging area:
```console
```bash
git add .
```
Only the files that were moved to the staging area will be added when you make a commit.
```console
```bash
git status
```
Output:
```console
```bash
On branch feat/documentation
Your branch is up to date with 'upstream/feat/documentation'.
@@ -313,7 +313,7 @@ Follow these steps:
Now, you can commit your changes with a short message like so:
```console
```bash
git commit -m "fix: my short commit message"
```
@@ -345,7 +345,7 @@ Follow these steps:
9. If you realize that you need to edit a file or update the commit message after making a commit you can do so after editing the files with:
```console
```bash
git commit --amend
```
@@ -353,7 +353,7 @@ Follow these steps:
10. Next, you can push your changes to your fork:
```console
```bash
git push origin branch/name-here
```
@@ -363,14 +363,14 @@ Follow these steps:
1. Clone a copy of the [freeCodeCamp repo](https://github.com/freeCodeCamp/freeCodeCamp) locally outside of your local copy of the freeCodeCamp mobile repo. Your folder structure should look like this:
```console
```bash
├── freeCodeCamp
├── mobile
```
2. Change the directory to the freeCodeCamp repo:
```console
```bash
cd freeCodeCamp
```
@@ -378,25 +378,25 @@ Follow these steps:
#### **macOS/Linux**
```console
```bash
cp sample.env .env
```
#### **Windows**
```console
```bash
copy sample.env .env
```
4. Install the dependencies for the freeCodeCamp repo:
```console
```bash
pnpm install && pnpm run create:shared
```
5. Generate the challenge data JSON file:
```console
```bash
pnpm run build:curriculum
```
@@ -404,54 +404,54 @@ Follow these steps:
#### **macOS/Linux**
```console
```bash
cp ./shared/config/curriculum.json ../mobile/mobile-app/curriculum.json
```
#### **Windows**
```console
```bash
copy .\shared\config\curriculum.json ..\mobile\mobile-app\curriculum.json
```
7. Change directory to the mobile app:
```console
```bash
cd ../mobile/mobile-app
```
8. Install the dependencies for the mobile app:
```console
```bash
flutter pub get
```
9. Update the test file to use the challenge data JSON file:
```console
```bash
sed -i '' 's/..\/..\/shared\/config\/curriculum.json/.\/curriculum.json/g' test/widget_test.dart
```
10. Generate the challenge files:
```console
```bash
flutter test test/widget_test.dart
```
11. Start a local server to serve the challenge files with the help of `serve` package:
```console
```bash
npx serve
```
12. In a different terminal go back to the freeCodeCamp repo:
```console
```bash
cd ../../freeCodeCamp
```
13. Run the cypress tests:
```console
```bash
pnpm cypress run --config retries=1,screenshotOnRunFailure=false,video=false,baseUrl=http://localhost:3000/generated-tests/,specPattern=cypress/e2e/mobile-learn/test-challenges.js -s cypress/e2e/mobile-learn/test-challenges.js -b chrome
```
@@ -482,7 +482,7 @@ If you are on a different OS and/or are still running into issues, see [getting
If you face issues with the UI, or build errors a cleanup can be useful:
```console
```bash
flutter clean
```

View File

@@ -10,7 +10,7 @@ This guide covers some common steps with the setup of WSL2. Once some of the com
## Enable WSL
Follow the instructions on the [official documentation](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to install WSL1 and followed by upgrading to WSL2.
Follow the instructions on the [official documentation](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to install WSL2.
## Install Ubuntu
@@ -20,9 +20,11 @@ Follow the instructions on the [official documentation](https://docs.microsoft.c
>
> While you may use other non-Debian-based distributions, they all come with their own 'gotchas' that are beyond the scope of this guide.
As of November 2023, Ubuntu and Debian are the only Linux distributions [officially supported by Playwright](https://playwright.dev/docs/intro#system-requirements), the end-to-end testing library used by freeCodeCamp.
2. Update the dependencies for the OS
```console
```bash
sudo apt update
sudo apt upgrade -y
@@ -70,23 +72,23 @@ This makes it so that the containers run on the WSL side instead of running on W
Once you have configured Docker Desktop to work with WSL2, follow these steps to start a MongoDB service:
1. Launch a new Ubuntu-18.04 terminal
1. Launch a new Ubuntu terminal
2. Pull `MongoDB 4.0.x` from Docker Hub
2. Pull MongoDB from Docker Hub. Please refer to the [Prerequisites](how-to-setup-freecodecamp-locally.md#Prerequisites) table for the current version of MongoDB used by freeCodeCamp. For example, if the version number is `5.0.x`, replace `<x.y>` with `5.0` in the following two code snippets.
```console
docker pull mongo:4.0
```bash
docker pull mongo:<x.y>
```
3. Start the MongoDB service at port `27017`, and configure it to run automatically on system restarts
```console
```bash
docker run -it \
-v mongodata:/data/db \
-p 27017:27017 \
--name mongodb \
--restart unless-stopped \
-d mongo:4.0
-d mongo:<x.y>
```
4. You can now access the service from both Windows or Ubuntu at `mongodb://localhost:27017`.
@@ -95,25 +97,17 @@ Once you have configured Docker Desktop to work with WSL2, follow these steps to
We recommend you install the LTS release for Node.js with a node version manager - [nvm](https://github.com/nvm-sh/nvm#installing-and-updating).
Once installed use these commands to install and use the Node.js version as needed
Once installed use this command to install and use the latest Node.js LTS version:
```console
```bash
nvm install --lts
# OR
# nvm install <version>
nvm install 14
# Usage
# nvm use <version>
nvm use 12
```
For instructions on installing and using a different version of Node.js, please refer to the [nvm docs](https://github.com/nvm-sh/nvm#usage).
Node.js comes bundled with `npm`, which you can use to install `pnpm`:
```console
```bash
npm install -g pnpm
```
@@ -125,6 +119,103 @@ Now that you have installed the pre-requisites, follow [our local setup guide](h
>
> Please note, at this time the setup for Cypress tests (and related GUI needs) is a work in progress. You should still be able to work on most of the codebase.
## Optimize Windows and WSL
> [!NOTE]
>
> The following tips were collected from across the web and have not gone through vigorous testing. Your mileage may vary.
### Adjust processer scheduling for background services
This may reduce incidents of Docker containers crashing due to lack of resources.
Open the System Properties control panel by pressing <kbd>Win + R</kbd> and entering `sysdm.cpl`
<details>
<summary>
Enter <code>sysdm.cpl</code> in the Run dialog (screenshot)
</summary>
<br>
<img src="https://raw.githubusercontent.com/freeCodeCamp/freeCodeCamp/main/docs/images/wsl/run-sysdm.png" alt="Enter `sysdm.cpl` in the Run dialog" />
</details>
<br>
Go to Advanced -> Performance -> Settings…
<details>
<summary>
Performance Settings button under Advanced tab in System Properties (screenshot)
</summary>
<br>
<img src="https://raw.githubusercontent.com/freeCodeCamp/freeCodeCamp/main/docs/images/wsl/advanced-performance-settings.png" alt="Performance Settings button under Advanced tab in System Properties" />
</details>
<br>
Under Advanced -> Processor scheduling, choose "Background services". Do not close the window. Continue to the next tip.
<details>
<summary>
Background services radio button under Advanced tab in Performance Options (screenshot)
</summary>
<br>
<img src="https://raw.githubusercontent.com/freeCodeCamp/freeCodeCamp/main/docs/images/wsl/background-services.png" alt="Background services radio button under Advanced tab in Performance Options" />
</details>
### Increase the size of Windows paging file for the system drive
Under Advanced -> Virtual memory, click "Change…"
<details>
<summary>
Change virtual memory button under Advanced tab in Performance Options (screenshot)
</summary>
<br>
<img src="https://raw.githubusercontent.com/freeCodeCamp/freeCodeCamp/main/docs/images/wsl/advanced-virtual-memory.png" alt="Change virtual memory button under Advanced tab in Performance Options" />
</details>
<br>
Choose "Custom size". Set the initial size to 1.5x and the maximum size to 3x of your physical memory. Then click "Set".
<details>
<summary>
Set custom size button in Virtual Memory window (screenshot)
</summary>
<br>
<img src="https://raw.githubusercontent.com/freeCodeCamp/freeCodeCamp/main/docs/images/wsl/set-custom-size.png" alt="Set custom size button in Virtual Memory window" />
</details>
### Increase the size of memory allocated to WSL
Create a [`.wslconfig` file](https://learn.microsoft.com/en-us/windows/wsl/wsl-config#configuration-setting-for-wslconfig) in your [`%UserProfile%` directory](https://learn.microsoft.com/en-us/windows/wsl/wsl-config#wslconfig) (typically `C:\Users\<UserName>\.wslconfig`). Please read the [WSL documentation](https://learn.microsoft.com/en-us/windows/wsl/wsl-config#configuration-setting-for-wslconfig) carefully and replace `x` with values that suit your own needs:
```ini
# Settings apply across all Linux distros running on WSL 2
[wsl2]
# How much memory to assign to the WSL 2 VM. The default value might not be enough
memory=xGB
# How much swap space to add to the WSL 2 VM, default is 25% of available RAM
swap=xGB
```
### Increase Node.js max old space size
This fixes the ["JavaScript heap out of memory" error](https://stackoverflow.com/a/54456814) with ESLint. Add the following to your `~/.bashrc` or `~/.zshrc`:
```sh
export NODE_OPTIONS="--max-old-space-size=4096"
```
### Avoid `pnpm run test`
Instead, use the script [appropriate to your PR](https://forum.freecodecamp.org/t/wsl-performance-issues-while-working-on-the-codebase/644215/2#:~:text=usually%2C%20you%20just%20want%20to%20test%20something%20specific%20to%20either%20the%20curriculum%20or%20the%20client%20or%20the%20api%20-%20almost%20never%20all%203.); either `pnpm run test:api`, `pnpm run test:curriculum`, or `pnpm run test-client`.
## Useful Links
- [A WSL2 Dev Setup with Ubuntu 20.04, Node.js, MongoDB, VS Code, and Docker](https://hn.mrugesh.dev/wsl2-dev-setup-with-ubuntu-nodejs-mongodb-and-docker) - an article by Mrugesh Mohapatra (Staff Developer at freeCodeCamp.org)

View File

@@ -232,6 +232,8 @@ Sentences should be clear and concise with minimal jargon. If used, jargon shoul
Keep paragraphs short (around 1-4 sentences). People are more likely to read several short paragraphs than a wall of text.
Use american english, e.g., use `labeled` instead of `labelled`.
Challenge text should use the second person ("you") to help to give it a conversational tone. This way the text and instructions seem to speak directly to the camper working through the challenge. Try to avoid using the first person ("I", "we", "let's", and "us").
Don't use outbound links. These interrupt the flow. Campers should never have to google anything during these challenges. If there are resources you think campers would benefit from, add them to the challenge's Guide-related article.
@@ -306,7 +308,7 @@ Challenges should have the minimum number of tests necessary to verify that a ca
Our goal is to communicate the single point that the challenge is trying to teach, and test that they have understood that point.
Challenge tests can make use of the Node.js and Chai.js assertion libraries. Also, if needed, user-generated code can be accessed in the `code` variable. In addition, the `__helpers` object exposes several functions that simplify the process of writing tests. The available functions are defined in _client/src/utils/curriculum-helpers.ts_.
Challenge tests can make use of the Node.js and Chai.js assertion libraries. Also, if needed, user-generated code can be accessed in the `code` variable. In addition, the `__helpers` object exposes several functions that simplify the process of writing tests. The available functions are defined in the [curriculum-helpers](https://github.com/freeCodeCamp/curriculum-helpers/blob/main/lib/index.ts) repo.
## Formatting Seed Code

View File

@@ -16,7 +16,7 @@ Let's understand how the i18n frameworks and tooling work.
Most of the files for translating the platform are located in the [`client/i18n`](https://github.com/freeCodeCamp/freeCodeCamp/tree/main/client/i18n) folder. Each language has a directory that contains JSON files with the translations.
```console
```bash
config
└── i18n.ts
...

View File

@@ -47,7 +47,7 @@ Typically you would not need to change any configuration or build the site local
Install freeCodeCamp locally ([see the local setup guide](how-to-setup-freecodecamp-locally)), we bundled the CLI with the development tools so you can run the command below as needed from the root of the repo:
```console
```bash
pnpm run docs:serve
```

View File

@@ -16,7 +16,7 @@ If you are on a different OS or are still facing issues, see [getting help](#get
When you build the client, Gatsby will cache the Fonts, language strings, and UI. If one of them isn't cached, run the following:
```console
```bash
pnpm run clean
pnpm install
pnpm run seed
@@ -53,7 +53,7 @@ git clean -ifdX
If you can't sign in, and instead you see a banner with an error message saying that the error will be reported to freeCodeCamp, please double-check that your local port `3000` is not in use by a different program.
#### **From Terminal:**
```console
```bash
netstat -a | grep "3000"
tcp4 0 0 0.0.0.0:3000 DESKTOP LISTEN

View File

@@ -303,19 +303,19 @@ You should keep the VMs up to date by performing updates and upgrades. This will
Update package information
```console
```bash
sudo apt update
```
Upgrade installed packages
```console
```bash
sudo apt upgrade -y
```
Cleanup unused packages
```console
```bash
sudo apt autoremove -y
```
@@ -331,7 +331,7 @@ Provisioning VMs with the Code
1. Install NGINX and configure from repository.
```console
```bash
sudo su
cd /var/www/html
@@ -352,7 +352,7 @@ Provisioning VMs with the Code
Move over existing certificates:
```console
```bash
# Local
scp -r username@source-server-public-ip:/etc/nginx/ssl ./
scp -pr ./ssl username@target-server-public-ip:/tmp/
@@ -364,7 +364,7 @@ Provisioning VMs with the Code
Update Upstream Configurations:
```console
```bash
vi configs/upstreams.conf
```
@@ -382,7 +382,7 @@ Provisioning VMs with the Code
1. Check status for NGINX service using the below command:
```console
```bash
sudo systemctl status nginx
```
@@ -396,13 +396,13 @@ Config changes to our NGINX instances are maintained on GitHub, these should be
1. SSH into the instance and enter sudo
```console
```bash
sudo su
```
2. Get the latest config code.
```console
```bash
cd /etc/nginx
git fetch --all --prune
git reset --hard origin/main
@@ -410,7 +410,7 @@ git reset --hard origin/main
3. Test and reload the config [with Signals](https://docs.nginx.com/nginx/admin-guide/basic-functionality/runtime-control/#controlling-nginx).
```console
```bash
nginx -t
nginx -s reload
```
@@ -419,7 +419,7 @@ nginx -s reload
1. Install build tools for node binaries (`node-gyp`) etc.
```console
```bash
sudo apt install build-essential
```
@@ -431,19 +431,19 @@ Provisioning VMs with the Code
2. Install pnpm globally.
```console
```bash
npm install -g pnpm
```
3. Install pm2 globally.
```console
```bash
npm install -g pm2
```
4. Clone freeCodeCamp, set up env, and keys.
```console
```bash
git clone https://github.com/freeCodeCamp/freeCodeCamp.git
cd freeCodeCamp
git checkout prod-current # or any other branch to be deployed
@@ -453,36 +453,36 @@ git checkout prod-current # or any other branch to be deployed
6. Install dependencies
```console
```bash
pnpm install
```
7. Setup pm2 `logrotate` and startup on boot
```console
```bash
pm2 install pm2-logrotate
pm2 startup
```
8. Build the server
```console
```bash
pnpm prebuild && pnpm build:curriculum && pnpm build:server
```
9. Start Instances
```console
```bash
pnpm start:server
```
### Logging and Monitoring
```console
```bash
pm2 logs
```
```console
```bash
pm2 monit
```
@@ -496,31 +496,31 @@ Code changes need to be deployed to the API instances from time to time. It can
1. Stop all instances
```console
```bash
pm2 stop all
```
2. Install dependencies
```console
```bash
pnpm install
```
3. Build the server
```console
```bash
pnpm prebuild && pnpm build:curriculum && pnpm build:server
```
4. Start Instances
```console
```bash
pnpm start:server && pm2 logs
```
#### 2. Rolling updates - Used for logical changes to code.
```console
```bash
pnpm reload:server && pm2 logs
```
@@ -532,7 +532,7 @@ pnpm reload:server && pm2 logs
2. Update pm2 to use the new version
```console
```bash
pm2 update
```
@@ -540,7 +540,7 @@ pm2 update
1. Install build tools for node binaries (`node-gyp`) etc.
```console
```bash
sudo apt install build-essential
```
@@ -552,7 +552,7 @@ Provisioning VMs with the Code
2. Update `npm` and install PM2 and setup `logrotate` and startup on boot
```console
```bash
npm i -g npm@8
npm i -g pm2@4
npm install -g serve@13
@@ -562,7 +562,7 @@ Provisioning VMs with the Code
3. Clone client config, setup env and keys.
```console
```bash
git clone https://github.com/freeCodeCamp/client-config.git client
cd client
```
@@ -571,7 +571,7 @@ Provisioning VMs with the Code
> Todo: This setup needs to move to S3 or Azure Blob storage
>
> ```console
> ```bash
> echo "serve -c ../serve.json -p 50505 www" > client-start-primary.sh
> chmod +x client-start-primary.sh
> pm2 delete client-primary
@@ -584,11 +584,11 @@ Provisioning VMs with the Code
### Logging and Monitoring
```console
```bash
pm2 logs
```
```console
```bash
pm2 monit
```
@@ -602,7 +602,7 @@ Code changes need to be deployed to the API instances from time to time. It can
1. Stop all instances
```console
```bash
pm2 stop all
```
@@ -610,13 +610,13 @@ Code changes need to be deployed to the API instances from time to time. It can
3. Start Instances
```console
```bash
pm2 start all --update-env && pm2 logs
```
#### 2. Rolling updates - Used for logical changes to code.
```console
```bash
pm2 reload all --update-env && pm2 logs
```
@@ -636,7 +636,7 @@ Provisioning VMs with the Code
1. Install NGINX and configure from repository.
```console
```bash
sudo su
cd /var/www/html
@@ -657,7 +657,7 @@ Provisioning VMs with the Code
Move over existing certificates:
```console
```bash
# Local
scp -r username@source-server-public-ip:/etc/nginx/ssl ./
scp -pr ./ssl username@target-server-public-ip:/tmp/
@@ -669,7 +669,7 @@ Provisioning VMs with the Code
Update Upstream Configurations:
```console
```bash
vi configs/upstreams.conf
```
@@ -687,7 +687,7 @@ Provisioning VMs with the Code
1. Install Docker and configure from the repository
```console
```bash
git clone https://github.com/freeCodeCamp/chat-config.git chat
cd chat
```
@@ -696,7 +696,7 @@ Provisioning VMs with the Code
3. Run rocket-chat server
```console
```bash
docker-compose config
docker-compose up -d
```
@@ -705,13 +705,13 @@ Provisioning VMs with the Code
1. Check status for NGINX service using the below command:
```console
```bash
sudo systemctl status nginx
```
2. Check status for running docker instances with:
```console
```bash
docker ps
```
@@ -723,13 +723,13 @@ Config changes to our NGINX instances are maintained on GitHub, these should be
1. SSH into the instance and enter sudo
```console
```bash
sudo su
```
2. Get the latest config code.
```console
```bash
cd /etc/nginx
git fetch --all --prune
git reset --hard origin/main
@@ -737,7 +737,7 @@ Config changes to our NGINX instances are maintained on GitHub, these should be
3. Test and reload the config [with Signals](https://docs.nginx.com/nginx/admin-guide/basic-functionality/runtime-control/#controlling-nginx).
```console
```bash
nginx -t
nginx -s reload
```
@@ -746,44 +746,44 @@ Config changes to our NGINX instances are maintained on GitHub, these should be
1. SSH into the instance and navigate to the chat config path
```console
```bash
cd ~/chat
```
2. Get the latest config code.
```console
```bash
git fetch --all --prune
git reset --hard origin/main
```
3. Pull down the latest docker image for Rocket.Chat
```console
```bash
docker-compose pull
```
4. Update the running instances
```console
```bash
docker-compose up -d
```
5. Validate the instances are up
```console
```bash
docker ps
```
6. Cleanup extraneous resources
```console
```bash
docker system prune --volumes
```
Output:
```console
```bash
WARNING! This will remove:
- all stopped containers
- all networks not used by at least one container
@@ -802,7 +802,7 @@ Config changes to our NGINX instances are maintained on GitHub, these should be
ssh into the VM (hosted on Digital Ocean).
```console
```bash
cd tools
git pull origin master
pnpm install
@@ -814,7 +814,7 @@ pm2 restart contribute-app
List currently installed node & npm versions
```console
```bash
nvm -v
node -v
npm -v
@@ -824,25 +824,25 @@ nvm ls
Install the latest Node.js LTS, and reinstall any global packages
```console
```bash
nvm install --lts --reinstall-packages-from=default
```
Verify installed packages
```console
```bash
npm ls -g --depth=0
```
Alias the `default` Node.js version to the current LTS (pinned to the latest major version)
```console
```bash
nvm alias default 16
```
(Optional) Uninstall old versions
```console
```bash
nvm uninstall <version>
```
@@ -852,31 +852,31 @@ nvm uninstall <version>
Get the uninstall instructions/commands with the `unstartup` command and use the output to remove the systemctl services
```console
```bash
pm2 unstartup
```
Get the install instructions/commands with the `startup` command and use the output to add the systemctl services
```console
```bash
pm2 startup
```
Quick commands for PM2 to list, resurrect saved processes, etc.
```console
```bash
pm2 ls
```
```console
```bash
pm2 resurrect
```
```console
```bash
pm2 save
```
```console
```bash
pm2 logs
```
@@ -898,32 +898,32 @@ Currently updating agents requires them to be removed and reconfigured. This is
1. Navigate and check status of the service
```console
```bash
cd ~/azagent
sudo ./svc.sh status
```
2. Stop the service
```console
```bash
sudo ./svc.sh stop
```
3. Uninstall the service
```console
```bash
sudo ./svc.sh uninstall
```
4. Remove the agent from the pipeline pool
```console
```bash
./config.sh remove
```
5. Remove the config files
```console
```bash
cd ~
rm -rf ~/azagent
```
@@ -938,7 +938,7 @@ We use [a CLI tool](https://github.com/freecodecamp/sendgrid-email-blast) to sen
2. Set up the script to fetch the email list.
```console
```bash
cd /home/freecodecamp/scripts/emails
cp sample.env .env
```
@@ -947,7 +947,7 @@ We use [a CLI tool](https://github.com/freecodecamp/sendgrid-email-blast) to sen
3. Run the script.
```console
```bash
node get-emails.js emails.csv
```

View File

@@ -26,25 +26,25 @@ To run tests against production builds, replace `dev` with `prd` below.
- To run all tests in the `./cypress` directory:
```console
```bash
pnpm run cypress:dev:run
```
- To run a single test:
```console
```bash
pnpm run cypress run --spec=cypress/<path_to_test_file>
```
For example:
```console
```bash
pnpm run cypress run --spec=cypress/e2e/default/landing.ts
```
- To create a development build, start the development server, and run all existing cypress end-to-end tests:
```console
```bash
pnpm run e2e:dev:run
```
@@ -57,25 +57,25 @@ If starting the Gitpod environment did not automatically develop the environment
- Follow the [MongoDB installation guide](https://www.mongodb.com/basics/get-started).
- Create a config file.
```console
```bash
pnpm run create:shared
```
- Seed the database
```console
```bash
pnpm run seed
```
- Develop the server and client
```console
```bash
pnpm run develop
```
### 2. Install Cypress Build Tools
```console
```bash
pnpm run cypress:install-build-tools
```

View File

@@ -4,7 +4,7 @@
To install Playwright run:
```console
```bash
pnpm run playwright:install-build-tools
```
@@ -181,49 +181,49 @@ To run tests with Playwright check the following below
- Make sure you navigate to the e2e repo first
```console
```bash
cd e2e
```
- To run tests in UI helper mode:
```console
```bash
npx playwright test --ui
```
- To run a single test:
```console
```bash
npx playwright test <filename>
```
For example:
```console
```bash
npx playwright test landing-page.spec.ts
```
- Run a set of test files in respective folders:
```console
```bash
npx playwright test <pathToFolder1> <pathToFolder2>
```
For example:
```console
```bash
npx playwright test tests/todo-page/ tests/landing-page/
```
- Run the test with the title:
```console
```bash
npx playwright test -g <title>
```
For example:
```console
```bash
npx playwright test -g "add a todo item"
```
@@ -233,13 +233,13 @@ Since Playwright runs in Node.js, you can debug it with your debugger of choice
- Debugging all tests:
```console
```bash
npx playwright test --debug
```
- Debugging one test file:
```console
```bash
npx playwright test example.spec.ts --debug
```
@@ -247,7 +247,7 @@ Since Playwright runs in Node.js, you can debug it with your debugger of choice
The HTML Reporter shows you a full report of your tests allowing you to filter the report by browsers, passed tests, failed tests, skipped tests and flaky tests.
```console
```bash
npx playwright show-report
```
@@ -257,13 +257,13 @@ Playwright is generally a solid bullet-proof tool. The contributor has already c
- (MacOs and Linux) If running Playwright results in an error due to kernel dependencies, run the following command:
```console
```bash
pnpm run playwright:install-build-tools-linux
```
- A common error seen in playwright is as follows:
```console
```bash
Error: page.goto: Could not connect: Connection refused
=========================== logs ===========================
navigating to "https://127.0.0.1:8000/", waiting until "load"
@@ -284,7 +284,7 @@ Playwright is generally a solid bullet-proof tool. The contributor has already c
- Another common error seen in playwright is as follows:
```console
```bash
Protocol error (Network.getResponseBody): Request content was evicted from inspector cache
```
@@ -305,25 +305,25 @@ If starting the Gitpod environment did not automatically develop the environment
- Create the .env
```console
```bash
cp sample.env .env
```
- Create a config file.
```console
```bash
pnpm run create:shared
```
- Seed the database
```console
```bash
pnpm run seed
```
- Develop the server and client
```console
```bash
pnpm run develop
```
@@ -331,7 +331,7 @@ If starting the Gitpod environment did not automatically develop the environment
To install necessary dependencies for running Playwright run the following command:
```console
```bash
pnpm run playwright:install-build-tools
```
@@ -339,6 +339,6 @@ pnpm run playwright:install-build-tools
To run all Playwright tests, run the following command:
```console
```bash
npx playwright test
```

View File

@@ -10,13 +10,13 @@ Follow these steps:
1. Validate that you are on the `main` branch:
```console
```bash
git status
```
You should get an output like this:
```console
```bash
On branch main
Your branch is up-to-date with 'origin/main'.
@@ -25,7 +25,7 @@ Follow these steps:
If you got a different message, then you aren't on main or your working directory isn't clean, resolve any outstanding files/commits and checkout `main`:
```console
```bash
git checkout main
```
@@ -39,25 +39,25 @@ Follow these steps:
Update your copy of the freeCodeCamp upstream repository:
```console
```bash
git fetch upstream
```
Hard reset your main branch with the freeCodeCamp main:
```console
```bash
git reset --hard upstream/main
```
Push your main branch to your origin to have a clean history on your fork on GitHub:
```console
```bash
git push origin main --force
```
You can validate that your current main matches the upstream/main by performing a diff:
```console
```bash
git diff upstream/main
```
@@ -69,7 +69,7 @@ Follow these steps:
Check that you are on `main` as explained previously, and branch off from there:
```console
```bash
git checkout -b fix/update-guide-for-xyz
```
@@ -93,13 +93,13 @@ Follow these steps:
7. Check and confirm the files you are updating:
```console
```bash
git status
```
This should show a list of `unstaged` files that you have edited.
```console
```bash
On branch feat/documentation
Your branch is up to date with 'upstream/feat/documentation'.
@@ -118,25 +118,25 @@ Follow these steps:
In this step, you should only mark files that you have edited or added yourself. You can perform a reset and resolve files that you did not intend to change if needed.
```console
```bash
git add path/to/my/changed/file.ext
```
Or you can add all the `unstaged` files to the staging area:
```console
```bash
git add .
```
Only the files that were moved to the staging area will be added when you make a commit.
```console
```bash
git status
```
Output:
```console
```bash
On branch feat/documentation
Your branch is up to date with 'upstream/feat/documentation'.
@@ -151,7 +151,7 @@ Follow these steps:
Now, you can commit your changes with a short message like so:
```console
```bash
git commit -m "fix: my short commit message"
```
@@ -181,7 +181,7 @@ Follow these steps:
9. If you realize that you need to edit a file or update the commit message after making a commit you can do so after editing the files with:
```console
```bash
git commit --amend
```
@@ -189,7 +189,7 @@ Follow these steps:
10. Next, you can push your changes to your fork:
```console
```bash
git push origin branch/name-here
```

View File

@@ -115,14 +115,14 @@ When you are working on regular bugs and features on our development branch `mai
1. Rebase your local copy:
```console
```bash
git checkout <pr-branch>
git pull --rebase upstream main
```
2. Resolve any conflicts and add / edit commits
```console
```bash
# Either
git add .
git commit -m "chore: resolve conflicts"
@@ -134,7 +134,7 @@ When you are working on regular bugs and features on our development branch `mai
3. Push back your changes to the PR
```console
```bash
git push --force origin <pr-branch>
```
@@ -144,7 +144,7 @@ When you are working on features for our upcoming curriculum `next-*` branches,
1. Make sure your upstream comes in sync with your local:
```console
```bash
git checkout main
git fetch --all --prune
git checkout next-python-projects
@@ -155,7 +155,7 @@ When you are working on features for our upcoming curriculum `next-*` branches,
a. Either delete your local branch after taking a backup (if you still have it locally):
```console
```bash
git checkout <pr-branch-name>
# example:
@@ -171,7 +171,7 @@ When you are working on features for our upcoming curriculum `next-*` branches,
b. Or just a backup of your PR branch (if you do not have it locally):
```console
```bash
git checkout -b <backup-branch-name> origin/<pr-branch-name>
# example:
@@ -180,14 +180,14 @@ When you are working on features for our upcoming curriculum `next-*` branches,
3. Start off with a clean slate:
```console
```bash
git checkout -b <pr-branch-name> next-python-projects
git cherry-pick <commit-hash>
```
4. Resolve any conflicts, cleanup, and install dependencies and run tests
```console
```bash
pnpm run clean
pnpm install
@@ -201,6 +201,6 @@ When you are working on features for our upcoming curriculum `next-*` branches,
5. If everything looks good, push back to the PR
```console
```bash
git push --force origin <pr-branch-name>
```

View File

@@ -75,7 +75,7 @@ We primarily support development on Linux and Unix-based systems like Ubuntu and
If Node.js is already installed on your machine, run the following commands to validate the versions:
```console
```bash
node -v
pnpm -v
```
@@ -142,7 +142,7 @@ Run these commands on your local machine:
2. Clone your fork of freeCodeCamp, replacing `YOUR_USER_NAME` with your GitHub Username
```console
```bash
git clone --depth=1 https://github.com/YOUR_USER_NAME/freeCodeCamp.git
```
@@ -160,25 +160,25 @@ You need a reference from your local clone to the `upstream` repository in addit
1. Change the directory to the new freeCodeCamp directory:
```console
```bash
cd freeCodeCamp
```
2. Add a remote reference to the main freeCodeCamp repository:
```console
```bash
git remote add upstream https://github.com/freeCodeCamp/freeCodeCamp.git
```
3. Ensure the configuration looks correct:
```console
```bash
git remote -v
```
The output should look something like below (replacing `YOUR_USER_NAME` with your GitHub username):
```console
```bash
origin https://github.com/YOUR_USER_NAME/freeCodeCamp.git (fetch)
origin https://github.com/YOUR_USER_NAME/freeCodeCamp.git (push)
upstream https://github.com/freeCodeCamp/freeCodeCamp.git (fetch)
@@ -203,12 +203,12 @@ And as always, feel free to ask questions on the ['Contributors' category on our
The default API keys and environment variables are stored in the file `sample.env`. This file needs to be copied to a new file named `.env` that is accessed dynamically during the installation step.
```console
```bash
# Create a copy of the "sample.env" and name it ".env".
# Populate it with the necessary API keys and secrets
```
```console
```bash
cp sample.env .env
```
@@ -220,7 +220,7 @@ The keys in the `.env` file are _not_ required to be changed to run the app loca
This step will install the dependencies required for the application to run:
```console
```bash
pnpm install && pnpm run create:shared
```
@@ -234,7 +234,7 @@ Before you can run the application locally, you will need to start the MongoDB s
Start the MongoDB server in a separate terminal:
```console
```bash
mongod
```
@@ -242,15 +242,14 @@ mongod
Next, let's seed the database. In this step, we run the below command that fills the MongoDB server with some initial data sets that are required by services. These include a few schemas, among other things.
```console
```bash
pnpm run seed
```
By default, you will be signed in as a new user without any completed certifications. Run the following commands if you need to develop with completed certifications:
```console
```bash
pnpm run seed:certified-user
pnpm run seed:exams
```
> [!WARNING] Running `pnpm run seed:certified-user` will log you out. You will have to clear your browser cookies and sign in again.
@@ -259,7 +258,7 @@ pnpm run seed:exams
You can now start up the API server and the client applications.
```console
```bash
pnpm run develop
```
@@ -279,11 +278,12 @@ If you have issues while installing it, check out the [troubleshooting section](
A quick reference to the commands that you will need when working locally.
| command | description |
| ------------------------------ | ------------------------------------------------------------------------------------------------- |
| `pnpm install` | Installs / re-installs all dependencies and bootstraps the different services. |
| `pnpm run seed` | Creates authorized test users and inserts them into MongoDB. |
| `pnpm run seed:certified-user` | Creates authorized test users with certifications fully completed, and inserts them into MongoDB. |
| `pnpm run seed:exams` | Creates exams and inserts them into MongoDB. |
| `pnpm run develop` | Starts the freeCodeCamp API Server and Client Applications. |
| `pnpm run clean` | Uninstalls all dependencies and cleans up caches. |
| command | description |
| ------------------------------ | ------------------------------------------------------------------------------------------------------------- |
| `pnpm install` | Installs / re-installs all dependencies and bootstraps the different services. |
| `pnpm run seed` | Creates authorized test users and inserts them into MongoDB. Also runs `seed:exams` and `seed:surveys` below. |
| `pnpm run seed:certified-user` | Creates authorized test users with certifications fully completed, and inserts them into MongoDB. |
| `pnpm run seed:exams` | Creates exams and inserts them into MongoDB. |
| `pnpm run seed:surveys` | Creates surveys for defaults users and inserts them into MongoDB. |
| `pnpm run develop` | Starts the freeCodeCamp API Server and Client Applications. |
| `pnpm run clean` | Uninstalls all dependencies and cleans up caches. |

View File

@@ -17,7 +17,7 @@ Start by installing the prerequisite software for your operating system.
If Flutter is already installed on your machine, run the following commands to validate the versions:
```console
```bash
flutter --version
dart --version
```
@@ -70,7 +70,7 @@ Run these commands on your local machine:
2. Clone your fork of freeCodeCamp, replacing `YOUR_USER_NAME` with your GitHub Username
```console
```bash
git clone --depth=1 https://github.com/YOUR_USER_NAME/mobile.git
```
@@ -88,25 +88,25 @@ You need a reference from your local clone to the `upstream` repository in addit
1. Change directory to the new `mobile` directory:
```console
```bash
cd mobile
```
2. Add a remote reference to the main freeCodeCamp mobile repository:
```console
```bash
git remote add upstream https://github.com/freeCodeCamp/mobile.git
```
3. Ensure the configuration looks correct:
```console
```bash
git remote -v
```
The output should look something like below (replacing `YOUR_USER_NAME` with your GitHub username):
```console
```bash
origin https://github.com/YOUR_USER_NAME/mobile.git (fetch)
origin https://github.com/YOUR_USER_NAME/mobile.git (push)
upstream https://github.com/freeCodeCamp/mobile.git (fetch)
@@ -129,20 +129,20 @@ And as always, feel free to ask questions on the ['Contributors' category on our
The default API keys and environment variables are stored in the file `sample.env`. This file needs to be copied to a new file named `.env` which is accessed dynamically during the installation step. Remember to change the directory to `mobile-app` before running the following commands.
```console
```bash
# Create a copy of the "sample.env" and name it ".env".
# Populate it with the necessary API keys and secrets:
```
#### **macOS/Linux**
```console
```bash
cp sample.env .env
```
#### **Windows**
```console
```bash
copy sample.env .env
```
@@ -152,7 +152,7 @@ The keys in the `.env` file are _not_ required to be changed to run the app loca
This step will install the dependencies required for the application to run:
```console
```bash
flutter pub get
```
@@ -162,7 +162,7 @@ Start the emulator of your choice(Android or iOS) and wait for the bootup proces
You can now start the app by running the following command:
```console
```bash
flutter run
```
@@ -176,13 +176,13 @@ Follow these steps:
1. Validate that you are on the `main` branch:
```console
```bash
git status
```
You should get an output like this:
```console
```bash
On branch main
Your branch is up-to-date with 'origin/main'.
@@ -191,7 +191,7 @@ Follow these steps:
If you are not on main or your working directory is not clean, resolve any outstanding files/commits and checkout `main`:
```console
```bash
git checkout main
```
@@ -205,25 +205,25 @@ Follow these steps:
Update your local copy of the freeCodeCamp mobile upstream repository:
```console
```bash
git fetch upstream
```
Hard reset your main branch with the freeCodeCamp mobile main:
```console
```bash
git reset --hard upstream/main
```
Push your main branch to your origin to have a clean history on your fork on GitHub:
```console
```bash
git push origin main --force
```
You can validate that your current main matches the upstream/main by performing a diff:
```console
```bash
git diff upstream/main
```
@@ -235,7 +235,7 @@ Follow these steps:
Check that you are on `main` as explained previously, and branch off from there:
```console
```bash
git checkout -b fix/update-guide-for-xyz
```
@@ -259,13 +259,13 @@ Follow these steps:
7. Check and confirm the files you are updating:
```console
```bash
git status
```
This should show a list of `unstaged` files that you have edited.
```console
```bash
On branch feat/documentation
Your branch is up to date with 'upstream/feat/documentation'.
@@ -282,25 +282,25 @@ Follow these steps:
In this step, you should only mark files that you have edited or added yourself. You can perform a reset and resolve files that you did not intend to change if needed.
```console
```bash
git add path/to/my/changed/file.ext
```
Or you can add all the `unstaged` files to the staging area:
```console
```bash
git add .
```
Only the files that were moved to the staging area will be added when you make a commit.
```console
```bash
git status
```
Output:
```console
```bash
On branch feat/documentation
Your branch is up to date with 'upstream/feat/documentation'.
@@ -313,7 +313,7 @@ Follow these steps:
Now, you can commit your changes with a short message like so:
```console
```bash
git commit -m "fix: my short commit message"
```
@@ -345,7 +345,7 @@ Follow these steps:
9. If you realize that you need to edit a file or update the commit message after making a commit you can do so after editing the files with:
```console
```bash
git commit --amend
```
@@ -353,7 +353,7 @@ Follow these steps:
10. Next, you can push your changes to your fork:
```console
```bash
git push origin branch/name-here
```
@@ -363,14 +363,14 @@ Follow these steps:
1. Clone a copy of the [freeCodeCamp repo](https://github.com/freeCodeCamp/freeCodeCamp) locally outside of your local copy of the freeCodeCamp mobile repo. Your folder structure should look like this:
```console
```bash
├── freeCodeCamp
├── mobile
```
2. Change the directory to the freeCodeCamp repo:
```console
```bash
cd freeCodeCamp
```
@@ -378,25 +378,25 @@ Follow these steps:
#### **macOS/Linux**
```console
```bash
cp sample.env .env
```
#### **Windows**
```console
```bash
copy sample.env .env
```
4. Install the dependencies for the freeCodeCamp repo:
```console
```bash
pnpm install && pnpm run create:shared
```
5. Generate the challenge data JSON file:
```console
```bash
pnpm run build:curriculum
```
@@ -404,54 +404,54 @@ Follow these steps:
#### **macOS/Linux**
```console
```bash
cp ./shared/config/curriculum.json ../mobile/mobile-app/curriculum.json
```
#### **Windows**
```console
```bash
copy .\shared\config\curriculum.json ..\mobile\mobile-app\curriculum.json
```
7. Change directory to the mobile app:
```console
```bash
cd ../mobile/mobile-app
```
8. Install the dependencies for the mobile app:
```console
```bash
flutter pub get
```
9. Update the test file to use the challenge data JSON file:
```console
```bash
sed -i '' 's/..\/..\/shared\/config\/curriculum.json/.\/curriculum.json/g' test/widget_test.dart
```
10. Generate the challenge files:
```console
```bash
flutter test test/widget_test.dart
```
11. Start a local server to serve the challenge files with the help of `serve` package:
```console
```bash
npx serve
```
12. In a different terminal go back to the freeCodeCamp repo:
```console
```bash
cd ../../freeCodeCamp
```
13. Run the cypress tests:
```console
```bash
pnpm cypress run --config retries=1,screenshotOnRunFailure=false,video=false,baseUrl=http://localhost:3000/generated-tests/,specPattern=cypress/e2e/mobile-learn/test-challenges.js -s cypress/e2e/mobile-learn/test-challenges.js -b chrome
```
@@ -482,7 +482,7 @@ If you are on a different OS and/or are still running into issues, see [getting
If you face issues with the UI, or build errors a cleanup can be useful:
```console
```bash
flutter clean
```

View File

@@ -10,7 +10,7 @@ This guide covers some common steps with the setup of WSL2. Once some of the com
## Enable WSL
Follow the instructions on the [official documentation](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to install WSL1 and followed by upgrading to WSL2.
Follow the instructions on the [official documentation](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to install WSL2.
## Install Ubuntu
@@ -20,9 +20,11 @@ Follow the instructions on the [official documentation](https://docs.microsoft.c
>
> While you may use other non-Debian-based distributions, they all come with their own 'gotchas' that are beyond the scope of this guide.
As of November 2023, Ubuntu and Debian are the only Linux distributions [officially supported by Playwright](https://playwright.dev/docs/intro#system-requirements), the end-to-end testing library used by freeCodeCamp.
2. Update the dependencies for the OS
```console
```bash
sudo apt update
sudo apt upgrade -y
@@ -70,23 +72,23 @@ This makes it so that the containers run on the WSL side instead of running on W
Once you have configured Docker Desktop to work with WSL2, follow these steps to start a MongoDB service:
1. Launch a new Ubuntu-18.04 terminal
1. Launch a new Ubuntu terminal
2. Pull `MongoDB 4.0.x` from Docker Hub
2. Pull MongoDB from Docker Hub. Please refer to the [Prerequisites](how-to-setup-freecodecamp-locally.md#Prerequisites) table for the current version of MongoDB used by freeCodeCamp. For example, if the version number is `5.0.x`, replace `<x.y>` with `5.0` in the following two code snippets.
```console
docker pull mongo:4.0
```bash
docker pull mongo:<x.y>
```
3. Start the MongoDB service at port `27017`, and configure it to run automatically on system restarts
```console
```bash
docker run -it \
-v mongodata:/data/db \
-p 27017:27017 \
--name mongodb \
--restart unless-stopped \
-d mongo:4.0
-d mongo:<x.y>
```
4. You can now access the service from both Windows or Ubuntu at `mongodb://localhost:27017`.
@@ -95,25 +97,17 @@ Once you have configured Docker Desktop to work with WSL2, follow these steps to
We recommend you install the LTS release for Node.js with a node version manager - [nvm](https://github.com/nvm-sh/nvm#installing-and-updating).
Once installed use these commands to install and use the Node.js version as needed
Once installed use this command to install and use the latest Node.js LTS version:
```console
```bash
nvm install --lts
# OR
# nvm install <version>
nvm install 14
# Usage
# nvm use <version>
nvm use 12
```
For instructions on installing and using a different version of Node.js, please refer to the [nvm docs](https://github.com/nvm-sh/nvm#usage).
Node.js comes bundled with `npm`, which you can use to install `pnpm`:
```console
```bash
npm install -g pnpm
```
@@ -125,6 +119,103 @@ Now that you have installed the pre-requisites, follow [our local setup guide](h
>
> Please note, at this time the setup for Cypress tests (and related GUI needs) is a work in progress. You should still be able to work on most of the codebase.
## Optimize Windows and WSL
> [!NOTE]
>
> The following tips were collected from across the web and have not gone through vigorous testing. Your mileage may vary.
### Adjust processer scheduling for background services
This may reduce incidents of Docker containers crashing due to lack of resources.
Open the System Properties control panel by pressing <kbd>Win + R</kbd> and entering `sysdm.cpl`
<details>
<summary>
Enter <code>sysdm.cpl</code> in the Run dialog (screenshot)
</summary>
<br>
<img src="https://raw.githubusercontent.com/freeCodeCamp/freeCodeCamp/main/docs/images/wsl/run-sysdm.png" alt="Enter `sysdm.cpl` in the Run dialog" />
</details>
<br>
Go to Advanced -> Performance -> Settings…
<details>
<summary>
Performance Settings button under Advanced tab in System Properties (screenshot)
</summary>
<br>
<img src="https://raw.githubusercontent.com/freeCodeCamp/freeCodeCamp/main/docs/images/wsl/advanced-performance-settings.png" alt="Performance Settings button under Advanced tab in System Properties" />
</details>
<br>
Under Advanced -> Processor scheduling, choose "Background services". Do not close the window. Continue to the next tip.
<details>
<summary>
Background services radio button under Advanced tab in Performance Options (screenshot)
</summary>
<br>
<img src="https://raw.githubusercontent.com/freeCodeCamp/freeCodeCamp/main/docs/images/wsl/background-services.png" alt="Background services radio button under Advanced tab in Performance Options" />
</details>
### Increase the size of Windows paging file for the system drive
Under Advanced -> Virtual memory, click "Change…"
<details>
<summary>
Change virtual memory button under Advanced tab in Performance Options (screenshot)
</summary>
<br>
<img src="https://raw.githubusercontent.com/freeCodeCamp/freeCodeCamp/main/docs/images/wsl/advanced-virtual-memory.png" alt="Change virtual memory button under Advanced tab in Performance Options" />
</details>
<br>
Choose "Custom size". Set the initial size to 1.5x and the maximum size to 3x of your physical memory. Then click "Set".
<details>
<summary>
Set custom size button in Virtual Memory window (screenshot)
</summary>
<br>
<img src="https://raw.githubusercontent.com/freeCodeCamp/freeCodeCamp/main/docs/images/wsl/set-custom-size.png" alt="Set custom size button in Virtual Memory window" />
</details>
### Increase the size of memory allocated to WSL
Create a [`.wslconfig` file](https://learn.microsoft.com/en-us/windows/wsl/wsl-config#configuration-setting-for-wslconfig) in your [`%UserProfile%` directory](https://learn.microsoft.com/en-us/windows/wsl/wsl-config#wslconfig) (typically `C:\Users\<UserName>\.wslconfig`). Please read the [WSL documentation](https://learn.microsoft.com/en-us/windows/wsl/wsl-config#configuration-setting-for-wslconfig) carefully and replace `x` with values that suit your own needs:
```ini
# Settings apply across all Linux distros running on WSL 2
[wsl2]
# How much memory to assign to the WSL 2 VM. The default value might not be enough
memory=xGB
# How much swap space to add to the WSL 2 VM, default is 25% of available RAM
swap=xGB
```
### Increase Node.js max old space size
This fixes the ["JavaScript heap out of memory" error](https://stackoverflow.com/a/54456814) with ESLint. Add the following to your `~/.bashrc` or `~/.zshrc`:
```sh
export NODE_OPTIONS="--max-old-space-size=4096"
```
### Avoid `pnpm run test`
Instead, use the script [appropriate to your PR](https://forum.freecodecamp.org/t/wsl-performance-issues-while-working-on-the-codebase/644215/2#:~:text=usually%2C%20you%20just%20want%20to%20test%20something%20specific%20to%20either%20the%20curriculum%20or%20the%20client%20or%20the%20api%20-%20almost%20never%20all%203.); either `pnpm run test:api`, `pnpm run test:curriculum`, or `pnpm run test-client`.
## Useful Links
- [A WSL2 Dev Setup with Ubuntu 20.04, Node.js, MongoDB, VS Code, and Docker](https://hn.mrugesh.dev/wsl2-dev-setup-with-ubuntu-nodejs-mongodb-and-docker) - an article by Mrugesh Mohapatra (Staff Developer at freeCodeCamp.org)

View File

@@ -232,6 +232,8 @@ Sentences should be clear and concise with minimal jargon. If used, jargon shoul
Keep paragraphs short (around 1-4 sentences). People are more likely to read several short paragraphs than a wall of text.
Use american english, e.g., use `labeled` instead of `labelled`.
Challenge text should use the second person ("you") to help to give it a conversational tone. This way the text and instructions seem to speak directly to the camper working through the challenge. Try to avoid using the first person ("I", "we", "let's", and "us").
Don't use outbound links. These interrupt the flow. Campers should never have to google anything during these challenges. If there are resources you think campers would benefit from, add them to the challenge's Guide-related article.
@@ -306,7 +308,7 @@ Challenges should have the minimum number of tests necessary to verify that a ca
Our goal is to communicate the single point that the challenge is trying to teach, and test that they have understood that point.
Challenge tests can make use of the Node.js and Chai.js assertion libraries. Also, if needed, user-generated code can be accessed in the `code` variable. In addition, the `__helpers` object exposes several functions that simplify the process of writing tests. The available functions are defined in _client/src/utils/curriculum-helpers.ts_.
Challenge tests can make use of the Node.js and Chai.js assertion libraries. Also, if needed, user-generated code can be accessed in the `code` variable. In addition, the `__helpers` object exposes several functions that simplify the process of writing tests. The available functions are defined in the [curriculum-helpers](https://github.com/freeCodeCamp/curriculum-helpers/blob/main/lib/index.ts) repo.
## Formatting Seed Code

View File

@@ -16,7 +16,7 @@ Let's understand how the i18n frameworks and tooling work.
Most of the files for translating the platform are located in the [`client/i18n`](https://github.com/freeCodeCamp/freeCodeCamp/tree/main/client/i18n) folder. Each language has a directory that contains JSON files with the translations.
```console
```bash
config
└── i18n.ts
...

View File

@@ -47,7 +47,7 @@ Typically you would not need to change any configuration or build the site local
Install freeCodeCamp locally ([see the local setup guide](how-to-setup-freecodecamp-locally)), we bundled the CLI with the development tools so you can run the command below as needed from the root of the repo:
```console
```bash
pnpm run docs:serve
```

View File

@@ -16,7 +16,7 @@ If you are on a different OS or are still facing issues, see [getting help](#get
When you build the client, Gatsby will cache the Fonts, language strings, and UI. If one of them isn't cached, run the following:
```console
```bash
pnpm run clean
pnpm install
pnpm run seed
@@ -53,7 +53,7 @@ git clean -ifdX
If you can't sign in, and instead you see a banner with an error message saying that the error will be reported to freeCodeCamp, please double-check that your local port `3000` is not in use by a different program.
#### **From Terminal:**
```console
```bash
netstat -a | grep "3000"
tcp4 0 0 0.0.0.0:3000 DESKTOP LISTEN

View File

@@ -303,19 +303,19 @@ Debes mantener las máquinas virtuales actualizadas mediante la realización de
Actualizar la información de paquetes
```console
```bash
sudo apt update
```
Actualizar los paquetes instalados
```console
```bash
sudo apt upgrade -y
```
Limpieza de paquetes no utilizados
```console
```bash
sudo apt autoremove -y
```
@@ -331,7 +331,7 @@ Aprovisionamiento de máquinas virtuales con el código
1. Instala NGINX y configúralo desde el repositorio.
```console
```bash
sudo su
cd /var/www/html
@@ -352,7 +352,7 @@ Aprovisionamiento de máquinas virtuales con el código
Mueve los certificados existentes:
```console
```bash
# En Local
scp -r username@source-server-public-ip:/etc/nginx/ssl ./
scp -pr ./ssl username@target-server-public-ip:/tmp/
@@ -364,7 +364,7 @@ Aprovisionamiento de máquinas virtuales con el código
Actualiza las configuraciones upstream:
```console
```bash
vi configs/upstreams.conf
```
@@ -382,7 +382,7 @@ Aprovisionamiento de máquinas virtuales con el código
1. Compruebe el estado del servicio NGINX utilizando el siguiente comando:
```console
```bash
sudo systemctl status nginx
```
@@ -396,13 +396,13 @@ Los cambios en la configuración de nuestras instancias NGINX son mantenidos en
1. SSH en la instancia y entra en modo sudo
```console
```bash
sudo su
```
2. Obtén el código de configuración más reciente.
```console
```bash
cd /etc/nginx
git fetch --all --prune
git reset --hard origin/main
@@ -410,7 +410,7 @@ git reset --hard origin/main
3. Prueba y recarga la configuración [con Signals](https://docs.nginx.com/nginx/admin-guide/basic-functionality/runtime-control/#controlling-nginx).
```console
```bash
nginx -t
nginx -s reload
```
@@ -419,7 +419,7 @@ nginx -s reload
1. Instala las herramientas de compilación para archivos binarios de Node (`node-gyp`) etc.
```console
```bash
sudo apt install build-essential
```
@@ -431,19 +431,19 @@ Aprovisionamiento de MVs con el código
2. Install pnpm globally.
```console
```bash
npm install -g pnpm
```
3. Install pm2 globally.
```console
```bash
npm install -g pm2
```
4. Clone freeCodeCamp, set up env, and keys.
```console
```bash
git clone https://github.com/freeCodeCamp/freeCodeCamp.git
cd freeCodeCamp
git checkout prod-current # or any other branch to be deployed
@@ -453,36 +453,36 @@ git checkout prod-current # or any other branch to be deployed
6. Install dependencies
```console
```bash
pnpm install
```
7. Setup pm2 `logrotate` and startup on boot
```console
```bash
pm2 install pm2-logrotate
pm2 startup
```
8. Build the server
```console
```bash
pnpm prebuild && pnpm build:curriculum && pnpm build:server
```
9. Start Instances
```console
```bash
pnpm start:server
```
### Registro de eventos y monitoreo
```console
```bash
pm2 logs
```
```console
```bash
pm2 monit
```
@@ -496,31 +496,31 @@ Los cambios en el código deben desplegarse en las instancias de la API cada tan
1. Stop all instances
```console
```bash
pm2 stop all
```
2. Install dependencies
```console
```bash
pnpm install
```
3. Build the server
```console
```bash
pnpm prebuild && pnpm build:curriculum && pnpm build:server
```
4. Start Instances
```console
```bash
pnpm start:server && pm2 logs
```
#### 2. Rolling updates - Used for logical changes to code.
```console
```bash
pnpm reload:server && pm2 logs
```
@@ -532,7 +532,7 @@ pnpm reload:server && pm2 logs
2. Update pm2 to use the new version
```console
```bash
pm2 update
```
@@ -540,7 +540,7 @@ pm2 update
1. Install build tools for node binaries (`node-gyp`) etc.
```console
```bash
sudo apt install build-essential
```
@@ -552,7 +552,7 @@ Aprovisionamiento de MVs con el código
2. Update `npm` and install PM2 and setup `logrotate` and startup on boot
```console
```bash
npm i -g npm@8
npm i -g pm2@4
npm install -g serve@13
@@ -562,7 +562,7 @@ Aprovisionamiento de MVs con el código
3. Clone client config, setup env and keys.
```console
```bash
git clone https://github.com/freeCodeCamp/client-config.git client
cd client
```
@@ -571,7 +571,7 @@ Aprovisionamiento de MVs con el código
> Todo: This setup needs to move to S3 or Azure Blob storage
>
> ```console
> ```bash
> echo "serve -c ../serve.json -p 50505 www" > client-start-primary.sh
> chmod +x client-start-primary.sh
> pm2 delete client-primary
@@ -584,11 +584,11 @@ Aprovisionamiento de MVs con el código
### Registro de eventos y monitoreo
```console
```bash
pm2 logs
```
```console
```bash
pm2 monit
```
@@ -602,7 +602,7 @@ Los cambios en el código deben desplegarse en las instancias del API cada ciert
1. Stop all instances
```console
```bash
pm2 stop all
```
@@ -610,13 +610,13 @@ Los cambios en el código deben desplegarse en las instancias del API cada ciert
3. Start Instances
```console
```bash
pm2 start all --update-env && pm2 logs
```
#### 2. Actualizaciones continuas: Utilizadas para cambios lógicos en el código.
```console
```bash
pm2 reload all --update-env && pm2 logs
```
@@ -636,7 +636,7 @@ Aprovisionamiento de MVs con el código
1. Install NGINX and configure from repository.
```console
```bash
sudo su
cd /var/www/html
@@ -657,7 +657,7 @@ Aprovisionamiento de MVs con el código
Move over existing certificates:
```console
```bash
# Local
scp -r username@source-server-public-ip:/etc/nginx/ssl ./
scp -pr ./ssl username@target-server-public-ip:/tmp/
@@ -669,7 +669,7 @@ Aprovisionamiento de MVs con el código
Update Upstream Configurations:
```console
```bash
vi configs/upstreams.conf
```
@@ -687,7 +687,7 @@ Aprovisionamiento de MVs con el código
1. Install Docker and configure from the repository
```console
```bash
git clone https://github.com/freeCodeCamp/chat-config.git chat
cd chat
```
@@ -696,7 +696,7 @@ Aprovisionamiento de MVs con el código
3. Run rocket-chat server
```console
```bash
docker-compose config
docker-compose up -d
```
@@ -705,13 +705,13 @@ Aprovisionamiento de MVs con el código
1. Check status for NGINX service using the below command:
```console
```bash
sudo systemctl status nginx
```
2. Check status for running docker instances with:
```console
```bash
docker ps
```
@@ -723,13 +723,13 @@ Los cambios de configuración a nuestras instancias NGINX se mantienen en GitHub
1. SSH into the instance and enter sudo
```console
```bash
sudo su
```
2. Get the latest config code.
```console
```bash
cd /etc/nginx
git fetch --all --prune
git reset --hard origin/main
@@ -737,7 +737,7 @@ Los cambios de configuración a nuestras instancias NGINX se mantienen en GitHub
3. Test and reload the config [with Signals](https://docs.nginx.com/nginx/admin-guide/basic-functionality/runtime-control/#controlling-nginx).
```console
```bash
nginx -t
nginx -s reload
```
@@ -746,44 +746,44 @@ Los cambios de configuración a nuestras instancias NGINX se mantienen en GitHub
1. SSH into the instance and navigate to the chat config path
```console
```bash
cd ~/chat
```
2. Get the latest config code.
```console
```bash
git fetch --all --prune
git reset --hard origin/main
```
3. Pull down the latest docker image for Rocket.Chat
```console
```bash
docker-compose pull
```
4. Update the running instances
```console
```bash
docker-compose up -d
```
5. Validate the instances are up
```console
```bash
docker ps
```
6. Cleanup extraneous resources
```console
```bash
docker system prune --volumes
```
Output:
```console
```bash
WARNING! This will remove:
- all stopped containers
- all networks not used by at least one container
@@ -802,7 +802,7 @@ Los cambios de configuración a nuestras instancias NGINX se mantienen en GitHub
ssh en la máquina virtual (alojada en Digital Ocean).
```console
```bash
cd tools
git pull origin master
pnpm install
@@ -814,7 +814,7 @@ pm2 restart contribute-app
Lista las versiones instaladas de node y npm
```console
```bash
nvm -v
node -v
npm -v
@@ -824,25 +824,25 @@ nvm ls
Instala el último Node.js LTS y reinstala cualquier paquete global
```console
```bash
nvm install --lts --reinstall-packages-from=default
```
Verifica los paquetes instalados
```console
```bash
npm ls -g --depth=0
```
Alias the `default` Node.js version to the current LTS (pinned to the latest major version)
```console
```bash
nvm alias default 16
```
(Opcional) Desinstalar versiones antiguas
```console
```bash
nvm uninstall <version>
```
@@ -852,31 +852,31 @@ nvm uninstall <version>
Obtén las instrucciones/comandos de desinstalación con el comando `unstartup` y usa la salida para eliminar los servicios de systemctl
```console
```bash
pm2 unstartup
```
Obtén las instrucciones/comandos de instalación con el comando `startup` y usa la salida para agregar los servicios de systemctl
```console
```bash
pm2 startup
```
Comandos rápidos para que PM2 enumere, reviva procesos guardados, etc.
```console
```bash
pm2 ls
```
```console
```bash
pm2 resurrect
```
```console
```bash
pm2 save
```
```console
```bash
pm2 logs
```
@@ -898,32 +898,32 @@ Actualmente actualizar los agentes requiere que sean eliminados y reconfigurados
1. Navigate and check status of the service
```console
```bash
cd ~/azagent
sudo ./svc.sh status
```
2. Stop the service
```console
```bash
sudo ./svc.sh stop
```
3. Uninstall the service
```console
```bash
sudo ./svc.sh uninstall
```
4. Remove the agent from the pipeline pool
```console
```bash
./config.sh remove
```
5. Remove the config files
```console
```bash
cd ~
rm -rf ~/azagent
```
@@ -938,7 +938,7 @@ Utilizamos [una herramienta CLI](https://github.com/freecodecamp/sendgrid-email-
2. Set up the script to fetch the email list.
```console
```bash
cd /home/freecodecamp/scripts/emails
cp sample.env .env
```
@@ -947,7 +947,7 @@ Utilizamos [una herramienta CLI](https://github.com/freecodecamp/sendgrid-email-
3. Run the script.
```console
```bash
node get-emails.js emails.csv
```

View File

@@ -26,25 +26,25 @@ Para ejecutar pruebas en las compilaciones de producción, reemplaza `dev` con `
- Para ejecutar todas las pruebas en el directorio `./cypress`:
```console
```bash
pnpm run cypress:dev:run
```
- Para ejecutar una sola prueba:
```console
```bash
pnpm run cypress run --spec=cypress/<path_to_test_file>
```
For example:
```console
```bash
pnpm run cypress run --spec=cypress/e2e/default/landing.ts
```
- Para crear una compilación de desarrollo, inicia el servidor de desarrollo y ejecuta todas las pruebas de cypress existentes de extremo a extremo:
```console
```bash
pnpm run e2e:dev:run
```
@@ -57,25 +57,25 @@ If starting the Gitpod environment did not automatically develop the environment
- Follow the [MongoDB installation guide](https://www.mongodb.com/basics/get-started).
- Create a config file.
```console
```bash
pnpm run create:shared
```
- Propaga la base de datos
```console
```bash
pnpm run seed
```
- Inicia el servidor de desarrollo y cliente
```console
```bash
pnpm run develop
```
### 2. Instala las herramientas de compilación de Cypress
```console
```bash
pnpm run cypress:install-build-tools
```

View File

@@ -4,7 +4,7 @@
To install Playwright run:
```console
```bash
pnpm run playwright:install-build-tools
```
@@ -181,49 +181,49 @@ To run tests with Playwright check the following below
- Make sure you navigate to the e2e repo first
```console
```bash
cd e2e
```
- To run tests in UI helper mode:
```console
```bash
npx playwright test --ui
```
- To run a single test:
```console
```bash
npx playwright test <filename>
```
For example:
```console
```bash
npx playwright test landing-page.spec.ts
```
- Run a set of test files in respective folders:
```console
```bash
npx playwright test <pathToFolder1> <pathToFolder2>
```
For example:
```console
```bash
npx playwright test tests/todo-page/ tests/landing-page/
```
- Run the test with the title:
```console
```bash
npx playwright test -g <title>
```
For example:
```console
```bash
npx playwright test -g "add a todo item"
```
@@ -233,13 +233,13 @@ Since Playwright runs in Node.js, you can debug it with your debugger of choice
- Debugging all tests:
```console
```bash
npx playwright test --debug
```
- Debugging one test file:
```console
```bash
npx playwright test example.spec.ts --debug
```
@@ -247,7 +247,7 @@ Since Playwright runs in Node.js, you can debug it with your debugger of choice
The HTML Reporter shows you a full report of your tests allowing you to filter the report by browsers, passed tests, failed tests, skipped tests and flaky tests.
```console
```bash
npx playwright show-report
```
@@ -257,13 +257,13 @@ Playwright is generally a solid bullet-proof tool. The contributor has already c
- (MacOs and Linux) If running Playwright results in an error due to kernel dependencies, run the following command:
```console
```bash
pnpm run playwright:install-build-tools-linux
```
- A common error seen in playwright is as follows:
```console
```bash
Error: page.goto: Could not connect: Connection refused
=========================== logs ===========================
navigating to "https://127.0.0.1:8000/", waiting until "load"
@@ -284,7 +284,7 @@ Playwright is generally a solid bullet-proof tool. The contributor has already c
- Another common error seen in playwright is as follows:
```console
```bash
Protocol error (Network.getResponseBody): Request content was evicted from inspector cache
```
@@ -305,25 +305,25 @@ If starting the Gitpod environment did not automatically develop the environment
- Create the .env
```console
```bash
cp sample.env .env
```
- Create a config file.
```console
```bash
pnpm run create:shared
```
- Seed the database
```console
```bash
pnpm run seed
```
- Develop the server and client
```console
```bash
pnpm run develop
```
@@ -331,7 +331,7 @@ If starting the Gitpod environment did not automatically develop the environment
To install necessary dependencies for running Playwright run the following command:
```console
```bash
pnpm run playwright:install-build-tools
```
@@ -339,6 +339,6 @@ pnpm run playwright:install-build-tools
To run all Playwright tests, run the following command:
```console
```bash
npx playwright test
```

View File

@@ -10,13 +10,13 @@ Sigue estos pasos:
1. 1. Utiliza el siguiente comando para confirmar que estes en la rama `main`:
```console
```bash
git status
```
el comando debería devolverte el siguiente resultado:
```console
```bash
On branch main
Your branch is up-to-date with 'origin/main'.
@@ -25,7 +25,7 @@ Sigue estos pasos:
If you got a different message, then you aren't on main or your working directory isn't clean, resolve any outstanding files/commits and checkout `main`:
```console
```bash
git checkout main
```
@@ -39,25 +39,25 @@ Sigue estos pasos:
Actualizar tu copia del repositorio principal de freeCodeCamp:
```console
```bash
git fetch upstream
```
Formatea tu rama main con la rama main de freeCodeCamp:
```console
```bash
git reset --hard upstream/main
```
Hace push de tu rama main a tu bifurcación original para limpiar tu historial en GitHub:
```console
```bash
git push origin main --force
```
You can validate that your current main matches the upstream/main by performing a diff:
```console
```bash
git diff upstream/main
```
@@ -69,7 +69,7 @@ Sigue estos pasos:
Verificá que estás en `main` siguiendo los pasos ya explicados y empezá desde ahí:
```console
```bash
git checkout -b fix/update-guide-for-xyz
```
@@ -93,13 +93,13 @@ Sigue estos pasos:
7. Comprobá y confirmá los archivos que estás actualizando:
```console
```bash
git status
```
Este comando debería mostrar una lista de los archivos `unstaged` que editaste.
```console
```bash
On branch feat/documentation
Your branch is up to date with 'upstream/feat/documentation'.
@@ -118,25 +118,25 @@ Sigue estos pasos:
En este paso, sólo deberías marcar los archivos que has editado o añadido tu mismo. Puede realizar un reseteo y resolver archivos que no tenías intención de cambiar si es necesario.
```console
```bash
git add path/to/my/changed/file.ext
```
O puedes añadir todos los archivos que no estén `unstaged` al área de staging:
```console
```bash
git add .
```
Sólo los archivos que fueron movidos al área de staging serán añadidos cuando hagas un commit.
```console
```bash
git status
```
Resultado:
```console
```bash
On branch feat/documentation
Your branch is up to date with 'upstream/feat/documentation'.
@@ -151,7 +151,7 @@ Sigue estos pasos:
Ahora, puedes confirmar tus cambios con un mensaje corto así:
```console
```bash
git commit -m "fix: my short commit message"
```
@@ -181,7 +181,7 @@ Sigue estos pasos:
9. Si te das cuenta de que necesitas editar un archivo o actualizar el mensaje de confirmación después de hacer un commit puedes hacerlo después de editar los archivos con:
```console
```bash
git commit --amend
```
@@ -189,7 +189,7 @@ Sigue estos pasos:
10. A continuación, puedes enviar tus cambios a tu bifurcación:
```console
```bash
git push origin branch/name-here
```

View File

@@ -115,14 +115,14 @@ When you are working on regular bugs and features on our development branch `mai
1. Rebase your local copy:
```console
```bash
git checkout <pr-branch>
git pull --rebase upstream main
```
2. Resolve any conflicts and add / edit commits
```console
```bash
# Either
git add .
git commit -m "chore: resolve conflicts"
@@ -134,7 +134,7 @@ When you are working on regular bugs and features on our development branch `mai
3. Push back your changes to the PR
```console
```bash
git push --force origin <pr-branch>
```
@@ -144,7 +144,7 @@ When you are working on features for our upcoming curriculum `next-*` branches,
1. Make sure your upstream comes in sync with your local:
```console
```bash
git checkout main
git fetch --all --prune
git checkout next-python-projects
@@ -155,7 +155,7 @@ When you are working on features for our upcoming curriculum `next-*` branches,
a. Either delete your local branch after taking a backup (if you still have it locally):
```console
```bash
git checkout <pr-branch-name>
# example:
@@ -171,7 +171,7 @@ When you are working on features for our upcoming curriculum `next-*` branches,
b. Or just a backup of your PR branch (if you do not have it locally):
```console
```bash
git checkout -b <backup-branch-name> origin/<pr-branch-name>
# example:
@@ -180,14 +180,14 @@ When you are working on features for our upcoming curriculum `next-*` branches,
3. Start off with a clean slate:
```console
```bash
git checkout -b <pr-branch-name> next-python-projects
git cherry-pick <commit-hash>
```
4. Resolve any conflicts, cleanup, and install dependencies and run tests
```console
```bash
pnpm run clean
pnpm install
@@ -201,6 +201,6 @@ When you are working on features for our upcoming curriculum `next-*` branches,
5. If everything looks good, push back to the PR
```console
```bash
git push --force origin <pr-branch-name>
```

View File

@@ -75,7 +75,7 @@ We primarily support development on Linux and Unix-based systems like Ubuntu and
If Node.js is already installed on your machine, run the following commands to validate the versions:
```console
```bash
node -v
pnpm -v
```
@@ -142,7 +142,7 @@ Run these commands on your local machine:
2. Clone your fork of freeCodeCamp, replacing `YOUR_USER_NAME` with your GitHub Username
```console
```bash
git clone --depth=1 https://github.com/YOUR_USER_NAME/freeCodeCamp.git
```
@@ -160,25 +160,25 @@ You need a reference from your local clone to the `upstream` repository in addit
1. Change the directory to the new freeCodeCamp directory:
```console
```bash
cd freeCodeCamp
```
2. Add a remote reference to the main freeCodeCamp repository:
```console
```bash
git remote add upstream https://github.com/freeCodeCamp/freeCodeCamp.git
```
3. Ensure the configuration looks correct:
```console
```bash
git remote -v
```
The output should look something like below (replacing `YOUR_USER_NAME` with your GitHub username):
```console
```bash
origin https://github.com/YOUR_USER_NAME/freeCodeCamp.git (fetch)
origin https://github.com/YOUR_USER_NAME/freeCodeCamp.git (push)
upstream https://github.com/freeCodeCamp/freeCodeCamp.git (fetch)
@@ -203,12 +203,12 @@ And as always, feel free to ask questions on the ['Contributors' category on our
The default API keys and environment variables are stored in the file `sample.env`. This file needs to be copied to a new file named `.env` that is accessed dynamically during the installation step.
```console
```bash
# Crear una copia de la "sample.env" y nombrarla ".env".
# Populate it with the necessary API keys and secrets
```
```console
```bash
cp sample.env .env
```
@@ -220,7 +220,7 @@ The keys in the `.env` file are _not_ required to be changed to run the app loca
This step will install the dependencies required for the application to run:
```console
```bash
pnpm install && pnpm run create:shared
```
@@ -234,7 +234,7 @@ Before you can run the application locally, you will need to start the MongoDB s
Start the MongoDB server in a separate terminal:
```console
```bash
mongod
```
@@ -242,15 +242,14 @@ mongod
Next, let's seed the database. In this step, we run the below command that fills the MongoDB server with some initial data sets that are required by services. These include a few schemas, among other things.
```console
```bash
pnpm run seed
```
By default, you will be signed in as a new user without any completed certifications. Run the following commands if you need to develop with completed certifications:
```console
```bash
pnpm run seed:certified-user
pnpm run seed:exams
```
> [!WARNING] Running `pnpm run seed:certified-user` will log you out. You will have to clear your browser cookies and sign in again.
@@ -259,7 +258,7 @@ pnpm run seed:exams
You can now start up the API server and the client applications.
```console
```bash
pnpm run develop
```
@@ -279,11 +278,12 @@ If you have issues while installing it, check out the [troubleshooting section](
A quick reference to the commands that you will need when working locally.
| command | description |
| ------------------------------ | ------------------------------------------------------------------------------------------------- |
| `pnpm install` | Installs / re-installs all dependencies and bootstraps the different services. |
| `pnpm run seed` | Creates authorized test users and inserts them into MongoDB. |
| `pnpm run seed:certified-user` | Creates authorized test users with certifications fully completed, and inserts them into MongoDB. |
| `pnpm run seed:exams` | Creates exams and inserts them into MongoDB. |
| `pnpm run develop` | Starts the freeCodeCamp API Server and Client Applications. |
| `pnpm run clean` | Uninstalls all dependencies and cleans up caches. |
| command | description |
| ------------------------------ | ------------------------------------------------------------------------------------------------------------- |
| `pnpm install` | Installs / re-installs all dependencies and bootstraps the different services. |
| `pnpm run seed` | Creates authorized test users and inserts them into MongoDB. Also runs `seed:exams` and `seed:surveys` below. |
| `pnpm run seed:certified-user` | Creates authorized test users with certifications fully completed, and inserts them into MongoDB. |
| `pnpm run seed:exams` | Creates exams and inserts them into MongoDB. |
| `pnpm run seed:surveys` | Creates surveys for defaults users and inserts them into MongoDB. |
| `pnpm run develop` | Starts the freeCodeCamp API Server and Client Applications. |
| `pnpm run clean` | Uninstalls all dependencies and cleans up caches. |

View File

@@ -17,7 +17,7 @@ Empezar instalando el software requerido previamente para su sistema operativo.
Si Flutter ya está instalado en su equipo, ejecute los siguientes comandos para verificar la versión:
```console
```bash
flutter --version
dart --version
```
@@ -70,7 +70,7 @@ Ejecuta estos comandos en tu máquina local:
2. Clona tu fork de freeCodeCamp, reemplazando `TU_NOMBRE_DE_USUARIO` por tu nombre de usuario de GitHub
```console
```bash
git clon --depth=1 https://github.com/TU_NOMBRE_DE_USUARIO/mobile.git
```
@@ -88,25 +88,25 @@ Necesitas una referencia de tu clon local al repositorio `upstream` además del
1. Cambiar el directorio al nuevo directorio `móvil`:
```console
```bash
cd mobile
```
2. Añadir una referencia remota al repositorio principal de freeCodeCamp móvil:
```console
```bash
git remote add upstream https://github.com/freeCodeCamp/mobile.git
```
3. Asegúrate de que la configuración se vea correcta:
```console
```bash
git remote -v
```
La salida debería verse parecida a como se muestra debajo (remplazando `TU_NOMBRE_DE_USUARIO` con tu usuario de GitHub):
```console
```bash
origin https://github.com/YOUR_USER_NAME/mobile.git (fetch)
origin https://github.com/YOUR_USER_NAME/mobile.git (push)
upstream https://github.com/freeCodeCamp/mobile.git (fetch)
@@ -129,20 +129,20 @@ Y como siempre, siéntete libre de preguntar en la categoría ['Contribuyentes'
Las claves de la API por defecto y las variables de entorno se almacenan en el archivo `sample.env`. This file needs to be copied to a new file named `.env` which is accessed dynamically during the installation step. Recuerda cambiar el directorio a `mobile-app` antes de ejecutar los siguientes comandos.
```console
```bash
# Crear una copia del "sample.env" y nombrarla ".env".
# Llenarlo con las keys y secrets de la API necesarios:
```
#### **macOS/Linux**
```console
```bash
cp sample.env .env
```
#### **Windows**
```console
```bash
copy sample.env .env
```
@@ -152,7 +152,7 @@ Las claves dentro del archivo `.env` _no_ requieren ser cambiadas para correr l
Este paso instalará las dependencias necesarias para que la aplicación se ejecute:
```console
```bash
flutter pub get
```
@@ -162,7 +162,7 @@ Inicia el emulador de tu elección (Android o iOS) y espera a que se complete el
Ahora puedes iniciar la aplicación ejecutando el siguiente comando:
```console
```bash
flutter run
```
@@ -176,13 +176,13 @@ Sigue estos pasos:
1. Valida que estás en la rama `main`:
```console
```bash
git status
```
Deberías obtener una salida como esta:
```console
```bash
On branch main
Your branch is up-to-date with 'origin/main'.
@@ -191,7 +191,7 @@ Sigue estos pasos:
Si no estás en main o tu directorio de trabajo no está limpio, resuelve cualquier archivos/commits pendientes y comprueba `main`:
```console
```bash
git checkout main
```
@@ -205,25 +205,25 @@ Sigue estos pasos:
Actualiza tu copia local del repositorio de freeCodeCamp móvil:
```console
```bash
git fetch upstream
```
Restablece tu rama main con el main de freeCodeCamp móvil:
```console
```bash
git reset --hard upstream/main
```
Has push de tu rama main a tu origen para tener un historial limpio en tu fork en GitHub:
```console
```bash
git push origin main --force
```
You can validate that your current main matches the upstream/main by performing a diff:
```console
```bash
git diff upstream/main
```
@@ -235,7 +235,7 @@ Sigue estos pasos:
Comprueba que estás en `main` como se explicó anteriormente, y ramifica desde ahí:
```console
```bash
git checkout -b fix/update-guide-for-xyz
```
@@ -259,13 +259,13 @@ Sigue estos pasos:
7. Comprueba y confirma los archivos que estás actualizando:
```console
```bash
git status
```
Esto debería mostrar una lista de archivos `unstaged` que has editado.
```console
```bash
On branch feat/documentation
Your branch is up to date with 'upstream/feat/documentation'.
@@ -282,25 +282,25 @@ Sigue estos pasos:
En este paso, sólo deberías marcar los archivos que has editado o añadido tu mismo. Puede realizar un reset y resolver archivos que no tenías intención de cambiar si es necesario.
```console
```bash
git add ruta/al/archivo/editado.ext
```
O puedes añadir todos los archivos que no estén `organizados` al área de staging:
```console
```bash
git add .
```
Sólo los archivos que fueron movidos al área de staging serán añadidos cuando hagas un commit.
```console
```bash
git status
```
Salida:
```console
```bash
On branch feat/documentation
Your branch is up to date with 'upstream/feat/documentation'.
@@ -313,7 +313,7 @@ Sigue estos pasos:
Ahora, puedes hace commit de tus cambios con un mensaje corto, así:
```console
```bash
git commit -m "fix: mensaje corto"
```
@@ -345,7 +345,7 @@ Sigue estos pasos:
9. Si te das cuenta de que necesitas editar un archivo o actualizar el mensaje de confirmación después de hacer un commit puedes hacerlo después de editar los archivos con:
```console
```bash
git commit --amend
```
@@ -353,7 +353,7 @@ Sigue estos pasos:
10. A continuación, puedes enviar tus cambios a tu fork:
```console
```bash
git push origin nombre/rama-aqui
```
@@ -363,14 +363,14 @@ Sigue estos pasos:
1. Clone a copy of the [freeCodeCamp repo](https://github.com/freeCodeCamp/freeCodeCamp) locally outside of your local copy of the freeCodeCamp mobile repo. Your folder structure should look like this:
```console
```bash
├── freeCodeCamp
├── mobile
```
2. Change the directory to the freeCodeCamp repo:
```console
```bash
cd freeCodeCamp
```
@@ -378,25 +378,25 @@ Sigue estos pasos:
#### **macOS/Linux**
```console
```bash
cp sample.env .env
```
#### **Windows**
```console
```bash
copy sample.env .env
```
4. Install the dependencies for the freeCodeCamp repo:
```console
```bash
pnpm install && pnpm run create:shared
```
5. Generate the challenge data JSON file:
```console
```bash
pnpm run build:curriculum
```
@@ -404,54 +404,54 @@ Sigue estos pasos:
#### **macOS/Linux**
```console
```bash
cp ./shared/config/curriculum.json ../mobile/mobile-app/curriculum.json
```
#### **Windows**
```console
```bash
copy .\shared\config\curriculum.json ..\mobile\mobile-app\curriculum.json
```
7. Change directory to the mobile app:
```console
```bash
cd ../mobile/mobile-app
```
8. Install the dependencies for the mobile app:
```console
```bash
flutter pub get
```
9. Update the test file to use the challenge data JSON file:
```console
```bash
sed -i '' 's/..\/..\/shared\/config\/curriculum.json/.\/curriculum.json/g' test/widget_test.dart
```
10. Generate the challenge files:
```console
```bash
flutter test test/widget_test.dart
```
11. Start a local server to serve the challenge files with the help of `serve` package:
```console
```bash
npx serve
```
12. In a different terminal go back to the freeCodeCamp repo:
```console
```bash
cd ../../freeCodeCamp
```
13. Run the cypress tests:
```console
```bash
pnpm cypress run --config retries=1,screenshotOnRunFailure=false,video=false,baseUrl=http://localhost:3000/generated-tests/,specPattern=cypress/e2e/mobile-learn/test-challenges.js -s cypress/e2e/mobile-learn/test-challenges.js -b chrome
```
@@ -482,7 +482,7 @@ Si estás en un sistema operativo diferente y/o todavía tienes problemas, consu
If you face issues with the UI, or build errors a cleanup can be useful:
```console
```bash
flutter clean
```

View File

@@ -10,7 +10,7 @@ Esta guía cubre algunos pasos comunes con la configuración de WSL2. Una vez qu
## Habilitar WSL
Sigue las instrucciones de la [documentación oficial](https://docs.microsoft.com/en-us/windows/wsl/install-win10) para instalar WSL1 y luego actualice a WSL2.
Follow the instructions on the [official documentation](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to install WSL2.
## Instalar Ubuntu
@@ -20,9 +20,11 @@ Sigue las instrucciones de la [documentación oficial](https://docs.microsoft.co
>
> While you may use other non-Debian-based distributions, they all come with their own 'gotchas' that are beyond the scope of this guide.
As of November 2023, Ubuntu and Debian are the only Linux distributions [officially supported by Playwright](https://playwright.dev/docs/intro#system-requirements), the end-to-end testing library used by freeCodeCamp.
2. Actualizar las dependencias del sistema operativo
```console
```bash
sudo apt update
sudo apt upgrade -y
@@ -70,23 +72,23 @@ Esto hace que los contenedores se ejecuten del lado de WSL en vez de Windows. Se
Una vez que hayas configurado Docker Desktop para trabajar con WSL2, sigue estos pasos para iniciar un servicio MongoDB:
1. Inicia una nueva terminal Ubuntu-18.04
1. Launch a new Ubuntu terminal
2. Pull `MongoDB 4.0.x` from Docker Hub
2. Pull MongoDB from Docker Hub. Please refer to the [Prerequisites](how-to-setup-freecodecamp-locally.md#Prerequisites) table for the current version of MongoDB used by freeCodeCamp. For example, if the version number is `5.0.x`, replace `<x.y>` with `5.0` in the following two code snippets.
```console
docker pull mongo:4.0
```bash
docker pull mongo:<x.y>
```
3. Inicia el servicio MongoDB en el puerto `27017`, y configúralo para que se ejecute automáticamente al reiniciar el sistema
```console
```bash
docker run -it \
-v mongodata:/data/db \
-p 27017:27017 \
--name mongodb \
--restart unless-stopped \
-d mongo:4.0
-d mongo:<x.y>
```
4. Ahora puedes acceder al servicio desde Windows o Ubuntu en `mongodb://localhost:27017`.
@@ -95,25 +97,17 @@ Una vez que hayas configurado Docker Desktop para trabajar con WSL2, sigue estos
Recomendamos que instales la versión LTS de Node.js con un gestor de versiones de node - [nvm](https://github.com/nvm-sh/nvm#installing-and-updating).
Una vez instalado, usa estos comandos para instalar y usar la versión de Node.js según sea necesario
Once installed use this command to install and use the latest Node.js LTS version:
```console
```bash
nvm install --lts
# O también
# nvm install <version>
nvm install 14
# Uso
# nvm use <version>
nvm use 12
```
For instructions on installing and using a different version of Node.js, please refer to the [nvm docs](https://github.com/nvm-sh/nvm#usage).
Node.js comes bundled with `npm`, which you can use to install `pnpm`:
```console
```bash
npm install -g pnpm
```
@@ -125,7 +119,104 @@ Now that you have installed the pre-requisites, follow [our local setup guide](h
>
> Please note, at this time the setup for Cypress tests (and related GUI needs) is a work in progress. Aún así deberías poder trabajar en la mayor parte del código base.
## Enlaces útiles
## Optimize Windows and WSL
> [!NOTE]
>
> The following tips were collected from across the web and have not gone through vigorous testing. Your mileage may vary.
### Adjust processer scheduling for background services
This may reduce incidents of Docker containers crashing due to lack of resources.
Open the System Properties control panel by pressing <kbd>Win + R</kbd> and entering `sysdm.cpl`
<details>
<summary>
Enter <code>sysdm.cpl</code> in the Run dialog (screenshot)
</summary>
<br>
<img src="https://raw.githubusercontent.com/freeCodeCamp/freeCodeCamp/main/docs/images/wsl/run-sysdm.png" alt="Enter `sysdm.cpl` in the Run dialog" />
</details>
<br>
Go to Advanced -> Performance -> Settings…
<details>
<summary>
Performance Settings button under Advanced tab in System Properties (screenshot)
</summary>
<br>
<img src="https://raw.githubusercontent.com/freeCodeCamp/freeCodeCamp/main/docs/images/wsl/advanced-performance-settings.png" alt="Performance Settings button under Advanced tab in System Properties" />
</details>
<br>
Under Advanced -> Processor scheduling, choose "Background services". Do not close the window. Continue to the next tip.
<details>
<summary>
Background services radio button under Advanced tab in Performance Options (screenshot)
</summary>
<br>
<img src="https://raw.githubusercontent.com/freeCodeCamp/freeCodeCamp/main/docs/images/wsl/background-services.png" alt="Background services radio button under Advanced tab in Performance Options" />
</details>
### Increase the size of Windows paging file for the system drive
Under Advanced -> Virtual memory, click "Change…"
<details>
<summary>
Change virtual memory button under Advanced tab in Performance Options (screenshot)
</summary>
<br>
<img src="https://raw.githubusercontent.com/freeCodeCamp/freeCodeCamp/main/docs/images/wsl/advanced-virtual-memory.png" alt="Change virtual memory button under Advanced tab in Performance Options" />
</details>
<br>
Choose "Custom size". Set the initial size to 1.5x and the maximum size to 3x of your physical memory. Then click "Set".
<details>
<summary>
Set custom size button in Virtual Memory window (screenshot)
</summary>
<br>
<img src="https://raw.githubusercontent.com/freeCodeCamp/freeCodeCamp/main/docs/images/wsl/set-custom-size.png" alt="Set custom size button in Virtual Memory window" />
</details>
### Increase the size of memory allocated to WSL
Create a [`.wslconfig` file](https://learn.microsoft.com/en-us/windows/wsl/wsl-config#configuration-setting-for-wslconfig) in your [`%UserProfile%` directory](https://learn.microsoft.com/en-us/windows/wsl/wsl-config#wslconfig) (typically `C:\Users\<UserName>\.wslconfig`). Please read the [WSL documentation](https://learn.microsoft.com/en-us/windows/wsl/wsl-config#configuration-setting-for-wslconfig) carefully and replace `x` with values that suit your own needs:
```ini
# Settings apply across all Linux distros running on WSL 2
[wsl2]
# How much memory to assign to the WSL 2 VM. The default value might not be enough
memory=xGB
# How much swap space to add to the WSL 2 VM, default is 25% of available RAM
swap=xGB
```
### Increase Node.js max old space size
This fixes the ["JavaScript heap out of memory" error](https://stackoverflow.com/a/54456814) with ESLint. Add the following to your `~/.bashrc` or `~/.zshrc`:
```sh
export NODE_OPTIONS="--max-old-space-size=4096"
```
### Avoid `pnpm run test`
Instead, use the script [appropriate to your PR](https://forum.freecodecamp.org/t/wsl-performance-issues-while-working-on-the-codebase/644215/2#:~:text=usually%2C%20you%20just%20want%20to%20test%20something%20specific%20to%20either%20the%20curriculum%20or%20the%20client%20or%20the%20api%20-%20almost%20never%20all%203.); either `pnpm run test:api`, `pnpm run test:curriculum`, or `pnpm run test-client`.
## Useful Links
- [A WSL2 Dev Setup with Ubuntu 20.04, Node.js, MongoDB, VS Code, and Docker](https://hn.mrugesh.dev/wsl2-dev-setup-with-ubuntu-nodejs-mongodb-and-docker) - an article by Mrugesh Mohapatra (Staff Developer at freeCodeCamp.org)
- Preguntas frecuentes sobre:

View File

@@ -239,6 +239,8 @@ Sentences should be clear and concise with minimal jargon. If used, jargon shoul
Keep paragraphs short (around 1-4 sentences). People are more likely to read several short paragraphs than a wall of text.
Use american english, e.g., use `labeled` instead of `labelled`.
Challenge text should use the second person ("you") to help to give it a conversational tone. This way the text and instructions seem to speak directly to the camper working through the challenge. Try to avoid using the first person ("I", "we", "let's", and "us").
Don't use outbound links. These interrupt the flow. Campers should never have to google anything during these challenges. If there are resources you think campers would benefit from, add them to the challenge's Guide-related article.
@@ -313,7 +315,7 @@ Los desafíos deben tener el número mínimo de pruebas necesarias para verifica
Nuestro objetivo es comunicar el único punto que el reto está tratando de enseñar y comprobar que han comprendido ese punto.
Las pruebas de desafío pueden hacer uso de las librerías de aserción de Node.js y Chai.js. Además, si es necesario, se puede acceder al código generado por el usuario en la variable `code`. Además, el objeto `__helpers` expone varias funciones que simplifican el proceso de escritura de los test. Las funciones disponibles estan definidas en _client/src/utils/curriculum-helpers.ts_.
Las pruebas de desafío pueden hacer uso de las librerías de aserción de Node.js y Chai.js. Además, si es necesario, se puede acceder al código generado por el usuario en la variable `code`. Además, el objeto `__helpers` expone varias funciones que simplifican el proceso de escritura de los test. The available functions are defined in the [curriculum-helpers](https://github.com/freeCodeCamp/curriculum-helpers/blob/main/lib/index.ts) repo.
## Formatting Seed Code

View File

@@ -16,7 +16,7 @@ Veamos cómo funcionan los marcos de trabajo y las herramientas de i18n.
Most of the files for translating the platform are located in the [`client/i18n`](https://github.com/freeCodeCamp/freeCodeCamp/tree/main/client/i18n) folder. Each language has a directory that contains JSON files with the translations.
```console
```bash
config
└── i18n.ts
...

View File

@@ -47,7 +47,7 @@ Normalmente no vas a necesitar cambiar ninguna configuración o compliar el siti
Install freeCodeCamp locally ([see the local setup guide](how-to-setup-freecodecamp-locally)), we bundled the CLI with the development tools so you can run the command below as needed from the root of the repo:
```console
```bash
pnpm run docs:serve
```

View File

@@ -16,7 +16,7 @@ Si estás en un sistema operativo diferente o todavía estas encontrandote con p
When you build the client, Gatsby will cache the Fonts, language strings, and UI. Si uno de ellos no fue almacenado en caché, ejecute lo siguiente:
```console
```bash
pnpm run clean
pnpm install
pnpm run seed
@@ -53,7 +53,7 @@ git clean -ifdX
If you can't sign in, and instead you see a banner with an error message saying that the error will be reported to freeCodeCamp, please double-check that your local port `3000` is not in use by a different program.
#### **From Terminal:**
```console
```bash
netstat -a | grep "3000"
tcp4 0 0 0.0.0.0:3000 DESKTOP LISTEN

View File

@@ -303,19 +303,19 @@ Du solltest die VMs auf dem neuesten Stand halten, indem du Updates und Upgrades
Paketinformationen aktualisieren
```console
```bash
sudo apt update
```
Installierte Pakete upgraden
```console
```bash
sudo apt upgrade -y
```
Unbenutzte Pakete entfernen
```console
```bash
sudo apt autoremove -y
```
@@ -331,7 +331,7 @@ Provisionieren der VMs mit Code
1. Installiere NGINX und konfiguriere es aus dem Repository.
```console
```bash
sudo su
cd /var/www/html
@@ -352,7 +352,7 @@ Provisionieren der VMs mit Code
Übertrage bestehende Zertifikate:
```console
```bash
# Local
scp -r username@source-server-public-ip:/etc/nginx/ssl ./
scp -pr ./ssl username@target-server-public-ip:/tmp/
@@ -364,7 +364,7 @@ Provisionieren der VMs mit Code
Aktualisiere die Upstream-Konfigurationen:
```console
```bash
vi configs/upstreams.conf
```
@@ -382,7 +382,7 @@ Provisionieren der VMs mit Code
1. Überprüfe den Status des NGINX-Dienstes mit dem folgenden Befehl:
```console
```bash
sudo systemctl status nginx
```
@@ -396,13 +396,13 @@ Konfigurationsänderungen an unseren NGINX-Instanzen werden auf GitHub gepflegt,
1. Verbinde dich per SSH mit der Instanz und gib sudo ein
```console
```bash
sudo su
```
2. Lade den neuesten Konfigurationscode herunter.
```console
```bash
cd /etc/nginx
git fetch --all --prune
git reset --hard origin/main
@@ -410,7 +410,7 @@ git reset --hard origin/main
3. Teste und lade die Konfiguration neu [mit Signals](https://docs.nginx.com/nginx/admin-guide/basic-functionality/runtime-control/#controlling-nginx).
```console
```bash
nginx -t
nginx -s reload
```
@@ -419,7 +419,7 @@ nginx -s reload
1. Installiere Build-Tools für Node-Binaries (`node-gyp`) usw.
```console
```bash
sudo apt install build-essential
```
@@ -431,19 +431,19 @@ Bereitstellung von VMs mit dem Code
2. Install pnpm globally.
```console
```bash
npm install -g pnpm
```
3. Install pm2 globally.
```console
```bash
npm install -g pm2
```
4. Clone freeCodeCamp, set up env, and keys.
```console
```bash
git clone https://github.com/freeCodeCamp/freeCodeCamp.git
cd freeCodeCamp
git checkout prod-current # or any other branch to be deployed
@@ -453,36 +453,36 @@ git checkout prod-current # or any other branch to be deployed
6. Install dependencies
```console
```bash
pnpm install
```
7. Setup pm2 `logrotate` and startup on boot
```console
```bash
pm2 install pm2-logrotate
pm2 startup
```
8. Build the server
```console
```bash
pnpm prebuild && pnpm build:curriculum && pnpm build:server
```
9. Start Instances
```console
```bash
pnpm start:server
```
### Logging und Monitoring
```console
```bash
pm2 logs
```
```console
```bash
pm2 monit
```
@@ -496,31 +496,31 @@ Codeänderungen müssen von Zeit zu Zeit auf die API-Instanzen übertragen werde
1. Stop all instances
```console
```bash
pm2 stop all
```
2. Install dependencies
```console
```bash
pnpm install
```
3. Build the server
```console
```bash
pnpm prebuild && pnpm build:curriculum && pnpm build:server
```
4. Start Instances
```console
```bash
pnpm start:server && pm2 logs
```
#### 2. Rolling updates - Used for logical changes to code.
```console
```bash
pnpm reload:server && pm2 logs
```
@@ -532,7 +532,7 @@ pnpm reload:server && pm2 logs
2. Update pm2 to use the new version
```console
```bash
pm2 update
```
@@ -540,7 +540,7 @@ pm2 update
1. Install build tools for node binaries (`node-gyp`) etc.
```console
```bash
sudo apt install build-essential
```
@@ -552,7 +552,7 @@ Bereitstellung von VMs mit dem Code
2. Update `npm` and install PM2 and setup `logrotate` and startup on boot
```console
```bash
npm i -g npm@8
npm i -g pm2@4
npm install -g serve@13
@@ -562,7 +562,7 @@ Bereitstellung von VMs mit dem Code
3. Clone client config, setup env and keys.
```console
```bash
git clone https://github.com/freeCodeCamp/client-config.git client
cd client
```
@@ -571,7 +571,7 @@ Bereitstellung von VMs mit dem Code
> Todo: This setup needs to move to S3 or Azure Blob storage
>
> ```console
> ```bash
> echo "serve -c ../serve.json -p 50505 www" > client-start-primary.sh
> chmod +x client-start-primary.sh
> pm2 delete client-primary
@@ -584,11 +584,11 @@ Bereitstellung von VMs mit dem Code
### Logging und Monitoring
```console
```bash
pm2 logs
```
```console
```bash
pm2 monit
```
@@ -602,7 +602,7 @@ Codeänderungen müssen von Zeit zu Zeit auf die API-Instanzen übertragen werde
1. Stop all instances
```console
```bash
pm2 stop all
```
@@ -610,13 +610,13 @@ Codeänderungen müssen von Zeit zu Zeit auf die API-Instanzen übertragen werde
3. Start Instances
```console
```bash
pm2 start all --update-env && pm2 logs
```
#### 2. Fortlaufende (Rolling) Updates - Werden für logische Änderungen am Code verwendet.
```console
```bash
pm2 reload all --update-env && pm2 logs
```
@@ -636,7 +636,7 @@ Bereitstellen von VMs mit dem Code
1. Install NGINX and configure from repository.
```console
```bash
sudo su
cd /var/www/html
@@ -657,7 +657,7 @@ Bereitstellen von VMs mit dem Code
Move over existing certificates:
```console
```bash
# Local
scp -r username@source-server-public-ip:/etc/nginx/ssl ./
scp -pr ./ssl username@target-server-public-ip:/tmp/
@@ -669,7 +669,7 @@ Bereitstellen von VMs mit dem Code
Update Upstream Configurations:
```console
```bash
vi configs/upstreams.conf
```
@@ -687,7 +687,7 @@ Bereitstellen von VMs mit dem Code
1. Install Docker and configure from the repository
```console
```bash
git clone https://github.com/freeCodeCamp/chat-config.git chat
cd chat
```
@@ -696,7 +696,7 @@ Bereitstellen von VMs mit dem Code
3. Run rocket-chat server
```console
```bash
docker-compose config
docker-compose up -d
```
@@ -705,13 +705,13 @@ Bereitstellen von VMs mit dem Code
1. Check status for NGINX service using the below command:
```console
```bash
sudo systemctl status nginx
```
2. Check status for running docker instances with:
```console
```bash
docker ps
```
@@ -723,13 +723,13 @@ Konfigurationsänderungen für unsere NGINX-Instanzen werden auf GitHub gepflegt
1. SSH into the instance and enter sudo
```console
```bash
sudo su
```
2. Get the latest config code.
```console
```bash
cd /etc/nginx
git fetch --all --prune
git reset --hard origin/main
@@ -737,7 +737,7 @@ Konfigurationsänderungen für unsere NGINX-Instanzen werden auf GitHub gepflegt
3. Test and reload the config [with Signals](https://docs.nginx.com/nginx/admin-guide/basic-functionality/runtime-control/#controlling-nginx).
```console
```bash
nginx -t
nginx -s reload
```
@@ -746,44 +746,44 @@ Konfigurationsänderungen für unsere NGINX-Instanzen werden auf GitHub gepflegt
1. SSH into the instance and navigate to the chat config path
```console
```bash
cd ~/chat
```
2. Get the latest config code.
```console
```bash
git fetch --all --prune
git reset --hard origin/main
```
3. Pull down the latest docker image for Rocket.Chat
```console
```bash
docker-compose pull
```
4. Update the running instances
```console
```bash
docker-compose up -d
```
5. Validate the instances are up
```console
```bash
docker ps
```
6. Cleanup extraneous resources
```console
```bash
docker system prune --volumes
```
Output:
```console
```bash
WARNING! This will remove:
- all stopped containers
- all networks not used by at least one container
@@ -802,7 +802,7 @@ Konfigurationsänderungen für unsere NGINX-Instanzen werden auf GitHub gepflegt
ssh in die VM (gehostet auf Digital Ocean).
```console
```bash
cd tools
git pull origin master
pnpm install
@@ -814,7 +814,7 @@ pm2 restart contribute-app
Liste die aktuell installierten node & npm Versionen auf
```console
```bash
nvm -v
node -v
npm -v
@@ -824,25 +824,25 @@ nvm ls
Installiere die neueste Node.js LTS, und installiere alle globalen Pakete neu
```console
```bash
nvm install --lts --reinstall-packages-from=default
```
Überprüfe installierte Pakete
```console
```bash
npm ls -g --depth=0
```
Alias the `default` Node.js version to the current LTS (pinned to the latest major version)
```console
```bash
nvm alias default 16
```
(Optional) Deinstalliere alte Versionen
```console
```bash
nvm uninstall <version>
```
@@ -852,31 +852,31 @@ nvm uninstall <version>
Hole die Anweisungen/Befehle zur Deinstallation mit dem Befehl `unstartup` und verwende die Ausgabe, um die systemctl Dienste zu entfernen
```console
```bash
pm2 unstartup
```
Hole dir die Installationsanweisungen/Befehle mit dem `startup` Befehl und benutze die Ausgabe, um die systemctl Dienste hinzuzufügen
```console
```bash
pm2 startup
```
Kurzbefehle für PM2, um gespeicherte Prozesse aufzulisten, wiederherzustellen usw.
```console
```bash
pm2 ls
```
```console
```bash
pm2 resurrect
```
```console
```bash
pm2 save
```
```console
```bash
pm2 logs
```
@@ -898,32 +898,32 @@ Derzeit müssen Agents zum Aktualisieren entfernt und neu konfiguriert werden. D
1. Navigate and check status of the service
```console
```bash
cd ~/azagent
sudo ./svc.sh status
```
2. Stop the service
```console
```bash
sudo ./svc.sh stop
```
3. Uninstall the service
```console
```bash
sudo ./svc.sh uninstall
```
4. Remove the agent from the pipeline pool
```console
```bash
./config.sh remove
```
5. Remove the config files
```console
```bash
cd ~
rm -rf ~/azagent
```
@@ -938,7 +938,7 @@ Wir verwenden [ein CLI-Tool](https://github.com/freecodecamp/sendgrid-email-blas
2. Set up the script to fetch the email list.
```console
```bash
cd /home/freecodecamp/scripts/emails
cp sample.env .env
```
@@ -947,7 +947,7 @@ Wir verwenden [ein CLI-Tool](https://github.com/freecodecamp/sendgrid-email-blas
3. Run the script.
```console
```bash
node get-emails.js emails.csv
```

View File

@@ -26,25 +26,25 @@ Um Tests mit Produktions-Builds durchzuführen, ersetze unten `dev` durch `prd`.
- Um alle Tests im Verzeichnis `./cypress` auszuführen:
```console
```bash
pnpm run cypress:dev:run
```
- Um einen einzelnen Test durchzuführen:
```console
```bash
pnpm run cypress run --spec=cypress/<path_to_test_file>
```
For example:
```console
```bash
pnpm run cypress run --spec=cypress/e2e/default/landing.ts
```
- Um einen Entwicklungs-Build zu erstellen, starte den Entwicklungsserver und führe alle vorhandenen Cypress-End-to-End-Tests aus:
```console
```bash
pnpm run e2e:dev:run
```
@@ -57,25 +57,25 @@ If starting the Gitpod environment did not automatically develop the environment
- Follow the [MongoDB installation guide](https://www.mongodb.com/basics/get-started).
- Create a config file.
```console
```bash
pnpm run create:shared
```
- Richte die Datenbank ein
```console
```bash
pnpm run seed
```
- Entwickle den Server und den Client
```console
```bash
pnpm run develop
```
### 2. Cypress Build Tools installieren
```console
```bash
pnpm run cypress:install-build-tools
```

View File

@@ -4,7 +4,7 @@
To install Playwright run:
```console
```bash
pnpm run playwright:install-build-tools
```
@@ -181,49 +181,49 @@ To run tests with Playwright check the following below
- Make sure you navigate to the e2e repo first
```console
```bash
cd e2e
```
- To run tests in UI helper mode:
```console
```bash
npx playwright test --ui
```
- To run a single test:
```console
```bash
npx playwright test <filename>
```
For example:
```console
```bash
npx playwright test landing-page.spec.ts
```
- Run a set of test files in respective folders:
```console
```bash
npx playwright test <pathToFolder1> <pathToFolder2>
```
For example:
```console
```bash
npx playwright test tests/todo-page/ tests/landing-page/
```
- Run the test with the title:
```console
```bash
npx playwright test -g <title>
```
For example:
```console
```bash
npx playwright test -g "add a todo item"
```
@@ -233,13 +233,13 @@ Since Playwright runs in Node.js, you can debug it with your debugger of choice
- Debugging all tests:
```console
```bash
npx playwright test --debug
```
- Debugging one test file:
```console
```bash
npx playwright test example.spec.ts --debug
```
@@ -247,7 +247,7 @@ Since Playwright runs in Node.js, you can debug it with your debugger of choice
The HTML Reporter shows you a full report of your tests allowing you to filter the report by browsers, passed tests, failed tests, skipped tests and flaky tests.
```console
```bash
npx playwright show-report
```
@@ -257,13 +257,13 @@ Playwright is generally a solid bullet-proof tool. The contributor has already c
- (MacOs and Linux) If running Playwright results in an error due to kernel dependencies, run the following command:
```console
```bash
pnpm run playwright:install-build-tools-linux
```
- A common error seen in playwright is as follows:
```console
```bash
Error: page.goto: Could not connect: Connection refused
=========================== logs ===========================
navigating to "https://127.0.0.1:8000/", waiting until "load"
@@ -284,7 +284,7 @@ Playwright is generally a solid bullet-proof tool. The contributor has already c
- Another common error seen in playwright is as follows:
```console
```bash
Protocol error (Network.getResponseBody): Request content was evicted from inspector cache
```
@@ -305,25 +305,25 @@ If starting the Gitpod environment did not automatically develop the environment
- Create the .env
```console
```bash
cp sample.env .env
```
- Create a config file.
```console
```bash
pnpm run create:shared
```
- Seed the database
```console
```bash
pnpm run seed
```
- Develop the server and client
```console
```bash
pnpm run develop
```
@@ -331,7 +331,7 @@ If starting the Gitpod environment did not automatically develop the environment
To install necessary dependencies for running Playwright run the following command:
```console
```bash
pnpm run playwright:install-build-tools
```
@@ -339,6 +339,6 @@ pnpm run playwright:install-build-tools
To run all Playwright tests, run the following command:
```console
```bash
npx playwright test
```

View File

@@ -10,13 +10,13 @@ Follow these steps:
1. Validate that you are on the `main` branch:
```console
```bash
git status
```
You should get an output like this:
```console
```bash
On branch main
Your branch is up-to-date with 'origin/main'.
@@ -25,7 +25,7 @@ Follow these steps:
If you got a different message, then you aren't on main or your working directory isn't clean, resolve any outstanding files/commits and checkout `main`:
```console
```bash
git checkout main
```
@@ -39,25 +39,25 @@ Follow these steps:
Update your copy of the freeCodeCamp upstream repository:
```console
```bash
git fetch upstream
```
Hard reset your main branch with the freeCodeCamp main:
```console
```bash
git reset --hard upstream/main
```
Push your main branch to your origin to have a clean history on your fork on GitHub:
```console
```bash
git push origin main --force
```
You can validate that your current main matches the upstream/main by performing a diff:
```console
```bash
git diff upstream/main
```
@@ -69,7 +69,7 @@ Follow these steps:
Check that you are on `main` as explained previously, and branch off from there:
```console
```bash
git checkout -b fix/update-guide-for-xyz
```
@@ -93,13 +93,13 @@ Follow these steps:
7. Check and confirm the files you are updating:
```console
```bash
git status
```
This should show a list of `unstaged` files that you have edited.
```console
```bash
On branch feat/documentation
Your branch is up to date with 'upstream/feat/documentation'.
@@ -118,25 +118,25 @@ Follow these steps:
In this step, you should only mark files that you have edited or added yourself. You can perform a reset and resolve files that you did not intend to change if needed.
```console
```bash
git add path/to/my/changed/file.ext
```
Or you can add all the `unstaged` files to the staging area:
```console
```bash
git add .
```
Only the files that were moved to the staging area will be added when you make a commit.
```console
```bash
git status
```
Output:
```console
```bash
On branch feat/documentation
Your branch is up to date with 'upstream/feat/documentation'.
@@ -151,7 +151,7 @@ Follow these steps:
Now, you can commit your changes with a short message like so:
```console
```bash
git commit -m "fix: my short commit message"
```
@@ -181,7 +181,7 @@ Follow these steps:
9. If you realize that you need to edit a file or update the commit message after making a commit you can do so after editing the files with:
```console
```bash
git commit --amend
```
@@ -189,7 +189,7 @@ Follow these steps:
10. Next, you can push your changes to your fork:
```console
```bash
git push origin branch/name-here
```

View File

@@ -115,14 +115,14 @@ Wenn du an regulären Bugs und Features auf unserem Entwicklungszweig `main` arb
1. Rebase deiner lokalen Kopie:
```console
```bash
git checkout <pr-branch>
git pull --rebase upstream main
```
2. Löse alle Konflikte und füge Commits hinzu / bzw. bearbeite sie
```console
```bash
# Entweder
git add .
git commit -m "chore: resolve conflicts"
@@ -134,7 +134,7 @@ Wenn du an regulären Bugs und Features auf unserem Entwicklungszweig `main` arb
3. Schiebe deine Änderungen in den PR zurück
```console
```bash
git push --force origin <pr-branch>
```
@@ -144,7 +144,7 @@ When you are working on features for our upcoming curriculum `next-*` branches,
1. Achte darauf, dass dein Upstream mit deinem Local übereinstimmt:
```console
```bash
git checkout main
git fetch --all --prune
git checkout next-python-projects
@@ -155,7 +155,7 @@ When you are working on features for our upcoming curriculum `next-*` branches,
a. Entweder löschst du deinen lokalen Branch, nachdem du ein Backup gemacht hast (wenn du ihn noch lokal hast):
```console
```bash
git checkout <pr-branch-name>
# Beispiel:
@@ -171,7 +171,7 @@ When you are working on features for our upcoming curriculum `next-*` branches,
b. Or just a backup of your PR branch (if you do not have it locally):
```console
```bash
git checkout -b <backup-branch-name> origin/<pr-branch-name>
# Beispiel:
@@ -180,14 +180,14 @@ When you are working on features for our upcoming curriculum `next-*` branches,
3. Beginne mit einer weißen Weste:
```console
```bash
git checkout -b <pr-branch-name> next-python-projects
git cherry-pick <commit-hash>
```
4. Resolve any conflicts, cleanup, and install dependencies and run tests
```console
```bash
pnpm run clean
pnpm install
@@ -201,6 +201,6 @@ When you are working on features for our upcoming curriculum `next-*` branches,
5. If everything looks good, push back to the PR
```console
```bash
git push --force origin <pr-branch-name>
```

View File

@@ -75,7 +75,7 @@ We primarily support development on Linux and Unix-based systems like Ubuntu and
If Node.js is already installed on your machine, run the following commands to validate the versions:
```console
```bash
node -v
pnpm -v
```
@@ -142,7 +142,7 @@ Run these commands on your local machine:
2. Clone your fork of freeCodeCamp, replacing `YOUR_USER_NAME` with your GitHub Username
```console
```bash
git clone --depth=1 https://github.com/YOUR_USER_NAME/freeCodeCamp.git
```
@@ -160,25 +160,25 @@ You need a reference from your local clone to the `upstream` repository in addit
1. Change the directory to the new freeCodeCamp directory:
```console
```bash
cd freeCodeCamp
```
2. Add a remote reference to the main freeCodeCamp repository:
```console
```bash
git remote add upstream https://github.com/freeCodeCamp/freeCodeCamp.git
```
3. Ensure the configuration looks correct:
```console
```bash
git remote -v
```
The output should look something like below (replacing `YOUR_USER_NAME` with your GitHub username):
```console
```bash
origin https://github.com/YOUR_USER_NAME/freeCodeCamp.git (fetch)
origin https://github.com/YOUR_USER_NAME/freeCodeCamp.git (push)
upstream https://github.com/freeCodeCamp/freeCodeCamp.git (fetch)
@@ -203,12 +203,12 @@ And as always, feel free to ask questions on the ['Contributors' category on our
The default API keys and environment variables are stored in the file `sample.env`. This file needs to be copied to a new file named `.env` that is accessed dynamically during the installation step.
```console
```bash
# Erstelle eine Kopie der "sample.env" und nenne sie ".env".
# Populate it with the necessary API keys and secrets
```
```console
```bash
cp sample.env .env
```
@@ -220,7 +220,7 @@ The keys in the `.env` file are _not_ required to be changed to run the app loca
This step will install the dependencies required for the application to run:
```console
```bash
pnpm install && pnpm run create:shared
```
@@ -234,7 +234,7 @@ Before you can run the application locally, you will need to start the MongoDB s
Start the MongoDB server in a separate terminal:
```console
```bash
mongod
```
@@ -242,15 +242,14 @@ mongod
Next, let's seed the database. In this step, we run the below command that fills the MongoDB server with some initial data sets that are required by services. These include a few schemas, among other things.
```console
```bash
pnpm run seed
```
By default, you will be signed in as a new user without any completed certifications. Run the following commands if you need to develop with completed certifications:
```console
```bash
pnpm run seed:certified-user
pnpm run seed:exams
```
> [!WARNING] Running `pnpm run seed:certified-user` will log you out. You will have to clear your browser cookies and sign in again.
@@ -259,7 +258,7 @@ pnpm run seed:exams
You can now start up the API server and the client applications.
```console
```bash
pnpm run develop
```
@@ -279,11 +278,12 @@ If you have issues while installing it, check out the [troubleshooting section](
A quick reference to the commands that you will need when working locally.
| command | description |
| ------------------------------ | ------------------------------------------------------------------------------------------------- |
| `pnpm install` | Installs / re-installs all dependencies and bootstraps the different services. |
| `pnpm run seed` | Creates authorized test users and inserts them into MongoDB. |
| `pnpm run seed:certified-user` | Creates authorized test users with certifications fully completed, and inserts them into MongoDB. |
| `pnpm run seed:exams` | Creates exams and inserts them into MongoDB. |
| `pnpm run develop` | Starts the freeCodeCamp API Server and Client Applications. |
| `pnpm run clean` | Uninstalls all dependencies and cleans up caches. |
| command | description |
| ------------------------------ | ------------------------------------------------------------------------------------------------------------- |
| `pnpm install` | Installs / re-installs all dependencies and bootstraps the different services. |
| `pnpm run seed` | Creates authorized test users and inserts them into MongoDB. Also runs `seed:exams` and `seed:surveys` below. |
| `pnpm run seed:certified-user` | Creates authorized test users with certifications fully completed, and inserts them into MongoDB. |
| `pnpm run seed:exams` | Creates exams and inserts them into MongoDB. |
| `pnpm run seed:surveys` | Creates surveys for defaults users and inserts them into MongoDB. |
| `pnpm run develop` | Starts the freeCodeCamp API Server and Client Applications. |
| `pnpm run clean` | Uninstalls all dependencies and cleans up caches. |

View File

@@ -17,7 +17,7 @@ Installiere zunächst die erforderliche Software für dein Betriebssystem.
Wenn Flutter bereits auf deinem Rechner installiert ist, führe die folgenden Befehle aus, um die Versionen zu überprüfen:
```console
```bash
flutter --version
dart --version
```
@@ -70,7 +70,7 @@ Führe diese Befehle auf deinem lokalen Rechner aus:
2. Klone deinen Fork von freeCodeCamp und ersetze `YOUR_USER_NAME` durch deinen GitHub Benutzernamen
```console
```bash
git clone --depth=1 https://github.com/YOUR_USER_NAME/mobile.git
```
@@ -88,25 +88,25 @@ Du benötigst eine Referenz von deinem lokalen Klon auf das `upstream`-Repositor
1. Wechsle in das neue `mobile`-Verzeichnis:
```console
```bash
cd mobile
```
2. Füge eine Remote-Referenz zum Haupt-Repository von freeCodeCamp mobile hinzu:
```console
```bash
git remote add upstream https://github.com/freeCodeCamp/mobile.git
```
3. Stelle sicher, dass die Konfiguration korrekt aussieht:
```console
```bash
git remote -v
```
Die Ausgabe sollte in etwas so aussehen wie unten (ersetze `YOUR_USER_NAME` durch deinen GitHub Benutzernamen):
```console
```bash
origin https://github.com/YOUR_USER_NAME/mobile.git (fetch)
origin https://github.com/YOUR_USER_NAME/mobile.git (push)
upstream https://github.com/freeCodeCamp/mobile.git (fetch)
@@ -129,20 +129,20 @@ Und wie immer kannst du Fragen in der [Kategorie 'Contributors' in unserem Forum
Die Standard-API-Schlüssel und Umgebungsvariablen sind in der Datei `sample.env` gespeichert. This file needs to be copied to a new file named `.env` which is accessed dynamically during the installation step. Denke daran, das Verzeichnis in `mobile-app` zu ändern, bevor du die folgenden Befehle ausführst.
```console
```bash
# Erstelle eine Kopie der "sample.env" und benenne sie ".env".
# Trage die notwendigen API-Schlüssel und Secrets in die Datei ein:
```
#### **macOS/Linux**
```console
```bash
cp sample.env .env
```
#### **Windows**
```console
```bash
copy sample.env .env
```
@@ -152,7 +152,7 @@ Die Schlüssel in der `.env` Datei müssen _nicht_ geändert werden, um die App
In diesem Schritt werden die für die Ausführung der Anwendung erforderlichen Abhängigkeiten installiert:
```console
```bash
flutter pub get
```
@@ -162,7 +162,7 @@ Starte den Emulator deiner Wahl (Android oder iOS) und warte, bis der Startvorga
Du kannst die App nun mit folgendem Befehl starten:
```console
```bash
flutter run
```
@@ -176,13 +176,13 @@ Folge diesen Schritten:
1. Überprüfe, ob du dich auf dem `main`-Branch befindest:
```console
```bash
git status
```
Du solltest eine Ausgabe wie diese erhalten:
```console
```bash
On branch main
Your branch is up-to-date with 'origin/main'.
@@ -191,7 +191,7 @@ Folge diesen Schritten:
Wenn du nicht auf main bist oder dein Arbeitsverzeichnis nicht bereinigt ist, löse alle ausstehenden Dateien/Commits auf und checke `main` aus:
```console
```bash
git checkout main
```
@@ -205,25 +205,25 @@ Folge diesen Schritten:
Aktualisiere deine lokale Kopie des freeCodeCamp mobile Upstream-Repository:
```console
```bash
git fetch upstream
```
Führe einen Hard Reset deines Hauptzweiges mit dem freeCodeCamp mobile main durch:
```console
```bash
git reset --hard upstream/main
```
Schiebe deinen Hauptbranch in deinen origin, um einen sauberen Verlauf deines Forks auf GitHub zu haben:
```console
```bash
git push origin main --force
```
You can validate that your current main matches the upstream/main by performing a diff:
```console
```bash
git diff upstream/main
```
@@ -235,7 +235,7 @@ Folge diesen Schritten:
Vergewissere dich, dass du auf `main` bist, wie zuvor erklärt, und zweige von dort ab:
```console
```bash
git checkout -b fix/update-guide-for-xyz
```
@@ -259,13 +259,13 @@ Folge diesen Schritten:
7. Überprüfe und bestätige die Dateien, die du aktualisierst:
```console
```bash
git status
```
Dies sollte eine Liste `unstaged`-Dateien anzeigen, die du verändert hast.
```console
```bash
On branch feat/documentation
Your branch is up to date with 'upstream/feat/documentation'.
@@ -282,25 +282,25 @@ Folge diesen Schritten:
In diesem Schritt solltest du nur Dateien markieren, die du selbst bearbeitet oder hinzugefügt hast. Bei Bedarf kannst du einen Reset durchführen und Dateien lösen, die du nicht ändern wolltest.
```console
```bash
git add path/to/my/changed/file.ext
```
Oder du kannst alle `unstaged`-Dateien zum Staging-Bereich hinzufügen:
```console
```bash
git add .
```
Nur die Dateien, die in den Staging-Bereich verschoben wurden, werden hinzugefügt, wenn du einen Commit durchführst.
```console
```bash
git status
```
Ausgabe:
```console
```bash
On branch feat/documentation
Your branch is up to date with 'upstream/feat/documentation'.
@@ -313,7 +313,7 @@ Folge diesen Schritten:
Jetzt kannst du deine Änderungen mit einer kurzen Nachricht wie dieser übertragen:
```console
```bash
git commit -m "fix: my short commit message"
```
@@ -345,7 +345,7 @@ Folge diesen Schritten:
9. Wenn du feststellst, dass du eine Datei bearbeiten oder die Commit-Nachricht aktualisieren musst, nachdem du einen Commit gemacht hast, kannst du das nach der Bearbeitung der Dateien wie folgt tun:
```console
```bash
git commit --amend
```
@@ -353,7 +353,7 @@ Folge diesen Schritten:
10. Als nächstes kannst du deine Änderungen in deinen Fork schieben:
```console
```bash
git push origin branch/name-here
```
@@ -363,14 +363,14 @@ Folge diesen Schritten:
1. Clone a copy of the [freeCodeCamp repo](https://github.com/freeCodeCamp/freeCodeCamp) locally outside of your local copy of the freeCodeCamp mobile repo. Your folder structure should look like this:
```console
```bash
├── freeCodeCamp
├── mobile
```
2. Change the directory to the freeCodeCamp repo:
```console
```bash
cd freeCodeCamp
```
@@ -378,25 +378,25 @@ Folge diesen Schritten:
#### **macOS/Linux**
```console
```bash
cp sample.env .env
```
#### **Windows**
```console
```bash
copy sample.env .env
```
4. Install the dependencies for the freeCodeCamp repo:
```console
```bash
pnpm install && pnpm run create:shared
```
5. Generate the challenge data JSON file:
```console
```bash
pnpm run build:curriculum
```
@@ -404,54 +404,54 @@ Folge diesen Schritten:
#### **macOS/Linux**
```console
```bash
cp ./shared/config/curriculum.json ../mobile/mobile-app/curriculum.json
```
#### **Windows**
```console
```bash
copy .\shared\config\curriculum.json ..\mobile\mobile-app\curriculum.json
```
7. Change directory to the mobile app:
```console
```bash
cd ../mobile/mobile-app
```
8. Install the dependencies for the mobile app:
```console
```bash
flutter pub get
```
9. Update the test file to use the challenge data JSON file:
```console
```bash
sed -i '' 's/..\/..\/shared\/config\/curriculum.json/.\/curriculum.json/g' test/widget_test.dart
```
10. Generate the challenge files:
```console
```bash
flutter test test/widget_test.dart
```
11. Start a local server to serve the challenge files with the help of `serve` package:
```console
```bash
npx serve
```
12. In a different terminal go back to the freeCodeCamp repo:
```console
```bash
cd ../../freeCodeCamp
```
13. Run the cypress tests:
```console
```bash
pnpm cypress run --config retries=1,screenshotOnRunFailure=false,video=false,baseUrl=http://localhost:3000/generated-tests/,specPattern=cypress/e2e/mobile-learn/test-challenges.js -s cypress/e2e/mobile-learn/test-challenges.js -b chrome
```
@@ -482,7 +482,7 @@ Wenn du mit einem anderen Betriebssystem arbeitest und/oder immer noch Probleme
If you face issues with the UI, or build errors a cleanup can be useful:
```console
```bash
flutter clean
```

View File

@@ -10,7 +10,7 @@ Dieser Leitfaden behandelt einige allgemeine Schritte bei der Einrichtung von WS
## WSL aktivieren
Folge den Anweisungen in der [offiziellen Dokumentation](https://docs.microsoft.com/en-us/windows/wsl/install-win10), um WSL1 zu installieren und anschließend auf WSL2 zu aktualisieren.
Follow the instructions on the [official documentation](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to install WSL2.
## Ubuntu installieren
@@ -20,9 +20,11 @@ Folge den Anweisungen in der [offiziellen Dokumentation](https://docs.microsoft.
>
> While you may use other non-Debian-based distributions, they all come with their own 'gotchas' that are beyond the scope of this guide.
As of November 2023, Ubuntu and Debian are the only Linux distributions [officially supported by Playwright](https://playwright.dev/docs/intro#system-requirements), the end-to-end testing library used by freeCodeCamp.
2. Abhängigkeiten (Dependencies) für das Betriebssystem aktualisieren
```console
```bash
sudo apt update
sudo apt upgrade -y
@@ -70,23 +72,23 @@ Dadurch laufen die Container auf der WSL-Seite und nicht unter Windows. Du kanns
Sobald du Docker Desktop für die Zusammenarbeit mit WSL2 konfiguriert hast, befolge diese Schritte, um einen MongoDB-Dienst zu starten:
1. Starte ein neues Ubuntu-18.04 Terminal
1. Launch a new Ubuntu terminal
2. Pull `MongoDB 4.0.x` from Docker Hub
2. Pull MongoDB from Docker Hub. Please refer to the [Prerequisites](how-to-setup-freecodecamp-locally.md#Prerequisites) table for the current version of MongoDB used by freeCodeCamp. For example, if the version number is `5.0.x`, replace `<x.y>` with `5.0` in the following two code snippets.
```console
docker pull mongo:4.0
```bash
docker pull mongo:<x.y>
```
3. Starte den MongoDB-Dienst an Port `27017` und konfiguriere ihn so, dass er bei Systemneustarts automatisch ausgeführt wird
```console
```bash
docker run -it \
-v mongodata:/data/db \
-p 27017:27017 \
--name mongodb \
--restart unless-stopped \
-d mongo:4.0
-d mongo:<x.y>
```
4. Du kannst jetzt sowohl von Windows als auch von Ubuntu aus auf den Dienst unter `mongodb://localhost:27017` zugreifen.
@@ -95,25 +97,17 @@ Sobald du Docker Desktop für die Zusammenarbeit mit WSL2 konfiguriert hast, bef
Wir empfehlen dir, die LTS-Version für Node.js mit einem Node-Versionsmanager zu installieren - [nvm](https://github.com/nvm-sh/nvm#installing-and-updating).
Nach der Installation kannst du mit den folgenden Befehlen die Node.js-Version installieren und verwenden, falls nötig
Once installed use this command to install and use the latest Node.js LTS version:
```console
```bash
nvm install --lts
# OR
# nvm install <version>
nvm install 14
# Usage
# nvm use <version>
nvm use 12
```
For instructions on installing and using a different version of Node.js, please refer to the [nvm docs](https://github.com/nvm-sh/nvm#usage).
Node.js comes bundled with `npm`, which you can use to install `pnpm`:
```console
```bash
npm install -g pnpm
```
@@ -125,7 +119,104 @@ Now that you have installed the pre-requisites, follow [our local setup guide](h
>
> Please note, at this time the setup for Cypress tests (and related GUI needs) is a work in progress. Du solltest immer noch in der Lage sein, an den meisten Teilen der Codebasis zu arbeiten.
## Nützliche Links
## Optimize Windows and WSL
> [!NOTE]
>
> The following tips were collected from across the web and have not gone through vigorous testing. Your mileage may vary.
### Adjust processer scheduling for background services
This may reduce incidents of Docker containers crashing due to lack of resources.
Open the System Properties control panel by pressing <kbd>Win + R</kbd> and entering `sysdm.cpl`
<details>
<summary>
Enter <code>sysdm.cpl</code> in the Run dialog (screenshot)
</summary>
<br>
<img src="https://raw.githubusercontent.com/freeCodeCamp/freeCodeCamp/main/docs/images/wsl/run-sysdm.png" alt="Enter `sysdm.cpl` in the Run dialog" />
</details>
<br>
Go to Advanced -> Performance -> Settings…
<details>
<summary>
Performance Settings button under Advanced tab in System Properties (screenshot)
</summary>
<br>
<img src="https://raw.githubusercontent.com/freeCodeCamp/freeCodeCamp/main/docs/images/wsl/advanced-performance-settings.png" alt="Performance Settings button under Advanced tab in System Properties" />
</details>
<br>
Under Advanced -> Processor scheduling, choose "Background services". Do not close the window. Continue to the next tip.
<details>
<summary>
Background services radio button under Advanced tab in Performance Options (screenshot)
</summary>
<br>
<img src="https://raw.githubusercontent.com/freeCodeCamp/freeCodeCamp/main/docs/images/wsl/background-services.png" alt="Background services radio button under Advanced tab in Performance Options" />
</details>
### Increase the size of Windows paging file for the system drive
Under Advanced -> Virtual memory, click "Change…"
<details>
<summary>
Change virtual memory button under Advanced tab in Performance Options (screenshot)
</summary>
<br>
<img src="https://raw.githubusercontent.com/freeCodeCamp/freeCodeCamp/main/docs/images/wsl/advanced-virtual-memory.png" alt="Change virtual memory button under Advanced tab in Performance Options" />
</details>
<br>
Choose "Custom size". Set the initial size to 1.5x and the maximum size to 3x of your physical memory. Then click "Set".
<details>
<summary>
Set custom size button in Virtual Memory window (screenshot)
</summary>
<br>
<img src="https://raw.githubusercontent.com/freeCodeCamp/freeCodeCamp/main/docs/images/wsl/set-custom-size.png" alt="Set custom size button in Virtual Memory window" />
</details>
### Increase the size of memory allocated to WSL
Create a [`.wslconfig` file](https://learn.microsoft.com/en-us/windows/wsl/wsl-config#configuration-setting-for-wslconfig) in your [`%UserProfile%` directory](https://learn.microsoft.com/en-us/windows/wsl/wsl-config#wslconfig) (typically `C:\Users\<UserName>\.wslconfig`). Please read the [WSL documentation](https://learn.microsoft.com/en-us/windows/wsl/wsl-config#configuration-setting-for-wslconfig) carefully and replace `x` with values that suit your own needs:
```ini
# Settings apply across all Linux distros running on WSL 2
[wsl2]
# How much memory to assign to the WSL 2 VM. The default value might not be enough
memory=xGB
# How much swap space to add to the WSL 2 VM, default is 25% of available RAM
swap=xGB
```
### Increase Node.js max old space size
This fixes the ["JavaScript heap out of memory" error](https://stackoverflow.com/a/54456814) with ESLint. Add the following to your `~/.bashrc` or `~/.zshrc`:
```sh
export NODE_OPTIONS="--max-old-space-size=4096"
```
### Avoid `pnpm run test`
Instead, use the script [appropriate to your PR](https://forum.freecodecamp.org/t/wsl-performance-issues-while-working-on-the-codebase/644215/2#:~:text=usually%2C%20you%20just%20want%20to%20test%20something%20specific%20to%20either%20the%20curriculum%20or%20the%20client%20or%20the%20api%20-%20almost%20never%20all%203.); either `pnpm run test:api`, `pnpm run test:curriculum`, or `pnpm run test-client`.
## Useful Links
- [A WSL2 Dev Setup with Ubuntu 20.04, Node.js, MongoDB, VS Code, and Docker](https://hn.mrugesh.dev/wsl2-dev-setup-with-ubuntu-nodejs-mongodb-and-docker) - an article by Mrugesh Mohapatra (Staff Developer at freeCodeCamp.org)
- Häufig gestellte Fragen zu:

View File

@@ -232,6 +232,8 @@ Sentences should be clear and concise with minimal jargon. If used, jargon shoul
Keep paragraphs short (around 1-4 sentences). People are more likely to read several short paragraphs than a wall of text.
Use american english, e.g., use `labeled` instead of `labelled`.
Challenge text should use the second person ("you") to help to give it a conversational tone. This way the text and instructions seem to speak directly to the camper working through the challenge. Try to avoid using the first person ("I", "we", "let's", and "us").
Don't use outbound links. These interrupt the flow. Campers should never have to google anything during these challenges. If there are resources you think campers would benefit from, add them to the challenge's Guide-related article.
@@ -306,7 +308,7 @@ Aufgaben sollten so viele Tests enthalten, wie nötig sind, um zu überprüfen,
Unser Ziel ist es, den einzelnen Aspekt der Aufgabe zu vermitteln und zu prüfen, ob die Teilnehmer/innen diesen Aspekt verstanden haben.
Aufgabentests können die Assertion-Bibliotheken von Node.js und Chai.js nutzen. Außerdem kann bei Bedarf auf den vom Benutzer erstellten Code in der Variable `code` zugegriffen werden. Zusätzlich stellt das Objekt `__helpers` mehrere Funktionen zur Verfügung, die das Schreiben von Tests vereinfachen. Die verfügbaren Funktionen sind in _client/src/utils/curriculum-helpers.ts_ definiert.
Aufgabentests können die Assertion-Bibliotheken von Node.js und Chai.js nutzen. Außerdem kann bei Bedarf auf den vom Benutzer erstellten Code in der Variable `code` zugegriffen werden. Zusätzlich stellt das Objekt `__helpers` mehrere Funktionen zur Verfügung, die das Schreiben von Tests vereinfachen. The available functions are defined in the [curriculum-helpers](https://github.com/freeCodeCamp/curriculum-helpers/blob/main/lib/index.ts) repo.
## Formatting Seed Code

View File

@@ -16,7 +16,7 @@ Wir wollen verstehen, wie die i18n-Frameworks und -Werkzeuge funktionieren.
Most of the files for translating the platform are located in the [`client/i18n`](https://github.com/freeCodeCamp/freeCodeCamp/tree/main/client/i18n) folder. Each language has a directory that contains JSON files with the translations.
```console
```bash
config
└── i18n.ts
...

View File

@@ -47,7 +47,7 @@ Typically you would not need to change any configuration or build the site local
Install freeCodeCamp locally ([see the local setup guide](how-to-setup-freecodecamp-locally)), we bundled the CLI with the development tools so you can run the command below as needed from the root of the repo:
```console
```bash
pnpm run docs:serve
```

View File

@@ -16,7 +16,7 @@ If you are on a different OS or are still facing issues, see [getting help](#get
When you build the client, Gatsby will cache the Fonts, language strings, and UI. If one of them isn't cached, run the following:
```console
```bash
pnpm run clean
pnpm install
pnpm run seed
@@ -53,7 +53,7 @@ git clean -ifdX
If you can't sign in, and instead you see a banner with an error message saying that the error will be reported to freeCodeCamp, please double-check that your local port `3000` is not in use by a different program.
#### **From Terminal:**
```console
```bash
netstat -a | grep "3000"
tcp4 0 0 0.0.0.0:3000 DESKTOP LISTEN

View File

@@ -303,19 +303,19 @@ Dovresti tenere aggiornate le VM eseguendo update e upgrade. This will ensure th
Aggiorna informazioni sul pacchetto
```console
```bash
sudo apt update
```
Aggiorna i pacchetti installati
```console
```bash
sudo apt upgrade -y
```
Pulisci i pacchetti inutilizzati
```console
```bash
sudo apt autoremove -y
```
@@ -331,7 +331,7 @@ Provisioning delle VM con il codice
1. Installa NGINX e configuralo dal repository.
```console
```bash
sudo su
cd /var/www/html
@@ -352,7 +352,7 @@ Provisioning delle VM con il codice
Sposta i certificati esistenti:
```console
```bash
# Local
scp -r username@source-server-public-ip:/etc/nginx/ssl ./
scp -pr ./ssl username@target-server-public-ip:/tmp/
@@ -364,7 +364,7 @@ Provisioning delle VM con il codice
Aggiorna le configurazioni di upstream:
```console
```bash
vi configs/upstreams.conf
```
@@ -382,7 +382,7 @@ Provisioning delle VM con il codice
1. Controlla lo stato dei servizi NGINX usando i comandi seguenti:
```console
```bash
sudo systemctl status nginx
```
@@ -396,13 +396,13 @@ Le modifiche di configurazione alle nostre istanze NGINX sono mantenute su GitHu
1. SSH nell'istanza e inserisci sudo
```console
```bash
sudo su
```
2. Ottieni l'ultimo codice di configurazione.
```console
```bash
cd /etc/nginx
git fetch --all --prune
git reset --hard origin/main
@@ -410,7 +410,7 @@ git reset --hard origin/main
3. Prova e ricarica la configurazione [con i segnali](https://docs.nginx.com/nginx/admin-guide/basic-functionality/runtime-control/#controlling-nginx).
```console
```bash
nginx -t
nginx -s reload
```
@@ -419,7 +419,7 @@ nginx -s reload
1. Installa strumenti di generazione per i binari di node (`node-gyp`) ecc.
```console
```bash
sudo apt install build-essential
```
@@ -431,19 +431,19 @@ Fare il provisioning delle VM con il codice
2. Install pnpm globally.
```console
```bash
npm install -g pnpm
```
3. Install pm2 globally.
```console
```bash
npm install -g pm2
```
4. Clone freeCodeCamp, set up env, and keys.
```console
```bash
git clone https://github.com/freeCodeCamp/freeCodeCamp.git
cd freeCodeCamp
git checkout prod-current # or any other branch to be deployed
@@ -453,36 +453,36 @@ git checkout prod-current # or any other branch to be deployed
6. Install dependencies
```console
```bash
pnpm install
```
7. Setup pm2 `logrotate` and startup on boot
```console
```bash
pm2 install pm2-logrotate
pm2 startup
```
8. Build the server
```console
```bash
pnpm prebuild && pnpm build:curriculum && pnpm build:server
```
9. Start Instances
```console
```bash
pnpm start:server
```
### Aggiornamento Istanze (Manutenzione)
```console
```bash
pm2 logs
```
```console
```bash
pm2 monit
```
@@ -496,31 +496,31 @@ Ogni tanto devono essere fatti dei deployment dei cambiamenti al codice alle ist
1. Stop all instances
```console
```bash
pm2 stop all
```
2. Install dependencies
```console
```bash
pnpm install
```
3. Build the server
```console
```bash
pnpm prebuild && pnpm build:curriculum && pnpm build:server
```
4. Start Instances
```console
```bash
pnpm start:server && pm2 logs
```
#### 2. Rolling updates - Used for logical changes to code.
```console
```bash
pnpm reload:server && pm2 logs
```
@@ -532,7 +532,7 @@ pnpm reload:server && pm2 logs
2. Update pm2 to use the new version
```console
```bash
pm2 update
```
@@ -540,7 +540,7 @@ pm2 update
1. Install build tools for node binaries (`node-gyp`) etc.
```console
```bash
sudo apt install build-essential
```
@@ -552,7 +552,7 @@ Fare provisioning delle VM con il codice
2. Update `npm` and install PM2 and setup `logrotate` and startup on boot
```console
```bash
npm i -g npm@8
npm i -g pm2@4
npm install -g serve@13
@@ -562,7 +562,7 @@ Fare provisioning delle VM con il codice
3. Clone client config, setup env and keys.
```console
```bash
git clone https://github.com/freeCodeCamp/client-config.git client
cd client
```
@@ -571,7 +571,7 @@ Fare provisioning delle VM con il codice
> Todo: This setup needs to move to S3 or Azure Blob storage
>
> ```console
> ```bash
> echo "serve -c ../serve.json -p 50505 www" > client-start-primary.sh
> chmod +x client-start-primary.sh
> pm2 delete client-primary
@@ -584,11 +584,11 @@ Fare provisioning delle VM con il codice
### Logging e monitoraggio
```console
```bash
pm2 logs
```
```console
```bash
pm2 monit
```
@@ -602,7 +602,7 @@ Ogni tanto devono essere fatti dei deployment dei cambiamenti al codice alle ist
1. Stop all instances
```console
```bash
pm2 stop all
```
@@ -610,13 +610,13 @@ Ogni tanto devono essere fatti dei deployment dei cambiamenti al codice alle ist
3. Start Instances
```console
```bash
pm2 start all --update-env && pm2 logs
```
#### 2. Aggiornamenti continui - usati per cambiamenti logici al codice.
```console
```bash
pm2 reload all --update-env && pm2 logs
```
@@ -636,7 +636,7 @@ Fare provisioning delle VM con il codice
1. Install NGINX and configure from repository.
```console
```bash
sudo su
cd /var/www/html
@@ -657,7 +657,7 @@ Fare provisioning delle VM con il codice
Move over existing certificates:
```console
```bash
# Local
scp -r username@source-server-public-ip:/etc/nginx/ssl ./
scp -pr ./ssl username@target-server-public-ip:/tmp/
@@ -669,7 +669,7 @@ Fare provisioning delle VM con il codice
Update Upstream Configurations:
```console
```bash
vi configs/upstreams.conf
```
@@ -687,7 +687,7 @@ Fare provisioning delle VM con il codice
1. Install Docker and configure from the repository
```console
```bash
git clone https://github.com/freeCodeCamp/chat-config.git chat
cd chat
```
@@ -696,7 +696,7 @@ Fare provisioning delle VM con il codice
3. Run rocket-chat server
```console
```bash
docker-compose config
docker-compose up -d
```
@@ -705,13 +705,13 @@ Fare provisioning delle VM con il codice
1. Check status for NGINX service using the below command:
```console
```bash
sudo systemctl status nginx
```
2. Check status for running docker instances with:
```console
```bash
docker ps
```
@@ -723,13 +723,13 @@ Le modifiche di configurazione alle nostre istanze NGINX sono mantenute su GitHu
1. SSH into the instance and enter sudo
```console
```bash
sudo su
```
2. Get the latest config code.
```console
```bash
cd /etc/nginx
git fetch --all --prune
git reset --hard origin/main
@@ -737,7 +737,7 @@ Le modifiche di configurazione alle nostre istanze NGINX sono mantenute su GitHu
3. Test and reload the config [with Signals](https://docs.nginx.com/nginx/admin-guide/basic-functionality/runtime-control/#controlling-nginx).
```console
```bash
nginx -t
nginx -s reload
```
@@ -746,44 +746,44 @@ Le modifiche di configurazione alle nostre istanze NGINX sono mantenute su GitHu
1. SSH into the instance and navigate to the chat config path
```console
```bash
cd ~/chat
```
2. Get the latest config code.
```console
```bash
git fetch --all --prune
git reset --hard origin/main
```
3. Pull down the latest docker image for Rocket.Chat
```console
```bash
docker-compose pull
```
4. Update the running instances
```console
```bash
docker-compose up -d
```
5. Validate the instances are up
```console
```bash
docker ps
```
6. Cleanup extraneous resources
```console
```bash
docker system prune --volumes
```
Output:
```console
```bash
WARNING! This will remove:
- all stopped containers
- all networks not used by at least one container
@@ -802,7 +802,7 @@ Le modifiche di configurazione alle nostre istanze NGINX sono mantenute su GitHu
Fai ssh nella VM (hosted su Digital Ocean).
```console
```bash
cd tools
git pull origin master
pnpm install
@@ -814,7 +814,7 @@ pm2 restart contribute-app
Visualizza le versioni installate di node & npm
```console
```bash
nvm -v
node -v
npm -v
@@ -824,25 +824,25 @@ nvm ls
Installa l'ultima versione di Node.js LTC, e reinstalla i pacchetti globali
```console
```bash
nvm install --lts --reinstall-packages-from=default
```
Verifica i pacchetti installati
```console
```bash
npm ls -g --depth=0
```
Alias the `default` Node.js version to the current LTS (pinned to the latest major version)
```console
```bash
nvm alias default 16
```
(Facoltativo) Disinstalla vecchie versioni
```console
```bash
nvm uninstall <version>
```
@@ -852,31 +852,31 @@ nvm uninstall <version>
Ottieni le istruzioni/comandi di deinstallazione con il comando `unstartup` e usa l'output per rimuovere i servizi systemctl
```console
```bash
pm2 unstartup
```
Ottieni le istruzioni/comandi di installazione con il comando `startup` e usa l'output per aggiungere i servizi systemctl
```console
```bash
pm2 startup
```
Comandi veloci per PM2 per elencare, far ripartire processi salvati, ecc.
```console
```bash
pm2 ls
```
```console
```bash
pm2 resurrect
```
```console
```bash
pm2 save
```
```console
```bash
pm2 logs
```
@@ -898,32 +898,32 @@ Attualmente aggiornare gli agent richiede che siano rimossi e riconfigurati. Que
1. Navigate and check status of the service
```console
```bash
cd ~/azagent
sudo ./svc.sh status
```
2. Stop the service
```console
```bash
sudo ./svc.sh stop
```
3. Uninstall the service
```console
```bash
sudo ./svc.sh uninstall
```
4. Remove the agent from the pipeline pool
```console
```bash
./config.sh remove
```
5. Remove the config files
```console
```bash
cd ~
rm -rf ~/azagent
```
@@ -938,7 +938,7 @@ Usiamo uno [strumento CLI](https://github.com/freecodecamp/sendgrid-email-blast)
2. Set up the script to fetch the email list.
```console
```bash
cd /home/freecodecamp/scripts/emails
cp sample.env .env
```
@@ -947,7 +947,7 @@ Usiamo uno [strumento CLI](https://github.com/freecodecamp/sendgrid-email-blast)
3. Run the script.
```console
```bash
node get-emails.js emails.csv
```

View File

@@ -26,25 +26,25 @@ Per eseguire i test su build di produzione, sostituisci `dev` con `prd` nella pa
- Per eseguire tutti i test nella cartella `./cypress`:
```console
```bash
pnpm run cypress:dev:run
```
- Per eseguire un singolo test:
```console
```bash
pnpm run cypress run --spec=cypress/<path_to_test_file>
```
Ad esempio:
```console
```bash
pnpm run cypress run --spec=cypress/e2e/default/landing.ts
```
- Per creare una build di sviluppo, avvia il server di sviluppo e esegui tutti i test cypress end-to-end esistenti:
```console
```bash
pnpm run e2e:dev:run
```
@@ -57,25 +57,25 @@ If starting the Gitpod environment did not automatically develop the environment
- Follow the [MongoDB installation guide](https://www.mongodb.com/basics/get-started).
- Create a config file.
```console
```bash
pnpm run create:shared
```
- Fai il seed del database
```console
```bash
pnpm run seed
```
- Sviluppa il server e il client
```console
```bash
pnpm run develop
```
### 2. Installa Cypress Build Tools
```console
```bash
pnpm run cypress:install-build-tools
```

View File

@@ -4,7 +4,7 @@
To install Playwright run:
```console
```bash
pnpm run playwright:install-build-tools
```
@@ -181,49 +181,49 @@ To run tests with Playwright check the following below
- Make sure you navigate to the e2e repo first
```console
```bash
cd e2e
```
- To run tests in UI helper mode:
```console
```bash
npx playwright test --ui
```
- To run a single test:
```console
```bash
npx playwright test <filename>
```
For example:
```console
```bash
npx playwright test landing-page.spec.ts
```
- Run a set of test files in respective folders:
```console
```bash
npx playwright test <pathToFolder1> <pathToFolder2>
```
For example:
```console
```bash
npx playwright test tests/todo-page/ tests/landing-page/
```
- Run the test with the title:
```console
```bash
npx playwright test -g <title>
```
For example:
```console
```bash
npx playwright test -g "add a todo item"
```
@@ -233,13 +233,13 @@ Since Playwright runs in Node.js, you can debug it with your debugger of choice
- Debugging all tests:
```console
```bash
npx playwright test --debug
```
- Debugging one test file:
```console
```bash
npx playwright test example.spec.ts --debug
```
@@ -247,7 +247,7 @@ Since Playwright runs in Node.js, you can debug it with your debugger of choice
The HTML Reporter shows you a full report of your tests allowing you to filter the report by browsers, passed tests, failed tests, skipped tests and flaky tests.
```console
```bash
npx playwright show-report
```
@@ -257,13 +257,13 @@ Playwright is generally a solid bullet-proof tool. The contributor has already c
- (MacOs and Linux) If running Playwright results in an error due to kernel dependencies, run the following command:
```console
```bash
pnpm run playwright:install-build-tools-linux
```
- A common error seen in playwright is as follows:
```console
```bash
Error: page.goto: Could not connect: Connection refused
=========================== logs ===========================
navigating to "https://127.0.0.1:8000/", waiting until "load"
@@ -284,7 +284,7 @@ Playwright is generally a solid bullet-proof tool. The contributor has already c
- Another common error seen in playwright is as follows:
```console
```bash
Protocol error (Network.getResponseBody): Request content was evicted from inspector cache
```
@@ -305,25 +305,25 @@ If starting the Gitpod environment did not automatically develop the environment
- Create the .env
```console
```bash
cp sample.env .env
```
- Create a config file.
```console
```bash
pnpm run create:shared
```
- Seed the database
```console
```bash
pnpm run seed
```
- Develop the server and client
```console
```bash
pnpm run develop
```
@@ -331,7 +331,7 @@ If starting the Gitpod environment did not automatically develop the environment
To install necessary dependencies for running Playwright run the following command:
```console
```bash
pnpm run playwright:install-build-tools
```
@@ -339,6 +339,6 @@ pnpm run playwright:install-build-tools
To run all Playwright tests, run the following command:
```console
```bash
npx playwright test
```

View File

@@ -10,13 +10,13 @@ Segui questi passaggi:
1. Controlla di essere sul branch `main`:
```console
```bash
git status
```
Dovresti ottenere un output come questo:
```console
```bash
On branch main
Your branch is up-to-date with 'origin/main'.
@@ -25,7 +25,7 @@ Segui questi passaggi:
If you got a different message, then you aren't on main or your working directory isn't clean, resolve any outstanding files/commits and checkout `main`:
```console
```bash
git checkout main
```
@@ -39,25 +39,25 @@ Segui questi passaggi:
Aggiorna la tua copia del repository upstream freeCodeCamp:
```console
```bash
git fetch upstream
```
Fai un hard reset del tuo ramo main con il ramo main di freeCodeCamp:
```console
```bash
git reset --hard upstream/main
```
Fai un push del ramo main al tuo origin per avere una cronologia pulita nel tuo fork su GitHub:
```console
```bash
git push origin main --force
```
You can validate that your current main matches the upstream/main by performing a diff:
```console
```bash
git diff upstream/main
```
@@ -69,7 +69,7 @@ Segui questi passaggi:
Controlla di essere su `main`, come spiegato in precedenza, e crea un branch da lì:
```console
```bash
git checkout -b fix/update-guide-for-xyz
```
@@ -93,13 +93,13 @@ Segui questi passaggi:
7. Controlla e conferma i file che stai aggiornando:
```console
```bash
git status
```
Questo dovrebbe mostrare un elenco di file `unstaged` che hai modificato.
```console
```bash
On branch feat/documentation
Your branch is up to date with 'upstream/feat/documentation'.
@@ -118,25 +118,25 @@ Segui questi passaggi:
In questo passaggio, dovresti contrassegnare solo i file che hai modificato o aggiunto tu stesso. Se necessario è possibile eseguire un reset e risolvere i file che non hai intenzione di modificare.
```console
```bash
git add path/to/my/changed/file.ext
```
Oppure puoi aggiungere tutti i file `unstaged` all'area di staging:
```console
```bash
git add .
```
Solo i file che sono stati spostati nell'area di staging verranno aggiunti quando effettui un commit.
```console
```bash
git status
```
Output:
```console
```bash
On branch feat/documentation
Your branch is up to date with 'upstream/feat/documentation'.
@@ -151,7 +151,7 @@ Segui questi passaggi:
Ora, è possibile eseguire il commit delle modifiche con un breve messaggio come questo:
```console
```bash
git commit -m "fix: breve messaggio di commit"
```
@@ -181,7 +181,7 @@ Segui questi passaggi:
9. Se ti accorgi di dover modificare un file o aggiornare il messaggio del commit dopo aver fatto un commit puoi farlo dopo aver modificato i file con:
```console
```bash
git commit --amend
```
@@ -189,7 +189,7 @@ Segui questi passaggi:
10. Successivamente, è possibile inviare le modifiche al fork:
```console
```bash
git push origin branch/name-here
```

View File

@@ -115,14 +115,14 @@ Quando stai lavorando su normali bug e funzionalità sul nostro ramo di sviluppo
1. Esegui un rebase della tua copia locale:
```console
```bash
git checkout <pr-branch>
git pull --rebase upstream main
```
2. Risolvi eventuali conflitti e aggiungi / modifica i commit
```console
```bash
# O
git add .
git commit -m "chore: resolve conflicts"
@@ -134,7 +134,7 @@ Quando stai lavorando su normali bug e funzionalità sul nostro ramo di sviluppo
3. Fai il push dei tuoi cambiamenti alla PR
```console
```bash
git push --force origin <pr-branch>
```
@@ -144,7 +144,7 @@ When you are working on features for our upcoming curriculum `next-*` branches,
1. Assicurati che il tuo upstream sia sincronizzato con il tuo repository locale:
```console
```bash
git checkout main
git fetch --all --prune
git checkout next-python-projects
@@ -155,7 +155,7 @@ When you are working on features for our upcoming curriculum `next-*` branches,
a. Elimina il ramo locale dopo aver effettuato un backup (se lo hai ancora localmente):
```console
```bash
git checkout <pr-branch-name>
# esempio:
@@ -171,7 +171,7 @@ When you are working on features for our upcoming curriculum `next-*` branches,
b. Or just a backup of your PR branch (if you do not have it locally):
```console
```bash
git checkout -b <backup-branch-name> origin/<pr-branch-name>
# esempio:
@@ -180,14 +180,14 @@ When you are working on features for our upcoming curriculum `next-*` branches,
3. Inizia con una slate pulita:
```console
```bash
git checkout -b <pr-branch-name> next-python-projects
git cherry-pick <commit-hash>
```
4. Resolve any conflicts, cleanup, and install dependencies and run tests
```console
```bash
pnpm run clean
pnpm install
@@ -201,6 +201,6 @@ When you are working on features for our upcoming curriculum `next-*` branches,
5. If everything looks good, push back to the PR
```console
```bash
git push --force origin <pr-branch-name>
```

View File

@@ -75,7 +75,7 @@ We primarily support development on Linux and Unix-based systems like Ubuntu and
If Node.js is already installed on your machine, run the following commands to validate the versions:
```console
```bash
node -v
pnpm -v
```
@@ -142,7 +142,7 @@ Run these commands on your local machine:
2. Clona il tuo fork di freeCodeCamp, sostituendo `YOUR_USER_NAME` con il tuo nome utente GitHub
```console
```bash
git clone --depth=1 https://github.com/YOUR_USER_NAME/freeCodeCamp.git
```
@@ -160,25 +160,25 @@ You need a reference from your local clone to the `upstream` repository in addit
1. Change the directory to the new freeCodeCamp directory:
```console
```bash
cd freeCodeCamp
```
2. Aggiungi un riferimento remoto al repository freeCodeCamp principale:
```console
```bash
git remote add upstream https://github.com/freeCodeCamp/freeCodeCamp.git
```
3. Assicurati che la configurazione sia corretta:
```console
```bash
git remote -v
```
L'output dovrebbe apparire simile al seguente (sostituendo `YOUR_USER_NAME` con il tuo username di GitHub):
```console
```bash
origin https://github.com/YOUR_USER_NAME/freeCodeCamp.git (fetch)
origin https://github.com/YOUR_USER_NAME/freeCodeCamp.git (push)
upstream https://github.com/freeCodeCamp/freeCodeCamp.git (fetch)
@@ -203,12 +203,12 @@ And as always, feel free to ask questions on the ['Contributors' category on our
The default API keys and environment variables are stored in the file `sample.env`. This file needs to be copied to a new file named `.env` that is accessed dynamically during the installation step.
```console
```bash
# Creare una copia del "sample.env" e denominarlo ".env".
# Populate it with the necessary API keys and secrets
```
```console
```bash
cp sample.env .env
```
@@ -220,7 +220,7 @@ The keys in the `.env` file are _not_ required to be changed to run the app loca
This step will install the dependencies required for the application to run:
```console
```bash
pnpm install && pnpm run create:shared
```
@@ -234,7 +234,7 @@ Before you can run the application locally, you will need to start the MongoDB s
Start the MongoDB server in a separate terminal:
```console
```bash
mongod
```
@@ -242,15 +242,14 @@ mongod
Next, let's seed the database. In this step, we run the below command that fills the MongoDB server with some initial data sets that are required by services. These include a few schemas, among other things.
```console
```bash
pnpm run seed
```
By default, you will be signed in as a new user without any completed certifications. Run the following commands if you need to develop with completed certifications:
```console
```bash
pnpm run seed:certified-user
pnpm run seed:exams
```
> [!WARNING] Running `pnpm run seed:certified-user` will log you out. You will have to clear your browser cookies and sign in again.
@@ -259,7 +258,7 @@ pnpm run seed:exams
You can now start up the API server and the client applications.
```console
```bash
pnpm run develop
```
@@ -279,11 +278,12 @@ If you have issues while installing it, check out the [troubleshooting section](
A quick reference to the commands that you will need when working locally.
| command | description |
| ------------------------------ | ------------------------------------------------------------------------------------------------- |
| `pnpm install` | Installs / re-installs all dependencies and bootstraps the different services. |
| `pnpm run seed` | Creates authorized test users and inserts them into MongoDB. |
| `pnpm run seed:certified-user` | Creates authorized test users with certifications fully completed, and inserts them into MongoDB. |
| `pnpm run seed:exams` | Creates exams and inserts them into MongoDB. |
| `pnpm run develop` | Starts the freeCodeCamp API Server and Client Applications. |
| `pnpm run clean` | Uninstalls all dependencies and cleans up caches. |
| command | description |
| ------------------------------ | ------------------------------------------------------------------------------------------------------------- |
| `pnpm install` | Installs / re-installs all dependencies and bootstraps the different services. |
| `pnpm run seed` | Creates authorized test users and inserts them into MongoDB. Also runs `seed:exams` and `seed:surveys` below. |
| `pnpm run seed:certified-user` | Creates authorized test users with certifications fully completed, and inserts them into MongoDB. |
| `pnpm run seed:exams` | Creates exams and inserts them into MongoDB. |
| `pnpm run seed:surveys` | Creates surveys for defaults users and inserts them into MongoDB. |
| `pnpm run develop` | Starts the freeCodeCamp API Server and Client Applications. |
| `pnpm run clean` | Uninstalls all dependencies and cleans up caches. |

View File

@@ -17,7 +17,7 @@ Inizia installando i prerequisiti software per il tuo sistema operativo.
Se Flutter è già installato sulla macchina, eseguire i seguenti comandi per convalidare le versioni:
```console
```bash
flutter --version
dart --version
```
@@ -70,7 +70,7 @@ Esegui questi comandi sulla tua macchina locale:
2. Clona il tuo fork di freeCodeCamp, sostituendo `YOUR_USER_NAME` con il tuo nome utente GitHub
```console
```bash
git clone --depth=1 https://github.com/YOUR_USER_NAME/mobile.git
```
@@ -88,25 +88,25 @@ Hai bisogno di un riferimento dal tuo clone locale al repository `upstream` oltr
1. Spostati nella directory `mobile`:
```console
```bash
cd mobile
```
2. Aggiungi un riferimento remoto al repository freeCodeCamp mobile:
```console
```bash
git remote add upstream https://github.com/freeCodeCamp/mobile.git
```
3. Assicurati che la configurazione sia corretta:
```console
```bash
git remote -v
```
L'output dovrebbe apparire simile al seguente (sostituendo `YOUR_USER_NAME` con il tuo username di GitHub):
```console
```bash
origin https://github.com/YOUR_USER_NAME/mobile.git (fetch)
origin https://github.com/YOUR_USER_NAME/mobile.git (push)
upstream https://github.com/freeCodeCamp/mobile.git (fetch)
@@ -129,20 +129,20 @@ E come sempre, fai liberamente le tue domande nella [categoria 'Contributors' su
Le chiavi API predefinite e le variabili d'ambiente sono memorizzate nel file `sample.env`. This file needs to be copied to a new file named `.env` which is accessed dynamically during the installation step. Ricordati di spostarti nella directory `mobile-app` prima di eseguire i seguenti comandi.
```console
```bash
# Crea una copia di "sample.env" e chiamalo ".env".
# Popolalo con le chiavi API e i segreti necessari:
```
#### **macOS/Linux**
```console
```bash
cp sample.env .env
```
#### **Windows**
```console
```bash
copy sample.env .env
```
@@ -152,7 +152,7 @@ _Non_ è necessario cambiare le chiavi nel file `.env` per eseguire l'applicazio
Questo passaggio installerà le dipendenze richieste per l'esecuzione dell'applicazione:
```console
```bash
flutter pub get
```
@@ -162,7 +162,7 @@ Avvia un emulatore di tua scelta (Android o iOS) e aspetta il processo di avvio
Ora puoi avviare l'app eseguendo il seguente comando:
```console
```bash
flutter run
```
@@ -176,13 +176,13 @@ Segui questi passaggi:
1. Controlla di essere sul branch `main`:
```console
```bash
git status
```
Dovresti ottenere un output come questo:
```console
```bash
On branch main
Your branch is up-to-date with 'origin/main'.
@@ -191,7 +191,7 @@ Segui questi passaggi:
Se non sei sul branch main o la directory su cui stai lavorando non è pulita, risolvi file e commit in sospeso e fai il checkout da `main`:
```console
```bash
git checkout main
```
@@ -205,25 +205,25 @@ Segui questi passaggi:
Aggiorna la tua copia locale del repository upstream freeCodeCamp mobile:
```console
```bash
git fetch upstream
```
Fai un hard reset del tuo branch main con il branch main di freeCodeCamp mobile:
```console
```bash
git reset --hard upstream/main
```
Fai un push del branch main al tuo origin per avere una cronologia pulita nel tuo fork su GitHub:
```console
```bash
git push origin main --force
```
You can validate that your current main matches the upstream/main by performing a diff:
```console
```bash
git diff upstream/main
```
@@ -235,7 +235,7 @@ Segui questi passaggi:
Controlla di essere su `main`, come spiegato in precedenza, e crea un branch da lì:
```console
```bash
git checkout -b fix/update-guide-for-xyz
```
@@ -259,13 +259,13 @@ Segui questi passaggi:
7. Controlla e conferma i file che stai aggiornando:
```console
```bash
git status
```
Questo dovrebbe mostrare un elenco di file `unstaged` che hai modificato.
```console
```bash
On branch feat/documentation
Your branch is up to date with 'upstream/feat/documentation'.
@@ -282,25 +282,25 @@ Segui questi passaggi:
In questo passaggio, dovresti contrassegnare solo i file che hai modificato o aggiunto tu stesso. Se necessario è possibile eseguire un reset e risolvere i file che non hai intenzione di modificare.
```console
```bash
git add path/to/my/changed/file.ext
```
Oppure puoi aggiungere tutti i file `unstaged` all'area di staging:
```console
```bash
git add .
```
Solo i file che sono stati spostati nell'area di staging verranno aggiunti quando effettui un commit.
```console
```bash
git status
```
Output:
```console
```bash
On branch feat/documentation
Your branch is up to date with 'upstream/feat/documentation'.
@@ -313,7 +313,7 @@ Segui questi passaggi:
Ora, è possibile eseguire il commit delle modifiche con un breve messaggio come questo:
```console
```bash
git commit -m "fix: breve messaggio di commit"
```
@@ -345,7 +345,7 @@ Segui questi passaggi:
9. Se ti accorgi di dover modificare un file o aggiornare il messaggio del commit dopo aver fatto un commit puoi farlo dopo aver modificato i file con:
```console
```bash
git commit --amend
```
@@ -353,7 +353,7 @@ Segui questi passaggi:
10. Successivamente, è possibile inviare le modifiche al fork:
```console
```bash
git push origin branch/name-here
```
@@ -363,14 +363,14 @@ Segui questi passaggi:
1. Clone a copy of the [freeCodeCamp repo](https://github.com/freeCodeCamp/freeCodeCamp) locally outside of your local copy of the freeCodeCamp mobile repo. Your folder structure should look like this:
```console
```bash
├── freeCodeCamp
├── mobile
```
2. Change the directory to the freeCodeCamp repo:
```console
```bash
cd freeCodeCamp
```
@@ -378,25 +378,25 @@ Segui questi passaggi:
#### **macOS/Linux**
```console
```bash
cp sample.env .env
```
#### **Windows**
```console
```bash
copy sample.env .env
```
4. Install the dependencies for the freeCodeCamp repo:
```console
```bash
pnpm install && pnpm run create:shared
```
5. Generate the challenge data JSON file:
```console
```bash
pnpm run build:curriculum
```
@@ -404,54 +404,54 @@ Segui questi passaggi:
#### **macOS/Linux**
```console
```bash
cp ./shared/config/curriculum.json ../mobile/mobile-app/curriculum.json
```
#### **Windows**
```console
```bash
copy .\shared\config\curriculum.json ..\mobile\mobile-app\curriculum.json
```
7. Change directory to the mobile app:
```console
```bash
cd ../mobile/mobile-app
```
8. Install the dependencies for the mobile app:
```console
```bash
flutter pub get
```
9. Update the test file to use the challenge data JSON file:
```console
```bash
sed -i '' 's/..\/..\/shared\/config\/curriculum.json/.\/curriculum.json/g' test/widget_test.dart
```
10. Generate the challenge files:
```console
```bash
flutter test test/widget_test.dart
```
11. Start a local server to serve the challenge files with the help of `serve` package:
```console
```bash
npx serve
```
12. In a different terminal go back to the freeCodeCamp repo:
```console
```bash
cd ../../freeCodeCamp
```
13. Run the cypress tests:
```console
```bash
pnpm cypress run --config retries=1,screenshotOnRunFailure=false,video=false,baseUrl=http://localhost:3000/generated-tests/,specPattern=cypress/e2e/mobile-learn/test-challenges.js -s cypress/e2e/mobile-learn/test-challenges.js -b chrome
```
@@ -482,7 +482,7 @@ Se sei su un sistema operativo diverso e/o continui ad avere dei problemi, visit
If you face issues with the UI, or build errors a cleanup can be useful:
```console
```bash
flutter clean
```

View File

@@ -10,7 +10,7 @@ Questa guida copre alcuni passi comuni con la configurazione di WSL2. Una volta
## Abilita WSL
Segui le istruzioni sulla [documentazione ufficiale](https://docs.microsoft.com/en-us/windows/wsl/install-win10) per installare WSL1 seguito dall'aggiornamento a WSL2.
Follow the instructions on the [official documentation](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to install WSL2.
## Installare Ubuntu
@@ -20,9 +20,11 @@ Segui le istruzioni sulla [documentazione ufficiale](https://docs.microsoft.com/
>
> While you may use other non-Debian-based distributions, they all come with their own 'gotchas' that are beyond the scope of this guide.
As of November 2023, Ubuntu and Debian are the only Linux distributions [officially supported by Playwright](https://playwright.dev/docs/intro#system-requirements), the end-to-end testing library used by freeCodeCamp.
2. Aggiorna le dipendenze per il sistema operativo
```console
```bash
sudo apt update
sudo apt upgrade -y
@@ -70,23 +72,23 @@ Questo fa si che i container siano eseguiti su WSL invece che su Windows. Sarai
Una volta che hai configurato Docker Desktop per lavorare con WSL2, segui questi step per avviare un servizio MongoDB:
1. Avvia un nuovo terminale Ubuntu-18.04
1. Launch a new Ubuntu terminal
2. Pull `MongoDB 4.0.x` from Docker Hub
2. Pull MongoDB from Docker Hub. Please refer to the [Prerequisites](how-to-setup-freecodecamp-locally.md#Prerequisites) table for the current version of MongoDB used by freeCodeCamp. For example, if the version number is `5.0.x`, replace `<x.y>` with `5.0` in the following two code snippets.
```console
docker pull mongo:4.0
```bash
docker pull mongo:<x.y>
```
3. Avvia il servizio MongoDB sulla porta `27017` e configuralo perché sia eseguito automaticamente al riavvio del sistema
```console
```bash
docker run -it \
-v mongodata:/data/db \
-p 27017:27017 \
--name mongodb \
--restart unless-stopped \
-d mongo:4.0
-d mongo:<x.y>
```
4. Ora puoi accedere al servizio sia da Windows che da Ubuntu da `mongodb://localhost:27017`.
@@ -95,25 +97,17 @@ Una volta che hai configurato Docker Desktop per lavorare con WSL2, segui questi
Raccomandiamo di installare la release LTS di Node.js con un gestore di versioni di node (node version manager): [nvm](https://github.com/nvm-sh/nvm#installing-and-updating).
Una volta installato usa questi comandi per installare e usare la versione di Node.js che ti serve
Once installed use this command to install and use the latest Node.js LTS version:
```console
```bash
nvm install --lts
# O
# nvm install <version>
nvm install 14
# Usage
# nvm use <version>
nvm use 12
```
Node.js ha in dotazione `npm`, che puoi usare per installare `pnpm`:
For instructions on installing and using a different version of Node.js, please refer to the [nvm docs](https://github.com/nvm-sh/nvm#usage).
```console
Node.js comes bundled with `npm`, which you can use to install `pnpm`:
```bash
npm install -g pnpm
```
@@ -125,7 +119,104 @@ Now that you have installed the pre-requisites, follow [our local setup guide](h
>
> Please note, at this time the setup for Cypress tests (and related GUI needs) is a work in progress. Dovresti essere comunque in grado di lavorare sulla maggior parte del codebase.
## Link Utili
## Optimize Windows and WSL
> [!NOTE]
>
> The following tips were collected from across the web and have not gone through vigorous testing. Your mileage may vary.
### Adjust processer scheduling for background services
This may reduce incidents of Docker containers crashing due to lack of resources.
Open the System Properties control panel by pressing <kbd>Win + R</kbd> and entering `sysdm.cpl`
<details>
<summary>
Enter <code>sysdm.cpl</code> in the Run dialog (screenshot)
</summary>
<br>
<img src="https://raw.githubusercontent.com/freeCodeCamp/freeCodeCamp/main/docs/images/wsl/run-sysdm.png" alt="Enter `sysdm.cpl` in the Run dialog" />
</details>
<br>
Go to Advanced -> Performance -> Settings…
<details>
<summary>
Performance Settings button under Advanced tab in System Properties (screenshot)
</summary>
<br>
<img src="https://raw.githubusercontent.com/freeCodeCamp/freeCodeCamp/main/docs/images/wsl/advanced-performance-settings.png" alt="Performance Settings button under Advanced tab in System Properties" />
</details>
<br>
Under Advanced -> Processor scheduling, choose "Background services". Do not close the window. Continue to the next tip.
<details>
<summary>
Background services radio button under Advanced tab in Performance Options (screenshot)
</summary>
<br>
<img src="https://raw.githubusercontent.com/freeCodeCamp/freeCodeCamp/main/docs/images/wsl/background-services.png" alt="Background services radio button under Advanced tab in Performance Options" />
</details>
### Increase the size of Windows paging file for the system drive
Under Advanced -> Virtual memory, click "Change…"
<details>
<summary>
Change virtual memory button under Advanced tab in Performance Options (screenshot)
</summary>
<br>
<img src="https://raw.githubusercontent.com/freeCodeCamp/freeCodeCamp/main/docs/images/wsl/advanced-virtual-memory.png" alt="Change virtual memory button under Advanced tab in Performance Options" />
</details>
<br>
Choose "Custom size". Set the initial size to 1.5x and the maximum size to 3x of your physical memory. Then click "Set".
<details>
<summary>
Set custom size button in Virtual Memory window (screenshot)
</summary>
<br>
<img src="https://raw.githubusercontent.com/freeCodeCamp/freeCodeCamp/main/docs/images/wsl/set-custom-size.png" alt="Set custom size button in Virtual Memory window" />
</details>
### Increase the size of memory allocated to WSL
Create a [`.wslconfig` file](https://learn.microsoft.com/en-us/windows/wsl/wsl-config#configuration-setting-for-wslconfig) in your [`%UserProfile%` directory](https://learn.microsoft.com/en-us/windows/wsl/wsl-config#wslconfig) (typically `C:\Users\<UserName>\.wslconfig`). Please read the [WSL documentation](https://learn.microsoft.com/en-us/windows/wsl/wsl-config#configuration-setting-for-wslconfig) carefully and replace `x` with values that suit your own needs:
```ini
# Settings apply across all Linux distros running on WSL 2
[wsl2]
# How much memory to assign to the WSL 2 VM. The default value might not be enough
memory=xGB
# How much swap space to add to the WSL 2 VM, default is 25% of available RAM
swap=xGB
```
### Increase Node.js max old space size
This fixes the ["JavaScript heap out of memory" error](https://stackoverflow.com/a/54456814) with ESLint. Add the following to your `~/.bashrc` or `~/.zshrc`:
```sh
export NODE_OPTIONS="--max-old-space-size=4096"
```
### Avoid `pnpm run test`
Instead, use the script [appropriate to your PR](https://forum.freecodecamp.org/t/wsl-performance-issues-while-working-on-the-codebase/644215/2#:~:text=usually%2C%20you%20just%20want%20to%20test%20something%20specific%20to%20either%20the%20curriculum%20or%20the%20client%20or%20the%20api%20-%20almost%20never%20all%203.); either `pnpm run test:api`, `pnpm run test:curriculum`, or `pnpm run test-client`.
## Useful Links
- [A WSL2 Dev Setup with Ubuntu 20.04, Node.js, MongoDB, VS Code, and Docker](https://hn.mrugesh.dev/wsl2-dev-setup-with-ubuntu-nodejs-mongodb-and-docker) - an article by Mrugesh Mohapatra (Staff Developer at freeCodeCamp.org)
- Domande frequenti su:

View File

@@ -232,6 +232,8 @@ Sentences should be clear and concise with minimal jargon. If used, jargon shoul
Keep paragraphs short (around 1-4 sentences). People are more likely to read several short paragraphs than a wall of text.
Use american english, e.g., use `labeled` instead of `labelled`.
Challenge text should use the second person ("you") to help to give it a conversational tone. This way the text and instructions seem to speak directly to the camper working through the challenge. Try to avoid using the first person ("I", "we", "let's", and "us").
Don't use outbound links. These interrupt the flow. Campers should never have to google anything during these challenges. If there are resources you think campers would benefit from, add them to the challenge's Guide-related article.
@@ -306,7 +308,7 @@ Le sfide dovrebbero avere il numero minimo di test per verificare che un camper
Il nostro obbiettivo è comunicare il singolo punto che la sfida sta cercando di insegnare, e testare che abbiano capito il punto.
I test delle sfide possono fare uso delle librerie di asserzioni Node.js e Chai.js. E, se necessario, il codice generato dall'utente può essere acceduto dalla variabile `code`. In aggiunta, l'oggetto `__helpers` mette a disposizione diverse funzioni che semplificano il processo di scrittura dei test. Le funzioni disponibili sono definite in _client/src/utils/curriculum-helpers.ts_.
I test delle sfide possono fare uso delle librerie di asserzioni Node.js e Chai.js. E, se necessario, il codice generato dall'utente può essere acceduto dalla variabile `code`. In aggiunta, l'oggetto `__helpers` mette a disposizione diverse funzioni che semplificano il processo di scrittura dei test. The available functions are defined in the [curriculum-helpers](https://github.com/freeCodeCamp/curriculum-helpers/blob/main/lib/index.ts) repo.
## Formatting Seed Code

View File

@@ -16,7 +16,7 @@ Andiamo a vedere come funzionano il framework e gli strumenti.
Most of the files for translating the platform are located in the [`client/i18n`](https://github.com/freeCodeCamp/freeCodeCamp/tree/main/client/i18n) folder. Each language has a directory that contains JSON files with the translations.
```console
```bash
config
└── i18n.ts
...

View File

@@ -47,7 +47,7 @@ In genere non è necessario modificare alcuna configurazione o costruire il sito
Install freeCodeCamp locally ([see the local setup guide](how-to-setup-freecodecamp-locally)), we bundled the CLI with the development tools so you can run the command below as needed from the root of the repo:
```console
```bash
pnpm run docs:serve
```

View File

@@ -16,7 +16,7 @@ Se sei su un sistema operativo diverso o continui ad avere dei problemi, visita
When you build the client, Gatsby will cache the Fonts, language strings, and UI. Se uno di loro non è memorizzato nella cache, esegui quanto segue:
```console
```bash
pnpm run clean
pnpm install
pnpm run seed
@@ -53,7 +53,7 @@ git clean -ifdX
If you can't sign in, and instead you see a banner with an error message saying that the error will be reported to freeCodeCamp, please double-check that your local port `3000` is not in use by a different program.
#### **From Terminal:**
```console
```bash
netstat -a | grep "3000"
tcp4 0 0 0.0.0.0:3000 DESKTOP LISTEN

View File

@@ -303,19 +303,19 @@ doctl compute droplet list --format "ID,Name,PublicIPv4"
パッケージ情報を更新します。
```console
```bash
sudo apt update
```
インストール済みパッケージをアップグレードします。
```console
```bash
sudo apt upgrade -y
```
未使用のパッケージをクリーンアップします。
```console
```bash
sudo apt autoremove -y
```
@@ -331,7 +331,7 @@ NGINX 設定は [このリポジトリ](https://github.com/freeCodeCamp/nginx-co
1. NGINX をインストールし、リポジトリから設定します。
```console
```bash
sudo su
cd /var/www/html
@@ -352,7 +352,7 @@ NGINX 設定は [このリポジトリ](https://github.com/freeCodeCamp/nginx-co
既存の証明書を移動させます。
```console
```bash
# Local
scp -r username@source-server-public-ip:/etc/nginx/ssl ./
scp -pr ./ssl username@target-server-public-ip:/tmp/
@@ -364,7 +364,7 @@ NGINX 設定は [このリポジトリ](https://github.com/freeCodeCamp/nginx-co
アップストリーム設定を更新します。
```console
```bash
vi configs/upstreams.conf
```
@@ -382,7 +382,7 @@ NGINX 設定は [このリポジトリ](https://github.com/freeCodeCamp/nginx-co
1. 以下のコマンドを使用して NGINX サービスのステータスを確認します。
```console
```bash
sudo systemctl status nginx
```
@@ -396,13 +396,13 @@ NGINX インスタンスへの設定変更は、GitHub 上でメンテナンス
1. SSH でインスタンスに接続し、sudo と入力します。
```console
```bash
sudo su
```
2. 最新の設定コードを取得します。
```console
```bash
cd /etc/nginx
git fetch --all --prune
git reset --hard origin/main
@@ -410,7 +410,7 @@ git reset --hard origin/main
3. 設定 [with Signals](https://docs.nginx.com/nginx/admin-guide/basic-functionality/runtime-control/#controlling-nginx) をテストして再度読み込みます。
```console
```bash
nginx -t
nginx -s reload
```
@@ -419,7 +419,7 @@ nginx -s reload
1. ノードバイナリのビルドツール (`node-gyp`) をインストールします。
```console
```bash
sudo apt install build-essential
```
@@ -431,19 +431,19 @@ sudo apt install build-essential
2. Install pnpm globally.
```console
```bash
npm install -g pnpm
```
3. Install pm2 globally.
```console
```bash
npm install -g pm2
```
4. Clone freeCodeCamp, set up env, and keys.
```console
```bash
git clone https://github.com/freeCodeCamp/freeCodeCamp.git
cd freeCodeCamp
git checkout prod-current # or any other branch to be deployed
@@ -453,36 +453,36 @@ git checkout prod-current # or any other branch to be deployed
6. Install dependencies
```console
```bash
pnpm install
```
7. Setup pm2 `logrotate` and startup on boot
```console
```bash
pm2 install pm2-logrotate
pm2 startup
```
8. Build the server
```console
```bash
pnpm prebuild && pnpm build:curriculum && pnpm build:server
```
9. Start Instances
```console
```bash
pnpm start:server
```
### ログとモニタリング
```console
```bash
pm2 logs
```
```console
```bash
pm2 monit
```
@@ -496,31 +496,31 @@ pm2 monit
1. Stop all instances
```console
```bash
pm2 stop all
```
2. Install dependencies
```console
```bash
pnpm install
```
3. Build the server
```console
```bash
pnpm prebuild && pnpm build:curriculum && pnpm build:server
```
4. Start Instances
```console
```bash
pnpm start:server && pm2 logs
```
#### 2. Rolling updates - Used for logical changes to code.
```console
```bash
pnpm reload:server && pm2 logs
```
@@ -532,7 +532,7 @@ pnpm reload:server && pm2 logs
2. Update pm2 to use the new version
```console
```bash
pm2 update
```
@@ -540,7 +540,7 @@ pm2 update
1. Install build tools for node binaries (`node-gyp`) etc.
```console
```bash
sudo apt install build-essential
```
@@ -552,7 +552,7 @@ sudo apt install build-essential
2. Update `npm` and install PM2 and setup `logrotate` and startup on boot
```console
```bash
npm i -g npm@8
npm i -g pm2@4
npm install -g serve@13
@@ -562,7 +562,7 @@ sudo apt install build-essential
3. Clone client config, setup env and keys.
```console
```bash
git clone https://github.com/freeCodeCamp/client-config.git client
cd client
```
@@ -571,7 +571,7 @@ sudo apt install build-essential
> Todo: This setup needs to move to S3 or Azure Blob storage
>
> ```console
> ```bash
> echo "serve -c ../serve.json -p 50505 www" > client-start-primary.sh
> chmod +x client-start-primary.sh
> pm2 delete client-primary
@@ -584,11 +584,11 @@ sudo apt install build-essential
### ログとモニタリング
```console
```bash
pm2 logs
```
```console
```bash
pm2 monit
```
@@ -602,7 +602,7 @@ pm2 monit
1. Stop all instances
```console
```bash
pm2 stop all
```
@@ -610,13 +610,13 @@ pm2 monit
3. Start Instances
```console
```bash
pm2 start all --update-env && pm2 logs
```
#### 2. ローリング更新 - コードの論理的な変更に使用されます。
```console
```bash
pm2 reload all --update-env && pm2 logs
```
@@ -636,7 +636,7 @@ Rocket.Chat クラスタの前で、負荷分散型 (Azure ロードバランサ
1. Install NGINX and configure from repository.
```console
```bash
sudo su
cd /var/www/html
@@ -657,7 +657,7 @@ Rocket.Chat クラスタの前で、負荷分散型 (Azure ロードバランサ
Move over existing certificates:
```console
```bash
# Local
scp -r username@source-server-public-ip:/etc/nginx/ssl ./
scp -pr ./ssl username@target-server-public-ip:/tmp/
@@ -669,7 +669,7 @@ Rocket.Chat クラスタの前で、負荷分散型 (Azure ロードバランサ
Update Upstream Configurations:
```console
```bash
vi configs/upstreams.conf
```
@@ -687,7 +687,7 @@ Rocket.Chat クラスタの前で、負荷分散型 (Azure ロードバランサ
1. Install Docker and configure from the repository
```console
```bash
git clone https://github.com/freeCodeCamp/chat-config.git chat
cd chat
```
@@ -696,7 +696,7 @@ Rocket.Chat クラスタの前で、負荷分散型 (Azure ロードバランサ
3. Run rocket-chat server
```console
```bash
docker-compose config
docker-compose up -d
```
@@ -705,13 +705,13 @@ Rocket.Chat クラスタの前で、負荷分散型 (Azure ロードバランサ
1. Check status for NGINX service using the below command:
```console
```bash
sudo systemctl status nginx
```
2. Check status for running docker instances with:
```console
```bash
docker ps
```
@@ -723,13 +723,13 @@ NGINX インスタンスへの設定変更は、GitHub 上でメンテナンス
1. SSH into the instance and enter sudo
```console
```bash
sudo su
```
2. Get the latest config code.
```console
```bash
cd /etc/nginx
git fetch --all --prune
git reset --hard origin/main
@@ -737,7 +737,7 @@ NGINX インスタンスへの設定変更は、GitHub 上でメンテナンス
3. Test and reload the config [with Signals](https://docs.nginx.com/nginx/admin-guide/basic-functionality/runtime-control/#controlling-nginx).
```console
```bash
nginx -t
nginx -s reload
```
@@ -746,44 +746,44 @@ NGINX インスタンスへの設定変更は、GitHub 上でメンテナンス
1. SSH into the instance and navigate to the chat config path
```console
```bash
cd ~/chat
```
2. Get the latest config code.
```console
```bash
git fetch --all --prune
git reset --hard origin/main
```
3. Pull down the latest docker image for Rocket.Chat
```console
```bash
docker-compose pull
```
4. Update the running instances
```console
```bash
docker-compose up -d
```
5. Validate the instances are up
```console
```bash
docker ps
```
6. Cleanup extraneous resources
```console
```bash
docker system prune --volumes
```
Output:
```console
```bash
WARNING! This will remove:
- all stopped containers
- all networks not used by at least one container
@@ -802,7 +802,7 @@ NGINX インスタンスへの設定変更は、GitHub 上でメンテナンス
(Digital Ocean 上でホストされている) VM に ssh で接続します。
```console
```bash
cd tools
git pull origin master
pnpm install
@@ -814,7 +814,7 @@ pm2 restart contribute-app
現在インストールされている node と npm のバージョンをリストアップします。
```console
```bash
nvm -v
node -v
npm -v
@@ -824,25 +824,25 @@ nvm ls
最新の Node.js LTS をインストールし、グローバルパッケージを再インストールします。
```console
```bash
nvm install --lts --reinstall-packages-from=default
```
インストールされたパッケージを確認します。
```console
```bash
npm ls -g --depth=0
```
Alias the `default` Node.js version to the current LTS (pinned to the latest major version)
```console
```bash
nvm alias default 16
```
(オプション) 旧バージョンをアンインストールします。
```console
```bash
nvm uninstall <version>
```
@@ -852,31 +852,31 @@ nvm uninstall <version>
`unstartup` コマンドでアンインストールの手順 / コマンドを取得し、出力を使用して systemctl サービスを削除します。
```console
```bash
pm2 unstartup
```
`startup` コマンドでインストールの手順 / コマンドを取得し、出力を使用して systemctl サービスを追加します。
```console
```bash
pm2 startup
```
以下は、PM2 からリストへのクイックコマンド、保存されたプロセスの復元などです。
```console
```bash
pm2 ls
```
```console
```bash
pm2 resurrect
```
```console
```bash
pm2 save
```
```console
```bash
pm2 logs
```
@@ -898,32 +898,32 @@ https://dev.azure.com/freeCodeCamp-org/_usersSettings/tokens から入手でき
1. Navigate and check status of the service
```console
```bash
cd ~/azagent
sudo ./svc.sh status
```
2. Stop the service
```console
```bash
sudo ./svc.sh stop
```
3. Uninstall the service
```console
```bash
sudo ./svc.sh uninstall
```
4. Remove the agent from the pipeline pool
```console
```bash
./config.sh remove
```
5. Remove the config files
```console
```bash
cd ~
rm -rf ~/azagent
```
@@ -938,7 +938,7 @@ https://dev.azure.com/freeCodeCamp-org/_usersSettings/tokens から入手でき
2. Set up the script to fetch the email list.
```console
```bash
cd /home/freecodecamp/scripts/emails
cp sample.env .env
```
@@ -947,7 +947,7 @@ https://dev.azure.com/freeCodeCamp-org/_usersSettings/tokens から入手でき
3. Run the script.
```console
```bash
node get-emails.js emails.csv
```

View File

@@ -26,25 +26,25 @@ Cypress テストもしくは「specs」の書き方については、Cypress
- `./cypress` ディレクトリで、すべてのテストを実行します。
```console
```bash
pnpm run cypress:dev:run
```
- 単一のテストを実行します。
```console
```bash
pnpm run cypress run --spec=cypress/<path_to_test_file>
```
For example:
```console
```bash
pnpm run cypress run --spec=cypress/e2e/default/landing.ts
```
- 開発ビルドを作成するには、開発サーバーを起動し、既存の cypress エンドツーエンドテストをすべて実行します。
```console
```bash
pnpm run e2e:dev:run
```
@@ -57,25 +57,25 @@ If starting the Gitpod environment did not automatically develop the environment
- Follow the [MongoDB installation guide](https://www.mongodb.com/basics/get-started).
- Create a config file.
```console
```bash
pnpm run create:shared
```
- データベースをシードします。
```console
```bash
pnpm run seed
```
- サーバーとクライアントを構築します。
```console
```bash
pnpm run develop
```
### 2. Cypress ビルドツールをインストールする
```console
```bash
pnpm run cypress:install-build-tools
```

View File

@@ -4,7 +4,7 @@
To install Playwright run:
```console
```bash
pnpm run playwright:install-build-tools
```
@@ -181,49 +181,49 @@ To run tests with Playwright check the following below
- Make sure you navigate to the e2e repo first
```console
```bash
cd e2e
```
- To run tests in UI helper mode:
```console
```bash
npx playwright test --ui
```
- To run a single test:
```console
```bash
npx playwright test <filename>
```
For example:
```console
```bash
npx playwright test landing-page.spec.ts
```
- Run a set of test files in respective folders:
```console
```bash
npx playwright test <pathToFolder1> <pathToFolder2>
```
For example:
```console
```bash
npx playwright test tests/todo-page/ tests/landing-page/
```
- Run the test with the title:
```console
```bash
npx playwright test -g <title>
```
For example:
```console
```bash
npx playwright test -g "add a todo item"
```
@@ -233,13 +233,13 @@ Since Playwright runs in Node.js, you can debug it with your debugger of choice
- Debugging all tests:
```console
```bash
npx playwright test --debug
```
- Debugging one test file:
```console
```bash
npx playwright test example.spec.ts --debug
```
@@ -247,7 +247,7 @@ Since Playwright runs in Node.js, you can debug it with your debugger of choice
The HTML Reporter shows you a full report of your tests allowing you to filter the report by browsers, passed tests, failed tests, skipped tests and flaky tests.
```console
```bash
npx playwright show-report
```
@@ -257,13 +257,13 @@ Playwright is generally a solid bullet-proof tool. The contributor has already c
- (MacOs and Linux) If running Playwright results in an error due to kernel dependencies, run the following command:
```console
```bash
pnpm run playwright:install-build-tools-linux
```
- A common error seen in playwright is as follows:
```console
```bash
Error: page.goto: Could not connect: Connection refused
=========================== logs ===========================
navigating to "https://127.0.0.1:8000/", waiting until "load"
@@ -284,7 +284,7 @@ Playwright is generally a solid bullet-proof tool. The contributor has already c
- Another common error seen in playwright is as follows:
```console
```bash
Protocol error (Network.getResponseBody): Request content was evicted from inspector cache
```
@@ -305,25 +305,25 @@ If starting the Gitpod environment did not automatically develop the environment
- Create the .env
```console
```bash
cp sample.env .env
```
- Create a config file.
```console
```bash
pnpm run create:shared
```
- Seed the database
```console
```bash
pnpm run seed
```
- Develop the server and client
```console
```bash
pnpm run develop
```
@@ -331,7 +331,7 @@ If starting the Gitpod environment did not automatically develop the environment
To install necessary dependencies for running Playwright run the following command:
```console
```bash
pnpm run playwright:install-build-tools
```
@@ -339,6 +339,6 @@ pnpm run playwright:install-build-tools
To run all Playwright tests, run the following command:
```console
```bash
npx playwright test
```

View File

@@ -10,13 +10,13 @@ Follow these steps:
1. Validate that you are on the `main` branch:
```console
```bash
git status
```
You should get an output like this:
```console
```bash
On branch main
Your branch is up-to-date with 'origin/main'.
@@ -25,7 +25,7 @@ Follow these steps:
If you got a different message, then you aren't on main or your working directory isn't clean, resolve any outstanding files/commits and checkout `main`:
```console
```bash
git checkout main
```
@@ -39,25 +39,25 @@ Follow these steps:
Update your copy of the freeCodeCamp upstream repository:
```console
```bash
git fetch upstream
```
Hard reset your main branch with the freeCodeCamp main:
```console
```bash
git reset --hard upstream/main
```
Push your main branch to your origin to have a clean history on your fork on GitHub:
```console
```bash
git push origin main --force
```
You can validate that your current main matches the upstream/main by performing a diff:
```console
```bash
git diff upstream/main
```
@@ -69,7 +69,7 @@ Follow these steps:
Check that you are on `main` as explained previously, and branch off from there:
```console
```bash
git checkout -b fix/update-guide-for-xyz
```
@@ -93,13 +93,13 @@ Follow these steps:
7. Check and confirm the files you are updating:
```console
```bash
git status
```
This should show a list of `unstaged` files that you have edited.
```console
```bash
On branch feat/documentation
Your branch is up to date with 'upstream/feat/documentation'.
@@ -118,25 +118,25 @@ Follow these steps:
In this step, you should only mark files that you have edited or added yourself. You can perform a reset and resolve files that you did not intend to change if needed.
```console
```bash
git add path/to/my/changed/file.ext
```
Or you can add all the `unstaged` files to the staging area:
```console
```bash
git add .
```
Only the files that were moved to the staging area will be added when you make a commit.
```console
```bash
git status
```
Output:
```console
```bash
On branch feat/documentation
Your branch is up to date with 'upstream/feat/documentation'.
@@ -151,7 +151,7 @@ Follow these steps:
Now, you can commit your changes with a short message like so:
```console
```bash
git commit -m "fix: my short commit message"
```
@@ -181,7 +181,7 @@ Follow these steps:
9. If you realize that you need to edit a file or update the commit message after making a commit you can do so after editing the files with:
```console
```bash
git commit --amend
```
@@ -189,7 +189,7 @@ Follow these steps:
10. Next, you can push your changes to your fork:
```console
```bash
git push origin branch/name-here
```

View File

@@ -115,14 +115,14 @@ When you are working on regular bugs and features on our development branch `mai
1. Rebase your local copy:
```console
```bash
git checkout <pr-branch>
git pull --rebase upstream main
```
2. Resolve any conflicts and add / edit commits
```console
```bash
# Either
git add .
git commit -m "chore: resolve conflicts"
@@ -134,7 +134,7 @@ When you are working on regular bugs and features on our development branch `mai
3. Push back your changes to the PR
```console
```bash
git push --force origin <pr-branch>
```
@@ -144,7 +144,7 @@ When you are working on features for our upcoming curriculum `next-*` branches,
1. Make sure your upstream comes in sync with your local:
```console
```bash
git checkout main
git fetch --all --prune
git checkout next-python-projects
@@ -155,7 +155,7 @@ When you are working on features for our upcoming curriculum `next-*` branches,
a. Either delete your local branch after taking a backup (if you still have it locally):
```console
```bash
git checkout <pr-branch-name>
# example:
@@ -171,7 +171,7 @@ When you are working on features for our upcoming curriculum `next-*` branches,
b. Or just a backup of your PR branch (if you do not have it locally):
```console
```bash
git checkout -b <backup-branch-name> origin/<pr-branch-name>
# example:
@@ -180,14 +180,14 @@ When you are working on features for our upcoming curriculum `next-*` branches,
3. Start off with a clean slate:
```console
```bash
git checkout -b <pr-branch-name> next-python-projects
git cherry-pick <commit-hash>
```
4. Resolve any conflicts, cleanup, and install dependencies and run tests
```console
```bash
pnpm run clean
pnpm install
@@ -201,6 +201,6 @@ When you are working on features for our upcoming curriculum `next-*` branches,
5. If everything looks good, push back to the PR
```console
```bash
git push --force origin <pr-branch-name>
```

View File

@@ -75,7 +75,7 @@ We primarily support development on Linux and Unix-based systems like Ubuntu and
If Node.js is already installed on your machine, run the following commands to validate the versions:
```console
```bash
node -v
pnpm -v
```
@@ -142,7 +142,7 @@ Run these commands on your local machine:
2. Clone your fork of freeCodeCamp, replacing `YOUR_USER_NAME` with your GitHub Username
```console
```bash
git clone --depth=1 https://github.com/YOUR_USER_NAME/freeCodeCamp.git
```
@@ -160,25 +160,25 @@ You need a reference from your local clone to the `upstream` repository in addit
1. Change the directory to the new freeCodeCamp directory:
```console
```bash
cd freeCodeCamp
```
2. Add a remote reference to the main freeCodeCamp repository:
```console
```bash
git remote add upstream https://github.com/freeCodeCamp/freeCodeCamp.git
```
3. Ensure the configuration looks correct:
```console
```bash
git remote -v
```
The output should look something like below (replacing `YOUR_USER_NAME` with your GitHub username):
```console
```bash
origin https://github.com/YOUR_USER_NAME/freeCodeCamp.git (fetch)
origin https://github.com/YOUR_USER_NAME/freeCodeCamp.git (push)
upstream https://github.com/freeCodeCamp/freeCodeCamp.git (fetch)
@@ -203,12 +203,12 @@ And as always, feel free to ask questions on the ['Contributors' category on our
The default API keys and environment variables are stored in the file `sample.env`. This file needs to be copied to a new file named `.env` that is accessed dynamically during the installation step.
```console
```bash
# "sample.env" のコピーを作成し、".env" という名前を付けます。
# Populate it with the necessary API keys and secrets
```
```console
```bash
cp sample.env .env
```
@@ -220,7 +220,7 @@ The keys in the `.env` file are _not_ required to be changed to run the app loca
This step will install the dependencies required for the application to run:
```console
```bash
pnpm install && pnpm run create:shared
```
@@ -234,7 +234,7 @@ Before you can run the application locally, you will need to start the MongoDB s
Start the MongoDB server in a separate terminal:
```console
```bash
mongod
```
@@ -242,15 +242,14 @@ mongod
Next, let's seed the database. In this step, we run the below command that fills the MongoDB server with some initial data sets that are required by services. These include a few schemas, among other things.
```console
```bash
pnpm run seed
```
By default, you will be signed in as a new user without any completed certifications. Run the following commands if you need to develop with completed certifications:
```console
```bash
pnpm run seed:certified-user
pnpm run seed:exams
```
> [!WARNING] Running `pnpm run seed:certified-user` will log you out. You will have to clear your browser cookies and sign in again.
@@ -259,7 +258,7 @@ pnpm run seed:exams
You can now start up the API server and the client applications.
```console
```bash
pnpm run develop
```
@@ -279,11 +278,12 @@ If you have issues while installing it, check out the [troubleshooting section](
A quick reference to the commands that you will need when working locally.
| command | description |
| ------------------------------ | ------------------------------------------------------------------------------------------------- |
| `pnpm install` | Installs / re-installs all dependencies and bootstraps the different services. |
| `pnpm run seed` | Creates authorized test users and inserts them into MongoDB. |
| `pnpm run seed:certified-user` | Creates authorized test users with certifications fully completed, and inserts them into MongoDB. |
| `pnpm run seed:exams` | Creates exams and inserts them into MongoDB. |
| `pnpm run develop` | Starts the freeCodeCamp API Server and Client Applications. |
| `pnpm run clean` | Uninstalls all dependencies and cleans up caches. |
| command | description |
| ------------------------------ | ------------------------------------------------------------------------------------------------------------- |
| `pnpm install` | Installs / re-installs all dependencies and bootstraps the different services. |
| `pnpm run seed` | Creates authorized test users and inserts them into MongoDB. Also runs `seed:exams` and `seed:surveys` below. |
| `pnpm run seed:certified-user` | Creates authorized test users with certifications fully completed, and inserts them into MongoDB. |
| `pnpm run seed:exams` | Creates exams and inserts them into MongoDB. |
| `pnpm run seed:surveys` | Creates surveys for defaults users and inserts them into MongoDB. |
| `pnpm run develop` | Starts the freeCodeCamp API Server and Client Applications. |
| `pnpm run clean` | Uninstalls all dependencies and cleans up caches. |

View File

@@ -17,7 +17,7 @@ Start by installing the prerequisite software for your operating system.
If Flutter is already installed on your machine, run the following commands to validate the versions:
```console
```bash
flutter --version
dart --version
```
@@ -70,7 +70,7 @@ Run these commands on your local machine:
2. Clone your fork of freeCodeCamp, replacing `YOUR_USER_NAME` with your GitHub Username
```console
```bash
git clone --depth=1 https://github.com/YOUR_USER_NAME/mobile.git
```
@@ -88,25 +88,25 @@ You need a reference from your local clone to the `upstream` repository in addit
1. Change directory to the new `mobile` directory:
```console
```bash
cd mobile
```
2. Add a remote reference to the main freeCodeCamp mobile repository:
```console
```bash
git remote add upstream https://github.com/freeCodeCamp/mobile.git
```
3. Ensure the configuration looks correct:
```console
```bash
git remote -v
```
The output should look something like below (replacing `YOUR_USER_NAME` with your GitHub username):
```console
```bash
origin https://github.com/YOUR_USER_NAME/mobile.git (fetch)
origin https://github.com/YOUR_USER_NAME/mobile.git (push)
upstream https://github.com/freeCodeCamp/mobile.git (fetch)
@@ -129,20 +129,20 @@ And as always, feel free to ask questions on the ['Contributors' category on our
The default API keys and environment variables are stored in the file `sample.env`. This file needs to be copied to a new file named `.env` which is accessed dynamically during the installation step. Remember to change the directory to `mobile-app` before running the following commands.
```console
```bash
# Create a copy of the "sample.env" and name it ".env".
# Populate it with the necessary API keys and secrets:
```
#### **macOS/Linux**
```console
```bash
cp sample.env .env
```
#### **Windows**
```console
```bash
copy sample.env .env
```
@@ -152,7 +152,7 @@ The keys in the `.env` file are _not_ required to be changed to run the app loca
This step will install the dependencies required for the application to run:
```console
```bash
flutter pub get
```
@@ -162,7 +162,7 @@ Start the emulator of your choice(Android or iOS) and wait for the bootup proces
You can now start the app by running the following command:
```console
```bash
flutter run
```
@@ -176,13 +176,13 @@ Follow these steps:
1. Validate that you are on the `main` branch:
```console
```bash
git status
```
You should get an output like this:
```console
```bash
On branch main
Your branch is up-to-date with 'origin/main'.
@@ -191,7 +191,7 @@ Follow these steps:
If you are not on main or your working directory is not clean, resolve any outstanding files/commits and checkout `main`:
```console
```bash
git checkout main
```
@@ -205,25 +205,25 @@ Follow these steps:
Update your local copy of the freeCodeCamp mobile upstream repository:
```console
```bash
git fetch upstream
```
Hard reset your main branch with the freeCodeCamp mobile main:
```console
```bash
git reset --hard upstream/main
```
Push your main branch to your origin to have a clean history on your fork on GitHub:
```console
```bash
git push origin main --force
```
You can validate that your current main matches the upstream/main by performing a diff:
```console
```bash
git diff upstream/main
```
@@ -235,7 +235,7 @@ Follow these steps:
Check that you are on `main` as explained previously, and branch off from there:
```console
```bash
git checkout -b fix/update-guide-for-xyz
```
@@ -259,13 +259,13 @@ Follow these steps:
7. Check and confirm the files you are updating:
```console
```bash
git status
```
This should show a list of `unstaged` files that you have edited.
```console
```bash
On branch feat/documentation
Your branch is up to date with 'upstream/feat/documentation'.
@@ -282,25 +282,25 @@ Follow these steps:
In this step, you should only mark files that you have edited or added yourself. You can perform a reset and resolve files that you did not intend to change if needed.
```console
```bash
git add path/to/my/changed/file.ext
```
Or you can add all the `unstaged` files to the staging area:
```console
```bash
git add .
```
Only the files that were moved to the staging area will be added when you make a commit.
```console
```bash
git status
```
Output:
```console
```bash
On branch feat/documentation
Your branch is up to date with 'upstream/feat/documentation'.
@@ -313,7 +313,7 @@ Follow these steps:
Now, you can commit your changes with a short message like so:
```console
```bash
git commit -m "fix: my short commit message"
```
@@ -345,7 +345,7 @@ Follow these steps:
9. If you realize that you need to edit a file or update the commit message after making a commit you can do so after editing the files with:
```console
```bash
git commit --amend
```
@@ -353,7 +353,7 @@ Follow these steps:
10. Next, you can push your changes to your fork:
```console
```bash
git push origin branch/name-here
```
@@ -363,14 +363,14 @@ Follow these steps:
1. Clone a copy of the [freeCodeCamp repo](https://github.com/freeCodeCamp/freeCodeCamp) locally outside of your local copy of the freeCodeCamp mobile repo. Your folder structure should look like this:
```console
```bash
├── freeCodeCamp
├── mobile
```
2. Change the directory to the freeCodeCamp repo:
```console
```bash
cd freeCodeCamp
```
@@ -378,25 +378,25 @@ Follow these steps:
#### **macOS/Linux**
```console
```bash
cp sample.env .env
```
#### **Windows**
```console
```bash
copy sample.env .env
```
4. Install the dependencies for the freeCodeCamp repo:
```console
```bash
pnpm install && pnpm run create:shared
```
5. Generate the challenge data JSON file:
```console
```bash
pnpm run build:curriculum
```
@@ -404,54 +404,54 @@ Follow these steps:
#### **macOS/Linux**
```console
```bash
cp ./shared/config/curriculum.json ../mobile/mobile-app/curriculum.json
```
#### **Windows**
```console
```bash
copy .\shared\config\curriculum.json ..\mobile\mobile-app\curriculum.json
```
7. Change directory to the mobile app:
```console
```bash
cd ../mobile/mobile-app
```
8. Install the dependencies for the mobile app:
```console
```bash
flutter pub get
```
9. Update the test file to use the challenge data JSON file:
```console
```bash
sed -i '' 's/..\/..\/shared\/config\/curriculum.json/.\/curriculum.json/g' test/widget_test.dart
```
10. Generate the challenge files:
```console
```bash
flutter test test/widget_test.dart
```
11. Start a local server to serve the challenge files with the help of `serve` package:
```console
```bash
npx serve
```
12. In a different terminal go back to the freeCodeCamp repo:
```console
```bash
cd ../../freeCodeCamp
```
13. Run the cypress tests:
```console
```bash
pnpm cypress run --config retries=1,screenshotOnRunFailure=false,video=false,baseUrl=http://localhost:3000/generated-tests/,specPattern=cypress/e2e/mobile-learn/test-challenges.js -s cypress/e2e/mobile-learn/test-challenges.js -b chrome
```
@@ -482,7 +482,7 @@ If you are on a different OS and/or are still running into issues, see [getting
If you face issues with the UI, or build errors a cleanup can be useful:
```console
```bash
flutter clean
```

View File

@@ -10,7 +10,7 @@
## WSLを有効化する
[公式ドキュメント](https://docs.microsoft.com/en-us/windows/wsl/install-win10) の指示に従って、WSL1 をインストールしてから、WSL2 にアップグレードしてください。
Follow the instructions on the [official documentation](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to install WSL2.
## Ubuntu をインストールする
@@ -20,9 +20,11 @@
>
> While you may use other non-Debian-based distributions, they all come with their own 'gotchas' that are beyond the scope of this guide.
As of November 2023, Ubuntu and Debian are the only Linux distributions [officially supported by Playwright](https://playwright.dev/docs/intro#system-requirements), the end-to-end testing library used by freeCodeCamp.
2. OS の依存関係を更新します。
```console
```bash
sudo apt update
sudo apt upgrade -y
@@ -70,23 +72,23 @@ Docker Desktop がインストールされたら、[この手順に従って](ht
WSL2 で動作するように Docker Desktop を設定したら、次の手順に従って MongoDB サービスを起動します。
1. 新しい Ubuntu-18.04 端末を起動します。
1. Launch a new Ubuntu terminal
2. Pull `MongoDB 4.0.x` from Docker Hub
2. Pull MongoDB from Docker Hub. Please refer to the [Prerequisites](how-to-setup-freecodecamp-locally.md#Prerequisites) table for the current version of MongoDB used by freeCodeCamp. For example, if the version number is `5.0.x`, replace `<x.y>` with `5.0` in the following two code snippets.
```console
docker pull mongo:4.0
```bash
docker pull mongo:<x.y>
```
3. MongoDB サービスをポート `27017` で起動し、システム再起動時に自動的に実行するように設定します。
```console
```bash
docker run -it \
-v mongodata:/data/db \
-p 27017:27017 \
--name mongodb \
--restart unless-stopped \
-d mongo:4.0
-d mongo:<x.y>
```
4. Windows または Ubuntu から `mongodb://localhost:27017` でサービスにアクセスできるようになりました。
@@ -95,25 +97,17 @@ WSL2 で動作するように Docker Desktop を設定したら、次の手順
Node バージョンマネジャー - [nvm](https://github.com/nvm-sh/nvm#installing-and-updating) を使用して、Node.js 用の LTS リリースをインストールすることを推奨します。
インストールしたら、以下のようなコマンドを使って、Node.js バージョンをインストールして使用します。
Once installed use this command to install and use the latest Node.js LTS version:
```console
```bash
nvm install --lts
# OR
# nvm install <version>
nvm install 14
# Usage
# nvm use <version>
nvm use 12
```
For instructions on installing and using a different version of Node.js, please refer to the [nvm docs](https://github.com/nvm-sh/nvm#usage).
Node.js comes bundled with `npm`, which you can use to install `pnpm`:
```console
```bash
npm install -g pnpm
```
@@ -125,7 +119,104 @@ Now that you have installed the pre-requisites, follow [our local setup guide](h
>
> Please note, at this time the setup for Cypress tests (and related GUI needs) is a work in progress. それでも、ほとんどのコードベースで作業できるはずです。
## 有用なリンク
## Optimize Windows and WSL
> [!NOTE]
>
> The following tips were collected from across the web and have not gone through vigorous testing. Your mileage may vary.
### Adjust processer scheduling for background services
This may reduce incidents of Docker containers crashing due to lack of resources.
Open the System Properties control panel by pressing <kbd>Win + R</kbd> and entering `sysdm.cpl`
<details>
<summary>
Enter <code>sysdm.cpl</code> in the Run dialog (screenshot)
</summary>
<br>
<img src="https://raw.githubusercontent.com/freeCodeCamp/freeCodeCamp/main/docs/images/wsl/run-sysdm.png" alt="Enter `sysdm.cpl` in the Run dialog" />
</details>
<br>
Go to Advanced -> Performance -> Settings…
<details>
<summary>
Performance Settings button under Advanced tab in System Properties (screenshot)
</summary>
<br>
<img src="https://raw.githubusercontent.com/freeCodeCamp/freeCodeCamp/main/docs/images/wsl/advanced-performance-settings.png" alt="Performance Settings button under Advanced tab in System Properties" />
</details>
<br>
Under Advanced -> Processor scheduling, choose "Background services". Do not close the window. Continue to the next tip.
<details>
<summary>
Background services radio button under Advanced tab in Performance Options (screenshot)
</summary>
<br>
<img src="https://raw.githubusercontent.com/freeCodeCamp/freeCodeCamp/main/docs/images/wsl/background-services.png" alt="Background services radio button under Advanced tab in Performance Options" />
</details>
### Increase the size of Windows paging file for the system drive
Under Advanced -> Virtual memory, click "Change…"
<details>
<summary>
Change virtual memory button under Advanced tab in Performance Options (screenshot)
</summary>
<br>
<img src="https://raw.githubusercontent.com/freeCodeCamp/freeCodeCamp/main/docs/images/wsl/advanced-virtual-memory.png" alt="Change virtual memory button under Advanced tab in Performance Options" />
</details>
<br>
Choose "Custom size". Set the initial size to 1.5x and the maximum size to 3x of your physical memory. Then click "Set".
<details>
<summary>
Set custom size button in Virtual Memory window (screenshot)
</summary>
<br>
<img src="https://raw.githubusercontent.com/freeCodeCamp/freeCodeCamp/main/docs/images/wsl/set-custom-size.png" alt="Set custom size button in Virtual Memory window" />
</details>
### Increase the size of memory allocated to WSL
Create a [`.wslconfig` file](https://learn.microsoft.com/en-us/windows/wsl/wsl-config#configuration-setting-for-wslconfig) in your [`%UserProfile%` directory](https://learn.microsoft.com/en-us/windows/wsl/wsl-config#wslconfig) (typically `C:\Users\<UserName>\.wslconfig`). Please read the [WSL documentation](https://learn.microsoft.com/en-us/windows/wsl/wsl-config#configuration-setting-for-wslconfig) carefully and replace `x` with values that suit your own needs:
```ini
# Settings apply across all Linux distros running on WSL 2
[wsl2]
# How much memory to assign to the WSL 2 VM. The default value might not be enough
memory=xGB
# How much swap space to add to the WSL 2 VM, default is 25% of available RAM
swap=xGB
```
### Increase Node.js max old space size
This fixes the ["JavaScript heap out of memory" error](https://stackoverflow.com/a/54456814) with ESLint. Add the following to your `~/.bashrc` or `~/.zshrc`:
```sh
export NODE_OPTIONS="--max-old-space-size=4096"
```
### Avoid `pnpm run test`
Instead, use the script [appropriate to your PR](https://forum.freecodecamp.org/t/wsl-performance-issues-while-working-on-the-codebase/644215/2#:~:text=usually%2C%20you%20just%20want%20to%20test%20something%20specific%20to%20either%20the%20curriculum%20or%20the%20client%20or%20the%20api%20-%20almost%20never%20all%203.); either `pnpm run test:api`, `pnpm run test:curriculum`, or `pnpm run test-client`.
## Useful Links
- [A WSL2 Dev Setup with Ubuntu 20.04, Node.js, MongoDB, VS Code, and Docker](https://hn.mrugesh.dev/wsl2-dev-setup-with-ubuntu-nodejs-mongodb-and-docker) - an article by Mrugesh Mohapatra (Staff Developer at freeCodeCamp.org)
- よくある質問:

View File

@@ -232,6 +232,8 @@ Sentences should be clear and concise with minimal jargon. If used, jargon shoul
Keep paragraphs short (around 1-4 sentences). People are more likely to read several short paragraphs than a wall of text.
Use american english, e.g., use `labeled` instead of `labelled`.
Challenge text should use the second person ("you") to help to give it a conversational tone. This way the text and instructions seem to speak directly to the camper working through the challenge. Try to avoid using the first person ("I", "we", "let's", and "us").
Don't use outbound links. These interrupt the flow. Campers should never have to google anything during these challenges. If there are resources you think campers would benefit from, add them to the challenge's Guide-related article.
@@ -306,7 +308,7 @@ The following is an example of code:
私たちの目標は、チャレンジが教えようとしている単一のポイントを伝え、そのポイントを理解していることをテストすることです。
チャレンジテストでは、Node.js と Chai.js アサーションライブラリを使用できます。 また、必要に応じて、`code` 変数からユーザーが生成したコードにアクセスすることもできます。 さらに、 `__helpers` オブジェクトは、テストを記述するプロセスを簡略化するいくつかの関数を公開します。 利用可能な関数は、_client/src/utils/curriculum-helpers.ts_ に定義されています。
チャレンジテストでは、Node.js と Chai.js アサーションライブラリを使用できます。 また、必要に応じて、`code` 変数からユーザーが生成したコードにアクセスすることもできます。 さらに、 `__helpers` オブジェクトは、テストを記述するプロセスを簡略化するいくつかの関数を公開します。 The available functions are defined in the [curriculum-helpers](https://github.com/freeCodeCamp/curriculum-helpers/blob/main/lib/index.ts) repo.
## Formatting Seed Code

View File

@@ -16,7 +16,7 @@ i18n フレームワークとツールがどのように機能するかを理解
Most of the files for translating the platform are located in the [`client/i18n`](https://github.com/freeCodeCamp/freeCodeCamp/tree/main/client/i18n) folder. Each language has a directory that contains JSON files with the translations.
```console
```bash
config
└── i18n.ts
...

View File

@@ -47,7 +47,7 @@ Typically you would not need to change any configuration or build the site local
Install freeCodeCamp locally ([see the local setup guide](how-to-setup-freecodecamp-locally)), we bundled the CLI with the development tools so you can run the command below as needed from the root of the repo:
```console
```bash
pnpm run docs:serve
```

View File

@@ -16,7 +16,7 @@ If you are on a different OS or are still facing issues, see [getting help](#get
When you build the client, Gatsby will cache the Fonts, language strings, and UI. If one of them isn't cached, run the following:
```console
```bash
pnpm run clean
pnpm install
pnpm run seed
@@ -53,7 +53,7 @@ git clean -ifdX
If you can't sign in, and instead you see a banner with an error message saying that the error will be reported to freeCodeCamp, please double-check that your local port `3000` is not in use by a different program.
#### **From Terminal:**
```console
```bash
netstat -a | grep "3000"
tcp4 0 0 0.0.0.0:3000 DESKTOP LISTEN

View File

@@ -303,19 +303,19 @@ Você deve manter as VMs atualizadas realizando atualizações e atualizações.
Atualize informações do pacote
```console
```bash
sudo apt update
```
Atualize pacotes instalados
```console
```bash
sudo apt upgrade -y
```
Limpe pacotes não utilizados
```console
```bash
sudo apt autoremove -y
```
@@ -331,7 +331,7 @@ Provisionando VMs com o código
1. Instale o NGINX e configure a partir do repositório.
```console
```bash
sudo su
cd /var/www/html
@@ -352,7 +352,7 @@ Provisionando VMs com o código
Mova os certificados existentes:
```console
```bash
# Localmente
scp -r username@source-server-public-ip:/etc/nginx/ssl ./
scp -pr ./ssl username@target-server-public-ip:/tmp/
@@ -364,7 +364,7 @@ Provisionando VMs com o código
Atualize as configurações upstream:
```console
```bash
vi configs/upstreams.conf
```
@@ -382,7 +382,7 @@ Provisionando VMs com o código
1. Verifique o estado do serviço NGINX usando o comando abaixo:
```console
```bash
sudo systemctl status nginx
```
@@ -396,13 +396,13 @@ Configure as mudanças das instâncias do NGINX que são mantidas no GitHub, est
1. SSH na instância e digite sudo
```console
```bash
sudo su
```
2. Obtenha o código de configuração mais recente.
```console
```bash
cd /etc/nginx
git fetch --all --prune
git reset --hard origin/main
@@ -410,7 +410,7 @@ git reset --hard origin/main
3. Teste e recarregue a configuração [com Signals](https://docs.nginx.com/nginx/admin-guide/basic-functionality/runtime-control/#controlling-nginx).
```console
```bash
nginx -t
nginx -s reload
```
@@ -419,7 +419,7 @@ nginx -s reload
1. Instale ferramentas de compilação para binários node (`node-gyp`), etc.
```console
```bash
sudo apt install build-essential
```
@@ -431,19 +431,19 @@ Provisionando MVs com o código
2. Instale o pnpm globalmente.
```console
```bash
npm install -g pnpm
```
3. Instale o pm2 globalmente.
```console
```bash
npm install -g pm2
```
4. Faça a clonagem do freeCodeCamp, configure env e as chaves.
```console
```bash
git clone https://github.com/freeCodeCamp/freeCodeCamp.git
cd freeCodeCamp
git checkout prod-current # ou qualquer outra branch a ser implementada
@@ -453,36 +453,36 @@ git checkout prod-current # ou qualquer outra branch a ser implementada
6. Instale as dependências
```console
```bash
pnpm install
```
7. Configure o pm2 `logrotate` e inicialize no boot
```console
```bash
pm2 install pm2-logrotate
pm2 startup
```
8. Compile o servidor
```console
```bash
pnpm prebuild && pnpm build:curriculum && pnpm build:server
```
9. Inicie as instâncias
```console
```bash
pnpm start:server
```
### Registro e monitoramento
```console
```bash
pm2 logs
```
```console
```bash
pm2 monit
```
@@ -496,31 +496,31 @@ Mudanças no código devem ser implementadas na instância da API de tempos em t
1. Pare todas as instâncias
```console
```bash
pm2 stop all
```
2. Instale as dependências
```console
```bash
pnpm install
```
3. Compile o servidor
```console
```bash
pnpm prebuild && pnpm build:curriculum && pnpm build:server
```
4. Inicie as instâncias
```console
```bash
pnpm start:server && pm2 logs
```
#### 2. Atualizações contínuas - Usadas para mudanças lógicas no código.
```console
```bash
pnpm reload:server && pm2 logs
```
@@ -532,7 +532,7 @@ pnpm reload:server && pm2 logs
2. Atualize o pm2 para que ele use a nova versão
```console
```bash
pm2 update
```
@@ -540,7 +540,7 @@ pm2 update
1. Instale ferramentas de compilação para os binários do node (`node-gyp` e outros).
```console
```bash
sudo apt install build-essential
```
@@ -552,7 +552,7 @@ Provisionando MVs com o código
2. Atualize o `npm` e instale o PM2 e configure `logrotate` e inicie quando reiniciar
```console
```bash
npm i -g npm@8
npm i -g pm2@4
npm install -g serve@13
@@ -562,7 +562,7 @@ Provisionando MVs com o código
3. Faça a clonagem do client, configure env e as chaves.
```console
```bash
git clone https://github.com/freeCodeCamp/client-config.git client
cd client
```
@@ -571,7 +571,7 @@ Provisionando MVs com o código
> A fazer: Esta configuração precisa ser movida para S3 ou armazenamento Azure Blob
>
> ```console
> ```bash
> echo "serve -c ../serve.json -p 50505 www" > client-start-primary.sh
> chmod +x client-start-primary.sh
> pm2 delete client-primary
@@ -584,11 +584,11 @@ Provisionando MVs com o código
### Registro e monitoramento
```console
```bash
pm2 logs
```
```console
```bash
pm2 monit
```
@@ -602,7 +602,7 @@ As alterações no código precisam ser implementadas para as instâncias de API
1. Pare todas as instâncias
```console
```bash
pm2 stop all
```
@@ -610,13 +610,13 @@ As alterações no código precisam ser implementadas para as instâncias de API
3. Inicie as instâncias
```console
```bash
pm2 start all --update-env && pm2 logs
```
#### 2. Atualizações contínuas - Usado par mudanças lógicas no código.
```console
```bash
pm2 reload all --update-env && pm2 logs
```
@@ -636,7 +636,7 @@ Provisionando MVs com código
1. Instale o NGINX e configure a partir do repositório.
```console
```bash
sudo su
cd /var/www/html
@@ -657,7 +657,7 @@ Provisionando MVs com código
Mova os certificados existentes:
```console
```bash
# Local
scp -r username@source-server-public-ip:/etc/nginx/ssl ./
scp -pr ./ssl username@target-server-public-ip:/tmp/
@@ -669,7 +669,7 @@ Provisionando MVs com código
Atualize as configurações upstream:
```console
```bash
vi configs/upstreams.conf
```
@@ -687,7 +687,7 @@ Provisionando MVs com código
1. Instale o Docker e configure a partir do repositório
```console
```bash
git clone https://github.com/freeCodeCamp/chat-config.git chat
cd chat
```
@@ -696,7 +696,7 @@ Provisionando MVs com código
3. Execute o servidor do rocket-chat
```console
```bash
docker-compose config
docker-compose up -d
```
@@ -705,13 +705,13 @@ Provisionando MVs com código
1. Verifique o estado do serviço NGINX usando o comando abaixo:
```console
```bash
sudo systemctl status nginx
```
2. Verifique o estado das instâncias do Docker que estão sendo executadas com:
```console
```bash
docker ps
```
@@ -723,13 +723,13 @@ As alterações na configuração das nossas instâncias NGINX são mantidas no
1. Use o SSH na instância e digite sudo
```console
```bash
sudo su
```
2. Obtenha o código de configuração mais recente.
```console
```bash
cd /etc/nginx
git fetch --all --prune
git reset --hard origin/main
@@ -737,7 +737,7 @@ As alterações na configuração das nossas instâncias NGINX são mantidas no
3. Teste e recarregue a configuração [com Signals](https://docs.nginx.com/nginx/admin-guide/basic-functionality/runtime-control/#controlling-nginx).
```console
```bash
nginx -t
nginx -s reload
```
@@ -746,44 +746,44 @@ As alterações na configuração das nossas instâncias NGINX são mantidas no
1. Use SSH na instância e vá para onde está o arquivo de configuração do chat
```console
```bash
cd ~/chat
```
2. Obtenha o código de configuração mais recente.
```console
```bash
git fetch --all --prune
git reset --hard origin/main
```
3. Obtenha a imagem docker mais recente do Rocket.Chat
```console
```bash
docker-compose pull
```
4. Atualize as instâncias que estão executando
```console
```bash
docker-compose up -d
```
5. Veja se as instâncias estão executando
```console
```bash
docker ps
```
6. Limpe recursos estranhos
```console
```bash
docker system prune --volumes
```
Resultado:
```console
```bash
WARNING! This will remove:
- all stopped containers
- all networks not used by at least one container
@@ -802,7 +802,7 @@ As alterações na configuração das nossas instâncias NGINX são mantidas no
ssh na VM (hospedada na Digital Ocean).
```console
```bash
cd tools
git pull origin master
pnpm install
@@ -814,7 +814,7 @@ pm2 restart contribute-app
Liste as versões do node e do npm instaladas
```console
```bash
nvm -v
node -v
npm -v
@@ -824,25 +824,25 @@ nvm ls
Instale a versão LTS Node.js mais recente e reinstale qualquer pacote global
```console
```bash
nvm install --lts --reinstall-packages-from=default
```
Verifique os pacotes instalados
```console
```bash
npm ls -g --depth=0
```
Coloque um alias na versão `default` do Node.js para que seja a LTS atual (marcada como a versão major mais recente)
```console
```bash
nvm alias default 16
```
(Opcional) Desinstale versões antigas
```console
```bash
nvm uninstall <versão>
```
@@ -852,31 +852,31 @@ nvm uninstall <versão>
Obtenha as instruções/comandos de desinstalação com o comando `unstartup` e use a saída para remover os serviços systemctl
```console
```bash
pm2 unstartup
```
Obtenha as instruções/comandos de instalação com o comando `startup` e use a saída para adicionar os serviços systemctl
```console
```bash
pm2 startup
```
Comandos rápidos PM2 para listar, reviver processos salvos, etc.
```console
```bash
pm2 ls
```
```console
```bash
pm2 resurrect
```
```console
```bash
pm2 save
```
```console
```bash
pm2 logs
```
@@ -898,32 +898,32 @@ Atualmente, atualizar os agentes requer que sejam removidos e reconfigurados. Is
1. Vá e verifique o estado do serviço
```console
```bash
cd ~/azagent
sudo ./svc.sh status
```
2. Pare o serviço
```console
```bash
sudo ./svc.sh stop
```
3. Desinstale o serviço
```console
```bash
sudo ./svc.sh uninstall
```
4. Remova o agente do pool do pipeline
```console
```bash
./config.sh remove
```
5. Remova os arquivos de configuração
```console
```bash
cd ~
rm -rf ~/azagent
```
@@ -938,7 +938,7 @@ Nós usamos [uma ferramenta de linha de comando](https://github.com/freecodecamp
2. Configure o script para pegar a lista de email.
```console
```bash
cd /home/freecodecamp/scripts/emails
cp sample.env .env
```
@@ -947,7 +947,7 @@ Nós usamos [uma ferramenta de linha de comando](https://github.com/freecodecamp
3. Rode o script.
```console
```bash
node get-emails.js emails.csv
```

View File

@@ -26,25 +26,25 @@ Para executar testes usando compilações de produção, substitua `dev` por `pr
- Para executar todos os testes no diretório `./cypress`:
```console
```bash
pnpm run cypress:dev:run
```
- Para executar um único teste:
```console
```bash
pnpm run cypress run --spec=cypress/<caminho_para_o_arquivo_de_teste>
```
Por exemplo:
```console
```bash
pnpm run cypress run --spec=cypress/e2e/default/landing.ts
```
- Para criar uma versão de compilação, inicie o servidor de desenvolvimento e execute todos os testes cypress contínuos e funcionais existentes:
```console
```bash
pnpm run e2e:dev:run
```
@@ -57,25 +57,25 @@ Se o ambiente Gitpod não foi criado automaticamente:
- Siga o [guia de instalação do MongoDB](https://www.mongodb.com/basics/get-started).
- Crie um arquivo de configuração.
```console
```bash
pnpm run create:shared
```
- Crie a base de dados
```console
```bash
pnpm run seed
```
- Desenvolva o servidor e o client
```console
```bash
pnpm run develop
```
### 2. Instale as ferramentas de compilação do Cypress
```console
```bash
pnpm run cypress:install-build-tools
```

View File

@@ -4,7 +4,7 @@
Para instalar o Playwright, execute:
```console
```bash
pnpm run playwright:install-build-tools
```
@@ -181,49 +181,49 @@ Para executar testes com o Playwright, verifique o seguinte
- Não se esqueça de navegar primeiro para o repositório e2e
```console
```bash
cd e2e
```
- Para executar testes no modo auxiliar de UI:
```console
```bash
npx playwright test --ui
```
- Para executar um único teste:
```console
```bash
npx playwright test <nome_do_arquivo>
```
Por exemplo:
```console
```bash
npx playwright test landing-page.spec.ts
```
- Para executar um conjunto de arquivos de teste nas respectivas pastas:
```console
```bash
npx playwright test <caminho_da_pasta1> <caminho_da_pasta2>
```
Por exemplo:
```console
```bash
npx playwright test tests/todo-page/ tests/landing-page/
```
- Para executar o teste com o título:
```console
```bash
npx playwright test -g <título>
```
Por exemplo:
```console
```bash
npx playwright test -g "add a todo item"
```
@@ -233,13 +233,13 @@ Como o Playwright é executado no Node.js, você pode depurá-lo com seu depurad
- Depuração de todos os testes:
```console
```bash
npx playwright test --debug
```
- Depuração de um arquivo de teste:
```console
```bash
npx playwright test example.spec.ts --debug
```
@@ -247,7 +247,7 @@ Como o Playwright é executado no Node.js, você pode depurá-lo com seu depurad
O HTML Reporter mostra um relatório completo de seus testes, que permite filtrar o relatório por navegadores, testes que passaram, testes que falharam, testes ignorados e testes não confiáveis.
```console
```bash
npx playwright show-report
```
@@ -257,13 +257,13 @@ O Playwright, geralmente, é uma ferramenta com pouquíssimas chances de erro. O
- (MacOs e Linux) Se executar o Playwright resultar em um erro devido a dependências do kernel, execute o seguinte comando:
```console
```bash
pnpm run playwright:install-build-tools-linux
```
- Um erro comum visto no Playwright é o seguinte:
```console
```bash
Error: page.goto: Could not connect: Connection refused
=========================== logs ===========================
navigating to "https://127.0.0.1:8000/", waiting until "load"
@@ -284,7 +284,7 @@ O Playwright, geralmente, é uma ferramenta com pouquíssimas chances de erro. O
- Outro erro comum visto no Playwright é o seguinte:
```console
```bash
Protocol error (Network.getResponseBody): Request content was evicted from inspector cache
```
@@ -305,25 +305,25 @@ Se, ao iniciar o ambiente do Gitpod, o ambiente não foi desenvolvido automatica
- Criar o arquivo .env
```console
```bash
cp sample.env .env
```
- Crie um arquivo de configuração.
```console
```bash
pnpm run create:shared
```
- Crie o banco de dados
```console
```bash
pnpm run seed
```
- Desenvolva o servidor e o client
```console
```bash
pnpm run develop
```
@@ -331,7 +331,7 @@ Se, ao iniciar o ambiente do Gitpod, o ambiente não foi desenvolvido automatica
Para instalar as dependências necessárias para executar o Playwright, execute o seguinte comando:
```console
```bash
pnpm run playwright:install-build-tools
```
@@ -339,6 +339,6 @@ pnpm run playwright:install-build-tools
Para executar todos os testes do Playwright, execute o seguinte comando:
```console
```bash
npx playwright test
```

View File

@@ -10,13 +10,13 @@ Siga estes passos:
1. Certifique-se que está no branch `main`:
```console
```bash
git status
```
Você deve ver um resultado como este:
```console
```bash
Na branch main
Sua branch está atualizada com 'origin/main'.
@@ -25,7 +25,7 @@ Siga estes passos:
Se você receber uma mensagem diferente, você não está em main ou seu diretório de trabalho não está limpo. Resolva quaisquer arquivos/commits pendentes e saia de `main`:
```console
```bash
git checkout main
```
@@ -39,25 +39,25 @@ Siga estes passos:
Atualize sua cópia do repositório upstream do freeCodeCamp:
```console
```bash
git fetch upstream
```
Faça um hard reset na sua branch main com a main do freeCodeCamp:
```console
```bash
git reset --hard upstream/main
```
Faça um push da sua branch main para a origin para obter um histórico claro em seu fork do GitHub:
```console
```bash
git push origin main --force
```
Você pode validar se sua main atual combina com upstream/main fazendo um diff:
```console
```bash
git diff upstream/main
```
@@ -69,7 +69,7 @@ Siga estes passos:
Veja se você está na `main` como explicado antes e crie uma branch a partir dela:
```console
```bash
git checkout -b fix/update-guide-for-xyz
```
@@ -93,13 +93,13 @@ Siga estes passos:
7. Verifique e confirme os arquivos que você está atualizando:
```console
```bash
git status
```
Isso deve mostrar uma lista dos arquivos `unstaged` que você editou.
```console
```bash
Na branch feat/documentation
Sua branch está atualizada com 'upstream/feat/documentation'.
@@ -118,25 +118,25 @@ Siga estes passos:
Nesta etapa, você só deve marcar arquivos que você editou ou adicionou. Você pode executar um reset e resolver arquivos que você não pretendeu mudar se necessário.
```console
```bash
git add caminho/para/meu/arquivo/alterado.ext
```
Ou você pode adicionar todos os arquivos `unstaged` para a área de preparação:
```console
```bash
git add .
```
Apenas os arquivos que foram movidos para a área de staging serão adicionados quando você fizer um commit.
```console
```bash
git status
```
Resultado:
```console
```bash
Na branch feat/documentation
Sua branch está atualizada com 'upstream/feat/documentation'.
@@ -151,7 +151,7 @@ Siga estes passos:
Agora, você pode fazer o commit das alterações com uma pequena mensagem assim:
```console
```bash
git commit -m "fix: my short commit message"
```
@@ -181,7 +181,7 @@ Siga estes passos:
9. Se você se deu conta que precisa editar um arquivo ou atualizar a mensagem de commit você pode fazer isso assim:
```console
```bash
git commit --amend
```
@@ -189,7 +189,7 @@ Siga estes passos:
10. Em seguida, você pode fazer push das suas alterações no seu fork:
```console
```bash
git push origin branch/nome-aqui
```

View File

@@ -115,14 +115,14 @@ Quando se está trabalhando em erros normais e funcionalidades no seu branch `ma
1. Faça um rebase na sua cópia local:
```console
```bash
git checkout <pr-branch>
git pull --rebase upstream main
```
2. Resolva quaisquer conflitos e adicione / edite commits
```console
```bash
# isso
git add .
git commit -m "chore: resolve conflitos"
@@ -134,7 +134,7 @@ Quando se está trabalhando em erros normais e funcionalidades no seu branch `ma
3. Faça um push das suas alterações para o PR
```console
```bash
git push --force origin <pr-branch>
```
@@ -144,7 +144,7 @@ Quando você estiver trabalhando em funcionalidades para nossos próximos branch
1. Certifique-se de que seu upstream esteja sincronizado com seu local:
```console
```bash
git checkout main
git fetch --all --prune
git checkout next-python-projects
@@ -155,7 +155,7 @@ Quando você estiver trabalhando em funcionalidades para nossos próximos branch
a. Exclua seu branch local depois de ter feito um backup (se você ainda o tem localmente):
```console
```bash
git checkout <pr-branch-nome>
# exemplo:
@@ -171,7 +171,7 @@ Quando você estiver trabalhando em funcionalidades para nossos próximos branch
b. Ou apenas faça um backup do seu branch de PR (se você não o tem localmente):
```console
```bash
git checkout -b <backup-branch-nome> origin/<pr-branch-nome>
# exemplo:
@@ -180,14 +180,14 @@ Quando você estiver trabalhando em funcionalidades para nossos próximos branch
3. Comece do zero:
```console
```bash
git checkout -b <pr-branch-nome> next-python-projects
git cherry-pick <commit-hash>
```
4. Resolva os conflitos, faça a limpeza, instale as dependências e execute os testes
```console
```bash
pnpm run clean
pnpm install
@@ -201,6 +201,6 @@ Quando você estiver trabalhando em funcionalidades para nossos próximos branch
5. Se tudo estiver correto, faça um push ao PR
```console
```bash
git push --force origin <pr-branch-nome>
```

View File

@@ -75,7 +75,7 @@ Apoiamos principalmente o desenvolvimento em sistemas Linux e Unix, como o Ubunt
Se o Node.js já estiver instalado em sua máquina, execute os seguintes comandos para validar as versões:
```console
```bash
node -v
pnpm -v
```
@@ -142,7 +142,7 @@ Execute estes comandos em sua máquina local:
2. Clone seu fork do freeCodeCamp, substituindo `YOUR_USER_NAME` pelo seu nome de usuário do GitHub
```console
```bash
git clone --depth=1 https://github.com/YOUR_USER_NAME/freeCodeCamp.git
```
@@ -160,25 +160,25 @@ Agora que você baixou uma cópia do seu fork, será necessário configurar um r
1. Mude o diretório para o novo diretório freeCodeCamp:
```console
```bash
cd freeCodeCamp
```
2. Adicione uma referência remota ao repositório principal freeCodeCampo:
```console
```bash
git remote add upstream https://github.com/freeCodeCamp/freeCodeCamp.git
```
3. Certifique-se de que a configuração esteja correta:
```console
```bash
git remote -v
```
O resultado deve ser algo parecido com o mostrado abaixo (substituindo `YOUR_USER_NAME` com seu nome de usuário do GitHub):
```console
```bash
origin https://github.com/YOUR_USER_NAME/freeCodeCamp.git (fetch)
origin https://github.com/YOUR_USER_NAME/freeCodeCamp.git (push)
upstream https://github.com/freeCodeCamp/freeCodeCamp.git (fetch)
@@ -203,12 +203,12 @@ Como sempre, fique à vontade para perguntar na [categoria 'Contributors' (colab
As chaves de API padrão e variáveis de ambiente são armazenadas no arquivo `sample.env`. Esse arquivo precisa ser copiado para um novo arquivo chamado `.env` que é acessado dinamicamente durante a etapa de instalação.
```console
```bash
# Crie uma cópia da "sample.env" e a nomeie como ".env".
# Preencha-o com as chaves e segredos de API necessários
```
```console
```bash
cp sample.env .env
```
@@ -220,7 +220,7 @@ As chaves no arquivo `.env` _não_ precisam ser alteradas para executar o aplica
Esta etapa vai instalar as dependências necessárias para a execução da aplicação:
```console
```bash
pnpm install && pnpm run create:shared
```
@@ -234,7 +234,7 @@ Antes de executar a aplicação localmente, você precisará iniciar o serviço
Inicie o servidor do MongoDB em um terminal separado:
```console
```bash
mongod
```
@@ -242,15 +242,14 @@ mongod
Em seguida, vamos criar o banco de dados. Nesta etapa, executamos o comando abaixo que preenche o servidor MongoDB com alguns conjuntos de dados iniciais que são requeridos pelos serviços. Dentre outras coisas, incluem alguns esquemas.
```console
```bash
pnpm run seed
```
Por padrão, você será conectado como um novo usuário sem nenhuma certificação concluída. Execute os seguintes comandos se precisar desenvolver com certificados concluídos:
```console
```bash
pnpm run seed:certified-user
pnpm run seed:exams
```
> [!WARNING] Executar `pnpm run seed:certified-user` desconectará você. Você precisará limpar os cookies do seu navegador e fazer login novamente.
@@ -259,7 +258,7 @@ pnpm run seed:exams
Agora você pode iniciar o servidor de API e os aplicativos do client.
```console
```bash
pnpm run develop
```
@@ -279,11 +278,12 @@ Se você tiver problemas durante a instalação, confira a [seção de solução
Uma rápida referência aos comandos que você precisará ao trabalhar localmente.
| comando | descrição |
| ------------------------------ | -------------------------------------------------------------------------------------------------- |
| `pnpm install` | Instala/reinstala todas as dependências e inicializa os diferentes serviços. |
| `pnpm run seed` | Cria usuários de testes autorizados e os insere no MongoDB. |
| `pnpm run seed:certified-user` | Cria usuários de testes autorizados com certificações totalmente completas e os insere no MongoDB. |
| `pnpm run seed:exams` | Cria exames e os insere no MongoDB. |
| `pnpm run develop` | Inicia o servidor de API freeCodeCamp e aplicativos Cliente. |
| `pnpm run clean` | Desinstala todas as dependências e limpa os caches. |
| comando | descrição |
| ------------------------------ | ------------------------------------------------------------------------------------------------------------- |
| `pnpm install` | Instala/reinstala todas as dependências e inicializa os diferentes serviços. |
| `pnpm run seed` | Creates authorized test users and inserts them into MongoDB. Also runs `seed:exams` and `seed:surveys` below. |
| `pnpm run seed:certified-user` | Cria usuários de testes autorizados com certificações totalmente completas e os insere no MongoDB. |
| `pnpm run seed:exams` | Cria exames e os insere no MongoDB. |
| `pnpm run seed:surveys` | Creates surveys for defaults users and inserts them into MongoDB. |
| `pnpm run develop` | Starts the freeCodeCamp API Server and Client Applications. |
| `pnpm run clean` | Uninstalls all dependencies and cleans up caches. |

View File

@@ -17,7 +17,7 @@ Comece instalando o software pré-requisito para seu sistema operacional.
Se o Flutter já estiver instalado em sua máquina, execute os seguintes comandos para validar as versões:
```console
```bash
flutter --version
dart --version
```
@@ -70,7 +70,7 @@ Execute esses comandos em sua máquina local:
2. Clone seu fork do freeCodeCamp, substituindo `YOUR_USER_NAME` pelo seu nome de usuário do GitHub
```console
```bash
git clone --depth=1 https://github.com/YOUR_USER_NAME/mobile.git
```
@@ -88,25 +88,25 @@ Agora que você baixou uma cópia do seu fork, será necessário configurar um r
1. Mude o diretório para o novo diretório `mobile`:
```console
```bash
cd mobile
```
2. Adicione uma referência remota ao repositório principal mobile do freeCodeCamp:
```console
```bash
git remote add upstream https://github.com/freeCodeCamp/mobile.git
```
3. Certifique-se de que a configuração esteja correta:
```console
```bash
git remote -v
```
O resultado deve ser algo parecido com o mostrado abaixo (substituindo `YOUR_USER_NAME` com seu nome de usuário do GitHub):
```console
```bash
origin https://github.com/YOUR_USER_NAME/mobile.git (fetch)
origin https://github.com/YOUR_USER_NAME/mobile.git (push)
upstream https://github.com/freeCodeCamp/mobile.git (fetch)
@@ -129,20 +129,20 @@ E como sempre, fique à vontade em perguntar na [categoria 'Contributors' (colab
As chaves de API padrão e variáveis de ambiente são armazenadas no arquivo `sample.env`. Esse arquivo precisa ser copiado para um novo arquivo chamado `.env` que é acessado dinamicamente durante a etapa de instalação. Lembre-se de mudar o diretório para `mobile-app` antes de executar os comandos a seguir.
```console
```bash
# Crie uma cópia da "sample.env" e a nomeie como ".env".
# Preencha-o com as chaves e segredos de API necessários:
```
#### **macOS/Linux**
```console
```bash
cp sample.env .env
```
#### **Windows**
```console
```bash
copy sample.env .env
```
@@ -152,7 +152,7 @@ As chaves no arquivo `.env` _ não _ precisam ser alteradas para executar o apli
Esta etapa vai instalar as dependências necessárias para a execução do aplicativo:
```console
```bash
flutter pub get
```
@@ -162,7 +162,7 @@ Inicie o emulador de sua escolha (Android ou iOS) e aguarde a conclusão do proc
Agora, você pode iniciar o aplicativo executando o seguinte comando:
```console
```bash
flutter run
```
@@ -176,13 +176,13 @@ Siga estes passos:
1. Certifique-se que está no branch `main`:
```console
```bash
git status
```
Você deve ver um resultado como este:
```console
```bash
Na branch main
Sua branch está atualizada com 'origin/main'.
@@ -191,7 +191,7 @@ Siga estes passos:
Se você não está no main ou seu diretório de trabalho não está limpo, resolva quaisquer arquivos/commits e saia do `main`:
```console
```bash
git checkout main
```
@@ -205,25 +205,25 @@ Siga estes passos:
Atualize sua cópia local do repositório upstream da aplicação do freeCodeCamp para dispositivos móveis:
```console
```bash
git fetch upstream
```
Faça um hard reset na sua branch main com a main da aplicação do freeCodeCamp para dispositivos móveis:
```console
```bash
git reset --hard upstream/main
```
Faça um push da sua branch main para a origin para obter um histórico claro em seu fork do GitHub:
```console
```bash
git push origin main --force
```
Você pode validar se sua main atual combina com upstream/main fazendo um diff:
```console
```bash
git diff upstream/main
```
@@ -235,7 +235,7 @@ Siga estes passos:
Veja se você está na `main` como explicado antes e crie uma branch a partir dela:
```console
```bash
git checkout -b fix/update-guide-for-xyz
```
@@ -259,13 +259,13 @@ Siga estes passos:
7. Verifique e confirme os arquivos que você está atualizando:
```console
```bash
git status
```
Isso deve mostrar uma lista dos arquivos `unstaged` que você editou.
```console
```bash
Na branch feat/documentation
Sua branch está atualizada com 'upstream/feat/documentation'.
@@ -282,25 +282,25 @@ Siga estes passos:
Nesta etapa, você só deve marcar arquivos que você editou ou adicionou. Você pode executar um reset e resolver arquivos que você não pretendeu mudar se necessário.
```console
```bash
git add caminho/para/meu/arquivo/alterado.ext
```
Ou você pode adicionar todos os arquivos `unstaged` para a área de preparação:
```console
```bash
git add .
```
Apenas os arquivos que foram movidos para a área de staging serão adicionados quando você fizer um commit.
```console
```bash
git status
```
Resultado:
```console
```bash
Na branch feat/documentation
Sua branch está atualizada com 'upstream/feat/documentation'.
@@ -313,7 +313,7 @@ Siga estes passos:
Agora, você pode fazer o commit das alterações com uma pequena mensagem assim:
```console
```bash
git commit -m "fix: my short commit message"
```
@@ -345,7 +345,7 @@ Siga estes passos:
9. Se você se deu conta que precisa editar um arquivo ou atualizar a mensagem de commit você pode fazer isso assim:
```console
```bash
git commit --amend
```
@@ -353,7 +353,7 @@ Siga estes passos:
10. Em seguida, você pode fazer push das suas alterações no seu fork:
```console
```bash
git push origin branch/nome-aqui
```
@@ -363,14 +363,14 @@ Siga estes passos:
1. Faça a clonagem do [repositório do freeCodeCamp](https://github.com/freeCodeCamp/freeCodeCamp) localmente e fora da cópia local do repositório para dispositivos móveis do freeCodeCamp. A estrutura de pastas deve ficar assim:
```console
```bash
├── freeCodeCamp
├── mobile
```
2. Mude o diretório para o novo diretório do freeCodeCamp:
```console
```bash
cd freeCodeCamp
```
@@ -378,25 +378,25 @@ Siga estes passos:
#### **macOS/Linux**
```console
```bash
cp sample.env .env
```
#### **Windows**
```console
```bash
copy sample.env .env
```
4. Instale as dependências para o repositório do freeCodeCamp:
```console
```bash
pnpm install && pnpm run create:shared
```
5. Gere o arquivo JSON dos dados de desafio:
```console
```bash
pnpm run build:curriculum
```
@@ -404,54 +404,54 @@ Siga estes passos:
#### **macOS/Linux**
```console
```bash
cp ./shared/config/curriculum.json ../mobile/mobile-app/curriculum.json
```
#### **Windows**
```console
```bash
copy .\shared\config\curriculum.json ..\mobile\mobile-app\curriculum.json
```
7. Mude o diretório para o diretório da aplicação para dispositivos móveis:
```console
```bash
cd ../mobile/mobile-app
```
8. Instale as dependências para a aplicação para dispositivos móveis:
```console
```bash
flutter pub get
```
9. Atualize o arquivo de testes para que use o arquivo JSON de dados do desafio:
```console
```bash
sed -i '' 's/..\/..\/shared\/config\/curriculum.json/.\/curriculum.json/g' test/widget_test.dart
```
10. Gere os arquivos do desafio:
```console
```bash
flutter test test/widget_test.dart
```
11. Inicie um servidor local para servir os arquivos de desafio com a ajuda do pacote `serve`:
```console
```bash
npx serve
```
12. Em um terminal diferente, volte ao repositório do freeCodeCamp:
```console
```bash
cd ../../freeCodeCamp
```
13. Execute os testes do Cypress:
```console
```bash
pnpm cypress run --config retries=1,screenshotOnRunFailure=false,video=false,baseUrl=http://localhost:3000/generated-tests/,specPattern=cypress/e2e/mobile-learn/test-challenges.js -s cypress/e2e/mobile-learn/test-challenges.js -b chrome
```
@@ -482,7 +482,7 @@ Se você está em um sistema operacional diferente e/ou ainda está com problema
Se você enfrenta problemas com a interface do usuário ou erros de build, uma limpeza pode ser útil:
```console
```bash
flutter clean
```

View File

@@ -10,7 +10,7 @@ Este guia abrange algumas etapas comuns sobre a instalação do WSL2. Uma vez re
## Ative o WSL
Siga as instruções na [documentação oficial](https://docs.microsoft.com/en-us/windows/wsl/install-win10) para instalar o WSL1 e atualizar para o WSL2.
Siga as instruções na [documentação oficial](https://docs.microsoft.com/en-us/windows/wsl/install-win10) para instalar o WSL2.
## Instale o Ubuntu
@@ -20,9 +20,11 @@ Siga as instruções na [documentação oficial](https://docs.microsoft.com/en-u
>
> Embora você possa usar outras distribuições não baseadas em Debian, todas vêm com seus próprios empecilhos, que estão além do escopo deste guia.
A partir de novembro de 2023, Ubuntu e Debian serão as únicas distribuições de Linux [oficialmente suportadas pelo Playwright](https://playwright.dev/docs/intro#system-requirements), a biblioteca de testes de ponta a ponta usada pelo freeCodeCamp.
2. Atualize as dependências para o sistema operacional
```console
```bash
sudo apt update
sudo apt upgrade -y
@@ -70,23 +72,23 @@ Isso faz com que os contêineres sejam executados no lado do WSL em vez de serem
Depois de ter configurado o Docker Desktop para trabalhar com o WSL2, siga essas etapas para iniciar um serviço no MongoDB:
1. Inicie um novo terminal Ubuntu-18.04
1. Inicie um novo terminal do Ubuntu
2. Faça o pull `MongoDB 4.0.x` do Docker Hub
2. Faça o pull do MongoDB a partir do Docker Hub. Consulte a tabela de [Pré-requisitos](how-to-setup-freecodecamp-locally.md#Prerequisites) para ver a versão atual do MongoDB usada pelo freeCodeCamp. Por exemplo, se o número da versão for `5.0.x`, substitua `<x.y>` por `5.0` nos dois trechos de código a seguir.
```console
docker pull mongo:4.0
```bash
docker pull mongo:<x.y>
```
3. Inicie o serviço MongoDB na porta `27017` e configure-o para ser executado automaticamente ao reiniciar o sistema
```console
```bash
docker run -it \
-v mongodata:/data/db \
-p 27017:27017 \
--name mongodb \
--restart unless-stopped \
-d mongo:4.0
-d mongo:<x.y>
```
4. Agora você pode acessar o serviço no Windows ou Ubuntu em `mongodb://localhost:27017`.
@@ -95,25 +97,17 @@ Depois de ter configurado o Docker Desktop para trabalhar com o WSL2, siga essas
Recomendamos que você instale a versão LTS para Node.js com um gerenciador de versões do node - [nvm](https://github.com/nvm-sh/nvm#installing-and-updating).
Uma vez instalado, use esses comandos para instalar e usar a versão do Node.js, conforme necessário
Uma vez instalado, use este comando para instalar e usar a versão do Node.js LTS mais recente:
```console
```bash
nvm install --lts
# OU
# nvm install <version>
nvm install 14
# Uso
# nvm use <version>
nvm use 12
```
Para ver instruções de instalação e de uso de uma versão diferente do Node.js, consulte a [documentação do nvm](https://github.com/nvm-sh/nvm#usage).
O Node.js vem com o `npm`, que você pode usar para instalar o `pnpm`:
```console
```bash
npm install -g pnpm
```
@@ -125,7 +119,104 @@ Agora que você instalou os pré-requisitos, siga [nosso guia de instalação lo
>
> Por favor note que, neste momento, a configuração para testes do Cypress (e necessidades relacionadas à GUI) é um trabalho em andamento. Você ainda deve ser capaz de trabalhar na maior parte do código.
## Links Úteis
## Otimizar o Windows e o WSL
> [!NOTE]
>
> As dicas a seguir foram coletadas de toda a web e não passaram por diversos testes. A quilometragem pode variar.
### Ajuste o agendamento do processador para serviços de segundo plano
Isso pode reduzir os incidentes dos contêineres do Docker causando um crash devido à falta de recursos.
Abra o painel de controle das Propriedades do Sistema pressionando <kbd>Win + R</kbd> e digitando `sysdm.cpl`
<details>
<summary>
Digite <code>sysdm.cpl</code> na caixa de diálogo Executar (captura de tela)
</summary>
<br>
<img src="https://raw.githubusercontent.com/freeCodeCamp/freeCodeCamp/main/docs/images/wsl/run-sysdm.png" alt="Digite `sysdm.cpl` na caixa de diálogo Executar" />
</details>
<br>
Vá para Avançado -> Desempenho -> Configurações…
<details>
<summary>
Botão de Configurações na parte de Desempenho na guia Avançado das Propriedades do Sistema (captura de tela)
</summary>
<br>
<img src="https://raw.githubusercontent.com/freeCodeCamp/freeCodeCamp/main/docs/images/wsl/advanced-performance-settings.png" alt="Botão Configurações na parte de Desempenho na guia Avançado em Propriedades do Sistema" />
</details>
<br>
Em Avançado -> Agendamento do processador, escolha "Serviços em segundo plano". Não feche a janela. Continue para a próxima dica.
<details>
<summary>
Botão de seleção dos Serviços em segundo plano na aba Avançado em Opções de Desempenho (captura de tela)
</summary>
<br>
<img src="https://raw.githubusercontent.com/freeCodeCamp/freeCodeCamp/main/docs/images/wsl/background-services.png" alt="Botão de opção dos Serviços em segundo plano na guia Avançado em Opções de Desempenho" />
</details>
### Aumente o tamanho do arquivo de paginação do Windows para a unidade do sistema
Em Avançado -> Memória virtual, clique em "Alterar…"
<details>
<summary>
Botão para alterar a memória virtual na aba Avançado em Opções de Desempenho (captura de tela)
</summary>
<br>
<img src="https://raw.githubusercontent.com/freeCodeCamp/freeCodeCamp/main/docs/images/wsl/advanced-virtual-memory.png" alt="Botão de alterar a memória virtual na guia Avançado em Opções de Desempenho" />
</details>
<br>
Escolha "Tamanho personalizado". Defina o tamanho inicial para 1.5x e o tamanho máximo para 3x da sua memória física. Em seguida, clique em "Definir".
<details>
<summary>
Botão Definir o tamanho personalizado na janela de Memória Virtual (captura de tela)
</summary>
<br>
<img src="https://raw.githubusercontent.com/freeCodeCamp/freeCodeCamp/main/docs/images/wsl/set-custom-size.png" alt="Botão Definir o tamanho personalizado na janela de Memória Virtual" />
</details>
### Aumentar o tamanho da memória alocada para o WSL
Crie um arquivo [`.wslconfig`](https://learn.microsoft.com/en-us/windows/wsl/wsl-config#configuration-setting-for-wslconfig) no diretório [`%UserProfile%`](https://learn.microsoft.com/en-us/windows/wsl/wsl-config#wslconfig) (tipicamente `C:\Users\<NomeDoUsuário>\.wslconfig`). Leia a documentação do [WSL](https://learn.microsoft.com/en-us/windows/wsl/wsl-config#configuration-setting-for-wslconfig) cuidadosamente e substitua `x` por valores que correspondam às suas próprias necessidades:
```ini
# As configurações se aplicam a todas as distribuições do Linux que rodam no WSL 2
[wsl2]
# Quanta memória atribuir à VM do WSL 2. O valor padrão pode não ser suficiente
memory=xGB
# Quanto de espaço de swap para adicionar à VM do WSL 2. O padrão é 25% da RAM disponível
swap=xGB
```
### Aumentar o tamanho do espaço antigo máximo do Node.js
Isso corrige o erro ["JavaScript heap out of memory"](https://stackoverflow.com/a/54456814) com o ESLint. Adicione o seguinte à sua `~/.bashrc` ou `~/.zshrc`:
```sh
export NODE_OPTIONS="--max-old-space-size=4096"
```
### Evite `pnpm run test`
Ao invés disso, use o script [apropriado ao seu PR](https://forum.freecodecamp.org/t/wsl-performance-issues-while-working-on-the-codebase/644215/2#:~:text=usually%2C%20you%20just%20want%20to%20test%20something%20specific%20to%20either%20the%20curriculum%20or%20the%20client%20or%20the%20api%20-%20almost%20never%20all%203.): `pnpm run test:api`, `pnpm run test:curriculum` ou `pnpm run test-client`.
## Links úteis
- [Configuração de desenvolvimento do WSL2 com Ubuntu 20.04, Node.js, MongoDB, VS Code e Docker](https://hn.mrugesh.dev/wsl2-dev-setup-with-ubuntu-nodejs-mongodb-and-docker) - um artigo de Mrugesh Mohapatra (desenvolvedor da equipe do freeCodeCamp.org)
- Perguntas frequentes sobre:

View File

@@ -232,15 +232,17 @@ As frases devem ser claras e resumidas com o mínimo de termos técnicos. Se usa
Mantenha os parágrafos curtos (em torno de 1-4 frases). É mais provável que as pessoas leiam vários parágrafos curtos do que um parágrafo enorme.
O desafio de texto deve usar a segunda pessoa ("você") para ajudar a dar um tom coloquial. Dessa forma, o texto e as instruções parecem falar diretamente ao usuário freeCodeCamp que está resolvendo o desafio. Tente evitar usar a primeira pessoa ("eu", "nós", "vamos").
Use american english, e.g., use `labeled` instead of `labelled`.
Não use links externos. Eles interrompem o fluxo. Os usuários do freeCodeCamp nunca devem precisar pesquisar nada no Google durante esses desafios. Se há recursos que você acha que os usuários aproveitarão, adicione-os no artigo relacionado ao guia do desafio.
Challenge text should use the second person ("you") to help to give it a conversational tone. This way the text and instructions seem to speak directly to the camper working through the challenge. Try to avoid using the first person ("I", "we", "let's", and "us").
Você pode adicionar diagramas se necessário.
Don't use outbound links. These interrupt the flow. Campers should never have to google anything during these challenges. If there are resources you think campers would benefit from, add them to the challenge's Guide-related article.
Não use emojis ou emoticons em desafios. O freeCodeCamp possui uma comunidade global, e o significado cultural de um emoji ou emoticon pode ser diferente ao redor do mundo. Além disso, emojis podem ser mostrados de maneiras diferentes em diferentes sistemas.
You can add diagrams if necessary.
Substantivos próprios devem começar com letra maiúscula quando possível. Abaixo está uma lista de palavras e como devem aparecem nos desafios.
Don't use emojis or emoticons in challenges. freeCodeCamp has a global community, and the cultural meaning of an emoji or emoticon may be different around the world. Also, emojis can render differently on different systems.
Proper nouns should use correct capitalization when possible. Below is a list of words as they should appear in the challenges.
- JavaScript (letras maiúsculas em "J" e "S" e sem abreviações)
- Node.js
@@ -248,28 +250,28 @@ Substantivos próprios devem começar com letra maiúscula quando possível. Aba
### A regra dos 2 minutos
Cada desafio deve ser resolvido em 120 segundos por um nativo da língua inglesa que tenha concluído os desafios anteriores. Isso inclui a quantidade de tempo que leva para ler as instruções, entender o código fornecido, escrever o código e passar nos testes.
Each challenge should be solvable within 120 seconds by a native English speaker who has completed the challenges leading up to it. This includes the amount of time it takes to read the directions/instructions understand the seeded code, write their code and get all the tests to pass.
Se levar mais do que dois minutos para completar um desafio, você tem duas opções:
If it takes longer than two minutes to complete the challenge, you have two options:
- Simplifique o desafio, ou
- Divida o desafio em dois desafios.
A regra dos 2 minutos força quem criou o desafio a deixar as instruções resumidas, o código fornecido limpo e seus testes diretos.
The 2-minute rule forces you, the challenge designer, to make your directions concise, your seed code clear, and your tests straightforward.
Acompanhamos o tempo que leva para os usuários resolverem os desafios e usamos essa informação para identificar desafios que precisem ser simplificados ou divididos.
We track how long it takes for campers to solve challenges and use this information to identify challenges that need to be simplified or split.
### Modularidade
Cada desafio deve ensinar exatamente um conceito, e esse conceito deve estar aparente a partir do nome do desafio.
Each challenge should teach exactly one concept, and that concept should be apparent from the challenge's name.
Podemos reforçar conceitos citados anteriormente através de repetição e variações - por exemplo, introduzir elementos h1 em um desafio, então elementos h3 depois.
We can reinforce previously covered concepts through repetition and variations - for example, introducing h1 elements in one challenge, then h3 elements a few challenges later.
Nossa meta é ter vários desafios de 2 minutos. Eles podem se completar e relembrar conceitos anteriormente citados.
Our goal is to have thousands of 2-minute challenges. These can flow together and reiterate previously-covered concepts.
### Formatando o texto do desafio
Aqui estão diretrizes de formatação específicas para o texto do desafio e exemplos:
Here are specific formatting guidelines for challenge text and examples:
- Palavras chaves da linguagem ficam entre `` \` `` crases. Por exemplo, nomes de tags HTML ou nomes de propriedade CSS.
- Referências a códigos (ex. função, método ou nomes de variáveis) devem estar entre `` \` ``. Veja o exemplo abaixo:
@@ -282,9 +284,9 @@ Use `parseInt` para converter a variável `realNumber` em um número inteiro.
- Blocos de código com várias linhas **devem ser precedidos por uma linha vazia**. A próxima linha deve começar com três crases seguidas imediatamente por uma das [linguagens suportadas](https://prismjs.com/#supported-languages). Para completar o bloco de código, você deve começar uma nova linha que apenas possui três crases e **outra linha vazia**. Veja o exemplo abaixo:
- Os espaços importam no Markdown. Então, recomendamos que os mantenham visíveis no seu editor.
**Observação:** se você for usar um exemplo de código em YAML, use `yaml` ao invés de `yml` para a linguagem à direita das crases.
**Note:** If you are going to use an example code in YAML, use `yaml` instead of `yml` for the language to the right of the backticks.
Exemplo de código:
The following is an example of code:
````md
```{language}
@@ -309,7 +311,7 @@ Desafios devem ter um número mínimo de testes necessários para verificar que
Nossa meta é comunicar o ponto que o desafio está tentando ensinar e testar se eles entenderam esse ponto.
Os testes do desafio podem usar bibliotecas Node.js e Chai.js. Se necessário, o código gerado pro usuário pode ser acessado na variável `code` também. Além disso, os objetos `__helpers` expõem várias funções que simplificam o processo de escrita dos testes. As funções disponíveis estão definidas em _client/src/utils/curriculum-helpers.ts_.
Os testes do desafio podem usar bibliotecas Node.js e Chai.js. Se necessário, o código gerado pro usuário pode ser acessado na variável `code` também. Além disso, os objetos `__helpers` expõem várias funções que simplificam o processo de escrita dos testes. The available functions are defined in the [curriculum-helpers](https://github.com/freeCodeCamp/curriculum-helpers/blob/main/lib/index.ts) repo.
## Formatação do código seed
@@ -331,13 +333,13 @@ Exemplo de um comentário de uma linha em JavaScript:
// Mude somente abaixo dessa linha
````
Exemplo de um comentário válido em CSS:
Example of a valid CSS comment:
```css
/* Only change code above this line */
```
Se um desafio tem apenas um lugar onde as mudanças de código são necessárias, use os comentários seguindo o exemplo a seguir para instruir o usuário sobre o local onde as mudanças devem ser feitas.
If a challenge only has a single place where code changes are needed, please use the comments in the following example to instruct the user where changes should be made.
```js
var a = 3;
@@ -350,7 +352,7 @@ b = 9 + b;
c = c + 7;
```
Se um desafio tem múltiplos lugares onde se espera que o usuário faça mudanças no código (ex. os desafios de React)
If a challenge has multiple places where the user is expected to change code (i.e. the React challenges)
```jsx
class MyComponent extends React.Component {
@@ -383,9 +385,9 @@ class MyComponent extends React.Component {
### Tradução de comentários de código seed
Existem dicionários de comentários separados para cada linguagem. A [versão em inglês do dicionário de comentários](https://github.com/freeCodeCamp/freeCodeCamp/blob/main/curriculum/dictionaries/english/comments.json) é a base para as traduções encontradas nas versões correspondentes dos arquivos em outros idiomas. A versão do dicionário de comentários em chinês (não a versão em inglês) pode ser encontrada em `/curriculum/dictionaries/chinese/comments.json`. Cada dicionário consiste em um array de objetos com uma propriedade de `id` única e uma propriedade de `text`. Somente a propriedade `text` deve ser modificada para englobar a tradução do comentário correspondente em inglês.
There are separate comment dictionaries for each language. The [English version of the comment dictionary](https://github.com/freeCodeCamp/freeCodeCamp/blob/main/curriculum/dictionaries/english/comments.json) is the basis for the translations found in the corresponding non-English versions of the files. The non-English version of the Chinese comment dictionary would be located at `/curriculum/dictionaries/chinese/comments.json`. Each dictionary consists of an array of objects with a unique `id` property and a `text` property. Only the `text` should be modified to encompass the translation of the corresponding English comment.
Alguns comentários podem conter uma palavra/frase que não deve ser traduzida. Por exemplo, nomes de variáveis, ou nomes próprios de bibliotecas como "React" não devem ser traduzidas. Veja o comentário abaixo como um exemplo. A palavra `myGlobal` não deve ser traduzida.
Some comments may contain a word/phrase that should not be translated. For example, variable names or proper library names like "React" should not be translated. See the comment below as an example. The word `myGlobal` should not be translated.
```text
Declare a variável myGlobal abaixo desta linha
@@ -397,13 +399,13 @@ Declare a variável myGlobal abaixo desta linha
## Dicas e soluções
Cada desafio tem um botão `Get a Hint`, assim, o usuário pode acessar qualquer dica/solução que foi criada para aquele desafio. Os tópicos de dicas/soluções são encontrados no [nosso fórum](https://forum.freecodecamp.org/c/guide), abaixo da categoria `Guide`.
Each challenge has a `Get a Hint` button, so a user can access any hints/solutions which have been created for the challenge. Curriculum hints/solutions topics are located on [our forum](https://forum.freecodecamp.org/c/guide) under the `Guide` category.
Se você encontrar um problema nas dicas/tópicos de solução de um desafio existente, você pode fazer sugestões na [categoria de contribuidores](https://forum.freecodecamp.org/c/contributors) no fórum. Os moderadores e usuários com o nível de confiança 3 vão revisar os comentários e decidir quais incluir as mudanças nos tópicos correspondentes de dicas/soluções.
If you find a problem with an existing challenge's hints/solutions topic, you can make suggestions in the [contributors category](https://forum.freecodecamp.org/c/contributors) on the forum. Moderators and users with trust level 3 will review the comments and decide whether or not to include the changes in the corresponding hint/solutions topic.
### Adicionando um novo tópico de dicas/soluções em um desafio
Faça o passo-a-passo a seguir quando for adicionar novos tópicos de dicas/soluções relacionadas a um desafio.
Take the following steps when adding a new challenge hints/solutions-related topic.
1. Comece seguindo os mesmos passos para criar um novo tópico, mas revise o seguinte para criar o título.
2. O título do tópico deve começar com `freeCodeCamp Challenge Guide:` concatenado com o título atual do desafio de currículo. Por exemplo, se o desafio é chamado "`Chunky Monkey`", o título do tópico seria "`freeCodeCamp Challenge Guide: Chunky Monkey`".
@@ -412,7 +414,7 @@ Faça o passo-a-passo a seguir quando for adicionar novos tópicos de dicas/solu
### Diretrizes para o conteúdo dos tópicos de dicas e soluções
Ao propor uma solução para um tópico do guia relacionado a um desafio de currículo, o código completo deve ser adicionado. Isso inclui todo o código seed original, assim como as alterações necessárias para passar em todos os testes do desafio. O modelo a seguir deve ser usado ao criar um novo tópico de dicas/soluções:
When proposing a solution for a curriculum challenge-related Guide topic, the full code must be added. This includes all the original seed code plus any changes needed to pass all the challenge tests. The following template should be used when creating new hints/solutions topics:
````md
# O nome do desafio fica aqui
@@ -499,35 +501,35 @@ Você também pode testar desafios por título utilizando as seguintes etapas:
cd curriculum
```
2. Execute o comando a seguir para cada arquivo de desafio no qual você fez alteraçõess (substituindo `challenge-title-goes-here` com o título completo do desafio):
2. Run the following for each challenge file for which you have changed (replacing `challenge-title-goes-here` with the full title of the challenge):
```
pnpm run test -- -g titulo-do-desafio-aqui
pnpm run test -- -g challenge-title-goes-here
```
> [!TIP]
> Você pode definir a váriavel de ambiente `LOCALE` no arquivo `.env` para o idioma do(s) desafio(s) que você precisa testar.
> You can set the environment variable `LOCALE` in the `.env` to the language of the challenge(s) you need to test.
>
> Os valores aceitos de momento são `english` e `chinese`, com `english` sendo o valor padrão.
> The currently accepted values are `english` and `chinese`, with `english` being set by default.
## Propondo um Pull Request (PR)
## Proposing a Pull Request (PR)
Depois de fazer o commit de suas alterações, confira aqui [como abrir um Pull Request](how-to-open-a-pull-request.md).
After you've committed your changes, check here for [how to open a Pull Request](how-to-open-a-pull-request.md).
## Links úteis
## Useful Links
Criação e edição de desafios:
Creating and Editing Challenges:
1. [Tipos de desafio](https://github.com/freeCodeCamp/freeCodeCamp/blob/main/client/utils/challenge-types.js#L1-L13) - o que significam os valores do tipo de desafio numérico (enum).
1. [Challenge types](https://github.com/freeCodeCamp/freeCodeCamp/blob/main/client/utils/challenge-types.js#L1-L13) - what the numeric challenge type values mean (enum).
2. [Contribuindo para o FreeCodeCamp - Escrevendo testes para desafios de ES6](https://www.youtube.com/watch?v=iOdD84OSfAE#t=2h49m55s) - um vídeo que acompanha [Ethan Arrowood](https://twitter.com/ArrowoodTech) durante sua contribuição para a versão antiga do currículo.
2. [Contributing to FreeCodeCamp - Writing ES6 Challenge Tests](https://www.youtube.com/watch?v=iOdD84OSfAE#t=2h49m55s) - a video following [Ethan Arrowood](https://twitter.com/ArrowoodTech) as he contributes to the old version of the curriculum.
## Scripts auxiliares
## Helper Scripts
> [!NOTE]
> Se estiver trabalhando com os desafios baseados em passos, consulte a seção [Trabalho com projetos práticos](how-to-work-on-practice-projects.md).
> If you are working with the step-based challenges, refer to the [Work on Practice Projects](how-to-work-on-practice-projects.md) section.
Existem alguns scripts auxiliares que podem ser usados para gerenciar os desafios em um bloco. Observe que todos esses comandos devem ser executados no diretório do bloco. Por exemplo:
There are a few helper scripts that can be used to manage the challenges in a block. Note that these commands should all be run in the block directory. For example:
```bash
cd curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting
@@ -535,33 +537,33 @@ cd curriculum/challenges/english/02-javascript-algorithms-and-data-structures/ba
### Adicionar um novo desafio
Para adicionar um novo desafio no final de um bloco, chame o script:
To add a new challenge at the end of a block, call the script:
```bash
pnpm run create-next-challenge
```
Ele solicitará a informação do desafio e criará o arquivo de desafio, atualizando o arquivo `meta.json` com as novas informações de desafio.
This will prompt you for the challenge information and create the challenge file, updating the `meta.json` file with the new challenge information.
### Excluir um desafio
Para excluir um desafio, chame o script:
To delete a challenge, call the script:
```bash
pnpm run delete-challenge
```
Ele solicitará que você selecione qual desafio deve ser excluído. Em seguida, excluirá o arquivo e atualizará o arquivo `meta.json` para remover o desafio da ordem.
This will prompt you to select which challenge should be deleted, then delete the file and update the `meta.json` file to remove the challenge from the order.
### Inserir um desafio
Para inserir um desafio antes de um desafio existente, chame o script:
To insert a challenge before an existing challenge, call the script:
```bash
pnpm run insert-challenge
```
Ele solicitará a informação do desafio e, em seguida, o desafio será inserido antes do desafio informado. Por exemplo, se suas escolhas forem:
This will prompt you for the challenge information, then for the challenge to insert before. For example, if your choices are:
```bash
a
@@ -569,7 +571,7 @@ b
c
```
Se você escolher `b`, a nova ordem será:
If you choose `b`, your new order will be:
```bash
a
@@ -580,26 +582,26 @@ c
### Atualizar a ordem dos desafios
Se você precisar reordenar manualmente os desafios, chame o script:
If you need to manually re-order the challenges, call the script:
```bash
pnpm run update-challenge-order
```
Ele vai orientá-lo através de um processo interativo para selecionar a ordem dos desafios.
This will take you through an interactive process to select the order of the challenges.
## Solução de problemas
### Loop infinito detectado
Se você ver o seguinte erro no console ao pré-visualizar um desafio:
If you see the following error in the console while previewing a challenge:
```text
Potential infinite loop detected on line <number>...
```
Isso significa que o plug-in de proteção de loops encontrou um loop de longa duração ou uma função recursiva. Se o desafio precisar fazer isso (por exemplo, contém um loop de eventos que deve ser executado indefinidamente), então você pode impedir que o plug-in seja usado na visualização. Para fazer isso, adicione `disableLoopProtectPreview: true` ao arquivo `meta.json` do bloco.
This means that the loop-protect plugin has found a long-running loop or recursive function. If your challenge needs to do that (e.g. it contains an event loop that is supposed to run indefinitely), then you can prevent the plugin from being used in the preview. To do so, add `disableLoopProtectPreview: true` to the block's `meta.json` file.
Se os testes demandam muitos cálculos, você poderá ver esse erro quando eles forem executados. Se isso acontecer, adicione `disableLoopProtectPreview: true` ao arquivo `meta.json` do bloco.
If your tests are computationally intensive, then you may see this error when they run. If this happens then you can add `disableLoopProtectTests: true` to the block's `meta.json` file.
Normalmente, não é necessário ter os dois definidos como true, Defina-os, apenas, conforme necessário.
It's not typically necessary to have both set to true, so only set them as needed.

View File

@@ -16,7 +16,7 @@ Vamos entender como o framework i18n e suas ferramentas funcionam.
A maioria dos arquivos para tradução da plataforma ficam localizados na pasta [`client/i18n`](https://github.com/freeCodeCamp/freeCodeCamp/tree/main/client/i18n). Cada idioma tem uma pasta contendo arquivos JSON com as traduções.
```console
```bash
config
└── i18n.ts
...

View File

@@ -47,7 +47,7 @@ Normalmente, você não precisaria alterar nenhuma configuração ou compilar o
Instale o freeCodeCamp localmente ([veja o guia de instalação local](how-to-setup-freecodecamp-locally)). Nós empacotamos a CLI com as ferramentas de desenvolvimento para que você possa executar o comando abaixo, conforme necessário, a partir da raiz do repositório:
```console
```bash
pnpm run docs:serve
```

View File

@@ -16,7 +16,7 @@ Se você está em um sistema operacional diferente ou se ainda está encontrando
Quando você fizer a build no client, o Gatsby armazenará em cache as fontes, as strings de idioma e a interface do usuário. Se um deles não estiver em cache, execute o seguinte:
```console
```bash
pnpm run clean
pnpm install
pnpm run seed
@@ -53,7 +53,7 @@ git clean -ifdX
Se você não conseguir fazer o login e se vir um banner com uma mensagem de erro dizendo que o erro será reportado ao freeCodeCamp, verifique novamente se a porta local `3000` não está em uso por um programa diferente.
#### **A partir do Terminal:**
```console
```bash
netstat -a | grep "3000"
tcp4 0 0 0.0.0.0:3000 DESKTOP LISTEN

View File

@@ -303,19 +303,19 @@ doctl compute droplet list --format "ID,Name,PublicIPv4"
Оновіть інформацію пакетів
```console
```bash
sudo apt update
```
Оновіть встановлені пакети
```console
```bash
sudo apt upgrade -y
```
Очистьте невикористані пакети
```console
```bash
sudo apt autoremove -y
```
@@ -331,7 +331,7 @@ sudo apt autoremove -y
1. Завантажте і налаштуйте NGINX з репозиторію.
```console
```bash
sudo su
cd /var/www/html
@@ -352,7 +352,7 @@ sudo apt autoremove -y
Перемістіть наявні сертифікати:
```console
```bash
# Local
scp -r username@source-server-public-ip:/etc/nginx/ssl ./
scp -pr ./ssl username@target-server-public-ip:/tmp/
@@ -364,7 +364,7 @@ sudo apt autoremove -y
Оновіть головні конфігурації:
```console
```bash
vi configs/upstreams.conf
```
@@ -382,7 +382,7 @@ sudo apt autoremove -y
1. Перевірте стан служби NGINX за допомогою наступної команди:
```console
```bash
sudo systemctl status nginx
```
@@ -396,13 +396,13 @@ sudo apt autoremove -y
1. SSH в екземпляр і введіть sudo
```console
```bash
sudo su
```
2. Отримайте останній код конфігурації.
```console
```bash
cd /etc/nginx
git fetch --all --prune
git reset --hard origin/main
@@ -410,7 +410,7 @@ git reset --hard origin/main
3. Протестуйте та повторно завантажте конфігурації [з Signals](https://docs.nginx.com/nginx/admin-guide/basic-functionality/runtime-control/#controlling-nginx).
```console
```bash
nginx -t
nginx -s reload
```
@@ -419,7 +419,7 @@ nginx -s reload
1. Встановіть інструменти збірки для бінарних файлів node (`node-gyp`) тощо.
```console
```bash
sudo apt install build-essential
```
@@ -431,19 +431,19 @@ sudo apt install build-essential
2. Встановіть pnpm глобально.
```console
```bash
npm install -g pnpm
```
3. Встановіть pm2 глобально.
```console
```bash
npm install -g pm2
```
4. Клонуйте freeCodeCamp, налаштуйте середовище та ключі.
```console
```bash
git clone https://github.com/freeCodeCamp/freeCodeCamp.git
cd freeCodeCamp
git checkout prod-current # or any other branch to be deployed
@@ -453,36 +453,36 @@ git checkout prod-current # or any other branch to be deployed
6. Встановіть залежності
```console
```bash
pnpm install
```
7. Налаштуйте pm2 `logrotate` та запустіть під час завантаження
```console
```bash
pm2 install pm2-logrotate
pm2 startup
```
8. Побудуйте сервер
```console
```bash
pnpm prebuild && pnpm build:curriculum && pnpm build:server
```
9. Запустіть екземпляри
```console
```bash
pnpm start:server
```
### Журналювання та моніторинг
```console
```bash
pm2 logs
```
```console
```bash
pm2 monit
```
@@ -496,31 +496,31 @@ pm2 monit
1. Зупиніть всі екземпляри
```console
```bash
pm2 stop all
```
2. Встановіть залежності
```console
```bash
pnpm install
```
3. Побудуйте сервер
```console
```bash
pnpm prebuild && pnpm build:curriculum && pnpm build:server
```
4. Запустіть екземпляри
```console
```bash
pnpm start:server && pm2 logs
```
#### 2. Постійне оновлення: використовується для логічних змін коду.
```console
```bash
pnpm reload:server && pm2 logs
```
@@ -532,7 +532,7 @@ pnpm reload:server && pm2 logs
2. Оновіть pm2 для використання нової версії
```console
```bash
pm2 update
```
@@ -540,7 +540,7 @@ pm2 update
1. Встановіть інструменти збірки для бінарних файлів node (`node-gyp`) тощо.
```console
```bash
sudo apt install build-essential
```
@@ -552,7 +552,7 @@ sudo apt install build-essential
2. Оновіть `npm`, встановіть PM2, налаштуйте `logrotate` та запустіть під час завантаження
```console
```bash
npm i -g npm@8
npm i -g pm2@4
npm install -g serve@13
@@ -562,7 +562,7 @@ sudo apt install build-essential
3. Клонуйте конфігурацію клієнта, налаштування середовища та ключі.
```console
```bash
git clone https://github.com/freeCodeCamp/client-config.git client
cd client
```
@@ -571,7 +571,7 @@ sudo apt install build-essential
> Завдання: це налаштування потрібно перемістити в сховище S3 або Azure Blob
>
> ```console
> ```bash
> echo "serve -c ../serve.json -p 50505 www" > client-start-primary.sh
> chmod +x client-start-primary.sh
> pm2 delete client-primary
@@ -584,11 +584,11 @@ sudo apt install build-essential
### Журналювання та моніторинг
```console
```bash
pm2 logs
```
```console
```bash
pm2 monit
```
@@ -602,7 +602,7 @@ pm2 monit
1. Зупиніть всі екземпляри
```console
```bash
pm2 stop all
```
@@ -610,13 +610,13 @@ pm2 monit
3. Запустіть екземпляри
```console
```bash
pm2 start all --update-env && pm2 logs
```
#### 2. Постійне оновлення: використовується для логічних змін коду.
```console
```bash
pm2 reload all --update-env && pm2 logs
```
@@ -636,7 +636,7 @@ pm2 reload all --update-env && pm2 logs
1. Завантажте і налаштуйте NGINX з репозиторію.
```console
```bash
sudo su
cd /var/www/html
@@ -657,7 +657,7 @@ pm2 reload all --update-env && pm2 logs
Перемістіть наявні сертифікати:
```console
```bash
# Локально
scp -r username@source-server-public-ip:/etc/nginx/ssl ./
scp -pr ./ssl username@target-server-public-ip:/tmp/
@@ -669,7 +669,7 @@ pm2 reload all --update-env && pm2 logs
Оновіть головні конфігурації:
```console
```bash
vi configs/upstreams.conf
```
@@ -687,7 +687,7 @@ pm2 reload all --update-env && pm2 logs
1. Завантажте і налаштуйте Docker з репозиторію
```console
```bash
git clone https://github.com/freeCodeCamp/chat-config.git chat
cd chat
```
@@ -696,7 +696,7 @@ pm2 reload all --update-env && pm2 logs
3. Запустіть сервер rocket-chat
```console
```bash
docker-compose config
docker-compose up -d
```
@@ -705,13 +705,13 @@ pm2 reload all --update-env && pm2 logs
1. Перевірте стан служби NGINX за допомогою наступної команди:
```console
```bash
sudo systemctl status nginx
```
2. Перевірте стан запущених екземплярів docker за допомогою:
```console
```bash
docker ps
```
@@ -723,13 +723,13 @@ pm2 reload all --update-env && pm2 logs
1. SSH в екземпляр і введіть sudo
```console
```bash
sudo su
```
2. Отримайте останній код конфігурації.
```console
```bash
cd /etc/nginx
git fetch --all --prune
git reset --hard origin/main
@@ -737,7 +737,7 @@ pm2 reload all --update-env && pm2 logs
3. Протестуйте та повторно завантажте конфігурації [з Signals](https://docs.nginx.com/nginx/admin-guide/basic-functionality/runtime-control/#controlling-nginx).
```console
```bash
nginx -t
nginx -s reload
```
@@ -746,44 +746,44 @@ pm2 reload all --update-env && pm2 logs
1. SSH в екземпляр та перейдіть до шляху налаштування чату
```console
```bash
cd ~/chat
```
2. Отримайте останній код конфігурації.
```console
```bash
git fetch --all --prune
git reset --hard origin/main
```
3. Отримайте останній образ docker для Rocket.Chat
```console
```bash
docker-compose pull
```
4. Оновіть запущені екземпляри
```console
```bash
docker-compose up -d
```
5. Переконайтесь, що екземпляри запущені
```console
```bash
docker ps
```
6. Вилучіть зайві ресурси
```console
```bash
docker system prune --volumes
```
Вивід:
```console
```bash
WARNING! This will remove:
- all stopped containers
- all networks not used by at least one container
@@ -802,7 +802,7 @@ pm2 reload all --update-env && pm2 logs
ssh у віртуальну машину (розміщену на Digital Ocean).
```console
```bash
cd tools
git pull origin master
pnpm install
@@ -814,7 +814,7 @@ pm2 restart contribute-app
Отримайте список наразі встановлених версій node та npm
```console
```bash
nvm -v
node -v
npm -v
@@ -824,25 +824,25 @@ nvm ls
Встановіть останню версію Node.js LTS і перевстановіть всі глобальні пакети
```console
```bash
nvm install --lts --reinstall-packages-from=default
```
Перевірте встановлені пакети
```console
```bash
npm ls -g --depth=0
```
Зробіть псевдонім версії Node.js `default` для поточної LTS (закріплена до останньої основної версії)
```console
```bash
nvm alias default 16
```
(Необов’язково) Видаліть старі версії
```console
```bash
nvm uninstall <version>
```
@@ -852,31 +852,31 @@ nvm uninstall <version>
Отримайте інструкції/команди видалення за допомогою команди `unstartup` та використайте вивід, щоб видалити служби systemctl
```console
```bash
pm2 unstartup
```
Отримайте інструкції/команди встановлення за допомогою команди `startup` та використайте вивід, щоб додати служби systemctl
```console
```bash
pm2 startup
```
Швидкі команди для PM2 для перерахування, відновлення збережених процесів і т. д.
```console
```bash
pm2 ls
```
```console
```bash
pm2 resurrect
```
```console
```bash
pm2 save
```
```console
```bash
pm2 logs
```
@@ -898,32 +898,32 @@ pm2 logs
1. Перейдіть та перевірте статус служби
```console
```bash
cd ~/azagent
sudo ./svc.sh status
```
2. Зупиніть службу
```console
```bash
sudo ./svc.sh stop
```
3. Видаліть службу
```console
```bash
sudo ./svc.sh uninstall
```
4. Видаліть агента з пулу конвеєра
```console
```bash
./config.sh remove
```
5. Видаліть файли конфігурації
```console
```bash
cd ~
rm -rf ~/azagent
```
@@ -938,7 +938,7 @@ pm2 logs
2. Налаштуйте сценарій, щоб отримати віддалений доступ до списку електронних пошт.
```console
```bash
cd /home/freecodecamp/scripts/emails
cp sample.env .env
```
@@ -947,7 +947,7 @@ pm2 logs
3. Запустіть сценарій.
```console
```bash
node get-emails.js emails.csv
```

View File

@@ -26,25 +26,25 @@
- Щоб запустити всі тести в каталозі `./cypress`:
```console
```bash
pnpm run cypress:dev:run
```
- Щоб запустити один тест:
```console
```bash
pnpm run cypress run --spec=cypress/<path_to_test_file>
```
Наприклад:
```console
```bash
pnpm run cypress run --spec=cypress/e2e/default/landing.ts
```
- Щоб створити збірку розробки, запустіть сервер розробки і виконайте всі наявні тести cypress:
```console
```bash
pnpm run e2e:dev:run
```
@@ -57,25 +57,25 @@
- Дотримуйтесь [посібнику з налаштування MongoDB](https://www.mongodb.com/basics/get-started).
- Створіть конфігураційний файл.
```console
```bash
pnpm run create:shared
```
- Заповніть базу даних
```console
```bash
pnpm run seed
```
- Розробіть сервер та клієнта
```console
```bash
pnpm run develop
```
### 2. Встановіть інструменти збірки Cypress
```console
```bash
pnpm run cypress:install-build-tools
```

View File

@@ -4,7 +4,7 @@
Щоб встановити Playwright:
```console
```bash
pnpm run playwright:install-build-tools
```
@@ -181,49 +181,49 @@ describe('The campers landing page', () => {
- Переконайтесь, що перейшли до репозиторію e2e:
```console
```bash
cd e2e
```
- Щоб запустити тести в режимі помічника UI:
```console
```bash
npx playwright test --ui
```
- Щоб запустити один тест:
```console
```bash
npx playwright test <filename>
```
Наприклад:
```console
```bash
npx playwright test landing-page.spec.ts
```
- Щоб запустити набір файлів тестів у відповідних папках:
```console
```bash
npx playwright test <pathToFolder1> <pathToFolder2>
```
Наприклад:
```console
```bash
npx playwright test tests/todo-page/ tests/landing-page/
```
- Щоб запустити тест із заголовком:
```console
```bash
npx playwright test -g <title>
```
Наприклад:
```console
```bash
npx playwright test -g "add a todo item"
```
@@ -233,13 +233,13 @@ describe('The campers landing page', () => {
- Налагодження всіх тестів:
```console
```bash
npx playwright test --debug
```
- Налагодження одного файлу тесту:
```console
```bash
npx playwright test example.spec.ts --debug
```
@@ -247,7 +247,7 @@ describe('The campers landing page', () => {
HTML Reporter надає повний звіт про ваші тести, що дає змогу фільтрувати звіт за браузерами, пройденими тестами, проваленими тестами, пропущеними тестами та ненадійними тестами.
```console
```bash
npx playwright show-report
```
@@ -257,13 +257,13 @@ Playwright, як правило, є інструментом з дуже мал
- (MacOs та Linux) Якщо запуск Playwright призводить до помилки через залежності ядра, запустіть цю команду:
```console
```bash
pnpm run playwright:install-build-tools-linux
```
- Поширена помилка в Playwright виглядає так:
```console
```bash
Error: page.goto: Could not connect: Connection refused
=========================== logs ===========================
navigating to "https://127.0.0.1:8000/", waiting until "load"
@@ -284,7 +284,7 @@ Playwright, як правило, є інструментом з дуже мал
- Ще одна поширена помилка в Playwright виглядає так:
```console
```bash
Protocol error (Network.getResponseBody): Request content was evicted from inspector cache
```
@@ -305,25 +305,25 @@ Playwright, як правило, є інструментом з дуже мал
- Створіть .env
```console
```bash
cp sample.env .env
```
- Створіть конфігураційний файл.
```console
```bash
pnpm run create:shared
```
- Заповніть базу даних
```console
```bash
pnpm run seed
```
- Розробіть сервер та клієнта
```console
```bash
pnpm run develop
```
@@ -331,7 +331,7 @@ Playwright, як правило, є інструментом з дуже мал
Щоб встановити необхідні залежності для запуску Playwright, виконайте цю команду:
```console
```bash
pnpm run playwright:install-build-tools
```
@@ -339,6 +339,6 @@ pnpm run playwright:install-build-tools
Щоб запустити всі тести Playwright, виконайте цю команду:
```console
```bash
npx playwright test
```

View File

@@ -10,13 +10,13 @@
1. Переконайтесь, що знаходитесь на гілці `main`:
```console
```bash
git status
```
Ви повинні отримати такий вивід:
```console
```bash
On branch main
Your branch is up-to-date with 'origin/main'.
@@ -25,7 +25,7 @@
Якщо ви отримали інше повідомлення, значить ви не перебуваєте на головній гілці (main) або ваш робочий каталог не чистий. Розв’яжіть будь-які невиконані файли/затвердження та перевірте `main`:
```console
```bash
git checkout main
```
@@ -39,25 +39,25 @@
Оновіть свою копію віддаленого репозиторію freeCodeCamp:
```console
```bash
git fetch upstream
```
Скиньте свою головну гілку з головною гілкою freeCodeCamp:
```console
```bash
git reset --hard upstream/main
```
Перемістіть свою головну гілку до джерела, щоб мати чисту історію розгалуження на GitHub:
```console
```bash
git push origin main --force
```
Ви можете переконатись, що ваша поточна головна гілка відповідає upstream/main, виконавши diff:
```console
```bash
git diff upstream/main
```
@@ -69,7 +69,7 @@
Переконайтесь, що знаходитесь на `main` та починайте розгалуження звідси:
```console
```bash
git checkout -b fix/update-guide-for-xyz
```
@@ -93,13 +93,13 @@
7. Перевірте та підтвердьте файли, які оновлюєте:
```console
```bash
git status
```
Має з’явитись список файлів `unstaged`, які ви відредагували.
```console
```bash
On branch feat/documentation
Your branch is up to date with 'upstream/feat/documentation'.
@@ -118,25 +118,25 @@
У цьому кроці потрібно позначити лише ті файли, які редагували чи додавали самостійно. Якщо необхідно, ви можете виконати скидання та виправити файли, які не збираєтеся змінювати.
```console
```bash
git add path/to/my/changed/file.ext
```
Або ви можете додати всі файли `unstaged` до області тимчасового зберігання:
```console
```bash
git add .
```
Лише ті файли, які було переміщено до області тимчасового зберігання, будуть додані під час затвердження.
```console
```bash
git status
```
Вивід:
```console
```bash
On branch feat/documentation
Your branch is up to date with 'upstream/feat/documentation'.
@@ -151,7 +151,7 @@
Тепер ви можете затвердити свої зміни, використовуючи коротке повідомлення:
```console
```bash
git commit -m "fix: my short commit message"
```
@@ -181,7 +181,7 @@
9. Якщо ви усвідомили, що вам потрібно відредагувати файл або оновити повідомлення коміту, після того, як зробили коміт, ви можете зробити так після редагування файлів:
```console
```bash
git commit --amend
```
@@ -189,7 +189,7 @@
10. Тепер надішліть свої зміни до розгалуження:
```console
```bash
git push origin branch/name-here
```

View File

@@ -115,14 +115,14 @@
1. Перебазуйте свою локальну копію:
```console
```bash
git checkout <pr-branch>
git pull --rebase upstream main
```
2. Вирішіть будь-які конфлікти та додайте/редагуйте коміти
```console
```bash
# Або
git add .
git commit -m "chore: resolve conflicts"
@@ -134,7 +134,7 @@
3. Відправте зміни до PR
```console
```bash
git push --force origin <pr-branch>
```
@@ -144,7 +144,7 @@
1. Переконайтесь, що upstream синхронізовано з локальною гілкою:
```console
```bash
git checkout main
git fetch --all --prune
git checkout next-python-projects
@@ -155,7 +155,7 @@
a. Або видаліть локальну гілку після створення резервної копії (якщо вона досі існує локально):
```console
```bash
git checkout <pr-branch-name>
# приклад:
@@ -171,7 +171,7 @@
b. Або зробіть резервну копію гілки PR (якщо вона не існує локально):
```console
```bash
git checkout -b <backup-branch-name> origin/<pr-branch-name>
# приклад:
@@ -180,14 +180,14 @@
3. Розпочніть з нуля:
```console
```bash
git checkout -b <pr-branch-name> next-python-projects
git cherry-pick <commit-hash>
```
4. Розв’яжіть будь-які конфлікти, поприбирайте, встановіть залежності та запустіть тести
```console
```bash
pnpm run clean
pnpm install
@@ -201,6 +201,6 @@
5. Якщо все виглядає добре, передайте до PR
```console
```bash
git push --force origin <pr-branch-name>
```

View File

@@ -75,7 +75,7 @@
Якщо на вашій машині вже встановлено Node.js, запустіть наступні команди для перевірки версій:
```console
```bash
node -v
pnpm -v
```
@@ -142,7 +142,7 @@ pnpm -v
2. Клонуйте своє розгалуження freeCodeCamp, замінивши `YOUR_USER_NAME` на ім’я користувача GitHub
```console
```bash
git clone --depth=1 https://github.com/YOUR_USER_NAME/freeCodeCamp.git
```
@@ -160,25 +160,25 @@ pnpm -v
1. Змініть каталог на новий каталог freeCodeCamp:
```console
```bash
cd freeCodeCamp
```
2. Додайте віддалене посилання на основний репозиторій freeCodeCamp:
```console
```bash
git remote add upstream https://github.com/freeCodeCamp/freeCodeCamp.git
```
3. Переконайтеся, що конфігурація правильна:
```console
```bash
git remote -v
```
Вивід повинен бути схожим на нижчеподаний приклад (замініть `YOUR_USER_NAME` на своє ім’я користувача GitHub):
```console
```bash
origin https://github.com/YOUR_USER_NAME/freeCodeCamp.git (fetch)
origin https://github.com/YOUR_USER_NAME/freeCodeCamp.git (push)
upstream https://github.com/freeCodeCamp/freeCodeCamp.git (fetch)
@@ -203,12 +203,12 @@ pnpm -v
Ключі API та змінні середовища за замовчуванням зберігаються у файлі `sample.env`. Цей файл потрібно скопіювати в новий файл під назвою `.env`, доступ до якого відкривається динамічно на кроці встановлення.
```console
```bash
# Створіть копію «sample.env» та назвіть її «.env».
# Заповніть її необхідними ключами та секретами API
```
```console
```bash
cp sample.env .env
```
@@ -220,7 +220,7 @@ cp sample.env .env
У цьому кроці буде встановлено залежності, необхідні для запуску застосунку:
```console
```bash
pnpm install && pnpm run create:shared
```
@@ -234,7 +234,7 @@ pnpm install && pnpm run create:shared
Запустіть сервер MongoDB в окремому терміналі:
```console
```bash
mongod
```
@@ -242,15 +242,14 @@ mongod
Тепер додамо базу даних. На цьому кроці ми запускаємо нижченаведену команду, яка заповнює сервер MongoDB деякими початковими наборами даних, потрібних службам. До них належать деякі схеми та інше.
```console
```bash
pnpm run seed
```
Ви увійдете як новий користувач без будь-яких завершених сертифікацій за замовчуванням. Запустіть ці команди, якщо потрібні наявні виконані сертифікації:
```console
```bash
pnpm run seed:certified-user
pnpm run seed:exams
```
> [!WARNING] Якщо запустити `pnpm run seed:certified-user`, ви вийдете з облікового запису. Вам доведеться очистити cookies свого браузера та увійти знову.
@@ -259,7 +258,7 @@ pnpm run seed:exams
Тепер ви можете запустити сервер API та клієнтську програму.
```console
```bash
pnpm run develop
```
@@ -279,11 +278,12 @@ pnpm run develop
Короткий довідник команд, які знадобляться при локальній роботі.
| команда | опис |
| ------------------------------ | --------------------------------------------------------------------------------------------------- |
| `pnpm install` | Встановлює/перевстановлює всі залежності та запускає різні служби. |
| `pnpm run seed` | Створює авторизованих тестових користувачів і розміщує їх у MongoDB. |
| `pnpm run seed:certified-user` | Створює автоматизованих тестових користувачів, які завершили сертифікації, і розміщує їх у MongoDB. |
| `pnpm run seed:exams` | Створює екзамени та вставляє їх в MongoDB. |
| `pnpm run develop` | Запускає сервер API та клієнтські програми freeCodeCamp. |
| `pnpm run clean` | Видаляє всі залежності й очищає кеш. |
| команда | опис |
| ------------------------------ | ------------------------------------------------------------------------------------------------------------- |
| `pnpm install` | Встановлює/перевстановлює всі залежності та запускає різні служби. |
| `pnpm run seed` | Creates authorized test users and inserts them into MongoDB. Also runs `seed:exams` and `seed:surveys` below. |
| `pnpm run seed:certified-user` | Створює автоматизованих тестових користувачів, які завершили сертифікації, і розміщує їх у MongoDB. |
| `pnpm run seed:exams` | Створює екзамени та вставляє їх в MongoDB. |
| `pnpm run seed:surveys` | Creates surveys for defaults users and inserts them into MongoDB. |
| `pnpm run develop` | Starts the freeCodeCamp API Server and Client Applications. |
| `pnpm run clean` | Uninstalls all dependencies and cleans up caches. |

View File

@@ -17,7 +17,7 @@
Якщо на вашій машині вже встановлено Flutter, запустіть наступні команди для перевірки версій:
```console
```bash
flutter --version
dart --version
```
@@ -70,7 +70,7 @@ dart --version
2. Клонуйте своє розгалуження freeCodeCamp, замінивши `YOUR_USER_NAME` на ім’я користувача GitHub
```console
```bash
git clone --depth=1 https://github.com/YOUR_USER_NAME/mobile.git
```
@@ -88,25 +88,25 @@ dart --version
1. Змініть каталог на новий каталог `mobile`:
```console
```bash
cd mobile
```
2. Додайте віддалене посилання на головний репозиторій мобільного застосунку freeCodeCamp:
```console
```bash
git remote add upstream https://github.com/freeCodeCamp/mobile.git
```
3. Переконайтеся, що конфігурація правильна:
```console
```bash
git remote -v
```
Вивід повинен бути схожим на нижчеподаний приклад (замініть `YOUR_USER_NAME` на своє ім’я користувача GitHub):
```console
```bash
origin https://github.com/YOUR_USER_NAME/mobile.git (fetch)
origin https://github.com/YOUR_USER_NAME/mobile.git (push)
upstream https://github.com/freeCodeCamp/mobile.git (fetch)
@@ -129,20 +129,20 @@ dart --version
Ключі API та змінні середовища за замовчуванням зберігаються у файлі `sample.env`. Цей файл потрібно скопіювати в новий файл під назвою `.env`, доступ до якого відкривається динамічно на кроці встановлення. Не забудьте змінити каталог на `mobile-app` перед виконанням наступних команд.
```console
```bash
# Створіть копію «sample.env» та назвіть її «.env».
# Заповніть її необхідними ключами та секретами API:
```
#### **macOS/Linux**
```console
```bash
cp sample.env .env
```
#### **Windows**
```console
```bash
copy sample.env .env
```
@@ -152,7 +152,7 @@ copy sample.env .env
У цьому кроці буде встановлено залежності, необхідні для запуску застосунку:
```console
```bash
flutter pub get
```
@@ -162,7 +162,7 @@ flutter pub get
Тепер ви можете запустити застосунок, виконавши наступну команду:
```console
```bash
flutter run
```
@@ -176,13 +176,13 @@ flutter run
1. Переконайтесь, що знаходитесь на гілці `main`:
```console
```bash
git status
```
Ви повинні отримати такий вивід:
```console
```bash
On branch main
Your branch is up-to-date with 'origin/main'.
@@ -191,7 +191,7 @@ flutter run
Якщо ви не перебуваєте на головній гілці (main) або ваш робочий каталог не чистий, розв’яжіть будь-які невиконані файли/затвердження та перевірте `main`:
```console
```bash
git checkout main
```
@@ -205,25 +205,25 @@ flutter run
Оновіть свою локальну копію віддаленого репозиторію мобільного застосунку freeCodeCamp:
```console
```bash
git fetch upstream
```
Скиньте свою головну гілку з головною гілкою мобільного застосунку freeCodeCamp:
```console
```bash
git reset --hard upstream/main
```
Перемістіть свою головну гілку до джерела, щоб мати чисту історію розгалуження на GitHub:
```console
```bash
git push origin main --force
```
Ви можете переконатись, що ваша поточна головна гілка відповідає upstream/main, виконавши diff:
```console
```bash
git diff upstream/main
```
@@ -235,7 +235,7 @@ flutter run
Переконайтесь, що знаходитесь на `main` та починайте розгалуження звідси:
```console
```bash
git checkout -b fix/update-guide-for-xyz
```
@@ -259,13 +259,13 @@ flutter run
7. Перевірте та підтвердьте файли, які оновлюєте:
```console
```bash
git status
```
Має з’явитись список файлів `unstaged`, які ви відредагували.
```console
```bash
On branch feat/documentation
Your branch is up to date with 'upstream/feat/documentation'.
@@ -282,25 +282,25 @@ flutter run
У цьому кроці потрібно позначити лише ті файли, які редагували чи додавали самостійно. Якщо необхідно, ви можете виконати скидання та виправити файли, які не збираєтеся змінювати.
```console
```bash
git add path/to/my/changed/file.ext
```
Або ви можете додати всі файли `unstaged` до області тимчасового зберігання:
```console
```bash
git add .
```
Лише ті файли, які було переміщено до області тимчасового зберігання, будуть додані під час затвердження.
```console
```bash
git status
```
Вивід:
```console
```bash
On branch feat/documentation
Your branch is up to date with 'upstream/feat/documentation'.
@@ -313,7 +313,7 @@ flutter run
Тепер ви можете затвердити свої зміни, використовуючи коротке повідомлення:
```console
```bash
git commit -m "fix: my short commit message"
```
@@ -345,7 +345,7 @@ flutter run
9. Якщо вам потрібно відредагувати файл або оновити повідомлення після створення затвердження, це можна зробити після редагування файлів за допомогою:
```console
```bash
git commit --amend
```
@@ -353,7 +353,7 @@ flutter run
10. Тепер надішліть свої зміни до розгалуження:
```console
```bash
git push origin branch/name-here
```
@@ -363,14 +363,14 @@ flutter run
1. Клонуйте копію [репозиторію freeCodeCamp](https://github.com/freeCodeCamp/freeCodeCamp) локально зі своєї локальної копії репозиторію мобільного застосунку freeCodeCamp. Структура файлів має виглядати так:
```console
```bash
├── freeCodeCamp
├── mobile
```
2. Змініть каталог на репозиторій freeCodeCamp:
```console
```bash
cd freeCodeCamp
```
@@ -378,25 +378,25 @@ flutter run
#### **macOS/Linux**
```console
```bash
cp sample.env .env
```
#### **Windows**
```console
```bash
copy sample.env .env
```
4. Встановіть залежності для репозиторію freeCodeCamp:
```console
```bash
pnpm install && pnpm run create:shared
```
5. Створіть файл JSON з даними завдань:
```console
```bash
pnpm run build:curriculum
```
@@ -404,54 +404,54 @@ flutter run
#### **macOS/Linux**
```console
```bash
cp ./shared/config/curriculum.json ../mobile/mobile-app/curriculum.json
```
#### **Windows**
```console
```bash
copy .\shared\config\curriculum.json ..\mobile\mobile-app\curriculum.json
```
7. Змініть каталог на мобільний застосунок:
```console
```bash
cd ../mobile/mobile-app
```
8. Встановіть залежності для мобільного застосунку:
```console
```bash
flutter pub get
```
9. Оновіть файл тестів, щоб використовувати файл JSON з даними завдань:
```console
```bash
sed -i '' 's/..\/..\/shared\/config\/curriculum.json/.\/curriculum.json/g' test/widget_test.dart
```
10. Створіть файли завдань:
```console
```bash
flutter test test/widget_test.dart
```
11. Запустіть локальний сервер для обслуговування файлів завдань за допомогою пакету `serve`:
```console
```bash
npx serve
```
12. В іншому терміналі поверніться до репозиторію freeCodeCamp:
```console
```bash
cd ../../freeCodeCamp
```
13. Запустіть тести cypress:
```console
```bash
pnpm cypress run --config retries=1,screenshotOnRunFailure=false,video=false,baseUrl=http://localhost:3000/generated-tests/,specPattern=cypress/e2e/mobile-learn/test-challenges.js -s cypress/e2e/mobile-learn/test-challenges.js -b chrome
```
@@ -482,7 +482,7 @@ A quick reference to the commands that you will need when working locally.
Якщо у вас виникли проблеми з інтерфейсом чи збіркою, може допомогти очищення:
```console
```bash
flutter clean
```

View File

@@ -10,7 +10,7 @@
## Активуйте WSL
Дотримуйтесь інструкцій з [офіційної документації](https://docs.microsoft.com/en-us/windows/wsl/install-win10), щоб встановити WSL1 та оновити його до WSL2.
Follow the instructions on the [official documentation](https://docs.microsoft.com/en-us/windows/wsl/install-win10) to install WSL2.
## Встановіть Ubuntu
@@ -20,9 +20,11 @@
>
> Ви можете використовувати інші дистрибутиви, основою яких не є Debian, але у них наявні певні недоліки та вони виходять за рамки цього посібника.
As of November 2023, Ubuntu and Debian are the only Linux distributions [officially supported by Playwright](https://playwright.dev/docs/intro#system-requirements), the end-to-end testing library used by freeCodeCamp.
2. Оновіть залежності ОС
```console
```bash
sudo apt update
sudo apt upgrade -y
@@ -70,23 +72,23 @@ git version 2.25.1
Як тільки ви налаштували Docker Desktop для роботи з WSL2, дотримуйтесь цих кроків, щоб запустити службу MongoDB:
1. Запустіть новий термінал Ubuntu-18.04
1. Launch a new Ubuntu terminal
2. Витягніть `MongoDB 4.0.x` із Docker Hub
2. Pull MongoDB from Docker Hub. Please refer to the [Prerequisites](how-to-setup-freecodecamp-locally.md#Prerequisites) table for the current version of MongoDB used by freeCodeCamp. For example, if the version number is `5.0.x`, replace `<x.y>` with `5.0` in the following two code snippets.
```console
docker pull mongo:4.0
```bash
docker pull mongo:<x.y>
```
3. Запустіть службу MongoDB на порті `27017` та налаштуйте її на автоматичний запуск після перезавантаження системи
```console
```bash
docker run -it \
-v mongodata:/data/db \
-p 27017:27017 \
--name mongodb \
--restart unless-stopped \
-d mongo:4.0
-d mongo:<x.y>
```
4. Тепер ви можете отримати доступ до служби з Windows чи Ubuntu на `mongodb://localhost:27017`.
@@ -95,37 +97,126 @@ git version 2.25.1
Ми рекомендуємо встановити випуск LTS для Node.js за допомогою Node Version Manager ([nvm](https://github.com/nvm-sh/nvm#installing-and-updating)).
Як тільки його буде встановлено, використайте ці команди, щоб встановити та використовувати версію Node.js за потреби:
Once installed use this command to install and use the latest Node.js LTS version:
```console
```bash
nvm install --lts
# АБО
# nvm install <version>
nvm install 14
# Використання
# nvm use <version>
nvm use 12
```
Node.js надходить разом з `npm`, який можна використати для встановлення `pnpm`:
For instructions on installing and using a different version of Node.js, please refer to the [nvm docs](https://github.com/nvm-sh/nvm#usage).
```console
Node.js comes bundled with `npm`, which you can use to install `pnpm`:
```bash
npm install -g pnpm
```
## Налаштуйте freeCodeCamp локально
Ви встановили передумови, тому дотримуйтесь [нашого посібника з локального налаштування](how-to-setup-freecodecamp-locally.md), щоб клонувати, встановити та налаштувати freeCodeCamp локально на своїй машині.
Now that you have installed the pre-requisites, follow [our local setup guide](how-to-setup-freecodecamp-locally.md) to clone, install and set up freeCodeCamp locally on your machine.
> [!WARNING]
>
> Зауважте, що наразі налаштування тестів Cypress (та пов’язаних потреб GUI) знаходяться в стадії розробки. Ви повинні вміти працювати над більшою частиною кодової бази.
## Корисні посилання
## Optimize Windows and WSL
> [!NOTE]
>
> The following tips were collected from across the web and have not gone through vigorous testing. Your mileage may vary.
### Adjust processer scheduling for background services
This may reduce incidents of Docker containers crashing due to lack of resources.
Open the System Properties control panel by pressing <kbd>Win + R</kbd> and entering `sysdm.cpl`
<details>
<summary>
Enter <code>sysdm.cpl</code> in the Run dialog (screenshot)
</summary>
<br>
<img src="https://raw.githubusercontent.com/freeCodeCamp/freeCodeCamp/main/docs/images/wsl/run-sysdm.png" alt="Enter `sysdm.cpl` in the Run dialog" />
</details>
<br>
Go to Advanced -> Performance -> Settings…
<details>
<summary>
Performance Settings button under Advanced tab in System Properties (screenshot)
</summary>
<br>
<img src="https://raw.githubusercontent.com/freeCodeCamp/freeCodeCamp/main/docs/images/wsl/advanced-performance-settings.png" alt="Performance Settings button under Advanced tab in System Properties" />
</details>
<br>
Under Advanced -> Processor scheduling, choose "Background services". Do not close the window. Continue to the next tip.
<details>
<summary>
Background services radio button under Advanced tab in Performance Options (screenshot)
</summary>
<br>
<img src="https://raw.githubusercontent.com/freeCodeCamp/freeCodeCamp/main/docs/images/wsl/background-services.png" alt="Background services radio button under Advanced tab in Performance Options" />
</details>
### Increase the size of Windows paging file for the system drive
Under Advanced -> Virtual memory, click "Change…"
<details>
<summary>
Change virtual memory button under Advanced tab in Performance Options (screenshot)
</summary>
<br>
<img src="https://raw.githubusercontent.com/freeCodeCamp/freeCodeCamp/main/docs/images/wsl/advanced-virtual-memory.png" alt="Change virtual memory button under Advanced tab in Performance Options" />
</details>
<br>
Choose "Custom size". Set the initial size to 1.5x and the maximum size to 3x of your physical memory. Then click "Set".
<details>
<summary>
Set custom size button in Virtual Memory window (screenshot)
</summary>
<br>
<img src="https://raw.githubusercontent.com/freeCodeCamp/freeCodeCamp/main/docs/images/wsl/set-custom-size.png" alt="Set custom size button in Virtual Memory window" />
</details>
### Increase the size of memory allocated to WSL
Create a [`.wslconfig` file](https://learn.microsoft.com/en-us/windows/wsl/wsl-config#configuration-setting-for-wslconfig) in your [`%UserProfile%` directory](https://learn.microsoft.com/en-us/windows/wsl/wsl-config#wslconfig) (typically `C:\Users\<UserName>\.wslconfig`). Please read the [WSL documentation](https://learn.microsoft.com/en-us/windows/wsl/wsl-config#configuration-setting-for-wslconfig) carefully and replace `x` with values that suit your own needs:
```ini
# Settings apply across all Linux distros running on WSL 2
[wsl2]
# How much memory to assign to the WSL 2 VM. The default value might not be enough
memory=xGB
# How much swap space to add to the WSL 2 VM, default is 25% of available RAM
swap=xGB
```
### Increase Node.js max old space size
This fixes the ["JavaScript heap out of memory" error](https://stackoverflow.com/a/54456814) with ESLint. Add the following to your `~/.bashrc` or `~/.zshrc`:
```sh
export NODE_OPTIONS="--max-old-space-size=4096"
```
### Avoid `pnpm run test`
Instead, use the script [appropriate to your PR](https://forum.freecodecamp.org/t/wsl-performance-issues-while-working-on-the-codebase/644215/2#:~:text=usually%2C%20you%20just%20want%20to%20test%20something%20specific%20to%20either%20the%20curriculum%20or%20the%20client%20or%20the%20api%20-%20almost%20never%20all%203.); either `pnpm run test:api`, `pnpm run test:curriculum`, or `pnpm run test-client`.
## Useful Links
- [A WSL2 Dev Setup with Ubuntu 20.04, Node.js, MongoDB, VS Code, and Docker](https://hn.mrugesh.dev/wsl2-dev-setup-with-ubuntu-nodejs-mongodb-and-docker) — стаття Мругеша Мохапатри (штатний розробник freeCodeCamp.org)
- Часті питання:

View File

@@ -232,15 +232,17 @@ title: Challenge Title
Надавайте перевагу коротким абзацам (1-4 речення). Найімовірніше, люди прочитають декілька коротких абзаців, а не суцільний текст.
У тексті завдання потрібно використовувати 2-гу особу множини («ви»). У такий спосіб текст та інструкції будуть звернені напряму до учня, який виконує завдання. Намагайтеся уникати звертань у 1-й особі, як-от «я», «ми», «нам».
Use american english, e.g., use `labeled` instead of `labelled`.
Не використовуйте зовнішні посилання. Вони переривають робочий процес. Учні не повинні використовувати гугл під час виконання завдань. Якщо є ресурси, які, на вашу думку, допоможуть учням, додайте їх до статті, пов’язаної з керівництвом до завдання.
Challenge text should use the second person ("you") to help to give it a conversational tone. This way the text and instructions seem to speak directly to the camper working through the challenge. Try to avoid using the first person ("I", "we", "let's", and "us").
В разі потреби можна додати діаграми.
Don't use outbound links. These interrupt the flow. Campers should never have to google anything during these challenges. If there are resources you think campers would benefit from, add them to the challenge's Guide-related article.
Не використовуйте емоджі в завданнях. freeCodeCamp — глобальна спільнота, а значення емоджі може відрізнятись в різних частинах світу. Крім цього, емоджі можуть по-різному зображатися у різних системах.
You can add diagrams if necessary.
Власні іменники потрібно писати з великої літери, коли це можливо. Нижче поданий список, у якому показано, як повинні писатись слова в завданнях.
Don't use emojis or emoticons in challenges. freeCodeCamp has a global community, and the cultural meaning of an emoji or emoticon may be different around the world. Also, emojis can render differently on different systems.
Proper nouns should use correct capitalization when possible. Below is a list of words as they should appear in the challenges.
- JavaScript (великі літери «J» і «S», без скорочень)
- Node.js
@@ -248,28 +250,28 @@ title: Challenge Title
### Правило двох хвилин
Кожне завдання повинне бути вирішене протягом 120 секунд носієм англійської мови, який виконав попередні завдання. У цей час входять прочитання вказівок/інструкцій для розуміння початкового коду, написання власного коду і проходження всіх тестів.
Each challenge should be solvable within 120 seconds by a native English speaker who has completed the challenges leading up to it. This includes the amount of time it takes to read the directions/instructions understand the seeded code, write their code and get all the tests to pass.
Якщо виконання завдання займає більше двох хвилин, у вас є два шляхи:
If it takes longer than two minutes to complete the challenge, you have two options:
- Спростіть завдання, або
- Розділіть завдання на два кроки.
Завдяки правилу двох хвилин ви зробите лаконічні вказівки, зрозумілий початковий код та прості тести.
The 2-minute rule forces you, the challenge designer, to make your directions concise, your seed code clear, and your tests straightforward.
Ми відстежуємо скільки часу займає розв’язок завдань та використовуємо цю інформацію, щоб виявити завдання, які потрібно спростити чи розділити.
We track how long it takes for campers to solve challenges and use this information to identify challenges that need to be simplified or split.
### Модульність
Кожне завдання повинне навчати лише одному поняттю, і це поняття повинне бути очевидним з назви завдання.
Each challenge should teach exactly one concept, and that concept should be apparent from the challenge's name.
Ми можемо закріпити раніше вивчені поняття за допомогою повторення та варіацій. Наприклад, ознайомити користувача з елементами h1 в одному завданні, а пізніше з елементами h3.
We can reinforce previously covered concepts through repetition and variations - for example, introducing h1 elements in one challenge, then h3 elements a few challenges later.
Наша мета — розробити тисячі двохвилинних завдань. Вони можуть йти нарівні, а також нагадувати про раніше вивчені поняття.
Our goal is to have thousands of 2-minute challenges. These can flow together and reiterate previously-covered concepts.
### Форматування тексту завдання
Тут подано конкретні рекомендації щодо форматування тексту завдання та приклади:
Here are specific formatting guidelines for challenge text and examples:
- Ключові слова мови знаходяться у зворотних лапках `` \` ``. Наприклад, назви тегів HTML чи назви властивостей CSS.
- Посилання на частини коду (тобто назви функцій, методів чи змінних) потрібно брати у зворотні лапки `` \ ` ``. Розгляньте приклад нижче:
@@ -282,9 +284,9 @@ title: Challenge Title
- Перед блоками багаторядкового коду **має бути порожній рядок**. Наступний рядок повинен починатись з трьох зворотних лапок, після яких йде одна з [підтримуваних мов](https://prismjs.com/#supported-languages). Щоб закінчити блок коду, потрібно почати новий рядок, який має лише три зворотні лапки та **ще один порожній рядок**. Розгляньте приклад нижче:
- Пробіл має значення у markdown, тому ми рекомендуємо зробити його видимим у редакторі.
**Примітка:** якщо ви збираєтесь використовувати код прикладу в YAML, використовуйте `yaml` замість `yml` для мови справа від зворотних лапок.
**Note:** If you are going to use an example code in YAML, use `yaml` instead of `yml` for the language to the right of the backticks.
Нижче поданий приклад коду:
The following is an example of code:
````md
```{language}
@@ -306,7 +308,7 @@ title: Challenge Title
Наша мета — пояснити поняття, описане в завданні, та перевірити, що його зрозуміли.
Тести завдань можуть використовувати бібліотеки Node.js та Chai.js. Якщо необхідно, у змінній `code` можна отримати доступ до коду, створеного користувачами. Крім того, об’єкт `__helpers` надає декілька функцій, які полегшують процес написання тестів. Доступні функції визначені у _client/src/utils/curriculum-helpers.ts_.
Тести завдань можуть використовувати бібліотеки Node.js та Chai.js. Якщо необхідно, у змінній `code` можна отримати доступ до коду, створеного користувачами. Крім того, об’єкт `__helpers` надає декілька функцій, які полегшують процес написання тестів. The available functions are defined in the [curriculum-helpers](https://github.com/freeCodeCamp/curriculum-helpers/blob/main/lib/index.ts) repo.
## Форматування вихідного коду
@@ -328,13 +330,13 @@ title: Challenge Title
// Змініть код під цим рядком
````
Приклад дійсного коментаря CSS:
Example of a valid CSS comment:
```css
/* Only change code above this line */
```
Якщо завдання має лише одне місце, де потрібно змінити код, будь ласка, використайте коментарі з наступного прикладу, щоб проінформувати користувача, де потрібно внести зміни.
If a challenge only has a single place where code changes are needed, please use the comments in the following example to instruct the user where changes should be made.
```js
var a = 3;
@@ -347,7 +349,7 @@ b = 9 + b;
c = c + 7;
```
Якщо завдання має декілька місць, де користувач повинен змінити код (наприклад, завдання з React)
If a challenge has multiple places where the user is expected to change code (i.e. the React challenges)
```jsx
class MyComponent extends React.Component {
@@ -380,9 +382,9 @@ class MyComponent extends React.Component {
### Переклад коментарів початкового коду
Існують окремі словники з коментарями для кожної мови. [Англійська версія словника з коментарями](https://github.com/freeCodeCamp/freeCodeCamp/blob/main/curriculum/dictionaries/english/comments.json) є основою для перекладів іншомовних версій файлів. Китайська версія словника з коментарями буде розташована на `/curriculum/dictionaries/chinese/comments.json`. Кожен словник складається з масиву об’єктів з унікальною властивістю `id` та властивістю `text`. Щоб охопити переклад англійського коментаря, потрібно змінювати лише `text`.
There are separate comment dictionaries for each language. The [English version of the comment dictionary](https://github.com/freeCodeCamp/freeCodeCamp/blob/main/curriculum/dictionaries/english/comments.json) is the basis for the translations found in the corresponding non-English versions of the files. The non-English version of the Chinese comment dictionary would be located at `/curriculum/dictionaries/chinese/comments.json`. Each dictionary consists of an array of objects with a unique `id` property and a `text` property. Only the `text` should be modified to encompass the translation of the corresponding English comment.
Деякі коментарі можуть містити слова чи фрази, які не потрібно перекладати. Наприклад, назви змінних або власні назви бібліотек (як-от «React») не потрібно перекладати. Розгляньте приклад нижче. Слово `myGlobal` не потрібно перекладати.
Some comments may contain a word/phrase that should not be translated. For example, variable names or proper library names like "React" should not be translated. See the comment below as an example. The word `myGlobal` should not be translated.
```text
Оголосіть змінну myGlobal під цим рядком
@@ -394,13 +396,13 @@ class MyComponent extends React.Component {
## Підказки та розв’язки
Кожне завдання має кнопку `Get a Hint` для того, щоб користувач отримав доступ до будь-яких підказок/розв’язків, які були створені для цього завдання. Підказки та розв’язки навчальної програми розташовані на [нашому форумі](https://forum.freecodecamp.org/c/guide) у категорії `Guide`.
Each challenge has a `Get a Hint` button, so a user can access any hints/solutions which have been created for the challenge. Curriculum hints/solutions topics are located on [our forum](https://forum.freecodecamp.org/c/guide) under the `Guide` category.
Якщо ви виявили помилку в наявних підказках чи розв’язках, повідомте про це на форумі [у розділі «Contributors»](https://forum.freecodecamp.org/c/contributors). Модератори й користувачі з 3-м рівнем довіри розглянуть коментарі та приймуть рішення щодо наданих вами змін.
If you find a problem with an existing challenge's hints/solutions topic, you can make suggestions in the [contributors category](https://forum.freecodecamp.org/c/contributors) on the forum. Moderators and users with trust level 3 will review the comments and decide whether or not to include the changes in the corresponding hint/solutions topic.
### Додавання нових тем для підказок чи розв’язків завдань
Виконайте наступні кроки, щоб додати нову тему для підказок чи розв’язків завдань.
Take the following steps when adding a new challenge hints/solutions-related topic.
1. Розпочніть з тих самих кроків для створення нової теми, але зверніть увагу на наступні щодо заголовка.
2. Заголовок теми повинен починатись з `freeCodeCamp Challenge Guide:`, з’єднаного з назвою завдання навчальної програми. Наприклад, якщо завдання має назву `Chunky Monkey`, заголовком теми буде `freeCodeCamp Challenge Guide: Chunky Monkey`.
@@ -409,7 +411,7 @@ class MyComponent extends React.Component {
### Вказівки щодо змісту тем підказок і розв’язків
Пропонуючи розв’язок до теми завдання навчальної програми, потрібно додати повний код. Сюди входить весь вихідний код та будь-які зміни, необхідні для проходження тестів. Використовуйте цей шаблон для створення нових тем підказок/розв’язків:
When proposing a solution for a curriculum challenge-related Guide topic, the full code must be added. This includes all the original seed code plus any changes needed to pass all the challenge tests. The following template should be used when creating new hints/solutions topics:
````md
# Тут назва завдання
@@ -496,35 +498,35 @@ FCC_SUPERBLOCK='responsive-web-design' pnpm run test:curriculum
cd curriculum
```
2. Виконайте цю команду для кожного файлу завдання, до якого ви внесли зміни (замінивши `challenge-title-goes-here` на повну назву завдання):
2. Run the following for each challenge file for which you have changed (replacing `challenge-title-goes-here` with the full title of the challenge):
```
pnpm run test -- -g challenge-title-goes-here
```
> [!TIP]
> Ви можете встановити змінну середовища `LOCALE` у `.env` на мову завдань, які потрібно протестувати.
> You can set the environment variable `LOCALE` in the `.env` to the language of the challenge(s) you need to test.
>
> Наразі прийнятними значеннями є `english` та `chinese` (`english` за замовчуванням).
> The currently accepted values are `english` and `chinese`, with `english` being set by default.
## Відкриття запиту на злиття (PR)
## Proposing a Pull Request (PR)
Як тільки ви затвердили свої зміни, див. [як відкрити запит на злиття](how-to-open-a-pull-request.md).
After you've committed your changes, check here for [how to open a Pull Request](how-to-open-a-pull-request.md).
## Корисні посилання
## Useful Links
Створення та редагування завдань:
Creating and Editing Challenges:
1. [Види завдань](https://github.com/freeCodeCamp/freeCodeCamp/blob/main/client/utils/challenge-types.js#L1-L13) — що означають числові значення завдань (перелік).
1. [Challenge types](https://github.com/freeCodeCamp/freeCodeCamp/blob/main/client/utils/challenge-types.js#L1-L13) - what the numeric challenge type values mean (enum).
2. [Внесок до FreeCodeCamp: написання тестів до завдань ES6](https://www.youtube.com/watch?v=iOdD84OSfAE#t=2h49m55s) — відео [Ітана Арровуда](https://twitter.com/ArrowoodTech) про його внесок до старої версії навчальної програми.
2. [Contributing to FreeCodeCamp - Writing ES6 Challenge Tests](https://www.youtube.com/watch?v=iOdD84OSfAE#t=2h49m55s) - a video following [Ethan Arrowood](https://twitter.com/ArrowoodTech) as he contributes to the old version of the curriculum.
## Допоміжні скрипти
## Helper Scripts
> [!NOTE]
> Якщо ви працюєте над покроковими завданнями, див. розділ щодо [роботи над практичними проєктами](how-to-work-on-practice-projects.md).
> If you are working with the step-based challenges, refer to the [Work on Practice Projects](how-to-work-on-practice-projects.md) section.
Існує декілька допоміжних скриптів, які можна використовувати для завдань у блоці. Зверніть увагу, що ці команди потрібно виконувати у каталозі блоків. Наприклад:
There are a few helper scripts that can be used to manage the challenges in a block. Note that these commands should all be run in the block directory. For example:
```bash
cd curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-algorithm-scripting
@@ -532,33 +534,33 @@ cd curriculum/challenges/english/02-javascript-algorithms-and-data-structures/ba
### Додати нове завдання
Щоб додати нове завдання в кінці блоку, викличте скрипт:
To add a new challenge at the end of a block, call the script:
```bash
pnpm run create-next-challenge
```
Це допоможе отримати інформацію про завдання та створити файл з завданням, оновивши файл `meta.json` новою інформацією про завдання.
This will prompt you for the challenge information and create the challenge file, updating the `meta.json` file with the new challenge information.
### Видалити завдання
Щоб видалити завдання, викличте скрипт:
To delete a challenge, call the script:
```bash
pnpm run delete-challenge
```
Це допоможе обрати потрібне завдання, видалити файл та оновити файл `meta.json`, щоб видалити завдання з порядку.
This will prompt you to select which challenge should be deleted, then delete the file and update the `meta.json` file to remove the challenge from the order.
### Вставити завдання
Щоб вставити завдання перед наявним завданням, викличте скрипт:
To insert a challenge before an existing challenge, call the script:
```bash
pnpm run insert-challenge
```
Це допоможе отримати інформацію про нове завдання, а також про наявне завдання. Наприклад, якщо варіанти такі:
This will prompt you for the challenge information, then for the challenge to insert before. For example, if your choices are:
```bash
a
@@ -566,7 +568,7 @@ b
c
```
Якщо оберете `b`, то новим порядком буде:
If you choose `b`, your new order will be:
```bash
a
@@ -577,26 +579,26 @@ c
### Оновити порядок завдань
Якщо вам потрібно змінити порядок завдань вручну, викличте скрипт:
If you need to manually re-order the challenges, call the script:
```bash
pnpm run update-challenge-order
```
Він проведе вас через інтерактивний процес, який допоможе впорядкувати завдання.
This will take you through an interactive process to select the order of the challenges.
## Розв’язання проблем розробки
### Виявлено нескінченний цикл
Якщо ви бачите цю помилку в консолі під час попереднього перегляду завдання:
If you see the following error in the console while previewing a challenge:
```text
Potential infinite loop detected on line <number>...
```
Це означає, що плагін для захисту циклу знайшов довгий цикл або рекурсивну функцію. Якщо ваше завдання передбачає їх (тобто містить нескінченний цикл), ви можете запобігти використанню плагіну в попередньому перегляді. Для цього додайте `disableLoopProtectPreview: true` до файлу блоку `meta.json`.
This means that the loop-protect plugin has found a long-running loop or recursive function. If your challenge needs to do that (e.g. it contains an event loop that is supposed to run indefinitely), then you can prevent the plugin from being used in the preview. To do so, add `disableLoopProtectPreview: true` to the block's `meta.json` file.
Якщо ваші тести інтенсивно обчислюються, ви можете побачити цю помилку під час запуску. Якщо це відбувається, додайте `disableLoopProtectTests: true` до файлу блоку `meta.json`.
If your tests are computationally intensive, then you may see this error when they run. If this happens then you can add `disableLoopProtectTests: true` to the block's `meta.json` file.
Значенням обох необов’язково має бути true, тому налаштовуйте їх лише за потреби.
It's not typically necessary to have both set to true, so only set them as needed.

View File

@@ -16,7 +16,7 @@
Більшість файлів для перекладу платформи розташовані у папці [`client/i18n`](https://github.com/freeCodeCamp/freeCodeCamp/tree/main/client/i18n). Для кожної мови є каталог, що містить файли JSON з перекладами.
```console
```bash
config
└── i18n.ts
...

View File

@@ -47,7 +47,7 @@
Налаштуйте freeCodeCamp локально ([див. посібник з локального налаштування](how-to-setup-freecodecamp-locally)). Ми зібрали CLI з інструментами веброзробки, щоб ви могли запустити будь-яку з наведених нижче команд з кореня репозиторію:
```console
```bash
pnpm run docs:serve
```

View File

@@ -16,7 +16,7 @@
Коли ви будуєте клієнта, Gatsby кешує шрифти, мовні рядки та UI. Якщо щось з переліченого не кешоване, виконайте наступне:
```console
```bash
pnpm run clean
pnpm install
pnpm run seed
@@ -53,7 +53,7 @@ git clean -ifdX
Якщо ви не можете увійти, а замість цього бачите банер з повідомленням про помилку, яка буде відправлена до freeCodeCamp, будь ласка, перевірте, чи не використовується ваш локальний порт `3000` іншою програмою.
#### **З термінала:**
```console
```bash
netstat -a | grep "3000"
tcp4 0 0 0.0.0.0:3000 DESKTOP LISTEN