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
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
module.exports = {
root: true,
env: {
browser: false,
es2020: true,
},
extends: [
"airbnb-typescript/base",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:wc/recommended",
"prettier/@typescript-eslint",
"plugin:prettier/recommended",
],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: 2020,
sourceType: "module",
project: "./tsconfig.json",
},
rules: {
"@typescript-eslint/ban-ts-comment": 0,
"@typescript-eslint/ban-ts-ignore": 0,
"@typescript-eslint/explicit-function-return-type": 0,
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/no-misused-promises": 0, // This one really needs to go
"@typescript-eslint/no-unsafe-assignment": 0,
"@typescript-eslint/no-unsafe-member-access": 0,
"@typescript-eslint/no-unused-vars": 0,
"@typescript-eslint/no-use-before-define": 0,
"@typescript-eslint/restrict-template-expressions": 0,
"class-methods-use-this": 0,
"default-case": 0,
"import/no-cycle": 0,
"import/prefer-default-export": 0,
"no-console": 0,
"no-continue": 0,
"no-param-reassign": 0,
"no-restricted-syntax": ["error", "LabeledStatement", "WithStatement"],
"no-void": 0,
"prefer-destructuring": 0,
"vars-on-top": 0,
strict: 0,
},
};
80 changes: 41 additions & 39 deletions .github/workflows/github-actions-language-service.yml
Original file line number Diff line number Diff line change
@@ -1,56 +1,58 @@
name: Language Sevice

on:
on:
push:
paths:
- 'src/language-service/*'
- '.github/*'
- "src/language-service/*"
- ".github/*"
pull_request:
paths:
- 'src/language-service/*'
- '.github/*'
- "src/language-service/*"
- ".github/*"

jobs:
language-service:
name: Language Service
runs-on: ubuntu-latest
runs-on: ubuntu-latest

steps:

- uses: actions/checkout@master

- name: Use Node.js 12.x
uses: actions/setup-node@master
with:
node-version: 12.x

- name: NPM Install
working-directory: src/language-service
run: |
rm package-lock.json
npm install

- name: NPM Compile
working-directory: src/language-service
run: npm run compile

- name: Create .npmrc
run: echo "//registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN" >> ~/.npmrc
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: NPM Publish to Registry
if: success() && github.ref == 'refs/heads/master'
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
npm publish src/language-service

- uses: actions/checkout@master

- name: Use Node.js 12.x
uses: actions/setup-node@master
with:
node-version: 12.x

- name: NPM Install
working-directory: src/language-service
run: |
rm package-lock.json
npm install

- name: NPM Lint
working-directory: src/language-service
run: npm run lint

- name: NPM Compile
working-directory: src/language-service
run: npm run compile

- name: Create .npmrc
run: echo "//registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN" >> ~/.npmrc
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: NPM Publish to Registry
if: success() && github.ref == 'refs/heads/master'
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
npm publish src/language-service
# - name: NPM Publish to Registry
# uses: actions/npm@master
# uses: actions/npm@master
# if: success() && github.ref == 'refs/heads/master'
# env:
# NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# with:
# args: publish src/language-service
# args: publish src/language-service
47 changes: 25 additions & 22 deletions .github/workflows/github-actions-vscode-extension.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,33 @@
name: VS Code Extension

on: [ push, pull_request]
on: [push, pull_request]

jobs:
vscode-extension:
name: VS Code Extension
runs-on: ubuntu-latest
runs-on: ubuntu-latest

steps:

- uses: actions/checkout@v1

- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: 12.x

- name: NPM Install & Compile
run: |
npm install
npm run compile

- name: VS Marketplace Publish
if: success() && github.ref == 'refs/heads/master'
run: |
npm install -g vsce
vsce publish -p $VSCE_TOKEN
env:
VSCE_TOKEN: ${{ secrets.VSCE_TOKEN }}
- uses: actions/checkout@v1

- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: 12.x

- name: NPM Install & Compile
run: npm install

- name: NPM Lint
run: npm run lint

- name: NPM Compile
run: npm run compile

- name: VS Marketplace Publish
if: success() && github.ref == 'refs/heads/master'
run: |
npm install -g vsce
vsce publish -p $VSCE_TOKEN
env:
VSCE_TOKEN: ${{ secrets.VSCE_TOKEN }}
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
12.1
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.vscode-test/
node_modules
out
src/language-service/dist
src/language-service/src/schemas/json
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
</h1>

# Getting started

1. Install via the [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=keesschollaart.vscode-home-assistant)

2. Open your (local copy of the) Home Assistant Configuration with VS Code

3. Configure the connection to Home Assistant via the HA Section in the VS Code Settings UI

More details in [the How-To in the Wiki](https://github.com/keesschollaart81/vscode-home-assistant/wiki/Configure-connection-to-HA)

4. Enjoy the features showcased below 👇
Expand All @@ -30,28 +30,29 @@
## Completion for Entity ID's & Services

When connected with your Home Assistant server, entity id' and services will be auto-completed.
<img src="https://raw.githubusercontent.com/keesschollaart81/vscode-home-assistant/dev/assets/entity_service_completion.gif" >

<img src="https://raw.githubusercontent.com/keesschollaart81/vscode-home-assistant/dev/assets/entity_service_completion.gif">

## Completion & Validation for Configuration & Lovelace Schema

Most of the scheme's of Home Assistant will be validated and things like properties, values and enums will be auto-completed. This extension understands the behaviour of Home Assistant '!include...' behaviour and use this to provide scoped validation for all your files.
<img src="https://raw.githubusercontent.com/keesschollaart81/vscode-home-assistant/dev/assets/schema_validation_completion.gif" >

<img src="https://raw.githubusercontent.com/keesschollaart81/vscode-home-assistant/dev/assets/schema_validation_completion.gif">

## Go to Definition for Includes

Easy navigate between your files references via the different !include... tags using 'f12' / 'Go to Definition'.
<img src="https://raw.githubusercontent.com/keesschollaart81/vscode-home-assistant/dev/assets/go_to_definition.gif" >

<img src="https://raw.githubusercontent.com/keesschollaart81/vscode-home-assistant/dev/assets/go_to_definition.gif">

## Snippets

Snippets allow you to create commonly used data structures very quickly.
Snippets allow you to create commonly used data structures very quickly.

<img src="https://raw.githubusercontent.com/keesschollaart81/vscode-home-assistant/dev/assets/snippet.gif" >
<img src="https://raw.githubusercontent.com/keesschollaart81/vscode-home-assistant/dev/assets/snippet.gif">

## Commands

Commands allow you to quickly interact with Home Assistant! Find them using Cmd+shift+P and type 'Home Assistant'

![image](https://user-images.githubusercontent.com/6755359/69496084-6b089d80-0ece-11ea-8496-50251b91732f.png)
Expand All @@ -63,7 +64,7 @@ Commands allow you to quickly interact with Home Assistant! Find them using Cmd+

# Release Notes

Read all the recent changes in the [GitHub releases section](https://github.com/keesschollaart81/vscode-home-assistant/releases)
Read all the recent changes in the [GitHub releases section](https://github.com/keesschollaart81/vscode-home-assistant/releases)

# Feedback / Ideas

Expand All @@ -72,9 +73,8 @@ Create an [issue](https://github.com/keesschollaart81/vscode-home-assistant/issu
# Things to do / up for grabs

- [ ] Go to Definition for entities, scripts and automations
- [ ] Render Jinja2 template locally (like/via CLI?) in preview pane
- [ ] Render Jinja2 template locally (like/via CLI?) in preview pane
- [ ] Autocomplete !secrets
- [ ] Autocomplete triggers
- [ ] Check local config with HA Server

# Build & Deployment status
Expand Down
Loading