From 32fa807d16f5df3e757cb93fb76714c29a705d8b Mon Sep 17 00:00:00 2001 From: Gao Sun Date: Wed, 14 Dec 2022 13:23:59 +0800 Subject: [PATCH] refactor: bring back toolkit packages --- .dockerignore | 10 +- .gitignore | 10 +- .scripts/package.sh | 6 +- .vscode/settings.json | 5 +- Dockerfile | 2 +- package.json | 8 - packages/cli/package.json | 2 +- packages/console/package.json | 6 +- packages/core/package.json | 8 +- packages/core/src/env-set/index.ts | 2 +- .../__mocks__/logto-config.ts | 0 .../src/{lib => libraries}/connector.test.ts | 0 .../core/src/{lib => libraries}/connector.ts | 0 .../src/{lib => libraries}/logto-config.ts | 0 .../src/{lib => libraries}/passcode.test.ts | 0 .../core/src/{lib => libraries}/passcode.ts | 0 .../src/{lib => libraries}/phrase.test.ts | 2 +- .../core/src/{lib => libraries}/phrase.ts | 0 .../core/src/{lib => libraries}/session.ts | 0 .../sign-in-experience/index.test.ts | 0 .../sign-in-experience/index.ts | 0 .../sign-in-experience/sign-in.test.ts | 0 .../sign-in-experience/sign-in.ts | 0 .../sign-in-experience/sign-up.test.ts | 0 .../sign-in-experience/sign-up.ts | 0 .../core/src/{lib => libraries}/social.ts | 2 + .../core/src/{lib => libraries}/user.test.ts | 0 packages/core/src/{lib => libraries}/user.ts | 0 packages/core/src/routes/admin-user.ts | 2 +- packages/core/src/routes/connector.ts | 4 +- .../interaction/actions/submit-interaction.ts | 4 +- packages/core/src/routes/interaction/index.ts | 2 +- .../koa-session-sign-in-experience-guard.ts | 2 +- .../interaction/utils/passcode-validation.ts | 2 +- .../interaction/utils/social-verification.ts | 4 +- .../identifier-payload-verification.ts | 2 +- .../user-identity-verification.ts | 2 +- packages/core/src/routes/phrase.ts | 2 +- packages/core/src/routes/profile.ts | 6 +- packages/core/src/routes/session/continue.ts | 9 +- .../src/routes/session/forgot-password.ts | 2 +- packages/core/src/routes/session/index.ts | 2 +- .../middleware/koa-guard-session-action.ts | 4 +- .../session/middleware/passwordless-action.ts | 9 +- packages/core/src/routes/session/password.ts | 9 +- .../core/src/routes/session/passwordless.ts | 2 +- packages/core/src/routes/session/social.ts | 13 +- packages/core/src/routes/session/utils.ts | 9 +- .../core/src/routes/sign-in-experience.ts | 2 +- packages/core/src/routes/well-known.ts | 4 +- packages/demo-app/package.json | 6 +- packages/phrases-ui/package.json | 6 +- packages/phrases/package.json | 6 +- packages/schemas/package.json | 8 +- packages/toolkit/README.md | 3 + packages/toolkit/connector-kit/CHANGELOG.md | 191 +++++++ packages/toolkit/connector-kit/package.json | 61 +++ .../toolkit/connector-kit/rollup.config.js | 21 + packages/toolkit/connector-kit/src/index.ts | 26 + packages/toolkit/connector-kit/src/types.ts | 149 +++++ packages/toolkit/connector-kit/tsconfig.json | 12 + packages/toolkit/core-kit/CHANGELOG.md | 265 +++++++++ .../toolkit/core-kit/declaration/dom.d.ts | 77 +++ .../toolkit/core-kit/declaration/index.ts | 4 + .../core-kit/declaration/react-app.d.ts | 65 +++ packages/toolkit/core-kit/jest.config.ts | 13 + packages/toolkit/core-kit/package.json | 80 +++ packages/toolkit/core-kit/rollup.config.js | 21 + .../core-kit/scss/_console-themes.scss | 339 ++++++++++++ packages/toolkit/core-kit/scss/_fonts.scss | 32 ++ packages/toolkit/core-kit/src/index.ts | 3 + packages/toolkit/core-kit/src/regex.ts | 8 + packages/toolkit/core-kit/src/scope.ts | 85 +++ .../toolkit/core-kit/src/utilities/color.ts | 17 + .../toolkit/core-kit/src/utilities/index.ts | 4 + .../core-kit/src/utilities/string.test.ts | 15 + .../toolkit/core-kit/src/utilities/string.ts | 6 + .../core-kit/src/utilities/url.test.ts | 23 + .../toolkit/core-kit/src/utilities/url.ts | 21 + .../core-kit/src/utilities/zod.test.ts | 13 + .../toolkit/core-kit/src/utilities/zod.ts | 15 + packages/toolkit/core-kit/tsconfig.build.json | 5 + packages/toolkit/core-kit/tsconfig.json | 10 + packages/toolkit/language-kit/CHANGELOG.md | 78 +++ packages/toolkit/language-kit/jest.config.ts | 12 + packages/toolkit/language-kit/package.json | 61 +++ .../toolkit/language-kit/rollup.config.js | 21 + packages/toolkit/language-kit/src/const.ts | 125 +++++ packages/toolkit/language-kit/src/index.ts | 3 + packages/toolkit/language-kit/src/type.ts | 3 + .../toolkit/language-kit/src/utility.test.ts | 27 + packages/toolkit/language-kit/src/utility.ts | 11 + .../toolkit/language-kit/tsconfig.build.json | 5 + packages/toolkit/language-kit/tsconfig.json | 10 + packages/ui/package.json | 6 +- pnpm-lock.yaml | 517 +++++++++++++----- pnpm-workspace.yaml | 3 +- 97 files changed, 2411 insertions(+), 241 deletions(-) rename packages/core/src/{lib => libraries}/__mocks__/logto-config.ts (100%) rename packages/core/src/{lib => libraries}/connector.test.ts (100%) rename packages/core/src/{lib => libraries}/connector.ts (100%) rename packages/core/src/{lib => libraries}/logto-config.ts (100%) rename packages/core/src/{lib => libraries}/passcode.test.ts (100%) rename packages/core/src/{lib => libraries}/passcode.ts (100%) rename packages/core/src/{lib => libraries}/phrase.test.ts (98%) rename packages/core/src/{lib => libraries}/phrase.ts (100%) rename packages/core/src/{lib => libraries}/session.ts (100%) rename packages/core/src/{lib => libraries}/sign-in-experience/index.test.ts (100%) rename packages/core/src/{lib => libraries}/sign-in-experience/index.ts (100%) rename packages/core/src/{lib => libraries}/sign-in-experience/sign-in.test.ts (100%) rename packages/core/src/{lib => libraries}/sign-in-experience/sign-in.ts (100%) rename packages/core/src/{lib => libraries}/sign-in-experience/sign-up.test.ts (100%) rename packages/core/src/{lib => libraries}/sign-in-experience/sign-up.ts (100%) rename packages/core/src/{lib => libraries}/social.ts (98%) rename packages/core/src/{lib => libraries}/user.test.ts (100%) rename packages/core/src/{lib => libraries}/user.ts (100%) create mode 100644 packages/toolkit/README.md create mode 100644 packages/toolkit/connector-kit/CHANGELOG.md create mode 100644 packages/toolkit/connector-kit/package.json create mode 100644 packages/toolkit/connector-kit/rollup.config.js create mode 100644 packages/toolkit/connector-kit/src/index.ts create mode 100644 packages/toolkit/connector-kit/src/types.ts create mode 100644 packages/toolkit/connector-kit/tsconfig.json create mode 100644 packages/toolkit/core-kit/CHANGELOG.md create mode 100644 packages/toolkit/core-kit/declaration/dom.d.ts create mode 100644 packages/toolkit/core-kit/declaration/index.ts create mode 100644 packages/toolkit/core-kit/declaration/react-app.d.ts create mode 100644 packages/toolkit/core-kit/jest.config.ts create mode 100644 packages/toolkit/core-kit/package.json create mode 100644 packages/toolkit/core-kit/rollup.config.js create mode 100644 packages/toolkit/core-kit/scss/_console-themes.scss create mode 100644 packages/toolkit/core-kit/scss/_fonts.scss create mode 100644 packages/toolkit/core-kit/src/index.ts create mode 100644 packages/toolkit/core-kit/src/regex.ts create mode 100644 packages/toolkit/core-kit/src/scope.ts create mode 100644 packages/toolkit/core-kit/src/utilities/color.ts create mode 100644 packages/toolkit/core-kit/src/utilities/index.ts create mode 100644 packages/toolkit/core-kit/src/utilities/string.test.ts create mode 100644 packages/toolkit/core-kit/src/utilities/string.ts create mode 100644 packages/toolkit/core-kit/src/utilities/url.test.ts create mode 100644 packages/toolkit/core-kit/src/utilities/url.ts create mode 100644 packages/toolkit/core-kit/src/utilities/zod.test.ts create mode 100644 packages/toolkit/core-kit/src/utilities/zod.ts create mode 100644 packages/toolkit/core-kit/tsconfig.build.json create mode 100644 packages/toolkit/core-kit/tsconfig.json create mode 100644 packages/toolkit/language-kit/CHANGELOG.md create mode 100644 packages/toolkit/language-kit/jest.config.ts create mode 100644 packages/toolkit/language-kit/package.json create mode 100644 packages/toolkit/language-kit/rollup.config.js create mode 100644 packages/toolkit/language-kit/src/const.ts create mode 100644 packages/toolkit/language-kit/src/index.ts create mode 100644 packages/toolkit/language-kit/src/type.ts create mode 100644 packages/toolkit/language-kit/src/utility.test.ts create mode 100644 packages/toolkit/language-kit/src/utility.ts create mode 100644 packages/toolkit/language-kit/tsconfig.build.json create mode 100644 packages/toolkit/language-kit/tsconfig.json diff --git a/.dockerignore b/.dockerignore index 62e2ada24..c73df52ba 100644 --- a/.dockerignore +++ b/.dockerignore @@ -2,16 +2,16 @@ node_modules # testing -/packages/*/coverage +/packages/**/coverage # report /report.json -/packages/*/report.json +/packages/**/report.json # production -/packages/*/build -/packages/*/lib -/packages/*/dist +/packages/**/build +/packages/**/lib +/packages/**/dist # logs logs diff --git a/.gitignore b/.gitignore index 4ebbdef2d..edc458f41 100644 --- a/.gitignore +++ b/.gitignore @@ -6,16 +6,16 @@ node_modules .pnp.js # testing -/packages/*/coverage +/packages/**/coverage # report /report.json -/packages/*/report.json +/packages/**/report.json # production -/packages/*/build -/packages/*/lib -/packages/*/dist +/packages/**/build +/packages/**/lib +/packages/**/dist # logs logs diff --git a/.scripts/package.sh b/.scripts/package.sh index 940e2a6bd..34e434846 100755 --- a/.scripts/package.sh +++ b/.scripts/package.sh @@ -1,7 +1,7 @@ set -eo pipefail echo Prune dependencies -rm -rf node_modules packages/*/node_modules +rm -rf node_modules packages/**/node_modules echo Install production dependencies NODE_ENV=production pnpm i @@ -9,8 +9,8 @@ NODE_ENV=production pnpm i echo Prune files rm -rf \ .git .github .husky .vscode .parcel-cache pnpm-*.yaml *.js \ -packages/*/src \ -packages/*/*.config.js packages/*/*.config.ts packages/*/tsconfig*.json +packages/**/src \ +packages/**/*.config.js packages/**/*.config.ts packages/**/tsconfig*.json echo Tar cd .. diff --git a/.vscode/settings.json b/.vscode/settings.json index 10453f7bc..2d324d934 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -8,7 +8,10 @@ "stylelint.validate": ["css", "scss"], "eslint.workingDirectories": [ { - "pattern": "./packages/*" + "pattern": "./packages/*", + }, + { + "pattern": "./packages/toolkit/*", } ], "eslint.validate": [ diff --git a/Dockerfile b/Dockerfile index 5301427af..b89cfffb1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,7 +18,7 @@ RUN pnpm -r build RUN pnpm cli connector add --official -p . # Prune dependencies for production -RUN rm -rf node_modules packages/*/node_modules +RUN rm -rf node_modules packages/**/node_modules RUN NODE_ENV=production pnpm i # Clean up diff --git a/package.json b/package.json index c1f418579..73774909e 100644 --- a/package.json +++ b/package.json @@ -26,14 +26,6 @@ "husky": "^8.0.0", "typescript": "^4.9.4" }, - "workspaces": { - "packages": [ - "packages/*" - ], - "nohoist": [ - "**/module-alias" - ] - }, "engines": { "node": "^16.13.0 || ^18.12.0", "pnpm": "^7.14.0" diff --git a/packages/cli/package.json b/packages/cli/package.json index 110504060..6bb988750 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -63,7 +63,7 @@ "slonik-sql-tag-raw": "^1.1.4", "tar": "^6.1.11", "yargs": "^17.6.0", - "zod": "^3.19.1" + "zod": "^3.20.2" }, "devDependencies": { "@silverhand/eslint-config": "1.3.0", diff --git a/packages/console/package.json b/packages/console/package.json index 9dc1f2091..72be43d5c 100644 --- a/packages/console/package.json +++ b/packages/console/package.json @@ -19,8 +19,8 @@ }, "devDependencies": { "@fontsource/roboto-mono": "^4.5.7", - "@logto/core-kit": "1.0.0-beta.28", - "@logto/language-kit": "1.0.0-beta.28", + "@logto/core-kit": "workspace:*", + "@logto/language-kit": "workspace:*", "@logto/phrases": "workspace:*", "@logto/phrases-ui": "workspace:*", "@logto/react": "1.0.0-beta.14", @@ -88,7 +88,7 @@ "stylelint": "^14.9.1", "swr": "^1.3.0", "typescript": "^4.9.4", - "zod": "^3.19.1" + "zod": "^3.20.2" }, "engines": { "node": "^16.13.0 || ^18.12.0" diff --git a/packages/core/package.json b/packages/core/package.json index 4585c4a43..610143400 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -26,9 +26,9 @@ }, "dependencies": { "@logto/cli": "workspace:*", - "@logto/connector-kit": "1.0.0-beta.28", - "@logto/core-kit": "1.0.0-beta.28", - "@logto/language-kit": "1.0.0-beta.28", + "@logto/connector-kit": "workspace:*", + "@logto/core-kit": "workspace:*", + "@logto/language-kit": "workspace:*", "@logto/phrases": "workspace:*", "@logto/phrases-ui": "workspace:*", "@logto/schemas": "workspace:*", @@ -68,7 +68,7 @@ "slonik-sql-tag-raw": "^1.1.4", "snake-case": "^3.0.4", "snakecase-keys": "^5.4.4", - "zod": "^3.19.1" + "zod": "^3.20.2" }, "devDependencies": { "@silverhand/eslint-config": "1.3.0", diff --git a/packages/core/src/env-set/index.ts b/packages/core/src/env-set/index.ts index 34dc0360d..4d668805a 100644 --- a/packages/core/src/env-set/index.ts +++ b/packages/core/src/env-set/index.ts @@ -2,7 +2,7 @@ import type { Optional } from '@silverhand/essentials'; import { getEnv, getEnvAsStringArray } from '@silverhand/essentials'; import type { DatabasePool } from 'slonik'; -import { getOidcConfigs } from '#src/lib/logto-config.js'; +import { getOidcConfigs } from '#src/libraries/logto-config.js'; import { appendPath } from '#src/utils/url.js'; import { checkAlterationState } from './check-alteration-state.js'; diff --git a/packages/core/src/lib/__mocks__/logto-config.ts b/packages/core/src/libraries/__mocks__/logto-config.ts similarity index 100% rename from packages/core/src/lib/__mocks__/logto-config.ts rename to packages/core/src/libraries/__mocks__/logto-config.ts diff --git a/packages/core/src/lib/connector.test.ts b/packages/core/src/libraries/connector.test.ts similarity index 100% rename from packages/core/src/lib/connector.test.ts rename to packages/core/src/libraries/connector.test.ts diff --git a/packages/core/src/lib/connector.ts b/packages/core/src/libraries/connector.ts similarity index 100% rename from packages/core/src/lib/connector.ts rename to packages/core/src/libraries/connector.ts diff --git a/packages/core/src/lib/logto-config.ts b/packages/core/src/libraries/logto-config.ts similarity index 100% rename from packages/core/src/lib/logto-config.ts rename to packages/core/src/libraries/logto-config.ts diff --git a/packages/core/src/lib/passcode.test.ts b/packages/core/src/libraries/passcode.test.ts similarity index 100% rename from packages/core/src/lib/passcode.test.ts rename to packages/core/src/libraries/passcode.test.ts diff --git a/packages/core/src/lib/passcode.ts b/packages/core/src/libraries/passcode.ts similarity index 100% rename from packages/core/src/lib/passcode.ts rename to packages/core/src/libraries/passcode.ts diff --git a/packages/core/src/lib/phrase.test.ts b/packages/core/src/libraries/phrase.test.ts similarity index 98% rename from packages/core/src/lib/phrase.test.ts rename to packages/core/src/libraries/phrase.test.ts index 607bb7169..7469ad131 100644 --- a/packages/core/src/lib/phrase.test.ts +++ b/packages/core/src/libraries/phrase.test.ts @@ -44,7 +44,7 @@ mockEsm('#src/queries/custom-phrase.js', () => ({ findCustomPhraseByLanguageTag, })); -const { getPhrase } = await import('#src/lib/phrase.js'); +const { getPhrase } = await import('#src/libraries/phrase.js'); afterEach(() => { jest.clearAllMocks(); diff --git a/packages/core/src/lib/phrase.ts b/packages/core/src/libraries/phrase.ts similarity index 100% rename from packages/core/src/lib/phrase.ts rename to packages/core/src/libraries/phrase.ts diff --git a/packages/core/src/lib/session.ts b/packages/core/src/libraries/session.ts similarity index 100% rename from packages/core/src/lib/session.ts rename to packages/core/src/libraries/session.ts diff --git a/packages/core/src/lib/sign-in-experience/index.test.ts b/packages/core/src/libraries/sign-in-experience/index.test.ts similarity index 100% rename from packages/core/src/lib/sign-in-experience/index.test.ts rename to packages/core/src/libraries/sign-in-experience/index.test.ts diff --git a/packages/core/src/lib/sign-in-experience/index.ts b/packages/core/src/libraries/sign-in-experience/index.ts similarity index 100% rename from packages/core/src/lib/sign-in-experience/index.ts rename to packages/core/src/libraries/sign-in-experience/index.ts diff --git a/packages/core/src/lib/sign-in-experience/sign-in.test.ts b/packages/core/src/libraries/sign-in-experience/sign-in.test.ts similarity index 100% rename from packages/core/src/lib/sign-in-experience/sign-in.test.ts rename to packages/core/src/libraries/sign-in-experience/sign-in.test.ts diff --git a/packages/core/src/lib/sign-in-experience/sign-in.ts b/packages/core/src/libraries/sign-in-experience/sign-in.ts similarity index 100% rename from packages/core/src/lib/sign-in-experience/sign-in.ts rename to packages/core/src/libraries/sign-in-experience/sign-in.ts diff --git a/packages/core/src/lib/sign-in-experience/sign-up.test.ts b/packages/core/src/libraries/sign-in-experience/sign-up.test.ts similarity index 100% rename from packages/core/src/lib/sign-in-experience/sign-up.test.ts rename to packages/core/src/libraries/sign-in-experience/sign-up.test.ts diff --git a/packages/core/src/lib/sign-in-experience/sign-up.ts b/packages/core/src/libraries/sign-in-experience/sign-up.ts similarity index 100% rename from packages/core/src/lib/sign-in-experience/sign-up.ts rename to packages/core/src/libraries/sign-in-experience/sign-up.ts diff --git a/packages/core/src/lib/social.ts b/packages/core/src/libraries/social.ts similarity index 98% rename from packages/core/src/lib/social.ts rename to packages/core/src/libraries/social.ts index 6662186af..7662f1f54 100644 --- a/packages/core/src/lib/social.ts +++ b/packages/core/src/libraries/social.ts @@ -47,6 +47,8 @@ export const getUserInfoByAuthCode = async ( }) ); + // FIXME: @Darcy + // @ts-expect-error pending fix return connector.getUserInfo(data); }; diff --git a/packages/core/src/lib/user.test.ts b/packages/core/src/libraries/user.test.ts similarity index 100% rename from packages/core/src/lib/user.test.ts rename to packages/core/src/libraries/user.test.ts diff --git a/packages/core/src/lib/user.ts b/packages/core/src/libraries/user.ts similarity index 100% rename from packages/core/src/lib/user.ts rename to packages/core/src/libraries/user.ts diff --git a/packages/core/src/routes/admin-user.ts b/packages/core/src/routes/admin-user.ts index ce35ab52f..781354062 100644 --- a/packages/core/src/routes/admin-user.ts +++ b/packages/core/src/routes/admin-user.ts @@ -12,7 +12,7 @@ import { encryptUserPassword, generateUserId, insertUser, -} from '#src/lib/user.js'; +} from '#src/libraries/user.js'; import koaGuard from '#src/middleware/koa-guard.js'; import koaPagination from '#src/middleware/koa-pagination.js'; import { revokeInstanceByUserId } from '#src/queries/oidc-model-instance.js'; diff --git a/packages/core/src/routes/connector.ts b/packages/core/src/routes/connector.ts index 6c65384c4..a7ed428ff 100644 --- a/packages/core/src/routes/connector.ts +++ b/packages/core/src/routes/connector.ts @@ -13,8 +13,8 @@ import { } from '#src/connectors/index.js'; import type { LogtoConnector } from '#src/connectors/types.js'; import RequestError from '#src/errors/RequestError/index.js'; -import { checkSocialConnectorTargetAndPlatformUniqueness } from '#src/lib/connector.js'; -import { removeUnavailableSocialConnectorTargets } from '#src/lib/sign-in-experience/index.js'; +import { checkSocialConnectorTargetAndPlatformUniqueness } from '#src/libraries/connector.js'; +import { removeUnavailableSocialConnectorTargets } from '#src/libraries/sign-in-experience/index.js'; import koaGuard from '#src/middleware/koa-guard.js'; import { findConnectorById, diff --git a/packages/core/src/routes/interaction/actions/submit-interaction.ts b/packages/core/src/routes/interaction/actions/submit-interaction.ts index 47ae8fdb6..2672e8a73 100644 --- a/packages/core/src/routes/interaction/actions/submit-interaction.ts +++ b/packages/core/src/routes/interaction/actions/submit-interaction.ts @@ -4,8 +4,8 @@ import { conditional } from '@silverhand/essentials'; import type { Provider } from 'oidc-provider'; import { getLogtoConnectorById } from '#src/connectors/index.js'; -import { assignInteractionResults } from '#src/lib/session.js'; -import { encryptUserPassword, generateUserId, insertUser } from '#src/lib/user.js'; +import { assignInteractionResults } from '#src/libraries/session.js'; +import { encryptUserPassword, generateUserId, insertUser } from '#src/libraries/user.js'; import { findUserById, updateUserById } from '#src/queries/user.js'; import type { diff --git a/packages/core/src/routes/interaction/index.ts b/packages/core/src/routes/interaction/index.ts index 4bfbd051d..5c7ef9bae 100644 --- a/packages/core/src/routes/interaction/index.ts +++ b/packages/core/src/routes/interaction/index.ts @@ -3,7 +3,7 @@ import { Event } from '@logto/schemas'; import type { Provider } from 'oidc-provider'; import RequestError from '#src/errors/RequestError/index.js'; -import { assignInteractionResults } from '#src/lib/session.js'; +import { assignInteractionResults } from '#src/libraries/session.js'; import koaGuard from '#src/middleware/koa-guard.js'; import assertThat from '#src/utils/assert-that.js'; diff --git a/packages/core/src/routes/interaction/middleware/koa-session-sign-in-experience-guard.ts b/packages/core/src/routes/interaction/middleware/koa-session-sign-in-experience-guard.ts index fbcbd604f..5d9174a23 100644 --- a/packages/core/src/routes/interaction/middleware/koa-session-sign-in-experience-guard.ts +++ b/packages/core/src/routes/interaction/middleware/koa-session-sign-in-experience-guard.ts @@ -4,7 +4,7 @@ import type { MiddlewareType } from 'koa'; import type { IRouterParamContext } from 'koa-router'; import type { Provider } from 'oidc-provider'; -import { getSignInExperienceForApplication } from '#src/lib/sign-in-experience/index.js'; +import { getSignInExperienceForApplication } from '#src/libraries/sign-in-experience/index.js'; import { signInModeValidation, diff --git a/packages/core/src/routes/interaction/utils/passcode-validation.ts b/packages/core/src/routes/interaction/utils/passcode-validation.ts index 66adc62f6..abb5c04ed 100644 --- a/packages/core/src/routes/interaction/utils/passcode-validation.ts +++ b/packages/core/src/routes/interaction/utils/passcode-validation.ts @@ -1,7 +1,7 @@ import type { Event } from '@logto/schemas'; import { PasscodeType } from '@logto/schemas'; -import { createPasscode, sendPasscode, verifyPasscode } from '#src/lib/passcode.js'; +import { createPasscode, sendPasscode, verifyPasscode } from '#src/libraries/passcode.js'; import type { LogContext } from '#src/middleware/koa-log.js'; import { getPasswordlessRelatedLogType } from '#src/routes/session/utils.js'; diff --git a/packages/core/src/routes/interaction/utils/social-verification.ts b/packages/core/src/routes/interaction/utils/social-verification.ts index 787b69c60..83968756d 100644 --- a/packages/core/src/routes/interaction/utils/social-verification.ts +++ b/packages/core/src/routes/interaction/utils/social-verification.ts @@ -3,7 +3,7 @@ import { ConnectorType } from '@logto/schemas'; import { getLogtoConnectorById } from '#src/connectors/index.js'; import type { SocialUserInfo } from '#src/connectors/types.js'; -import { getUserInfoByAuthCode } from '#src/lib/social.js'; +import { getUserInfoByAuthCode } from '#src/libraries/social.js'; import type { LogContext } from '#src/middleware/koa-log.js'; import assertThat from '#src/utils/assert-that.js'; @@ -17,6 +17,8 @@ export const createSocialAuthorizationUrl = async (payload: SocialAuthorizationU assertThat(connector.type === ConnectorType.Social, 'connector.unexpected_type'); + // FIXME: @Darcy + // @ts-expect-error pending fix return connector.getAuthorizationUri({ state, redirectUri }); }; diff --git a/packages/core/src/routes/interaction/verifications/identifier-payload-verification.ts b/packages/core/src/routes/interaction/verifications/identifier-payload-verification.ts index 325f6aec7..bbf6c7a13 100644 --- a/packages/core/src/routes/interaction/verifications/identifier-payload-verification.ts +++ b/packages/core/src/routes/interaction/verifications/identifier-payload-verification.ts @@ -2,7 +2,7 @@ import type { Event, SocialConnectorPayload, SocialIdentityPayload } from '@logt import type { Provider } from 'oidc-provider'; import RequestError from '#src/errors/RequestError/index.js'; -import { verifyUserPassword } from '#src/lib/user.js'; +import { verifyUserPassword } from '#src/libraries/user.js'; import assertThat from '#src/utils/assert-that.js'; import type { diff --git a/packages/core/src/routes/interaction/verifications/user-identity-verification.ts b/packages/core/src/routes/interaction/verifications/user-identity-verification.ts index 1c8a319b0..488512609 100644 --- a/packages/core/src/routes/interaction/verifications/user-identity-verification.ts +++ b/packages/core/src/routes/interaction/verifications/user-identity-verification.ts @@ -2,7 +2,7 @@ import { deduplicate } from '@silverhand/essentials'; import type { Provider } from 'oidc-provider'; import RequestError from '#src/errors/RequestError/index.js'; -import { findSocialRelatedUser } from '#src/lib/social.js'; +import { findSocialRelatedUser } from '#src/libraries/social.js'; import assertThat from '#src/utils/assert-that.js'; import { maskUserInfo } from '#src/utils/format.js'; diff --git a/packages/core/src/routes/phrase.ts b/packages/core/src/routes/phrase.ts index 3377360c2..e01097297 100644 --- a/packages/core/src/routes/phrase.ts +++ b/packages/core/src/routes/phrase.ts @@ -6,7 +6,7 @@ import { import type { Provider } from 'oidc-provider'; import detectLanguage from '#src/i18n/detect-language.js'; -import { getPhrase } from '#src/lib/phrase.js'; +import { getPhrase } from '#src/libraries/phrase.js'; import { findAllCustomLanguageTags } from '#src/queries/custom-phrase.js'; import { findDefaultSignInExperience } from '#src/queries/sign-in-experience.js'; diff --git a/packages/core/src/routes/profile.ts b/packages/core/src/routes/profile.ts index 991322411..39d17dfc2 100644 --- a/packages/core/src/routes/profile.ts +++ b/packages/core/src/routes/profile.ts @@ -8,9 +8,9 @@ import { object, string, unknown } from 'zod'; import { getLogtoConnectorById } from '#src/connectors/index.js'; import RequestError from '#src/errors/RequestError/index.js'; -import { checkSessionHealth } from '#src/lib/session.js'; -import { getUserInfoByAuthCode } from '#src/lib/social.js'; -import { checkIdentifierCollision, encryptUserPassword } from '#src/lib/user.js'; +import { checkSessionHealth } from '#src/libraries/session.js'; +import { getUserInfoByAuthCode } from '#src/libraries/social.js'; +import { checkIdentifierCollision, encryptUserPassword } from '#src/libraries/user.js'; import koaGuard from '#src/middleware/koa-guard.js'; import { deleteUserIdentity, findUserById, updateUserById } from '#src/queries/user.js'; import assertThat from '#src/utils/assert-that.js'; diff --git a/packages/core/src/routes/session/continue.ts b/packages/core/src/routes/session/continue.ts index 3b32e5d74..79ef06767 100644 --- a/packages/core/src/routes/session/continue.ts +++ b/packages/core/src/routes/session/continue.ts @@ -3,9 +3,12 @@ import type { Provider } from 'oidc-provider'; import { object, string } from 'zod'; import RequestError from '#src/errors/RequestError/index.js'; -import { assignInteractionResults, getApplicationIdFromInteraction } from '#src/lib/session.js'; -import { getSignInExperienceForApplication } from '#src/lib/sign-in-experience/index.js'; -import { encryptUserPassword } from '#src/lib/user.js'; +import { + assignInteractionResults, + getApplicationIdFromInteraction, +} from '#src/libraries/session.js'; +import { getSignInExperienceForApplication } from '#src/libraries/sign-in-experience/index.js'; +import { encryptUserPassword } from '#src/libraries/user.js'; import koaGuard from '#src/middleware/koa-guard.js'; import { findUserById, diff --git a/packages/core/src/routes/session/forgot-password.ts b/packages/core/src/routes/session/forgot-password.ts index 4a49a260a..e5a2acdb7 100644 --- a/packages/core/src/routes/session/forgot-password.ts +++ b/packages/core/src/routes/session/forgot-password.ts @@ -4,7 +4,7 @@ import type { Provider } from 'oidc-provider'; import { z } from 'zod'; import RequestError from '#src/errors/RequestError/index.js'; -import { encryptUserPassword } from '#src/lib/user.js'; +import { encryptUserPassword } from '#src/libraries/user.js'; import koaGuard from '#src/middleware/koa-guard.js'; import { findUserById, updateUserById } from '#src/queries/user.js'; import assertThat from '#src/utils/assert-that.js'; diff --git a/packages/core/src/routes/session/index.ts b/packages/core/src/routes/session/index.ts index 63607d43a..ef7157c37 100644 --- a/packages/core/src/routes/session/index.ts +++ b/packages/core/src/routes/session/index.ts @@ -8,7 +8,7 @@ import type { Provider } from 'oidc-provider'; import { object, string } from 'zod'; import RequestError from '#src/errors/RequestError/index.js'; -import { assignInteractionResults, saveUserFirstConsentedAppId } from '#src/lib/session.js'; +import { assignInteractionResults, saveUserFirstConsentedAppId } from '#src/libraries/session.js'; import { findUserById } from '#src/queries/user.js'; import assertThat from '#src/utils/assert-that.js'; diff --git a/packages/core/src/routes/session/middleware/koa-guard-session-action.ts b/packages/core/src/routes/session/middleware/koa-guard-session-action.ts index 4489a3f68..2dfccfc54 100644 --- a/packages/core/src/routes/session/middleware/koa-guard-session-action.ts +++ b/packages/core/src/routes/session/middleware/koa-guard-session-action.ts @@ -5,8 +5,8 @@ import type { Provider } from 'oidc-provider'; import { errors } from 'oidc-provider'; import RequestError from '#src/errors/RequestError/index.js'; -import { getApplicationIdFromInteraction } from '#src/lib/session.js'; -import { getSignInExperienceForApplication } from '#src/lib/sign-in-experience/index.js'; +import { getApplicationIdFromInteraction } from '#src/libraries/session.js'; +import { getSignInExperienceForApplication } from '#src/libraries/sign-in-experience/index.js'; import assertThat from '#src/utils/assert-that.js'; export default function koaGuardSessionAction( diff --git a/packages/core/src/routes/session/middleware/passwordless-action.ts b/packages/core/src/routes/session/middleware/passwordless-action.ts index f83863ecd..fca8bc870 100644 --- a/packages/core/src/routes/session/middleware/passwordless-action.ts +++ b/packages/core/src/routes/session/middleware/passwordless-action.ts @@ -3,9 +3,12 @@ import type { MiddlewareType } from 'koa'; import type { Provider } from 'oidc-provider'; import RequestError from '#src/errors/RequestError/index.js'; -import { assignInteractionResults, getApplicationIdFromInteraction } from '#src/lib/session.js'; -import { getSignInExperienceForApplication } from '#src/lib/sign-in-experience/index.js'; -import { generateUserId, insertUser } from '#src/lib/user.js'; +import { + assignInteractionResults, + getApplicationIdFromInteraction, +} from '#src/libraries/session.js'; +import { getSignInExperienceForApplication } from '#src/libraries/sign-in-experience/index.js'; +import { generateUserId, insertUser } from '#src/libraries/user.js'; import type { WithLogContext } from '#src/middleware/koa-log.js'; import { hasUserWithPhone, diff --git a/packages/core/src/routes/session/password.ts b/packages/core/src/routes/session/password.ts index ef43a8d30..39ea74d9c 100644 --- a/packages/core/src/routes/session/password.ts +++ b/packages/core/src/routes/session/password.ts @@ -5,9 +5,12 @@ import type { Provider } from 'oidc-provider'; import { object, string } from 'zod'; import RequestError from '#src/errors/RequestError/index.js'; -import { assignInteractionResults, getApplicationIdFromInteraction } from '#src/lib/session.js'; -import { getSignInExperienceForApplication } from '#src/lib/sign-in-experience/index.js'; -import { encryptUserPassword, generateUserId, insertUser } from '#src/lib/user.js'; +import { + assignInteractionResults, + getApplicationIdFromInteraction, +} from '#src/libraries/session.js'; +import { getSignInExperienceForApplication } from '#src/libraries/sign-in-experience/index.js'; +import { encryptUserPassword, generateUserId, insertUser } from '#src/libraries/user.js'; import koaGuard from '#src/middleware/koa-guard.js'; import { findUserByEmail, diff --git a/packages/core/src/routes/session/passwordless.ts b/packages/core/src/routes/session/passwordless.ts index 4b918c897..0adcaf26a 100644 --- a/packages/core/src/routes/session/passwordless.ts +++ b/packages/core/src/routes/session/passwordless.ts @@ -4,7 +4,7 @@ import type { Provider } from 'oidc-provider'; import { object, string } from 'zod'; import RequestError from '#src/errors/RequestError/index.js'; -import { createPasscode, sendPasscode, verifyPasscode } from '#src/lib/passcode.js'; +import { createPasscode, sendPasscode, verifyPasscode } from '#src/libraries/passcode.js'; import koaGuard from '#src/middleware/koa-guard.js'; import { findUserByEmail, findUserByPhone } from '#src/queries/user.js'; import { passcodeTypeGuard } from '#src/routes/session/types.js'; diff --git a/packages/core/src/routes/session/social.ts b/packages/core/src/routes/session/social.ts index 05f58c828..436abfecb 100644 --- a/packages/core/src/routes/session/social.ts +++ b/packages/core/src/routes/session/social.ts @@ -7,14 +7,17 @@ import { object, string, unknown } from 'zod'; import { getLogtoConnectorById } from '#src/connectors/index.js'; import RequestError from '#src/errors/RequestError/index.js'; -import { assignInteractionResults, getApplicationIdFromInteraction } from '#src/lib/session.js'; -import { getSignInExperienceForApplication } from '#src/lib/sign-in-experience/index.js'; +import { + assignInteractionResults, + getApplicationIdFromInteraction, +} from '#src/libraries/session.js'; +import { getSignInExperienceForApplication } from '#src/libraries/sign-in-experience/index.js'; import { findSocialRelatedUser, getUserInfoByAuthCode, getUserInfoFromInteractionResult, -} from '#src/lib/social.js'; -import { generateUserId, insertUser } from '#src/lib/user.js'; +} from '#src/libraries/social.js'; +import { generateUserId, insertUser } from '#src/libraries/user.js'; import koaGuard from '#src/middleware/koa-guard.js'; import { hasUserWithIdentity, @@ -47,6 +50,8 @@ export default function socialRoutes(router: T, provi assertThat(state && redirectUri, 'session.insufficient_info'); const connector = await getLogtoConnectorById(connectorId); assertThat(connector.type === ConnectorType.Social, 'connector.unexpected_type'); + // FIXME: @Darcy + // @ts-expect-error pending fix const redirectTo = await connector.getAuthorizationUri({ state, redirectUri }); ctx.body = { redirectTo }; diff --git a/packages/core/src/routes/session/utils.ts b/packages/core/src/routes/session/utils.ts index 232333ce6..6c56970c8 100644 --- a/packages/core/src/routes/session/utils.ts +++ b/packages/core/src/routes/session/utils.ts @@ -9,9 +9,12 @@ import type { ZodType } from 'zod'; import { z } from 'zod'; import RequestError from '#src/errors/RequestError/index.js'; -import { assignInteractionResults, getApplicationIdFromInteraction } from '#src/lib/session.js'; -import { getSignInExperienceForApplication } from '#src/lib/sign-in-experience/index.js'; -import { verifyUserPassword } from '#src/lib/user.js'; +import { + assignInteractionResults, + getApplicationIdFromInteraction, +} from '#src/libraries/session.js'; +import { getSignInExperienceForApplication } from '#src/libraries/sign-in-experience/index.js'; +import { verifyUserPassword } from '#src/libraries/user.js'; import type { LogContext } from '#src/middleware/koa-log.js'; import { updateUserById } from '#src/queries/user.js'; import assertThat from '#src/utils/assert-that.js'; diff --git a/packages/core/src/routes/sign-in-experience.ts b/packages/core/src/routes/sign-in-experience.ts index 0aa080150..944dd4605 100644 --- a/packages/core/src/routes/sign-in-experience.ts +++ b/packages/core/src/routes/sign-in-experience.ts @@ -7,7 +7,7 @@ import { validateTermsOfUse, validateSignUp, validateSignIn, -} from '#src/lib/sign-in-experience/index.js'; +} from '#src/libraries/sign-in-experience/index.js'; import koaGuard from '#src/middleware/koa-guard.js'; import { findDefaultSignInExperience, diff --git a/packages/core/src/routes/well-known.ts b/packages/core/src/routes/well-known.ts index 65314a50d..5a6c69035 100644 --- a/packages/core/src/routes/well-known.ts +++ b/packages/core/src/routes/well-known.ts @@ -5,8 +5,8 @@ import etag from 'etag'; import type { Provider } from 'oidc-provider'; import { getLogtoConnectors } from '#src/connectors/index.js'; -import { getApplicationIdFromInteraction } from '#src/lib/session.js'; -import { getSignInExperienceForApplication } from '#src/lib/sign-in-experience/index.js'; +import { getApplicationIdFromInteraction } from '#src/libraries/session.js'; +import { getSignInExperienceForApplication } from '#src/libraries/sign-in-experience/index.js'; import type { AnonymousRouter } from './types.js'; diff --git a/packages/demo-app/package.json b/packages/demo-app/package.json index 58104384a..03ce45280 100644 --- a/packages/demo-app/package.json +++ b/packages/demo-app/package.json @@ -16,8 +16,8 @@ "stylelint": "stylelint \"src/**/*.scss\"" }, "devDependencies": { - "@logto/core-kit": "1.0.0-beta.28", - "@logto/language-kit": "1.0.0-beta.28", + "@logto/core-kit": "workspace:*", + "@logto/language-kit": "workspace:*", "@logto/phrases": "workspace:*", "@logto/react": "1.0.0-beta.14", "@logto/schemas": "workspace:*", @@ -42,7 +42,7 @@ "react-i18next": "^11.18.3", "stylelint": "^14.9.1", "typescript": "^4.9.4", - "zod": "^3.19.1" + "zod": "^3.20.2" }, "engines": { "node": "^16.13.0 || ^18.12.0" diff --git a/packages/phrases-ui/package.json b/packages/phrases-ui/package.json index 04f6f4cdd..97d1ff8e1 100644 --- a/packages/phrases-ui/package.json +++ b/packages/phrases-ui/package.json @@ -33,10 +33,10 @@ "url": "https://github.com/logto-io/logto/issues" }, "dependencies": { - "@logto/core-kit": "1.0.0-beta.28", - "@logto/language-kit": "1.0.0-beta.28", + "@logto/core-kit": "workspace:*", + "@logto/language-kit": "workspace:*", "@silverhand/essentials": "^1.3.0", - "zod": "^3.19.1" + "zod": "^3.20.2" }, "devDependencies": { "@silverhand/eslint-config": "1.3.0", diff --git a/packages/phrases/package.json b/packages/phrases/package.json index 8c0ae5f21..72c9b279a 100644 --- a/packages/phrases/package.json +++ b/packages/phrases/package.json @@ -33,10 +33,10 @@ "url": "https://github.com/logto-io/logto/issues" }, "dependencies": { - "@logto/core-kit": "1.0.0-beta.28", - "@logto/language-kit": "1.0.0-beta.28", + "@logto/core-kit": "workspace:*", + "@logto/language-kit": "workspace:*", "@silverhand/essentials": "^1.3.0", - "zod": "^3.19.1" + "zod": "^3.20.2" }, "devDependencies": { "@silverhand/eslint-config": "1.3.0", diff --git a/packages/schemas/package.json b/packages/schemas/package.json index 457f716bb..43a95206d 100644 --- a/packages/schemas/package.json +++ b/packages/schemas/package.json @@ -68,11 +68,11 @@ }, "prettier": "@silverhand/eslint-config/.prettierrc", "dependencies": { - "@logto/connector-kit": "1.0.0-beta.28", - "@logto/core-kit": "1.0.0-beta.28", - "@logto/language-kit": "1.0.0-beta.28", + "@logto/connector-kit": "workspace:*", + "@logto/core-kit": "workspace:*", + "@logto/language-kit": "workspace:*", "@logto/phrases": "workspace:*", "@logto/phrases-ui": "workspace:*", - "zod": "^3.19.1" + "zod": "^3.20.2" } } diff --git a/packages/toolkit/README.md b/packages/toolkit/README.md new file mode 100644 index 000000000..47f13415e --- /dev/null +++ b/packages/toolkit/README.md @@ -0,0 +1,3 @@ +# Toolkit packages directory + +This directory is NOT a package but a container for all toolkit packages. diff --git a/packages/toolkit/connector-kit/CHANGELOG.md b/packages/toolkit/connector-kit/CHANGELOG.md new file mode 100644 index 000000000..a6d65cce6 --- /dev/null +++ b/packages/toolkit/connector-kit/CHANGELOG.md @@ -0,0 +1,191 @@ +# Change Log + +All notable changes to this project will be documented in this file. +See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +## [1.0.0-beta.29](https://github.com/logto-io/toolkit/compare/v1.0.0-beta.28...v1.0.0-beta.29) (2022-12-07) + + +### Bug Fixes + +* exports info and lock dep version ([#45](https://github.com/logto-io/toolkit/issues/45)) ([2ac83b4](https://github.com/logto-io/toolkit/commit/2ac83b4f0ff17579456569fb67ba018ac493c1af)) + + + +## [1.0.0-beta.28](https://github.com/logto-io/toolkit/compare/v1.0.0-beta.27...v1.0.0-beta.28) (2022-12-06) + +**Note:** Version bump only for package @logto/connector-kit + + + + + +## [1.0.0-beta.27](https://github.com/logto-io/toolkit/compare/v1.0.0-beta.26...v1.0.0-beta.27) (2022-11-29) + + +### Features + +* **connector:** add continue message type ([#41](https://github.com/logto-io/toolkit/issues/41)) ([78f1eb0](https://github.com/logto-io/toolkit/commit/78f1eb06f84de2bc7601016a6bcc3c85eb4695f0)) + + + +## [1.0.0-beta.26](https://github.com/logto-io/toolkit/compare/v1.0.0-beta.25...v1.0.0-beta.26) (2022-11-23) + +**Note:** Version bump only for package @logto/connector-kit + + + + + +## [1.0.0-beta.25](https://github.com/logto-io/toolkit/compare/v1.0.0-beta.24...v1.0.0-beta.25) (2022-11-22) + +**Note:** Version bump only for package @logto/connector-kit + + + + + +## [1.0.0-beta.24](https://github.com/logto-io/toolkit/compare/v1.0.0-beta.23...v1.0.0-beta.24) (2022-11-22) + +**Note:** Version bump only for package @logto/connector-kit + + + + + +## [1.0.0-beta.23](https://github.com/logto-io/toolkit/compare/v1.0.0-beta.22...v1.0.0-beta.23) (2022-11-18) + + +### Bug Fixes + +* hot fix the check on whether an element exists in array ([#37](https://github.com/logto-io/toolkit/issues/37)) ([889a577](https://github.com/logto-io/toolkit/commit/889a5773b5e95c35c4ef17db24622e7b87b723c5)) + + + +## [1.0.0-beta.22](https://github.com/logto-io/toolkit/compare/v1.0.0-beta.21...v1.0.0-beta.22) (2022-11-16) + + +### Bug Fixes + +* make standard connectors display name configurable ([#36](https://github.com/logto-io/toolkit/issues/36)) ([da431bf](https://github.com/logto-io/toolkit/commit/da431bf318a83e0086070d49a16a8cc3d970f388)) + + + +## [1.0.0-beta.21](https://github.com/logto-io/toolkit/compare/v1.0.0-beta.20...v1.0.0-beta.21) (2022-11-11) + + +### Features + +* update connector metadata types and add corresponding type guards ([#35](https://github.com/logto-io/toolkit/issues/35)) ([4e7cd12](https://github.com/logto-io/toolkit/commit/4e7cd12b4b4fb32f2ed5a7d66e1616e20fa395f1)) + + + +## [1.0.0-beta.20](https://github.com/logto-io/toolkit/compare/v1.0.0-beta.19...v1.0.0-beta.20) (2022-10-21) + +**Note:** Version bump only for package @logto/connector-kit + + + + + +## [1.0.0-beta.19](https://github.com/logto-io/toolkit/compare/v1.0.0-beta.18...v1.0.0-beta.19) (2022-10-19) + +**Note:** Version bump only for package @logto/connector-kit + + + + + +## [1.0.0-beta.18](https://github.com/logto-io/toolkit/compare/v1.0.0-beta.17...v1.0.0-beta.18) (2022-10-12) + +**Note:** Version bump only for package @logto/connector-kit + + + + + +## [1.0.0-beta.17](https://github.com/logto-io/toolkit/compare/v1.0.0-beta.16...v1.0.0-beta.17) (2022-10-12) + +**Note:** Version bump only for package @logto/connector-kit + + + + + +## [1.0.0-beta.16](https://github.com/logto-io/toolkit/compare/v1.0.0-beta.15...v1.0.0-beta.16) (2022-09-28) + +**Note:** Version bump only for package @logto/connector-kit + + + + + +## [1.0.0-beta.15](https://github.com/logto-io/toolkit/compare/v1.0.0-beta.14...v1.0.0-beta.15) (2022-09-27) + + +### Features + +* **language,core,connector:** init language-kit package ([#14](https://github.com/logto-io/toolkit/issues/14)) ([9a74fc4](https://github.com/logto-io/toolkit/commit/9a74fc4d34c9ce277b8734ab78735549dc3a3cda)) + + + +## [1.0.0-beta.14](https://github.com/logto-io/toolkit/compare/v1.0.0-beta.13...v1.0.0-beta.14) (2022-09-23) + +**Note:** Version bump only for package @logto/connector-kit + + + + + +## [1.0.0-beta.13](https://github.com/logto-io/toolkit/compare/v1.0.0-beta.12...v1.0.0-beta.13) (2022-09-19) + +**Note:** Version bump only for package @logto/connector-kit + + + + + +## [1.0.0-beta.12](https://github.com/logto-io/toolkit/compare/v1.0.0-beta.11...v1.0.0-beta.12) (2022-09-17) + +**Note:** Version bump only for package @logto/connector-kit + + + + + +## [1.0.0-beta.11](https://github.com/logto-io/toolkit/compare/v1.0.0-beta.10...v1.0.0-beta.11) (2022-09-16) + +**Note:** Version bump only for package @logto/connector-kit + + + + + +## 1.0.0-beta.10 (2022-09-16) + + +### Features + +* initial commit ([56a4968](https://github.com/logto-io/toolkit/commit/56a496848168a4a9ae9ac7af83d51f1b8a6afe2c)) + + + +## [1.0.0-beta.9](https://github.com/logto-io/logto/compare/v1.0.0-beta.8...v1.0.0-beta.9) (2022-09-07) + +**Note:** Version bump only for package @logto/connector-core + + + + + +## [1.0.0-beta.8](https://github.com/logto-io/logto/compare/v1.0.0-beta.6...v1.0.0-beta.8) (2022-09-01) + +**Note:** Version bump only for package @logto/connector-core + + + + + +## [1.0.0-beta.6](https://github.com/logto-io/logto/compare/v1.0.0-beta.5...v1.0.0-beta.6) (2022-08-30) + +**Note:** Version bump only for package @logto/connector-core diff --git a/packages/toolkit/connector-kit/package.json b/packages/toolkit/connector-kit/package.json new file mode 100644 index 000000000..57fc83082 --- /dev/null +++ b/packages/toolkit/connector-kit/package.json @@ -0,0 +1,61 @@ +{ + "name": "@logto/connector-kit", + "version": "1.0.0-beta.29", + "author": "Silverhand Inc. ", + "homepage": "https://github.com/logto-io/toolkit#readme", + "repository": { + "type": "git", + "url": "git+https://github.com/logto-io/toolkit.git" + }, + "license": "MPL-2.0", + "type": "module", + "main": "./lib/index.cjs", + "exports": { + "types": "./lib/index.d.ts", + "import": "./lib/index.js", + "require": "./lib/index.cjs" + }, + "types": "./lib/index.d.ts", + "files": [ + "lib" + ], + "scripts": { + "precommit": "lint-staged", + "dev": "tsc --watch --preserveWatchOutput --incremental", + "build": "rm -rf lib/ && rollup -c && tsc", + "lint": "eslint --ext .ts src", + "lint:report": "pnpm lint --format json --output-file report.json", + "prepack": "pnpm build" + }, + "peerDependencies": { + "zod": "^3.19.1" + }, + "dependencies": { + "@logto/core-kit": "workspace:*", + "@logto/language-kit": "workspace:*", + "@silverhand/essentials": "^1.2.1" + }, + "devDependencies": { + "@rollup/plugin-typescript": "^10.0.1", + "@silverhand/eslint-config": "1.3.0", + "@silverhand/ts-config": "1.2.1", + "@types/node": "^16.3.1", + "eslint": "^8.21.0", + "lint-staged": "^13.0.0", + "prettier": "^2.7.1", + "rollup": "^3.6.0", + "tslib": "^2.4.1", + "typescript": "^4.7.4", + "zod": "^3.20.2" + }, + "engines": { + "node": "^16.13.0 || ^18.12.0" + }, + "eslintConfig": { + "extends": "@silverhand" + }, + "prettier": "@silverhand/eslint-config/.prettierrc", + "publishConfig": { + "access": "public" + } +} diff --git a/packages/toolkit/connector-kit/rollup.config.js b/packages/toolkit/connector-kit/rollup.config.js new file mode 100644 index 000000000..7e29ded8a --- /dev/null +++ b/packages/toolkit/connector-kit/rollup.config.js @@ -0,0 +1,21 @@ +import typescript from '@rollup/plugin-typescript'; + +/** + * @type {import('rollup').RollupOptions} + */ +const configs = [ + { + input: ['src/index.ts'], + output: [ + { + dir: 'lib', + format: 'cjs', + preserveModules: true, + entryFileNames: '[name].cjs', + }, + ], + plugins: [typescript()], + }, +]; + +export default configs; diff --git a/packages/toolkit/connector-kit/src/index.ts b/packages/toolkit/connector-kit/src/index.ts new file mode 100644 index 000000000..4807dfba3 --- /dev/null +++ b/packages/toolkit/connector-kit/src/index.ts @@ -0,0 +1,26 @@ +import type { ZodType } from 'zod'; + +import { ConnectorError, ConnectorErrorCodes } from './types.js'; + +export * from './types.js'; + +export function validateConfig(config: unknown, guard: ZodType): asserts config is T { + const result = guard.safeParse(config); + + if (!result.success) { + throw new ConnectorError(ConnectorErrorCodes.InvalidConfig, result.error); + } +} + +export const parseJson = ( + jsonString: string, + errorCode: ConnectorErrorCodes = ConnectorErrorCodes.InvalidResponse, + errorPayload?: unknown +) => { + try { + // eslint-disable-next-line @typescript-eslint/no-unsafe-return + return JSON.parse(jsonString); + } catch { + throw new ConnectorError(errorCode, errorPayload ?? jsonString); + } +}; diff --git a/packages/toolkit/connector-kit/src/types.ts b/packages/toolkit/connector-kit/src/types.ts new file mode 100644 index 000000000..53984be6d --- /dev/null +++ b/packages/toolkit/connector-kit/src/types.ts @@ -0,0 +1,149 @@ +import type { LanguageTag } from '@logto/language-kit'; +import { isLanguageTag } from '@logto/language-kit'; +import type { ZodType } from 'zod'; +import { z } from 'zod'; + +// MARK: Foundation +export enum ConnectorType { + Email = 'Email', + Sms = 'Sms', + Social = 'Social', +} + +export enum ConnectorPlatform { + Native = 'Native', + Universal = 'Universal', + Web = 'Web', +} + +export const i18nPhrasesGuard: ZodType = z + .object({ en: z.string() }) + .and(z.record(z.string())) + .refine((i18nObject) => { + const keys = Object.keys(i18nObject); + + if (!keys.includes('en')) { + return false; + } + + for (const value of keys) { + if (!isLanguageTag(value)) { + return false; + } + } + + return true; + }); + +type I18nPhrases = { en: string } & { + [K in Exclude]?: string; +}; + +export enum ConnectorErrorCodes { + General = 'general', + InvalidMetadata = 'invalid_metadata', + UnexpectedType = 'unexpected_type', + InvalidConfigGuard = 'invalid_config_guard', + InvalidRequestParameters = 'invalid_request_parameters', + InsufficientRequestParameters = 'insufficient_request_parameters', + InvalidConfig = 'invalid_config', + InvalidResponse = 'invalid_response', + TemplateNotFound = 'template_not_found', + NotImplemented = 'not_implemented', + SocialAuthCodeInvalid = 'social_auth_code_invalid', + SocialAccessTokenInvalid = 'social_invalid_access_token', + SocialIdTokenInvalid = 'social_invalid_id_token', + AuthorizationFailed = 'authorization_failed', +} + +export class ConnectorError extends Error { + public code: ConnectorErrorCodes; + public data: unknown; + + constructor(code: ConnectorErrorCodes, data?: unknown) { + const message = typeof data === 'string' ? data : 'Connector error occurred.'; + super(message); + this.code = code; + this.data = typeof data === 'string' ? { message: data } : data; + } +} + +export enum MessageTypes { + SignIn = 'SignIn', + Register = 'Register', + ForgotPassword = 'ForgotPassword', + Continue = 'Continue', + Test = 'Test', +} + +export const messageTypesGuard = z.nativeEnum(MessageTypes); + +const connectorMetadataGuard = z.object({ + id: z.string(), + target: z.string(), + platform: z.nativeEnum(ConnectorPlatform).nullable(), + name: i18nPhrasesGuard, + logo: z.string(), + logoDark: z.string().nullable(), + description: i18nPhrasesGuard, + isStandard: z.boolean().optional(), + readme: z.string(), + configTemplate: z.string(), +}); + +export const configurableConnectorMetadataGuard = connectorMetadataGuard + .pick({ + target: true, + name: true, + logo: true, + logoDark: true, + }) + .partial(); + +export type ConnectorMetadata = z.infer; + +export type ConfigurableConnectorMetadata = z.infer; + +export type BaseConnector = { + type: Type; + metadata: ConnectorMetadata; + configGuard: ZodType; +}; + +export type CreateConnector> = (options: { + getConfig: GetConnectorConfig; +}) => Promise; + +export type GetConnectorConfig = (id: string) => Promise; + +export type AllConnector = SmsConnector | EmailConnector | SocialConnector; + +// MARK: SMS + Email connector +export type SmsConnector = BaseConnector & { + sendMessage: SendMessageFunction; +}; + +export type EmailConnector = BaseConnector & { + sendMessage: SendMessageFunction; +}; + +export type SendMessageFunction = ( + data: { to: string; type: MessageTypes; payload: { code: string } }, + config?: unknown +) => Promise; + +// MARK: Social connector +export type SocialConnector = BaseConnector & { + getAuthorizationUri: GetAuthorizationUri; + getUserInfo: GetUserInfo; +}; + +export type GetAuthorizationUri = (payload: { + state: string; + redirectUri: string; + nonce: string; +}) => Promise; + +export type GetUserInfo = ( + data: Record & { nonce: string; redirectUri: string } +) => Promise<{ id: string } & Record>; diff --git a/packages/toolkit/connector-kit/tsconfig.json b/packages/toolkit/connector-kit/tsconfig.json new file mode 100644 index 000000000..41e099231 --- /dev/null +++ b/packages/toolkit/connector-kit/tsconfig.json @@ -0,0 +1,12 @@ +{ + "extends": "@silverhand/ts-config/tsconfig.base", + "compilerOptions": { + "outDir": "lib", + "declaration": true, + "moduleResolution": "nodenext", + "module": "esnext" + }, + "include": [ + "src" + ] +} diff --git a/packages/toolkit/core-kit/CHANGELOG.md b/packages/toolkit/core-kit/CHANGELOG.md new file mode 100644 index 000000000..e1818578e --- /dev/null +++ b/packages/toolkit/core-kit/CHANGELOG.md @@ -0,0 +1,265 @@ +# Change Log + +All notable changes to this project will be documented in this file. +See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +## [1.0.0-beta.29](https://github.com/logto-io/toolkit/compare/v1.0.0-beta.28...v1.0.0-beta.29) (2022-12-07) + + +### Bug Fixes + +* exports info and lock dep version ([#45](https://github.com/logto-io/toolkit/issues/45)) ([2ac83b4](https://github.com/logto-io/toolkit/commit/2ac83b4f0ff17579456569fb67ba018ac493c1af)) + + + +## [1.0.0-beta.28](https://github.com/logto-io/toolkit/compare/v1.0.0-beta.27...v1.0.0-beta.28) (2022-12-06) + +**Note:** Version bump only for package @logto/core-kit + + + + + +## [1.0.0-beta.26](https://github.com/logto-io/toolkit/compare/v1.0.0-beta.25...v1.0.0-beta.26) (2022-11-23) + +**Note:** Version bump only for package @logto/core-kit + + + + + +## [1.0.0-beta.25](https://github.com/logto-io/toolkit/compare/v1.0.0-beta.24...v1.0.0-beta.25) (2022-11-22) + + +### Bug Fixes + +* **core:** declarations ([#39](https://github.com/logto-io/toolkit/issues/39)) ([3140fdb](https://github.com/logto-io/toolkit/commit/3140fdbcc2db76bb76b4a5f5a5070de0dc12ff40)) + + + +## [1.0.0-beta.24](https://github.com/logto-io/toolkit/compare/v1.0.0-beta.23...v1.0.0-beta.24) (2022-11-22) + +**Note:** Version bump only for package @logto/core-kit + + + + + +## [1.0.0-beta.21](https://github.com/logto-io/toolkit/compare/v1.0.0-beta.20...v1.0.0-beta.21) (2022-11-11) + +**Note:** Version bump only for package @logto/core-kit + + + + + +## [1.0.0-beta.20](https://github.com/logto-io/toolkit/compare/v1.0.0-beta.19...v1.0.0-beta.20) (2022-10-21) + +**Note:** Version bump only for package @logto/core-kit + + + + + +## [1.0.0-beta.19](https://github.com/logto-io/toolkit/compare/v1.0.0-beta.18...v1.0.0-beta.19) (2022-10-19) + +**Note:** Version bump only for package @logto/core-kit + + + + + +## [1.0.0-beta.18](https://github.com/logto-io/toolkit/compare/v1.0.0-beta.17...v1.0.0-beta.18) (2022-10-12) + + +### Bug Fixes + +* export url utilities in index file ([#23](https://github.com/logto-io/toolkit/issues/23)) ([0a7b4c8](https://github.com/logto-io/toolkit/commit/0a7b4c836fe6d566fc051fcf185df4dac352e308)) + + + +## [1.0.0-beta.17](https://github.com/logto-io/toolkit/compare/v1.0.0-beta.16...v1.0.0-beta.17) (2022-10-12) + +**Note:** Version bump only for package @logto/core-kit + + + + + +## [1.0.0-beta.16](https://github.com/logto-io/toolkit/compare/v1.0.0-beta.15...v1.0.0-beta.16) (2022-09-28) + + +### Bug Fixes + +* **core,language:** avoid using path aliases ([#15](https://github.com/logto-io/toolkit/issues/15)) ([22db3ed](https://github.com/logto-io/toolkit/commit/22db3ed2daf3ee5906ffc864bb9bed1a826df842)) + + + +## [1.0.0-beta.15](https://github.com/logto-io/toolkit/compare/v1.0.0-beta.14...v1.0.0-beta.15) (2022-09-27) + + +### Features + +* **language,core,connector:** init language-kit package ([#14](https://github.com/logto-io/toolkit/issues/14)) ([9a74fc4](https://github.com/logto-io/toolkit/commit/9a74fc4d34c9ce277b8734ab78735549dc3a3cda)) + + + +## [1.0.0-beta.14](https://github.com/logto-io/toolkit/compare/v1.0.0-beta.13...v1.0.0-beta.14) (2022-09-23) + + +### Bug Fixes + +* remove unused file utils to avoid importing fs in browser ([#11](https://github.com/logto-io/toolkit/issues/11)) ([e1bda93](https://github.com/logto-io/toolkit/commit/e1bda93d1e95974f5e7128c48bb3a342cc9de358)) + + + +## [1.0.0-beta.13](https://github.com/logto-io/toolkit/compare/v1.0.0-beta.12...v1.0.0-beta.13) (2022-09-19) + +**Note:** Version bump only for package @logto/core-kit + + + + + +## [1.0.0-beta.12](https://github.com/logto-io/toolkit/compare/v1.0.0-beta.11...v1.0.0-beta.12) (2022-09-17) + +**Note:** Version bump only for package @logto/core-kit + + + + + +## [1.0.0-beta.11](https://github.com/logto-io/toolkit/compare/v1.0.0-beta.10...v1.0.0-beta.11) (2022-09-16) + +**Note:** Version bump only for package @logto/core-kit + + + + + +## 1.0.0-beta.10 (2022-09-16) + + +### Features + +* initial commit ([56a4968](https://github.com/logto-io/toolkit/commit/56a496848168a4a9ae9ac7af83d51f1b8a6afe2c)) + + + +## [1.0.0-beta.9](https://github.com/logto-io/logto/compare/v1.0.0-beta.8...v1.0.0-beta.9) (2022-09-07) + + +### Features + +* add Portuguese translation ([f268ecb](https://github.com/logto-io/logto/commit/f268ecb1a8d57d1e33225bec8852f3bc377dd478)) + + +### Bug Fixes + +* **console,ui:** fix locale guard issue in settings page ([e200578](https://github.com/logto-io/logto/commit/e2005780a39fa7b5f5c5e406f37805913b684c18)) + + + +## [1.0.0-beta.8](https://github.com/logto-io/logto/compare/v1.0.0-beta.6...v1.0.0-beta.8) (2022-09-01) + +**Note:** Version bump only for package @logto/shared + + + + + +## [1.0.0-beta.6](https://github.com/logto-io/logto/compare/v1.0.0-beta.5...v1.0.0-beta.6) (2022-08-30) + +**Note:** Version bump only for package @logto/shared + + + + + +## [1.0.0-beta.5](https://github.com/logto-io/logto/compare/v1.0.0-beta.4...v1.0.0-beta.5) (2022-08-19) + +**Note:** Version bump only for package @logto/shared + + + + + +## [1.0.0-beta.4](https://github.com/logto-io/logto/compare/v1.0.0-beta.3...v1.0.0-beta.4) (2022-08-11) + + +### Bug Fixes + +* **shared:** fix dark color generator ([#1719](https://github.com/logto-io/logto/issues/1719)) ([3deb98c](https://github.com/logto-io/logto/commit/3deb98c18dfe54abda53e6de7592f40924e1f2f3)) + + + +## [1.0.0-beta.3](https://github.com/logto-io/logto/compare/v1.0.0-beta.2...v1.0.0-beta.3) (2022-08-01) + + +### Features + +* **console:** add Next.js integration guide in admin console ([7d3f947](https://github.com/logto-io/logto/commit/7d3f94738f495de98464d23b6fdf18214d59005e)) + + + +## [1.0.0-beta.1](https://github.com/logto-io/logto/compare/v1.0.0-beta.0...v1.0.0-beta.1) (2022-07-19) + +**Note:** Version bump only for package @logto/shared + + + + + +## [1.0.0-beta.0](https://github.com/logto-io/logto/compare/v1.0.0-alpha.4...v1.0.0-beta.0) (2022-07-14) + +**Note:** Version bump only for package @logto/shared + + + + + +## [1.0.0-alpha.3](https://github.com/logto-io/logto/compare/v1.0.0-alpha.2...v1.0.0-alpha.3) (2022-07-07) + +**Note:** Version bump only for package @logto/shared + + + + + +### [0.1.2-alpha.5](https://github.com/logto-io/logto/compare/v0.1.2-alpha.4...v0.1.2-alpha.5) (2022-07-03) + +**Note:** Version bump only for package @logto/shared + + + + + +### [0.1.2-alpha.1](https://github.com/logto-io/logto/compare/v0.1.2-alpha.0...v0.1.2-alpha.1) (2022-07-02) + +**Note:** Version bump only for package @logto/shared + + + + + +### [0.1.1-alpha.0](https://github.com/logto-io/logto/compare/v0.1.0-internal...v0.1.1-alpha.0) (2022-07-01) + + +### Features + +* **console,ui:** generate dark mode color in console ([#1231](https://github.com/logto-io/logto/issues/1231)) ([f72b21d](https://github.com/logto-io/logto/commit/f72b21d1602ab0fb35ef3e7d84f6c8ebd7e18b08)) +* **console:** add details summary component in guides ([693c4f0](https://github.com/logto-io/logto/commit/693c4f0422eb312190f2c7b0673e3ceaa8c41213)) +* **core,shared:** get /dashboard/users/active ([#953](https://github.com/logto-io/logto/issues/953)) ([1420bb2](https://github.com/logto-io/logto/commit/1420bb28cec9c0e20b4d0645a58e436135f87c83)) +* **demo-app:** implement (part 2) ([85a055e](https://github.com/logto-io/logto/commit/85a055efa4358cfb69c0d74f7aeaeb0bade024af)) +* **demo-app:** implementation ([#982](https://github.com/logto-io/logto/issues/982)) ([7f4f4f8](https://github.com/logto-io/logto/commit/7f4f4f84addf8a25c3d30f1ac3ceeef460afcf17)) +* **demo-app:** init ([#979](https://github.com/logto-io/logto/issues/979)) ([ad0aa8e](https://github.com/logto-io/logto/commit/ad0aa8e0c20a8d60f095b477e942b724fb53ca7d)) +* **shared,phrases-ui:** not allow hyphens in username ([#1319](https://github.com/logto-io/logto/issues/1319)) ([5e81966](https://github.com/logto-io/logto/commit/5e819665c7c1d584ff5cff25e4e0723122be78b2)) +* update field check rules ([#854](https://github.com/logto-io/logto/issues/854)) ([85a407c](https://github.com/logto-io/logto/commit/85a407c5f6f76fed0513acd6fb41943413935b5a)) + + +### Bug Fixes + +* `lint:report` script ([#730](https://github.com/logto-io/logto/issues/730)) ([3b17324](https://github.com/logto-io/logto/commit/3b17324d189b2fe47985d0bee8b37b4ef1dbdd2b)) +* **console:** dashboard chart style ([#1177](https://github.com/logto-io/logto/issues/1177)) ([cf47044](https://github.com/logto-io/logto/commit/cf470446e4458e748bbf6384adb96d69805a1991)), closes [#1178](https://github.com/logto-io/logto/issues/1178) +* **console:** new platform tab colors ([#1158](https://github.com/logto-io/logto/issues/1158)) ([1bb770f](https://github.com/logto-io/logto/commit/1bb770fd1fa364f12c1c56a8542d36a3cf9647fe)) +* **core:** remove name regex ([#1109](https://github.com/logto-io/logto/issues/1109)) ([a790248](https://github.com/logto-io/logto/commit/a790248c091e444614652b08b05686e9934cb639)) diff --git a/packages/toolkit/core-kit/declaration/dom.d.ts b/packages/toolkit/core-kit/declaration/dom.d.ts new file mode 100644 index 000000000..ce3570903 --- /dev/null +++ b/packages/toolkit/core-kit/declaration/dom.d.ts @@ -0,0 +1,77 @@ +// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#input_types +type InputType = + | 'button' + | 'checkbox' + | 'color' + | 'date' + | 'datetime-local' + | 'email' + | 'file' + | 'hidden' + | 'image' + | 'month' + | 'number' + | 'password' + | 'radio' + | 'range' + | 'reset' + | 'search' + | 'submit' + | 'tel' + | 'text' + | 'time' + | 'url' + | 'week'; + +// https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofilling-form-controls:-the-autocomplete-attribute +type AutoCompleteType = + | 'name' + | 'honorific-prefix' + | 'given-name' + | 'additional-name' + | 'family-name' + | 'honorific-suffix' + | 'nickname' + | 'username' + | 'new-password' + | 'current-password' + | 'one-time-code' + | 'organization-title' + | 'organization' + | 'street-address' + | 'address-line1' + | 'address-line2' + | 'address-line3' + | 'address-level4' + | 'address-level3' + | 'address-level2' + | 'address-level1' + | 'country' + | 'country-name' + | 'postal-code' + | 'cc-name' + | 'cc-given-name' + | 'cc-additional-name' + | 'cc-family-name' + | 'cc-number' + | 'cc-exp' + | 'cc-exp-month' + | 'cc-exp-year' + | 'cc-csc' + | 'cc-type' + | 'transaction-currency' + | 'transaction-amount' + | 'language' + | 'bday' + | 'bday-day' + | 'bday-month' + | 'bday-year' + | 'sex' + | 'url' + | 'photo' + | 'mobile'; + +// TO-DO: remove me +interface Body { + json(): Promise; +} diff --git a/packages/toolkit/core-kit/declaration/index.ts b/packages/toolkit/core-kit/declaration/index.ts new file mode 100644 index 000000000..85057a144 --- /dev/null +++ b/packages/toolkit/core-kit/declaration/index.ts @@ -0,0 +1,4 @@ +/* eslint-disable import/no-unassigned-import */ +import './react-app.d'; +import './dom.d'; +/* eslint-enable import/no-unassigned-import */ diff --git a/packages/toolkit/core-kit/declaration/react-app.d.ts b/packages/toolkit/core-kit/declaration/react-app.d.ts new file mode 100644 index 000000000..05f26074d --- /dev/null +++ b/packages/toolkit/core-kit/declaration/react-app.d.ts @@ -0,0 +1,65 @@ +// Copied from react-scripts/lib/react-app.d.ts + +declare module '*.avif' { + const source: string; + export default source; +} + +declare module '*.bmp' { + const source: string; + export default source; +} + +declare module '*.gif' { + const source: string; + export default source; +} + +declare module '*.jpg' { + const source: string; + export default source; +} + +declare module '*.jpeg' { + const source: string; + export default source; +} + +declare module '*.png' { + const source: string; + export default source; +} + +declare module '*.webp' { + const source: string; + export default source; +} + +declare module '*.svg' { + import * as React from 'react'; + + export const ReactComponent: React.FunctionComponent< + React.SVGProps & { title?: string } + >; + + const source: string; + export default source; +} + +declare module '*.module.css' { + const classes: Readonly>; + export default classes; + export = classes; +} + +declare module '*.module.scss' { + const classes: Readonly>; + export default classes; + export = classes; +} + +declare module '*.module.sass' { + const classes: Readonly>; + export default classes; + export = classes; +} diff --git a/packages/toolkit/core-kit/jest.config.ts b/packages/toolkit/core-kit/jest.config.ts new file mode 100644 index 000000000..2a644a24e --- /dev/null +++ b/packages/toolkit/core-kit/jest.config.ts @@ -0,0 +1,13 @@ +import type { Config } from '@jest/types'; + +const config: Config.InitialOptions = { + preset: 'ts-jest', + moduleNameMapper: { + '^(\\.{1,2}/.*)\\.js$': '$1', + }, + collectCoverageFrom: ['src/**/*.ts'], + coverageReporters: ['lcov', 'text-summary'], + setupFilesAfterEnv: ['jest-matcher-specific-error'], +}; + +export default config; diff --git a/packages/toolkit/core-kit/package.json b/packages/toolkit/core-kit/package.json new file mode 100644 index 000000000..6645b1cad --- /dev/null +++ b/packages/toolkit/core-kit/package.json @@ -0,0 +1,80 @@ +{ + "name": "@logto/core-kit", + "version": "1.0.0-beta.29", + "author": "Silverhand Inc. ", + "homepage": "https://github.com/logto-io/toolkit#readme", + "repository": { + "type": "git", + "url": "git+https://github.com/logto-io/toolkit.git" + }, + "license": "MPL-2.0", + "type": "module", + "main": "./lib/index.cjs", + "exports": { + "types": "./lib/index.d.ts", + "import": "./lib/index.js", + "require": "./lib/index.cjs" + }, + "types": "./lib/index.d.ts", + "files": [ + "declaration", + "lib", + "scss" + ], + "scripts": { + "precommit": "lint-staged", + "dev": "tsc -p tsconfig.build.json --watch --preserveWatchOutput --incremental", + "build": "rm -rf lib/ && rollup -c && tsc -p tsconfig.build.json", + "lint": "eslint --ext .ts src", + "lint:report": "pnpm lint --format json --output-file report.json", + "prepack": "pnpm build", + "stylelint": "stylelint \"scss/**/*.scss\"", + "test": "jest", + "test:coverage": "jest --silent --coverage" + }, + "engines": { + "node": "^16.13.0 || ^18.12.0" + }, + "peerDependencies": { + "zod": "^3.19.1" + }, + "dependencies": { + "@logto/language-kit": "^1.0.0-beta.29", + "color": "^4.2.3", + "nanoid": "^3.1.23" + }, + "devDependencies": { + "@jest/types": "^29.0.3", + "@rollup/plugin-typescript": "^10.0.1", + "@silverhand/eslint-config": "1.3.0", + "@silverhand/eslint-config-react": "1.3.0", + "@silverhand/essentials": "^1.2.1", + "@silverhand/ts-config": "1.2.1", + "@types/color": "^3.0.3", + "@types/jest": "^29.0.3", + "@types/node": "^16.3.1", + "@types/react": "^18.0.20", + "eslint": "^8.21.0", + "jest": "^29.0.3", + "jest-matcher-specific-error": "^1.0.0", + "lint-staged": "^13.0.0", + "postcss": "^8.4.6", + "prettier": "^2.7.1", + "rollup": "^3.6.0", + "stylelint": "^14.9.1", + "ts-jest": "^29.0.1", + "tslib": "^2.4.1", + "typescript": "^4.7.4", + "zod": "^3.20.2" + }, + "eslintConfig": { + "extends": "@silverhand" + }, + "stylelint": { + "extends": "@silverhand/eslint-config-react/.stylelintrc" + }, + "prettier": "@silverhand/eslint-config/.prettierrc", + "publishConfig": { + "access": "public" + } +} diff --git a/packages/toolkit/core-kit/rollup.config.js b/packages/toolkit/core-kit/rollup.config.js new file mode 100644 index 000000000..af6ad8d07 --- /dev/null +++ b/packages/toolkit/core-kit/rollup.config.js @@ -0,0 +1,21 @@ +import typescript from '@rollup/plugin-typescript'; + +/** + * @type {import('rollup').RollupOptions} + */ +const configs = [ + { + input: ['src/index.ts'], + output: [ + { + dir: 'lib', + format: 'cjs', + preserveModules: true, + entryFileNames: '[name].cjs', + }, + ], + plugins: [typescript({ tsconfig: 'tsconfig.build.json' })], + }, +]; + +export default configs; diff --git a/packages/toolkit/core-kit/scss/_console-themes.scss b/packages/toolkit/core-kit/scss/_console-themes.scss new file mode 100644 index 000000000..aada4e242 --- /dev/null +++ b/packages/toolkit/core-kit/scss/_console-themes.scss @@ -0,0 +1,339 @@ +@mixin light { + // tonal palettes + --color-all-0: #000; + --color-all-100: #fff; + --color-primary-10: #190064; + --color-primary-20: #2d009d; + --color-primary-30: #4300da; + --color-primary-40: #5d34f2; + --color-primary-50: #7958ff; + --color-primary-60: #947dff; + --color-primary-70: #af9eff; + --color-primary-80: #cabeff; + --color-primary-90: #e6deff; + --color-primary-95: #f5eeff; + --color-primary-99: #fffbff; + --color-secondary-10: #201c00; + --color-secondary-20: #373100; + --color-secondary-30: #4f4700; + --color-secondary-40: #695f00; + --color-secondary-50: #847900; + --color-secondary-60: #9f930d; + --color-secondary-70: #baad2d; + --color-secondary-80: #d7c947; + --color-secondary-90: #f4e560; + --color-secondary-95: #fff480; + --color-secondary-99: #fffbf7; + --color-tertiary-10: #350041; + --color-tertiary-20: #560068; + --color-tertiary-30: #7b0093; + --color-tertiary-40: #9927af; + --color-tertiary-50: #b545ca; + --color-tertiary-60: #d361e7; + --color-tertiary-70: #f07eff; + --color-tertiary-80: #faabff; + --color-tertiary-90: #ffd5ff; + --color-tertiary-95: #ffeafe; + --color-tertiary-99: #fcfcfc; + --color-error-10: #410001; + --color-error-20: #680003; + --color-error-30: #930006; + --color-error-40: #ba1b1b; + --color-error-50: #dd3730; + --color-error-60: #ff5449; + --color-error-70: #ff897a; + --color-error-80: #ffb4a9; + --color-error-90: #ffdad4; + --color-error-95: #ffede9; + --color-error-99: #fcfcfc; + --color-neutral-10: #191c1d; + --color-neutral-20: #2d3132; + --color-neutral-30: #444748; + --color-neutral-40: #5c5f60; + --color-neutral-50: #747778; + --color-neutral-60: #8e9192; + --color-neutral-70: #a9acac; + --color-neutral-80: #c4c7c7; + --color-neutral-90: #e0e3e3; + --color-neutral-95: #eff1f1; + --color-neutral-99: #f7f8f8; + --color-neutral-variant-10: #1b1b22; + --color-neutral-variant-20: #302f38; + --color-neutral-variant-30: #47464e; + --color-neutral-variant-40: #5f5d67; + --color-neutral-variant-50: #78767f; + --color-neutral-variant-60: #928f9a; + --color-neutral-variant-70: #adaab4; + --color-neutral-variant-80: #c9c5d0; + --color-neutral-variant-90: #e5e1ec; + --color-neutral-variant-95: #f3effa; + --color-neutral-variant-99: #fffbff; + --color-success-10: #002106; + --color-success-20: #00390b; + --color-success-30: #005314; + --color-success-40: #116d26; + --color-success-50: #32873d; + --color-success-60: #4ea254; + --color-success-70: #68be6c; + --color-success-80: #83da85; + --color-success-90: #9fe79f; + --color-success-95: #bdefbd; + --color-success-99: #ebf9eb; + --color-alert-10: #2b1700; + --color-alert-20: #472a00; + --color-alert-30: #663e00; + --color-alert-40: #865300; + --color-alert-50: #a76900; + --color-alert-60: #ca8000; + --color-alert-70: #eb9918; + --color-alert-80: #ffb95a; + --color-alert-90: #ffddb5; + --color-alert-95: #ffeedc; + --color-alert-99: #fff5eb; + + // color aliases + --color-primary: var(--color-primary-40); + --color-on-primary: var(--color-all-100); + --color-primary-container: var(--color-primary-90); + --color-on-primary-container: var(--color-primary-10); + --color-secondary: var(--color-secondary-40); + --color-on-secondary: var(--color-all-100); + --color-secondary-container: var(--color-secondary-30); + --color-on-secondary-container: var(--color-secondary-10); + --color-tertiary: var(--color-tertiary-40); + --color-on-tertiary: var(--color-all-100); + --color-tertiary-container: var(--color-tertiary-90); + --color-on-tertiary-container: var(--color-tertiary-10); + --color-error: var(--color-error-40); + --color-on-error: var(--color-all-100); + --color-error-container: var(--color-error-90); + --color-on-error-container: var(--color-error-10); + --color-background: var(--color-neutral-99); + --color-on-background: var(--color-neutral-10); + --color-surface: var(--color-neutral-99); + --color-surface-1: #ecebf6; // Neutral-99 + 2% Neutral-Variant-50 + 5% Primary-40 + --color-surface-2: #e8e6f6; // Neutral-99 + 2% Neutral-Variant-50 + 8% Primary-40 + --color-surface-3: #e3e0f6; // Neutral-99 + 2% Neutral-Variant-50 + 11% Primary-40 + --color-surface-4: #dfdaf5; // Neutral-99 + 2% Neutral-Variant-50 + 14% Primary-40 + --color-surface-5: #dcd6f5; // Neutral-99 + 2% Neutral-Variant-50 + 16% Primary-40 + --color-on-surface: var(--color-neutral-10); + --color-surface-variant: var(--color-neutral-variant-90); + --color-on-surface-variant: var(--color-neutral-variant-30); + --color-outline: var(--color-neutral-variant-50); + --color-primary-hover: var(--color-primary-50); + --color-primary-pressed: var(--color-primary-30); + --color-danger-hover: var(--color-error-50); + --color-danger-pressed: var(--color-error-30); + --color-text: var(--color-neutral-10); + --color-text-link: var(--color-primary-40); + --color-text-secondary: var(--color-neutral-50); + --color-placeholder: var(--color-neutral-70); + --color-border: var(--color-neutral-80); + --color-divider: var(--color-neutral-90); + --color-disabled: var(--color-neutral-80); + --color-base: var(--color-surface-1); + --color-layer-1: var(--color-all-100); + --color-layer-2: var(--color-neutral-95); + --color-float: var(--color-all-100); + --color-layer-light: var(--color-neutral-99); + --color-inverse-surface: var(--color-neutral-20); + --color-inverse-on-surface: var(--color-neutral-95); + --color-inverse-primary: var(--color-primary-50); + --color-shadow: var(--color-all-100); + --color-white: #fff; + --color-button-icon: var(--color-primary-80); + --color-icon-background: var(--color-neutral-variant-95); + --color-hover: rgba(25, 28, 29, 8%); // 8% Neutral-10 + --color-pressed: rgba(25, 28, 29, 12%); // 12% Neutral-10 + --color-focused: rgba(25, 28, 29, 16%); // 16% Neutral-10 + --color-hover-variant: rgba(93, 52, 242, 8%); // 8% Primary-40 + --color-pressed-variant: rgba(93, 52, 242, 12%); // 12% Primary-40 + --color-focused-variant: rgba(93, 52, 242, 16%); // 16% Primary-40 + + // Shadows + --shadow-1: 0 4px 8px rgba(0, 0, 0, 8%); + --shadow-2: 0 4px 12px rgba(0, 0, 0, 12%); + --shadow-2-reversed: 0 -4px 12px rgba(0, 0, 0, 12%); + --shadow-3: 0 4px 16px rgba(0, 0, 0, 20%); + + // Client specific variables (not available in design system) + --color-danger-toast-background: var(--color-error-95); + --color-danger-focused: rgba(186, 27, 27, 16%); // 16% Error-40 + --color-tooltip-background: #34353f; // dark theme Surface-4 + --color-tooltip-text: var(--color-neutral-99); + --color-overlay: rgba(0, 0, 0, 30%); + --color-drawer-overlay: rgba(0, 0, 0, 40%); + --color-guide-dropdown-background: var(--color-white); + --color-guide-dropdown-border: var(--color-border); + --color-skeleton-shimmer-rgb: 255, 255, 255; // rgb of Layer-1 +} + +@mixin dark { + // tonal palettes + --color-all-0: #fff; + --color-all-100: #000; + --color-primary-10: #fffbff; + --color-primary-20: #f5eeff; + --color-primary-30: #e6deff; + --color-primary-40: #cabeff; + --color-primary-50: #af9eff; + --color-primary-60: #947dff; + --color-primary-70: #7958ff; + --color-primary-80: #5d34f2; + --color-primary-90: #4300da; + --color-primary-95: #2d009d; + --color-primary-99: #190064; + --color-secondary-10: #fffbf7; + --color-secondary-20: #fff480; + --color-secondary-30: #f4e560; + --color-secondary-40: #d7c947; + --color-secondary-50: #baad2d; + --color-secondary-60: #9f930d; + --color-secondary-70: #847900; + --color-secondary-80: #695f00; + --color-secondary-90: #4f4700; + --color-secondary-95: #373100; + --color-secondary-99: #201c00; + --color-tertiary-10: #fcfcfc; + --color-tertiary-20: #ffeafe; + --color-tertiary-30: #ffd5ff; + --color-tertiary-40: #faabff; + --color-tertiary-50: #f07eff; + --color-tertiary-60: #d361e7; + --color-tertiary-70: #b545ca; + --color-tertiary-80: #9927af; + --color-tertiary-90: #7b0093; + --color-tertiary-95: #560068; + --color-tertiary-99: #350041; + --color-error-10: #fcfcfc; + --color-error-20: #ffede9; + --color-error-30: #ffdad4; + --color-error-40: #ffb4a9; + --color-error-50: #ff897a; + --color-error-60: #ff5449; + --color-error-70: #dd3730; + --color-error-80: #ba1b1b; + --color-error-90: #930006; + --color-error-95: #680003; + --color-error-99: #410001; + --color-neutral-10: #f7f8f8; + --color-neutral-20: #eff1f1; + --color-neutral-30: #e0e3e3; + --color-neutral-40: #c4c7c7; + --color-neutral-50: #a9acac; + --color-neutral-60: #8e9192; + --color-neutral-70: #747778; + --color-neutral-80: #5c5f60; + --color-neutral-90: #444748; + --color-neutral-95: #2d3132; + --color-neutral-99: #191c1d; + --color-neutral-variant-10: #fffbff; + --color-neutral-variant-20: #f3effa; + --color-neutral-variant-30: #e5e1ec; + --color-neutral-variant-40: #c9c5d0; + --color-neutral-variant-50: #adaab4; + --color-neutral-variant-60: #928f9a; + --color-neutral-variant-70: #78767f; + --color-neutral-variant-80: #5f5d67; + --color-neutral-variant-90: #47464e; + --color-neutral-variant-95: #302f38; + --color-neutral-variant-99: #1b1b22; + --color-success-10: #ebf9eb; + --color-success-20: #bdefbd; + --color-success-30: #9fe79f; + --color-success-40: #83da85; + --color-success-50: #68be6c; + --color-success-60: #4ea254; + --color-success-70: #32873d; + --color-success-80: #116d26; + --color-success-90: #005314; + --color-success-95: #00390b; + --color-success-99: #002106; + --color-alert-10: #fff5eb; + --color-alert-20: #ffeedc; + --color-alert-30: #ffddb5; + --color-alert-40: #ffb95a; + --color-alert-50: #eb9918; + --color-alert-60: #ca8000; + --color-alert-70: #a76900; + --color-alert-80: #865300; + --color-alert-90: #663e00; + --color-alert-95: #472a00; + --color-alert-99: #2b1700; + + // color aliases + --color-primary: var(--color-primary-70); + --color-on-primary: var(--color-all-0); + --color-primary-container: var(--color-primary-30); + --color-on-primary-container: var(--color-primary-30); + --color-secondary: var(--color-secondary-70); + --color-on-secondary: var(--color-all-0); + --color-secondary-container: var(--color-secondary-90); + --color-on-secondary-container: var(--color-secondary-30); + --color-tertiary: var(--color-tertiary-70); + --color-on-tertiary: var(--color-all-0); + --color-tertiary-container: var(--color-tertiary-90); + --color-on-tertiary-container: var(--color-tertiary-30); + --color-error: var(--color-error-70); + --color-on-error: var(--color-all-0); + --color-error-container: var(--color-error-90); + --color-on-error-container: var(--color-error-30); + --color-background: var(--color-neutral-99); + --color-on-background: var(--color-neutral-10); + --color-surface: var(--color-neutral-99); + --color-surface-1: #25272b; // Neutral-99 + 2% Neutral-40 + 5% Primary-80 + --color-surface-2: #2a2c32; // Neutral-99 + 2% Neutral-40 + 8% Primary-80 + --color-surface-3: #2f3039; // Neutral-99 + 2% Neutral-40 + 11% Primary-80 + --color-surface-4: #34353f; // Neutral-99 + 2% Neutral-40 + 14% Primary-80 + --color-surface-5: #383844; // Neutral-99 + 2% Neutral-40 + 16% Primary-80 + --color-on-surface: var(--color-neutral-10); + --color-surface-variant: var(--color-neutral-variant-90); + --color-on-surface-variant: var(--color-neutral-variant-40); + --color-outline: var(--color-neutral-variant-60); + --color-primary-hover: var(--color-primary-60); + --color-primary-pressed: var(--color-primary-80); + --color-danger-hover: var(--color-error-60); + --color-danger-pressed: var(--color-error-80); + --color-text: var(--color-neutral-10); + --color-text-link: var(--color-primary-40); + --color-text-secondary: var(--color-neutral-50); + --color-placeholder: var(--color-neutral-70); + --color-border: var(--color-neutral-80); + --color-divider: var(--color-neutral-90); + --color-disabled: var(--color-neutral-80); + --color-base: var(--color-surface); + --color-layer-1: var(--color-surface-2); + --color-layer-2: var(--color-surface-4); + --color-float: var(--color-surface-4); + --color-layer-light: var(--color-surface-4); + --color-inverse-surface: var(--color-neutral-20); + --color-inverse-on-surface: var(--color-neutral-95); + --color-inverse-primary: var(--color-primary-80); + --color-shadow: var(--color-all-100); + --color-white: #fff; + --color-button-icon: var(--color-primary-20); + --color-icon-background: #3a3b59; + --color-hover: rgba(247, 248, 248, 8%); // 8% Neutral-10 + --color-pressed: rgba(247, 248, 248, 12%); // 12% Neutral-10 + --color-focused: rgba(247, 248, 248, 16%); // 16% Neutral-10 + --color-hover-variant: rgba(202, 190, 255, 8%); // 8% Primary-40 + --color-pressed-variant: rgba(202, 190, 255, 12%); // 12% Primary-40 + --color-focused-variant: rgba(202, 190, 255, 16%); // 16% Primary-40 + + // Shadows + --shadow-1: 0 4px 8px rgba(0, 0, 0, 8%); + --shadow-2: 0 4px 12px rgba(0, 0, 0, 12%); + --shadow-2-reversed: 0 -4px 12px rgba(0, 0, 0, 12%); + --shadow-3: 0 4px 16px rgba(0, 0, 0, 20%); + + // Client specific variables (not available in design system) + --color-danger-toast-background: var(--color-error-99); + --color-danger-focused: rgba(255, 180, 169, 16%); // 16% Error-40 + --color-tooltip-background: var(--color-surface-4); + --color-tooltip-text: var(--color-neutral-10); + --color-overlay: rgba(0, 0, 0, 30%); + --color-drawer-overlay: rgba(0, 0, 0, 60%); + --color-guide-dropdown-background: var(--color-neutral-variant-80); + --color-guide-dropdown-border: var(--color-neutral-variant-70); + --color-skeleton-shimmer-rgb: 42, 44, 50; // rgb of Layer-1 +} diff --git a/packages/toolkit/core-kit/scss/_fonts.scss b/packages/toolkit/core-kit/scss/_fonts.scss new file mode 100644 index 000000000..0fe903ec7 --- /dev/null +++ b/packages/toolkit/core-kit/scss/_fonts.scss @@ -0,0 +1,32 @@ +$font-family: + -apple-system, + system-ui, + 'BlinkMacSystemFont', + 'Segoe UI', + 'Roboto', + 'Helvetica Neue', + 'Helvetica', + 'Arial', + sans-serif, + 'Apple Color Emoji'; + +:root { + --font-family: #{$font-family}; + --font-headline-large: 600 32px/40px #{$font-family}; + --font-headline-medium: 600 28px/36px #{$font-family}; + --font-headline-small: 600 24px/32px #{$font-family}; + --font-title-large: 600 20px/28px #{$font-family}; + --font-title-medium: 600 16px/24px #{$font-family}; + --font-title-small: 600 14px/20px #{$font-family}; + --font-label-large: 500 14px/20px #{$font-family}; + --font-label-medium: 500 12px/16px #{$font-family}; + --font-label-small: 500 11px/16px #{$font-family}; + --font-body-large: 400 16px/24px #{$font-family}; + --font-body-medium: 400 14px/20px #{$font-family}; + --font-body-small: 400 12px/16px #{$font-family}; + --font-subhead-1: 500 16px/24px #{$font-family}; + --font-subhead-2: 500 14px/20px #{$font-family}; + --font-subhead-cap: 700 12px/16px #{$font-family}; + --font-subhead-cap-small: 700 10px/16px #{$font-family}; + --font-button: 500 14px/20px #{$font-family}; +} diff --git a/packages/toolkit/core-kit/src/index.ts b/packages/toolkit/core-kit/src/index.ts new file mode 100644 index 000000000..524fd4181 --- /dev/null +++ b/packages/toolkit/core-kit/src/index.ts @@ -0,0 +1,3 @@ +export * from './utilities/index.js'; +export * from './regex.js'; +export * from './scope.js'; diff --git a/packages/toolkit/core-kit/src/regex.ts b/packages/toolkit/core-kit/src/regex.ts new file mode 100644 index 000000000..666a86729 --- /dev/null +++ b/packages/toolkit/core-kit/src/regex.ts @@ -0,0 +1,8 @@ +export const emailRegEx = /^\S+@\S+\.\S+$/; +export const phoneRegEx = /^\d+$/; +export const usernameRegEx = /^[A-Z_a-z]\w*$/; +export const passwordRegEx = /^.{6,}$/; +export const webRedirectUriProtocolRegEx = /^https?:$/; +export const mobileUriSchemeProtocolRegEx = /^[a-z][\d_a-z]*(\.[\d_a-z]+)+:$/; +export const hexColorRegEx = /^#[\da-f]{3}([\da-f]{3})?$/i; +export const dateRegex = /^\d{4}(-\d{2}){2}/; diff --git a/packages/toolkit/core-kit/src/scope.ts b/packages/toolkit/core-kit/src/scope.ts new file mode 100644 index 000000000..000ea96f8 --- /dev/null +++ b/packages/toolkit/core-kit/src/scope.ts @@ -0,0 +1,85 @@ +export enum ReservedScope { + OpenId = 'openid', + OfflineAccess = 'offline_access', +} + +export type UserClaim = + | 'name' + | 'picture' + | 'username' + | 'role_names' + | 'email' + | 'email_verified' + | 'phone_number' + | 'phone_number_verified' + | 'custom_data' + | 'identities'; + +/** + * Scopes for ID Token and Userinfo Endpoint. + */ +export enum UserScope { + /** + * Scope for basic user info. + * + * See {@link idTokenClaims} for mapped claims in ID Token and {@link userinfoClaims} for additional claims in Userinfo Endpoint. + */ + Profile = 'profile', + /** + * Scope for user email address. + * + * See {@link idTokenClaims} for mapped claims in ID Token and {@link userinfoClaims} for additional claims in Userinfo Endpoint. + */ + Email = 'email', + /** + * Scope for user phone number. + * + * See {@link idTokenClaims} for mapped claims in ID Token and {@link userinfoClaims} for additional claims in Userinfo Endpoint. + */ + Phone = 'phone', + /** + * Scope for user's custom data. + * + * See {@link idTokenClaims} for mapped claims in ID Token and {@link userinfoClaims} for additional claims in Userinfo Endpoint. + */ + CustomData = 'custom_data', + /** + * Scope for user's social identity details. + * + * See {@link idTokenClaims} for mapped claims in ID Token and {@link userinfoClaims} for additional claims in Userinfo Endpoint. + */ + Identities = 'identities', +} + +/** + * Mapped claims that ID Token includes. + */ +export const idTokenClaims: Readonly> = Object.freeze({ + [UserScope.Profile]: ['name', 'picture', 'username', 'role_names'], + [UserScope.Email]: ['email', 'email_verified'], + [UserScope.Phone]: ['phone_number', 'phone_number_verified'], + [UserScope.CustomData]: [], + [UserScope.Identities]: [], +}); + +/** + * Additional claims that Userinfo Endpoint returns. + */ +export const userinfoClaims: Readonly> = Object.freeze({ + [UserScope.Profile]: [], + [UserScope.Email]: [], + [UserScope.Phone]: [], + [UserScope.CustomData]: ['custom_data'], + [UserScope.Identities]: ['identities'], +}); + +export const userClaims: Readonly> = Object.freeze( + // Hard to infer type directly, use `as` for a workaround. + // eslint-disable-next-line no-restricted-syntax + Object.fromEntries( + Object.values(UserScope).map((current) => [ + current, + [...idTokenClaims[current], ...userinfoClaims[current]], + ]) + ) as Record +); diff --git a/packages/toolkit/core-kit/src/utilities/color.ts b/packages/toolkit/core-kit/src/utilities/color.ts new file mode 100644 index 000000000..0f7136664 --- /dev/null +++ b/packages/toolkit/core-kit/src/utilities/color.ts @@ -0,0 +1,17 @@ +import color from 'color'; + +// Color hsl lighten/darken takes percentage value only, need to implement absolute value update +export const absoluteLighten = (baseColor: color, delta: number) => { + const hslArray = baseColor.hsl().round().array(); + + return color([hslArray[0] ?? 0, hslArray[1] ?? 0, (hslArray[2] ?? 0) + delta], 'hsl'); +}; + +export const absoluteDarken = (baseColor: color, delta: number) => { + const hslArray = baseColor.hsl().round().array(); + + return color([hslArray[0] ?? 0, hslArray[1] ?? 0, (hslArray[2] ?? 0) - delta], 'hsl'); +}; + +export const generateDarkColor = (lightColor: string) => + absoluteLighten(color(lightColor), 10).hex(); diff --git a/packages/toolkit/core-kit/src/utilities/index.ts b/packages/toolkit/core-kit/src/utilities/index.ts new file mode 100644 index 000000000..5cf8bede3 --- /dev/null +++ b/packages/toolkit/core-kit/src/utilities/index.ts @@ -0,0 +1,4 @@ +export * from './color.js'; +export * from './string.js'; +export * from './zod.js'; +export * from './url.js'; diff --git a/packages/toolkit/core-kit/src/utilities/string.test.ts b/packages/toolkit/core-kit/src/utilities/string.test.ts new file mode 100644 index 000000000..f084cf9ab --- /dev/null +++ b/packages/toolkit/core-kit/src/utilities/string.test.ts @@ -0,0 +1,15 @@ +import { generateRandomString } from './string.js'; + +describe('generateRandomString', () => { + it('should return a random string with specified length', () => { + const randomString = generateRandomString(32); + expect(randomString).toHaveLength(32); + }); + + it('should contain only 0-9, A-Z and a-z by default', () => { + const randomString = generateRandomString(32); + expect(() => { + /[\dA-Za-z]/.test(randomString); + }).toBeTruthy(); + }); +}); diff --git a/packages/toolkit/core-kit/src/utilities/string.ts b/packages/toolkit/core-kit/src/utilities/string.ts new file mode 100644 index 000000000..7c0a83ae9 --- /dev/null +++ b/packages/toolkit/core-kit/src/utilities/string.ts @@ -0,0 +1,6 @@ +import { customAlphabet } from 'nanoid'; + +export const generateRandomString = ( + size: number, + alphabet = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz' +): string => customAlphabet(alphabet, size)(); diff --git a/packages/toolkit/core-kit/src/utilities/url.test.ts b/packages/toolkit/core-kit/src/utilities/url.test.ts new file mode 100644 index 000000000..6f4aa588b --- /dev/null +++ b/packages/toolkit/core-kit/src/utilities/url.test.ts @@ -0,0 +1,23 @@ +import { validateRedirectUrl } from './url.js'; + +describe('url utilities', () => { + it('should allow valid redirect URIs', () => { + expect(validateRedirectUrl('http://localhost:3001', 'web')).toBeTruthy(); + expect(validateRedirectUrl('https://logto.dev/callback', 'web')).toBeTruthy(); + expect(validateRedirectUrl('https://my-company.com/callback?test=123', 'web')).toBeTruthy(); + expect(validateRedirectUrl('https://abc.com/callback?test=123#param=hash', 'web')).toBeTruthy(); + expect(validateRedirectUrl('io.logto://my-app/callback', 'mobile')).toBeTruthy(); + expect(validateRedirectUrl('com.company://myDemoApp/callback', 'mobile')).toBeTruthy(); + expect(validateRedirectUrl('com.company://demo:1234', 'mobile')).toBeTruthy(); + }); + + it('should detect invalid redirect URIs', () => { + expect(validateRedirectUrl('io.logto://my-app/callback', 'web')).toBeFalsy(); + expect(validateRedirectUrl('ws://com.company://demo:1234', 'web')).toBeFalsy(); + expect(validateRedirectUrl('abc.com', 'web')).toBeFalsy(); + expect(validateRedirectUrl('abc.com', 'mobile')).toBeFalsy(); + expect(validateRedirectUrl('http://localhost:3001', 'mobile')).toBeFalsy(); + expect(validateRedirectUrl('https://logto.dev/callback', 'mobile')).toBeFalsy(); + expect(validateRedirectUrl('demoApp/callback', 'mobile')).toBeFalsy(); + }); +}); diff --git a/packages/toolkit/core-kit/src/utilities/url.ts b/packages/toolkit/core-kit/src/utilities/url.ts new file mode 100644 index 000000000..100575643 --- /dev/null +++ b/packages/toolkit/core-kit/src/utilities/url.ts @@ -0,0 +1,21 @@ +import { mobileUriSchemeProtocolRegEx, webRedirectUriProtocolRegEx } from '../regex.js'; + +export const validateRedirectUrl = (url: string, type: 'web' | 'mobile') => { + try { + const { protocol } = new URL(url); + const protocolRegEx = + type === 'mobile' ? mobileUriSchemeProtocolRegEx : webRedirectUriProtocolRegEx; + + return protocolRegEx.test(protocol); + } catch { + return false; + } +}; + +export const validateUriOrigin = (url: string) => { + try { + return new URL(url).origin === url; + } catch { + return false; + } +}; diff --git a/packages/toolkit/core-kit/src/utilities/zod.test.ts b/packages/toolkit/core-kit/src/utilities/zod.test.ts new file mode 100644 index 000000000..5c4fb8746 --- /dev/null +++ b/packages/toolkit/core-kit/src/utilities/zod.test.ts @@ -0,0 +1,13 @@ +import { number, ZodError } from 'zod'; + +import { fallback } from './zod.js'; + +describe('fallback', () => { + it('should fallback to default value', () => { + const schema = number(); + const tolerant = schema.or(fallback(-1)); + + expect(() => schema.parse('foo')).toThrow(ZodError); + expect(tolerant.parse('foo')).toBe(-1); + }); +}); diff --git a/packages/toolkit/core-kit/src/utilities/zod.ts b/packages/toolkit/core-kit/src/utilities/zod.ts new file mode 100644 index 000000000..ddcdab684 --- /dev/null +++ b/packages/toolkit/core-kit/src/utilities/zod.ts @@ -0,0 +1,15 @@ +import { any } from 'zod'; + +/** + * https://github.com/colinhacks/zod/issues/316#issuecomment-850906479 + * Create a schema matches anything and returns a value. Use it with `or`: + * + * const schema = zod.number(); + * const tolerant = schema.or(fallback(-1)); + * + * schema.parse('foo') // => ZodError + * tolerant.parse('foo') // -1 + */ +export function fallback(value: T) { + return any().transform(() => value); +} diff --git a/packages/toolkit/core-kit/tsconfig.build.json b/packages/toolkit/core-kit/tsconfig.build.json new file mode 100644 index 000000000..665256ab7 --- /dev/null +++ b/packages/toolkit/core-kit/tsconfig.build.json @@ -0,0 +1,5 @@ +{ + "extends": "./tsconfig", + "include": ["src"], + "exclude": ["src/**/*.test.ts"] +} diff --git a/packages/toolkit/core-kit/tsconfig.json b/packages/toolkit/core-kit/tsconfig.json new file mode 100644 index 000000000..a3439e9fa --- /dev/null +++ b/packages/toolkit/core-kit/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "@silverhand/ts-config/tsconfig.base", + "compilerOptions": { + "outDir": "lib", + "baseUrl": ".", + "moduleResolution": "nodenext", + "module": "esnext" + }, + "include": ["src", "declaration", "jest.config.ts"] +} diff --git a/packages/toolkit/language-kit/CHANGELOG.md b/packages/toolkit/language-kit/CHANGELOG.md new file mode 100644 index 000000000..72468f751 --- /dev/null +++ b/packages/toolkit/language-kit/CHANGELOG.md @@ -0,0 +1,78 @@ +# Change Log + +All notable changes to this project will be documented in this file. +See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +## [1.0.0-beta.29](https://github.com/logto-io/toolkit/compare/v1.0.0-beta.28...v1.0.0-beta.29) (2022-12-07) + + +### Bug Fixes + +* exports info and lock dep version ([#45](https://github.com/logto-io/toolkit/issues/45)) ([2ac83b4](https://github.com/logto-io/toolkit/commit/2ac83b4f0ff17579456569fb67ba018ac493c1af)) + + + +## [1.0.0-beta.28](https://github.com/logto-io/toolkit/compare/v1.0.0-beta.27...v1.0.0-beta.28) (2022-12-06) + +**Note:** Version bump only for package @logto/language-kit + + + + + +## [1.0.0-beta.26](https://github.com/logto-io/toolkit/compare/v1.0.0-beta.25...v1.0.0-beta.26) (2022-11-23) + +**Note:** Version bump only for package @logto/language-kit + + + + + +## [1.0.0-beta.24](https://github.com/logto-io/toolkit/compare/v1.0.0-beta.23...v1.0.0-beta.24) (2022-11-22) + +**Note:** Version bump only for package @logto/language-kit + + + + + +## [1.0.0-beta.21](https://github.com/logto-io/toolkit/compare/v1.0.0-beta.20...v1.0.0-beta.21) (2022-11-11) + +**Note:** Version bump only for package @logto/language-kit + + + + + +## [1.0.0-beta.20](https://github.com/logto-io/toolkit/compare/v1.0.0-beta.19...v1.0.0-beta.20) (2022-10-21) + +**Note:** Version bump only for package @logto/language-kit + + + + + +## [1.0.0-beta.19](https://github.com/logto-io/toolkit/compare/v1.0.0-beta.18...v1.0.0-beta.19) (2022-10-19) + + +### Bug Fixes + +* language tag `jp` ([#28](https://github.com/logto-io/toolkit/issues/28)) ([0f5f6e6](https://github.com/logto-io/toolkit/commit/0f5f6e6a2cd9553e1a78aa7473f56e7631c2efc4)) + + + +## [1.0.0-beta.16](https://github.com/logto-io/toolkit/compare/v1.0.0-beta.15...v1.0.0-beta.16) (2022-09-28) + + +### Bug Fixes + +* **core,language:** avoid using path aliases ([#15](https://github.com/logto-io/toolkit/issues/15)) ([22db3ed](https://github.com/logto-io/toolkit/commit/22db3ed2daf3ee5906ffc864bb9bed1a826df842)) + + + +## [1.0.0-beta.15](https://github.com/logto-io/toolkit/compare/v1.0.0-beta.14...v1.0.0-beta.15) (2022-09-27) + + +### Features + +* **language,core,connector:** init language-kit package ([#14](https://github.com/logto-io/toolkit/issues/14)) ([9a74fc4](https://github.com/logto-io/toolkit/commit/9a74fc4d34c9ce277b8734ab78735549dc3a3cda)) diff --git a/packages/toolkit/language-kit/jest.config.ts b/packages/toolkit/language-kit/jest.config.ts new file mode 100644 index 000000000..8a0c2eca4 --- /dev/null +++ b/packages/toolkit/language-kit/jest.config.ts @@ -0,0 +1,12 @@ +import type { Config } from '@jest/types'; + +const config: Config.InitialOptions = { + preset: 'ts-jest', + moduleNameMapper: { + '^(\\.{1,2}/.*)\\.js$': '$1', + }, + collectCoverageFrom: ['src/**/*.ts'], + coverageReporters: ['lcov', 'text-summary'], +}; + +export default config; diff --git a/packages/toolkit/language-kit/package.json b/packages/toolkit/language-kit/package.json new file mode 100644 index 000000000..3f084f569 --- /dev/null +++ b/packages/toolkit/language-kit/package.json @@ -0,0 +1,61 @@ +{ + "name": "@logto/language-kit", + "version": "1.0.0-beta.29", + "author": "Silverhand Inc. ", + "homepage": "https://github.com/logto-io/toolkit#readme", + "repository": { + "type": "git", + "url": "git+https://github.com/logto-io/toolkit.git" + }, + "license": "MPL-2.0", + "type": "module", + "main": "./lib/index.cjs", + "exports": { + "types": "./lib/index.d.ts", + "import": "./lib/index.js", + "require": "./lib/index.cjs" + }, + "types": "./lib/index.d.ts", + "files": [ + "lib" + ], + "scripts": { + "precommit": "lint-staged", + "build": "rm -rf lib/ && rollup -c && tsc -p tsconfig.build.json", + "lint": "eslint --ext .ts src", + "lint:report": "pnpm lint --format json --output-file report.json", + "prepack": "pnpm build", + "test": "jest", + "test:coverage": "jest --silent --coverage" + }, + "engines": { + "node": "^16.13.0 || ^18.12.0" + }, + "peerDependencies": { + "zod": "^3.19.1" + }, + "devDependencies": { + "@jest/types": "^29.0.3", + "@rollup/plugin-typescript": "^10.0.1", + "@silverhand/eslint-config": "1.3.0", + "@silverhand/ts-config": "1.2.1", + "@types/jest": "^29.0.3", + "@types/node": "^16.3.1", + "eslint": "^8.21.0", + "jest": "^29.0.3", + "lint-staged": "^13.0.0", + "prettier": "^2.7.1", + "rollup": "^3.6.0", + "ts-jest": "^29.0.1", + "tslib": "^2.4.1", + "typescript": "^4.7.4", + "zod": "^3.20.2" + }, + "eslintConfig": { + "extends": "@silverhand" + }, + "prettier": "@silverhand/eslint-config/.prettierrc", + "publishConfig": { + "access": "public" + } +} diff --git a/packages/toolkit/language-kit/rollup.config.js b/packages/toolkit/language-kit/rollup.config.js new file mode 100644 index 000000000..af6ad8d07 --- /dev/null +++ b/packages/toolkit/language-kit/rollup.config.js @@ -0,0 +1,21 @@ +import typescript from '@rollup/plugin-typescript'; + +/** + * @type {import('rollup').RollupOptions} + */ +const configs = [ + { + input: ['src/index.ts'], + output: [ + { + dir: 'lib', + format: 'cjs', + preserveModules: true, + entryFileNames: '[name].cjs', + }, + ], + plugins: [typescript({ tsconfig: 'tsconfig.build.json' })], + }, +]; + +export default configs; diff --git a/packages/toolkit/language-kit/src/const.ts b/packages/toolkit/language-kit/src/const.ts new file mode 100644 index 000000000..c8b926181 --- /dev/null +++ b/packages/toolkit/language-kit/src/const.ts @@ -0,0 +1,125 @@ +export const languages = Object.freeze({ + 'af-ZA': 'Afrikaans', + 'am-ET': 'አማርኛ', + 'ar-AR': 'العربية', + 'as-IN': 'অসমীয়া', + 'az-AZ': 'Azərbaycan dili', + 'be-BY': 'Беларуская', + 'bg-BG': 'Български', + 'bn-IN': 'বাংলা', + 'br-FR': 'Brezhoneg', + 'bs-BA': 'Bosanski', + 'ca-ES': 'Català', + 'cb-IQ': 'کوردیی ناوەندی', + 'co-FR': 'Corsu', + 'cs-CZ': 'Čeština', + 'cx-PH': 'Bisaya', + 'cy-GB': 'Cymraeg', + 'da-DK': 'Dansk', + de: 'Deutsch', + 'de-DE': 'Deutsch (Deutschland)', + 'el-GR': 'Ελληνικά', + en: 'English', + 'en-GB': 'English (UK)', + 'en-US': 'English (US)', + 'eo-EO': 'Esperanto', + es: 'Español', + 'es-ES': 'Español (España)', + 'es-419': 'Español (Latinoamérica)', + 'et-EE': 'Eesti', + 'eu-ES': 'Euskara', + 'fa-IR': 'فارسی', + 'ff-NG': 'Fula', + 'fi-FI': 'Suomi', + 'fo-FO': 'Føroyskt', + fr: 'Français', + 'fr-CA': 'Français (Canada)', + 'fr-FR': 'Français (France)', + 'fy-NL': 'Frysk', + 'ga-IE': 'Gaeilge', + 'gl-ES': 'Galego', + 'gn-PY': 'Guarani', + 'gu-IN': 'ગુજરાતી', + 'ha-NG': 'Hausa', + 'he-IL': 'עברית', + 'hi-IN': 'हिन्दी', + 'hr-HR': 'Hrvatski', + 'ht-HT': 'Kreyòl Ayisyen', + 'hu-HU': 'Magyar', + 'hy-AM': 'Հայերեն', + 'id-ID': 'Bahasa Indonesia', + 'ik-US': 'Iñupiatun', + 'is-IS': 'Íslenska', + it: 'Italiano', + 'it-IT': 'italiano (Italia)', + 'iu-CA': 'Inuktitut', + ja: '日本語', + 'ja-JP': '日本語', + 'ja-KS': '日本語(関西)', + 'jv-ID': 'Basa Jawa', + 'ka-GE': 'ქართული', + 'kk-KZ': 'Қазақша', + 'km-KH': 'ភាសាខ្មែរ', + 'kn-IN': 'ಕನ್ನಡ', + ko: '한국어', + 'ko-KR': '한국어', + 'ku-TR': 'Kurdî (Kurmancî)', + 'ky-KG': 'кыргызча', + 'lo-LA': 'ພາສາລາວ', + 'lt-LT': 'Lietuvių', + 'lv-LV': 'Latviešu', + 'mg-MG': 'Malagasy', + 'mk-MK': 'Македонски', + 'ml-IN': 'മലയാളം', + 'mn-MN': 'Монгол', + 'mr-IN': 'मराठी', + 'ms-MY': 'Bahasa Melayu', + 'mt-MT': 'Malti', + 'my-MM': 'မြန်မာဘာသာ', + 'nb-NO': 'Norsk (bokmål)', + 'ne-NP': 'नेपाली', + 'nl-BE': 'Vlaams', + 'nl-NL': 'Nederlands', + 'nn-NO': 'Norsk (nynorsk)', + 'or-IN': 'ଓଡ଼ିଆ', + 'pa-IN': 'ਪੰਜਾਬੀ', + 'pl-PL': 'Polski', + 'ps-AF': 'پښتو', + pt: 'português', + 'pt-BR': 'Português (Brasil)', + 'pt-PT': 'português (Portugal)', + 'ro-RO': 'Română', + ru: 'Русский', + 'ru-RU': 'Русский', + 'rw-RW': 'Ikinyarwanda', + 'sc-IT': 'Sardu', + 'si-LK': 'සිංහල', + 'sk-SK': 'Slovenčina', + 'sl-SI': 'Slovenščina', + 'sn-ZW': 'Shona', + 'sq-AL': 'Shqip', + 'sr-RS': 'Српски', + 'sv-SE': 'Svenska', + 'sw-KE': 'Kiswahili', + 'sy-SY': 'ܣܘܪܝܝܐ', + 'sz-PL': 'ślōnskŏ gŏdka', + 'ta-IN': 'தமிழ்', + 'te-IN': 'తెలుగు', + 'tg-TJ': 'Тоҷикӣ', + 'th-TH': 'ภาษาไทย', + 'tl-PH': 'Filipino', + tr: 'Türkçe', + 'tr-TR': 'Türkçe', + 'tt-RU': 'Татарча', + 'tz-MA': 'ⵜⴰⵎⴰⵣⵉⵖⵜ', + 'uk-UA': 'Українська', + 'ur-PK': 'اردو', + 'uz-UZ': "O'zbek", + 'vi-VN': 'Tiếng Việt', + zh: '中文', + 'zh-CN': '简体中文', + 'zh-HK': '繁體中文(香港)', + 'zh-MO': '繁體中文(澳門)', + 'zh-TW': '繁體中文(台灣)', + 'zz-TR': 'Zaza', +}); diff --git a/packages/toolkit/language-kit/src/index.ts b/packages/toolkit/language-kit/src/index.ts new file mode 100644 index 000000000..5a666803f --- /dev/null +++ b/packages/toolkit/language-kit/src/index.ts @@ -0,0 +1,3 @@ +export * from './const.js'; +export * from './type.js'; +export * from './utility.js'; diff --git a/packages/toolkit/language-kit/src/type.ts b/packages/toolkit/language-kit/src/type.ts new file mode 100644 index 000000000..7724d3341 --- /dev/null +++ b/packages/toolkit/language-kit/src/type.ts @@ -0,0 +1,3 @@ +import type { languages } from './const.js'; + +export type LanguageTag = keyof typeof languages; diff --git a/packages/toolkit/language-kit/src/utility.test.ts b/packages/toolkit/language-kit/src/utility.test.ts new file mode 100644 index 000000000..b2302e71e --- /dev/null +++ b/packages/toolkit/language-kit/src/utility.test.ts @@ -0,0 +1,27 @@ +import { isLanguageTag, languageTagGuard } from './utility.js'; + +describe('isLanguageTag', () => { + it('should pass when input is a valid language key', () => { + expect(isLanguageTag('en-GB')).toBeTruthy(); + expect(isLanguageTag('zh-CN')).toBeTruthy(); + }); + + it('should fail when input is not a valid language key', () => { + for (const invalidLanguageKey of [undefined, '', 'xx-XX']) { + expect(isLanguageTag(invalidLanguageKey)).toBeFalsy(); + } + }); +}); + +describe('languageTagGuard', () => { + it('should pass when input is a valid language key', () => { + expect(languageTagGuard.safeParse('en-GB').success).toBeTruthy(); + expect(languageTagGuard.safeParse('zh-CN').success).toBeTruthy(); + }); + + it('should fail when input is not a valid language key', () => { + for (const invalidLanguageKey of [undefined, '', 'xx-XX']) { + expect(languageTagGuard.safeParse(invalidLanguageKey).success).toBeFalsy(); + } + }); +}); diff --git a/packages/toolkit/language-kit/src/utility.ts b/packages/toolkit/language-kit/src/utility.ts new file mode 100644 index 000000000..017ccb124 --- /dev/null +++ b/packages/toolkit/language-kit/src/utility.ts @@ -0,0 +1,11 @@ +import { z } from 'zod'; + +import { languages } from './const.js'; +import type { LanguageTag } from './type.js'; + +export const isLanguageTag = (value: unknown): value is LanguageTag => + typeof value === 'string' && value in languages; + +export const languageTagGuard: z.ZodType = z + .any() + .refine((value: unknown) => isLanguageTag(value)); diff --git a/packages/toolkit/language-kit/tsconfig.build.json b/packages/toolkit/language-kit/tsconfig.build.json new file mode 100644 index 000000000..665256ab7 --- /dev/null +++ b/packages/toolkit/language-kit/tsconfig.build.json @@ -0,0 +1,5 @@ +{ + "extends": "./tsconfig", + "include": ["src"], + "exclude": ["src/**/*.test.ts"] +} diff --git a/packages/toolkit/language-kit/tsconfig.json b/packages/toolkit/language-kit/tsconfig.json new file mode 100644 index 000000000..f01468a1d --- /dev/null +++ b/packages/toolkit/language-kit/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "@silverhand/ts-config/tsconfig.base", + "compilerOptions": { + "outDir": "lib", + "baseUrl": ".", + "moduleResolution": "nodenext", + "module": "esnext" + }, + "include": ["src", "jest.config.ts"] +} diff --git a/packages/ui/package.json b/packages/ui/package.json index 12ddbdcbe..f14efd3a2 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -17,8 +17,8 @@ "test": "jest" }, "devDependencies": { - "@logto/core-kit": "1.0.0-beta.28", - "@logto/language-kit": "1.0.0-beta.28", + "@logto/core-kit": "workspace:*", + "@logto/language-kit": "workspace:*", "@logto/phrases": "workspace:*", "@logto/phrases-ui": "workspace:*", "@logto/schemas": "workspace:*", @@ -69,7 +69,7 @@ "superstruct": "^0.16.0", "typescript": "^4.9.4", "use-debounced-loader": "^0.1.1", - "zod": "^3.19.1" + "zod": "^3.20.2" }, "engines": { "node": "^16.13.0 || ^18.12.0" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c2e0698c6..218acb91e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -60,7 +60,7 @@ importers: tar: ^6.1.11 typescript: ^4.9.4 yargs: ^17.6.0 - zod: ^3.19.1 + zod: ^3.20.2 dependencies: '@logto/schemas': link:../schemas '@logto/shared': link:../shared @@ -82,7 +82,7 @@ importers: slonik-sql-tag-raw: 1.1.4_roarr@7.11.0+slonik@30.1.2 tar: 6.1.11 yargs: 17.6.0 - zod: 3.19.1 + zod: 3.20.2 devDependencies: '@silverhand/eslint-config': 1.3.0_eu7dlo3qq5moigliolva3udaxa '@silverhand/ts-config': 1.2.1_typescript@4.9.4 @@ -105,8 +105,8 @@ importers: packages/console: specifiers: '@fontsource/roboto-mono': ^4.5.7 - '@logto/core-kit': 1.0.0-beta.28 - '@logto/language-kit': 1.0.0-beta.28 + '@logto/core-kit': workspace:* + '@logto/language-kit': workspace:* '@logto/phrases': workspace:* '@logto/phrases-ui': workspace:* '@logto/react': 1.0.0-beta.14 @@ -174,11 +174,11 @@ importers: stylelint: ^14.9.1 swr: ^1.3.0 typescript: ^4.9.4 - zod: ^3.19.1 + zod: ^3.20.2 devDependencies: '@fontsource/roboto-mono': 4.5.7 - '@logto/core-kit': 1.0.0-beta.28_zod@3.19.1 - '@logto/language-kit': 1.0.0-beta.28_zod@3.19.1 + '@logto/core-kit': link:../toolkit/core-kit + '@logto/language-kit': link:../toolkit/language-kit '@logto/phrases': link:../phrases '@logto/phrases-ui': link:../phrases-ui '@logto/react': 1.0.0-beta.14_react@18.2.0 @@ -246,14 +246,14 @@ importers: stylelint: 14.9.1 swr: 1.3.0_react@18.2.0 typescript: 4.9.4 - zod: 3.19.1 + zod: 3.20.2 packages/core: specifiers: '@logto/cli': workspace:* - '@logto/connector-kit': 1.0.0-beta.28 - '@logto/core-kit': 1.0.0-beta.28 - '@logto/language-kit': 1.0.0-beta.28 + '@logto/connector-kit': workspace:* + '@logto/core-kit': workspace:* + '@logto/language-kit': workspace:* '@logto/phrases': workspace:* '@logto/phrases-ui': workspace:* '@logto/schemas': workspace:* @@ -324,12 +324,12 @@ importers: snakecase-keys: ^5.4.4 supertest: ^6.2.2 typescript: ^4.9.4 - zod: ^3.19.1 + zod: ^3.20.2 dependencies: '@logto/cli': link:../cli - '@logto/connector-kit': 1.0.0-beta.28_zod@3.19.1 - '@logto/core-kit': 1.0.0-beta.28_zod@3.19.1 - '@logto/language-kit': 1.0.0-beta.28_zod@3.19.1 + '@logto/connector-kit': link:../toolkit/connector-kit + '@logto/core-kit': link:../toolkit/core-kit + '@logto/language-kit': link:../toolkit/language-kit '@logto/phrases': link:../phrases '@logto/phrases-ui': link:../phrases-ui '@logto/schemas': link:../schemas @@ -369,7 +369,7 @@ importers: slonik-sql-tag-raw: 1.1.4_roarr@7.11.0+slonik@30.1.2 snake-case: 3.0.4 snakecase-keys: 5.4.4 - zod: 3.19.1 + zod: 3.20.2 devDependencies: '@silverhand/eslint-config': 1.3.0_eu7dlo3qq5moigliolva3udaxa '@silverhand/ts-config': 1.2.1_typescript@4.9.4 @@ -411,8 +411,8 @@ importers: packages/demo-app: specifiers: - '@logto/core-kit': 1.0.0-beta.28 - '@logto/language-kit': 1.0.0-beta.28 + '@logto/core-kit': workspace:* + '@logto/language-kit': workspace:* '@logto/phrases': workspace:* '@logto/react': 1.0.0-beta.14 '@logto/schemas': workspace:* @@ -437,10 +437,10 @@ importers: react-i18next: ^11.18.3 stylelint: ^14.9.1 typescript: ^4.9.4 - zod: ^3.19.1 + zod: ^3.20.2 devDependencies: - '@logto/core-kit': 1.0.0-beta.28_zod@3.19.1 - '@logto/language-kit': 1.0.0-beta.28_zod@3.19.1 + '@logto/core-kit': link:../toolkit/core-kit + '@logto/language-kit': link:../toolkit/language-kit '@logto/phrases': link:../phrases '@logto/react': 1.0.0-beta.14_react@18.2.0 '@logto/schemas': link:../schemas @@ -465,7 +465,7 @@ importers: react-i18next: 11.18.3_shxxmfhtk2bc4pbx5cyq3uoph4 stylelint: 14.9.1 typescript: 4.9.4 - zod: 3.19.1 + zod: 3.20.2 packages/integration-tests: specifiers: @@ -519,8 +519,8 @@ importers: packages/phrases: specifiers: - '@logto/core-kit': 1.0.0-beta.28 - '@logto/language-kit': 1.0.0-beta.28 + '@logto/core-kit': workspace:* + '@logto/language-kit': workspace:* '@silverhand/eslint-config': 1.3.0 '@silverhand/essentials': ^1.3.0 '@silverhand/ts-config': 1.2.1 @@ -528,12 +528,12 @@ importers: lint-staged: ^13.0.0 prettier: ^2.7.1 typescript: ^4.9.4 - zod: ^3.19.1 + zod: ^3.20.2 dependencies: - '@logto/core-kit': 1.0.0-beta.28_zod@3.19.1 - '@logto/language-kit': 1.0.0-beta.28_zod@3.19.1 + '@logto/core-kit': link:../toolkit/core-kit + '@logto/language-kit': link:../toolkit/language-kit '@silverhand/essentials': 1.3.0 - zod: 3.19.1 + zod: 3.20.2 devDependencies: '@silverhand/eslint-config': 1.3.0_eu7dlo3qq5moigliolva3udaxa '@silverhand/ts-config': 1.2.1_typescript@4.9.4 @@ -544,8 +544,8 @@ importers: packages/phrases-ui: specifiers: - '@logto/core-kit': 1.0.0-beta.28 - '@logto/language-kit': 1.0.0-beta.28 + '@logto/core-kit': workspace:* + '@logto/language-kit': workspace:* '@silverhand/eslint-config': 1.3.0 '@silverhand/essentials': ^1.3.0 '@silverhand/ts-config': 1.2.1 @@ -553,12 +553,12 @@ importers: lint-staged: ^13.0.0 prettier: ^2.7.1 typescript: ^4.9.4 - zod: ^3.19.1 + zod: ^3.20.2 dependencies: - '@logto/core-kit': 1.0.0-beta.28_zod@3.19.1 - '@logto/language-kit': 1.0.0-beta.28_zod@3.19.1 + '@logto/core-kit': link:../toolkit/core-kit + '@logto/language-kit': link:../toolkit/language-kit '@silverhand/essentials': 1.3.0 - zod: 3.19.1 + zod: 3.20.2 devDependencies: '@silverhand/eslint-config': 1.3.0_eu7dlo3qq5moigliolva3udaxa '@silverhand/ts-config': 1.2.1_typescript@4.9.4 @@ -569,9 +569,9 @@ importers: packages/schemas: specifiers: - '@logto/connector-kit': 1.0.0-beta.28 - '@logto/core-kit': 1.0.0-beta.28 - '@logto/language-kit': 1.0.0-beta.28 + '@logto/connector-kit': workspace:* + '@logto/core-kit': workspace:* + '@logto/language-kit': workspace:* '@logto/phrases': workspace:* '@logto/phrases-ui': workspace:* '@silverhand/eslint-config': 1.3.0 @@ -590,14 +590,14 @@ importers: prettier: ^2.7.1 slonik: ^30.0.0 typescript: ^4.9.4 - zod: ^3.19.1 + zod: ^3.20.2 dependencies: - '@logto/connector-kit': 1.0.0-beta.28_zod@3.19.1 - '@logto/core-kit': 1.0.0-beta.28_zod@3.19.1 - '@logto/language-kit': 1.0.0-beta.28_zod@3.19.1 + '@logto/connector-kit': link:../toolkit/connector-kit + '@logto/core-kit': link:../toolkit/core-kit + '@logto/language-kit': link:../toolkit/language-kit '@logto/phrases': link:../phrases '@logto/phrases-ui': link:../phrases-ui - zod: 3.19.1 + zod: 3.20.2 devDependencies: '@silverhand/eslint-config': 1.3.0_eu7dlo3qq5moigliolva3udaxa '@silverhand/essentials': 1.3.0 @@ -649,10 +649,132 @@ importers: prettier: 2.7.1 typescript: 4.9.4 + packages/toolkit/connector-kit: + specifiers: + '@logto/core-kit': workspace:* + '@logto/language-kit': workspace:* + '@rollup/plugin-typescript': ^10.0.1 + '@silverhand/eslint-config': 1.3.0 + '@silverhand/essentials': ^1.2.1 + '@silverhand/ts-config': 1.2.1 + '@types/node': ^16.3.1 + eslint: ^8.21.0 + lint-staged: ^13.0.0 + prettier: ^2.7.1 + rollup: ^3.6.0 + tslib: ^2.4.1 + typescript: ^4.7.4 + zod: ^3.20.2 + dependencies: + '@logto/core-kit': link:../core-kit + '@logto/language-kit': link:../language-kit + '@silverhand/essentials': 1.3.0 + devDependencies: + '@rollup/plugin-typescript': 10.0.1_ksuudmkloucy44p3irodiuckje + '@silverhand/eslint-config': 1.3.0_eu7dlo3qq5moigliolva3udaxa + '@silverhand/ts-config': 1.2.1_typescript@4.9.4 + '@types/node': 16.11.12 + eslint: 8.21.0 + lint-staged: 13.0.0 + prettier: 2.7.1 + rollup: 3.7.4 + tslib: 2.4.1 + typescript: 4.9.4 + zod: 3.20.2 + + packages/toolkit/core-kit: + specifiers: + '@jest/types': ^29.0.3 + '@logto/language-kit': ^1.0.0-beta.29 + '@rollup/plugin-typescript': ^10.0.1 + '@silverhand/eslint-config': 1.3.0 + '@silverhand/eslint-config-react': 1.3.0 + '@silverhand/essentials': ^1.2.1 + '@silverhand/ts-config': 1.2.1 + '@types/color': ^3.0.3 + '@types/jest': ^29.0.3 + '@types/node': ^16.3.1 + '@types/react': ^18.0.20 + color: ^4.2.3 + eslint: ^8.21.0 + jest: ^29.0.3 + jest-matcher-specific-error: ^1.0.0 + lint-staged: ^13.0.0 + nanoid: ^3.1.23 + postcss: ^8.4.6 + prettier: ^2.7.1 + rollup: ^3.6.0 + stylelint: ^14.9.1 + ts-jest: ^29.0.1 + tslib: ^2.4.1 + typescript: ^4.7.4 + zod: ^3.20.2 + dependencies: + '@logto/language-kit': link:../language-kit + color: 4.2.3 + nanoid: 3.3.4 + devDependencies: + '@jest/types': 29.3.1 + '@rollup/plugin-typescript': 10.0.1_ksuudmkloucy44p3irodiuckje + '@silverhand/eslint-config': 1.3.0_eu7dlo3qq5moigliolva3udaxa + '@silverhand/eslint-config-react': 1.3.0_axexeg2s3ejmo2yj7jhkylllwa + '@silverhand/essentials': 1.3.0 + '@silverhand/ts-config': 1.2.1_typescript@4.9.4 + '@types/color': 3.0.3 + '@types/jest': 29.1.2 + '@types/node': 16.11.12 + '@types/react': 18.0.26 + eslint: 8.21.0 + jest: 29.3.1_@types+node@16.11.12 + jest-matcher-specific-error: 1.0.0 + lint-staged: 13.0.0 + postcss: 8.4.18 + prettier: 2.7.1 + rollup: 3.7.4 + stylelint: 14.9.1 + ts-jest: 29.0.3_a67wnu7kur6t3xg6vztzc6sc5i + tslib: 2.4.1 + typescript: 4.9.4 + zod: 3.20.2 + + packages/toolkit/language-kit: + specifiers: + '@jest/types': ^29.0.3 + '@rollup/plugin-typescript': ^10.0.1 + '@silverhand/eslint-config': 1.3.0 + '@silverhand/ts-config': 1.2.1 + '@types/jest': ^29.0.3 + '@types/node': ^16.3.1 + eslint: ^8.21.0 + jest: ^29.0.3 + lint-staged: ^13.0.0 + prettier: ^2.7.1 + rollup: ^3.6.0 + ts-jest: ^29.0.1 + tslib: ^2.4.1 + typescript: ^4.7.4 + zod: ^3.20.2 + devDependencies: + '@jest/types': 29.3.1 + '@rollup/plugin-typescript': 10.0.1_ksuudmkloucy44p3irodiuckje + '@silverhand/eslint-config': 1.3.0_eu7dlo3qq5moigliolva3udaxa + '@silverhand/ts-config': 1.2.1_typescript@4.9.4 + '@types/jest': 29.1.2 + '@types/node': 16.11.12 + eslint: 8.21.0 + jest: 29.3.1_@types+node@16.11.12 + lint-staged: 13.0.0 + prettier: 2.7.1 + rollup: 3.7.4 + ts-jest: 29.0.3_a67wnu7kur6t3xg6vztzc6sc5i + tslib: 2.4.1 + typescript: 4.9.4 + zod: 3.20.2 + packages/ui: specifiers: - '@logto/core-kit': 1.0.0-beta.28 - '@logto/language-kit': 1.0.0-beta.28 + '@logto/core-kit': workspace:* + '@logto/language-kit': workspace:* '@logto/phrases': workspace:* '@logto/phrases-ui': workspace:* '@logto/schemas': workspace:* @@ -703,10 +825,10 @@ importers: superstruct: ^0.16.0 typescript: ^4.9.4 use-debounced-loader: ^0.1.1 - zod: ^3.19.1 + zod: ^3.20.2 devDependencies: - '@logto/core-kit': 1.0.0-beta.28_zod@3.19.1 - '@logto/language-kit': 1.0.0-beta.28_zod@3.19.1 + '@logto/core-kit': link:../toolkit/core-kit + '@logto/language-kit': link:../toolkit/language-kit '@logto/phrases': link:../phrases '@logto/phrases-ui': link:../phrases-ui '@logto/schemas': link:../schemas @@ -757,7 +879,7 @@ importers: superstruct: 0.16.0 typescript: 4.9.4 use-debounced-loader: 0.1.1_react@18.2.0 - zod: 3.19.1 + zod: 3.20.2 packages: @@ -1252,7 +1374,7 @@ packages: engines: {node: '>=6.9.0'} dependencies: core-js-pure: 3.25.5 - regenerator-runtime: 0.13.9 + regenerator-runtime: 0.13.11 dev: true /@babel/runtime/7.17.9: @@ -1784,7 +1906,7 @@ packages: resolution: {integrity: sha512-ujEBCcYs82BTmRxqfHMQggSlkUZP63AE5YEaTPj7eFyJOzukkTorstOUC7L6nE3w5SYadGVAnTsQ/ZjTGL0qYQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/types': 29.2.1 + '@jest/types': 29.3.1 '@types/node': 17.0.23 chalk: 4.1.2 jest-message-util: 29.2.1 @@ -1817,7 +1939,7 @@ packages: '@jest/reporters': 29.1.2 '@jest/test-result': 29.1.2 '@jest/transform': 29.1.2 - '@jest/types': 29.2.1 + '@jest/types': 29.3.1 '@types/node': 17.0.23 ansi-escapes: 4.3.2 chalk: 4.1.2 @@ -1903,7 +2025,7 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/fake-timers': 29.2.2 - '@jest/types': 29.2.1 + '@jest/types': 29.3.1 '@types/node': 17.0.23 jest-mock: 29.2.2 dev: true @@ -1968,7 +2090,7 @@ packages: resolution: {integrity: sha512-nqaW3y2aSyZDl7zQ7t1XogsxeavNpH6kkdq+EpXncIDvAkjvFD7hmhcIs1nWloengEWUoWqkqSA6MSbf9w6DgA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/types': 29.2.1 + '@jest/types': 29.3.1 '@sinonjs/fake-timers': 9.1.2 '@types/node': 17.0.23 jest-message-util: 29.2.1 @@ -1994,7 +2116,7 @@ packages: dependencies: '@jest/environment': 29.2.2 '@jest/expect': 29.1.2 - '@jest/types': 29.2.1 + '@jest/types': 29.3.1 jest-mock: 29.2.2 transitivePeerDependencies: - supports-color @@ -2025,7 +2147,7 @@ packages: '@jest/console': 29.1.2 '@jest/test-result': 29.1.2 '@jest/transform': 29.1.2 - '@jest/types': 29.2.1 + '@jest/types': 29.3.1 '@jridgewell/trace-mapping': 0.3.16 '@types/node': 17.0.23 chalk: 4.1.2 @@ -2117,7 +2239,7 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/console': 29.1.2 - '@jest/types': 29.2.1 + '@jest/types': 29.3.1 '@types/istanbul-lib-coverage': 2.0.4 collect-v8-coverage: 1.0.1 dev: true @@ -2157,7 +2279,7 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@babel/core': 7.19.3 - '@jest/types': 29.2.1 + '@jest/types': 29.3.1 '@jridgewell/trace-mapping': 0.3.16 babel-plugin-istanbul: 6.1.1 chalk: 4.1.2 @@ -2221,18 +2343,6 @@ packages: chalk: 4.1.2 dev: true - /@jest/types/29.2.1: - resolution: {integrity: sha512-O/QNDQODLnINEPAI0cl9U6zUIDXEWXt6IC1o2N2QENuos7hlGUIthlKyV4p6ki3TvXFX071blj8HUhgLGquPjw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - '@jest/schemas': 29.0.0 - '@types/istanbul-lib-coverage': 2.0.4 - '@types/istanbul-reports': 3.0.1 - '@types/node': 17.0.23 - '@types/yargs': 17.0.13 - chalk: 4.1.2 - dev: true - /@jest/types/29.3.1: resolution: {integrity: sha512-d0S0jmmTpjnhCmNpApgX3jrUZgZ22ivKJRvL2lli5hpCRoNnp1f85r2/wpKfXuYu8E7Jjh1hGfhPyup1NM5AmA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -2382,39 +2492,16 @@ packages: lodash.once: 4.1.1 dev: true - /@logto/connector-kit/1.0.0-beta.28_zod@3.19.1: - resolution: {integrity: sha512-f+Hnn84nC6cnu6jwKLDAYo2+rNypHhWhs1NWYQKWVPUtIoLBKircLKGlvVjzEQnXZM6Cnd47X1Zk15IVFhraWA==} - engines: {node: ^16.13.0 || ^18.12.0} - peerDependencies: - zod: ^3.19.1 - dependencies: - '@logto/core-kit': 1.0.0-beta.28_zod@3.19.1 - '@logto/language-kit': 1.0.0-beta.28_zod@3.19.1 - '@silverhand/essentials': 1.3.0 - zod: 3.19.1 - dev: false - /@logto/core-kit/1.0.0-beta.20: resolution: {integrity: sha512-seYvL/aGYRfO4d0FYfKIW/Cu9PnFMRpRM5/oRXwXbcbv+LY1a3TcAX0itrVXeBygIrxiAmWd9DL7CGIWzb48Qg==} engines: {node: ^16.0.0} dependencies: - '@logto/language-kit': 1.0.0-beta.29_zod@3.20.0 + '@logto/language-kit': 1.0.0-beta.29_zod@3.20.2 color: 4.2.3 nanoid: 3.3.4 - zod: 3.20.0 + zod: 3.20.2 dev: true - /@logto/core-kit/1.0.0-beta.28_zod@3.19.1: - resolution: {integrity: sha512-tbT34SupNvk7mriMhBq32KknCEe+qm7LrZBc2E7JDD3FBJmMxyHQCJgdPBlnR+0sXB0uG32NmYwLqG4p9slAPw==} - engines: {node: ^16.13.0 || ^18.12.0} - peerDependencies: - zod: ^3.19.1 - dependencies: - '@logto/language-kit': 1.0.0-beta.28_zod@3.19.1 - color: 4.2.3 - nanoid: 3.3.4 - zod: 3.19.1 - /@logto/js/1.0.0-beta.14: resolution: {integrity: sha512-fMmZHfqkgpArcQxN8+Aj3hMJ+Gpyg7fg+iiyKKw4IOGzG0oe1D7R18EQ/jUTpw87mL4wxKpOOwsDpMgixfgQxQ==} dependencies: @@ -2425,21 +2512,13 @@ packages: lodash.get: 4.4.2 dev: true - /@logto/language-kit/1.0.0-beta.28_zod@3.19.1: - resolution: {integrity: sha512-levNkJ0uiTufnn0r8dLZLdPKgRFiV5mSQ0H04AhpP9dHlm7+1PMRspoi8NjcQqUgemhmcwpP8oCtn4rgW8vpJA==} - engines: {node: ^16.13.0 || ^18.12.0} - peerDependencies: - zod: ^3.19.1 - dependencies: - zod: 3.19.1 - - /@logto/language-kit/1.0.0-beta.29_zod@3.20.0: + /@logto/language-kit/1.0.0-beta.29_zod@3.20.2: resolution: {integrity: sha512-+YeAkawjEq0vwwnqq8RDrDKePWE6x1q2WdpLXtj0H6SQ3GB9pXcYLecjnANHOHB4Zp9Jnxd4eBGogNRWvspikg==} engines: {node: ^16.13.0 || ^18.12.0} peerDependencies: zod: ^3.19.1 dependencies: - zod: 3.20.0 + zod: 3.20.2 dev: true /@logto/node/1.0.0-beta.14: @@ -3367,14 +3446,14 @@ packages: '@types/asn1js': 2.0.2 asn1js: 2.3.2 pvtsutils: 1.2.2 - tslib: 2.3.1 + tslib: 2.4.1 dev: true /@peculiar/json-schema/1.1.12: resolution: {integrity: sha512-coUfuoMeIB7B8/NMekxaDzLhaYmp0HZNPEjYRm9goRou8UZIC3z21s0sL9AWoCw4EG876QyO3kYrc61WNF9B/w==} engines: {node: '>=8.0.0'} dependencies: - tslib: 2.3.1 + tslib: 2.4.1 dev: true /@peculiar/webcrypto/1.3.3: @@ -3397,7 +3476,7 @@ packages: open: 8.4.0 picocolors: 1.0.0 tiny-glob: 0.2.9 - tslib: 2.4.0 + tslib: 2.4.1 dev: true /@react-dnd/asap/5.0.0: @@ -3412,6 +3491,41 @@ packages: resolution: {integrity: sha512-Yykovind6xzqAqd0t5umrdAGPlGLTE80cy80UkEnbt8Zv5zEYTFzJSNPQ81TY8BSpRreubu1oE54iHBv2UVnTQ==} dev: true + /@rollup/plugin-typescript/10.0.1_ksuudmkloucy44p3irodiuckje: + resolution: {integrity: sha512-wBykxRLlX7EzL8BmUqMqk5zpx2onnmRMSw/l9M1sVfkJvdwfxogZQVNUM9gVMJbjRLDR5H6U0OMOrlDGmIV45A==} + engines: {node: '>=14.0.0'} + peerDependencies: + rollup: ^2.14.0||^3.0.0 + tslib: '*' + typescript: '>=3.7.0' + peerDependenciesMeta: + rollup: + optional: true + tslib: + optional: true + dependencies: + '@rollup/pluginutils': 5.0.2_rollup@3.7.4 + resolve: 1.22.1 + rollup: 3.7.4 + tslib: 2.4.1 + typescript: 4.9.4 + dev: true + + /@rollup/pluginutils/5.0.2_rollup@3.7.4: + resolution: {integrity: sha512-pTd9rIsP92h+B6wWwFbW8RkZv4hiR/xKsqre4SIuAOaOEQRxi0lqLke9k2/7WegC85GgUs9pjmOjCUi3In4vwA==} + engines: {node: '>=14.0.0'} + peerDependencies: + rollup: ^1.20.0||^2.0.0||^3.0.0 + peerDependenciesMeta: + rollup: + optional: true + dependencies: + '@types/estree': 1.0.0 + estree-walker: 2.0.2 + picomatch: 2.3.1 + rollup: 3.7.4 + dev: true + /@sideway/address/4.1.4: resolution: {integrity: sha512-7vwq+rOHVWjyXxVlR76Agnvhy8I9rpzjosTESvmhNeXOXdZZB15Fl+TI9x1SiHZH5Jv2wTGduSxFDIaq0m3DUw==} dependencies: @@ -3426,6 +3540,28 @@ packages: resolution: {integrity: sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ==} dev: true + /@silverhand/eslint-config-react/1.3.0_axexeg2s3ejmo2yj7jhkylllwa: + resolution: {integrity: sha512-L6tzayeKo1RXTadIHbZKUJWzi5Pu0tjg6eoTw5mz+3FTLu4zBXK0+/jK6FeHwQ3lWt8Cj3HDIMvVG97yjoblPA==} + engines: {node: ^16.0.0 || ^18.0.0} + peerDependencies: + stylelint: ^14.9.1 + dependencies: + '@silverhand/eslint-config': 1.3.0_eu7dlo3qq5moigliolva3udaxa + eslint-config-xo-react: 0.27.0_nlhz3yu2pbp43ngjgjnh6mfwge + eslint-plugin-jsx-a11y: 6.6.1_eslint@8.21.0 + eslint-plugin-react: 7.31.10_eslint@8.21.0 + eslint-plugin-react-hooks: 4.6.0_eslint@8.21.0 + stylelint: 14.9.1 + stylelint-config-xo-scss: 0.15.0_tbxkegwovyw2ffmso5mcdjcnyu + transitivePeerDependencies: + - eslint + - eslint-import-resolver-webpack + - postcss + - prettier + - supports-color + - typescript + dev: true + /@silverhand/eslint-config-react/1.3.0_hwxyoluj7tfktess7f4itjwcee: resolution: {integrity: sha512-L6tzayeKo1RXTadIHbZKUJWzi5Pu0tjg6eoTw5mz+3FTLu4zBXK0+/jK6FeHwQ3lWt8Cj3HDIMvVG97yjoblPA==} engines: {node: ^16.0.0 || ^18.0.0} @@ -3528,13 +3664,13 @@ packages: peerDependencies: jest: ^29.0.0 || ^29.1.2 dependencies: - '@jest/types': 29.1.2 + '@jest/types': 29.3.1 deepmerge: 4.2.2 identity-obj-proxy: 3.0.0 jest: 29.1.2 jest-matcher-specific-error: 1.0.0 jest-transform-stub: 2.0.0 - ts-jest: 29.0.3_5xcodqox2j6ogkdcajmxw2vjdu + ts-jest: 29.0.3_h5yo4o4jl7fzim4gycvvdmdsqu transitivePeerDependencies: - '@babel/core' - babel-jest @@ -3934,6 +4070,10 @@ packages: '@types/ms': 0.7.31 dev: true + /@types/estree/1.0.0: + resolution: {integrity: sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ==} + dev: true + /@types/etag/1.8.1: resolution: {integrity: sha512-bsKkeSqN7HYyYntFRAmzcwx/dKW4Wa+KVMTInANlI72PWLQmOpZu96j0OqHZGArW4VQwCmJPteQlXaUDeOB0WQ==} dependencies: @@ -4241,7 +4381,7 @@ packages: resolution: {integrity: sha512-ELEYRUie2czuJzaZ5+ziIp9Hhw+juEw8b7C11YNA4QdLCVbQ3qLi2l4aq8XnlqM7V31LZX8dxUuFUCrzHm6sqQ==} dependencies: '@types/history': 4.7.9 - '@types/react': 18.0.15 + '@types/react': 18.0.26 '@types/react-router': 5.1.17 dev: true @@ -4249,7 +4389,7 @@ packages: resolution: {integrity: sha512-RNSXOyb3VyRs/EOGmjBhhGKTbnN6fHWvy5FNLzWfOWOGjgVUKqJZXfpKzLmgoU8h6Hj8mpALj/mbXQASOb92wQ==} dependencies: '@types/history': 4.7.11 - '@types/react': 18.0.15 + '@types/react': 18.0.26 dev: true /@types/react-syntax-highlighter/15.5.1: @@ -4266,6 +4406,14 @@ packages: csstype: 3.0.11 dev: true + /@types/react/18.0.26: + resolution: {integrity: sha512-hCR3PJQsAIXyxhTNSiDFY//LhnMZWpNNr5etoCqx/iUfGc5gXWtQR2Phl908jVR6uPXacojQWTg4qRpkxTuGug==} + dependencies: + '@types/prop-types': 15.7.4 + '@types/scheduler': 0.16.2 + csstype: 3.0.11 + dev: true + /@types/responselike/1.0.0: resolution: {integrity: sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA==} dependencies: @@ -6193,7 +6341,7 @@ packages: resolution: {integrity: sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==} dependencies: no-case: 3.0.4 - tslib: 2.4.0 + tslib: 2.4.1 /dot-prop/5.3.0: resolution: {integrity: sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==} @@ -6862,6 +7010,10 @@ packages: engines: {node: '>=4.0'} dev: true + /estree-walker/2.0.2: + resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} + dev: true + /esutils/2.0.3: resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} engines: {node: '>=0.10.0'} @@ -7593,6 +7745,7 @@ packages: /graceful-fs/4.2.10: resolution: {integrity: sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==} + dev: true /graceful-fs/4.2.9: resolution: {integrity: sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==} @@ -8586,7 +8739,7 @@ packages: '@jest/environment': 29.2.2 '@jest/expect': 29.1.2 '@jest/test-result': 29.1.2 - '@jest/types': 29.2.1 + '@jest/types': 29.3.1 '@types/node': 17.0.23 chalk: 4.1.2 co: 4.6.0 @@ -8597,7 +8750,7 @@ packages: jest-message-util: 29.2.1 jest-runtime: 29.1.2 jest-snapshot: 29.1.2 - jest-util: 29.2.1 + jest-util: 29.3.1 p-limit: 3.1.0 pretty-format: 29.2.1 slash: 3.0.0 @@ -8645,7 +8798,7 @@ packages: dependencies: '@jest/core': 29.1.2 '@jest/test-result': 29.1.2 - '@jest/types': 29.2.1 + '@jest/types': 29.3.1 chalk: 4.1.2 exit: 0.1.2 graceful-fs: 4.2.10 @@ -8673,7 +8826,7 @@ packages: dependencies: '@jest/core': 29.1.2 '@jest/test-result': 29.1.2 - '@jest/types': 29.2.1 + '@jest/types': 29.3.1 chalk: 4.1.2 exit: 0.1.2 graceful-fs: 4.2.10 @@ -8731,7 +8884,7 @@ packages: dependencies: '@babel/core': 7.19.3 '@jest/test-sequencer': 29.1.2 - '@jest/types': 29.2.1 + '@jest/types': 29.3.1 babel-jest: 29.1.2_@babel+core@7.19.3 chalk: 4.1.2 ci-info: 3.5.0 @@ -8769,7 +8922,7 @@ packages: dependencies: '@babel/core': 7.19.3 '@jest/test-sequencer': 29.1.2 - '@jest/types': 29.2.1 + '@jest/types': 29.3.1 '@types/node': 16.11.12 babel-jest: 29.1.2_@babel+core@7.19.3 chalk: 4.1.2 @@ -8808,7 +8961,7 @@ packages: dependencies: '@babel/core': 7.19.3 '@jest/test-sequencer': 29.1.2 - '@jest/types': 29.2.1 + '@jest/types': 29.3.1 '@types/node': 17.0.23 babel-jest: 29.1.2_@babel+core@7.19.3 chalk: 4.1.2 @@ -8964,10 +9117,10 @@ packages: resolution: {integrity: sha512-AmTQp9b2etNeEwMyr4jc0Ql/LIX/dhbgP21gHAizya2X6rUspHn2gysMXaj6iwWuOJ2sYRgP8c1P4cXswgvS1A==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/types': 29.2.1 + '@jest/types': 29.3.1 chalk: 4.1.2 jest-get-type: 29.0.0 - jest-util: 29.2.1 + jest-util: 29.3.1 pretty-format: 29.2.1 dev: true @@ -8993,7 +9146,7 @@ packages: dependencies: '@jest/environment': 29.2.2 '@jest/fake-timers': 29.2.2 - '@jest/types': 29.2.1 + '@jest/types': 29.3.1 '@types/jsdom': 20.0.0 '@types/node': 17.0.23 jest-mock: 29.2.2 @@ -9023,10 +9176,10 @@ packages: dependencies: '@jest/environment': 29.2.2 '@jest/fake-timers': 29.2.2 - '@jest/types': 29.2.1 + '@jest/types': 29.3.1 '@types/node': 17.0.23 jest-mock: 29.2.2 - jest-util: 29.2.1 + jest-util: 29.3.1 dev: true /jest-environment-node/29.3.1: @@ -9068,7 +9221,7 @@ packages: resolution: {integrity: sha512-xSjbY8/BF11Jh3hGSPfYTa/qBFrm3TPM7WU8pU93m2gqzORVLkHFWvuZmFsTEBPRKndfewXhMOuzJNHyJIZGsw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/types': 29.2.1 + '@jest/types': 29.3.1 '@types/graceful-fs': 4.1.5 '@types/node': 17.0.23 anymatch: 3.1.2 @@ -9162,7 +9315,7 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@babel/code-frame': 7.18.6 - '@jest/types': 29.2.1 + '@jest/types': 29.3.1 '@types/stack-utils': 2.0.1 chalk: 4.1.2 graceful-fs: 4.2.10 @@ -9177,7 +9330,7 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@babel/code-frame': 7.18.6 - '@jest/types': 29.2.1 + '@jest/types': 29.3.1 '@types/stack-utils': 2.0.1 chalk: 4.1.2 graceful-fs: 4.2.10 @@ -9214,7 +9367,7 @@ packages: resolution: {integrity: sha512-1leySQxNAnivvbcx0sCB37itu8f4OX2S/+gxLAV4Z62shT4r4dTG9tACDywUAEZoLSr36aYUTsVp3WKwWt4PMQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/types': 29.2.1 + '@jest/types': 29.3.1 '@types/node': 17.0.23 jest-util: 29.2.1 dev: true @@ -9333,7 +9486,7 @@ packages: '@jest/environment': 29.2.2 '@jest/test-result': 29.1.2 '@jest/transform': 29.1.2 - '@jest/types': 29.2.1 + '@jest/types': 29.3.1 '@types/node': 17.0.23 chalk: 4.1.2 emittery: 0.10.2 @@ -9393,7 +9546,7 @@ packages: '@jest/source-map': 29.0.0 '@jest/test-result': 29.1.2 '@jest/transform': 29.1.2 - '@jest/types': 29.2.1 + '@jest/types': 29.3.1 '@types/node': 17.0.23 chalk: 4.1.2 cjs-module-lexer: 1.2.2 @@ -9455,7 +9608,7 @@ packages: '@babel/types': 7.19.4 '@jest/expect-utils': 29.1.2 '@jest/transform': 29.1.2 - '@jest/types': 29.2.1 + '@jest/types': 29.3.1 '@types/babel__traverse': 7.18.2 '@types/prettier': 2.7.1 babel-preset-current-node-syntax: 1.0.1_@babel+core@7.19.3 @@ -9537,7 +9690,7 @@ packages: resolution: {integrity: sha512-P5VWDj25r7kj7kl4pN2rG/RN2c1TLfYYYZYULnS/35nFDjBai+hBeo3MDrYZS7p6IoY3YHZnt2vq4L6mKnLk0g==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/types': 29.2.1 + '@jest/types': 29.3.1 '@types/node': 17.0.23 chalk: 4.1.2 ci-info: 3.5.0 @@ -9561,7 +9714,7 @@ packages: resolution: {integrity: sha512-k71pOslNlV8fVyI+mEySy2pq9KdXdgZtm7NHrBX8LghJayc3wWZH0Yr0mtYNGaCU4F1OLPXRkwZR0dBm/ClshA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/types': 29.2.1 + '@jest/types': 29.3.1 camelcase: 6.3.0 chalk: 4.1.2 jest-get-type: 29.0.0 @@ -9586,7 +9739,7 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/test-result': 29.1.2 - '@jest/types': 29.2.1 + '@jest/types': 29.3.1 '@types/node': 17.0.23 ansi-escapes: 4.3.2 chalk: 4.1.2 @@ -9614,7 +9767,7 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@types/node': 17.0.23 - jest-util: 29.2.1 + jest-util: 29.3.1 merge-stream: 2.0.0 supports-color: 8.1.1 dev: true @@ -9835,7 +9988,7 @@ packages: dependencies: universalify: 2.0.0 optionalDependencies: - graceful-fs: 4.2.10 + graceful-fs: 4.2.9 /jsonparse/1.3.1: resolution: {integrity: sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==} @@ -10352,7 +10505,7 @@ packages: /lower-case/2.0.2: resolution: {integrity: sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==} dependencies: - tslib: 2.4.0 + tslib: 2.4.1 /lowercase-keys/1.0.1: resolution: {integrity: sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==} @@ -11106,7 +11259,7 @@ packages: resolution: {integrity: sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==} dependencies: lower-case: 2.0.2 - tslib: 2.4.0 + tslib: 2.4.1 /node-addon-api/3.2.1: resolution: {integrity: sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==} @@ -12001,6 +12154,15 @@ packages: postcss: 8.4.14 dev: true + /postcss-scss/4.0.5_postcss@8.4.18: + resolution: {integrity: sha512-F7xpB6TrXyqUh3GKdyB4Gkp3QL3DDW1+uI+gxx/oJnUt/qXI4trj5OGlp9rOKdoABGULuqtqeG+3HEVQk4DjmA==} + engines: {node: '>=12.0'} + peerDependencies: + postcss: ^8.3.3 + dependencies: + postcss: 8.4.18 + dev: true + /postcss-scss/4.0.5_postcss@8.4.6: resolution: {integrity: sha512-F7xpB6TrXyqUh3GKdyB4Gkp3QL3DDW1+uI+gxx/oJnUt/qXI4trj5OGlp9rOKdoABGULuqtqeG+3HEVQk4DjmA==} engines: {node: '>=12.0'} @@ -12339,7 +12501,7 @@ packages: /pvtsutils/1.2.2: resolution: {integrity: sha512-OALo5ZEdqiI127i64+CXwkCOyFHUA+tCQgaUO/MvRDFXWPr53f2sx28ECNztUEzuyu5xvuuD1EB/szg9mwJoGA==} dependencies: - tslib: 2.3.1 + tslib: 2.4.1 dev: true /pvutils/1.1.3: @@ -13103,6 +13265,14 @@ packages: globalthis: 1.0.2 semver-compare: 1.0.0 + /rollup/3.7.4: + resolution: {integrity: sha512-jN9rx3k5pfg9H9al0r0y1EYKSeiRANZRYX32SuNXAnKzh6cVyf4LZVto1KAuDnbHT03E1CpsgqDKaqQ8FZtgxw==} + engines: {node: '>=14.18.0', npm: '>=8.0.0'} + hasBin: true + optionalDependencies: + fsevents: 2.3.2 + dev: true + /run-async/2.4.1: resolution: {integrity: sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==} engines: {node: '>=0.12.0'} @@ -13117,7 +13287,7 @@ packages: /rxjs/7.5.5: resolution: {integrity: sha512-sy+H0pQofO95VDmFLzyaw9xNJU4KTRSwQIGM6+iG3SypAtCiLDzpeG8sJrNCWn2Up9km+KhkvTdbkrdy+yzZdw==} dependencies: - tslib: 2.4.0 + tslib: 2.4.1 /sade/1.8.1: resolution: {integrity: sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==} @@ -13807,6 +13977,20 @@ packages: - postcss dev: true + /stylelint-config-xo-scss/0.15.0_tbxkegwovyw2ffmso5mcdjcnyu: + resolution: {integrity: sha512-X9WD8cDofWFWy3uaKdwwm+DjEvgI/+h7AtlaPagkhNAeOWH/GFQoeciBvNvyJ8tB1p00SoIzCn2IIOIKXCbxYA==} + engines: {node: '>=12'} + peerDependencies: + stylelint: '>=14.5.1' + dependencies: + postcss-scss: 4.0.5_postcss@8.4.18 + stylelint: 14.9.1 + stylelint-config-xo: 0.21.1_stylelint@14.9.1 + stylelint-scss: 4.3.0_stylelint@14.9.1 + transitivePeerDependencies: + - postcss + dev: true + /stylelint-config-xo-scss/0.15.0_uyk3cwxn3favstz4untq233szu: resolution: {integrity: sha512-X9WD8cDofWFWy3uaKdwwm+DjEvgI/+h7AtlaPagkhNAeOWH/GFQoeciBvNvyJ8tB1p00SoIzCn2IIOIKXCbxYA==} engines: {node: '>=12'} @@ -14024,7 +14208,7 @@ packages: engines: {node: ^14.18.0 || >=16.0.0} dependencies: '@pkgr/utils': 2.3.1 - tslib: 2.4.0 + tslib: 2.4.1 dev: true /table/5.4.6: @@ -14247,7 +14431,7 @@ packages: resolution: {integrity: sha512-AqTiAOLcj85xS7vQ8QkAV41hPDIJ71XJB4RCUrzo/1GM2CQwhkJGaf9Hgr7BOugMRpgGUrqRg/DrBDl4H40+8g==} dev: true - /ts-jest/29.0.3_5xcodqox2j6ogkdcajmxw2vjdu: + /ts-jest/29.0.3_a67wnu7kur6t3xg6vztzc6sc5i: resolution: {integrity: sha512-Ibygvmuyq1qp/z3yTh9QTwVVAbFdDy/+4BtIQR2sp6baF2SJU/8CKK/hhnGIDY2L90Az2jIqTwZPnN2p+BweiQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true @@ -14268,11 +14452,45 @@ packages: esbuild: optional: true dependencies: - '@jest/types': 29.1.2 + '@jest/types': 29.3.1 + bs-logger: 0.2.6 + fast-json-stable-stringify: 2.1.0 + jest: 29.3.1_@types+node@16.11.12 + jest-util: 29.3.1 + json5: 2.2.1 + lodash.memoize: 4.1.2 + make-error: 1.3.6 + semver: 7.3.8 + typescript: 4.9.4 + yargs-parser: 21.1.1 + dev: true + + /ts-jest/29.0.3_h5yo4o4jl7fzim4gycvvdmdsqu: + resolution: {integrity: sha512-Ibygvmuyq1qp/z3yTh9QTwVVAbFdDy/+4BtIQR2sp6baF2SJU/8CKK/hhnGIDY2L90Az2jIqTwZPnN2p+BweiQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + hasBin: true + peerDependencies: + '@babel/core': '>=7.0.0-beta.0 <8' + '@jest/types': ^29.0.0 + babel-jest: ^29.0.0 + esbuild: '*' + jest: ^29.0.0 || ^29.1.2 + typescript: '>=4.3' + peerDependenciesMeta: + '@babel/core': + optional: true + '@jest/types': + optional: true + babel-jest: + optional: true + esbuild: + optional: true + dependencies: + '@jest/types': 29.3.1 bs-logger: 0.2.6 fast-json-stable-stringify: 2.1.0 jest: 29.1.2 - jest-util: 29.2.1 + jest-util: 29.3.1 json5: 2.2.1 lodash.memoize: 4.1.2 make-error: 1.3.6 @@ -14334,7 +14552,6 @@ packages: /tslib/2.4.1: resolution: {integrity: sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==} - dev: true /tsscmp/1.0.6: resolution: {integrity: sha512-LxhtAkPDTkVCMQjt2h6eBVY28KCjikZqZfMcC15YBeNjkgUpdCfBu5HoiOTDu86v6smE8yOjyEktJ8hlbANHQA==} @@ -14815,7 +15032,7 @@ packages: '@peculiar/json-schema': 1.1.12 asn1js: 2.3.2 pvtsutils: 1.2.2 - tslib: 2.3.1 + tslib: 2.4.1 dev: true /webidl-conversions/3.0.1: @@ -15099,12 +15316,8 @@ packages: engines: {node: '>=12.20'} dev: false - /zod/3.19.1: - resolution: {integrity: sha512-LYjZsEDhCdYET9ikFu6dVPGp2YH9DegXjdJToSzD9rO6fy4qiRYFoyEYwps88OseJlPyl2NOe2iJuhEhL7IpEA==} - - /zod/3.20.0: - resolution: {integrity: sha512-ZWxs7oM5ixoo1BMoxTNeDMYSih/F/FUnExsnRtHT04rG6q0Bd74TKS45RGXw07TOalOZyyzdKaYH38k8yTEv9A==} - dev: true + /zod/3.20.2: + resolution: {integrity: sha512-1MzNQdAvO+54H+EaK5YpyEy0T+Ejo/7YLHS93G3RnYWh5gaotGHwGeN/ZO687qEDU2y4CdStQYXVHIgrUl5UVQ==} /zwitch/1.0.5: resolution: {integrity: sha512-V50KMwwzqJV0NpZIZFwfOD5/lyny3WlSzRiXgA0G7VUnRlqttta1L6UQIHzd6EuBY/cHGfwTIck7w1yH6Q5zUw==} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 18ec407ef..9aa378857 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,2 +1,3 @@ packages: - - 'packages/*' + - packages/* + - packages/toolkit/*