Skip to content

Commit 83b9ac0

Browse files
authored
Merge pull request #1185 from db-ux-design-system/refactor-running-prettier
refactor: running prettier
2 parents 3031e58 + e1405c8 commit 83b9ac0

File tree

15 files changed

+102
-80
lines changed

15 files changed

+102
-80
lines changed

.github/dependabot.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ updates:
1616
ignore:
1717
# We currently need to ignore eslint@v9
1818
- dependency-name: "eslint"
19-
update-types: [ "version-update:semver-major" ]
19+
update-types: ["version-update:semver-major"]

scripts/cleanup-gh-pages.js

+44-47
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,56 @@
11
/*
22
* Fetches all branches and deletes all review-branches in github pages
33
*/
4-
import FS from 'node:fs';
4+
import FS from "node:fs";
55

6-
const TAG = 'cleanup-gh-pages:';
6+
const TAG = "cleanup-gh-pages:";
77

88
const removeOldFromPath = (isTag, data) => {
9-
const path = `public/${isTag ? 'version' : 'review'}`;
10-
if (
11-
FS.existsSync(path) &&
12-
data?.filter((branch) => branch.name).length > 0
13-
) {
14-
const dirsToDelete = FS.readdirSync(path)
15-
.filter((file) => !data.find((branch) => branch.name === file))
16-
// Let's not clean up specific folders
17-
.filter((file) => !['main', 'latest'].includes(file));
18-
if (dirsToDelete?.length > 0) {
19-
console.log(
20-
TAG,
21-
`Start removing ${isTag ? 'tags' : 'branches'} from gh-pages`
22-
);
23-
console.log(TAG, dirsToDelete);
24-
for (const dir of dirsToDelete) {
25-
FS.rmSync(`${path}/${dir}`, {
26-
recursive: true,
27-
force: true
28-
});
29-
console.log(TAG, `deleted ${isTag ? 'tag' : 'branch'} ${dir}`);
30-
}
31-
32-
return true;
33-
}
34-
35-
console.log(TAG, `All ${isTag ? 'tags' : 'branches'} are up to date`);
36-
}
37-
38-
return false;
9+
const path = `public/${isTag ? "version" : "review"}`;
10+
if (FS.existsSync(path) && data?.filter((branch) => branch.name).length > 0) {
11+
const dirsToDelete = FS.readdirSync(path)
12+
.filter((file) => !data.find((branch) => branch.name === file))
13+
// Let's not clean up specific folders
14+
.filter((file) => !["main", "latest"].includes(file));
15+
if (dirsToDelete?.length > 0) {
16+
console.log(
17+
TAG,
18+
`Start removing ${isTag ? "tags" : "branches"} from gh-pages`,
19+
);
20+
console.log(TAG, dirsToDelete);
21+
for (const dir of dirsToDelete) {
22+
FS.rmSync(`${path}/${dir}`, {
23+
recursive: true,
24+
force: true,
25+
});
26+
console.log(TAG, `deleted ${isTag ? "tag" : "branch"} ${dir}`);
27+
}
28+
29+
return true;
30+
}
31+
32+
console.log(TAG, `All ${isTag ? "tags" : "branches"} are up to date`);
33+
}
34+
35+
return false;
3936
};
4037

4138
const cleanUpPages = async ({ github, context }) => {
42-
const { repo, owner } = context.repo;
43-
const branches = await github.rest.repos.listBranches({
44-
owner,
45-
repo
46-
});
47-
const tags = await github.rest.repos.listTags({
48-
owner,
49-
repo
50-
});
51-
52-
return {
53-
deploy:
54-
removeOldFromPath(false, branches.data) ||
55-
removeOldFromPath(true, tags.data)
56-
};
39+
const { repo, owner } = context.repo;
40+
const branches = await github.rest.repos.listBranches({
41+
owner,
42+
repo,
43+
});
44+
const tags = await github.rest.repos.listTags({
45+
owner,
46+
repo,
47+
});
48+
49+
return {
50+
deploy:
51+
removeOldFromPath(false, branches.data) ||
52+
removeOldFromPath(true, tags.data),
53+
};
5754
};
5855

5956
export default cleanUpPages;

src/components/Customization/LogoUpload/logo-upload.tsx

+2-8
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,7 @@ const LogoUpload = memo(() => {
1313
<div className="flex flex-col gap-fix-md">
1414
<h5>{t("logo")}</h5>
1515
<div className="flex gap-fix-md">
16-
<div
17-
className="flex flex-col gap-fix-md p-fix-sm"
18-
data-mode="light"
19-
>
16+
<div className="flex flex-col gap-fix-md p-fix-sm" data-mode="light">
2017
<DBInfotext icon="sun">Light</DBInfotext>
2118
<img
2219
className="h-siz-md mx-auto"
@@ -44,10 +41,7 @@ const LogoUpload = memo(() => {
4441
/>
4542
</div>
4643
<DBDivider margin="none" variant="vertical" />
47-
<div
48-
className="flex flex-col gap-fix-md p-fix-sm"
49-
data-mode="dark"
50-
>
44+
<div className="flex flex-col gap-fix-md p-fix-sm" data-mode="dark">
5145
<DBInfotext icon="moon">Dark</DBInfotext>
5246
<img
5347
className="h-siz-md mx-auto"

src/components/Customization/Preview/ColorPalettes/index.scss

+6-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,12 @@
1414

1515
.db-popover-content {
1616
top: calc(
17-
-1 * (#{variables.$db-spacing-fixed-sm} + #{variables.$db-sizing-lg} *
18-
var(--color-index, 1) + var(--color-index, 1) * #{variables.$db-spacing-fixed-2xs})
17+
-1 *
18+
(
19+
#{variables.$db-spacing-fixed-sm} + #{variables.$db-sizing-lg} *
20+
var(--color-index, 1) + var(--color-index, 1) *
21+
#{variables.$db-spacing-fixed-2xs}
22+
)
1923
) !important;
2024
}
2125

src/components/DefaultPage/default-page.tsx

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
import { DBButton, DBHeader, DBPage, DBTooltip } from "@db-ux/react-core-components";
1+
import {
2+
DBButton,
3+
DBHeader,
4+
DBPage,
5+
DBTooltip,
6+
} from "@db-ux/react-core-components";
27
import { useThemeBuilderStore } from "../../store";
38
import { DefaultPagePropsType } from "./data.ts";
49
import { PropsWithChildren, useState } from "react";

src/components/Landing/ThemeSelect/theme-select.tsx

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
import { DBCard, DBIcon, DBSection, DBTooltip } from "@db-ux/react-core-components";
1+
import {
2+
DBCard,
3+
DBIcon,
4+
DBSection,
5+
DBTooltip,
6+
} from "@db-ux/react-core-components";
27
import { useThemeBuilderStore } from "../../../store";
38
import { Link } from "react-router-dom";
49
import Demo from "../../../pages/Demo";

src/index.scss

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
@use "@db-ux/core-foundations/build/styles/screen-sizes";
44
@use "@db-ux/core-components/build/styles/internal/db-puls" as puls;
55

6-
76
[data-focus="true"] {
87
@extend %db-puls;
98
@include puls.set-db-puls-vertical();

src/pages/Demo/demo.tsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,10 @@ const Demo = ({ linkToDemo, density }: DemoPropsType) => {
2626
>
2727
<div className="flex flex-col md:flex-row h-full">
2828
<Sidenav />
29-
<div className="flex flex-col gap-fix-md py-fix-md px-res-sm
30-
db-bg-color-basic-level-2 w-full h-full overflow-y-auto">
29+
<div
30+
className="flex flex-col gap-fix-md py-fix-md px-res-sm
31+
db-bg-color-basic-level-2 w-full h-full overflow-y-auto"
32+
>
3133
<h1>{t("Dashboard")}</h1>
3234
<div className="demo-dashboard grid gap-fix-md h-full">
3335
<DBCard

src/pages/Playground/index.scss

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ $selected-outline-height: 3px;
2222
.drop-container,
2323
.drag-container {
2424
--db-current-icon-color: #{colors.$db-adaptive-on-bg-basic-emphasis-100-default};
25-
background-image: linear-gradient(
25+
background-image:
26+
linear-gradient(
2627
#{colors.$db-adaptive-bg-basic-level-1-default},
2728
#{colors.$db-adaptive-bg-basic-level-1-default}
2829
),

src/utils/generate-colors.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { defaultLuminances, HeisslufType } from "./data.ts";
22
import { Hsluv } from "hsluv";
33
import chroma from "chroma-js";
4-
import {FALLBACK_COLOR} from "../constants.ts";
4+
import { FALLBACK_COLOR } from "../constants.ts";
55

66
export const getValidPaletteColorAsHex = (
77
brandColors: HeisslufType[],

src/utils/outputs/index.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,14 @@ export const getPaletteOutput = (
173173
});
174174

175175
result[`--${prefix}-${name}-origin`] = color.origin;
176-
result[`--${prefix}-${name}-origin-light-default`] = color.originLightDefault;
176+
result[`--${prefix}-${name}-origin-light-default`] =
177+
color.originLightDefault;
177178
result[`--${prefix}-${name}-origin-light-hovered`] =
178179
color.originLightHovered;
179180
result[`--${prefix}-${name}-origin-light-pressed`] =
180181
color.originLightPressed;
181-
result[`--${prefix}-${name}-on-origin-light-default`] = color.onOriginLightDefault;
182+
result[`--${prefix}-${name}-on-origin-light-default`] =
183+
color.onOriginLightDefault;
182184
result[`--${prefix}-${name}-on-origin-light-hovered`] =
183185
color.onOriginLightHovered;
184186
result[`--${prefix}-${name}-on-origin-light-pressed`] =
@@ -187,7 +189,8 @@ export const getPaletteOutput = (
187189
result[`--${prefix}-${name}-origin-dark-default`] = color.originDarkDefault;
188190
result[`--${prefix}-${name}-origin-dark-hovered`] = color.originDarkHovered;
189191
result[`--${prefix}-${name}-origin-dark-pressed`] = color.originDarkPressed;
190-
result[`--${prefix}-${name}-on-origin-dark-default`] = color.onOriginDarkDefault;
192+
result[`--${prefix}-${name}-on-origin-dark-default`] =
193+
color.onOriginDarkDefault;
191194
result[`--${prefix}-${name}-on-origin-dark-hovered`] =
192195
color.onOriginDarkHovered;
193196
result[`--${prefix}-${name}-on-origin-dark-pressed`] =

src/utils/outputs/web/auto-complete/data.ts

+12-5
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,13 @@ export const generateColorProperties = (color: string): string => {
2424
colorStates.forEach((state) => {
2525
backgroundColors.forEach((bgColor) => {
2626
result +=
27-
["-", prefix, color, "bg", bgColor, state].join("-") + `: "Change the background color level of the current element. Can be used on containers and components.";\n`;
27+
["-", prefix, color, "bg", bgColor, state].join("-") +
28+
`: "Change the background color level of the current element. Can be used on containers and components.";\n`;
2829
});
2930
onBackgroundColors.forEach((onBgColor) => {
3031
result +=
31-
["-", prefix, color, "on-bg", onBgColor, state].join("-") + `: "Change the foreground color with another emphasis of the current element.";\n`;
32+
["-", prefix, color, "on-bg", onBgColor, state].join("-") +
33+
`: "Change the foreground color with another emphasis of the current element.";\n`;
3234
});
3335
invertedColors.forEach((invertedColor) => {
3436
result +=
@@ -37,9 +39,14 @@ export const generateColorProperties = (color: string): string => {
3739
});
3840

3941
result +=
40-
["-", prefix, color, "on-bg", "inverted", state].join("-") + `: "Change the foreground color of the current element. Only used with inverted background colors.";\n`;
41-
result += ["-", prefix, color, "origin", state].join("-") + `: "Origin color can be used for background and foreground. Use this if you know what you are doing, it might not be accessible.";\n`;
42-
result += ["-", prefix, color, "on-origin", state].join("-") + `: "Change the foreground color of the current element. Only used with origin as background color.";\n`;
42+
["-", prefix, color, "on-bg", "inverted", state].join("-") +
43+
`: "Change the foreground color of the current element. Only used with inverted background colors.";\n`;
44+
result +=
45+
["-", prefix, color, "origin", state].join("-") +
46+
`: "Origin color can be used for background and foreground. Use this if you know what you are doing, it might not be accessible.";\n`;
47+
result +=
48+
["-", prefix, color, "on-origin", state].join("-") +
49+
`: "Change the foreground color of the current element. Only used with origin as background color.";\n`;
4350
});
4451
return result;
4552
};

src/utils/outputs/web/auto-complete/index.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,12 @@ export const getColorVariables = (
3838
const getClasses = (allColors: Record<string, DefaultColorType>) => {
3939
const combinedClasses = [
4040
...allClasses,
41-
{ name: `container-color`, description: "These classes define the monochromatic adaptive color scheme for a container. Texts, icons and backgrounds in it than automatically adapt to the color set.", sizes: Object.keys(allColors) },
41+
{
42+
name: `container-color`,
43+
description:
44+
"These classes define the monochromatic adaptive color scheme for a container. Texts, icons and backgrounds in it than automatically adapt to the color set.",
45+
sizes: Object.keys(allColors),
46+
},
4247
];
4348
let result = "";
4449
combinedClasses.forEach((classSet) => {

tailwind.config.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ export default {
77
theme: {
88
...tokens,
99
gap: ({ theme }) => ({
10-
...theme("spacing")
10+
...theme("spacing"),
1111
}),
1212
space: ({ theme }) => ({
13-
...theme("spacing")
14-
})
15-
}
16-
};
13+
...theme("spacing"),
14+
}),
15+
},
16+
};

vite.config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ export default defineConfig({
77
plugins: [react()],
88
define: {
99
global: {},
10-
}
10+
},
1111
});

0 commit comments

Comments
 (0)