Skip to content

Commit 01e021f

Browse files
authored
feat!: update to uikit@5, node@18, storybook@7; remove assets (#116)
* feat!: update to uikit@5, node@18, storybook@7; remove assets * chore(build): fix preview build
1 parent 1d87e38 commit 01e021f

File tree

30 files changed

+18893
-16566
lines changed

30 files changed

+18893
-16566
lines changed

.babelrc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"sourceType": "unambiguous",
3+
"presets": [
4+
[
5+
"@babel/preset-env",
6+
{
7+
"targets": {
8+
"chrome": 100
9+
}
10+
}
11+
],
12+
"@babel/preset-typescript",
13+
"@babel/preset-react"
14+
],
15+
"plugins": []
16+
}

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Setup Node
1919
uses: actions/setup-node@v2
2020
with:
21-
node-version: '14.x'
21+
node-version: '18.x'
2222
cache: 'npm'
2323
- name: Install Packages
2424
run: npm ci

.github/workflows/main-preview.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Setup Node
1717
uses: actions/setup-node@v2
1818
with:
19-
node-version: 14
19+
node-version: 18
2020
- name: Install Packages
2121
run: npm ci
2222
shell: bash

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

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,32 @@ jobs:
88
name: Build
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: yandex-cloud/ui-preview-build-action@main
12-
env:
13-
TS_NODE_PROJECT: .storybook/tsconfig.json
11+
- name: Checkout
12+
uses: actions/checkout@v2
13+
with:
14+
fetch-depth: 0
15+
- name: Setup Node
16+
uses: actions/setup-node@v2
17+
with:
18+
node-version: 18
19+
- name: Install Packages
20+
run: npm ci
21+
shell: bash
22+
- name: Build Storybook
23+
run: npm run storybook:build
24+
shell: bash
25+
- name: Create Static Artifact
26+
uses: actions/upload-artifact@v2
27+
with:
28+
name: static
29+
path: ./storybook-static
30+
- name: Save PR ID
31+
run: |
32+
pr="${{ github.event.pull_request.number }}"
33+
echo $pr > ./pr-id.txt
34+
shell: bash
35+
- name: Create PR Artifact
36+
uses: actions/upload-artifact@v2
37+
with:
38+
name: pr
39+
path: ./pr-id.txt

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ jobs:
1212
with:
1313
github-token: ${{ secrets.YC_UI_BOT_GITHUB_TOKEN }}
1414
npm-token: ${{ secrets.YC_UI_BOT_NPM_TOKEN }}
15-
node-version: 14
15+
node-version: 18

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
14.20
1+
18

.storybook/main.js

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

.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/react-webpack5';
2+
3+
const config:StorybookConfig = {
4+
framework: {
5+
name: '@storybook/react-webpack5',
6+
options: {fastRefresh: true},
7+
},
8+
stories: ['../demo/**/*.stories.@(js|jsx|ts|tsx)'],
9+
addons: [
10+
'@storybook/preset-scss',
11+
{name: '@storybook/addon-essentials', options: {backgrounds: false}},
12+
],
13+
typescript: {
14+
check: true,
15+
},
16+
};
17+
18+
export default config;

.storybook/preview.js

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

.storybook/preview.ts

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import type {Preview} from '@storybook/react';
2+
import {MINIMAL_VIEWPORTS} from '@storybook/addon-viewport';
3+
4+
import {withThemeProvider, withLang, backgrounds} from '../demo/utils/preview';
5+
6+
const preview: Preview = {
7+
decorators: [withThemeProvider, withLang],
8+
parameters: {
9+
jsx: {showFunctions: true}, // To show functions in sources
10+
viewport: {
11+
viewports: MINIMAL_VIEWPORTS,
12+
},
13+
},
14+
globalTypes: {
15+
theme: {
16+
defaultValue: 'light',
17+
toolbar: {
18+
title: 'Theme',
19+
icon: 'mirror',
20+
items: [
21+
{value: 'light', right: '☼', title: 'Light'},
22+
{value: 'dark', right: '☾', title: 'Dark'},
23+
{value: 'light-hc', right: '☼', title: 'High Contrast Light (beta)'},
24+
{value: 'dark-hc', right: '☾', title: 'High Contrast Dark (beta)'},
25+
],
26+
},
27+
},
28+
lang: {
29+
defaultValue: 'en',
30+
toolbar: {
31+
title: 'Language',
32+
icon: 'globe',
33+
items: [
34+
{value: 'en', right: '🇬🇧', title: 'En'},
35+
{value: 'ru', right: '🇷🇺', title: 'Ru'},
36+
],
37+
},
38+
},
39+
},
40+
};
41+
42+
export default preview;

0 commit comments

Comments
 (0)