From 6fc8f4dfe31cd2919422226a6296754cfb2e21fe Mon Sep 17 00:00:00 2001 From: Martin Raifer Date: Fri, 18 Nov 2022 12:44:34 +0100 Subject: [PATCH] add `npm run dist translations` command and don't purge translations on `npm run dist` --- CHANGELOG.md | 1 + scripts/dist.js | 15 +++++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c9393111..036d8484 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ _Breaking developer changes, which may affect downstream projects or sites that #### Development * Upgrade schema-builder to version 5.2, updates transifex API to v3 (see also [iD#9375]) +* Don't purge and re-fetch translations when running `npm run dist`: To do a "full" dist run – including updated translations – one can run `npm run dist translations` now. [iD#9375]: https://github.com/openstreetmap/iD/pull/9375 diff --git a/scripts/dist.js b/scripts/dist.js index af5baadf..6abb6a19 100644 --- a/scripts/dist.js +++ b/scripts/dist.js @@ -1,5 +1,15 @@ import schemaBuilder from '@ideditor/schema-builder'; +let translationOptions = {}; +if (process.argv.includes('translations')) { + translationOptions = { + translOrgId: 'openstreetmap', + translProjectId: 'id-editor', + translResourceIds: ['presets'], + translReviewedOnly: ['vi'] + }; +} + schemaBuilder.buildDist({ taginfoProjectInfo: { name: 'iD Tagging Schema', @@ -9,8 +19,5 @@ schemaBuilder.buildDist({ contact_name: 'Martin Raifer', contact_email: 'martin@raifer.tech' }, - translOrgId: 'openstreetmap', - translProjectId: 'id-editor', - translResourceIds: ['presets'], - translReviewedOnly: ['vi'] + ...translationOptions });