Skip to content

Commit c7f6ac9

Browse files
authored
build: set up monorepo with pnpm workspace and nx (#914)
1 parent c172859 commit c7f6ac9

1,480 files changed

Lines changed: 1941 additions & 991 deletions

File tree

Some content is hidden

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

.github/workflows/branch-preview.yaml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,15 @@ jobs:
2222
cache: pnpm
2323

2424
- name: Install dependencies
25-
run: pnpm run deps:ci
26-
27-
- name: Install Storybook CLI
28-
run: pnpm i @storybook/cli@8.4.1
25+
run: pnpm run ci:deps
2926

3027
- name: Build Storybook
31-
run: pnpm run sb:build
28+
run: pnpm run ci:demo:build
3229

3330
- name: Upload to S3
3431
uses: gravity-ui/preview-upload-to-s3-action@v1
3532
with:
36-
src-path: storybook-static
33+
src-path: demo/storybook-static
3734
dest-path: /md-editor/branches/${{ github.ref_name }}/
3835
s3-key-id: ${{ secrets.STORYBOOK_S3_KEY_ID }}
3936
s3-secret-key: ${{ secrets.STORYBOOK_S3_SECRET_KEY }}

.github/workflows/ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
cache: pnpm
2424

2525
- name: Install dependencies
26-
run: pnpm run deps:ci
26+
run: pnpm run ci:deps
2727

2828
- name: Lint Files
2929
run: pnpm run lint
@@ -48,13 +48,13 @@ jobs:
4848
cache: pnpm
4949

5050
- name: Install dependencies
51-
run: pnpm run deps:ci
51+
run: pnpm run ci:deps
5252

5353
- name: Unit Tests
54-
run: pnpm run test
54+
run: pnpm ci:test:unit
5555

5656
- name: ESBuild compatability
57-
run: pnpm run test:esbuild
57+
run: pnpm ci:test:esbuild
5858

5959
check_circular_deps:
6060
name: Check Circular Dependencies
@@ -73,7 +73,7 @@ jobs:
7373
cache: pnpm
7474

7575
- name: Install dependencies
76-
run: pnpm run deps:ci
76+
run: pnpm run ci:deps
7777

7878
- name: Check circular dependencies
79-
run: pnpm run check-circular-deps
79+
run: pnpm ci:test:circular-deps

.github/workflows/main-preview.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,15 @@ jobs:
2222
cache: pnpm
2323

2424
- name: Install dependencies
25-
run: pnpm run deps:ci
26-
27-
- name: Install Storybook CLI
28-
run: pnpm i @storybook/cli@8.4.1
25+
run: pnpm run ci:deps
2926

3027
- name: Build Storybook
31-
run: pnpm run sb:build
28+
run: pnpm run ci:demo:build
3229

3330
- name: Upload to S3
3431
uses: gravity-ui/preview-upload-to-s3-action@v1
3532
with:
36-
src-path: storybook-static
33+
src-path: demo/storybook-static
3734
dest-path: /md-editor/main/
3835
s3-key-id: ${{ secrets.STORYBOOK_S3_KEY_ID }}
3936
s3-secret-key: ${{ secrets.STORYBOOK_S3_SECRET_KEY }}

.github/workflows/pr-preview.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,15 @@ jobs:
2121
cache: pnpm
2222

2323
- name: Install dependencies
24-
run: pnpm run deps:ci
25-
26-
- name: Install Storybook CLI
27-
run: pnpm i @storybook/cli@8.4.1
24+
run: pnpm run ci:deps
2825

2926
- name: Build Storybook
30-
run: pnpm run sb:build
27+
run: pnpm run ci:demo:build
3128

3229
- name: Upload to S3
3330
uses: gravity-ui/preview-upload-to-s3-action@v1
3431
with:
35-
src-path: storybook-static
32+
src-path: demo/storybook-static
3633
dest-path: /md-editor/pulls/${{ github.event.pull_request.number }}/
3734
s3-key-id: ${{ secrets.STORYBOOK_S3_KEY_ID }}
3835
s3-secret-key: ${{ secrets.STORYBOOK_S3_SECRET_KEY }}

.github/workflows/pr-title-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
cache: pnpm
3131

3232
- name: Install dependencies
33-
run: pnpm run deps:ci
33+
run: pnpm run ci:deps
3434

3535
- name: Run Commitlint
3636
run: echo '${{github.event.pull_request.title}}' | pnpm commitlint

.github/workflows/pr-visual-tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ jobs:
2323
cache: pnpm
2424

2525
- name: Install dependencies
26-
run: pnpm run deps:ci
26+
run: pnpm run ci:deps
2727

2828
- name: Run Visual Tests
29-
run: pnpm run playwright
29+
run: pnpm run ci:test:visual
3030
env:
3131
CI: 'true'
3232

@@ -35,7 +35,7 @@ jobs:
3535
uses: actions/upload-artifact@v4
3636
with:
3737
name: playwright-report
38-
path: ./playwright-report
38+
path: ./demo/playwright-report
3939
retention-days: 1
4040

4141
- name: Save PR ID

.github/workflows/publish.yml

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ on:
77
# Manually trigger the publish workflow
88
workflow_dispatch:
99
inputs:
10-
version:
11-
description: 'Override version to publish'
12-
required: false
13-
type: string
14-
default: ''
10+
package:
11+
description: 'Package to publish'
12+
required: true
13+
type: choice
14+
default: 'packages/editor'
15+
options:
16+
- 'packages/editor'
1517
tag:
1618
description: 'Publish with tag'
1719
required: true
@@ -49,22 +51,17 @@ jobs:
4951
cache: pnpm
5052

5153
- name: Install dependencies
52-
run: pnpm run deps:ci
54+
run: pnpm run ci:deps
5355

5456
- name: Configure npm authentication
5557
shell: bash
5658
run: echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" > ~/.npmrc
5759
env:
5860
NODE_AUTH_TOKEN: ${{ secrets.GRAVITY_UI_BOT_NPM_TOKEN }}
5961

60-
- name: Set package version
61-
if: ${{ github.event.inputs.version != '' }}
62-
shell: bash
63-
run: pnpm pkg set version="${{ github.event.inputs.version }}"
64-
6562
- name: Publish package
6663
shell: bash
67-
run: pnpm publish --tag ${{ github.event.inputs.tag }} --access public --report-summary --no-git-checks --dry-run ${{ github.event.inputs.dry_run }}
64+
run: pnpm publish ${{ github.event.inputs.package }} --tag ${{ github.event.inputs.tag }} --access public --report-summary --no-git-checks --dry-run ${{ github.event.inputs.dry_run }}
6865
env:
6966
NODE_AUTH_TOKEN: ${{ secrets.GRAVITY_UI_BOT_NPM_TOKEN }}
7067
NPM_CONFIG_PROVENANCE: true

.github/workflows/release.yml

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,32 +23,21 @@ jobs:
2323
cache: pnpm
2424

2525
- name: Install dependencies
26-
run: pnpm run deps:ci
26+
run: pnpm run ci:deps
2727

2828
- name: Run tests
2929
shell: bash
3030
run: pnpm test
3131

32-
- name: Get package info
33-
uses: codex-team/action-nodejs-package-info@v1.1
34-
id: package
35-
3632
- name: Release please
37-
uses: google-github-actions/release-please-action@v3
33+
uses: google-github-actions/release-please-action@v4
3834
id: release
3935
with:
4036
token: ${{ secrets.GRAVITY_UI_BOT_GITHUB_TOKEN }}
41-
release-type: node
42-
package-name: ${{ steps.package.outputs.name }}
43-
bump-minor-pre-major: true
44-
default-branch: ${{ github.ref_name != 'main' && github.ref_name || null }}
45-
changelog-types: >
46-
[{"type":"feat","section":"Features","hidden":false},
47-
{"type":"fix","section":"Bug Fixes","hidden":false},
48-
{"type":"refactor","section":"Refactoring","hidden":false},
49-
{"type":"perf","section":"Performance Improvements","hidden":false}]
37+
config-file: .release-please/config.json
38+
manifest-file: .release-please/manifest.json
5039

5140
- name: Publish version
52-
if: steps.release.outputs.release_created == 'true'
41+
if: steps.release.outputs.releases_created == 'true'
5342
shell: bash
5443
run: echo "Please run publish workflow manually"

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,13 @@ build/
2222
coverage/
2323
storybook-static/
2424
.eslintcache
25-
demo/docs
25+
demo/src/docs
26+
debug-storybook.log
2627

2728
# tests
2829
playwright-report*
2930
test-results/
3031

32+
# nx
33+
.nx/cache
34+
.nx/workspace-data

.release-please/config.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
3+
"release-type": "node",
4+
"bump-minor-pre-major": true,
5+
"bump-patch-for-minor-pre-major": true,
6+
"separate-pull-requests": true,
7+
"changelog-sections": [
8+
{"type": "feat", "section": "Features", "hidden": false},
9+
{"type": "fix", "section": "Bug Fixes", "hidden": false},
10+
{"type": "refactor", "section": "Refactoring", "hidden": false},
11+
{"type": "perf", "section": "Performance Improvements", "hidden": false}
12+
],
13+
"packages": {
14+
".": {}
15+
}
16+
}

0 commit comments

Comments
 (0)