Skip to content

Commit

Permalink
Refactor JavaScript to TypeScript (#81)
Browse files Browse the repository at this point in the history
Other changes include:

* Add Vacuum Card and View.

* Add hiding a view if no device is configured for it. Closes #24.

* Add icon to HomeView configuration.

* Add version output to console.

* Add version bumper.

* Add .editorconfig settings.

* Refactor README, because the information moved to the repository's
   Wiki. Closes #87.
  • Loading branch information
DigiLive authored Nov 22, 2023
1 parent c8a9cd5 commit 82a91c3
Show file tree
Hide file tree
Showing 120 changed files with 6,346 additions and 4,396 deletions.
39 changes: 12 additions & 27 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
max_line_length = 120
tab_width = 4
trim_trailing_whitespace = true
ij_continuation_indent_size = 8
ij_continuation_indent_size = 2
ij_formatter_off_tag = @formatter:off
ij_formatter_on_tag = @formatter:on
ij_formatter_tags_enabled = true
ij_smart_tabs = false
ij_visual_guides =
ij_wrap_on_typing = false
indent_size = 2
indent_style = space
insert_final_newline = true
max_line_length = 120
tab_width = 2
trim_trailing_whitespace = true

[.editorconfig]
ij_editorconfig_align_group_field_declarations = false
Expand Down Expand Up @@ -43,7 +43,6 @@ ij_xml_space_inside_empty_tag = false
ij_xml_text_wrap = normal

[{*.ats,*.cts,*.mts,*.ts}]
ij_continuation_indent_size = 4
ij_typescript_align_imports = false
ij_typescript_align_multiline_array_initializer_expression = false
ij_typescript_align_multiline_binary_operation = false
Expand All @@ -55,7 +54,7 @@ ij_typescript_align_multiline_parameters_in_calls = false
ij_typescript_align_multiline_ternary_operation = false
ij_typescript_align_object_properties = 0
ij_typescript_align_union_types = false
ij_typescript_align_var_statements = 0
ij_typescript_align_var_statements = 1
ij_typescript_array_initializer_new_line_after_left_brace = false
ij_typescript_array_initializer_right_brace_on_new_line = false
ij_typescript_array_initializer_wrap = off
Expand All @@ -64,7 +63,7 @@ ij_typescript_binary_operation_sign_on_next_line = false
ij_typescript_binary_operation_wrap = off
ij_typescript_blacklist_imports = rxjs/Rx,node_modules/**,**/node_modules/**,@angular/material,@angular/material/typings/**
ij_typescript_blank_lines_after_imports = 1
ij_typescript_blank_lines_around_class = 1
ij_typescript_blank_lines_around_class = 0
ij_typescript_blank_lines_around_field = 0
ij_typescript_blank_lines_around_field_in_interface = 0
ij_typescript_blank_lines_around_function = 1
Expand Down Expand Up @@ -112,7 +111,7 @@ ij_typescript_keep_blank_lines_in_code = 2
ij_typescript_keep_first_column_comment = true
ij_typescript_keep_indents_on_empty_lines = false
ij_typescript_keep_line_breaks = true
ij_typescript_keep_simple_blocks_in_one_line = false
ij_typescript_keep_simple_blocks_in_one_line = true
ij_typescript_keep_simple_methods_in_one_line = false
ij_typescript_line_comment_add_space = true
ij_typescript_line_comment_at_first_column = false
Expand All @@ -132,7 +131,7 @@ ij_typescript_prefer_explicit_types_function_returns = false
ij_typescript_prefer_explicit_types_vars_fields = false
ij_typescript_prefer_parameters_wrap = false
ij_typescript_property_prefix =
ij_typescript_reformat_c_style_comments = false
ij_typescript_reformat_c_style_comments = true
ij_typescript_space_after_colon = true
ij_typescript_space_after_comma = true
ij_typescript_space_after_dots_in_rest_parameter = false
Expand Down Expand Up @@ -207,6 +206,7 @@ ij_typescript_union_types_wrap = on_every_item
ij_typescript_use_chained_calls_group_indents = false
ij_typescript_use_double_quotes = true
ij_typescript_use_explicit_js_extension = auto
ij_typescript_use_import_type = auto
ij_typescript_use_path_mapping = always
ij_typescript_use_public_modifier = false
ij_typescript_use_semicolon_after_statement = true
Expand All @@ -215,20 +215,7 @@ ij_typescript_while_brace_force = never
ij_typescript_while_on_new_line = false
ij_typescript_wrap_comments = false

[{*.bash,*.sh,*.zsh}]
indent_size = 2
tab_width = 2
ij_shell_binary_ops_start_line = false
ij_shell_keep_column_alignment_padding = false
ij_shell_minify_program = false
ij_shell_redirect_followed_by_space = false
ij_shell_switch_cases_indented = false
ij_shell_use_unix_line_separator = true

[{*.cjs,*.js}]
indent_size = 2
tab_width = 2
ij_continuation_indent_size = 2
ij_javascript_align_imports = false
ij_javascript_align_multiline_array_initializer_expression = false
ij_javascript_align_multiline_binary_operation = false
Expand Down Expand Up @@ -397,7 +384,6 @@ ij_javascript_while_on_new_line = false
ij_javascript_wrap_comments = false

[{*.har,*.jsb2,*.jsb3,*.json,.babelrc,.eslintrc,.prettierrc,.remarkrc,.stylelintrc,bowerrc,composer.lock,jest.config}]
indent_size = 2
ij_json_array_wrapping = split_into_lines
ij_json_keep_blank_lines_in_code = 0
ij_json_keep_indents_on_empty_lines = false
Expand Down Expand Up @@ -460,7 +446,6 @@ ij_markdown_wrap_text_if_long = true
ij_markdown_wrap_text_inside_blockquotes = true

[{*.yaml,*.yml}]
indent_size = 2
ij_yaml_align_values_properties = do_not_align
ij_yaml_autoinsert_sequence_marker = true
ij_yaml_block_mapping_on_new_line = false
Expand Down
Empty file added .eslintrc
Empty file.
19 changes: 10 additions & 9 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,28 @@ assignees: ''

---

**Describe the bug**
**Describe the bug**
A clear and concise description of what the bug is.

**Versions**
**Versions**
* Mushroom-Strategy:
* HACS:
* Mushroom:
* Home Assistant:

**To Reproduce**
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'

1. Go to '…'
2. Click on '…'
3. Scroll down to '…'
4. See error

**Expected behavior**
**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
**Screenshots**
If applicable, add screenshots to help explain your problem.

**Additional context**
**Additional context**
Add any other context about the problem here.
10 changes: 5 additions & 5 deletions .github/workflows/webpack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches: [ "main" ]
# Ignore changes in folders that are affected by the auto commit. (Node.js project)
paths-ignore:
paths-ignore:
- 'dist/**'
# pull_request:
# branches: [ "main" ]
Expand All @@ -24,7 +24,7 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.WORKFLOW_GIT_ACCESS_TOKEN }}
token: ${{ secrets.WORKFLOW_GIT_ACCESS_TOKEN }}

# Build steps
- name: Use Node.js ${{ matrix.node-version }}
Expand All @@ -34,7 +34,7 @@ jobs:

- name: Node Install
run: npm ci

- name: Build Distribution
run: |
npm run build
Expand All @@ -44,10 +44,10 @@ jobs:
run: |
git diff --quiet . || echo "changed=true" >> $GITHUB_OUTPUT
# Commit and push all changed files.
# Commit and push all changed files.
# Must only affect files that are listed in "paths-ignore".
- name: GIT Commit Distribution Build
# Only run on main branch push (e.g. pull request merge).
# Only run on main branch push (e.g., pull request merge).
if: github.event_name == 'push' && steps.checkDiff.outputs.changed == 'true'
run: |
git config --global user.name "${{ env.CI_COMMIT_AUTHOR }}"
Expand Down
19 changes: 10 additions & 9 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@
## Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to make
participation in our project and our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education,
socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
participation in our project and our community a harassment-free experience for everyone.
This is regardless of age, body size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socioeconomic status, nationality, personal appearance, race, religion, or
sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to a positive environment for our community include:

* Demonstrating empathy and kindness toward other people.
* Being respectful of differing opinions, viewpoints and experiences.
* Being respectful of differing opinions, viewpoints, and experiences.
* Giving and gracefully accepting constructive feedback.
* Accepting responsibility and apologizing to those affected by our mistakes and learning from the experience.
* Focusing on what is best not just for us as individuals, but for the overall community.
Expand All @@ -28,18 +29,18 @@ Examples of unacceptable behavior include:
## Our Responsibilities

Project maintainers are responsible for clarifying and enforcing our standards of acceptable behavior and will take
appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive
appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits,
issues and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation
issues, and other contributions that are not aligned to this Code of Conduct and will communicate reasons for moderation
decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing
the community in public spaces. Examples of representing our community include using an official e-mail address, posting
via an official social media account or acting as an appointed representative at an online or offline event.
via an official social media account, or acting as an appointed representative at an online or offline event.

## Enforcement

Expand Down Expand Up @@ -80,8 +81,8 @@ enforcing the Code of Conduct, is allowed during this period. Violating these te

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate
behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
**Community Impact**: Demonstrating violations of community standards, including sustained inappropriate
behavior, harassment of an individual, or aggression toward or disparagement of their class.

**Consequence**: A permanent ban from any sort of public interaction within the community.

Expand Down
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ It will make it a lot easier for us maintainers and smooth out the experience fo
The community looks forward to your contributions.

> And if you like the project, but just don't have time to contribute, that's fine.
> There are other easy ways to support the project and show your appreciation, which we would also be very happy about:
> There are other easy ways to support the project and show your appreciation, which we would also be thrilled about:
> - Star the project
> - Tweet about it
> - Refer this project in your project's readme
Expand Down Expand Up @@ -58,14 +58,14 @@ We will then take care of the issue as soon as possible.
> ### Legal Notice
>
> When contributing to this project, you must agree that you have authored 100% of the content, that you have the
> necessary rights to the content and that the content you contribute may be provided under the project license.
> necessary rights to the content, and that the content you contribute may be provided under the project license.
### Reporting Bugs

#### Before Submitting a Bug Report

A good bug report shouldn't leave others needing to chase you up for more information.
Therefore, we ask you to investigate carefully, collect information and describe the issue in detail in your report.
Therefore, we ask you to investigate carefully, collect information, and describe the issue in detail in your report.
Please complete the following steps in advance to help us fix any potential bug as fast as possible.

- Make sure that you are using the latest version.
Expand All @@ -87,7 +87,7 @@ Please complete the following steps in advance to help us fix any potential bug

#### How Do I Submit a Good Bug Report?

> You must never report security related issues, vulnerabilities or bugs including sensitive information to the issue
> You must never report security related issues, vulnerabilities, or bugs including sensitive information to the issue
> tracker, or elsewhere in public.
> Instead, sensitive bugs must be sent by email to <[email protected]>.
Expand Down
Loading

0 comments on commit 82a91c3

Please sign in to comment.