Skip to content
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

Sending lots of love ❤️ #374

Merged
merged 11 commits into from
Jul 12, 2020
Merged

Conversation

frenck
Copy link
Collaborator

@frenck frenck commented Jul 11, 2020

Honestly @keesschollaart81, I love this extension. It brings so much awesomeness to people who maintain their YAML configuration files manually... it is insane!

So thank you for that 🙏

This PR is lending a hand in bringing it to other levels and further future extension of this beauty.
⚠️ It is a big one, so this needs quite a bit of testing.

In this PR:

  • Updates all dependencies and all needed changes for that.
    • vscode is removed and replaced with just the types and vscode-test.
    • Language server is upgraded
    • YAML library has been upgraded and breaking changes have been resolved.
    • Upgraded WebSocket and the Home Assistant WebSocket packages.
    • All known CVEs in dependencies have been resolved.
  • Schemas:
    • Start of a structure for schemes. Integration schemas have their own folder and each integration its own schema file.
    • Adds inline documentation and documentation links in hovercard when pointing at a known schema.
      image
    • Added support for deprecating properties on the schemas
      image
    • More validation in the existing schemes where possible
      image
      image
  • Added support auto-completion on scenes
    image
  • Auto-completion for triggers, including descriptions
    image
  • Entity's actual name is shown while going through the auto-complete suggestions
    2020-07-12 00 14 22
  • Fixes auto identation of YAML
    2020-07-12 09 04 01
  • Fixes a crash on empty lists, e.g.:
    entity_id:
      -
  • tslint has been removed and replaced by ESLint, with an extensive ruleset by AirBNB and others.
  • Prettier has been added to ensure the code styling it the same in all TS & JSON files. ESLint has been made aware of this.
  • New NPM script commands added for linting & formatting. Allowing it for easy use, both manually and in a CI:
    • npm run lint (or individually: lint:types, lint:eslint, lint:prettier)
    • npm run format (or individually: format:eslint, format:prettier)
      image
  • Extended the GitHub Actions to run the new linters:
    image
  • Pre-commit git hook added to ensure one can only commit if the linting passes. Implemented using husky and lint-staged (to ensure only git staged files are linted).
    image
  • Fixed a bunch of async/sync context mixups.
  • Removed all occurrences where await was used in for-loops.
  • Tons of other small things like typing fixes, small markdown tweaks, schema updates, error handling.
  • Lastly updated known schemas to match the upcoming Home Assistant 0.113.0, including the new automation/scripts features like the repeat actions:
    image

fixes #288 fixes #326 fixes #371 fixes #296 fixes #340 fixes #360 closes #351 closes #358 closes #363 closes #337 closes #330 closes #328 closes #367 closes #370 closes #366 closes #365 closes #364 closes #342 closes #332

Furthermore opened up an PR @ Prettier, to support the home-assistant language.
prettier/prettier#8739

Starting points from here would be:

  • Improve reconnect logic to Home Asssistant. Make sure Home Assistant is in a "running" state when connected.
  • Split Lovelace schema's in a similar fashion as integrations.
  • Look into making schema generation more dynamically, not to rely on the mapping.json.
  • More schema definitions for integrations.

@frenck frenck marked this pull request as ready for review July 11, 2020 21:03
@frenck frenck marked this pull request as draft July 11, 2020 21:33
@frenck frenck marked this pull request as ready for review July 11, 2020 22:26
@keesschollaart81
Copy link
Owner

Holy macaroni Frenck! Let's see if we can make it to a release tonight, starting now!

@keesschollaart81 keesschollaart81 self-requested a review July 12, 2020 12:26
Copy link
Owner

@keesschollaart81 keesschollaart81 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First round of checks. Mostly because of some schema errors in test-configurations I have around.

src/language-service/src/schemas/core.ts Outdated Show resolved Hide resolved
src/language-service/src/schemas/integrations/scene.ts Outdated Show resolved Hide resolved
src/language-service/src/schemas/actions.ts Outdated Show resolved Hide resolved
src/language-service/src/schemas/types.ts Outdated Show resolved Hide resolved
src/language-service/src/schemas/core.ts Show resolved Hide resolved
src/language-service/src/schemas/sensors.ts Outdated Show resolved Hide resolved
@keesschollaart81 keesschollaart81 changed the base branch from master to dev July 12, 2020 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants