From ff22c1df3db4fbab2186532b998c6ebfb8ab8f37 Mon Sep 17 00:00:00 2001 From: Alano Terblanche <18033717+Benehiko@users.noreply.github.com> Date: Thu, 21 Sep 2023 18:27:59 +0200 Subject: [PATCH 01/22] feat: strict eslint --- .eslintrc.cjs | 43 ++ .gitignore | 3 +- package-lock.json | 636 +++++++++++++----- package.json | 14 +- playwright-ct.config.ts | 17 +- src/markup-components/component-wrapper.tsx | 10 +- src/markup-components/express.spec.ts | 75 +++ src/markup-components/express.ts | 6 +- src/markup/express.ts | 22 - src/react-components/button-link.tsx | 2 +- src/react-components/codebox.tsx | 2 +- src/react-components/nav.tsx | 2 +- src/react-components/ory/helpers/common.tsx | 6 +- .../ory/helpers/error-messages.tsx | 6 +- src/react-components/ory/helpers/node.tsx | 44 +- .../ory/helpers/user-auth-form.tsx | 28 +- .../ory/sections/auth-code-section.spec.tsx | 2 +- .../ory/sections/auth-code-section.tsx | 8 +- .../ory/sections/link-section.tsx | 8 +- .../ory/sections/logged-info.tsx | 8 +- .../ory/sections/login-section.tsx | 2 +- .../lookup-secret-settings-section.tsx | 2 +- .../ory/sections/lookup-secrets-section.tsx | 2 +- .../ory/sections/oidc-settings-section.tsx | 2 +- .../sections/password-settings-section.tsx | 2 +- .../ory/sections/profile-settings-section.tsx | 2 +- .../ory/sections/registration-section.tsx | 2 +- .../ory/sections/totp-settings-section.tsx | 2 +- .../sections/webauthn-settings-section.tsx | 2 +- .../ory/user-auth-card.spec.tsx | 142 ++-- src/react-components/ory/user-auth-card.tsx | 83 +-- .../ory/user-consent-card.spec.tsx | 3 +- ...nsent-card-login-flow-1-chromium-linux.png | Bin 0 -> 36932 bytes ...onsent-card-login-flow-1-firefox-linux.png | Bin 0 -> 39759 bytes .../ory/user-consent-card.tsx | 13 +- src/react-components/ory/user-error-card.tsx | 18 +- .../ory/user-logout-card.spec.tsx | 4 +- src/react-components/ory/user-logout-card.tsx | 14 +- .../ory/user-settings-card.tsx | 12 +- .../ory/user-settings-screen.tsx | 12 +- src/react-components/provider.tsx | 2 +- src/test/fixtures/login.ts | 117 +++- src/test/fixtures/registration.ts | 5 +- src/test/mock/login.ts | 2 +- src/test/mock/recovery.ts | 4 +- src/test/models/AuthPage.ts | 10 +- src/test/models/LoginPage.ts | 9 +- src/test/models/RecoveryPage.ts | 4 +- src/test/models/RegistrationPage.ts | 5 +- src/test/models/SettingsPage.ts | 4 +- src/test/models/VerificationPage.ts | 2 +- src/test/playwright-fixture.ts | 8 +- src/test/types.ts | 8 +- src/test/utils.ts | 14 +- src/theme/consts.ts | 4 +- src/theme/message.css.ts | 10 +- src/vite-env.d.ts | 4 - 57 files changed, 1077 insertions(+), 396 deletions(-) create mode 100644 .eslintrc.cjs create mode 100644 src/markup-components/express.spec.ts delete mode 100644 src/markup/express.ts create mode 100644 src/react-components/ory/user-consent-card.spec.tsx-snapshots/ory-consent-card-login-flow-1-chromium-linux.png create mode 100644 src/react-components/ory/user-consent-card.spec.tsx-snapshots/ory-consent-card-login-flow-1-firefox-linux.png delete mode 100644 src/vite-env.d.ts diff --git a/.eslintrc.cjs b/.eslintrc.cjs new file mode 100644 index 000000000..64a257611 --- /dev/null +++ b/.eslintrc.cjs @@ -0,0 +1,43 @@ +// Copyright © 2023 Ory Corp +// SPDX-License-Identifier: Apache-2.0 + +module.exports = { + env: { + browser: true, + es6: true, + node: true, + }, + extends: [ + "eslint:recommended", + "plugin:react/recommended", + "plugin:@typescript-eslint/stylistic-type-checked", + "plugin:@typescript-eslint/recommended-type-checked", + "plugin:react/jsx-runtime", + "plugin:storybook/recommended", + "plugin:playwright/recommended", + ], + overrides: [], + parser: "@typescript-eslint/parser", + ignorePatterns: ["src/assets/*.js"], + parserOptions: { + project: "./tsconfig.json", + tsconfigRootDir: __dirname, + ecmaVersion: 2021, + sourceType: "module", + ecmaFeatures: { + jsx: true, + }, + }, + settings: { + playwright: { + additionalAssertFunctionNames: [], + }, + }, + root: true, + plugins: ["react", "@typescript-eslint", "eslint-plugin-tsdoc", "formatjs"], + rules: { + "tsdoc/syntax": "warn", + "formatjs/no-offset": "error", + "@typescript-eslint/no-floating-promises": "error", + }, +} diff --git a/.gitignore b/.gitignore index 97885efc9..28f89be7c 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ dist dist-ssr *.local .bin/ +tests-dist/ # Editor directories and files .vscode/* @@ -37,4 +38,4 @@ pnpm-lock.yaml /playwright/.cache/ /test-results/ /playwright-report/ -/playwright/.cache/ \ No newline at end of file +/playwright/.cache/ diff --git a/package-lock.json b/package-lock.json index 6c3cc43dc..03f27b9e6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -33,28 +33,28 @@ "@types/node": "18.16.19", "@types/react": "18.2.20", "@types/react-dom": "18.2.7", - "@typescript-eslint/eslint-plugin": "5.33.1", - "@typescript-eslint/parser": "5.33.1", + "@typescript-eslint/eslint-plugin": "6.7.2", + "@typescript-eslint/parser": "6.7.2", "@vanilla-extract/css": "1.13.0", "@vanilla-extract/dynamic": "2.0.3", "@vanilla-extract/recipes": "0.5.0", "@vanilla-extract/sprinkles": "1.6.1", "@vanilla-extract/vite-plugin": "3.9.0", "@vitejs/plugin-react": "4.0.4", - "autoprefixer": "10.4.15", + "autoprefixer": "10.4.16", "chromatic": "6.21.0", "classnames": "2.3.2", "eslint": "8.49.0", "eslint-config-semistandard": "17.0.0", "eslint-config-standard": "17.1.0", - "eslint-plugin-formatjs": "4.10.3", + "eslint-plugin-formatjs": "4.10.5", "eslint-plugin-import": "2.28.1", - "eslint-plugin-n": "15.7.0", + "eslint-plugin-n": "16.1.0", "eslint-plugin-playwright": "0.16.0", "eslint-plugin-promise": "6.1.1", "eslint-plugin-react": "7.32.2", "eslint-plugin-react-hooks": "4.6.0", - "eslint-plugin-storybook": "0.6.13", + "eslint-plugin-storybook": "0.6.14", "eslint-plugin-tsdoc": "0.2.17", "lerna": "5.6.2", "license-checker": "25.0.1", @@ -69,7 +69,7 @@ "typedoc": "0.23.16", "typescript": "5.2.2", "vite": "4.4.9", - "vite-plugin-dts": "3.5.3", + "vite-plugin-dts": "3.5.4", "vite-plugin-static-copy": "0.17.0" }, "engines": { @@ -3750,9 +3750,10 @@ } }, "node_modules/@eslint-community/eslint-utils": { - "version": "4.3.0", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", "dev": true, - "license": "MIT", "dependencies": { "eslint-visitor-keys": "^3.3.0" }, @@ -3941,12 +3942,12 @@ } }, "node_modules/@formatjs/ts-transformer": { - "version": "3.13.3", - "resolved": "https://registry.npmjs.org/@formatjs/ts-transformer/-/ts-transformer-3.13.3.tgz", - "integrity": "sha512-W6+huH4dLYx8eZfZue6fcreNzLZHoPboreqJSkickYCKIOicI35zC0Txb4xCT6kau/DXAKTpNEln3V2NgX6Igg==", + "version": "3.13.5", + "resolved": "https://registry.npmjs.org/@formatjs/ts-transformer/-/ts-transformer-3.13.5.tgz", + "integrity": "sha512-dh2mmZqkId0UeM+FQtmwugpMGvyzTBmXj5LjwD4M5OeSm62tcgkScjqeO/1EetaNS/JkTUBbsFBnHzaDzh3yOw==", "dev": true, "dependencies": { - "@formatjs/icu-messageformat-parser": "2.6.0", + "@formatjs/icu-messageformat-parser": "2.6.2", "@types/json-stable-stringify": "^1.0.32", "@types/node": "14 || 16 || 17", "chalk": "^4.0.0", @@ -3963,6 +3964,46 @@ } } }, + "node_modules/@formatjs/ts-transformer/node_modules/@formatjs/ecma402-abstract": { + "version": "1.17.2", + "resolved": "https://registry.npmjs.org/@formatjs/ecma402-abstract/-/ecma402-abstract-1.17.2.tgz", + "integrity": "sha512-k2mTh0m+IV1HRdU0xXM617tSQTi53tVR2muvYOsBeYcUgEAyxV1FOC7Qj279th3fBVQ+Dj6muvNJZcHSPNdbKg==", + "dev": true, + "dependencies": { + "@formatjs/intl-localematcher": "0.4.2", + "tslib": "^2.4.0" + } + }, + "node_modules/@formatjs/ts-transformer/node_modules/@formatjs/icu-messageformat-parser": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/@formatjs/icu-messageformat-parser/-/icu-messageformat-parser-2.6.2.tgz", + "integrity": "sha512-nF/Iww7sc5h+1MBCDRm68qpHTCG4xvGzYs/x9HFcDETSGScaJ1Fcadk5U/NXjXeCtzD+DhN4BAwKFVclHfKMdA==", + "dev": true, + "dependencies": { + "@formatjs/ecma402-abstract": "1.17.2", + "@formatjs/icu-skeleton-parser": "1.6.2", + "tslib": "^2.4.0" + } + }, + "node_modules/@formatjs/ts-transformer/node_modules/@formatjs/icu-skeleton-parser": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/@formatjs/icu-skeleton-parser/-/icu-skeleton-parser-1.6.2.tgz", + "integrity": "sha512-VtB9Slo4ZL6QgtDFJ8Injvscf0xiDd4bIV93SOJTBjUF4xe2nAWOoSjLEtqIG+hlIs1sNrVKAaFo3nuTI4r5ZA==", + "dev": true, + "dependencies": { + "@formatjs/ecma402-abstract": "1.17.2", + "tslib": "^2.4.0" + } + }, + "node_modules/@formatjs/ts-transformer/node_modules/@formatjs/intl-localematcher": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@formatjs/intl-localematcher/-/intl-localematcher-0.4.2.tgz", + "integrity": "sha512-BGdtJFmaNJy5An/Zan4OId/yR9Ih1OojFjcduX/xOvq798OgWSyDtd6Qd5jqJXwJs1ipe4Fxu9+cshic5Ox2tA==", + "dev": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, "node_modules/@formatjs/ts-transformer/node_modules/@types/node": { "version": "17.0.45", "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.45.tgz", @@ -11317,9 +11358,10 @@ } }, "node_modules/@types/json-schema": { - "version": "7.0.11", - "dev": true, - "license": "MIT" + "version": "7.0.13", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.13.tgz", + "integrity": "sha512-RbSSoHliUbnXj3ny0CNFOoxrIDV6SUGyStHsvDqosw6CkdPV8TtWGlfecuK4ToyMEAql6pzNxgCFKanovUzlgQ==", + "dev": true }, "node_modules/@types/json-stable-stringify": { "version": "1.0.34", @@ -11432,9 +11474,10 @@ "license": "MIT" }, "node_modules/@types/semver": { - "version": "7.3.13", - "dev": true, - "license": "MIT" + "version": "7.5.2", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.2.tgz", + "integrity": "sha512-7aqorHYgdNO4DM36stTiGO3DvKoex9TQRwsJU6vMaFGyqpBA1MNZkz+PG3gaNUPpTAOYhT1WR7M1JyA3fbS9Cw==", + "dev": true }, "node_modules/@types/serve-static": { "version": "1.15.1", @@ -11469,30 +11512,33 @@ "license": "MIT" }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "5.33.1", + "version": "6.7.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.7.2.tgz", + "integrity": "sha512-ooaHxlmSgZTM6CHYAFRlifqh1OAr3PAQEwi7lhYhaegbnXrnh7CDcHmc3+ihhbQC7H0i4JF0psI5ehzkF6Yl6Q==", "dev": true, - "license": "MIT", "dependencies": { - "@typescript-eslint/scope-manager": "5.33.1", - "@typescript-eslint/type-utils": "5.33.1", - "@typescript-eslint/utils": "5.33.1", + "@eslint-community/regexpp": "^4.5.1", + "@typescript-eslint/scope-manager": "6.7.2", + "@typescript-eslint/type-utils": "6.7.2", + "@typescript-eslint/utils": "6.7.2", + "@typescript-eslint/visitor-keys": "6.7.2", "debug": "^4.3.4", - "functional-red-black-tree": "^1.0.1", - "ignore": "^5.2.0", - "regexpp": "^3.2.0", - "semver": "^7.3.7", - "tsutils": "^3.21.0" + "graphemer": "^1.4.0", + "ignore": "^5.2.4", + "natural-compare": "^1.4.0", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^5.0.0", - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + "@typescript-eslint/parser": "^6.0.0 || ^6.0.0-alpha", + "eslint": "^7.0.0 || ^8.0.0" }, "peerDependenciesMeta": { "typescript": { @@ -11501,15 +11547,16 @@ } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/scope-manager": { - "version": "5.33.1", + "version": "6.7.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.7.2.tgz", + "integrity": "sha512-bgi6plgyZjEqapr7u2mhxGR6E8WCzKNUFWNh6fkpVe9+yzRZeYtDTbsIBzKbcxI+r1qVWt6VIoMSNZ4r2A+6Yw==", "dev": true, - "license": "MIT", "dependencies": { - "@typescript-eslint/types": "5.33.1", - "@typescript-eslint/visitor-keys": "5.33.1" + "@typescript-eslint/types": "6.7.2", + "@typescript-eslint/visitor-keys": "6.7.2" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", @@ -11517,23 +11564,25 @@ } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/type-utils": { - "version": "5.33.1", + "version": "6.7.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.7.2.tgz", + "integrity": "sha512-36F4fOYIROYRl0qj95dYKx6kybddLtsbmPIYNK0OBeXv2j9L5nZ17j9jmfy+bIDHKQgn2EZX+cofsqi8NPATBQ==", "dev": true, - "license": "MIT", "dependencies": { - "@typescript-eslint/utils": "5.33.1", + "@typescript-eslint/typescript-estree": "6.7.2", + "@typescript-eslint/utils": "6.7.2", "debug": "^4.3.4", - "tsutils": "^3.21.0" + "ts-api-utils": "^1.0.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "*" + "eslint": "^7.0.0 || ^8.0.0" }, "peerDependenciesMeta": { "typescript": { @@ -11542,64 +11591,80 @@ } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/utils": { - "version": "5.33.1", + "version": "6.7.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.7.2.tgz", + "integrity": "sha512-ZCcBJug/TS6fXRTsoTkgnsvyWSiXwMNiPzBUani7hDidBdj1779qwM1FIAmpH4lvlOZNF3EScsxxuGifjpLSWQ==", "dev": true, - "license": "MIT", "dependencies": { - "@types/json-schema": "^7.0.9", - "@typescript-eslint/scope-manager": "5.33.1", - "@typescript-eslint/types": "5.33.1", - "@typescript-eslint/typescript-estree": "5.33.1", - "eslint-scope": "^5.1.1", - "eslint-utils": "^3.0.0" + "@eslint-community/eslint-utils": "^4.4.0", + "@types/json-schema": "^7.0.12", + "@types/semver": "^7.5.0", + "@typescript-eslint/scope-manager": "6.7.2", + "@typescript-eslint/types": "6.7.2", + "@typescript-eslint/typescript-estree": "6.7.2", + "semver": "^7.5.4" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + "eslint": "^7.0.0 || ^8.0.0" } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/visitor-keys": { - "version": "5.33.1", + "version": "6.7.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.7.2.tgz", + "integrity": "sha512-uVw9VIMFBUTz8rIeaUT3fFe8xIUx8r4ywAdlQv1ifH+6acn/XF8Y6rwJ7XNmkNMDrTW+7+vxFFPIF40nJCVsMQ==", "dev": true, - "license": "MIT", "dependencies": { - "@typescript-eslint/types": "5.33.1", - "eslint-visitor-keys": "^3.3.0" + "@typescript-eslint/types": "6.7.2", + "eslint-visitor-keys": "^3.4.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/eslint-scope": { - "version": "5.1.1", + "node_modules/@typescript-eslint/eslint-plugin/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dev": true, - "license": "BSD-2-Clause", "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" + "yallist": "^4.0.0" }, "engines": { - "node": ">=8.0.0" + "node": ">=10" } }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/estraverse": { - "version": "4.3.0", + "node_modules/@typescript-eslint/eslint-plugin/node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, - "license": "BSD-2-Clause", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, "engines": { - "node": ">=4.0" + "node": ">=10" } }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, "node_modules/@typescript-eslint/experimental-utils": { "version": "5.56.0", "dev": true, @@ -11734,24 +11799,26 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "5.33.1", + "version": "6.7.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.7.2.tgz", + "integrity": "sha512-KA3E4ox0ws+SPyxQf9iSI25R6b4Ne78ORhNHeVKrPQnoYsb9UhieoiRoJgrzgEeKGOXhcY1i8YtOeCHHTDa6Fw==", "dev": true, - "license": "BSD-2-Clause", "dependencies": { - "@typescript-eslint/scope-manager": "5.33.1", - "@typescript-eslint/types": "5.33.1", - "@typescript-eslint/typescript-estree": "5.33.1", + "@typescript-eslint/scope-manager": "6.7.2", + "@typescript-eslint/types": "6.7.2", + "@typescript-eslint/typescript-estree": "6.7.2", + "@typescript-eslint/visitor-keys": "6.7.2", "debug": "^4.3.4" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + "eslint": "^7.0.0 || ^8.0.0" }, "peerDependenciesMeta": { "typescript": { @@ -11760,15 +11827,16 @@ } }, "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/scope-manager": { - "version": "5.33.1", + "version": "6.7.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.7.2.tgz", + "integrity": "sha512-bgi6plgyZjEqapr7u2mhxGR6E8WCzKNUFWNh6fkpVe9+yzRZeYtDTbsIBzKbcxI+r1qVWt6VIoMSNZ4r2A+6Yw==", "dev": true, - "license": "MIT", "dependencies": { - "@typescript-eslint/types": "5.33.1", - "@typescript-eslint/visitor-keys": "5.33.1" + "@typescript-eslint/types": "6.7.2", + "@typescript-eslint/visitor-keys": "6.7.2" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", @@ -11776,15 +11844,16 @@ } }, "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/visitor-keys": { - "version": "5.33.1", + "version": "6.7.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.7.2.tgz", + "integrity": "sha512-uVw9VIMFBUTz8rIeaUT3fFe8xIUx8r4ywAdlQv1ifH+6acn/XF8Y6rwJ7XNmkNMDrTW+7+vxFFPIF40nJCVsMQ==", "dev": true, - "license": "MIT", "dependencies": { - "@typescript-eslint/types": "5.33.1", - "eslint-visitor-keys": "^3.3.0" + "@typescript-eslint/types": "6.7.2", + "eslint-visitor-keys": "^3.4.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", @@ -11884,11 +11953,12 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "5.33.1", + "version": "6.7.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.7.2.tgz", + "integrity": "sha512-flJYwMYgnUNDAN9/GAI3l8+wTmvTYdv64fcH8aoJK76Y+1FCZ08RtI5zDerM/FYT5DMkAc+19E4aLmd5KqdFyg==", "dev": true, - "license": "MIT", "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", @@ -11896,20 +11966,21 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.33.1", + "version": "6.7.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.7.2.tgz", + "integrity": "sha512-kiJKVMLkoSciGyFU0TOY0fRxnp9qq1AzVOHNeN1+B9erKFCJ4Z8WdjAkKQPP+b1pWStGFqezMLltxO+308dJTQ==", "dev": true, - "license": "BSD-2-Clause", "dependencies": { - "@typescript-eslint/types": "5.33.1", - "@typescript-eslint/visitor-keys": "5.33.1", + "@typescript-eslint/types": "6.7.2", + "@typescript-eslint/visitor-keys": "6.7.2", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", @@ -11922,21 +11993,55 @@ } }, "node_modules/@typescript-eslint/typescript-estree/node_modules/@typescript-eslint/visitor-keys": { - "version": "5.33.1", + "version": "6.7.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.7.2.tgz", + "integrity": "sha512-uVw9VIMFBUTz8rIeaUT3fFe8xIUx8r4ywAdlQv1ifH+6acn/XF8Y6rwJ7XNmkNMDrTW+7+vxFFPIF40nJCVsMQ==", "dev": true, - "license": "MIT", "dependencies": { - "@typescript-eslint/types": "5.33.1", - "eslint-visitor-keys": "^3.3.0" + "@typescript-eslint/types": "6.7.2", + "eslint-visitor-keys": "^3.4.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^16.0.0 || >=18.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" } }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, "node_modules/@typescript-eslint/utils": { "version": "5.49.0", "dev": true, @@ -12941,7 +13046,9 @@ } }, "node_modules/autoprefixer": { - "version": "10.4.15", + "version": "10.4.16", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.16.tgz", + "integrity": "sha512-7vd3UC6xKp0HLfua5IjZlcXvGAGy7cBAXTg2lyQ/8WpNhd6SiZ8Be+xm3FyBSYJx5GKcpRCzBh7RH4/0dnY+uQ==", "dev": true, "funding": [ { @@ -12957,11 +13064,10 @@ "url": "https://github.com/sponsors/ai" } ], - "license": "MIT", "dependencies": { "browserslist": "^4.21.10", - "caniuse-lite": "^1.0.30001520", - "fraction.js": "^4.2.0", + "caniuse-lite": "^1.0.30001538", + "fraction.js": "^4.3.6", "normalize-range": "^0.1.2", "picocolors": "^1.0.0", "postcss-value-parser": "^4.2.0" @@ -13601,7 +13707,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001520", + "version": "1.0.30001538", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001538.tgz", + "integrity": "sha512-HWJnhnID+0YMtGlzcp3T9drmBJUVDchPJ08tpUGFLs9CYlwWPH2uLgpHn8fND5pCgXVtnGS3H4QR9XLMHVNkHw==", "funding": [ { "type": "opencollective", @@ -13615,8 +13723,7 @@ "type": "github", "url": "https://github.com/sponsors/ai" } - ], - "license": "CC-BY-4.0" + ] }, "node_modules/caseless": { "version": "0.12.0", @@ -15676,6 +15783,107 @@ "typescript": "*" } }, + "node_modules/eslint-config-standard-with-typescript/node_modules/@typescript-eslint/parser": { + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.62.0.tgz", + "integrity": "sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==", + "dev": true, + "dependencies": { + "@typescript-eslint/scope-manager": "5.62.0", + "@typescript-eslint/types": "5.62.0", + "@typescript-eslint/typescript-estree": "5.62.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/eslint-config-standard-with-typescript/node_modules/@typescript-eslint/scope-manager": { + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz", + "integrity": "sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "5.62.0", + "@typescript-eslint/visitor-keys": "5.62.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/eslint-config-standard-with-typescript/node_modules/@typescript-eslint/types": { + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.62.0.tgz", + "integrity": "sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/eslint-config-standard-with-typescript/node_modules/@typescript-eslint/typescript-estree": { + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz", + "integrity": "sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "5.62.0", + "@typescript-eslint/visitor-keys": "5.62.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "semver": "^7.3.7", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/eslint-config-standard-with-typescript/node_modules/@typescript-eslint/visitor-keys": { + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz", + "integrity": "sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "5.62.0", + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, "node_modules/eslint-config-standard-with-typescript/node_modules/eslint-config-standard": { "version": "17.0.0", "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-17.0.0.tgz", @@ -15830,6 +16038,25 @@ "eslint": ">=4.19.1" } }, + "node_modules/eslint-plugin-es-x": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-es-x/-/eslint-plugin-es-x-7.2.0.tgz", + "integrity": "sha512-9dvv5CcvNjSJPqnS5uZkqb3xmbeqRLnvXKK7iI5+oK/yTusyc46zbBZKENGsOfojm/mKfszyZb+wNqNPAPeGXA==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.1.2", + "@eslint-community/regexpp": "^4.6.0" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ota-meshi" + }, + "peerDependencies": { + "eslint": ">=8" + } + }, "node_modules/eslint-plugin-es/node_modules/eslint-utils": { "version": "2.1.0", "dev": true, @@ -15853,20 +16080,20 @@ } }, "node_modules/eslint-plugin-formatjs": { - "version": "4.10.3", - "resolved": "https://registry.npmjs.org/eslint-plugin-formatjs/-/eslint-plugin-formatjs-4.10.3.tgz", - "integrity": "sha512-EHKuEMCmWhAiMdCc8oZU8qBAvnvHPUiJuhGxPqA+GX2Nb7GBsGm2o616KYnSSffDisK+v0E9TDCrS8oJ0QLgcw==", + "version": "4.10.5", + "resolved": "https://registry.npmjs.org/eslint-plugin-formatjs/-/eslint-plugin-formatjs-4.10.5.tgz", + "integrity": "sha512-pBPA4idiYHXPQMrIb9/Le+D0snlNa7MFQsw12yIzyva/z9uz0u/4NOK3NkfyENMBNMeTX2tZXtugk9FyqM5SRw==", "dev": true, "dependencies": { - "@formatjs/icu-messageformat-parser": "2.6.0", - "@formatjs/ts-transformer": "3.13.3", + "@formatjs/icu-messageformat-parser": "2.6.2", + "@formatjs/ts-transformer": "3.13.5", "@types/eslint": "7 || 8", "@types/picomatch": "^2.3.0", - "@typescript-eslint/typescript-estree": "5.59.0", + "@typescript-eslint/typescript-estree": "5.62.0", "emoji-regex": "^10.2.1", "magic-string": "^0.30.0", "picomatch": "^2.3.1", - "tslib": "2.5.0", + "tslib": "2.6.0", "typescript": "^4.7 || 5", "unicode-emoji-utils": "^1.1.1" }, @@ -15874,6 +16101,46 @@ "eslint": "7 || 8" } }, + "node_modules/eslint-plugin-formatjs/node_modules/@formatjs/ecma402-abstract": { + "version": "1.17.2", + "resolved": "https://registry.npmjs.org/@formatjs/ecma402-abstract/-/ecma402-abstract-1.17.2.tgz", + "integrity": "sha512-k2mTh0m+IV1HRdU0xXM617tSQTi53tVR2muvYOsBeYcUgEAyxV1FOC7Qj279th3fBVQ+Dj6muvNJZcHSPNdbKg==", + "dev": true, + "dependencies": { + "@formatjs/intl-localematcher": "0.4.2", + "tslib": "^2.4.0" + } + }, + "node_modules/eslint-plugin-formatjs/node_modules/@formatjs/icu-messageformat-parser": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/@formatjs/icu-messageformat-parser/-/icu-messageformat-parser-2.6.2.tgz", + "integrity": "sha512-nF/Iww7sc5h+1MBCDRm68qpHTCG4xvGzYs/x9HFcDETSGScaJ1Fcadk5U/NXjXeCtzD+DhN4BAwKFVclHfKMdA==", + "dev": true, + "dependencies": { + "@formatjs/ecma402-abstract": "1.17.2", + "@formatjs/icu-skeleton-parser": "1.6.2", + "tslib": "^2.4.0" + } + }, + "node_modules/eslint-plugin-formatjs/node_modules/@formatjs/icu-skeleton-parser": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/@formatjs/icu-skeleton-parser/-/icu-skeleton-parser-1.6.2.tgz", + "integrity": "sha512-VtB9Slo4ZL6QgtDFJ8Injvscf0xiDd4bIV93SOJTBjUF4xe2nAWOoSjLEtqIG+hlIs1sNrVKAaFo3nuTI4r5ZA==", + "dev": true, + "dependencies": { + "@formatjs/ecma402-abstract": "1.17.2", + "tslib": "^2.4.0" + } + }, + "node_modules/eslint-plugin-formatjs/node_modules/@formatjs/intl-localematcher": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@formatjs/intl-localematcher/-/intl-localematcher-0.4.2.tgz", + "integrity": "sha512-BGdtJFmaNJy5An/Zan4OId/yR9Ih1OojFjcduX/xOvq798OgWSyDtd6Qd5jqJXwJs1ipe4Fxu9+cshic5Ox2tA==", + "dev": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, "node_modules/eslint-plugin-formatjs/node_modules/@jridgewell/sourcemap-codec": { "version": "1.4.15", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", @@ -15881,9 +16148,9 @@ "dev": true }, "node_modules/eslint-plugin-formatjs/node_modules/@typescript-eslint/types": { - "version": "5.59.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.59.0.tgz", - "integrity": "sha512-yR2h1NotF23xFFYKHZs17QJnB51J/s+ud4PYU4MqdZbzeNxpgUr05+dNeCN/bb6raslHvGdd6BFCkVhpPk/ZeA==", + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.62.0.tgz", + "integrity": "sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -15894,13 +16161,13 @@ } }, "node_modules/eslint-plugin-formatjs/node_modules/@typescript-eslint/typescript-estree": { - "version": "5.59.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.0.tgz", - "integrity": "sha512-sUNnktjmI8DyGzPdZ8dRwW741zopGxltGs/SAPgGL/AAgDpiLsCFLcMNSpbfXfmnNeHmK9h3wGmCkGRGAoUZAg==", + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.62.0.tgz", + "integrity": "sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.59.0", - "@typescript-eslint/visitor-keys": "5.59.0", + "@typescript-eslint/types": "5.62.0", + "@typescript-eslint/visitor-keys": "5.62.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -15921,12 +16188,12 @@ } }, "node_modules/eslint-plugin-formatjs/node_modules/@typescript-eslint/visitor-keys": { - "version": "5.59.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.0.tgz", - "integrity": "sha512-qZ3iXxQhanchCeaExlKPV3gDQFxMUmU35xfd5eCXB6+kUw1TUAbIy2n7QIrwz9s98DQLzNWyHp61fY0da4ZcbA==", + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz", + "integrity": "sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.59.0", + "@typescript-eslint/types": "5.62.0", "eslint-visitor-keys": "^3.3.0" }, "engines": { @@ -16069,22 +16336,23 @@ } }, "node_modules/eslint-plugin-n": { - "version": "15.7.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-15.7.0.tgz", - "integrity": "sha512-jDex9s7D/Qial8AGVIHq4W7NswpUD5DPDL2RH8Lzd9EloWUuvUkHfv4FRLMipH5q2UtyurorBkPeNi1wVWNh3Q==", + "version": "16.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-16.1.0.tgz", + "integrity": "sha512-3wv/TooBst0N4ND+pnvffHuz9gNPmk/NkLwAxOt2JykTl/hcuECe6yhTtLJcZjIxtZwN+GX92ACp/QTLpHA3Hg==", "dev": true, "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", "builtins": "^5.0.1", - "eslint-plugin-es": "^4.1.0", - "eslint-utils": "^3.0.0", - "ignore": "^5.1.1", - "is-core-module": "^2.11.0", + "eslint-plugin-es-x": "^7.1.0", + "get-tsconfig": "^4.7.0", + "ignore": "^5.2.4", + "is-core-module": "^2.12.1", "minimatch": "^3.1.2", - "resolve": "^1.22.1", - "semver": "^7.3.8" + "resolve": "^1.22.2", + "semver": "^7.5.3" }, "engines": { - "node": ">=12.22.0" + "node": ">=16.0.0" }, "funding": { "url": "https://github.com/sponsors/mysticatea" @@ -16093,6 +16361,39 @@ "eslint": ">=7.0.0" } }, + "node_modules/eslint-plugin-n/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/eslint-plugin-n/node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/eslint-plugin-n/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, "node_modules/eslint-plugin-playwright": { "version": "0.16.0", "resolved": "https://registry.npmjs.org/eslint-plugin-playwright/-/eslint-plugin-playwright-0.16.0.tgz", @@ -16190,9 +16491,10 @@ } }, "node_modules/eslint-plugin-storybook": { - "version": "0.6.13", + "version": "0.6.14", + "resolved": "https://registry.npmjs.org/eslint-plugin-storybook/-/eslint-plugin-storybook-0.6.14.tgz", + "integrity": "sha512-IeYigPur/MvESNDo43Z+Z5UvlcEVnt0dDZmnw1odi9X2Th1R3bpGyOZsHXb9bp1pFecOpRUuoMG5xdID2TwwOg==", "dev": true, - "license": "MIT", "dependencies": { "@storybook/csf": "^0.0.1", "@typescript-eslint/utils": "^5.45.0", @@ -17063,15 +17365,16 @@ } }, "node_modules/fraction.js": { - "version": "4.2.0", + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.3.6.tgz", + "integrity": "sha512-n2aZ9tNfYDwaHhvFTkhFErqOMIb8uyzSQ+vGJBjZyanAKZVbGUQ1sngfk9FdkBw7G26O7AgNjLcecLffD1c7eg==", "dev": true, - "license": "MIT", "engines": { "node": "*" }, "funding": { "type": "patreon", - "url": "https://www.patreon.com/infusion" + "url": "https://github.com/sponsors/rawify" } }, "node_modules/fresh": { @@ -17152,11 +17455,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/functional-red-black-tree": { - "version": "1.0.1", - "dev": true, - "license": "MIT" - }, "node_modules/functions-have-names": { "version": "1.2.3", "license": "MIT", @@ -17310,8 +17608,12 @@ } }, "node_modules/get-tsconfig": { - "version": "4.4.0", - "license": "MIT", + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.0.tgz", + "integrity": "sha512-pmjiZ7xtB8URYm74PlGJozDNyhvsVLUcpBa8DZBG3bWHwaHa9bPiRpiSfovw+fjhwONSCWKRyk+JQHEGZmMrzw==", + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, "funding": { "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" } @@ -23166,10 +23468,11 @@ "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==" }, "node_modules/resolve": { - "version": "1.22.1", - "license": "MIT", + "version": "1.22.6", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.6.tgz", + "integrity": "sha512-njhxM7mV12JfufShqGy3Rz8j11RPdLy4xi15UurGJeoHLfJpVXKdh3ueuOqbYUcDZnffr6X739JBo5LzyahEsw==", "dependencies": { - "is-core-module": "^2.9.0", + "is-core-module": "^2.13.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, @@ -23199,6 +23502,14 @@ "node": ">=8" } }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, "node_modules/restore-cursor": { "version": "3.1.0", "dev": true, @@ -24460,6 +24771,18 @@ "node": ">=8" } }, + "node_modules/ts-api-utils": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.0.3.tgz", + "integrity": "sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg==", + "dev": true, + "engines": { + "node": ">=16.13.0" + }, + "peerDependencies": { + "typescript": ">=4.2.0" + } + }, "node_modules/ts-dedent": { "version": "2.2.0", "dev": true, @@ -24496,8 +24819,9 @@ } }, "node_modules/tslib": { - "version": "2.5.0", - "license": "0BSD" + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.0.tgz", + "integrity": "sha512-7At1WUettjcSRHXCyYtTselblcHl9PJFFVKiCAy/bY97+BPZXSQ2wbq0P9s8tK2G7dFQfNnlJnPAiArVBVBsfA==" }, "node_modules/tsutils": { "version": "3.21.0", @@ -25213,9 +25537,9 @@ } }, "node_modules/vite-plugin-dts": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/vite-plugin-dts/-/vite-plugin-dts-3.5.3.tgz", - "integrity": "sha512-h94j/+SR1PhLR9jnEtcjZILagE2QZBAV8V1y3T2Ujcet1VI0Et4dZSU1W8fbnp6obB7B3/b8hArqdi2/9HuH+w==", + "version": "3.5.4", + "resolved": "https://registry.npmjs.org/vite-plugin-dts/-/vite-plugin-dts-3.5.4.tgz", + "integrity": "sha512-BJLBj1Vg9kV7ZMXAULT9UGogrElwz5s+k8TzC7LsFkHv5Jy90OWnHKUp8qm7sypu2pkF5pTJ5McUuHudnT0Imw==", "dev": true, "dependencies": { "@microsoft/api-extractor": "^7.36.4", diff --git a/package.json b/package.json index 43c15f0ef..b1a5e0a11 100644 --- a/package.json +++ b/package.json @@ -46,28 +46,28 @@ "@types/node": "18.16.19", "@types/react": "18.2.20", "@types/react-dom": "18.2.7", - "@typescript-eslint/eslint-plugin": "5.33.1", - "@typescript-eslint/parser": "5.33.1", + "@typescript-eslint/eslint-plugin": "6.7.2", + "@typescript-eslint/parser": "6.7.2", "@vanilla-extract/css": "1.13.0", "@vanilla-extract/dynamic": "2.0.3", "@vanilla-extract/recipes": "0.5.0", "@vanilla-extract/sprinkles": "1.6.1", "@vanilla-extract/vite-plugin": "3.9.0", "@vitejs/plugin-react": "4.0.4", - "autoprefixer": "10.4.15", + "autoprefixer": "10.4.16", "chromatic": "6.21.0", "classnames": "2.3.2", "eslint": "8.49.0", "eslint-config-semistandard": "17.0.0", "eslint-config-standard": "17.1.0", - "eslint-plugin-formatjs": "4.10.3", + "eslint-plugin-formatjs": "4.10.5", "eslint-plugin-import": "2.28.1", - "eslint-plugin-n": "15.7.0", + "eslint-plugin-n": "16.1.0", "eslint-plugin-playwright": "0.16.0", "eslint-plugin-promise": "6.1.1", "eslint-plugin-react": "7.32.2", "eslint-plugin-react-hooks": "4.6.0", - "eslint-plugin-storybook": "0.6.13", + "eslint-plugin-storybook": "0.6.14", "eslint-plugin-tsdoc": "0.2.17", "lerna": "5.6.2", "license-checker": "25.0.1", @@ -82,7 +82,7 @@ "typedoc": "0.23.16", "typescript": "5.2.2", "vite": "4.4.9", - "vite-plugin-dts": "3.5.3", + "vite-plugin-dts": "3.5.4", "vite-plugin-static-copy": "0.17.0" }, "files": [ diff --git a/playwright-ct.config.ts b/playwright-ct.config.ts index 883e5b5c6..46885d42f 100644 --- a/playwright-ct.config.ts +++ b/playwright-ct.config.ts @@ -1,17 +1,15 @@ // Copyright © 2023 Ory Corp // SPDX-License-Identifier: Apache-2.0 - import { defineConfig, devices } from "@playwright/experimental-ct-react" import { vanillaExtractPlugin } from "@vanilla-extract/vite-plugin" import react from "@vitejs/plugin-react" +import dts from "vite-plugin-dts" /** * See https://playwright.dev/docs/test-configuration. */ export default defineConfig({ - testDir: "./src/react-components", - /* The base directory, relative to the config file, for snapshot files created with toMatchSnapshot and toHaveScreenshot. */ - snapshotDir: "./__snapshots__", + testDir: "./src/react-components/", /* Maximum time one test can run for. */ timeout: 10 * 1000, /* Run tests in files in parallel */ @@ -28,14 +26,19 @@ export default defineConfig({ use: { /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ trace: "on-first-retry", - /* Port to use for Playwright component endpoint. */ ctPort: 3100, ctViteConfig: { - plugins: [vanillaExtractPlugin(), react()], + plugins: [ + react(), + vanillaExtractPlugin({ + emitCssInSsr: true, + }), + dts({ insertTypesEntry: true }), + ], + root: __dirname, }, }, - /* Configure projects for major browsers */ projects: [ { diff --git a/src/markup-components/component-wrapper.tsx b/src/markup-components/component-wrapper.tsx index 1724533bd..508759c22 100644 --- a/src/markup-components/component-wrapper.tsx +++ b/src/markup-components/component-wrapper.tsx @@ -1,18 +1,18 @@ // Copyright © 2023 Ory Corp // SPDX-License-Identifier: Apache-2.0 -import { FunctionComponent } from "react" +import { FunctionComponent, PropsWithChildren } from "react" import ReactDOMServer from "react-dom/server" import { IntlProvider } from "../react-components" import * as locales from "../locales" -export type Context = { +export interface Context { locale?: keyof typeof locales } -export const ComponentWrapper = ( - Component: FunctionComponent, - props: Props, +export const ComponentWrapper = ( + Component: FunctionComponent, + props: WrapperProps, { locale = "en" }: Context, ) => { return ReactDOMServer.renderToStaticMarkup( diff --git a/src/markup-components/express.spec.ts b/src/markup-components/express.spec.ts new file mode 100644 index 000000000..539c1921d --- /dev/null +++ b/src/markup-components/express.spec.ts @@ -0,0 +1,75 @@ +// Copyright © 2023 Ory Corp +// SPDX-License-Identifier: Apache-2.0 + +import { expect, test } from "@playwright/experimental-ct-react" +import express from "express" +import { RegisterOryElementsExpress } from "./express" + +test("express ory elements routes", async ({ request }) => { + const app = express() + const theme = { + fontFamily: "", + fontFamilyMono: "", + fontStyle: "", + accent: { + def: "#3D53F5", + muted: "#6475F7", + emphasis: "#3142C4", + disabled: "#E0E0E0", + subtle: "#eceefe", + }, + foreground: { + def: "#171717", + muted: "#616161", + subtle: "#9E9E9E", + disabled: "#BDBDBD", + onDark: "#FFFFFF", + onAccent: "#FFFFFF", + onDisabled: "#e0e0e0", + }, + background: { + surface: "#FFFFFF", + canvas: "#FCFCFC", + subtle: "#EEEEEE", + }, + error: { + def: "#9c0f2e", + subtle: "#fce8ec", + muted: "#e95c7b", + emphasis: "#DF1642", + }, + success: { + emphasis: "#18A957", + }, + border: { + def: "#EEEEEE", + }, + text: { + def: "#FFFFFF", + disabled: "#757575", + }, + input: { + background: "#FFFFFF", + disabled: "#E0E0E0", + placeholder: "#9E9E9E", + text: "#424242", + }, + } + + RegisterOryElementsExpress(app, theme, () => ({ + theme: theme, + })) + + const server = app.listen() + + const address = server.address() + + await request + .get(`${address?.toString()}/theme.css`) + .then(({ body, status, headersArray }) => { + expect(status()).toEqual(200) + expect(headersArray()).toEqual([{ "Content-Type": "text/css" }]) + expect(body).toMatchSnapshot() + server.closeAllConnections() + }) +}) diff --git a/src/markup-components/express.ts b/src/markup-components/express.ts index f79df11f5..ab61e9d26 100644 --- a/src/markup-components/express.ts +++ b/src/markup-components/express.ts @@ -34,7 +34,11 @@ export const RegisterOryElementsExpress: OryEelementsExpressRoute = ( // merge also creates a new object ensuring that we don't pollute the default or request theme inlineTheme = merge({}, inlineTheme, theme) } - res.send(`body {${assignInlineVars(oryTheme, inlineTheme).toString()}}`) + res.send( + `body {${Object.entries( + assignInlineVars(oryTheme, inlineTheme), + ).toString()}}`, + ) }) app.use("/", express.static("node_modules/@ory/elements/dist")) } diff --git a/src/markup/express.ts b/src/markup/express.ts deleted file mode 100644 index a88f49687..000000000 --- a/src/markup/express.ts +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright © 2023 Ory Corp -// SPDX-License-Identifier: Apache-2.0 - -import { assignInlineVars } from "@vanilla-extract/dynamic" -import express from "express" -import { oryTheme, Theme } from "../theme" - -export const RegisterOryElementsExpress = ( - app: express.Application, - theme: Theme, -) => { - app.use("/theme.css", (req, res) => { - res.header("Content-Type", "text/css") - res.send( - `body {${assignInlineVars(oryTheme, { - ...oryTheme, - ...theme, - }).toString()}}`, - ) - }) - app.use("/", express.static("node_modules/@ory/elements-markup/dist")) -} diff --git a/src/react-components/button-link.tsx b/src/react-components/button-link.tsx index 73e411d6b..cdb4c6e43 100644 --- a/src/react-components/button-link.tsx +++ b/src/react-components/button-link.tsx @@ -9,7 +9,7 @@ import { buttonLinkStyle, } from "../theme/button-link.css" -export type CustomHref = { +export interface CustomHref { href: string handler: (url: string) => void } diff --git a/src/react-components/codebox.tsx b/src/react-components/codebox.tsx index 32f9ab8f1..9b3ce7021 100644 --- a/src/react-components/codebox.tsx +++ b/src/react-components/codebox.tsx @@ -34,7 +34,7 @@ export const CodeBox = ({ htmlFor={id} className={cn(typographyStyle({ size: "small" }), codeboxHeaderStyle)} > -
{toggleText || "Toggle content"}
+
{toggleText ?? "Toggle content"}
-export type NavSection = { +export interface NavSection { title?: string titleIcon?: string floatBottom?: boolean diff --git a/src/react-components/ory/helpers/common.tsx b/src/react-components/ory/helpers/common.tsx index 462963139..0bcf3e0e8 100644 --- a/src/react-components/ory/helpers/common.tsx +++ b/src/react-components/ory/helpers/common.tsx @@ -4,7 +4,7 @@ import { colorSprinkle } from "../../../theme" import { ButtonLink, CustomHref } from "../../button-link" import { Message } from "../../message" -export type ErrorProps = { +export interface ErrorProps { code: number details: { docs: string @@ -16,14 +16,14 @@ export type ErrorProps = { reason: string } -export type AdditionalProps = { +export interface AdditionalProps { forgotPasswordURL?: CustomHref | string signupURL?: CustomHref | string logoutURL?: CustomHref | string loginURL?: CustomHref | string } -export type MessageSectionProps = { +export interface MessageSectionProps { url?: CustomHref | string buttonText: string dataTestId?: string diff --git a/src/react-components/ory/helpers/error-messages.tsx b/src/react-components/ory/helpers/error-messages.tsx index 2b2608b21..d6d03dc17 100644 --- a/src/react-components/ory/helpers/error-messages.tsx +++ b/src/react-components/ory/helpers/error-messages.tsx @@ -8,7 +8,7 @@ import { uiTextToFormattedMessage } from "./node" export type NodeMessagesProps = { nodes?: UiNode[] - uiMessages?: Array + uiMessages?: UiText[] } & GridStyle & MessageStyleProps @@ -59,12 +59,12 @@ export const NodeMessages = ({ nodeMessage({ message, key: `ui-messsage-${message.id}-${key}` }), ) - const $allMessages = [...($groupMessages || []), ...($messages || [])] + const $allMessages = [...($groupMessages ?? []), ...($messages ?? [])] return $allMessages.length > 0 ? (
diff --git a/src/react-components/ory/helpers/node.tsx b/src/react-components/ory/helpers/node.tsx index ab2e65b4e..48c15838c 100644 --- a/src/react-components/ory/helpers/node.tsx +++ b/src/react-components/ory/helpers/node.tsx @@ -27,7 +27,7 @@ interface ButtonSubmit { value: string } -export type NodeOverrideProps = { +export interface NodeOverrideProps { buttonOverrideProps?: Partial buttonSocialOverrideProps?: Partial } @@ -65,34 +65,36 @@ export const uiTextToFormattedMessage = ( id: `identities.messages.${id}`, defaultMessage: text, }, - Object.entries(context).reduce>( + Object.entries(context).reduce< + Record + >( (values, [key, value]) => Array.isArray(value) ? { ...values, [key]: value, - [key + "_list"]: intl.formatList(value), + [key + "_list"]: intl.formatList(value), } : key.endsWith("_unix") ? { ...values, [key]: intl.formatDate(new Date(value * 1000)), [key + "_since"]: intl.formatDateTimeRange( - new Date(value), + new Date(value as string | number), new Date(), ), [key + "_since_minutes"]: (value - new Date().getTime() / 1000) / 60, [key + "_until"]: intl.formatDateTimeRange( new Date(), - new Date(value), + new Date(value as string | number), ), [key + "_until_minutes"]: (new Date().getTime() / 1000 - value) / 60, } : { ...values, - [key]: value, + [key]: value as string | number, }, {}, ), @@ -116,9 +118,9 @@ export const Node = ({ return ( {formatMessage(node.meta.label)} @@ -172,14 +174,14 @@ export const Node = ({ const nodeType = attrs.type const isSocial = - (attrs.name === "provider" || attrs.name === "link") && + (attrs.name === "provider" ?? attrs.name === "link") && node.group === "oidc" const submit: ButtonSubmit = { type: attrs.type as "submit" | "reset" | "button" | undefined, name: attrs.name, - ...(attrs.value && { value: attrs.value }), - } + ...(attrs.value && { value: attrs.value as string }), + } as ButtonSubmit switch (nodeType) { case "button": @@ -204,7 +206,7 @@ export const Node = ({ // the recovery code resend button if ( - node.meta.label?.id === 1070007 || // TODO: remove this once everyone has migrated to the fix (https://github.com/ory/kratos/pull/3067) + node.meta.label?.id === 1070007 ?? // TODO: remove this once everyone has migrated to the fix (https://github.com/ory/kratos/pull/3067) node.meta.label?.id === 1070008 ) { // on html forms the required flag on an input field will prevent the form from submitting. @@ -215,8 +217,8 @@ export const Node = ({ return isSocial ? ( } - label={formatMessage(getNodeLabel(node))} + label={formatMessage(getNodeLabel(node)) as string} name={attrs.name} required={attrs.required} - defaultValue={attrs.value} + defaultValue={attrs.value as string | number | string[]} disabled={attrs.disabled} defaultChecked={Boolean(attrs.value)} dataTestid={`node/input/${attrs.name}`} @@ -262,13 +264,13 @@ export const Node = ({ dataTestid={`node/input/${attrs.name}`} className={className} name={attrs.name} - header={formatMessage(getNodeLabel(node))} + header={formatMessage(getNodeLabel(node)) as string} type={attrs.type} autoComplete={ - attrs.autocomplete || + attrs.autocomplete ?? (attrs.name === "identifier" ? "username" : "") } - defaultValue={attrs.value} + defaultValue={attrs.value as string | number | string[]} required={attrs.required} disabled={attrs.disabled} /> @@ -278,7 +280,7 @@ export const Node = ({ return ( void } -// SelfServiceFlowForm props +/** + * UserAuthFormProps is the props interface for the UserAuthForm component + * @see UserAuthForm + * + * @param flow - the Ory flow object that is used to add the form action and method and add csrf tokens to the form + * @param children - the children of the form + * @param formFilterOverride - the filter that is used to filter the form nodes. By default, only hidden fields are included. + * @param submitOnEnter - if true, the form will be submitted when the enter key is pressed. Otherwise, the enter key will be ignored. + * @param className - css class overrides for the form component + */ export interface UserAuthFormProps extends Omit, "onSubmit">, UserAuthFormAdditionalProps { @@ -39,6 +54,13 @@ export interface UserAuthFormProps className?: string } +/** + * UserAuthForm is a component that renders a form for a given Ory flow. + * It automatically adds the form action and method and adds csrf tokens to the form. + * When the `onSubmit` parameter is passed, it also automatically maps the form data to the request body and prevents native form submits. + * @see UserAuthFormProps + * @returns JSX.Element + */ export const UserAuthForm = ({ flow, children, @@ -94,7 +116,7 @@ export const UserAuthForm = ({ {/*always add csrf token and other hidden fields to form*/}