Skip to content

Commit

Permalink
Merge branch 'dev' into flat-config
Browse files Browse the repository at this point in the history
  • Loading branch information
silamon committed Nov 18, 2024
2 parents e763323 + ced70fd commit ef79ff0
Show file tree
Hide file tree
Showing 118 changed files with 3,668 additions and 2,016 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
script/release
- name: Upload release assets
uses: softprops/action-gh-release@v2.0.9
uses: softprops/action-gh-release@v2.1.0
with:
files: |
dist/*.whl
Expand All @@ -74,7 +74,7 @@ jobs:
echo "home-assistant-frontend==$version" > ./requirements.txt
- name: Build wheels
uses: home-assistant/wheels@2024.07.1
uses: home-assistant/wheels@2024.11.0
with:
abi: cp312
tag: musllinux_1_2
Expand Down
2 changes: 1 addition & 1 deletion build-scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The Home Assistant build pipeline contains various steps to prepare a build.

Currently in Home Assistant we use a bundler to convert TypeScript, CSS and JSON files to JavaScript files that the browser understands.

We currently rely on Webpack but also have experimental Rollup support. Both of these programs bundle the converted files in both production and development.
We currently rely on Webpack. Both of these programs bundle the converted files in both production and development.

For development, bundling is optional. We just want to get the right files in the browser.

Expand Down
13 changes: 6 additions & 7 deletions build-scripts/bundle.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -226,13 +226,12 @@ module.exports.config = {
return {
name: "frontend" + nameSuffix(latestBuild),
entry: {
"service-worker":
!env.useRollup() && !latestBuild
? {
import: "./src/entrypoints/service-worker.ts",
layer: "sw",
}
: "./src/entrypoints/service-worker.ts",
"service-worker": !latestBuild
? {
import: "./src/entrypoints/service-worker.ts",
layer: "sw",
}
: "./src/entrypoints/service-worker.ts",
app: "./src/entrypoints/app.ts",
authorize: "./src/entrypoints/authorize.ts",
onboarding: "./src/entrypoints/onboarding.ts",
Expand Down
3 changes: 0 additions & 3 deletions build-scripts/env.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ const path = require("path");
const paths = require("./paths.cjs");

module.exports = {
useRollup() {
return process.env.ROLLUP === "1";
},
useWDS() {
return process.env.WDS === "1";
},
Expand Down
9 changes: 2 additions & 7 deletions build-scripts/gulp/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import "./entry-html.js";
import "./gather-static.js";
import "./gen-icons-json.js";
import "./locale-data.js";
import "./rollup.js";
import "./service-worker.js";
import "./translations.js";
import "./wds.js";
Expand All @@ -27,11 +26,7 @@ gulp.task(
"build-locale-data"
),
"copy-static-app",
env.useWDS()
? "wds-watch-app"
: env.useRollup()
? "rollup-watch-app"
: "webpack-watch-app"
env.useWDS() ? "wds-watch-app" : "webpack-watch-app"
)
);

Expand All @@ -44,7 +39,7 @@ gulp.task(
"clean",
gulp.parallel("gen-icons-json", "build-translations", "build-locale-data"),
"copy-static-app",
env.useRollup() ? "rollup-prod-app" : "webpack-prod-app",
"webpack-prod-app",
gulp.parallel("gen-pages-app-prod", "gen-service-worker-app-prod"),
// Don't compress running tests
...(env.isTestBuild() ? [] : ["compress-app"])
Expand Down
6 changes: 2 additions & 4 deletions build-scripts/gulp/cast.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import gulp from "gulp";
import env from "../env.cjs";
import "./clean.js";
import "./entry-html.js";
import "./gather-static.js";
import "./rollup.js";
import "./service-worker.js";
import "./translations.js";
import "./webpack.js";
Expand All @@ -19,7 +17,7 @@ gulp.task(
gulp.parallel("gen-icons-json", "build-translations", "build-locale-data"),
"copy-static-cast",
"gen-pages-cast-dev",
env.useRollup() ? "rollup-dev-server-cast" : "webpack-dev-server-cast"
"webpack-dev-server-cast"
)
);

Expand All @@ -33,7 +31,7 @@ gulp.task(
"translations-enable-merge-backend",
gulp.parallel("gen-icons-json", "build-translations", "build-locale-data"),
"copy-static-cast",
env.useRollup() ? "rollup-prod-cast" : "webpack-prod-cast",
"webpack-prod-cast",
"gen-pages-cast-prod"
)
);
6 changes: 2 additions & 4 deletions build-scripts/gulp/demo.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import gulp from "gulp";
import env from "../env.cjs";
import "./clean.js";
import "./entry-html.js";
import "./gather-static.js";
import "./gen-icons-json.js";
import "./rollup.js";
import "./service-worker.js";
import "./translations.js";
import "./webpack.js";
Expand All @@ -24,7 +22,7 @@ gulp.task(
"build-locale-data"
),
"copy-static-demo",
env.useRollup() ? "rollup-dev-server-demo" : "webpack-dev-server-demo"
"webpack-dev-server-demo"
)
);

Expand All @@ -39,7 +37,7 @@ gulp.task(
"translations-enable-merge-backend",
gulp.parallel("gen-icons-json", "build-translations", "build-locale-data"),
"copy-static-demo",
env.useRollup() ? "rollup-prod-demo" : "webpack-prod-demo",
"webpack-prod-demo",
"gen-pages-demo-prod"
)
);
1 change: 1 addition & 0 deletions build-scripts/gulp/download-translations.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ gulp.task("fetch-lokalise", async function () {
replace_breaks: false,
json_unescaped_slashes: true,
export_empty_as: "skip",
filter_data: ["verified"],
})
.then((download) => fetch(download.bundle_url))
.then((response) => {
Expand Down
1 change: 0 additions & 1 deletion build-scripts/gulp/entry-html.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ const getCommonTemplateVars = () => {
{ ignorePatch: true, allowHigherVersions: true }
);
return {
useRollup: env.useRollup(),
useWDS: env.useWDS(),
modernRegex: compileRegex(browserRegexes.concat(haMacOSRegex)).toString(),
};
Expand Down
8 changes: 2 additions & 6 deletions build-scripts/gulp/gallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@ import gulp from "gulp";
import yaml from "js-yaml";
import { marked } from "marked";
import path from "path";
import env from "../env.cjs";
import paths from "../paths.cjs";
import "./clean.js";
import "./entry-html.js";
import "./gather-static.js";
import "./gen-icons-json.js";
import "./rollup.js";
import "./service-worker.js";
import "./translations.js";
import "./webpack.js";
Expand Down Expand Up @@ -158,9 +156,7 @@ gulp.task(
"copy-static-gallery",
"gen-pages-gallery-dev",
gulp.parallel(
env.useRollup()
? "rollup-dev-server-gallery"
: "webpack-dev-server-gallery",
"webpack-dev-server-gallery",
async function watchMarkdownFiles() {
gulp.watch(
[
Expand Down Expand Up @@ -189,7 +185,7 @@ gulp.task(
"gather-gallery-pages"
),
"copy-static-gallery",
env.useRollup() ? "rollup-prod-gallery" : "webpack-prod-gallery",
"webpack-prod-gallery",
"gen-pages-gallery-prod"
)
);
4 changes: 0 additions & 4 deletions build-scripts/gulp/gather-static.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import fs from "fs-extra";
import gulp from "gulp";
import path from "path";
import paths from "../paths.cjs";
import env from "../env.cjs";

const npmPath = (...parts) =>
path.resolve(paths.polymer_dir, "node_modules", ...parts);
Expand Down Expand Up @@ -69,9 +68,6 @@ function copyPolyfills(staticDir) {
}

function copyLoaderJS(staticDir) {
if (!env.useRollup()) {
return;
}
const staticPath = genStaticPath(staticDir);
copyFileDir(npmPath("systemjs/dist/s.min.js"), staticPath("js"));
copyFileDir(npmPath("systemjs/dist/s.min.js.map"), staticPath("js"));
Expand Down
5 changes: 2 additions & 3 deletions build-scripts/gulp/hassio.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import "./compress.js";
import "./entry-html.js";
import "./gather-static.js";
import "./gen-icons-json.js";
import "./rollup.js";
import "./translations.js";
import "./webpack.js";

Expand All @@ -22,7 +21,7 @@ gulp.task(
"copy-translations-supervisor",
"build-locale-data",
"copy-static-supervisor",
env.useRollup() ? "rollup-watch-hassio" : "webpack-watch-hassio"
"webpack-watch-hassio"
)
);

Expand All @@ -38,7 +37,7 @@ gulp.task(
"copy-translations-supervisor",
"build-locale-data",
"copy-static-supervisor",
env.useRollup() ? "rollup-prod-hassio" : "webpack-prod-hassio",
"webpack-prod-hassio",
"gen-pages-hassio-prod",
...// Don't compress running tests
(env.isTestBuild() ? [] : ["compress-hassio"])
Expand Down
147 changes: 0 additions & 147 deletions build-scripts/gulp/rollup.js

This file was deleted.

Loading

0 comments on commit ef79ff0

Please sign in to comment.