migrate to vite
This commit is contained in:
parent
75e212718d
commit
24ff9e506c
38
.eslintrc.cjs
Normal file
38
.eslintrc.cjs
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
module.exports = {
|
||||||
|
root: true,
|
||||||
|
env: { browser: true, es2020: true },
|
||||||
|
extends: [
|
||||||
|
"eslint:recommended",
|
||||||
|
"plugin:@typescript-eslint/recommended",
|
||||||
|
"plugin:react-hooks/recommended",
|
||||||
|
],
|
||||||
|
ignorePatterns: ["dist", ".eslintrc.cjs"],
|
||||||
|
parser: "@typescript-eslint/parser",
|
||||||
|
plugins: ["react-refresh"],
|
||||||
|
rules: {
|
||||||
|
"react-refresh/only-export-components": [
|
||||||
|
"warn",
|
||||||
|
{ allowConstantExport: true },
|
||||||
|
],
|
||||||
|
"@typescript-eslint/ban-ts-comment": "off",
|
||||||
|
"@typescript-eslint/no-empty-function": "off",
|
||||||
|
"@typescript-eslint/no-empty-interface": "off",
|
||||||
|
"@typescript-eslint/no-explicit-any": "off",
|
||||||
|
"@typescript-eslint/no-floating-promises": "off",
|
||||||
|
"@typescript-eslint/no-inferrable-types": "off",
|
||||||
|
"@typescript-eslint/no-misused-promises": "off",
|
||||||
|
"@typescript-eslint/no-non-null-assertion": "off",
|
||||||
|
"@typescript-eslint/no-unsafe-argument": "off",
|
||||||
|
"@typescript-eslint/no-unsafe-assignment": "off",
|
||||||
|
"@typescript-eslint/no-unsafe-call": "off",
|
||||||
|
"@typescript-eslint/no-unsafe-member-access": "off",
|
||||||
|
"@typescript-eslint/no-unused-vars": "warn",
|
||||||
|
"@typescript-eslint/require-await": "warn",
|
||||||
|
"@typescript-eslint/restrict-template-expressions": "off",
|
||||||
|
"no-debugger": "off",
|
||||||
|
"no-empty-function": "off",
|
||||||
|
"no-empty-pattern": "off",
|
||||||
|
"no-empty": "off",
|
||||||
|
"prefer-const": "warn",
|
||||||
|
},
|
||||||
|
};
|
39
.gitignore
vendored
39
.gitignore
vendored
@ -1,25 +1,24 @@
|
|||||||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
# Logs
|
||||||
|
logs
|
||||||
# dependencies
|
*.log
|
||||||
/node_modules
|
|
||||||
/.pnp
|
|
||||||
.pnp.js
|
|
||||||
|
|
||||||
# testing
|
|
||||||
/coverage
|
|
||||||
|
|
||||||
# production
|
|
||||||
/build
|
|
||||||
|
|
||||||
# misc
|
|
||||||
.DS_Store
|
|
||||||
.env.local
|
|
||||||
.env.development.local
|
|
||||||
.env.test.local
|
|
||||||
.env.production.local
|
|
||||||
|
|
||||||
npm-debug.log*
|
npm-debug.log*
|
||||||
yarn-debug.log*
|
yarn-debug.log*
|
||||||
yarn-error.log*
|
yarn-error.log*
|
||||||
|
pnpm-debug.log*
|
||||||
|
lerna-debug.log*
|
||||||
|
|
||||||
|
node_modules
|
||||||
|
dist
|
||||||
|
dist-ssr
|
||||||
|
*.local
|
||||||
|
|
||||||
|
# Editor directories and files
|
||||||
|
.vscode/*
|
||||||
|
!.vscode/extensions.json
|
||||||
.idea
|
.idea
|
||||||
|
.DS_Store
|
||||||
|
*.suo
|
||||||
|
*.ntvs*
|
||||||
|
*.njsproj
|
||||||
|
*.sln
|
||||||
|
*.sw?
|
||||||
|
@ -1,17 +0,0 @@
|
|||||||
const CracoAlias = require("craco-alias");
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
plugins: [
|
|
||||||
{
|
|
||||||
plugin: CracoAlias,
|
|
||||||
options: {
|
|
||||||
source: "tsconfig",
|
|
||||||
// baseUrl SHOULD be specified
|
|
||||||
// plugin does not take it from tsconfig
|
|
||||||
baseUrl: "./src",
|
|
||||||
// tsConfigPath should point to the file where "baseUrl" and "paths" are specified
|
|
||||||
tsConfigPath: "./tsconfig.extend.json"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
};
|
|
13
index.html
Normal file
13
index.html
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8" />
|
||||||
|
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
|
<title>Vite + React + TS</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="root"></div>
|
||||||
|
<script type="module" src="/src/main.tsx"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
45
package.json
45
package.json
@ -1,9 +1,16 @@
|
|||||||
{
|
{
|
||||||
"name": "squidward",
|
"name": "squzanswerer",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
|
"type": "module",
|
||||||
|
"scripts": {
|
||||||
|
"dev": "vite",
|
||||||
|
"build": "tsc && vite build",
|
||||||
|
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
||||||
|
"preview": "vite preview",
|
||||||
|
"cypress:open": "cypress open"
|
||||||
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@craco/craco": "^7.0.0",
|
|
||||||
"@emotion/react": "^11.10.5",
|
"@emotion/react": "^11.10.5",
|
||||||
"@emotion/styled": "^11.10.5",
|
"@emotion/styled": "^11.10.5",
|
||||||
"@frontend/kitui": "^1.0.54",
|
"@frontend/kitui": "^1.0.54",
|
||||||
@ -11,8 +18,6 @@
|
|||||||
"@mui/material": "^5.10.14",
|
"@mui/material": "^5.10.14",
|
||||||
"@mui/x-date-pickers": "^6.16.1",
|
"@mui/x-date-pickers": "^6.16.1",
|
||||||
"@types/node": "^16.7.13",
|
"@types/node": "^16.7.13",
|
||||||
"@types/react": "^18.0.0",
|
|
||||||
"@types/react-dom": "^18.0.0",
|
|
||||||
"axios": "^1.5.1",
|
"axios": "^1.5.1",
|
||||||
"dayjs": "^1.11.10",
|
"dayjs": "^1.11.10",
|
||||||
"emoji-mart": "^5.5.2",
|
"emoji-mart": "^5.5.2",
|
||||||
@ -32,32 +37,22 @@
|
|||||||
"yup": "^1.3.2",
|
"yup": "^1.3.2",
|
||||||
"zustand": "^4.3.8"
|
"zustand": "^4.3.8"
|
||||||
},
|
},
|
||||||
"scripts": {
|
|
||||||
"start": "craco start",
|
|
||||||
"build": "craco build",
|
|
||||||
"test": "craco test",
|
|
||||||
"eject": "craco eject",
|
|
||||||
"cypress:open": "cypress open"
|
|
||||||
},
|
|
||||||
"browserslist": {
|
|
||||||
"production": [
|
|
||||||
">0.2%",
|
|
||||||
"not dead",
|
|
||||||
"not op_mini all"
|
|
||||||
],
|
|
||||||
"development": [
|
|
||||||
"last 1 chrome version",
|
|
||||||
"last 1 firefox version",
|
|
||||||
"last 1 safari version"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@emoji-mart/data": "^1.1.2",
|
"@emoji-mart/data": "^1.1.2",
|
||||||
"@emoji-mart/react": "^1.1.1",
|
"@emoji-mart/react": "^1.1.1",
|
||||||
"@types/cytoscape-popper": "^2.0.4",
|
"@types/cytoscape-popper": "^2.0.4",
|
||||||
|
"@types/react": "^18.2.43",
|
||||||
"@types/react-beautiful-dnd": "^13.1.4",
|
"@types/react-beautiful-dnd": "^13.1.4",
|
||||||
"@types/react-cytoscapejs": "^1.2.4",
|
"@types/react-cytoscapejs": "^1.2.4",
|
||||||
"craco-alias": "^3.0.1",
|
"@types/react-dom": "^18.2.17",
|
||||||
"cypress": "^13.6.1"
|
"@typescript-eslint/eslint-plugin": "^6.14.0",
|
||||||
|
"@typescript-eslint/parser": "^6.14.0",
|
||||||
|
"@vitejs/plugin-react": "^4.2.1",
|
||||||
|
"cypress": "^13.6.1",
|
||||||
|
"eslint": "^8.55.0",
|
||||||
|
"eslint-plugin-react-hooks": "^4.6.0",
|
||||||
|
"eslint-plugin-react-refresh": "^0.4.5",
|
||||||
|
"typescript": "^5.2.2",
|
||||||
|
"vite": "^5.0.8"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
0
src/index.tsx → src/main.tsx
Executable file → Normal file
0
src/index.tsx → src/main.tsx
Executable file → Normal file
@ -8,7 +8,7 @@ import { useDebouncedCallback } from "use-debounce";
|
|||||||
|
|
||||||
import CustomCheckbox from "@ui_kit/CustomCheckbox";
|
import CustomCheckbox from "@ui_kit/CustomCheckbox";
|
||||||
import { useEffect, useRef, useState } from "react";
|
import { useEffect, useRef, useState } from "react";
|
||||||
import { useQuestionsStore } from "@root/quizData/store";
|
import { useQuestionsStore } from "@stores/quizData/store";
|
||||||
|
|
||||||
import { checkEmptyData } from "./tools/checkEmptyData";
|
import { checkEmptyData } from "./tools/checkEmptyData";
|
||||||
import type { AnyTypedQuizQuestion } from "../../model/questionTypes/shared";
|
import type { AnyTypedQuizQuestion } from "../../model/questionTypes/shared";
|
||||||
|
@ -2,9 +2,9 @@ import { useState, useEffect } from "react";
|
|||||||
import { Box, Button, Typography, useMediaQuery, useTheme } from "@mui/material";
|
import { Box, Button, Typography, useMediaQuery, useTheme } from "@mui/material";
|
||||||
|
|
||||||
import type { AnyTypedQuizQuestion, QuizQuestionBase } from "../../model/questionTypes/shared";
|
import type { AnyTypedQuizQuestion, QuizQuestionBase } from "../../model/questionTypes/shared";
|
||||||
import { useQuestionsStore } from "@root/quizData/store";
|
import { useQuestionsStore } from "@stores/quizData/store";
|
||||||
import { getQuestionById } from "@root/quizData/actions";
|
import { getQuestionById } from "@stores/quizData/actions";
|
||||||
import { useQuizViewStore } from "@root/quizView/store";
|
import { useQuizViewStore } from "@stores/quizView/store";
|
||||||
import { enqueueSnackbar } from "notistack";
|
import { enqueueSnackbar } from "notistack";
|
||||||
import { NameplateLogoFQ } from "@icons/NameplateLogoFQ";
|
import { NameplateLogoFQ } from "@icons/NameplateLogoFQ";
|
||||||
import { NameplateLogoFQDark } from "@icons/NameplateLogoFQDark";
|
import { NameplateLogoFQDark } from "@icons/NameplateLogoFQDark";
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import { useState, useEffect } from "react";
|
import { useState, useEffect } from "react";
|
||||||
import {Box, useMediaQuery, useTheme} from "@mui/material";
|
import {Box, useMediaQuery, useTheme} from "@mui/material";
|
||||||
|
|
||||||
import { useQuestionsStore } from "@root/quizData/store"
|
import { useQuestionsStore } from "@stores/quizData/store"
|
||||||
import { getQuestionById } from "@root/quizData/actions";
|
import { getQuestionById } from "@stores/quizData/actions";
|
||||||
|
|
||||||
import { Variant } from "./questions/Variant";
|
import { Variant } from "./questions/Variant";
|
||||||
import { Images } from "./questions/Images";
|
import { Images } from "./questions/Images";
|
||||||
|
@ -6,7 +6,7 @@ import {
|
|||||||
useTheme,
|
useTheme,
|
||||||
} from "@mui/material";
|
} from "@mui/material";
|
||||||
|
|
||||||
import { useQuestionsStore } from "@root/quizData/store";
|
import { useQuestionsStore } from "@stores/quizData/store";
|
||||||
|
|
||||||
import YoutubeEmbedIframe from "./tools/YoutubeEmbedIframe";
|
import YoutubeEmbedIframe from "./tools/YoutubeEmbedIframe";
|
||||||
import { NameplateLogo } from "@icons/NameplateLogo";
|
import { NameplateLogo } from "@icons/NameplateLogo";
|
||||||
|
@ -3,7 +3,7 @@ import YoutubeEmbedIframe from "./tools/YoutubeEmbedIframe";
|
|||||||
import { QuizStartpageAlignType, QuizStartpageType } from "@model/quizSettings";
|
import { QuizStartpageAlignType, QuizStartpageType } from "@model/quizSettings";
|
||||||
import { notReachable } from "../../utils/notReachable";
|
import { notReachable } from "../../utils/notReachable";
|
||||||
import { useUADevice } from "../../utils/hooks/useUADevice";
|
import { useUADevice } from "../../utils/hooks/useUADevice";
|
||||||
import { useQuestionsStore } from "@root/quizData/store";
|
import { useQuestionsStore } from "@stores/quizData/store";
|
||||||
import { NameplateLogo } from "@icons/NameplateLogo";
|
import { NameplateLogo } from "@icons/NameplateLogo";
|
||||||
import { modes } from "../../utils/themes/Publication/themePublication";
|
import { modes } from "../../utils/themes/Publication/themePublication";
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ import { StartPageViewPublication } from "./StartPageViewPublication";
|
|||||||
import { Question } from "./Question";
|
import { Question } from "./Question";
|
||||||
import { ApologyPage } from "./ApologyPage"
|
import { ApologyPage } from "./ApologyPage"
|
||||||
|
|
||||||
import { useQuestionsStore } from "@root/quizData/store"
|
import { useQuestionsStore } from "@stores/quizData/store"
|
||||||
import { getData } from "@api/quizRelase"
|
import { getData } from "@api/quizRelase"
|
||||||
|
|
||||||
import type { AnyTypedQuizQuestion } from "@model/questionTypes/shared";
|
import type { AnyTypedQuizQuestion } from "@model/questionTypes/shared";
|
||||||
|
@ -3,13 +3,13 @@ import { DatePicker } from "@mui/x-date-pickers";
|
|||||||
import { Box, Typography, useTheme } from "@mui/material";
|
import { Box, Typography, useTheme } from "@mui/material";
|
||||||
import { modes } from "../../../utils/themes/Publication/themePublication";
|
import { modes } from "../../../utils/themes/Publication/themePublication";
|
||||||
|
|
||||||
import { useQuizViewStore, updateAnswer } from "@root/quizView/store";
|
import { useQuizViewStore, updateAnswer } from "@stores/quizView/store";
|
||||||
|
|
||||||
import type { QuizQuestionDate } from "../../../model/questionTypes/date";
|
import type { QuizQuestionDate } from "../../../model/questionTypes/date";
|
||||||
import CalendarIcon from "@icons/CalendarIcon";
|
import CalendarIcon from "@icons/CalendarIcon";
|
||||||
import { enqueueSnackbar } from "notistack";
|
import { enqueueSnackbar } from "notistack";
|
||||||
import { sendAnswer } from "@api/quizRelase";
|
import { sendAnswer } from "@api/quizRelase";
|
||||||
import { useQuestionsStore } from "@root/quizData/store";
|
import { useQuestionsStore } from "@stores/quizData/store";
|
||||||
|
|
||||||
type DateProps = {
|
type DateProps = {
|
||||||
currentQuestion: QuizQuestionDate;
|
currentQuestion: QuizQuestionDate;
|
||||||
|
@ -10,7 +10,7 @@ import {
|
|||||||
} from "@mui/material";
|
} from "@mui/material";
|
||||||
import { modes } from "../../../utils/themes/Publication/themePublication";
|
import { modes } from "../../../utils/themes/Publication/themePublication";
|
||||||
|
|
||||||
import { useQuizViewStore, updateAnswer, deleteAnswer } from "@root/quizView/store";
|
import { useQuizViewStore, updateAnswer, deleteAnswer } from "@stores/quizView/store";
|
||||||
|
|
||||||
import RadioCheck from "@ui_kit/RadioCheck";
|
import RadioCheck from "@ui_kit/RadioCheck";
|
||||||
import RadioIcon from "@ui_kit/RadioIcon";
|
import RadioIcon from "@ui_kit/RadioIcon";
|
||||||
@ -18,7 +18,7 @@ import RadioIcon from "@ui_kit/RadioIcon";
|
|||||||
import type { QuizQuestionEmoji } from "../../../model/questionTypes/emoji";
|
import type { QuizQuestionEmoji } from "../../../model/questionTypes/emoji";
|
||||||
import { enqueueSnackbar } from "notistack";
|
import { enqueueSnackbar } from "notistack";
|
||||||
import { sendAnswer } from "@api/quizRelase";
|
import { sendAnswer } from "@api/quizRelase";
|
||||||
import { useQuestionsStore } from "@root/quizData/store"
|
import { useQuestionsStore } from "@stores/quizData/store"
|
||||||
|
|
||||||
type EmojiProps = {
|
type EmojiProps = {
|
||||||
currentQuestion: QuizQuestionEmoji;
|
currentQuestion: QuizQuestionEmoji;
|
||||||
|
@ -5,7 +5,7 @@ import {
|
|||||||
useTheme,
|
useTheme,
|
||||||
IconButton, useMediaQuery,
|
IconButton, useMediaQuery,
|
||||||
} from "@mui/material";
|
} from "@mui/material";
|
||||||
import { useQuizViewStore, updateAnswer } from "@root/quizView/store";
|
import { useQuizViewStore, updateAnswer } from "@stores/quizView/store";
|
||||||
import { UPLOAD_FILE_TYPES_MAP } from "../tools/File";
|
import { UPLOAD_FILE_TYPES_MAP } from "../tools/File";
|
||||||
|
|
||||||
import UploadIcon from "@icons/UploadIcon";
|
import UploadIcon from "@icons/UploadIcon";
|
||||||
@ -17,7 +17,7 @@ import type { DragEvent } from "react";
|
|||||||
import type { UploadFileType } from "@model/questionTypes/file";
|
import type { UploadFileType } from "@model/questionTypes/file";
|
||||||
import { enqueueSnackbar } from "notistack";
|
import { enqueueSnackbar } from "notistack";
|
||||||
import { sendFile } from "@api/quizRelase";
|
import { sendFile } from "@api/quizRelase";
|
||||||
import { useQuestionsStore } from "@root/quizData/store"
|
import { useQuestionsStore } from "@stores/quizData/store"
|
||||||
|
|
||||||
type FileProps = {
|
type FileProps = {
|
||||||
currentQuestion: QuizQuestionFile;
|
currentQuestion: QuizQuestionFile;
|
||||||
|
@ -8,14 +8,14 @@ import {
|
|||||||
useMediaQuery,
|
useMediaQuery,
|
||||||
} from "@mui/material";
|
} from "@mui/material";
|
||||||
|
|
||||||
import { useQuizViewStore, updateAnswer, deleteAnswer } from "@root/quizView/store";
|
import { useQuizViewStore, updateAnswer, deleteAnswer } from "@stores/quizView/store";
|
||||||
import RadioCheck from "@ui_kit/RadioCheck";
|
import RadioCheck from "@ui_kit/RadioCheck";
|
||||||
import RadioIcon from "@ui_kit/RadioIcon";
|
import RadioIcon from "@ui_kit/RadioIcon";
|
||||||
|
|
||||||
import type { QuizQuestionImages } from "../../../model/questionTypes/images";
|
import type { QuizQuestionImages } from "../../../model/questionTypes/images";
|
||||||
import { enqueueSnackbar } from "notistack";
|
import { enqueueSnackbar } from "notistack";
|
||||||
import { sendAnswer } from "@api/quizRelase";
|
import { sendAnswer } from "@api/quizRelase";
|
||||||
import { useQuestionsStore } from "@root/quizData/store"
|
import { useQuestionsStore } from "@stores/quizData/store"
|
||||||
|
|
||||||
type ImagesProps = {
|
type ImagesProps = {
|
||||||
currentQuestion: QuizQuestionImages;
|
currentQuestion: QuizQuestionImages;
|
||||||
|
@ -5,12 +5,12 @@ import { useDebouncedCallback } from "use-debounce";
|
|||||||
import CustomTextField from "@ui_kit/CustomTextField";
|
import CustomTextField from "@ui_kit/CustomTextField";
|
||||||
import { CustomSlider } from "@ui_kit/CustomSlider";
|
import { CustomSlider } from "@ui_kit/CustomSlider";
|
||||||
|
|
||||||
import { useQuizViewStore, updateAnswer } from "@root/quizView/store";
|
import { useQuizViewStore, updateAnswer } from "@stores/quizView/store";
|
||||||
|
|
||||||
import type { QuizQuestionNumber } from "../../../model/questionTypes/number";
|
import type { QuizQuestionNumber } from "../../../model/questionTypes/number";
|
||||||
import { enqueueSnackbar } from "notistack";
|
import { enqueueSnackbar } from "notistack";
|
||||||
import { sendAnswer } from "@api/quizRelase";
|
import { sendAnswer } from "@api/quizRelase";
|
||||||
import { useQuestionsStore } from "@root/quizData/store"
|
import { useQuestionsStore } from "@stores/quizData/store"
|
||||||
import { modes } from "../../../utils/themes/Publication/themePublication";
|
import { modes } from "../../../utils/themes/Publication/themePublication";
|
||||||
|
|
||||||
type NumberProps = {
|
type NumberProps = {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { Box, Typography, useTheme } from "@mui/material";
|
import { Box, Typography, useTheme } from "@mui/material";
|
||||||
|
|
||||||
import { useQuizViewStore, updateAnswer } from "@root/quizView/store";
|
import { useQuizViewStore, updateAnswer } from "@stores/quizView/store";
|
||||||
|
|
||||||
import type { QuizQuestionPage } from "../../../model/questionTypes/page";
|
import type { QuizQuestionPage } from "../../../model/questionTypes/page";
|
||||||
import YoutubeEmbedIframe from "../tools/YoutubeEmbedIframe";
|
import YoutubeEmbedIframe from "../tools/YoutubeEmbedIframe";
|
||||||
|
@ -6,7 +6,7 @@ import {
|
|||||||
useMediaQuery
|
useMediaQuery
|
||||||
} from "@mui/material";
|
} from "@mui/material";
|
||||||
|
|
||||||
import { useQuizViewStore, updateAnswer } from "@root/quizView/store";
|
import { useQuizViewStore, updateAnswer } from "@stores/quizView/store";
|
||||||
|
|
||||||
import TropfyIcon from "@icons/questionsPage/tropfyIcon";
|
import TropfyIcon from "@icons/questionsPage/tropfyIcon";
|
||||||
import FlagIcon from "@icons/questionsPage/FlagIcon";
|
import FlagIcon from "@icons/questionsPage/FlagIcon";
|
||||||
@ -19,7 +19,7 @@ import StarIconMini from "@icons/questionsPage/StarIconMini";
|
|||||||
import type { QuizQuestionRating } from "../../../model/questionTypes/rating";
|
import type { QuizQuestionRating } from "../../../model/questionTypes/rating";
|
||||||
import { enqueueSnackbar } from "notistack";
|
import { enqueueSnackbar } from "notistack";
|
||||||
import { sendAnswer } from "@api/quizRelase";
|
import { sendAnswer } from "@api/quizRelase";
|
||||||
import { useQuestionsStore } from "@root/quizData/store"
|
import { useQuestionsStore } from "@stores/quizData/store";
|
||||||
|
|
||||||
type RatingProps = {
|
type RatingProps = {
|
||||||
currentQuestion: QuizQuestionRating;
|
currentQuestion: QuizQuestionRating;
|
||||||
|
@ -2,13 +2,13 @@ import { Box, Typography, useTheme } from "@mui/material";
|
|||||||
|
|
||||||
import { Select as SelectComponent } from "../tools//Select";
|
import { Select as SelectComponent } from "../tools//Select";
|
||||||
|
|
||||||
import { useQuizViewStore, updateAnswer, deleteAnswer } from "@root/quizView/store";
|
import { useQuizViewStore, updateAnswer, deleteAnswer } from "@stores/quizView/store";
|
||||||
|
|
||||||
import type { QuizQuestionSelect } from "../../../model/questionTypes/select";
|
import type { QuizQuestionSelect } from "../../../model/questionTypes/select";
|
||||||
import { enqueueSnackbar } from "notistack";
|
import { enqueueSnackbar } from "notistack";
|
||||||
import { sendAnswer } from "@api/quizRelase";
|
import { sendAnswer } from "@api/quizRelase";
|
||||||
|
|
||||||
import { useQuestionsStore } from "@root/quizData/store"
|
import { useQuestionsStore } from "@stores/quizData/store"
|
||||||
type SelectProps = {
|
type SelectProps = {
|
||||||
currentQuestion: QuizQuestionSelect;
|
currentQuestion: QuizQuestionSelect;
|
||||||
};
|
};
|
||||||
|
@ -2,11 +2,11 @@ import { Box, Typography, useTheme } from "@mui/material";
|
|||||||
|
|
||||||
import CustomTextField from "@ui_kit/CustomTextField";
|
import CustomTextField from "@ui_kit/CustomTextField";
|
||||||
|
|
||||||
import { useQuizViewStore, updateAnswer } from "@root/quizView/store";
|
import { useQuizViewStore, updateAnswer } from "@stores/quizView/store";
|
||||||
|
|
||||||
import type { QuizQuestionText } from "../../../model/questionTypes/text";
|
import type { QuizQuestionText } from "../../../model/questionTypes/text";
|
||||||
import { enqueueSnackbar } from "notistack";
|
import { enqueueSnackbar } from "notistack";
|
||||||
import { useQuestionsStore } from "@root/quizData/store"
|
import { useQuestionsStore } from "@stores/quizData/store"
|
||||||
import { sendAnswer } from "@api/quizRelase";
|
import { sendAnswer } from "@api/quizRelase";
|
||||||
import { useDebouncedCallback } from "use-debounce";
|
import { useDebouncedCallback } from "use-debounce";
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ import {
|
|||||||
deleteAnswer,
|
deleteAnswer,
|
||||||
updateOwnVariant,
|
updateOwnVariant,
|
||||||
deleteOwnVariant,
|
deleteOwnVariant,
|
||||||
} from "@root/quizView/store";
|
} from "@stores/quizView/store";
|
||||||
|
|
||||||
import RadioCheck from "@ui_kit/RadioCheck";
|
import RadioCheck from "@ui_kit/RadioCheck";
|
||||||
import RadioIcon from "@ui_kit/RadioIcon";
|
import RadioIcon from "@ui_kit/RadioIcon";
|
||||||
@ -27,7 +27,7 @@ import type { QuizQuestionVariant } from "../../../model/questionTypes/variant";
|
|||||||
import type { QuestionVariant } from "../../../model/questionTypes/shared";
|
import type { QuestionVariant } from "../../../model/questionTypes/shared";
|
||||||
import { enqueueSnackbar } from "notistack";
|
import { enqueueSnackbar } from "notistack";
|
||||||
import { sendAnswer } from "@api/quizRelase";
|
import { sendAnswer } from "@api/quizRelase";
|
||||||
import { useQuestionsStore } from "@root/quizData/store"
|
import { useQuestionsStore } from "@stores/quizData/store"
|
||||||
import { modes } from "../../../utils/themes/Publication/themePublication";
|
import { modes } from "../../../utils/themes/Publication/themePublication";
|
||||||
|
|
||||||
type VariantProps = {
|
type VariantProps = {
|
||||||
|
@ -11,8 +11,8 @@ import { modes } from "../../../utils/themes/Publication/themePublication";
|
|||||||
|
|
||||||
import gag from "./gag.png"
|
import gag from "./gag.png"
|
||||||
|
|
||||||
import { useQuestionsStore } from "@root/quizData/store"
|
import { useQuestionsStore } from "@stores/quizData/store"
|
||||||
import { useQuizViewStore, updateAnswer, deleteAnswer } from "@root/quizView/store";
|
import { useQuizViewStore, updateAnswer, deleteAnswer } from "@stores/quizView/store";
|
||||||
|
|
||||||
import RadioCheck from "@ui_kit/RadioCheck";
|
import RadioCheck from "@ui_kit/RadioCheck";
|
||||||
import RadioIcon from "@ui_kit/RadioIcon";
|
import RadioIcon from "@ui_kit/RadioIcon";
|
||||||
|
1
src/react-app-env.d.ts
vendored
1
src/react-app-env.d.ts
vendored
@ -1 +0,0 @@
|
|||||||
/// <reference types="react-scripts" />
|
|
@ -1,5 +0,0 @@
|
|||||||
// jest-dom adds custom jest matchers for asserting on DOM nodes.
|
|
||||||
// allows you to do things like:
|
|
||||||
// expect(element).toHaveTextContent(/react/i)
|
|
||||||
// learn more: https://github.com/testing-library/jest-dom
|
|
||||||
import '@testing-library/jest-dom';
|
|
@ -1,5 +1,5 @@
|
|||||||
import { useEffect, useLayoutEffect, useRef, useState } from "react"
|
import { useEffect, useLayoutEffect, useRef, useState } from "react"
|
||||||
import { useQuestionsStore } from "@root/quizData/store";
|
import { useQuestionsStore } from "@stores/quizData/store";
|
||||||
|
|
||||||
import { getData } from "@api/quizRelase"
|
import { getData } from "@api/quizRelase"
|
||||||
|
|
||||||
|
1
src/vite-env.d.ts
vendored
Normal file
1
src/vite-env.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
/// <reference types="vite/client" />
|
@ -1,22 +0,0 @@
|
|||||||
{
|
|
||||||
"compilerOptions": {
|
|
||||||
"baseUrl": "./src",
|
|
||||||
"paths": {
|
|
||||||
"@ui_kit/*": [
|
|
||||||
"./ui_kit/*"
|
|
||||||
],
|
|
||||||
"@icons/*": [
|
|
||||||
"./assets/icons/*"
|
|
||||||
],
|
|
||||||
"@root/*": [
|
|
||||||
"./stores/*"
|
|
||||||
],
|
|
||||||
"@api/*": [
|
|
||||||
"./api/*"
|
|
||||||
],
|
|
||||||
"@model/*": [
|
|
||||||
"./model/*"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,32 +1,54 @@
|
|||||||
{
|
{
|
||||||
"extends": "./tsconfig.extend.json",
|
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "es2015",
|
"target": "ES2021",
|
||||||
|
"useDefineForClassFields": true,
|
||||||
"lib": [
|
"lib": [
|
||||||
"dom",
|
"ES2021",
|
||||||
"dom.iterable",
|
"DOM",
|
||||||
"esnext"
|
"DOM.Iterable"
|
||||||
],
|
],
|
||||||
"allowJs": true,
|
"module": "ESNext",
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"esModuleInterop": true,
|
/* Bundler mode */
|
||||||
"allowSyntheticDefaultImports": true,
|
"moduleResolution": "bundler",
|
||||||
"strict": true,
|
"allowImportingTsExtensions": true,
|
||||||
"forceConsistentCasingInFileNames": true,
|
|
||||||
"noFallthroughCasesInSwitch": true,
|
|
||||||
"module": "esnext",
|
|
||||||
"moduleResolution": "node",
|
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"isolatedModules": true,
|
"isolatedModules": true,
|
||||||
"noEmit": true,
|
"noEmit": true,
|
||||||
"jsx": "react-jsx",
|
"jsx": "react-jsx",
|
||||||
|
/* Linting */
|
||||||
|
"strict": true,
|
||||||
|
"noFallthroughCasesInSwitch": true,
|
||||||
|
"baseUrl": "./src",
|
||||||
|
"paths": {
|
||||||
|
"@ui_kit/*": [
|
||||||
|
"./ui_kit/*"
|
||||||
|
],
|
||||||
|
"@icons/*": [
|
||||||
|
"./assets/icons/*"
|
||||||
|
],
|
||||||
|
"@stores/*": [
|
||||||
|
"./stores/*"
|
||||||
|
],
|
||||||
|
"@api/*": [
|
||||||
|
"./api/*"
|
||||||
|
],
|
||||||
|
"@model/*": [
|
||||||
|
"./model/*"
|
||||||
|
]
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"src",
|
"src"
|
||||||
],
|
],
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"cypress.config.ts",
|
"cypress.config.ts",
|
||||||
"cypress",
|
"cypress",
|
||||||
"node_modules",
|
"node_modules",
|
||||||
|
],
|
||||||
|
"references": [
|
||||||
|
{
|
||||||
|
"path": "./tsconfig.node.json"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
10
tsconfig.node.json
Normal file
10
tsconfig.node.json
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"composite": true,
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"module": "ESNext",
|
||||||
|
"moduleResolution": "bundler",
|
||||||
|
"allowSyntheticDefaultImports": true
|
||||||
|
},
|
||||||
|
"include": ["vite.config.ts"]
|
||||||
|
}
|
17
vite.config.ts
Normal file
17
vite.config.ts
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
import { defineConfig } from "vite";
|
||||||
|
import react from "@vitejs/plugin-react";
|
||||||
|
import { resolve } from "path";
|
||||||
|
|
||||||
|
// https://vitejs.dev/config/
|
||||||
|
export default defineConfig({
|
||||||
|
plugins: [react()],
|
||||||
|
resolve: {
|
||||||
|
alias: {
|
||||||
|
"@ui_kit": resolve(__dirname, "./src/ui_kit"),
|
||||||
|
"@icons": resolve(__dirname, "./src/assets/icons"),
|
||||||
|
"@stores": resolve(__dirname, "./src/stores"),
|
||||||
|
"@api": resolve(__dirname, "./src/api"),
|
||||||
|
"@model": resolve(__dirname, "./src/model"),
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
Loading…
Reference in New Issue
Block a user