diff --git a/assets/contributors.json b/assets/contributors.json new file mode 100644 index 0000000000..aec23b63eb --- /dev/null +++ b/assets/contributors.json @@ -0,0 +1,108 @@ +{ + "contributors": [ + { + "contributor": "Noémie", + "commits": 1 + }, + { + "contributor": "Schouppe Joost", + "commits": 1 + }, + { + "contributor": "tbowdecl97", + "commits": 1 + }, + { + "contributor": "Thibault Molleman", + "commits": 1 + }, + { + "contributor": "Tomas Fiers", + "commits": 1 + }, + { + "contributor": "David Haberthür", + "commits": 2 + }, + { + "contributor": "graveelius", + "commits": 2 + }, + { + "contributor": "pbarban", + "commits": 2 + }, + { + "contributor": "Sebastian Kürten", + "commits": 2 + }, + { + "contributor": "Stanislas Gueniffey", + "commits": 2 + }, + { + "contributor": "Mateusz Konieczny", + "commits": 4 + }, + { + "contributor": "dependabot[bot]", + "commits": 5 + }, + { + "contributor": "pelderson", + "commits": 6 + }, + { + "contributor": "Binnette", + "commits": 7 + }, + { + "contributor": "Flo Edelmann", + "commits": 7 + }, + { + "contributor": "Joost", + "commits": 7 + }, + { + "contributor": "yopaseopor", + "commits": 7 + }, + { + "contributor": "Midgard", + "commits": 8 + }, + { + "contributor": "Bavo Vanderghote", + "commits": 12 + }, + { + "contributor": "ToastHawaii", + "commits": 15 + }, + { + "contributor": "Pieter Fiers", + "commits": 31 + }, + { + "contributor": "Win Olario", + "commits": 31 + }, + { + "contributor": "Christian Neumann", + "commits": 33 + }, + { + "contributor": "Tobias", + "commits": 35 + }, + { + "contributor": "pietervdvn", + "commits": 512 + }, + { + "contributor": "Pieter Vander Vennet", + "commits": 669 + } + ] +} \ No newline at end of file diff --git a/package.json b/package.json index 79274e5ed5..f10a30c321 100644 --- a/package.json +++ b/package.json @@ -20,18 +20,19 @@ "generate:layeroverview": "ts-node scripts/generateLayerOverview.ts --no-fail", "generate:licenses": "ts-node scripts/generateLicenseInfo.ts --no-fail", "generate:report": "cd Docs/Tools && ./compileStats.sh && git commit . -m 'New statistics ands graphs' && git push", + "generate:contributor-list": "git log --pretty='%aN' | sort | uniq -c | sort -h| sed 's/ *\\([0-9]*\\) \\(.*\\)$/{\"contributor\":\"\\2\", \"commits\":\\1}/' | tr '\\n' ',' | sed 's/^/{\"contributors\":[/' | sed 's/,$/]}/' > assets/contributors.json", "validate:layeroverview": "ts-node scripts/generateLayerOverview.ts --report", "validate:licenses": "ts-node scripts/generateLicenseInfo.ts --report", "optimize-images": "cd assets/generated/ && find -name '*.png' -exec optipng '{}' \\; && echo 'PNGs are optimized'", "reset:layeroverview": "echo '{\"layers\":[], \"themes\":[]}' > ./assets/generated/known_layers_and_themes.json", "generate": "mkdir -p ./assets/generated && npm run reset:layeroverview && npm run generate:images && npm run generate:translations && npm run generate:licenses && npm run generate:licenses && npm run generate:layeroverview", "build": "rm -rf dist/ && npm run generate && parcel build --public-url ./ *.html assets/** assets/**/** assets/**/**/** vendor/* vendor/*/*", - "prepare-deploy": "npm run generate && npm run test && npm run generate:editor-layer-index && npm run generate:layouts && npm run generate:layeroverview && npm run build && rm -rf .cache && npm run generate:docs", + "prepare-deploy": "npm run generate && npm run test && npm run generate:editor-layer-index && npm run generate:layeroverview && npm run generate:layouts && npm run build && rm -rf .cache && npm run generate:docs", "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:pietervdvn": "cd /home/pietervdvn/git/pietervdvn.github.io/ && git pull && cd - && 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", "deploy:production": "rm -rf ./assets/generated && npm run prepare-deploy && npm run optimize-images && rm -rf /home/pietervdvn/git/mapcomplete.github.io/* && cp -r dist/* /home/pietervdvn/git/mapcomplete.github.io/ && cd /home/pietervdvn/git/mapcomplete.github.io/ && echo \"mapcomplete.osm.be\" > CNAME && git add * && git commit -m 'New MapComplete Version' && git push && cd - && npm run clean", "lint": "tslint --project . -c tslint.json '**.ts' ", - "clean": "rm -rf .cache/ && (find *.html | grep -v \"\\(index\\|land\\|test\\|preferences\\|customGenerator\\).html\" | xargs rm) && rm *.webmanifest" + "clean": "rm -rf .cache/ && (find *.html | grep -v \"\\(index\\|land\\|test\\|preferences\\|customGenerator\\).html\" | xargs rm) && rm *.webmanifest" }, "keywords": [ "OpenStreetMap", diff --git a/scripts/generateLayouts.ts b/scripts/generateLayouts.ts index 1a3539bd65..17024c9301 100644 --- a/scripts/generateLayouts.ts +++ b/scripts/generateLayouts.ts @@ -52,11 +52,12 @@ async function createIcon(iconPath: string, size: number) { return newname; } -async function createManifest(layout: LayoutConfig, relativePath: string) { +async function createManifest(layout: LayoutConfig) { const name = layout.id; Translation.forcedLanguage = "en" const icons = []; + let icon = layout.icon; if (icon.endsWith(".svg") || icon.startsWith(" { + createManifest(layout).then(manifObj => { const manif = JSON.stringify(manifObj, undefined, 2); const manifestLocation = encodeURIComponent(layout.id.toLowerCase()) + ".webmanifest"; writeFile(manifestLocation, manif, err); @@ -215,7 +215,7 @@ createManifest(new LayoutConfig({ title: {en:"MapComplete"}, version: Constants.vNumber, description: {en:"A thematic map viewer and editor based on OpenStreetMap"} -}), "").then(manifObj => { +})).then(manifObj => { const manif = JSON.stringify(manifObj, undefined, 2); writeFileSync("index.manifest", manif) }) diff --git a/scripts/generateTranslations.ts b/scripts/generateTranslations.ts index 55946aacd8..7e06c4d578 100644 --- a/scripts/generateTranslations.ts +++ b/scripts/generateTranslations.ts @@ -34,11 +34,11 @@ function genTranslations() { const translations = JSON.parse(fs.readFileSync("./assets/translations.json", "utf-8")) const transformed = transformTranslation(translations); - let module = `import {Translation} from "./UI/i18n/Translation"\n\nexport default class AllTranslationAssets {\n\n`; + let module = `import {Translation} from "../../UI/i18n/Translation"\n\nexport default class CompiledTranslations {\n\n`; module += " public static t = " + transformed; module += "}" - fs.writeFileSync("AllTranslationAssets.ts", module); + fs.writeFileSync("./assets/generated/CompiledTranslations.ts", module); }