diff --git a/libs/remix-api/src/index.ts b/libs/remix-api/src/index.ts index e69de29bb2..71e343fc8a 100644 --- a/libs/remix-api/src/index.ts +++ b/libs/remix-api/src/index.ts @@ -0,0 +1 @@ +export * from './lib/remix-api' \ No newline at end of file diff --git a/libs/remix-api/src/lib/remix-api.ts b/libs/remix-api/src/lib/remix-api.ts new file mode 100644 index 0000000000..2a251bcc70 --- /dev/null +++ b/libs/remix-api/src/lib/remix-api.ts @@ -0,0 +1,9 @@ +import { customDGitSystem } from "@remix-ui/git" +import { IRemixApi } from "@remixproject/plugin-api" +import { StatusEvents } from "@remixproject/plugin-utils" + +export interface ICustomRemixApi extends IRemixApi { + dgitApi: customDGitSystem +} + +export declare type CustomRemixApi = Readonly \ No newline at end of file diff --git a/libs/remix-ui/git/src/lib/gitactions.ts b/libs/remix-ui/git/src/lib/gitactions.ts index 57959790fa..aab09062e0 100644 --- a/libs/remix-ui/git/src/lib/gitactions.ts +++ b/libs/remix-ui/git/src/lib/gitactions.ts @@ -2,7 +2,7 @@ import { ViewPlugin } from "@remixproject/engine-web"; import { ReadBlobResult, ReadCommitResult } from "isomorphic-git"; import React from "react"; import { fileStatus, fileStatusMerge, setRemoteBranchCommits, resetRemoteBranchCommits, setBranches, setCanCommit, setCommitChanges, setCommits, setCurrentBranch, setGitHubUser, setLoading, setRateLimit, setRemoteBranches, setRemotes, setRepos, setUpstream, setLocalBranchCommits, setBranchDifferences, setRemoteAsDefault, setScopes, setLog, clearLog } from "../state/gitpayload"; -import { GitHubUser, RateLimit, branch, commitChange, gitActionDispatch, statusMatrixType, gitState, branchDifference, remote, gitLog, fileStatusResult, customGitApi, customDGitSystem, cloneInputType, fetchInputType, pullInputType, pushInputType, CustomRemixApi, checkoutInput, rmInput, addInput, repository } from '../types'; +import { GitHubUser, RateLimit, branch, commitChange, gitActionDispatch, statusMatrixType, gitState, branchDifference, remote, gitLog, fileStatusResult, customGitApi, customDGitSystem, cloneInputType, fetchInputType, pullInputType, pushInputType, checkoutInput, rmInput, addInput, repository } from '../types'; import { removeSlash } from "../utils"; import { disableCallBacks, enableCallBacks } from "./listeners"; import { AlertModal, ModalTypes } from "@remix-ui/app"; @@ -13,6 +13,7 @@ import { IDgitSystem, IRemixApi, RemixApi } from "@remixproject/plugin-api"; import { Plugin } from "@remixproject/engine"; import { AnyMxRecord } from "dns"; import { StatusEvents } from "@remixproject/plugin-utils"; +import { CustomRemixApi } from "@remix-api"; export const fileStatuses = [ ["new,untracked", 0, 2, 0], // new, untracked diff --git a/libs/remix-ui/git/src/lib/listeners.ts b/libs/remix-ui/git/src/lib/listeners.ts index b6839be9a8..452ead1fee 100644 --- a/libs/remix-ui/git/src/lib/listeners.ts +++ b/libs/remix-ui/git/src/lib/listeners.ts @@ -2,10 +2,11 @@ import { ViewPlugin } from "@remixproject/engine-web"; import React from "react"; import { setCanUseApp, setLoading, setRepoName, setGItHubToken, setLog } from "../state/gitpayload"; -import { CustomRemixApi, customDGitSystem, gitActionDispatch } from "../types"; +import { customDGitSystem, gitActionDispatch } from "../types"; import { Plugin } from "@remixproject/engine"; import { diffFiles, getBranches, getFileStatusMatrix, getGitHubUser, getRemotes, gitlog, setPlugin } from "./gitactions"; import { Profile } from "@remixproject/plugin-utils"; +import { CustomRemixApi } from "@remix-api"; let plugin: Plugin, gitDispatch: React.Dispatch, loaderDispatch: React.Dispatch, loadFileQueue: AsyncDebouncedQueue let callBackEnabled: boolean = false diff --git a/libs/remix-ui/git/src/types/index.ts b/libs/remix-ui/git/src/types/index.ts index a5bc951e48..905c113e27 100644 --- a/libs/remix-ui/git/src/types/index.ts +++ b/libs/remix-ui/git/src/types/index.ts @@ -5,8 +5,6 @@ import { CommitObject, ReadBlobResult, ReadCommitResult, StatusRow } from "isomo export type GitHubUser = Endpoints["GET /user"]["response"]['data'] export type RateLimit = Endpoints["GET /rate_limit"]["response"]["data"] - - export interface customDGitSystem { events: { "checkout": () => void @@ -45,12 +43,6 @@ export interface customDGitSystem { } } -export interface ICustomRemixApi extends IRemixApi { - dgitApi: customDGitSystem -} - -export declare type CustomRemixApi = Readonly; - export type initInput = { defaultBranch: string } diff --git a/libs/remix-ui/workspace/src/lib/actions/workspace.ts b/libs/remix-ui/workspace/src/lib/actions/workspace.ts index fda521553b..f445788000 100644 --- a/libs/remix-ui/workspace/src/lib/actions/workspace.ts +++ b/libs/remix-ui/workspace/src/lib/actions/workspace.ts @@ -42,9 +42,10 @@ import { ROOT_PATH, slitherYml, solTestYml, tsSolTestYml } from '../utils/consta import { IndexedDBStorage } from '../../../../../../apps/remix-ide/src/app/files/filesystems/indexedDB' import { getUncommittedFiles } from '../utils/gitStatusFilter' import { AppModal, ModalTypes } from '@remix-ui/app' -import { CustomRemixApi, branch, cloneInputType, customDGitSystem } from '@remix-ui/git' +import { branch, cloneInputType, customDGitSystem } from '@remix-ui/git' import * as templates from '@remix-project/remix-ws-templates' import { Plugin } from "@remixproject/engine"; +import { CustomRemixApi } from '@remix-api' declare global { interface Window { diff --git a/tsconfig.paths.json b/tsconfig.paths.json index d173c96b59..27b4cf0fbf 100644 --- a/tsconfig.paths.json +++ b/tsconfig.paths.json @@ -174,6 +174,9 @@ ], "@remix-ui/git": [ "libs/remix-ui/git/src/index.ts" + ], + "@remix-api": [ + "libs/remix-api/src/index.ts" ] } }