diff --git a/apps/demo/package.json b/apps/demo/package.json index 2206610bc..31a06efe6 100644 --- a/apps/demo/package.json +++ b/apps/demo/package.json @@ -12,6 +12,8 @@ "preview": "vite preview", "snapshot:update": "vitest --environment jsdom run --update", "sort-package": "npx sort-package-json", + "stylelint": "stylelint \"src/**/*.{css,vue}\" --allow-empty-input", + "stylelint:fix": "stylelint \"src/**/*.{css,vue}\" --fix --allow-empty-input", "test": "CI=true vitest", "test:unit": "CI=true vitest", "typecheck": "tsc --noEmit -p tsconfig.vitest.json --composite false" @@ -23,7 +25,6 @@ "@prefabs.tech/react-layout": "0.72.1", "@prefabs.tech/react-ui": "0.72.1", "@prefabs.tech/react-user": "0.72.1", - "@prefabs.tech/tsconfig": "0.6.0", "@reduxjs/toolkit": "1.9.7", "normalize.css": "8.0.1", "primeicons": "7.0.0", @@ -36,11 +37,12 @@ "zod": "3.24.4" }, "devDependencies": { - "@prefabs.tech/tsconfig": "0.5.0", "@babel/core": "7.26.10", "@babel/plugin-syntax-flow": "7.26.0", "@babel/plugin-transform-react-jsx": "^7.21.5", - "@prefabs.tech/eslint-config": "0.5.0", + "@prefabs.tech/eslint-config": "0.7.0", + "@prefabs.tech/stylelint-config": "0.7.0", + "@prefabs.tech/tsconfig": "0.7.0", "@testing-library/react": "16.3.2", "@types/jsdom": "21.1.7", "@types/node": "25.3.5", @@ -51,6 +53,9 @@ "eslint": "9.39.4", "jsdom": "27.0.1", "prettier": "3.8.3", + "stylelint": "17.9.1", + "stylelint-config-standard": "40.0.0", + "stylelint-order": "8.1.1", "typescript": "5.9.3", "vite": "7.3.2", "vite-plugin-compression": "0.5.1", diff --git a/apps/demo/setup-test.ts b/apps/demo/setup-test.ts index 3bb3c5cce..cd9a4146c 100644 --- a/apps/demo/setup-test.ts +++ b/apps/demo/setup-test.ts @@ -4,10 +4,10 @@ import { vi } from "vitest"; vi.mock("@prefabs.tech/react-i18n", () => ({ useTranslation: () => { return { - t: (string_) => string_, i18n: { changeLanguage: () => new Promise(() => {}), }, + t: (string_) => string_, }; }, })); diff --git a/apps/demo/src/Routers.tsx b/apps/demo/src/Routers.tsx index 1bf999f01..7efeecb35 100644 --- a/apps/demo/src/Routers.tsx +++ b/apps/demo/src/Routers.tsx @@ -28,70 +28,70 @@ import { const router = createBrowserRouter( [ { - path: "/", - element: , - errorElement: , children: [ { - index: true, element: , + index: true, }, { - path: "/ui", - element: , children: [ { - index: true, element: , + index: true, }, ...uiRoutes, ], + element: , + path: "/ui", }, { - path: "/user", - element: , children: [ { - index: true, element: , + index: true, }, ...userRoutes, ], + element: , + path: "/user", }, { - path: "/form", - element: , children: [ { - index: true, element: , + index: true, }, ...formRoutes, ], + element: , + path: "/form", }, { - path: "/layout", - element: , children: [ { - index: true, element: , + index: true, }, ...layoutRoutes, ], + element: , + path: "/layout", }, { - path: "/i18n", - element: , children: [ { - index: true, element: , + index: true, }, ...i18nRoutes, ], + element: , + path: "/i18n", }, ], + element: , + errorElement: , + path: "/", }, ], { diff --git a/apps/demo/src/Views/ErrorBoundary/__test__/ErrorBoundary.snapshot.test.tsx b/apps/demo/src/Views/ErrorBoundary/__test__/ErrorBoundary.snapshot.test.tsx index 3754d57d0..ea7f43c18 100644 --- a/apps/demo/src/Views/ErrorBoundary/__test__/ErrorBoundary.snapshot.test.tsx +++ b/apps/demo/src/Views/ErrorBoundary/__test__/ErrorBoundary.snapshot.test.tsx @@ -5,7 +5,7 @@ import ErrorBoundary from "../index"; vi.mock("react-router-dom", async () => ({ ...(await vi.importActual("react-router-dom")), - useRouteError: () => ({ statusText: 404, message: "Not Found" }), + useRouteError: () => ({ message: "Not Found", statusText: 404 }), })); test("Component matches snapshot", async () => { diff --git a/apps/demo/src/Views/ErrorBoundary/__test__/ErrorBoundary.test.tsx b/apps/demo/src/Views/ErrorBoundary/__test__/ErrorBoundary.test.tsx index 2dbb53fa0..9404443ed 100644 --- a/apps/demo/src/Views/ErrorBoundary/__test__/ErrorBoundary.test.tsx +++ b/apps/demo/src/Views/ErrorBoundary/__test__/ErrorBoundary.test.tsx @@ -5,7 +5,7 @@ import ErrorBoundary from "../index"; vi.mock("react-router-dom", async () => ({ ...(await vi.importActual("react-router-dom")), - useRouteError: () => ({ statusText: 404, message: "Not Found" }), + useRouteError: () => ({ message: "Not Found", statusText: 404 }), })); test("show error when loader throws error", async () => { diff --git a/apps/demo/src/Views/ErrorBoundary/index.tsx b/apps/demo/src/Views/ErrorBoundary/index.tsx index bdcf10038..0d4507020 100644 --- a/apps/demo/src/Views/ErrorBoundary/index.tsx +++ b/apps/demo/src/Views/ErrorBoundary/index.tsx @@ -1,11 +1,12 @@ import { useTranslation } from "@prefabs.tech/react-i18n"; import { Page } from "@prefabs.tech/react-ui"; import { useRouteError } from "react-router-dom"; + import "./ErrorBoundary.css"; type RouteError = { - statusText?: string; message?: string; + statusText?: string; }; const ErrorBoundary = (): JSX.Element => { diff --git a/apps/demo/src/Views/Form/components/FileInput/FileInput.tsx b/apps/demo/src/Views/Form/components/FileInput/FileInput.tsx index 3cd944adf..922d43d06 100644 --- a/apps/demo/src/Views/Form/components/FileInput/FileInput.tsx +++ b/apps/demo/src/Views/Form/components/FileInput/FileInput.tsx @@ -2,6 +2,7 @@ import { useTranslation } from "@prefabs.tech/react-i18n"; import { Button, Page } from "@prefabs.tech/react-ui"; import { useNavigate } from "react-router-dom"; +import { Section } from "../../../../components/Demo"; import { FileAttachDemo, FileInputButton, @@ -9,7 +10,6 @@ import { FormWithFileInput, FormWithFileInputButton, } from "./_components"; -import { Section } from "../../../../components/Demo"; export const FileInputDemo = () => { const [t] = useTranslation("form"); @@ -21,10 +21,10 @@ export const FileInputDemo = () => { title={t("fileInput.title")} toolbar={