Skip to content

Commit

Permalink
feat(Init): init
Browse files Browse the repository at this point in the history
  • Loading branch information
gizeasy committed Apr 22, 2021
1 parent c72c882 commit 1e8c827
Show file tree
Hide file tree
Showing 99 changed files with 23,379 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[*]
indent_style = space
end_of_line = lf
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
max_line_length = 0
trim_trailing_whitespace = false
10 changes: 10 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
build
lib
node_modules
scripts
types
webpack
babel.config.js
jest.config.js
postcss.config.js
*.css.d.ts
22 changes: 22 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module.exports = {
extends: [require.resolve('@consta/widgets-configs/eslintrc')],
overrides: [
{
files: ['./src/**/*.stories.tsx'],
rules: {
'import/no-default-export': ['off'],
'@typescript-eslint/no-shadow': ['off'],
},
},
],
plugins: ['todo-plz'],
rules: {
'todo-plz/ticket-ref': [
'error',
{
pattern: '(GDC-|UI-Kit#)[0-9]+',
terms: ['TODO', 'todo'],
},
],
},
}
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* @gizeasy @dmitriykorsakovnedra
*.md @arhayka
*.mdx @arhayka
20 changes: 20 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
## Описание изменений

## Чек-лист

- [ ] PR: направлен в правильную ветку
- [ ] PR: назначен исполнитель PR и указаны нужные лейблы
- [ ] PR: проверен diff, ничего лишнего в PR не попало
- [ ] PR: прилинкованы затронутые issue и связанные PR
- [ ] PR: есть описание изменений
- [ ] JS: нет варнингов и ошибок в консоли браузера
- [ ] Тесты: новый функционал и исправленные баги покрыты тестами
- [ ] Документация: отражены все изменения в API компонентов и описаны важные особенности реализации или использования
- [ ] Сторибук: для компонентов написаны или обновлены stories
- [ ] Верстка: используются переменные из UI-kit
- [ ] Верстка: проверена с разным количеством контента

## Опционально

- [ ] Доработки: заведены задачи для дальнейшей работы, если что-то решено не править в текущем пулл-реквесте
- [ ] Коммиты: проименованы в соответствии с [правилами](https://consta-widgets.consta.vercel.app/?path=/docs/common-develop-commits-style--page)
34 changes: 34 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Тесты
on:
push:
branches: master
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: rokroskar/[email protected]
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master'"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12

- name: Установка yarn
id: yarn-setup
run: |
yarn policies set-version 1.19.1
echo "::set-output name=cache_dir::$(yarn cache dir)"
- name: Настройка кэширования yarn
uses: actions/cache@v2
with:
path: ${{ steps.yarn-setup.outputs.cache_dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Установка зависимостей
run: yarn --frozen-lockfile
- name: Тесты
run: yarn test
45 changes: 45 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Meta
**/.DS_Store
.idea
.vscode

# Logs
logs
*.log
npm-debug.log*

# Runtime data
pids
*.pid
*.seed

# Coverage directory used by tools like istanbul
coverage

# node-waf configuration
.lock-wscript

# Dependency directories
node_modules
jspm_packages

# Optional npm cache directory
.npm

# Optional REPL history
.node_repl_history

# Distribution
build
dist
lib

# Env
.env

# CSS typings
*.css.d.ts

# Yalc
.yalc
yalc.lock
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
build/*
dist/*
*.css.d.ts
3 changes: 3 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
...require('@consta/widgets-configs/prettier.config.js'),
};
38 changes: 38 additions & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
const getCommonConfig = require('@consta/widgets-configs/config/webpack/common.webpack')
const webpackMerge = require('webpack-merge')
const omit = require('lodash/omit')
const flowRight = require('lodash/flowRight')
const glob = require('fast-glob')

const { withMdxRules, disableCSSModules } = require('../webpack/helpers')

module.exports = {
addons: [
'@storybook/addon-knobs',
'@storybook/addon-actions',
'storybook-addon-react-docgen',
'@storybook/addon-docs/register',
'storybook-addon-themes',
],
stories: async () => {
const isDevelop = process.env.NODE_ENV === 'development'

const paths = await glob(
['src/**/*.stories.tsx', !isDevelop && '!src/core/**/*.stories.tsx', 'docs/**/*.mdx'].filter(
Boolean
)
)

return paths.map(path => `../${path}`)
},
webpackFinal: config => {
// Exclude default module rules to fix svg import issue: https://github.com/storybooks/storybook/issues/5926
const baseSBConfig = omit(config, ['module'])

const projectConfig = flowRight([withMdxRules, disableCSSModules])(
getCommonConfig({ withDocgen: true })
)

return webpackMerge(baseSBConfig, projectConfig)
},
}
67 changes: 67 additions & 0 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import { withKnobs } from '@storybook/addon-knobs'
import { withInfo } from '@storybook/addon-info'
import { addDecorator, addParameters } from '@storybook/react'
import { themes } from '@storybook/theming'
import { withPropsTable } from 'storybook-addon-react-docgen'

import {
DocsDecorator,
environmentDecorator,
listOfThemes,
ThemeDecorator,
} from '@/__private__/storybook'

import stub from './stub.mdx'

import './storybook.css'

addDecorator(withPropsTable)
addDecorator(withKnobs)
addDecorator(environmentDecorator())
addDecorator(
withInfo({
header: false,
})
)

const storySort = (a, b) => {
const orderA = a[1].parameters.order
const orderB = b[1].parameters.order
const idA = a[0]
const idB = b[0]

if (orderA && orderB) {
return orderA - orderB
}
if (orderA) {
return -1
}
if (orderB) {
return 1
}
if (idA < idB) {
return -1
}
if (idA > idB) {
return 1
}
return 0
}

addParameters({
themes: {
list: listOfThemes,
Decorator: ThemeDecorator,
},
docs: {
container: DocsDecorator,
page: stub,
},
options: {
theme: themes.dark,
showRoots: true,
storySort,
},
})

window.document.documentElement.lang = 'ru'
35 changes: 35 additions & 0 deletions .storybook/storybook.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
html {
line-height: 1.15;
-webkit-text-size-adjust: 100%;
}

body {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;

margin: 0;
padding: 0;
}

:global(.sbdocs-wrapper) {
min-height: 100vh;
box-sizing: border-box;
}

/* Стили якорей */
:global {
.sbdocs-h1,
.sbdocs-h2,
.sbdocs-h3,
.sbdocs-h4,
.sbdocs-h5,
.sbdocs-h6 {
& > a {
color: inherit;

& > svg {
fill: currentColor;
}
}
}
}
2 changes: 2 additions & 0 deletions .storybook/stub.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# В разработке
Сожалеем, но данный раздел находится в разработке.
6 changes: 6 additions & 0 deletions .stylelintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*.ts
*.tsx
*.js
*.jsx
*.md
*.mdx
7 changes: 7 additions & 0 deletions .stylelintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
extends: '@consta/widgets-configs/stylelintrc',
rules: {
'selector-class-pattern': '[a-zA-Z0-9_-]+',
'selector-nested-pattern': '[a-zA-Z0-9_-]+',
},
}
Loading

0 comments on commit 1e8c827

Please sign in to comment.