Try cookiecutter
This commit is contained in:
parent
37a641887f
commit
bdd99e9374
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -1,2 +0,0 @@
|
||||
<NAME>.js binary
|
||||
package-lock.json.binary
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +0,0 @@
|
||||
node_modules/
|
6
cookiecutter.json
Normal file
6
cookiecutter.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"project_name": "Lovelace Custom Card",
|
||||
"project_slug": "{{ cookiecutter.project_name.lower().replace(' ', '-') ",
|
||||
"project_file": "{{ cookiecutter.project_slug.replace('lovelace-', '') ",
|
||||
"author": "Thomas Lovén"
|
||||
}
|
28
package.json
28
package.json
@ -1,28 +0,0 @@
|
||||
{
|
||||
"name": "<NAME>",
|
||||
"private": true,
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"scripts": {
|
||||
"build": "rollup -c",
|
||||
"watch": "rollup -c --watch",
|
||||
"update-card-tools": "npm uninstall card-tools && npm install thomasloven/lovelace-card-tools"
|
||||
},
|
||||
"author": "Thomas Lovén",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.13.1",
|
||||
"@rollup/plugin-babel": "^5.3.0",
|
||||
"@rollup/plugin-json": "^4.1.0",
|
||||
"@rollup/plugin-node-resolve": "^11.2.0",
|
||||
"rollup": "^2.39.0",
|
||||
"rollup-plugin-terser": "^7.0.2",
|
||||
"rollup-plugin-typescript2": "^0.30.0",
|
||||
"typescript": "^4.1.5"
|
||||
},
|
||||
"dependencies": {
|
||||
"card-tools": "github:thomasloven/lovelace-card-tools",
|
||||
"lit": "^2.0.0-rc.2",
|
||||
"tslib": "^2.1.0"
|
||||
}
|
||||
}
|
@ -1,4 +0,0 @@
|
||||
HASS_USERNAME=dev
|
||||
HASS_PASSWORD=dev
|
||||
LOVELACE_LOCAL_FILES=<NAME>.js
|
||||
LOVELACE_PLUGINS=thomasloven/lovelace-card-mod
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "<NAME> Dev",
|
||||
"name": "{{ cookiecutter.project_slug }} Dev",
|
||||
"image": "thomasloven/hass-custom-devcontainer",
|
||||
"postCreateCommand": "sudo -E container setup-dev && npm add",
|
||||
"containerEnv": {
|
||||
@ -9,7 +9,8 @@
|
||||
"mounts": [
|
||||
"source=${localWorkspaceFolder},target=/config/www/workspace,type=bind",
|
||||
"source=${localWorkspaceFolder}/test,target=/config/test,type=bind",
|
||||
"source=${localWorkspaceFolder}/test/configuration.yaml,target=/config/configuration.yaml,type=bind"
|
||||
"source=${localWorkspaceFolder}/test/configuration.yaml,target=/config/configuration.yaml,type=bind",
|
||||
"source=${localWorkspaceFolder}/custom_components,target=/config/custom_components,type=bind"
|
||||
],
|
||||
"runArgs": ["--env-file", "${localWorkspaceFolder}/test/.env"],
|
||||
"extensions": [
|
2
{{ cookiecutter.project_slug }}/.gitattributes
vendored
Normal file
2
{{ cookiecutter.project_slug }}/.gitattributes
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
{{ cookiecutter.project_file }}.js binary
|
||||
package-lock.json.binary
|
2
{{ cookiecutter.project_slug }}/.gitignore
vendored
Normal file
2
{{ cookiecutter.project_slug }}/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
node_modules/
|
||||
custom_components/
|
@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2021 Thomas Lovén
|
||||
Copyright (c) 2023 Thomas Lovén
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
@ -1,4 +1,4 @@
|
||||
# <NAME>
|
||||
# {{ cookiecutter.project_name }}
|
||||
|
||||
[](https://github.com/custom-components/hacs)
|
||||
|
4
{{ cookiecutter.project_slug }}/hacs.json
Normal file
4
{{ cookiecutter.project_slug }}/hacs.json
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"name": "{{ cookiecutter.project_name }}",
|
||||
"render_readme": true
|
||||
}
|
27
{{ cookiecutter.project_slug }}/package.json
Normal file
27
{{ cookiecutter.project_slug }}/package.json
Normal file
@ -0,0 +1,27 @@
|
||||
{
|
||||
"name": "{{ cookiecutter.project_name }}",
|
||||
"private": true,
|
||||
"version": "0.1.0",
|
||||
"description": "",
|
||||
"scripts": {
|
||||
"build": "rollup -c",
|
||||
"watch": "rollup -c --watch"
|
||||
},
|
||||
"author": "{{ cookiecutter.author }}",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.23.6",
|
||||
"@babel/preset-env": "^7.23.6",
|
||||
"@rollup/plugin-babel": "^6.0.4",
|
||||
"@rollup/plugin-json": "^6.1.0",
|
||||
"@rollup/plugin-node-resolve": "^15.2.3",
|
||||
"rollup": "^2.79.1",
|
||||
"rollup-plugin-terser": "^7.0.2",
|
||||
"rollup-plugin-typescript2": "^0.36.0",
|
||||
"typescript": "^5.3.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"lit": "^3.1.0",
|
||||
"tslib": "^2.6.2"
|
||||
}
|
||||
}
|
@ -2,23 +2,21 @@ import nodeResolve from "@rollup/plugin-node-resolve";
|
||||
import json from "@rollup/plugin-json";
|
||||
import typescript from "rollup-plugin-typescript2";
|
||||
import { terser } from "rollup-plugin-terser";
|
||||
import babel from "@rollup/plugin-babel";
|
||||
import { getBabelOutputPlugin } from "@rollup/plugin-babel";
|
||||
|
||||
const dev = process.env.ROLLUP_WATCH;
|
||||
|
||||
export default {
|
||||
input: "src/main.ts",
|
||||
output: {
|
||||
file: "<NAME>.js",
|
||||
file: "{{ cookiecutter.project_file }}.js",
|
||||
format: "es",
|
||||
},
|
||||
plugins: [
|
||||
nodeResolve(),
|
||||
json(),
|
||||
typescript(),
|
||||
babel({
|
||||
exclude: "node_modules/**",
|
||||
}),
|
||||
getBabelOutputPlugin({ presets: ["@babel/preset-env"] }),
|
||||
!dev && terser({ format: { comments: false } }),
|
||||
],
|
||||
};
|
4
{{ cookiecutter.project_slug }}/test/.env
Normal file
4
{{ cookiecutter.project_slug }}/test/.env
Normal file
@ -0,0 +1,4 @@
|
||||
HASS_USERNAME=dev
|
||||
HASS_PASSWORD=dev
|
||||
LOVELACE_LOCAL_FILES={{ cookiecutter.project_file }}.js
|
||||
LOVELACE_PLUGINS="thomasloven/lovelace-card-mod"
|
@ -12,5 +12,6 @@ services:
|
||||
- ./configuration.yaml:/config/configuration.yaml:ro
|
||||
- .:/config/test:ro
|
||||
- ..:/config/www/workspace
|
||||
- ../custom_components,target=/config/custom_components
|
||||
ports:
|
||||
- 8125:8123
|
0
{{ cookiecutter.project_slug }}/test/lovelace.yaml
Normal file
0
{{ cookiecutter.project_slug }}/test/lovelace.yaml
Normal file
Loading…
x
Reference in New Issue
Block a user