From d33d2569b6f4bcf0761e5d436bd36f066ad9f109 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Stefa=C5=84czyk?= Date: Wed, 8 May 2024 16:46:31 +0200 Subject: [PATCH] fix/ci: build backend post install, create directory when building translations (#326) * fix/ci: build backend post install, create directory when building translations --- app.config.js | 6 + package-lock.json | 252 +++++++++++++++++++++++++++++++++- package.json | 4 +- scripts/build-translations.js | 1 + 4 files changed, 260 insertions(+), 3 deletions(-) diff --git a/app.config.js b/app.config.js index a3feb907b..6f3aca24c 100644 --- a/app.config.js +++ b/app.config.js @@ -32,4 +32,10 @@ module.exports = ({config}) => ({ package: 'com.comapeo' + SUFFIX, googleServicesFile: process.env.GOOGLE_SERVICES_JSON, }, + updates: { + url: 'https://u.expo.dev/2d5b8137-12ec-45aa-9c23-56b6a1c522b7', + }, + runtimeVersion: { + policy: 'appVersion', + }, }); diff --git a/package-lock.json b/package-lock.json index 1ca26d263..43399c618 100644 --- a/package-lock.json +++ b/package-lock.json @@ -42,6 +42,7 @@ "expo-status-bar": "~1.11.1", "expo-system-ui": "^2.9.4", "expo-task-manager": "~11.7.3", + "expo-updates": "^0.25.9", "geojson": "^0.5.0", "geojson-geometries-lookup": "^0.5.0", "lodash.isequal": "^4.5.0", @@ -12871,6 +12872,11 @@ "node": ">=10" } }, + "node_modules/expo-eas-client": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/expo-eas-client/-/expo-eas-client-0.12.0.tgz", + "integrity": "sha512-Jkww9Cwpv0z7DdLYiRX0r4fqBEcI9cKqTn7cHx63S09JaZ2rcwEE4zYHgrXwjahO+tU2VW8zqH+AJl6RhhW4zA==" + }, "node_modules/expo-file-system": { "version": "16.0.9", "resolved": "https://registry.npmjs.org/expo-file-system/-/expo-file-system-16.0.9.tgz", @@ -13080,6 +13086,11 @@ "resolved": "https://registry.npmjs.org/expo-status-bar/-/expo-status-bar-1.11.1.tgz", "integrity": "sha512-ddQEtCOgYHTLlFUe/yH67dDBIoct5VIULthyT3LRJbEwdpzAgueKsX2FYK02ldh440V87PWKCamh7R9evk1rrg==" }, + "node_modules/expo-structured-headers": { + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/expo-structured-headers/-/expo-structured-headers-3.8.0.tgz", + "integrity": "sha512-R+gFGn0x5CWl4OVlk2j1bJTJIz4KO8mPoCHpRHmfqMjmrMvrOM0qQSY3V5NHXwp1yT/L2v8aUmFQsBRIdvi1XA==" + }, "node_modules/expo-system-ui": { "version": "2.9.4", "resolved": "https://registry.npmjs.org/expo-system-ui/-/expo-system-ui-2.9.4.tgz", @@ -13103,6 +13114,34 @@ "expo": "*" } }, + "node_modules/expo-updates": { + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/expo-updates/-/expo-updates-0.25.9.tgz", + "integrity": "sha512-o2pyHhMYoTINIyqFNJq1gJOIKwySbZqxSI01bhHrOgVXJIPJmmqTFvD7p/s+XzG/NcHeyjCCS6VucR7Tif3h2g==", + "dependencies": { + "@expo/code-signing-certificates": "0.0.5", + "@expo/config": "~9.0.0-beta.0", + "@expo/config-plugins": "~8.0.0-beta.0", + "@expo/fingerprint": "^0.7.0", + "@expo/spawn-async": "^1.7.2", + "arg": "4.1.0", + "chalk": "^4.1.2", + "expo-eas-client": "~0.12.0", + "expo-manifests": "~0.14.0", + "expo-structured-headers": "~3.8.0", + "expo-updates-interface": "~0.16.0", + "fast-glob": "^3.3.2", + "fbemitter": "^3.0.0", + "ignore": "^5.3.1", + "resolve-from": "^5.0.0" + }, + "bin": { + "expo-updates": "bin/cli.js" + }, + "peerDependencies": { + "expo": "*" + } + }, "node_modules/expo-updates-interface": { "version": "0.15.3", "resolved": "https://registry.npmjs.org/expo-updates-interface/-/expo-updates-interface-0.15.3.tgz", @@ -13111,6 +13150,214 @@ "expo": "*" } }, + "node_modules/expo-updates/node_modules/@babel/code-frame": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", + "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", + "dependencies": { + "@babel/highlight": "^7.10.4" + } + }, + "node_modules/expo-updates/node_modules/@expo/config": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/@expo/config/-/config-9.0.1.tgz", + "integrity": "sha512-0tjaXBstTbXmD4z+UMFBkh2SZFwilizSQhW6DlaTMnPG5ezuw93zSFEWAuEC3YzkpVtNQTmYzxAYjxwh6seOGg==", + "dependencies": { + "@babel/code-frame": "~7.10.4", + "@expo/config-plugins": "~8.0.0-beta.0", + "@expo/config-types": "^51.0.0-unreleased", + "@expo/json-file": "^8.3.0", + "getenv": "^1.0.0", + "glob": "7.1.6", + "require-from-string": "^2.0.2", + "resolve-from": "^5.0.0", + "semver": "^7.6.0", + "slugify": "^1.3.4", + "sucrase": "3.34.0" + } + }, + "node_modules/expo-updates/node_modules/@expo/config-plugins": { + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/@expo/config-plugins/-/config-plugins-8.0.4.tgz", + "integrity": "sha512-Hi+xuyNWE2LT4LVbGttHJgl9brnsdWAhEB42gWKb5+8ae86Nr/KwUBQJsJppirBYTeLjj5ZlY0glYnAkDa2jqw==", + "dependencies": { + "@expo/config-types": "^51.0.0-unreleased", + "@expo/json-file": "~8.3.0", + "@expo/plist": "^0.1.0", + "@expo/sdk-runtime-versions": "^1.0.0", + "chalk": "^4.1.2", + "debug": "^4.3.1", + "find-up": "~5.0.0", + "getenv": "^1.0.0", + "glob": "7.1.6", + "resolve-from": "^5.0.0", + "semver": "^7.5.4", + "slash": "^3.0.0", + "slugify": "^1.6.6", + "xcode": "^3.0.1", + "xml2js": "0.6.0" + } + }, + "node_modules/expo-updates/node_modules/@expo/config-types": { + "version": "51.0.0", + "resolved": "https://registry.npmjs.org/@expo/config-types/-/config-types-51.0.0.tgz", + "integrity": "sha512-acn03/u8mQvBhdTQtA7CNhevMltUhbSrpI01FYBJwpVntufkU++ncQujWKlgY/OwIajcfygk1AY4xcNZ5ImkRA==" + }, + "node_modules/expo-updates/node_modules/@expo/fingerprint": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/@expo/fingerprint/-/fingerprint-0.7.1.tgz", + "integrity": "sha512-lbTwFiIk0lOm9zzPRvnC45GfPqXqPB3w4hDDKVma+8FDAbPCWhNN42ltLhx/ekwcHFQxURmg0fHm59k0Vy+jtw==", + "dependencies": { + "@expo/spawn-async": "^1.7.2", + "chalk": "^4.1.2", + "debug": "^4.3.4", + "find-up": "^5.0.0", + "minimatch": "^3.0.4", + "p-limit": "^3.1.0", + "resolve-from": "^5.0.0", + "semver": "^7.6.0" + }, + "bin": { + "fingerprint": "bin/cli.js" + } + }, + "node_modules/expo-updates/node_modules/@expo/spawn-async": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/@expo/spawn-async/-/spawn-async-1.7.2.tgz", + "integrity": "sha512-QdWi16+CHB9JYP7gma19OVVg0BFkvU8zNj9GjWorYI8Iv8FUxjOCcYRuAmX4s/h91e4e7BPsskc8cSrZYho9Ew==", + "dependencies": { + "cross-spawn": "^7.0.3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/expo-updates/node_modules/arg": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.0.tgz", + "integrity": "sha512-ZWc51jO3qegGkVh8Hwpv636EkbesNV5ZNQPCtRa+0qytRYPEs9IYT9qITY9buezqUH5uqyzlWLcufrzU2rffdg==" + }, + "node_modules/expo-updates/node_modules/expo-json-utils": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/expo-json-utils/-/expo-json-utils-0.13.1.tgz", + "integrity": "sha512-mlfaSArGVb+oJmUcR22jEONlgPp0wj4iNIHfQ2je9Q8WTOqMc0Ws9tUciz3JdJnhffdHqo/k8fpvf0IRmN5HPA==" + }, + "node_modules/expo-updates/node_modules/expo-manifests": { + "version": "0.14.2", + "resolved": "https://registry.npmjs.org/expo-manifests/-/expo-manifests-0.14.2.tgz", + "integrity": "sha512-hFrwIGr76/zGVhZ+vcjDZpOePd7uYNB6yCaiJcm7/bcrt2ne7cHyKQ8l+3n26/v1OuXfBfjxNH+PHIpkClszoQ==", + "dependencies": { + "@expo/config": "~9.0.0-beta.0", + "expo-json-utils": "~0.13.0" + }, + "peerDependencies": { + "expo": "*" + } + }, + "node_modules/expo-updates/node_modules/expo-updates-interface": { + "version": "0.16.1", + "resolved": "https://registry.npmjs.org/expo-updates-interface/-/expo-updates-interface-0.16.1.tgz", + "integrity": "sha512-yyG0y9HcifF0ptovHKvRyU7zz5/neGnJQI9BXrshpMwrtIGncQMpuL7vXVmmK2cg32enziPkIPDtu/bG0KoF1g==", + "peerDependencies": { + "expo": "*" + } + }, + "node_modules/expo-updates/node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/expo-updates/node_modules/glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/expo-updates/node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/expo-updates/node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/expo-updates/node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/expo-updates/node_modules/uuid": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-7.0.3.tgz", + "integrity": "sha512-DPSke0pXhTZgoF/d+WSt2QaKMCFSfx7QegxEWT+JOuHF5aWrKEn0G+ztjuJg/gG8/ItK+rbPCD/yNv8yyih6Cg==", + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/expo-updates/node_modules/xcode": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/xcode/-/xcode-3.0.1.tgz", + "integrity": "sha512-kCz5k7J7XbJtjABOvkc5lJmkiDh8VhjVCGNiqdKCscmVpdVUpEAyXv1xmCLkQJ5dsHqx3IPO4XW+NTDhU/fatA==", + "dependencies": { + "simple-plist": "^1.1.0", + "uuid": "^7.0.3" + }, + "engines": { + "node": ">=10.0.0" + } + }, "node_modules/exponential-backoff": { "version": "3.1.1", "license": "Apache-2.0" @@ -14492,8 +14739,9 @@ "license": "BSD-3-Clause" }, "node_modules/ignore": { - "version": "5.2.0", - "license": "MIT", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", + "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", "engines": { "node": ">= 4" } diff --git a/package.json b/package.json index 499d76683..104c33bd8 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,8 @@ "build:translations": "node ./scripts/build-translations.js ", "build:intl-polyfills": "node ./scripts/build-intl-polyfills.mjs", "build:backend": "node ./scripts/build-backend.mjs", - "extract-messages": "formatjs extract 'src/frontend/**/*.{ts,tsx}' --ignore='**/*.d.ts' --format crowdin --out-file ./messages/en.json" + "extract-messages": "formatjs extract 'src/frontend/**/*.{ts,tsx}' --ignore='**/*.d.ts' --format crowdin --out-file ./messages/en.json", + "eas-build-post-install": "npm run build:backend && npm run build:translations && npm run build:intl-polyfills" }, "dependencies": { "@bam.tech/react-native-image-resizer": "^3.0.7", @@ -58,6 +59,7 @@ "expo-status-bar": "~1.11.1", "expo-system-ui": "^2.9.4", "expo-task-manager": "~11.7.3", + "expo-updates": "^0.25.9", "geojson": "^0.5.0", "geojson-geometries-lookup": "^0.5.0", "lodash.isequal": "^4.5.0", diff --git a/scripts/build-translations.js b/scripts/build-translations.js index b99488966..6872348d0 100644 --- a/scripts/build-translations.js +++ b/scripts/build-translations.js @@ -49,6 +49,7 @@ async function compile() { translations[lang][key] = msgs[key].message; }); } + fs.mkdirSync(path.join(__dirname, 'translations')); const output = path.join(__dirname, '../translations/messages.json'); await writeJson(output, translations); }