Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Release
on:
push:
tags:
- "v*.*.*"
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install
run: npm ci
- name: Build
run: npm run build
- name: Package Artifacts
run: |
shopt -s nullglob
artifacts=(dist/*)
if [ ${#artifacts[@]} -eq 0 ]; then
echo "No dist artifacts found" >&2
exit 1
fi
zip -j "dist/simon42-dashboard-strategy-${GITHUB_REF_NAME}.zip" "${artifacts[@]}"
- name: Release
uses: softprops/action-gh-release@v3
if: startsWith(github.ref, 'refs/tags/')
with:
draft: true
generate_release_notes: true
files: dist/*.zip

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ dist/simon42-dashboard-strategy.js
dist/simon42-dashboard-strategy.js.map
.DS_Store
.codacy/
dist/
1 change: 0 additions & 1 deletion dist/simon42-dashboard-strategy-217.c4475779.js

This file was deleted.

Binary file removed dist/simon42-dashboard-strategy-217.c4475779.js.br
Binary file not shown.
Binary file removed dist/simon42-dashboard-strategy-217.c4475779.js.gz
Binary file not shown.
1 change: 0 additions & 1 deletion dist/simon42-dashboard-strategy-598.c4475779.js

This file was deleted.

Binary file removed dist/simon42-dashboard-strategy-598.c4475779.js.br
Binary file not shown.
Binary file removed dist/simon42-dashboard-strategy-598.c4475779.js.gz
Binary file not shown.
149 changes: 0 additions & 149 deletions dist/simon42-dashboard-strategy-core.bf96b4b7.js

This file was deleted.

Binary file removed dist/simon42-dashboard-strategy-core.bf96b4b7.js.br
Binary file not shown.
Binary file removed dist/simon42-dashboard-strategy-core.bf96b4b7.js.gz
Binary file not shown.
1,399 changes: 0 additions & 1,399 deletions dist/simon42-dashboard-strategy-editor.ab836110.js

This file was deleted.

This file was deleted.

Binary file not shown.
Binary file not shown.
2 changes: 0 additions & 2 deletions dist/simon42-dashboard-strategy-lit.4284f31e.js

This file was deleted.

11 changes: 0 additions & 11 deletions dist/simon42-dashboard-strategy-lit.4284f31e.js.LICENSE.txt

This file was deleted.

Binary file removed dist/simon42-dashboard-strategy-lit.4284f31e.js.br
Binary file not shown.
Binary file removed dist/simon42-dashboard-strategy-lit.4284f31e.js.gz
Binary file not shown.
1 change: 0 additions & 1 deletion dist/simon42-dashboard-strategy-views.89475601.js

This file was deleted.

Binary file removed dist/simon42-dashboard-strategy-views.89475601.js.br
Binary file not shown.
Binary file removed dist/simon42-dashboard-strategy-views.89475601.js.gz
Binary file not shown.
1 change: 0 additions & 1 deletion dist/simon42-dashboard-strategy.js

This file was deleted.

Binary file removed dist/simon42-dashboard-strategy.js.br
Binary file not shown.
Binary file removed dist/simon42-dashboard-strategy.js.gz
Binary file not shown.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"private": true,
"type": "module",
"scripts": {
"build": "webpack",
"build-dev": "webpack --config webpack.dev.config.ts",
"watch": "webpack --config webpack.dev.config.ts --watch",
"build": "webpack --config webpack.config.js",
"build-dev": "webpack --config webpack.dev.config.js",
"watch": "webpack --config webpack.dev.config.js --watch",
"format": "prettier --write \"src/**/*.ts\"",
"format:check": "prettier --check \"src/**/*.ts\"",
"lint": "eslint \"src/**/*.ts\"",
Expand Down
18 changes: 10 additions & 8 deletions webpack.config.ts → webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import path from 'path';
import zlib from 'zlib';
import webpack from 'webpack';
import CompressionPlugin from 'compression-webpack-plugin';

const config: webpack.Configuration = {
/** @type {import('webpack').Configuration} */
const config = {
mode: 'production',
entry: './src/simon42-dashboard-strategy.ts',
output: {
Expand All @@ -29,11 +29,11 @@ const config: webpack.Configuration = {
optimization: {
splitChunks: {
// Chunk architecture:
// main (entry) tiny, registers custom element instantly
// lit Lit framework, shared by core + views + editor
// core Registry, Utils, OverviewViewStrategy, Cards (home screen)
// views LightsView, CoversView, SecurityView, BatteriesView, RoomView
// editor StrategyEditor + js-yaml (on-demand only)
// main (entry) -> tiny, registers custom element instantly
// lit -> Lit framework, shared by core + views + editor
// core -> Registry, Utils, OverviewViewStrategy, Cards (home screen)
// views -> LightsView, CoversView, SecurityView, BatteriesView, RoomView
// editor -> StrategyEditor + js-yaml (on-demand only)
cacheGroups: {
lit: {
test: /[\\/]node_modules[\\/](?:lit|@lit|lit-html|lit-element)[\\/]/,
Expand Down Expand Up @@ -75,7 +75,9 @@ const config: webpack.Configuration = {
new CompressionPlugin({
algorithm: 'brotliCompress',
test: /\.js$/,
compressionOptions: { params: { [zlib.constants.BROTLI_PARAM_QUALITY]: 11 } } as any,
compressionOptions: {
[zlib.constants.BROTLI_PARAM_QUALITY]: 11,
},
minRatio: 0.8,
filename: '[path][base].br',
}),
Expand Down
5 changes: 3 additions & 2 deletions webpack.dev.config.ts → webpack.dev.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import path from 'path';
import webpack from 'webpack';

const config: webpack.Configuration = {
/** @type {import('webpack').Configuration} */
const config = {
mode: 'development',
devtool: 'source-map',
entry: './src/simon42-dashboard-strategy.ts',
output: {
clean: true,
filename: 'simon42-dashboard-strategy.js',
path: path.resolve(__dirname, 'dist'),
path: path.resolve(import.meta.dirname, 'dist'),
},
resolve: {
extensions: ['.ts', '.js'],
Expand Down
Loading