Skip to content

Commit fb43b08

Browse files
authored
Merge pull request #23 from mess9/tea
add postcss-nesting, aliases, @types/node
2 parents 3484057 + ce2e91c commit fb43b08

File tree

123 files changed

+11888
-886
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+11888
-886
lines changed

.github/workflows/deploy_front.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Deploy Frontend to Oracle VM
2+
3+
on:
4+
push:
5+
tags:
6+
- 'front_v*' # Теги вида front_v1.0.0
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
# Шаг 1: Настроить SSH ключи и добавить сервер в known_hosts для безопасности
14+
- name: Setup SSH keys and known hosts
15+
run: |
16+
# Создаем директорию для SSH ключей
17+
mkdir -p ~/.ssh
18+
19+
# Добавляем приватный ключ для доступа к серверу
20+
echo "${{ secrets.REMOTE_SSH_KEY }}" > ~/.ssh/deploy_key
21+
chmod 600 ~/.ssh/deploy_key # Устанавливаем правильные права для приватного ключа
22+
23+
# Добавляем публичный ключ сервера в known_hosts для проверки подлинности
24+
ssh-keyscan -H ${{ secrets.REMOTE_HOST }} >> ~/.ssh/known_hosts
25+
26+
# Устанавливаем права на директорию и файл known_hosts
27+
chmod 644 ~/.ssh/known_hosts
28+
29+
# Шаг 2: Выполняем деплой на сервер
30+
- name: Deploy frontend to Oracle VM
31+
run: |
32+
ssh -o StrictHostKeyChecking=yes -i ~/.ssh/deploy_key ubuntu@${{ secrets.REMOTE_HOST }} << 'EOF'
33+
34+
# Переходим в папку с фронтендом
35+
cd ~/frontend
36+
37+
# Обновляем репозиторий на сервере, вытягиваем последние изменения
38+
git fetch --tags
39+
git checkout front_v1.0.0 # Переключаемся на тег (если это нужно)
40+
41+
# Устанавливаем зависимости
42+
npm install
43+
44+
# Строим фронтенд
45+
npm run build
46+
47+
# Удаляем старые файлы на сервере
48+
sudo rm -rf /var/www/html/*
49+
50+
# Копируем новые файлы
51+
sudo cp -r ~/frontend/dist/* /var/www/html/
52+
53+
# Перезагружаем Nginx для обновления
54+
sudo systemctl reload nginx
55+
56+
EOF
57+
env:
58+
SSH_PRIVATE_KEY: ${{ secrets.REMOTE_SSH_KEY }}

.gitignore

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ build/
3434

3535
###OTHER###
3636
.allure
37-
*/node_modules/
3837
amplicode.xml
3938
.deploy/oracle/dbWallet
39+
40+
### Frontend ###
41+
*/node_modules/
42+
*/dist/
43+
*storybook.log
44+
.cursorignore
45+
*.sublime-project
46+
*.sublime-workspace

frontend/.gitignore

Lines changed: 0 additions & 24 deletions
This file was deleted.

frontend/.prettierignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
*.svg
2+
*.png
3+
*.jpg
4+
*.jpeg
5+
*.gif
6+
*.webp
7+
*.ico
8+
*.avif

frontend/.storybook/main.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import type { StorybookConfig } from "storybook-solidjs-vite";
2+
3+
const config: StorybookConfig = {
4+
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
5+
addons: [
6+
"@storybook/addon-essentials",
7+
"@chromatic-com/storybook",
8+
"@storybook/addon-interactions",
9+
],
10+
core: {
11+
builder: '@storybook/builder-vite', // 👈 The builder enabled here.
12+
},
13+
framework: {
14+
name: "storybook-solidjs-vite",
15+
options: {},
16+
},
17+
};
18+
export default config;

frontend/.storybook/manager.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { addons } from '@storybook/manager-api';
2+
import { themes } from '@storybook/theming';
3+
4+
addons.setConfig({
5+
sidebar: {
6+
showRoots: false,
7+
},
8+
theme: themes.dark,
9+
});

frontend/.storybook/preview.tsx

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
import type { Preview } from "storybook-solidjs";
2+
3+
import { themes } from "@storybook/theming";
4+
/*import { JSX } from "solid-js";*/
5+
6+
const withGlobalCSSVariable = (Story, context) => {
7+
const { globals } = context;
8+
9+
// Установить значение CSS-переменной
10+
document.documentElement.style.setProperty(
11+
"--count-items-on-vh",
12+
globals.countItemsOnVh || "16", // Значение по умолчанию
13+
);
14+
15+
return Story();
16+
};
17+
18+
const decorators = [withGlobalCSSVariable];
19+
20+
export const globalTypes = {
21+
countItemsOnVh: {
22+
name: "Count Items on Viewport Height",
23+
description: "Number of items visible per viewport height",
24+
defaultValue: "16", // Значение по умолчанию
25+
toolbar: {
26+
icon: "circlehollow", // Иконка в интерфейсе Storybook
27+
items: ["8", "12", "16", "20", "24"], // Возможные значения
28+
showName: true,
29+
},
30+
},
31+
};
32+
33+
const preview: Preview = {
34+
decorators,
35+
// decorators: [
36+
// (Story: () => JSX.Element): JSX.Element => (
37+
// <div>
38+
// <Story />
39+
// </div>
40+
// ),
41+
// ],
42+
// decorators: [
43+
// (Story) => (
44+
// <div style={{ margin: '3em' }}>
45+
// <Story />
46+
// </div>
47+
// )],
48+
parameters: {
49+
backgrounds: {
50+
values: [
51+
{ name: "Dark", value: "#333" },
52+
{ name: "Light", value: "#F7F9F2" },
53+
{ name: "Maroon", value: "#400" },
54+
],
55+
default: "Dark",
56+
},
57+
controls: {
58+
matchers: {
59+
color: /(background|color)$/i,
60+
date: /Date$/i,
61+
},
62+
},
63+
docs: {
64+
theme: themes.dark,
65+
},
66+
options: {
67+
storySort: {
68+
order: [
69+
"app",
70+
"pages",
71+
"widgets",
72+
"features",
73+
"entities",
74+
"shared",
75+
"Example",
76+
],
77+
},
78+
},
79+
},
80+
globalTypes,
81+
};
82+
83+
// const Dec = (Story) => (
84+
// <div style={{ margin: '3em' }}>
85+
// <Story />
86+
// </div>
87+
// )
88+
89+
// import './styles/global.css';
90+
91+
// export const globalTypes = {
92+
// theme: {
93+
// name: 'Theme',
94+
// description: 'Global theme for components',
95+
// defaultValue: 'default',
96+
// toolbar: {
97+
// icon: 'paintbrush',
98+
// items: ['default', 'dark'],
99+
// },
100+
// },
101+
// };
102+
103+
// export const decorators = [
104+
// (Story, context) => {
105+
// const theme = context.globals.theme;
106+
// return (
107+
// <div data-theme={theme}>
108+
// <Story />
109+
// </div>
110+
// );
111+
// },
112+
// ];
113+
114+
export default preview;

frontend/README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
## Usage
2+
3+
Those templates dependencies are maintained via [pnpm](https://pnpm.io) via `pnpm up -Lri`.
4+
5+
This is the reason you see a `pnpm-lock.yaml`. That being said, any package manager will work. This file can be safely be removed once you clone a template.
6+
7+
```bash
8+
$ npm install # or pnpm install or yarn install
9+
```
10+
11+
### Learn more on the [Solid Website](https://solidjs.com) and come chat with us on our [Discord](https://discord.com/invite/solidjs)
12+
13+
## Available Scripts
14+
15+
In the project directory, you can run:
16+
17+
### `npm run dev` or `npm start`
18+
19+
Runs the app in the development mode.<br>
20+
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
21+
22+
The page will reload if you make edits.<br>
23+
24+
### `npm run build`
25+
26+
Builds the app for production to the `dist` folder.<br>
27+
It correctly bundles Solid in production mode and optimizes the build for the best performance.
28+
29+
The build is minified and the filenames include the hashes.<br>
30+
Your app is ready to be deployed!
31+
32+
## Deployment
33+
34+
You can deploy the `dist` folder to any static host provider (netlify, surge, now, etc.)

frontend/eslint.config.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import globals from "globals";
2+
import pluginJs from "@eslint/js";
3+
import solid from "eslint-plugin-solid/configs/typescript";
4+
import tseslint from "typescript-eslint";
5+
6+
/** @type {import('eslint').Linter.Config[]} */
7+
8+
export default [
9+
pluginJs.configs.recommended,
10+
...tseslint.config([
11+
tseslint.configs.recommended,
12+
{
13+
rules: {
14+
"@typescript-eslint/consistent-type-exports": "warn",
15+
"@typescript-eslint/consistent-type-imports": "warn",
16+
17+
"@typescript-eslint/no-unused-vars": "warn",
18+
},
19+
files: ["src/**/*.{ts,tsx}"],
20+
languageOptions: {
21+
globals: globals.browser,
22+
parser: tseslint.parser,
23+
parserOptions: {
24+
project: "tsconfig.json",
25+
tsconfigRootDir: import.meta.dirname,
26+
},
27+
},
28+
},
29+
]),
30+
solid,
31+
];

frontend/index.html

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
<!doctype html>
22
<html lang="en">
3-
<head>
4-
<meta charset="UTF-8"/>
5-
<link rel="icon" type="image/svg+xml" href="/vite.svg"/>
6-
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
7-
<title>Vite + Preact + TS</title>
8-
</head>
9-
<body>
10-
<div id="app"></div>
11-
<script type="module" src="/src/main.tsx"></script>
12-
</body>
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1" />
6+
<meta name="theme-color" content="#000000" />
7+
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
8+
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />
9+
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" />
10+
<link rel="manifest" href="/site.webmanifest" />
11+
<link rel="shortcut icon" type="image/ico" href="/favicon.ico" />
12+
<title>Baylist</title>
13+
</head>
14+
<body>
15+
<noscript>You need to enable JavaScript to run this app.</noscript>
16+
<div id="root"></div>
17+
18+
<script src="/src/index.tsx" type="module"></script>
19+
</body>
1320
</html>

0 commit comments

Comments
 (0)