-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
301 changed files
with
9,985 additions
and
3,811 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,7 @@ jobs: | |
ref: dev | ||
|
||
- name: Setup Node | ||
uses: actions/[email protected].2 | ||
uses: actions/[email protected].3 | ||
with: | ||
node-version-file: ".nvmrc" | ||
cache: yarn | ||
|
@@ -62,7 +62,7 @@ jobs: | |
ref: master | ||
|
||
- name: Setup Node | ||
uses: actions/[email protected].2 | ||
uses: actions/[email protected].3 | ||
with: | ||
node-version-file: ".nvmrc" | ||
cache: yarn | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,7 @@ jobs: | |
- name: Check out files from GitHub | ||
uses: actions/[email protected] | ||
- name: Setup Node | ||
uses: actions/[email protected].2 | ||
uses: actions/[email protected].3 | ||
with: | ||
node-version-file: ".nvmrc" | ||
cache: yarn | ||
|
@@ -60,7 +60,7 @@ jobs: | |
- name: Check out files from GitHub | ||
uses: actions/[email protected] | ||
- name: Setup Node | ||
uses: actions/[email protected].2 | ||
uses: actions/[email protected].3 | ||
with: | ||
node-version-file: ".nvmrc" | ||
cache: yarn | ||
|
@@ -78,7 +78,7 @@ jobs: | |
- name: Check out files from GitHub | ||
uses: actions/[email protected] | ||
- name: Setup Node | ||
uses: actions/[email protected].2 | ||
uses: actions/[email protected].3 | ||
with: | ||
node-version-file: ".nvmrc" | ||
cache: yarn | ||
|
@@ -102,7 +102,7 @@ jobs: | |
- name: Check out files from GitHub | ||
uses: actions/[email protected] | ||
- name: Setup Node | ||
uses: actions/[email protected].2 | ||
uses: actions/[email protected].3 | ||
with: | ||
node-version-file: ".nvmrc" | ||
cache: yarn | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,7 @@ jobs: | |
ref: dev | ||
|
||
- name: Setup Node | ||
uses: actions/[email protected].2 | ||
uses: actions/[email protected].3 | ||
with: | ||
node-version-file: ".nvmrc" | ||
cache: yarn | ||
|
@@ -63,7 +63,7 @@ jobs: | |
ref: master | ||
|
||
- name: Setup Node | ||
uses: actions/[email protected].2 | ||
uses: actions/[email protected].3 | ||
with: | ||
node-version-file: ".nvmrc" | ||
cache: yarn | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ jobs: | |
uses: actions/[email protected] | ||
|
||
- name: Setup Node | ||
uses: actions/[email protected].2 | ||
uses: actions/[email protected].3 | ||
with: | ||
node-version-file: ".nvmrc" | ||
cache: yarn | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,7 @@ jobs: | |
uses: actions/[email protected] | ||
|
||
- name: Setup Node | ||
uses: actions/[email protected].2 | ||
uses: actions/[email protected].3 | ||
with: | ||
node-version-file: ".nvmrc" | ||
cache: yarn | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,7 @@ jobs: | |
python-version: ${{ env.PYTHON_VERSION }} | ||
|
||
- name: Setup Node | ||
uses: actions/[email protected].2 | ||
uses: actions/[email protected].3 | ||
with: | ||
node-version-file: ".nvmrc" | ||
cache: yarn | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,7 +34,7 @@ jobs: | |
python-version: ${{ env.PYTHON_VERSION }} | ||
|
||
- name: Setup Node | ||
uses: actions/[email protected].2 | ||
uses: actions/[email protected].3 | ||
with: | ||
node-version-file: ".nvmrc" | ||
cache: yarn | ||
|
@@ -55,7 +55,7 @@ jobs: | |
script/release | ||
- name: Upload release assets | ||
uses: softprops/[email protected].6 | ||
uses: softprops/[email protected].8 | ||
with: | ||
files: | | ||
dist/*.whl | ||
|
@@ -74,9 +74,9 @@ jobs: | |
echo "home-assistant-frontend==$version" > ./requirements.txt | ||
- name: Build wheels | ||
uses: home-assistant/wheels@2024.01.0 | ||
uses: home-assistant/wheels@2024.07.1 | ||
with: | ||
abi: cp311 | ||
abi: cp312 | ||
tag: musllinux_1_2 | ||
arch: amd64 | ||
wheels-key: ${{ secrets.WHEELS_KEY }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
yarn run lint-staged --relative --shell "/bin/bash" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
diff --git a/build/inject-manifest.js b/build/inject-manifest.js | ||
index 60e3d2bb51c11a19fbbedbad65e101082ec41c36..fed6026630f43f86e25446383982cf6fb694313b 100644 | ||
--- a/build/inject-manifest.js | ||
+++ b/build/inject-manifest.js | ||
@@ -104,7 +104,7 @@ async function injectManifest(config) { | ||
replaceString: manifestString, | ||
searchString: options.injectionPoint, | ||
}); | ||
- filesToWrite[options.swDest] = source; | ||
+ filesToWrite[options.swDest] = source.replace(url, encodeURI(upath_1.default.basename(destPath))); | ||
filesToWrite[destPath] = map; | ||
} | ||
else { | ||
diff --git a/build/lib/translate-url-to-sourcemap-paths.js b/build/lib/translate-url-to-sourcemap-paths.js | ||
index 3220c5474eeac6e8a56ca9b2ac2bd9be48529e43..5f003879a904d4840529a42dd056d288fd213771 100644 | ||
--- a/build/lib/translate-url-to-sourcemap-paths.js | ||
+++ b/build/lib/translate-url-to-sourcemap-paths.js | ||
@@ -22,7 +22,7 @@ function translateURLToSourcemapPaths(url, swSrc, swDest) { | ||
const possibleSrcPath = upath_1.default.resolve(upath_1.default.dirname(swSrc), url); | ||
if (fs_extra_1.default.existsSync(possibleSrcPath)) { | ||
srcPath = possibleSrcPath; | ||
- destPath = upath_1.default.resolve(upath_1.default.dirname(swDest), url); | ||
+ destPath = `${swDest}.map`; | ||
} | ||
else { | ||
warning = `${errors_1.errors['cant-find-sourcemap']} ${possibleSrcPath}`; | ||
diff --git a/src/inject-manifest.ts b/src/inject-manifest.ts | ||
index 8795ddcaa77aea7b0356417e4bc4b19e2b3f860c..fcdc68342d9ac53936c9ed40a9ccfc2f5070cad3 100644 | ||
--- a/src/inject-manifest.ts | ||
+++ b/src/inject-manifest.ts | ||
@@ -129,7 +129,10 @@ export async function injectManifest( | ||
searchString: options.injectionPoint!, | ||
}); | ||
|
||
- filesToWrite[options.swDest] = source; | ||
+ filesToWrite[options.swDest] = source.replace( | ||
+ url!, | ||
+ encodeURI(upath.basename(destPath)), | ||
+ ); | ||
filesToWrite[destPath] = map; | ||
} else { | ||
// If there's no sourcemap associated with swSrc, a simple string | ||
diff --git a/src/lib/translate-url-to-sourcemap-paths.ts b/src/lib/translate-url-to-sourcemap-paths.ts | ||
index 072eac40d4ef5d095a01cb7f7e392a9e034853bd..f0bbe69e88ef3a415de18a7e9cb264daea273d71 100644 | ||
--- a/src/lib/translate-url-to-sourcemap-paths.ts | ||
+++ b/src/lib/translate-url-to-sourcemap-paths.ts | ||
@@ -28,7 +28,7 @@ export function translateURLToSourcemapPaths( | ||
const possibleSrcPath = upath.resolve(upath.dirname(swSrc), url); | ||
if (fse.existsSync(possibleSrcPath)) { | ||
srcPath = possibleSrcPath; | ||
- destPath = upath.resolve(upath.dirname(swDest), url); | ||
+ destPath = `${swDest}.map`; | ||
} else { | ||
warning = `${errors['cant-find-sourcemap']} ${possibleSrcPath}`; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,54 @@ | ||
// Tasks to compress | ||
|
||
import { constants } from "node:zlib"; | ||
import gulp from "gulp"; | ||
import brotli from "gulp-brotli"; | ||
import zopfli from "gulp-zopfli-green"; | ||
import paths from "../paths.cjs"; | ||
|
||
const filesGlob = "*.{js,json,css,svg,xml}"; | ||
const brotliOptions = { | ||
skipLarger: true, | ||
params: { | ||
[constants.BROTLI_PARAM_QUALITY]: constants.BROTLI_MAX_QUALITY, | ||
}, | ||
}; | ||
const zopfliOptions = { threshold: 150 }; | ||
|
||
const compressDist = (rootDir) => | ||
const compressDistBrotli = (rootDir, modernDir) => | ||
gulp | ||
.src([ | ||
`${rootDir}/**/*.{js,json,css,svg,xml}`, | ||
`${rootDir}/{authorize,onboarding}.html`, | ||
]) | ||
.src([`${modernDir}/**/${filesGlob}`, `${rootDir}/sw-modern.js`], { | ||
base: rootDir, | ||
}) | ||
.pipe(brotli(brotliOptions)) | ||
.pipe(gulp.dest(rootDir)); | ||
|
||
const compressDistZopfli = (rootDir, modernDir) => | ||
gulp | ||
.src( | ||
[ | ||
`${rootDir}/**/${filesGlob}`, | ||
`!${modernDir}/**/${filesGlob}`, | ||
`!${rootDir}/sw-modern.js`, | ||
`${rootDir}/{authorize,onboarding}.html`, | ||
], | ||
{ base: rootDir } | ||
) | ||
.pipe(zopfli(zopfliOptions)) | ||
.pipe(gulp.dest(rootDir)); | ||
|
||
gulp.task("compress-app", () => compressDist(paths.app_output_root)); | ||
gulp.task("compress-hassio", () => compressDist(paths.hassio_output_root)); | ||
const compressAppBrotli = () => | ||
compressDistBrotli(paths.app_output_root, paths.app_output_latest); | ||
const compressHassioBrotli = () => | ||
compressDistBrotli(paths.hassio_output_root, paths.hassio_output_latest); | ||
|
||
const compressAppZopfli = () => | ||
compressDistZopfli(paths.app_output_root, paths.app_output_latest); | ||
const compressHassioZopfli = () => | ||
compressDistZopfli(paths.hassio_output_root, paths.hassio_output_latest); | ||
|
||
gulp.task("compress-app", gulp.parallel(compressAppBrotli, compressAppZopfli)); | ||
gulp.task( | ||
"compress-hassio", | ||
gulp.parallel(compressHassioBrotli, compressHassioZopfli) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.