From e3e8e218ad390ff97c5ec7b19b7422aff7bcb48c Mon Sep 17 00:00:00 2001 From: Pedro Pombeiro Date: Thu, 12 Sep 2019 16:30:56 +0200 Subject: [PATCH] Make root folder less busy - Move `mobile_files` into `mobile/js_files` - Move `desktop_files` into `desktop/js_files` Signed-off-by: Pedro Pombeiro --- .github/CODEOWNERS | 1 - .gitignore | 2 +- {desktop_files => desktop/js_files}/package.json | 0 {desktop_files => desktop/js_files}/yarn.lock | 0 {mobile_files => mobile/js_files}/DEPENDENCIES.md | 0 {mobile_files => mobile/js_files}/metro.config.js | 0 {mobile_files => mobile/js_files}/package.json | 0 {mobile_files => mobile/js_files}/yarn.lock | 0 nix/mobile/android/maven-and-npm-deps/default.nix | 10 +++++----- nix/mobile/android/targets/release-android.nix | 2 +- nix/mobile/ios/default.nix | 8 ++++---- nix/mobile/node-package.nix | 4 ++-- rn-cli.config.js | 2 +- scripts/build-desktop.sh | 2 +- scripts/prepare-for-desktop-platform.sh | 2 +- 15 files changed, 16 insertions(+), 17 deletions(-) rename {desktop_files => desktop/js_files}/package.json (100%) rename {desktop_files => desktop/js_files}/yarn.lock (100%) rename {mobile_files => mobile/js_files}/DEPENDENCIES.md (100%) rename {mobile_files => mobile/js_files}/metro.config.js (100%) rename {mobile_files => mobile/js_files}/package.json (100%) rename {mobile_files => mobile/js_files}/yarn.lock (100%) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 9847ec9416..fa97fcbacd 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -25,7 +25,6 @@ /components @status-im/status-core-ui desktop/ @vkjr -/desktop_files @vkjr modules/react-native-desktop*/ @vkjr modules/react-native-desktop*/ @vkjr diff --git a/.gitignore b/.gitignore index cb36deab75..9c249a73e0 100644 --- a/.gitignore +++ b/.gitignore @@ -122,7 +122,7 @@ fastlane/README.md # emacs .dir-locals.el -#ignore platform-specific files in the root since they are only symlinks to files in folders 'desktop_files' and 'mobile_files' +#ignore platform-specific files in the root since they are only symlinks to files in folders 'desktop/js_files' and 'mobile/js_files' /package-lock.json /package.json /metro.config.js diff --git a/desktop_files/package.json b/desktop/js_files/package.json similarity index 100% rename from desktop_files/package.json rename to desktop/js_files/package.json diff --git a/desktop_files/yarn.lock b/desktop/js_files/yarn.lock similarity index 100% rename from desktop_files/yarn.lock rename to desktop/js_files/yarn.lock diff --git a/mobile_files/DEPENDENCIES.md b/mobile/js_files/DEPENDENCIES.md similarity index 100% rename from mobile_files/DEPENDENCIES.md rename to mobile/js_files/DEPENDENCIES.md diff --git a/mobile_files/metro.config.js b/mobile/js_files/metro.config.js similarity index 100% rename from mobile_files/metro.config.js rename to mobile/js_files/metro.config.js diff --git a/mobile_files/package.json b/mobile/js_files/package.json similarity index 100% rename from mobile_files/package.json rename to mobile/js_files/package.json diff --git a/mobile_files/yarn.lock b/mobile/js_files/yarn.lock similarity index 100% rename from mobile_files/yarn.lock rename to mobile/js_files/yarn.lock diff --git a/nix/mobile/android/maven-and-npm-deps/default.nix b/nix/mobile/android/maven-and-npm-deps/default.nix index eb640bea29..75737e5027 100644 --- a/nix/mobile/android/maven-and-npm-deps/default.nix +++ b/nix/mobile/android/maven-and-npm-deps/default.nix @@ -14,9 +14,9 @@ let react-native-deps = callPackage ./maven/reactnative-android-native-deps.nix { inherit stdenvNoCC; }; createMobileFilesSymlinks = root: '' - ln -sf ${root}/mobile_files/package.json ${root}/package.json - ln -sf ${root}/mobile_files/metro.config.js ${root}/metro.config.js - ln -sf ${root}/mobile_files/yarn.lock ${root}/yarn.lock + ln -sf ${root}/mobile/js_files/package.json ${root}/package.json + ln -sf ${root}/mobile/js_files/metro.config.js ${root}/metro.config.js + ln -sf ${root}/mobile/js_files/yarn.lock ${root}/yarn.lock ''; # fake build to pre-download deps into fixed-output derivation @@ -30,7 +30,7 @@ let stdenv.mkDerivation { name = "patched-android-gradle-and-npm-modules"; src = - let path = ./../../../..; # Import the root /android and /mobile_files folders clean of any build artifacts + let path = ./../../../..; # Import the root /android and /mobile/js_files folders clean of any build artifacts in builtins.path { # We use builtins.path so that we can name the resulting derivation, otherwise the name would be taken from the checkout directory, which is outside of our control inherit path; name = "status-react-source-gradle-install"; @@ -38,7 +38,7 @@ let # Keep this filter as restrictive as possible in order to avoid unnecessary rebuilds and limit closure size mkFilter { dirRootsToInclude = [ - "android" "mobile_files" "resources" + "android" "mobile/js_files" "resources" "translations" "status-modules" ]; dirsToExclude = [ ".git" ".svn" "CVS" ".hg" ".gradle" "build" "intermediates" "libs" "obj" ]; diff --git a/nix/mobile/android/targets/release-android.nix b/nix/mobile/android/targets/release-android.nix index 46b055ce95..cd301410a0 100644 --- a/nix/mobile/android/targets/release-android.nix +++ b/nix/mobile/android/targets/release-android.nix @@ -39,7 +39,7 @@ in stdenv.mkDerivation { # Keep this filter as restrictive as possible in order to avoid unnecessary rebuilds and limit closure size mkFilter { dirRootsToInclude = [ - "mobile_files" + "mobile/js_files" "modules/react-native-status/android" "resources" ]; diff --git a/nix/mobile/ios/default.nix b/nix/mobile/ios/default.nix index 45b1d9359b..9d082d55f2 100644 --- a/nix/mobile/ios/default.nix +++ b/nix/mobile/ios/default.nix @@ -7,9 +7,9 @@ let createMobileFilesSymlinks = root: '' # Set up symlinks to mobile enviroment in project root - ln -sf ${root}/mobile_files/package.json ${root}/package.json - ln -sf ${root}/mobile_files/metro.config.js ${root}/metro.config.js - ln -sf ${root}/mobile_files/yarn.lock ${root}/yarn.lock + ln -sf ${root}/mobile/js_files/package.json ${root}/package.json + ln -sf ${root}/mobile/js_files/metro.config.js ${root}/metro.config.js + ln -sf ${root}/mobile/js_files/yarn.lock ${root}/yarn.lock ''; src = @@ -20,7 +20,7 @@ let filter = # Keep this filter as restrictive as possible in order to avoid unnecessary rebuilds and limit closure size mkFilter { - dirRootsToInclude = [ "mobile_files" ]; + dirRootsToInclude = [ "mobile/js_files" ]; dirsToExclude = [ ".git" ".svn" "CVS" ".hg" ]; filesToInclude = [ ".babelrc" ]; root = path; diff --git a/nix/mobile/node-package.nix b/nix/mobile/node-package.nix index 02f785b5a3..98ea213c2d 100644 --- a/nix/mobile/node-package.nix +++ b/nix/mobile/node-package.nix @@ -8,8 +8,8 @@ let rev = "3cc020e384ce2a439813adb7a0cc772a034d90bb"; sha256 = "0h2kzdfiw43rbiiffpqq9lkhvdv8mgzz2w29pzrxgv8d39x67vr9"; }) { inherit pkgs nodejs yarn; }; - yarnLock = ../../mobile_files/yarn.lock; - packageJSON = ../../mobile_files/package.json; + yarnLock = ../../mobile/js_files/yarn.lock; + packageJSON = ../../mobile/js_files/package.json; packageJSONContent = importJSON packageJSON; # Create a yarn package for our project that contains all the dependecies, so that we have a diff --git a/rn-cli.config.js b/rn-cli.config.js index 34ab86b8d6..40fec8e6fe 100644 --- a/rn-cli.config.js +++ b/rn-cli.config.js @@ -2,6 +2,6 @@ const blacklist = require('metro').createBlacklist; module.exports = { getBlacklistRE: function() { - return blacklist([/desktop_files\/.*/]); + return blacklist([/desktop\/js_files\/.*/]); } }; diff --git a/scripts/build-desktop.sh b/scripts/build-desktop.sh index d659111814..1e82c2c891 100755 --- a/scripts/build-desktop.sh +++ b/scripts/build-desktop.sh @@ -114,7 +114,7 @@ function buildJSBundle() { function compile() { # Temporarily add path to javascript bundle to package.json local jsBundleLine="\"desktopJSBundlePath\": \"$JS_BUNDLE_PATH\"" - local jsPackagePath=$(joinExistingPath "$STATUS_REACT_HOME" 'desktop_files/package.json') + local jsPackagePath=$(joinExistingPath "$STATUS_REACT_HOME" 'desktop/js_files/package.json') local tmp=$(mktemp) jq ".=(. + {$jsBundleLine})" "$jsPackagePath" > "$tmp" && mv "$tmp" "$jsPackagePath" echo -e "${YELLOW}Added 'desktopJSBundlePath' line to $jsPackagePath:${NC}" diff --git a/scripts/prepare-for-desktop-platform.sh b/scripts/prepare-for-desktop-platform.sh index 62ef96a5b4..5ccc11828a 100755 --- a/scripts/prepare-for-desktop-platform.sh +++ b/scripts/prepare-for-desktop-platform.sh @@ -14,7 +14,7 @@ RED='\033[0;31m' GREEN='\033[0;32m' YELLOW='\033[1;33m' NC='\033[0m' -PLATFORM_FOLDER="desktop_files" +PLATFORM_FOLDER="desktop/js_files" $GIT_ROOT/scripts/run-environment-check.sh desktop