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

Web wrapup #74

Closed
wants to merge 2 commits into from
Closed
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
2 changes: 1 addition & 1 deletion .github/workflows/check-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ jobs:
- name: Run prettier style check
uses: creyD/prettier_action@v4.3
with:
prettier_options: --check ./frontend/
prettier_options: --check ./web/
dry: true
6 changes: 3 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
}
},
{
"name": "(yarn) Frontend",
"command": "yarn start",
"name": "(bun) Frontend",
"command": "bun run --bun vite-dev",
"request": "launch",
"type": "node-terminal",
"cwd": "${workspaceFolder}/frontend"
"cwd": "${workspaceFolder}/web"
}
]
}
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,5 @@ conan_cmake_run(CONANFILE conanfile.txt
BUILD missing)

add_subdirectory(daemon)
add_subdirectory(frontend)
add_subdirectory(web)
add_subdirectory(dbcli)
9 changes: 4 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@ RUN apt-get update --yes && apt-get install --yes ca-certificates curl gnupg \
&& echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main" > /etc/apt/sources.list.d/llvm.list \
&& curl --silent --location https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - \
&& mkdir -p /etc/apt/keyrings \
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list \
&& curl --silent --location https://apt.kitware.com/keys/kitware-archive-latest.asc | gpg --dearmor -o /usr/share/keyrings/kitware-archive-keyring.gpg \
&& echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ jammy main' | tee /etc/apt/sources.list.d/kitware.list >/dev/null \
&& apt-get update --yes \
&& apt-get install --yes build-essential git cmake libssl-dev pip ninja-build lldb-17 clangd-17 clang-format-17 clang-17 libc++-17-dev libc++abi-17-dev nodejs zstd \
&& apt-get install --yes build-essential git cmake libssl-dev pip ninja-build lldb-17 clangd-17 clang-format-17 clang-17 libc++-17-dev libc++abi-17-dev nodejs zstd unzip \
&& rm -rf /var/lib/apt/lists/*

RUN update-alternatives --install /usr/bin/clang clang /usr/bin/clang-17 100 && \
Expand All @@ -28,8 +26,9 @@ RUN pip install conan==1.63.0 \
&& conan profile update settings.compiler.version=17 default \
&& conan profile update settings.compiler.libcxx=libc++ default

RUN corepack enable \
&& corepack prepare yarn@stable --activate
RUN curl -fsSL https://bun.sh/install | bash

ENV PATH="/root/.bun/bin:${PATH}"

COPY conanfile.txt /conan/

Expand Down
51 changes: 51 additions & 0 deletions cmake/FindBun.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
set(_prev "${BUN_EXECUTABLE}")
find_program(BUN_EXECUTABLE bun DOC "Path to Bun, the all-in-one JavaScript runtime")

if(BUN_EXECUTABLE)
if(NOT _prev)
message(STATUS "Found Bun executable: ${BUN_EXECUTABLE}")
endif()
set(Bun_FOUND TRUE CACHE INTERNAL "")
else()
set(Bun_FOUND FALSE CACHE INTERNAL "")
if(Bun_FIND_REQUIRED)
message(FATAL_ERROR "Failed to find a Bun executable")
endif()
endif()

function(bun_run_command cmd working_dir)
message(STATUS "Running command: ${BUN_EXECUTABLE} ${cmd} at ${working_dir}")
execute_process(
COMMAND ${BUN_EXECUTABLE} ${cmd}
RESULT_VARIABLE result
ERROR_VARIABLE error
WORKING_DIRECTORY ${working_dir}
)
if (result)
message(FATAL_ERROR "Failed to run command: ${result}")
endif()
endfunction()

function(bun_add_vite_project package_name working_dir)
bun_run_command(install ${working_dir})

add_custom_target("${package_name}_build" ALL
COMMAND ${CMAKE_COMMAND} -E env BUILD_PATH='${CMAKE_CURRENT_BINARY_DIR}' ${BUN_EXECUTABLE} run --bun vite-build
WORKING_DIRECTORY ${working_dir}
COMMENT "Building ${package_name}"
USES_TERMINAL
)

add_custom_command(
TARGET "${package_name}_build" POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_BINARY_DIR}/bin/frontend)

add_custom_target("${package_name}_install"
COMMAND ${CMAKE_COMMAND} -E env BUILD_PATH='${CMAKE_CURRENT_BINARY_DIR}' ${BUN_EXECUTABLE} install
WORKING_DIRECTORY ${working_dir}
COMMENT "Installing packages for ${package_name}"
USES_TERMINAL
)
endfunction()
24 changes: 0 additions & 24 deletions frontend/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion frontend/.yarnrc.yml

This file was deleted.

6 changes: 0 additions & 6 deletions frontend/CMakeLists.txt

This file was deleted.

46 changes: 0 additions & 46 deletions frontend/README.md

This file was deleted.

73 changes: 0 additions & 73 deletions frontend/package.json

This file was deleted.

42 changes: 0 additions & 42 deletions frontend/public/index.html

This file was deleted.

25 changes: 0 additions & 25 deletions frontend/public/manifest.json

This file was deleted.

3 changes: 0 additions & 3 deletions frontend/public/robots.txt

This file was deleted.

38 changes: 0 additions & 38 deletions frontend/src/App.css

This file was deleted.

9 changes: 0 additions & 9 deletions frontend/src/App.test.tsx

This file was deleted.

Loading