mirror of
https://github.com/Unleash/unleash.git
synced 2025-10-09 11:14:29 +02:00
task: Upgrade to biome 1.5, moving files list to joined config variable
This commit is contained in:
parent
dcf539f4f7
commit
bad699a4da
70
biome.json
70
biome.json
@ -1,5 +1,5 @@
|
||||
{
|
||||
"$schema": "https://biomejs.dev/schemas/1.4.0/schema.json",
|
||||
"$schema": "https://biomejs.dev/schemas/1.5.0/schema.json",
|
||||
"linter": {
|
||||
"enabled": true,
|
||||
"rules": {
|
||||
@ -27,6 +27,7 @@
|
||||
},
|
||||
"suspicious": {
|
||||
"noExplicitAny": "off",
|
||||
"noImplicitAnyLet": "off",
|
||||
"noExtraNonNullAssertion": "off",
|
||||
"noRedeclare": "off",
|
||||
"noPrototypeBuiltins": "off",
|
||||
@ -37,56 +38,39 @@
|
||||
"noDelete": "off"
|
||||
}
|
||||
},
|
||||
"ignore": [
|
||||
"node_modules",
|
||||
"docker",
|
||||
"bundle.js",
|
||||
"website/blog",
|
||||
"website/build",
|
||||
"website/core",
|
||||
"website/docs",
|
||||
"website/i18n/*.js",
|
||||
"website/pages",
|
||||
"website/translated_docs",
|
||||
"website",
|
||||
"setupJest.js",
|
||||
"dist",
|
||||
"build",
|
||||
"src/migrations/*.js",
|
||||
"src/test/examples/*.json",
|
||||
"website/**/*.js",
|
||||
"coverage",
|
||||
"CHANGELOG.md"
|
||||
]
|
||||
"ignore": []
|
||||
},
|
||||
"organizeImports": {
|
||||
"enabled": false
|
||||
},
|
||||
"formatter": {
|
||||
"indentStyle": "space",
|
||||
"ignore": [
|
||||
"node_modules",
|
||||
"docker",
|
||||
"bundle.js",
|
||||
"website/blog",
|
||||
"website/build",
|
||||
"website/core",
|
||||
"website/docs",
|
||||
"website/i18n/*.js",
|
||||
"website/pages",
|
||||
"website/translated_docs",
|
||||
"website",
|
||||
"setupJest.js",
|
||||
"dist",
|
||||
"build",
|
||||
"src/migrations/*.js",
|
||||
"src/migrations/*.json",
|
||||
"src/test/examples/*.json",
|
||||
"website/**/*.js",
|
||||
"coverage"
|
||||
],
|
||||
"indentWidth": 4
|
||||
},
|
||||
"files": {
|
||||
"ignore": [
|
||||
"src/migrations/*.json",
|
||||
"**/node_modules",
|
||||
"**/docker",
|
||||
"**/bundle.js",
|
||||
"**/website/blog",
|
||||
"**/website/build",
|
||||
"**/website/core",
|
||||
"**/website/docs",
|
||||
"**/website/i18n/*.js",
|
||||
"**/website/pages",
|
||||
"**/website/translated_docs",
|
||||
"**/website",
|
||||
"**/setupJest.js",
|
||||
"**/dist",
|
||||
"**/build",
|
||||
"**/src/migrations/*.js",
|
||||
"**/src/test/examples/*.json",
|
||||
"**/website/**/*.js",
|
||||
"**/coverage",
|
||||
"**/CHANGELOG.md"
|
||||
]
|
||||
},
|
||||
"javascript": {
|
||||
"formatter": {
|
||||
"semicolons": "always",
|
||||
|
@ -32,7 +32,7 @@
|
||||
"gen:api:sandbox": "NODE_OPTIONS=\"${NODE_OPTIONS} --no-experimental-fetch\" UNLEASH_OPENAPI_URL=https://sandbox.getunleash.io/demo2/docs/openapi.json yarn run gen:api"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@biomejs/biome": "1.4.1",
|
||||
"@biomejs/biome": "1.5.0",
|
||||
"@codemirror/lang-json": "6.0.1",
|
||||
"@emotion/react": "11.11.3",
|
||||
"@emotion/styled": "11.11.0",
|
||||
|
@ -56,7 +56,11 @@ export const ApplicationList = () => {
|
||||
() => [
|
||||
{
|
||||
id: 'Icon',
|
||||
Cell: ({ row: { original: { icon } } }: any) => (
|
||||
Cell: ({
|
||||
row: {
|
||||
original: { icon },
|
||||
},
|
||||
}: any) => (
|
||||
<IconCell
|
||||
icon={
|
||||
<Avatar>
|
||||
@ -72,7 +76,9 @@ export const ApplicationList = () => {
|
||||
accessor: 'appName',
|
||||
width: '50%',
|
||||
Cell: ({
|
||||
row: { original: { appName, description } },
|
||||
row: {
|
||||
original: { appName, description },
|
||||
},
|
||||
}: any) => (
|
||||
<LinkCell
|
||||
title={appName}
|
||||
|
@ -80,7 +80,6 @@ export const MultiActionButton: FC<{
|
||||
}}
|
||||
open={open}
|
||||
anchorEl={anchorRef.current}
|
||||
role={undefined}
|
||||
transition
|
||||
disablePortal
|
||||
>
|
||||
|
@ -137,7 +137,12 @@ export const ChangeRequestsTabs = ({
|
||||
.includes(feature.name.toLowerCase()),
|
||||
);
|
||||
},
|
||||
Cell: ({ value, row: { original: { title } } }: any) => (
|
||||
Cell: ({
|
||||
value,
|
||||
row: {
|
||||
original: { title },
|
||||
},
|
||||
}: any) => (
|
||||
<FeaturesCell
|
||||
project={projectId}
|
||||
value={value}
|
||||
|
@ -71,7 +71,11 @@ const ContextList: VFC = () => {
|
||||
Header: 'Name',
|
||||
accessor: 'name',
|
||||
width: '70%',
|
||||
Cell: ({ row: { original: { name, description } } }: any) => (
|
||||
Cell: ({
|
||||
row: {
|
||||
original: { name, description },
|
||||
},
|
||||
}: any) => (
|
||||
<LinkCell
|
||||
title={name}
|
||||
to={`/context/edit/${name}`}
|
||||
@ -91,7 +95,11 @@ const ContextList: VFC = () => {
|
||||
Header: 'Actions',
|
||||
id: 'Actions',
|
||||
align: 'center',
|
||||
Cell: ({ row: { original: { name } } }: any) => (
|
||||
Cell: ({
|
||||
row: {
|
||||
original: { name },
|
||||
},
|
||||
}: any) => (
|
||||
<ContextActionsCell
|
||||
name={name}
|
||||
onDelete={() => {
|
||||
|
@ -211,18 +211,15 @@ export const DemoSteps = ({
|
||||
const currentStep = currentTopic.steps[step];
|
||||
if (!currentStep) return;
|
||||
|
||||
setTimeout(
|
||||
() => {
|
||||
if (
|
||||
currentStep.href &&
|
||||
!location.pathname.endsWith(currentStep.href.split('?')[0])
|
||||
) {
|
||||
navigate(currentStep.href);
|
||||
}
|
||||
waitForLoad(currentStep);
|
||||
},
|
||||
currentStep.delay ?? 0,
|
||||
);
|
||||
setTimeout(() => {
|
||||
if (
|
||||
currentStep.href &&
|
||||
!location.pathname.endsWith(currentStep.href.split('?')[0])
|
||||
) {
|
||||
navigate(currentStep.href);
|
||||
}
|
||||
waitForLoad(currentStep);
|
||||
}, currentStep.delay ?? 0);
|
||||
}, [topic, step]);
|
||||
|
||||
useEffect(() => {
|
||||
|
@ -70,7 +70,11 @@ export const EnvironmentVariantsTable = ({
|
||||
{
|
||||
Header: 'Weight',
|
||||
accessor: 'weight',
|
||||
Cell: ({ row: { original: { name, weight } } }: any) => {
|
||||
Cell: ({
|
||||
row: {
|
||||
original: { name, weight },
|
||||
},
|
||||
}: any) => {
|
||||
return (
|
||||
<TextCell data-testid={`VARIANT_WEIGHT_${name}`}>
|
||||
{calculateVariantWeight(weight)} %
|
||||
|
@ -54,7 +54,11 @@ export const FeatureTypesList = () => {
|
||||
Header: 'Name',
|
||||
accessor: 'name',
|
||||
width: '90%',
|
||||
Cell: ({ row: { original: { name, description } } }: any) => {
|
||||
Cell: ({
|
||||
row: {
|
||||
original: { name, description },
|
||||
},
|
||||
}: any) => {
|
||||
return (
|
||||
<LinkCell
|
||||
data-loading
|
||||
|
@ -5,12 +5,10 @@ import { Typography, styled } from '@mui/material';
|
||||
import { IntegrationIcon } from '../IntegrationList/IntegrationIcon/IntegrationIcon';
|
||||
import { Markdown } from 'component/common/Markdown/Markdown';
|
||||
|
||||
const StyledHowDoesItWorkSection = styled(StyledRaisedSection)(
|
||||
({ theme }) => ({
|
||||
fontSize: theme.fontSizes.smallBody,
|
||||
gap: theme.spacing(1.5),
|
||||
}),
|
||||
);
|
||||
const StyledHowDoesItWorkSection = styled(StyledRaisedSection)(({ theme }) => ({
|
||||
fontSize: theme.fontSizes.smallBody,
|
||||
gap: theme.spacing(1.5),
|
||||
}));
|
||||
|
||||
interface IIntegrationHowToSectionProps {
|
||||
provider?: Pick<AddonTypeSchema, 'howTo' | 'name'>;
|
||||
|
@ -117,7 +117,11 @@ export const VariantInformation: VFC<IVariantInformationProps> = ({
|
||||
const COLUMNS = [
|
||||
{
|
||||
id: 'Icon',
|
||||
Cell: ({ row: { original: { selected } } }: any) => (
|
||||
Cell: ({
|
||||
row: {
|
||||
original: { selected },
|
||||
},
|
||||
}: any) => (
|
||||
<>
|
||||
<ConditionallyRender
|
||||
condition={selected}
|
||||
@ -132,9 +136,11 @@ const COLUMNS = [
|
||||
Header: 'Name',
|
||||
accessor: 'name',
|
||||
searchable: true,
|
||||
Cell: ({ row: { original: { name } } }: any) => (
|
||||
<TextCell>{name}</TextCell>
|
||||
),
|
||||
Cell: ({
|
||||
row: {
|
||||
original: { name },
|
||||
},
|
||||
}: any) => <TextCell>{name}</TextCell>,
|
||||
maxWidth: 175,
|
||||
width: 175,
|
||||
},
|
||||
@ -144,8 +150,10 @@ const COLUMNS = [
|
||||
sortType: 'alphanumeric',
|
||||
searchable: true,
|
||||
maxWidth: 75,
|
||||
Cell: ({ row: { original: { weight } } }: any) => (
|
||||
<TextCell>{weight}</TextCell>
|
||||
),
|
||||
Cell: ({
|
||||
row: {
|
||||
original: { weight },
|
||||
},
|
||||
}: any) => <TextCell>{weight}</TextCell>,
|
||||
},
|
||||
];
|
||||
|
@ -57,7 +57,11 @@ export const ProjectDoraMetrics = () => {
|
||||
Header: 'Name',
|
||||
accessor: 'name',
|
||||
width: '40%',
|
||||
Cell: ({ row: { original: { name } } }: any) => {
|
||||
Cell: ({
|
||||
row: {
|
||||
original: { name },
|
||||
},
|
||||
}: any) => {
|
||||
return (
|
||||
<Box
|
||||
data-loading
|
||||
|
@ -102,7 +102,6 @@ const strategyListItem = (
|
||||
{`${formatStrategyNameParens(
|
||||
strategy,
|
||||
)} — in change request `}
|
||||
|
||||
<StyledLink
|
||||
to={formatChangeRequestPath(strategy.projectId, id)}
|
||||
target='_blank'
|
||||
|
@ -134,7 +134,6 @@ const strategyListItem = (
|
||||
{`${formatStrategyNameParens(
|
||||
strategy,
|
||||
)} — in change request `}
|
||||
|
||||
<Link
|
||||
to={formatChangeRequestPath(strategy.projectId, id)}
|
||||
target='_blank'
|
||||
|
@ -184,7 +184,11 @@ const getColumns = () => [
|
||||
Header: 'Name',
|
||||
accessor: 'name',
|
||||
width: '60%',
|
||||
Cell: ({ row: { original: { name, description, id } } }: any) => (
|
||||
Cell: ({
|
||||
row: {
|
||||
original: { name, description, id },
|
||||
},
|
||||
}: any) => (
|
||||
<LinkCell
|
||||
title={name}
|
||||
to={`/segments/edit/${id}`}
|
||||
|
@ -256,7 +256,9 @@ export const StrategiesList = () => {
|
||||
accessor: (row: any) => formatStrategyName(row.name),
|
||||
width: '90%',
|
||||
Cell: ({
|
||||
row: { original: { name, description, deprecated } },
|
||||
row: {
|
||||
original: { name, description, deprecated },
|
||||
},
|
||||
}: any) => {
|
||||
return (
|
||||
<LinkCell
|
||||
|
@ -77,7 +77,11 @@ export const TagTypeList = () => {
|
||||
Header: 'Name',
|
||||
accessor: 'name',
|
||||
width: '90%',
|
||||
Cell: ({ row: { original: { name, description } } }: any) => {
|
||||
Cell: ({
|
||||
row: {
|
||||
original: { name, description },
|
||||
},
|
||||
}: any) => {
|
||||
return (
|
||||
<LinkCell
|
||||
data-loading
|
||||
|
@ -119,17 +119,12 @@ declare module '@mui/material/styles' {
|
||||
variants: string[];
|
||||
}
|
||||
|
||||
// biome-ignore lint/suspicious/noEmptyInterface: <explanation>
|
||||
interface Theme extends CustomTheme {}
|
||||
// biome-ignore lint/suspicious/noEmptyInterface: <explanation>
|
||||
interface ThemeOptions extends CustomTheme {}
|
||||
|
||||
// biome-ignore lint/suspicious/noEmptyInterface: <explanation>
|
||||
interface Palette extends CustomPalette {}
|
||||
// biome-ignore lint/suspicious/noEmptyInterface: <explanation>
|
||||
interface PaletteOptions extends CustomPalette {}
|
||||
|
||||
// biome-ignore lint/suspicious/noEmptyInterface: <explanation>
|
||||
interface TypeBackground extends CustomTypeBackground {}
|
||||
|
||||
/* Extend the background object from MUI */
|
||||
|
@ -517,47 +517,59 @@
|
||||
"@babel/helper-validator-identifier" "^7.22.20"
|
||||
to-fast-properties "^2.0.0"
|
||||
|
||||
"@biomejs/biome@1.4.1":
|
||||
version "1.4.1"
|
||||
resolved "https://registry.yarnpkg.com/@biomejs/biome/-/biome-1.4.1.tgz#b698c67ea8cd8141c8e27f857c8e6e794320a251"
|
||||
integrity sha512-JccVAwPbhi37pdxbAGmaOBjUTKEwEjWAhl7rKkVVuXHo4MLASXJ5HR8BTgrImi4/7rTBsGz1tgVD1Kwv1CHGRg==
|
||||
"@biomejs/biome@1.5.0":
|
||||
version "1.5.0"
|
||||
resolved "https://registry.yarnpkg.com/@biomejs/biome/-/biome-1.5.0.tgz#8cc7006861618b601fe4c37429e9aee58e277328"
|
||||
integrity sha512-ln+o5jbs109qpeDoA+5n+vlAPai3DhlK0tHtZXzQvu4tswFgxNiJCeIXmlW1DYHziTmtBImV3Y0uhbm2iVSE3Q==
|
||||
optionalDependencies:
|
||||
"@biomejs/cli-darwin-arm64" "1.4.1"
|
||||
"@biomejs/cli-darwin-x64" "1.4.1"
|
||||
"@biomejs/cli-linux-arm64" "1.4.1"
|
||||
"@biomejs/cli-linux-x64" "1.4.1"
|
||||
"@biomejs/cli-win32-arm64" "1.4.1"
|
||||
"@biomejs/cli-win32-x64" "1.4.1"
|
||||
"@biomejs/cli-darwin-arm64" "1.5.0"
|
||||
"@biomejs/cli-darwin-x64" "1.5.0"
|
||||
"@biomejs/cli-linux-arm64" "1.5.0"
|
||||
"@biomejs/cli-linux-arm64-musl" "1.5.0"
|
||||
"@biomejs/cli-linux-x64" "1.5.0"
|
||||
"@biomejs/cli-linux-x64-musl" "1.5.0"
|
||||
"@biomejs/cli-win32-arm64" "1.5.0"
|
||||
"@biomejs/cli-win32-x64" "1.5.0"
|
||||
|
||||
"@biomejs/cli-darwin-arm64@1.4.1":
|
||||
version "1.4.1"
|
||||
resolved "https://registry.yarnpkg.com/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-1.4.1.tgz#75f9c3c9b1abed8836c8f7bc8cd23ba153fb93d1"
|
||||
integrity sha512-PZWy2Idndqux38p6AXSDQM2ldRAWi32bvb7bMbTN0ALzpWYMYnxd71ornatumSSJYoNhKmxzDLq+jct7nZJ79w==
|
||||
"@biomejs/cli-darwin-arm64@1.5.0":
|
||||
version "1.5.0"
|
||||
resolved "https://registry.yarnpkg.com/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-1.5.0.tgz#794ea67d348a3f95747e41c6bbbc1145937359ce"
|
||||
integrity sha512-3+D7axf04dpadGMOaqb2q+zyQnhWW0o/Imt7TJBWsoE0N3/+28Wht8g3UEHHcUL5FPuGIfsE+NcYntBaaAsEIg==
|
||||
|
||||
"@biomejs/cli-darwin-x64@1.4.1":
|
||||
version "1.4.1"
|
||||
resolved "https://registry.yarnpkg.com/@biomejs/cli-darwin-x64/-/cli-darwin-x64-1.4.1.tgz#672fcce2d339de3bb7a7bd2997e94f03121a28a3"
|
||||
integrity sha512-soj3BWhnsM1M2JlzR09cibUzG1owJqetwj/Oo7yg0foijo9lNH9XWXZfJBYDKgW/6Fomn+CC2EcUS+hisQzt9g==
|
||||
"@biomejs/cli-darwin-x64@1.5.0":
|
||||
version "1.5.0"
|
||||
resolved "https://registry.yarnpkg.com/@biomejs/cli-darwin-x64/-/cli-darwin-x64-1.5.0.tgz#ee8ad47984bf08bdbd09cf5cf7b1d0856af8b0f3"
|
||||
integrity sha512-8k5aaLWE/B6ZAXLC+z/Vwh9ogyiSaiRIfvg+F9foxuneHl2R/D/2Iy7pvd3Yoi4Kf6/MBdowekPVezGP4/Kbcw==
|
||||
|
||||
"@biomejs/cli-linux-arm64@1.4.1":
|
||||
version "1.4.1"
|
||||
resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-arm64/-/cli-linux-arm64-1.4.1.tgz#c816206089ad29ce866c58a6e00e9d3d64a3529d"
|
||||
integrity sha512-YIZqfJUg4F+fPsBTXxgD7EU2E5OAYbmYSl/snf4PevwfQCWE/omOFZv+NnIQmjYj9I7ParDgcJvanoA3/kO0JQ==
|
||||
"@biomejs/cli-linux-arm64-musl@1.5.0":
|
||||
version "1.5.0"
|
||||
resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-1.5.0.tgz#94af114a283b2e40cd56ec39bbc087dd752b9da4"
|
||||
integrity sha512-+1B3J8tWLTOvP3+00Cap+XhEXMvxwCHvVfuywUsB7Sqd66NWic3wKJuGbGcS3PuCWtGuIFsiQMNAGqiOXG4uBQ==
|
||||
|
||||
"@biomejs/cli-linux-x64@1.4.1":
|
||||
version "1.4.1"
|
||||
resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-x64/-/cli-linux-x64-1.4.1.tgz#2639daeab1be205cfe444a8d5a3f76aa3a59b956"
|
||||
integrity sha512-9YOZw3qBd/KUj63A6Hn2zZgzGb2nbESM0qNmeMXgmqinVKM//uc4OgY5TuKITuGjMSvcVxxd4dX1IzYjV9qvNQ==
|
||||
"@biomejs/cli-linux-arm64@1.5.0":
|
||||
version "1.5.0"
|
||||
resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-arm64/-/cli-linux-arm64-1.5.0.tgz#a173b20a9c85f7b5a69824f7fd8227274fa181d0"
|
||||
integrity sha512-RiecxG71E1jnqiJZ3FaikVBDRkk2ohIxBo0O4o68g87y6Hug//G0S83sj6Wqyn8DgKMCRWQg+XYMgk5CwLVowA==
|
||||
|
||||
"@biomejs/cli-win32-arm64@1.4.1":
|
||||
version "1.4.1"
|
||||
resolved "https://registry.yarnpkg.com/@biomejs/cli-win32-arm64/-/cli-win32-arm64-1.4.1.tgz#ed5e749b2e0987cf16b545beaa01be6980ae8ce1"
|
||||
integrity sha512-nWQbvkNKxYn/kCQ0yVF8kCaS3VzaGvtFSmItXiMknU4521LDjJ7tNWH12Gol+pIslrCbd4E1LhJa0a3ThRsBVg==
|
||||
"@biomejs/cli-linux-x64-musl@1.5.0":
|
||||
version "1.5.0"
|
||||
resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-1.5.0.tgz#5431e874954eedf8e95851a61c87ba755353fb74"
|
||||
integrity sha512-4S2rLluc0WT+XTbLTgcm9+5EEFwJmoGiUEzR6N0P2sIjZD8c5KNf9Ou46BP1Pdg5AgqV+IIClGPK1I80ApSh1Q==
|
||||
|
||||
"@biomejs/cli-win32-x64@1.4.1":
|
||||
version "1.4.1"
|
||||
resolved "https://registry.yarnpkg.com/@biomejs/cli-win32-x64/-/cli-win32-x64-1.4.1.tgz#dd8ee6e14a5d74cbeb2eb9824a43c61bb5c460e4"
|
||||
integrity sha512-88fR2CQxQ4YLs2BUDuywWYQpUKgU3A3sTezANFc/4LGKQFFLV2yX+F7QAdZVkMHfA+RD9Xg178HomM/6mnTNPA==
|
||||
"@biomejs/cli-linux-x64@1.5.0":
|
||||
version "1.5.0"
|
||||
resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-x64/-/cli-linux-x64-1.5.0.tgz#273dc39c8dea8ce02e0bb842355ffb9a7e94b201"
|
||||
integrity sha512-TlTsG+ptSmnDTUsAAYsXyGOXMcFiF8SiwhPdj4YsNkJRgx9M2curEVcTVm66FINIPK6VJTUcEDahFlx3NPUOzA==
|
||||
|
||||
"@biomejs/cli-win32-arm64@1.5.0":
|
||||
version "1.5.0"
|
||||
resolved "https://registry.yarnpkg.com/@biomejs/cli-win32-arm64/-/cli-win32-arm64-1.5.0.tgz#fd4ec29be7774dc5392fb765c25a7a8e378fee9a"
|
||||
integrity sha512-sWOi1SR+YqJuXElBncGRnWBR7IN7ni6GQY4Zm/vTpP6nVA0dX5C301eQUW1N/VnFQb6fyrJTcBslDUKyemsN/g==
|
||||
|
||||
"@biomejs/cli-win32-x64@1.5.0":
|
||||
version "1.5.0"
|
||||
resolved "https://registry.yarnpkg.com/@biomejs/cli-win32-x64/-/cli-win32-x64-1.5.0.tgz#aa74ea06cef041049027aaa0462bff5facc42b7f"
|
||||
integrity sha512-OoqgUXyzmRwX466bklOsWS7WdcvWtBuxF94DXATNe7bUiBa2tlW8QX7VVZvPnMKH57E5J619AkB3b5fhzyUhXA==
|
||||
|
||||
"@braintree/sanitize-url@^6.0.0":
|
||||
version "6.0.2"
|
||||
|
@ -151,7 +151,7 @@
|
||||
"devDependencies": {
|
||||
"@apidevtools/swagger-parser": "10.1.0",
|
||||
"@babel/core": "7.23.7",
|
||||
"@biomejs/biome": "1.4.1",
|
||||
"@biomejs/biome": "1.5.0",
|
||||
"@swc/core": "1.3.102",
|
||||
"@swc/jest": "0.2.29",
|
||||
"@types/bcryptjs": "2.4.6",
|
||||
|
@ -19,9 +19,9 @@ class PermissionError extends UnleashError {
|
||||
.map((perm) => `"${perm}"`)
|
||||
.join(', ')}`;
|
||||
|
||||
const message =
|
||||
`You don't have the required permissions to perform this operation. To perform this action, you need ${permissionsMessage}` +
|
||||
(environment ? ` in the "${environment}" environment.` : `.`);
|
||||
const message = `You don't have the required permissions to perform this operation. To perform this action, you need ${permissionsMessage}${
|
||||
environment ? ` in the "${environment}" environment.` : `.`
|
||||
}`;
|
||||
|
||||
super(message);
|
||||
|
||||
|
@ -39,7 +39,8 @@ interface IRouteOptionsNonGet extends IRouteOptionsBase {
|
||||
type IRouteOptions = IRouteOptionsNonGet | IRouteOptionsGet;
|
||||
|
||||
const checkPermission =
|
||||
(permission: Permission = []) => async (req, res, next) => {
|
||||
(permission: Permission = []) =>
|
||||
async (req, res, next) => {
|
||||
const permissions = (
|
||||
Array.isArray(permission) ? permission : [permission]
|
||||
).filter((p) => p !== NONE);
|
||||
|
@ -17,16 +17,19 @@ export const parseFile: (file: string, data: string) => any = (
|
||||
export const filterExisting: (
|
||||
keepExisting: boolean,
|
||||
existingArray: any[],
|
||||
) => (item: any) => boolean = (keepExisting, existingArray = []) => (item) => {
|
||||
if (keepExisting) {
|
||||
const found = existingArray.find((t) => t.name === item.name);
|
||||
return !found;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
) => (item: any) => boolean =
|
||||
(keepExisting, existingArray = []) =>
|
||||
(item) => {
|
||||
if (keepExisting) {
|
||||
const found = existingArray.find((t) => t.name === item.name);
|
||||
return !found;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
export const filterEqual: (existingArray: any[]) => (item: any) => boolean =
|
||||
(existingArray = []) => (item) => {
|
||||
(existingArray = []) =>
|
||||
(item) => {
|
||||
const toggle = existingArray.find((t) => t.name === item.name);
|
||||
if (toggle) {
|
||||
return JSON.stringify(toggle) !== JSON.stringify(item);
|
||||
|
@ -1,5 +1,8 @@
|
||||
export interface OmitKeys {
|
||||
<T extends object, K extends [...(keyof T)[]]>(obj: T, ...keys: K): {
|
||||
<T extends object, K extends [...(keyof T)[]]>(
|
||||
obj: T,
|
||||
...keys: K
|
||||
): {
|
||||
[K2 in Exclude<keyof T, K[number]>]: T[K2];
|
||||
};
|
||||
}
|
||||
|
80
yarn.lock
80
yarn.lock
@ -616,47 +616,59 @@
|
||||
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
|
||||
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
|
||||
|
||||
"@biomejs/biome@1.4.1":
|
||||
version "1.4.1"
|
||||
resolved "https://registry.yarnpkg.com/@biomejs/biome/-/biome-1.4.1.tgz#b698c67ea8cd8141c8e27f857c8e6e794320a251"
|
||||
integrity sha512-JccVAwPbhi37pdxbAGmaOBjUTKEwEjWAhl7rKkVVuXHo4MLASXJ5HR8BTgrImi4/7rTBsGz1tgVD1Kwv1CHGRg==
|
||||
"@biomejs/biome@1.5.0":
|
||||
version "1.5.0"
|
||||
resolved "https://registry.yarnpkg.com/@biomejs/biome/-/biome-1.5.0.tgz#8cc7006861618b601fe4c37429e9aee58e277328"
|
||||
integrity sha512-ln+o5jbs109qpeDoA+5n+vlAPai3DhlK0tHtZXzQvu4tswFgxNiJCeIXmlW1DYHziTmtBImV3Y0uhbm2iVSE3Q==
|
||||
optionalDependencies:
|
||||
"@biomejs/cli-darwin-arm64" "1.4.1"
|
||||
"@biomejs/cli-darwin-x64" "1.4.1"
|
||||
"@biomejs/cli-linux-arm64" "1.4.1"
|
||||
"@biomejs/cli-linux-x64" "1.4.1"
|
||||
"@biomejs/cli-win32-arm64" "1.4.1"
|
||||
"@biomejs/cli-win32-x64" "1.4.1"
|
||||
"@biomejs/cli-darwin-arm64" "1.5.0"
|
||||
"@biomejs/cli-darwin-x64" "1.5.0"
|
||||
"@biomejs/cli-linux-arm64" "1.5.0"
|
||||
"@biomejs/cli-linux-arm64-musl" "1.5.0"
|
||||
"@biomejs/cli-linux-x64" "1.5.0"
|
||||
"@biomejs/cli-linux-x64-musl" "1.5.0"
|
||||
"@biomejs/cli-win32-arm64" "1.5.0"
|
||||
"@biomejs/cli-win32-x64" "1.5.0"
|
||||
|
||||
"@biomejs/cli-darwin-arm64@1.4.1":
|
||||
version "1.4.1"
|
||||
resolved "https://registry.yarnpkg.com/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-1.4.1.tgz#75f9c3c9b1abed8836c8f7bc8cd23ba153fb93d1"
|
||||
integrity sha512-PZWy2Idndqux38p6AXSDQM2ldRAWi32bvb7bMbTN0ALzpWYMYnxd71ornatumSSJYoNhKmxzDLq+jct7nZJ79w==
|
||||
"@biomejs/cli-darwin-arm64@1.5.0":
|
||||
version "1.5.0"
|
||||
resolved "https://registry.yarnpkg.com/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-1.5.0.tgz#794ea67d348a3f95747e41c6bbbc1145937359ce"
|
||||
integrity sha512-3+D7axf04dpadGMOaqb2q+zyQnhWW0o/Imt7TJBWsoE0N3/+28Wht8g3UEHHcUL5FPuGIfsE+NcYntBaaAsEIg==
|
||||
|
||||
"@biomejs/cli-darwin-x64@1.4.1":
|
||||
version "1.4.1"
|
||||
resolved "https://registry.yarnpkg.com/@biomejs/cli-darwin-x64/-/cli-darwin-x64-1.4.1.tgz#672fcce2d339de3bb7a7bd2997e94f03121a28a3"
|
||||
integrity sha512-soj3BWhnsM1M2JlzR09cibUzG1owJqetwj/Oo7yg0foijo9lNH9XWXZfJBYDKgW/6Fomn+CC2EcUS+hisQzt9g==
|
||||
"@biomejs/cli-darwin-x64@1.5.0":
|
||||
version "1.5.0"
|
||||
resolved "https://registry.yarnpkg.com/@biomejs/cli-darwin-x64/-/cli-darwin-x64-1.5.0.tgz#ee8ad47984bf08bdbd09cf5cf7b1d0856af8b0f3"
|
||||
integrity sha512-8k5aaLWE/B6ZAXLC+z/Vwh9ogyiSaiRIfvg+F9foxuneHl2R/D/2Iy7pvd3Yoi4Kf6/MBdowekPVezGP4/Kbcw==
|
||||
|
||||
"@biomejs/cli-linux-arm64@1.4.1":
|
||||
version "1.4.1"
|
||||
resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-arm64/-/cli-linux-arm64-1.4.1.tgz#c816206089ad29ce866c58a6e00e9d3d64a3529d"
|
||||
integrity sha512-YIZqfJUg4F+fPsBTXxgD7EU2E5OAYbmYSl/snf4PevwfQCWE/omOFZv+NnIQmjYj9I7ParDgcJvanoA3/kO0JQ==
|
||||
"@biomejs/cli-linux-arm64-musl@1.5.0":
|
||||
version "1.5.0"
|
||||
resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-1.5.0.tgz#94af114a283b2e40cd56ec39bbc087dd752b9da4"
|
||||
integrity sha512-+1B3J8tWLTOvP3+00Cap+XhEXMvxwCHvVfuywUsB7Sqd66NWic3wKJuGbGcS3PuCWtGuIFsiQMNAGqiOXG4uBQ==
|
||||
|
||||
"@biomejs/cli-linux-x64@1.4.1":
|
||||
version "1.4.1"
|
||||
resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-x64/-/cli-linux-x64-1.4.1.tgz#2639daeab1be205cfe444a8d5a3f76aa3a59b956"
|
||||
integrity sha512-9YOZw3qBd/KUj63A6Hn2zZgzGb2nbESM0qNmeMXgmqinVKM//uc4OgY5TuKITuGjMSvcVxxd4dX1IzYjV9qvNQ==
|
||||
"@biomejs/cli-linux-arm64@1.5.0":
|
||||
version "1.5.0"
|
||||
resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-arm64/-/cli-linux-arm64-1.5.0.tgz#a173b20a9c85f7b5a69824f7fd8227274fa181d0"
|
||||
integrity sha512-RiecxG71E1jnqiJZ3FaikVBDRkk2ohIxBo0O4o68g87y6Hug//G0S83sj6Wqyn8DgKMCRWQg+XYMgk5CwLVowA==
|
||||
|
||||
"@biomejs/cli-win32-arm64@1.4.1":
|
||||
version "1.4.1"
|
||||
resolved "https://registry.yarnpkg.com/@biomejs/cli-win32-arm64/-/cli-win32-arm64-1.4.1.tgz#ed5e749b2e0987cf16b545beaa01be6980ae8ce1"
|
||||
integrity sha512-nWQbvkNKxYn/kCQ0yVF8kCaS3VzaGvtFSmItXiMknU4521LDjJ7tNWH12Gol+pIslrCbd4E1LhJa0a3ThRsBVg==
|
||||
"@biomejs/cli-linux-x64-musl@1.5.0":
|
||||
version "1.5.0"
|
||||
resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-1.5.0.tgz#5431e874954eedf8e95851a61c87ba755353fb74"
|
||||
integrity sha512-4S2rLluc0WT+XTbLTgcm9+5EEFwJmoGiUEzR6N0P2sIjZD8c5KNf9Ou46BP1Pdg5AgqV+IIClGPK1I80ApSh1Q==
|
||||
|
||||
"@biomejs/cli-win32-x64@1.4.1":
|
||||
version "1.4.1"
|
||||
resolved "https://registry.yarnpkg.com/@biomejs/cli-win32-x64/-/cli-win32-x64-1.4.1.tgz#dd8ee6e14a5d74cbeb2eb9824a43c61bb5c460e4"
|
||||
integrity sha512-88fR2CQxQ4YLs2BUDuywWYQpUKgU3A3sTezANFc/4LGKQFFLV2yX+F7QAdZVkMHfA+RD9Xg178HomM/6mnTNPA==
|
||||
"@biomejs/cli-linux-x64@1.5.0":
|
||||
version "1.5.0"
|
||||
resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-x64/-/cli-linux-x64-1.5.0.tgz#273dc39c8dea8ce02e0bb842355ffb9a7e94b201"
|
||||
integrity sha512-TlTsG+ptSmnDTUsAAYsXyGOXMcFiF8SiwhPdj4YsNkJRgx9M2curEVcTVm66FINIPK6VJTUcEDahFlx3NPUOzA==
|
||||
|
||||
"@biomejs/cli-win32-arm64@1.5.0":
|
||||
version "1.5.0"
|
||||
resolved "https://registry.yarnpkg.com/@biomejs/cli-win32-arm64/-/cli-win32-arm64-1.5.0.tgz#fd4ec29be7774dc5392fb765c25a7a8e378fee9a"
|
||||
integrity sha512-sWOi1SR+YqJuXElBncGRnWBR7IN7ni6GQY4Zm/vTpP6nVA0dX5C301eQUW1N/VnFQb6fyrJTcBslDUKyemsN/g==
|
||||
|
||||
"@biomejs/cli-win32-x64@1.5.0":
|
||||
version "1.5.0"
|
||||
resolved "https://registry.yarnpkg.com/@biomejs/cli-win32-x64/-/cli-win32-x64-1.5.0.tgz#aa74ea06cef041049027aaa0462bff5facc42b7f"
|
||||
integrity sha512-OoqgUXyzmRwX466bklOsWS7WdcvWtBuxF94DXATNe7bUiBa2tlW8QX7VVZvPnMKH57E5J619AkB3b5fhzyUhXA==
|
||||
|
||||
"@colors/colors@1.5.0":
|
||||
version "1.5.0"
|
||||
|
Loading…
Reference in New Issue
Block a user