KartoffelToby/better-thermostat-ui-card

How to contribute

jmcollin78 opened this issue · 4 comments

Hello,

I would like to contribute to this great thermostat. So I fork the repo, open it into my VScode environment.

But when I run npm install
I have this error:

[18:07:15]-507 [()]-jmcollin@mac-mini-eth:~/SugarSync/Projets/home-assistant/better-thermostat-ui-card$ node --version 
v18.18.2
[18:07:22]-508 [()]-jmcollin@mac-mini-eth:~/SugarSync/Projets/home-assistant/better-thermostat-ui-card$ npm install 
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: rollup-plugin-minify-html-literals@1.2.6
npm ERR! Found: rollup@4.2.0
npm ERR! node_modules/rollup
npm ERR!   dev rollup@"4.2.0" from the root project
npm ERR!   peerOptional rollup@"^1.20.0||^2.0.0||^3.0.0||^4.0.0" from @rollup/plugin-babel@6.0.4
npm ERR!   node_modules/@rollup/plugin-babel
npm ERR!     dev @rollup/plugin-babel@"6.0.4" from the root project
npm ERR!   6 more (@rollup/plugin-commonjs, @rollup/plugin-json, ...)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer rollup@"^0.65.2 || ^1.0.0 || ^2.0.0" from rollup-plugin-minify-html-literals@1.2.6
npm ERR! node_modules/rollup-plugin-minify-html-literals
npm ERR!   dev rollup-plugin-minify-html-literals@"^1.2.6" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: rollup@2.79.1
npm ERR! node_modules/rollup
npm ERR!   peer rollup@"^0.65.2 || ^1.0.0 || ^2.0.0" from rollup-plugin-minify-html-literals@1.2.6
npm ERR!   node_modules/rollup-plugin-minify-html-literals
npm ERR!     dev rollup-plugin-minify-html-literals@"^1.2.6" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! 
npm ERR! For a full report see:
npm ERR! /Users/jmcollin/.npm/_logs/2023-11-04T17_07_27_643Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in: /Users/jmcollin/.npm/_logs/2023-11-04T17_07_27_643Z-debug-0.log

Any help would be appreciated.

First, thanks for your effort! Looking Forward for your PRs :)

Try it with npm i --force (node 20+)

I used an older rollup config from HA itself and haven't the time yet to migrate it to a new vite Setup

Another question please, how to you deploy and test your changes ?
Is it possible to test without having to deploy into a real Home Assistant environment ?

It shoud be testest in a real ha env.

There are some Options.

  1. Rum npm start to start a local Dev Server on port 4000, open your HA, add a JS Ressource with:
lovelace:
  mode: yaml
  resources:
    - url: http://0.0.0.0:4000/better-thermostat-ui-card.js #/hacsfiles/better-thermostat-ui-card/better-thermostat-ui-card.js
      type: module

Or Clone the BT Integration, and open it as a devcontainer in vs code

  1. Try to run it in a ha docker Container

Thank you for your valuable answers !