2 Commits
v0.2.0 ... main

Author SHA1 Message Date
Robin Chappatte
624c987e13 add backend npm package build step 2024-06-22 22:11:53 +02:00
Robin Chappatte
8412cc7d9d specify backend's deno config file and add run permission in build script 2024-06-22 18:20:03 +02:00

View File

@@ -10,7 +10,15 @@ then
fi
function clean {
rm -rf ./frontend/dist && rm -rf ./backend/dist && rm -rf ./dist
rm -rf ./frontend/dist && \
rm -rf ./backend/dist && \
rm -rf ./backend/npm && \
rm -rf ./dist && \
true
}
function build_backend_npm_package {
deno run --allow-env --allow-read --allow-write=./backend/npm --allow-run=npm ./backend/build-for-npm.ts ./backend/npm 1.0.0
}
function build_frontend {
@@ -20,7 +28,7 @@ function build_frontend {
cd "$dir"
}
function build_backend {
function bundle_frontend_files_info_single_json_file {
deno run --allow-read=./frontend/dist,./dist --allow-write=./dist ./bundle.ts ./frontend/dist ./dist/bundled-view-files.json
cp ./dist/bundled-view-files.json ./backend/src/modules/view/bundled-view-files.json
}
@@ -28,7 +36,7 @@ function build_backend {
function compile_for {
target=$1
mkdir -p "./dist/bin"
deno compile --target "$target" --output "./dist/bin/$target" --allow-net --allow-read --allow-write --allow-sys ./backend/src/main.ts
deno compile --config "./backend/deno.json" --target "$target" --output "./dist/bin/$target" --allow-net --allow-read --allow-write --allow-sys --allow-run ./backend/src/main.ts
}
function compile_all {
@@ -41,6 +49,7 @@ function compile_all {
clean
build_backend_npm_package
build_frontend
build_backend
bundle_frontend_files_info_single_json_file
compile_all