Move from prettier to oxfmt (#64299)

* Move from prettier to oxfmt

* Do not sort package.json
This commit is contained in:
Ryan Clark
2026-03-10 14:11:45 +00:00
committed by GitHub
parent c4ec2a20bc
commit 4d2b865f99
59 changed files with 443 additions and 324 deletions
+61
View File
@@ -0,0 +1,61 @@
{
"$schema": "./node_modules/oxfmt/configuration_schema.json",
"printWidth": 80,
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "es5",
"arrowParens": "avoid",
"ignorePatterns": [
"*/packages/design/src/assets/**",
"*/packages/teleterm/build/**",
"**/*_pb.*",
"**/ironrdp/pkg/**",
"web/.storybook/public/mockServiceWorker.js",
],
"sortPackageJson": false,
"sortImports": {
"newlinesBetween": true,
"partitionByComment": true,
"customGroups": [
{
"groupName": "library-packages",
"elementNamePattern": [
"build",
"build/**",
"shared/**",
"design",
"design/**",
"gen-proto-ts/**",
"@gravitational/build",
"@gravitational/build/**",
"@gravitational/shared/**",
"@gravitational/design",
"@gravitational/design/**",
"@gravitational/gen-proto-ts/**",
],
},
{
"groupName": "app-packages",
"elementNamePattern": [
"teleport",
"teleport/**",
"e-teleport/**",
"teleterm/**",
"@gravitational/teleport",
"@gravitational/teleport/**",
"@gravitational/e-teleport/**",
"@gravitational/teleterm/**",
],
},
],
"groups": [
"builtin",
"external",
"library-packages",
"app-packages",
["parent", "sibling", "index"],
"unknown",
],
},
}
-11
View File
@@ -1,11 +0,0 @@
# Ignore directories:
*/packages/design/src/assets/**
*/packages/teleterm/build/**
# Ignore protobuf files:
**/*_pb.*
# Ignore WASM generated files:
**/ironrdp/pkg/**
# Ignore generated mockServiceWorker file
web/.storybook/public/mockServiceWorker.js
-39
View File
@@ -1,39 +0,0 @@
const tsConfigBase = require('./tsconfig.json');
const ourPackages = new Set(
Object.keys(tsConfigBase.compilerOptions.paths).map(
// Remove extra '/*' if present in the package name.
packageName => packageName.split('/')[0]
)
);
const appPackages = ['teleport', 'e-teleport', 'teleterm'].flatMap(pkg => [
pkg,
`@gravitational/${pkg}`,
]);
const libraryPackages = [...ourPackages]
.filter(pkg => !appPackages.includes(pkg))
.flatMap(pkg => [pkg, `@gravitational/${pkg}`]);
module.exports = {
arrowParens: 'avoid',
printWidth: 80,
bracketSpacing: true,
plugins: ['@ianvs/prettier-plugin-sort-imports'],
importOrder: [
'<BUILTIN_MODULES>',
'',
'<THIRD_PARTY_MODULES>',
'',
`^(${libraryPackages.join('|')})`,
'',
`^(${appPackages.join('|')})`,
'',
'^[./]',
],
importOrderParserPlugins: ['typescript', 'jsx', 'decorators-legacy'],
importOrderTypeScriptVersion: '5.0.0',
semi: true,
singleQuote: true,
tabWidth: 2,
trailingComma: 'es5',
};
+6 -7
View File
@@ -18,22 +18,21 @@
"test-coverage": "jest --coverage && web/scripts/print-coverage-link.sh",
"test-update-snapshot": "pnpm run test --updateSnapshot",
"tdd": "jest --watch",
"lint": "pnpm eslint && pnpm prettier-check",
"lint-fix": "pnpm eslint --fix && pnpm prettier-write",
"lint": "pnpm eslint && pnpm format-check",
"lint-fix": "pnpm eslint --fix && pnpm format",
"eslint": "eslint --quiet '+(e|web)/**/*.{ts,tsx,js,jsx,mts}'",
"type-check": "NODE_OPTIONS='--max-old-space-size=4096' tsc --build",
"type-check-native": "tsgo --build",
"optimize-resource-icons": "svgo --multipass --quiet -rf web/packages/design/src/ResourceIcon/assets",
"prettier-check": "prettier --check '+(e|web)/**/*.{ts,tsx,js,jsx,mts}'",
"prettier-write": "prettier --write --log-level silent '+(e|web)/**/*.{ts,tsx,js,jsx,mts}'",
"process-icons": "pnpm optimize-resource-icons && node web/packages/design/src/Icon/script/script.js && pnpm prettier --log-level silent --write 'web/packages/design/src/Icon/**/*.tsx'",
"format-check": "oxfmt --check 'e/**/*.{ts,tsx,js,jsx,mts}' 'web/**/*.{ts,tsx,js,jsx,mts}'",
"format": "oxfmt 'e/**/*.{ts,tsx,js,jsx,mts}' 'web/**/*.{ts,tsx,js,jsx,mts}'",
"process-icons": "pnpm optimize-resource-icons && node web/packages/design/src/Icon/script/script.js && pnpm oxfmt 'web/packages/design/src/Icon/**/*.tsx'",
"list-installed-versions": "./web/scripts/list-installed-versions.sh",
"nop": "exit 0"
},
"private": true,
"devDependencies": {
"@gravitational/build": "workspace:*",
"@ianvs/prettier-plugin-sort-imports": "^4.7.1",
"@storybook/addon-vitest": "^10.2.14",
"@storybook/react-vite": "^10.2.14",
"@testing-library/jest-dom": "^6.9.1",
@@ -55,8 +54,8 @@
"jsdom-testing-mocks": "^1.16.0",
"msw": "2.12.10",
"msw-storybook-addon": "^2.0.6",
"oxfmt": "^0.36.0",
"playwright": "^1.58.2",
"prettier": "^3.8.1",
"react-select-event": "^5.5.1",
"storybook": "^10.2.14",
"svgo": "^4.0.0",
+240 -67
View File
@@ -130,15 +130,12 @@ importers:
'@gravitational/build':
specifier: workspace:*
version: link:web/packages/build
'@ianvs/prettier-plugin-sort-imports':
specifier: ^4.7.1
version: 4.7.1([email protected])
'@storybook/addon-vitest':
specifier: ^10.2.14
version: 10.2.14([email protected]([email protected]))([email protected])([email protected](@testing-library/[email protected])([email protected])([email protected]([email protected]))([email protected]))
version: 10.2.14([email protected]([email protected]))([email protected])([email protected](@testing-library/[email protected])([email protected]([email protected]))([email protected]))
'@storybook/react-vite':
specifier: ^10.2.14
version: 10.2.14([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected](@testing-library/[email protected])([email protected])([email protected]([email protected]))([email protected]))([email protected])([email protected](@types/[email protected])([email protected])([email protected]))
version: 10.2.14([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected](@testing-library/[email protected])([email protected]([email protected]))([email protected]))([email protected])([email protected](@types/[email protected])([email protected])([email protected]))
'@testing-library/jest-dom':
specifier: ^6.9.1
version: 6.9.1
@@ -196,18 +193,18 @@ importers:
msw-storybook-addon:
specifier: ^2.0.6
version: 2.0.6([email protected](@types/[email protected])([email protected]))
oxfmt:
specifier: ^0.36.0
version: 0.36.0
playwright:
specifier: ^1.58.2
version: 1.58.2
prettier:
specifier: ^3.8.1
version: 3.8.1
react-select-event:
specifier: ^5.5.1
version: 5.5.1
storybook:
specifier: ^10.2.14
version: 10.2.14(@testing-library/[email protected])([email protected])([email protected]([email protected]))([email protected])
version: 10.2.14(@testing-library/[email protected])([email protected]([email protected]))([email protected])
svgo:
specifier: ^4.0.0
version: 4.0.0
@@ -269,7 +266,7 @@ importers:
version: 7.0.1([email protected]([email protected]))
eslint-plugin-storybook:
specifier: ^10.2.14
version: 10.2.14([email protected]([email protected]))([email protected](@testing-library/[email protected])([email protected])([email protected]([email protected]))([email protected]))([email protected])
version: 10.2.14([email protected]([email protected]))([email protected](@testing-library/[email protected])([email protected]([email protected]))([email protected]))([email protected])
eslint-plugin-testing-library:
specifier: 7.16.0
version: 7.16.0([email protected]([email protected]))([email protected])
@@ -2009,24 +2006,6 @@ packages:
resolution: {integrity: sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==}
engines: {node: '>=18.18'}
'@ianvs/[email protected]':
resolution: {integrity: sha512-jmTNYGlg95tlsoG3JLCcuC4BrFELJtLirLAkQW/71lXSyOhVt/Xj7xWbbGcuVbNq1gwWgSyMrPjJc9Z30hynVw==}
peerDependencies:
'@prettier/plugin-oxc': ^0.0.4 || ^0.1.0
'@vue/compiler-sfc': 2.7.x || 3.x
content-tag: ^4.0.0
prettier: 2 || 3 || ^4.0.0-0
prettier-plugin-ember-template-tag: ^2.1.0
peerDependenciesMeta:
'@prettier/plugin-oxc':
optional: true
'@vue/compiler-sfc':
optional: true
content-tag:
optional: true
prettier-plugin-ember-template-tag:
optional: true
'@inquirer/[email protected]':
resolution: {integrity: sha512-S8qNSZiYzFd0wAcyG5AXCvUHC5Sr7xpZ9wZ2py9XR88jUz8wooStVx5M6dRzczbBWjic9NP7+rY0Xi7qqK/aMQ==}
engines: {node: '>=18'}
@@ -2411,6 +2390,128 @@ packages:
resolution: {integrity: sha512-cifvXDhcqMwwTlTK04GBNeIe7yyo28Mfby85QXFe1Yk8nmi36Ab/5UQwptOx84SsoGNRg+EVSjwzfSZMy6pmlw==}
engines: {node: '>=14'}
'@oxfmt/[email protected]':
resolution: {integrity: sha512-Z4yVHJWx/swHHjtr0dXrBZb6LxS+qNz1qdza222mWwPTUK4L790+5i3LTgjx3KYGBzcYpjaiZBw4vOx94dH7MQ==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm]
os: [android]
'@oxfmt/[email protected]':
resolution: {integrity: sha512-3ElCJRFNPQl7jexf2CAa9XmAm8eC5JPrIDSjc9jSchkVSFTEqyL0NtZinBB2h1a4i4JgP1oGl/5G5n8YR4FN8Q==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm64]
os: [android]
'@oxfmt/[email protected]':
resolution: {integrity: sha512-nak4znWCqIExKhYSY/mz/lWsqWIpdsS7o0+SRzXR1Q0m7GrMcG1UrF1pS7TLGZhhkf7nTfEF7q6oZzJiodRDuw==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm64]
os: [darwin]
'@oxfmt/[email protected]':
resolution: {integrity: sha512-V4GP96thDnpKx6ADnMDnhIXNdtV+Ql9D4HUU+a37VTeVbs5qQSF/s6hhUP1b3xUqU7iRcwh72jUU2Y12rtGHAw==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [x64]
os: [darwin]
'@oxfmt/[email protected]':
resolution: {integrity: sha512-/xapWCADfI5wrhxpEUjhI9fnw7MV5BUZizVa8e24n3VSK6A3Y1TB/ClOP1tfxNspykFKXp4NBWl6NtDJP3osqQ==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [x64]
os: [freebsd]
'@oxfmt/[email protected]':
resolution: {integrity: sha512-1lOmv61XMFIH5uNm27620kRRzWt/RK6tdn250BRDoG9W7OXGOQ5UyI1HVT+SFkoOoKztBiinWgi68+NA1MjBVQ==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm]
os: [linux]
'@oxfmt/[email protected]':
resolution: {integrity: sha512-vMH23AskdR1ujUS9sPck2Df9rBVoZUnCVY86jisILzIQ/QQ/yKUTi7tgnIvydPx7TyB/48wsQ5QMr5Knq5p/aw==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm]
os: [linux]
'@oxfmt/[email protected]':
resolution: {integrity: sha512-Hy1V+zOBHpBiENRx77qrUTt5aPDHeCASRc8K5KwwAHkX2AKP0nV89eL17hsZrE9GmnXFjsNmd80lyf7aRTXsbw==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm64]
os: [linux]
libc: [glibc]
'@oxfmt/[email protected]':
resolution: {integrity: sha512-SPGLJkOIHSIC6ABUQ5V8NqJpvYhMJueJv26NYqfCnwi/Mn6A61amkpJJ9Suy0Nmvs+OWESJpcebrBUbXPGZyQQ==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm64]
os: [linux]
libc: [musl]
'@oxfmt/[email protected]':
resolution: {integrity: sha512-3EuoyB8x9x8ysYJjbEO/M9fkSk72zQKnXCvpZMDHXlnY36/1qMp55Nm0PrCwjGO/1pen5hdOVkz9WmP3nAp2IQ==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [ppc64]
os: [linux]
libc: [glibc]
'@oxfmt/[email protected]':
resolution: {integrity: sha512-MpY3itLwpGh8dnywtrZtaZ604T1m715SydCKy0+qTxetv+IHzuA+aO/AGzrlzUNYZZmtWtmDBrChZGibvZxbRQ==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [riscv64]
os: [linux]
libc: [glibc]
'@oxfmt/[email protected]':
resolution: {integrity: sha512-mmDhe4Vtx+XwQPRPn/V25+APnkApYgZ23q+6GVsNYY98pf3aU0aI3Me96pbRs/AfJ1jIiGC+/6q71FEu8dHcHw==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [riscv64]
os: [linux]
libc: [musl]
'@oxfmt/[email protected]':
resolution: {integrity: sha512-AYXhU+DmNWLSnvVwkHM92fuYhogtVHab7UQrPNaDf1sxadugg9gWVmcgJDlIwxJdpk5CVW/TFvwUKwI432zhhA==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [s390x]
os: [linux]
libc: [glibc]
'@oxfmt/[email protected]':
resolution: {integrity: sha512-H16QhhQ3usoakMleiAAQ2mg0NsBDAdyE9agUgfC8IHHh3jZEbr0rIKwjEqwbOHK5M0EmfhJmr+aGO/MgZPsneA==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [x64]
os: [linux]
libc: [glibc]
'@oxfmt/[email protected]':
resolution: {integrity: sha512-EFFGkixA39BcmHiCe2ECdrq02D6FCve5ka6ObbvrheXl4V+R0U/E+/uLyVx1X65LW8TA8QQHdnbdDallRekohw==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [x64]
os: [linux]
libc: [musl]
'@oxfmt/[email protected]':
resolution: {integrity: sha512-zr/t369wZWFOj1qf06Z5gGNjFymfUNDrxKMmr7FKiDRVI1sNsdKRCuRL4XVjtcptKQ+ao3FfxLN1vrynivmCYg==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm64]
os: [openharmony]
'@oxfmt/[email protected]':
resolution: {integrity: sha512-FxO7UksTv8h4olzACgrqAXNF6BP329+H322323iDrMB5V/+a1kcAw07fsOsUmqNrb9iJBsCQgH/zqcqp5903ag==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm64]
os: [win32]
'@oxfmt/[email protected]':
resolution: {integrity: sha512-OjoMQ89H01M0oLMfr/CPNH1zi48ZIwxAKObUl57oh7ssUBNDp/2Vjf7E1TQ8M4oj4VFQ/byxl2SmcPNaI2YNDg==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [ia32]
os: [win32]
'@oxfmt/[email protected]':
resolution: {integrity: sha512-MoyeQ9S36ZTz/4bDhOKJgOBIDROd4dQ5AkT9iezhEaUBxAPdNX9Oq0jD8OSnCj3G4wam/XNxVWKMA52kmzmPtQ==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [x64]
os: [win32]
'@pkgjs/[email protected]':
resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==}
engines: {node: '>=14'}
@@ -5660,6 +5761,11 @@ packages:
resolution: {integrity: sha512-qFOyK5PjiWZd+QQIh+1jhdb9LpxTF0qs7Pm8o5QHYZ0M3vKqSqzsZaEB6oWlxZ+q2sJBMI/Ktgd2N5ZwQoRHfg==}
engines: {node: '>= 0.4'}
[email protected]:
resolution: {integrity: sha512-/ejJ+KoSW6J9bcNT9a9UtJSJNWhJ3yOLSBLbkoFHJs/8CZjmaZVZAJe4YgO1KMJlKpNQasrn/G9JQUEZI3p0EQ==}
engines: {node: ^20.19.0 || >=22.12.0}
hasBin: true
[email protected]:
resolution: {integrity: sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg==}
engines: {node: '>=8'}
@@ -5805,11 +5911,6 @@ packages:
resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==}
engines: {node: '>= 0.8.0'}
[email protected]:
resolution: {integrity: sha512-UOnG6LftzbdaHZcKoPFtOcCKztrQ57WkHDeRD9t/PTQtmT0NHSeWWepj6pS0z/N7+08BHFDQVUrfmfMRcZwbMg==}
engines: {node: '>=14'}
hasBin: true
[email protected]:
resolution: {integrity: sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==}
engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0}
@@ -6456,6 +6557,10 @@ packages:
resolution: {integrity: sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==}
engines: {node: '>=12.0.0'}
[email protected]:
resolution: {integrity: sha512-Pugqs6M0m7Lv1I7FtxN4aoyToKg1C4tu+/381vH35y8oENM/Ai7f7C4StcoK4/+BSw9ebcS8jRiVrORFKCALLw==}
engines: {node: ^20.0.0 || >=22.0.0}
[email protected]:
resolution: {integrity: sha512-op4nsTR47R6p0vMUUoYl/a+ljLFVtlfaXkLQmqfLR1qHma1h/ysYk4hEXZ880bf2CYgTskvTa/e196Vd5dDQXw==}
engines: {node: '>=14.0.0'}
@@ -8563,17 +8668,6 @@ snapshots:
'@humanwhocodes/[email protected]': {}
'@ianvs/[email protected]([email protected])':
dependencies:
'@babel/generator': 7.29.1
'@babel/parser': 7.29.0
'@babel/traverse': 7.29.0
'@babel/types': 7.29.0
prettier: 3.8.1
semver: 7.7.4
transitivePeerDependencies:
- supports-color
'@inquirer/[email protected]': {}
'@inquirer/[email protected](@types/[email protected])':
@@ -9181,6 +9275,63 @@ snapshots:
'@opentelemetry/[email protected]': {}
'@oxfmt/[email protected]':
optional: true
'@oxfmt/[email protected]':
optional: true
'@oxfmt/[email protected]':
optional: true
'@oxfmt/[email protected]':
optional: true
'@oxfmt/[email protected]':
optional: true
'@oxfmt/[email protected]':
optional: true
'@oxfmt/[email protected]':
optional: true
'@oxfmt/[email protected]':
optional: true
'@oxfmt/[email protected]':
optional: true
'@oxfmt/[email protected]':
optional: true
'@oxfmt/[email protected]':
optional: true
'@oxfmt/[email protected]':
optional: true
'@oxfmt/[email protected]':
optional: true
'@oxfmt/[email protected]':
optional: true
'@oxfmt/[email protected]':
optional: true
'@oxfmt/[email protected]':
optional: true
'@oxfmt/[email protected]':
optional: true
'@oxfmt/[email protected]':
optional: true
'@oxfmt/[email protected]':
optional: true
'@pkgjs/[email protected]':
optional: true
@@ -9365,19 +9516,19 @@ snapshots:
'@standard-schema/[email protected]': {}
'@storybook/[email protected]([email protected]([email protected]))([email protected])([email protected](@testing-library/[email protected])([email protected])([email protected]([email protected]))([email protected]))':
'@storybook/[email protected]([email protected]([email protected]))([email protected])([email protected](@testing-library/[email protected])([email protected]([email protected]))([email protected]))':
dependencies:
'@storybook/global': 5.0.0
'@storybook/icons': 2.0.1([email protected]([email protected]))([email protected])
storybook: 10.2.14(@testing-library/[email protected])([email protected])([email protected]([email protected]))([email protected])
storybook: 10.2.14(@testing-library/[email protected])([email protected]([email protected]))([email protected])
transitivePeerDependencies:
- react
- react-dom
'@storybook/[email protected]([email protected])([email protected])([email protected](@testing-library/[email protected])([email protected])([email protected]([email protected]))([email protected]))([email protected](@types/[email protected])([email protected])([email protected]))':
'@storybook/[email protected]([email protected])([email protected])([email protected](@testing-library/[email protected])([email protected]([email protected]))([email protected]))([email protected](@types/[email protected])([email protected])([email protected]))':
dependencies:
'@storybook/csf-plugin': 10.2.14([email protected])([email protected])([email protected](@testing-library/[email protected])([email protected])([email protected]([email protected]))([email protected]))([email protected](@types/[email protected])([email protected])([email protected]))
storybook: 10.2.14(@testing-library/[email protected])([email protected])([email protected]([email protected]))([email protected])
'@storybook/csf-plugin': 10.2.14([email protected])([email protected])([email protected](@testing-library/[email protected])([email protected]([email protected]))([email protected]))([email protected](@types/[email protected])([email protected])([email protected]))
storybook: 10.2.14(@testing-library/[email protected])([email protected]([email protected]))([email protected])
ts-dedent: 2.2.0
vite: 7.3.1(@types/[email protected])([email protected])([email protected])
transitivePeerDependencies:
@@ -9385,9 +9536,9 @@ snapshots:
- rollup
- webpack
'@storybook/[email protected]([email protected])([email protected])([email protected](@testing-library/[email protected])([email protected])([email protected]([email protected]))([email protected]))([email protected](@types/[email protected])([email protected])([email protected]))':
'@storybook/[email protected]([email protected])([email protected])([email protected](@testing-library/[email protected])([email protected]([email protected]))([email protected]))([email protected](@types/[email protected])([email protected])([email protected]))':
dependencies:
storybook: 10.2.14(@testing-library/[email protected])([email protected])([email protected]([email protected]))([email protected])
storybook: 10.2.14(@testing-library/[email protected])([email protected]([email protected]))([email protected])
unplugin: 2.3.11
optionalDependencies:
esbuild: 0.27.3
@@ -9401,25 +9552,25 @@ snapshots:
react: 19.2.4
react-dom: 19.2.4([email protected])
'@storybook/[email protected]([email protected]([email protected]))([email protected])([email protected](@testing-library/[email protected])([email protected])([email protected]([email protected]))([email protected]))':
'@storybook/[email protected]([email protected]([email protected]))([email protected])([email protected](@testing-library/[email protected])([email protected]([email protected]))([email protected]))':
dependencies:
react: 19.2.4
react-dom: 19.2.4([email protected])
storybook: 10.2.14(@testing-library/[email protected])([email protected])([email protected]([email protected]))([email protected])
storybook: 10.2.14(@testing-library/[email protected])([email protected]([email protected]))([email protected])
'@storybook/[email protected]([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected](@testing-library/[email protected])([email protected])([email protected]([email protected]))([email protected]))([email protected])([email protected](@types/[email protected])([email protected])([email protected]))':
'@storybook/[email protected]([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected](@testing-library/[email protected])([email protected]([email protected]))([email protected]))([email protected])([email protected](@types/[email protected])([email protected])([email protected]))':
dependencies:
'@joshwooding/vite-plugin-react-docgen-typescript': 0.6.4([email protected])([email protected](@types/[email protected])([email protected])([email protected]))
'@rollup/pluginutils': 5.3.0([email protected])
'@storybook/builder-vite': 10.2.14([email protected])([email protected])([email protected](@testing-library/[email protected])([email protected])([email protected]([email protected]))([email protected]))([email protected](@types/[email protected])([email protected])([email protected]))
'@storybook/react': 10.2.14([email protected]([email protected]))([email protected])([email protected](@testing-library/[email protected])([email protected])([email protected]([email protected]))([email protected]))([email protected])
'@storybook/builder-vite': 10.2.14([email protected])([email protected])([email protected](@testing-library/[email protected])([email protected]([email protected]))([email protected]))([email protected](@types/[email protected])([email protected])([email protected]))
'@storybook/react': 10.2.14([email protected]([email protected]))([email protected])([email protected](@testing-library/[email protected])([email protected]([email protected]))([email protected]))([email protected])
empathic: 2.0.0
magic-string: 0.30.21
react: 19.2.4
react-docgen: 8.0.2
react-dom: 19.2.4([email protected])
resolve: 1.22.11
storybook: 10.2.14(@testing-library/[email protected])([email protected])([email protected]([email protected]))([email protected])
storybook: 10.2.14(@testing-library/[email protected])([email protected]([email protected]))([email protected])
tsconfig-paths: 4.2.0
vite: 7.3.1(@types/[email protected])([email protected])([email protected])
transitivePeerDependencies:
@@ -9429,14 +9580,14 @@ snapshots:
- typescript
- webpack
'@storybook/[email protected]([email protected]([email protected]))([email protected])([email protected](@testing-library/[email protected])([email protected])([email protected]([email protected]))([email protected]))([email protected])':
'@storybook/[email protected]([email protected]([email protected]))([email protected])([email protected](@testing-library/[email protected])([email protected]([email protected]))([email protected]))([email protected])':
dependencies:
'@storybook/global': 5.0.0
'@storybook/react-dom-shim': 10.2.14([email protected]([email protected]))([email protected])([email protected](@testing-library/[email protected])([email protected])([email protected]([email protected]))([email protected]))
'@storybook/react-dom-shim': 10.2.14([email protected]([email protected]))([email protected])([email protected](@testing-library/[email protected])([email protected]([email protected]))([email protected]))
react: 19.2.4
react-docgen: 8.0.2
react-dom: 19.2.4([email protected])
storybook: 10.2.14(@testing-library/[email protected])([email protected])([email protected]([email protected]))([email protected])
storybook: 10.2.14(@testing-library/[email protected])([email protected]([email protected]))([email protected])
optionalDependencies:
typescript: 5.9.3
transitivePeerDependencies:
@@ -11396,11 +11547,11 @@ snapshots:
string.prototype.matchall: 4.0.12
string.prototype.repeat: 1.0.0
[email protected]([email protected]([email protected]))([email protected](@testing-library/[email protected])([email protected])([email protected]([email protected]))([email protected]))([email protected]):
[email protected]([email protected]([email protected]))([email protected](@testing-library/[email protected])([email protected]([email protected]))([email protected]))([email protected]):
dependencies:
'@typescript-eslint/utils': 8.56.1([email protected]([email protected]))([email protected])
eslint: 9.39.2([email protected])
storybook: 10.2.14(@testing-library/[email protected])([email protected])([email protected]([email protected]))([email protected])
storybook: 10.2.14(@testing-library/[email protected])([email protected]([email protected]))([email protected])
transitivePeerDependencies:
- supports-color
- typescript
@@ -12965,6 +13116,30 @@ snapshots:
object-keys: 1.1.1
safe-push-apply: 1.0.0
[email protected]:
dependencies:
tinypool: 2.1.0
optionalDependencies:
'@oxfmt/binding-android-arm-eabi': 0.36.0
'@oxfmt/binding-android-arm64': 0.36.0
'@oxfmt/binding-darwin-arm64': 0.36.0
'@oxfmt/binding-darwin-x64': 0.36.0
'@oxfmt/binding-freebsd-x64': 0.36.0
'@oxfmt/binding-linux-arm-gnueabihf': 0.36.0
'@oxfmt/binding-linux-arm-musleabihf': 0.36.0
'@oxfmt/binding-linux-arm64-gnu': 0.36.0
'@oxfmt/binding-linux-arm64-musl': 0.36.0
'@oxfmt/binding-linux-ppc64-gnu': 0.36.0
'@oxfmt/binding-linux-riscv64-gnu': 0.36.0
'@oxfmt/binding-linux-riscv64-musl': 0.36.0
'@oxfmt/binding-linux-s390x-gnu': 0.36.0
'@oxfmt/binding-linux-x64-gnu': 0.36.0
'@oxfmt/binding-linux-x64-musl': 0.36.0
'@oxfmt/binding-openharmony-arm64': 0.36.0
'@oxfmt/binding-win32-arm64-msvc': 0.36.0
'@oxfmt/binding-win32-ia32-msvc': 0.36.0
'@oxfmt/binding-win32-x64-msvc': 0.36.0
[email protected]: {}
[email protected]:
@@ -13088,8 +13263,6 @@ snapshots:
[email protected]: {}
[email protected]: {}
[email protected]:
dependencies:
ansi-regex: 5.0.1
@@ -13657,7 +13830,7 @@ snapshots:
[email protected]: {}
[email protected](@testing-library/[email protected])([email protected])([email protected]([email protected]))([email protected]):
[email protected](@testing-library/[email protected])([email protected]([email protected]))([email protected]):
dependencies:
'@storybook/global': 5.0.0
'@storybook/icons': 2.0.1([email protected]([email protected]))([email protected])
@@ -13671,8 +13844,6 @@ snapshots:
semver: 7.7.4
use-sync-external-store: 1.6.0([email protected])
ws: 8.19.0
optionalDependencies:
prettier: 3.8.1
transitivePeerDependencies:
- '@testing-library/dom'
- bufferutil
@@ -13907,6 +14078,8 @@ snapshots:
fdir: 6.5.0([email protected])
picomatch: 4.0.3
[email protected]: {}
[email protected]: {}
[email protected]: {}
+1 -2
View File
@@ -16,9 +16,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { CSSProp } from 'styled-components';
import 'react';
import { CSSProp } from 'styled-components';
import { Theme } from 'design/theme/themes/types';
+16 -45
View File
@@ -170,56 +170,27 @@ We are targeting last 2 versions of all major browsers. To quickly find out whic
pnpm dlx browserslist 'last 2 chrome version, last 2 edge version, last 2 firefox version, last 2 safari version'
```
### Setup Prettier on VSCode
### Setup Oxfmt in Your Editor
1. Install plugin: https://github.com/prettier/prettier-vscode
1. Go to Command Palette: CMD/CTRL + SHIFT + P (or F1)
1. Type `open settings`
1. Select `Open Settings (JSON)`
1. Include the below snippet and save:
We use [oxfmt](https://oxc.rs/docs/guide/usage/formatter) for code formatting.
```js
**VSCode:**
Install the [oxc-vscode](https://oxc.rs/docs/contribute/vscode) extension from the Visual Studio Marketplace, then add to your settings:
// Set the default
"editor.formatOnSave": false,
// absolute config path
"prettier.configPath": ".prettierrc.js",
// enable per-language
"[html]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascriptreact]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
},
"[typescript]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
},
"[json]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "vscode.json-language-features"
},
"[jsonc]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "vscode.json-language-features"
},
"[markdown]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
},
```json
"editor.formatOnSave": true,
"editor.tabSize": 2,
```
**JetBrains (WebStorm, IntelliJ, etc.):**
Install the [Oxc plugin](https://plugins.jetbrains.com/plugin/27061-oxc) from the JetBrains Marketplace.
**CLI:**
```bash
pnpm format # format all files
pnpm format-check # check without writing
```
### MFA Development
#### Local cluster with nip.io
@@ -306,7 +277,7 @@ in the root `package.json`:
to avoid generating a different lockfile when `e` isn't cloned).
For example, `react` - it is imported in every package (in `e` too), so it
needs to be kept in the root.
2. CLI tools which are run from the root of the repo, like `prettier`.
2. CLI tools which are run from the root of the repo, like `oxfmt`.
### Adding an Audit Event
+1 -2
View File
@@ -16,8 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import 'whatwg-fetch';
import crypto from 'node:crypto';
import path from 'node:path';
@@ -25,6 +23,7 @@ import { configure as configureTestingLibrary } from '@testing-library/react';
import failOnConsole from 'jest-fail-on-console';
import { configMocks } from 'jsdom-testing-mocks';
import { act } from 'react';
import 'whatwg-fetch';
configMocks({ act });
+1 -2
View File
@@ -16,9 +16,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import 'styled-system';
import type * as PropTypes from 'prop-types';
import 'styled-system';
declare module 'styled-system' {
export function style(args: LowLevelStylefunctionArguments): styleFn;
+5 -7
View File
@@ -16,6 +16,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import '@testing-library/jest-dom';
import {
act,
fireEvent,
@@ -28,19 +30,15 @@ import {
within,
} from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import 'jest-styled-components';
import { HttpResponse, JsonBodyType } from 'msw';
import { setupServer } from 'msw/node';
import { PropsWithChildren, ReactNode } from 'react';
import { MemoryRouter as Router } from 'react-router-dom';
import { darkTheme } from 'design/theme';
import { ConfiguredThemeProvider } from 'design/ThemeProvider';
import '@testing-library/jest-dom';
import 'jest-styled-components';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { HttpResponse, JsonBodyType } from 'msw';
import { setupServer } from 'msw/node';
export const testQueryClient = new QueryClient({
defaultOptions: {
queries: {
@@ -17,7 +17,6 @@
*/
import '@testing-library/jest-dom';
import { render, screen } from '@testing-library/react';
import { mockResizeObserver } from 'jsdom-testing-mocks';
@@ -17,7 +17,6 @@
*/
import '@testing-library/jest-dom';
import { render, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { mockResizeObserver } from 'jsdom-testing-mocks';
@@ -16,13 +16,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { addMonths } from 'date-fns';
import { useState } from 'react';
import { DayPicker } from 'react-day-picker';
import styled from 'styled-components';
import 'react-day-picker/dist/style.css';
import { addMonths } from 'date-fns';
import styled from 'styled-components';
import { Box, ButtonIcon, Flex, LabelInput } from 'design';
import { ButtonSecondary } from 'design/Button';
@@ -50,7 +50,9 @@ export function PromotedMessage({
<br />
{self ? (
<>
You are now a member of Access List <b>{promotedAccessListTitle}</b>{' '}
You are now a member of Access List <b>
{promotedAccessListTitle}
</b>{' '}
which grants you the resources requested.
</>
) : (
@@ -19,6 +19,8 @@
import { EventEmitter } from 'events';
import { screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import 'jest-canvas-mock';
import { act } from 'react';
import { render } from 'design/utils/testing';
@@ -29,15 +31,10 @@ import {
SharedDirectoryAccess,
TdpClient,
} from 'shared/libs/tdp';
import { TdpTransport } from 'shared/libs/tdp/client';
import { DesktopSession } from './DesktopSession';
import 'jest-canvas-mock';
import userEvent from '@testing-library/user-event';
import { TdpTransport } from 'shared/libs/tdp/client';
// Disable WASM in tests.
jest.mock('shared/libs/ironrdp/pkg/ironrdp');
@@ -17,14 +17,13 @@
*/
import ace from 'ace-builds/src-min-noconflict/ace';
import 'ace-builds/src-noconflict/ext-searchbox';
import 'ace-builds/src-noconflict/mode-json';
import 'ace-builds/src-noconflict/mode-terraform.js';
import 'ace-builds/src-noconflict/mode-yaml';
import { Component } from 'react';
import styled from 'styled-components';
import 'ace-builds/src-noconflict/mode-json';
import 'ace-builds/src-noconflict/mode-yaml';
import 'ace-builds/src-noconflict/mode-terraform.js';
import 'ace-builds/src-noconflict/ext-searchbox';
import { ButtonSecondary } from 'design/Button';
import Flex from 'design/Flex';
import { Copy, Download } from 'design/Icon';
@@ -31,9 +31,6 @@ import styled from 'styled-components';
import { Box, ButtonBorder, ButtonSecondary, Flex, Text } from 'design';
import { Danger } from 'design/Alert';
import { Icon, Magnifier, PushPin } from 'design/Icon';
import './unifiedStyles.css';
import { HoverTooltip } from 'design/Tooltip';
import {
AvailableResourceMode,
@@ -77,6 +74,7 @@ import {
VisibleFilterPanelFields,
VisibleResourceItemFields,
} from './types';
import './unifiedStyles.css';
// get 48 resources to start
const INITIAL_FETCH_SIZE = 48;
@@ -290,10 +290,12 @@ function UnhealthyServerList({ servers }: { servers: SharedResourceServer[] }) {
padding: ${p => p.theme.space[3]}px;
border-left: 4px solid
${p => p.theme.colors.interactive.solid.alert.default};
${index !== lastServerInList &&
css`
${
index !== lastServerInList &&
css`
border-bottom: 1px solid ${p => p.theme.colors.spotBackground[1]};
`}
`
}
`}
>
<Text>
@@ -17,7 +17,6 @@
*/
import 'whatwg-fetch';
// eslint-disable-next-line no-restricted-imports -- FIXME
import { Node } from 'teleport/services/nodes';
@@ -35,7 +35,7 @@ import {
within,
} from 'design/utils/testing';
import { InfoGuidePanelProvider } from 'shared/components/SlidingSidePanel/InfoGuide';
import 'shared/components/TextEditor/TextEditor.mock';
import cfg from 'teleport/config';
import { createTeleportContext } from 'teleport/mocks/contexts';
import { listBotInstances } from 'teleport/services/bot/bot';
@@ -47,8 +47,6 @@ import {
listBotInstancesSuccess,
} from 'teleport/test/helpers/botInstances';
import 'shared/components/TextEditor/TextEditor.mock';
import { ContextProvider } from '..';
import { BotInstances } from './BotInstances';
@@ -31,9 +31,7 @@ import {
waitForElementToBeRemoved,
within,
} from 'design/utils/testing';
import 'shared/components/TextEditor/TextEditor.mock';
import { createTeleportContext } from 'teleport/mocks/contexts';
import { TeleportProviderBasic } from 'teleport/mocks/providers';
import { defaultAccess, makeAcl } from 'teleport/services/user/makeAcl';
@@ -16,11 +16,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { screen } from '@testing-library/react';
import { MemoryRouter, useLocation } from 'react-router';
import '@testing-library/jest-dom';
import { screen } from '@testing-library/react';
import 'jest-canvas-mock';
import { MemoryRouter, useLocation } from 'react-router';
import { act, render } from 'design/utils/testing';
@@ -1,3 +1,4 @@
import '@testing-library/jest-dom';
/**
* Teleport
* Copyright (C) 2024 Gravitational, Inc.
@@ -16,10 +17,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { screen } from '@testing-library/react';
import '@testing-library/jest-dom';
import 'jest-canvas-mock';
import { act, render } from 'design/utils/testing';
import { ContextProvider } from 'teleport';
@@ -16,12 +16,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import 'jest-canvas-mock';
import { MemoryRouter } from 'react-router';
import { render, screen } from 'design/utils/testing';
import 'jest-canvas-mock';
import { allAccessAcl } from 'teleport/mocks/contexts';
import DocumentSsh from '.';
@@ -16,12 +16,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import '@xterm/xterm/css/xterm.css';
import styled from 'styled-components';
import { Box } from 'design';
import '@xterm/xterm/css/xterm.css';
const StyledXterm = styled(Box)(
() => `
height: 100%;
@@ -19,13 +19,10 @@
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { MemoryRouter } from 'react-router';
import { copyToClipboard } from 'design/utils/copyToClipboard';
import { act, fireEvent, render, screen, waitFor } from 'design/utils/testing';
import { InfoGuidePanelProvider } from 'shared/components/SlidingSidePanel/InfoGuide';
import 'shared/components/TextEditor/TextEditor.mock';
import { copyToClipboard } from 'design/utils/copyToClipboard';
import { ContextProvider } from 'teleport';
import cfg from 'teleport/config';
import { ContentMinWidth } from 'teleport/Main/Main';
@@ -30,6 +30,7 @@ import {
Indicator,
Text,
} from 'design';
import { Info } from 'design/Alert/Alert';
import { Cross } from 'design/Icon';
import { HoverTooltip } from 'design/Tooltip';
import FieldInput from 'shared/components/FieldInput';
@@ -38,8 +39,10 @@ import { Option } from 'shared/components/Select';
import Validation, { Validator } from 'shared/components/Validation';
import { requiredField } from 'shared/components/Validation/rules';
import { useAsync } from 'shared/hooks/useAsync';
import { collectKeys } from 'shared/utils/collectKeys';
import { useTeleport } from 'teleport';
import auth from 'teleport/services/auth';
import {
AWSRules,
CreateJoinTokenRequest,
@@ -47,13 +50,7 @@ import {
JoinRole,
JoinToken,
} from 'teleport/services/joinToken';
import 'teleport/services/resources';
import { Info } from 'design/Alert/Alert';
import { collectKeys } from 'shared/utils/collectKeys';
import auth from 'teleport/services/auth';
import { YamlSupportedResourceKind } from 'teleport/services/yaml/types';
import {
@@ -174,7 +171,10 @@ function makeDefaultEditState(token: JoinToken): NewJoinTokenState {
iam: token.allow,
gcp: token.gcp?.allow.map(r => ({
project_ids: r.project_ids?.map(i => ({ value: i, label: i })),
service_accounts: r.service_accounts?.map(i => ({ value: i, label: i })),
service_accounts: r.service_accounts?.map(i => ({
value: i,
label: i,
})),
locations: r.locations?.map(i => ({ value: i, label: i })),
})),
oracle: token.oracle?.allow.map(r => ({
@@ -338,11 +338,13 @@ export function getCategoryStyles(
background: ${theme.colors.interactive.tonal.primary[2]};
color: ${theme.colors.interactive.solid.primary.active};
}
${isExpanded &&
`
${
isExpanded &&
`
background: ${theme.colors.interactive.tonal.primary[1]};
color: ${theme.colors.interactive.solid.primary.default};
`}
`
}
`;
}
@@ -358,11 +360,13 @@ export function getCategoryStyles(
background: ${theme.colors.interactive.tonal.neutral[1]};
color: ${theme.colors.text.main};
}
${isExpanded &&
`
${
isExpanded &&
`
background: ${theme.colors.interactive.tonal.neutral[0]};
color: ${theme.colors.text.main};
`}
`
}
`;
}
@@ -222,16 +222,20 @@ export const RecordingItemContainer = styled(Link).withConfig({
box-shadow: ${props => props.theme.boxShadow[3]};
}
${p.viewMode === ViewMode.List
? css`
padding: ${p.density === Density.Compact
? `${p.theme.space[2]}px`
: `calc(${p.theme.space[2]}px + 2px) ${p.theme.space[2]}px`};
${
p.viewMode === ViewMode.List
? css`
padding: ${
p.density === Density.Compact
? `${p.theme.space[2]}px`
: `calc(${p.theme.space[2]}px + 2px) ${p.theme.space[2]}px`
};
gap: ${p.theme.space[3]}px;
`
: css`
flex-direction: column;
`}
: css`
flex-direction: column;
`
}
transition: background-color 150ms, border-color 150ms, box-shadow 150ms;
`
);
@@ -244,20 +248,22 @@ export const ThumbnailContainer = styled.div<
position: relative;
overflow: hidden;
${p.viewMode === ViewMode.List
? css`
${
p.viewMode === ViewMode.List
? css`
border: 1px solid ${p.theme.colors.interactive.tonal.neutral[0]};
border-radius: ${p.theme.radii[2]}px;
height: 100%;
width: ${p.density === Density.Compact ? '256px' : '320px'};
`
: css`
: css`
border-bottom: 1px solid
${p.theme.colors.interactive.tonal.neutral[0]};
flex: 1;
height: ${p.density === Density.Compact ? '90px' : '120px'};
width: 100%;
`}
`
}
${RecordingItemContainer}:hover & {
border-color: transparent;
@@ -276,21 +282,23 @@ export const RecordingDetails = styled.div<
flex-shrink: 0;
font-size: ${p.density === Density.Compact ? '13px' : '15px'};
${p.viewMode === ViewMode.List
? css`
gap: ${p.density === Density.Compact
? p.theme.space[1]
: p.theme.space[2]}px;
padding-top: ${p.density === Density.Compact
? p.theme.space[0]
: p.theme.space[2]}px;
${
p.viewMode === ViewMode.List
? css`
gap: ${
p.density === Density.Compact ? p.theme.space[1] : p.theme.space[2]
}px;
padding-top: ${
p.density === Density.Compact ? p.theme.space[0] : p.theme.space[2]
}px;
padding-right: ${p.theme.space[1]}px;
`
: css`
: css`
padding: ${p.theme.space[3]}px ${p.theme.space[2]}px
${p.theme.space[2]}px ${p.theme.space[3]}px;
gap: ${p.theme.space[1]}px;
`}
`
}
`
);
@@ -305,13 +313,15 @@ export const Duration = styled.div<Pick<RecordingItemProps, 'viewMode'>>(
padding: ${p.theme.space[1]}px ${p.theme.space[2]}px;
right: ${p.theme.space[2]}px;
${p.viewMode === ViewMode.List
? css`
${
p.viewMode === ViewMode.List
? css`
bottom: ${p.theme.space[2]}px;
`
: css`
: css`
top: ${p.theme.space[2]}px;
`}
`
}
`
);
@@ -17,7 +17,6 @@
*/
import 'jest-canvas-mock';
import { darkTheme } from 'design/theme';
import {
@@ -17,7 +17,6 @@
*/
import 'jest-canvas-mock';
import { darkTheme } from 'design/theme';
import { SessionRecordingThumbnail } from 'teleport/services/recordings';
@@ -17,7 +17,6 @@
*/
import 'jest-canvas-mock';
import { darkTheme } from 'design/theme';
import { SessionRecordingMetadata } from 'teleport/services/recordings';
@@ -17,7 +17,6 @@
*/
import 'jest-canvas-mock';
import { darkTheme } from 'design/theme';
import { SessionRecordingMetadata } from 'teleport/services/recordings';
@@ -17,7 +17,6 @@
*/
import 'jest-canvas-mock';
import { darkTheme } from 'design/theme';
import {
@@ -80,7 +80,7 @@ export const Support = ({
css={`
grid-column: auto;
@media screen and (min-width: ${props =>
props.theme.breakpoints.small}) {
props.theme.breakpoints.small}) {
grid-column: span 2;
}
`}
@@ -16,11 +16,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import '@testing-library/jest-dom';
import { http, HttpResponse } from 'msw';
import { MemoryRouter } from 'react-router';
import '@testing-library/jest-dom';
import { ThemeProvider } from 'styled-components';
import lightTheme from 'design/theme/themes/lightTheme';
+1 -2
View File
@@ -18,9 +18,8 @@
import { createRoot } from 'react-dom/client';
import history from 'teleport/services/history';
import 'teleport/lib/polyfillRandomUuid';
import history from 'teleport/services/history';
import cfg from './config';
import { KeysEnum } from './services/storageService';
@@ -19,9 +19,7 @@
import { endOfDay, isAfter, startOfDay, subMonths } from 'date-fns';
import { forwardRef, useState } from 'react';
import { DateRange, DayPicker } from 'react-day-picker';
import 'react-day-picker/dist/style.css';
import { StyledDateRange } from 'design/DatePicker';
/**
@@ -17,9 +17,7 @@
*/
import { useState } from 'react';
import 'react-day-picker/dist/style.css';
import styled from 'styled-components';
import { Box, ButtonBorder, Text } from 'design';
@@ -63,7 +63,7 @@ export const ExternalAuditStorageCta = () => {
css={`
grid-column: span 2;
@media screen and (max-width: ${props =>
props.theme.breakpoints.mobile}) {
props.theme.breakpoints.mobile}) {
grid-column: auto;
}
`}
@@ -72,7 +72,7 @@ export const ExternalAuditStorageCta = () => {
justifyContent="space-between"
css={`
@media screen and (max-width: ${props =>
props.theme.breakpoints.mobile}) {
props.theme.breakpoints.mobile}) {
flex-direction: column;
gap: ${props => props.theme.space[3]}px;
}
@@ -50,7 +50,9 @@ describe('lib/term/protobuf', () => {
expect(msg.version).toBe('1');
expect(msg.type).toBe('r');
expect(msg.payload).toBe(`container(f1ff295e4127) ~: `);
expect(msg.payload).toBe(
`container(f1ff295e4127) ~: `
);
});
});
@@ -17,7 +17,6 @@
*/
import 'jest-canvas-mock';
import TtyTerminal from './terminal';
import Tty from './tty';
@@ -16,14 +16,12 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import '@xterm/xterm/css/xterm.css';
import { FitAddon } from '@xterm/addon-fit';
import { ImageAddon } from '@xterm/addon-image';
import { WebLinksAddon } from '@xterm/addon-web-links';
import { WebglAddon } from '@xterm/addon-webgl';
import { ITheme, Terminal } from '@xterm/xterm';
import '@xterm/xterm/css/xterm.css';
import {
SearchAddon,
TerminalSearcher,
@@ -17,7 +17,6 @@
*/
import 'whatwg-fetch';
import auth, { MfaChallengeScope } from 'teleport/services/auth/auth';
import websession from 'teleport/services/websession';
+1 -2
View File
@@ -16,10 +16,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import 'jest-canvas-mock';
import { act, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import 'jest-canvas-mock';
import { mockIntersectionObserver } from 'jsdom-testing-mocks';
import { render } from 'design/utils/testing';
@@ -17,7 +17,6 @@
*/
import 'jest-canvas-mock';
import { render, screen } from 'design/utils/testing';
import { makeDeepLinkWithSafeInput } from 'shared/deepLinks';
@@ -16,7 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import 'jest-canvas-mock';
import userEvent from '@testing-library/user-event';
import { render, screen } from 'design/utils/testing';
@@ -16,13 +16,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import 'jest-canvas-mock';
import { EventEmitter } from 'node:events';
import { screen, waitFor } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import 'jest-canvas-mock';
import { render } from 'design/utils/testing';
import Logger, { NullService } from 'teleterm/logger';
@@ -17,7 +17,6 @@
*/
import 'jest-canvas-mock';
import Logger, { NullService } from 'teleterm/logger';
import { createMockConfigService } from 'teleterm/services/config/fixtures/mocks';
import { MockPtyProcess } from 'teleterm/services/pty/fixtures/mocks';
@@ -16,11 +16,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import '@xterm/xterm/css/xterm.css';
import { FitAddon } from '@xterm/addon-fit';
import { IDisposable, ITheme, Terminal } from '@xterm/xterm';
import '@xterm/xterm/css/xterm.css';
import {
SearchAddon,
TerminalSearcher,
@@ -17,9 +17,7 @@
*/
import { renderHook, waitFor } from '@testing-library/react';
import 'jest-canvas-mock';
import Logger, { NullService } from 'teleterm/logger';
import {
IPtyProcess,
@@ -193,7 +193,7 @@ export function ChangePin(props: {
}
const notDefaultPin =
<T = string,>(): Rule<T | T[] | readonly T[]> =>
<T = string>(): Rule<T | T[] | readonly T[]> =>
value =>
() => {
const message = 'Default PIN is not allowed';
@@ -205,7 +205,7 @@ const notDefaultPin =
};
const notDefaultPuk =
<T = string,>(): Rule<T | T[] | readonly T[]> =>
<T = string>(): Rule<T | T[] | readonly T[]> =>
value =>
() => {
const message = 'Default PUK is not allowed';
@@ -217,7 +217,7 @@ const notDefaultPuk =
};
const correctLength =
<T = string,>(message: string): Rule<T | T[] | readonly T[]> =>
<T = string>(message: string): Rule<T | T[] | readonly T[]> =>
value =>
() => {
const valid =
@@ -16,10 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { PropsWithChildren } from 'react';
import '@testing-library/jest-dom';
import {
act,
createEvent,
@@ -28,6 +25,7 @@ import {
renderHook,
screen,
} from '@testing-library/react';
import { PropsWithChildren } from 'react';
import { makeRootCluster } from 'teleterm/services/tshd/testHelpers';
import { MockAppContextProvider } from 'teleterm/ui/fixtures/MockAppContextProvider';
@@ -17,7 +17,6 @@
*/
import 'jest-canvas-mock';
import { createRef } from 'react';
import { act, fireEvent, render, screen } from 'design/utils/testing';
@@ -96,10 +96,12 @@ const StyledStatus = styled(Box)<{
content: '✕';
font-size: 12px;
${!props.$inline &&
`position: absolute;
${
!props.$inline &&
`position: absolute;
top: -8px;
`}
`
}
}
`;
}
@@ -109,25 +111,29 @@ const StyledStatus = styled(Box)<{
&:after {
content: '⚠';
font-size: 12px;
${props.$inline &&
`
${
props.$inline &&
`
// This cuts out a little portion of the icon on the left. This is most clearly visible
// on Windows. But at least it better aligns with the other statuses.
//
// TODO(ravicious): Rewrite this to not use weird characters to represent different
// statuses so that all statuses properly align together.
margin: -1px;
`}
${!props.$inline &&
`
}
${
!props.$inline &&
`
position: absolute;
top: -1px;
// Visually, -1px seems to be better aligned than -2px, especially when looking at
// VnetWarning story.
left: -1px;
line-height: 8px;
`}
`
}
}
`;
}
@@ -16,7 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import 'jest-canvas-mock';
import { within } from '@testing-library/react';
import { mockIntersectionObserver } from 'jsdom-testing-mocks';
@@ -16,9 +16,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { render, screen } from '@testing-library/react';
import '@testing-library/jest-dom';
import { render, screen } from '@testing-library/react';
import { FailedApp } from './App';
@@ -16,9 +16,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { render, screen } from '@testing-library/react';
import '@testing-library/jest-dom';
import { render, screen } from '@testing-library/react';
import Logger, { NullService } from 'teleterm/logger';
@@ -16,10 +16,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import 'jest-canvas-mock';
import { within } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import 'jest-canvas-mock';
import { act, ComponentType, createRef } from 'react';
import { render, screen } from 'design/utils/testing';