Merge pull request #330902 from mweinelt/lovelace-upstreaming

Lovelace card upstreaming (atomic-calendar-revive, rmv-card, template-entity-row)

Changed files
+326
pkgs
servers
home-assistant
custom-lovelace-modules
atomic-calendar-revive
rmv-card
template-entity-row
+4
.editorconfig
···
indent_size = 2
indent_style = space
+
# Match package.json, which are generally pulled from upstream and accept them as they are
+
[package.json]
+
indent_style = unset
+
# Disable file types or individual files
# some of these files may be auto-generated and/or require significant changes
+56
pkgs/servers/home-assistant/custom-lovelace-modules/atomic-calendar-revive/default.nix
···
+
{
+
lib,
+
mkYarnPackage,
+
fetchYarnDeps,
+
fetchFromGitHub,
+
}:
+
+
mkYarnPackage rec {
+
pname = "atomic-calendar-revive";
+
version = "10.0.0";
+
+
src = fetchFromGitHub {
+
owner = "totaldebug";
+
repo = "atomic-calendar-revive";
+
rev = "v${version}";
+
hash = "sha256-TaxvxAUcewQH0IMJ0/VjW4+T6squ1tuZIFGn3PE3jhU=";
+
};
+
+
packageJSON = ./package.json;
+
+
offlineCache = fetchYarnDeps {
+
name = "${pname}-yarn-offline-cache";
+
yarnLock = src + "/yarn.lock";
+
hash = "sha256-d3lk3mwgaWMPFl/EDUWH/tUlAC7OfhNycOLbi1GzkfM=";
+
};
+
+
buildPhase = ''
+
runHook preBuild
+
+
yarn run build
+
+
runHook postBuild
+
'';
+
+
installPhase = ''
+
runHook preInstall
+
+
mkdir $out
+
cp ./deps/atomic-calendar-revive/dist/atomic-calendar-revive.js $out
+
+
runHook postInstall
+
'';
+
+
doDist = false;
+
+
passthru.updateScript = ./update.sh;
+
+
meta = with lib; {
+
changelog = "https://github.com/totaldebug/atomic-calendar-revive/releases/tag/v${src.rev}";
+
description = "An advanced calendar card for Home Assistant Lovelace";
+
homepage = "https://github.com/totaldebug/atomic-calendar-revive";
+
license = licenses.mit;
+
maintainers = with maintainers; [ hexa ];
+
platforms = platforms.all;
+
};
+
}
+142
pkgs/servers/home-assistant/custom-lovelace-modules/atomic-calendar-revive/package.json
···
+
{
+
"name": "atomic-calendar-revive",
+
"version": "10.0.0",
+
"description": "Calendar Card for Home Assistant",
+
"main": "atomic-calendar-revive.js",
+
"scripts": {
+
"lint": "eslint src/*.ts | more ",
+
"lintindex": "eslint src/index.ts | more",
+
"lintindexfix": "eslint src/index.ts --fix",
+
"lintfixall": "eslint src/*.ts --fix",
+
"linteditor": "eslint src/index-editor.ts",
+
"babel": "babel dist/index.js --out-file dist/atomic-calendar-revive.js",
+
"rollup": "rollup -c",
+
"start": "rollup -c --watch --bundleConfigAsCjs",
+
"build": "rollup -c --bundleConfigAsCjs",
+
"watch": "rollup -c rollup-dev.config.mjs --bundleConfigAsCjs",
+
"commit": "cz"
+
},
+
"repository": {
+
"type": "git",
+
"url": "git+https://github.com/totaldebug/atomic-calendar-revive.git"
+
},
+
"author": "Steven Marks",
+
"license": "ISC",
+
"devDependencies": {
+
"@babel/cli": "^7.24.7",
+
"@babel/core": "^7.24.7",
+
"@babel/plugin-proposal-class-properties": "^7.18.6",
+
"@babel/plugin-proposal-decorators": "^7.24.7",
+
"@babel/plugin-transform-template-literals": "^7.24.7",
+
"@babel/preset-env": "^7.24.7",
+
"@rollup/plugin-babel": "^6.0.4",
+
"@rollup/plugin-commonjs": "^26.0.1",
+
"@rollup/plugin-eslint": "^9.0.5",
+
"@rollup/plugin-json": "^6.1.0",
+
"@rollup/plugin-node-resolve": "^15.2.3",
+
"@rollup/plugin-terser": "^0.4.4",
+
"@semantic-release/changelog": "^6.0.3",
+
"@semantic-release/exec": "^6.0.3",
+
"@semantic-release/git": "^10.0.1",
+
"@typescript-eslint/eslint-plugin": "^7.13.1",
+
"@typescript-eslint/parser": "^7.13.1",
+
"babel-preset-minify": "^0.5.2",
+
"commitizen": "^4.3.0",
+
"conventional-changelog-conventionalcommits": "^8.0.0",
+
"cz-conventional-changelog": "^3.3.0",
+
"eslint": "^9.5.0",
+
"eslint-config-prettier": "^9.1.0",
+
"eslint-import-resolver-typescript": "^3.6.1",
+
"eslint-plugin-import": "^2.29.1",
+
"eslint-plugin-prettier": "^5.1.3",
+
"prettier": "^3.3.2",
+
"rollup": "^4.18.0",
+
"rollup-plugin-serve": "^2.0.3",
+
"rollup-plugin-typescript2": "^0.36.0",
+
"semantic-release": "^24.0.0"
+
},
+
"dependencies": {
+
"@formatjs/icu-messageformat-parser": "^2.7.8",
+
"@lit-labs/scoped-registry-mixin": "^1.0.3",
+
"@lit/reactive-element": "2.0.4",
+
"@material/mwc-formfield": "^0.27.0",
+
"@material/mwc-icon-button": "^0.27.0",
+
"@material/mwc-linear-progress": "^0.27.0",
+
"@material/mwc-list": "^0.27.0",
+
"@material/mwc-menu": "^0.27.0",
+
"@material/mwc-notched-outline": "^0.27.0",
+
"@material/mwc-ripple": "^0.27.0",
+
"@material/mwc-select": "^0.27.0",
+
"@material/mwc-switch": "^0.27.0",
+
"@material/mwc-textfield": "^0.27.0",
+
"@mdi/js": "^7.4.47",
+
"@webcomponents/webcomponentsjs": "^2.8.0",
+
"dayjs": "^1.11.11",
+
"home-assistant-js-websocket": "^9.4.0",
+
"lit": "^3.1.4",
+
"memoize-one": "^6.0.0",
+
"npm": "^10.8.1",
+
"typescript": "^5.5.2"
+
},
+
"resolutions": {
+
"lit": "^3.0.2",
+
"@lit/reactive-element": "2.0.1"
+
},
+
"bugs": {
+
"url": "https://github.com/totaldebug/atomic-calendar-revive/issues"
+
},
+
"homepage": "https://github.com/totaldebug/atomic-calendar-revive#readme",
+
"config": {
+
"commitizen": {
+
"path": "./node_modules/cz-conventional-changelog"
+
}
+
},
+
"release": {
+
"plugins": [
+
[
+
"@semantic-release/commit-analyzer",
+
{
+
"preset": "conventionalcommits"
+
}
+
],
+
[
+
"@semantic-release/release-notes-generator",
+
{
+
"preset": "conventionalcommits"
+
}
+
],
+
[
+
"@semantic-release/npm",
+
{
+
"npmPublish": false
+
}
+
],
+
[
+
"@semantic-release/exec",
+
{
+
"prepareCmd": "yarn run build"
+
}
+
],
+
[
+
"@semantic-release/git",
+
{
+
"assets": [
+
"package.json"
+
],
+
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
+
}
+
],
+
[
+
"@semantic-release/github",
+
{
+
"assets": [
+
{
+
"path": "dist/atomic-calendar-revive.js"
+
}
+
]
+
}
+
],
+
"@semantic-release/changelog"
+
]
+
}
+
}
+42
pkgs/servers/home-assistant/custom-lovelace-modules/atomic-calendar-revive/update.sh
···
+
#!/usr/bin/env nix-shell
+
#!nix-shell -i bash -p nix-update git
+
# shellcheck shell=bash
+
+
ROOT=$(git rev-parse --show-toplevel)
+
ATTR=home-assistant-custom-lovelace-modules.atomic-calendar-revive
+
+
cd "$ROOT" || exit 1
+
+
# get current version in nixpkgs
+
CURRENT_VERSION=$(nix eval -f ./default.nix --raw "$ATTR")
+
+
# get latest release tag
+
LATEST_RELEASE=$(curl https://api.github.com/repos/totaldebug/atomic-calendar-revive/releases | jq "[.[] | select(.prerelease == false)][0].tag_name")
+
+
# strip version prefix
+
LATEST_VERSION=${LATEST_RELEASE//"v"}
+
+
# strip quotes
+
LATEST_VERSION=${LATEST_VERSION%\"}
+
LATEST_VERSION=${LATEST_VERSION#\"}
+
+
if [ "$CURRENT_VERSION" = "$LATEST_VERSION" ];
+
then
+
echo Already on latest version
+
exit 0
+
fi
+
+
echo "Updating to ${LATEST_VERSION}"
+
+
PKGDIR=$(dirname "$0")
+
+
# change to package directory
+
cd "$PKGDIR" || exit 1
+
+
# update package.json
+
echo "https://raw.githubusercontent.com/totaldebug/atomic-calendar-revive/v${LATEST_VERSION}/package.json"
+
curl -o ./package.json "https://raw.githubusercontent.com/totaldebug/atomic-calendar-revive/v${LATEST_VERSION}/package.json"
+
+
# update package
+
cd "$ROOT" || exit 1
+
nix-update --version "$LATEST_VERSION" "$ATTR"
+6
pkgs/servers/home-assistant/custom-lovelace-modules/default.nix
···
apexcharts-card = callPackage ./apexcharts-card { };
+
atomic-calendar-revive = callPackage ./atomic-calendar-revive { };
+
button-card = callPackage ./button-card { };
card-mod = callPackage ./card-mod { };
···
multiple-entity-row = callPackage ./multiple-entity-row { };
mushroom = callPackage ./mushroom { };
+
+
rmv-card = callPackage ./rmv-card { };
+
+
template-entity-row = callPackage ./template-entity-row { };
valetudo-map-card = callPackage ./valetudo-map-card { };
+39
pkgs/servers/home-assistant/custom-lovelace-modules/rmv-card/default.nix
···
+
{
+
lib,
+
stdenv,
+
fetchFromGitHub,
+
unstableGitUpdater,
+
}:
+
+
stdenv.mkDerivation {
+
pname = "rmv-card";
+
version = "0-unstable-2023-10-09";
+
+
src = fetchFromGitHub {
+
owner = "custom-cards";
+
repo = "rmv-card";
+
rev = "b0b2af1565bb69b8d304285cae163cb15883c9ab";
+
hash = "sha256-9chkS4wqkeNqeYGWdG00bwJOdDbsI+9VwWWfH+5TJoY=";
+
};
+
+
dontBuild = true;
+
+
installPhase = ''
+
runHook preInstall
+
+
mkdir $out
+
cp rmv-card.js $out/
+
+
runHook postInstall
+
'';
+
+
passthru.updateScript = unstableGitUpdater { };
+
+
meta = with lib; {
+
description = "Custom card for the RMV component";
+
homepage = "https://github.com/custom-cards/rmv-card";
+
license = licenses.asl20;
+
maintainers = with maintainers; [ hexa ];
+
platforms = platforms.all;
+
};
+
}
+37
pkgs/servers/home-assistant/custom-lovelace-modules/template-entity-row/default.nix
···
+
{
+
lib,
+
buildNpmPackage,
+
fetchFromGitHub,
+
}:
+
+
buildNpmPackage rec {
+
pname = "template-entity-row";
+
version = "1.4.1";
+
+
src = fetchFromGitHub {
+
owner = "thomasloven";
+
repo = "lovelace-template-entity-row";
+
rev = "v${version}";
+
hash = "sha256-XQxdnRQywWki5mJhmQU5Etz2XSB8jYC32tFGLWb3IXs=";
+
};
+
+
npmDepsHash = "sha256-fJ+2LWXtUH4PiHhoVhMMxdCnCjfH+xzk+vjI44rKF60=";
+
+
installPhase = ''
+
runHook preInstall
+
+
mkdir $out
+
cp template-entity-row.js $out/
+
+
runHook postInstall
+
'';
+
+
meta = with lib; {
+
changelog = "https://github.com/thomasloven/lovelace-template-entity-row/releases/tag/${src.rev}";
+
description = "Display whatever you want in an entities card row";
+
homepage = "https://github.com/thomasloven/lovelace-template-entity-row";
+
license = licenses.mit;
+
maintainers = with maintainers; [ hexa ];
+
platforms = platforms.all;
+
};
+
}