forked from MapComplete/MapComplete
		
	Move scripts into package.json
This commit is contained in:
		
							parent
							
								
									cad14d0824
								
							
						
					
					
						commit
						40efa744aa
					
				
					 4 changed files with 9 additions and 70 deletions
				
			
		
							
								
								
									
										2
									
								
								State.ts
									
										
									
									
									
								
							
							
						
						
									
										2
									
								
								State.ts
									
										
									
									
									
								
							| 
						 | 
					@ -22,7 +22,7 @@ export default class State {
 | 
				
			||||||
    // The singleton of the global state
 | 
					    // The singleton of the global state
 | 
				
			||||||
    public static state: 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
 | 
					    // The user journey states thresholds when a new feature gets unlocked
 | 
				
			||||||
    public static userJourney = {
 | 
					    public static userJourney = {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										29
									
								
								clean.sh
									
										
									
									
									
								
							
							
						
						
									
										29
									
								
								clean.sh
									
										
									
									
									
								
							| 
						 | 
					@ -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
 | 
					 | 
				
			||||||
							
								
								
									
										39
									
								
								deploy.sh
									
										
									
									
									
								
							
							
						
						
									
										39
									
								
								deploy.sh
									
										
									
									
									
								
							| 
						 | 
					@ -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"
 | 
					 | 
				
			||||||
| 
						 | 
					@ -14,12 +14,19 @@
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  "scripts": {
 | 
					  "scripts": {
 | 
				
			||||||
    "start": "parcel *.html UI/** Logic/** assets/** assets/**/** assets/**/**/** vendor/* vendor/*/*",
 | 
					    "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: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:included-images": "ts-node generateIncludedImages.ts",
 | 
				
			||||||
    "generate:layouts": "ts-node createLayouts.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",
 | 
					    "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/*/*",
 | 
					    "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": [
 | 
					  "keywords": [
 | 
				
			||||||
    "OpenStreetMap",
 | 
					    "OpenStreetMap",
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue