-
-
Notifications
You must be signed in to change notification settings - Fork 992
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documented new frontend development script #2483
base: master
Are you sure you want to change the base?
Documented new frontend development script #2483
Conversation
📝 Walkthrough📝 WalkthroughWalkthroughThe documentation for frontend development has been significantly revised to enhance clarity and usability. It now presents two distinct methods for configuring Home Assistant for frontend testing, with detailed instructions for each method. A new command, Changes
Sequence Diagram(s)sequenceDiagram
participant Developer
participant HomeAssistant
participant Frontend
Developer->>HomeAssistant: Configure Home Assistant with development frontend
Developer->>Frontend: Run `script/develop_and_serve`
Frontend->>HomeAssistant: Connect to existing Home Assistant instance
Note over Developer, Frontend: Ensure to log out when changing URL
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (2)
docs/frontend/development.md (2)
28-29
: Minor grammatical improvement neededThe content effectively explains the two testing approaches and their tradeoffs. Add a comma after "However" for better readability:
-However the downside is that not everything can be tested this way. +However, the downside is that not everything can be tested this way.🧰 Tools
🪛 LanguageTool
[uncategorized] ~28-~28: A comma may be missing after the conjunctive/linking adverb ‘However’.
Context: ...ng Home Assistant without modifying it. However the downside is that not everything can...(SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA)
59-79
: Address grammatical issues in the new sectionThe content effectively documents the new
script/develop_and_serve
feature, but requires several grammatical corrections:-If you setup your frontend development environment +If you set up your frontend development environment -run the frontend on http://localhost:8124 and it will connect +run the frontend on http://localhost:8124, and it will connect -you will need to logout from your development frontend +you will need to log out from your development frontend -you will need to setup port forwarding +you will need to set up port forwardingAlso, consider completing the sentence about port forwarding setup with specific instructions or requirements.
🧰 Tools
🪛 LanguageTool
[grammar] ~61-~61: The word “setup” is a noun. The verb is spelled with a space.
Context: ... use an existing Home Assistant If you setup your frontend development environment s...(NOUN_VERB_CONFUSION)
[uncategorized] ~61-~61: Use a comma before ‘and’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...un the frontend on http://localhost:8124 and it will connect to the Home Assistant r...(COMMA_COMPOUND_SENTENCE)
[misspelling] ~67-~67: The verb or noun ‘bypass’ is spelled as one word.
Context: ... Assistant url the frontend connects to by passing the -c option. This will also work for ...(BY_PASS)
[misspelling] ~67-~67: Did you mean the verb “log out” instead of the noun ‘logout’?
Context: ... value for this option you will need to logout from your development frontend before i...(LOG_IN)
[grammar] ~73-~73: The word “setup” is a noun. The verb is spelled with a space.
Context: ...g from a devcontainer, you will need to setup port forwarding as well if you want to ...(NOUN_VERB_CONFUSION)
🪛 Markdownlint (0.35.0)
61-61: null
Bare URL used(MD034, no-bare-urls)
61-61: null
Bare URL used(MD034, no-bare-urls)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
docs/frontend/development.md
(2 hunks)
🧰 Additional context used
🪛 LanguageTool
docs/frontend/development.md
[uncategorized] ~28-~28: A comma may be missing after the conjunctive/linking adverb ‘However’.
Context: ...ng Home Assistant without modifying it. However the downside is that not everything can...
(SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA)
[grammar] ~61-~61: The word “setup” is a noun. The verb is spelled with a space.
Context: ... use an existing Home Assistant If you setup your frontend development environment s...
(NOUN_VERB_CONFUSION)
[uncategorized] ~61-~61: Use a comma before ‘and’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...un the frontend on http://localhost:8124 and it will connect to the Home Assistant r...
(COMMA_COMPOUND_SENTENCE)
[misspelling] ~67-~67: The verb or noun ‘bypass’ is spelled as one word.
Context: ... Assistant url the frontend connects to by passing the -c option. This will also work for ...
(BY_PASS)
[misspelling] ~67-~67: Did you mean the verb “log out” instead of the noun ‘logout’?
Context: ... value for this option you will need to logout from your development frontend before i...
(LOG_IN)
[grammar] ~73-~73: The word “setup” is a noun. The verb is spelled with a space.
Context: ...g from a devcontainer, you will need to setup port forwarding as well if you want to ...
(NOUN_VERB_CONFUSION)
🪛 Markdownlint (0.35.0)
docs/frontend/development.md
61-61: null
Bare URL used
(MD034, no-bare-urls)
61-61: null
Bare URL used
(MD034, no-bare-urls)
🔇 Additional comments (1)
docs/frontend/development.md (1)
Line range hint 30-58
: Well-documented configuration instructions
The section provides clear, complete instructions for configuring the development frontend, including:
- Clear YAML configuration examples
- Detailed devcontainer setup steps
- Important caution about excluding local paths from PRs
🧰 Tools
🪛 LanguageTool
[uncategorized] ~28-~28: A comma may be missing after the conjunctive/linking adverb ‘However’.
Context: ...ng Home Assistant without modifying it. However the downside is that not everything can...
(SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA)
```shell | ||
script/develop_and_serve | ||
``` | ||
|
||
You can change the Home Assistant url the frontend connects to by passing the -c option. This will also work for existing production core instances. It does not need to be a development version hosted locally. However, if you change the value for this option you will need to logout from your development frontend before it actually switches to the new value. For example: | ||
|
||
```shell | ||
script/develop_and_serve -c https://myhost.duckdns.org:8123 | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
Documentation refers to a non-existent script
The documentation refers to a script/develop_and_serve
script and its -c
option, but this script does not exist in the codebase. The development server is actually managed through npm scripts defined in package.json, which uses Docusaurus commands and doesn't support the documented URL configuration option.
- Remove or update the documentation at
docs/frontend/development.md
to reflect the correct development server setup usingnpm start
or the appropriate Docusaurus commands - Remove the incorrect information about the
-c
option for changing the Home Assistant URL
🔗 Analysis chain
Verify documentation against the frontend implementation
Let's verify that the documented command and options match the implementation in PR #23062.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify the script implementation matches the documentation
# Check if the script exists and verify its contents
if [ -f "script/develop_and_serve" ]; then
echo "Checking script/develop_and_serve implementation..."
cat script/develop_and_serve
else
echo "Warning: script/develop_and_serve not found"
fi
# Search for related test files
fd -t f -e ts -e js "develop.*serve" test/
Length of output: 272
Script:
#!/bin/bash
# Let's check if the script exists in a different location and search for related files
fd -t f "develop_and_serve"
# Search for any files containing references to the script or its options
rg -i "develop_and_serve"
# Search for any configuration or URL-related patterns in the frontend code
rg -i "hass_url|hassUrl|HASS_URL" src/
Length of output: 299
Script:
#!/bin/bash
# Let's check the dev scripts directory and package.json for development commands
fd -t f "package.json"
# Check the content of package.json for development scripts
cat package.json
# Look for any development server or configuration related files
fd -t f -e js -e ts "dev-server|webpack.config"
Length of output: 1140
🧰 Tools
🪛 LanguageTool
[misspelling] ~67-~67: The verb or noun ‘bypass’ is spelled as one word.
Context: ... Assistant url the frontend connects to by passing the -c option. This will also work for ...
(BY_PASS)
[misspelling] ~67-~67: Did you mean the verb “log out” instead of the noun ‘logout’?
Context: ... value for this option you will need to logout from your development frontend before i...
(LOG_IN)
@martetassyns thanks, could you maybe use tabs instead of 1. and 2.? I think that would make it clearer that these are 2 options. |
We should not document this until it fully works. Right now REST API calls will not work. |
@wendevlin Could you point me to an example in the existing code where tabs are used? I tried to use the markdown {.tabset} feature I found documented online, but that doesn't work both in the visual code preview (attribute is printed instead of used) nor when running the Docusaurus site (errror: Could not parse expression with acorn). |
@bramkragten I wasn't aware that the frontend also made calls through that api and not just the websocket. I will make the changes |
@MindFreeze will look into it, we need to add a proxy and maybe replace @web/dev-server with another alternative |
Sure, here is an example: https://docusaurus.io/docs/markdown-features/tabs you need to import Tabs and TabItem below the frontmatter section (second When you do it correctly you would need to rename from |
@wendevlin @MindFreeze I assume this approach is what you are referring to? |
we don't need to proxy thr websocket it it's problem but it make everything cleaner. I started looking into using rspack's dec server but didn't have much time today |
@wendevlin The Tabs/TabItem feature in docusaurus in only available from version 3.6.3, while this repo is using 3.5.2 (at least I assume that is why I get an error Could not parse import/exports with acorn). I Feel that upgrading this should not be part of the scope of this change. Do you have any other recommendation on how we can make this more readable? |
Mhh ok. I tested it for you in dev mode. Need to check details tomorrow. |
@MindFreeze it would be nice if everything could be proxied. Because the hostname under which the core is accessible can be different between the browser and your node server hosting the files if you're running in devcontainer and use localhost. (it would be docker.host.internal in that case). It would also remove the need to have a special build of the frontend. I'll try to look into that some more. |
Tabs are available since version 2.0 see here |
@wendevlin I found what was going wrong and have made the requested changes to tabs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (4)
docs/frontend/development.md (4)
28-29
: Improve readability with proper punctuationThe content effectively explains the two configuration methods. However, there are minor grammatical improvements needed:
-However the downside is that not everything can be tested this way. +However, the downside is that not everything can be tested this way.🧰 Tools
🪛 LanguageTool
[uncategorized] ~28-~28: A comma may be missing after the conjunctive/linking adverb ‘However’.
Context: ...ng Home Assistant without modifying it. However the downside is that not everything can...(SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA)
66-67
: Fix grammar and improve URL formattingSeveral improvements needed:
-If you setup your frontend development environment +If you set up your frontend development environment -frontend on http://localhost:8124 and it will connect +frontend on `http://localhost:8124`, and it will connect🧰 Tools
🪛 LanguageTool
[grammar] ~66-~66: The word “setup” is a noun. The verb is spelled with a space.
Context: ...ontend outside Home Assistant"> If you setup your frontend development environment s...(NOUN_VERB_CONFUSION)
[uncategorized] ~66-~66: Use a comma before ‘and’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...un the frontend on http://localhost:8124 and it will connect to the Home Assistant r...(COMMA_COMPOUND_SENTENCE)
🪛 Markdownlint (0.35.0)
66-66: null
Bare URL used(MD034, no-bare-urls)
66-66: null
Bare URL used(MD034, no-bare-urls)
78-83
: Fix grammar and clarify port forwarding setup-you will need to setup port forwarding +you will need to set up port forwardingConsider adding brief instructions or a link to documentation about configuring port forwarding in devcontainers.
🧰 Tools
🪛 LanguageTool
[grammar] ~78-~78: The word “setup” is a noun. The verb is spelled with a space.
Context: ...g from a devcontainer, you will need to setup port forwarding as well if you want to ...(NOUN_VERB_CONFUSION)
72-73
: Fix grammar in configuration instructionsSeveral grammar improvements needed:
-by passing the -c option +bypassing the -c option -you will need to logout from +you will need to log out from🧰 Tools
🪛 LanguageTool
[misspelling] ~72-~72: The verb or noun ‘bypass’ is spelled as one word.
Context: ... Assistant url the frontend connects to by passing the -c option. This will also work for ...(BY_PASS)
[uncategorized] ~72-~72: Possible missing comma found.
Context: ...wever, if you change the value for this option you will need to logout from your devel...(AI_HYDRA_LEO_MISSING_COMMA)
[misspelling] ~72-~72: Did you mean the verb “log out” instead of the noun ‘logout’?
Context: ... value for this option you will need to logout from your development frontend before i...(LOG_IN)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
docs/frontend/development.md
(2 hunks)
🧰 Additional context used
🪛 LanguageTool
docs/frontend/development.md
[uncategorized] ~28-~28: A comma may be missing after the conjunctive/linking adverb ‘However’.
Context: ...ng Home Assistant without modifying it. However the downside is that not everything can...
(SENT_START_CONJUNCTIVE_LINKING_ADVERB_COMMA)
[grammar] ~66-~66: The word “setup” is a noun. The verb is spelled with a space.
Context: ...ontend outside Home Assistant"> If you setup your frontend development environment s...
(NOUN_VERB_CONFUSION)
[uncategorized] ~66-~66: Use a comma before ‘and’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...un the frontend on http://localhost:8124 and it will connect to the Home Assistant r...
(COMMA_COMPOUND_SENTENCE)
[misspelling] ~72-~72: The verb or noun ‘bypass’ is spelled as one word.
Context: ... Assistant url the frontend connects to by passing the -c option. This will also work for ...
(BY_PASS)
[uncategorized] ~72-~72: Possible missing comma found.
Context: ...wever, if you change the value for this option you will need to logout from your devel...
(AI_HYDRA_LEO_MISSING_COMMA)
[misspelling] ~72-~72: Did you mean the verb “log out” instead of the noun ‘logout’?
Context: ... value for this option you will need to logout from your development frontend before i...
(LOG_IN)
[grammar] ~78-~78: The word “setup” is a noun. The verb is spelled with a space.
Context: ...g from a devcontainer, you will need to setup port forwarding as well if you want to ...
(NOUN_VERB_CONFUSION)
🪛 Markdownlint (0.35.0)
docs/frontend/development.md
66-66: null
Bare URL used
(MD034, no-bare-urls)
66-66: null
Bare URL used
(MD034, no-bare-urls)
🔇 Additional comments (3)
docs/frontend/development.md (3)
30-34
: Well-structured tab implementation
The use of Docusaurus tabs improves the documentation's organization and readability, making it easier for users to choose their preferred configuration method.
Also applies to: 62-63, 85-87
68-76
:
Documentation refers to a non-existent script
Based on the previous review, the script/develop_and_serve
script and its -c
option don't exist in the codebase yet. This documentation should be added after the script is implemented in PR #23062.
🧰 Tools
🪛 LanguageTool
[misspelling] ~72-~72: The verb or noun ‘bypass’ is spelled as one word.
Context: ... Assistant url the frontend connects to by passing the -c option. This will also work for ...
(BY_PASS)
[uncategorized] ~72-~72: Possible missing comma found.
Context: ...wever, if you change the value for this option you will need to logout from your devel...
(AI_HYDRA_LEO_MISSING_COMMA)
[misspelling] ~72-~72: Did you mean the verb “log out” instead of the noun ‘logout’?
Context: ... value for this option you will need to logout from your development frontend before i...
(LOG_IN)
64-84
: Hold documentation updates pending script implementation
As mentioned by bramkragten in the PR comments, this documentation should be finalized after the new script is fully functional and REST API calls are operational. Consider:
- Holding these changes until PR #23062 is merged
- Adding a note about REST API limitations
- Including examples of common use cases once the script is working
✅ Verification successful
Documentation should be added after script implementation
The script/develop_and_serve
referenced in the documentation does not exist in the codebase yet. This documentation should be held until the actual script implementation is completed in PR #23062 to ensure accuracy and prevent confusion for developers.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Verify if the script exists in the frontend repository
if [ -f "script/develop_and_serve" ]; then
echo "Script exists"
cat script/develop_and_serve
else
echo "Script does not exist yet"
fi
Length of output: 98
🧰 Tools
🪛 LanguageTool
[grammar] ~66-~66: The word “setup” is a noun. The verb is spelled with a space.
Context: ...ontend outside Home Assistant"> If you setup your frontend development environment s...
(NOUN_VERB_CONFUSION)
[uncategorized] ~66-~66: Use a comma before ‘and’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...un the frontend on http://localhost:8124 and it will connect to the Home Assistant r...
(COMMA_COMPOUND_SENTENCE)
[misspelling] ~72-~72: The verb or noun ‘bypass’ is spelled as one word.
Context: ... Assistant url the frontend connects to by passing the -c option. This will also work for ...
(BY_PASS)
[uncategorized] ~72-~72: Possible missing comma found.
Context: ...wever, if you change the value for this option you will need to logout from your devel...
(AI_HYDRA_LEO_MISSING_COMMA)
[misspelling] ~72-~72: Did you mean the verb “log out” instead of the noun ‘logout’?
Context: ... value for this option you will need to logout from your development frontend before i...
(LOG_IN)
[grammar] ~78-~78: The word “setup” is a noun. The verb is spelled with a space.
Context: ...g from a devcontainer, you will need to setup port forwarding as well if you want to ...
(NOUN_VERB_CONFUSION)
🪛 Markdownlint (0.35.0)
66-66: null
Bare URL used
(MD034, no-bare-urls)
66-66: null
Bare URL used
(MD034, no-bare-urls)
Thanks, we'll review it when frontend PR is merged. |
@bramkragten I think that CORS is not an issue since the calls to /api/ don't seem to use the $hassUrl and are relative (for which support was added in home-assistant/frontend#23144). Can you confirm that this is the case, or point me to a part of the UI were it is an issue? |
As mentioned in the frontend PR, we should document that the user should set |
@bramkragten done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (4)
docs/frontend/development.md (4)
28-29
: Add a heading for better document structureConsider adding a clear heading like "## Configuration Methods" before introducing the two approaches. This would improve the document's structure and make it easier to navigate.
Line range hint
35-62
: Improve configuration example formattingConsider adding language identifiers to the code blocks for better syntax highlighting:
- Use
yaml configuration.yaml
instead of justyaml
- Use
json devcontainer.json
instead of justjson
This helps readers quickly identify which file they're looking at.
80-84
: Fix grammar and improve claritySeveral writing improvements needed:
- "by passing" should be "by-passing"
- Add a comma after "for this option"
- Use "log out" instead of "logout" (it's a verb in this context)
Suggested revision:
-You can change the Home Assistant url the frontend connects to by passing the -c option. This will also work for existing production core instances. However, if you change the value for this option you will need to logout from your development frontend before it actually switches to the new value. +You can change the Home Assistant URL the frontend connects to by by-passing the -c option. This will also work for existing production core instances. However, if you change the value for this option, you will need to log out from your development frontend before it actually switches to the new value.🧰 Tools
🪛 LanguageTool
[misspelling] ~80-~80: The verb or noun ‘bypass’ is spelled as one word.
Context: ... Assistant url the frontend connects to by passing the -c option. This will also work for ...(BY_PASS)
[uncategorized] ~80-~80: Possible missing comma found.
Context: ...wever, if you change the value for this option you will need to logout from your devel...(AI_HYDRA_LEO_MISSING_COMMA)
[misspelling] ~80-~80: Did you mean the verb “log out” instead of the noun ‘logout’?
Context: ... value for this option you will need to logout from your development frontend before i...(LOG_IN)
86-91
: Fix grammar and improve port forwarding explanation
- "setup" should be "set up" (it's a verb in this context)
- The port forwarding explanation could be clearer
Suggested revision:
-You can change the port the frontend is served on by passing the -p option. Note that if you are running from a devcontainer, you will need to setup -port forwarding as well if you want to access it from the container host. For example: +You can change the port the frontend is served on by passing the -p option. Note that if you are running from a devcontainer, you will need to set up +port forwarding in your devcontainer configuration if you want to access it from the container host. For example:🧰 Tools
🪛 LanguageTool
[grammar] ~86-~86: The word “setup” is a noun. The verb is spelled with a space.
Context: ...g from a devcontainer, you will need to setup port forwarding as well if you want to ...(NOUN_VERB_CONFUSION)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
docs/frontend/development.md
(2 hunks)
🧰 Additional context used
🪛 LanguageTool
docs/frontend/development.md
[style] ~74-~74: In American English, “you” and “have” do not usually form a contraction unless they’re followed by a past participle.
Context: ... - http://localhost:8124 ``` After you've setup your frontend development environ...
(IVE_I_HAVE_AMERICAN_STYLE)
[uncategorized] ~74-~74: Use a comma before ‘and’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...un the frontend on http://localhost:8124 and it will connect to the Home Assistant r...
(COMMA_COMPOUND_SENTENCE)
[misspelling] ~80-~80: The verb or noun ‘bypass’ is spelled as one word.
Context: ... Assistant url the frontend connects to by passing the -c option. This will also work for ...
(BY_PASS)
[uncategorized] ~80-~80: Possible missing comma found.
Context: ...wever, if you change the value for this option you will need to logout from your devel...
(AI_HYDRA_LEO_MISSING_COMMA)
[misspelling] ~80-~80: Did you mean the verb “log out” instead of the noun ‘logout’?
Context: ... value for this option you will need to logout from your development frontend before i...
(LOG_IN)
[grammar] ~86-~86: The word “setup” is a noun. The verb is spelled with a space.
Context: ...g from a devcontainer, you will need to setup port forwarding as well if you want to ...
(NOUN_VERB_CONFUSION)
🪛 Markdownlint (0.37.0)
docs/frontend/development.md
74-74: null
Bare URL used
(MD034, no-bare-urls)
74-74: null
Bare URL used
(MD034, no-bare-urls)
🔇 Additional comments (2)
docs/frontend/development.md (2)
30-34
: LGTM! Good improvement using tabs
The tabs implementation is a great improvement over numbered lists, making it easier for users to focus on their chosen configuration method.
74-78
:
Documentation references non-existent script
The documentation refers to script/develop_and_serve
, but according to previous reviews, this script doesn't exist in the codebase. This needs to be addressed before the documentation can be merged.
🧰 Tools
🪛 LanguageTool
[style] ~74-~74: In American English, “you” and “have” do not usually form a contraction unless they’re followed by a past participle.
Context: ... - http://localhost:8124 ``` After you've setup your frontend development environ...
(IVE_I_HAVE_AMERICAN_STYLE)
[uncategorized] ~74-~74: Use a comma before ‘and’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...un the frontend on http://localhost:8124 and it will connect to the Home Assistant r...
(COMMA_COMPOUND_SENTENCE)
🪛 Markdownlint (0.37.0)
74-74: null
Bare URL used
(MD034, no-bare-urls)
74-74: null
Bare URL used
(MD034, no-bare-urls)
After you've setup your frontend development environment so that you can run the `script/develop` script as described in section [Development](#development). You can use the following command as a replacement to develop and run the frontend on http://localhost:8124 and it will connect to the Home Assistant running on http://localhost:8123. Note that if you are running this command from a devcontainer, the url should be accessed from the container host. | ||
|
||
```shell | ||
script/develop_and_serve | ||
``` | ||
|
||
You can change the Home Assistant url the frontend connects to by passing the -c option. This will also work for existing production core instances. It does not need to be a development version hosted locally. However, if you change the value for this option you will need to logout from your development frontend before it actually switches to the new value. For example: | ||
|
||
```shell | ||
script/develop_and_serve -c https://myhost.duckdns.org:8123 | ||
``` | ||
|
||
You can change the port the frontend is served on by passing the -p option. Note that if you are running from a devcontainer, you will need to setup | ||
port forwarding as well if you want to access it from the container host. For example: | ||
|
||
```shell | ||
script/develop_and_serve -p 8654 | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
Documentation refers to a non-existent script
The documentation in docs/frontend/development.md
refers to a script/develop_and_serve
script that does not exist in the repository. The repository is actually a Docusaurus-based documentation site with different development commands:
- The actual development server is started using
npm run start:development
ornpm run start:devcontainer
- The documented functionality about connecting to Home Assistant and port configuration is not present in the codebase
🔗 Analysis chain
Verify the development server implementation
Let's verify how the development server is actually implemented to ensure the documentation matches reality.
Let's gather more information by checking the actual script content and related files.
Let's check the docusaurus configuration and look for any development-related scripts in the root directory, as the script might be in a different location.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check the actual implementation of the development server
# Look for development server related files and scripts
echo "Checking for development server scripts..."
fd -t f "develop.*serve|dev-server"
# Check package.json for development scripts
echo "Checking package.json for development scripts..."
if [ -f "package.json" ]; then
jq '.scripts | with_entries(select(.key | contains("develop")))' package.json
fi
# Look for webpack configurations
echo "Checking for webpack configurations..."
fd -t f "webpack.*config"
Length of output: 506
Script:
#!/bin/bash
# Check the content of the script/develop_and_serve
echo "Checking script/develop_and_serve content..."
cat script/develop_and_serve
# Look for any related development scripts
echo -e "\nChecking other development scripts..."
fd -t f "^develop" script/
# Check if there are any related configuration files
echo -e "\nChecking for configuration files..."
fd -t f "config|\.rc" -d 1
# Check docusaurus configuration since we saw docusaurus in package.json
echo -e "\nChecking docusaurus configuration..."
fd -t f "docusaurus\.config\.js"
Length of output: 588
Script:
#!/bin/bash
# Check docusaurus configuration content
echo "Checking docusaurus.config.js content..."
cat docusaurus.config.js
# Look for development scripts in the root directory
echo -e "\nChecking for development scripts in root..."
fd -t f "develop.*serve|develop" .
# Check if there are any npm/yarn scripts in package.json
echo -e "\nChecking complete package.json..."
cat package.json
Length of output: 6257
🧰 Tools
🪛 LanguageTool
[style] ~74-~74: In American English, “you” and “have” do not usually form a contraction unless they’re followed by a past participle.
Context: ... - http://localhost:8124 ``` After you've setup your frontend development environ...
(IVE_I_HAVE_AMERICAN_STYLE)
[uncategorized] ~74-~74: Use a comma before ‘and’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...un the frontend on http://localhost:8124 and it will connect to the Home Assistant r...
(COMMA_COMPOUND_SENTENCE)
[misspelling] ~80-~80: The verb or noun ‘bypass’ is spelled as one word.
Context: ... Assistant url the frontend connects to by passing the -c option. This will also work for ...
(BY_PASS)
[uncategorized] ~80-~80: Possible missing comma found.
Context: ...wever, if you change the value for this option you will need to logout from your devel...
(AI_HYDRA_LEO_MISSING_COMMA)
[misspelling] ~80-~80: Did you mean the verb “log out” instead of the noun ‘logout’?
Context: ... value for this option you will need to logout from your development frontend before i...
(LOG_IN)
[grammar] ~86-~86: The word “setup” is a noun. The verb is spelled with a space.
Context: ...g from a devcontainer, you will need to setup port forwarding as well if you want to ...
(NOUN_VERB_CONFUSION)
🪛 Markdownlint (0.37.0)
74-74: null
Bare URL used
(MD034, no-bare-urls)
74-74: null
Bare URL used
(MD034, no-bare-urls)
Proposed change
Documented new development script added in home-assistant/frontend#23062.
Type of change
Additional information
Summary by CodeRabbit
Summary by CodeRabbit