mirror of
https://github.com/logto-io/logto.git
synced 2024-12-16 20:26:19 -05:00
refactor: add official connectors in dist (#2768)
This commit is contained in:
parent
43de6258d1
commit
77bad4b1e7
3 changed files with 12 additions and 3 deletions
3
.github/workflows/integration-test.yml
vendored
3
.github/workflows/integration-test.yml
vendored
|
@ -81,9 +81,10 @@ jobs:
|
|||
run: |
|
||||
npm run cli init -- -p ../logto --db postgres://postgres:postgres@localhost:5432/postgres --no-oc --du ../logto.tar.gz
|
||||
|
||||
- name: Add mock connectors
|
||||
- name: Check and add mock connectors
|
||||
working-directory: tests
|
||||
run: |
|
||||
npm run cli connector list -- -p ../logto | grep OFFICIAL
|
||||
npm run cli connector add @logto/connector-mock-sms @logto/connector-mock-email @logto/connector-mock-standard-email @logto/connector-mock-social -- -p ../logto
|
||||
|
||||
- name: Run Logto
|
||||
|
|
|
@ -18,6 +18,9 @@ packages/**/*.config.js packages/**/*.config.ts packages/**/tsconfig*.json \
|
|||
! -path '**/node_modules/**' \
|
||||
-prune -exec rm -rf {} +
|
||||
|
||||
# Add official connectors
|
||||
pnpm cli connector add --official -p .
|
||||
|
||||
echo Tar
|
||||
cd ..
|
||||
tar -czf /tmp/logto.tar.gz logto
|
||||
|
|
|
@ -4,7 +4,7 @@ import fs from 'fs/promises';
|
|||
import path from 'path';
|
||||
import { promisify } from 'util';
|
||||
|
||||
import { assert, conditionalString } from '@silverhand/essentials';
|
||||
import { assert, conditionalString, trySafe } from '@silverhand/essentials';
|
||||
import chalk from 'chalk';
|
||||
import { got } from 'got';
|
||||
import inquirer from 'inquirer';
|
||||
|
@ -105,8 +105,13 @@ export const isOfficialConnector = (packageName: string) =>
|
|||
|
||||
export const getConnectorPackagesFrom = async (instancePath?: string) => {
|
||||
const directory = getConnectorDirectory(await inquireInstancePath(instancePath));
|
||||
const packages = await trySafe(getConnectorPackagesFromDirectory(directory));
|
||||
|
||||
return getConnectorPackagesFromDirectory(directory);
|
||||
if (!packages || packages.length === 0) {
|
||||
throw new Error('No connector found');
|
||||
}
|
||||
|
||||
return packages;
|
||||
};
|
||||
|
||||
export const addConnectors = async (instancePath: string, packageNames: string[]) => {
|
||||
|
|
Loading…
Reference in a new issue