mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 09:46:36 +00:00
20230330.0 (#15982)
This commit is contained in:
commit
4483a8b9a2
@ -20,7 +20,7 @@
|
||||
"settings": {
|
||||
"import/resolver": {
|
||||
"webpack": {
|
||||
"config": "./webpack.config.js"
|
||||
"config": "./webpack.config.cjs"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
2
.github/workflows/nightly.yaml
vendored
2
.github/workflows/nightly.yaml
vendored
@ -43,7 +43,7 @@ jobs:
|
||||
LOKALISE_TOKEN: ${{ secrets.LOKALISE_TOKEN }}
|
||||
|
||||
- name: Bump version
|
||||
run: script/version_bump.js nightly
|
||||
run: script/version_bump.cjs nightly
|
||||
|
||||
- name: Build nightly Python wheels
|
||||
run: |
|
||||
|
@ -1,6 +1,6 @@
|
||||
const path = require("path");
|
||||
const env = require("./env.js");
|
||||
const paths = require("./paths.js");
|
||||
const env = require("./env.cjs");
|
||||
const paths = require("./paths.cjs");
|
||||
|
||||
// GitHub base URL to use for production source maps
|
||||
// Nightly builds use the commit SHA, otherwise assumes there is a tag that matches the version
|
||||
@ -99,7 +99,7 @@ module.exports.babelOptions = ({ latestBuild, isProdBuild, isTestBuild }) => ({
|
||||
[
|
||||
path.resolve(
|
||||
paths.polymer_dir,
|
||||
"build-scripts/babel-plugins/inline-constants-plugin.js"
|
||||
"build-scripts/babel-plugins/inline-constants-plugin.cjs"
|
||||
),
|
||||
{
|
||||
modules: ["@mdi/js"],
|
@ -1,6 +1,6 @@
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const paths = require("./paths.js");
|
||||
const paths = require("./paths.cjs");
|
||||
|
||||
module.exports = {
|
||||
useRollup() {
|
@ -1,18 +1,18 @@
|
||||
// Run HA develop mode
|
||||
|
||||
const gulp = require("gulp");
|
||||
const env = require("../env");
|
||||
require("./clean.js");
|
||||
require("./translations.js");
|
||||
require("./locale-data.js");
|
||||
require("./gen-icons-json.js");
|
||||
require("./gather-static.js");
|
||||
require("./compress.js");
|
||||
require("./webpack.js");
|
||||
require("./service-worker.js");
|
||||
require("./entry-html.js");
|
||||
require("./rollup.js");
|
||||
require("./wds.js");
|
||||
const env = require("../env.cjs");
|
||||
require("./clean.cjs");
|
||||
require("./translations.cjs");
|
||||
require("./locale-data.cjs");
|
||||
require("./gen-icons-json.cjs");
|
||||
require("./gather-static.cjs");
|
||||
require("./compress.cjs");
|
||||
require("./webpack.cjs");
|
||||
require("./service-worker.cjs");
|
||||
require("./entry-html.cjs");
|
||||
require("./rollup.cjs");
|
||||
require("./wds.cjs");
|
||||
|
||||
gulp.task(
|
||||
"develop-app",
|
@ -1,14 +1,13 @@
|
||||
const gulp = require("gulp");
|
||||
const env = require("../env.cjs");
|
||||
|
||||
const env = require("../env");
|
||||
|
||||
require("./clean.js");
|
||||
require("./translations.js");
|
||||
require("./gather-static.js");
|
||||
require("./webpack.js");
|
||||
require("./service-worker.js");
|
||||
require("./entry-html.js");
|
||||
require("./rollup.js");
|
||||
require("./clean.cjs");
|
||||
require("./translations.cjs");
|
||||
require("./gather-static.cjs");
|
||||
require("./webpack.cjs");
|
||||
require("./service-worker.cjs");
|
||||
require("./entry-html.cjs");
|
||||
require("./rollup.cjs");
|
||||
|
||||
gulp.task(
|
||||
"develop-cast",
|
@ -1,7 +1,7 @@
|
||||
const del = import("del");
|
||||
const gulp = require("gulp");
|
||||
const paths = require("../paths");
|
||||
require("./translations");
|
||||
const paths = require("../paths.cjs");
|
||||
require("./translations.cjs");
|
||||
|
||||
gulp.task(
|
||||
"clean",
|
@ -4,7 +4,7 @@ const gulp = require("gulp");
|
||||
const zopfli = require("gulp-zopfli-green");
|
||||
const merge = require("merge-stream");
|
||||
const path = require("path");
|
||||
const paths = require("../paths");
|
||||
const paths = require("../paths.cjs");
|
||||
|
||||
const zopfliOptions = { threshold: 150 };
|
||||
|
@ -1,16 +1,15 @@
|
||||
// Run demo develop mode
|
||||
const gulp = require("gulp");
|
||||
const env = require("../env.cjs");
|
||||
|
||||
const env = require("../env");
|
||||
|
||||
require("./clean.js");
|
||||
require("./translations.js");
|
||||
require("./gen-icons-json.js");
|
||||
require("./gather-static.js");
|
||||
require("./webpack.js");
|
||||
require("./service-worker.js");
|
||||
require("./entry-html.js");
|
||||
require("./rollup.js");
|
||||
require("./clean.cjs");
|
||||
require("./translations.cjs");
|
||||
require("./gen-icons-json.cjs");
|
||||
require("./gather-static.cjs");
|
||||
require("./webpack.cjs");
|
||||
require("./service-worker.cjs");
|
||||
require("./entry-html.cjs");
|
||||
require("./rollup.cjs");
|
||||
|
||||
gulp.task(
|
||||
"develop-demo",
|
@ -4,9 +4,9 @@ const fs = require("fs-extra");
|
||||
const path = require("path");
|
||||
const template = require("lodash.template");
|
||||
const { minify } = require("html-minifier-terser");
|
||||
const paths = require("../paths.js");
|
||||
const env = require("../env.js");
|
||||
const { htmlMinifierOptions, terserOptions } = require("../bundle.js");
|
||||
const paths = require("../paths.cjs");
|
||||
const env = require("../env.cjs");
|
||||
const { htmlMinifierOptions, terserOptions } = require("../bundle.cjs");
|
||||
|
||||
const templatePath = (tpl) =>
|
||||
path.resolve(paths.polymer_dir, "src/html/", `${tpl}.html.template`);
|
@ -6,17 +6,17 @@ const { marked } = require("marked");
|
||||
const glob = require("glob");
|
||||
const yaml = require("js-yaml");
|
||||
|
||||
const env = require("../env");
|
||||
const paths = require("../paths");
|
||||
const env = require("../env.cjs");
|
||||
const paths = require("../paths.cjs");
|
||||
|
||||
require("./clean.js");
|
||||
require("./translations.js");
|
||||
require("./gen-icons-json.js");
|
||||
require("./gather-static.js");
|
||||
require("./webpack.js");
|
||||
require("./service-worker.js");
|
||||
require("./entry-html.js");
|
||||
require("./rollup.js");
|
||||
require("./clean.cjs");
|
||||
require("./translations.cjs");
|
||||
require("./gen-icons-json.cjs");
|
||||
require("./gather-static.cjs");
|
||||
require("./webpack.cjs");
|
||||
require("./service-worker.cjs");
|
||||
require("./entry-html.cjs");
|
||||
require("./rollup.cjs");
|
||||
|
||||
gulp.task("gather-gallery-pages", async function gatherPages() {
|
||||
const pageDir = path.resolve(paths.gallery_dir, "src/pages");
|
||||
@ -89,9 +89,7 @@ gulp.task("gather-gallery-pages", async function gatherPages() {
|
||||
|
||||
// Generate sidebar
|
||||
const sidebarPath = path.resolve(paths.gallery_dir, "sidebar.js");
|
||||
// To make watch work during development
|
||||
delete require.cache[sidebarPath];
|
||||
const sidebar = require(sidebarPath);
|
||||
const sidebar = (await import(sidebarPath)).default;
|
||||
|
||||
const pagesToProcess = {};
|
||||
for (const key of processed) {
|
@ -3,7 +3,7 @@
|
||||
const gulp = require("gulp");
|
||||
const path = require("path");
|
||||
const fs = require("fs-extra");
|
||||
const paths = require("../paths");
|
||||
const paths = require("../paths.cjs");
|
||||
|
||||
const npmPath = (...parts) =>
|
||||
path.resolve(paths.polymer_dir, "node_modules", ...parts);
|
@ -134,11 +134,11 @@ gulp.task("gen-icons-json", (done) => {
|
||||
});
|
||||
|
||||
const file = fs.readFileSync(PACKAGE_PATH, { encoding });
|
||||
const package = JSON.parse(file);
|
||||
const packageMeta = JSON.parse(file);
|
||||
|
||||
fs.writeFileSync(
|
||||
path.resolve(OUTPUT_DIR, "iconMetadata.json"),
|
||||
JSON.stringify({ version: package.version, parts })
|
||||
JSON.stringify({ version: packageMeta.version, parts })
|
||||
);
|
||||
|
||||
fs.writeFileSync(
|
@ -1,13 +1,13 @@
|
||||
const gulp = require("gulp");
|
||||
const env = require("../env");
|
||||
require("./clean.js");
|
||||
require("./gen-icons-json.js");
|
||||
require("./webpack.js");
|
||||
require("./compress.js");
|
||||
require("./rollup.js");
|
||||
require("./gather-static.js");
|
||||
require("./translations.js");
|
||||
require("./gen-icons-json.js");
|
||||
const env = require("../env.cjs");
|
||||
require("./clean.cjs");
|
||||
require("./compress.cjs");
|
||||
require("./entry-html.cjs");
|
||||
require("./gather-static.cjs");
|
||||
require("./gen-icons-json.cjs");
|
||||
require("./rollup.cjs");
|
||||
require("./translations.cjs");
|
||||
require("./webpack.cjs");
|
||||
|
||||
gulp.task(
|
||||
"develop-hassio",
|
@ -2,7 +2,7 @@ const del = import("del");
|
||||
const path = require("path");
|
||||
const gulp = require("gulp");
|
||||
const fs = require("fs");
|
||||
const paths = require("../paths");
|
||||
const paths = require("../paths.cjs");
|
||||
|
||||
const outDir = "build/locale-data";
|
||||
|
@ -6,8 +6,8 @@ const handler = require("serve-handler");
|
||||
const http = require("http");
|
||||
const log = require("fancy-log");
|
||||
const open = require("open");
|
||||
const rollupConfig = require("../rollup");
|
||||
const paths = require("../paths");
|
||||
const rollupConfig = require("../rollup.cjs");
|
||||
const paths = require("../paths.cjs");
|
||||
|
||||
const bothBuilds = (createConfigFunc, params) =>
|
||||
gulp.series(
|
||||
@ -46,7 +46,7 @@ function createServer(serveOptions) {
|
||||
);
|
||||
}
|
||||
|
||||
function watchRollup(createConfig, extraWatchSrc = [], serveOptions) {
|
||||
function watchRollup(createConfig, extraWatchSrc = [], serveOptions = null) {
|
||||
const { inputOptions, outputOptions } = createConfig({
|
||||
isProdBuild: false,
|
||||
latestBuild: true,
|
@ -5,7 +5,7 @@ const path = require("path");
|
||||
const fs = require("fs-extra");
|
||||
const workboxBuild = require("workbox-build");
|
||||
const sourceMapUrl = require("source-map-url");
|
||||
const paths = require("../paths.js");
|
||||
const paths = require("../paths.cjs");
|
||||
|
||||
const swDest = path.resolve(paths.app_output_root, "service_worker.js");
|
||||
|
@ -9,11 +9,11 @@ const flatmap = require("gulp-flatmap");
|
||||
const merge = require("gulp-merge-json");
|
||||
const rename = require("gulp-rename");
|
||||
const transform = require("gulp-json-transform");
|
||||
const { mapFiles } = require("../util");
|
||||
const env = require("../env");
|
||||
const paths = require("../paths");
|
||||
const { mapFiles } = require("../util.cjs");
|
||||
const env = require("../env.cjs");
|
||||
const paths = require("../paths.cjs");
|
||||
|
||||
require("./fetch-nightly-translations");
|
||||
require("./fetch-nightly-translations.cjs");
|
||||
|
||||
const inFrontendDir = "translations/frontend";
|
||||
const inBackendDir = "translations/backend";
|
@ -5,15 +5,15 @@ const webpack = require("webpack");
|
||||
const WebpackDevServer = require("webpack-dev-server");
|
||||
const log = require("fancy-log");
|
||||
const path = require("path");
|
||||
const env = require("../env");
|
||||
const paths = require("../paths");
|
||||
const env = require("../env.cjs");
|
||||
const paths = require("../paths.cjs");
|
||||
const {
|
||||
createAppConfig,
|
||||
createDemoConfig,
|
||||
createCastConfig,
|
||||
createHassioConfig,
|
||||
createGalleryConfig,
|
||||
} = require("../webpack");
|
||||
} = require("../webpack.cjs");
|
||||
|
||||
const bothBuilds = (createConfigFunc, params) => [
|
||||
createConfigFunc({ ...params, latestBuild: true }),
|
@ -103,7 +103,7 @@ module.exports = function (opts = {}) {
|
||||
}
|
||||
delete optionsObject.type;
|
||||
|
||||
if (!new RegExp("^.*/").test(workerFile)) {
|
||||
if (!/^.*\//.test(workerFile)) {
|
||||
this.warn(
|
||||
`Paths passed to the Worker constructor must be relative or absolute, i.e. start with /, ./ or ../ (just like dynamic import!). Ignoring "${workerFile}".`
|
||||
);
|
@ -3,18 +3,18 @@ const path = require("path");
|
||||
const commonjs = require("@rollup/plugin-commonjs");
|
||||
const resolve = require("@rollup/plugin-node-resolve");
|
||||
const json = require("@rollup/plugin-json");
|
||||
const babel = require("@rollup/plugin-babel").babel;
|
||||
const { babel } = require("@rollup/plugin-babel");
|
||||
const replace = require("@rollup/plugin-replace");
|
||||
const visualizer = require("rollup-plugin-visualizer");
|
||||
const { string } = require("rollup-plugin-string");
|
||||
const { terser } = require("rollup-plugin-terser");
|
||||
const manifest = require("./rollup-plugins/manifest-plugin");
|
||||
const worker = require("./rollup-plugins/worker-plugin");
|
||||
const dontHashPlugin = require("./rollup-plugins/dont-hash-plugin");
|
||||
const ignore = require("./rollup-plugins/ignore-plugin");
|
||||
const manifest = require("./rollup-plugins/manifest-plugin.cjs");
|
||||
const worker = require("./rollup-plugins/worker-plugin.cjs");
|
||||
const dontHashPlugin = require("./rollup-plugins/dont-hash-plugin.cjs");
|
||||
const ignore = require("./rollup-plugins/ignore-plugin.cjs");
|
||||
|
||||
const bundle = require("./bundle");
|
||||
const paths = require("./paths");
|
||||
const bundle = require("./bundle.cjs");
|
||||
const paths = require("./paths.cjs");
|
||||
|
||||
const extensions = [".js", ".ts"];
|
||||
|
@ -4,8 +4,8 @@ const TerserPlugin = require("terser-webpack-plugin");
|
||||
const { WebpackManifestPlugin } = require("webpack-manifest-plugin");
|
||||
const log = require("fancy-log");
|
||||
const WebpackBar = require("webpackbar");
|
||||
const paths = require("./paths.js");
|
||||
const bundle = require("./bundle.js");
|
||||
const paths = require("./paths.cjs");
|
||||
const bundle = require("./bundle.cjs");
|
||||
|
||||
class LogStartCompilePlugin {
|
||||
ignoredFirst = false;
|
||||
@ -64,6 +64,9 @@ const createWebpackConfig = ({
|
||||
cacheCompression: false,
|
||||
},
|
||||
},
|
||||
resolve: {
|
||||
fullySpecified: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
test: /\.css$/,
|
@ -1,5 +1,5 @@
|
||||
const rollup = require("../build-scripts/rollup.js");
|
||||
const env = require("../build-scripts/env.js");
|
||||
import rollup from "../build-scripts/rollup.cjs";
|
||||
import env from "../build-scripts/env.cjs";
|
||||
|
||||
const config = rollup.createCastConfig({
|
||||
isProdBuild: env.isProdBuild(),
|
||||
@ -7,4 +7,4 @@ const config = rollup.createCastConfig({
|
||||
isStatsBuild: env.isStatsBuild(),
|
||||
});
|
||||
|
||||
module.exports = { ...config.inputOptions, output: config.outputOptions };
|
||||
export default { ...config.inputOptions, output: config.outputOptions };
|
||||
|
@ -1,8 +1,8 @@
|
||||
const { createCastConfig } = require("../build-scripts/webpack.js");
|
||||
const { isProdBuild, isStatsBuild } = require("../build-scripts/env.js");
|
||||
import webpack from "../build-scripts/webpack.cjs";
|
||||
import env from "../build-scripts/env.cjs";
|
||||
|
||||
module.exports = createCastConfig({
|
||||
isProdBuild: isProdBuild(),
|
||||
isStatsBuild: isStatsBuild(),
|
||||
export default webpack.createCastConfig({
|
||||
isProdBuild: env.isProdBuild(),
|
||||
isStatsBuild: env.isStatsBuild(),
|
||||
latestBuild: true,
|
||||
});
|
||||
|
@ -1,5 +1,5 @@
|
||||
const rollup = require("../build-scripts/rollup.js");
|
||||
const env = require("../build-scripts/env.js");
|
||||
import rollup from "../build-scripts/rollup.cjs";
|
||||
import env from "../build-scripts/env.cjs";
|
||||
|
||||
const config = rollup.createDemoConfig({
|
||||
isProdBuild: env.isProdBuild(),
|
||||
@ -7,4 +7,4 @@ const config = rollup.createDemoConfig({
|
||||
isStatsBuild: env.isStatsBuild(),
|
||||
});
|
||||
|
||||
module.exports = { ...config.inputOptions, output: config.outputOptions };
|
||||
export default { ...config.inputOptions, output: config.outputOptions };
|
||||
|
@ -1,12 +1,11 @@
|
||||
const { createDemoConfig } = require("../build-scripts/webpack.js");
|
||||
const { isProdBuild, isStatsBuild } = require("../build-scripts/env.js");
|
||||
import webpack from "../build-scripts/webpack.cjs";
|
||||
import env from "../build-scripts/env.cjs";
|
||||
|
||||
// File just used for stats builds
|
||||
|
||||
const latestBuild = true;
|
||||
|
||||
module.exports = createDemoConfig({
|
||||
isProdBuild: isProdBuild(),
|
||||
isStatsBuild: isStatsBuild(),
|
||||
export default webpack.createDemoConfig({
|
||||
isProdBuild: env.isProdBuild(),
|
||||
isStatsBuild: env.isStatsBuild(),
|
||||
latestBuild,
|
||||
});
|
||||
|
@ -1,5 +1,5 @@
|
||||
const rollup = require("../build-scripts/rollup.js");
|
||||
const env = require("../build-scripts/env.js");
|
||||
import rollup from "../build-scripts/rollup.cjs";
|
||||
import env from "../build-scripts/env.cjs";
|
||||
|
||||
const config = rollup.createGalleryConfig({
|
||||
isProdBuild: env.isProdBuild(),
|
||||
@ -7,4 +7,4 @@ const config = rollup.createGalleryConfig({
|
||||
isStatsBuild: env.isStatsBuild(),
|
||||
});
|
||||
|
||||
module.exports = { ...config.inputOptions, output: config.outputOptions };
|
||||
export default { ...config.inputOptions, output: config.outputOptions };
|
||||
|
@ -1,4 +1,4 @@
|
||||
module.exports = [
|
||||
export default [
|
||||
{
|
||||
// This section has no header and so all page links are shown directly in the sidebar
|
||||
category: "concepts",
|
||||
|
@ -1,8 +1,8 @@
|
||||
const { createGalleryConfig } = require("../build-scripts/webpack.js");
|
||||
const { isProdBuild, isStatsBuild } = require("../build-scripts/env.js");
|
||||
import webpack from "../build-scripts/webpack.cjs";
|
||||
import env from "../build-scripts/env.cjs";
|
||||
|
||||
module.exports = createGalleryConfig({
|
||||
isProdBuild: isProdBuild(),
|
||||
isStatsBuild: isStatsBuild(),
|
||||
export default webpack.createGalleryConfig({
|
||||
isProdBuild: env.isProdBuild(),
|
||||
isStatsBuild: env.isStatsBuild(),
|
||||
latestBuild: true,
|
||||
});
|
||||
|
14
gulpfile.js
14
gulpfile.js
@ -1,3 +1,13 @@
|
||||
var requireDir = require("require-dir");
|
||||
import { globIterate } from "glob";
|
||||
|
||||
requireDir("./build-scripts/gulp/");
|
||||
const gulpImports = [];
|
||||
|
||||
for await (const gulpModule of globIterate("build-scripts/gulp/*.?(c|m)js", {
|
||||
dotRelative: true,
|
||||
})) {
|
||||
gulpImports.push(import(gulpModule));
|
||||
}
|
||||
|
||||
// Since all tasks are currently registered with gulp.task(), this is enough
|
||||
// If any are converted to named exports, need to loop and aggregate exports here
|
||||
await Promise.all(gulpImports);
|
||||
|
@ -1,5 +1,5 @@
|
||||
const rollup = require("../build-scripts/rollup.js");
|
||||
const env = require("../build-scripts/env.js");
|
||||
import rollup from "../build-scripts/rollup.cjs";
|
||||
import env from "../build-scripts/env.cjs";
|
||||
|
||||
const config = rollup.createHassioConfig({
|
||||
isProdBuild: env.isProdBuild(),
|
||||
@ -7,4 +7,4 @@ const config = rollup.createHassioConfig({
|
||||
isStatsBuild: env.isStatsBuild(),
|
||||
});
|
||||
|
||||
module.exports = { ...config.inputOptions, output: config.outputOptions };
|
||||
export default { ...config.inputOptions, output: config.outputOptions };
|
||||
|
@ -1,8 +1,8 @@
|
||||
const { createHassioConfig } = require("../build-scripts/webpack.js");
|
||||
const { isProdBuild, isStatsBuild } = require("../build-scripts/env.js");
|
||||
import webpack from "../build-scripts/webpack.cjs";
|
||||
import env from "../build-scripts/env.cjs";
|
||||
|
||||
module.exports = createHassioConfig({
|
||||
isProdBuild: isProdBuild(),
|
||||
isStatsBuild: isStatsBuild(),
|
||||
export default webpack.createHassioConfig({
|
||||
isProdBuild: env.isProdBuild(),
|
||||
isStatsBuild: env.isStatsBuild(),
|
||||
latestBuild: true,
|
||||
});
|
||||
|
@ -1,5 +1,5 @@
|
||||
module.exports = {
|
||||
"*.{js,ts}": ["prettier --write", "eslint --fix"],
|
||||
export default {
|
||||
"*.?(c|m){js,ts}": ["eslint --fix", "prettier --write"],
|
||||
"!(/translations)*.{json,css,md,html}": "prettier --write",
|
||||
"translations/*/*.json": (files) =>
|
||||
'printf "%s\n" "Translation files should not be added or modified here. Instead, make the necessary modifications in src/translations/en.json. Other languages are managed externally. Please see https://developers.home-assistant.io/docs/translations/ for details." ' +
|
||||
|
@ -19,10 +19,11 @@
|
||||
"postinstall": "husky install",
|
||||
"prepack": "pinst --disable",
|
||||
"postpack": "pinst --enable",
|
||||
"test": "instant-mocha --webpack-config ./test/webpack.config.js --require ./test/setup.js \"test/**/*.ts\""
|
||||
"test": "instant-mocha --webpack-config ./test/webpack.config.js --require ./test/setup.cjs \"test/**/*.ts\""
|
||||
},
|
||||
"author": "Paulus Schoutsen <Paulus@PaulusSchoutsen.nl> (http://paulusschoutsen.nl)",
|
||||
"license": "Apache-2.0",
|
||||
"type": "module",
|
||||
"dependencies": {
|
||||
"@braintree/sanitize-url": "6.0.2",
|
||||
"@codemirror/autocomplete": "6.4.2",
|
||||
@ -227,13 +228,12 @@
|
||||
"open": "8.4.2",
|
||||
"pinst": "3.0.0",
|
||||
"prettier": "2.8.7",
|
||||
"require-dir": "1.2.0",
|
||||
"rollup": "2.79.1",
|
||||
"rollup-plugin-string": "3.0.0",
|
||||
"rollup-plugin-terser": "7.0.2",
|
||||
"rollup-plugin-visualizer": "5.9.0",
|
||||
"serve-handler": "6.1.5",
|
||||
"sinon": "15.0.2",
|
||||
"sinon": "15.0.3",
|
||||
"source-map-url": "0.4.1",
|
||||
"systemjs": "6.14.1",
|
||||
"tar": "6.1.13",
|
||||
@ -254,7 +254,6 @@
|
||||
"@polymer/polymer": "patch:@polymer/polymer@3.5.1#./.yarn/patches/@polymer/polymer/pr-5569.patch",
|
||||
"@material/mwc-button@^0.25.3": "^0.27.0"
|
||||
},
|
||||
"main": "src/home-assistant.js",
|
||||
"prettier": {
|
||||
"trailingComma": "es5",
|
||||
"arrowParens": "always"
|
||||
|
@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
||||
|
||||
[project]
|
||||
name = "home-assistant-frontend"
|
||||
version = "20230329.0"
|
||||
version = "20230330.0"
|
||||
license = {text = "Apache-2.0"}
|
||||
description = "The Home Assistant frontend"
|
||||
readme = "README.md"
|
||||
|
@ -1,5 +1,5 @@
|
||||
const rollup = require("./build-scripts/rollup.js");
|
||||
const env = require("./build-scripts/env.js");
|
||||
import rollup from "../build-scripts/rollup.cjs";
|
||||
import env from "../build-scripts/env.cjs";
|
||||
|
||||
const config = rollup.createAppConfig({
|
||||
isProdBuild: env.isProdBuild(),
|
||||
@ -7,4 +7,4 @@ const config = rollup.createAppConfig({
|
||||
isStatsBuild: env.isStatsBuild(),
|
||||
});
|
||||
|
||||
module.exports = { ...config.inputOptions, output: config.outputOptions };
|
||||
export default { ...config.inputOptions, output: config.outputOptions };
|
||||
|
@ -302,6 +302,7 @@ export default class HaChartBase extends LitElement {
|
||||
return css`
|
||||
:host {
|
||||
display: block;
|
||||
position: relative;
|
||||
}
|
||||
.chartContainer {
|
||||
overflow: hidden;
|
||||
|
@ -61,6 +61,10 @@ class StateHistoryChartLine extends LitElement {
|
||||
this._chartOptions = {
|
||||
parsing: false,
|
||||
animation: false,
|
||||
interaction: {
|
||||
mode: "nearest",
|
||||
axis: "x",
|
||||
},
|
||||
scales: {
|
||||
x: {
|
||||
type: "time",
|
||||
@ -108,7 +112,6 @@ class StateHistoryChartLine extends LitElement {
|
||||
},
|
||||
plugins: {
|
||||
tooltip: {
|
||||
mode: "nearest",
|
||||
callbacks: {
|
||||
label: (context) =>
|
||||
`${context.dataset.label}: ${formatNumber(
|
||||
@ -127,16 +130,13 @@ class StateHistoryChartLine extends LitElement {
|
||||
},
|
||||
},
|
||||
},
|
||||
hover: {
|
||||
mode: "nearest",
|
||||
},
|
||||
elements: {
|
||||
line: {
|
||||
tension: 0.1,
|
||||
borderWidth: 1.5,
|
||||
},
|
||||
point: {
|
||||
hitRadius: 5,
|
||||
hitRadius: 50,
|
||||
},
|
||||
},
|
||||
// @ts-expect-error
|
||||
|
@ -102,6 +102,7 @@ class StatisticsChart extends LitElement {
|
||||
if (
|
||||
changedProps.has("statisticsData") ||
|
||||
changedProps.has("statTypes") ||
|
||||
changedProps.has("chartType") ||
|
||||
changedProps.has("hideLegend")
|
||||
) {
|
||||
this._generateData();
|
||||
@ -149,6 +150,10 @@ class StatisticsChart extends LitElement {
|
||||
this._chartOptions = {
|
||||
parsing: false,
|
||||
animation: false,
|
||||
interaction: {
|
||||
mode: "nearest",
|
||||
axis: "x",
|
||||
},
|
||||
scales: {
|
||||
x: {
|
||||
type: "time",
|
||||
@ -186,7 +191,6 @@ class StatisticsChart extends LitElement {
|
||||
},
|
||||
plugins: {
|
||||
tooltip: {
|
||||
mode: "nearest",
|
||||
callbacks: {
|
||||
label: (context) =>
|
||||
`${context.dataset.label}: ${formatNumber(
|
||||
@ -208,9 +212,6 @@ class StatisticsChart extends LitElement {
|
||||
},
|
||||
},
|
||||
},
|
||||
hover: {
|
||||
mode: "nearest",
|
||||
},
|
||||
elements: {
|
||||
line: {
|
||||
tension: 0.4,
|
||||
@ -219,7 +220,7 @@ class StatisticsChart extends LitElement {
|
||||
},
|
||||
bar: { borderWidth: 1.5, borderRadius: 4 },
|
||||
point: {
|
||||
hitRadius: 5,
|
||||
hitRadius: 50,
|
||||
},
|
||||
},
|
||||
// @ts-expect-error
|
||||
@ -316,6 +317,7 @@ class StatisticsChart extends LitElement {
|
||||
}
|
||||
statDataSets.forEach((d, i) => {
|
||||
if (
|
||||
this.chartType === "line" &&
|
||||
prevEndTime &&
|
||||
prevValues &&
|
||||
prevEndTime.getTime() !== start.getTime()
|
||||
|
@ -41,7 +41,9 @@ export class HaDialog extends DialogBase {
|
||||
SUPPRESS_DEFAULT_PRESS_SELECTOR,
|
||||
].join(", ");
|
||||
this._updateScrolledAttribute();
|
||||
this.contentElement?.addEventListener("scroll", this._onScroll);
|
||||
this.contentElement?.addEventListener("scroll", this._onScroll, {
|
||||
passive: true,
|
||||
});
|
||||
}
|
||||
|
||||
disconnectedCallback(): void {
|
||||
|
@ -191,6 +191,9 @@ export class HaFileUpload extends LitElement {
|
||||
inset-inline-end: initial !important;
|
||||
direction: var(--direction);
|
||||
}
|
||||
.mdc-text-field__icon--trailing {
|
||||
pointer-events: auto !important;
|
||||
}
|
||||
.dragged:before {
|
||||
position: var(--layout-fit_-_position);
|
||||
top: var(--layout-fit_-_top);
|
||||
|
@ -10,6 +10,7 @@ export class HaTopAppBarFixed extends TopAppBarFixedBase {
|
||||
css`
|
||||
.mdc-top-app-bar__row {
|
||||
height: var(--header-height);
|
||||
border-bottom: var(--app-header-border-bottom);
|
||||
}
|
||||
.mdc-top-app-bar--fixed-adjust {
|
||||
padding-top: var(--header-height);
|
||||
@ -21,7 +22,6 @@ export class HaTopAppBarFixed extends TopAppBarFixedBase {
|
||||
--app-header-background-color,
|
||||
var(--mdc-theme-primary)
|
||||
);
|
||||
border-bottom: var(--app-header-border-bottom);
|
||||
}
|
||||
`,
|
||||
];
|
||||
|
@ -10,6 +10,7 @@ export class HaTopAppBar extends TopAppBarBase {
|
||||
css`
|
||||
.mdc-top-app-bar__row {
|
||||
height: var(--header-height);
|
||||
border-bottom: var(--app-header-border-bottom);
|
||||
}
|
||||
.mdc-top-app-bar--fixed-adjust {
|
||||
padding-top: var(--header-height);
|
||||
@ -21,7 +22,6 @@ export class HaTopAppBar extends TopAppBarBase {
|
||||
--app-header-background-color,
|
||||
var(--mdc-theme-primary)
|
||||
);
|
||||
border-bottom: var(--app-header-border-bottom);
|
||||
}
|
||||
`,
|
||||
];
|
||||
|
@ -3,7 +3,9 @@ import {
|
||||
HassEntityBase,
|
||||
} from "home-assistant-js-websocket";
|
||||
import { supportsFeature } from "../common/entity/supports-feature";
|
||||
import { blankBeforePercent } from "../common/translations/blank_before_percent";
|
||||
import { UNAVAILABLE } from "./entity";
|
||||
import { FrontendLocaleData } from "./translation";
|
||||
|
||||
export const enum CoverEntityFeature {
|
||||
OPEN = 1,
|
||||
@ -106,3 +108,18 @@ interface CoverEntityAttributes extends HassEntityAttributeBase {
|
||||
export interface CoverEntity extends HassEntityBase {
|
||||
attributes: CoverEntityAttributes;
|
||||
}
|
||||
|
||||
export function computeCoverPositionStateDisplay(
|
||||
stateObj: CoverEntity,
|
||||
locale: FrontendLocaleData,
|
||||
position?: number
|
||||
) {
|
||||
const currentPosition =
|
||||
position ??
|
||||
stateObj.attributes.current_position ??
|
||||
stateObj.attributes.current_tilt_position;
|
||||
|
||||
return currentPosition && currentPosition !== 100
|
||||
? `${Math.round(currentPosition)}${blankBeforePercent(locale)}%`
|
||||
: "";
|
||||
}
|
||||
|
@ -9,6 +9,8 @@ import {
|
||||
HassEntityAttributeBase,
|
||||
HassEntityBase,
|
||||
} from "home-assistant-js-websocket";
|
||||
import { blankBeforePercent } from "../common/translations/blank_before_percent";
|
||||
import { FrontendLocaleData } from "./translation";
|
||||
|
||||
export const enum FanEntityFeature {
|
||||
SET_SPEED = 1,
|
||||
@ -91,3 +93,15 @@ export function computeFanSpeedIcon(
|
||||
: [mdiFanSpeed1, mdiFanSpeed2, mdiFanSpeed3][index - 1];
|
||||
}
|
||||
export const FAN_SPEED_COUNT_MAX_FOR_BUTTONS = 4;
|
||||
|
||||
export function computeFanSpeedStateDisplay(
|
||||
stateObj: FanEntity,
|
||||
locale: FrontendLocaleData,
|
||||
speed?: number
|
||||
) {
|
||||
const currentSpeed = speed ?? stateObj.attributes.percentage;
|
||||
|
||||
return currentSpeed
|
||||
? `${Math.round(currentSpeed)}${blankBeforePercent(locale)}%`
|
||||
: "";
|
||||
}
|
||||
|
@ -10,9 +10,12 @@ import {
|
||||
import { customElement, property, state } from "lit/decorators";
|
||||
import { computeStateDisplay } from "../../../common/entity/compute_state_display";
|
||||
import { supportsFeature } from "../../../common/entity/supports-feature";
|
||||
import { blankBeforePercent } from "../../../common/translations/blank_before_percent";
|
||||
import "../../../components/ha-attributes";
|
||||
import { CoverEntity, CoverEntityFeature } from "../../../data/cover";
|
||||
import {
|
||||
computeCoverPositionStateDisplay,
|
||||
CoverEntity,
|
||||
CoverEntityFeature,
|
||||
} from "../../../data/cover";
|
||||
import type { HomeAssistant } from "../../../types";
|
||||
import "../components/cover/ha-more-info-cover-buttons";
|
||||
import "../components/cover/ha-more-info-cover-position";
|
||||
@ -27,7 +30,9 @@ class MoreInfoCover extends LitElement {
|
||||
|
||||
@property({ attribute: false }) public stateObj?: CoverEntity;
|
||||
|
||||
@state() private _displayedPosition?: number;
|
||||
@state() private _livePosition?: number;
|
||||
|
||||
@state() private _liveTilt?: number;
|
||||
|
||||
@state() private _mode?: "position" | "button";
|
||||
|
||||
@ -35,20 +40,29 @@ class MoreInfoCover extends LitElement {
|
||||
this._mode = this._mode === "position" ? "button" : "position";
|
||||
}
|
||||
|
||||
private _positionChanged(ev) {
|
||||
private _positionSliderMoved(ev) {
|
||||
const value = (ev.detail as any).value;
|
||||
if (isNaN(value)) return;
|
||||
this._displayedPosition = value;
|
||||
this._livePosition = value;
|
||||
}
|
||||
|
||||
private _positionValueChanged() {
|
||||
this._livePosition = undefined;
|
||||
}
|
||||
|
||||
private _tiltSliderMoved(ev) {
|
||||
const value = (ev.detail as any).value;
|
||||
if (isNaN(value)) return;
|
||||
this._liveTilt = value;
|
||||
}
|
||||
|
||||
private _tiltValueChanged() {
|
||||
this._liveTilt = undefined;
|
||||
}
|
||||
|
||||
protected willUpdate(changedProps: PropertyValues): void {
|
||||
super.willUpdate(changedProps);
|
||||
if (changedProps.has("stateObj") && this.stateObj) {
|
||||
if (supportsFeature(this.stateObj, CoverEntityFeature.SET_POSITION)) {
|
||||
const currentPosition = this.stateObj?.attributes.current_position;
|
||||
this._displayedPosition =
|
||||
currentPosition != null ? Math.round(currentPosition) : undefined;
|
||||
}
|
||||
if (!this._mode) {
|
||||
this._mode =
|
||||
supportsFeature(this.stateObj, CoverEntityFeature.SET_POSITION) ||
|
||||
@ -60,29 +74,29 @@ class MoreInfoCover extends LitElement {
|
||||
}
|
||||
|
||||
private get _stateOverride() {
|
||||
if (this._displayedPosition == null) return undefined;
|
||||
const liveValue = this._livePosition ?? this._liveTilt;
|
||||
|
||||
const tempState = {
|
||||
...this.stateObj,
|
||||
state: this._displayedPosition ? "open" : "closed",
|
||||
attributes: {
|
||||
...this.stateObj!.attributes,
|
||||
current_position: this._displayedPosition,
|
||||
},
|
||||
} as CoverEntity;
|
||||
const forcedState =
|
||||
liveValue != null ? (liveValue ? "open" : "closed") : undefined;
|
||||
|
||||
const stateDisplay = computeStateDisplay(
|
||||
this.hass.localize,
|
||||
tempState!,
|
||||
this.stateObj!,
|
||||
this.hass.locale,
|
||||
this.hass.entities
|
||||
this.hass.entities,
|
||||
forcedState
|
||||
);
|
||||
|
||||
return this._displayedPosition && this._displayedPosition !== 100
|
||||
? `${stateDisplay} - ${Math.round(
|
||||
this._displayedPosition
|
||||
)}${blankBeforePercent(this.hass!.locale)}%`
|
||||
: stateDisplay;
|
||||
const positionStateDisplay = computeCoverPositionStateDisplay(
|
||||
this.stateObj!,
|
||||
this.hass.locale,
|
||||
liveValue
|
||||
);
|
||||
|
||||
if (positionStateDisplay) {
|
||||
return `${stateDisplay} ⸱ ${positionStateDisplay}`;
|
||||
}
|
||||
return stateDisplay;
|
||||
}
|
||||
|
||||
protected render() {
|
||||
@ -133,7 +147,8 @@ class MoreInfoCover extends LitElement {
|
||||
<ha-more-info-cover-position
|
||||
.stateObj=${this.stateObj}
|
||||
.hass=${this.hass}
|
||||
@slider-moved=${this._positionChanged}
|
||||
@slider-moved=${this._positionSliderMoved}
|
||||
@value-changed=${this._positionValueChanged}
|
||||
></ha-more-info-cover-position>
|
||||
`
|
||||
: nothing}
|
||||
@ -142,6 +157,8 @@ class MoreInfoCover extends LitElement {
|
||||
<ha-more-info-cover-tilt-position
|
||||
.stateObj=${this.stateObj}
|
||||
.hass=${this.hass}
|
||||
@slider-moved=${this._tiltSliderMoved}
|
||||
@value-changed=${this._tiltValueChanged}
|
||||
></ha-more-info-cover-tilt-position>
|
||||
`
|
||||
: nothing}
|
||||
|
@ -22,11 +22,12 @@ import {
|
||||
computeAttributeNameDisplay,
|
||||
computeAttributeValueDisplay,
|
||||
} from "../../../common/entity/compute_attribute_display";
|
||||
import { computeStateDisplay } from "../../../common/entity/compute_state_display";
|
||||
import { supportsFeature } from "../../../common/entity/supports-feature";
|
||||
import { blankBeforePercent } from "../../../common/translations/blank_before_percent";
|
||||
import "../../../components/ha-attributes";
|
||||
import { UNAVAILABLE } from "../../../data/entity";
|
||||
import {
|
||||
computeFanSpeedStateDisplay,
|
||||
computeFanSpeedCount,
|
||||
FanEntity,
|
||||
FanEntityFeature,
|
||||
@ -49,12 +50,16 @@ class MoreInfoFan extends LitElement {
|
||||
|
||||
@state() public _presetMode?: string;
|
||||
|
||||
@state() private _selectedPercentage?: number;
|
||||
@state() private _liveSpeed?: number;
|
||||
|
||||
private _percentageChanged(ev) {
|
||||
private _speedSliderMoved(ev) {
|
||||
const value = (ev.detail as any).value;
|
||||
if (isNaN(value)) return;
|
||||
this._selectedPercentage = value;
|
||||
this._liveSpeed = value;
|
||||
}
|
||||
|
||||
private _speedValueChanged() {
|
||||
this._liveSpeed = undefined;
|
||||
}
|
||||
|
||||
private _toggle = () => {
|
||||
@ -107,12 +112,35 @@ class MoreInfoFan extends LitElement {
|
||||
protected updated(changedProps: PropertyValues): void {
|
||||
if (changedProps.has("stateObj")) {
|
||||
this._presetMode = this.stateObj?.attributes.preset_mode;
|
||||
this._selectedPercentage = this.stateObj?.attributes.percentage
|
||||
? Math.round(this.stateObj.attributes.percentage)
|
||||
: undefined;
|
||||
}
|
||||
}
|
||||
|
||||
private get _stateOverride() {
|
||||
const liveValue = this._liveSpeed;
|
||||
|
||||
const forcedState =
|
||||
this._liveSpeed != null ? (this._liveSpeed ? "on" : "off") : undefined;
|
||||
|
||||
const stateDisplay = computeStateDisplay(
|
||||
this.hass.localize,
|
||||
this.stateObj!,
|
||||
this.hass.locale,
|
||||
this.hass.entities,
|
||||
forcedState
|
||||
);
|
||||
|
||||
const positionStateDisplay = computeFanSpeedStateDisplay(
|
||||
this.stateObj!,
|
||||
this.hass.locale,
|
||||
liveValue
|
||||
);
|
||||
|
||||
if (positionStateDisplay) {
|
||||
return positionStateDisplay;
|
||||
}
|
||||
return stateDisplay;
|
||||
}
|
||||
|
||||
protected render() {
|
||||
if (!this.hass || !this.stateObj) {
|
||||
return nothing;
|
||||
@ -140,17 +168,11 @@ class MoreInfoFan extends LitElement {
|
||||
supportsSpeed &&
|
||||
computeFanSpeedCount(this.stateObj) > FAN_SPEED_COUNT_MAX_FOR_BUTTONS;
|
||||
|
||||
const stateOverride = this._selectedPercentage
|
||||
? `${Math.round(this._selectedPercentage)}${blankBeforePercent(
|
||||
this.hass!.locale
|
||||
)}%`
|
||||
: undefined;
|
||||
|
||||
return html`
|
||||
<ha-more-info-state-header
|
||||
.hass=${this.hass}
|
||||
.stateObj=${this.stateObj}
|
||||
.stateOverride=${stateOverride}
|
||||
.stateOverride=${this._stateOverride}
|
||||
></ha-more-info-state-header>
|
||||
<div class="controls">
|
||||
${
|
||||
@ -159,7 +181,8 @@ class MoreInfoFan extends LitElement {
|
||||
<ha-more-info-fan-speed
|
||||
.stateObj=${this.stateObj}
|
||||
.hass=${this.hass}
|
||||
@slider-moved=${this._percentageChanged}
|
||||
@slider-moved=${this._speedSliderMoved}
|
||||
@value-changed=${this._speedValueChanged}
|
||||
>
|
||||
</ha-more-info-fan-speed>
|
||||
`
|
||||
|
@ -1,8 +1,6 @@
|
||||
<meta name='viewport' content='width=device-width, user-scalable=no, viewport-fit=cover, initial-scale=1'>
|
||||
<style>
|
||||
html {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: Roboto, sans-serif;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
|
@ -65,7 +65,7 @@ class HassErrorScreen extends LitElement {
|
||||
align-items: center;
|
||||
font-size: 20px;
|
||||
height: var(--header-height);
|
||||
padding: 0 16px;
|
||||
padding: 8px 12px;
|
||||
pointer-events: none;
|
||||
background-color: var(--app-header-background-color);
|
||||
font-weight: 400;
|
||||
@ -73,6 +73,11 @@ class HassErrorScreen extends LitElement {
|
||||
border-bottom: var(--app-header-border-bottom, none);
|
||||
box-sizing: border-box;
|
||||
}
|
||||
@media (max-width: 599px) {
|
||||
.toolbar {
|
||||
padding: 4px;
|
||||
}
|
||||
}
|
||||
ha-icon-button-arrow-prev {
|
||||
pointer-events: auto;
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ class HassLoadingScreen extends LitElement {
|
||||
align-items: center;
|
||||
font-size: 20px;
|
||||
height: var(--header-height);
|
||||
padding: 0 16px;
|
||||
padding: 8px 12px;
|
||||
pointer-events: none;
|
||||
background-color: var(--app-header-background-color);
|
||||
font-weight: 400;
|
||||
@ -68,6 +68,11 @@ class HassLoadingScreen extends LitElement {
|
||||
border-bottom: var(--app-header-border-bottom, none);
|
||||
box-sizing: border-box;
|
||||
}
|
||||
@media (max-width: 599px) {
|
||||
.toolbar {
|
||||
padding: 4px;
|
||||
}
|
||||
}
|
||||
ha-menu-button,
|
||||
ha-icon-button-arrow-prev {
|
||||
pointer-events: auto;
|
||||
|
@ -111,7 +111,7 @@ class HassSubpage extends LitElement {
|
||||
align-items: center;
|
||||
font-size: 20px;
|
||||
height: var(--header-height);
|
||||
padding: 0 16px;
|
||||
padding: 8px 12px;
|
||||
pointer-events: none;
|
||||
background-color: var(--app-header-background-color);
|
||||
font-weight: 400;
|
||||
@ -119,6 +119,11 @@ class HassSubpage extends LitElement {
|
||||
border-bottom: var(--app-header-border-bottom, none);
|
||||
box-sizing: border-box;
|
||||
}
|
||||
@media (max-width: 599px) {
|
||||
.toolbar {
|
||||
padding: 4px;
|
||||
}
|
||||
}
|
||||
.toolbar a {
|
||||
color: var(--sidebar-text-color);
|
||||
text-decoration: none;
|
||||
|
@ -323,7 +323,6 @@ export class HaTabsSubpageDataTable extends LitElement {
|
||||
--text-field-overflow: initial;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin-right: 8px;
|
||||
color: var(--primary-text-color);
|
||||
}
|
||||
.active-filters {
|
||||
|
@ -235,9 +235,14 @@ class HassTabsSubpage extends LitElement {
|
||||
background-color: var(--sidebar-background-color);
|
||||
font-weight: 400;
|
||||
border-bottom: 1px solid var(--divider-color);
|
||||
padding: 0 16px;
|
||||
padding: 8px 12px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
@media (max-width: 599px) {
|
||||
.toolbar {
|
||||
padding: 4px;
|
||||
}
|
||||
}
|
||||
.toolbar a {
|
||||
color: var(--sidebar-text-color);
|
||||
text-decoration: none;
|
||||
|
@ -142,10 +142,12 @@ export class HomeAssistantMain extends LitElement {
|
||||
protected updated(changedProps: PropertyValues) {
|
||||
super.updated(changedProps);
|
||||
|
||||
toggleAttribute(this, "expanded", this.hass.dockedSidebar === "docked");
|
||||
|
||||
toggleAttribute(
|
||||
this,
|
||||
"expanded",
|
||||
this.narrow || this.hass.dockedSidebar !== "auto"
|
||||
"modal",
|
||||
this._sidebarNarrow || this._externalSidebar
|
||||
);
|
||||
}
|
||||
|
||||
@ -165,20 +167,20 @@ export class HomeAssistantMain extends LitElement {
|
||||
/* remove the grey tap highlights in iOS on the fullscreen touch targets */
|
||||
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
||||
--mdc-drawer-width: 56px;
|
||||
--mdc-top-app-bar-width: calc(100% - var(--mdc-drawer-width));
|
||||
}
|
||||
:host([expanded]) {
|
||||
--mdc-drawer-width: calc(256px + env(safe-area-inset-left));
|
||||
}
|
||||
:host([modal]) {
|
||||
--mdc-drawer-width: unset;
|
||||
--mdc-top-app-bar-width: unset;
|
||||
}
|
||||
partial-panel-resolver,
|
||||
ha-sidebar {
|
||||
/* allow a light tap highlight on the actual interface elements */
|
||||
-webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
@media (min-width: 870px) {
|
||||
partial-panel-resolver {
|
||||
--mdc-top-app-bar-width: calc(100% - var(--mdc-drawer-width));
|
||||
}
|
||||
}
|
||||
`;
|
||||
}
|
||||
}
|
||||
|
@ -511,7 +511,7 @@ export class HaAutomationTrace extends LitElement {
|
||||
justify-content: center;
|
||||
font-size: 20px;
|
||||
height: var(--header-height);
|
||||
padding: 0 16px;
|
||||
padding: 4px;
|
||||
background-color: var(--primary-background-color);
|
||||
font-weight: 400;
|
||||
color: var(--app-header-text-color, white);
|
||||
|
@ -376,7 +376,7 @@ class HaConfigIntegrations extends SubscribeMixin(LitElement) {
|
||||
);
|
||||
|
||||
const filterMenu = html`
|
||||
<div slot=${ifDefined(this.narrow ? "toolbar-icon" : "suffix")}>
|
||||
<div slot=${ifDefined(this.narrow ? "toolbar-icon" : undefined)}>
|
||||
<div class="menu-badge-container">
|
||||
${!this._showDisabled && this.narrow && disabledCount
|
||||
? html`<span class="badge">${disabledCount}</span>`
|
||||
@ -455,24 +455,25 @@ class HaConfigIntegrations extends SubscribeMixin(LitElement) {
|
||||
)}
|
||||
>
|
||||
${!this._showDisabled && disabledCount
|
||||
? html`<div
|
||||
class="active-filters"
|
||||
slot="suffix"
|
||||
@click=${this._preventDefault}
|
||||
>
|
||||
${this.hass.localize(
|
||||
"ui.panel.config.integrations.disable.disabled_integrations",
|
||||
{ number: disabledCount }
|
||||
)}
|
||||
<mwc-button
|
||||
@click=${this._toggleShowDisabled}
|
||||
.label=${this.hass.localize(
|
||||
"ui.panel.config.integrations.disable.show"
|
||||
? html`<div class="filters" slot="suffix">
|
||||
<div
|
||||
class="active-filters"
|
||||
@click=${this._preventDefault}
|
||||
>
|
||||
${this.hass.localize(
|
||||
"ui.panel.config.integrations.disable.disabled_integrations",
|
||||
{ number: disabledCount }
|
||||
)}
|
||||
></mwc-button>
|
||||
<mwc-button
|
||||
@click=${this._toggleShowDisabled}
|
||||
.label=${this.hass.localize(
|
||||
"ui.panel.config.integrations.disable.show"
|
||||
)}
|
||||
></mwc-button>
|
||||
</div>
|
||||
${filterMenu}
|
||||
</div>`
|
||||
: ""}
|
||||
${filterMenu}
|
||||
</search-input>
|
||||
</div>
|
||||
`}
|
||||
@ -845,7 +846,6 @@ class HaConfigIntegrations extends SubscribeMixin(LitElement) {
|
||||
.container > * {
|
||||
max-width: 500px;
|
||||
}
|
||||
|
||||
.empty-message {
|
||||
margin: auto;
|
||||
text-align: center;
|
||||
@ -884,6 +884,15 @@ class HaConfigIntegrations extends SubscribeMixin(LitElement) {
|
||||
right: 0;
|
||||
left: 0;
|
||||
}
|
||||
.filters {
|
||||
--mdc-text-field-fill-color: var(--input-fill-color);
|
||||
--mdc-text-field-idle-line-color: var(--input-idle-line-color);
|
||||
--mdc-shape-small: 4px;
|
||||
--text-field-overflow: initial;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
color: var(--primary-text-color);
|
||||
}
|
||||
.active-filters {
|
||||
color: var(--primary-text-color);
|
||||
position: relative;
|
||||
|
@ -108,10 +108,15 @@ class PanelDeveloperTools extends LitElement {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 20px;
|
||||
padding: 0 16px;
|
||||
padding: 8px 12px;
|
||||
font-weight: 400;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
@media (max-width: 599px) {
|
||||
.toolbar {
|
||||
padding: 4px;
|
||||
}
|
||||
}
|
||||
.main-title {
|
||||
margin: 0 0 0 24px;
|
||||
line-height: 20px;
|
||||
|
@ -157,6 +157,9 @@ export class HuiEnergyGasGraphCard
|
||||
const options: ChartOptions = {
|
||||
parsing: false,
|
||||
animation: false,
|
||||
interaction: {
|
||||
mode: "x",
|
||||
},
|
||||
scales: {
|
||||
x: {
|
||||
type: "time",
|
||||
@ -171,9 +174,6 @@ export class HuiEnergyGasGraphCard
|
||||
maxRotation: 0,
|
||||
sampleSize: 5,
|
||||
autoSkipPadding: 20,
|
||||
major: {
|
||||
enabled: true,
|
||||
},
|
||||
font: (context) =>
|
||||
context.tick && context.tick.major
|
||||
? ({ weight: "bold" } as any)
|
||||
@ -213,7 +213,7 @@ export class HuiEnergyGasGraphCard
|
||||
},
|
||||
plugins: {
|
||||
tooltip: {
|
||||
mode: "nearest",
|
||||
position: "nearest",
|
||||
callbacks: {
|
||||
title: (datasets) => {
|
||||
if (dayDifference > 0) {
|
||||
@ -244,13 +244,10 @@ export class HuiEnergyGasGraphCard
|
||||
},
|
||||
},
|
||||
},
|
||||
hover: {
|
||||
mode: "nearest",
|
||||
},
|
||||
elements: {
|
||||
bar: { borderWidth: 1.5, borderRadius: 4 },
|
||||
point: {
|
||||
hitRadius: 5,
|
||||
hitRadius: 50,
|
||||
},
|
||||
},
|
||||
// @ts-expect-error
|
||||
|
@ -154,6 +154,9 @@ export class HuiEnergySolarGraphCard
|
||||
const options: ChartOptions = {
|
||||
parsing: false,
|
||||
animation: false,
|
||||
interaction: {
|
||||
mode: "x",
|
||||
},
|
||||
scales: {
|
||||
x: {
|
||||
type: "time",
|
||||
@ -168,9 +171,6 @@ export class HuiEnergySolarGraphCard
|
||||
maxRotation: 0,
|
||||
sampleSize: 5,
|
||||
autoSkipPadding: 20,
|
||||
major: {
|
||||
enabled: true,
|
||||
},
|
||||
font: (context) =>
|
||||
context.tick && context.tick.major
|
||||
? ({ weight: "bold" } as any)
|
||||
@ -209,7 +209,7 @@ export class HuiEnergySolarGraphCard
|
||||
},
|
||||
plugins: {
|
||||
tooltip: {
|
||||
mode: "nearest",
|
||||
position: "nearest",
|
||||
callbacks: {
|
||||
title: (datasets) => {
|
||||
if (dayDifference > 0) {
|
||||
@ -240,9 +240,6 @@ export class HuiEnergySolarGraphCard
|
||||
},
|
||||
},
|
||||
},
|
||||
hover: {
|
||||
mode: "nearest",
|
||||
},
|
||||
elements: {
|
||||
line: {
|
||||
tension: 0.3,
|
||||
|
@ -148,6 +148,9 @@ export class HuiEnergyUsageGraphCard
|
||||
const options: ChartOptions = {
|
||||
parsing: false,
|
||||
animation: false,
|
||||
interaction: {
|
||||
mode: "x",
|
||||
},
|
||||
scales: {
|
||||
x: {
|
||||
type: "time",
|
||||
@ -162,9 +165,6 @@ export class HuiEnergyUsageGraphCard
|
||||
maxRotation: 0,
|
||||
sampleSize: 5,
|
||||
autoSkipPadding: 20,
|
||||
major: {
|
||||
enabled: true,
|
||||
},
|
||||
font: (context) =>
|
||||
context.tick && context.tick.major
|
||||
? ({ weight: "bold" } as any)
|
||||
@ -204,8 +204,6 @@ export class HuiEnergyUsageGraphCard
|
||||
},
|
||||
plugins: {
|
||||
tooltip: {
|
||||
mode: "x",
|
||||
intersect: true,
|
||||
position: "nearest",
|
||||
filter: (val) => val.formattedValue !== "0",
|
||||
callbacks: {
|
||||
@ -265,13 +263,10 @@ export class HuiEnergyUsageGraphCard
|
||||
},
|
||||
},
|
||||
},
|
||||
hover: {
|
||||
mode: "nearest",
|
||||
},
|
||||
elements: {
|
||||
bar: { borderWidth: 1.5, borderRadius: 4 },
|
||||
point: {
|
||||
hitRadius: 5,
|
||||
hitRadius: 50,
|
||||
},
|
||||
},
|
||||
// @ts-expect-error
|
||||
|
@ -157,6 +157,9 @@ export class HuiEnergyWaterGraphCard
|
||||
const options: ChartOptions = {
|
||||
parsing: false,
|
||||
animation: false,
|
||||
interaction: {
|
||||
mode: "x",
|
||||
},
|
||||
scales: {
|
||||
x: {
|
||||
type: "time",
|
||||
@ -171,9 +174,6 @@ export class HuiEnergyWaterGraphCard
|
||||
maxRotation: 0,
|
||||
sampleSize: 5,
|
||||
autoSkipPadding: 20,
|
||||
major: {
|
||||
enabled: true,
|
||||
},
|
||||
font: (context) =>
|
||||
context.tick && context.tick.major
|
||||
? ({ weight: "bold" } as any)
|
||||
@ -213,7 +213,7 @@ export class HuiEnergyWaterGraphCard
|
||||
},
|
||||
plugins: {
|
||||
tooltip: {
|
||||
mode: "nearest",
|
||||
position: "nearest",
|
||||
callbacks: {
|
||||
title: (datasets) => {
|
||||
if (dayDifference > 0) {
|
||||
@ -244,13 +244,10 @@ export class HuiEnergyWaterGraphCard
|
||||
},
|
||||
},
|
||||
},
|
||||
hover: {
|
||||
mode: "nearest",
|
||||
},
|
||||
elements: {
|
||||
bar: { borderWidth: 1.5, borderRadius: 4 },
|
||||
point: {
|
||||
hitRadius: 5,
|
||||
hitRadius: 50,
|
||||
},
|
||||
},
|
||||
// @ts-expect-error
|
||||
|
@ -36,9 +36,12 @@ import "../../../components/tile/ha-tile-icon";
|
||||
import "../../../components/tile/ha-tile-image";
|
||||
import "../../../components/tile/ha-tile-info";
|
||||
import { cameraUrlWithWidthHeight } from "../../../data/camera";
|
||||
import { CoverEntity } from "../../../data/cover";
|
||||
import { isUnavailableState, ON } from "../../../data/entity";
|
||||
import { FanEntity } from "../../../data/fan";
|
||||
import {
|
||||
computeCoverPositionStateDisplay,
|
||||
CoverEntity,
|
||||
} from "../../../data/cover";
|
||||
import { isUnavailableState } from "../../../data/entity";
|
||||
import { computeFanSpeedStateDisplay, FanEntity } from "../../../data/fan";
|
||||
import { LightEntity } from "../../../data/light";
|
||||
import { ActionHandlerEvent } from "../../../data/lovelace";
|
||||
import { SENSOR_DEVICE_CLASS_TIMESTAMP } from "../../../data/sensor";
|
||||
@ -202,7 +205,7 @@ export class HuiTileCard extends LitElement implements LovelaceCard {
|
||||
`;
|
||||
}
|
||||
|
||||
if (domain === "light" && stateObj.state === ON) {
|
||||
if (domain === "light" && stateActive(stateObj)) {
|
||||
const brightness = (stateObj as LightEntity).attributes.brightness;
|
||||
if (brightness) {
|
||||
return `${Math.round((brightness * 100) / 255)}${blankBeforePercent(
|
||||
@ -211,10 +214,13 @@ export class HuiTileCard extends LitElement implements LovelaceCard {
|
||||
}
|
||||
}
|
||||
|
||||
if (domain === "fan" && stateObj.state === ON) {
|
||||
const speed = (stateObj as FanEntity).attributes.percentage;
|
||||
if (speed) {
|
||||
return `${Math.round(speed)}${blankBeforePercent(this.hass!.locale)}%`;
|
||||
if (domain === "fan" && stateActive(stateObj)) {
|
||||
const speedStateDisplay = computeFanSpeedStateDisplay(
|
||||
stateObj as FanEntity,
|
||||
this.hass!.locale
|
||||
);
|
||||
if (speedStateDisplay) {
|
||||
return speedStateDisplay;
|
||||
}
|
||||
}
|
||||
|
||||
@ -225,15 +231,14 @@ export class HuiTileCard extends LitElement implements LovelaceCard {
|
||||
this.hass!.entities
|
||||
);
|
||||
|
||||
if (
|
||||
domain === "cover" &&
|
||||
["open", "opening", "closing"].includes(stateObj.state)
|
||||
) {
|
||||
const position = (stateObj as CoverEntity).attributes.current_position;
|
||||
if (position && position !== 100) {
|
||||
return `${stateDisplay} - ${Math.round(position)}${blankBeforePercent(
|
||||
this.hass!.locale
|
||||
)}%`;
|
||||
if (domain === "cover" && stateActive(stateObj)) {
|
||||
const positionStateDisplay = computeCoverPositionStateDisplay(
|
||||
stateObj as CoverEntity,
|
||||
this.hass!.locale
|
||||
);
|
||||
|
||||
if (positionStateDisplay) {
|
||||
return `${stateDisplay} ⸱ ${positionStateDisplay}`;
|
||||
}
|
||||
}
|
||||
return stateDisplay;
|
||||
|
@ -63,7 +63,7 @@ class ActionHandler extends HTMLElement implements ActionHandler {
|
||||
|
||||
public connectedCallback() {
|
||||
Object.assign(this.style, {
|
||||
position: "absolute",
|
||||
position: "fixed",
|
||||
width: isTouch ? "100px" : "50px",
|
||||
height: isTouch ? "100px" : "50px",
|
||||
transform: "translate(-50%, -50%)",
|
||||
@ -147,11 +147,11 @@ class ActionHandler extends HTMLElement implements ActionHandler {
|
||||
let x;
|
||||
let y;
|
||||
if ((ev as TouchEvent).touches) {
|
||||
x = (ev as TouchEvent).touches[0].pageX;
|
||||
y = (ev as TouchEvent).touches[0].pageY;
|
||||
x = (ev as TouchEvent).touches[0].clientX;
|
||||
y = (ev as TouchEvent).touches[0].clientY;
|
||||
} else {
|
||||
x = (ev as MouseEvent).pageX;
|
||||
y = (ev as MouseEvent).pageY;
|
||||
x = (ev as MouseEvent).clientX;
|
||||
y = (ev as MouseEvent).clientY;
|
||||
}
|
||||
|
||||
if (options.hasHold) {
|
||||
|
@ -164,7 +164,7 @@ export class HuiCreateDialogCard
|
||||
ha-dialog {
|
||||
--mdc-dialog-max-width: 845px;
|
||||
--dialog-content-padding: 2px 24px 20px 24px;
|
||||
--dialog-z-index: 5;
|
||||
--dialog-z-index: 6;
|
||||
}
|
||||
|
||||
ha-dialog.table {
|
||||
|
@ -394,7 +394,7 @@ export class HuiDialogEditCard
|
||||
|
||||
ha-dialog {
|
||||
--mdc-dialog-max-width: 845px;
|
||||
--dialog-z-index: 5;
|
||||
--dialog-z-index: 6;
|
||||
}
|
||||
|
||||
@media all and (min-width: 451px) and (min-height: 501px) {
|
||||
|
@ -143,7 +143,7 @@ export class HuiDialogSuggestCard extends LitElement {
|
||||
}
|
||||
ha-dialog {
|
||||
max-width: 845px;
|
||||
--dialog-z-index: 5;
|
||||
--dialog-z-index: 6;
|
||||
}
|
||||
.hidden {
|
||||
display: none;
|
||||
|
@ -145,7 +145,7 @@ export class HuiCreateDialogHeaderFooter
|
||||
ha-dialog {
|
||||
--mdc-dialog-max-width: 550px;
|
||||
--dialog-content-padding: 2px 24px 20px 24px;
|
||||
--dialog-z-index: 5;
|
||||
--dialog-z-index: 6;
|
||||
}
|
||||
|
||||
.elements {
|
||||
|
@ -26,7 +26,13 @@ import {
|
||||
PropertyValues,
|
||||
TemplateResult,
|
||||
} from "lit";
|
||||
import { customElement, property, query, state } from "lit/decorators";
|
||||
import {
|
||||
customElement,
|
||||
eventOptions,
|
||||
property,
|
||||
query,
|
||||
state,
|
||||
} from "lit/decorators";
|
||||
import { classMap } from "lit/directives/class-map";
|
||||
import { ifDefined } from "lit/directives/if-defined";
|
||||
import memoizeOne from "memoize-one";
|
||||
@ -116,9 +122,9 @@ class HUIRoot extends LitElement {
|
||||
|
||||
return html`
|
||||
<div
|
||||
class=" ${classMap({
|
||||
class=${classMap({
|
||||
"edit-mode": this._editMode,
|
||||
})}"
|
||||
})}
|
||||
>
|
||||
<div class="header">
|
||||
<div class="toolbar">
|
||||
@ -547,11 +553,20 @@ class HUIRoot extends LitElement {
|
||||
`
|
||||
: ""}
|
||||
</div>
|
||||
<div id="view" @ll-rebuild=${this._debouncedConfigChanged}></div>
|
||||
<div
|
||||
id="view"
|
||||
@ll-rebuild=${this._debouncedConfigChanged}
|
||||
@scroll=${this._viewScrolled}
|
||||
></div>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
|
||||
@eventOptions({ passive: true })
|
||||
private _viewScrolled(ev) {
|
||||
this.toggleAttribute("scrolled", ev.currentTarget.scrollTop !== 0);
|
||||
}
|
||||
|
||||
private _isVisible = (view: LovelaceViewConfig) =>
|
||||
Boolean(
|
||||
this._editMode ||
|
||||
@ -947,6 +962,10 @@ class HUIRoot extends LitElement {
|
||||
top: 0;
|
||||
width: var(--mdc-top-app-bar-width, 100%);
|
||||
z-index: 2;
|
||||
transition: box-shadow 0.3s ease-out;
|
||||
}
|
||||
:host([scrolled]) .header {
|
||||
box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.75);
|
||||
}
|
||||
.edit-mode .header {
|
||||
background-color: var(--app-header-edit-background-color, #455a64);
|
||||
@ -957,10 +976,15 @@ class HUIRoot extends LitElement {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 20px;
|
||||
padding: 0 16px;
|
||||
padding: 0px 12px;
|
||||
font-weight: 400;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
@media (max-width: 599px) {
|
||||
.toolbar {
|
||||
padding: 0 4px;
|
||||
}
|
||||
}
|
||||
.main-title {
|
||||
margin: 0 0 0 24px;
|
||||
line-height: 20px;
|
||||
@ -1025,14 +1049,10 @@ class HUIRoot extends LitElement {
|
||||
100vh - var(--header-height) - env(safe-area-inset-top) -
|
||||
env(safe-area-inset-bottom)
|
||||
);
|
||||
/**
|
||||
* Since we only set min-height, if child nodes need percentage
|
||||
* heights they must use absolute positioning so we need relative
|
||||
* positioning here.
|
||||
*
|
||||
* https://www.w3.org/TR/CSS2/visudet.html#the-height-property
|
||||
*/
|
||||
position: relative;
|
||||
background: var(
|
||||
--lovelace-background,
|
||||
var(--primary-background-color)
|
||||
);
|
||||
display: flex;
|
||||
overflow: auto;
|
||||
}
|
||||
@ -1064,12 +1084,6 @@ class HUIRoot extends LitElement {
|
||||
.menu-link {
|
||||
text-decoration: none;
|
||||
}
|
||||
hui-view {
|
||||
background: var(
|
||||
--lovelace-background,
|
||||
var(--primary-background-color)
|
||||
);
|
||||
}
|
||||
.exit-edit-mode {
|
||||
--mdc-theme-primary: var(--app-header-edit-text-color, #fff);
|
||||
--mdc-button-outline-color: var(--app-header-edit-text-color, #fff);
|
||||
|
@ -1,7 +1,8 @@
|
||||
const { createAppConfig } = require("../build-scripts/webpack.js");
|
||||
import webpack from "../build-scripts/webpack.cjs";
|
||||
|
||||
module.exports = createAppConfig({
|
||||
export default webpack.createAppConfig({
|
||||
isProdBuild: false,
|
||||
latestBuild: true,
|
||||
isStatsBuild: false,
|
||||
isTestBuild: true,
|
||||
});
|
||||
|
@ -1,20 +1,26 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es2017",
|
||||
"module": "esnext",
|
||||
// Language Options
|
||||
"target": "ES2017",
|
||||
"lib": ["ES2017", "DOM", "DOM.Iterable", "WebWorker"],
|
||||
"experimentalDecorators": true,
|
||||
// Modules
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "node",
|
||||
"lib": ["es2017", "dom", "dom.iterable", "WebWorker"],
|
||||
"resolveJsonModule": true,
|
||||
// Babel handles transpiling and no need for declaration files
|
||||
"noEmit": true,
|
||||
// Type checking options
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"noImplicitReturns": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"strict": true,
|
||||
"noImplicitAny": false,
|
||||
// Do not check type declaration files
|
||||
"skipLibCheck": true,
|
||||
"resolveJsonModule": true,
|
||||
"experimentalDecorators": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
// Interop with CommonJS and other tools
|
||||
"esModuleInterop": true,
|
||||
"plugins": [
|
||||
{
|
||||
"name": "ts-lit-plugin",
|
||||
|
@ -1,7 +1,6 @@
|
||||
const cors = require("@koa/cors");
|
||||
const { rollupAdapter } = require("@web/dev-server-rollup");
|
||||
|
||||
const rollup = require("./build-scripts/rollup");
|
||||
import cors from "@koa/cors";
|
||||
import { rollupAdapter } from "@web/dev-server-rollup";
|
||||
import rollup from "./build-scripts/rollup.cjs";
|
||||
|
||||
const rollupWDSPlugins = rollup
|
||||
.createAppConfig({
|
||||
@ -13,7 +12,7 @@ const rollupWDSPlugins = rollup
|
||||
);
|
||||
|
||||
/** @type import("@web/dev-server/src/config/DevServerConfig.ts") */
|
||||
module.exports = {
|
||||
export default {
|
||||
mimeTypes: {
|
||||
"**/*.ts": "js",
|
||||
"**/*.json": "js",
|
||||
|
28
webpack.config.cjs
Normal file
28
webpack.config.cjs
Normal file
@ -0,0 +1,28 @@
|
||||
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||
// Needs to remain CommonJS until eslint-import-resolver-webpack supports ES modules
|
||||
const webpack = require("./build-scripts/webpack.cjs");
|
||||
const env = require("./build-scripts/env.cjs");
|
||||
|
||||
// This file exists because we haven't migrated the stats script yet
|
||||
|
||||
const configs = [
|
||||
webpack.createAppConfig({
|
||||
isProdBuild: env.isProdBuild(),
|
||||
isStatsBuild: env.isStatsBuild(),
|
||||
isTestBuild: env.isTestBuild(),
|
||||
latestBuild: true,
|
||||
}),
|
||||
];
|
||||
|
||||
if (env.isProdBuild() && !env.isStatsBuild()) {
|
||||
configs.push(
|
||||
webpack.createAppConfig({
|
||||
isProdBuild: env.isProdBuild(),
|
||||
isStatsBuild: env.isStatsBuild(),
|
||||
isTestBuild: env.isTestBuild(),
|
||||
latestBuild: false,
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
module.exports = configs;
|
@ -1,33 +0,0 @@
|
||||
/* eslint-disable import/extensions */
|
||||
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||
|
||||
const { createAppConfig } = require("./build-scripts/webpack.js");
|
||||
const {
|
||||
isProdBuild,
|
||||
isStatsBuild,
|
||||
isTestBuild,
|
||||
} = require("./build-scripts/env.js");
|
||||
|
||||
// This file exists because we haven't migrated the stats script yet
|
||||
|
||||
const configs = [
|
||||
createAppConfig({
|
||||
isProdBuild: isProdBuild(),
|
||||
isStatsBuild: isStatsBuild(),
|
||||
isTestBuild: isTestBuild(),
|
||||
latestBuild: true,
|
||||
}),
|
||||
];
|
||||
// const configs = [createConfig(isProdBuild, /* latestBuild */ true)];
|
||||
if (isProdBuild && !isStatsBuild) {
|
||||
configs.push(
|
||||
createAppConfig({
|
||||
isProdBuild: isProdBuild(),
|
||||
isStatsBuild: isStatsBuild(),
|
||||
isTestBuild: isTestBuild(),
|
||||
latestBuild: false,
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
module.exports = configs;
|
28
yarn.lock
28
yarn.lock
@ -3897,14 +3897,14 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@sinonjs/samsam@npm:^7.0.1":
|
||||
version: 7.0.1
|
||||
resolution: "@sinonjs/samsam@npm:7.0.1"
|
||||
"@sinonjs/samsam@npm:^8.0.0":
|
||||
version: 8.0.0
|
||||
resolution: "@sinonjs/samsam@npm:8.0.0"
|
||||
dependencies:
|
||||
"@sinonjs/commons": ^2.0.0
|
||||
lodash.get: ^4.4.2
|
||||
type-detect: ^4.0.8
|
||||
checksum: 291efb158d54c67dee23ddabcb28873d22063449b692aaa3b2a4f1826d2f79d38695574063c92e9c17573cc805cd6acbf0ab0c66c9f3aed7afd0f12a2b905615
|
||||
checksum: 95e40d0bb9f7288e27c379bee1b03c3dc51e7e78b9d5ea6aef66a690da7e81efc4715145b561b449cefc5361a171791e3ce30fb1a46ab247d4c0766024c60a60
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@ -9571,7 +9571,6 @@ __metadata:
|
||||
qr-scanner: 1.4.2
|
||||
qrcode: 1.5.1
|
||||
regenerator-runtime: 0.13.11
|
||||
require-dir: 1.2.0
|
||||
resize-observer-polyfill: 1.5.1
|
||||
roboto-fontface: 0.10.0
|
||||
rollup: 2.79.1
|
||||
@ -9580,7 +9579,7 @@ __metadata:
|
||||
rollup-plugin-visualizer: 5.9.0
|
||||
rrule: 2.7.2
|
||||
serve-handler: 6.1.5
|
||||
sinon: 15.0.2
|
||||
sinon: 15.0.3
|
||||
sortablejs: 1.15.0
|
||||
source-map-url: 0.4.1
|
||||
superstruct: 1.0.3
|
||||
@ -13443,13 +13442,6 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"require-dir@npm:1.2.0":
|
||||
version: 1.2.0
|
||||
resolution: "require-dir@npm:1.2.0"
|
||||
checksum: 8bbc4757d7e3fae0799e24cb363f165a89e0cc83172de9d5fd95f8e75cf2368764199e5fd557434d6318ab1f271415cc9d3ef190076393e6e993a7b1add8ef27
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"require-directory@npm:^2.1.1":
|
||||
version: 2.1.1
|
||||
resolution: "require-directory@npm:2.1.1"
|
||||
@ -14052,17 +14044,17 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"sinon@npm:15.0.2":
|
||||
version: 15.0.2
|
||||
resolution: "sinon@npm:15.0.2"
|
||||
"sinon@npm:15.0.3":
|
||||
version: 15.0.3
|
||||
resolution: "sinon@npm:15.0.3"
|
||||
dependencies:
|
||||
"@sinonjs/commons": ^3.0.0
|
||||
"@sinonjs/fake-timers": ^10.0.2
|
||||
"@sinonjs/samsam": ^7.0.1
|
||||
"@sinonjs/samsam": ^8.0.0
|
||||
diff: ^5.1.0
|
||||
nise: ^5.1.4
|
||||
supports-color: ^7.2.0
|
||||
checksum: 98eb555442db3985d7fe0d90e23f081f3df71adffa0a50b049bcd2abbf5c2d71a43aeaa1e3c02500164cff5233d2f102f777356ebe8bfc257cb7059c1b2778b0
|
||||
checksum: fb9401e44215c7a7904d2df3032c56369cb4f2fd9c708460e1b980c6032de8e13bd8c4d90039074f9383e5219702a5e0755b7bea94bd4c090b8c1e583f137c3d
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user