Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: kufu/smarthr-ui
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v58.0.1
Choose a base ref
...
head repository: kufu/smarthr-ui
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing 670 changed files with 25,104 additions and 21,335 deletions.
42 changes: 37 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -3,19 +3,19 @@ version: 2.1
executors:
node-maintenance:
docker:
- image: cimg/node:18.20.4
- image: cimg/node:20.18.0
auth:
username: smarthrinc
password: $DOCKER_HUB_ACCESS_TOKEN
node-active-lts:
docker:
- image: cimg/node:20.17.0
- image: cimg/node:22.11.0
auth:
username: smarthrinc
password: $DOCKER_HUB_ACCESS_TOKEN
node-active-lts-browsers:
docker:
- image: cimg/node:20.17.0-browsers
- image: cimg/node:22.11.0-browsers
auth:
username: smarthrinc
password: $DOCKER_HUB_ACCESS_TOKEN
@@ -32,7 +32,7 @@ commands:
- run: |
sudo corepack enable
sudo corepack prepare
pnpm ui install
pnpm install
- save_cache:
paths:
- node_modules
@@ -43,7 +43,7 @@ commands:
- run: pnpm ui lint
run-npm-test:
steps:
- run: pnpm ui test -- -w 1
- run: pnpm ui test
- run: pnpm ui test:build-assets
run-a11y-test:
steps:
@@ -57,6 +57,27 @@ commands:
command: pnpm ui test-storybook:ci
- store_test_results:
path: junit.xml
run-e2e-test:
steps:
- run:
name: build and store smarthr-ui package
working_directory: packages/smarthr-ui
command: npx yalc publish
- run:
name: Setup Next.js sandbox
working_directory: sandbox/next
command: npx yalc add smarthr-ui
- run:
name: Start Next.js sandbox
working_directory: sandbox/next
command: pnpm dev
background: true
- run:
name: Run E2E Test
working_directory: sandbox/next
command: |
pnpm playwright install chromium
pnpm playwright test
run-chromatic:
steps:
- checkout
@@ -82,12 +103,14 @@ commands:
jobs:
node-maintenance:
executor: node-maintenance
resource_class: medium
steps:
- setup-for-test
- check-source
- run-npm-test
node-active-lts:
executor: node-active-lts
resource_class: medium
steps:
- setup-for-test
- check-source
@@ -100,6 +123,13 @@ jobs:
- setup-for-test
- install-noto-sans-cjk-jp
- run-a11y-test
e2e-test:
executor: node-active-lts-browsers
working_directory: ~/repo
resource_class: medium+
steps:
- setup-for-test
- run-e2e-test
chromatic-deployment:
executor: node-active-lts
resource_class: medium+
@@ -121,6 +151,8 @@ workflows:
context: smarthr-dockerhub
- a11y-test:
context: smarthr-dockerhub
- e2e-test:
context: smarthr-dockerhub
- chromatic-deployment:
filters:
branches:
20 changes: 0 additions & 20 deletions .eslintrc.js

This file was deleted.

27 changes: 0 additions & 27 deletions .github/workflows/e2e.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .github/workflows/previewRelease.yml
Original file line number Diff line number Diff line change
@@ -3,9 +3,12 @@ name: Preview Release
on:
pull_request:
types: [opened, reopened, synchronize]
pull_request_review:
types: [submitted]

jobs:
previewRelease:
if: ${{ (((github.event_name != 'pull_request_review') && !(startsWith(github.event.pull_request.head.ref, 'merge-release-'))) || (github.event_name == 'pull_request_review') && (startsWith(github.event.pull_request.head.ref, 'merge-release-'))) }}
runs-on: ubuntu-latest

steps:
14 changes: 6 additions & 8 deletions .github/workflows/publishRelease.yml
Original file line number Diff line number Diff line change
@@ -37,11 +37,11 @@ jobs:
- run: pnpm publish --filter smarthr-ui --no-git-checks
if: ${{ env.IS_PRERELEASE == 'false' }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.KUFU_NPM_RELEASE_TOKEN }}
- run: pnpm publish --filter smarthr-ui --tag prerelease --no-git-checks
if: ${{ env.IS_PRERELEASE == 'true' }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.KUFU_NPM_RELEASE_TOKEN }}
- run: echo NEW_TAG=$(git describe) >> $GITHUB_ENV
- run: git push origin $NEW_TAG
- run: npx ts-node ./packages/smarthr-ui/scripts/getLatestChangelog.ts > ${{ env.CHANGELOG_PATH }}
@@ -70,11 +70,9 @@ jobs:
branch: 'merge-release-${{ env.NEW_TAG }}'
labels: release candidate
- name: Send message to Slack
uses: slackapi/slack-github-action@v1.27.0
uses: slackapi/slack-github-action@v2.0.0
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
webhook-type: webhook-trigger
payload: |
{
"text": "<!subteam^S01RJL6PHJ8> npm publish が完了しました。Release Pull Request を手動でマージしたらリリース完了です。"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
text: "<!subteam^S01RJL6PHJ8> npm publish が完了しました。Release Pull Request を手動でマージしたらリリース完了です。"
7 changes: 3 additions & 4 deletions .github/workflows/startRelease.yml
Original file line number Diff line number Diff line change
@@ -70,9 +70,8 @@ jobs:
labels: ${{ env.ISSUE_LABELS }}
- name: Send GitHub Action trigger data to Slack
if: ${{ github.event.client_payload.channel_id != null }}
uses: slackapi/slack-github-action@v1.27.0
uses: slackapi/slack-github-action@v2.0.0
with:
channel-id: ${{ github.event.client_payload.channel_id }}
method: chat.postMessage
token: ${{ secrets.SLACK_BOT_TOKEN }}
payload: ${{ github.event.client_payload.say }}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
5 changes: 4 additions & 1 deletion .github/workflows/titleCheck.yml
Original file line number Diff line number Diff line change
@@ -3,16 +3,19 @@ name: PR Title Check
on:
pull_request:
types: [opened, edited, synchronize, reopened]
pull_request_review:
types: [submitted]

jobs:
conventional_commits:
if: ${{ (((github.event_name != 'pull_request_review') && !(startsWith(github.event.pull_request.head.ref, 'merge-release-'))) || (github.event_name == 'pull_request_review') && (startsWith(github.event.pull_request.head.ref, 'merge-release-'))) }}
runs-on: ubuntu-latest
steps:
- name: check title
env:
PR_TITLE: ${{ github.event.pull_request.title }}
run: |
regex="^(feat|fix|docs|chore|style|refactor|perf|test)!?(\([^\)]+\))?:[[:space:]].+"
regex="^(feat|fix|docs|chore|style|refactor|perf|test)(\([^\)]+\))?!?:[[:space:]].+"
if [[ "$PR_TITLE" =~ $regex ]]; then
echo OK
else
13 changes: 13 additions & 0 deletions .github/workflows/typoChecker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Typo Checker
on: [pull_request]

jobs:
run:
name: Typo Checker
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use custom config file
uses: crate-ci/typos@master
with:
config: ./.typos.toml
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.17.0
22.11.0
7 changes: 7 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[files]
extend-exclude = [
'CHANGELOG.md',
'smarthr-ui-props.json',
]

[default.extend-words]
12 changes: 2 additions & 10 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -20,14 +20,6 @@ $ pnpm install
$ pnpm ui test
```

`smarthr-ui` uses Jest's snapshot testing.

If the test results are what you expect, you can update the snapshot with the following command.

```sh
$ pnpm ui test:update-snapshot
```

## Commit

We use [conventional commit messages](https://www.conventionalcommits.org/en/v1.0.0-beta.4/) for `standard-version`.
@@ -41,9 +33,9 @@ The SmartHR UI uses [CircleCI](https://circleci.com/).
- Style description check by stylelint
- TypeScript grammar check with `tsc --noEmit`
- Unit test
- Unit and component testing with [Jest](https://jestjs.io/ja/), [jest-styled-components](https://github.com/styled-components/jest-styled-components)
- Unit and component testing with [Vitest](https://vitest.dev/)
- visual regression test
- [reg-suit](https://github.com/reg-viz/reg-suit)
- [Chromatic](https://www.chromatic.com/)
- Host on Netlify
- Launch the environment on Netlify for each PR so that you can check the operation without launching locally

1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -7,7 +7,6 @@ SmartHR UI はそのすべてのアプリケーションの UI コンポーネ

[![npm version](https://badge.fury.io/js/smarthr-ui.svg)](https://badge.fury.io/js/smarthr-ui)
[![CircleCI](https://circleci.com/gh/kufu/smarthr-ui.svg?style=shield)](https://circleci.com/gh/kufu/smarthr-ui)
![e2e](https://github.com/kufu/smarthr-ui/workflows/e2e/badge.svg)

</div>

50 changes: 50 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import smarthr from 'eslint-config-smarthr'
import storybook from 'eslint-plugin-storybook'

/**
* @type {import('eslint').Linter.Config[]}
*/
export default [
...smarthr,
...storybook.configs['flat/recommended'],
{
rules: {
'jsx-a11y/anchor-is-valid': 'warn',
'jsx-a11y/click-events-have-key-events': 'warn',
'jsx-a11y/no-static-element-interactions': 'warn',
'jsx-a11y/label-has-associated-control': [
'error',
{
controlComponents: ['Input', 'InputWithTooltip'],
},
],
'@typescript-eslint/consistent-type-definitions': [
'error',
'type',
],
'smarthr/require-barrel-import': 'off',
'smarthr/a11y-anchor-has-href-attribute': [
'error',
{
checkType: 'allow-spread-attributes',
}
],
'smarthr/a11y-input-has-name-attribute': [
'error',
{
checkType: 'allow-spread-attributes',
}
],
},
},
{
ignores: [
'**/*.{mjs,js}',
'sandbox/',
'storybook-static/',
'packages/smarthr-ui/esm/',
'packages/smarthr-ui/lib/',
'packages/smarthr-ui/.storybook',
]
},
]
Loading