Skip to content

Commit

Permalink
chore(deps): upgrade withtyped and cloud packages (logto-io#5408)
Browse files Browse the repository at this point in the history
* fix(deps): upgrade withtyped packages

* chore: fix types

* chore(deps): upgrade logto cloud package

* refactor(cli): fix types

---------

Co-authored-by: Gao Sun <[email protected]>
  • Loading branch information
renovate[bot] and gao-sun authored Mar 6, 2024
1 parent 23e7564 commit e1def81
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 48 deletions.
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"devDependencies": {
"@silverhand/eslint-config": "5.0.0",
"@silverhand/ts-config": "5.0.0",
"@withtyped/server": "^0.12.9",
"@withtyped/server": "^0.13.3",
"@types/inquirer": "^9.0.0",
"@types/jest": "^29.4.0",
"@types/node": "^20.9.5",
Expand Down
11 changes: 7 additions & 4 deletions packages/cli/src/connector/factories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ import { loadConnector } from './loader.js';
import type { ConnectorFactory, ConnectorPackage } from './types.js';
import { parseMetadata, validateConnectorModule } from './utils.js';

// eslint-disable-next-line @silverhand/fp/no-let, @typescript-eslint/no-explicit-any
let cachedConnectorFactories: Array<ConnectorFactory<Router<any, BaseRoutes, string>>> | undefined;
// eslint-disable-next-line @silverhand/fp/no-let
let cachedConnectorFactories: // eslint-disable-next-line @typescript-eslint/no-explicit-any
Array<ConnectorFactory<Router<any, any, BaseRoutes, string>>> | undefined;

export const loadConnectorFactories = async (
connectorPackages: ConnectorPackage[],
Expand Down Expand Up @@ -49,8 +50,10 @@ export const loadConnectorFactories = async (

// eslint-disable-next-line @silverhand/fp/no-mutation
cachedConnectorFactories = connectorFactories.filter(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(connectorFactory): connectorFactory is ConnectorFactory<Router<any, BaseRoutes, string>> =>
(
connectorFactory
// eslint-disable-next-line @typescript-eslint/no-explicit-any
): connectorFactory is ConnectorFactory<Router<any, any, BaseRoutes, string>> =>
connectorFactory !== undefined
);

Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/connector/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type { BaseRoutes, Router } from '@withtyped/server';
*/
export type ConnectorFactory<
// eslint-disable-next-line @typescript-eslint/no-explicit-any
T extends Router<any, BaseRoutes, string>,
T extends Router<any, any, BaseRoutes, string>,
U extends AllConnector = AllConnector,
> = Pick<U, 'type' | 'metadata' | 'configGuard'> & {
createConnector: CreateConnector<U, T>;
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/connector/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export const parseMetadata = async (

export const buildRawConnector = async <
// eslint-disable-next-line @typescript-eslint/no-explicit-any
T extends Router<any, BaseRoutes, string>,
T extends Router<any, any, BaseRoutes, string>,
U extends AllConnector = AllConnector,
>(
connectorFactory: ConnectorFactory<T, U>,
Expand Down
2 changes: 1 addition & 1 deletion packages/connectors/connector-logto-email/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@
"access": "public"
},
"devDependencies": {
"@logto/cloud": "0.2.5-faca9a9"
"@logto/cloud": "0.2.5-4ef0b45"
}
}
4 changes: 2 additions & 2 deletions packages/console/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"@fontsource/roboto-mono": "^5.0.0",
"@jest/types": "^29.5.0",
"@logto/app-insights": "workspace:^1.4.0",
"@logto/cloud": "0.2.5-faca9a9",
"@logto/cloud": "0.2.5-4ef0b45",
"@logto/connector-kit": "workspace:^2.1.0",
"@logto/core-kit": "workspace:^2.3.0",
"@logto/language-kit": "workspace:^1.1.0",
Expand Down Expand Up @@ -60,7 +60,7 @@
"@types/react-helmet": "^6.1.6",
"@types/react-modal": "^3.13.1",
"@types/react-syntax-highlighter": "^15.5.1",
"@withtyped/client": "^0.7.22",
"@withtyped/client": "^0.8.4",
"buffer": "^5.7.1",
"classnames": "^2.3.1",
"clean-deep": "^3.4.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"@logto/shared": "workspace:^3.1.0",
"@silverhand/essentials": "^2.9.0",
"@simplewebauthn/server": "^9.0.0",
"@withtyped/client": "^0.7.22",
"@withtyped/client": "^0.8.4",
"camelcase": "^8.0.0",
"camelcase-keys": "^9.0.0",
"chalk": "^5.0.0",
Expand Down Expand Up @@ -93,7 +93,7 @@
"zod": "^3.22.4"
},
"devDependencies": {
"@logto/cloud": "0.2.5-faca9a9",
"@logto/cloud": "0.2.5-4ef0b45",
"@silverhand/eslint-config": "5.0.0",
"@silverhand/ts-config": "5.0.0",
"@types/debug": "^4.1.7",
Expand Down
4 changes: 2 additions & 2 deletions packages/toolkit/connector-kit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
"dependencies": {
"@logto/language-kit": "workspace:^1.1.0",
"@silverhand/essentials": "^2.9.0",
"@withtyped/client": "^0.7.22",
"@withtyped/server": "^0.12.9"
"@withtyped/client": "^0.8.4",
"@withtyped/server": "^0.13.3"
},
"optionalDependencies": {
"zod": "^3.22.4"
Expand Down
4 changes: 2 additions & 2 deletions packages/toolkit/connector-kit/src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ export * from './social.js';
export type GetConnectorConfig = (id: string) => Promise<unknown>;

// eslint-disable-next-line @typescript-eslint/no-explicit-any
export type GetCloudServiceClient<T extends Router<any, BaseRoutes, string>> = () => Promise<
export type GetCloudServiceClient<T extends Router<any, any, BaseRoutes, string>> = () => Promise<
Client<T>
>;

export type CreateConnector<
T extends AllConnector,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
U extends Router<any, BaseRoutes, string> = Router<any, BaseRoutes, string>,
U extends Router<any, any, BaseRoutes, string> = Router<any, any, BaseRoutes, string>,
> = (options: {
getConfig: GetConnectorConfig;
getCloudServiceClient?: GetCloudServiceClient<U>;
Expand Down
54 changes: 22 additions & 32 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e1def81

Please sign in to comment.