Skip to content

Commit a565603

Browse files
committed
Initial commit
0 parents  commit a565603

31 files changed

+18019
-0
lines changed

.editorconfig

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
indent_size = 4
7+
indent_style = space
8+
insert_final_newline = true
9+
max_line_length = 100
10+
trim_trailing_whitespace = true
11+
12+
[{*.json, *.yaml, *.yml}]
13+
indent_size = 2
14+
15+
[*.md]
16+
max_line_length = 0
17+
trim_trailing_whitespace = false

.eslintrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": ["@gravity-ui/eslint-config", "@gravity-ui/eslint-config/prettier"],
3+
"root": true,
4+
"env": {
5+
"node": true,
6+
"jest": true
7+
}
8+
}

.github/workflows/ci.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
verify_files:
11+
name: Verify Files
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v2
16+
with:
17+
fetch-depth: 0
18+
- name: Setup Node
19+
uses: actions/setup-node@v2
20+
with:
21+
node-version: '14.x'
22+
cache: 'npm'
23+
- name: Install Packages
24+
run: npm ci
25+
- name: Lint Files
26+
run: npm run lint
27+
- name: Typecheck
28+
run: npm run typecheck
29+
30+
tests:
31+
name: Tests
32+
runs-on: ubuntu-latest
33+
steps:
34+
- name: Checkout
35+
uses: actions/checkout@v2
36+
with:
37+
fetch-depth: 0
38+
- name: Setup Node
39+
uses: actions/setup-node@v2
40+
with:
41+
node-version: '14.x'
42+
cache: 'npm'
43+
- name: Install Packages
44+
run: npm ci
45+
- name: Unit Tests
46+
run: npm run test
47+

.github/workflows/main-preview.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Main Preview
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
jobs:
8+
main:
9+
name: Build and Deploy
10+
runs-on: ubuntu-latest
11+
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 }}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: PR Preview Build
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
build:
8+
name: Build
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: gravity-ui/preview-build-action@v1
12+
env:
13+
TS_NODE_PROJECT: .storybook/tsconfig.json
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: PR Preview Deploy
2+
3+
on:
4+
workflow_run:
5+
workflows: ['PR Preview Build']
6+
types:
7+
- completed
8+
9+
jobs:
10+
deploy:
11+
name: Deploy
12+
if: >
13+
github.event.workflow_run.event == 'pull_request' &&
14+
github.event.workflow_run.conclusion == 'success'
15+
runs-on: ubuntu-latest
16+
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 }}

.github/workflows/release.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
jobs:
8+
release:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: gravity-ui/release-action@v1
12+
with:
13+
github-token: ${{ secrets.GRAVITY_UI_BOT_GITHUB_TOKEN }}
14+
npm-token: ${{ secrets.GRAVITY_UI_BOT_NPM_TOKEN }}

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# IDE settings
2+
.idea
3+
.vscode
4+
5+
# Dependencies
6+
node_modules
7+
8+
# Artifacts
9+
dist

.husky/commit-msg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npx commitlint -e

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npx nano-staged

0 commit comments

Comments
 (0)