Compare commits
No commits in common. "1a17cb4f5d6432f9cebeb178cf492fcd671bd3b6" and "99831ff824edbbf486ca6a3ef457e630c40e4dcc" have entirely different histories.
1a17cb4f5d
...
99831ff824
63 changed files with 659 additions and 3177 deletions
|
@ -1 +1,3 @@
|
||||||
FROM local/nodejs/dev:18
|
FROM local/nodejs/dev:18
|
||||||
|
|
||||||
|
USER node
|
|
@ -3,7 +3,7 @@
|
||||||
"workspaceFolder": "/home/project/seedling",
|
"workspaceFolder": "/home/project/seedling",
|
||||||
"dockerComposeFile": "docker-compose.yml",
|
"dockerComposeFile": "docker-compose.yml",
|
||||||
"service": "seedling",
|
"service": "seedling",
|
||||||
"postCreateCommand": "sudo chown iamuser:iamuser /home/project",
|
"postCreateCommand": "sudo chown node:node -R /home/project",
|
||||||
"customizations": {
|
"customizations": {
|
||||||
"vscode": {
|
"vscode": {
|
||||||
"extensions": [
|
"extensions": [
|
||||||
|
|
|
@ -12,7 +12,7 @@ services:
|
||||||
context: .
|
context: .
|
||||||
container_name: seedling
|
container_name: seedling
|
||||||
volumes:
|
volumes:
|
||||||
- ../:/home/project/seedling:delegated
|
- ../:/home/project/seedling
|
||||||
- node_modules:/home/project/seedling/node_modules
|
- node_modules:/home/project/seedling/node_modules
|
||||||
- pnpm-store:/home/project/seedling/.pnpm-store
|
- pnpm-store:/home/project/seedling/.pnpm-store
|
||||||
command: sleep infinity
|
command: sleep infinity
|
|
@ -1 +0,0 @@
|
||||||
source/
|
|
6
.gitignore
vendored
6
.gitignore
vendored
|
@ -1,9 +1,9 @@
|
||||||
build/
|
build/
|
||||||
dist/
|
dist/
|
||||||
|
app/
|
||||||
|
node_modules/
|
||||||
|
|
||||||
.vscode/
|
.vscode/
|
||||||
.idea/
|
|
||||||
|
|
||||||
node_modules/
|
.pnpm/
|
||||||
.pnpm-store/
|
.pnpm-store/
|
||||||
output/
|
|
||||||
|
|
26
create.js
26
create.js
|
@ -7,14 +7,14 @@ const argv = require('minimist')(process.argv.slice(2));
|
||||||
const appName = argv.name ?? 'app';
|
const appName = argv.name ?? 'app';
|
||||||
const appPort = argv.port ?? '0';
|
const appPort = argv.port ?? '0';
|
||||||
|
|
||||||
const defaultContextDir = '.';
|
const defaultContextDir = './';
|
||||||
const rootDir = __dirname;
|
const rootDir = __dirname;
|
||||||
const contextDir = `${argv._[0] ?? defaultContextDir}`;
|
const contextDir = `${argv._[0]}/` ?? defaultContextDir;
|
||||||
|
|
||||||
// create app folder
|
// create app folder
|
||||||
const appsDir = `${contextDir}/apps`;
|
const appsDir = `${contextDir}/apps`;
|
||||||
const uiDir = `${contextDir}/apps/${appName}-ui`;
|
const uiDir = `${contextDir}/apps/${appName}-ui`;
|
||||||
const restDir = `${contextDir}/apps/${appName}-rest`;
|
const apiDir = `${contextDir}/apps/${appName}-rest`;
|
||||||
|
|
||||||
// prepare structure folders
|
// prepare structure folders
|
||||||
if (!fs.existsSync(uiDir)) {
|
if (!fs.existsSync(uiDir)) {
|
||||||
|
@ -24,8 +24,8 @@ if (!fs.existsSync(uiDir)) {
|
||||||
fs.mkdirSync(appsDir);
|
fs.mkdirSync(appsDir);
|
||||||
fs.mkdirSync(uiDir);
|
fs.mkdirSync(uiDir);
|
||||||
fs.mkdirSync(`${uiDir}/src`);
|
fs.mkdirSync(`${uiDir}/src`);
|
||||||
fs.mkdirSync(restDir);
|
fs.mkdirSync(apiDir);
|
||||||
fs.mkdirSync(`${restDir}/src`);
|
fs.mkdirSync(`${apiDir}/src`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// copy folder content
|
// copy folder content
|
||||||
|
@ -38,7 +38,7 @@ try {
|
||||||
force: true,
|
force: true,
|
||||||
recursive: true,
|
recursive: true,
|
||||||
});
|
});
|
||||||
fs.cpSync(`${rootDir}/source/rest/`, restDir, {
|
fs.cpSync(`${rootDir}/source/rest/`, apiDir, {
|
||||||
force: true,
|
force: true,
|
||||||
recursive: true,
|
recursive: true,
|
||||||
});
|
});
|
||||||
|
@ -55,29 +55,29 @@ fs.renameSync(`${contextDir}/gitignore`, `${contextDir}/.gitignore`);
|
||||||
fs.renameSync(`${contextDir}/prettierrc`, `${contextDir}/.prettierrc`);
|
fs.renameSync(`${contextDir}/prettierrc`, `${contextDir}/.prettierrc`);
|
||||||
fs.renameSync(`${contextDir}/.tsconfig.json`, `${contextDir}/tsconfig.json`);
|
fs.renameSync(`${contextDir}/.tsconfig.json`, `${contextDir}/tsconfig.json`);
|
||||||
fs.renameSync(`${uiDir}/.tsconfig.json`, `${uiDir}/tsconfig.json`);
|
fs.renameSync(`${uiDir}/.tsconfig.json`, `${uiDir}/tsconfig.json`);
|
||||||
fs.renameSync(`${restDir}/.tsconfig.json`, `${restDir}/tsconfig.json`);
|
fs.renameSync(`${apiDir}/.tsconfig.json`, `${apiDir}/tsconfig.json`);
|
||||||
|
|
||||||
// replace in files
|
// replace in files
|
||||||
replaceInFiles.sync({
|
replaceInFiles.sync({
|
||||||
files: [`${contextDir}/**/*`, `${contextDir}/.devcontainer/*`],
|
files: `./${contextDir}/**/*.{ts,tsx}`,
|
||||||
from: /\/\/.@ts-nocheck\n/gm,
|
from: /\/\/.\@ts\-nocheck\n/gm,
|
||||||
to: '',
|
to: '',
|
||||||
});
|
});
|
||||||
replaceInFiles.sync({
|
replaceInFiles.sync({
|
||||||
files: [`${contextDir}/**/*`, `${contextDir}/.devcontainer/*`],
|
files: `./${contextDir}/**/*`,
|
||||||
from: /\$\(appName\)/gm,
|
from: /\$\(appName\)/gm,
|
||||||
to: appName,
|
to: appName,
|
||||||
});
|
});
|
||||||
replaceInFiles.sync({
|
replaceInFiles.sync({
|
||||||
files: [`${contextDir}/**/*`, `${contextDir}/.devcontainer/*`],
|
files: `./${contextDir}/**/*`,
|
||||||
from: /\$\(AppName\)/gm,
|
from: /\$\(AppName\)/gm,
|
||||||
to: appName.charAt(0).toUpperCase() + appName.slice(1),
|
to: appName.charAt(0).toUpperCase() + appName.slice(1),
|
||||||
});
|
});
|
||||||
replaceInFiles.sync({
|
replaceInFiles.sync({
|
||||||
files: [`${contextDir}/**/*`, `${contextDir}/.devcontainer/*`],
|
files: `./${contextDir}/**/*`,
|
||||||
from: /\$\(appPort\)/gm,
|
from: /\$\(appPort\)/gm,
|
||||||
to: appPort,
|
to: appPort,
|
||||||
});
|
});
|
||||||
|
|
||||||
// install deps
|
// install deps
|
||||||
execSync(`pnpm i`, { cwd: `${contextDir}` });
|
execSync(`pnpm i`, { cwd: `./${contextDir}` })
|
||||||
|
|
|
@ -8,10 +8,11 @@
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"create": "pnpm ci:build",
|
"create": "pnpm ci:build",
|
||||||
"ci:build": "node create.js --name app --port 90 ./output",
|
"ci:build": "node create.js --name app --port 90 ./app",
|
||||||
"release": "pnpm version --no-git-tag-version"
|
"release": "pnpm version --no-git-tag-version"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"app": "link:app",
|
||||||
"minimist": "1.2.8",
|
"minimist": "1.2.8",
|
||||||
"replace-in-file": "7.0.2"
|
"replace-in-file": "7.0.2"
|
||||||
},
|
},
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
FROM local/nodejs/dev:18
|
|
|
@ -1,7 +0,0 @@
|
||||||
{
|
|
||||||
"name": "$(appName)",
|
|
||||||
"workspaceFolder": "/home/project/$(appName)",
|
|
||||||
"dockerComposeFile": "docker-compose.yml",
|
|
||||||
"service": "$(appName)",
|
|
||||||
"postCreateCommand": "sudo chown iamuser:iamuser -R /home/project",
|
|
||||||
}
|
|
|
@ -1,18 +0,0 @@
|
||||||
version: "3"
|
|
||||||
|
|
||||||
name: $(appName)
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
node_modules:
|
|
||||||
pnpm-store:
|
|
||||||
|
|
||||||
services:
|
|
||||||
seedling:
|
|
||||||
build:
|
|
||||||
context: .
|
|
||||||
container_name: $(appName)
|
|
||||||
volumes:
|
|
||||||
- ../:/home/project/$(appName)
|
|
||||||
- node_modules:/home/project/seedling/node_modules
|
|
||||||
- pnpm-store:/home/project/seedling/.pnpm-store
|
|
||||||
command: sleep infinity
|
|
|
@ -1 +0,0 @@
|
||||||
COMPOSE_PROJECT_NAME=$(appName)
|
|
|
@ -7,16 +7,15 @@
|
||||||
"emitDecoratorMetadata": true,
|
"emitDecoratorMetadata": true,
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"resolveJsonModule": true,
|
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"allowJs": true,
|
"allowJs": true,
|
||||||
"outDir": "build",
|
"outDir": "build",
|
||||||
"module": "esnext",
|
"module": "commonjs",
|
||||||
"target": "es6",
|
"target": "es6",
|
||||||
"lib": [
|
"lib": [
|
||||||
"es6",
|
"es6",
|
||||||
"dom"
|
"dom"
|
||||||
]
|
],
|
||||||
},
|
},
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"./node_modules",
|
"./node_modules",
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
build/
|
build/
|
||||||
dist/
|
dist/
|
||||||
|
node_modules/
|
||||||
|
|
||||||
.vscode/
|
.vscode/
|
||||||
.idea/
|
|
||||||
|
|
||||||
node_modules/
|
|
||||||
.pnpm-store/
|
.pnpm-store/
|
|
@ -4,7 +4,7 @@
|
||||||
"author": "Roman Jaroš",
|
"author": "Roman Jaroš",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "pnpm -r --parallel --stream dev",
|
"dev": "pnpm -r dev",
|
||||||
"test": "pnpm -r test",
|
"test": "pnpm -r test",
|
||||||
"test:e2e": "pnpm -r test:e2e"
|
"test:e2e": "pnpm -r test:e2e"
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
{
|
{
|
||||||
|
"parser": "@typescript-eslint/parser",
|
||||||
"extends": [
|
"extends": [
|
||||||
"eslint:recommended",
|
"eslint:recommended",
|
||||||
"plugin:react/recommended",
|
"plugin:react/recommended",
|
||||||
"plugin:@typescript-eslint/recommended",
|
"plugin:@typescript-eslint/recommended",
|
||||||
"prettier",
|
"prettier"
|
||||||
"next/core-web-vitals"
|
|
||||||
],
|
],
|
||||||
"plugins": [
|
"plugins": [
|
||||||
"react",
|
"react",
|
||||||
|
|
|
@ -1,31 +1,54 @@
|
||||||
{
|
{
|
||||||
"extends": "../../tsconfig.json",
|
"extends": "../../tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"module": "esnext",
|
"jsx": "react-jsx",
|
||||||
"moduleResolution": "bundler",
|
"baseUrl": ".",
|
||||||
"isolatedModules": true,
|
"paths": {
|
||||||
"jsx": "preserve",
|
"api/*": [
|
||||||
"incremental": true,
|
"./src/api/*"
|
||||||
"types": [
|
],
|
||||||
"node",
|
"app/*": [
|
||||||
"jest"
|
"./src/app/*"
|
||||||
],
|
],
|
||||||
"strict": false,
|
"components/*": [
|
||||||
"noEmit": true,
|
"./src/components/*"
|
||||||
"plugins": [
|
],
|
||||||
{
|
"constants/*": [
|
||||||
"name": "next"
|
"./src/constants/*"
|
||||||
}
|
],
|
||||||
],
|
"features/*": [
|
||||||
"strictNullChecks": true
|
"./src/features/*"
|
||||||
},
|
],
|
||||||
"include": [
|
"hooks/*": [
|
||||||
"./src/**/*.ts",
|
"./src/hooks/*"
|
||||||
"./src/**/*.tsx",
|
],
|
||||||
".next/types/**/*.ts"
|
"localization/*": [
|
||||||
],
|
"./src/localization/*"
|
||||||
"exclude": [
|
],
|
||||||
"./node_modules",
|
"pages/*": [
|
||||||
"./src/**/__tests__/*.tsx"
|
"./src/pages/*"
|
||||||
]
|
],
|
||||||
|
"utils/*": [
|
||||||
|
"./src/utils/*"
|
||||||
|
],
|
||||||
|
"types/*": [
|
||||||
|
"./src/types/*"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"types": [
|
||||||
|
"node",
|
||||||
|
"jest",
|
||||||
|
"./src/types/yup"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"include": [
|
||||||
|
"./src/**/*.ts",
|
||||||
|
"./src/**/*.tsx",
|
||||||
|
"./types/modules.d.ts",
|
||||||
|
"src/styles/theme.js"
|
||||||
|
],
|
||||||
|
"exclude": [
|
||||||
|
"./node_modules",
|
||||||
|
"./src/**/__tests__/*.tsx"
|
||||||
|
]
|
||||||
}
|
}
|
|
@ -1,36 +1 @@
|
||||||
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
|
# $(AppName)
|
||||||
|
|
||||||
## Getting Started
|
|
||||||
|
|
||||||
First, run the development server:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
npm run dev
|
|
||||||
# or
|
|
||||||
yarn dev
|
|
||||||
# or
|
|
||||||
pnpm dev
|
|
||||||
# or
|
|
||||||
bun dev
|
|
||||||
```
|
|
||||||
|
|
||||||
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
|
|
||||||
|
|
||||||
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
|
|
||||||
|
|
||||||
This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.
|
|
||||||
|
|
||||||
## Learn More
|
|
||||||
|
|
||||||
To learn more about Next.js, take a look at the following resources:
|
|
||||||
|
|
||||||
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
|
|
||||||
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
|
|
||||||
|
|
||||||
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
|
|
||||||
|
|
||||||
## Deploy on Vercel
|
|
||||||
|
|
||||||
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
|
|
||||||
|
|
||||||
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
|
|
1
source/ui/config/local/.env
Normal file
1
source/ui/config/local/.env
Normal file
|
@ -0,0 +1 @@
|
||||||
|
ENDPOINT_BASE_URL=""
|
1
source/ui/config/prod/.env
Normal file
1
source/ui/config/prod/.env
Normal file
|
@ -0,0 +1 @@
|
||||||
|
ENDPOINT_BASE_URL=""
|
|
@ -1,27 +1,12 @@
|
||||||
FROM node:18-alpine3.19
|
FROM nginx:1.25.3-alpine
|
||||||
|
|
||||||
RUN apk add --no-cache libc6-compat
|
RUN mkdir app
|
||||||
|
RUN mkdir -p /run/nginx
|
||||||
|
|
||||||
WORKDIR /app
|
COPY build /app
|
||||||
|
COPY docker/nginx/conf.d/ /etc/nginx/conf.d/
|
||||||
|
|
||||||
ENV NODE_ENV production
|
EXPOSE 80
|
||||||
ENV PORT 3000
|
|
||||||
|
|
||||||
ENV NEXT_TELEMETRY_DISABLED 1
|
VOLUME [ "/etc/nginx/conf.d" ]
|
||||||
|
ENTRYPOINT ["nginx", "-g", "daemon off;"]
|
||||||
RUN addgroup --system --gid 1001 nodejs \
|
|
||||||
&& adduser --system --uid 1001 nextjs
|
|
||||||
|
|
||||||
COPY .next/ .next/
|
|
||||||
COPY public/ public/
|
|
||||||
COPY node_modules/ node_modules/
|
|
||||||
COPY package.json package.json
|
|
||||||
COPY next.config.js next.config.js
|
|
||||||
|
|
||||||
RUN chown -R nextjs:nodejs .next
|
|
||||||
|
|
||||||
USER nextjs
|
|
||||||
|
|
||||||
EXPOSE 3000
|
|
||||||
|
|
||||||
CMD ["npm", "run", "start"]
|
|
||||||
|
|
13
source/ui/docker/nginx/conf.d/default.conf
Normal file
13
source/ui/docker/nginx/conf.d/default.conf
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
server {
|
||||||
|
listen 80 default_server;
|
||||||
|
listen [::]:80 default_server;
|
||||||
|
|
||||||
|
server_name _;
|
||||||
|
|
||||||
|
root /app;
|
||||||
|
index index.html;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
try_files $uri $uri/ /index.html;
|
||||||
|
}
|
||||||
|
}
|
21
source/ui/jest.config.js
Normal file
21
source/ui/jest.config.js
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
module.exports = {
|
||||||
|
transform: {
|
||||||
|
'^.+\\.(ts|tsx)$': 'ts-jest',
|
||||||
|
},
|
||||||
|
testRegex: '(/__tests__/.*|(-|/)(test))\\.(ts|tsx)?$',
|
||||||
|
transformIgnorePatterns: ['<rootDir>/node_modules/.*'],
|
||||||
|
testPathIgnorePatterns: ['.vscode'],
|
||||||
|
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'],
|
||||||
|
moduleNameMapper: {
|
||||||
|
'^app(.*)$': '<rootDir>/src/app/$1',
|
||||||
|
'^api(.*)$': '<rootDir>/src/api/$1',
|
||||||
|
'^components(.*)$': '<rootDir>/src/components/$1',
|
||||||
|
'^constants(.*)$': '<rootDir>/src/constants/$1',
|
||||||
|
'^features(.*)$': '<rootDir>/src/features/$1',
|
||||||
|
'^hooks(.*)$': '<rootDir>/src/hooks/$1',
|
||||||
|
'^localization(.*)$': '<rootDir>/src/localization/$1',
|
||||||
|
'^pages(.*)$': '<rootDir>/src/pages/$1',
|
||||||
|
'^types(.*)$': '<rootDir>/src/types/$1',
|
||||||
|
'^utils(.*)$': '<rootDir>/src/utils/$1',
|
||||||
|
},
|
||||||
|
};
|
|
@ -1,4 +0,0 @@
|
||||||
/** @type {import('next').NextConfig} */
|
|
||||||
const nextConfig = {};
|
|
||||||
|
|
||||||
module.exports = nextConfig;
|
|
41
source/ui/nightwatch.js
Normal file
41
source/ui/nightwatch.js
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
/** @type {import('nightwatch').NightwatchOptions} */
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
src_folders: 'tests/.nightwatchjs/src',
|
||||||
|
output_folder: 'tests/.nightwatchjs/output',
|
||||||
|
page_objects_path: ['tests/.nightwatchjs/objects'],
|
||||||
|
custom_commands_path: 'tests/.nightwatchjs/commands',
|
||||||
|
use_xpath: true,
|
||||||
|
end_session_on_fail: true,
|
||||||
|
start_process: false,
|
||||||
|
test_settings: {
|
||||||
|
localhost: {
|
||||||
|
launch_url: '',
|
||||||
|
selenium_port: 4444,
|
||||||
|
selenium_host: '10.2.0.4',
|
||||||
|
screenshots: {
|
||||||
|
enabled: true,
|
||||||
|
on_failure: true,
|
||||||
|
on_error: true,
|
||||||
|
path: 'tests/.nightwatchjs/output',
|
||||||
|
},
|
||||||
|
desiredCapabilities: {
|
||||||
|
browserName: 'chrome',
|
||||||
|
chromeOptions: {
|
||||||
|
args: ['no-sandbox'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
ci: {
|
||||||
|
launch_url: '',
|
||||||
|
selenium_port: 4444,
|
||||||
|
selenium_host: '10.0.1.21',
|
||||||
|
desiredCapabilities: {
|
||||||
|
browserName: 'chrome',
|
||||||
|
chromeOptions: {
|
||||||
|
args: ['headless', 'no-sandbox'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
|
@ -1,73 +1,95 @@
|
||||||
{
|
{
|
||||||
"name": "$(appName)-ui",
|
"name": "$(appName)-ui",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"author": "Roman Jaroš",
|
"author": "Roman Jaroš",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"ci:build": "pnpm build:prod",
|
"ci:build": "pnpm build:prod",
|
||||||
"ci:test:e2e": "nightwatch --env ci",
|
"ci:build:test": "pnpm build:test",
|
||||||
"dev": "next dev",
|
"ci:test:e2e": "nightwatch --env ci",
|
||||||
"start": "next start",
|
"dev": "webpack serve --config scripts/webpack-dev.js --env config=local",
|
||||||
"lint": "eslint src/**/*.{ts,tsx}",
|
"lint": "eslint -c .eslintrc src/**/*.{ts,tsx}",
|
||||||
"lint:css": "stylelint src/**/*.ts",
|
"lint:css": "stylelint src/**/*.ts",
|
||||||
"test": "jest",
|
"test": "jest",
|
||||||
"test:watch": "jest --watch",
|
"test:watch": "jest --watch",
|
||||||
"test:update": "jest -u",
|
"test:update": "jest -u",
|
||||||
"build:prod": "next build",
|
"test:e2e-build": "tsc -p tests/tsconfig.json -w",
|
||||||
"codegen": "pnpm dlx @rtk-query/codegen-openapi openapi-config.ts"
|
"test:e2e": "nightwatch --env localhost",
|
||||||
},
|
"build:prod": "webpack --config scripts/webpack-prod.js",
|
||||||
"dependencies": {
|
"build:test": "webpack --config scripts/webpack-dev.js --env config=test",
|
||||||
"@procyon/api": "1.2.10",
|
"serve": "http-server-spa build index.html 3331",
|
||||||
"@procyon/auth": "1.2.10",
|
"codegen": "pnpm dlx @rtk-query/codegen-openapi openapi-config.ts"
|
||||||
"@procyon/components": "1.2.10",
|
},
|
||||||
"@procyon/constants": "1.2.10",
|
"dependencies": {
|
||||||
"@procyon/forms": "1.2.10",
|
"@procyon/api": "1.2.9",
|
||||||
"@procyon/localization": "1.2.10",
|
"@procyon/auth": "1.2.9",
|
||||||
"@procyon/styles": "1.2.10",
|
"@procyon/components": "1.2.9",
|
||||||
"@procyon/types": "1.2.10",
|
"@procyon/constants": "1.2.9",
|
||||||
"@procyon/utils": "1.2.10",
|
"@procyon/forms": "1.2.9",
|
||||||
"@reduxjs/toolkit": "2.0.1",
|
"@procyon/localization": "1.2.9",
|
||||||
"clsx": "2.0.0",
|
"@procyon/styles": "1.2.9",
|
||||||
"date-fns": "3.0.6",
|
"@procyon/types": "1.2.9",
|
||||||
"history": "5.3.0",
|
"@procyon/utils": "1.2.9",
|
||||||
"next": "14.0.4",
|
"@reduxjs/toolkit": "2.0.1",
|
||||||
"ramda": "0.29.1",
|
"clsx": "2.0.0",
|
||||||
"react": "18.2.0",
|
"date-fns": "3.0.6",
|
||||||
"react-dom": "18.2.0",
|
"history": "5.3.0",
|
||||||
"react-redux": "9.0.4",
|
"ramda": "0.29.1",
|
||||||
"typescript": "5.3.3",
|
"react": "18.2.0",
|
||||||
"yup": "1.3.3"
|
"react-dom": "18.2.0",
|
||||||
},
|
"react-redux": "9.0.4",
|
||||||
"devDependencies": {
|
"typescript": "5.3.3",
|
||||||
"@rtk-query/codegen-openapi": "1.2.0",
|
"wouter": "2.12.1",
|
||||||
"@types/jest": "29.5.11",
|
"yup": "1.3.3"
|
||||||
"@types/ramda": "0.29.9",
|
},
|
||||||
"@types/react": "18.2.45",
|
"devDependencies": {
|
||||||
"@types/react-dom": "18.2.18",
|
"@rtk-query/codegen-openapi": "1.2.0",
|
||||||
"@types/react-redux": "7.1.33",
|
"@types/enzyme": "3.10.16",
|
||||||
"@types/yup": "0.29.14",
|
"@types/jest": "29.5.11",
|
||||||
"@typescript-eslint/eslint-plugin": "6.15.0",
|
"@types/nightwatch": "2.3.30",
|
||||||
"@typescript-eslint/parser": "6.15.0",
|
"@types/ramda": "0.29.9",
|
||||||
"autoprefixer": "10.4.16",
|
"@types/react": "18.2.45",
|
||||||
"css-loader":"^6.8.1",
|
"@types/react-dom": "18.2.18",
|
||||||
"process": "0.11.10",
|
"@types/react-redux": "7.1.33",
|
||||||
"dotenv": "16.3.1",
|
"@types/yup": "0.29.14",
|
||||||
"eslint": "8.56.0",
|
"@typescript-eslint/eslint-plugin": "6.15.0",
|
||||||
"eslint-config-prettier": "9.1.0",
|
"@typescript-eslint/parser": "6.15.0",
|
||||||
"eslint-plugin-import": "2.29.1",
|
"autoprefixer": "10.4.16",
|
||||||
"eslint-config-next": "14.0.4",
|
"case-sensitive-paths-webpack-plugin": "2.4.0",
|
||||||
"eslint-plugin-react": "7.33.2",
|
"clean-webpack-plugin": "4.0.0",
|
||||||
"eslint-plugin-react-hooks": "4.6.0",
|
"copy-webpack-plugin": "11.0.0",
|
||||||
"eslint-plugin-simple-import-sort": "10.0.0",
|
"css-loader": "6.8.1",
|
||||||
"eslint-plugin-typescript": "0.14.0",
|
"process": "0.11.10",
|
||||||
"eslint-plugin-typescript-sort-keys": "3.1.0",
|
"dotenv": "16.3.1",
|
||||||
"jest": "29.7.0",
|
"eslint": "8.56.0",
|
||||||
"postcss": "8.4.32",
|
"eslint-config-prettier": "9.1.0",
|
||||||
"postcss-loader": "7.3.3",
|
"eslint-plugin-import": "2.29.1",
|
||||||
"prettier": "3.1.1",
|
"eslint-plugin-react": "7.33.2",
|
||||||
"tailwindcss": "3.4.0",
|
"eslint-plugin-react-hooks": "4.6.0",
|
||||||
"ts-node": "10.9.2",
|
"eslint-plugin-simple-import-sort": "10.0.0",
|
||||||
"ts-jest": "29.1.1"
|
"eslint-plugin-typescript": "0.14.0",
|
||||||
},
|
"eslint-plugin-typescript-sort-keys": "3.1.0",
|
||||||
"peerDependencies": {}
|
"file-loader": "6.2.0",
|
||||||
|
"html-webpack-plugin": "5.6.0",
|
||||||
|
"http-server-spa": "1.3.0",
|
||||||
|
"jest": "29.7.0",
|
||||||
|
"mini-css-extract-plugin": "2.7.6",
|
||||||
|
"nightwatch": "3.3.5",
|
||||||
|
"postcss": "8.4.32",
|
||||||
|
"postcss-loader": "7.3.3",
|
||||||
|
"prettier": "3.1.1",
|
||||||
|
"tailwindcss": "3.4.0",
|
||||||
|
"ts-node": "10.9.2",
|
||||||
|
"ts-jest": "29.1.1",
|
||||||
|
"ts-loader": "9.5.1",
|
||||||
|
"ts-prune": "0.10.3",
|
||||||
|
"tsconfig-paths": "4.2.0",
|
||||||
|
"url-loader": "4.1.1",
|
||||||
|
"webpack": "5.89.0",
|
||||||
|
"webpack-bundle-analyzer": "4.10.1",
|
||||||
|
"webpack-cli": "5.1.4",
|
||||||
|
"webpack-dev-server": "4.15.1",
|
||||||
|
"webpack-merge": "5.10.0"
|
||||||
|
},
|
||||||
|
"peerDependencies": {}
|
||||||
}
|
}
|
2778
source/ui/pnpm-lock.yaml
generated
2778
source/ui/pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load diff
|
@ -1,5 +0,0 @@
|
||||||
const configPath = require.resolve('./src/styles/tailwind.config.ts');
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
plugins: ['postcss-import', 'tailwindcss/nesting', ['tailwindcss', configPath], 'autoprefixer'],
|
|
||||||
};
|
|
82
source/ui/scripts/webpack-common.js
Normal file
82
source/ui/scripts/webpack-common.js
Normal file
|
@ -0,0 +1,82 @@
|
||||||
|
require('ts-node/register');
|
||||||
|
|
||||||
|
const path = require('path');
|
||||||
|
const webpack = require('webpack');
|
||||||
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
||||||
|
const HtmlWebPackPlugin = require('html-webpack-plugin');
|
||||||
|
const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin');
|
||||||
|
const CopyPlugin = require('copy-webpack-plugin');
|
||||||
|
|
||||||
|
const __basedir = path.resolve(__dirname, '..');
|
||||||
|
|
||||||
|
module.exports = (env, args, myEnv) => ({
|
||||||
|
entry: {
|
||||||
|
app: [path.resolve(__basedir, 'src/index.tsx')],
|
||||||
|
style: [path.resolve(__basedir, 'src/styles/global.css')],
|
||||||
|
},
|
||||||
|
output: {
|
||||||
|
path: path.resolve(__basedir, 'build'),
|
||||||
|
publicPath: '/',
|
||||||
|
},
|
||||||
|
resolve: {
|
||||||
|
alias: {
|
||||||
|
api: path.resolve(__basedir, 'src/api'),
|
||||||
|
app: path.resolve(__basedir, 'src/app'),
|
||||||
|
components: path.resolve(__basedir, 'src/components'),
|
||||||
|
constants: path.resolve(__basedir, 'src/constants'),
|
||||||
|
features: path.resolve(__basedir, 'src/features'),
|
||||||
|
hooks: path.resolve(__basedir, 'src/hooks'),
|
||||||
|
localization: path.resolve(__basedir, 'src/localization'),
|
||||||
|
pages: path.resolve(__basedir, 'src/pages'),
|
||||||
|
utils: path.resolve(__basedir, 'src/utils'),
|
||||||
|
types: path.resolve(__basedir, 'src/types'),
|
||||||
|
},
|
||||||
|
extensions: ['.ts', '.tsx', '.js', '.json'],
|
||||||
|
},
|
||||||
|
module: {
|
||||||
|
rules: [
|
||||||
|
{
|
||||||
|
test: /\.tsx?$/,
|
||||||
|
loader: 'ts-loader',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
test: /\.css$/i,
|
||||||
|
use: [
|
||||||
|
MiniCssExtractPlugin.loader,
|
||||||
|
'css-loader',
|
||||||
|
{
|
||||||
|
loader: 'postcss-loader',
|
||||||
|
options: {
|
||||||
|
postcssOptions: {
|
||||||
|
config: path.resolve(__basedir, 'src/styles/postcss.config.js'),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
plugins: [
|
||||||
|
new MiniCssExtractPlugin({
|
||||||
|
filename: '[name].css',
|
||||||
|
}),
|
||||||
|
new HtmlWebPackPlugin({
|
||||||
|
hash: true,
|
||||||
|
filename: 'index.html', //target html
|
||||||
|
template: path.resolve(__basedir, 'src/app/assets/html/index.ejs'), //source html
|
||||||
|
env: {
|
||||||
|
websiteId: process.env.WA_WEBSITE_ID,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
new CopyPlugin({
|
||||||
|
patterns: [
|
||||||
|
{ from: path.resolve(__basedir, 'src/app/assets/public'), to: './' },
|
||||||
|
],
|
||||||
|
}),
|
||||||
|
new webpack.EnvironmentPlugin(myEnv),
|
||||||
|
new webpack.ProvidePlugin({
|
||||||
|
process: 'process/browser',
|
||||||
|
}),
|
||||||
|
new CaseSensitivePathsPlugin(),
|
||||||
|
],
|
||||||
|
});
|
17
source/ui/scripts/webpack-dev.js
Normal file
17
source/ui/scripts/webpack-dev.js
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
const { merge } = require('webpack-merge');
|
||||||
|
|
||||||
|
const common = require('./webpack-common');
|
||||||
|
const myEnv = require('dotenv').config({ path: 'config/local/.env' }).parsed;
|
||||||
|
|
||||||
|
module.exports = (env, args) => {
|
||||||
|
return merge(common(env, args, myEnv), {
|
||||||
|
mode: 'development',
|
||||||
|
devtool: 'inline-source-map',
|
||||||
|
devServer: {
|
||||||
|
host: '0.0.0.0',
|
||||||
|
port: '3330',
|
||||||
|
hot: true,
|
||||||
|
historyApiFallback: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
16
source/ui/scripts/webpack-prod.js
Normal file
16
source/ui/scripts/webpack-prod.js
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
const { merge } = require('webpack-merge');
|
||||||
|
|
||||||
|
const myEnv = require('dotenv').config({ path: 'config/prod/.env' }).parsed;
|
||||||
|
const common = require('./webpack-common');
|
||||||
|
|
||||||
|
// const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
|
||||||
|
|
||||||
|
module.exports = (env, args) => {
|
||||||
|
return merge(common(env, args, myEnv), {
|
||||||
|
mode: 'production',
|
||||||
|
devtool: false,
|
||||||
|
plugins: [
|
||||||
|
// new BundleAnalyzerPlugin(),
|
||||||
|
],
|
||||||
|
});
|
||||||
|
};
|
66
source/ui/src/app/app.tsx
Normal file
66
source/ui/src/app/app.tsx
Normal file
|
@ -0,0 +1,66 @@
|
||||||
|
// @ts-nocheck
|
||||||
|
import React, { FC } from 'react';
|
||||||
|
import { Route, Switch } from 'wouter';
|
||||||
|
|
||||||
|
import { useAuth } from '@procyon/auth/hook/useAuth';
|
||||||
|
import Section from '@procyon/components/Section';
|
||||||
|
import { Skeleton } from '@procyon/components/Skeleton';
|
||||||
|
import { MenuItem } from '@procyon/components/Skeleton/types';
|
||||||
|
|
||||||
|
import { WelcomePage } from 'pages/WelcomePage';
|
||||||
|
|
||||||
|
import { buildRoute, Routes } from './routes';
|
||||||
|
|
||||||
|
const topMenu: MenuItem[][] = [
|
||||||
|
[
|
||||||
|
{ label: 'Routa', href: buildRoute('root') },
|
||||||
|
],
|
||||||
|
[
|
||||||
|
// authenticated
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
const userMenu: MenuItem[][] = [
|
||||||
|
[
|
||||||
|
// public
|
||||||
|
],
|
||||||
|
[
|
||||||
|
// authenticated
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
export const App: FC = () => {
|
||||||
|
const { authenticated } = useAuth();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Skeleton
|
||||||
|
items={{
|
||||||
|
logo: <>Many</>,
|
||||||
|
top: authenticated ? topMenu[1] : topMenu[0],
|
||||||
|
user: authenticated ? userMenu[1] : userMenu[0],
|
||||||
|
}}
|
||||||
|
components={{
|
||||||
|
footer: (
|
||||||
|
<div className="text-center footer">
|
||||||
|
<Section>
|
||||||
|
Tento web používá pouze technické cookie. Monitorování návštěvnosti je zcela anonymní a je prováděno na straně
|
||||||
|
provozovatele webu.
|
||||||
|
</Section>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{authenticated ? (
|
||||||
|
<Switch>
|
||||||
|
<Route>404!</Route>
|
||||||
|
</Switch>
|
||||||
|
) : (
|
||||||
|
<Switch>
|
||||||
|
<Route path={Routes.root} component={WelcomePage} />
|
||||||
|
<Route>404!</Route>
|
||||||
|
</Switch>
|
||||||
|
)}
|
||||||
|
</Skeleton>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
41
source/ui/src/app/assets/html/index.ejs
Normal file
41
source/ui/src/app/assets/html/index.ejs
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<link href="https://fonts.googleapis.com/css?family=Ubuntu:400,700&subset=cyrillic-ext" rel="stylesheet">
|
||||||
|
<title>$(AppName)</title>
|
||||||
|
<meta name="robots" content="index,follow">
|
||||||
|
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
::-webkit-scrollbar {
|
||||||
|
width: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
::-webkit-scrollbar-track {
|
||||||
|
background: #ddd;
|
||||||
|
}
|
||||||
|
|
||||||
|
::-webkit-scrollbar-thumb {
|
||||||
|
background: #666;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div id="app"></div>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
<% if (htmlWebpackPlugin.options.env.websiteId) { %>
|
||||||
|
<script async src="https://wa.romanjaros.dev/script.js"
|
||||||
|
data-website-id="<%= htmlWebpackPlugin.options.env.websiteId %>">
|
||||||
|
</script>
|
||||||
|
<% } %>
|
||||||
|
|
||||||
|
</html>
|
0
source/ui/src/app/assets/public/.gitkeep
Normal file
0
source/ui/src/app/assets/public/.gitkeep
Normal file
|
@ -1,28 +0,0 @@
|
||||||
// @ts-nocheck
|
|
||||||
import '../styles/global.css';
|
|
||||||
|
|
||||||
import type { Metadata } from 'next';
|
|
||||||
import { Poppins } from 'next/font/google';
|
|
||||||
import { ReactNode } from 'react';
|
|
||||||
|
|
||||||
import { ReduxProvider } from '../providers/Redux';
|
|
||||||
import { SkeletonProvider } from '../providers/Skeleton';
|
|
||||||
|
|
||||||
const inter = Poppins({ weight: ['300', '500', '700'], display: 'swap', subsets: ['latin'] });
|
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
|
||||||
title: `$(AppName)`,
|
|
||||||
description: '',
|
|
||||||
};
|
|
||||||
|
|
||||||
export default function RootLayout({ children }: Readonly<{ children: ReactNode }>) {
|
|
||||||
return (
|
|
||||||
<ReduxProvider>
|
|
||||||
<html lang="en">
|
|
||||||
<body className={inter.className}>
|
|
||||||
<SkeletonProvider>{children}</SkeletonProvider>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
</ReduxProvider>
|
|
||||||
);
|
|
||||||
}
|
|
|
@ -1,4 +0,0 @@
|
||||||
// @ts-nocheck
|
|
||||||
export default function Page() {
|
|
||||||
return <b>Next page</b>;
|
|
||||||
}
|
|
|
@ -1,25 +0,0 @@
|
||||||
// @ts-nocheck
|
|
||||||
|
|
||||||
async function getData() {
|
|
||||||
const res = await fetch('https://jsonplaceholder.typicode.com/todos/1');
|
|
||||||
// The return value is *not* serialized
|
|
||||||
// You can return Date, Map, Set, etc.
|
|
||||||
|
|
||||||
if (!res.ok) {
|
|
||||||
// This will activate the closest `error.js` Error Boundary
|
|
||||||
throw new Error('Failed to fetch data');
|
|
||||||
}
|
|
||||||
|
|
||||||
return res.json();
|
|
||||||
}
|
|
||||||
|
|
||||||
export default async function Page() {
|
|
||||||
const data = await getData();
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
Welcome
|
|
||||||
<br />
|
|
||||||
<pre>{JSON.stringify(data, null, 4)}</pre>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
16
source/ui/src/app/routes.ts
Normal file
16
source/ui/src/app/routes.ts
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
// @ts-nocheck
|
||||||
|
import { DotNestedKeys } from '@procyon/localization/types';
|
||||||
|
|
||||||
|
export const Routes = {
|
||||||
|
root: '/'
|
||||||
|
};
|
||||||
|
|
||||||
|
export const buildRoute = (route: DotNestedKeys<typeof Routes>) => {
|
||||||
|
let path = '';
|
||||||
|
let obj: Record<string, any> = Routes;
|
||||||
|
route.split('.').forEach((key: any) => {
|
||||||
|
path += obj[key]?.base ?? obj[key];
|
||||||
|
obj = obj[key];
|
||||||
|
});
|
||||||
|
return path;
|
||||||
|
};
|
34
source/ui/src/app/store.ts
Normal file
34
source/ui/src/app/store.ts
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
// @ts-nocheck
|
||||||
|
// import generated apis
|
||||||
|
|
||||||
|
import { AnyAction, combineReducers, configureStore, ThunkDispatch } from '@reduxjs/toolkit';
|
||||||
|
import { TypedUseSelectorHook, useDispatch, useSelector } from 'react-redux';
|
||||||
|
|
||||||
|
import authReducer from '@procyon/auth/slice';
|
||||||
|
import { AUTH_REDUCER_NAME } from '@procyon/auth/types';
|
||||||
|
import { ROOT_REDUCER_NAME } from '@procyon/constants/redux';
|
||||||
|
|
||||||
|
import { emptyApi } from '../api/emptyApi';
|
||||||
|
|
||||||
|
type procyonReducer = {
|
||||||
|
[AUTH_REDUCER_NAME]: typeof authReducer;
|
||||||
|
};
|
||||||
|
|
||||||
|
const store = configureStore({
|
||||||
|
reducer: {
|
||||||
|
[ROOT_REDUCER_NAME]: combineReducers<procyonReducer>({
|
||||||
|
[AUTH_REDUCER_NAME]: authReducer,
|
||||||
|
}),
|
||||||
|
[emptyApi.reducerPath]: emptyApi.reducer,
|
||||||
|
},
|
||||||
|
middleware: (gDM) => [...gDM({ serializableCheck: false }).concat([emptyApi.middleware])],
|
||||||
|
devTools: process.env.NODE_ENV === 'development'
|
||||||
|
});
|
||||||
|
|
||||||
|
export type RootState = ReturnType<typeof store.getState>;
|
||||||
|
export type AppDispatch = ThunkDispatch<RootState, unknown, AnyAction>;
|
||||||
|
|
||||||
|
export const useAppDispatch: () => AppDispatch = useDispatch;
|
||||||
|
export const useAppSelector: TypedUseSelectorHook<RootState> = useSelector;
|
||||||
|
|
||||||
|
export default store;
|
0
source/ui/src/components/.gitkeep
Normal file
0
source/ui/src/components/.gitkeep
Normal file
0
source/ui/src/constants/.gitkeep
Normal file
0
source/ui/src/constants/.gitkeep
Normal file
0
source/ui/src/features/.gitkeep
Normal file
0
source/ui/src/features/.gitkeep
Normal file
0
source/ui/src/hooks/.gitkeep
Normal file
0
source/ui/src/hooks/.gitkeep
Normal file
25
source/ui/src/index.tsx
Normal file
25
source/ui/src/index.tsx
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
// @ts-nocheck
|
||||||
|
import 'types/global';
|
||||||
|
import 'localization/locale';
|
||||||
|
import 'utils/yup';
|
||||||
|
|
||||||
|
import React from 'react';
|
||||||
|
import { render } from 'react-dom';
|
||||||
|
import { Provider } from 'react-redux';
|
||||||
|
|
||||||
|
import { ModalWrapper } from '@procyon/components/Modal/context';
|
||||||
|
import { ToasterWrapper } from '@procyon/components/Toaster/context';
|
||||||
|
|
||||||
|
import { App } from './app/app';
|
||||||
|
import store from './app/store';
|
||||||
|
|
||||||
|
render(
|
||||||
|
<Provider store={store}>
|
||||||
|
<ModalWrapper>
|
||||||
|
<ToasterWrapper>
|
||||||
|
<App />
|
||||||
|
</ToasterWrapper>
|
||||||
|
</ModalWrapper>
|
||||||
|
</Provider>,
|
||||||
|
document.getElementById('app')
|
||||||
|
);
|
6
source/ui/src/pages/WelcomePage.tsx
Normal file
6
source/ui/src/pages/WelcomePage.tsx
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
// @ts-nocheck
|
||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
export const WelcomePage = () => {
|
||||||
|
return <div className="welcome">Seedling app generator.</div>;
|
||||||
|
};
|
|
@ -1,16 +0,0 @@
|
||||||
// @ts-nocheck
|
|
||||||
'use client';
|
|
||||||
|
|
||||||
import { useRef, ReactNode } from 'react';
|
|
||||||
import { Provider } from 'react-redux';
|
|
||||||
|
|
||||||
import { makeStore } from '../redux/store';
|
|
||||||
|
|
||||||
export function ReduxProvider({ children }: { children: ReactNode }) {
|
|
||||||
const storeRef = useRef<ReturnType<typeof makeStore> | null>(null);
|
|
||||||
if (!storeRef.current) {
|
|
||||||
storeRef.current = makeStore();
|
|
||||||
}
|
|
||||||
|
|
||||||
return <Provider store={storeRef.current}>{children}</Provider>;
|
|
||||||
}
|
|
|
@ -1,28 +0,0 @@
|
||||||
// @ts-nocheck
|
|
||||||
'use client';
|
|
||||||
|
|
||||||
import { useRouter } from 'next/navigation';
|
|
||||||
import { Skeleton } from '@procyon/components/Skeleton';
|
|
||||||
|
|
||||||
export function SkeletonProvider({ children }: Readonly<{ children: React.ReactNode }>) {
|
|
||||||
const router = useRouter();
|
|
||||||
return (
|
|
||||||
<Skeleton
|
|
||||||
onHref={(path) => router.push(path as string)}
|
|
||||||
items={{
|
|
||||||
logo: <>App</>,
|
|
||||||
top: [
|
|
||||||
{
|
|
||||||
label: 'Home',
|
|
||||||
href: '/',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Next page',
|
|
||||||
href: '/next-page',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
}}>
|
|
||||||
{children}
|
|
||||||
</Skeleton>
|
|
||||||
);
|
|
||||||
}
|
|
|
@ -1,27 +0,0 @@
|
||||||
// @ts-nocheck
|
|
||||||
import { combineReducers, configureStore } from '@reduxjs/toolkit';
|
|
||||||
import { TypedUseSelectorHook, useDispatch, useSelector } from 'react-redux';
|
|
||||||
|
|
||||||
import authReducer from '@procyon/auth/slice';
|
|
||||||
|
|
||||||
import { emptyApi } from './emptyApi';
|
|
||||||
|
|
||||||
export const makeStore = () =>
|
|
||||||
configureStore({
|
|
||||||
reducer: {
|
|
||||||
procyon: combineReducers({
|
|
||||||
auth: authReducer,
|
|
||||||
}),
|
|
||||||
[emptyApi.reducerPath]: emptyApi.reducer,
|
|
||||||
},
|
|
||||||
middleware: (gDM) => gDM().prepend(emptyApi.middleware),
|
|
||||||
devTools: process.env.NODE_ENV === 'development',
|
|
||||||
});
|
|
||||||
|
|
||||||
export type ReduxStore = ReturnType<typeof makeStore>;
|
|
||||||
|
|
||||||
export type RootState = ReturnType<ReduxStore['getState']>;
|
|
||||||
export type AppDispatch = ReduxStore['dispatch'];
|
|
||||||
|
|
||||||
export const useAppDispatch: () => AppDispatch = useDispatch;
|
|
||||||
export const useAppSelector: TypedUseSelectorHook<RootState> = useSelector;
|
|
8
source/ui/src/styles/components/component.js
Normal file
8
source/ui/src/styles/components/component.js
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
const component = () => ({
|
||||||
|
});
|
||||||
|
|
||||||
|
module.exports = ({ addComponents, theme }) => {
|
||||||
|
addComponents(component(theme));
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports.component = component;
|
|
@ -1,9 +0,0 @@
|
||||||
import { PluginCreator } from 'tailwindcss/types/config';
|
|
||||||
|
|
||||||
const component = () => ({});
|
|
||||||
|
|
||||||
const creator: PluginCreator = ({ addComponents, theme }) => {
|
|
||||||
addComponents({});
|
|
||||||
};
|
|
||||||
|
|
||||||
export default creator;
|
|
|
@ -1,5 +1,9 @@
|
||||||
@import '@procyon/styles/global.css';
|
@import '@procyon/styles/global.css';
|
||||||
|
|
||||||
|
@import "./variables.css";
|
||||||
|
|
||||||
|
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;500;700&display=swap');
|
||||||
|
|
||||||
body {
|
body {
|
||||||
@apply bg-white text-black text-sm;
|
@apply bg-white text-black text-sm;
|
||||||
font-family: 'Poppins', sans-serif;
|
font-family: 'Poppins', sans-serif;
|
||||||
|
|
4
source/ui/src/styles/postcss.config.js
Normal file
4
source/ui/src/styles/postcss.config.js
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
const postcss = require('@procyon/styles/postcss.config');
|
||||||
|
const configPath = require.resolve('./tailwind.config.js');
|
||||||
|
|
||||||
|
module.exports = postcss({ tailwindConfigFile: configPath });
|
23
source/ui/src/styles/tailwind.config.js
Normal file
23
source/ui/src/styles/tailwind.config.js
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
|
const plugin = require('tailwindcss/plugin');
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
presets: [require('@procyon/styles/tailwind.config')],
|
||||||
|
content: [
|
||||||
|
path.resolve(__dirname + '../../**/*.{js,ts,tsx}'),
|
||||||
|
path.resolve(__dirname + '../../../node_modules/@procyon/**/*.{js,ts,tsx}'),
|
||||||
|
],
|
||||||
|
safelist: require('@procyon/styles/tailwind.config').safelist,
|
||||||
|
theme: {
|
||||||
|
extend: require('./theme'),
|
||||||
|
},
|
||||||
|
variants: {
|
||||||
|
extend: {
|
||||||
|
borderWidth: ['last'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
plugins: [
|
||||||
|
plugin(require('./components/component')),
|
||||||
|
],
|
||||||
|
};
|
|
@ -1,18 +0,0 @@
|
||||||
import type { Config } from 'tailwindcss';
|
|
||||||
import plugin from 'tailwindcss/plugin';
|
|
||||||
import path from 'path';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
presets: [require('@procyon/styles/tailwind.config')],
|
|
||||||
content: [
|
|
||||||
path.resolve(__dirname + '../../app/*.{js,ts,tsx}'),
|
|
||||||
path.resolve(__dirname + '../../pages/*.{js,ts,tsx}'),
|
|
||||||
path.resolve(__dirname + '../../components/*.{js,ts,tsx}'),
|
|
||||||
path.resolve(__dirname + '../../../node_modules/@procyon/**/*.{js,ts,tsx}'),
|
|
||||||
],
|
|
||||||
safelist: require('@procyon/styles/tailwind.config').safelist,
|
|
||||||
theme: {
|
|
||||||
extend: require('./theme'),
|
|
||||||
},
|
|
||||||
plugins: [plugin(require('./components/component'))],
|
|
||||||
} satisfies Config;
|
|
10
source/ui/src/styles/theme.js
Normal file
10
source/ui/src/styles/theme.js
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
const { pallete } = require('@procyon/styles/utils/color');
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
colors: {
|
||||||
|
disabled: pallete('disabled'),
|
||||||
|
},
|
||||||
|
borderWidth: {
|
||||||
|
1: '1px',
|
||||||
|
},
|
||||||
|
};
|
|
@ -1,12 +0,0 @@
|
||||||
// @ts-nocheck
|
|
||||||
|
|
||||||
import palette from '@procyon/styles/palette';
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
colors: {
|
|
||||||
...palette,
|
|
||||||
},
|
|
||||||
borderWidth: {
|
|
||||||
1: '1px',
|
|
||||||
},
|
|
||||||
};
|
|
5
source/ui/src/styles/variables.css
Normal file
5
source/ui/src/styles/variables.css
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
:root {
|
||||||
|
--color-h: 0;
|
||||||
|
--color-s: 0%;
|
||||||
|
--color-l: 0%;
|
||||||
|
}
|
0
source/ui/src/types/global.ts
Normal file
0
source/ui/src/types/global.ts
Normal file
5
source/ui/src/types/next-env.d.ts
vendored
5
source/ui/src/types/next-env.d.ts
vendored
|
@ -1,5 +0,0 @@
|
||||||
/// <reference types="next" />
|
|
||||||
/// <reference types="next/image-types/global" />
|
|
||||||
|
|
||||||
// NOTE: This file should not be edited
|
|
||||||
// see https://nextjs.org/docs/basic-features/typescript for more information.
|
|
8
source/ui/src/types/yup.d.ts
vendored
Normal file
8
source/ui/src/types/yup.d.ts
vendored
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
// @ts-nocheck
|
||||||
|
import { StringSchema } from 'yup';
|
||||||
|
|
||||||
|
declare module 'yup' {
|
||||||
|
interface StringSchema {
|
||||||
|
// place custom Yup definition of validation
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,7 +1,7 @@
|
||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
// place import for custom Yup validations
|
// place import for custom Yup validations
|
||||||
|
|
||||||
import * as Yup from 'src/utils/yup';
|
import * as Yup from 'yup';
|
||||||
|
|
||||||
Yup.setLocale({
|
Yup.setLocale({
|
||||||
mixed: {
|
mixed: {
|
||||||
|
|
9
source/ui/tests/nightwatchjs.d.ts
vendored
Normal file
9
source/ui/tests/nightwatchjs.d.ts
vendored
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
import { Definition } from 'nightwatch';
|
||||||
|
|
||||||
|
declare module 'nightwatch' {
|
||||||
|
interface NightwatchCustomPageObjects {
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface NightwatchCustomCommands {
|
||||||
|
}
|
||||||
|
}
|
22
source/ui/tests/tsconfig.json
Normal file
22
source/ui/tests/tsconfig.json
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"outDir": ".nightwatchjs",
|
||||||
|
"baseUrl": ".",
|
||||||
|
"rootDir": ".",
|
||||||
|
"allowJs": true,
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"module": "commonjs",
|
||||||
|
"strictNullChecks": true,
|
||||||
|
"strictFunctionTypes": false,
|
||||||
|
"target": "es6",
|
||||||
|
"lib": [
|
||||||
|
"es6",
|
||||||
|
],
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"./nightwatchjs.d.ts"
|
||||||
|
],
|
||||||
|
"include": [
|
||||||
|
"./**/*.ts",
|
||||||
|
]
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue