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

Remove node modules from the repository #108

Merged
merged 5 commits into from
Sep 24, 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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion .github/workflows/malt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
uses: actions/checkout@v4.1.1

- name: Install dependencies
run: sudo apt-get install -y libunwind-dev nodejs cmake
run: sudo apt-get install -y libunwind-dev nodejs npm cmake

- name: Build Project & test
run: |
Expand Down
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
src/webview/node_modules/grunt*
src/webview/node_modules/browserify/
src/webview/node_modules/.bin/grunt
src/webview/node_modules/.bin/browserify
# Ignore node modules which are downloaded at the installation
src/webview/node_modules/

# Ignore build directories
src/webview/dist
src/webview/build
/build*
18 changes: 18 additions & 0 deletions cmake/FindNpm.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
######################################################
# - Try to find npm command
# Once done this will define
# NPM_FOUND - System has npm
# NPM_BINARY - Path to the npm binary file

######################################################
find_program(NPM_BINARY npm)

######################################################
include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set NPM_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(Npm "Cannot find NPM. This is required beause you took the git master branch. Download official tar.gz or disable webview."
NPM_BINARY)

######################################################
mark_as_advanced(NPM_BINARY)
11 changes: 10 additions & 1 deletion dev/gen-archive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,14 @@ fi
######################################################
echo "Generate ${prefix}.tar.gz..."
set -e
git archive --format=tar --prefix=${prefix}/ HEAD | bzip2 > ./${prefix}.tar.bz2
git archive --format=tar --prefix=${prefix}/ HEAD | bzip2 > /tmp/${prefix}.tar.bz2
pushd /tmp
tar -xf ${prefix}.tar.bz2
pushd ${prefix}/src/webview
./prepare.sh
popd
tar -cjf ${prefix}.tar.bz2 ${prefix}
popd
mv /tmp/${prefix}.tar.bz2 ./
rm -rfvd /tmp/${prefix}
echo "Finished"
5 changes: 1 addition & 4 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,4 @@ if (QT5_FOUND)
add_subdirectory(qtview)
endif (QT5_FOUND)

######################################################
# Install the webview into share directory
INSTALL(DIRECTORY webview DESTINATION share/malt
PATTERN webview/client_v2/node_modules EXCLUDE)
add_subdirectory(webview)
35 changes: 35 additions & 0 deletions src/webview/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
######################################################
# PROJECT : MALT #
# VERSION : 1.2.2 #
# DATE : 06/2023 #
# AUTHOR : Valat Sébastien #
# LICENSE : CeCILL-C #
######################################################

######################################################
# Check for npm if needed
if (NOT IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/node_modules)
find_package(Npm REQUIRED)
endif()

######################################################
# Install nodejs dependencies if needed
# then install node_modules into share directory
if (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/node_modules)
message(STATUS "Copying package.json and package-lock.json to build directory")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/package.json ${CMAKE_CURRENT_BINARY_DIR}/package.json COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/package-lock.json ${CMAKE_CURRENT_BINARY_DIR}/package-lock.json COPYONLY)
add_custom_command (OUTPUT deps-loaded
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/prepare.sh ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Fetching webview javascript dependencies..."
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/prepare.sh
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
add_custom_target(run ALL DEPENDS deps-loaded package.json package-lock.json)
INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/node_modules DESTINATION share/malt/webview)
else (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/node_modules)
INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/node_modules DESTINATION share/malt/webview)
endif (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/node_modules)

#######################################################
## Install the webview into share directory
INSTALL(DIRECTORY . DESTINATION share/malt/webview)
1 change: 0 additions & 1 deletion src/webview/node_modules/.bin/JSONStream

This file was deleted.

1 change: 0 additions & 1 deletion src/webview/node_modules/.bin/bower

This file was deleted.

1 change: 0 additions & 1 deletion src/webview/node_modules/.bin/htpasswd

This file was deleted.

1 change: 0 additions & 1 deletion src/webview/node_modules/.bin/mime

This file was deleted.

1 change: 0 additions & 1 deletion src/webview/node_modules/.bin/uuid

This file was deleted.

Loading