Skip to content

Commit 31a4052

Browse files
authored
Update build scripts and frontend (#25)
1 parent a1ba889 commit 31a4052

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+5873
-22241
lines changed

.dockerignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.vscode

.eslintrc.json

+119
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
{
2+
"extends": [
3+
"airbnb-base",
4+
"airbnb-typescript/base",
5+
"plugin:@typescript-eslint/recommended",
6+
"plugin:wc/recommended",
7+
"plugin:lit/all",
8+
"prettier"
9+
],
10+
"parser": "@typescript-eslint/parser",
11+
"parserOptions": {
12+
"ecmaVersion": 2020,
13+
"ecmaFeatures": {
14+
"modules": true
15+
},
16+
"sourceType": "module",
17+
"project": "./tsconfig.json"
18+
},
19+
"settings": {
20+
"import/resolver": {
21+
"webpack": {
22+
"config": "./webpack.config.js"
23+
}
24+
}
25+
},
26+
"globals": {
27+
"__DEV__": false,
28+
"__DEMO__": false,
29+
"__BUILD__": false,
30+
"__VERSION__": false,
31+
"__STATIC_PATH__": false,
32+
"__SUPERVISOR__": false,
33+
"Polymer": true
34+
},
35+
"env": {
36+
"browser": true,
37+
"es6": true
38+
},
39+
"rules": {
40+
"class-methods-use-this": "off",
41+
"new-cap": "off",
42+
"prefer-template": "off",
43+
"object-shorthand": "off",
44+
"func-names": "off",
45+
"no-underscore-dangle": "off",
46+
"strict": "off",
47+
"no-plusplus": "off",
48+
"no-bitwise": "error",
49+
"comma-dangle": "off",
50+
"vars-on-top": "off",
51+
"no-continue": "off",
52+
"no-param-reassign": "off",
53+
"no-multi-assign": "off",
54+
"no-console": "error", // XXX TBD
55+
"radix": "off",
56+
"no-alert": "off",
57+
"no-nested-ternary": "off",
58+
"prefer-destructuring": "off",
59+
"no-restricted-globals": [2, "event"],
60+
"prefer-promise-reject-errors": "off",
61+
"import/prefer-default-export": "off",
62+
"import/no-default-export": "off",
63+
"import/no-unresolved": "off",
64+
"import/no-cycle": "off",
65+
"import/extensions": [
66+
"error",
67+
"ignorePackages",
68+
{ "ts": "never", "js": "never" }
69+
],
70+
"no-restricted-syntax": ["error", "LabeledStatement", "WithStatement"],
71+
"object-curly-newline": "off",
72+
"default-case": "off",
73+
"wc/no-self-class": "off",
74+
"no-shadow": "off",
75+
"@typescript-eslint/camelcase": "off",
76+
"@typescript-eslint/ban-ts-comment": "off",
77+
"@typescript-eslint/no-use-before-define": "off",
78+
"@typescript-eslint/no-non-null-assertion": "off",
79+
"@typescript-eslint/no-explicit-any": "off",
80+
"@typescript-eslint/explicit-function-return-type": "off",
81+
"@typescript-eslint/explicit-module-boundary-types": "off",
82+
"@typescript-eslint/no-shadow": ["error"],
83+
"@typescript-eslint/naming-convention": [
84+
"off",
85+
{
86+
"selector": "default",
87+
"format": ["camelCase", "snake_case"],
88+
"leadingUnderscore": "allow",
89+
"trailingUnderscore": "allow"
90+
},
91+
{
92+
"selector": ["variable"],
93+
"format": ["camelCase", "snake_case", "UPPER_CASE"],
94+
"leadingUnderscore": "allow",
95+
"trailingUnderscore": "allow"
96+
},
97+
{
98+
"selector": "typeLike",
99+
"format": ["PascalCase"]
100+
}
101+
],
102+
"@typescript-eslint/no-unused-vars": "off",
103+
"unused-imports/no-unused-vars": [
104+
"error",
105+
{
106+
"vars": "all",
107+
"varsIgnorePattern": "^_",
108+
"args": "after-used",
109+
"argsIgnorePattern": "^_",
110+
"ignoreRestSiblings": true
111+
}
112+
],
113+
"unused-imports/no-unused-imports": "error",
114+
"lit/attribute-value-entities": "off",
115+
"lit/no-template-map": "off"
116+
},
117+
"plugins": ["disable", "unused-imports"],
118+
"processor": "disable/disable"
119+
}

.eslintrc.yaml

-95
This file was deleted.

.gitignore

+51-49
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,51 @@
1-
# Project files to ignore
2-
node_modules
3-
package-lock.json
4-
src/localize/generated.ts
5-
6-
yarn-error.log
7-
.yarn
8-
.idea
9-
10-
# Byte-compiled / optimized / DLL files
11-
__pycache__/
12-
*.py[cod]
13-
*$py.class
14-
15-
# C extensions
16-
*.so
17-
18-
# Distribution / packaging
19-
.Python
20-
env/
21-
build/
22-
knx_frontend/frontend_latest
23-
knx_frontend/*.js
24-
knx_frontend/*.json
25-
knx_frontend/*.js.gz
26-
!knx_frontend/*.py
27-
develop-eggs/
28-
dist/
29-
downloads/
30-
eggs/
31-
.eggs/
32-
lib/
33-
lib64/
34-
parts/
35-
sdist/
36-
var/
37-
*.egg-info/
38-
.installed.cfg
39-
*.egg
40-
41-
# PyInstaller
42-
# Usually these files are written by a python script from a template
43-
# before PyInstaller builds the exe, so as to inject date/other infos into it.
44-
*.manifest
45-
*.spec
46-
47-
# Installer logs
48-
pip-log.txt
49-
pip-delete-this-directory.txt
1+
# Project files to ignore
2+
node_modules
3+
package-lock.json
4+
src/localize/generated.ts
5+
6+
yarn-error.log
7+
.yarn
8+
9+
result.md
10+
11+
# Byte-compiled / optimized / DLL files
12+
__pycache__/
13+
*.py[cod]
14+
*$py.class
15+
16+
# C extensions
17+
*.so
18+
19+
# Distribution / packaging
20+
.Python
21+
env/
22+
build/
23+
knx_frontend/
24+
develop-eggs/
25+
dist/
26+
downloads/
27+
eggs/
28+
.eggs/
29+
lib/
30+
lib64/
31+
parts/
32+
sdist/
33+
var/
34+
*.egg-info/
35+
.installed.cfg
36+
*.egg
37+
38+
# PyInstaller
39+
# Usually these files are written by a python script from a template
40+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
41+
*.manifest
42+
*.spec
43+
44+
# Installer logs
45+
pip-log.txt
46+
pip-delete-this-directory.txt
47+
48+
# Development environment
49+
.vscode
50+
.idea
51+
.DS_Store

.gitmodules

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[submodule "homeassistant-frontend"]
22
path = homeassistant-frontend
3-
url = git@github.com:home-assistant/frontend.git
3+
url = https://github.com/home-assistant/frontend.git

.yarnrc.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ plugins:
66
- path: homeassistant-frontend/.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
77
spec: "@yarnpkg/plugin-interactive-tools"
88

9-
yarnPath: homeassistant-frontend/.yarn/releases/yarn-3.2.0.cjs
9+
yarnPath: homeassistant-frontend/.yarn/releases/yarn-3.4.1.cjs

Makefile

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
.DEFAULT_GOAL := help
2+
3+
help: ## Shows help message.
4+
@printf "\033[1m%s\033[36m %s\033[32m %s\033[0m \n\n" "Development environment for" "KNX Panel" "Frontend";
5+
@awk 'BEGIN {FS = ":.*##";} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m make %-18s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST);
6+
@echo
7+
8+
init:
9+
make bootstrap;
10+
11+
develop: ## Start the frontend
12+
script/develop;
13+
14+
bootstrap: ## Bootstrap the repository
15+
script/bootstrap;
16+
17+
build: ## Build the repository
18+
script/build;
19+
20+
update: ## Pull main from xknx/knx-frontend
21+
git pull upstream main;
22+
23+
update-submodule: ## Udpate submodules
24+
rm -R homeassistant-frontend;
25+
git submodule update --init --recursive --remote;
26+
script/bootstrap

README.md

+10-4
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ KNX integration.
1414

1515
If you check this repository out for the first time please run the following command to init the submodules:
1616

17-
script/bootstrap
17+
make bootstrap
1818

1919
### Development build (watcher)
2020

21-
yarn start
21+
make develop
2222

2323
### Production build
2424

25-
yarn build
25+
make build
2626

2727
### Update the home assistant frontend
2828

@@ -34,4 +34,10 @@ Replace latest_tag with the current release tag.
3434
cd ..
3535
rm -f yarn.lock
3636
node ./script/merge_requirements.js
37-
script/bootstrap
37+
script/bootstrap
38+
39+
### Testing the panel
40+
41+
You can test the panel by symlinking the build result directory `knx_frontend` into your Home Assistant configuration directory.
42+
43+
ln -s /Users/me/dev/knx-frontend/knx_frontend ~/.homeassistant/

build-scripts/.eslintrc

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"rules": {
3+
"import/no-extraneous-dependencies": 0,
4+
"no-restricted-syntax": 0,
5+
"no-console": 0
6+
}
7+
}

0 commit comments

Comments
 (0)