From 1d1e6e3244fd3a4459a911aa1827c27f38e4121e Mon Sep 17 00:00:00 2001 From: Gao Sun Date: Sun, 11 Dec 2022 20:07:21 +0800 Subject: [PATCH 1/4] test: update to native ESM (batch 1) --- packages/cli/package.json | 7 ++++--- packages/cli/tsconfig.json | 3 +-- packages/core/package.json | 2 +- packages/core/tsconfig.json | 3 +-- packages/schemas/jest.config.js | 10 ++++++++++ packages/schemas/jest.config.ts | 16 ---------------- packages/schemas/package.json | 10 +++++----- packages/schemas/tsconfig.build.gen.json | 4 ++++ packages/schemas/tsconfig.json | 3 +-- packages/schemas/tsconfig.test.json | 7 ++++++- packages/shared/jest.config.js | 10 ++++++++++ packages/shared/jest.config.ts | 15 --------------- packages/shared/package.json | 7 ++++--- packages/shared/tsconfig.json | 3 +-- pnpm-lock.yaml | 8 +------- 15 files changed, 49 insertions(+), 59 deletions(-) create mode 100644 packages/schemas/jest.config.js delete mode 100644 packages/schemas/jest.config.ts create mode 100644 packages/schemas/tsconfig.build.gen.json create mode 100644 packages/shared/jest.config.js delete mode 100644 packages/shared/jest.config.ts diff --git a/packages/cli/package.json b/packages/cli/package.json index 6ddca2849..fb7843be7 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -25,13 +25,14 @@ "precommit": "lint-staged", "prepare:package-json": "node -p \"'export const packageJson = ' + JSON.stringify(require('./package.json'), undefined, 2) + ';'\" > src/package-json.ts", "build": "rimraf lib && pnpm prepare:package-json && tsc -p tsconfig.build.json", - "build:test": "rm -rf build/ && tsc -p tsconfig.test.json --sourcemap", + "build:test": "rm -rf lib/ && tsc -p tsconfig.test.json --sourcemap", "dev": "tsc -p tsconfig.build.json --watch --preserveWatchOutput --incremental", "start": "node .", - "start:dev": "ts-node --files src/index.ts", + "start:dev": "pnpm build && node .", "lint": "eslint --ext .ts src", "lint:report": "pnpm lint --format json --output-file report.json", - "test": "pnpm build:test && NODE_OPTIONS=--experimental-vm-modules jest", + "test:only": "NODE_OPTIONS=--experimental-vm-modules jest", + "test": "pnpm build:test && pnpm test:only", "test:ci": "pnpm run test", "prepack": "pnpm build" }, diff --git a/packages/cli/tsconfig.json b/packages/cli/tsconfig.json index 8378efdc2..d706f486e 100644 --- a/packages/cli/tsconfig.json +++ b/packages/cli/tsconfig.json @@ -9,8 +9,7 @@ "types": ["node", "jest"] }, "include": [ - "src", - "jest.*.ts" + "src" ], "exclude": ["**/alteration-scripts"] } diff --git a/packages/core/package.json b/packages/core/package.json index 23ab9455a..298275bde 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -20,7 +20,7 @@ "dev": "rm -rf build/ && pnpm run copyfiles && nodemon", "start": "NODE_ENV=production node build/index.js", "test:only": "NODE_OPTIONS=--experimental-vm-modules jest", - "test": "pnpm build:test && pnpm test:only build/", + "test": "pnpm build:test && pnpm test:only", "test:ci": "pnpm run test --coverage --silent", "test:report": "codecov -F core" }, diff --git a/packages/core/tsconfig.json b/packages/core/tsconfig.json index 64517c9bb..2796b3926 100644 --- a/packages/core/tsconfig.json +++ b/packages/core/tsconfig.json @@ -8,7 +8,6 @@ ] }, "include": [ - "src", - "jest.*.ts" + "src" ] } diff --git a/packages/schemas/jest.config.js b/packages/schemas/jest.config.js new file mode 100644 index 000000000..652de5472 --- /dev/null +++ b/packages/schemas/jest.config.js @@ -0,0 +1,10 @@ +const config = { + coveragePathIgnorePatterns: ['/node_modules/', '/src/__mocks__/'], + coverageReporters: ['text-summary', 'lcov'], + roots: ['./lib'], + moduleNameMapper: { + '^(chalk|inquirer)$': '/../shared/lib/esm/module-proxy.js', + }, +}; + +export default config; diff --git a/packages/schemas/jest.config.ts b/packages/schemas/jest.config.ts deleted file mode 100644 index e5f84f9f6..000000000 --- a/packages/schemas/jest.config.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { Config } from '@silverhand/jest-config'; -import { merge } from '@silverhand/jest-config'; - -const config: Config.InitialOptions = { - ...merge({ - // Will update common config soon - transformIgnorePatterns: ['node_modules/(?!(.*(nanoid|jose|ky|@logto))/)'], - moduleNameMapper: { - '^(\\.{1,2}/.*)\\.js$': '$1', - }, - }), - // Will update common config soon - transformIgnorePatterns: ['node_modules/(?!(.*(nanoid|jose|ky|@logto))/)'], -}; - -export default config; diff --git a/packages/schemas/package.json b/packages/schemas/package.json index 9fead7017..8ccf7a232 100644 --- a/packages/schemas/package.json +++ b/packages/schemas/package.json @@ -17,15 +17,17 @@ "scripts": { "precommit": "lint-staged", "version": "./update-next.sh && git add alterations/", - "generate": "rm -rf src/db-entries && ts-node-esm src/gen/index.ts && eslint \"src/db-entries/**\" --fix", + "generate": "rm -rf src/db-entries && tsc -p tsconfig.build.gen.json && node lib/src/gen/index.js && eslint \"src/db-entries/**\" --fix", "build:alterations": "rm -rf alterations-js && tsc -p tsconfig.build.alterations.json", "build": "pnpm generate && rm -rf lib/ && tsc -p tsconfig.build.json && pnpm build:alterations", + "build:test": "rm -rf lib/ && tsc -p tsconfig.test.json --sourcemap", "dev": "tsc -p tsconfig.build.json --watch --preserveWatchOutput --incremental", "lint": "eslint --ext .ts src", "lint:report": "pnpm lint --format json --output-file report.json", "prepack": "pnpm build", - "test": "jest", - "test:ci": "jest" + "test:only": "NODE_OPTIONS=--experimental-vm-modules jest", + "test": "pnpm build:test && pnpm test:only", + "test:ci": "pnpm run test" }, "engines": { "node": "^16.13.0 || ^18.12.0" @@ -33,7 +35,6 @@ "devDependencies": { "@silverhand/eslint-config": "1.3.0", "@silverhand/essentials": "^1.3.0", - "@silverhand/jest-config": "1.2.2", "@silverhand/ts-config": "1.2.1", "@types/jest": "^29.1.2", "@types/lodash.uniq": "^4.5.6", @@ -47,7 +48,6 @@ "pluralize": "^8.0.0", "prettier": "^2.7.1", "slonik": "^30.0.0", - "ts-node": "^10.9.1", "typescript": "^4.7.4" }, "eslintConfig": { diff --git a/packages/schemas/tsconfig.build.gen.json b/packages/schemas/tsconfig.build.gen.json new file mode 100644 index 000000000..eeed8fa29 --- /dev/null +++ b/packages/schemas/tsconfig.build.gen.json @@ -0,0 +1,4 @@ +{ + "extends": "./tsconfig", + "include": ["src/gen"] +} diff --git a/packages/schemas/tsconfig.json b/packages/schemas/tsconfig.json index bf5e57cc9..f07ef0259 100644 --- a/packages/schemas/tsconfig.json +++ b/packages/schemas/tsconfig.json @@ -8,7 +8,6 @@ }, "include": [ "src", - "alterations", - "jest.config.ts" + "alterations" ] } diff --git a/packages/schemas/tsconfig.test.json b/packages/schemas/tsconfig.test.json index 1c66acf6d..55de18c33 100644 --- a/packages/schemas/tsconfig.test.json +++ b/packages/schemas/tsconfig.test.json @@ -1,3 +1,8 @@ { - "extends": "./tsconfig" + "extends": "./tsconfig", + "compilerOptions": { + "isolatedModules": false, + "allowJs": true + }, + "include": ["src"] } diff --git a/packages/shared/jest.config.js b/packages/shared/jest.config.js new file mode 100644 index 000000000..652de5472 --- /dev/null +++ b/packages/shared/jest.config.js @@ -0,0 +1,10 @@ +const config = { + coveragePathIgnorePatterns: ['/node_modules/', '/src/__mocks__/'], + coverageReporters: ['text-summary', 'lcov'], + roots: ['./lib'], + moduleNameMapper: { + '^(chalk|inquirer)$': '/../shared/lib/esm/module-proxy.js', + }, +}; + +export default config; diff --git a/packages/shared/jest.config.ts b/packages/shared/jest.config.ts deleted file mode 100644 index 97b9c20ae..000000000 --- a/packages/shared/jest.config.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { Config } from '@silverhand/jest-config'; -import { merge } from '@silverhand/jest-config'; - -const config: Config.InitialOptions = { - ...merge({ - roots: ['./src'], - moduleNameMapper: { - '^(\\.{1,2}/.*)\\.js$': '$1', - }, - }), - // Will update common config soon - transformIgnorePatterns: ['node_modules/(?!(.*(nanoid|jose|ky|@logto))/)'], -}; - -export default config; diff --git a/packages/shared/package.json b/packages/shared/package.json index 5548c608c..740cf8aea 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -22,16 +22,17 @@ "scripts": { "precommit": "lint-staged", "build": "rm -rf lib/ && tsc -p tsconfig.build.json", + "build:test": "rm -rf lib/ && tsc -p tsconfig.test.json --sourcemap", "dev": "tsc -p tsconfig.build.json --watch --preserveWatchOutput --incremental", "lint": "eslint --ext .ts src", "lint:report": "pnpm lint --format json --output-file report.json", "prepack": "pnpm build", - "test": "jest", - "test:ci": "jest" + "test:only": "NODE_OPTIONS=--experimental-vm-modules jest", + "test": "pnpm build:test && pnpm test:only", + "test:ci": "pnpm run test" }, "devDependencies": { "@silverhand/eslint-config": "1.3.0", - "@silverhand/jest-config": "1.2.2", "@silverhand/ts-config": "1.2.1", "@types/jest": "^29.1.2", "@types/node": "^16.0.0", diff --git a/packages/shared/tsconfig.json b/packages/shared/tsconfig.json index 3bccdbc71..fd9fd4d6f 100644 --- a/packages/shared/tsconfig.json +++ b/packages/shared/tsconfig.json @@ -8,7 +8,6 @@ "module": "es2022" }, "include": [ - "src", - "jest.config.ts" + "src" ] } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7d4883e22..6e86483aa 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -580,7 +580,6 @@ importers: '@logto/phrases-ui': workspace:* '@silverhand/eslint-config': 1.3.0 '@silverhand/essentials': ^1.3.0 - '@silverhand/jest-config': 1.2.2 '@silverhand/ts-config': 1.2.1 '@types/jest': ^29.1.2 '@types/lodash.uniq': ^4.5.6 @@ -594,7 +593,6 @@ importers: pluralize: ^8.0.0 prettier: ^2.7.1 slonik: ^30.0.0 - ts-node: ^10.9.1 typescript: ^4.7.4 zod: ^3.19.1 dependencies: @@ -607,7 +605,6 @@ importers: devDependencies: '@silverhand/eslint-config': 1.3.0_swk2g7ygmfleszo5c33j4vooni '@silverhand/essentials': 1.3.0 - '@silverhand/jest-config': 1.2.2_zapogttls25djihwjkusccjjym '@silverhand/ts-config': 1.2.1_typescript@4.7.4 '@types/jest': 29.1.2 '@types/lodash.uniq': 4.5.6 @@ -615,13 +612,12 @@ importers: '@types/pluralize': 0.0.29 camelcase: 7.0.0 eslint: 8.21.0 - jest: 29.1.2_k5ytkvaprncdyzidqqws5bqksq + jest: 29.1.2_@types+node@16.11.12 lint-staged: 13.0.0 lodash.uniq: 4.5.0 pluralize: 8.0.0 prettier: 2.7.1 slonik: 30.1.2 - ts-node: 10.9.1_ccwudyfw5se7hgalwgkzhn2yp4 typescript: 4.7.4 packages/shared: @@ -629,7 +625,6 @@ importers: '@logto/schemas': workspace:* '@silverhand/eslint-config': 1.3.0 '@silverhand/essentials': ^1.3.0 - '@silverhand/jest-config': 1.2.2 '@silverhand/ts-config': 1.2.1 '@types/jest': ^29.1.2 '@types/node': ^16.0.0 @@ -649,7 +644,6 @@ importers: slonik: 30.1.2 devDependencies: '@silverhand/eslint-config': 1.3.0_swk2g7ygmfleszo5c33j4vooni - '@silverhand/jest-config': 1.2.2_zapogttls25djihwjkusccjjym '@silverhand/ts-config': 1.2.1_typescript@4.7.4 '@types/jest': 29.1.2 '@types/node': 16.11.12 From 51647cf4ca9d9f3c51e3b32bd67123786a70f85e Mon Sep 17 00:00:00 2001 From: Gao Sun Date: Mon, 12 Dec 2022 21:15:09 +0800 Subject: [PATCH 2/4] test: update to native ESM (batch 2) --- package.json | 2 +- packages/cli/package.json | 2 +- packages/console/package.json | 2 +- packages/core/package.json | 2 +- packages/core/tsconfig.base.json | 6 +- packages/demo-app/package.json | 2 +- packages/integration-tests/jest.config.js | 12 + packages/integration-tests/jest.config.ts | 12 - packages/integration-tests/jest.config.ui.js | 10 + packages/integration-tests/jest.config.ui.ts | 12 - packages/integration-tests/jest.setup.js | 4 +- packages/integration-tests/package.json | 16 +- .../integration-tests/src/api/admin-user.ts | 2 +- packages/integration-tests/src/api/api.ts | 4 +- .../integration-tests/src/api/application.ts | 2 +- .../integration-tests/src/api/connector.ts | 2 +- .../integration-tests/src/api/dashboard.ts | 2 +- packages/integration-tests/src/api/index.ts | 22 +- packages/integration-tests/src/api/logs.ts | 2 +- packages/integration-tests/src/api/me.ts | 2 +- .../integration-tests/src/api/resource.ts | 4 +- packages/integration-tests/src/api/session.ts | 2 +- .../src/api/sign-in-experience.ts | 2 +- .../integration-tests/src/api/wellknown.ts | 2 +- .../integration-tests/src/client/index.ts | 12 +- packages/integration-tests/src/constants.ts | 4 +- packages/integration-tests/src/helpers.ts | 6 +- .../include.d/openapi-schema-validator.d.ts | 32 ++ .../{ => src}/tests/api/admin-user.test.ts | 6 +- .../{ => src}/tests/api/application.test.ts | 2 +- .../{ => src}/tests/api/connector.test.ts | 4 +- .../{ => src}/tests/api/dashboard.test.ts | 10 +- .../tests/api/get-access-token.test.ts | 10 +- .../{ => src}/tests/api/health-check.test.ts | 2 +- .../{ => src}/tests/api/logs.test.ts | 8 +- .../{ => src}/tests/api/resource.test.ts | 4 +- .../{ => src}/tests/api/session.test.ts | 12 +- .../tests/api/sign-in-experience.test.ts | 2 +- .../tests/api/social-session.test.ts | 12 +- .../{ => src}/tests/api/swagger-check.test.ts | 6 +- .../{ => src}/tests/api/wellknown.test.ts | 6 +- .../{ => src}/tests/ui/smoke.test.ts | 2 +- packages/integration-tests/tsconfig.json | 8 +- packages/phrases-ui/package.json | 2 +- packages/phrases/package.json | 2 +- packages/schemas/generate.sh | 7 + packages/schemas/package.json | 4 +- packages/shared/package.json | 2 +- packages/ui/package.json | 2 +- pnpm-lock.yaml | 487 ++++++------------ 50 files changed, 339 insertions(+), 445 deletions(-) create mode 100644 packages/integration-tests/jest.config.js delete mode 100644 packages/integration-tests/jest.config.ts create mode 100644 packages/integration-tests/jest.config.ui.js delete mode 100644 packages/integration-tests/jest.config.ui.ts create mode 100644 packages/integration-tests/src/include.d/openapi-schema-validator.d.ts rename packages/integration-tests/{ => src}/tests/api/admin-user.test.ts (94%) rename packages/integration-tests/{ => src}/tests/api/application.test.ts (97%) rename packages/integration-tests/{ => src}/tests/api/connector.test.ts (98%) rename packages/integration-tests/{ => src}/tests/api/dashboard.test.ts (89%) rename packages/integration-tests/{ => src}/tests/api/get-access-token.test.ts (89%) rename packages/integration-tests/{ => src}/tests/api/health-check.test.ts (80%) rename packages/integration-tests/{ => src}/tests/api/logs.test.ts (77%) rename packages/integration-tests/{ => src}/tests/api/resource.test.ts (97%) rename packages/integration-tests/{ => src}/tests/api/session.test.ts (97%) rename packages/integration-tests/{ => src}/tests/api/sign-in-experience.test.ts (92%) rename packages/integration-tests/{ => src}/tests/api/social-session.test.ts (93%) rename packages/integration-tests/{ => src}/tests/api/swagger-check.test.ts (80%) rename packages/integration-tests/{ => src}/tests/api/wellknown.test.ts (88%) rename packages/integration-tests/{ => src}/tests/ui/smoke.test.ts (81%) create mode 100755 packages/schemas/generate.sh diff --git a/package.json b/package.json index de3801af8..c1f418579 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "@commitlint/config-conventional": "^17.0.0", "@commitlint/types": "^17.0.0", "husky": "^8.0.0", - "typescript": "^4.7.4" + "typescript": "^4.9.4" }, "workspaces": { "packages": [ diff --git a/packages/cli/package.json b/packages/cli/package.json index fb7843be7..4829c6544 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -82,7 +82,7 @@ "prettier": "^2.7.1", "rimraf": "^3.0.2", "sinon": "^15.0.0", - "typescript": "^4.7.4" + "typescript": "^4.9.4" }, "eslintConfig": { "extends": "@silverhand", diff --git a/packages/console/package.json b/packages/console/package.json index f9f675097..89488b028 100644 --- a/packages/console/package.json +++ b/packages/console/package.json @@ -87,7 +87,7 @@ "snake-case": "^3.0.4", "stylelint": "^14.9.1", "swr": "^1.3.0", - "typescript": "^4.7.4", + "typescript": "^4.9.4", "zod": "^3.19.1" }, "engines": { diff --git a/packages/core/package.json b/packages/core/package.json index 298275bde..adc7260d9 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -101,7 +101,7 @@ "prettier": "^2.7.1", "sinon": "^15.0.0", "supertest": "^6.2.2", - "typescript": "^4.9.3" + "typescript": "^4.9.4" }, "engines": { "node": "^16.13.0 || ^18.12.0" diff --git a/packages/core/tsconfig.base.json b/packages/core/tsconfig.base.json index 890550d0c..75db7efcc 100644 --- a/packages/core/tsconfig.base.json +++ b/packages/core/tsconfig.base.json @@ -1,6 +1,8 @@ { "extends": "@silverhand/ts-config/tsconfig.base", "compilerOptions": { + "moduleResolution": "nodenext", + "module": "es2022", "declaration": false, "outDir": "build", "baseUrl": ".", @@ -8,8 +10,6 @@ "#src/*": [ "src/*" ] - }, - "moduleResolution": "nodenext", - "module": "es2022" + } } } diff --git a/packages/demo-app/package.json b/packages/demo-app/package.json index 2c5194f11..58104384a 100644 --- a/packages/demo-app/package.json +++ b/packages/demo-app/package.json @@ -41,7 +41,7 @@ "react-dom": "^18.0.0", "react-i18next": "^11.18.3", "stylelint": "^14.9.1", - "typescript": "^4.7.4", + "typescript": "^4.9.4", "zod": "^3.19.1" }, "engines": { diff --git a/packages/integration-tests/jest.config.js b/packages/integration-tests/jest.config.js new file mode 100644 index 000000000..d6e8961c6 --- /dev/null +++ b/packages/integration-tests/jest.config.js @@ -0,0 +1,12 @@ +/** @type {import('jest').Config} */ +const config = { + testPathIgnorePatterns: ['/node_modules/'], + setupFilesAfterEnv: ['./jest.setup.js'], + roots: ['./lib'], + moduleNameMapper: { + '^#src/(.*)\\.js(x)?$': '/lib/$1', + '^(chalk|inquirer)$': '/../shared/lib/esm/module-proxy.js', + }, +}; + +export default config; diff --git a/packages/integration-tests/jest.config.ts b/packages/integration-tests/jest.config.ts deleted file mode 100644 index 435ef3f33..000000000 --- a/packages/integration-tests/jest.config.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { Config } from '@silverhand/jest-config'; -import { merge } from '@silverhand/jest-config'; - -const config: Config.InitialOptions = { - ...merge({ - setupFilesAfterEnv: ['/jest.setup.js'], - }), - // Will update common config soon - transformIgnorePatterns: ['node_modules/(?!(.*(nanoid|jose|ky|@logto))/)'], -}; - -export default config; diff --git a/packages/integration-tests/jest.config.ui.js b/packages/integration-tests/jest.config.ui.js new file mode 100644 index 000000000..dddbf5004 --- /dev/null +++ b/packages/integration-tests/jest.config.ui.js @@ -0,0 +1,10 @@ +/** @type {import('jest').Config} */ +const config = { + preset: 'jest-puppeteer', + moduleNameMapper: { + '^#src/(.*)\\.js(x)?$': '/lib/$1', + '^(chalk|inquirer)$': '/../shared/lib/esm/module-proxy.js', + }, +}; + +export default config; diff --git a/packages/integration-tests/jest.config.ui.ts b/packages/integration-tests/jest.config.ui.ts deleted file mode 100644 index 81fd637df..000000000 --- a/packages/integration-tests/jest.config.ui.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { Config } from '@silverhand/jest-config'; -import { merge } from '@silverhand/jest-config'; - -const config: Config.InitialOptions = { - // Will treat as CJS - // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires, unicorn/prefer-module - ...merge(require('jest-puppeteer/jest-preset')), - // Will update common config soon - transformIgnorePatterns: ['node_modules/(?!(.*(nanoid|jose|ky|@logto))/)'], -}; - -export default config; diff --git a/packages/integration-tests/jest.setup.js b/packages/integration-tests/jest.setup.js index 89e48b851..f60a41079 100644 --- a/packages/integration-tests/jest.setup.js +++ b/packages/integration-tests/jest.setup.js @@ -2,10 +2,10 @@ // https://github.com/jsdom/jsdom/issues/1612 import { Crypto } from '@peculiar/webcrypto'; import dotenv from 'dotenv'; +import fetch from 'node-fetch'; import { TextDecoder, TextEncoder } from 'text-encoder'; -// eslint-disable-next-line unicorn/prefer-module -const fetch = require('node-fetch'); +const { jest } = import.meta; dotenv.config(); diff --git a/packages/integration-tests/package.json b/packages/integration-tests/package.json index 01749cc2d..d11ff0f5b 100644 --- a/packages/integration-tests/package.json +++ b/packages/integration-tests/package.json @@ -5,10 +5,16 @@ "author": "Silverhand Inc. ", "license": "MPL-2.0", "private": true, + "type": "module", + "imports": { + "#src/*": "./lib/*" + }, "scripts": { - "test": "pnpm test:api && pnpm test:ui", - "test:api": "jest -i ./tests/api", - "test:ui": "jest -i --config=jest.config.ui.ts ./tests/ui", + "build": "rm -rf lib/ && tsc -p tsconfig.test.json --sourcemap", + "test:only": "NODE_OPTIONS=--experimental-vm-modules jest", + "test": "pnpm build && pnpm test:api && pnpm test:ui", + "test:api": "pnpm test:only -i ./lib/tests/api", + "test:ui": "pnpm test:only -i --config=jest.config.ui.js ./lib/tests/ui", "lint": "eslint --ext .ts src tests", "lint:report": "pnpm lint --format json --output-file report.json", "start": "pnpm test" @@ -28,7 +34,7 @@ "@types/node": "^16.0.0", "dotenv": "^16.0.0", "eslint": "^8.21.0", - "got": "^11.8.5", + "got": "^12.5.3", "jest": "^29.1.2", "jest-puppeteer": "^6.1.1", "node-fetch": "^2.6.7", @@ -38,7 +44,7 @@ "puppeteer": "^19.0.0", "text-encoder": "^0.0.4", "ts-node": "^10.9.1", - "typescript": "^4.7.4" + "typescript": "^4.9.4" }, "engines": { "node": "^16.13.0 || ^18.12.0" diff --git a/packages/integration-tests/src/api/admin-user.ts b/packages/integration-tests/src/api/admin-user.ts index 4c7cf72f9..05bcbe4bf 100644 --- a/packages/integration-tests/src/api/admin-user.ts +++ b/packages/integration-tests/src/api/admin-user.ts @@ -1,6 +1,6 @@ import type { User } from '@logto/schemas'; -import { authedAdminApi } from './api'; +import { authedAdminApi } from './api.js'; type CreateUserPayload = { primaryEmail?: string; diff --git a/packages/integration-tests/src/api/api.ts b/packages/integration-tests/src/api/api.ts index ae3eb2bcf..22736a479 100644 --- a/packages/integration-tests/src/api/api.ts +++ b/packages/integration-tests/src/api/api.ts @@ -1,6 +1,6 @@ -import got from 'got'; +import { got } from 'got'; -import { logtoUrl } from '@/constants'; +import { logtoUrl } from '#src/constants.js'; export default got.extend({ prefixUrl: new URL('/api', logtoUrl) }); diff --git a/packages/integration-tests/src/api/application.ts b/packages/integration-tests/src/api/application.ts index f441e143f..f251d25c0 100644 --- a/packages/integration-tests/src/api/application.ts +++ b/packages/integration-tests/src/api/application.ts @@ -5,7 +5,7 @@ import type { OidcClientMetadata, } from '@logto/schemas'; -import { authedAdminApi } from './api'; +import { authedAdminApi } from './api.js'; export const createApplication = (name: string, type: ApplicationType) => authedAdminApi diff --git a/packages/integration-tests/src/api/connector.ts b/packages/integration-tests/src/api/connector.ts index 388659776..aff29c381 100644 --- a/packages/integration-tests/src/api/connector.ts +++ b/packages/integration-tests/src/api/connector.ts @@ -1,6 +1,6 @@ import type { Connector, ConnectorResponse } from '@logto/schemas'; -import { authedAdminApi } from './api'; +import { authedAdminApi } from './api.js'; export const listConnectors = async () => authedAdminApi.get('connectors').json(); diff --git a/packages/integration-tests/src/api/dashboard.ts b/packages/integration-tests/src/api/dashboard.ts index 11e3b1dce..8835bed54 100644 --- a/packages/integration-tests/src/api/dashboard.ts +++ b/packages/integration-tests/src/api/dashboard.ts @@ -1,4 +1,4 @@ -import { authedAdminApi } from './api'; +import { authedAdminApi } from './api.js'; export type StatisticsData = { count: number; diff --git a/packages/integration-tests/src/api/index.ts b/packages/integration-tests/src/api/index.ts index 6283bed00..18b84987b 100644 --- a/packages/integration-tests/src/api/index.ts +++ b/packages/integration-tests/src/api/index.ts @@ -1,12 +1,12 @@ -export * from './resource'; -export * from './connector'; -export * from './application'; -export * from './sign-in-experience'; -export * from './admin-user'; -export * from './session'; -export * from './logs'; -export * from './dashboard'; -export * from './me'; -export * from './wellknown'; +export * from './resource.js'; +export * from './connector.js'; +export * from './application.js'; +export * from './sign-in-experience.js'; +export * from './admin-user.js'; +export * from './session.js'; +export * from './logs.js'; +export * from './dashboard.js'; +export * from './me.js'; +export * from './wellknown.js'; -export { default as api, authedAdminApi } from './api'; +export { default as api, authedAdminApi } from './api.js'; diff --git a/packages/integration-tests/src/api/logs.ts b/packages/integration-tests/src/api/logs.ts index 7382c860f..22c0469a4 100644 --- a/packages/integration-tests/src/api/logs.ts +++ b/packages/integration-tests/src/api/logs.ts @@ -1,6 +1,6 @@ import type { Log } from '@logto/schemas'; -import { authedAdminApi } from './api'; +import { authedAdminApi } from './api.js'; export const getLogs = () => authedAdminApi.get('logs').json(); diff --git a/packages/integration-tests/src/api/me.ts b/packages/integration-tests/src/api/me.ts index be4ce11f1..28862076c 100644 --- a/packages/integration-tests/src/api/me.ts +++ b/packages/integration-tests/src/api/me.ts @@ -1,6 +1,6 @@ import type { ArbitraryObject, UserInfo } from '@logto/schemas'; -import api from './api'; +import api from './api.js'; export const getCurrentUserInfo = (userId: string) => api.get(`me`, { headers: { 'development-user-id': userId } }).json(); diff --git a/packages/integration-tests/src/api/resource.ts b/packages/integration-tests/src/api/resource.ts index e60049a89..5f988ce0f 100644 --- a/packages/integration-tests/src/api/resource.ts +++ b/packages/integration-tests/src/api/resource.ts @@ -1,9 +1,9 @@ import type { Resource, CreateResource } from '@logto/schemas'; import type { OptionsOfTextResponseBody } from 'got'; -import { generateResourceIndicator, generateResourceName } from '@/utils'; +import { generateResourceIndicator, generateResourceName } from '#src/utils.js'; -import { authedAdminApi } from './api'; +import { authedAdminApi } from './api.js'; export const createResource = (name?: string, indicator?: string) => authedAdminApi diff --git a/packages/integration-tests/src/api/session.ts b/packages/integration-tests/src/api/session.ts index b650c645a..66485df35 100644 --- a/packages/integration-tests/src/api/session.ts +++ b/packages/integration-tests/src/api/session.ts @@ -1,6 +1,6 @@ import { PasscodeType } from '@logto/schemas'; -import api from './api'; +import api from './api.js'; type RedirectResponse = { redirectTo: string; diff --git a/packages/integration-tests/src/api/sign-in-experience.ts b/packages/integration-tests/src/api/sign-in-experience.ts index 9fda9d08b..231f3a76e 100644 --- a/packages/integration-tests/src/api/sign-in-experience.ts +++ b/packages/integration-tests/src/api/sign-in-experience.ts @@ -1,6 +1,6 @@ import type { SignInExperience } from '@logto/schemas'; -import { authedAdminApi } from './api'; +import { authedAdminApi } from './api.js'; export const getSignInExperience = () => authedAdminApi.get('sign-in-exp').json(); diff --git a/packages/integration-tests/src/api/wellknown.ts b/packages/integration-tests/src/api/wellknown.ts index eac1cf112..29d9aa114 100644 --- a/packages/integration-tests/src/api/wellknown.ts +++ b/packages/integration-tests/src/api/wellknown.ts @@ -1,6 +1,6 @@ import type { SignInExperience } from '@logto/schemas'; -import api from './api'; +import api from './api.js'; export const getWellKnownSignInExperience = (interactionCookie: string) => api diff --git a/packages/integration-tests/src/client/index.ts b/packages/integration-tests/src/client/index.ts index e5129e839..ea4e886ff 100644 --- a/packages/integration-tests/src/client/index.ts +++ b/packages/integration-tests/src/client/index.ts @@ -1,14 +1,14 @@ import type { LogtoConfig } from '@logto/node'; import LogtoClient from '@logto/node'; -import { demoAppApplicationId } from '@logto/schemas/lib/seeds'; +import { demoAppApplicationId } from '@logto/schemas/lib/seeds/index.js'; import { assert } from '@silverhand/essentials'; -import got from 'got'; +import { got } from 'got'; -import { consent } from '@/api'; -import { demoAppRedirectUri, logtoUrl } from '@/constants'; -import { extractCookie } from '@/utils'; +import { consent } from '#src/api/index.js'; +import { demoAppRedirectUri, logtoUrl } from '#src/constants.js'; +import { extractCookie } from '#src/utils.js'; -import { MemoryStorage } from './storage'; +import { MemoryStorage } from './storage.js'; export const defaultConfig = { endpoint: logtoUrl, diff --git a/packages/integration-tests/src/constants.ts b/packages/integration-tests/src/constants.ts index 1faf4cf1f..0d0b31222 100644 --- a/packages/integration-tests/src/constants.ts +++ b/packages/integration-tests/src/constants.ts @@ -1,8 +1,8 @@ import { SignInIdentifier } from '@logto/schemas'; import { demoAppApplicationId } from '@logto/schemas/lib/seeds'; -import { getEnv } from '@silverhand/essentials'; +import { assertEnv } from '@silverhand/essentials'; -export const logtoUrl = getEnv('INTEGRATION_TESTS_LOGTO_URL'); +export const logtoUrl = assertEnv('INTEGRATION_TESTS_LOGTO_URL'); export const discoveryUrl = `${logtoUrl}/oidc/.well-known/openid-configuration`; diff --git a/packages/integration-tests/src/helpers.ts b/packages/integration-tests/src/helpers.ts index 17ebe83b2..97f51848b 100644 --- a/packages/integration-tests/src/helpers.ts +++ b/packages/integration-tests/src/helpers.ts @@ -13,9 +13,9 @@ import { getAuthWithSocial, signInWithSocial, updateSignInExperience, -} from '@/api'; -import MockClient from '@/client'; -import { generateUsername, generatePassword } from '@/utils'; +} from '#src/api/index.js'; +import MockClient from '#src/client/index.js'; +import { generateUsername, generatePassword } from '#src/utils.js'; export const createUserByAdmin = (username?: string, password?: string, primaryEmail?: string) => { return createUser({ diff --git a/packages/integration-tests/src/include.d/openapi-schema-validator.d.ts b/packages/integration-tests/src/include.d/openapi-schema-validator.d.ts new file mode 100644 index 000000000..753c04b90 --- /dev/null +++ b/packages/integration-tests/src/include.d/openapi-schema-validator.d.ts @@ -0,0 +1,32 @@ +/** + * There's an issue for `"moduleResolution": "nodenext"`, thus we need to copy type definitions to here. + * See: https://github.com/microsoft/TypeScript/issues/47848 https://github.com/microsoft/TypeScript/issues/49189 + */ + +declare module 'openapi-schema-validator' { + import type { ErrorObject } from 'ajv'; + import type { IJsonSchema, OpenAPI } from 'openapi-types'; + + export interface IOpenAPISchemaValidator { + /** + * Validate the provided OpenAPI doc against this validator's schema version and + * return the results. + */ + validate(document: OpenAPI.Document): OpenAPISchemaValidatorResult; + } + export interface OpenAPISchemaValidatorArgs { + version: number | string; + extensions?: IJsonSchema; + } + export interface OpenAPISchemaValidatorResult { + errors: ErrorObject[]; + } + class OpenAPISchemaValidator implements IOpenAPISchemaValidator { + private readonly validator; + constructor(args: OpenAPISchemaValidatorArgs); + validate(openapiDocument: OpenAPI.Document): OpenAPISchemaValidatorResult; + } + + // eslint-disable-next-line import/no-anonymous-default-export + export default { default: OpenAPISchemaValidator }; +} diff --git a/packages/integration-tests/tests/api/admin-user.test.ts b/packages/integration-tests/src/tests/api/admin-user.test.ts similarity index 94% rename from packages/integration-tests/tests/api/admin-user.test.ts rename to packages/integration-tests/src/tests/api/admin-user.test.ts index 266ee2005..3c7898d17 100644 --- a/packages/integration-tests/tests/api/admin-user.test.ts +++ b/packages/integration-tests/src/tests/api/admin-user.test.ts @@ -4,7 +4,7 @@ import { mockSocialConnectorConfig, mockSocialConnectorId, mockSocialConnectorTarget, -} from '@/__mocks__/connectors-mock'; +} from '#src/__mocks__/connectors-mock.js'; import { getUser, getUsers, @@ -15,8 +15,8 @@ import { postConnector, updateConnectorConfig, deleteConnectorById, -} from '@/api'; -import { createUserByAdmin, bindSocialToNewCreatedUser } from '@/helpers'; +} from '#src/api/index.js'; +import { createUserByAdmin, bindSocialToNewCreatedUser } from '#src/helpers.js'; describe('admin console user management', () => { it('should create user successfully', async () => { diff --git a/packages/integration-tests/tests/api/application.test.ts b/packages/integration-tests/src/tests/api/application.test.ts similarity index 97% rename from packages/integration-tests/tests/api/application.test.ts rename to packages/integration-tests/src/tests/api/application.test.ts index 2f089639a..0b27fc79f 100644 --- a/packages/integration-tests/tests/api/application.test.ts +++ b/packages/integration-tests/src/tests/api/application.test.ts @@ -2,7 +2,7 @@ import { ApplicationType } from '@logto/schemas'; import { demoAppApplicationId } from '@logto/schemas/lib/seeds'; import { HTTPError } from 'got'; -import { createApplication, getApplication, updateApplication, deleteApplication } from '@/api'; +import { createApplication, getApplication, updateApplication, deleteApplication } from '#src/api/index.js'; describe('admin console application', () => { it('should get demo app details successfully', async () => { diff --git a/packages/integration-tests/tests/api/connector.test.ts b/packages/integration-tests/src/tests/api/connector.test.ts similarity index 98% rename from packages/integration-tests/tests/api/connector.test.ts rename to packages/integration-tests/src/tests/api/connector.test.ts index ec5d65aca..00c3d1dca 100644 --- a/packages/integration-tests/tests/api/connector.test.ts +++ b/packages/integration-tests/src/tests/api/connector.test.ts @@ -9,7 +9,7 @@ import { mockSocialConnectorId, mockStandardEmailConnectorConfig, mockStandardEmailConnectorId, -} from '@/__mocks__/connectors-mock'; +} from '#src/__mocks__/connectors-mock.js'; import { deleteConnectorById, getConnector, @@ -18,7 +18,7 @@ import { sendEmailTestMessage, sendSmsTestMessage, updateConnectorConfig, -} from '@/api/connector'; +} from '#src/api/connector.js'; const connectorIdMap = new Map(); diff --git a/packages/integration-tests/tests/api/dashboard.test.ts b/packages/integration-tests/src/tests/api/dashboard.test.ts similarity index 89% rename from packages/integration-tests/tests/api/dashboard.test.ts rename to packages/integration-tests/src/tests/api/dashboard.test.ts index 596757279..235abd3a5 100644 --- a/packages/integration-tests/tests/api/dashboard.test.ts +++ b/packages/integration-tests/src/tests/api/dashboard.test.ts @@ -1,8 +1,8 @@ -import type { StatisticsData } from '@/api'; -import { getTotalUsersCount, getNewUsersData, getActiveUsersData } from '@/api'; -import { signUpIdentifiers } from '@/constants'; -import { createUserByAdmin, registerNewUser, setSignUpIdentifier, signIn } from '@/helpers'; -import { generateUsername, generatePassword } from '@/utils'; +import type { StatisticsData } from '#src/api/index.js'; +import { getTotalUsersCount, getNewUsersData, getActiveUsersData } from '#src/api/index.js'; +import { signUpIdentifiers } from '#src/constants.js'; +import { createUserByAdmin, registerNewUser, setSignUpIdentifier, signIn } from '#src/helpers.js'; +import { generateUsername, generatePassword } from '#src/utils.js'; describe('admin console dashboard', () => { beforeAll(async () => { diff --git a/packages/integration-tests/tests/api/get-access-token.test.ts b/packages/integration-tests/src/tests/api/get-access-token.test.ts similarity index 89% rename from packages/integration-tests/tests/api/get-access-token.test.ts rename to packages/integration-tests/src/tests/api/get-access-token.test.ts index e635e4993..38dd7ba7f 100644 --- a/packages/integration-tests/tests/api/get-access-token.test.ts +++ b/packages/integration-tests/src/tests/api/get-access-token.test.ts @@ -5,11 +5,11 @@ import { managementResource } from '@logto/schemas/lib/seeds'; import { assert } from '@silverhand/essentials'; import fetch from 'node-fetch'; -import { signInWithPassword } from '@/api'; -import MockClient, { defaultConfig } from '@/client'; -import { logtoUrl } from '@/constants'; -import { createUserByAdmin } from '@/helpers'; -import { generateUsername, generatePassword } from '@/utils'; +import { signInWithPassword } from '#src/api/index.js'; +import MockClient, { defaultConfig } from '#src/client/index.js'; +import { logtoUrl } from '#src/constants.js'; +import { createUserByAdmin } from '#src/helpers.js'; +import { generateUsername, generatePassword } from '#src/utils.js'; describe('get access token', () => { const username = generateUsername(); diff --git a/packages/integration-tests/tests/api/health-check.test.ts b/packages/integration-tests/src/tests/api/health-check.test.ts similarity index 80% rename from packages/integration-tests/tests/api/health-check.test.ts rename to packages/integration-tests/src/tests/api/health-check.test.ts index 32415b430..1c44838eb 100644 --- a/packages/integration-tests/tests/api/health-check.test.ts +++ b/packages/integration-tests/src/tests/api/health-check.test.ts @@ -1,4 +1,4 @@ -import { api } from '@/api'; +import { api } from '#src/api/index.js'; describe('Health check', () => { it('should have a health state', async () => { diff --git a/packages/integration-tests/tests/api/logs.test.ts b/packages/integration-tests/src/tests/api/logs.test.ts similarity index 77% rename from packages/integration-tests/tests/api/logs.test.ts rename to packages/integration-tests/src/tests/api/logs.test.ts index c40a15837..efcf89141 100644 --- a/packages/integration-tests/tests/api/logs.test.ts +++ b/packages/integration-tests/src/tests/api/logs.test.ts @@ -1,9 +1,9 @@ import { assert } from '@silverhand/essentials'; -import { getLogs, getLog } from '@/api'; -import { signUpIdentifiers } from '@/constants'; -import { registerNewUser, setSignUpIdentifier } from '@/helpers'; -import { generateUsername, generatePassword } from '@/utils'; +import { getLogs, getLog } from '#src/api/index.js'; +import { signUpIdentifiers } from '#src/constants.js'; +import { registerNewUser, setSignUpIdentifier } from '#src/helpers.js'; +import { generateUsername, generatePassword } from '#src/utils.js'; describe('admin console logs', () => { const username = generateUsername(); diff --git a/packages/integration-tests/tests/api/resource.test.ts b/packages/integration-tests/src/tests/api/resource.test.ts similarity index 97% rename from packages/integration-tests/tests/api/resource.test.ts rename to packages/integration-tests/src/tests/api/resource.test.ts index 83492b726..2391f8dfe 100644 --- a/packages/integration-tests/tests/api/resource.test.ts +++ b/packages/integration-tests/src/tests/api/resource.test.ts @@ -1,8 +1,8 @@ import { managementResource } from '@logto/schemas/lib/seeds'; import { HTTPError } from 'got'; -import { createResource, getResource, updateResource, deleteResource } from '@/api'; -import { generateResourceIndicator, generateResourceName } from '@/utils'; +import { createResource, getResource, updateResource, deleteResource } from '#src/api/index.js'; +import { generateResourceIndicator, generateResourceName } from '#src/utils.js'; describe('admin console api resources', () => { it('should get management api resource details successfully', async () => { diff --git a/packages/integration-tests/tests/api/session.test.ts b/packages/integration-tests/src/tests/api/session.test.ts similarity index 97% rename from packages/integration-tests/tests/api/session.test.ts rename to packages/integration-tests/src/tests/api/session.test.ts index 4b96b54b2..a581a021b 100644 --- a/packages/integration-tests/tests/api/session.test.ts +++ b/packages/integration-tests/src/tests/api/session.test.ts @@ -7,7 +7,7 @@ import { mockEmailConnectorConfig, mockSmsConnectorId, mockSmsConnectorConfig, -} from '@/__mocks__/connectors-mock'; +} from '#src/__mocks__/connectors-mock.js'; import { sendRegisterUserWithEmailPasscode, verifyRegisterUserWithEmailPasscode, @@ -23,9 +23,9 @@ import { deleteConnectorById, postConnector, updateConnectorConfig, -} from '@/api'; -import MockClient from '@/client'; -import { signUpIdentifiers } from '@/constants'; +} from '#src/api/index.js'; +import MockClient from '#src/client/index.js'; +import { signUpIdentifiers } from '#src/constants.js'; import { registerNewUser, signIn, @@ -33,8 +33,8 @@ import { createUserByAdmin, setSignUpIdentifier, setSignInMethod, -} from '@/helpers'; -import { generateUsername, generatePassword, generateEmail, generatePhone } from '@/utils'; +} from '#src/helpers.js'; +import { generateUsername, generatePassword, generateEmail, generatePhone } from '#src/utils.js'; const connectorIdMap = new Map(); diff --git a/packages/integration-tests/tests/api/sign-in-experience.test.ts b/packages/integration-tests/src/tests/api/sign-in-experience.test.ts similarity index 92% rename from packages/integration-tests/tests/api/sign-in-experience.test.ts rename to packages/integration-tests/src/tests/api/sign-in-experience.test.ts index 5893f6faa..2ba6e9025 100644 --- a/packages/integration-tests/tests/api/sign-in-experience.test.ts +++ b/packages/integration-tests/src/tests/api/sign-in-experience.test.ts @@ -1,6 +1,6 @@ import { BrandingStyle } from '@logto/schemas'; -import { getSignInExperience, updateSignInExperience } from '@/api'; +import { getSignInExperience, updateSignInExperience } from '#src/api/index.js'; describe('admin console sign-in experience', () => { it('should get sign-in experience successfully', async () => { diff --git a/packages/integration-tests/tests/api/social-session.test.ts b/packages/integration-tests/src/tests/api/social-session.test.ts similarity index 93% rename from packages/integration-tests/tests/api/social-session.test.ts rename to packages/integration-tests/src/tests/api/social-session.test.ts index 4c5bf484b..35e198f90 100644 --- a/packages/integration-tests/tests/api/social-session.test.ts +++ b/packages/integration-tests/src/tests/api/social-session.test.ts @@ -5,7 +5,7 @@ import { mockSocialConnectorId, mockSocialConnectorTarget, mockSocialConnectorConfig, -} from '@/__mocks__/connectors-mock'; +} from '#src/__mocks__/connectors-mock.js'; import { signInWithSocial, getAuthWithSocial, @@ -16,11 +16,11 @@ import { postConnector, updateConnectorConfig, deleteConnectorById, -} from '@/api'; -import MockClient from '@/client'; -import { signUpIdentifiers } from '@/constants'; -import { createUserByAdmin, setSignUpIdentifier } from '@/helpers'; -import { generateUsername, generatePassword } from '@/utils'; +} from '#src/api/index.js'; +import MockClient from '#src/client/index.js'; +import { signUpIdentifiers } from '#src/constants.js'; +import { createUserByAdmin, setSignUpIdentifier } from '#src/helpers.js'; +import { generateUsername, generatePassword } from '#src/utils.js'; const state = 'foo_state'; const redirectUri = 'http://foo.dev/callback'; diff --git a/packages/integration-tests/tests/api/swagger-check.test.ts b/packages/integration-tests/src/tests/api/swagger-check.test.ts similarity index 80% rename from packages/integration-tests/tests/api/swagger-check.test.ts rename to packages/integration-tests/src/tests/api/swagger-check.test.ts index c816bf614..cb25c7d3a 100644 --- a/packages/integration-tests/tests/api/swagger-check.test.ts +++ b/packages/integration-tests/src/tests/api/swagger-check.test.ts @@ -1,7 +1,9 @@ -import OpenApiSchemaValidator from 'openapi-schema-validator'; +import Validator from 'openapi-schema-validator'; import type { OpenAPI } from 'openapi-types'; -import { api } from '@/api'; +import { api } from '#src/api/index.js'; + +const { default: OpenApiSchemaValidator } = Validator; describe('Swagger check', () => { it('should provide a valid swagger.json', async () => { diff --git a/packages/integration-tests/tests/api/wellknown.test.ts b/packages/integration-tests/src/tests/api/wellknown.test.ts similarity index 88% rename from packages/integration-tests/tests/api/wellknown.test.ts rename to packages/integration-tests/src/tests/api/wellknown.test.ts index c350116db..8001f303f 100644 --- a/packages/integration-tests/tests/api/wellknown.test.ts +++ b/packages/integration-tests/src/tests/api/wellknown.test.ts @@ -1,9 +1,9 @@ import { adminConsoleApplicationId } from '@logto/schemas/lib/seeds'; import { assert } from '@silverhand/essentials'; -import { getWellKnownSignInExperience } from '@/api'; -import MockClient from '@/client'; -import { adminConsoleRedirectUri } from '@/constants'; +import { getWellKnownSignInExperience } from '#src/api/index.js'; +import MockClient from '#src/client/index.js'; +import { adminConsoleRedirectUri } from '#src/constants.js'; describe('wellknown api', () => { it('get /.well-known/sign-in-exp for AC', async () => { diff --git a/packages/integration-tests/tests/ui/smoke.test.ts b/packages/integration-tests/src/tests/ui/smoke.test.ts similarity index 81% rename from packages/integration-tests/tests/ui/smoke.test.ts rename to packages/integration-tests/src/tests/ui/smoke.test.ts index e41051b01..9aa405bb8 100644 --- a/packages/integration-tests/tests/ui/smoke.test.ts +++ b/packages/integration-tests/src/tests/ui/smoke.test.ts @@ -1,4 +1,4 @@ -import { logtoUrl } from '@/constants'; +import { logtoUrl } from '#src/constants.js'; describe('smoke testing', () => { it('opens with app element', async () => { diff --git a/packages/integration-tests/tsconfig.json b/packages/integration-tests/tsconfig.json index d978a7287..7cb9489e4 100644 --- a/packages/integration-tests/tsconfig.json +++ b/packages/integration-tests/tsconfig.json @@ -1,15 +1,17 @@ { "extends": "@silverhand/ts-config/tsconfig.base", "compilerOptions": { + "moduleResolution": "nodenext", + "module": "esnext", "isolatedModules": false, "allowJs": true, - "noEmit": true, + "outDir": "lib", "baseUrl": ".", "paths": { - "@/*": [ + "#src/*": [ "src/*" ] } }, - "include": ["tests", "src", "jest.*.ts", "jest.setup.js"] + "include": ["src"] } diff --git a/packages/phrases-ui/package.json b/packages/phrases-ui/package.json index 27d0084ef..7a5f208cc 100644 --- a/packages/phrases-ui/package.json +++ b/packages/phrases-ui/package.json @@ -43,7 +43,7 @@ "eslint": "^8.21.0", "lint-staged": "^13.0.0", "prettier": "^2.7.1", - "typescript": "^4.7.4" + "typescript": "^4.9.4" }, "engines": { "node": "^16.13.0 || ^18.12.0" diff --git a/packages/phrases/package.json b/packages/phrases/package.json index 5819bf24d..75e20b23a 100644 --- a/packages/phrases/package.json +++ b/packages/phrases/package.json @@ -43,7 +43,7 @@ "eslint": "^8.21.0", "lint-staged": "^13.0.0", "prettier": "^2.7.1", - "typescript": "^4.7.4" + "typescript": "^4.9.4" }, "eslintConfig": { "extends": "@silverhand" diff --git a/packages/schemas/generate.sh b/packages/schemas/generate.sh new file mode 100755 index 000000000..f20e26984 --- /dev/null +++ b/packages/schemas/generate.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +rm -rf lib/ +pnpm exec tsc -p tsconfig.build.gen.json +rm -rf src/db-entries +node lib/index.js +pnpm exec eslint src/db-entries/** --fix diff --git a/packages/schemas/package.json b/packages/schemas/package.json index 8ccf7a232..a4b093f4b 100644 --- a/packages/schemas/package.json +++ b/packages/schemas/package.json @@ -17,7 +17,7 @@ "scripts": { "precommit": "lint-staged", "version": "./update-next.sh && git add alterations/", - "generate": "rm -rf src/db-entries && tsc -p tsconfig.build.gen.json && node lib/src/gen/index.js && eslint \"src/db-entries/**\" --fix", + "generate": "./generate.sh", "build:alterations": "rm -rf alterations-js && tsc -p tsconfig.build.alterations.json", "build": "pnpm generate && rm -rf lib/ && tsc -p tsconfig.build.json && pnpm build:alterations", "build:test": "rm -rf lib/ && tsc -p tsconfig.test.json --sourcemap", @@ -48,7 +48,7 @@ "pluralize": "^8.0.0", "prettier": "^2.7.1", "slonik": "^30.0.0", - "typescript": "^4.7.4" + "typescript": "^4.9.4" }, "eslintConfig": { "extends": "@silverhand", diff --git a/packages/shared/package.json b/packages/shared/package.json index 740cf8aea..3a30ecc66 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -40,7 +40,7 @@ "jest": "^29.1.2", "lint-staged": "^13.0.0", "prettier": "^2.7.1", - "typescript": "^4.7.4" + "typescript": "^4.9.4" }, "engines": { "node": "^16.13.0 || ^18.12.0" diff --git a/packages/ui/package.json b/packages/ui/package.json index 03af5220d..552bea80c 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -67,7 +67,7 @@ "react-timer-hook": "^3.0.5", "stylelint": "^14.9.1", "superstruct": "^0.16.0", - "typescript": "^4.7.4", + "typescript": "^4.9.4", "use-debounced-loader": "^0.1.1", "zod": "^3.19.1" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6e86483aa..bd5b3409e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -10,7 +10,7 @@ importers: '@commitlint/types': ^17.0.0 '@logto/cli': ^1.0.0-beta.10 husky: ^8.0.0 - typescript: ^4.7.4 + typescript: ^4.9.4 dependencies: '@logto/cli': link:packages/cli devDependencies: @@ -19,7 +19,7 @@ importers: '@commitlint/config-conventional': 17.0.0 '@commitlint/types': 17.0.0 husky: 8.0.1 - typescript: 4.7.4 + typescript: 4.9.4 packages/cli: specifiers: @@ -58,7 +58,7 @@ importers: slonik-interceptor-preset: ^1.2.10 slonik-sql-tag-raw: ^1.1.4 tar: ^6.1.11 - typescript: ^4.7.4 + typescript: ^4.9.4 yargs: ^17.6.0 zod: ^3.19.1 dependencies: @@ -84,8 +84,8 @@ importers: yargs: 17.6.0 zod: 3.19.1 devDependencies: - '@silverhand/eslint-config': 1.3.0_swk2g7ygmfleszo5c33j4vooni - '@silverhand/ts-config': 1.2.1_typescript@4.7.4 + '@silverhand/eslint-config': 1.3.0_eu7dlo3qq5moigliolva3udaxa + '@silverhand/ts-config': 1.2.1_typescript@4.9.4 '@types/fs-extra': 9.0.13 '@types/inquirer': 8.2.1 '@types/jest': 29.1.2 @@ -100,7 +100,7 @@ importers: prettier: 2.7.1 rimraf: 3.0.2 sinon: 15.0.0 - typescript: 4.7.4 + typescript: 4.9.4 packages/console: specifiers: @@ -173,7 +173,7 @@ importers: snake-case: ^3.0.4 stylelint: ^14.9.1 swr: ^1.3.0 - typescript: ^4.7.4 + typescript: ^4.9.4 zod: ^3.19.1 devDependencies: '@fontsource/roboto-mono': 4.5.7 @@ -188,11 +188,11 @@ importers: '@parcel/transformer-mdx': 2.8.0_smofjnbzoy3mcjjin2zix4yahi '@parcel/transformer-sass': 2.8.0_@parcel+core@2.8.0 '@parcel/transformer-svg-react': 2.8.0_@parcel+core@2.8.0 - '@silverhand/eslint-config': 1.3.0_swk2g7ygmfleszo5c33j4vooni - '@silverhand/eslint-config-react': 1.3.0_3jdvf2aalbcoibv3m53iflhmym + '@silverhand/eslint-config': 1.3.0_eu7dlo3qq5moigliolva3udaxa + '@silverhand/eslint-config-react': 1.3.0_pzm7kshjahdwz2kcmmatnemr54 '@silverhand/essentials': 1.3.0 - '@silverhand/ts-config': 1.2.1_typescript@4.7.4 - '@silverhand/ts-config-react': 1.2.1_typescript@4.7.4 + '@silverhand/ts-config': 1.2.1_typescript@4.9.4 + '@silverhand/ts-config-react': 1.2.1_typescript@4.9.4 '@tsconfig/docusaurus': 1.0.5 '@types/color': 3.0.3 '@types/lodash.get': 4.4.7 @@ -245,7 +245,7 @@ importers: snake-case: 3.0.4 stylelint: 14.9.1 swr: 1.3.0_react@18.2.0 - typescript: 4.7.4 + typescript: 4.9.4 zod: 3.19.1 packages/core: @@ -323,7 +323,7 @@ importers: snake-case: ^3.0.4 snakecase-keys: ^5.4.4 supertest: ^6.2.2 - typescript: ^4.9.3 + typescript: ^4.9.4 zod: ^3.19.1 dependencies: '@logto/cli': link:../cli @@ -371,8 +371,8 @@ importers: snakecase-keys: 5.4.4 zod: 3.19.1 devDependencies: - '@silverhand/eslint-config': 1.3.0_xygfz6avl43ipur7dlp2av7gnm - '@silverhand/ts-config': 1.2.1_typescript@4.9.3 + '@silverhand/eslint-config': 1.3.0_eu7dlo3qq5moigliolva3udaxa + '@silverhand/ts-config': 1.2.1_typescript@4.9.4 '@types/debug': 4.1.7 '@types/etag': 1.8.1 '@types/fs-extra': 9.0.13 @@ -401,7 +401,7 @@ importers: prettier: 2.7.1 sinon: 15.0.0 supertest: 6.2.2 - typescript: 4.9.3 + typescript: 4.9.4 packages/create: specifiers: @@ -436,7 +436,7 @@ importers: react-dom: ^18.0.0 react-i18next: ^11.18.3 stylelint: ^14.9.1 - typescript: ^4.7.4 + typescript: ^4.9.4 zod: ^3.19.1 devDependencies: '@logto/core-kit': 1.0.0-beta.28_zod@3.19.1 @@ -446,10 +446,10 @@ importers: '@logto/schemas': link:../schemas '@parcel/core': 2.8.0 '@parcel/transformer-sass': 2.8.0_@parcel+core@2.8.0 - '@silverhand/eslint-config': 1.3.0_swk2g7ygmfleszo5c33j4vooni - '@silverhand/eslint-config-react': 1.3.0_qoomm4vc6ijs52fnjlal4yoenm - '@silverhand/ts-config': 1.2.1_typescript@4.7.4 - '@silverhand/ts-config-react': 1.2.1_typescript@4.7.4 + '@silverhand/eslint-config': 1.3.0_eu7dlo3qq5moigliolva3udaxa + '@silverhand/eslint-config-react': 1.3.0_hwxyoluj7tfktess7f4itjwcee + '@silverhand/ts-config': 1.2.1_typescript@4.9.4 + '@silverhand/ts-config-react': 1.2.1_typescript@4.9.4 '@types/react': 18.0.15 '@types/react-dom': 18.0.6 cross-env: 7.0.3 @@ -464,7 +464,7 @@ importers: react-dom: 18.2.0_react@18.2.0 react-i18next: 11.18.3_shxxmfhtk2bc4pbx5cyq3uoph4 stylelint: 14.9.1 - typescript: 4.7.4 + typescript: 4.9.4 zod: 3.19.1 packages/integration-tests: @@ -483,7 +483,7 @@ importers: '@types/node': ^16.0.0 dotenv: ^16.0.0 eslint: ^8.21.0 - got: ^11.8.5 + got: ^12.5.3 jest: ^29.1.2 jest-puppeteer: ^6.1.1 node-fetch: ^2.6.7 @@ -493,23 +493,23 @@ importers: puppeteer: ^19.0.0 text-encoder: ^0.0.4 ts-node: ^10.9.1 - typescript: ^4.7.4 + typescript: ^4.9.4 devDependencies: '@jest/types': 29.1.2 '@logto/js': 1.0.0-beta.14 '@logto/node': 1.0.0-beta.14 '@logto/schemas': link:../schemas '@peculiar/webcrypto': 1.3.3 - '@silverhand/eslint-config': 1.3.0_swk2g7ygmfleszo5c33j4vooni + '@silverhand/eslint-config': 1.3.0_eu7dlo3qq5moigliolva3udaxa '@silverhand/essentials': 1.3.0 - '@silverhand/jest-config': 1.2.2_zapogttls25djihwjkusccjjym - '@silverhand/ts-config': 1.2.1_typescript@4.7.4 + '@silverhand/jest-config': 1.2.2_ky6c64xxalg2hsll4xx3evq2dy + '@silverhand/ts-config': 1.2.1_typescript@4.9.4 '@types/jest': 29.1.2 '@types/jest-environment-puppeteer': 5.0.2 '@types/node': 16.11.12 dotenv: 16.0.0 eslint: 8.21.0 - got: 11.8.5 + got: 12.5.3 jest: 29.1.2_k5ytkvaprncdyzidqqws5bqksq jest-puppeteer: 6.1.1_puppeteer@19.2.2 node-fetch: 2.6.7 @@ -518,8 +518,8 @@ importers: prettier: 2.7.1 puppeteer: 19.2.2 text-encoder: 0.0.4 - ts-node: 10.9.1_ccwudyfw5se7hgalwgkzhn2yp4 - typescript: 4.7.4 + ts-node: 10.9.1_ace2mtubvwruu4qt46fm3vtq3a + typescript: 4.9.4 packages/phrases: specifiers: @@ -531,7 +531,7 @@ importers: eslint: ^8.21.0 lint-staged: ^13.0.0 prettier: ^2.7.1 - typescript: ^4.7.4 + typescript: ^4.9.4 zod: ^3.19.1 dependencies: '@logto/core-kit': 1.0.0-beta.28_zod@3.19.1 @@ -539,12 +539,12 @@ importers: '@silverhand/essentials': 1.3.0 zod: 3.19.1 devDependencies: - '@silverhand/eslint-config': 1.3.0_swk2g7ygmfleszo5c33j4vooni - '@silverhand/ts-config': 1.2.1_typescript@4.7.4 + '@silverhand/eslint-config': 1.3.0_eu7dlo3qq5moigliolva3udaxa + '@silverhand/ts-config': 1.2.1_typescript@4.9.4 eslint: 8.21.0 lint-staged: 13.0.0 prettier: 2.7.1 - typescript: 4.7.4 + typescript: 4.9.4 packages/phrases-ui: specifiers: @@ -556,7 +556,7 @@ importers: eslint: ^8.21.0 lint-staged: ^13.0.0 prettier: ^2.7.1 - typescript: ^4.7.4 + typescript: ^4.9.4 zod: ^3.19.1 dependencies: '@logto/core-kit': 1.0.0-beta.28_zod@3.19.1 @@ -564,12 +564,12 @@ importers: '@silverhand/essentials': 1.3.0 zod: 3.19.1 devDependencies: - '@silverhand/eslint-config': 1.3.0_swk2g7ygmfleszo5c33j4vooni - '@silverhand/ts-config': 1.2.1_typescript@4.7.4 + '@silverhand/eslint-config': 1.3.0_eu7dlo3qq5moigliolva3udaxa + '@silverhand/ts-config': 1.2.1_typescript@4.9.4 eslint: 8.21.0 lint-staged: 13.0.0 prettier: 2.7.1 - typescript: 4.7.4 + typescript: 4.9.4 packages/schemas: specifiers: @@ -593,7 +593,7 @@ importers: pluralize: ^8.0.0 prettier: ^2.7.1 slonik: ^30.0.0 - typescript: ^4.7.4 + typescript: ^4.9.4 zod: ^3.19.1 dependencies: '@logto/connector-kit': 1.0.0-beta.28_zod@3.19.1 @@ -603,9 +603,9 @@ importers: '@logto/phrases-ui': link:../phrases-ui zod: 3.19.1 devDependencies: - '@silverhand/eslint-config': 1.3.0_swk2g7ygmfleszo5c33j4vooni + '@silverhand/eslint-config': 1.3.0_eu7dlo3qq5moigliolva3udaxa '@silverhand/essentials': 1.3.0 - '@silverhand/ts-config': 1.2.1_typescript@4.7.4 + '@silverhand/ts-config': 1.2.1_typescript@4.9.4 '@types/jest': 29.1.2 '@types/lodash.uniq': 4.5.6 '@types/node': 16.11.12 @@ -618,7 +618,7 @@ importers: pluralize: 8.0.0 prettier: 2.7.1 slonik: 30.1.2 - typescript: 4.7.4 + typescript: 4.9.4 packages/shared: specifiers: @@ -635,7 +635,7 @@ importers: nanoid: ^3.3.4 prettier: ^2.7.1 slonik: ^30.0.0 - typescript: ^4.7.4 + typescript: ^4.9.4 dependencies: '@logto/schemas': link:../schemas '@silverhand/essentials': 1.3.0 @@ -643,15 +643,15 @@ importers: nanoid: 3.3.4 slonik: 30.1.2 devDependencies: - '@silverhand/eslint-config': 1.3.0_swk2g7ygmfleszo5c33j4vooni - '@silverhand/ts-config': 1.2.1_typescript@4.7.4 + '@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.1.2_@types+node@16.11.12 lint-staged: 13.0.0 prettier: 2.7.1 - typescript: 4.7.4 + typescript: 4.9.4 packages/ui: specifiers: @@ -705,7 +705,7 @@ importers: react-timer-hook: ^3.0.5 stylelint: ^14.9.1 superstruct: ^0.16.0 - typescript: ^4.7.4 + typescript: ^4.9.4 use-debounced-loader: ^0.1.1 zod: ^3.19.1 devDependencies: @@ -718,12 +718,12 @@ importers: '@parcel/transformer-sass': 2.8.0_@parcel+core@2.8.0 '@parcel/transformer-svg-react': 2.8.0_@parcel+core@2.8.0 '@peculiar/webcrypto': 1.3.3 - '@silverhand/eslint-config': 1.3.0_swk2g7ygmfleszo5c33j4vooni - '@silverhand/eslint-config-react': 1.3.0_3jdvf2aalbcoibv3m53iflhmym + '@silverhand/eslint-config': 1.3.0_eu7dlo3qq5moigliolva3udaxa + '@silverhand/eslint-config-react': 1.3.0_pzm7kshjahdwz2kcmmatnemr54 '@silverhand/essentials': 1.3.0 - '@silverhand/jest-config': 1.2.2_zapogttls25djihwjkusccjjym - '@silverhand/ts-config': 1.2.1_typescript@4.7.4 - '@silverhand/ts-config-react': 1.2.1_typescript@4.7.4 + '@silverhand/jest-config': 1.2.2_ky6c64xxalg2hsll4xx3evq2dy + '@silverhand/ts-config': 1.2.1_typescript@4.9.4 + '@silverhand/ts-config-react': 1.2.1_typescript@4.9.4 '@testing-library/react': 13.3.0_biqbaboplfbrettd7655fr4n2y '@types/color': 3.0.3 '@types/jest': 29.1.2 @@ -759,7 +759,7 @@ importers: react-timer-hook: 3.0.5_biqbaboplfbrettd7655fr4n2y stylelint: 14.9.1 superstruct: 0.16.0 - typescript: 4.7.4 + typescript: 4.9.4 use-debounced-loader: 0.1.1_react@18.2.0 zod: 3.19.1 @@ -1620,10 +1620,10 @@ packages: '@types/node': 17.0.23 chalk: 4.1.2 cosmiconfig: 7.0.1 - cosmiconfig-typescript-loader: 2.0.0_bjctuninx3nzqxltyvshqte2ni + cosmiconfig-typescript-loader: 2.0.0_73inix45wpcdjnppmmovzbfudu lodash: 4.17.21 resolve-from: 5.0.0 - typescript: 4.7.4 + typescript: 4.9.4 transitivePeerDependencies: - '@swc/core' - '@swc/wasm' @@ -2427,7 +2427,7 @@ packages: dependencies: '@logto/client': 1.0.0-beta.14 '@silverhand/essentials': 1.3.0 - js-base64: 3.7.2 + js-base64: 3.7.3 dev: true /@logto/client/1.0.0-beta.14: @@ -2437,7 +2437,7 @@ packages: '@logto/js': 1.0.0-beta.14 '@silverhand/essentials': 1.3.0 camelcase-keys: 7.0.2 - jose: 4.11.0 + jose: 4.11.1 lodash.get: 4.4.2 lodash.once: 4.1.1 dev: true @@ -2458,10 +2458,10 @@ packages: resolution: {integrity: sha512-seYvL/aGYRfO4d0FYfKIW/Cu9PnFMRpRM5/oRXwXbcbv+LY1a3TcAX0itrVXeBygIrxiAmWd9DL7CGIWzb48Qg==} engines: {node: ^16.0.0} dependencies: - '@logto/language-kit': 1.0.0-beta.28_zod@3.19.1 + '@logto/language-kit': 1.0.0-beta.29_zod@3.20.0 color: 4.2.3 nanoid: 3.3.4 - zod: 3.19.1 + zod: 3.20.0 dev: true /@logto/core-kit/1.0.0-beta.28_zod@3.19.1: @@ -2481,7 +2481,7 @@ packages: '@logto/core-kit': 1.0.0-beta.20 '@silverhand/essentials': 1.3.0 camelcase-keys: 7.0.2 - jose: 4.11.0 + jose: 4.11.1 lodash.get: 4.4.2 dev: true @@ -2493,12 +2493,21 @@ packages: dependencies: zod: 3.19.1 + /@logto/language-kit/1.0.0-beta.29_zod@3.20.0: + resolution: {integrity: sha512-+YeAkawjEq0vwwnqq8RDrDKePWE6x1q2WdpLXtj0H6SQ3GB9pXcYLecjnANHOHB4Zp9Jnxd4eBGogNRWvspikg==} + engines: {node: ^16.13.0 || ^18.12.0} + peerDependencies: + zod: ^3.19.1 + dependencies: + zod: 3.20.0 + dev: true + /@logto/node/1.0.0-beta.14: resolution: {integrity: sha512-+0S6lBBcG3pOmjEMRQnD+6X0MJ3V3E/4In59ckl/uVr/UgIufvOKWJwWCfsVKyguaO3QweJn19x7YkF8FyO31g==} dependencies: '@logto/client': 1.0.0-beta.14 '@silverhand/essentials': 1.3.0 - js-base64: 3.7.2 + js-base64: 3.7.3 node-fetch: 2.6.7 transitivePeerDependencies: - encoding @@ -3477,35 +3486,13 @@ packages: resolution: {integrity: sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ==} dev: true - /@silverhand/eslint-config-react/1.3.0_3jdvf2aalbcoibv3m53iflhmym: + /@silverhand/eslint-config-react/1.3.0_hwxyoluj7tfktess7f4itjwcee: 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_swk2g7ygmfleszo5c33j4vooni - 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_eqpuutlgonckfyjzwkrpusdvaa - transitivePeerDependencies: - - eslint - - eslint-import-resolver-webpack - - postcss - - prettier - - supports-color - - typescript - dev: true - - /@silverhand/eslint-config-react/1.3.0_qoomm4vc6ijs52fnjlal4yoenm: - 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_swk2g7ygmfleszo5c33j4vooni + '@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 @@ -3521,39 +3508,29 @@ packages: - typescript dev: true - /@silverhand/eslint-config/1.3.0_swk2g7ygmfleszo5c33j4vooni: - resolution: {integrity: sha512-0+SXJXAkUe1pg2DNn3JCEo99Weev07chQsL2iSCramXeMKjEk1R1UKjgQJM9saUGF7ovY4hlE/JjFD3PFId4DQ==} + /@silverhand/eslint-config-react/1.3.0_pzm7kshjahdwz2kcmmatnemr54: + resolution: {integrity: sha512-L6tzayeKo1RXTadIHbZKUJWzi5Pu0tjg6eoTw5mz+3FTLu4zBXK0+/jK6FeHwQ3lWt8Cj3HDIMvVG97yjoblPA==} engines: {node: ^16.0.0 || ^18.0.0} peerDependencies: - eslint: ^8.21.0 - prettier: ^2.7.1 + stylelint: ^14.9.1 dependencies: - '@silverhand/eslint-plugin-fp': 2.5.0_eslint@8.21.0 - '@typescript-eslint/eslint-plugin': 5.40.0_bomoubwgcm5gub6ncofkqpat4u - '@typescript-eslint/parser': 5.40.0_qugx7qdu5zevzvxaiqyxfiwquq - eslint: 8.21.0 - eslint-config-prettier: 8.5.0_eslint@8.21.0 - eslint-config-xo: 0.42.0_eslint@8.21.0 - eslint-config-xo-typescript: 0.53.0_4y2fwmtil766jscqcpwrpkqfje - eslint-import-resolver-typescript: 3.5.1_jatgrcxl4x7ywe7ak6cnjca2ae - eslint-plugin-consistent-default-export-name: 0.0.15 - eslint-plugin-eslint-comments: 3.2.0_eslint@8.21.0 - eslint-plugin-import: 2.26.0_7tkpoacjify653e7qftl64vwym - eslint-plugin-no-use-extend-native: 0.5.0 - eslint-plugin-node: 11.1.0_eslint@8.21.0 - eslint-plugin-prettier: 4.2.1_h62lvancfh4b7r6zn2dgodrh5e - eslint-plugin-promise: 6.1.0_eslint@8.21.0 - eslint-plugin-sql: 2.1.0_eslint@8.21.0 - eslint-plugin-unicorn: 43.0.2_eslint@8.21.0 - eslint-plugin-unused-imports: 2.0.0_kjyxfvacupbf4yx7sz4dzjz4we - prettier: 2.7.1 + '@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_eqpuutlgonckfyjzwkrpusdvaa transitivePeerDependencies: + - eslint - eslint-import-resolver-webpack + - postcss + - prettier - supports-color - typescript dev: true - /@silverhand/eslint-config/1.3.0_xygfz6avl43ipur7dlp2av7gnm: + /@silverhand/eslint-config/1.3.0_eu7dlo3qq5moigliolva3udaxa: resolution: {integrity: sha512-0+SXJXAkUe1pg2DNn3JCEo99Weev07chQsL2iSCramXeMKjEk1R1UKjgQJM9saUGF7ovY4hlE/JjFD3PFId4DQ==} engines: {node: ^16.0.0 || ^18.0.0} peerDependencies: @@ -3561,12 +3538,12 @@ packages: prettier: ^2.7.1 dependencies: '@silverhand/eslint-plugin-fp': 2.5.0_eslint@8.21.0 - '@typescript-eslint/eslint-plugin': 5.40.0_ujnp3qqzcos2fcjl53ed5mxtmq - '@typescript-eslint/parser': 5.40.0_4he5nxxgrmu5gxjroamasnmd3i + '@typescript-eslint/eslint-plugin': 5.40.0_ryuuuwjgkm45eys4ms27dfx6xm + '@typescript-eslint/parser': 5.40.0_ggwlz5rjjuds5feuls6rqqovzi eslint: 8.21.0 eslint-config-prettier: 8.5.0_eslint@8.21.0 eslint-config-xo: 0.42.0_eslint@8.21.0 - eslint-config-xo-typescript: 0.53.0_6262kjopfp2ssqpmwkpdbrlzgu + eslint-config-xo-typescript: 0.53.0_cqx3bgaw6gtoyrp3gyom2ucbru eslint-import-resolver-typescript: 3.5.1_jatgrcxl4x7ywe7ak6cnjca2ae eslint-plugin-consistent-default-export-name: 0.0.15 eslint-plugin-eslint-comments: 3.2.0_eslint@8.21.0 @@ -3605,7 +3582,7 @@ packages: lodash.orderby: 4.6.0 lodash.pick: 4.4.0 - /@silverhand/jest-config/1.2.2_zapogttls25djihwjkusccjjym: + /@silverhand/jest-config/1.2.2_ky6c64xxalg2hsll4xx3evq2dy: resolution: {integrity: sha512-sCOIHN3kIG9nyySkDao8nz6HK8VhGoUV4WG1CCriDDeGTqbHs4IprzTp1p+ChFdC8JGBCElQC0cIFrWYTFnTAQ==} engines: {node: ^16.0.0 || ^18.0.0} peerDependencies: @@ -3617,7 +3594,7 @@ packages: jest: 29.1.2_k5ytkvaprncdyzidqqws5bqksq jest-matcher-specific-error: 1.0.0 jest-transform-stub: 2.0.0 - ts-jest: 29.0.3_37jxomqt5oevoqzq6g3r6n3ili + ts-jest: 29.0.3_5xcodqox2j6ogkdcajmxw2vjdu transitivePeerDependencies: - '@babel/core' - babel-jest @@ -3625,32 +3602,23 @@ packages: - typescript dev: true - /@silverhand/ts-config-react/1.2.1_typescript@4.7.4: + /@silverhand/ts-config-react/1.2.1_typescript@4.9.4: resolution: {integrity: sha512-40BYg5gqzThCmXw+SJXnlWvSUWpFKsdfVHlguJXgdB1l8O6Yqe1jcwjHrNC/yBy8jgLInhLXuaFs86/p1g0m+Q==} engines: {node: ^16.0.0 || ^18.0.0} peerDependencies: typescript: ^4.7.4 dependencies: - '@silverhand/ts-config': 1.2.1_typescript@4.7.4 - typescript: 4.7.4 + '@silverhand/ts-config': 1.2.1_typescript@4.9.4 + typescript: 4.9.4 dev: true - /@silverhand/ts-config/1.2.1_typescript@4.7.4: + /@silverhand/ts-config/1.2.1_typescript@4.9.4: resolution: {integrity: sha512-Lm5Ydb45qKmXvlOfQfSb+1WHrdL5IBtzt+AMOR5h528H073FLzaazLiaDo4noBVT9PAVtO7kG9qjwSPzHf0k9Q==} engines: {node: ^16.0.0 || ^18.0.0} peerDependencies: typescript: ^4.7.4 dependencies: - typescript: 4.7.4 - dev: true - - /@silverhand/ts-config/1.2.1_typescript@4.9.3: - resolution: {integrity: sha512-Lm5Ydb45qKmXvlOfQfSb+1WHrdL5IBtzt+AMOR5h528H073FLzaazLiaDo4noBVT9PAVtO7kG9qjwSPzHf0k9Q==} - engines: {node: ^16.0.0 || ^18.0.0} - peerDependencies: - typescript: ^4.7.4 - dependencies: - typescript: 4.9.3 + typescript: 4.9.4 dev: true /@sinclair/typebox/0.24.46: @@ -3660,11 +3628,11 @@ packages: /@sindresorhus/is/4.2.0: resolution: {integrity: sha512-VkE3KLBmJwcCaVARtQpfuKcKv8gcBmUubrfHGF84dXuuW6jgsRYxPtzcIhPyK9WAPpRt2/xY6zkD9MnRaJzSyw==} engines: {node: '>=10'} + dev: false /@sindresorhus/is/5.3.0: resolution: {integrity: sha512-CX6t4SYQ37lzxicAqsBtxA3OseeoVrh9cSJ5PFYam0GksYlupRfy1A+Q4aYD3zvcfECLc0zO2u+ZnR2UYKvCrw==} engines: {node: '>=14.16'} - dev: false /@sinonjs/commons/1.8.3: resolution: {integrity: sha512-xkNcLAn/wZaX14RPlwizcKicDk9G3F8m2nU3L7Ukm5zBgTwiT0wsoFAHx9Jq56fJA1z/7uKGtCRu16sOUCLIHQ==} @@ -3856,13 +3824,13 @@ packages: engines: {node: '>=10'} dependencies: defer-to-connect: 2.0.1 + dev: false /@szmarczak/http-timer/5.0.1: resolution: {integrity: sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==} engines: {node: '>=14.16'} dependencies: defer-to-connect: 2.0.1 - dev: false /@testing-library/dom/8.11.1: resolution: {integrity: sha512-3KQDyx9r0RKYailW2MiYrSSKEfH0GTkI51UGEvJenvcoDoeRYs0PZpi2SXqtnMClQvCqdtTTpOfFETDTVADpAg==} @@ -3979,6 +3947,7 @@ packages: '@types/keyv': 3.1.3 '@types/node': 17.0.23 '@types/responselike': 1.0.0 + dev: false /@types/color-convert/2.0.0: resolution: {integrity: sha512-m7GG7IKKGuJUXvkZ1qqG3ChccdIM/qBBo913z+Xft0nKCX4hAU/IxKwZBU4cpRZ7GS5kV4vOblUkILtSShCPXQ==} @@ -4163,6 +4132,7 @@ packages: resolution: {integrity: sha512-FXCJgyyN3ivVgRoml4h94G/p3kY+u/B86La+QptcqJaWtBWtmc6TtkNfS40n9bIvyLteHh7zXOtgbobORKPbDg==} dependencies: '@types/node': 17.0.23 + dev: false /@types/koa-compose/3.2.5: resolution: {integrity: sha512-B8nG/OoE1ORZqCkBVsup/AKcvjdgoHnfi4pZMn5UwAPCbhk/96xyv284eBYW8JlQbQ7zDmnpFr68I/40mFoIBQ==} @@ -4360,6 +4330,7 @@ packages: resolution: {integrity: sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA==} dependencies: '@types/node': 17.0.23 + dev: false /@types/retry/0.12.1: resolution: {integrity: sha512-xoDlM2S4ortawSWORYqsdU+2rxdh4LRW9ytc3zmT37RIKQh6IHyKwwtKhKis9ah8ol07DCkZxPt8BBvPjC6v4g==} @@ -4460,7 +4431,7 @@ packages: dev: true optional: true - /@typescript-eslint/eslint-plugin/5.40.0_bomoubwgcm5gub6ncofkqpat4u: + /@typescript-eslint/eslint-plugin/5.40.0_ryuuuwjgkm45eys4ms27dfx6xm: resolution: {integrity: sha512-FIBZgS3DVJgqPwJzvZTuH4HNsZhHMa9SjxTKAZTlMsPw/UzpEjcf9f4dfgDJEHjK+HboUJo123Eshl6niwEm/Q==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -4471,48 +4442,22 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/parser': 5.40.0_qugx7qdu5zevzvxaiqyxfiwquq + '@typescript-eslint/parser': 5.40.0_ggwlz5rjjuds5feuls6rqqovzi '@typescript-eslint/scope-manager': 5.40.0 - '@typescript-eslint/type-utils': 5.40.0_qugx7qdu5zevzvxaiqyxfiwquq - '@typescript-eslint/utils': 5.40.0_qugx7qdu5zevzvxaiqyxfiwquq + '@typescript-eslint/type-utils': 5.40.0_ggwlz5rjjuds5feuls6rqqovzi + '@typescript-eslint/utils': 5.40.0_ggwlz5rjjuds5feuls6rqqovzi debug: 4.3.4 eslint: 8.21.0 ignore: 5.2.0 regexpp: 3.2.0 semver: 7.3.8 - tsutils: 3.21.0_typescript@4.7.4 - typescript: 4.7.4 + tsutils: 3.21.0_typescript@4.9.4 + typescript: 4.9.4 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/eslint-plugin/5.40.0_ujnp3qqzcos2fcjl53ed5mxtmq: - resolution: {integrity: sha512-FIBZgS3DVJgqPwJzvZTuH4HNsZhHMa9SjxTKAZTlMsPw/UzpEjcf9f4dfgDJEHjK+HboUJo123Eshl6niwEm/Q==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - '@typescript-eslint/parser': ^5.0.0 - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@typescript-eslint/parser': 5.40.0_4he5nxxgrmu5gxjroamasnmd3i - '@typescript-eslint/scope-manager': 5.40.0 - '@typescript-eslint/type-utils': 5.40.0_4he5nxxgrmu5gxjroamasnmd3i - '@typescript-eslint/utils': 5.40.0_4he5nxxgrmu5gxjroamasnmd3i - debug: 4.3.4 - eslint: 8.21.0 - ignore: 5.2.0 - regexpp: 3.2.0 - semver: 7.3.8 - tsutils: 3.21.0_typescript@4.9.3 - typescript: 4.9.3 - transitivePeerDependencies: - - supports-color - dev: true - - /@typescript-eslint/parser/5.40.0_4he5nxxgrmu5gxjroamasnmd3i: + /@typescript-eslint/parser/5.40.0_ggwlz5rjjuds5feuls6rqqovzi: resolution: {integrity: sha512-Ah5gqyX2ySkiuYeOIDg7ap51/b63QgWZA7w6AHtFrag7aH0lRQPbLzUjk0c9o5/KZ6JRkTTDKShL4AUrQa6/hw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -4524,30 +4469,10 @@ packages: dependencies: '@typescript-eslint/scope-manager': 5.40.0 '@typescript-eslint/types': 5.40.0 - '@typescript-eslint/typescript-estree': 5.40.0_typescript@4.9.3 + '@typescript-eslint/typescript-estree': 5.40.0_typescript@4.9.4 debug: 4.3.4 eslint: 8.21.0 - typescript: 4.9.3 - transitivePeerDependencies: - - supports-color - dev: true - - /@typescript-eslint/parser/5.40.0_qugx7qdu5zevzvxaiqyxfiwquq: - resolution: {integrity: sha512-Ah5gqyX2ySkiuYeOIDg7ap51/b63QgWZA7w6AHtFrag7aH0lRQPbLzUjk0c9o5/KZ6JRkTTDKShL4AUrQa6/hw==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@typescript-eslint/scope-manager': 5.40.0 - '@typescript-eslint/types': 5.40.0 - '@typescript-eslint/typescript-estree': 5.40.0_typescript@4.7.4 - debug: 4.3.4 - eslint: 8.21.0 - typescript: 4.7.4 + typescript: 4.9.4 transitivePeerDependencies: - supports-color dev: true @@ -4560,7 +4485,7 @@ packages: '@typescript-eslint/visitor-keys': 5.40.0 dev: true - /@typescript-eslint/type-utils/5.40.0_4he5nxxgrmu5gxjroamasnmd3i: + /@typescript-eslint/type-utils/5.40.0_ggwlz5rjjuds5feuls6rqqovzi: resolution: {integrity: sha512-nfuSdKEZY2TpnPz5covjJqav+g5qeBqwSHKBvz7Vm1SAfy93SwKk/JeSTymruDGItTwNijSsno5LhOHRS1pcfw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -4570,32 +4495,12 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 5.40.0_typescript@4.9.3 - '@typescript-eslint/utils': 5.40.0_4he5nxxgrmu5gxjroamasnmd3i + '@typescript-eslint/typescript-estree': 5.40.0_typescript@4.9.4 + '@typescript-eslint/utils': 5.40.0_ggwlz5rjjuds5feuls6rqqovzi debug: 4.3.4 eslint: 8.21.0 - tsutils: 3.21.0_typescript@4.9.3 - typescript: 4.9.3 - transitivePeerDependencies: - - supports-color - dev: true - - /@typescript-eslint/type-utils/5.40.0_qugx7qdu5zevzvxaiqyxfiwquq: - resolution: {integrity: sha512-nfuSdKEZY2TpnPz5covjJqav+g5qeBqwSHKBvz7Vm1SAfy93SwKk/JeSTymruDGItTwNijSsno5LhOHRS1pcfw==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - eslint: '*' - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@typescript-eslint/typescript-estree': 5.40.0_typescript@4.7.4 - '@typescript-eslint/utils': 5.40.0_qugx7qdu5zevzvxaiqyxfiwquq - debug: 4.3.4 - eslint: 8.21.0 - tsutils: 3.21.0_typescript@4.7.4 - typescript: 4.7.4 + tsutils: 3.21.0_typescript@4.9.4 + typescript: 4.9.4 transitivePeerDependencies: - supports-color dev: true @@ -4605,7 +4510,7 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /@typescript-eslint/typescript-estree/5.40.0_typescript@4.7.4: + /@typescript-eslint/typescript-estree/5.40.0_typescript@4.9.4: resolution: {integrity: sha512-b0GYlDj8TLTOqwX7EGbw2gL5EXS2CPEWhF9nGJiGmEcmlpNBjyHsTwbqpyIEPVpl6br4UcBOYlcI2FJVtJkYhg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -4620,34 +4525,13 @@ packages: globby: 11.1.0 is-glob: 4.0.3 semver: 7.3.8 - tsutils: 3.21.0_typescript@4.7.4 - typescript: 4.7.4 + tsutils: 3.21.0_typescript@4.9.4 + typescript: 4.9.4 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/typescript-estree/5.40.0_typescript@4.9.3: - resolution: {integrity: sha512-b0GYlDj8TLTOqwX7EGbw2gL5EXS2CPEWhF9nGJiGmEcmlpNBjyHsTwbqpyIEPVpl6br4UcBOYlcI2FJVtJkYhg==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@typescript-eslint/types': 5.40.0 - '@typescript-eslint/visitor-keys': 5.40.0 - debug: 4.3.4 - globby: 11.1.0 - is-glob: 4.0.3 - semver: 7.3.8 - tsutils: 3.21.0_typescript@4.9.3 - typescript: 4.9.3 - transitivePeerDependencies: - - supports-color - dev: true - - /@typescript-eslint/utils/5.40.0_4he5nxxgrmu5gxjroamasnmd3i: + /@typescript-eslint/utils/5.40.0_ggwlz5rjjuds5feuls6rqqovzi: resolution: {integrity: sha512-MO0y3T5BQ5+tkkuYZJBjePewsY+cQnfkYeRqS6tPh28niiIwPnQ1t59CSRcs1ZwJJNOdWw7rv9pF8aP58IMihA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -4656,26 +4540,7 @@ packages: '@types/json-schema': 7.0.11 '@typescript-eslint/scope-manager': 5.40.0 '@typescript-eslint/types': 5.40.0 - '@typescript-eslint/typescript-estree': 5.40.0_typescript@4.9.3 - eslint: 8.21.0 - eslint-scope: 5.1.1 - eslint-utils: 3.0.0_eslint@8.21.0 - semver: 7.3.8 - transitivePeerDependencies: - - supports-color - - typescript - dev: true - - /@typescript-eslint/utils/5.40.0_qugx7qdu5zevzvxaiqyxfiwquq: - resolution: {integrity: sha512-MO0y3T5BQ5+tkkuYZJBjePewsY+cQnfkYeRqS6tPh28niiIwPnQ1t59CSRcs1ZwJJNOdWw7rv9pF8aP58IMihA==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - dependencies: - '@types/json-schema': 7.0.11 - '@typescript-eslint/scope-manager': 5.40.0 - '@typescript-eslint/types': 5.40.0 - '@typescript-eslint/typescript-estree': 5.40.0_typescript@4.7.4 + '@typescript-eslint/typescript-estree': 5.40.0_typescript@4.9.4 eslint: 8.21.0 eslint-scope: 5.1.1 eslint-utils: 3.0.0_eslint@8.21.0 @@ -5289,6 +5154,7 @@ packages: /cacheable-lookup/5.0.4: resolution: {integrity: sha512-2/kNscPhpcxrOigMZzbiWF7dz8ilhb/nIHU3EyZiXWXpeq/au8qJ8VhdftMkty3n7Gj6HIGalQG8oiBNB3AJgA==} engines: {node: '>=10.6.0'} + dev: false /cacheable-lookup/6.0.4: resolution: {integrity: sha512-mbcDEZCkv2CZF4G01kr8eBd/5agkt9oCqz75tJMSIsquvRZ2sL6Hi5zGVKi/0OSC9oO1GHfJ2AV0ZIOY9vye0A==} @@ -5298,7 +5164,6 @@ packages: /cacheable-lookup/7.0.0: resolution: {integrity: sha512-+qJyx4xiKra8mZrcwhjMRMUhD5NR1R8esPkzIYxX96JiecFoxAXFuz/GpR3+ev4PE1WamHip78wV0vcmPQtp8w==} engines: {node: '>=14.16'} - dev: false /cacheable-request/10.2.2: resolution: {integrity: sha512-KxjQZM3UIo7/J6W4sLpwFvu1GB3Whv8NtZ8ZrUL284eiQjiXeeqWTdhixNrp/NLZ/JNuFBo6BD4ZaO8ZJ5BN8Q==} @@ -5311,7 +5176,6 @@ packages: mimic-response: 4.0.0 normalize-url: 7.2.0 responselike: 3.0.0 - dev: false /cacheable-request/7.0.2: resolution: {integrity: sha512-pouW8/FmiPQbuGpkXQ9BAPv/Mo5xDGANgSNXzTzJ8DrKGuXOssM4wIQRjfanNRh3Yu5cfYPvcorqbhg2KIJtew==} @@ -5324,6 +5188,7 @@ packages: lowercase-keys: 2.0.0 normalize-url: 6.1.0 responselike: 2.0.0 + dev: false /call-bind/1.0.2: resolution: {integrity: sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==} @@ -5585,6 +5450,7 @@ packages: resolution: {integrity: sha512-yjLXh88P599UOyPTFX0POsd7WxnbsVsGohcwzHOLspIhhpalPw1BcqED8NblyZLKcGrL8dTgMlcaZxV2jAD41Q==} dependencies: mimic-response: 1.0.1 + dev: false /clone/1.0.4: resolution: {integrity: sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==} @@ -5803,7 +5669,7 @@ packages: resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==} dev: true - /cosmiconfig-typescript-loader/2.0.0_bjctuninx3nzqxltyvshqte2ni: + /cosmiconfig-typescript-loader/2.0.0_73inix45wpcdjnppmmovzbfudu: resolution: {integrity: sha512-2NlGul/E3vTQEANqPziqkA01vfiuUU8vT0jZAuUIjEW8u3eCcnCQWLggapCjhbF76s7KQF0fM0kXSKmzaDaG1g==} engines: {node: '>=12', npm: '>=6'} peerDependencies: @@ -5812,8 +5678,8 @@ packages: dependencies: '@types/node': 17.0.23 cosmiconfig: 7.0.1 - ts-node: 10.7.0_bjctuninx3nzqxltyvshqte2ni - typescript: 4.7.4 + ts-node: 10.7.0_73inix45wpcdjnppmmovzbfudu + typescript: 4.9.4 transitivePeerDependencies: - '@swc/core' - '@swc/wasm' @@ -6602,7 +6468,7 @@ packages: eslint-plugin-react-hooks: 4.6.0_eslint@8.21.0 dev: true - /eslint-config-xo-typescript/0.53.0_4y2fwmtil766jscqcpwrpkqfje: + /eslint-config-xo-typescript/0.53.0_cqx3bgaw6gtoyrp3gyom2ucbru: resolution: {integrity: sha512-IJ1n70egMPTou/41HoGGFbLf/2WCsVW5lSUxOSklrR8T1221fMRPVJxIVZ3evr8R+N5wR6uzg/0uzSymwWA5Bg==} engines: {node: '>=12'} peerDependencies: @@ -6611,25 +6477,10 @@ packages: eslint: '>=8.0.0' typescript: '>=4.4' dependencies: - '@typescript-eslint/eslint-plugin': 5.40.0_bomoubwgcm5gub6ncofkqpat4u - '@typescript-eslint/parser': 5.40.0_qugx7qdu5zevzvxaiqyxfiwquq + '@typescript-eslint/eslint-plugin': 5.40.0_ryuuuwjgkm45eys4ms27dfx6xm + '@typescript-eslint/parser': 5.40.0_ggwlz5rjjuds5feuls6rqqovzi eslint: 8.21.0 - typescript: 4.7.4 - dev: true - - /eslint-config-xo-typescript/0.53.0_6262kjopfp2ssqpmwkpdbrlzgu: - resolution: {integrity: sha512-IJ1n70egMPTou/41HoGGFbLf/2WCsVW5lSUxOSklrR8T1221fMRPVJxIVZ3evr8R+N5wR6uzg/0uzSymwWA5Bg==} - engines: {node: '>=12'} - peerDependencies: - '@typescript-eslint/eslint-plugin': '>=5.31.0' - '@typescript-eslint/parser': '>=5.31.0' - eslint: '>=8.0.0' - typescript: '>=4.4' - dependencies: - '@typescript-eslint/eslint-plugin': 5.40.0_ujnp3qqzcos2fcjl53ed5mxtmq - '@typescript-eslint/parser': 5.40.0_4he5nxxgrmu5gxjroamasnmd3i - eslint: 8.21.0 - typescript: 4.9.3 + typescript: 4.9.4 dev: true /eslint-config-xo/0.42.0_eslint@8.21.0: @@ -6692,7 +6543,7 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - '@typescript-eslint/parser': 5.40.0_qugx7qdu5zevzvxaiqyxfiwquq + '@typescript-eslint/parser': 5.40.0_ggwlz5rjjuds5feuls6rqqovzi debug: 3.2.7 eslint: 8.21.0 eslint-import-resolver-node: 0.3.6 @@ -6741,7 +6592,7 @@ packages: '@typescript-eslint/parser': optional: true dependencies: - '@typescript-eslint/parser': 5.40.0_qugx7qdu5zevzvxaiqyxfiwquq + '@typescript-eslint/parser': 5.40.0_ggwlz5rjjuds5feuls6rqqovzi array-includes: 3.1.5 array.prototype.flat: 1.3.0 debug: 2.6.9 @@ -6916,7 +6767,7 @@ packages: '@typescript-eslint/eslint-plugin': optional: true dependencies: - '@typescript-eslint/eslint-plugin': 5.40.0_bomoubwgcm5gub6ncofkqpat4u + '@typescript-eslint/eslint-plugin': 5.40.0_ryuuuwjgkm45eys4ms27dfx6xm eslint: 8.21.0 eslint-rule-composer: 0.3.0 dev: true @@ -7403,7 +7254,6 @@ packages: /form-data-encoder/2.1.3: resolution: {integrity: sha512-KqU0nnPMgIJcCOFTNJFEA8epcseEaoox4XZffTgy8jlI6pL/5EFyR54NRG7CnCJN0biY7q52DO3MH6/sJ/TKlQ==} engines: {node: '>= 14.17'} - dev: false /form-data/4.0.0: resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} @@ -7749,6 +7599,7 @@ packages: lowercase-keys: 2.0.0 p-cancelable: 2.1.1 responselike: 2.0.0 + dev: false /got/12.5.3: resolution: {integrity: sha512-8wKnb9MGU8IPGRIo+/ukTy9XLJBwDiCpIf5TVzQ9Cpol50eMTpBq2GAuDsuDIz7hTYmZgMgC1e9ydr6kSDWs3w==} @@ -7765,10 +7616,10 @@ packages: lowercase-keys: 3.0.0 p-cancelable: 3.0.0 responselike: 3.0.0 - dev: false /graceful-fs/4.2.10: resolution: {integrity: sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==} + dev: true /graceful-fs/4.2.9: resolution: {integrity: sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==} @@ -8118,6 +7969,7 @@ packages: dependencies: quick-lru: 5.1.1 resolve-alpn: 1.2.1 + dev: false /http2-wrapper/2.2.0: resolution: {integrity: sha512-kZB0wxMo0sh1PehyjJUWRFEd99KC5TLjZ2cULC4f9iqJBAmKQQXEICjxl5iPJRwP40dpeHFqqhm7tYCvODpqpQ==} @@ -8125,7 +7977,6 @@ packages: dependencies: quick-lru: 5.1.1 resolve-alpn: 1.2.1 - dev: false /https-proxy-agent/5.0.1: resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} @@ -9072,7 +8923,7 @@ packages: pretty-format: 29.2.1 slash: 3.0.0 strip-json-comments: 3.1.1 - ts-node: 10.9.1_ccwudyfw5se7hgalwgkzhn2yp4 + ts-node: 10.9.1_ace2mtubvwruu4qt46fm3vtq3a transitivePeerDependencies: - supports-color dev: true @@ -9112,7 +8963,7 @@ packages: pretty-format: 29.2.1 slash: 3.0.0 strip-json-comments: 3.1.1 - ts-node: 10.9.1_ccwudyfw5se7hgalwgkzhn2yp4 + ts-node: 10.9.1_ace2mtubvwruu4qt46fm3vtq3a transitivePeerDependencies: - supports-color dev: true @@ -10006,10 +9857,18 @@ packages: /jose/4.11.0: resolution: {integrity: sha512-wLe+lJHeG8Xt6uEubS4x0LVjS/3kXXu9dGoj9BNnlhYq7Kts0Pbb2pvv5KiI0yaKH/eaiR0LUOBhOVo9ktd05A==} + /jose/4.11.1: + resolution: {integrity: sha512-YRv4Tk/Wlug8qicwqFNFVEZSdbROCHRAC6qu/i0dyNKr5JQdoa2pIGoS04lLO/jXQX7Z9omoNewYIVIxqZBd9Q==} + dev: true + /js-base64/3.7.2: resolution: {integrity: sha512-NnRs6dsyqUXejqk/yv2aiXlAvOs56sLkX6nUdeaNezI5LFFLlsZjOThmwnrcwh5ZZRwZlCMnVAY3CvhIhoVEKQ==} dev: true + /js-base64/3.7.3: + resolution: {integrity: sha512-PAr6Xg2jvd7MCR6Ld9Jg3BmTcjYsHEBx1VlwEwULb/qowPf5VD9kEMagj23Gm7JRnSvE/Da/57nChZjnvL8v6A==} + dev: true + /js-tokens/4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} @@ -10130,7 +9989,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==} @@ -10160,12 +10019,12 @@ packages: resolution: {integrity: sha512-vqNHbAc8BBsxk+7QBYLW0Y219rWcClspR6WSeoHYKG5mnsSoOH+BL1pWq02DDCVdvvuUny5rkBlzMRzoqc+GIg==} dependencies: json-buffer: 3.0.1 + dev: false /keyv/4.5.2: resolution: {integrity: sha512-5MHbFaKn8cNSmVW7BYnijeAVlE4cYA/SVkifVgrh7yotnfhKmjuXpDKjrABLnT0SfHWV21P8ow07OGfRrNDg8g==} dependencies: json-buffer: 3.0.1 - dev: false /kind-of/2.0.1: resolution: {integrity: sha512-0u8i1NZ/mg0b+W3MGGw5I7+6Eib2nx72S/QvXa0hYjEkjTknYmEYQJwGu3mLC0BrhtJjtQafTkyRUQ75Kx0LVg==} @@ -10649,11 +10508,11 @@ packages: /lowercase-keys/2.0.0: resolution: {integrity: sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==} engines: {node: '>=8'} + dev: false /lowercase-keys/3.0.0: resolution: {integrity: sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - dev: false /lowlight/1.20.0: resolution: {integrity: sha512-8Ktj+prEb1RoCPkEOrPMYUN/nCggB7qAWe3a7OpMjWQkh3l2RD5wKRQ+o8Q8YuI9RG/xs95waaI/E6ym/7NsTw==} @@ -11237,6 +11096,7 @@ packages: /mimic-response/1.0.1: resolution: {integrity: sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==} engines: {node: '>=4'} + dev: false /mimic-response/3.1.0: resolution: {integrity: sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==} @@ -11245,7 +11105,6 @@ packages: /mimic-response/4.0.0: resolution: {integrity: sha512-e5ISH9xMYU0DzrT+jl8q2ze9D6eWBto+I8CNpe+VI+K2J/F/k3PdkdTdz4wvGVH4NTpo+NRYTVIuMQEMMcsLqg==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - dev: false /min-indent/1.0.1: resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==} @@ -11503,11 +11362,11 @@ packages: /normalize-url/6.1.0: resolution: {integrity: sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==} engines: {node: '>=10'} + dev: false /normalize-url/7.2.0: resolution: {integrity: sha512-uhXOdZry0L6M2UIo9BTt7FdpBDiAGN/7oItedQwPKh8jh31ZlvC8U9Xl/EJ3aijDHaywXTW3QbZ6LuCocur1YA==} engines: {node: '>=12.20'} - dev: false /npm-run-path/4.0.1: resolution: {integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==} @@ -11761,11 +11620,11 @@ packages: /p-cancelable/2.1.1: resolution: {integrity: sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg==} engines: {node: '>=8'} + dev: false /p-cancelable/3.0.0: resolution: {integrity: sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw==} engines: {node: '>=12.20'} - dev: false /p-defer/3.0.0: resolution: {integrity: sha512-ugZxsxmtTln604yeYd29EGrNhazN2lywetzpKhfmQjW/VJmhpDmWbiX+h0zL8V91R0UXkhb3KtPmyq9PZw3aYw==} @@ -13283,13 +13142,13 @@ packages: resolution: {integrity: sha512-xH48u3FTB9VsZw7R+vvgaKeLKzT6jOogbQhEe/jewwnZgzPcnyWui2Av6JpoYZF/91uueC+lqhWqeURw5/qhCw==} dependencies: lowercase-keys: 2.0.0 + dev: false /responselike/3.0.0: resolution: {integrity: sha512-40yHxbNcl2+rzXvZuVkrYohathsSJlMTXKryG5y8uciHv1+xDLHQpgjG64JUO9nrEq2jGLH6IZ8BcZyw3wrweg==} engines: {node: '>=14.16'} dependencies: lowercase-keys: 3.0.0 - dev: false /restore-cursor/3.1.0: resolution: {integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==} @@ -14493,7 +14352,7 @@ packages: resolution: {integrity: sha512-AqTiAOLcj85xS7vQ8QkAV41hPDIJ71XJB4RCUrzo/1GM2CQwhkJGaf9Hgr7BOugMRpgGUrqRg/DrBDl4H40+8g==} dev: true - /ts-jest/29.0.3_37jxomqt5oevoqzq6g3r6n3ili: + /ts-jest/29.0.3_5xcodqox2j6ogkdcajmxw2vjdu: resolution: {integrity: sha512-Ibygvmuyq1qp/z3yTh9QTwVVAbFdDy/+4BtIQR2sp6baF2SJU/8CKK/hhnGIDY2L90Az2jIqTwZPnN2p+BweiQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true @@ -14523,11 +14382,11 @@ packages: lodash.memoize: 4.1.2 make-error: 1.3.6 semver: 7.3.8 - typescript: 4.7.4 + typescript: 4.9.4 yargs-parser: 21.1.1 dev: true - /ts-node/10.7.0_bjctuninx3nzqxltyvshqte2ni: + /ts-node/10.7.0_73inix45wpcdjnppmmovzbfudu: resolution: {integrity: sha512-TbIGS4xgJoX2i3do417KSaep1uRAW/Lu+WAL2doDHC0D6ummjirVOXU5/7aiZotbQ5p1Zp9tP7U6cYhA0O7M8A==} hasBin: true peerDependencies: @@ -14553,12 +14412,12 @@ packages: create-require: 1.1.1 diff: 4.0.2 make-error: 1.3.6 - typescript: 4.7.4 + typescript: 4.9.4 v8-compile-cache-lib: 3.0.1 yn: 3.1.1 dev: true - /ts-node/10.9.1_ccwudyfw5se7hgalwgkzhn2yp4: + /ts-node/10.9.1_ace2mtubvwruu4qt46fm3vtq3a: resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} hasBin: true peerDependencies: @@ -14584,7 +14443,7 @@ packages: create-require: 1.1.1 diff: 4.0.2 make-error: 1.3.6 - typescript: 4.7.4 + typescript: 4.9.4 v8-compile-cache-lib: 3.0.1 yn: 3.1.1 dev: true @@ -14618,24 +14477,14 @@ packages: engines: {node: '>=0.6.x'} dev: false - /tsutils/3.21.0_typescript@4.7.4: + /tsutils/3.21.0_typescript@4.9.4: resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} engines: {node: '>= 6'} peerDependencies: typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta' dependencies: tslib: 1.14.1 - typescript: 4.7.4 - dev: true - - /tsutils/3.21.0_typescript@4.9.3: - resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} - engines: {node: '>= 6'} - peerDependencies: - typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta' - dependencies: - tslib: 1.14.1 - typescript: 4.9.3 + typescript: 4.9.4 dev: true /tty-table/4.1.6: @@ -14723,14 +14572,8 @@ packages: /typedarray/0.0.6: resolution: {integrity: sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==} - /typescript/4.7.4: - resolution: {integrity: sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==} - engines: {node: '>=4.2.0'} - hasBin: true - dev: true - - /typescript/4.9.3: - resolution: {integrity: sha512-CIfGzTelbKNEnLpLdGFgdyKhG23CKdKgQPOBc+OUNrkJ2vr+KSzsSV5kq5iWhEQbok+quxgGzrAtGWCyU7tHnA==} + /typescript/4.9.4: + resolution: {integrity: sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==} engines: {node: '>=4.2.0'} hasBin: true dev: true @@ -15384,6 +15227,10 @@ packages: /zod/3.19.1: resolution: {integrity: sha512-LYjZsEDhCdYET9ikFu6dVPGp2YH9DegXjdJToSzD9rO6fy4qiRYFoyEYwps88OseJlPyl2NOe2iJuhEhL7IpEA==} + /zod/3.20.0: + resolution: {integrity: sha512-ZWxs7oM5ixoo1BMoxTNeDMYSih/F/FUnExsnRtHT04rG6q0Bd74TKS45RGXw07TOalOZyyzdKaYH38k8yTEv9A==} + dev: true + /zwitch/1.0.5: resolution: {integrity: sha512-V50KMwwzqJV0NpZIZFwfOD5/lyny3WlSzRiXgA0G7VUnRlqttta1L6UQIHzd6EuBY/cHGfwTIck7w1yH6Q5zUw==} dev: true From 0558195a90e04bcf411a8549dc1dd73bf60873b5 Mon Sep 17 00:00:00 2001 From: Gao Sun Date: Mon, 12 Dec 2022 21:23:38 +0800 Subject: [PATCH 3/4] chore(console): add fixme comment --- packages/console/src/components/RadioGroup/index.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/console/src/components/RadioGroup/index.tsx b/packages/console/src/components/RadioGroup/index.tsx index a0061869b..cd5209316 100644 --- a/packages/console/src/components/RadioGroup/index.tsx +++ b/packages/console/src/components/RadioGroup/index.tsx @@ -26,6 +26,8 @@ const RadioGroup = ( return child; } + // FIXME: @Charles + // @ts-expect-error to be fixed return cloneElement(child, { name, isChecked: value === child.props.value, From a805124437e8066f1b39751908ff0279770a59e2 Mon Sep 17 00:00:00 2001 From: Gao Sun Date: Mon, 12 Dec 2022 21:52:17 +0800 Subject: [PATCH 4/4] refactor: misc. issue fix --- .github/workflows/main.yml | 4 ++-- packages/cli/jest.config.js | 1 + packages/cli/package.json | 4 ++-- packages/cli/tsconfig.json | 2 +- packages/core/package.json | 2 +- packages/core/tsconfig.base.json | 2 +- packages/integration-tests/package.json | 4 +--- .../integration-tests/src/tests/api/application.test.ts | 7 ++++++- packages/phrases-ui/package.json | 1 + packages/phrases-ui/tsconfig.json | 2 +- packages/phrases/package.json | 1 + packages/phrases/tsconfig.json | 2 +- packages/schemas/jest.config.js | 1 + packages/schemas/package.json | 4 ++-- packages/schemas/tsconfig.json | 2 +- packages/shared/jest.config.js | 1 + packages/shared/package.json | 2 +- packages/shared/src/database/utils.test.ts | 2 ++ packages/shared/tsconfig.json | 2 +- pnpm-lock.yaml | 6 +----- 20 files changed, 29 insertions(+), 23 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ce7f5aeb4..abca19613 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -61,8 +61,8 @@ jobs: with: node-version: ${{ matrix.node_version }} - - name: Prepack - run: pnpm prepack + - name: Build for test + run: pnpm -r build:test - name: Test run: pnpm ci:test diff --git a/packages/cli/jest.config.js b/packages/cli/jest.config.js index 652de5472..3fd28f230 100644 --- a/packages/cli/jest.config.js +++ b/packages/cli/jest.config.js @@ -1,3 +1,4 @@ +/** @type {import('jest').Config} */ const config = { coveragePathIgnorePatterns: ['/node_modules/', '/src/__mocks__/'], coverageReporters: ['text-summary', 'lcov'], diff --git a/packages/cli/package.json b/packages/cli/package.json index 4829c6544..b5494624c 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -25,7 +25,7 @@ "precommit": "lint-staged", "prepare:package-json": "node -p \"'export const packageJson = ' + JSON.stringify(require('./package.json'), undefined, 2) + ';'\" > src/package-json.ts", "build": "rimraf lib && pnpm prepare:package-json && tsc -p tsconfig.build.json", - "build:test": "rm -rf lib/ && tsc -p tsconfig.test.json --sourcemap", + "build:test": "rimraf lib/ && pnpm prepare:package-json && tsc -p tsconfig.test.json --sourcemap", "dev": "tsc -p tsconfig.build.json --watch --preserveWatchOutput --incremental", "start": "node .", "start:dev": "pnpm build && node .", @@ -33,7 +33,7 @@ "lint:report": "pnpm lint --format json --output-file report.json", "test:only": "NODE_OPTIONS=--experimental-vm-modules jest", "test": "pnpm build:test && pnpm test:only", - "test:ci": "pnpm run test", + "test:ci": "pnpm run test:only", "prepack": "pnpm build" }, "engines": { diff --git a/packages/cli/tsconfig.json b/packages/cli/tsconfig.json index d706f486e..50fa1e84b 100644 --- a/packages/cli/tsconfig.json +++ b/packages/cli/tsconfig.json @@ -4,7 +4,7 @@ "outDir": "lib", "declaration": true, "moduleResolution": "nodenext", - "module": "es2022", + "module": "esnext", "target": "es2022", "types": ["node", "jest"] }, diff --git a/packages/core/package.json b/packages/core/package.json index adc7260d9..36d689e06 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -21,7 +21,7 @@ "start": "NODE_ENV=production node build/index.js", "test:only": "NODE_OPTIONS=--experimental-vm-modules jest", "test": "pnpm build:test && pnpm test:only", - "test:ci": "pnpm run test --coverage --silent", + "test:ci": "pnpm run test:only --coverage --silent", "test:report": "codecov -F core" }, "dependencies": { diff --git a/packages/core/tsconfig.base.json b/packages/core/tsconfig.base.json index 75db7efcc..247fd3037 100644 --- a/packages/core/tsconfig.base.json +++ b/packages/core/tsconfig.base.json @@ -2,7 +2,7 @@ "extends": "@silverhand/ts-config/tsconfig.base", "compilerOptions": { "moduleResolution": "nodenext", - "module": "es2022", + "module": "esnext", "declaration": false, "outDir": "build", "baseUrl": ".", diff --git a/packages/integration-tests/package.json b/packages/integration-tests/package.json index d11ff0f5b..cb53e05d5 100644 --- a/packages/integration-tests/package.json +++ b/packages/integration-tests/package.json @@ -15,7 +15,7 @@ "test": "pnpm build && pnpm test:api && pnpm test:ui", "test:api": "pnpm test:only -i ./lib/tests/api", "test:ui": "pnpm test:only -i --config=jest.config.ui.js ./lib/tests/ui", - "lint": "eslint --ext .ts src tests", + "lint": "eslint --ext .ts src", "lint:report": "pnpm lint --format json --output-file report.json", "start": "pnpm test" }, @@ -27,7 +27,6 @@ "@peculiar/webcrypto": "^1.3.3", "@silverhand/eslint-config": "1.3.0", "@silverhand/essentials": "^1.3.0", - "@silverhand/jest-config": "1.2.2", "@silverhand/ts-config": "1.2.1", "@types/jest": "^29.1.2", "@types/jest-environment-puppeteer": "^5.0.2", @@ -43,7 +42,6 @@ "prettier": "^2.7.1", "puppeteer": "^19.0.0", "text-encoder": "^0.0.4", - "ts-node": "^10.9.1", "typescript": "^4.9.4" }, "engines": { diff --git a/packages/integration-tests/src/tests/api/application.test.ts b/packages/integration-tests/src/tests/api/application.test.ts index 0b27fc79f..a9aed13f6 100644 --- a/packages/integration-tests/src/tests/api/application.test.ts +++ b/packages/integration-tests/src/tests/api/application.test.ts @@ -2,7 +2,12 @@ import { ApplicationType } from '@logto/schemas'; import { demoAppApplicationId } from '@logto/schemas/lib/seeds'; import { HTTPError } from 'got'; -import { createApplication, getApplication, updateApplication, deleteApplication } from '#src/api/index.js'; +import { + createApplication, + getApplication, + updateApplication, + deleteApplication, +} from '#src/api/index.js'; describe('admin console application', () => { it('should get demo app details successfully', async () => { diff --git a/packages/phrases-ui/package.json b/packages/phrases-ui/package.json index 7a5f208cc..04f6f4cdd 100644 --- a/packages/phrases-ui/package.json +++ b/packages/phrases-ui/package.json @@ -23,6 +23,7 @@ "scripts": { "precommit": "lint-staged", "build": "rm -rf lib/ && tsc", + "build:test": "pnpm build", "dev": "tsc --watch --preserveWatchOutput --incremental", "lint": "eslint --ext .ts src", "lint:report": "pnpm lint --format json --output-file report.json", diff --git a/packages/phrases-ui/tsconfig.json b/packages/phrases-ui/tsconfig.json index b28c5b67e..cd964b281 100644 --- a/packages/phrases-ui/tsconfig.json +++ b/packages/phrases-ui/tsconfig.json @@ -4,7 +4,7 @@ "outDir": "lib", "declaration": true, "moduleResolution": "nodenext", - "module": "es2022" + "module": "esnext" }, "include": ["src"] } diff --git a/packages/phrases/package.json b/packages/phrases/package.json index 75e20b23a..8c0ae5f21 100644 --- a/packages/phrases/package.json +++ b/packages/phrases/package.json @@ -20,6 +20,7 @@ "scripts": { "precommit": "lint-staged", "build": "rm -rf lib/ && tsc", + "build:test": "pnpm build", "dev": "tsc --watch --preserveWatchOutput --incremental", "lint": "eslint --ext .ts src", "lint:report": "pnpm lint --format json --output-file report.json", diff --git a/packages/phrases/tsconfig.json b/packages/phrases/tsconfig.json index 255f91f40..41e099231 100644 --- a/packages/phrases/tsconfig.json +++ b/packages/phrases/tsconfig.json @@ -4,7 +4,7 @@ "outDir": "lib", "declaration": true, "moduleResolution": "nodenext", - "module": "es2022" + "module": "esnext" }, "include": [ "src" diff --git a/packages/schemas/jest.config.js b/packages/schemas/jest.config.js index 652de5472..3fd28f230 100644 --- a/packages/schemas/jest.config.js +++ b/packages/schemas/jest.config.js @@ -1,3 +1,4 @@ +/** @type {import('jest').Config} */ const config = { coveragePathIgnorePatterns: ['/node_modules/', '/src/__mocks__/'], coverageReporters: ['text-summary', 'lcov'], diff --git a/packages/schemas/package.json b/packages/schemas/package.json index a4b093f4b..457f716bb 100644 --- a/packages/schemas/package.json +++ b/packages/schemas/package.json @@ -20,14 +20,14 @@ "generate": "./generate.sh", "build:alterations": "rm -rf alterations-js && tsc -p tsconfig.build.alterations.json", "build": "pnpm generate && rm -rf lib/ && tsc -p tsconfig.build.json && pnpm build:alterations", - "build:test": "rm -rf lib/ && tsc -p tsconfig.test.json --sourcemap", + "build:test": "pnpm generate && rm -rf lib/ && tsc -p tsconfig.test.json --sourcemap", "dev": "tsc -p tsconfig.build.json --watch --preserveWatchOutput --incremental", "lint": "eslint --ext .ts src", "lint:report": "pnpm lint --format json --output-file report.json", "prepack": "pnpm build", "test:only": "NODE_OPTIONS=--experimental-vm-modules jest", "test": "pnpm build:test && pnpm test:only", - "test:ci": "pnpm run test" + "test:ci": "pnpm run test:only" }, "engines": { "node": "^16.13.0 || ^18.12.0" diff --git a/packages/schemas/tsconfig.json b/packages/schemas/tsconfig.json index f07ef0259..05e3acb09 100644 --- a/packages/schemas/tsconfig.json +++ b/packages/schemas/tsconfig.json @@ -4,7 +4,7 @@ "outDir": "lib", "declaration": true, "moduleResolution": "nodenext", - "module": "es2022" + "module": "esnext" }, "include": [ "src", diff --git a/packages/shared/jest.config.js b/packages/shared/jest.config.js index 652de5472..3fd28f230 100644 --- a/packages/shared/jest.config.js +++ b/packages/shared/jest.config.js @@ -1,3 +1,4 @@ +/** @type {import('jest').Config} */ const config = { coveragePathIgnorePatterns: ['/node_modules/', '/src/__mocks__/'], coverageReporters: ['text-summary', 'lcov'], diff --git a/packages/shared/package.json b/packages/shared/package.json index 3a30ecc66..39e8b1601 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -29,7 +29,7 @@ "prepack": "pnpm build", "test:only": "NODE_OPTIONS=--experimental-vm-modules jest", "test": "pnpm build:test && pnpm test:only", - "test:ci": "pnpm run test" + "test:ci": "pnpm run test:only" }, "devDependencies": { "@silverhand/eslint-config": "1.3.0", diff --git a/packages/shared/src/database/utils.test.ts b/packages/shared/src/database/utils.test.ts index 27937c833..9199c1021 100644 --- a/packages/shared/src/database/utils.test.ts +++ b/packages/shared/src/database/utils.test.ts @@ -11,6 +11,8 @@ import { conditionalSql, } from './utils.js'; +const { jest } = import.meta; + describe('conditionalSql()', () => { it('returns empty sql when value is falsy', () => { expect(conditionalSql(false, () => sql`select 1`)).toEqual({ diff --git a/packages/shared/tsconfig.json b/packages/shared/tsconfig.json index fd9fd4d6f..b41cf6355 100644 --- a/packages/shared/tsconfig.json +++ b/packages/shared/tsconfig.json @@ -5,7 +5,7 @@ "declaration": true, "types": ["node", "jest"], "moduleResolution": "nodenext", - "module": "es2022" + "module": "esnext" }, "include": [ "src" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bd5b3409e..582774ba1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -476,7 +476,6 @@ importers: '@peculiar/webcrypto': ^1.3.3 '@silverhand/eslint-config': 1.3.0 '@silverhand/essentials': ^1.3.0 - '@silverhand/jest-config': 1.2.2 '@silverhand/ts-config': 1.2.1 '@types/jest': ^29.1.2 '@types/jest-environment-puppeteer': ^5.0.2 @@ -492,7 +491,6 @@ importers: prettier: ^2.7.1 puppeteer: ^19.0.0 text-encoder: ^0.0.4 - ts-node: ^10.9.1 typescript: ^4.9.4 devDependencies: '@jest/types': 29.1.2 @@ -502,7 +500,6 @@ importers: '@peculiar/webcrypto': 1.3.3 '@silverhand/eslint-config': 1.3.0_eu7dlo3qq5moigliolva3udaxa '@silverhand/essentials': 1.3.0 - '@silverhand/jest-config': 1.2.2_ky6c64xxalg2hsll4xx3evq2dy '@silverhand/ts-config': 1.2.1_typescript@4.9.4 '@types/jest': 29.1.2 '@types/jest-environment-puppeteer': 5.0.2 @@ -510,7 +507,7 @@ importers: dotenv: 16.0.0 eslint: 8.21.0 got: 12.5.3 - jest: 29.1.2_k5ytkvaprncdyzidqqws5bqksq + jest: 29.1.2_@types+node@16.11.12 jest-puppeteer: 6.1.1_puppeteer@19.2.2 node-fetch: 2.6.7 openapi-schema-validator: 12.0.0 @@ -518,7 +515,6 @@ importers: prettier: 2.7.1 puppeteer: 19.2.2 text-encoder: 0.0.4 - ts-node: 10.9.1_ace2mtubvwruu4qt46fm3vtq3a typescript: 4.9.4 packages/phrases: