diff --git a/packages/cli/package.json b/packages/cli/package.json index 65a11df42..59ae30eed 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -37,7 +37,7 @@ "dependencies": { "@logto/schemas": "^1.0.0-beta.10", "@logto/shared": "^1.0.0-beta.10", - "@silverhand/essentials": "^1.2.1", + "@silverhand/essentials": "^1.3.0", "chalk": "^4.1.2", "decamelize": "^5.0.0", "dotenv": "^16.0.0", diff --git a/packages/cli/src/commands/database/config.ts b/packages/cli/src/commands/database/config.ts index 2133cace2..5b089cea7 100644 --- a/packages/cli/src/commands/database/config.ts +++ b/packages/cli/src/commands/database/config.ts @@ -1,10 +1,11 @@ import { logtoConfigGuards, LogtoConfigKey, logtoConfigKeys } from '@logto/schemas'; +import { deduplicate } from '@silverhand/essentials'; import chalk from 'chalk'; import { CommandModule } from 'yargs'; import { createPoolFromEnv } from '../../database'; import { getRowsByKeys, updateValueByKey } from '../../queries/logto-config'; -import { deduplicate, log } from '../../utilities'; +import { log } from '../../utilities'; const validKeysDisplay = chalk.green(logtoConfigKeys.join(', ')); diff --git a/packages/cli/src/commands/database/index.ts b/packages/cli/src/commands/database/index.ts index 96e8f5ba0..265e559e8 100644 --- a/packages/cli/src/commands/database/index.ts +++ b/packages/cli/src/commands/database/index.ts @@ -1,6 +1,6 @@ +import { noop } from '@silverhand/essentials'; import { CommandModule } from 'yargs'; -import { noop } from '../../utilities'; import alteration from './alteration'; import { getConfig, setConfig } from './config'; import seed from './seed'; diff --git a/packages/cli/src/utilities.ts b/packages/cli/src/utilities.ts index 67d665f1c..9f715abe5 100644 --- a/packages/cli/src/utilities.ts +++ b/packages/cli/src/utilities.ts @@ -151,10 +151,3 @@ export const getCliConfig = async ({ key, readableKey, comments, defaultValue }: return value; }; - -// TODO: Move to `@silverhand/essentials` -// Intended -// eslint-disable-next-line @typescript-eslint/no-empty-function -export const noop = () => {}; - -export const deduplicate = (array: T[]) => [...new Set(array)]; diff --git a/packages/console/package.json b/packages/console/package.json index eb828fc6b..9a87ef900 100644 --- a/packages/console/package.json +++ b/packages/console/package.json @@ -31,7 +31,7 @@ "@parcel/transformer-svg-react": "2.7.0", "@silverhand/eslint-config": "1.0.0", "@silverhand/eslint-config-react": "1.1.0", - "@silverhand/essentials": "^1.2.1", + "@silverhand/essentials": "^1.3.0", "@silverhand/ts-config": "1.0.0", "@silverhand/ts-config-react": "1.0.0", "@tsconfig/docusaurus": "^1.0.5", diff --git a/packages/core/package.json b/packages/core/package.json index fc6b65688..8a2063361 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -31,7 +31,7 @@ "@logto/phrases-ui": "^1.0.0-beta.10", "@logto/schemas": "^1.0.0-beta.10", "@logto/shared": "^1.0.0-beta.10", - "@silverhand/essentials": "^1.2.1", + "@silverhand/essentials": "^1.3.0", "chalk": "^4", "clean-deep": "^3.4.0", "dayjs": "^1.10.5", diff --git a/packages/integration-tests/package.json b/packages/integration-tests/package.json index 880b9fc24..5e5122d91 100644 --- a/packages/integration-tests/package.json +++ b/packages/integration-tests/package.json @@ -19,7 +19,7 @@ "@logto/schemas": "^1.0.0-beta.10", "@peculiar/webcrypto": "^1.3.3", "@silverhand/eslint-config": "1.0.0", - "@silverhand/essentials": "^1.2.1", + "@silverhand/essentials": "^1.3.0", "@silverhand/jest-config": "1.0.0", "@silverhand/ts-config": "1.0.0", "@types/jest": "^28.1.6", diff --git a/packages/phrases-ui/package.json b/packages/phrases-ui/package.json index 8ad494b43..729013dcf 100644 --- a/packages/phrases-ui/package.json +++ b/packages/phrases-ui/package.json @@ -31,7 +31,7 @@ "dependencies": { "@logto/core-kit": "1.0.0-beta.16", "@logto/language-kit": "1.0.0-beta.16", - "@silverhand/essentials": "^1.2.1", + "@silverhand/essentials": "^1.3.0", "zod": "^3.18.0" }, "devDependencies": { diff --git a/packages/phrases/package.json b/packages/phrases/package.json index f9afa5a41..26c03703d 100644 --- a/packages/phrases/package.json +++ b/packages/phrases/package.json @@ -31,7 +31,7 @@ "dependencies": { "@logto/core-kit": "1.0.0-beta.16", "@logto/language-kit": "1.0.0-beta.15", - "@silverhand/essentials": "^1.2.1", + "@silverhand/essentials": "^1.3.0", "zod": "^3.18.0" }, "devDependencies": { diff --git a/packages/schemas/package.json b/packages/schemas/package.json index acb8e1359..d063da10d 100644 --- a/packages/schemas/package.json +++ b/packages/schemas/package.json @@ -27,7 +27,7 @@ }, "devDependencies": { "@silverhand/eslint-config": "1.0.0", - "@silverhand/essentials": "^1.2.1", + "@silverhand/essentials": "^1.3.0", "@silverhand/jest-config": "1.0.0", "@silverhand/ts-config": "1.0.0", "@types/jest": "^28.0.0", diff --git a/packages/shared/package.json b/packages/shared/package.json index 8e6c54bfd..ffd488c60 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -40,7 +40,7 @@ "prettier": "@silverhand/eslint-config/.prettierrc", "dependencies": { "@logto/schemas": "^1.0.0-beta.10", - "@silverhand/essentials": "^1.2.1", + "@silverhand/essentials": "^1.3.0", "dayjs": "^1.10.5", "nanoid": "^3.3.4", "slonik": "^30.0.0" diff --git a/packages/ui/package.json b/packages/ui/package.json index 14f75ee44..764b2c598 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -25,7 +25,7 @@ "@peculiar/webcrypto": "^1.3.3", "@silverhand/eslint-config": "1.0.0", "@silverhand/eslint-config-react": "1.1.0", - "@silverhand/essentials": "^1.2.1", + "@silverhand/essentials": "^1.3.0", "@silverhand/jest-config": "1.0.0", "@silverhand/ts-config": "1.0.0", "@silverhand/ts-config-react": "1.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3f5e24c60..9f2d307fe 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -23,7 +23,7 @@ importers: '@logto/schemas': ^1.0.0-beta.10 '@logto/shared': ^1.0.0-beta.10 '@silverhand/eslint-config': 1.0.0 - '@silverhand/essentials': ^1.2.1 + '@silverhand/essentials': ^1.3.0 '@silverhand/jest-config': 1.0.0 '@silverhand/ts-config': 1.0.0 '@types/decompress': ^4.2.4 @@ -62,7 +62,7 @@ importers: dependencies: '@logto/schemas': link:../schemas '@logto/shared': link:../shared - '@silverhand/essentials': 1.2.1 + '@silverhand/essentials': 1.3.0 chalk: 4.1.2 decamelize: 5.0.1 dotenv: 16.0.0 @@ -117,7 +117,7 @@ importers: '@parcel/transformer-svg-react': 2.7.0 '@silverhand/eslint-config': 1.0.0 '@silverhand/eslint-config-react': 1.1.0 - '@silverhand/essentials': ^1.2.1 + '@silverhand/essentials': ^1.3.0 '@silverhand/ts-config': 1.0.0 '@silverhand/ts-config-react': 1.0.0 '@tsconfig/docusaurus': ^1.0.5 @@ -184,7 +184,7 @@ importers: '@parcel/transformer-svg-react': 2.7.0_@parcel+core@2.7.0 '@silverhand/eslint-config': 1.0.0_swk2g7ygmfleszo5c33j4vooni '@silverhand/eslint-config-react': 1.1.0_3jdvf2aalbcoibv3m53iflhmym - '@silverhand/essentials': 1.2.1 + '@silverhand/essentials': 1.3.0 '@silverhand/ts-config': 1.0.0_typescript@4.7.4 '@silverhand/ts-config-react': 1.0.0_typescript@4.7.4 '@tsconfig/docusaurus': 1.0.5 @@ -249,7 +249,7 @@ importers: '@logto/shared': ^1.0.0-beta.10 '@shopify/jest-koa-mocks': ^5.0.0 '@silverhand/eslint-config': 1.0.0 - '@silverhand/essentials': ^1.2.1 + '@silverhand/essentials': ^1.3.0 '@silverhand/jest-config': 1.0.0 '@silverhand/ts-config': 1.0.0 '@types/debug': ^4.1.7 @@ -330,7 +330,7 @@ importers: '@logto/phrases-ui': link:../phrases-ui '@logto/schemas': link:../schemas '@logto/shared': link:../shared - '@silverhand/essentials': 1.2.1 + '@silverhand/essentials': 1.3.0 chalk: 4.1.2 clean-deep: 3.4.0 dayjs: 1.10.7 @@ -469,7 +469,7 @@ importers: '@logto/schemas': ^1.0.0-beta.10 '@peculiar/webcrypto': ^1.3.3 '@silverhand/eslint-config': 1.0.0 - '@silverhand/essentials': ^1.2.1 + '@silverhand/essentials': ^1.3.0 '@silverhand/jest-config': 1.0.0 '@silverhand/ts-config': 1.0.0 '@types/jest': ^28.1.6 @@ -494,7 +494,7 @@ importers: '@logto/schemas': link:../schemas '@peculiar/webcrypto': 1.3.3 '@silverhand/eslint-config': 1.0.0_swk2g7ygmfleszo5c33j4vooni - '@silverhand/essentials': 1.2.1 + '@silverhand/essentials': 1.3.0 '@silverhand/jest-config': 1.0.0_bi2kohzqnxavgozw3csgny5hju '@silverhand/ts-config': 1.0.0_typescript@4.7.4 '@types/jest': 28.1.6 @@ -519,7 +519,7 @@ importers: '@logto/core-kit': 1.0.0-beta.16 '@logto/language-kit': 1.0.0-beta.15 '@silverhand/eslint-config': 1.0.0 - '@silverhand/essentials': ^1.2.1 + '@silverhand/essentials': ^1.3.0 '@silverhand/ts-config': 1.0.0 eslint: ^8.21.0 lint-staged: ^13.0.0 @@ -529,7 +529,7 @@ importers: dependencies: '@logto/core-kit': 1.0.0-beta.16 '@logto/language-kit': 1.0.0-beta.15 - '@silverhand/essentials': 1.2.1 + '@silverhand/essentials': 1.3.0 zod: 3.18.0 devDependencies: '@silverhand/eslint-config': 1.0.0_swk2g7ygmfleszo5c33j4vooni @@ -544,7 +544,7 @@ importers: '@logto/core-kit': 1.0.0-beta.16 '@logto/language-kit': 1.0.0-beta.16 '@silverhand/eslint-config': 1.0.0 - '@silverhand/essentials': ^1.2.1 + '@silverhand/essentials': ^1.3.0 '@silverhand/ts-config': 1.0.0 eslint: ^8.21.0 lint-staged: ^13.0.0 @@ -554,7 +554,7 @@ importers: dependencies: '@logto/core-kit': 1.0.0-beta.16 '@logto/language-kit': 1.0.0-beta.16 - '@silverhand/essentials': 1.2.1 + '@silverhand/essentials': 1.3.0 zod: 3.18.0 devDependencies: '@silverhand/eslint-config': 1.0.0_swk2g7ygmfleszo5c33j4vooni @@ -572,7 +572,7 @@ importers: '@logto/phrases': ^1.0.0-beta.10 '@logto/phrases-ui': ^1.0.0-beta.10 '@silverhand/eslint-config': 1.0.0 - '@silverhand/essentials': ^1.2.1 + '@silverhand/essentials': ^1.3.0 '@silverhand/jest-config': 1.0.0 '@silverhand/ts-config': 1.0.0 '@types/jest': ^28.0.0 @@ -599,7 +599,7 @@ importers: zod: 3.18.0 devDependencies: '@silverhand/eslint-config': 1.0.0_swk2g7ygmfleszo5c33j4vooni - '@silverhand/essentials': 1.2.1 + '@silverhand/essentials': 1.3.0 '@silverhand/jest-config': 1.0.0_bi2kohzqnxavgozw3csgny5hju '@silverhand/ts-config': 1.0.0_typescript@4.7.4 '@types/jest': 28.1.6 @@ -621,7 +621,7 @@ importers: specifiers: '@logto/schemas': ^1.0.0-beta.10 '@silverhand/eslint-config': 1.0.0 - '@silverhand/essentials': ^1.2.1 + '@silverhand/essentials': ^1.3.0 '@silverhand/jest-config': 1.0.0 '@silverhand/ts-config': 1.0.0 '@types/jest': ^29.1.2 @@ -635,7 +635,7 @@ importers: typescript: ^4.7.4 dependencies: '@logto/schemas': link:../schemas - '@silverhand/essentials': 1.2.1 + '@silverhand/essentials': 1.3.0 dayjs: 1.10.7 nanoid: 3.3.4 slonik: 30.1.2 @@ -662,7 +662,7 @@ importers: '@peculiar/webcrypto': ^1.3.3 '@silverhand/eslint-config': 1.0.0 '@silverhand/eslint-config-react': 1.1.0 - '@silverhand/essentials': ^1.2.1 + '@silverhand/essentials': ^1.3.0 '@silverhand/jest-config': 1.0.0 '@silverhand/ts-config': 1.0.0 '@silverhand/ts-config-react': 1.0.0 @@ -716,7 +716,7 @@ importers: '@peculiar/webcrypto': 1.3.3 '@silverhand/eslint-config': 1.0.0_swk2g7ygmfleszo5c33j4vooni '@silverhand/eslint-config-react': 1.1.0_3jdvf2aalbcoibv3m53iflhmym - '@silverhand/essentials': 1.2.1 + '@silverhand/essentials': 1.3.0 '@silverhand/jest-config': 1.0.0_bi2kohzqnxavgozw3csgny5hju '@silverhand/ts-config': 1.0.0_typescript@4.7.4 '@silverhand/ts-config-react': 1.0.0_typescript@4.7.4 @@ -2600,7 +2600,7 @@ packages: resolution: {integrity: sha512-PaTtd4f5FBdwd5N4F5ByHh/+LrlqKYh951g47xdEzKdNn47HQAecxhXuvg8hYZXCopaWv73/7bsJgAoivhNM4Q==} dependencies: '@logto/client': 1.0.0-beta.8 - '@silverhand/essentials': 1.2.1 + '@silverhand/essentials': 1.3.0 js-base64: 3.7.2 dev: true @@ -2609,7 +2609,7 @@ packages: dependencies: '@logto/core-kit': 1.0.0-beta.14 '@logto/js': 1.0.0-beta.8 - '@silverhand/essentials': 1.2.1 + '@silverhand/essentials': 1.3.0 camelcase-keys: 7.0.2 jose: 4.6.0 lodash.get: 4.4.2 @@ -2621,7 +2621,7 @@ packages: engines: {node: ^16.0.0} dependencies: '@logto/core-kit': 1.0.0-beta.16 - '@silverhand/essentials': 1.2.1 + '@silverhand/essentials': 1.3.0 zod: 3.18.0 dev: false @@ -2655,7 +2655,7 @@ packages: resolution: {integrity: sha512-Xo63sYZHnoFV+UTCtxRvGk+RuC3yJ3aDEpVDqShSZyfqY0xwGU5naIWHQXOd4koqkAQtp613AdL0qsEshrSl7Q==} dependencies: '@logto/core-kit': 1.0.0-beta.14 - '@silverhand/essentials': 1.2.1 + '@silverhand/essentials': 1.3.0 camelcase-keys: 7.0.2 jose: 4.6.0 lodash.get: 4.4.2 @@ -2678,7 +2678,7 @@ packages: resolution: {integrity: sha512-IsQeFGhycUyX1R3/DiODK/nL2tsZaoeITKgqeJP68jiJnO51wPT9ewlFnJ656l/4bCA791oH71WTeeSvKJ8L2w==} dependencies: '@logto/client': 1.0.0-beta.8 - '@silverhand/essentials': 1.2.1 + '@silverhand/essentials': 1.3.0 js-base64: 3.7.2 node-fetch: 2.6.7 transitivePeerDependencies: @@ -2691,7 +2691,7 @@ packages: react: '>=16.8.0 || ^18.0.0' dependencies: '@logto/browser': 1.0.0-beta.8 - '@silverhand/essentials': 1.2.1 + '@silverhand/essentials': 1.3.0 react: 18.2.0 dev: true @@ -4050,8 +4050,8 @@ packages: lodash: 4.17.21 dev: true - /@silverhand/essentials/1.2.1: - resolution: {integrity: sha512-4wOM/yYEbcDH6Nwv/PdPjH+kbw8ixqGGVpD+CaWf+ay8+fYtmdNnr5aheqBwLV1ipHAjpXoh9x6Bqm9x68bGfA==} + /@silverhand/essentials/1.3.0: + resolution: {integrity: sha512-o3cAqwLkKxmv+HCEQfNMpyxrdmv+9Tz69WXB/P2LdzS2ggU6tcOXbxkCMv8K6b0UnGN/PckQSykM7pHnDZZN6w==} engines: {node: '>=14.15.0', pnpm: '>=6'} dependencies: lodash.orderby: 4.6.0