Skip to content

Commit 7ad5f6c

Browse files
authored
tech: rm styleguide (#9114)
h2. Описание Удаляем устаревший `stylegude/` в пользу `website/`. Теперь `website/` деплоится в gh-pages текущего репозитория вместо https://github.com/VKCOM/vkui.io > [!WARNING] > Перед выпуском v7.10.0, нужно привязать домен vkui.io к этому репозиторию. h2. Изменения 1. Удалил `packages/vkui/src/components/**/Readme.md`. 2. Удалил `styleguide/` и `shared.js`. 3. Поправил джобы в `.github/workflows/` и фильтрацию в `file-filters.yml`. 4. Через `"resolutions"` поднял версию [del](https://www.npmjs.com/package/del), зависимость плагина [clean-wepback-plugin](https://www.npmjs.com/package/clean-webpack-plugin), до [v6.1.1](https://www.npmjs.com/package/del/v/6.1.1) – с этой версии удален устаревший тип [@types/glob](https://www.npmjs.com/package/@types/glob), из-за которого падал `yarn workspace @vkontakte/vkui run lint:generated-files:css-custom-medias` с ошибкой ```sh Error: [css-custom-medias] ../../node_modules/@types/glob/index.d.ts(29,42): error TS2694: Namespace '"/home/runner/work/VKUI/VKUI/node_modules/minimatch/dist/commonjs/index"' has no exported member 'IOptions'. Error: [css-custom-medias] ../../node_modules/@types/glob/index.d.ts(74,30): error TS2724: '"/home/runner/work/VKUI/VKUI/node_modules/minimatch/dist/commonjs/index"' has no exported member named 'IMinimatch'. Did you mean 'Minimatch'? Error: [css-custom-medias] ../../node_modules/minimatch/dist/commonjs/ast.d.ts(4,5): error TS18028: Private identifiers are only available when targeting ECMAScript 2015 and higher. ```
1 parent 8d8368e commit 7ad5f6c

File tree

244 files changed

+171
-22984
lines changed

Some content is hidden

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

244 files changed

+171
-22984
lines changed

.github/file-filters.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,13 @@ package_vkui: &package_vkui
2222
- 'tsconfig.*'
2323
- 'package.json'
2424

25-
docs_styleguide:
26-
- *package_vkui
27-
- 'packages/vkui/src/**/*.md'
28-
- 'styleguide/**'
29-
3025
docs_storybook:
3126
- *package_vkui
3227
- 'packages/vkui/.storybook/**'
3328
- 'packages/vkui/storybook/**'
3429
- 'packages/vkui/src/**/*.stories.*'
3530
- 'packages/vkui/src/**/*.mdx'
31+
- 'packages/vkui/docs/**'
3632
- 'tools/storybook-*/**'
3733

3834
docs_beta:

.github/workflows/deploy_docs_from_branch.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,14 @@ jobs:
2020

2121
- name: Build docs
2222
run: |
23-
yarn docs:beta:build
23+
yarn docs:website:build
2424
yarn workspace @project-docs/website next-sitemap
2525
2626
- name: Publishing docs
2727
uses: JamesIves/github-pages-deploy-action@v4
2828
with:
29-
repository-name: VKCOM/vkui.io
30-
token: ${{ secrets.DOCS_REPO_TOKEN }}
31-
branch: main
29+
token: ${{ secrets.DEVTOOLS_GITHUB_TOKEN }}
30+
branch: gh-pages
3231
folder: website/out
3332
clean: true
3433
clean-exclude: |

.github/workflows/deploy_docs_on_branch_push.yml

Lines changed: 34 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -4,81 +4,53 @@ on:
44
push:
55
branches:
66
- master
7-
paths-ignore:
8-
- '.husky/**'
9-
- '.codesandbox/**'
10-
- '.github/**'
11-
- '!.github/actions/**'
12-
- '.github/actions/**/*.yml'
13-
- '**/*.md'
14-
- '!packages/vkui/src/**/*.md'
15-
- '!styleguide/pages/**/*.md'
16-
- '**/__image_snapshots__/*.png'
7+
paths:
8+
- 'website/**'
9+
- 'packages/vkui/**'
10+
# unit
11+
- '!packages/vkui/**/*.test.*'
12+
- '!packages/vkui/global.vitest.*'
13+
- '!packages/vkui/vitest.*.*'
14+
# e2e
15+
- '!packages/vkui/playwright/**'
16+
- '!packages/vkui/docker-compose.yml'
17+
- '!packages/vkui/playwright-ct.config.*'
18+
- '!packages/vkui/**/__image_snapshots__/*.png'
19+
# eslint
20+
- '!packages/vkui/.eslintrc.*'
21+
- '!packages/vkui/tsconfig.eslint.json'
1722

1823
env:
1924
AWS_S3_URL: https://${{ vars.AWS_BUCKET }}.${{ vars.AWS_ENDPOINT }}
2025

2126
concurrency:
22-
group: deploy-docs-${{ github.ref_name }}
27+
group: deploy-next-version-docs-${{ github.ref_name }}
2328
cancel-in-progress: true
2429

2530
jobs:
26-
changed_files:
31+
cleanup:
32+
if: ${{ !cancelled() }}
2733
runs-on: ubuntu-latest
28-
name: Detect what files changed
29-
outputs:
30-
docs_styleguide: ${{ steps.changes.outputs.docs_styleguide }}
31-
docs_storybook: ${{ steps.changes.outputs.docs_storybook }}
32-
docs_beta: ${{ steps.changes.outputs.docs_beta }}
33-
34-
steps:
35-
- name: Checkout
36-
uses: actions/checkout@v5
37-
38-
- name: Find changes
39-
uses: dorny/paths-filter@v3
40-
id: changes
41-
with:
42-
token: ${{ secrets.GITHUB_TOKEN }}
43-
filters: .github/file-filters.yml
44-
45-
build_and_deploy_styleguide:
46-
if: ${{ !cancelled() && needs.changed_files.outputs.docs_styleguide == 'true' }}
47-
runs-on: ubuntu-latest
48-
name: Deploy docs (styleguide)
49-
needs: changed_files
34+
name: Cleanup
5035
steps:
5136
- name: Checkout
5237
uses: actions/checkout@v5
5338

54-
- name: Node setup
55-
uses: ./.github/actions/node-setup
56-
57-
- name: Build
58-
run: yarn docs:styleguide:build
59-
60-
- name: Upload to S3
61-
id: deploy
39+
- name: Delete old artifacts for the next documentation version
6240
uses: VKCOM/gh-actions/VKUI/s3@main
6341
with:
6442
awsAccessKeyId: ${{ secrets.AWS_ACCESS_KEY_ID }}
6543
awsSecretAccessKey: ${{ secrets.AWS_SECRET_KEY }}
6644
awsBucket: ${{ vars.AWS_BUCKET }}
6745
awsEndpoint: https://${{ vars.AWS_ENDPOINT }}
68-
command: upload
69-
commandUploadSrc: styleguide/dist
70-
commandUploadDist: next/styleguide
71-
72-
- name: Create doc url
73-
if: ${{ steps.deploy.outcome == 'success' }}
74-
id: url
75-
run: echo "${{ env.AWS_S3_URL }}/next/styleguide/index.html"
46+
command: delete
47+
commandDeletePrefix: next/
7648

7749
build_and_deploy_storybook:
78-
if: ${{ !cancelled() && needs.changed_files.outputs.docs_storybook == 'true' }}
50+
if: ${{ !cancelled() }}
7951
runs-on: ubuntu-latest
8052
name: Deploy docs (storybook)
81-
needs: changed_files
53+
needs: cleanup
8254
steps:
8355
- name: Checkout
8456
uses: actions/checkout@v5
@@ -99,18 +71,18 @@ jobs:
9971
awsEndpoint: https://${{ vars.AWS_ENDPOINT }}
10072
command: upload
10173
commandUploadSrc: packages/vkui/storybook-static
102-
commandUploadDist: next/storybook
74+
commandUploadDist: next/playground
10375

10476
- name: Create doc url
10577
if: ${{ steps.deploy.outcome == 'success' }}
10678
id: url
107-
run: echo "${{ env.AWS_S3_URL }}/next/storybook/index.html"
79+
run: echo "${{ env.AWS_S3_URL }}/next/playground/index.html"
10880

109-
build_and_deploy_docs_beta:
110-
if: ${{ !cancelled() && needs.changed_files.outputs.docs_beta == 'true' }}
81+
build_and_deploy_docs_website:
82+
if: ${{ !cancelled() }}
11183
runs-on: ubuntu-latest
112-
name: Deploy docs (beta)
113-
needs: changed_files
84+
name: Deploy docs
85+
needs: cleanup
11486
steps:
11587
- name: Checkout
11688
uses: actions/checkout@v5
@@ -122,9 +94,9 @@ jobs:
12294
run: yarn build:vkui
12395

12496
- name: Build
125-
run: yarn docs:beta:build
97+
run: yarn docs:website:build
12698
env:
127-
NEXT_PUBLIC_VKUI_DOCS_BASE_PATH: /next/docs-beta
99+
NEXT_PUBLIC_VKUI_DOCS_BASE_PATH: /next
128100

129101
- name: Upload to S3
130102
id: deploy
@@ -136,9 +108,9 @@ jobs:
136108
awsEndpoint: https://${{ vars.AWS_ENDPOINT }}
137109
command: upload
138110
commandUploadSrc: website/out
139-
commandUploadDist: next/docs-beta
111+
commandUploadDist: next
140112

141113
- name: Create doc url
142114
if: ${{ steps.deploy.outcome == 'success' }}
143115
id: url
144-
run: echo "${{ env.AWS_S3_URL }}/next/docs-beta/overview/about/index.html"
116+
run: echo "${{ env.AWS_S3_URL }}/next/overview/about/index.html"

.github/workflows/publish_deploy.yml

Lines changed: 9 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -70,37 +70,25 @@ jobs:
7070
- name: Setting up the repository environment
7171
uses: ./.github/actions/setup
7272

73-
- name: Creating docs for pre-release
74-
if: ${{ fromJSON(needs.payload.outputs.is_for_prerelease) == true }}
75-
run: |
76-
yarn run docs:styleguide:build --dist dist/${{ needs.payload.outputs.next_version }}
77-
yarn run docs:storybook:build -o ../../styleguide/dist/${{ needs.payload.outputs.next_version }}/playground
78-
79-
- name: Creating docs for release
80-
if: ${{ fromJSON(needs.payload.outputs.is_for_prerelease) != true }}
81-
run: |
82-
yarn run docs:styleguide:build --dist dist
83-
yarn run docs:storybook:build -o ../../styleguide/dist/playground
84-
mkdir -p styleguide/${{ needs.payload.outputs.next_version }}
85-
cp -R styleguide/dist/* styleguide/${{ needs.payload.outputs.next_version }}
86-
mv styleguide/${{ needs.payload.outputs.next_version }} styleguide/dist
87-
8873
- name: Build vkui package
8974
run: yarn run build:vkui
9075

91-
- name: Creating beta docs for release (default basePath)
76+
- name: Build storybook
77+
run: yarn docs:storybook:build -o ../../website/tmp/playground
78+
79+
- name: Creating docs for release (default basePath)
9280
if: ${{ fromJSON(needs.payload.outputs.is_for_prerelease) != true }}
9381
run: |
94-
yarn run docs:beta:build
82+
yarn run docs:website:build
9583
yarn workspace @project-docs/website run next-sitemap
9684
mkdir -p website/out/playground
97-
cp -R styleguide/dist/${{ needs.payload.outputs.next_version }}/playground/* website/out/playground/
85+
cp -R website/tmp/playground/* website/out/playground/
9886
99-
- name: Creating beta docs for pre-release OR release (version basePath)
87+
- name: Creating docs for pre-release OR release (version basePath)
10088
run: |
101-
yarn run docs:beta:build
89+
yarn run docs:website:build
10290
mkdir -p website/out/${{ needs.payload.outputs.next_version }}/playground
103-
cp -R styleguide/dist/${{ needs.payload.outputs.next_version }}/playground/* website/out/${{ needs.payload.outputs.next_version }}/playground/
91+
cp -R website/tmp/playground/* website/out/${{ needs.payload.outputs.next_version }}/playground/
10492
env:
10593
NEXT_PUBLIC_VKUI_DOCS_BASE_PATH: /${{ needs.payload.outputs.next_version }}
10694
NEXT_PUBLIC_VKUI_DOCS_DIST_DIR: out/${{ needs.payload.outputs.next_version }}
@@ -110,16 +98,6 @@ jobs:
11098
with:
11199
token: ${{ secrets.DEVTOOLS_GITHUB_TOKEN }}
112100
branch: gh-pages
113-
folder: styleguide/dist
114-
clean: false
115-
force: false
116-
117-
- name: Publishing beta doc
118-
uses: JamesIves/github-pages-deploy-action@v4
119-
with:
120-
repository-name: VKCOM/vkui.io
121-
token: ${{ secrets.DOCS_REPO_TOKEN }}
122-
branch: main
123101
folder: website/out
124102
clean: false
125103
force: false

.github/workflows/pull_request_packages.yml

Lines changed: 8 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,10 @@ on:
55
types: [opened, synchronize, reopened, ready_for_review]
66
paths-ignore:
77
- '.husky/**'
8-
- '.codesandbox/**'
98
- '.github/**'
109
- '!.github/actions/**'
1110
- '.github/actions/**/*.yml'
1211
- '**/*.md'
13-
- '!packages/vkui/src/**/*.md'
14-
- '!styleguide/pages/**/*.md'
1512
- '**/__image_snapshots__/*.png'
1613

1714
concurrency:
@@ -24,9 +21,8 @@ jobs:
2421
name: Detect what files changed
2522
outputs:
2623
package_vkui: ${{ steps.changes.outputs.package_vkui }}
27-
docs_styleguide: ${{ steps.changes.outputs.docs_styleguide }}
2824
docs_storybook: ${{ steps.changes.outputs.docs_storybook }}
29-
docs_beta: ${{ steps.changes.outputs.docs_beta }}
25+
docs_website: ${{ steps.changes.outputs.docs_website }}
3026
dependencies: ${{ steps.changes.outputs.dependencies }}
3127
steps:
3228
- name: Checkout
@@ -237,27 +233,6 @@ jobs:
237233
name: diff-report
238234
path: diff/
239235

240-
docs_styleguide_upload:
241-
if: ${{ needs.changed_files.outputs.docs_styleguide == 'true' }}
242-
needs: changed_files
243-
runs-on: ubuntu-latest
244-
name: Upload docs dist artifact (styleguide)
245-
steps:
246-
- name: Checkout
247-
uses: actions/checkout@v5
248-
249-
- name: Node setup
250-
uses: ./.github/actions/node-setup
251-
252-
- name: Build
253-
run: yarn run docs:styleguide:build
254-
255-
- name: Upload dist
256-
uses: actions/upload-artifact@v4
257-
with:
258-
name: styleguide-dist
259-
path: styleguide/dist
260-
261236
docs_storybook_upload:
262237
if: ${{ needs.changed_files.outputs.docs_storybook == 'true' }}
263238
needs: changed_files
@@ -279,11 +254,11 @@ jobs:
279254
name: storybook-dist
280255
path: packages/vkui/storybook-static
281256

282-
docs_beta_upload:
283-
if: ${{ needs.changed_files.outputs.docs_beta == 'true' }}
257+
docs_website_upload:
258+
if: ${{ needs.changed_files.outputs.docs_website == 'true' }}
284259
needs: changed_files
285260
runs-on: ubuntu-latest
286-
name: Upload docs dist artifact (beta)
261+
name: Upload docs dist artifact
287262
steps:
288263
- name: Checkout
289264
uses: actions/checkout@v5
@@ -295,19 +270,19 @@ jobs:
295270
run: yarn build:vkui
296271

297272
- name: Build
298-
run: yarn docs:beta:build
273+
run: yarn docs:website:build
299274
env:
300-
NEXT_PUBLIC_VKUI_DOCS_BASE_PATH: /pull/${{ github.event.pull_request.number }}/${{ github.event.pull_request.head.sha }}/docs-beta
275+
NEXT_PUBLIC_VKUI_DOCS_BASE_PATH: /pull/${{ github.event.pull_request.number }}/${{ github.event.pull_request.head.sha }}
301276

302277
- name: Upload dist
303278
uses: actions/upload-artifact@v4
304279
with:
305-
name: docs-beta-dist
280+
name: docs-website-dist
306281
path: website/out
307282

308283
upload_pr_workflow_payload:
309284
# Дожидаемся выгрузки артефактов, на случай если вокрфлоу будет отменён или перезапушен
310-
needs: [test, test_e2e_prepare_and_upload_report, docs_styleguide_upload, docs_storybook_upload]
285+
needs: [test, test_e2e_prepare_and_upload_report, docs_storybook_upload]
311286
# Не используем always(), т.к. он не учитывает отмену воркфлоу
312287
# см. https://github.com/orgs/community/discussions/26303
313288
if: ${{ !cancelled() }}

0 commit comments

Comments
 (0)