Make root folder less busy

- Move `mobile_files` into `mobile/js_files`
- Move `desktop_files` into `desktop/js_files`

Signed-off-by: Pedro Pombeiro <pombeirp@users.noreply.github.com>
This commit is contained in:
Pedro Pombeiro 2019-09-12 16:30:56 +02:00
parent 8209bf260c
commit e3e8e218ad
No known key found for this signature in database
GPG Key ID: C4A24185B2AA48A1
15 changed files with 16 additions and 17 deletions

1
.github/CODEOWNERS vendored
View File

@ -25,7 +25,6 @@
/components @status-im/status-core-ui /components @status-im/status-core-ui
desktop/ @vkjr desktop/ @vkjr
/desktop_files @vkjr
modules/react-native-desktop*/ @vkjr modules/react-native-desktop*/ @vkjr
modules/react-native-desktop*/ @vkjr modules/react-native-desktop*/ @vkjr

2
.gitignore vendored
View File

@ -122,7 +122,7 @@ fastlane/README.md
# emacs # emacs
.dir-locals.el .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-lock.json
/package.json /package.json
/metro.config.js /metro.config.js

View File

@ -14,9 +14,9 @@ let
react-native-deps = callPackage ./maven/reactnative-android-native-deps.nix { inherit stdenvNoCC; }; react-native-deps = callPackage ./maven/reactnative-android-native-deps.nix { inherit stdenvNoCC; };
createMobileFilesSymlinks = root: '' createMobileFilesSymlinks = root: ''
ln -sf ${root}/mobile_files/package.json ${root}/package.json ln -sf ${root}/mobile/js_files/package.json ${root}/package.json
ln -sf ${root}/mobile_files/metro.config.js ${root}/metro.config.js ln -sf ${root}/mobile/js_files/metro.config.js ${root}/metro.config.js
ln -sf ${root}/mobile_files/yarn.lock ${root}/yarn.lock ln -sf ${root}/mobile/js_files/yarn.lock ${root}/yarn.lock
''; '';
# fake build to pre-download deps into fixed-output derivation # fake build to pre-download deps into fixed-output derivation
@ -30,7 +30,7 @@ let
stdenv.mkDerivation { stdenv.mkDerivation {
name = "patched-android-gradle-and-npm-modules"; name = "patched-android-gradle-and-npm-modules";
src = 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 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; inherit path;
name = "status-react-source-gradle-install"; 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 # Keep this filter as restrictive as possible in order to avoid unnecessary rebuilds and limit closure size
mkFilter { mkFilter {
dirRootsToInclude = [ dirRootsToInclude = [
"android" "mobile_files" "resources" "android" "mobile/js_files" "resources"
"translations" "status-modules" "translations" "status-modules"
]; ];
dirsToExclude = [ ".git" ".svn" "CVS" ".hg" ".gradle" "build" "intermediates" "libs" "obj" ]; dirsToExclude = [ ".git" ".svn" "CVS" ".hg" ".gradle" "build" "intermediates" "libs" "obj" ];

View File

@ -39,7 +39,7 @@ in stdenv.mkDerivation {
# Keep this filter as restrictive as possible in order to avoid unnecessary rebuilds and limit closure size # Keep this filter as restrictive as possible in order to avoid unnecessary rebuilds and limit closure size
mkFilter { mkFilter {
dirRootsToInclude = [ dirRootsToInclude = [
"mobile_files" "mobile/js_files"
"modules/react-native-status/android" "modules/react-native-status/android"
"resources" "resources"
]; ];

View File

@ -7,9 +7,9 @@ let
createMobileFilesSymlinks = root: '' createMobileFilesSymlinks = root: ''
# Set up symlinks to mobile enviroment in project root # Set up symlinks to mobile enviroment in project root
ln -sf ${root}/mobile_files/package.json ${root}/package.json ln -sf ${root}/mobile/js_files/package.json ${root}/package.json
ln -sf ${root}/mobile_files/metro.config.js ${root}/metro.config.js ln -sf ${root}/mobile/js_files/metro.config.js ${root}/metro.config.js
ln -sf ${root}/mobile_files/yarn.lock ${root}/yarn.lock ln -sf ${root}/mobile/js_files/yarn.lock ${root}/yarn.lock
''; '';
src = src =
@ -20,7 +20,7 @@ let
filter = filter =
# Keep this filter as restrictive as possible in order to avoid unnecessary rebuilds and limit closure size # Keep this filter as restrictive as possible in order to avoid unnecessary rebuilds and limit closure size
mkFilter { mkFilter {
dirRootsToInclude = [ "mobile_files" ]; dirRootsToInclude = [ "mobile/js_files" ];
dirsToExclude = [ ".git" ".svn" "CVS" ".hg" ]; dirsToExclude = [ ".git" ".svn" "CVS" ".hg" ];
filesToInclude = [ ".babelrc" ]; filesToInclude = [ ".babelrc" ];
root = path; root = path;

View File

@ -8,8 +8,8 @@ let
rev = "3cc020e384ce2a439813adb7a0cc772a034d90bb"; rev = "3cc020e384ce2a439813adb7a0cc772a034d90bb";
sha256 = "0h2kzdfiw43rbiiffpqq9lkhvdv8mgzz2w29pzrxgv8d39x67vr9"; sha256 = "0h2kzdfiw43rbiiffpqq9lkhvdv8mgzz2w29pzrxgv8d39x67vr9";
}) { inherit pkgs nodejs yarn; }; }) { inherit pkgs nodejs yarn; };
yarnLock = ../../mobile_files/yarn.lock; yarnLock = ../../mobile/js_files/yarn.lock;
packageJSON = ../../mobile_files/package.json; packageJSON = ../../mobile/js_files/package.json;
packageJSONContent = importJSON packageJSON; packageJSONContent = importJSON packageJSON;
# Create a yarn package for our project that contains all the dependecies, so that we have a # Create a yarn package for our project that contains all the dependecies, so that we have a

View File

@ -2,6 +2,6 @@ const blacklist = require('metro').createBlacklist;
module.exports = { module.exports = {
getBlacklistRE: function() { getBlacklistRE: function() {
return blacklist([/desktop_files\/.*/]); return blacklist([/desktop\/js_files\/.*/]);
} }
}; };

View File

@ -114,7 +114,7 @@ function buildJSBundle() {
function compile() { function compile() {
# Temporarily add path to javascript bundle to package.json # Temporarily add path to javascript bundle to package.json
local jsBundleLine="\"desktopJSBundlePath\": \"$JS_BUNDLE_PATH\"" 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) local tmp=$(mktemp)
jq ".=(. + {$jsBundleLine})" "$jsPackagePath" > "$tmp" && mv "$tmp" "$jsPackagePath" jq ".=(. + {$jsBundleLine})" "$jsPackagePath" > "$tmp" && mv "$tmp" "$jsPackagePath"
echo -e "${YELLOW}Added 'desktopJSBundlePath' line to $jsPackagePath:${NC}" echo -e "${YELLOW}Added 'desktopJSBundlePath' line to $jsPackagePath:${NC}"

View File

@ -14,7 +14,7 @@ RED='\033[0;31m'
GREEN='\033[0;32m' GREEN='\033[0;32m'
YELLOW='\033[1;33m' YELLOW='\033[1;33m'
NC='\033[0m' NC='\033[0m'
PLATFORM_FOLDER="desktop_files" PLATFORM_FOLDER="desktop/js_files"
$GIT_ROOT/scripts/run-environment-check.sh desktop $GIT_ROOT/scripts/run-environment-check.sh desktop