Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ module.exports = function (api) {
root: ['./'],

alias: {
'@': './',
'@lib': './lib',
'@': './src',
'@lib': './src/lib',
'tailwind.config': './tailwind.config.js',
},
},
Expand Down
20 changes: 10 additions & 10 deletions index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Entry point for React Native
import 'react-native-devsettings';
import './global.css';
import './lib/env';
import './src/lib/env';

import React from 'react';
import { AppRegistry, Text } from 'react-native';
Expand All @@ -14,18 +14,18 @@ enableScreens();
import { TouchableOpacity, BackHandler } from 'react-native';
import { Ionicons } from '@expo/vector-icons';
import { PowerSyncContext } from '@powersync/react';
import { db as psDb } from './lib/powersync';
import { setupPowerSyncLogCapture } from './lib/powersync/Connector';
import { SettingsProvider } from './lib/hooks/SettingsContext';
import { SyncDebugProvider } from './lib/hooks/SyncDebugContext';
import { ThemeProvider, useTheme } from './lib/theme/ThemeContext';
import { GluestackUIProvider } from './components/ui/gluestack-ui-provider';
import { db as psDb } from './src/lib/powersync';
import { setupPowerSyncLogCapture } from './src/lib/powersync/Connector';
import { SettingsProvider } from './src/lib/hooks/SettingsContext';
import { SyncDebugProvider } from './src/lib/hooks/SyncDebugContext';
import { ThemeProvider, useTheme } from './src/lib/theme/ThemeContext';
import { GluestackUIProvider } from './src/components/ui/gluestack-ui-provider';
import Logger from 'js-logger';

// Screens
import HomeScreen from './app/index';
import SettingsScreen from './app/settings';
import SyncDebugScreen from './app/sync-debug';
import HomeScreen from './src/screens/index';
import SettingsScreen from './src/screens/settings';
import SyncDebugScreen from './src/screens/sync-debug';

// Initialize logger
Logger.useDefaults();
Expand Down
28 changes: 14 additions & 14 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'jsdom',
roots: ['<rootDir>/lib', '<rootDir>/scripts'],
roots: ['<rootDir>/src/lib', '<rootDir>/scripts'],
testMatch: ['**/*.test.ts', '**/*.test.tsx', '**/*.ui.test.tsx'],
moduleNameMapper: {
'^@lib/(.*)$': '<rootDir>/lib/$1',
'^@/components/ui$': '<rootDir>/lib/features/__tests__/__mocks__/gluestackUI.tsx',
'^@/(.*)$': '<rootDir>/$1',
'^@lib/(.*)$': '<rootDir>/src/lib/$1',
'^@/components/ui$': '<rootDir>/src/lib/features/__tests__/__mocks__/gluestackUI.tsx',
'^@/(.*)$': '<rootDir>/src/$1',
'^react-native$': 'react-native-web',
'^@expo/vector-icons$': '<rootDir>/lib/features/__tests__/__mocks__/vectorIcons.ts',
'^@env$': '<rootDir>/lib/features/__tests__/__mocks__/env.ts',
'^@expo/vector-icons$': '<rootDir>/src/lib/features/__tests__/__mocks__/vectorIcons.ts',
'^@env$': '<rootDir>/src/lib/features/__tests__/__mocks__/env.ts',
},
transform: {
'^.+\\.tsx?$': ['ts-jest', {
Expand All @@ -23,18 +23,18 @@ module.exports = {
}],
},
setupFilesAfterEnv: [
'<rootDir>/lib/powersync/testSetup.ts',
'<rootDir>/lib/features/__tests__/setupComponentTests.ts',
'<rootDir>/src/lib/powersync/testSetup.ts',
'<rootDir>/src/lib/features/__tests__/setupComponentTests.ts',
],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
clearMocks: true,
collectCoverageFrom: [
'lib/**/*.{ts,tsx}',
'!lib/**/*.test.{ts,tsx}',
'!lib/**/*.ui.test.{ts,tsx}',
'!lib/**/testSetup.ts',
'!lib/**/setupComponentTests.ts',
'!lib/**/__tests__/**',
'src/lib/**/*.{ts,tsx}',
'!src/lib/**/*.test.{ts,tsx}',
'!src/lib/**/*.ui.test.{ts,tsx}',
'!src/lib/**/testSetup.ts',
'!src/lib/**/setupComponentTests.ts',
'!src/lib/**/__tests__/**',
],
coverageDirectory: 'coverage',
coverageReporters: ['text', 'text-summary', 'lcov', 'html'],
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions lib/features/SetupSync.tsx → src/lib/features/SetupSync.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useContext, useEffect, useState, memo } from 'react';
import { Linking, ScrollView } from 'react-native';
import { hello, sendRescheduleConfirmations, addChangeListener } from '../../modules/my-module';
import { hello, sendRescheduleConfirmations, addChangeListener } from '../../../modules/my-module';
import { open } from '@op-engineering/op-sqlite';
import { useQuery } from '@powersync/react';
import { PowerSyncContext } from "@powersync/react";
Expand All @@ -15,7 +15,7 @@ import { ActionButton, WarningBanner, AlertText } from '@lib/components/ui';
import { emitSyncLog } from '@lib/logging/syncLog';
import { VStack, Card, Text, Link, LinkText, Button, ButtonText } from '@/components/ui';

import type { RawRescheduleConfirmation } from '../../modules/my-module';
import type { RawRescheduleConfirmation } from '../../../modules/my-module';
import type { Settings } from '@lib/hooks/SettingsContext';

/** Isolated component for polling timestamp - re-renders every second without affecting parent */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jest.mock('@react-navigation/native', () => ({
}));

// Mock the native module
jest.mock('../../../modules/my-module', () => ({
jest.mock('../../../../modules/my-module', () => ({
hello: jest.fn(() => 'mocked'),
sendRescheduleConfirmations: jest.fn(),
addChangeListener: jest.fn(),
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 1 addition & 5 deletions tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@
module.exports = {
darkMode: process.env.DARK_MODE ? process.env.DARK_MODE : 'class',
content: [
'./app/**/*.{html,js,jsx,ts,tsx,mdx}',
'./components/**/*.{html,js,jsx,ts,tsx,mdx}',
'./lib/**/*.{html,js,jsx,ts,tsx,mdx}',
'./utils/**/*.{html,js,jsx,ts,tsx,mdx}',
'./*.{html,js,jsx,ts,tsx,mdx}',
'./src/**/*.{html,js,jsx,ts,tsx,mdx}',
'./*.{html,js,jsx,ts,tsx,mdx}',
],
presets: [require('nativewind/preset')],
important: 'html',
Expand Down
6 changes: 2 additions & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
"baseUrl": ".",
"paths": {
"@lib/*": [
"lib/*"
"src/lib/*"
],
"@/*": [
"./*"
"src/*"
],
"tailwind.config": [
"./tailwind.config.js"
Expand All @@ -29,8 +29,6 @@
"src/**/*",
"test/**/*",
"index.tsx",
"app/**/*",
"lib/**/*",
"scripts/**/*.ts",
"nativewind-env.d.ts"
],
Expand Down
Loading