Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

native: import directly from shared src instead of bundle #4120

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion apps/tlon-mobile/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import '@tloncorp/app/lib/devMenuItems';
import { setupDb } from '@tloncorp/app/lib/nativeDb';
import { addCustomEnabledLoggers } from '@tloncorp/shared';
import { useDebugStore } from '@tloncorp/shared';
import * as db from '@tloncorp/shared/dist/db';
import * as db from '@tloncorp/shared/db';
import { setStorage } from '@tloncorp/ui';
import { registerRootComponent } from 'expo';
import 'expo-dev-client';
Expand Down
7 changes: 2 additions & 5 deletions apps/tlon-mobile/src/App.main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,13 @@ import {
import ErrorBoundary from '@tloncorp/app/ErrorBoundary';
import { BranchProvider } from '@tloncorp/app/contexts/branch';
import { ShipProvider, useShip } from '@tloncorp/app/contexts/ship';
import {
SignupProvider,
useSignupContext,
} from './lib/signupContext';
import { useIsDarkMode } from '@tloncorp/app/hooks/useIsDarkMode';
import { useMigrations } from '@tloncorp/app/lib/nativeDb';
import { PlatformState } from '@tloncorp/app/lib/platformHelpers';
import { Provider as TamaguiProvider } from '@tloncorp/app/provider';
import { FeatureFlagConnectedInstrumentationProvider } from '@tloncorp/app/utils/perf';
import { posthogAsync } from '@tloncorp/app/utils/posthog';
import { QueryClientProvider, queryClient } from '@tloncorp/shared/dist/api';
import { QueryClientProvider, queryClient } from '@tloncorp/shared/api';
import {
LoadingSpinner,
PortalProvider,
Expand All @@ -40,6 +36,7 @@ import { SafeAreaProvider } from 'react-native-safe-area-context';

import { OnboardingStack } from './OnboardingStack';
import AuthenticatedApp from './components/AuthenticatedApp';
import { SignupProvider, useSignupContext } from './lib/signupContext';

// Android notification tap handler passes initial params here
const App = () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as db from '@tloncorp/shared/dist/db';
import * as db from '@tloncorp/shared/db';
import { GroupPreviewSheet } from '@tloncorp/ui';

import { group } from '../fakeData';
Expand Down
2 changes: 1 addition & 1 deletion apps/tlon-mobile/src/fixtures/Activity.fixture.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as logic from '@tloncorp/shared/dist/logic';
import * as logic from '@tloncorp/shared/logic';
import {
ActivityScreenContent,
AppDataContextProvider,
Expand Down
2 changes: 1 addition & 1 deletion apps/tlon-mobile/src/fixtures/BlockSectionList.fixture.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as db from '@tloncorp/shared/dist/db';
import * as db from '@tloncorp/shared/db';
import { BlockSectionList, ContactRow } from '@tloncorp/ui';
import { SectionListRenderItemInfo } from 'react-native';

Expand Down
6 changes: 3 additions & 3 deletions apps/tlon-mobile/src/fixtures/Channel.fixture.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import {
useChannel,
useGroupPreview,
usePostWithRelations,
} from '@tloncorp/shared/dist';
import type { Upload } from '@tloncorp/shared/dist/api';
import type * as db from '@tloncorp/shared/dist/db';
} from '@tloncorp/shared';
import type { Upload } from '@tloncorp/shared/api';
import type * as db from '@tloncorp/shared/db';
import {
AppDataContextProvider,
Channel,
Expand Down
2 changes: 1 addition & 1 deletion apps/tlon-mobile/src/fixtures/ChatMessage.fixture.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// tamagui-ignore
import * as db from '@tloncorp/shared/dist/db';
import * as db from '@tloncorp/shared/db';
import {
AppDataContextProvider,
ChannelDivider,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as db from '@tloncorp/shared/dist/db';
import * as db from '@tloncorp/shared/db';
import { AppDataContextProvider, RequestsProvider } from '@tloncorp/ui';
import { PostScreenView } from '@tloncorp/ui/src';

Expand Down
2 changes: 1 addition & 1 deletion apps/tlon-mobile/src/fixtures/FixtureWrapper.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// tamagui-ignore
import { QueryClientProvider, queryClient } from '@tloncorp/shared/dist';
import { QueryClientProvider, queryClient } from '@tloncorp/shared';
import type { ColorProp } from '@tloncorp/ui';
import { Theme, View } from '@tloncorp/ui';
import type { PropsWithChildren } from 'react';
Expand Down
2 changes: 1 addition & 1 deletion apps/tlon-mobile/src/fixtures/GalleryPost.fixture.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as db from '@tloncorp/shared/dist/db';
import * as db from '@tloncorp/shared/db';
import {
AppDataContextProvider,
GalleryPost,
Expand Down
2 changes: 1 addition & 1 deletion apps/tlon-mobile/src/fixtures/GroupList.fixture.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type * as db from '@tloncorp/shared/dist/db';
import type * as db from '@tloncorp/shared/db';
import { ChatList } from '@tloncorp/ui';

import { FixtureWrapper } from './FixtureWrapper';
Expand Down
2 changes: 1 addition & 1 deletion apps/tlon-mobile/src/fixtures/MessageActions.fixture.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ChannelAction } from '@tloncorp/shared';
import * as db from '@tloncorp/shared/dist/db';
import * as db from '@tloncorp/shared/db';
import { ChatMessageActions, Modal, ZStack } from '@tloncorp/ui';
import { createRef, useEffect, useState } from 'react';
import { View } from 'react-native';
Expand Down
2 changes: 1 addition & 1 deletion apps/tlon-mobile/src/fixtures/Onboarding.fixture.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
DeepLinkData,
QueryClientProvider,
queryClient,
} from '@tloncorp/shared/dist';
} from '@tloncorp/shared';
import { Theme } from '@tloncorp/ui';
import { PropsWithChildren, useState } from 'react';
import { useFixtureSelect } from 'react-cosmos/client';
Expand Down
2 changes: 1 addition & 1 deletion apps/tlon-mobile/src/fixtures/PostReference.fixture.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as db from '@tloncorp/shared/dist/db';
import * as db from '@tloncorp/shared/db';
import { View } from '@tloncorp/ui';
import {
GroupReference,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { faker } from '@faker-js/faker';
import * as db from '@tloncorp/shared/dist/db';
import * as db from '@tloncorp/shared/db';
import {
AppDataContextProvider,
UserProfileScreenView,
Expand Down
8 changes: 4 additions & 4 deletions apps/tlon-mobile/src/fixtures/activityHelpers.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { PostContent } from '@tloncorp/shared/dist/api';
import * as db from '@tloncorp/shared/dist/db';
import * as logic from '@tloncorp/shared/dist/logic';
import { ExtendedEventType } from '@tloncorp/shared/dist/urbit';
import { PostContent } from '@tloncorp/shared/api';
import * as db from '@tloncorp/shared/db';
import * as logic from '@tloncorp/shared/logic';
import { ExtendedEventType } from '@tloncorp/shared/urbit';

import { exampleContacts, postsByType } from './contentHelpers';
import { group as fakeGroup, tlonLocalIntros } from './fakeData';
Expand Down
6 changes: 3 additions & 3 deletions apps/tlon-mobile/src/fixtures/contentHelpers.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { faker } from '@faker-js/faker';
import { useQuery } from '@tanstack/react-query';
import type { ContentReference, PostContent } from '@tloncorp/shared/dist/api';
import * as db from '@tloncorp/shared/dist/db';
import * as ub from '@tloncorp/shared/dist/urbit';
import type { ContentReference, PostContent } from '@tloncorp/shared/api';
import * as db from '@tloncorp/shared/db';
import * as ub from '@tloncorp/shared/urbit';

import {
createFakePost,
Expand Down
6 changes: 3 additions & 3 deletions apps/tlon-mobile/src/fixtures/fakeData.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as db from '@tloncorp/shared/dist/db';
import { getTextContent } from '@tloncorp/shared/dist/urbit';
import type { Story } from '@tloncorp/shared/dist/urbit/channel';
import * as db from '@tloncorp/shared/db';
import { getTextContent } from '@tloncorp/shared/urbit';
import type { Story } from '@tloncorp/shared/urbit';
import { formatUd, unixToDa } from '@urbit/aura';
import seedrandom from 'seedrandom';

Expand Down
2 changes: 1 addition & 1 deletion apps/tlon-mobile/src/hooks/analytics.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useLureMetadata } from '@tloncorp/app/contexts/branch';
import { AnalyticsEvent, createDevLogger } from '@tloncorp/shared/dist';
import { AnalyticsEvent, createDevLogger } from '@tloncorp/shared';
import { useEffect } from 'react';

import { checkLatestVersion } from '../lib/lifecycleEvents';
Expand Down
4 changes: 2 additions & 2 deletions apps/tlon-mobile/src/hooks/useDeepLinkListener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { useBranch, useSignupParams } from '@tloncorp/app/contexts/branch';
import { useShip } from '@tloncorp/app/contexts/ship';
import { inviteShipWithLure } from '@tloncorp/app/lib/hostingApi';
import { trackError } from '@tloncorp/app/utils/posthog';
import { createDevLogger } from '@tloncorp/shared/dist';
import * as store from '@tloncorp/shared/dist/store';
import { createDevLogger } from '@tloncorp/shared';
import * as store from '@tloncorp/shared/store';
import { useEffect, useRef } from 'react';

import { RootStackParamList } from '../types';
Expand Down
10 changes: 5 additions & 5 deletions apps/tlon-mobile/src/hooks/useNotificationListener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import { useFeatureFlag } from '@tloncorp/app/lib/featureFlags';
import { connectNotifications } from '@tloncorp/app/lib/notifications';
import * as posthog from '@tloncorp/app/utils/posthog';
import { syncDms, syncGroups } from '@tloncorp/shared';
import { markChatRead } from '@tloncorp/shared/dist/api';
import * as api from '@tloncorp/shared/dist/api';
import * as db from '@tloncorp/shared/dist/db';
import * as store from '@tloncorp/shared/dist/store';
import { whomIsDm, whomIsMultiDm } from '@tloncorp/shared/dist/urbit';
import { markChatRead } from '@tloncorp/shared/api';
import * as api from '@tloncorp/shared/api';
import * as db from '@tloncorp/shared/db';
import * as store from '@tloncorp/shared/store';
import { whomIsDm, whomIsMultiDm } from '@tloncorp/shared/urbit';
import {
Notification,
addNotificationResponseReceivedListener,
Expand Down
6 changes: 3 additions & 3 deletions apps/tlon-mobile/src/hooks/useReviveSavedOnboarding.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { NavigationProp, useNavigation } from '@react-navigation/native';
import { useLureMetadata } from '@tloncorp/app/contexts/branch';
import { useShip } from '@tloncorp/app/contexts/ship';
import { useSignupContext } from '../lib/signupContext';
import { AnalyticsEvent, createDevLogger } from '@tloncorp/shared/dist';
import { SignupParams, signupData } from '@tloncorp/shared/dist/db';
import { AnalyticsEvent, createDevLogger } from '@tloncorp/shared';
import { SignupParams, signupData } from '@tloncorp/shared/db';
import { useCallback, useEffect } from 'react';

import { useOnboardingContext } from '../lib/OnboardingContext';
import { useSignupContext } from '../lib/signupContext';
import { OnboardingStackParamList } from '../types';

const logger = createDevLogger('OnboardingRevive', true);
Expand Down
2 changes: 1 addition & 1 deletion apps/tlon-mobile/src/lib/OnboardingContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
initClient,
} from '@google-cloud/recaptcha-enterprise-react-native';
import * as hostingApi from '@tloncorp/app/lib/hostingApi';
import { getLandscapeAuthCookie } from '@tloncorp/shared/dist/api';
import { getLandscapeAuthCookie } from '@tloncorp/shared/api';
import { createContext, useContext } from 'react';

interface OnboardingContextValue {
Expand Down
2 changes: 1 addition & 1 deletion apps/tlon-mobile/src/lib/lifecycleEvents.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getEasUpdateDisplay } from '@tloncorp/app/lib/platformHelpers';
import { lastAppVersion } from '@tloncorp/shared/dist/db';
import { lastAppVersion } from '@tloncorp/shared/db';
import * as Application from 'expo-application';
import * as Updates from 'expo-updates';

Expand Down
2 changes: 1 addition & 1 deletion apps/tlon-mobile/src/lib/refreshHostingAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
setHostingAuthExpired,
setLastHostingAuthCheck,
} from '@tloncorp/app/utils/hosting';
import { createDevLogger } from '@tloncorp/shared/dist';
import { createDevLogger } from '@tloncorp/shared';

const logger = createDevLogger('refreshHostingAuth', false);

Expand Down
8 changes: 4 additions & 4 deletions apps/tlon-mobile/src/lib/signupContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import { useBootSequence } from '@tloncorp/app/hooks/useBootSequence';
import { NodeBootPhase } from '@tloncorp/app/lib/bootHelpers';
import { connectNotifyProvider } from '@tloncorp/app/lib/notificationsApi';
import { createDevLogger } from '@tloncorp/shared/dist';
import * as api from '@tloncorp/shared/dist/api';
import { SignupParams, didSignUp, signupData } from '@tloncorp/shared/dist/db';
import * as store from '@tloncorp/shared/dist/store';
import { createDevLogger } from '@tloncorp/shared';
import * as api from '@tloncorp/shared/api';
import { SignupParams, didSignUp, signupData } from '@tloncorp/shared/db';
import * as store from '@tloncorp/shared/store';
import { createContext, useCallback, useContext, useEffect } from 'react';

const logger = createDevLogger('signup', true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
createInviteLinkRegex,
extractNormalizedInviteLink,
getMetadaFromInviteLink,
} from '@tloncorp/shared/dist';
} from '@tloncorp/shared';
import {
Field,
ScreenHeader,
Expand Down
6 changes: 3 additions & 3 deletions apps/tlon-mobile/src/screens/Onboarding/ShipLoginScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import { useShip } from '@tloncorp/app/contexts/ship';
import { setEulaAgreed } from '@tloncorp/app/utils/eula';
import { getShipFromCookie } from '@tloncorp/app/utils/ship';
import { transformShipURL } from '@tloncorp/app/utils/string';
import { AnalyticsEvent, createDevLogger } from '@tloncorp/shared/dist';
import { getLandscapeAuthCookie } from '@tloncorp/shared/dist/api';
import { didSignUp } from '@tloncorp/shared/dist/db';
import { AnalyticsEvent, createDevLogger } from '@tloncorp/shared';
import { getLandscapeAuthCookie } from '@tloncorp/shared/api';
import { didSignUp } from '@tloncorp/shared/db';
import {
Field,
KeyboardAvoidingView,
Expand Down
6 changes: 3 additions & 3 deletions apps/tlon-mobile/src/screens/Onboarding/TlonLoginScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import {
} from '@tloncorp/app/lib/hostingApi';
import { isEulaAgreed, setEulaAgreed } from '@tloncorp/app/utils/eula';
import { getShipUrl } from '@tloncorp/app/utils/ship';
import { AnalyticsEvent, createDevLogger } from '@tloncorp/shared/dist';
import { getLandscapeAuthCookie } from '@tloncorp/shared/dist/api';
import { didSignUp } from '@tloncorp/shared/dist/db';
import { AnalyticsEvent, createDevLogger } from '@tloncorp/shared';
import { getLandscapeAuthCookie } from '@tloncorp/shared/api';
import { didSignUp } from '@tloncorp/shared/db';
import {
Field,
KeyboardAvoidingView,
Expand Down
4 changes: 2 additions & 2 deletions apps/tlon-mobile/src/screens/Onboarding/WelcomeScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { NativeStackScreenProps } from '@react-navigation/native-stack';
import { useLureMetadata } from '@tloncorp/app/contexts/branch';
import { trackOnboardingAction } from '@tloncorp/app/utils/posthog';
import { setDidShowBenefitsSheet } from '@tloncorp/shared/dist/db';
import { useDidShowBenefitsSheet } from '@tloncorp/shared/dist/store';
import { setDidShowBenefitsSheet } from '@tloncorp/shared/db';
import { useDidShowBenefitsSheet } from '@tloncorp/shared/store';
import {
ActionSheet,
Button,
Expand Down
2 changes: 1 addition & 1 deletion apps/tlon-mobile/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { NavigatorScreenParams } from '@react-navigation/native';
import type * as db from '@tloncorp/shared/dist/db';
import type * as db from '@tloncorp/shared/db';

export type SignUpExtras = {
nickname?: string;
Expand Down
2 changes: 1 addition & 1 deletion apps/tlon-web-new/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { RootStack } from '@tloncorp/app/navigation/RootStack';
import { Provider as TamaguiProvider } from '@tloncorp/app/provider';
import { AppDataProvider } from '@tloncorp/app/provider/AppDataProvider';
import { sync } from '@tloncorp/shared';
import * as store from '@tloncorp/shared/dist/store';
import * as store from '@tloncorp/shared/store';
import cookies from 'browser-cookies';
import { usePostHog } from 'posthog-js/react';
import React, { PropsWithChildren, useEffect, useMemo, useState } from 'react';
Expand Down
2 changes: 1 addition & 1 deletion apps/tlon-web-new/src/logic/analytics.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PrivacyType } from '@tloncorp/shared/dist/urbit/groups';
import { PrivacyType } from '@tloncorp/shared/urbit/groups';
import posthog, { Properties } from 'posthog-js';

import { log } from './utils';
Expand Down
8 changes: 4 additions & 4 deletions apps/tlon-web-new/src/logic/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { MessageKey } from '@tloncorp/shared/dist/urbit/activity';
import { MessageKey } from '@tloncorp/shared/urbit/activity';
import {
CacheId,
ChatStory,
Expand All @@ -9,13 +9,13 @@ import {
Verse,
VerseBlock,
VerseInline,
} from '@tloncorp/shared/dist/urbit/channel';
} from '@tloncorp/shared/urbit/channel';
import {
Bold,
Inline,
Italics,
Strikethrough,
} from '@tloncorp/shared/dist/urbit/content';
} from '@tloncorp/shared/urbit/content';
import {
Cabals,
ChannelPrivacyType,
Expand All @@ -27,7 +27,7 @@ import {
PrivacyType,
Rank,
Saga,
} from '@tloncorp/shared/dist/urbit/groups';
} from '@tloncorp/shared/urbit/groups';
import {
BigIntOrderedMap,
Docket,
Expand Down
4 changes: 2 additions & 2 deletions apps/tlon-web-new/src/mocks/chat.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { faker } from '@faker-js/faker';
import { Activity } from '@tloncorp/shared/dist/urbit/activity';
import { Activity } from '@tloncorp/shared/urbit/activity';
import {
Post,
Posts,
Story,
storyFromChatStory,
} from '@tloncorp/shared/dist/urbit/channel';
} from '@tloncorp/shared/urbit/channel';
import { decToUd, unixToDa } from '@urbit/api';
import { subDays, subMinutes } from 'date-fns';
import _ from 'lodash';
Expand Down
2 changes: 1 addition & 1 deletion apps/tlon-web-new/src/mocks/groups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
GroupPreview,
PrivacyType,
Vessel,
} from '@tloncorp/shared/dist/urbit/groups';
} from '@tloncorp/shared/urbit/groups';

import { AUTHORS } from '@/constants';
import { randomElement } from '@/logic/utils';
Expand Down
4 changes: 2 additions & 2 deletions apps/tlon-web-new/src/mocks/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import {
DMWhom,
DmRsvp,
WritDiff,
} from '@tloncorp/shared/dist/urbit/dms';
import { GroupAction } from '@tloncorp/shared/dist/urbit/groups';
} from '@tloncorp/shared/urbit/dms';
import { GroupAction } from '@tloncorp/shared/urbit/groups';
import { decToUd, udToDec, unixToDa } from '@urbit/api';
import bigInt from 'big-integer';
import _ from 'lodash';
Expand Down
2 changes: 1 addition & 1 deletion apps/tlon-web-new/src/mocks/heaps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
ScryHandler,
SubscriptionHandler,
} from '@tloncorp/mock-http-api';
import { Channels, Perm, Posts } from '@tloncorp/shared/dist/urbit/channel';
import { Channels, Perm, Posts } from '@tloncorp/shared/urbit/channel';
import { subMinutes } from 'date-fns';

const unixTime = subMinutes(new Date(), 1).getTime();
Expand Down
Loading
Loading