diff --git a/State.ts b/State.ts index d76608ec9..d739d42de 100644 --- a/State.ts +++ b/State.ts @@ -22,7 +22,7 @@ export default class State { // The singleton of the global state public static state: State; - public static vNumber = "0.1.2f"; + public static vNumber = "0.1.2g"; // The user journey states thresholds when a new feature gets unlocked public static userJourney = { diff --git a/clean.sh b/clean.sh deleted file mode 100755 index e9b039ebe..000000000 --- a/clean.sh +++ /dev/null @@ -1,29 +0,0 @@ -#! /bin/bash - -# clean up the mess we made - # rm *.js - # rm Logic/*.js - # rm Logic/*.js - # rm Logic/*/*.js - # rm Logic/*/*/*.js - # rm UI/*.js - # rm UI/*/*.js - # rm UI/*/*/*.js - # rm Customizations/*.js - # rm Customizations/*/*.js - # rm Customizations/*/*/*.js - -rm *.webmanifest - -# rm assets/generated/* - -for f in ./*.html; do - if [[ "$f" == "./index.html" ]] || [[ "$f" == "./land.html" ]] || [[ "$f" == "./test.html" ]] || [[ "$f" == "./preferences.html" ]] || [[ "$f" == "./customGenerator.html" ]] - then - echo "Not removing $f" - else - rm $f - fi -done - -rm -rf .cache \ No newline at end of file diff --git a/deploy.sh b/deploy.sh deleted file mode 100755 index e4927a6fe..000000000 --- a/deploy.sh +++ /dev/null @@ -1,39 +0,0 @@ -#! /bin/bash - -mkdir -p assets/generated -ts-node createLayouts.ts || { echo 'Creating layouts failed' ; exit 1; } -find -name '*.png' | parallel optipng '{}' -npm run build || { echo 'Npm build failed' ; exit 1; } - -rm -rf .cache - -if [[ $1 == "groen" ]] -then - echo "DEPLOYING TO BUURTNATUUR!" - mv /home/pietervdvn/git/buurtnatuur.github.io/CNAME /home/pietervdvn/git/ - mv /home/pietervdvn/git/buurtnatuur.github.io/.git /home/pietervdvn/git/ - rm -rf /home/pietervdvn/git/buurtnatuur.github.io/* - cp -r dist/* /home/pietervdvn/git/buurtnatuur.github.io/ - mv /home/pietervdvn/git/CNAME /home/pietervdvn/git/buurtnatuur.github.io/ - mv /home/pietervdvn/git/.git /home/pietervdvn/git/buurtnatuur.github.io/ - cd /home/pietervdvn/git/buurtnatuur.github.io/ -elif [[ $1 == "production" ]] -then - echo "DEPLOYING TO MAPCOMPLETE" - rm -rf /home/pietervdvn/git/pietervdvn.github.io/MapComplete/* - cp -r dist/* /home/pietervdvn/git/pietervdvn.github.io/MapComplete/ - cd /home/pietervdvn/git/pietervdvn.github.io/MapComplete/ -else - echo "Testversion deploy" - rm -rf /home/pietervdvn/git/pietervdvn.github.io/Staging/* - cp -r dist/* /home/pietervdvn/git/pietervdvn.github.io/Staging/ - cd /home/pietervdvn/git/pietervdvn.github.io/Staging/ -fi - -git add * -git commit -am "New mapcomplete version" -git push -cd - -./clean.sh - -echo "DEPLOYED $1" diff --git a/package.json b/package.json index 91ec39837..c40c35164 100644 --- a/package.json +++ b/package.json @@ -14,12 +14,19 @@ }, "scripts": { "start": "parcel *.html UI/** Logic/** assets/** assets/**/** assets/**/**/** vendor/* vendor/*/*", + "test": "ts-node test/*", "generate:editor-layer-index": "cd assets/ && wget https://osmlab.github.io/editor-layer-index/imagery.geojson --output-document=editor-layer-index.json", "generate:included-images": "ts-node generateIncludedImages.ts", "generate:layouts": "ts-node createLayouts.ts", + "optimize-images": "cd assets/generated/ && find -name '*.png' -exec optipng '{}' \\; && echo 'PNGs are optimized'", "generate": "npm run generate:included-images && npm run generate:layouts && npm run generate:editor-layer-index", "build": "rm -rf dist/ npm run generate && parcel build --public-url ./ *.html assets/** assets/**/** assets/**/**/** vendor/* vendor/*/*", - "test": "ts-node test/*" + "prepare-deploy": "npm run generate && npm run build && rm -rf .cache", + "deploy:staging": "npm run prepare-deploy && rm -rf /home/pietervdvn/git/pietervdvn.github.io/Staging/* && cp -r dist/* /home/pietervdvn/git/pietervdvn.github.io/Staging/ && cd /home/pietervdvn/git/pietervdvn.github.io/ && git add * && git commit -m 'New MapComplete Version' && git push && cd - && npm run clean", + "deploy:production": "npm run prepare-deploy && rm -rf /home/pietervdvn/git/pietervdvn.github.io/MapComplete/* && cp -r dist/* /home/pietervdvn/git/pietervdvn.github.io/MapComplete/ && cd /home/pietervdvn/git/pietervdvn.github.io/ && git add * && git commit -m 'New MapComplete Version' && git push && cd - && npm run clean", + + "clean": "rm *.webmanifest && find *.html | grep -v \"\\(index\\|land\\|test\\|preferences\\|customGenerator\\).html\" | xargs rm" + }, "keywords": [ "OpenStreetMap",