spacedrive/apps/mobile/metro.config.js

66 lines
2 KiB
JavaScript
Raw Normal View History

Mobile app (#352) * Mobile app: Initial Commit! * Fix monorepo issues and add tailwind. Fix & Test tailwind. working ball app Fix workspace module import * Mobile app cleanup and structure * App Icons, Splash screen and eslint config * More cleanup * Use SVGs directly in React Native * Add placeholder files for project structrate * Cleanup all svg icons and modify metro config to use icons from interface package (temporary) * Potentially fix types for react & update some packages. * Onboarding screen + add reanimated & moti * Finishing touches on Onboarding screen * Persist onboarding, Button comp and Nav. flow. * Add mobile info to Contributing.md * Add .prettierignore for disabling auto import ordering for some files. * Introducing the new navigation flow * Change package name * use the new @sd/assets package * Add a temp. folder for @sd/assets organization * Drawer nav bar looks good now. * Hacky method to get the active route on drawer * Fix react native types & update few packages. * Drawer animation * Add counter * Collapsible Tags / Locations * rename Counter and add saveState prop * Sync counter with desktop version * Move some screens to BottomTab Nav. * Add Overview Stats * [WIP] - Device component * Upgrade to Expo 46 and fix types. * Add @sd/core to mobile * Fix eslint stuff * placeholder and some notes * Show folder icons on overview screen * Fixed android build, style and some screen tweaks * Add bottom sheet package * Fix bundler issues and rename landing package.json * Rename landing package.json * update all packages to latest React * Eject expo app * fix pnpm & expo & monorepo * monorepo debugging * cleanup dependencies & static link to shared packages * cleanup, switch to hermes, pollyfill intl for ios * Cleanup monorepo * Fix: Style for FileItem * Above average app icons * cleanup ios * update msrv * update codeowners for mobile * fix typecheck * update lockfile * fix ffmpeg install * rename UI to 'SpacedriveInterface' for clarity * Update codeowners * Fix eslint config mobile. * Refactor navigation flow, move types to navigators Co-authored-by: Utku <74243531+utkubkr@users.noreply.github.com> Co-authored-by: Oscar Beaumont <oscar@otbeaumont.me> Co-authored-by: Brendan Allan <brendonovich@outlook.com>
2022-08-09 03:29:14 +00:00
const { makeMetroConfig, resolveUniqueModule, exclusionList } = require('@rnx-kit/metro-config');
2022-10-17 13:27:14 +00:00
const path = require('path');
Mobile app (#352) * Mobile app: Initial Commit! * Fix monorepo issues and add tailwind. Fix & Test tailwind. working ball app Fix workspace module import * Mobile app cleanup and structure * App Icons, Splash screen and eslint config * More cleanup * Use SVGs directly in React Native * Add placeholder files for project structrate * Cleanup all svg icons and modify metro config to use icons from interface package (temporary) * Potentially fix types for react & update some packages. * Onboarding screen + add reanimated & moti * Finishing touches on Onboarding screen * Persist onboarding, Button comp and Nav. flow. * Add mobile info to Contributing.md * Add .prettierignore for disabling auto import ordering for some files. * Introducing the new navigation flow * Change package name * use the new @sd/assets package * Add a temp. folder for @sd/assets organization * Drawer nav bar looks good now. * Hacky method to get the active route on drawer * Fix react native types & update few packages. * Drawer animation * Add counter * Collapsible Tags / Locations * rename Counter and add saveState prop * Sync counter with desktop version * Move some screens to BottomTab Nav. * Add Overview Stats * [WIP] - Device component * Upgrade to Expo 46 and fix types. * Add @sd/core to mobile * Fix eslint stuff * placeholder and some notes * Show folder icons on overview screen * Fixed android build, style and some screen tweaks * Add bottom sheet package * Fix bundler issues and rename landing package.json * Rename landing package.json * update all packages to latest React * Eject expo app * fix pnpm & expo & monorepo * monorepo debugging * cleanup dependencies & static link to shared packages * cleanup, switch to hermes, pollyfill intl for ios * Cleanup monorepo * Fix: Style for FileItem * Above average app icons * cleanup ios * update msrv * update codeowners for mobile * fix typecheck * update lockfile * fix ffmpeg install * rename UI to 'SpacedriveInterface' for clarity * Update codeowners * Fix eslint config mobile. * Refactor navigation flow, move types to navigators Co-authored-by: Utku <74243531+utkubkr@users.noreply.github.com> Co-authored-by: Oscar Beaumont <oscar@otbeaumont.me> Co-authored-by: Brendan Allan <brendonovich@outlook.com>
2022-08-09 03:29:14 +00:00
// Needed for transforming svgs from @sd/assets
const [reactSVGPath, reactSVGExclude] = resolveUniqueModule('react-native-svg');
const [rspcClientPath, rspcClientExclude] = resolveUniqueModule('@rspc/client');
const [rspcReactPath, rspcReactExclude] = resolveUniqueModule('@rspc/react');
Mobile app (#352) * Mobile app: Initial Commit! * Fix monorepo issues and add tailwind. Fix & Test tailwind. working ball app Fix workspace module import * Mobile app cleanup and structure * App Icons, Splash screen and eslint config * More cleanup * Use SVGs directly in React Native * Add placeholder files for project structrate * Cleanup all svg icons and modify metro config to use icons from interface package (temporary) * Potentially fix types for react & update some packages. * Onboarding screen + add reanimated & moti * Finishing touches on Onboarding screen * Persist onboarding, Button comp and Nav. flow. * Add mobile info to Contributing.md * Add .prettierignore for disabling auto import ordering for some files. * Introducing the new navigation flow * Change package name * use the new @sd/assets package * Add a temp. folder for @sd/assets organization * Drawer nav bar looks good now. * Hacky method to get the active route on drawer * Fix react native types & update few packages. * Drawer animation * Add counter * Collapsible Tags / Locations * rename Counter and add saveState prop * Sync counter with desktop version * Move some screens to BottomTab Nav. * Add Overview Stats * [WIP] - Device component * Upgrade to Expo 46 and fix types. * Add @sd/core to mobile * Fix eslint stuff * placeholder and some notes * Show folder icons on overview screen * Fixed android build, style and some screen tweaks * Add bottom sheet package * Fix bundler issues and rename landing package.json * Rename landing package.json * update all packages to latest React * Eject expo app * fix pnpm & expo & monorepo * monorepo debugging * cleanup dependencies & static link to shared packages * cleanup, switch to hermes, pollyfill intl for ios * Cleanup monorepo * Fix: Style for FileItem * Above average app icons * cleanup ios * update msrv * update codeowners for mobile * fix typecheck * update lockfile * fix ffmpeg install * rename UI to 'SpacedriveInterface' for clarity * Update codeowners * Fix eslint config mobile. * Refactor navigation flow, move types to navigators Co-authored-by: Utku <74243531+utkubkr@users.noreply.github.com> Co-authored-by: Oscar Beaumont <oscar@otbeaumont.me> Co-authored-by: Brendan Allan <brendonovich@outlook.com>
2022-08-09 03:29:14 +00:00
const { getDefaultConfig } = require('expo/metro-config');
const expoDefaultConfig = getDefaultConfig(__dirname);
2022-10-17 13:27:14 +00:00
const projectRoot = __dirname;
const workspaceRoot = path.resolve(projectRoot, '../..');
Mobile app (#352) * Mobile app: Initial Commit! * Fix monorepo issues and add tailwind. Fix & Test tailwind. working ball app Fix workspace module import * Mobile app cleanup and structure * App Icons, Splash screen and eslint config * More cleanup * Use SVGs directly in React Native * Add placeholder files for project structrate * Cleanup all svg icons and modify metro config to use icons from interface package (temporary) * Potentially fix types for react & update some packages. * Onboarding screen + add reanimated & moti * Finishing touches on Onboarding screen * Persist onboarding, Button comp and Nav. flow. * Add mobile info to Contributing.md * Add .prettierignore for disabling auto import ordering for some files. * Introducing the new navigation flow * Change package name * use the new @sd/assets package * Add a temp. folder for @sd/assets organization * Drawer nav bar looks good now. * Hacky method to get the active route on drawer * Fix react native types & update few packages. * Drawer animation * Add counter * Collapsible Tags / Locations * rename Counter and add saveState prop * Sync counter with desktop version * Move some screens to BottomTab Nav. * Add Overview Stats * [WIP] - Device component * Upgrade to Expo 46 and fix types. * Add @sd/core to mobile * Fix eslint stuff * placeholder and some notes * Show folder icons on overview screen * Fixed android build, style and some screen tweaks * Add bottom sheet package * Fix bundler issues and rename landing package.json * Rename landing package.json * update all packages to latest React * Eject expo app * fix pnpm & expo & monorepo * monorepo debugging * cleanup dependencies & static link to shared packages * cleanup, switch to hermes, pollyfill intl for ios * Cleanup monorepo * Fix: Style for FileItem * Above average app icons * cleanup ios * update msrv * update codeowners for mobile * fix typecheck * update lockfile * fix ffmpeg install * rename UI to 'SpacedriveInterface' for clarity * Update codeowners * Fix eslint config mobile. * Refactor navigation flow, move types to navigators Co-authored-by: Utku <74243531+utkubkr@users.noreply.github.com> Co-authored-by: Oscar Beaumont <oscar@otbeaumont.me> Co-authored-by: Brendan Allan <brendonovich@outlook.com>
2022-08-09 03:29:14 +00:00
const metroConfig = makeMetroConfig({
...expoDefaultConfig,
2022-10-17 13:27:14 +00:00
projectRoot,
watchFolders: [workspaceRoot],
Mobile app (#352) * Mobile app: Initial Commit! * Fix monorepo issues and add tailwind. Fix & Test tailwind. working ball app Fix workspace module import * Mobile app cleanup and structure * App Icons, Splash screen and eslint config * More cleanup * Use SVGs directly in React Native * Add placeholder files for project structrate * Cleanup all svg icons and modify metro config to use icons from interface package (temporary) * Potentially fix types for react & update some packages. * Onboarding screen + add reanimated & moti * Finishing touches on Onboarding screen * Persist onboarding, Button comp and Nav. flow. * Add mobile info to Contributing.md * Add .prettierignore for disabling auto import ordering for some files. * Introducing the new navigation flow * Change package name * use the new @sd/assets package * Add a temp. folder for @sd/assets organization * Drawer nav bar looks good now. * Hacky method to get the active route on drawer * Fix react native types & update few packages. * Drawer animation * Add counter * Collapsible Tags / Locations * rename Counter and add saveState prop * Sync counter with desktop version * Move some screens to BottomTab Nav. * Add Overview Stats * [WIP] - Device component * Upgrade to Expo 46 and fix types. * Add @sd/core to mobile * Fix eslint stuff * placeholder and some notes * Show folder icons on overview screen * Fixed android build, style and some screen tweaks * Add bottom sheet package * Fix bundler issues and rename landing package.json * Rename landing package.json * update all packages to latest React * Eject expo app * fix pnpm & expo & monorepo * monorepo debugging * cleanup dependencies & static link to shared packages * cleanup, switch to hermes, pollyfill intl for ios * Cleanup monorepo * Fix: Style for FileItem * Above average app icons * cleanup ios * update msrv * update codeowners for mobile * fix typecheck * update lockfile * fix ffmpeg install * rename UI to 'SpacedriveInterface' for clarity * Update codeowners * Fix eslint config mobile. * Refactor navigation flow, move types to navigators Co-authored-by: Utku <74243531+utkubkr@users.noreply.github.com> Co-authored-by: Oscar Beaumont <oscar@otbeaumont.me> Co-authored-by: Brendan Allan <brendonovich@outlook.com>
2022-08-09 03:29:14 +00:00
resolver: {
...expoDefaultConfig.resolver,
extraNodeModules: {
'react-native-svg': reactSVGPath
},
blockList: exclusionList([reactSVGExclude, rspcClientExclude, rspcReactExclude]),
Mobile app (#352) * Mobile app: Initial Commit! * Fix monorepo issues and add tailwind. Fix & Test tailwind. working ball app Fix workspace module import * Mobile app cleanup and structure * App Icons, Splash screen and eslint config * More cleanup * Use SVGs directly in React Native * Add placeholder files for project structrate * Cleanup all svg icons and modify metro config to use icons from interface package (temporary) * Potentially fix types for react & update some packages. * Onboarding screen + add reanimated & moti * Finishing touches on Onboarding screen * Persist onboarding, Button comp and Nav. flow. * Add mobile info to Contributing.md * Add .prettierignore for disabling auto import ordering for some files. * Introducing the new navigation flow * Change package name * use the new @sd/assets package * Add a temp. folder for @sd/assets organization * Drawer nav bar looks good now. * Hacky method to get the active route on drawer * Fix react native types & update few packages. * Drawer animation * Add counter * Collapsible Tags / Locations * rename Counter and add saveState prop * Sync counter with desktop version * Move some screens to BottomTab Nav. * Add Overview Stats * [WIP] - Device component * Upgrade to Expo 46 and fix types. * Add @sd/core to mobile * Fix eslint stuff * placeholder and some notes * Show folder icons on overview screen * Fixed android build, style and some screen tweaks * Add bottom sheet package * Fix bundler issues and rename landing package.json * Rename landing package.json * update all packages to latest React * Eject expo app * fix pnpm & expo & monorepo * monorepo debugging * cleanup dependencies & static link to shared packages * cleanup, switch to hermes, pollyfill intl for ios * Cleanup monorepo * Fix: Style for FileItem * Above average app icons * cleanup ios * update msrv * update codeowners for mobile * fix typecheck * update lockfile * fix ffmpeg install * rename UI to 'SpacedriveInterface' for clarity * Update codeowners * Fix eslint config mobile. * Refactor navigation flow, move types to navigators Co-authored-by: Utku <74243531+utkubkr@users.noreply.github.com> Co-authored-by: Oscar Beaumont <oscar@otbeaumont.me> Co-authored-by: Brendan Allan <brendonovich@outlook.com>
2022-08-09 03:29:14 +00:00
sourceExts: [...expoDefaultConfig.resolver.sourceExts, 'svg'],
2022-10-17 13:27:14 +00:00
assetExts: expoDefaultConfig.resolver.assetExts.filter((ext) => ext !== 'svg'),
disableHierarchicalLookup: false,
2022-10-17 13:27:14 +00:00
nodeModulesPaths: [
path.resolve(projectRoot, 'node_modules'),
path.resolve(workspaceRoot, 'node_modules')
],
resolveRequest: (context, moduleName, platform) => {
if (moduleName.startsWith('@rspc/client/v2')) {
return {
filePath: path.resolve(rspcClientPath, 'dist', 'v2.js'),
type: 'sourceFile'
};
}
if (moduleName.startsWith('@rspc/react/v2')) {
return {
filePath: path.resolve(rspcReactPath, 'dist', 'v2.js'),
type: 'sourceFile'
};
}
// Optionally, chain to the standard Metro resolver.
return context.resolveRequest(context, moduleName, platform);
},
platforms: ['ios', 'android']
Mobile app (#352) * Mobile app: Initial Commit! * Fix monorepo issues and add tailwind. Fix & Test tailwind. working ball app Fix workspace module import * Mobile app cleanup and structure * App Icons, Splash screen and eslint config * More cleanup * Use SVGs directly in React Native * Add placeholder files for project structrate * Cleanup all svg icons and modify metro config to use icons from interface package (temporary) * Potentially fix types for react & update some packages. * Onboarding screen + add reanimated & moti * Finishing touches on Onboarding screen * Persist onboarding, Button comp and Nav. flow. * Add mobile info to Contributing.md * Add .prettierignore for disabling auto import ordering for some files. * Introducing the new navigation flow * Change package name * use the new @sd/assets package * Add a temp. folder for @sd/assets organization * Drawer nav bar looks good now. * Hacky method to get the active route on drawer * Fix react native types & update few packages. * Drawer animation * Add counter * Collapsible Tags / Locations * rename Counter and add saveState prop * Sync counter with desktop version * Move some screens to BottomTab Nav. * Add Overview Stats * [WIP] - Device component * Upgrade to Expo 46 and fix types. * Add @sd/core to mobile * Fix eslint stuff * placeholder and some notes * Show folder icons on overview screen * Fixed android build, style and some screen tweaks * Add bottom sheet package * Fix bundler issues and rename landing package.json * Rename landing package.json * update all packages to latest React * Eject expo app * fix pnpm & expo & monorepo * monorepo debugging * cleanup dependencies & static link to shared packages * cleanup, switch to hermes, pollyfill intl for ios * Cleanup monorepo * Fix: Style for FileItem * Above average app icons * cleanup ios * update msrv * update codeowners for mobile * fix typecheck * update lockfile * fix ffmpeg install * rename UI to 'SpacedriveInterface' for clarity * Update codeowners * Fix eslint config mobile. * Refactor navigation flow, move types to navigators Co-authored-by: Utku <74243531+utkubkr@users.noreply.github.com> Co-authored-by: Oscar Beaumont <oscar@otbeaumont.me> Co-authored-by: Brendan Allan <brendonovich@outlook.com>
2022-08-09 03:29:14 +00:00
},
transformer: {
...expoDefaultConfig.transformer,
Mobile app (#352) * Mobile app: Initial Commit! * Fix monorepo issues and add tailwind. Fix & Test tailwind. working ball app Fix workspace module import * Mobile app cleanup and structure * App Icons, Splash screen and eslint config * More cleanup * Use SVGs directly in React Native * Add placeholder files for project structrate * Cleanup all svg icons and modify metro config to use icons from interface package (temporary) * Potentially fix types for react & update some packages. * Onboarding screen + add reanimated & moti * Finishing touches on Onboarding screen * Persist onboarding, Button comp and Nav. flow. * Add mobile info to Contributing.md * Add .prettierignore for disabling auto import ordering for some files. * Introducing the new navigation flow * Change package name * use the new @sd/assets package * Add a temp. folder for @sd/assets organization * Drawer nav bar looks good now. * Hacky method to get the active route on drawer * Fix react native types & update few packages. * Drawer animation * Add counter * Collapsible Tags / Locations * rename Counter and add saveState prop * Sync counter with desktop version * Move some screens to BottomTab Nav. * Add Overview Stats * [WIP] - Device component * Upgrade to Expo 46 and fix types. * Add @sd/core to mobile * Fix eslint stuff * placeholder and some notes * Show folder icons on overview screen * Fixed android build, style and some screen tweaks * Add bottom sheet package * Fix bundler issues and rename landing package.json * Rename landing package.json * update all packages to latest React * Eject expo app * fix pnpm & expo & monorepo * monorepo debugging * cleanup dependencies & static link to shared packages * cleanup, switch to hermes, pollyfill intl for ios * Cleanup monorepo * Fix: Style for FileItem * Above average app icons * cleanup ios * update msrv * update codeowners for mobile * fix typecheck * update lockfile * fix ffmpeg install * rename UI to 'SpacedriveInterface' for clarity * Update codeowners * Fix eslint config mobile. * Refactor navigation flow, move types to navigators Co-authored-by: Utku <74243531+utkubkr@users.noreply.github.com> Co-authored-by: Oscar Beaumont <oscar@otbeaumont.me> Co-authored-by: Brendan Allan <brendonovich@outlook.com>
2022-08-09 03:29:14 +00:00
getTransformOptions: async () => ({
transform: {
// What does this do?
Mobile app (#352) * Mobile app: Initial Commit! * Fix monorepo issues and add tailwind. Fix & Test tailwind. working ball app Fix workspace module import * Mobile app cleanup and structure * App Icons, Splash screen and eslint config * More cleanup * Use SVGs directly in React Native * Add placeholder files for project structrate * Cleanup all svg icons and modify metro config to use icons from interface package (temporary) * Potentially fix types for react & update some packages. * Onboarding screen + add reanimated & moti * Finishing touches on Onboarding screen * Persist onboarding, Button comp and Nav. flow. * Add mobile info to Contributing.md * Add .prettierignore for disabling auto import ordering for some files. * Introducing the new navigation flow * Change package name * use the new @sd/assets package * Add a temp. folder for @sd/assets organization * Drawer nav bar looks good now. * Hacky method to get the active route on drawer * Fix react native types & update few packages. * Drawer animation * Add counter * Collapsible Tags / Locations * rename Counter and add saveState prop * Sync counter with desktop version * Move some screens to BottomTab Nav. * Add Overview Stats * [WIP] - Device component * Upgrade to Expo 46 and fix types. * Add @sd/core to mobile * Fix eslint stuff * placeholder and some notes * Show folder icons on overview screen * Fixed android build, style and some screen tweaks * Add bottom sheet package * Fix bundler issues and rename landing package.json * Rename landing package.json * update all packages to latest React * Eject expo app * fix pnpm & expo & monorepo * monorepo debugging * cleanup dependencies & static link to shared packages * cleanup, switch to hermes, pollyfill intl for ios * Cleanup monorepo * Fix: Style for FileItem * Above average app icons * cleanup ios * update msrv * update codeowners for mobile * fix typecheck * update lockfile * fix ffmpeg install * rename UI to 'SpacedriveInterface' for clarity * Update codeowners * Fix eslint config mobile. * Refactor navigation flow, move types to navigators Co-authored-by: Utku <74243531+utkubkr@users.noreply.github.com> Co-authored-by: Oscar Beaumont <oscar@otbeaumont.me> Co-authored-by: Brendan Allan <brendonovich@outlook.com>
2022-08-09 03:29:14 +00:00
experimentalImportSupport: false,
inlineRequires: true
}
}),
babelTransformerPath: require.resolve('react-native-svg-transformer')
}
});
module.exports = metroConfig;