mirror of
https://github.com/logto-io/logto.git
synced 2024-12-30 20:33:54 -05:00
feat(cli): export add connectors utils (#3926)
export add connectors utils
This commit is contained in:
parent
11cb34f7ae
commit
93e995aa83
1 changed files with 8 additions and 4 deletions
|
@ -132,9 +132,7 @@ export const getLocalConnectorPackages = async (instancePath: string) => {
|
|||
return packages.map(({ name }) => [name, path.join(directory, name)] as const);
|
||||
};
|
||||
|
||||
export const addConnectors = async (instancePath: string, packageNames: string[]) => {
|
||||
const cwd = getConnectorDirectory(instancePath);
|
||||
|
||||
export const addConnectorsToPath = async (cwd: string, packageNames: string[]) => {
|
||||
if (!existsSync(cwd)) {
|
||||
await fs.mkdir(cwd, { recursive: true });
|
||||
}
|
||||
|
@ -195,11 +193,17 @@ export const addConnectors = async (instancePath: string, packageNames: string[]
|
|||
}
|
||||
};
|
||||
|
||||
export const addConnectors = async (instancePath: string, packageNames: string[]) => {
|
||||
const cwd = getConnectorDirectory(instancePath);
|
||||
|
||||
await addConnectorsToPath(cwd, packageNames);
|
||||
};
|
||||
|
||||
const officialConnectorPrefix = '@logto/connector-';
|
||||
|
||||
type PackageMeta = { name: string; scope: string; version: string };
|
||||
|
||||
const fetchOfficialConnectorList = async (includingCloudConnectors = false) => {
|
||||
export const fetchOfficialConnectorList = async (includingCloudConnectors = false) => {
|
||||
// See https://github.com/npm/registry/blob/master/docs/REGISTRY-API.md#get-v1search
|
||||
type FetchResult = {
|
||||
objects: Array<{
|
||||
|
|
Loading…
Reference in a new issue