generated from gravity-ui/package-example
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 8a8ac7c
Showing
144 changed files
with
31,093 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"sourceType": "unambiguous", | ||
"presets": [ | ||
[ | ||
"@babel/preset-env", | ||
{ | ||
"targets": { | ||
"chrome": 100 | ||
} | ||
} | ||
], | ||
"@babel/preset-typescript", | ||
"@babel/preset-react" | ||
], | ||
"plugins": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
indent_size = 4 | ||
indent_style = space | ||
insert_final_newline = true | ||
max_line_length = 100 | ||
trim_trailing_whitespace = true | ||
|
||
[{*.json, *.yaml, *.yml}] | ||
indent_size = 2 | ||
|
||
[*.md] | ||
max_line_length = 0 | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
storybook-static | ||
build | ||
!/.storybook |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
{ | ||
"extends": [ | ||
"@gravity-ui/eslint-config", | ||
"@gravity-ui/eslint-config/client", | ||
"@gravity-ui/eslint-config/prettier", | ||
"@gravity-ui/eslint-config/import-order", | ||
"@gravity-ui/eslint-config/a11y" | ||
], | ||
"root": true, | ||
"rules": { | ||
"@typescript-eslint/consistent-type-imports": [ | ||
"warn", | ||
{ | ||
"prefer": "type-imports", | ||
"disallowTypeAnnotations": false | ||
} | ||
], | ||
"@typescript-eslint/no-non-null-assertion": "warn", | ||
"@typescript-eslint/no-shadow": "warn", | ||
"import/consistent-type-specifier-style": [ | ||
"error", | ||
"prefer-top-level" | ||
], | ||
"import/no-extraneous-dependencies": "off", | ||
"jsx-a11y/no-autofocus": "off", | ||
"no-param-reassign": "warn", | ||
"no-restricted-syntax": [ | ||
"error", | ||
{ | ||
"selector": "ImportDeclaration[source.value='react'] :matches(ImportNamespaceSpecifier, ImportSpecifier)", | ||
"message": "Please use import React from 'react' instead." | ||
}, | ||
{ | ||
"selector": "TSTypeReference>TSQualifiedName[left.name='React'][right.name='FC']", | ||
"message": "Don't use React.FC" | ||
} | ||
], | ||
"react/jsx-fragments": [ | ||
"error", | ||
"element" | ||
], | ||
"valid-jsdoc": "warn" | ||
}, | ||
"overrides": [ | ||
{ | ||
"files": [ | ||
"**/__tests__/**/*.[jt]s?(x)", | ||
"**/?(*.)+(spec|test).[jt]s?(x)" | ||
], | ||
"env": { | ||
"node": true, | ||
"jest": true | ||
}, | ||
"extends": [ | ||
"plugin:testing-library/react" | ||
], | ||
"rules": { | ||
"jsx-a11y/no-static-element-interactions": 0 | ||
} | ||
}, | ||
{ | ||
"files": [ | ||
"**/__stories__/**/*.[jt]s?(x)" | ||
], | ||
"rules": { | ||
"no-console": "off" | ||
} | ||
}, | ||
{ | ||
"files": [ | ||
"**/*.js", | ||
"!src/**/*" | ||
], | ||
"env": { | ||
"node": true | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
verify_files: | ||
name: Verify Files | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: npm | ||
- name: Install Packages | ||
run: npm ci | ||
- name: Lint Files | ||
run: npm run lint | ||
- name: Typecheck | ||
run: npm run typecheck | ||
|
||
tests: | ||
name: Tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: npm | ||
- name: Install Packages | ||
run: npm ci | ||
- name: Unit Tests | ||
run: npm run test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Main Preview | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
main: | ||
name: Build and Deploy | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
- name: Install Packages | ||
run: npm ci | ||
shell: bash | ||
- name: Build Storybook | ||
run: npm run build-storybook | ||
shell: bash | ||
- name: Upload to S3 | ||
uses: gravity-ui/preview-upload-to-s3-action@v1 | ||
with: | ||
src-path: storybook-static | ||
dest-path: /table/main/ | ||
s3-key-id: ${{ secrets.STORYBOOK_S3_KEY_ID }} | ||
s3-secret-key: ${{ secrets.STORYBOOK_S3_SECRET_KEY }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: PR Preview Build | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: gravity-ui/preview-build-action@v1 | ||
with: | ||
node-version: 18 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: PR Preview Deploy | ||
|
||
on: | ||
workflow_run: | ||
workflows: ['PR Preview Build'] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
deploy: | ||
name: Deploy | ||
if: > | ||
github.event.workflow_run.event == 'pull_request' && | ||
github.event.workflow_run.conclusion == 'success' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: gravity-ui/preview-deploy-action@v1 | ||
with: | ||
project: table | ||
github-token: ${{ secrets.GRAVITY_UI_BOT_GITHUB_TOKEN }} | ||
s3-key-id: ${{ secrets.STORYBOOK_S3_KEY_ID }} | ||
s3-secret-key: ${{ secrets.STORYBOOK_S3_SECRET_KEY }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: gravity-ui/release-action@v1 | ||
with: | ||
github-token: ${{ secrets.GRAVITY_UI_BOT_GITHUB_TOKEN }} | ||
npm-token: ${{ secrets.GRAVITY_UI_BOT_NPM_TOKEN }} | ||
node-version: 18 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# IDE settings | ||
.idea | ||
.vscode | ||
|
||
# Dependencies | ||
node_modules | ||
|
||
# Artifacts | ||
build | ||
storybook-static |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
npx commitlint -e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
npx nano-staged |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
registry=https://registry.npmjs.org |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
18 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
storybook-static | ||
build | ||
CHANGELOG.md | ||
CONTRIBUTING.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = require('@gravity-ui/prettier-config'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import React from 'react'; | ||
|
||
import {configure} from '@gravity-ui/uikit'; | ||
import type {Decorator} from '@storybook/react'; | ||
|
||
export const withLang: Decorator = (Story, context) => { | ||
const lang = context.globals.lang; | ||
|
||
configure({lang}); | ||
|
||
return <Story key={lang} {...context} />; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import React from 'react'; | ||
|
||
import {MobileProvider} from '@gravity-ui/uikit'; | ||
import type {Decorator} from '@storybook/react'; | ||
|
||
export const withMobile: Decorator = (Story, context) => { | ||
const platform = context.globals.platform; | ||
|
||
return ( | ||
<MobileProvider mobile={platform === 'mobile'} platform={platform}> | ||
<Story key={platform} {...context} /> | ||
</MobileProvider> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import React from 'react'; | ||
|
||
import type {Decorator} from '@storybook/react'; | ||
|
||
export const withStrictMode: Decorator = (Story, context) => { | ||
const children = <Story {...context} />; | ||
|
||
if (context.parameters?.disableStrictMode) { | ||
return children; | ||
} | ||
|
||
return <React.StrictMode>{children}</React.StrictMode>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import React from 'react'; | ||
|
||
import {ThemeProvider} from '@gravity-ui/uikit'; | ||
import type {Decorator} from '@storybook/react'; | ||
|
||
export const withTheme: Decorator = (Story, context) => { | ||
return ( | ||
<ThemeProvider theme={context.globals.theme} direction={context.globals.direction}> | ||
<Story {...context} /> | ||
</ThemeProvider> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import type {StorybookConfig} from '@storybook/react-webpack5'; | ||
|
||
const config: StorybookConfig = { | ||
addons: [ | ||
'@storybook/preset-scss', | ||
{ | ||
name: '@storybook/addon-essentials', | ||
options: { | ||
backgrounds: false, | ||
}, | ||
}, | ||
'./theme-addon/register.tsx', | ||
'@storybook/addon-webpack5-compiler-babel', | ||
], | ||
framework: '@storybook/react-webpack5', | ||
stories: ['../src/**/*.stories.@(ts|tsx)'], | ||
typescript: { | ||
reactDocgen: 'react-docgen-typescript', | ||
}, | ||
}; | ||
|
||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import {addons} from '@storybook/manager-api'; | ||
|
||
import {themes} from './theme'; | ||
|
||
addons.setConfig({ | ||
theme: themes.light, | ||
}); |
Oops, something went wrong.