Skip to content

Commit 26a290e

Browse files
committed
[TASK] update
1 parent ce95e5c commit 26a290e

Some content is hidden

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

73 files changed

+9796
-6732
lines changed

.babelrc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"presets": [
3+
[
4+
"@babel/preset-typescript",
5+
{
6+
"optimizeConstEnums": true
7+
}
8+
]
9+
]
10+
}

.browserslistrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
> 0.25%
2+
not dead

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
node_modules
1+
node_modules
2+
dist

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![Version - 0.9.0](https://img.shields.io/badge/Version-0.9.0-009688?style=for-the-badge)](https://github.com/KartoffelToby/better-thermostat-ui-card)
1+
[![Version - 1.0.0](https://img.shields.io/badge/Version-1.0.0-009688?style=for-the-badge)](https://github.com/KartoffelToby/better-thermostat-ui-card)
22
[![Discord](https://img.shields.io/discord/925725316540923914.svg?style=for-the-badge)](https://discord.gg/9BUegWTG3K)
33
[![hacs_badge](https://img.shields.io/badge/HACS-Default-41BDF5.svg?style=for-the-badge)](https://github.com/hacs/integration)
44

dist/better-thermostat-ui-card.js

Lines changed: 403 additions & 610 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 5253 additions & 4131 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "better-thermostat-ui",
3-
"version": "0.9.0",
3+
"version": "1.0.0",
44
"description": "Lovelace better-thermostat-ui",
55
"keywords": [
66
"home-assistant",
@@ -10,48 +10,49 @@
1010
"lovelace",
1111
"custom-cards",
1212
"better-thermostat",
13-
"better_thermostat",
14-
"ai_thermostat"
13+
"better_thermostat"
1514
],
1615
"module": "better-thermostat-ui-card.js",
17-
"repository": "",
18-
"author": "",
16+
"repository": "https://github.com/KartoffelToby/better-thermostat-ui-card",
17+
"author": "Tobias Haber",
18+
"type": "module",
19+
"scripts": {
20+
"start": "rollup -c --watch",
21+
"build": "rollup -c",
22+
"format": "prettier --write .",
23+
"start:hass": "docker run --rm -p8123:8123 -v ${PWD}/.hass_dev:/config homeassistant/home-assistant:beta",
24+
"start:hass-cmd": "docker run --rm -p8123:8123 -v %cd%/.hass_dev:/config homeassistant/home-assistant:beta"
25+
},
1926
"dependencies": {
20-
"@juggle/resize-observer": "^3.4.0",
27+
"@babel/preset-env": "^7.20.2",
2128
"@mdi/js": "^7.0.96",
29+
"@svgdotjs/svg.js": "^3.1.2",
2230
"@types/gsap": "^3.0.0",
31+
"animejs": "^3.2.1",
2332
"custom-card-helpers": "^1.9.0",
2433
"gsap": "^3.11.3",
2534
"home-assistant-js-websocket": "^8.0.0",
26-
"lit": "^2.4.0"
35+
"lit": "^2.4.1",
36+
"memoize-one": "^6.0.0"
2737
},
2838
"devDependencies": {
29-
"@babel/core": "^7.19.3",
30-
"@babel/plugin-proposal-class-properties": "^7.18.6",
31-
"@babel/plugin-proposal-decorators": "^7.19.3",
32-
"@rollup/plugin-json": "^4.1.0",
33-
"@typescript-eslint/eslint-plugin": "^5.39.0",
34-
"@typescript-eslint/parser": "^5.39.0",
35-
"eslint": "^8.24.0",
36-
"eslint-config-airbnb-base": "^15.0.0",
37-
"eslint-config-prettier": "^8.5.0",
38-
"eslint-plugin-import": "^2.26.0",
39-
"eslint-plugin-prettier": "^4.2.1",
39+
"@babel/core": "^7.20.2",
40+
"@babel/preset-typescript": "^7.18.6",
41+
"@material/mwc-ripple": "^0.27.0",
42+
"@material/tab-bar": "^14.0.0",
43+
"@rollup/plugin-babel": "^6.0.2",
44+
"@rollup/plugin-commonjs": "^23.0.2",
45+
"@rollup/plugin-json": "^5.0.1",
46+
"@rollup/plugin-node-resolve": "^15.0.1",
47+
"@rollup/plugin-typescript": "^9.0.2",
48+
"@types/color": "^3.0.3",
49+
"@types/hammerjs": "^2.0.41",
50+
"@types/node": "^18.11.9",
51+
"eslint": "^8.28.0",
4052
"prettier": "^2.7.1",
41-
"rollup": "^2.79.1",
42-
"rollup-plugin-babel": "^4.4.0",
43-
"rollup-plugin-commonjs": "^10.1.0",
44-
"rollup-plugin-node-resolve": "^5.2.0",
53+
"rollup": "^3.4.0",
4554
"rollup-plugin-serve": "^2.0.1",
4655
"rollup-plugin-terser": "^7.0.2",
47-
"rollup-plugin-typescript2": "^0.34.1",
48-
"rollup-plugin-uglify": "^6.0.4",
49-
"typescript": "^4.8.4"
50-
},
51-
"scripts": {
52-
"start": "rollup -c rollup.config.dev.js --watch",
53-
"build": "npm run rollup",
54-
"lint": "eslint src/*.ts",
55-
"rollup": "rollup -c"
56+
"typescript": "^4.9.3"
5657
}
5758
}

rollup-ignore-plugin.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
export default function (userOptions = {}) {
2+
// Files need to be absolute paths.
3+
// This only works if the file has no exports
4+
// and only is imported for its side effects
5+
const files = userOptions.files || [];
6+
7+
if (files.length === 0) {
8+
return {
9+
name: "ignore",
10+
};
11+
}
12+
13+
return {
14+
name: "ignore",
15+
16+
load(id) {
17+
return files.some((toIgnorePath) => id.startsWith(toIgnorePath))
18+
? {
19+
code: "",
20+
}
21+
: null;
22+
},
23+
};
24+
}

rollup.config.dev.js

Lines changed: 0 additions & 32 deletions
This file was deleted.

rollup.config.js

Lines changed: 63 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,74 @@
1-
import typescript from 'rollup-plugin-typescript2';
2-
import commonjs from 'rollup-plugin-commonjs';
3-
import nodeResolve from 'rollup-plugin-node-resolve';
4-
import babel from 'rollup-plugin-babel';
5-
import { terser } from 'rollup-plugin-terser';
6-
import serve from 'rollup-plugin-serve';
7-
import json from '@rollup/plugin-json';
1+
import commonjs from "@rollup/plugin-commonjs";
2+
import nodeResolve from "@rollup/plugin-node-resolve";
3+
import typescript from "@rollup/plugin-typescript";
4+
import babel from "@rollup/plugin-babel";
5+
import json from "@rollup/plugin-json";
6+
import { terser } from "rollup-plugin-terser";
7+
import serve from "rollup-plugin-serve";
8+
import ignore from "./rollup-ignore-plugin.js";
9+
10+
const IGNORED_FILES = [
11+
12+
];
813

914
const dev = process.env.ROLLUP_WATCH;
1015

11-
const serveopts = {
12-
contentBase: ['./dist'],
13-
host: '0.0.0.0',
14-
port: 5000,
15-
allowCrossOrigin: true,
16-
headers: {
17-
'Access-Control-Allow-Origin': '*',
18-
},
16+
const serveOptions = {
17+
contentBase: ["./dist"],
18+
host: "0.0.0.0",
19+
port: 4000,
20+
allowCrossOrigin: true,
21+
headers: {
22+
"Access-Control-Allow-Origin": "*",
23+
},
1924
};
2025

2126
const plugins = [
22-
nodeResolve({}),
23-
commonjs(),
24-
typescript(),
25-
json(),
26-
babel({
27-
exclude: 'node_modules/**',
28-
}),
29-
dev && serve(serveopts),
30-
!dev && terser(),
27+
ignore({
28+
files: IGNORED_FILES.map((file) => require.resolve(file)),
29+
}),
30+
typescript({
31+
declaration: false,
32+
}),
33+
nodeResolve(),
34+
json(),
35+
commonjs(),
36+
babel({
37+
exclude: "node_modules/**",
38+
babelHelpers: "bundled",
39+
}),
40+
...(dev ? [serve(serveOptions)] : [terser({
41+
warnings: true,
42+
output: {
43+
comments: function (node, comment) {
44+
var text = comment.value;
45+
var type = comment.type;
46+
if (type == "comment2") {
47+
// multiline comment
48+
return /@preserve|@license|@cc_on/i.test(text);
49+
}
50+
},
51+
},
52+
})]),
3153
];
3254

3355
export default [
34-
{
35-
input: 'src/better-thermostat-ui-card.ts',
36-
output: {
37-
dir: 'dist',
38-
format: 'es',
56+
{
57+
input: "src/better-thermostat-ui.ts",
58+
output: {
59+
inlineDynamicImports: true,
60+
file: "dist/better-thermostat-ui-card.js",
61+
format: "es",
62+
},
63+
plugins,
64+
moduleContext: (id) => {
65+
const thisAsWindowForModules = [
66+
"node_modules/@formatjs/intl-utils/lib/src/diff.js",
67+
"node_modules/@formatjs/intl-utils/lib/src/resolve-locale.js",
68+
];
69+
if (thisAsWindowForModules.some((id_) => id.trimRight().endsWith(id_))) {
70+
return "window";
71+
}
72+
},
3973
},
40-
plugins: [...plugins],
41-
},
4274
];

0 commit comments

Comments
 (0)