This commit is contained in:
primakov committed 2024-07-25 22:14:20 +03:00
commit a55fe9914b
32 files changed
+15966

No files matched your search

+32
View File
@@ -0,0 +1,32 @@
module.exports = {
env: {
browser: true,
node: true,
es2021: true,
},
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
],
parser: '@typescript-eslint/parser',
parserOptions: {
cmaFeatures: {
jsx: true,
},
ecmaVersion: 12,
sourceType: 'module',
},
plugins: ['react', '@typescript-eslint'],
rules: {
'@typescript-eslint/explicit-module-boundary-types': 'off',
'react/prop-types': 'off',
'@typescript-eslint/no-unused-vars': [
'warn',
{ argsIgnorePattern: '^_', caughtErrors: 'none' },
],
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/no-var-requires': 'off',
},
};
+51
View File
@@ -0,0 +1,51 @@
# These are some examples of commonly ignored file patterns.
# You should customize this list as applicable to your project.
# Learn more about .gitignore:
# https://www.atlassian.com/git/tutorials/saving-changes/gitignore
# Node artifact files
node_modules/
dist/
coverage/
# Compiled Java class files
*.class
# Compiled Python bytecode
*.py[cod]
# Log files
*.log
# Package files
*.jar
# Maven
target/
dist/
# JetBrains IDE
.idea/
# Unit test reports
TEST*.xml
# Generated by MacOS
.DS_Store
# Generated by Windows
Thumbs.db
# Applications
*.app
*.exe
*.war
# Large media files
*.mp4
*.tiff
*.avi
*.flv
*.mov
*.wmv
+1
View File
@@ -0,0 +1 @@
package-lock=true
+7
View File
@@ -0,0 +1,7 @@
# Ignore artifacts:
build
dist
coverage
stubs
logs
d-scripts
+7
View File
@@ -0,0 +1,7 @@
{
"tabWidth": 2,
"semi": true,
"jsxBracketSameLine": true,
"arrowParens": "avoid",
"singleQuote": true
}
+26
View File
@@ -0,0 +1,26 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Attach by Process ID",
"processId": "${command:PickProcess}",
"request": "attach",
"skipFiles": ["<node_internals>/**"],
"type": "pwa-node"
},
{
"type": "node",
"name": "vscode-jest-tests",
"request": "launch",
"args": ["--runInBand", "--no-cache"],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"disableOptimisticBPs": true,
"program": "${workspaceFolder}/node_modules/jest/bin/jest"
}
]
}
+10
View File
@@ -0,0 +1,10 @@
import '@emotion/react';
import { lightTheme } from '../src/app.theme';
declare module '@emotion/react' {
export interface Theme {
colors: typeof lightTheme.colors,
shadows: typeof lightTheme.shadows
}
}
+19
View File
@@ -0,0 +1,19 @@
declare const IS_PROD: string;
declare module '*.svg' {
const value: string;
export default value;
}
declare module '*.jpg' {
const value: string;
export default value;
}
declare module '*.png' {
const value: string;
export default value;
}
Vendored
+31
View File
@@ -0,0 +1,31 @@
pipeline {
agent {
docker {
image 'node:16'
}
}
stages {
stage('install') {
steps {
sh 'node -v'
sh 'npm -v'
sh 'npm ci'
}
}
stage('eslint') {
steps {
sh 'npm run eslint'
}
}
stage('clean-all') {
steps {
sh 'rm -rf .[!.]*'
sh 'rm -rf ./*'
sh 'ls -a'
}
}
}
}
+6
View File
@@ -0,0 +1,6 @@
module.exports = {
presets: [
['@babel/preset-env', { targets: { node: 'current' } }],
'@babel/preset-typescript',
],
};
+2
View File
@@ -0,0 +1,2 @@
sh stop.sh;
sh up-nginx.sh;
+1
View File
@@ -0,0 +1 @@
docker stop adminka_nginx2;
+1
View File
@@ -0,0 +1 @@
docker run --name adminka_nginx2 -v $PWD/nginx.conf:/etc/nginx/nginx.conf:ro -v $PWD/dist:/usr/share/nginx/html --rm -d -p 3072:80 nginx;
+17
View File
@@ -0,0 +1,17 @@
const pkg = require('./package')
module.exports = {
apiPath: 'stubs/api',
webpackConfig: {
output: {
publicPath: `/static/${pkg.name}/${process.env.VERSION || pkg.version}/`
}
},
/* use https://kc.admin.inno-js.ru/ to create config, navigations and features */
navigations: {
},
features: {
},
config: {
}
}
+9
View File
@@ -0,0 +1,9 @@
module.exports = {
clearMocks: true,
collectCoverage: true,
collectCoverageFrom: ['./src/**/*.ts?(x)'],
coverageDirectory: 'coverage',
coverageProvider: 'v8',
preset: 'ts-jest',
testEnvironment: 'jsdom',
};
+1
View File
@@ -0,0 +1 @@
{}
+3
View File
@@ -0,0 +1,3 @@
{
}
+1
View File
@@ -0,0 +1 @@
{}
+3
View File
@@ -0,0 +1,3 @@
{
}
+15512
View File
File diff suppressed because it is too large. Load diff
+55
View File
@@ -0,0 +1,55 @@
{
"name": "bro.landing",
"version": "2.0.1",
"description": "",
"main": "./src/index.tsx",
"scripts": {
"docker:rerun": "docker stop adminka_nginx2 && sh d-scripts/up-nginx.sh",
"predeploy": "npm i && npm run build:prod",
"redeploy": "npm run predeploy && npm run docker:rerun || sh d-scripts/up-nginx.sh",
"clean": "rimraf dist",
"eslint": "npx eslint src",
"prettier": "prettier --write .",
"test": "jest --coverage",
"start": "brojs server --port=8099 --with-open-browser",
"build": "npm run clean && brojs build --dev",
"build:prod": "npm run clean && brojs build"
},
"keywords": [],
"author": "",
"license": "MIT",
"dependencies": {
"@babel/preset-typescript": "7.24.7",
"@brojs/cli": "^0.0.4-alpha.6",
"@chakra-ui/icons": "^2.1.1",
"@chakra-ui/react": "^2.8.2",
"@emotion/css": "^11.13.0",
"@emotion/react": "^11.13.0",
"@emotion/styled": "^11.13.0",
"@reduxjs/toolkit": "^2.2.6",
"dayjs": "^1.11.12",
"express": "^4.19.2",
"i18next": "^23.12.2",
"i18next-browser-languagedetector": "^8.0.0",
"i18next-xhr-backend": "^3.2.2",
"lottie-react": "^2.4.0",
"prettier": "^3.3.3",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-helmet": "^6.1.0",
"react-i18next": "^15.0.0",
"react-redux": "^9.1.2",
"react-router-dom": "^6.25.1",
"redux": "^5.0.1"
},
"devDependencies": {
"@types/jest": "^29.5.12",
"babel-jest": "^29.7.0",
"eslint": "8.57.0",
"eslint-plugin-react": "^7.35.0",
"eslint-plugin-react-hooks": "^4.6.2",
"html-webpack-plugin": "^5.6.0",
"jest": "^29.7.0",
"ts-jest": "^29.2.3"
}
}
+31
View File
@@ -0,0 +1,31 @@
# PL админки ijl
Данный проект является презентационным слоем админки от стендов ijl
## Установка зависимостей
```shell
npm install
```
## Запуск
```shell
npm start
```
## Собрать
```shell
npm run build:prod
```
## Деплой
Для деплоя используется простой докер образ nginx раздающий директорию dist. Для запуска необходимо воспользоваться скриптами из директории d-scripts.
Команда запуска на сервере
```shell
sh d-scripts/up-nginx.sh
```
@@ -0,0 +1 @@
{"v":"5.7.0","fr":24,"ip":0,"op":240,"w":1920,"h":1448,"nm":"MNC_construction","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Right Tree","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.456],"y":[1.068]},"o":{"x":[0.532],"y":[-0.798]},"t":0,"s":[-3]},{"i":{"x":[0.452],"y":[0.875]},"o":{"x":[0.582],"y":[0.066]},"t":36,"s":[3]},{"t":68.8001953125,"s":[-3]}],"ix":10,"x":"var $bm_rt;\n$bm_rt = loopOut('PingPong');"},"p":{"a":0,"k":[1636.032,1439.268,0],"ix":2},"a":{"a":0,"k":[160.808,650.761,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"ef":[{"ty":5,"nm":"CC Bend It","np":7,"mn":"CC Bend It","ix":1,"en":1,"ef":[{"ty":0,"nm":"Bend","mn":"CC Bend It-0001","ix":1,"v":{"a":1,"k":[{"i":{"x":[0.471],"y":[0.207]},"o":{"x":[0.64],"y":[-1.921]},"t":0,"s":[-0.4]},{"i":{"x":[0.452],"y":[1.749]},"o":{"x":[0.67],"y":[1.833]},"t":36,"s":[0.6]},{"i":{"x":[0.462],"y":[0.229]},"o":{"x":[0.655],"y":[-1.877]},"t":68.8,"s":[-0.4]},{"i":{"x":[0.471],"y":[0.207]},"o":{"x":[0.64],"y":[-1.921]},"t":103.2,"s":[-0.4]},{"i":{"x":[0.452],"y":[1.749]},"o":{"x":[0.67],"y":[1.833]},"t":139.2,"s":[0.6]},{"i":{"x":[0.457],"y":[0.24]},"o":{"x":[0.662],"y":[-1.855]},"t":172,"s":[-0.4]},{"i":{"x":[0.471],"y":[0.207]},"o":{"x":[0.64],"y":[-1.921]},"t":205.6,"s":[-0.4]},{"i":{"x":[0.452],"y":[1.749]},"o":{"x":[0.67],"y":[1.833]},"t":241.6,"s":[0.6]},{"t":274.3998046875,"s":[-0.4]}],"ix":1}},{"ty":3,"nm":"Start","mn":"CC Bend It-0002","ix":2,"v":{"a":0,"k":[1485.312,1350.538],"ix":2}},{"ty":3,"nm":"End","mn":"CC Bend It-0003","ix":3,"v":{"a":0,"k":[1719.624,692.673],"ix":3}},{"ty":7,"nm":"Render Prestart","mn":"CC Bend It-0004","ix":4,"v":{"a":0,"k":3,"ix":4}},{"ty":7,"nm":"Distort","mn":"CC Bend It-0005","ix":5,"v":{"a":0,"k":1,"ix":5}}]}],"sy":[{"c":{"a":0,"k":[0,0,0,1],"ix":2},"o":{"a":0,"k":75,"ix":3},"a":{"a":0,"k":120,"ix":5},"s":{"a":0,"k":5,"ix":8},"d":{"a":0,"k":5,"ix":6},"ch":{"a":0,"k":0,"ix":7},"bm":{"a":0,"k":5,"ix":1},"no":{"a":0,"k":0,"ix":9},"lc":{"a":0,"k":1,"ix":10},"ty":1,"nm":"Drop Shadow"},{"c":{"a":0,"k":[0,0,0,1],"ix":2},"o":{"a":0,"k":75,"ix":3},"a":{"a":0,"k":120,"ix":5},"s":{"a":0,"k":5,"ix":8},"d":{"a":0,"k":5,"ix":6},"ch":{"a":0,"k":0,"ix":7},"bm":{"a":0,"k":5,"ix":1},"no":{"a":0,"k":0,"ix":9},"ty":2,"nm":"Inner Shadow"},{"c":{"a":0,"k":[1,1,0.745098039216,1],"ix":5},"o":{"a":0,"k":75,"ix":2},"s":{"a":0,"k":5,"ix":10},"r":{"a":0,"k":50,"ix":11},"ch":{"a":0,"k":0,"ix":9},"bm":{"a":0,"k":11,"ix":1},"no":{"a":0,"k":0,"ix":3},"j":{"a":0,"k":0,"ix":12},"ty":3,"nm":"Outer Glow"},{"c":{"a":0,"k":[1,1,0.745098039216,1],"ix":5},"o":{"a":0,"k":75,"ix":2},"s":{"a":0,"k":5,"ix":11},"r":{"a":0,"k":50,"ix":12},"sr":{"a":0,"k":1,"ix":9},"ch":{"a":0,"k":0,"ix":10},"bm":{"a":0,"k":11,"ix":1},"no":{"a":0,"k":0,"ix":3},"j":{"a":0,"k":0,"ix":13},"ty":4,"nm":"Inner Glow"},{"c":{"a":0,"k":[1,0,0,1],"ix":2},"s":{"a":0,"k":3,"ix":3},"ty":0,"nm":"Stroke"}],"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0.65,-7.206],[-2.626,8.874]],"o":[[-0.645,7.143],[2.627,-8.874]],"v":[[-14.648,-3.699],[12.667,2.031]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0.541000007181,0.769000004787,0.757000014361,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[343.599,388.174],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[6.054,-3.962],[-8.587,3.448]],"o":[[-6,3.928],[8.588,-3.45]],"v":[[-7.524,-12.231],[4.936,12.745]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0.128999986836,0.447000002394,0.46699999641,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[57.213,92.767],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 2","np":2,"cix":2,"bm":0,"ix":2,"mn":"ADBE Vector Group","hd":false},{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[5.249,-11.503],[-6.514,13.513]],"o":[[-5.3,11.613],[6.513,-13.515]],"v":[[-16.904,-9.491],[15.692,7.48]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0.128999986836,0.447000002394,0.46699999641,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[31.33,124.808],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"Line truncated
+20
View File
@@ -0,0 +1,20 @@
import React, { Suspense } from "react";
import { BrowserRouter } from "react-router-dom";
import {Helmet} from 'react-helmet';
import { Dashboard } from './dashboard';
const App = () => {
return (
<>
<Helmet>
<title>bro js</title>
</Helmet>
<BrowserRouter>
<Dashboard />
</BrowserRouter>
</>
);
};
export default App;
+22
View File
@@ -0,0 +1,22 @@
import React, { Suspense } from 'react';
import { Routes, Route } from 'react-router-dom';
import { Spinner } from '@chakra-ui/react';
import { UnderConstructionPage } from './pages';
const Hello = () => <h1>Hello</h1>;
export const Dashboard = () => {
return (
<Routes>
<Route
path={'*'}
element={
<Suspense fallback={<Spinner />}>
<UnderConstructionPage />
</Suspense>
}
/>
<Route path={'*'} element={<h1>Страница не найдена</h1>} />
</Routes>
);
};
+18
View File
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link href="https://fonts.googleapis.com/css?family=Montserrat:400,600,700,900&amp;subset=cyrillic,cyrillic-ext" rel="stylesheet" />
<title>bro-js admin</title>
<style>body {margin: 0; padding: 0;}</style>
</head>
<body>
<noscript><div><img src="https://mc.yandex.ru/watch/87860751" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
<div id="app"></div>
</body>
</html>
+26
View File
@@ -0,0 +1,26 @@
import React from 'react';
import i18next from 'i18next';
import { i18nextReactInitConfig } from '@brojs/cli/lib/i18next';
import { createRoot } from 'react-dom/client'
import App from './app';
i18next.t = i18next.t.bind(i18next);
const i18nextPromise = i18nextReactInitConfig(i18next);
const MOUNT_NODE = document.getElementById('app');
(async () => {
await Promise.all([i18nextPromise]);
const rootElement = createRoot(MOUNT_NODE)
rootElement.render(<App />);
if (module.hot) {
module.hot.accept('./app', async () => {
await i18next.reloadResources();
rootElement.render(<App />);
});
}
})();
export const mount = () => console.log('mounted');
export const unmount = () => console.log('unmounted');
+3
View File
@@ -0,0 +1,3 @@
import { lazy } from 'react';
export const UnderConstructionPage = lazy(() => import('./under-construction'));
+3
View File
@@ -0,0 +1,3 @@
import { UnderConstruction } from './underConstruction';
export default UnderConstruction;
@@ -0,0 +1,14 @@
import React from 'react';
import Lottie from "lottie-react";
import animation from '../../__data__/assets/lottie/under-construction.json';
export const UnderConstruction = () => {
return (
<div>
<Lottie animationData={animation} />
<h3><center>Сайт в разработке</center></h3>
</div>
)
}
+8
View File
@@ -0,0 +1,8 @@
const router = require('express').Router();
const timer = (time = 300) => (req, res, next) => setTimeout(next, time);
router.use(timer());
module.exports = router;
+25
View File
@@ -0,0 +1,25 @@
{
"compilerOptions": {
"lib": [
"dom",
"es2017"
],
"outDir": "./dist/",
"sourceMap": true,
"esModuleInterop": true,
"noImplicitAny": false,
"module": "esnext",
"moduleResolution": "node",
"target": "es6",
"jsx": "react",
"typeRoots": ["node_modules/@types", "src/typings"],
"types" : ["webpack-env", "node"],
"resolveJsonModule": true
},
"exclude": [
"node_modules",
"**/*.test.ts",
"**/*.test.tsx",
"node_modules/@types/jest"
]
}