Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile css files automatically as part of "run build-frontend" #696

Merged
merged 1 commit into from
May 5, 2024
Merged
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
9 changes: 3 additions & 6 deletions extra_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,24 @@

Import("env")

# install brotli if it isn't installed
#try:
# try:
# import brotli
#except ImportError:
# except ImportError:
# env.Execute("$PYTHONEXE -m pip install brotli")



def convert_files(root_file_path: pathlib.Path, target):
scripts.convert_html.convert_files(root_file_path, target)


def build_web_ui(*args, **kwargs) -> None:
# install and build the web UI
env.Execute("cd web && npm install && npm run build")

scripts.convert_html.convert_files(
pathlib.Path("web/dist/index.html"),
"src/sensesp/net/web/autogen/web_ui_files.h",
"kWebUIFiles",
"/"
"/",
)


Expand Down
20 changes: 11 additions & 9 deletions run
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,20 @@ function all {
checks
}

function install_pio {
function install-pio {
echo "📦 Installing PlatformIO project"
pio project init
}

function install_frontend {
function install-frontend {
echo "📦 Installing frontend dependencies"
( cd web && npm install )
}

function install {
echo "📦 Installing project and dependencies"
install_pio
install_frontend
install-pio
install-frontend
}

function clean {
Expand All @@ -57,20 +57,22 @@ function clean {
rm -rf web/node_modules/
}

function build_pio {
function build-pio {
echo "🏗️ Building the PlatformIO project"
pio run
}

function build_frontend {
function build-frontend {
echo "🏗️ Building the frontend"
( cd web && npm run css-compile )
( cd web && npm run build )
pio run -t webUI
}

function build {
echo "🏗️ Building the project"
build_frontend
build_pio
build-frontend
build-pio
}

function upload {
Expand All @@ -79,7 +81,7 @@ function upload {
pio run -t upload
}

function upload_monitor {
function upload-monitor {
echo "🚀 🖥️ Uploading the project and opening the serial monitor"
build
pio run -t upload --target monitor
Expand Down
Loading