Skip to content

Commit

Permalink
Merge pull request #53 from shoutem/hotfix/2.2.2
Browse files Browse the repository at this point in the history
Hotfix/2.2.2
  • Loading branch information
Definitely-Not-Vlad authored Mar 24, 2020
2 parents 699ebcc + 4db44f4 commit 9195513
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 14 deletions.
3 changes: 3 additions & 0 deletions android/constants.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ project.ext {
supportLibVersion = '28.0.0'
googlePlayServicesVersion = '15.0.0'

// some native packages use firebaseVersion, some use firebaseCoreVersion
// in both, we want them to use these versions
firebaseVersion = '16.0.3'
firebaseCoreVersion = '16.0.3'
firebaseMessagingVersion = '17.6.0'
}
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shoutem/platform",
"version": "2.2.1",
"version": "2.2.2",
"scripts": {
"start": "react-native start",
"setup": "cd scripts && yarn install",
Expand All @@ -9,7 +9,7 @@
"bundle": "node scripts/bundle",
"build": "node scripts/build",
"list-dependencies": "node scripts/platform-dependencies",
"jetify": "jetify"
"postinstall": "node scripts/postinstall"
},
"dependencies": {
"es6-symbol": "3.1.1",
Expand Down Expand Up @@ -44,9 +44,7 @@
"eslint-plugin-react": "~7.12.4",
"eslint-plugin-react-native": "~3.6.0",
"jest": "^24.9.0",
"jetifier": "^1.6.5",
"metro-react-native-babel-preset": "^0.56.0",
"patch-package": "6.2.0",
"react-test-renderer": "16.8.6"
},
"jest": {
Expand Down
6 changes: 2 additions & 4 deletions package.template.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shoutem/platform",
"version": "2.2.1",
"version": "2.2.2",
"scripts": {
"start": "react-native start",
"setup": "cd scripts && yarn install",
Expand All @@ -9,7 +9,7 @@
"bundle": "node scripts/bundle",
"build": "node scripts/build",
"list-dependencies": "node scripts/platform-dependencies",
"jetify": "jetify"
"postinstall": "node scripts/postinstall"
},
"dependencies": {
"es6-symbol": "3.1.1",
Expand Down Expand Up @@ -44,9 +44,7 @@
"eslint-plugin-react": "~7.12.4",
"eslint-plugin-react-native": "~3.6.0",
"jest": "^24.9.0",
"jetifier": "^1.6.5",
"metro-react-native-babel-preset": "^0.56.0",
"patch-package": "6.2.0",
"react-test-renderer": "16.8.6"
},
"jest": {
Expand Down
12 changes: 6 additions & 6 deletions platform/platform.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": "2.2.1",
"mobileAppVersion": "2.2.1",
"releaseNotes": "* Introduce navigation item text size change\n* Bugfixes and improvements",
"version": "2.2.2",
"mobileAppVersion": "2.2.2",
"releaseNotes": "* Introduce better and simpler patch-package support\n* Bugfixes and improvements",
"settings": {
"DEV-appetizeKey": "90dycv9gb098u6xytcb6jnkvw8",
"QA-appetizeKey": "p0rrung10fm80qjkfzd8xyb11w",
Expand All @@ -25,20 +25,20 @@
"shoutem.about": "~2.2.2",
"shoutem.analytics": "~2.2.0",
"shoutem.application": "~2.2.4",
"shoutem.audio": "~2.2.5",
"shoutem.audio": "~2.2.6",
"shoutem.auth": "~2.2.5",
"shoutem.books": "~2.2.3",
"shoutem.camera": "~2.2.4",
"shoutem.cms": "~2.2.3",
"shoutem.code-push": "~2.2.0",
"shoutem.deals": "~2.2.4",
"shoutem.deals": "~2.2.6",
"shoutem.events": "~2.2.2",
"shoutem.favorites": "~2.2.2",
"shoutem.flurry-analytics": "~2.2.1",
"shoutem.i18n": "~2.2.0",
"shoutem.ical-events": "~2.2.2",
"shoutem.layouts": "~2.2.0",
"shoutem.loyalty": "~2.2.7",
"shoutem.loyalty": "~2.2.8",
"shoutem.menu": "~2.2.2",
"shoutem.navigation": "~2.2.3",
"shoutem.news": "~2.2.2",
Expand Down
1 change: 1 addition & 0 deletions scripts/classes/app-binary-configurator.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ function downloadAndResizeImage(imageUrl, downloadPath, resizeConfig, production
Jimp.read(imagePath)
.then((imageFile) =>
imageFile
.rgba(!_.endsWith(image.savePath, 'marketing.png'))
.cover(image.width, image.height)
.write(image.savePath)
)
Expand Down
57 changes: 57 additions & 0 deletions scripts/postinstall.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
const { execSync } = require('child_process');
const fs = require('fs-extra');
const { prependProjectPath } = require('./helpers');

const NODE_MODULES_DIR = prependProjectPath('node_modules');

// returns all downloaded extensions found in the extensions directory
function fetchAllExtensions() {
const extensionsDir = prependProjectPath('extensions');

const listOfExtensions = fs.readdirSync(
prependProjectPath('extensions'),
{ withFileTypes: true },
).filter(file => {
// Depending on the environment's OS, 'file' can be an object or just the
// name string, so we do an explicit check
if (typeof file === 'object' && file !== null) {
return fs.lstatSync(`${extensionsDir}/${file.name}`).isDirectory();
}

return fs.lstatSync(`${extensionsDir}/${file}`).isDirectory();
});

return listOfExtensions;
}

// use patch-package to apply patches provided by extensions
function applyExtensionPatches() {
const extensions = fetchAllExtensions();

if (!extensions.length) {
return;
}

console.log("Checking for patch-package patches...");
extensions.map((extension) => {
// Depending on the environment's OS, 'extension' can be an object or just
// the name string, so we do an explicit check
const extensionName = typeof extension === 'object'
? extension.name : extension;
const patchPath = `node_modules/${extensionName}/patch`;

if (!fs.existsSync(patchPath)) {
return;
}

console.log(`[${extensionName}] - applying patches`)
return execSync(`npx patch-package --patch-dir ${patchPath}`);
});
console.log("Applied all existing patches found.")
}

applyExtensionPatches();

// use jetifier to update from android.support to androidx
console.log("Jetifying node_modules");
execSync('npx jetifier');

0 comments on commit 9195513

Please sign in to comment.