Skip to content

Commit b92b389

Browse files
committed
Merge branch 'main' into alpha
2 parents 5d71142 + f3945b9 commit b92b389

34 files changed

+582
-433
lines changed

.circleci/config.yml

Lines changed: 56 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
version: 2.1
22

33
orbs:
4-
codecov: codecov/codecov@1.2.0
4+
node: circleci/node@5.1.0
5+
codecov: codecov/codecov@3.3.0
56

67
references:
78
workspace_root: &workspace_root
@@ -10,74 +11,98 @@ references:
1011
attach_workspace: &attach_workspace
1112
attach_workspace:
1213
at: *workspace_root
14+
15+
build_cache_paths: &build_cache_paths
16+
paths:
17+
- node_modules/.cache/turbo
1318

14-
defaults: &defaults
15-
resource_class: xlarge
16-
working_directory: *workspace_root
19+
lint_cache_paths: &lint_cache_paths
20+
paths:
21+
- packages/bezier-react/.stylelintcache
22+
- packages/bezier-react/.eslintcache
23+
- packages/bezier-icons/.eslintcache
24+
- packages/bezier-figma-plugin/.eslintcache
25+
- packages/bezier-codemod/.eslintcache
1726

18-
docker:
19-
- image: node:18.17.1
27+
test_cache_paths: &test_cache_paths
28+
paths:
29+
- packages/bezier-react/.jestcache
30+
- packages/bezier-icons/.jestcache
31+
- packages/bezier-figma-plugin/.jestcache
32+
- packages/bezier-codemod/.jestcache
2033

21-
filter_only_tagged: &filter_only_tagged
22-
filters:
23-
tags:
24-
only: /^v.*/
25-
branches:
26-
ignore: /.*/
34+
executors:
35+
node_executor:
36+
docker:
37+
- image: node:18.17.1
38+
resource_class: xlarge
39+
working_directory: *workspace_root
2740

2841
jobs:
2942
install:
30-
<<: *defaults
43+
executor: node_executor
3144
steps:
3245
- checkout
33-
- restore_cache:
34-
keys:
35-
- bezier-react-dependencies-{{ checksum "yarn.lock" }}
36-
- run: yarn install
37-
- save_cache:
38-
paths:
39-
- .yarn/cache
40-
- .yarn/unplugged
41-
key: bezier-react-dependencies-{{ checksum "yarn.lock" }}
46+
- node/install-packages:
47+
pkg-manager: yarn
4248
- persist_to_workspace:
4349
root: *workspace_root
4450
paths:
4551
- .
4652

4753
build:
48-
<<: *defaults
54+
executor: node_executor
4955
steps:
5056
- *attach_workspace
51-
- run: yarn build --filter=bezier-icons
57+
- restore_cache:
58+
keys:
59+
- build-{{ .Environment.CACHE_VERSION }}-{{ .Branch }}-
60+
- build-{{ .Environment.CACHE_VERSION }}-
61+
- run: yarn build
62+
- save_cache:
63+
key: build-{{ .Environment.CACHE_VERSION }}-{{ .Branch }}-{{ epoch }}
64+
<<: *build_cache_paths
5265
- persist_to_workspace:
5366
root: *workspace_root
5467
paths:
5568
- .
5669

5770
lint:
58-
<<: *defaults
71+
executor: node_executor
5972
steps:
6073
- *attach_workspace
74+
- restore_cache:
75+
keys:
76+
- lint-{{ .Environment.CACHE_VERSION }}-{{ .Branch }}-
77+
- lint-{{ .Environment.CACHE_VERSION }}-
6178
- run: yarn lint
79+
- save_cache:
80+
key: lint-{{ .Environment.CACHE_VERSION }}-{{ .Branch }}-{{ epoch }}
81+
<<: *lint_cache_paths
6282

6383
typecheck:
64-
<<: *defaults
84+
executor: node_executor
6585
steps:
6686
- *attach_workspace
6787
- run: yarn typecheck
6888

6989
test:
70-
<<: *defaults
90+
executor: node_executor
7191
steps:
7292
- *attach_workspace
73-
- run: yarn test:ci
93+
- restore_cache:
94+
keys:
95+
- test-{{ .Environment.CACHE_VERSION }}-{{ .Branch }}-
96+
- test-{{ .Environment.CACHE_VERSION }}-
97+
- run: yarn test
7498
- codecov/upload:
7599
file: './packages/bezier-react/coverage/lcov.info'
76-
token: $CODECOV_TOKEN
100+
- save_cache:
101+
key: test-{{ .Environment.CACHE_VERSION }}-{{ .Branch }}-{{ epoch }}
102+
<<: *test_cache_paths
77103

78104
workflows:
79-
version: 2
80-
lint_and_test:
105+
ci:
81106
jobs:
82107
- install
83108
- build:

.github/workflows/chromatic-report.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
name: Chromatic Report
1313
runs-on: ubuntu-latest
1414
steps:
15-
- name: Checkout Repo
15+
- name: Checkout
1616
uses: actions/checkout@v4
1717

1818
- name: Download artifact

.github/workflows/chromatic.yml

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ on:
66
- main
77
- alpha
88
pull_request:
9-
types: [opened, reopened, synchronize]
109
paths:
1110
- packages/bezier-react/**
1211

@@ -16,33 +15,32 @@ jobs:
1615
name: Chromatic
1716
runs-on: ubuntu-latest
1817
steps:
19-
- name: Get Yarn cache path
20-
id: yarn-cache
21-
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
22-
23-
- name: Checkout Repo
18+
- name: Checkout
2419
uses: actions/checkout@v4
2520
with:
2621
fetch-depth: 0
2722

2823
- name: Setup Node.js
2924
uses: actions/setup-node@v3
3025
with:
31-
node-version: 18.17.1
26+
node-version-file: .nvmrc
27+
cache: yarn
3228

33-
- name: Load Yarn cache
29+
- name: Restore cache
3430
uses: actions/cache@v3
3531
with:
36-
path: ${{ steps.yarn-cache.outputs.dir }}
37-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
32+
path: |
33+
**/.turbo
34+
node_modules/.cache/turbo
35+
key: ${{ runner.os }}-chromatic-${{ github.sha }}
3836
restore-keys: |
39-
${{ runner.os }}-yarn-
37+
${{ runner.os }}-chromatic-
4038
41-
- name: Install Dependencies
39+
- name: Install dependencies
4240
run: yarn
4341

44-
- name: Build Packages
45-
run: yarn build --filter=bezier-icons
42+
- name: Build bezier-react's dependencies
43+
run: yarn build --filter=@channel.io/bezier-react^...
4644

4745
- name: Publish to Chromatic
4846
uses: chromaui/action@v1

.github/workflows/generate-icon-files.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ jobs:
1212
name: Generate icon files from icons.json file
1313
runs-on: ubuntu-latest
1414
steps:
15-
- name: Checkout Repo
15+
- name: Checkout
1616
uses: actions/checkout@v4
1717

1818
- name: Setup Node.js
1919
uses: actions/setup-node@v3
2020
with:
21-
node-version: 18.17.1
21+
node-version-file: .nvmrc
2222

2323
- name: Git Config
2424
run: |
@@ -38,12 +38,19 @@ jobs:
3838
run: echo "pull_request_number=$(gh pr view --json number -q .number || echo "")" >> $GITHUB_OUTPUT
3939
env:
4040
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41-
41+
4242
- name: Add pr description
4343
if: ${{ steps.generate-svg-files.outputs.icon_not_changed == 0}}
4444
run: |
4545
node packages/bezier-icons/scripts/add-pr-description.js ${{ secrets.GITHUB_TOKEN }} ${{ steps.pr.outputs.pull_request_number }}
46-
46+
47+
- name: Add changeset
48+
if: ${{ steps.generate-svg-files.outputs.icon_not_changed == 0}}
49+
run: |
50+
node packages/bezier-icons/scripts/generate-changeset.js
51+
git add .
52+
git commit -m "chore(bezier-icons): add changeset"
53+
4754
- name: Delete icons.json files
4855
run: |
4956
git rm packages/bezier-icons/icons.json

.github/workflows/release.yml

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,32 +11,17 @@ jobs:
1111
name: Release
1212
runs-on: ubuntu-latest
1313
steps:
14-
- name: Get Yarn cache path
15-
id: yarn-cache
16-
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
17-
18-
- name: Checkout Repo
14+
- name: Checkout
1915
uses: actions/checkout@v4
20-
with:
21-
fetch-depth: 0
2216

2317
- name: Setup Node.js
2418
uses: actions/setup-node@v3
2519
with:
26-
node-version: 18.17.1
27-
28-
- name: Load Yarn cache
29-
uses: actions/cache@v3
30-
with:
31-
path: ${{ steps.yarn-cache.outputs.dir }}
32-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
33-
restore-keys: |
34-
${{ runner.os }}-yarn-
20+
node-version-file: .nvmrc
21+
cache: yarn
3522

36-
- name: Install Dependencies
23+
- name: Install dependencies
3724
run: yarn
38-
env:
39-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
4025

4126
- name: Create release Pull Request or publish to NPM
4227
id: changesets

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,3 +215,6 @@ stats.html
215215

216216
# Rollup cache
217217
.rollup.cache
218+
219+
# Jest cache
220+
.jestcache

package.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
"lint": "turbo run lint",
1313
"typecheck": "turbo run typecheck",
1414
"test": "turbo run test",
15-
"test:ci": "turbo run test:ci",
1615
"clean": "turbo run clean && rm -rf node_modules .turbo",
1716
"version-packages": "changeset version && yarn --mode=\"update-lockfile\"",
1817
"release": "turbo run build --filter='@channel.io/*' && changeset publish",
@@ -25,16 +24,20 @@
2524
"@changesets/get-github-info": "^0.5.2",
2625
"@changesets/types": "^5.2.1",
2726
"@channel.io/stylelint-config": "^1.2.0",
28-
"@commitlint/cli": "^17.6.5",
29-
"@commitlint/config-conventional": "^17.6.5",
27+
"@commitlint/cli": "^17.7.1",
28+
"@commitlint/config-conventional": "^17.7.0",
3029
"@storybook/addon-styling": "^1.3.2",
30+
"@swc/core": "^1.3.83",
31+
"@swc/jest": "^0.2.29",
32+
"@types/jest": "^29.5.4",
3133
"cz-conventional-changelog": "^3.3.0",
3234
"eslint": "^7.32.0",
3335
"eslint-config-bezier": "workspace:*",
3436
"husky": "^8.0.3",
37+
"jest": "^29.6.4",
38+
"jest-environment-jsdom": "^29.6.4",
3539
"npm-run-all": "^4.1.5",
3640
"stylelint": "^13.13.1",
37-
"ts-node": "^10.9.1",
3841
"turbo": "^1.10.13",
3942
"typescript": "^4.9.5",
4043
"typescript-plugin-css-modules": "^5.0.1"
Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,12 @@
1-
/** @type {import('ts-jest').JestConfigWithTsJest} */
1+
/** @type {import('jest').Config} */
22
module.exports = {
3-
preset: 'ts-jest/presets/default-esm',
3+
cacheDirectory: '.jestcache',
4+
testEnvironment: 'node',
5+
transform: {
6+
'^.+\\.[t|j]sx?$': ['@swc/jest'],
7+
},
48
moduleNameMapper: {
59
'^(\\.{1,2}/.*)\\.js$': '$1',
610
},
7-
transform: {
8-
// '^.+\\.[tj]sx?$' to process js/ts with `ts-jest`
9-
// '^.+\\.m?[tj]sx?$' to process js/ts/mjs/mts with `ts-jest`
10-
'^.+\\.tsx?$': [
11-
'ts-jest',
12-
{
13-
useESM: true,
14-
},
15-
],
16-
},
17-
testEnvironment: 'node',
18-
testRegex: '\\.test\\.ts$',
11+
testMatch: ['**/*.test.(ts|tsx)'],
1912
}

packages/bezier-codemod/package.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
"dev": "tsc --watch",
2020
"lint": "TIMING=1 eslint --cache .",
2121
"typecheck": "tsc --noEmit",
22-
"test": "jest --onlyChanged",
23-
"clean": "rm -rf dist node_modules .turbo .eslintcache"
22+
"test": "jest",
23+
"clean": "rm -rf dist node_modules .turbo .eslintcache .jestcache"
2424
},
2525
"files": [
2626
"dist"
@@ -33,12 +33,9 @@
3333
"ts-morph": "^19.0.0"
3434
},
3535
"devDependencies": {
36-
"@types/jest": "^29.5.4",
3736
"@types/node": "^20.6.0",
3837
"@types/react": "^18.2.21",
3938
"eslint-config-bezier": "workspace:*",
40-
"jest": "^29.6.4",
41-
"ts-jest": "^29.1.1",
4239
"tsconfig": "workspace:*"
4340
},
4441
"keywords": [

packages/bezier-figma-plugin/CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
# bezier-figma-plugin
22

3+
## 0.4.6
4+
5+
### Patch Changes
6+
7+
- Updated dependencies
8+
- @channel.io/bezier-icons@0.14.0
9+
- @channel.io/bezier-react@1.15.1
10+
11+
## 0.4.5
12+
13+
### Patch Changes
14+
15+
- Updated dependencies
16+
- @channel.io/bezier-react@1.15.1
17+
318
## 0.4.4
419

520
### Patch Changes

0 commit comments

Comments
 (0)