diff --git a/package.json b/package.json index c96c4c96..db314eae 100644 --- a/package.json +++ b/package.json @@ -9,11 +9,13 @@ "nohoist": [] }, "scripts": { - "build": "yarn workspace @devhub/core build && yarn workspace @devhub/components build && yarn workspace @devhub/web build", "clean": "yarn workspaces run clean", - "deploy": "yarn clean && yarn build && yarn now", - "deploy-www": "pushd packages/www; now && now alias; popd;", - "dev": "yarn workspace @devhub/core build && yarn workspace @devhub/components build && concurrently --kill-others \"yarn workspace @devhub/core build -w\" \"yarn workspace @devhub/components build -w\" \"yarn workspace @devhub/web start\" \"yarn workspace @devhub/mobile start\"", + "compile": "yarn workspace @devhub/components build", + "deploy:web": "yarn workspace @devhub/web build && yarn now", + "deploy:www": "pushd packages/www; now && now alias; popd;", + "dev": "concurrently \"yarn compile -w\" \"yarn workspace @devhub/web start\" \"yarn workspace @devhub/mobile start\"", + "dev:web": "concurrently \"yarn compile -w\" \"yarn workspace @devhub/web start\"", + "dev:mobile": "concurrently \"yarn compile -w\" \"yarn workspace @devhub/mobile start\"", "format": "yarn workspaces run format", "lint": "yarn workspaces run lint", "now": "npx now", diff --git a/packages/components/package.json b/packages/components/package.json index 3caa784b..7a759a46 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -3,7 +3,7 @@ "version": "0.29.0", "main": "dist", "scripts": { - "build": "tsc", + "build": "tsc -b", "clean": "rm -rf dist/*", "format": "prettier --write '{.,src/**}/*.{js,jsx,ts,tsx}'", "lint": "tslint -p .", diff --git a/packages/components/src/api/mappers/user.ts b/packages/components/src/api/mappers/user.ts index 703b5807..c5beab81 100644 --- a/packages/components/src/api/mappers/user.ts +++ b/packages/components/src/api/mappers/user.ts @@ -1,5 +1,5 @@ -import { GitHubUser } from '@devhub/core/dist/types' -import { User } from '@devhub/core/dist/types/graphql' +import { GitHubUser } from '@devhub/core/src/types' +import { User } from '@devhub/core/src/types/graphql' // TODO: Put this on a shared repository with the server export function fromGitHubUser( diff --git a/packages/components/src/components/AppGlobalStyles.web.tsx b/packages/components/src/components/AppGlobalStyles.web.tsx index 96d9c863..03318157 100644 --- a/packages/components/src/components/AppGlobalStyles.web.tsx +++ b/packages/components/src/components/AppGlobalStyles.web.tsx @@ -1,6 +1,6 @@ import React from 'react' -import { Theme } from '@devhub/core/dist/types' +import { Theme } from '@devhub/core/src/types' import { useTheme } from './context/ThemeContext' function getStyles(params: { theme: Theme }) { diff --git a/packages/components/src/components/cards/EmptyCards.tsx b/packages/components/src/components/cards/EmptyCards.tsx index 64d05282..1bcbd2c6 100644 --- a/packages/components/src/components/cards/EmptyCards.tsx +++ b/packages/components/src/components/cards/EmptyCards.tsx @@ -1,7 +1,7 @@ import React from 'react' import { ActivityIndicator, Text, View } from 'react-native' -import { LoadState } from '@devhub/core/dist/types' +import { LoadState } from '@devhub/core/src/types' import { contentPadding } from '../../styles/variables' import { Button } from '../common/Button' import { TransparentTextOverlay } from '../common/TransparentTextOverlay' diff --git a/packages/components/src/components/cards/EventCard.tsx b/packages/components/src/components/cards/EventCard.tsx index 722252e3..cc7b01c4 100644 --- a/packages/components/src/components/cards/EventCard.tsx +++ b/packages/components/src/components/cards/EventCard.tsx @@ -18,14 +18,14 @@ import { GitHubRepo, GitHubUser, MultipleStarEvent, -} from '@devhub/core/dist/types' -import { getEventText } from '@devhub/core/dist/utils/helpers/github/events' -import { getOwnerAndRepo } from '@devhub/core/dist/utils/helpers/github/shared' +} from '@devhub/core/src/types' +import { getEventText } from '@devhub/core/src/utils/helpers/github/events' +import { getOwnerAndRepo } from '@devhub/core/src/utils/helpers/github/shared' import { getGitHubAvatarURLFromPayload, getRepoFullNameFromObject, -} from '@devhub/core/dist/utils/helpers/github/url' -import { isEventPrivate } from '@devhub/core/dist/utils/helpers/shared' +} from '@devhub/core/src/utils/helpers/github/url' +import { isEventPrivate } from '@devhub/core/src/utils/helpers/shared' import { contentPadding } from '../../styles/variables' import { getEventIconAndColor } from '../../utils/helpers/github/events' import { diff --git a/packages/components/src/components/cards/EventCards.tsx b/packages/components/src/components/cards/EventCards.tsx index d8f612d2..7784fe0a 100644 --- a/packages/components/src/components/cards/EventCards.tsx +++ b/packages/components/src/components/cards/EventCards.tsx @@ -1,7 +1,7 @@ import React from 'react' import { FlatList, View } from 'react-native' -import { EnhancedGitHubEvent, LoadState } from '@devhub/core/dist/types' +import { EnhancedGitHubEvent, LoadState } from '@devhub/core/src/types' import { ErrorBoundary } from '../../libs/bugsnag' import { contentPadding } from '../../styles/variables' import { Button } from '../common/Button' diff --git a/packages/components/src/components/cards/NotificationCard.tsx b/packages/components/src/components/cards/NotificationCard.tsx index ad4b472f..935e20a7 100644 --- a/packages/components/src/components/cards/NotificationCard.tsx +++ b/packages/components/src/components/cards/NotificationCard.tsx @@ -4,17 +4,17 @@ import { StyleSheet, View } from 'react-native' import { GitHubNotification, GitHubNotificationReason, -} from '@devhub/core/dist/types' -import { getOwnerAndRepo } from '@devhub/core/dist/utils/helpers/github/shared' +} from '@devhub/core/src/types' +import { getOwnerAndRepo } from '@devhub/core/src/utils/helpers/github/shared' import { getGitHubURLForRepoInvitation, getGitHubURLForSecurityAlert, getIssueOrPullRequestNumberFromUrl, -} from '@devhub/core/dist/utils/helpers/github/url' +} from '@devhub/core/src/utils/helpers/github/url' import { isNotificationPrivate, trimNewLinesAndSpaces, -} from '@devhub/core/dist/utils/helpers/shared' +} from '@devhub/core/src/utils/helpers/shared' import { contentPadding } from '../../styles/variables' import { getNotificationReasonMetadata } from '../../utils/helpers/github/notifications' import { diff --git a/packages/components/src/components/cards/NotificationCards.tsx b/packages/components/src/components/cards/NotificationCards.tsx index 6c9ae48b..efcea084 100644 --- a/packages/components/src/components/cards/NotificationCards.tsx +++ b/packages/components/src/components/cards/NotificationCards.tsx @@ -1,7 +1,7 @@ import React from 'react' import { FlatList, View } from 'react-native' -import { GitHubNotification, LoadState } from '@devhub/core/dist/types' +import { GitHubNotification, LoadState } from '@devhub/core/src/types' import { ErrorBoundary } from '../../libs/bugsnag' import { contentPadding } from '../../styles/variables' import { Button } from '../common/Button' diff --git a/packages/components/src/components/cards/partials/CardIcon.tsx b/packages/components/src/components/cards/partials/CardIcon.tsx index 02920971..8ba9c060 100644 --- a/packages/components/src/components/cards/partials/CardIcon.tsx +++ b/packages/components/src/components/cards/partials/CardIcon.tsx @@ -1,7 +1,7 @@ import React from 'react' import { StyleSheet } from 'react-native' -import { Omit } from '@devhub/core/dist/types' +import { Omit } from '@devhub/core/src/types' import { IconProps } from 'react-native-vector-icons/Icon' import { Octicons as Icon } from '../../../libs/vector-icons' import { contentPadding } from '../../../styles/variables' diff --git a/packages/components/src/components/cards/partials/CardItemId.tsx b/packages/components/src/components/cards/partials/CardItemId.tsx index 4e94c74a..a64571ea 100644 --- a/packages/components/src/components/cards/partials/CardItemId.tsx +++ b/packages/components/src/components/cards/partials/CardItemId.tsx @@ -1,7 +1,7 @@ import React from 'react' import { StyleProp, StyleSheet, Text, ViewStyle } from 'react-native' -import { GitHubIcon } from '@devhub/core/dist/types' +import { GitHubIcon } from '@devhub/core/src/types' import { Octicons as Icon } from '../../../libs/vector-icons' import { radius } from '../../../styles/variables' import { fixURL } from '../../../utils/helpers/github/url' diff --git a/packages/components/src/components/cards/partials/EventCardHeader.tsx b/packages/components/src/components/cards/partials/EventCardHeader.tsx index 76fee2d2..06f6eafc 100644 --- a/packages/components/src/components/cards/partials/EventCardHeader.tsx +++ b/packages/components/src/components/cards/partials/EventCardHeader.tsx @@ -2,8 +2,8 @@ import { MomentInput } from 'moment' import React from 'react' import { StyleSheet, Text, View } from 'react-native' -import { GitHubIcon } from '@devhub/core/dist/types' -import { getDateSmallText } from '@devhub/core/dist/utils/helpers/shared' +import { GitHubIcon } from '@devhub/core/src/types' +import { getDateSmallText } from '@devhub/core/src/utils/helpers/shared' import { Octicons as Icon } from '../../../libs/vector-icons' import { Avatar } from '../../common/Avatar' import { IntervalRefresh } from '../../common/IntervalRefresh' diff --git a/packages/components/src/components/cards/partials/NotificationCardHeader.tsx b/packages/components/src/components/cards/partials/NotificationCardHeader.tsx index 7aec4f5a..eae79302 100644 --- a/packages/components/src/components/cards/partials/NotificationCardHeader.tsx +++ b/packages/components/src/components/cards/partials/NotificationCardHeader.tsx @@ -2,8 +2,8 @@ import { MomentInput } from 'moment' import React from 'react' import { StyleSheet, Text, View } from 'react-native' -import { GitHubIcon } from '@devhub/core/dist/types' -import { getDateSmallText } from '@devhub/core/dist/utils/helpers/shared' +import { GitHubIcon } from '@devhub/core/src/types' +import { getDateSmallText } from '@devhub/core/src/utils/helpers/shared' import { useReduxState } from '../../../redux/hooks/use-redux-state' import * as selectors from '../../../redux/selectors' import { Avatar } from '../../common/Avatar' diff --git a/packages/components/src/components/cards/partials/rows/CommentRow.tsx b/packages/components/src/components/cards/partials/rows/CommentRow.tsx index 464d2b97..dc47568b 100644 --- a/packages/components/src/components/cards/partials/rows/CommentRow.tsx +++ b/packages/components/src/components/cards/partials/rows/CommentRow.tsx @@ -1,7 +1,7 @@ import React from 'react' import { Text, View } from 'react-native' -import { trimNewLinesAndSpaces } from '@devhub/core/dist/utils/helpers/shared' +import { trimNewLinesAndSpaces } from '@devhub/core/src/utils/helpers/shared' import { Platform } from '../../../../libs/platform' import { fixURL } from '../../../../utils/helpers/github/url' import { Avatar } from '../../../common/Avatar' diff --git a/packages/components/src/components/cards/partials/rows/CommitListRow.tsx b/packages/components/src/components/cards/partials/rows/CommitListRow.tsx index dd8d8e2f..8b630595 100644 --- a/packages/components/src/components/cards/partials/rows/CommitListRow.tsx +++ b/packages/components/src/components/cards/partials/rows/CommitListRow.tsx @@ -3,7 +3,7 @@ import React from 'react' import { CommitRow } from './CommitRow' import { RenderItem, RowList } from './RowList' -import { GitHubCommit } from '@devhub/core/dist/types' +import { GitHubCommit } from '@devhub/core/src/types' export interface CommitListRowProps { isRead: boolean diff --git a/packages/components/src/components/cards/partials/rows/CommitRow.tsx b/packages/components/src/components/cards/partials/rows/CommitRow.tsx index 3f06487c..732ce2f7 100644 --- a/packages/components/src/components/cards/partials/rows/CommitRow.tsx +++ b/packages/components/src/components/cards/partials/rows/CommitRow.tsx @@ -1,13 +1,13 @@ import React from 'react' import { Text, View } from 'react-native' -import { tryGetUsernameFromGitHubEmail } from '@devhub/core/dist/utils/helpers/github/shared' +import { tryGetUsernameFromGitHubEmail } from '@devhub/core/src/utils/helpers/github/shared' import { getCommentIdFromUrl, getGitHubSearchURL, getGitHubURLForUser, -} from '@devhub/core/dist/utils/helpers/github/url' -import { trimNewLinesAndSpaces } from '@devhub/core/dist/utils/helpers/shared' +} from '@devhub/core/src/utils/helpers/github/url' +import { trimNewLinesAndSpaces } from '@devhub/core/src/utils/helpers/shared' import { Octicons as Icon } from '../../../../libs/vector-icons' import { fixURL } from '../../../../utils/helpers/github/url' import { Avatar } from '../../../common/Avatar' diff --git a/packages/components/src/components/cards/partials/rows/IssueOrPullRequestRow.tsx b/packages/components/src/components/cards/partials/rows/IssueOrPullRequestRow.tsx index 398c3e5e..db54e372 100644 --- a/packages/components/src/components/cards/partials/rows/IssueOrPullRequestRow.tsx +++ b/packages/components/src/components/cards/partials/rows/IssueOrPullRequestRow.tsx @@ -1,7 +1,7 @@ import React from 'react' import { StyleSheet, Text, View } from 'react-native' -import { trimNewLinesAndSpaces } from '@devhub/core/dist/utils/helpers/shared' +import { trimNewLinesAndSpaces } from '@devhub/core/src/utils/helpers/shared' import { Octicons as Icon } from '../../../../libs/vector-icons' import { defaultStyles } from '../../../../styles/styles' import { contentPadding } from '../../../../styles/variables' diff --git a/packages/components/src/components/cards/partials/rows/ReleaseRow.tsx b/packages/components/src/components/cards/partials/rows/ReleaseRow.tsx index e20d5716..4cdd01ed 100644 --- a/packages/components/src/components/cards/partials/rows/ReleaseRow.tsx +++ b/packages/components/src/components/cards/partials/rows/ReleaseRow.tsx @@ -1,8 +1,8 @@ import React from 'react' import { Text, View } from 'react-native' -import { getGitHubURLForRelease } from '@devhub/core/dist/utils/helpers/github/url' -import { trimNewLinesAndSpaces } from '@devhub/core/dist/utils/helpers/shared' +import { getGitHubURLForRelease } from '@devhub/core/src/utils/helpers/github/url' +import { trimNewLinesAndSpaces } from '@devhub/core/src/utils/helpers/shared' import { Octicons as Icon } from '../../../../libs/vector-icons' import { fixURL } from '../../../../utils/helpers/github/url' import { Avatar } from '../../../common/Avatar' diff --git a/packages/components/src/components/cards/partials/rows/RepositoryListRow.tsx b/packages/components/src/components/cards/partials/rows/RepositoryListRow.tsx index 8cde4504..5c13bfa9 100644 --- a/packages/components/src/components/cards/partials/rows/RepositoryListRow.tsx +++ b/packages/components/src/components/cards/partials/rows/RepositoryListRow.tsx @@ -1,8 +1,8 @@ import React from 'react' -import { GitHubRepo } from '@devhub/core/dist/types' -import { getOwnerAndRepo } from '@devhub/core/dist/utils/helpers/github/shared' -import { getRepoFullNameFromObject } from '@devhub/core/dist/utils/helpers/github/url' +import { GitHubRepo } from '@devhub/core/src/types' +import { getOwnerAndRepo } from '@devhub/core/src/utils/helpers/github/shared' +import { getRepoFullNameFromObject } from '@devhub/core/src/utils/helpers/github/url' import { RepositoryRow } from './RepositoryRow' import { RenderItem, RowList } from './RowList' diff --git a/packages/components/src/components/cards/partials/rows/UserListRow.tsx b/packages/components/src/components/cards/partials/rows/UserListRow.tsx index 2794deff..889f8242 100644 --- a/packages/components/src/components/cards/partials/rows/UserListRow.tsx +++ b/packages/components/src/components/cards/partials/rows/UserListRow.tsx @@ -3,7 +3,7 @@ import React from 'react' import { RenderItem, RowList } from './RowList' import { UserRow } from './UserRow' -import { GitHubUser } from '@devhub/core/dist/types' +import { GitHubUser } from '@devhub/core/src/types' export interface UserListRowProps { isRead: boolean diff --git a/packages/components/src/components/cards/partials/rows/WikiPageListRow.tsx b/packages/components/src/components/cards/partials/rows/WikiPageListRow.tsx index 82ae51bd..145a9158 100644 --- a/packages/components/src/components/cards/partials/rows/WikiPageListRow.tsx +++ b/packages/components/src/components/cards/partials/rows/WikiPageListRow.tsx @@ -1,6 +1,6 @@ import React from 'react' -import { GitHubPage } from '@devhub/core/dist/types' +import { GitHubPage } from '@devhub/core/src/types' import { RenderItem, RowList } from './RowList' import { WikiPageRow } from './WikiPageRow' diff --git a/packages/components/src/components/cards/partials/rows/WikiPageRow.tsx b/packages/components/src/components/cards/partials/rows/WikiPageRow.tsx index 7532425c..3104e171 100644 --- a/packages/components/src/components/cards/partials/rows/WikiPageRow.tsx +++ b/packages/components/src/components/cards/partials/rows/WikiPageRow.tsx @@ -1,7 +1,7 @@ import React from 'react' import { Text, View } from 'react-native' -import { trimNewLinesAndSpaces } from '@devhub/core/dist/utils/helpers/shared' +import { trimNewLinesAndSpaces } from '@devhub/core/src/utils/helpers/shared' import { Octicons as Icon } from '../../../../libs/vector-icons' import { fixURL } from '../../../../utils/helpers/github/url' import { Link } from '../../../common/Link' diff --git a/packages/components/src/components/cards/partials/rows/helpers.ts b/packages/components/src/components/cards/partials/rows/helpers.ts index 8cf359d6..4c14afeb 100644 --- a/packages/components/src/components/cards/partials/rows/helpers.ts +++ b/packages/components/src/components/cards/partials/rows/helpers.ts @@ -1,6 +1,6 @@ import _ from 'lodash' -import { GitHubURLOptions } from '@devhub/core/dist/utils/helpers/github/url' +import { GitHubURLOptions } from '@devhub/core/src/utils/helpers/github/url' import { Browser } from '../../../../libs/browser' import { fixURL } from '../../../../utils/helpers/github/url' diff --git a/packages/components/src/components/cards/partials/rows/styles.ts b/packages/components/src/components/cards/partials/rows/styles.ts index 021eac96..ac3c1be5 100644 --- a/packages/components/src/components/cards/partials/rows/styles.ts +++ b/packages/components/src/components/cards/partials/rows/styles.ts @@ -1,7 +1,7 @@ import _ from 'lodash' import { StyleSheet } from 'react-native' -import { Theme } from '@devhub/core/dist/types/themes' +import { Theme } from '@devhub/core/src/types/themes' import { contentPadding, smallTextSize } from '../../../../styles/variables' export const getCardRowStylesForTheme = _.memoize((theme: Theme) => { diff --git a/packages/components/src/components/cards/styles.ts b/packages/components/src/components/cards/styles.ts index 3199f345..8e6bfe16 100644 --- a/packages/components/src/components/cards/styles.ts +++ b/packages/components/src/components/cards/styles.ts @@ -1,7 +1,7 @@ import _ from 'lodash' import { StyleSheet } from 'react-native' -import { Theme } from '@devhub/core/dist/types/themes' +import { Theme } from '@devhub/core/src/types/themes' import { Platform } from '../../libs/platform' import { avatarSize, diff --git a/packages/components/src/components/columns/ColumnHeaderItem.tsx b/packages/components/src/components/columns/ColumnHeaderItem.tsx index 455e294e..a96d6824 100644 --- a/packages/components/src/components/columns/ColumnHeaderItem.tsx +++ b/packages/components/src/components/columns/ColumnHeaderItem.tsx @@ -10,7 +10,7 @@ import { ViewStyle, } from 'react-native' -import { GitHubIcon } from '@devhub/core/dist/types' +import { GitHubIcon } from '@devhub/core/src/types' import { Octicons as Icon } from '../../libs/vector-icons' import { useReduxState } from '../../redux/hooks/use-redux-state' import * as selectors from '../../redux/selectors' diff --git a/packages/components/src/components/columns/ColumnOptions.tsx b/packages/components/src/components/columns/ColumnOptions.tsx index 3ac7f473..fc88b311 100644 --- a/packages/components/src/components/columns/ColumnOptions.tsx +++ b/packages/components/src/components/columns/ColumnOptions.tsx @@ -2,11 +2,11 @@ import _ from 'lodash' import React, { useState } from 'react' import { ScrollView, StyleSheet, Text, View } from 'react-native' -import { Column } from '@devhub/core/dist/types' +import { Column } from '@devhub/core/src/types' import { eventTypes, getEventTypeMetadata, -} from '@devhub/core/dist/utils/helpers/github/events' +} from '@devhub/core/src/utils/helpers/github/events' import { useDimensions } from '../../hooks/use-dimensions' import { Octicons as Icon } from '../../libs/vector-icons' import * as actions from '../../redux/actions' diff --git a/packages/components/src/components/columns/ColumnOptionsRow.tsx b/packages/components/src/components/columns/ColumnOptionsRow.tsx index 7f8967fb..603f9744 100644 --- a/packages/components/src/components/columns/ColumnOptionsRow.tsx +++ b/packages/components/src/components/columns/ColumnOptionsRow.tsx @@ -2,7 +2,7 @@ import _ from 'lodash' import React from 'react' import { TouchableWithoutFeedback, View, ViewStyle } from 'react-native' -import { GitHubIcon } from '@devhub/core/dist/types' +import { GitHubIcon } from '@devhub/core/src/types' import * as colors from '../../styles/colors' import { columnHeaderItemContentSize, diff --git a/packages/components/src/components/columns/Columns.tsx b/packages/components/src/components/columns/Columns.tsx index cff42440..09cede0b 100644 --- a/packages/components/src/components/columns/Columns.tsx +++ b/packages/components/src/components/columns/Columns.tsx @@ -7,7 +7,7 @@ import { ViewStyle, } from 'react-native' -import { Omit } from '@devhub/core/dist/types' +import { Omit } from '@devhub/core/src/types' import { ColumnContainer } from '../../containers/ColumnContainer' import { useEmitter } from '../../hooks/use-emitter' import { Separator } from '../common/Separator' diff --git a/packages/components/src/components/columns/EventColumn.tsx b/packages/components/src/components/columns/EventColumn.tsx index 9c56b08f..cc7bcd84 100644 --- a/packages/components/src/components/columns/EventColumn.tsx +++ b/packages/components/src/components/columns/EventColumn.tsx @@ -1,6 +1,6 @@ import React, { useState } from 'react' -import { getColumnHeaderDetails } from '@devhub/core/dist/utils/helpers/github/events' +import { getColumnHeaderDetails } from '@devhub/core/src/utils/helpers/github/events' import { EventCardsContainer, EventCardsContainerProps, diff --git a/packages/components/src/components/columns/NotificationColumn.tsx b/packages/components/src/components/columns/NotificationColumn.tsx index 7fe8a311..04185f5f 100644 --- a/packages/components/src/components/columns/NotificationColumn.tsx +++ b/packages/components/src/components/columns/NotificationColumn.tsx @@ -1,6 +1,6 @@ import React, { useState } from 'react' -import { getColumnHeaderDetails } from '@devhub/core/dist/utils/helpers/github/events' +import { getColumnHeaderDetails } from '@devhub/core/src/utils/helpers/github/events' import { NotificationCardsContainer, NotificationCardsContainerProps, diff --git a/packages/components/src/components/common/Avatar.tsx b/packages/components/src/components/common/Avatar.tsx index 1fe87e47..dcc72f36 100644 --- a/packages/components/src/components/common/Avatar.tsx +++ b/packages/components/src/components/common/Avatar.tsx @@ -10,7 +10,7 @@ import { getUserAvatarByAvatarURL, getUserAvatarByEmail, getUserAvatarByUsername, -} from '@devhub/core/dist/utils/helpers/github/shared' +} from '@devhub/core/src/utils/helpers/github/shared' import { avatarSize, radius, smallAvatarSize } from '../../styles/variables' import { fixURL } from '../../utils/helpers/github/url' import { getRepositoryURL, getUserURL } from '../cards/partials/rows/helpers' diff --git a/packages/components/src/components/common/FAB.tsx b/packages/components/src/components/common/FAB.tsx index 0259c009..4bec2c86 100644 --- a/packages/components/src/components/common/FAB.tsx +++ b/packages/components/src/components/common/FAB.tsx @@ -7,7 +7,7 @@ import { TouchableOpacityProps, } from 'react-native' -import { GitHubIcon } from '@devhub/core/dist/types' +import { GitHubIcon } from '@devhub/core/src/types' import { Octicons as Icon } from '../../libs/vector-icons' import * as colors from '../../styles/colors' import { contentPadding } from '../../styles/variables' diff --git a/packages/components/src/components/context/ColumnWidthContext.tsx b/packages/components/src/components/context/ColumnWidthContext.tsx index 109b2454..2bec4a56 100644 --- a/packages/components/src/components/context/ColumnWidthContext.tsx +++ b/packages/components/src/components/context/ColumnWidthContext.tsx @@ -4,7 +4,7 @@ import { Dimensions, ScaledSize } from 'react-native' import { MAX_COLUMN_WIDTH, MIN_COLUMN_WIDTH, -} from '@devhub/core/dist/utils/constants' +} from '@devhub/core/src/utils/constants' import { sidebarSize } from '../../styles/variables' import { APP_LAYOUT_BREAKPOINTS, getLayoutConsumerState } from './LayoutContext' diff --git a/packages/components/src/components/context/ThemeContext.tsx b/packages/components/src/components/context/ThemeContext.tsx index 07fcd23d..7e101c00 100644 --- a/packages/components/src/components/context/ThemeContext.tsx +++ b/packages/components/src/components/context/ThemeContext.tsx @@ -1,6 +1,6 @@ import React, { useContext } from 'react' -import { Theme } from '@devhub/core/dist/types' +import { Theme } from '@devhub/core/src/types' import { useReduxState } from '../../redux/hooks/use-redux-state' import * as selectors from '../../redux/selectors' import { defaultThemePair } from '../../redux/selectors/config' diff --git a/packages/components/src/components/layout/Sidebar.tsx b/packages/components/src/components/layout/Sidebar.tsx index 99b240f0..c9bcd3f2 100644 --- a/packages/components/src/components/layout/Sidebar.tsx +++ b/packages/components/src/components/layout/Sidebar.tsx @@ -8,8 +8,8 @@ import { View, } from 'react-native' -import { ModalPayload } from '@devhub/core/dist/types' -import { getColumnHeaderDetails } from '@devhub/core/dist/utils/helpers/github/events' +import { ModalPayload } from '@devhub/core/src/types' +import { getColumnHeaderDetails } from '@devhub/core/src/utils/helpers/github/events' import { useColumn } from '../../hooks/use-column' import * as actions from '../../redux/actions' import { useReduxAction } from '../../redux/hooks/use-redux-action' diff --git a/packages/components/src/components/modals/AddColumnDetailsModal.tsx b/packages/components/src/components/modals/AddColumnDetailsModal.tsx index 11f23e69..6a2a6e14 100644 --- a/packages/components/src/components/modals/AddColumnDetailsModal.tsx +++ b/packages/components/src/components/modals/AddColumnDetailsModal.tsx @@ -8,12 +8,12 @@ import { AddColumnDetailsPayload, ColumnParamField, NotificationColumn, -} from '@devhub/core/dist/types' +} from '@devhub/core/src/types' import * as actions from '../../redux/actions' import { ModalColumn } from '../columns/ModalColumn' -import { createSubscriptionObjectWithId } from '@devhub/core/dist/utils/helpers/github/shared' -import { guid } from '@devhub/core/dist/utils/helpers/shared' +import { createSubscriptionObjectWithId } from '@devhub/core/src/utils/helpers/github/shared' +import { guid } from '@devhub/core/src/utils/helpers/shared' import { useReduxAction } from '../../redux/hooks/use-redux-action' import { contentPadding } from '../../styles/variables' import { ColumnHeaderItem } from '../columns/ColumnHeaderItem' diff --git a/packages/components/src/components/modals/AddColumnModal.tsx b/packages/components/src/components/modals/AddColumnModal.tsx index e823dfc0..99930257 100644 --- a/packages/components/src/components/modals/AddColumnModal.tsx +++ b/packages/components/src/components/modals/AddColumnModal.tsx @@ -1,7 +1,7 @@ import React, { useState } from 'react' import { Text, TouchableOpacity, View } from 'react-native' -import { AddColumnDetailsPayload } from '@devhub/core/dist/types' +import { AddColumnDetailsPayload } from '@devhub/core/src/types' import * as actions from '../../redux/actions' import { useReduxAction } from '../../redux/hooks/use-redux-action' import { contentPadding } from '../../styles/variables' diff --git a/packages/components/src/components/widgets/ThemePreference.tsx b/packages/components/src/components/widgets/ThemePreference.tsx index efc3b002..49c491c2 100644 --- a/packages/components/src/components/widgets/ThemePreference.tsx +++ b/packages/components/src/components/widgets/ThemePreference.tsx @@ -1,7 +1,7 @@ import React from 'react' import { StyleSheet, Text, TouchableOpacity, View } from 'react-native' -import { Theme } from '@devhub/core/dist/types' +import { Theme } from '@devhub/core/src/types' import { useTheme } from '../../components/context/ThemeContext' import * as actions from '../../redux/actions' import { useReduxAction } from '../../redux/hooks/use-redux-action' diff --git a/packages/components/src/containers/EventCardsContainer.tsx b/packages/components/src/containers/EventCardsContainer.tsx index 01e8d58f..cc4d1431 100644 --- a/packages/components/src/containers/EventCardsContainer.tsx +++ b/packages/components/src/containers/EventCardsContainer.tsx @@ -9,7 +9,7 @@ import { GitHubEvent, LoadState, Omit, -} from '@devhub/core/dist/types' +} from '@devhub/core/src/types' import { EventCards, EventCardsProps } from '../components/cards/EventCards' import { getActivity } from '../libs/github' import { getFilteredEvents } from '../utils/helpers/filters' diff --git a/packages/components/src/containers/NotificationCardsContainer.tsx b/packages/components/src/containers/NotificationCardsContainer.tsx index be765fc9..764a77c1 100644 --- a/packages/components/src/containers/NotificationCardsContainer.tsx +++ b/packages/components/src/containers/NotificationCardsContainer.tsx @@ -8,14 +8,14 @@ import { LoadState, NotificationSubscription, Omit, -} from '@devhub/core/dist/types' -import { getOwnerAndRepo } from '@devhub/core/dist/utils/helpers/github/shared' +} from '@devhub/core/src/types' +import { getOwnerAndRepo } from '@devhub/core/src/utils/helpers/github/shared' import { getCommentIdFromUrl, getCommitShaFromUrl, getIssueOrPullRequestNumberFromUrl, getReleaseIdFromUrl, -} from '@devhub/core/dist/utils/helpers/github/url' +} from '@devhub/core/src/utils/helpers/github/url' import { NotificationCards, NotificationCardsProps, diff --git a/packages/components/src/libs/github/index.ts b/packages/components/src/libs/github/index.ts index 91659240..317f9c9b 100644 --- a/packages/components/src/libs/github/index.ts +++ b/packages/components/src/libs/github/index.ts @@ -1,6 +1,6 @@ import Octokit from '@octokit/rest' -import { GitHubActivityType } from '@devhub/core/dist/types' +import { GitHubActivityType } from '@devhub/core/src/types' export const octokit = new Octokit() diff --git a/packages/components/src/libs/oauth/index.ts b/packages/components/src/libs/oauth/index.ts index cff70f45..d54d1588 100644 --- a/packages/components/src/libs/oauth/index.ts +++ b/packages/components/src/libs/oauth/index.ts @@ -1,6 +1,6 @@ import qs from 'qs' -import { API_BASE_URL } from '@devhub/core/dist/utils/constants' +import { API_BASE_URL } from '@devhub/core/src/utils/constants' import { Browser } from '../browser' import { getUrlParamsIfMatches, listenForNextUrl } from './helpers' diff --git a/packages/components/src/libs/oauth/index.web.ts b/packages/components/src/libs/oauth/index.web.ts index b50f8880..e02e4361 100644 --- a/packages/components/src/libs/oauth/index.web.ts +++ b/packages/components/src/libs/oauth/index.web.ts @@ -1,6 +1,6 @@ import qs from 'qs' -import { API_BASE_URL } from '@devhub/core/dist/utils/constants' +import { API_BASE_URL } from '@devhub/core/src/utils/constants' import { listenForNextMessageData } from './helpers.web' function popupWindow(url: string, w: number = 500, h: number = 600) { diff --git a/packages/components/src/redux/actions/auth.ts b/packages/components/src/redux/actions/auth.ts index d31e1a68..e36f779b 100644 --- a/packages/components/src/redux/actions/auth.ts +++ b/packages/components/src/redux/actions/auth.ts @@ -1,4 +1,4 @@ -import { User } from '@devhub/core/dist/types/graphql' +import { User } from '@devhub/core/src/types/graphql' import { createAction, createErrorAction } from '../helpers' export function loginRequest(payload: { diff --git a/packages/components/src/redux/actions/columns.ts b/packages/components/src/redux/actions/columns.ts index 4920c190..886c5f26 100644 --- a/packages/components/src/redux/actions/columns.ts +++ b/packages/components/src/redux/actions/columns.ts @@ -4,7 +4,7 @@ import { GitHubEvent, GitHubNotificationReason, NotificationColumnFilters, -} from '@devhub/core/dist/types' +} from '@devhub/core/src/types' import { createAction } from '../helpers' export function replaceColumns(payload: ColumnAndSubscriptions[]) { diff --git a/packages/components/src/redux/actions/config.ts b/packages/components/src/redux/actions/config.ts index a707a9c7..88d8eb16 100644 --- a/packages/components/src/redux/actions/config.ts +++ b/packages/components/src/redux/actions/config.ts @@ -1,4 +1,4 @@ -import { ThemePair } from '@devhub/core/dist/types' +import { ThemePair } from '@devhub/core/src/types' import { createAction } from '../helpers' export function setTheme(payload: { diff --git a/packages/components/src/redux/actions/navigation.ts b/packages/components/src/redux/actions/navigation.ts index 57e078ec..a3f1a491 100644 --- a/packages/components/src/redux/actions/navigation.ts +++ b/packages/components/src/redux/actions/navigation.ts @@ -1,4 +1,4 @@ -import { ModalPayload } from '@devhub/core/dist/types' +import { ModalPayload } from '@devhub/core/src/types' import { createAction } from '../helpers' export function pushModal(payload: ModalPayload) { diff --git a/packages/components/src/redux/reducers/auth.ts b/packages/components/src/redux/reducers/auth.ts index 4bb019d4..3e06eaef 100644 --- a/packages/components/src/redux/reducers/auth.ts +++ b/packages/components/src/redux/reducers/auth.ts @@ -1,7 +1,7 @@ import _ from 'lodash' import { REHYDRATE } from 'redux-persist' -import { User } from '@devhub/core/dist/types/graphql' +import { User } from '@devhub/core/src/types/graphql' import { Reducer } from '../types' export interface State { diff --git a/packages/components/src/redux/reducers/columns.ts b/packages/components/src/redux/reducers/columns.ts index 67aa9b69..bcc3b738 100644 --- a/packages/components/src/redux/reducers/columns.ts +++ b/packages/components/src/redux/reducers/columns.ts @@ -5,8 +5,8 @@ import { ActivityColumn, Column, NotificationColumn, -} from '@devhub/core/dist/types' -import { guid } from '@devhub/core/dist/utils/helpers/shared' +} from '@devhub/core/src/types' +import { guid } from '@devhub/core/src/utils/helpers/shared' import { Reducer } from '../types' export interface State { diff --git a/packages/components/src/redux/reducers/config.ts b/packages/components/src/redux/reducers/config.ts index 206f9a51..4b515c70 100644 --- a/packages/components/src/redux/reducers/config.ts +++ b/packages/components/src/redux/reducers/config.ts @@ -1,11 +1,11 @@ import immer from 'immer' import _ from 'lodash' -import { ThemePair } from '@devhub/core/dist/types' +import { ThemePair } from '@devhub/core/src/types' import { DEFAULT_DARK_THEME, DEFAULT_LIGHT_THEME, -} from '@devhub/core/dist/utils/constants' +} from '@devhub/core/src/utils/constants' import { loadTheme } from '../../styles/utils' import { Reducer } from '../types' diff --git a/packages/components/src/redux/reducers/navigation.ts b/packages/components/src/redux/reducers/navigation.ts index 7a9e49a1..67fea94f 100644 --- a/packages/components/src/redux/reducers/navigation.ts +++ b/packages/components/src/redux/reducers/navigation.ts @@ -1,6 +1,6 @@ import immer from 'immer' -import { ModalPayload } from '@devhub/core/dist/types' +import { ModalPayload } from '@devhub/core/src/types' import { Reducer } from '../types' export interface State { diff --git a/packages/components/src/redux/reducers/subscriptions.ts b/packages/components/src/redux/reducers/subscriptions.ts index 2f3ade36..ba80cbd2 100644 --- a/packages/components/src/redux/reducers/subscriptions.ts +++ b/packages/components/src/redux/reducers/subscriptions.ts @@ -1,7 +1,7 @@ import immer from 'immer' import _ from 'lodash' -import { ColumnSubscription } from '@devhub/core/dist/types' +import { ColumnSubscription } from '@devhub/core/src/types' import { Reducer } from '../types' export interface State { diff --git a/packages/components/src/redux/sagas/auth.ts b/packages/components/src/redux/sagas/auth.ts index 7a4d303c..1fce7f02 100644 --- a/packages/components/src/redux/sagas/auth.ts +++ b/packages/components/src/redux/sagas/auth.ts @@ -2,9 +2,9 @@ import axios, { AxiosResponse } from 'axios' import { REHYDRATE } from 'redux-persist' import { all, call, put, select, takeLatest } from 'redux-saga/effects' -import { GitHubUser } from '@devhub/core/dist/types' -import { User } from '@devhub/core/dist/types/graphql' -import { GRAPHQL_ENDPOINT } from '@devhub/core/dist/utils/constants' +import { GitHubUser } from '@devhub/core/src/types' +import { User } from '@devhub/core/src/types/graphql' +import { GRAPHQL_ENDPOINT } from '@devhub/core/src/utils/constants' import { fromGitHubUser } from '../../api/mappers/user' import * as github from '../../libs/github' import * as actions from '../actions' diff --git a/packages/components/src/redux/sagas/columns.ts b/packages/components/src/redux/sagas/columns.ts index 369a528d..d70a9e7b 100644 --- a/packages/components/src/redux/sagas/columns.ts +++ b/packages/components/src/redux/sagas/columns.ts @@ -1,8 +1,8 @@ import { all, put, select, takeLatest } from 'redux-saga/effects' -import { ColumnAndSubscriptions } from '@devhub/core/dist/types' -import { createSubscriptionObjectWithId } from '@devhub/core/dist/utils/helpers/github/shared' -import { guid } from '@devhub/core/dist/utils/helpers/shared' +import { ColumnAndSubscriptions } from '@devhub/core/src/types' +import { createSubscriptionObjectWithId } from '@devhub/core/src/utils/helpers/github/shared' +import { guid } from '@devhub/core/src/utils/helpers/shared' import { delay } from 'redux-saga' import { emitter } from '../../setup' import * as actions from '../actions' diff --git a/packages/components/src/redux/sagas/config.ts b/packages/components/src/redux/sagas/config.ts index 81287994..e9a43a56 100644 --- a/packages/components/src/redux/sagas/config.ts +++ b/packages/components/src/redux/sagas/config.ts @@ -1,7 +1,7 @@ import { delay } from 'redux-saga' import { all, fork, put } from 'redux-saga/effects' -import { isNight } from '@devhub/core/dist/utils/helpers/shared' +import { isNight } from '@devhub/core/src/utils/helpers/shared' import * as actions from '../actions' let wasNight diff --git a/packages/components/src/redux/sagas/subscriptions.ts b/packages/components/src/redux/sagas/subscriptions.ts index b8bf7e75..068aefec 100644 --- a/packages/components/src/redux/sagas/subscriptions.ts +++ b/packages/components/src/redux/sagas/subscriptions.ts @@ -1,7 +1,7 @@ import _ from 'lodash' import { all, put, select, takeLatest } from 'redux-saga/effects' -import { Column } from '@devhub/core/dist/types' +import { Column } from '@devhub/core/src/types' import * as actions from '../actions' import * as selectors from '../selectors' diff --git a/packages/components/src/redux/selectors/config.ts b/packages/components/src/redux/selectors/config.ts index 50fedef2..2a1af323 100644 --- a/packages/components/src/redux/selectors/config.ts +++ b/packages/components/src/redux/selectors/config.ts @@ -1,8 +1,8 @@ import { createSelector } from 'reselect' -import { ThemePair } from '@devhub/core/dist/types' -import * as constants from '@devhub/core/dist/utils/constants' -import { isNight } from '@devhub/core/dist/utils/helpers/shared' +import { ThemePair } from '@devhub/core/src/types' +import * as constants from '@devhub/core/src/utils/constants' +import { isNight } from '@devhub/core/src/utils/helpers/shared' import { loadTheme } from '../../styles/utils' import { RootState } from '../types' diff --git a/packages/components/src/redux/store.ts b/packages/components/src/redux/store.ts index a45c2204..44df0bbf 100644 --- a/packages/components/src/redux/store.ts +++ b/packages/components/src/redux/store.ts @@ -10,9 +10,9 @@ import { import storage from 'redux-persist/lib/storage' import createSagaMiddleware from 'redux-saga' -import { Column, ColumnSubscription, GitHubUser } from '@devhub/core/dist/types' -import { GraphQLGitHubUser } from '@devhub/core/dist/types/graphql' -import { guid } from '@devhub/core/dist/utils/helpers/shared' +import { Column, ColumnSubscription, GitHubUser } from '@devhub/core/src/types' +import { GraphQLGitHubUser } from '@devhub/core/src/types/graphql' +import { guid } from '@devhub/core/src/utils/helpers/shared' import { rootReducer } from './reducers' import { rootSaga } from './sagas' import * as selectors from './selectors' diff --git a/packages/components/src/styles/themes.ts b/packages/components/src/styles/themes.ts index 9b2711d5..3e1bdb36 100644 --- a/packages/components/src/styles/themes.ts +++ b/packages/components/src/styles/themes.ts @@ -1,4 +1,4 @@ -import { Theme, ThemeName } from '@devhub/core/dist/types/themes' +import { Theme, ThemeName } from '@devhub/core/src/types/themes' import { theme as darkBlack } from './themes/dark-black' import { theme as darkBlue } from './themes/dark-blue' import { theme as darkGray } from './themes/dark-gray' diff --git a/packages/components/src/styles/themes/custom.ts b/packages/components/src/styles/themes/custom.ts index ceb90b40..310e8e00 100644 --- a/packages/components/src/styles/themes/custom.ts +++ b/packages/components/src/styles/themes/custom.ts @@ -1,6 +1,6 @@ import { darken, getLuminance, invert, lighten, rgba } from 'polished' -import { Theme } from '@devhub/core/dist/types/themes' +import { Theme } from '@devhub/core/src/types/themes' function createTheme(theme: Theme): Theme { return theme diff --git a/packages/components/src/styles/utils.ts b/packages/components/src/styles/utils.ts index eddf780d..88423958 100644 --- a/packages/components/src/styles/utils.ts +++ b/packages/components/src/styles/utils.ts @@ -1,6 +1,6 @@ -import { Theme, ThemePair } from '@devhub/core/dist/types/themes' -import * as constants from '@devhub/core/dist/utils/constants' -import { isNight } from '@devhub/core/dist/utils/helpers/shared' +import { Theme, ThemePair } from '@devhub/core/src/types/themes' +import * as constants from '@devhub/core/src/utils/constants' +import { isNight } from '@devhub/core/src/utils/helpers/shared' import { themes } from './themes' import { createThemeFromColor } from './themes/custom' diff --git a/packages/components/src/utils/helpers/filters.ts b/packages/components/src/utils/helpers/filters.ts index 706cde7f..8d67eb0a 100644 --- a/packages/components/src/utils/helpers/filters.ts +++ b/packages/components/src/utils/helpers/filters.ts @@ -5,12 +5,12 @@ import { GitHubEvent, GitHubNotification, NotificationColumnFilters, -} from '@devhub/core/dist/types' -import { mergeSimilarEvents } from '@devhub/core/dist/utils/helpers/github/events' +} from '@devhub/core/src/types' +import { mergeSimilarEvents } from '@devhub/core/src/utils/helpers/github/events' import { isEventPrivate, isNotificationPrivate, -} from '@devhub/core/dist/utils/helpers/shared' +} from '@devhub/core/src/utils/helpers/shared' export const filterRecordHasAnyForcedValue = ( filtersRecord: Record | undefined, diff --git a/packages/components/src/utils/helpers/github/events.ts b/packages/components/src/utils/helpers/github/events.ts index d5539186..ffa2404e 100644 --- a/packages/components/src/utils/helpers/github/events.ts +++ b/packages/components/src/utils/helpers/github/events.ts @@ -3,8 +3,8 @@ import { GitHubIcon, GitHubIssue, GitHubPullRequest, -} from '@devhub/core/dist/types' -import { isPullRequest } from '@devhub/core/dist/utils/helpers/github/shared' +} from '@devhub/core/src/types' +import { isPullRequest } from '@devhub/core/src/utils/helpers/github/shared' import * as colors from '../../../styles/colors' import { getIssueIconAndColor, getPullRequestIconAndColor } from './shared' diff --git a/packages/components/src/utils/helpers/github/notifications.ts b/packages/components/src/utils/helpers/github/notifications.ts index b1ede077..f57103dc 100644 --- a/packages/components/src/utils/helpers/github/notifications.ts +++ b/packages/components/src/utils/helpers/github/notifications.ts @@ -1,5 +1,5 @@ -import { GitHubNotificationReason } from '@devhub/core/dist/types' -import { capitalize } from '@devhub/core/dist/utils/helpers/shared' +import { GitHubNotificationReason } from '@devhub/core/src/types' +import { capitalize } from '@devhub/core/src/utils/helpers/shared' import * as colors from '../../../styles/colors' export const notificationReasons: GitHubNotificationReason[] = [ diff --git a/packages/components/src/utils/helpers/github/shared.ts b/packages/components/src/utils/helpers/github/shared.ts index 66780599..00367a3a 100644 --- a/packages/components/src/utils/helpers/github/shared.ts +++ b/packages/components/src/utils/helpers/github/shared.ts @@ -6,7 +6,7 @@ import { import { getCommitIconAndColor, isPullRequest, -} from '@devhub/core/dist/utils/helpers/github/shared' +} from '@devhub/core/src/utils/helpers/github/shared' import * as colors from '../../../styles/colors' export function getPullRequestIconAndColor(pullRequest: { diff --git a/packages/components/src/utils/helpers/github/url.ts b/packages/components/src/utils/helpers/github/url.ts index 8cd16e0c..17a9c89e 100644 --- a/packages/components/src/utils/helpers/github/url.ts +++ b/packages/components/src/utils/helpers/github/url.ts @@ -1,7 +1,7 @@ import { fixURLForPlatform, GitHubURLOptions, -} from '@devhub/core/dist/utils/helpers/github/url' +} from '@devhub/core/src/utils/helpers/github/url' import { Platform } from '../../../libs/platform' export function fixURL(url?: string, options?: GitHubURLOptions) { diff --git a/packages/core/package.json b/packages/core/package.json index 5ab21e24..f10cbb45 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -3,7 +3,7 @@ "version": "0.29.0", "main": "dist", "scripts": { - "build": "tsc", + "build": "tsc -b", "clean": "rm -rf dist/*", "format": "prettier --write '{.,src/**}/*.{js,jsx,ts,tsx}'", "lint": "tslint -p .", diff --git a/packages/core/src/utils/helpers/shared.ts b/packages/core/src/utils/helpers/shared.ts index 33a89211..1161b2d3 100644 --- a/packages/core/src/utils/helpers/shared.ts +++ b/packages/core/src/utils/helpers/shared.ts @@ -1,6 +1,5 @@ import _ from 'lodash' import moment, { MomentInput } from 'moment' -import { PixelRatio } from 'react-native' import { EnhancedGitHubEvent, GitHubNotification } from '../../types' export function capitalize(str: string) { diff --git a/packages/core/tsconfig.json b/packages/core/tsconfig.json index b84b27e6..4ec7df7a 100644 --- a/packages/core/tsconfig.json +++ b/packages/core/tsconfig.json @@ -11,6 +11,5 @@ "../../@types", "../../node_modules/@types" ] - }, - "include": ["src/"] + } } diff --git a/packages/mobile/index.js b/packages/mobile/index.js index 82297187..bae283cb 100644 --- a/packages/mobile/index.js +++ b/packages/mobile/index.js @@ -6,7 +6,7 @@ import { GoogleAnalyticsTracker, } from 'react-native-google-analytics-bridge' -import { App } from '@devhub/components/dist/components/App' +import { App } from '@devhub/components/src/components/App' export const tracker = new GoogleAnalyticsTracker('UA-52350759-2') GoogleAnalyticsSettings.setDispatchInterval(10) diff --git a/packages/mobile/package.json b/packages/mobile/package.json index fbd02371..a8fe42a3 100644 --- a/packages/mobile/package.json +++ b/packages/mobile/package.json @@ -9,7 +9,7 @@ "start": "node ../../node_modules/react-native/local-cli/cli.js start", "studio": "open -a /Applications/Android\\ Studio.app ./android/", "test": "jest", - "tsc": "tsc", + "tsc": "tsc -b", "xcode": "open ios/devhub.xcodeproj" }, "dependencies": { diff --git a/packages/web/config-overrides.js b/packages/web/config-overrides.js index 80b8d821..ce52cb68 100644 --- a/packages/web/config-overrides.js +++ b/packages/web/config-overrides.js @@ -1,22 +1,69 @@ const fs = require('fs') const path = require('path') +const resolve = require('resolve') const webpack = require('webpack') const BundleAnalyzerPlugin = require('webpack-bundle-analyzer') .BundleAnalyzerPlugin const ReactNativeWebPlugin = require('babel-plugin-react-native-web') +const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin-alt') const appDirectory = fs.realpathSync(process.cwd()) const resolveApp = relativePath => path.resolve(appDirectory, relativePath) +const appIncludes = [ + resolveApp('src'), + resolveApp('../core/src'), + resolveApp('../components/src'), +] + module.exports = function override(config, env) { config.resolve.alias['deepmerge$'] = 'deepmerge/dist/umd.js' + // allow importing from outside of src folder + config.resolve.plugins = config.resolve.plugins.filter( + plugin => plugin.constructor.name !== 'ModuleScopePlugin', + ) + + config.module.rules[0].include = appIncludes config.module.rules[1] = null + config.module.rules[2].oneOf[1].include = appIncludes config.module.rules[2].oneOf[1].options.plugins = [ require.resolve('babel-plugin-react-native-web'), ].concat(config.module.rules[2].oneOf[1].options.plugins) config.module.rules = config.module.rules.filter(Boolean) + config.plugins = config.plugins.map(plugin => { + if (plugin.constructor.name !== 'ForkTsCheckerWebpackPlugin') return plugin + + return new ForkTsCheckerWebpackPlugin({ + typescript: resolve.sync('typescript', { + basedir: resolveApp('node_modules'), + }), + async: false, + checkSyntacticErrors: true, + tsconfig: resolveApp('tsconfig.json'), + compilerOptions: { + module: 'esnext', + moduleResolution: 'node', + resolveJsonModule: true, + isolatedModules: true, + noEmit: true, + jsx: 'preserve', + }, + reportFiles: [ + '**', + '!**/*.json', + '!**/__tests__/**', + '!**/?(*.)(spec|test).*', + '!src/setupProxy.js', + '!src/setupTests.*', + ], + watch: appIncludes, // <- changed this + silent: false, + // formatter: typescriptFormatter, + }) + }) + config.plugins.push( new webpack.DefinePlugin({ __DEV__: env !== 'production' }), ) diff --git a/packages/web/package.json b/packages/web/package.json index 74aa1394..561be86a 100644 --- a/packages/web/package.json +++ b/packages/web/package.json @@ -11,7 +11,7 @@ "now-build": "build", "predeploy": "npm run build", "prepare": "cd .. && yarn patch-package", - "serve": "serve build", + "serve": "serve dist", "start": "react-app-rewired start", "test": "react-app-rewired test" }, diff --git a/packages/web/src/index.tsx b/packages/web/src/index.tsx index a6515fa0..b7d1f36d 100644 --- a/packages/web/src/index.tsx +++ b/packages/web/src/index.tsx @@ -7,7 +7,7 @@ import { AppRegistry } from 'react-native-web' import './index.css' import './reset.css' -import { App } from '@devhub/components/dist/components/App' +import { App } from '@devhub/components/src/components/App' AppRegistry.registerComponent('devhub', () => App) AppRegistry.runApplication('devhub', { diff --git a/packages/web/tsconfig.json b/packages/web/tsconfig.json index 654bfb0d..1a715dcc 100644 --- a/packages/web/tsconfig.json +++ b/packages/web/tsconfig.json @@ -4,14 +4,16 @@ "allowJs": false, "composite": true, "declaration": true, - "jsx": "react", - "noEmit": false, + "jsx": "preserve", + "noEmit": true, "outDir": "dist", "rootDir": "src", "typeRoots": [ "../../@types", "../../node_modules/@types" - ] + ], + "forceConsistentCasingInFileNames": true, + "isolatedModules": true }, "include": [ "src/index.tsx" @@ -20,6 +22,11 @@ "src/setupProxy.js" ], "references": [ - { "path": "../components" } + { + "path": "../core" + }, + { + "path": "../components" + } ] }