mirror of
https://github.com/movie-web/native-app.git
synced 2025-09-13 13:33:26 +00:00
Merge branch 'dev' into tabs
This commit is contained in:
18
apps/mobile/.eslintrc.json
Normal file
18
apps/mobile/.eslintrc.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"extends": ["../../.eslintrc.js"],
|
||||
"ignorePatterns": ["!**/*"],
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
|
||||
"rules": {}
|
||||
},
|
||||
{
|
||||
"files": ["*.ts", "*.tsx"],
|
||||
"rules": {}
|
||||
},
|
||||
{
|
||||
"files": ["*.js", "*.jsx"],
|
||||
"rules": {}
|
||||
}
|
||||
]
|
||||
}
|
3
apps/mobile/.gitignore
vendored
3
apps/mobile/.gitignore
vendored
@@ -7,6 +7,8 @@ node_modules/
|
||||
.expo/
|
||||
dist/
|
||||
web-build/
|
||||
android/
|
||||
ios/
|
||||
|
||||
# Native
|
||||
*.orig.*
|
||||
@@ -34,6 +36,7 @@ yarn-error.*
|
||||
# typescript
|
||||
*.tsbuildinfo
|
||||
|
||||
|
||||
# @generated expo-cli sync-2b81b286409207a5da26e14c78851eb30d8ccbdb
|
||||
# The following patterns were generated by expo-cli
|
||||
|
||||
|
@@ -1,35 +1,53 @@
|
||||
{
|
||||
"expo": {
|
||||
"name": "mobile",
|
||||
"slug": "mobile",
|
||||
"name": "movie-web",
|
||||
"slug": "mw-mobile",
|
||||
"version": "1.0.0",
|
||||
"orientation": "portrait",
|
||||
"scheme":"dev.movieweb.app",
|
||||
"icon": "./assets/images/icon.png",
|
||||
"scheme": "myapp",
|
||||
"userInterfaceStyle": "automatic",
|
||||
"splash": {
|
||||
"image": "./assets/images/splash.png",
|
||||
"resizeMode": "contain",
|
||||
"backgroundColor": "#ffffff"
|
||||
},
|
||||
"assetBundlePatterns": ["**/*"],
|
||||
"jsEngine": "jsc",
|
||||
"updates": {
|
||||
"fallbackToCacheTimeout": 0
|
||||
},
|
||||
"assetBundlePatterns": [
|
||||
"**/*"
|
||||
],
|
||||
"ios": {
|
||||
"supportsTablet": true
|
||||
"supportsTablet": true,
|
||||
"bundleIdentifier": "dev.movieweb.app"
|
||||
},
|
||||
"android": {
|
||||
"adaptiveIcon": {
|
||||
"foregroundImage": "./assets/images/adaptive-icon.png",
|
||||
"backgroundColor": "#ffffff"
|
||||
}
|
||||
"backgroundColor": "#FFFFFF"
|
||||
},
|
||||
"package": "dev.movieweb.app"
|
||||
},
|
||||
"web": {
|
||||
"bundler": "metro",
|
||||
"output": "static",
|
||||
"favicon": "./assets/images/favicon.png"
|
||||
"favicon": "./assets/images/favicon.png",
|
||||
"bundler": "metro"
|
||||
},
|
||||
"plugins": ["expo-router"],
|
||||
"experiments": {
|
||||
"typedRoutes": true
|
||||
}
|
||||
"plugins": [
|
||||
"expo-router",
|
||||
[
|
||||
"@config-plugins/detox",
|
||||
{
|
||||
"skipProguard": false,
|
||||
"subdomains": [
|
||||
"10.0.2.2",
|
||||
"localhost"
|
||||
]
|
||||
}
|
||||
]
|
||||
],
|
||||
"experiments": {
|
||||
"typedRoutes": true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -19,7 +19,7 @@ export {
|
||||
// eslint-disable-next-line camelcase
|
||||
export const unstable_settings = {
|
||||
// Ensure that reloading on `/modal` keeps a back button present.
|
||||
initialRouteName: '(tabs)',
|
||||
initialRouteName: '(tabs)/index',
|
||||
};
|
||||
|
||||
// Prevent the splash screen from auto-hiding before asset loading is complete.
|
||||
|
@@ -2,9 +2,9 @@ module.exports = function (api) {
|
||||
api.cache(true);
|
||||
return {
|
||||
presets: ['babel-preset-expo'],
|
||||
plugins: [
|
||||
// Required for expo-router
|
||||
'expo-router/babel',
|
||||
],
|
||||
plugins: [
|
||||
// Required for expo-router
|
||||
'expo-router/babel',
|
||||
],
|
||||
};
|
||||
};
|
||||
|
28
apps/mobile/eas.json
Normal file
28
apps/mobile/eas.json
Normal file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"build": {
|
||||
"production": {
|
||||
"android": {
|
||||
"buildType": "app-bundle"
|
||||
}
|
||||
},
|
||||
"development": {
|
||||
"developmentClient": true,
|
||||
"distribution": "internal"
|
||||
},
|
||||
"preview": {
|
||||
"distribution": "internal",
|
||||
"ios": {
|
||||
"simulator": true
|
||||
},
|
||||
"android": {
|
||||
"buildType": "apk"
|
||||
}
|
||||
}
|
||||
},
|
||||
"submit": {
|
||||
"production": {}
|
||||
},
|
||||
"cli": {
|
||||
"version": ">= 5.2.0"
|
||||
}
|
||||
}
|
13
apps/mobile/jest.config.ts
Normal file
13
apps/mobile/jest.config.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
module.exports = {
|
||||
displayName: 'mobile',
|
||||
resolver: '@nx/jest/plugins/resolver',
|
||||
preset: 'jest-expo',
|
||||
transformIgnorePatterns: [
|
||||
'node_modules/(?!((jest-)?react-native|@react-native(-community)?)|expo(nent)?|@expo(nent)?/.*|@expo-google-fonts/.*|react-navigation|@react-navigation/.*|@unimodules/.*|unimodules|sentry-expo|native-base|react-native-svg)',
|
||||
],
|
||||
moduleFileExtensions: ['ts', 'js', 'html', 'tsx', 'jsx'],
|
||||
setupFilesAfterEnv: ['<rootDir>/test-setup.ts'],
|
||||
moduleNameMapper: {
|
||||
'\\.svg$': '@nx/expo/plugins/jest/svg-mock',
|
||||
},
|
||||
};
|
@@ -1,27 +1,36 @@
|
||||
// Learn more https://docs.expo.io/guides/customizing-metro
|
||||
const { getDefaultConfig } = require('expo/metro-config');
|
||||
const path = require('path');
|
||||
const { withNxMetro } = require('@nx/expo');
|
||||
const { getDefaultConfig } = require('@expo/metro-config');
|
||||
const { mergeConfig } = require('metro-config');
|
||||
const exclusionList = require('metro-config/src/defaults/exclusionList');
|
||||
|
||||
const projectRoot = __dirname;
|
||||
const workspaceRoot = path.resolve(projectRoot, '../..');
|
||||
const defaultConfig = getDefaultConfig(__dirname);
|
||||
const { assetExts, sourceExts } = defaultConfig.resolver;
|
||||
|
||||
/** @type {import('expo/metro-config').MetroConfig} */
|
||||
const config = getDefaultConfig(projectRoot, {
|
||||
// [Web-only]: Enables CSS support in Metro.
|
||||
isCSSEnabled: true,
|
||||
/**
|
||||
* Metro configuration
|
||||
* https://facebook.github.io/metro/docs/configuration
|
||||
*
|
||||
* @type {import('metro-config').MetroConfig}
|
||||
*/
|
||||
const customConfig = {
|
||||
transformer: {
|
||||
babelTransformerPath: require.resolve('react-native-svg-transformer'),
|
||||
},
|
||||
resolver: {
|
||||
assetExts: assetExts.filter((ext) => ext !== 'svg'),
|
||||
sourceExts: [...sourceExts, 'svg'],
|
||||
blockList: exclusionList([/^(?!.*node_modules).*\/dist\/.*/]),
|
||||
// unstable_enableSymlinks: true,
|
||||
// unstable_enablePackageExports: true,
|
||||
},
|
||||
};
|
||||
|
||||
module.exports = withNxMetro(mergeConfig(defaultConfig, customConfig), {
|
||||
// Change this to true to see debugging info.
|
||||
// Useful if you have issues resolving modules
|
||||
debug: false,
|
||||
// all the file extensions used for imports other than 'ts', 'tsx', 'js', 'jsx', 'json'
|
||||
extensions: [],
|
||||
// Specify folders to watch, in addition to Nx defaults (workspace libraries and node_modules)
|
||||
watchFolders: [],
|
||||
});
|
||||
|
||||
if (config.resolver) {
|
||||
// 1. Watch all files within the monorepo
|
||||
config.watchFolders = [workspaceRoot];
|
||||
// 2. Let Metro know where to resolve packages and in what order
|
||||
config.resolver.nodeModulesPaths = [
|
||||
path.resolve(projectRoot, 'node_modules'),
|
||||
path.resolve(workspaceRoot, 'node_modules'),
|
||||
];
|
||||
// 3. Force Metro to resolve (sub)dependencies only from the `nodeModulesPaths`
|
||||
// TODO: This is supposed to be true, but I couldn't get it to work in the monorepo.
|
||||
config.resolver.disableHierarchicalLookup = false;
|
||||
}
|
||||
|
||||
module.exports = config;
|
||||
|
@@ -2,54 +2,64 @@
|
||||
"name": "mobile",
|
||||
"main": "expo-router/entry",
|
||||
"version": "1.0.0",
|
||||
"scripts": {
|
||||
"start": "expo start",
|
||||
"android": "expo start --android",
|
||||
"ios": "expo start --ios",
|
||||
"web": "expo start --web",
|
||||
"test": "jest --watchAll",
|
||||
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
|
||||
"format": "prettier --write ."
|
||||
},
|
||||
"jest": {
|
||||
"preset": "jest-expo"
|
||||
},
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@babel/core": "*",
|
||||
"@expo/metro-config": "*",
|
||||
"@expo/vector-icons": "^13.0.0",
|
||||
"@react-navigation/native": "^6.0.2",
|
||||
"expo": "~49.0.15",
|
||||
"expo-font": "~11.4.0",
|
||||
"expo-linking": "~5.0.2",
|
||||
"expo-router": "^2.0.0",
|
||||
"@nx/expo": "*",
|
||||
"@react-navigation/native": "^6.1.9",
|
||||
"@testing-library/jest-native": "*",
|
||||
"@testing-library/react-native": "*",
|
||||
"expo": "*",
|
||||
"expo-font": "^11.4.0",
|
||||
"expo-linking": "^6.0.0",
|
||||
"expo-router": "^2.0.14",
|
||||
"expo-splash-screen": "~0.20.5",
|
||||
"expo-status-bar": "~1.6.0",
|
||||
"expo-system-ui": "~2.4.0",
|
||||
"expo-web-browser": "~12.3.2",
|
||||
"react": "18.2.0",
|
||||
"expo-status-bar": "*",
|
||||
"expo-system-ui": "^2.6.0",
|
||||
"expo-web-browser": "^12.5.0",
|
||||
"metro-config": "*",
|
||||
"pod-install": "*",
|
||||
"react": "*",
|
||||
"react-dom": "18.2.0",
|
||||
"react-native": "0.72.6",
|
||||
"react-native-gesture-handler": "~2.12.0",
|
||||
"react-native-safe-area-context": "4.6.3",
|
||||
"react-native-screens": "~3.22.0",
|
||||
"react-native-web": "~0.19.6"
|
||||
"react-native": "*",
|
||||
"react-native-gesture-handler": "^2.14.1",
|
||||
"react-native-safe-area-context": "^4.8.2",
|
||||
"react-native-screens": "^3.29.0",
|
||||
"react-native-svg": "*",
|
||||
"react-native-svg-transformer": "*",
|
||||
"react-native-web": "^0.19.10"
|
||||
},
|
||||
"scripts": {
|
||||
"eas-build-pre-install": "cd ../../ && node tools/scripts/eas-build-pre-install.mjs . apps/mobile && cp pnpm-lock.yaml apps/mobile",
|
||||
"eas-build-post-install": "cd ../../ && node tools/scripts/eas-build-post-install.mjs . apps/mobile",
|
||||
"android": "expo run:android",
|
||||
"ios": "expo run:ios",
|
||||
"test": "jest --watchAll",
|
||||
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
|
||||
"format": "prettier --write ."
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.20.0",
|
||||
"@rnx-kit/metro-config": "^1.3.14",
|
||||
"@rnx-kit/metro-resolver-symlinks": "^0.1.34",
|
||||
"@types/react": "~18.2.14",
|
||||
"@types/react": "18.0.28",
|
||||
"eslint-plugin-react": "7.32.2",
|
||||
"eslint-plugin-react-hooks": "4.6.0",
|
||||
"jest": "^29.2.1",
|
||||
"jest": "^29.4.1",
|
||||
"jest-expo": "~49.0.0",
|
||||
"pod-install": "^0.1.39",
|
||||
"react-test-renderer": "18.2.0",
|
||||
"typescript": "^5.1.3"
|
||||
"typescript": "~5.2.2"
|
||||
},
|
||||
"overrides": {
|
||||
"react-refresh": "~0.14.0"
|
||||
},
|
||||
"resolutions": {
|
||||
"react-refresh": "~0.14.0"
|
||||
},
|
||||
"private": true
|
||||
}
|
||||
}
|
||||
|
94
apps/mobile/project.json
Normal file
94
apps/mobile/project.json
Normal file
@@ -0,0 +1,94 @@
|
||||
{
|
||||
"name": "mobile",
|
||||
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
||||
"sourceRoot": "apps/mobile/src",
|
||||
"projectType": "application",
|
||||
"targets": {
|
||||
"start": {
|
||||
"executor": "@nx/expo:start",
|
||||
"dependsOn": ["ensure-symlink", "sync-deps"],
|
||||
"options": {
|
||||
"port": 8081
|
||||
}
|
||||
},
|
||||
"serve": {
|
||||
"executor": "nx:run-commands",
|
||||
"options": {
|
||||
"command": "nx start mobile"
|
||||
}
|
||||
},
|
||||
"run-ios": {
|
||||
"executor": "@nx/expo:run",
|
||||
"dependsOn": ["ensure-symlink", "sync-deps"],
|
||||
"options": {
|
||||
"platform": "ios"
|
||||
}
|
||||
},
|
||||
"run-android": {
|
||||
"executor": "@nx/expo:run",
|
||||
"dependsOn": ["ensure-symlink", "sync-deps"],
|
||||
"options": {
|
||||
"platform": "android"
|
||||
}
|
||||
},
|
||||
"build": {
|
||||
"executor": "@nx/expo:build",
|
||||
"options": {}
|
||||
},
|
||||
"submit": {
|
||||
"executor": "@nx/expo:submit",
|
||||
"options": {}
|
||||
},
|
||||
"build-list": {
|
||||
"executor": "@nx/expo:build-list",
|
||||
"options": {}
|
||||
},
|
||||
"sync-deps": {
|
||||
"executor": "@nx/expo:sync-deps",
|
||||
"options": {}
|
||||
},
|
||||
"ensure-symlink": {
|
||||
"executor": "@nx/expo:ensure-symlink",
|
||||
"options": {}
|
||||
},
|
||||
"prebuild": {
|
||||
"executor": "@nx/expo:prebuild",
|
||||
"dependsOn": ["ensure-symlink", "sync-deps"],
|
||||
"options": {}
|
||||
},
|
||||
"install": {
|
||||
"executor": "@nx/expo:install",
|
||||
"options": {}
|
||||
},
|
||||
"update": {
|
||||
"executor": "@nx/expo:update",
|
||||
"options": {}
|
||||
},
|
||||
"export": {
|
||||
"executor": "@nx/expo:export",
|
||||
"dependsOn": ["ensure-symlink", "sync-deps"],
|
||||
"options": {
|
||||
"platform": "all",
|
||||
"outputDir": "../../dist/apps/mobile"
|
||||
}
|
||||
},
|
||||
"export-web": {
|
||||
"executor": "@nx/expo:export",
|
||||
"options": {
|
||||
"bundler": "metro"
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"executor": "@nx/eslint:lint",
|
||||
"outputs": ["{options.outputFile}"]
|
||||
},
|
||||
"test": {
|
||||
"executor": "@nx/jest:jest",
|
||||
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
|
||||
"options": {
|
||||
"jestConfig": "apps/mobile/jest.config.ts"
|
||||
}
|
||||
}
|
||||
},
|
||||
"tags": []
|
||||
}
|
1
apps/mobile/test-setup.ts
Normal file
1
apps/mobile/test-setup.ts
Normal file
@@ -0,0 +1 @@
|
||||
import '@testing-library/jest-native/extend-expect';
|
15
apps/mobile/tsconfig.app.json
Normal file
15
apps/mobile/tsconfig.app.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "../../dist/out-tsc",
|
||||
"types": ["node"]
|
||||
},
|
||||
"files": ["../../node_modules/@nx/expo/typings/svg.d.ts"],
|
||||
"exclude": [
|
||||
"jest.config.ts",
|
||||
"**/*.spec.ts",
|
||||
"**/*.spec.tsx",
|
||||
"test-setup.ts"
|
||||
],
|
||||
"include": ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx"]
|
||||
}
|
@@ -1,7 +1,29 @@
|
||||
{
|
||||
"extends": ["../../tsconfig.base", "expo/tsconfig.base"],
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"strict": true
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"jsx": "react-native",
|
||||
"lib": [
|
||||
"dom",
|
||||
"esnext"
|
||||
],
|
||||
"moduleResolution": "node",
|
||||
"skipLibCheck": true,
|
||||
"resolveJsonModule": true,
|
||||
"strict": true,
|
||||
"declaration": true
|
||||
},
|
||||
"include": ["**/*.ts", "**/*.tsx", ".expo/types/**/*.ts", "expo-env.d.ts"]
|
||||
"files": [],
|
||||
"include": [
|
||||
".expo/types/**/*.ts",
|
||||
"expo-env.d.ts"
|
||||
],
|
||||
"references": [
|
||||
{
|
||||
"path": "./tsconfig.app.json"
|
||||
},
|
||||
{
|
||||
"path": "./tsconfig.spec.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
20
apps/mobile/tsconfig.spec.json
Normal file
20
apps/mobile/tsconfig.spec.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "../../dist/out-tsc",
|
||||
"module": "commonjs",
|
||||
"types": ["jest", "node"]
|
||||
},
|
||||
"include": [
|
||||
"jest.config.ts",
|
||||
"src/**/*.test.ts",
|
||||
"src/**/*.spec.ts",
|
||||
"src/**/*.test.tsx",
|
||||
"src/**/*.spec.tsx",
|
||||
"src/**/*.test.js",
|
||||
"src/**/*.spec.js",
|
||||
"src/**/*.test.jsx",
|
||||
"src/**/*.spec.jsx",
|
||||
"src/**/*.d.ts"
|
||||
]
|
||||
}
|
Reference in New Issue
Block a user