chore: remove data-provider and use npm package instead (#713)

* chore: remove data-provider, install npm package

* chore: replace monorepo package with npm package: librechat-data-provider

* chore: remove data-provider scripts

* chore: remove data-provider from .eslintrc.js
This commit is contained in:
Danny Avila 2023-07-27 14:49:47 -04:00 committed by GitHub
parent 777d64088b
commit 369b1f4eba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
46 changed files with 1403 additions and 3415 deletions

View file

@ -6,7 +6,7 @@ import { useNavigate } from 'react-router-dom';
import { useRecoilValue } from 'recoil';
import store from '~/store';
import { localize } from '~/localization/Translation';
import { useGetStartupConfig } from '@librechat/data-provider';
import { useGetStartupConfig } from 'librechat-data-provider';
import { GoogleIcon, OpenIDIcon, GithubIcon, DiscordIcon } from '~/components';
function Login() {

View file

@ -2,7 +2,7 @@ import { useForm } from 'react-hook-form';
import { useRecoilValue } from 'recoil';
import store from '~/store';
import { localize } from '~/localization/Translation';
import { TLoginUser } from '@librechat/data-provider';
import { TLoginUser } from 'librechat-data-provider';
type TLoginFormProps = {
onSubmit: (data: TLoginUser) => void;

View file

@ -8,7 +8,7 @@ import {
useRegisterUserMutation,
TRegisterUser,
useGetStartupConfig,
} from '@librechat/data-provider';
} from 'librechat-data-provider';
import { GoogleIcon, OpenIDIcon, GithubIcon, DiscordIcon } from '~/components';
function Registration() {

View file

@ -7,7 +7,7 @@ import {
useRequestPasswordResetMutation,
TRequestPasswordReset,
TRequestPasswordResetResponse,
} from '@librechat/data-provider';
} from 'librechat-data-provider';
function RequestPasswordReset() {
const lang = useRecoilValue(store.lang);

View file

@ -1,6 +1,6 @@
import { useState } from 'react';
import { useForm } from 'react-hook-form';
import { useResetPasswordMutation, TResetPassword } from '@librechat/data-provider';
import { useResetPasswordMutation, TResetPassword } from 'librechat-data-provider';
import { useNavigate, useSearchParams } from 'react-router-dom';
import { useRecoilValue } from 'recoil';
import store from '~/store';

View file

@ -1,9 +1,9 @@
import { render, waitFor } from 'layout-test-utils';
import userEvent from '@testing-library/user-event';
import Login from '../Login';
import * as mockDataProvider from '@librechat/data-provider';
import * as mockDataProvider from 'librechat-data-provider';
jest.mock('@librechat/data-provider');
jest.mock('librechat-data-provider');
const setup = ({
useGetUserQueryReturnValue = {

View file

@ -1,9 +1,9 @@
import { render, waitFor } from 'layout-test-utils';
import userEvent from '@testing-library/user-event';
import Registration from '../Registration';
import * as mockDataProvider from '@librechat/data-provider';
import * as mockDataProvider from 'librechat-data-provider';
jest.mock('@librechat/data-provider');
jest.mock('librechat-data-provider');
const setup = ({
useGetUserQueryReturnValue = {

View file

@ -1,6 +1,6 @@
import { useState, useRef, useEffect } from 'react';
import { useRecoilState, useSetRecoilState } from 'recoil';
import { useUpdateConversationMutation } from '@librechat/data-provider';
import { useUpdateConversationMutation } from 'librechat-data-provider';
import RenameButton from './RenameButton';
import DeleteButton from './DeleteButton';
import ConvoIcon from '../svg/ConvoIcon';

View file

@ -1,5 +1,5 @@
import Conversation from './Conversation';
import { TConversation } from '@librechat/data-provider';
import { TConversation } from 'librechat-data-provider';
export default function Conversations({
conversations,

View file

@ -2,7 +2,7 @@ import { useEffect } from 'react';
import TrashIcon from '../svg/TrashIcon';
import CrossIcon from '../svg/CrossIcon';
import { useRecoilValue } from 'recoil';
import { useDeleteConversationMutation } from '@librechat/data-provider';
import { useDeleteConversationMutation } from 'librechat-data-provider';
import store from '~/store';

View file

@ -5,7 +5,7 @@ import { Checkbox } from '~/components/ui/Checkbox.tsx';
import SelectDropDown from '../../ui/SelectDropDown';
import { cn } from '~/utils/';
import useDebounce from '~/hooks/useDebounce';
import { useUpdateTokenCountMutation } from '@librechat/data-provider';
import { useUpdateTokenCountMutation } from 'librechat-data-provider';
import { useRecoilValue } from 'recoil';
import store from '~/store';
import { localize } from '~/localization/Translation';

View file

@ -3,7 +3,7 @@ import { useRecoilValue } from 'recoil';
import { Dialog, DialogTemplate, Input, Label } from '../ui/';
import { cn } from '~/utils/';
import cleanupPreset from '~/utils/cleanupPreset';
import { useCreatePresetMutation } from '@librechat/data-provider';
import { useCreatePresetMutation } from 'librechat-data-provider';
import store from '~/store';
import { localize } from '~/localization/Translation';

View file

@ -1,5 +1,5 @@
import React from 'react';
import { useGetStartupConfig } from '@librechat/data-provider';
import { useGetStartupConfig } from 'librechat-data-provider';
export default function Footer() {
const { data: config } = useGetStartupConfig();

View file

@ -9,7 +9,7 @@ import { Trash2 } from 'lucide-react';
import FileUpload from './FileUpload';
import getIcon from '~/utils/getIcon';
import getDefaultConversation from '~/utils/getDefaultConversation';
import { useDeletePresetMutation, useCreatePresetMutation } from '@librechat/data-provider';
import { useDeletePresetMutation, useCreatePresetMutation } from 'librechat-data-provider';
import {
Button,
DropdownMenu,

View file

@ -14,7 +14,7 @@ import { Settings, AgentSettings } from '../../Endpoints/Plugins/';
import { cn } from '~/utils/';
import store from '~/store';
import { useAuthContext } from '~/hooks/AuthContext';
import { useAvailablePluginsQuery } from '@librechat/data-provider';
import { useAvailablePluginsQuery } from 'librechat-data-provider';
function PluginsOptions() {
const { data: allPlugins } = useAvailablePluginsQuery();

View file

@ -1,6 +1,6 @@
import { useEffect } from 'react';
import { useRecoilValue, useResetRecoilState, useSetRecoilState } from 'recoil';
import { SSE, createPayload } from '@librechat/data-provider';
import { SSE, createPayload } from 'librechat-data-provider';
import store from '~/store';
import { useAuthContext } from '~/hooks/AuthContext';

View file

@ -10,7 +10,7 @@ import HoverButtons from './HoverButtons';
import SiblingSwitch from './SiblingSwitch';
import getIcon from '~/utils/getIcon';
import { useMessageHandler } from '~/utils/handleSubmit';
import { useGetConversationByIdQuery } from '@librechat/data-provider';
import { useGetConversationByIdQuery } from 'librechat-data-provider';
import { cn } from '~/utils/';
import store from '~/store';
import getError from '~/utils/getError';

View file

@ -1,7 +1,7 @@
import { useState, useEffect, useCallback } from 'react';
import { Dialog, DialogTemplate } from '../ui/';
import { ClearChatsButton } from './SettingsTabs/';
import { useClearConversationsMutation } from '@librechat/data-provider';
import { useClearConversationsMutation } from 'librechat-data-provider';
import store from '~/store';
import { useRecoilValue } from 'recoil';
import { localize } from '~/localization/Translation';

View file

@ -2,7 +2,7 @@ import { NewChat, NavLinks } from './';
import { Panel, Spinner } from '~/components';
import { Conversations, Pages } from '../Conversations';
import { useCallback, useEffect, useRef, useState } from 'react';
import { useGetConversationsQuery, useSearchQuery } from '@librechat/data-provider';
import { useGetConversationsQuery, useSearchQuery } from 'librechat-data-provider';
import { useRecoilValue, useSetRecoilState } from 'recoil';
import { useAuthContext, useDebounce } from '~/hooks';
import { localize } from '~/localization/Translation';

View file

@ -2,7 +2,7 @@ import * as Tabs from '@radix-ui/react-tabs';
import { CheckIcon } from 'lucide-react';
import { ThemeContext } from '~/hooks/ThemeContext';
import React, { useState, useContext, useEffect, useCallback } from 'react';
import { useClearConversationsMutation } from '@librechat/data-provider';
import { useClearConversationsMutation } from 'librechat-data-provider';
import { useRecoilValue } from 'recoil';
import store from '~/store';
import { localize } from '~/localization/Translation';

View file

@ -1,4 +1,4 @@
import { TPlugin, TPluginAuthConfig } from '@librechat/data-provider';
import { TPlugin, TPluginAuthConfig } from 'librechat-data-provider';
import { Save } from 'lucide-react';
import { useForm } from 'react-hook-form';
import { TPluginAction } from './PluginStoreDialog';

View file

@ -8,7 +8,7 @@ import {
useAvailablePluginsQuery,
useUpdateUserPluginsMutation,
TPlugin,
} from '@librechat/data-provider';
} from 'librechat-data-provider';
import { useAuthContext } from '~/hooks/AuthContext';
type TPluginStoreDialogProps = {

View file

@ -1,4 +1,4 @@
import { TPlugin } from '@librechat/data-provider';
import { TPlugin } from 'librechat-data-provider';
import { XCircle, DownloadCloud } from 'lucide-react';
type TPluginStoreItemProps = {

View file

@ -1,9 +1,9 @@
import { render } from 'layout-test-utils';
import PluginStoreDialog from '../PluginStoreDialog';
import userEvent from '@testing-library/user-event';
import * as mockDataProvider from '@librechat/data-provider';
import * as mockDataProvider from 'librechat-data-provider';
jest.mock('@librechat/data-provider');
jest.mock('librechat-data-provider');
class ResizeObserver {
observe() {

View file

@ -6,7 +6,7 @@ import LightningIcon from '../svg/LightningIcon';
import CautionIcon from '../svg/CautionIcon';
import store from '~/store';
import { localize } from '~/localization/Translation';
import { useGetStartupConfig } from '@librechat/data-provider';
import { useGetStartupConfig } from 'librechat-data-provider';
export default function Landing() {
const { data: config } = useGetStartupConfig();