Skip to content

Commit

Permalink
fix: publish grpc-bridge package
Browse files Browse the repository at this point in the history
Signed-off-by: Norman Meier <norman@berty.tech>
  • Loading branch information
n0izn0iz committed Mar 20, 2022
1 parent 4bb6a3a commit 330cd46
Show file tree
Hide file tree
Showing 189 changed files with 777 additions and 759 deletions.
7 changes: 7 additions & 0 deletions go/cmd/publish-npm-package/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ type packageJSONVars struct {
func errMain() error {
pathFlag := flag.String("path", "", "path to the package to be published")
versionFlag := flag.String("version", "", "version to publish")
var manual bool
flag.BoolVar(&manual, "manual", false, "don't install deps and don't publish if set")
flag.Parse()

path := *pathFlag
Expand Down Expand Up @@ -101,6 +103,11 @@ func errMain() error {
}
logger.Info("Wrote package.json")

if manual {
logger.Info("Manual mode!")
return nil
}

cmd := exec.Command("npm", "i")
cmd.Dir = buildDir
cmd.Stderr = os.Stderr
Expand Down
2 changes: 1 addition & 1 deletion js/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = {
'module-resolver',
{
alias: {
'@berty-tech': './packages/',
'@berty': './packages/',
},
},
],
Expand Down
2 changes: 1 addition & 1 deletion js/electron-app/craco.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module.exports = {
return webpackConfig;
},
alias: {
'@berty-tech': path.join(path.resolve(__dirname, '../packages/')),
'@berty': path.join(path.resolve(__dirname, '../packages/')),
},
}
}
6 changes: 3 additions & 3 deletions js/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions js/packages/berty-i18n/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# `@berty-tech/berty-i18n`
# `@berty/berty-i18n`

> TODO: description
## Usage

```
const bertyI18N = require('@berty-tech/berty-i18n');
const bertyI18N = require('@berty/berty-i18n');
// TODO: DEMONSTRATE API
```
6 changes: 3 additions & 3 deletions js/packages/components/AttachmentImage.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React, { useState, useEffect } from 'react'
import { Image, ImageProps, ActivityIndicator, View, TouchableOpacity } from 'react-native'

import { useNavigation } from '@berty-tech/navigation'
import { useMedia } from '@berty-tech/react-redux'
import { useNavigation } from '@berty/navigation'
import { useMedia } from '@berty/react-redux'

import { getSource } from './utils'
import { useSelector } from 'react-redux'
import { selectProtocolClient } from '@berty-tech/redux/reducers/ui.reducer'
import { selectProtocolClient } from '@berty/redux/reducers/ui.reducer'

const AttachmentImage: React.FC<{ cid: string; pressable?: boolean } & Omit<ImageProps, 'source'>> =
React.memo(props => {
Expand Down
13 changes: 4 additions & 9 deletions js/packages/components/InfosChat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,10 @@ import { Text as TextNative, View } from 'react-native'
import { useTranslation } from 'react-i18next'
import { Icon, Text } from '@ui-kitten/components'

import beapi from '@berty-tech/api'
import { useStyles } from '@berty-tech/styles'
import {
pbDateToNum,
useMessengerClient,
useThemeColor,
useMessengerContext,
} from '@berty-tech/store'
import { useOneToOneContact } from '@berty-tech/react-redux'
import beapi from '@berty/api'
import { useStyles } from '@berty/styles'
import { pbDateToNum, useMessengerClient, useThemeColor, useMessengerContext } from '@berty/store'
import { useOneToOneContact } from '@berty/react-redux'

import { timeFormat } from './helpers'
import { ContactAvatar } from './avatars'
Expand Down
6 changes: 3 additions & 3 deletions js/packages/components/NotificationBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ import { Vibration } from 'react-native'
import GestureRecognizer from 'react-native-swipe-gestures'
import { useSafeAreaInsets } from 'react-native-safe-area-context'

import beapi from '@berty-tech/api'
import { useStyles } from '@berty-tech/styles'
import beapi from '@berty/api'
import { useStyles } from '@berty/styles'
import {
usePersistentOptions,
useMessengerContext,
useThemeColor,
NotificationsInhibitor,
SoundKey,
} from '@berty-tech/store'
} from '@berty/store'

import { usePrevious } from './hooks'
import notifications, { DefaultNotification } from './notifications'
Expand Down
18 changes: 9 additions & 9 deletions js/packages/components/avatars.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import palette from 'google-palette'
import { SHA3 } from 'sha3'
import { withBadge } from 'react-native-elements'

import { useStyles } from '@berty-tech/styles'
import { Maybe, useMessengerContext, useThemeColor } from '@berty-tech/store'
import { navigate } from '@berty-tech/navigation'
import beapi from '@berty-tech/api'
import PinkBotAvatar from '@berty-tech/assets/berty_bot_pink_bg.png'
import GreenDevAvatar from '@berty-tech/assets/berty_dev_green_bg.png'
import OrangeBotAvatar from '@berty-tech/assets/berty_bot_orange_bg.png'
import BlueDevAvatar from '@berty-tech/assets/berty_dev_blue_bg.png'
import { useAccount, useContact, useConversation, useMember } from '@berty-tech/react-redux'
import { useStyles } from '@berty/styles'
import { Maybe, useMessengerContext, useThemeColor } from '@berty/store'
import { navigate } from '@berty/navigation'
import beapi from '@berty/api'
import PinkBotAvatar from '@berty/assets/berty_bot_pink_bg.png'
import GreenDevAvatar from '@berty/assets/berty_dev_green_bg.png'
import OrangeBotAvatar from '@berty/assets/berty_bot_orange_bg.png'
import BlueDevAvatar from '@berty/assets/berty_dev_blue_bg.png'
import { useAccount, useContact, useConversation, useMember } from '@berty/react-redux'

import AttachmentImage from './AttachmentImage'
import GroupAvatar from './main/Avatar_Group_Copy_19.png'
Expand Down
10 changes: 5 additions & 5 deletions js/packages/components/chat/ChatSettingsMemberDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import { View, ScrollView, StatusBar } from 'react-native'
import { Layout } from '@ui-kitten/components'
import { useTranslation } from 'react-i18next'

import { useStyles } from '@berty-tech/styles'
import { ScreenFC } from '@berty-tech/navigation'
import { Maybe, useThemeColor } from '@berty-tech/store'
import { useMember } from '@berty-tech/react-redux'
import { useStyles } from '@berty/styles'
import { ScreenFC } from '@berty/navigation'
import { Maybe, useThemeColor } from '@berty/store'
import { useMember } from '@berty/react-redux'

import { FactionButtonSetting } from '../shared-components/SettingsButtons'
import { MemberAvatar } from '../avatars'
import UserDevicesList from '@berty-tech/components/chat/DeviceList'
import UserDevicesList from '@berty/components/chat/DeviceList'

const ChatSettingsMemberDetailHeader: React.FC<{
convId: Maybe<string>
Expand Down
10 changes: 5 additions & 5 deletions js/packages/components/chat/ContactSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import React, { useState } from 'react'
import { View, ScrollView, ActivityIndicator, StatusBar, Text } from 'react-native'
import { useTranslation } from 'react-i18next'

import { useStyles } from '@berty-tech/styles'
import { useThemeColor } from '@berty-tech/store'
import { ScreenFC } from '@berty-tech/navigation'
import { useContact, useConversation } from '@berty-tech/react-redux'
import { useStyles } from '@berty/styles'
import { useThemeColor } from '@berty/store'
import { ScreenFC } from '@berty/navigation'
import { useContact, useConversation } from '@berty/react-redux'

import { FingerprintContent } from '../shared-components/FingerprintContent'
import { TabBar } from '../shared-components/TabBar'
import { ContactAvatar } from '../avatars'
import UserDevicesList from '@berty-tech/components/chat/DeviceList'
import UserDevicesList from '@berty/components/chat/DeviceList'

const ContactSettingsHeaderContent: React.FC = ({ children }) => {
const [{ margin }] = useStyles()
Expand Down
10 changes: 5 additions & 5 deletions js/packages/components/chat/DeviceList.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import React, { useState, useEffect } from 'react'
import { View } from 'react-native'
import { useTranslation } from 'react-i18next'
import { ButtonDropDown } from '@berty-tech/components/shared-components'
import { berty } from '@berty-tech/api/root.pb'
import { useStyles } from '@berty-tech/styles'
import { ButtonDropDown } from '@berty/components/shared-components'
import { berty } from '@berty/api/root.pb'
import { useStyles } from '@berty/styles'
import {
getDevicesForConversationAndMember,
getSharedPushTokensForConversation,
} from '@berty-tech/store'
} from '@berty/store'
import { useSelector } from 'react-redux'
import { selectClient } from '@berty-tech/redux/reducers/ui.reducer'
import { selectClient } from '@berty/redux/reducers/ui.reducer'

const UserDevicesList: React.FC<{ memberPk: string; conversationPk: string }> = ({
memberPk,
Expand Down
20 changes: 10 additions & 10 deletions js/packages/components/chat/EnableNotificationsButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@ import { useSelector } from 'react-redux'
import { useTranslation } from 'react-i18next'
import { RESULTS, PermissionStatus, checkNotifications } from 'react-native-permissions'

import { ButtonSetting } from '@berty-tech/components/shared-components'
import { ButtonSetting } from '@berty/components/shared-components'
import {
getSharedPushTokensForConversation,
requestAndPersistPushToken,
servicesAuthViaDefault,
serviceTypes,
useAccountServices,
} from '@berty-tech/store'
import rnutil from '@berty-tech/rnutil'
import { useNavigation } from '@berty-tech/navigation'
import { useStyles } from '@berty-tech/styles'
import beapi from '@berty-tech/api'
import { GRPCError } from '@berty-tech/grpc-bridge'
import { selectClient, selectProtocolClient } from '@berty-tech/redux/reducers/ui.reducer'
import { berty } from '@berty-tech/api/root.pb'
import { useConversation } from '@berty-tech/react-redux'
} from '@berty/store'
import rnutil from '@berty/rnutil'
import { useNavigation } from '@berty/navigation'
import { useStyles } from '@berty/styles'
import beapi from '@berty/api'
import { GRPCError } from '@berty/grpc-bridge'
import { selectClient, selectProtocolClient } from '@berty/redux/reducers/ui.reducer'
import { berty } from '@berty/api/root.pb'
import { useConversation } from '@berty/react-redux'

const EnableNotificationsButton: React.FC<{
conversationPk: string
Expand Down
4 changes: 2 additions & 2 deletions js/packages/components/chat/ImageCounter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import React from 'react'
import { View } from 'react-native'
import { Text, Icon } from '@ui-kitten/components'

import { useStyles } from '@berty-tech/styles'
import { useThemeColor } from '@berty-tech/store/hooks'
import { useStyles } from '@berty/styles'
import { useThemeColor } from '@berty/store/hooks'

export const ImageCounter: React.FC<{ count: number }> = ({ count }) => {
const [{ border, padding }] = useStyles()
Expand Down
10 changes: 5 additions & 5 deletions js/packages/components/chat/InfosMultiMember.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import React from 'react'
import { View } from 'react-native'
import { Text } from '@ui-kitten/components'

import { MessageSystemWrapper } from '@berty-tech/components/chat/message/MessageSystemWrapper'
import { ChatDate } from '@berty-tech/components/chat/common'
import { useStyles } from '@berty-tech/styles'
import beapi from '@berty-tech/api'
import { useThemeColor } from '@berty-tech/store/hooks'
import { MessageSystemWrapper } from '@berty/components/chat/message/MessageSystemWrapper'
import { ChatDate } from '@berty/components/chat/common'
import { useStyles } from '@berty/styles'
import beapi from '@berty/api'
import { useThemeColor } from '@berty/store/hooks'

export const InfosMultiMember: React.FC<beapi.messenger.IConversation> = ({
createdDate: createdDateStr,
Expand Down
8 changes: 4 additions & 4 deletions js/packages/components/chat/MessageList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ import {
} from 'react-native'
import moment from 'moment'

import { useStyles } from '@berty-tech/styles'
import { useStyles } from '@berty/styles'
import {
fetchMore,
pbDateToNum,
ParsedInteraction,
useMessengerClient,
useThemeColor,
} from '@berty-tech/store'
import beapi from '@berty-tech/api'
} from '@berty/store'
import beapi from '@berty/api'
import {
useConversationInteractions,
useConversationMembersDict,
useConversation,
} from '@berty-tech/react-redux'
} from '@berty/react-redux'

import { InfosChat } from '../InfosChat'
import { Message } from './message'
Expand Down
12 changes: 6 additions & 6 deletions js/packages/components/chat/MultiMember.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ import { useTranslation } from 'react-i18next'
import AndroidKeyboardAdjust from 'react-native-android-keyboard-adjust'
import { useHeaderHeight } from '@react-navigation/elements'

import { useStyles } from '@berty-tech/styles'
import { ScreenFC } from '@berty-tech/navigation'
import { useStyles } from '@berty/styles'
import { ScreenFC } from '@berty/navigation'
import {
useReadEffect,
useNotificationsInhibitor,
useThemeColor,
pbDateToNum,
useMessengerClient,
} from '@berty-tech/store'
import beapi from '@berty-tech/api'
import { IOSOnlyKeyboardAvoidingView } from '@berty-tech/rnutil/keyboardAvoiding'
import { useConversation, useLastConvInteraction } from '@berty-tech/react-redux'
} from '@berty/store'
import beapi from '@berty/api'
import { IOSOnlyKeyboardAvoidingView } from '@berty/rnutil/keyboardAvoiding'
import { useConversation, useLastConvInteraction } from '@berty/react-redux'

import { ChatDate } from './common'
import { MultiMemberAvatar } from '../avatars'
Expand Down
10 changes: 5 additions & 5 deletions js/packages/components/chat/MultiMemberQR.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import QRCode from 'react-native-qrcode-svg'
import { Share, TouchableOpacity, View, Text, StatusBar } from 'react-native'
import { Icon, Layout } from '@ui-kitten/components'

import beapi from '@berty-tech/api'
import { ScreenFC } from '@berty-tech/navigation'
import { useStylesBertyId, useThemeColor } from '@berty-tech/store'
import { useStyles } from '@berty-tech/styles'
import { useAccount, useConversation } from '@berty-tech/react-redux'
import beapi from '@berty/api'
import { ScreenFC } from '@berty/navigation'
import { useStylesBertyId, useThemeColor } from '@berty/store'
import { useStyles } from '@berty/styles'
import { useAccount, useConversation } from '@berty/react-redux'

import { MultiMemberAvatar } from '../avatars'
import logo from '../main/1_berty_picto.png'
Expand Down
12 changes: 6 additions & 6 deletions js/packages/components/chat/MultiMemberSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ import { useTranslation } from 'react-i18next'
import ImagePicker, { ImageOrVideo } from 'react-native-image-crop-picker'
import QRCode from 'react-native-qrcode-svg'

import beapi from '@berty-tech/api'
import { useStyles } from '@berty-tech/styles'
import { ScreenFC, useNavigation } from '@berty-tech/navigation'
import { Maybe, useMessengerClient, useThemeColor } from '@berty-tech/store'
import { useConversationMembersDict, useConversation } from '@berty-tech/react-redux'
import beapi from '@berty/api'
import { useStyles } from '@berty/styles'
import { ScreenFC, useNavigation } from '@berty/navigation'
import { Maybe, useMessengerClient, useThemeColor } from '@berty/store'
import { useConversationMembersDict, useConversation } from '@berty/react-redux'

import { ButtonSetting, FactionButtonSetting } from '../shared-components/SettingsButtons'
import logo from '../main/1_berty_picto.png'
import { MemberAvatar, MultiMemberAvatar } from '../avatars'
import EnableNotificationsButton from '@berty-tech/components/chat/EnableNotificationsButton'
import EnableNotificationsButton from '@berty/components/chat/EnableNotificationsButton'

const GroupChatSettingsHeader: React.FC<{ publicKey: Maybe<string> }> = ({ publicKey }) => {
const conv = useConversation(publicKey)
Expand Down
17 changes: 6 additions & 11 deletions js/packages/components/chat/MultiMembersSettingsAddMembers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,12 @@ import { Icon, Layout } from '@ui-kitten/components'
import { SafeAreaView } from 'react-native-safe-area-context'
import Long from 'long'

import beapi from '@berty-tech/api'
import { ScreenFC } from '@berty-tech/navigation'
import { useStyles } from '@berty-tech/styles'
import { useMessengerClient, useThemeColor } from '@berty-tech/store'
import { selectInvitationListMembers } from '@berty-tech/redux/reducers/groupCreationForm.reducer'
import {
useAllContacts,
useAppDispatch,
useAppSelector,
useConversation,
} from '@berty-tech/react-redux'
import beapi from '@berty/api'
import { ScreenFC } from '@berty/navigation'
import { useStyles } from '@berty/styles'
import { useMessengerClient, useThemeColor } from '@berty/store'
import { selectInvitationListMembers } from '@berty/redux/reducers/groupCreationForm.reducer'
import { useAllContacts, useAppDispatch, useAppSelector, useConversation } from '@berty/react-redux'

import { FooterCreateGroup } from '../main/CreateGroupFooter'
import { Header, MemberList } from '../main/CreateGroupAddMembers'
Expand Down

0 comments on commit 330cd46

Please sign in to comment.