mirror of
https://github.com/logto-io/logto.git
synced 2024-12-16 20:26:19 -05:00
fix(core): filter out connector-kit (#1987)
This commit is contained in:
parent
214ae7e41c
commit
f4cf89fb8d
1 changed files with 7 additions and 1 deletions
|
@ -13,12 +13,18 @@ import { npmPackResultGuard } from './types';
|
||||||
|
|
||||||
const execPromise = promisify(exec);
|
const execPromise = promisify(exec);
|
||||||
const npmConnectorFilter = '@logto/connector-';
|
const npmConnectorFilter = '@logto/connector-';
|
||||||
|
const excludedPackages = new Set([
|
||||||
|
'@logto/connector-kit',
|
||||||
|
'@logto/connector-mock-sms',
|
||||||
|
'@logto/connector-mock-social',
|
||||||
|
'@logto/connector-mock-email',
|
||||||
|
]);
|
||||||
|
|
||||||
const fetchOfficialConnectorList = async () => {
|
const fetchOfficialConnectorList = async () => {
|
||||||
const { stdout } = await execPromise(`npm search ${npmConnectorFilter} --json`);
|
const { stdout } = await execPromise(`npm search ${npmConnectorFilter} --json`);
|
||||||
const packages = z.object({ name: z.string() }).array().parse(JSON.parse(stdout));
|
const packages = z.object({ name: z.string() }).array().parse(JSON.parse(stdout));
|
||||||
|
|
||||||
return packages.filter(({ name }) => !name.includes('mock') && !name.includes('core'));
|
return packages.filter(({ name }) => !excludedPackages.has(name));
|
||||||
};
|
};
|
||||||
|
|
||||||
export const addConnector = async (packageName: string, cwd: string) => {
|
export const addConnector = async (packageName: string, cwd: string) => {
|
||||||
|
|
Loading…
Reference in a new issue