Skip to content

Commit

Permalink
update cli
Browse files Browse the repository at this point in the history
  • Loading branch information
jeemercado committed Aug 11, 2024
1 parent b80d81a commit 776fe29
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 13 deletions.
2 changes: 1 addition & 1 deletion lib/index.cjs

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions src/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export const removeDir = (dir) => {

export const addScriptsInRootPackageJson = (dir) => {
const scripts = {
android: 'npx nx run-android mobile --skip-nx-cache',
'android:connect': 'cd apps/mobile && npm run android:connect',
'check-env:mobile': './check-env.sh apps/mobile/.env apps/mobile/.env.template',
clean: './clean-generated-outputs.sh',
Expand All @@ -60,12 +61,16 @@ export const addScriptsInRootPackageJson = (dir) => {
'deploy-ios:dev': 'cd apps/mobile && npm run deploy-ios:dev',
'ios-certificates': 'cd apps/mobile && npm run ios-certificates',
};
const dependencies = {
'react-native': '0.74.4',
};

const packageJsonPath = path.join(dir, 'package.json');

const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));

packageJson.scripts = { ...packageJson.scripts, ...scripts };
packageJson.dependencies = { ...packageJson.dependencies, ...dependencies };

fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2));
};
6 changes: 6 additions & 0 deletions templates/apps/mobile/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -92,18 +92,24 @@ android {
storePassword 'development'
keyAlias 'dev'
keyPassword 'development'
v1SigningEnabled true
v2SigningEnabled true
}
dev {
storeFile file('dev.keystore')
storePassword 'development'
keyAlias 'dev'
keyPassword 'development'
v1SigningEnabled true
v2SigningEnabled true
}
production {
storeFile file('production.keystore')
storePassword System.getenv("STORE_PASSWORD")
keyAlias System.getenv("KEY_ALIAS")
keyPassword System.getenv("KEY_PASSWORD")
v1SigningEnabled true
v2SigningEnabled true
}
}

Expand Down
6 changes: 3 additions & 3 deletions templates/apps/mobile/fastlane/Fastfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

require 'fileutils'

def app_name = ""
def app_name = "AppsMobile"

def delete_gradle_temp()
UI.message("Deleting Gradle Temp...")
Expand Down Expand Up @@ -291,10 +291,10 @@ platform :ios do
lane :prod do
begin
build_number = setup_ios()
ios_build_ipa("Release", "Release")
ios_build_ipa("Release", app_name)
# (Optional) Uncomment if you want to upload dSYM to Firebase Crashlytics
# upload_dysm("Release", "Prod")
publish_ipa(build_number, "Release")
publish_ipa(build_number, app_name)
rescue => exception
UI.error(exception)
end
Expand Down
5 changes: 4 additions & 1 deletion templates/apps/mobile/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@
"run-android": {
"executor": "@nx/react-native:run-android",
"dependsOn": ["ensure-symlink"],
"options": {}
"options": {
"mode": "debug",
"tasks": "installDevDebug"
}
},
"build-android": {
"executor": "@nx/react-native:build-android",
Expand Down
10 changes: 2 additions & 8 deletions templates/apps/mobile/src/app/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,8 @@ LogBox.ignoreLogs(['VirtualizedLists', 'onAnimatedValueUpdate']);

enableFreeze(true);

const MS_IN_S = 1000;
const S_IN_A_MIN = 60;
const MIN_IN_AN_HOUR = 60;
const HOURS_IN_A_DAY = 24;
const MS_IN_DAYS = MS_IN_S * S_IN_A_MIN * MIN_IN_AN_HOUR * HOURS_IN_A_DAY;

const CACHE_TIME = MS_IN_DAYS * 1;
const STALE_TIME = MS_IN_S * S_IN_A_MIN * MIN_IN_AN_HOUR; // 5 minutes
const CACHE_TIME = 0;
const STALE_TIME = 0;

const queryClient = new QueryClient({
defaultOptions: {
Expand Down

0 comments on commit 776fe29

Please sign in to comment.