Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat/migrate #23

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .babelrc

This file was deleted.

21 changes: 21 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: ['eslint:recommended', "plugin:react/recommended", 'plugin:@typescript-eslint/recommended', 'plugin:react-hooks/recommended', 'plugin:storybook/recommended'],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parser: '@typescript-eslint/parser',
plugins: ['react-refresh', "react"],
parserOptions: {
ecmaFeatures: {
jsx: true
}
},
rules: {
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
"react/react-in-jsx-scope": "off",
"react/jsx-indent": ["error", 2],
},
}
44 changes: 0 additions & 44 deletions .github/workflows/publish-npm.yml

This file was deleted.

44 changes: 44 additions & 0 deletions .github/workflows/publish-storybook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: CI/CD for Storybook

on:
push:
branches:
- dev
pull_request:
branches:
- dev

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [22.x]

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: yarn install

- name: Upgrade dependencies
run: yarn upgrade

- name: Build Storybook
run: yarn build-storybook

- name: Create CNAME file
run: echo 'storybook.eveot.com' > ./storybook-static/CNAME

- name: Deploy Storybook to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./storybook-static
25 changes: 24 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,27 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.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
.npmrc
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

*storybook.log
*lock.yaml
30 changes: 13 additions & 17 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,32 +1,28 @@
import type { StorybookConfig } from "@storybook/react-webpack5";
import type { StorybookConfig } from "@storybook/react-vite";

const config: StorybookConfig = {
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
stories: [
{
directory: "../src/stories",
titlePrefix: 'main'
},
{
directory: "../src/legacystories",
titlePrefix: 'legacy'
},
],
addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-onboarding",
"@chromatic-com/storybook",
"@storybook/addon-interactions",
],
framework: {
name: "@storybook/react-webpack5",
name: "@storybook/react-vite",
options: {},
},
docs: {
autodocs: "tag",
},
webpackFinal: (config) => {
// Добавляем правила для обработки файлов .less
config.module.rules.push({
test: /\.less$/,
use: [
'style-loader', // добавить style-loader, чтобы стили применялись динамически
'css-loader',
'less-loader',
],
});
return config;
},
};

export default config;
10 changes: 8 additions & 2 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
import type { Preview } from "@storybook/react";
import { themes } from '@storybook/theming';

const preview: Preview = {
parameters: {
actions: { argTypesRegex: "^on[A-Z].*" },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
date: /Date$/i,
},
},
backgrounds: {
default: 'dark',
},
docs: {
theme: themes.dark
}
},
};

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Eveot GTA RP UI
13 changes: 13 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -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>
125 changes: 59 additions & 66 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,76 +1,69 @@
{
"name": "@eveot/ui",
"version": "1.2.1",
"description": "Eveot UI - Components library for Eveot Projects",
"scripts": {
"rollup": "rollup -c",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build",
"build": "webpack --mode production"
},
"exports": {
"@eveot/ui": "./dist/bundle.js"
},
"repository": {
"type": "git",
"url": "git+https://github.com/eveot/ui.git"
},
"name": "@eveot/erp-ui",
"version": "0.1.8",
"author": "Eveot Developers <developers@eveot.com>",
"license": "ISC",
"main": "./dist/bundle.js",
"module": "./dist/index.d.ts",
"private": false,
"license": "UNLICENSED",
"files": [
"dist"
],
"types": "dist/index.d.ts",
"type": "module",
"module": "./dist/index.d.ts",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"bugs": {
"url": "https://github.com/eveot/ui/issues"
"url": "https://github.com/eveot/erp-ui/issues"
},
"homepage": "https://github.com/eveot/ui#readme",
"devDependencies": {
"@babel/core": "^7.22.20",
"@babel/preset-env": "^7.22.14",
"@babel/preset-react": "^7.22.15",
"@babel/preset-typescript": "^7.22.11",
"@storybook/addon-essentials": "^7.4.0",
"@storybook/addon-interactions": "^7.4.0",
"@storybook/addon-links": "^7.4.0",
"@storybook/addon-onboarding": "^1.0.8",
"@storybook/blocks": "^7.4.0",
"@storybook/react": "^7.4.0",
"@storybook/react-webpack5": "^7.4.0",
"@storybook/testing-library": "^0.2.0",
"@types/react": "^18.2.21",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"concurrently": "^8.2.1",
"css-loader": "^6.8.1",
"less": "^4.2.0",
"less-loader": "^11.1.3",
"less-watch-compiler": "^1.16.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"rollup": "^2.79.1",
"rollup-plugin-alias": "^2.2.0",
"rollup-plugin-babel": "^4.4.0",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-css-only": "^4.3.0",
"rollup-plugin-less": "^1.1.3",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-serve": "^2.0.2",
"storybook": "^7.4.0",
"style-loader": "^3.3.3",
"typescript": "^4.9.5",
"webpack": "^5.88.2",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.15.1"
"homepage": "https://github.com/eveot/erp-ui#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/eveot/erp-ui.git"
},
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview",
"storybook": "storybook dev -p 6006 --no-open",
"build-storybook": "storybook build",
"npm:publish": "pnpm run build && npm publish"
},
"exports": {
".": {
"import": "./dist/index.js"
}
},
"dependencies": {
"@rollup/plugin-commonjs": "^25.0.4",
"@rollup/plugin-node-resolve": "^15.2.1",
"rollup-plugin-concat": "^1.0.3",
"rollup-plugin-copy": "^3.5.0",
"rollup-plugin-postcss": "^4.0.2",
"rollup-plugin-typescript2": "^0.35.0"
"@storybook/theming": "^8.0.9",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-icons": "5.1.0"
},
"devDependencies": {
"@chromatic-com/storybook": "^1.3.3",
"@storybook/addon-essentials": "^8.0.9",
"@storybook/addon-interactions": "^8.0.9",
"@storybook/addon-links": "^8.0.9",
"@storybook/blocks": "^8.0.9",
"@storybook/react": "^8.0.9",
"@storybook/react-vite": "^8.0.9",
"@storybook/test": "^8.0.9",
"@types/react": "^18.3.1",
"@types/react-dom": "^18.3.0",
"@typescript-eslint/eslint-plugin": "^7.8.0",
"@typescript-eslint/parser": "^7.8.0",
"@vitejs/plugin-react": "^4.2.1",
"eslint": "^8.57.0",
"eslint-plugin-react": "^7.34.1",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react-refresh": "^0.4.6",
"eslint-plugin-storybook": "^0.8.0",
"lightningcss": "^1.24.1",
"sass": "^1.76.0",
"storybook": "^8.0.9",
"terser": "^5.31.0",
"typescript": "^5.4.5",
"vite": "^5.2.11",
"vite-plugin-dts": "^3.9.0",
"vite-plugin-libcss": "^1.1.1"
}
}
}
1 change: 1 addition & 0 deletions public/vite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading