Skip to content

Commit 41d30e4

Browse files
authored
feat: code migration (#1)
1 parent a565603 commit 41d30e4

File tree

270 files changed

+17459
-4905
lines changed

Some content is hidden

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

270 files changed

+17459
-4905
lines changed

.babelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"presets": ["@babel/preset-typescript", "@babel/preset-env"]
3+
}

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dist
2+
build

.github/workflows/main-preview.yml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,24 @@ jobs:
99
name: Build and Deploy
1010
runs-on: ubuntu-latest
1111
steps:
12-
- name: Checkout
13-
uses: actions/checkout@v2
14-
with:
15-
fetch-depth: 0
16-
- name: Setup Node
17-
uses: actions/setup-node@v2
18-
with:
19-
node-version: 14
20-
- name: Install Packages
21-
run: npm ci
22-
shell: bash
23-
- name: Build Storybook
24-
run: npx build-storybook
25-
shell: bash
26-
- name: Upload to S3
27-
uses: gravity-ui/preview-upload-to-s3-action@v1
28-
with:
29-
src-path: storybook-static
30-
dest-path: /package-example/main/
31-
s3-key-id: ${{ secrets.STORYBOOK_S3_KEY_ID }}
32-
s3-secret-key: ${{ secrets.STORYBOOK_S3_SECRET_KEY }}
12+
- name: Checkout
13+
uses: actions/checkout@v2
14+
with:
15+
fetch-depth: 0
16+
- name: Setup Node
17+
uses: actions/setup-node@v2
18+
with:
19+
node-version: 14
20+
- name: Install Packages
21+
run: npm ci
22+
shell: bash
23+
- name: Build Storybook
24+
run: npx build-storybook
25+
shell: bash
26+
- name: Upload to S3
27+
uses: gravity-ui/preview-upload-to-s3-action@v1
28+
with:
29+
src-path: storybook-static
30+
dest-path: /dynamic-forms/main/
31+
s3-key-id: ${{ secrets.STORYBOOK_S3_KEY_ID }}
32+
s3-secret-key: ${{ secrets.STORYBOOK_S3_SECRET_KEY }}

.github/workflows/pr-preview-deploy.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
workflow_run:
55
workflows: ['PR Preview Build']
66
types:
7-
- completed
7+
- completed
88

99
jobs:
1010
deploy:
@@ -14,9 +14,9 @@ jobs:
1414
github.event.workflow_run.conclusion == 'success'
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: gravity-ui/preview-deploy-action@v1
18-
with:
19-
project: package-example
20-
github-token: ${{ secrets.GRAVITY_UI_BOT_GITHUB_TOKEN }}
21-
s3-key-id: ${{ secrets.STORYBOOK_S3_KEY_ID }}
22-
s3-secret-key: ${{ secrets.STORYBOOK_S3_SECRET_KEY }}
17+
- uses: gravity-ui/preview-deploy-action@v1
18+
with:
19+
project: dynamic-forms
20+
github-token: ${{ secrets.GRAVITY_UI_BOT_GITHUB_TOKEN }}
21+
s3-key-id: ${{ secrets.STORYBOOK_S3_KEY_ID }}
22+
s3-secret-key: ${{ secrets.STORYBOOK_S3_SECRET_KEY }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ node_modules
77

88
# Artifacts
99
dist
10+
build
11+
storybook-static

.storybook/decorators/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './withTheme';

.storybook/decorators/styles.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
html,
2+
body,
3+
#root {
4+
height: 100%;
5+
}
6+
7+
* {
8+
box-sizing: border-box;
9+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import React from 'react';
2+
3+
import type {DecoratorFn} from '@storybook/react';
4+
5+
import {ThemeProvider} from '@gravity-ui/uikit';
6+
7+
import '@gravity-ui/uikit/styles/styles.scss';
8+
import './styles.scss';
9+
10+
export const withTheme: DecoratorFn = (Story, context) => (
11+
<React.StrictMode>
12+
<ThemeProvider theme={context.globals.theme}>
13+
<Story {...context} />
14+
</ThemeProvider>
15+
</React.StrictMode>
16+
);

.storybook/main.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
import type {StorybookConfig} from '@storybook/core-common';
22

3+
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');
4+
35
const config: StorybookConfig = {
4-
stories: ['../src/**/*.stories.@(ts|tsx)'],
5-
addons: [
6-
'@storybook/preset-scss',
7-
{name: '@storybook/addon-essentials', options: {backgrounds: false}},
8-
],
6+
stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
7+
addons: ['@storybook/addon-essentials', '@storybook/preset-scss'],
8+
framework: '@storybook/react',
9+
webpackFinal: async (config) => {
10+
config.plugins?.push(new MonacoWebpackPlugin({languages: ['json']}));
11+
12+
return config;
13+
},
914
};
1015

1116
module.exports = config;

.storybook/preview.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import {withTheme} from './decorators';
2+
3+
export const decorators = [withTheme];
4+
5+
export const parameters = {
6+
actions: {argTypesRegex: '^on[A-Z].*'},
7+
controls: {
8+
matchers: {
9+
color: /(background|color)$/i,
10+
date: /Date$/,
11+
},
12+
},
13+
};

0 commit comments

Comments
 (0)