Added check on correct setup of the environment

This commit is contained in:
Davide Passoni 2024-02-19 15:34:39 +01:00
parent bc6c70928f
commit 4efd48c4b9
12 changed files with 40 additions and 20 deletions

2
.gitignore vendored
View File

@ -31,5 +31,5 @@ leaflet.css
package-lock.json
!frontend/server/bin
/frontend/server/public/javascripts/bundle.js
/mock-dcs
/frontend/setup

8
frontend/check_setup.bat Normal file
View File

@ -0,0 +1,8 @@
@echo off
if exist "setup" (
echo setup.bat has already been called, skipping...
) else (
echo setup.bat has not been called yet, installing!
call .\setup.bat
)

View File

@ -12,8 +12,7 @@
"<node_internals>/**"
],
"args": ["--config", "${input:enterDir}/Config/olympus.json"],
"program": "./bin/www",
"preLaunchTask": "prepare-dcs"
"program": "./bin/www"
},
{
"type": "node",

View File

@ -3,12 +3,6 @@
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "copy-website",
"type": "shell",
"command": "./scripts/copy.bat",
"isBackground": false
},
{
"label": "demo-server",
"type": "shell",

View File

@ -1,4 +1,4 @@
call ./scripts/copy.bat
call .\scripts\copy.bat
echo D|xcopy /Y /S /E .\bin ..\..\build\frontend\bin
echo D|xcopy /Y /S /E .\public ..\..\build\frontend\public

View File

@ -1,5 +1,2 @@
echo F|xcopy /Y ..\website\node_modules\leaflet\dist\leaflet.css .\public\stylesheets\leaflet\leaflet.css
echo F|xcopy /Y ..\website\node_modules\leaflet-gesture-handling\dist\leaflet-gesture-handling.css .\public\stylesheets\leaflet\leaflet-gesture-handling.css
echo F|xcopy /Y ..\website\node_modules\leaflet.nauticscale\dist\leaflet.nauticscale.js .\public\javascripts\leaflet.nauticscale.js
echo F|xcopy /Y ..\website\node_modules\leaflet-path-drag\dist\L.Path.Drag.js .\public\javascripts\L.Path.Drag.js

View File

@ -1,3 +1,7 @@
call ./scripts/copy.bat
call ./scripts/create-mock-dcs.bat
node ./bin/demo --config %1
cd ..
call .\check_setup.bat
cd server
call .\scripts\copy.bat
call .\scripts\create-mock-dcs.bat
node .\bin\demo --config %1

14
frontend/setup.bat Normal file
View File

@ -0,0 +1,14 @@
cd website
call npm install
call npm install -g watchify babelify tsify
cd ..
cd server
call npm install
cd ..
cd . > setup

View File

@ -1 +1 @@
call browserify ./src/index.ts -o ../../build/frontend/public/javascripts/bundle.js -t [ babelify --global true --presets [ @babel/preset-env ] --extensions '.js'] -p [ tsify --noImplicitAny ]
call browserify .\src\index.ts -o ..\..\build\frontend\public\javascripts\bundle.js -t [ babelify --global true --presets [ @babel\preset-env ] --extensions '.js'] -p [ tsify --noImplicitAny ]

View File

@ -1 +1 @@
tsc --project tsconfig.json --declaration --emitDeclarationOnly --outfile ./@types/olympus/index.d.ts
tsc --project tsconfig.json --declaration --emitDeclarationOnly --outfile .\@types\olympus\index.d.ts

View File

@ -1 +1,5 @@
watchify ./src/index.ts --debug -o ../server/public/javascripts/bundle.js -t [ babelify --global true --presets [ @babel/preset-env ] --extensions '.js'] -p [ tsify --noImplicitAny ]
cd ..
call .\check_setup.bat
cd website
watchify .\src\index.ts --debug -o ..\server\public\javascripts\bundle.js -t [ babelify --global true --presets [ @babel/preset-env ] --extensions '.js'] -p [ tsify --noImplicitAny ]

View File

@ -35,7 +35,7 @@ L.Map.addInitHook("addHandler", "gestureHandling", GestureHandling);
// TODO would be nice to convert to ts - yes
require("../../node_modules/leaflet.nauticscale/dist/leaflet.nauticscale.js")
require("../../node_modules/leaflet-path-drag/dist/L.Path.Drag.js")
require("../../node_modules/leaflet-path-drag/dist/index.js")
export type MapMarkerVisibilityControl = {
"category"?: string;