-
Open the Microsoft Store:
-
Search for and install Visual Studio Code (VSCode).
-
Search for and install Windows Subsystem for Linux (WSL).
-
-
Open Command Prompt (
cmd.exe
) and typewsl --install
, then pressEnter
to install Ubuntu via. WSL.
-
Open VSCode
-
In the bottom left corner, click the
<>
arrows (tooltipOpen a remote window
).- Connect to WSL - from the dropdown, select
Connect to WSL
. This takes a moment as it is connecting to Ubuntu in WSL. Once it's finished, VSCode will be running from Ubuntu in the/home
directory.
- Connect to WSL - from the dropdown, select
-
Tap
Clone Repository
, then select your forkedcore
repository -
If prompted in the bottom-right, choose:
-
Do you trust the authors of the files in this folder?
- yes -
Do you want to install the recommended extensions from Microsoft and Prettier for this repository?
- install -
Install python debugger extension
- yes -
Reopen in container
- yes -
Dev containers require docker to run
- install - this takes an extremely long time as all dependencies need to be downloaded then installedDo you want to continue
- yes
-
Virtual environment
- disable
-
-
Generate translations - press
Ctrl-T
, clear the box and typeTask
then a space, then selectGenerate English translations
. DIDNT DO ANYTHING?
Leave this VSCode window open to keep HA Core running. We will come back to it later.
-
Open VSCode
-
In the bottom left corner, click the
<>
arrows (tooltipOpen a remote window
).- Connect to WSL - from the dropdown, select
Connect to WSL
. This takes a moment as it is connecting to Ubuntu in WSL. Once it's finished, VSCode will be running from Ubuntu in the/home
directory.
- Connect to WSL - from the dropdown, select
-
Tap
Clone Repository
, then select your forkedfrontend
repository -
If prompted in the bottom-right, choose:
-
Do you trust the authors of the files in this folder?
- yes -
Do you want to install the recommended extensions from Microsoft and Prettier for this repository?
- install -
Install python debugger extension
- yes -
Reopen in container
- yes -
Dev containers require docker to run
- install - this takes an extremely long time as all dependencies need to be downloaded then installedDo you want to continue
- yes
-
Virtual environment
- disable
-
-
Open a terminal - if you do not see a Terminal (
username@hostname:~/workspaces
), open a new terminal from the menubar by selectingTerminal
->New Terminal
.
-
Run bootstrap script - type
script/bootstrap
, then pressEnter
- this can take a while as npm dependencies are downloaded and installed or built - done with warnings is okay -
Run the frontend - type
script/develop
, then pressEnter
- this can take a while as frontend is built from TypeScript. -
Generate translations - press
Ctrl-T
, clear the box and typeTask
then a space, then selectSetup and fetch nightly translations
. -
If you get an error when building:
-
Couldn't find a script named "lint-staged" -
yarn add lint-staged husky --dev
-
Git: Extension 'vscode.git' CANNOT use API proposal: telemetry - tried disabling Git and File -> Preferences -> Settings, search for Telemetry and change to Off but nothing worked (refer microsoft/vscode#204382); eventually got this working but don't remember what changed it
-
Leave this VSCode window open to keep HA Frontend running. We will come back to it later.
-
Switch back to the VSCode window for
core
. -
From the sidebar, select the
two sheets
icon at the top (tooltip `Explorer). -
Click
config
folder, then clickconfiguration.yaml
file, then afterfrontend
section on a new line, adddevelopment_repo: /workspaces/frontend/
(DO WE NEED TO SAVE). -
Click
.devcontainer
folder, then clickdevcontainer.json
file, then at the end of the file but before the last}
, add (DO WE NEED TO SAVE):}, "mounts": [ "source=/home/<username>/frontend,target=/workspaces/frontend,type=bind,consistency=cached" ]
- If prompted in the bottom-right
Configuration file(s) changed: devcontainer.json. The container might need to be rebuilt to apply the changes.
, choose:Rebuild
- this can take a while
- If prompted in the bottom-right
-
From the menubar, select
File
->Add Folder to Workspace
, then choosefrontend
and pressOK
. -
From the menubar, select
File
->Save Workspace As
, you decide, then pressOK
. -
From the sidebar, select the
Play / Bug
icon fourth from the top (tooltipRun and Debug
), then in the top-left next toRUN AND DEBUG
, press the green play>
button - this can take a while as HA Core builds.- If prompted in the bottom-right
A virtual environment is not currently selected for your Python interpreter. Would you like to create a virtual environment?
, chooseDisable
.
- If prompted in the bottom-right
TBC
git config --global user.name "codyc1515"
git config --global user.email [email protected]
Open frontend at http://localhost:8123
Create branch Make changes in the core / frontend folders Push branch Create PR etc.