Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/5.0.0 #349

Merged
merged 81 commits into from
May 13, 2022
Merged
Show file tree
Hide file tree
Changes from 78 commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
39aa011
feat: add `add-location` icon
leannechen Mar 22, 2022
87ba9ce
feat: remove fixed `fill` color
leannechen Mar 22, 2022
b2e51ca
feat: change `fill` value to currentColor
leannechen Mar 22, 2022
69fa2b6
Merge pull request #328 from iCHEF/feature/add_location_icon
leannechen Mar 22, 2022
1587e69
Merge pull request #331 from iCHEF/backport/4.4.0
a26620236 Mar 22, 2022
673ad51
fix: should not asideControlClickableOnDisabled if not disabled
chenesan Mar 30, 2022
eaf4f84
docs: update CHANGELOG.md
chenesan Mar 30, 2022
ea55cf7
Merge pull request #332 from iCHEF/bugfix/should_not_apply_aside_cont…
chenesan Mar 31, 2022
d7a5cc3
feat: add Location icon
leannechen Apr 7, 2022
2df6473
doc: update Changelog
leannechen Apr 7, 2022
348f117
Merge pull request #333 from iCHEF/feature/location-icon
leannechen Apr 8, 2022
86aee36
feat: specify node maximum version in package.json
leannechen Apr 8, 2022
4c0a1b9
feat: add .nvmrc for node version
leannechen Apr 8, 2022
ad2600b
feat: change Location icon
leannechen Apr 8, 2022
4bb5200
Merge pull request #334 from iCHEF/chore/specify-node-version
leannechen Apr 11, 2022
eff64ae
Merge pull request #335 from iCHEF/feature/change-location-icon
leannechen Apr 11, 2022
8ad1d7b
feat: change AddLocation icon
leannechen Apr 22, 2022
488503d
fix: lint issue
leannechen Apr 22, 2022
5fee666
Merge pull request #336 from iCHEF/feature/change-add-location-icon
leannechen Apr 22, 2022
369a6b3
feat(CheckboxEmpty): rename radio-empty with checkbox-empty
benny0642 Apr 29, 2022
33cf1da
feat(CheckboxHalf): rename to CheckboxHalf
benny0642 Apr 29, 2022
0883c8d
feat(CheckboxSelected): rename to CheckboxSelected
benny0642 Apr 29, 2022
ad75ef6
feat: add radio-empty.svg and radio-selected.svg
benny0642 May 3, 2022
cdfb6d4
feat: add SvgRadioEmpty and SvgRadioSelected
benny0642 May 3, 2022
5f86132
Merge pull request #337 from iCHEF/feature/rename_checkbox_icon
benny0642 May 3, 2022
df4e347
feat: implement Radio component
benny0642 May 3, 2022
d54c000
fix: clean code
benny0642 May 3, 2022
d595eaf
feat: implement RadioSelectList and RadioSelectOption
benny0642 May 3, 2022
984dedc
feat: add props for RadioSelectList
benny0642 May 3, 2022
53f3719
fix: fix props name
benny0642 May 3, 2022
f7a5b09
docs: update CHANGELOG
benny0642 May 3, 2022
15597c2
Merge pull request #338 from iCHEF/feature/radio-svg-component
benny0642 May 3, 2022
830c305
fix: fix code review
benny0642 May 3, 2022
ba3c3c4
test(parseSelectOptions): add unit test for RadioSelectOption
benny0642 May 3, 2022
8fd67ce
Merge pull request #339 from iCHEF/feature/radio-component
benny0642 May 3, 2022
5f56f15
feat: add ci workflow with codecov
kyoyadmoon May 4, 2022
1262b03
fix: lint error
kyoyadmoon May 4, 2022
94dbe0d
fix: remove build job
kyoyadmoon May 4, 2022
af43a4e
chore: change stylelint config indentation to 2
kyoyadmoon May 4, 2022
176bc6f
fix: fix scss file indentation
kyoyadmoon May 4, 2022
c2e19db
chore: remove unused action input
kyoyadmoon May 4, 2022
ca5074d
docs: update comment for typeSymbol
benny0642 May 5, 2022
ff67967
Merge pull request #340 from iCHEF/feature/radio-select-list
benny0642 May 5, 2022
62b44e8
Merge pull request #343 from iCHEF/project/radio_select_list
benny0642 May 5, 2022
825d0b1
feat: export RadioSelectList and RadioSelectOption
benny0642 May 5, 2022
fb3de7b
test(Radio): add Radio unit tests
benny0642 May 5, 2022
7edc1d5
Merge pull request #344 from iCHEF/feature/export_radio_select_list
benny0642 May 5, 2022
26ac5bb
test(RadioSelectList): add unit tests
benny0642 May 5, 2022
000b7fb
test(RadioSelectOption): add unit tests
benny0642 May 5, 2022
4400882
chore(package.json): add jest:watch script
benny0642 May 5, 2022
3ff5ed1
feat: use ichef npm-install-with-cache-action to install packages
kyoyadmoon May 5, 2022
90f859f
chore: remove unused local actions
kyoyadmoon May 6, 2022
192aad5
Merge branch 'develop' of https://github.com/iCHEF/gypcrete into feat…
kyoyadmoon May 6, 2022
e1b1bb1
fix: lint error
kyoyadmoon May 6, 2022
9cf2722
fix: linter errors in Radio.scss
kyoyadmoon May 6, 2022
ba0884c
Merge pull request #341 from iCHEF/feat/add-ci-workflow
kyoyadmoon May 6, 2022
e1da772
Merge branch 'feat/add-ci-workflow' of https://github.com/iCHEF/gypcr…
kyoyadmoon May 6, 2022
ff68819
fix: scss stylelint errors
kyoyadmoon May 6, 2022
e79cf6c
Merge pull request #342 from iCHEF/chore/change-stylelint-indent
kyoyadmoon May 6, 2022
8244088
Merge pull request #345 from iCHEF/test/radio_select_list
benny0642 May 6, 2022
7b95c83
fix(package.json): fix generate-icon-components script
benny0642 May 6, 2022
6db6451
docs: update CHANGELOG
benny0642 May 6, 2022
fa17c3d
feat: add canary release workflow
a26620236 May 8, 2022
57047ca
chore: fix typo
a26620236 May 8, 2022
6620403
feat: add release workflow
a26620236 May 8, 2022
00fba6d
feat: update release workflow
a26620236 May 9, 2022
40cfe3a
feat: update release workflow with `iCHEF/npm-install-with-cache-acti…
a26620236 May 9, 2022
c305dc3
Merge branch 'develop' into feature/add_release_workflow
a26620236 May 9, 2022
964933d
Merge branch 'develop' into feature/add_canary_workflow
a26620236 May 9, 2022
2da930d
fix: CI never stop running caused by watch mode
a26620236 May 9, 2022
0deacac
chore: update package name used in canary release workflow
a26620236 May 9, 2022
fd37cc5
chore: update package name used in canary release workflow
a26620236 May 9, 2022
579aaf6
Merge pull request #346 from iCHEF/feature/add_canary_workflow
a26620236 May 9, 2022
e8e39bb
Merge branch 'develop' into feature/add_release_workflow
a26620236 May 9, 2022
08086fa
chore: update package name used in canary release workflow and script…
a26620236 May 9, 2022
ad22c1f
feat: add "conventional-changelog-cli to package.json
a26620236 May 9, 2022
5b32861
Merge pull request #347 from iCHEF/fix/generate-icon-components-script
benny0642 May 11, 2022
674be48
Merge pull request #348 from iCHEF/feature/add_release_workflow
a26620236 May 12, 2022
c4a99b1
feat: deleted unused travis cd
a26620236 May 13, 2022
c06773e
feat: deleted unused deploy.sh
a26620236 May 13, 2022
b3ae98d
Merge pull request #350 from iCHEF/feature/delete_unused_travis
a26620236 May 13, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions .github/workflows/canary_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Canary Build

on:
pull_request:
types:
- opened
- synchronize
- reopened
push:
branches:
- develop

jobs:
canary-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v1
with:
node-version: '12'
registry-url: 'https://registry.npmjs.org'

- name: Install packages with cache
uses: iCHEF/npm-install-with-cache-action@v1
with:
is-monorepo: true

- name: start deployment
uses: bobheadxi/deployments@v0.4.3
id: deployment
with:
step: start
token: ${{ secrets.GITHUB_TOKEN }}
env: canary
ref: ${{ github.head_ref }}

- name: Publish canary build
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
RUN_NUMBER: ${{ github.run_number }}
run: yarn release:canary --yes --preid="alpha.${RUN_NUMBER}" --no-git-reset --dist-tag="alpha"

- name: Retrieve package version
uses: nyaa8/package-version@v1
with:
path: packages/core/package.json

- name: Format canary version
run: echo "CANARY_VERSION=$PACKAGE_VERSION" | cut -d "+" -f 1 > $GITHUB_ENV

- name: update deployment status
uses: bobheadxi/deployments@v0.4.3
if: always()
with:
step: finish
token: ${{ secrets.GITHUB_TOKEN }}
status: ${{ job.status }}
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
env_url: ${{ format('https://www.npmjs.com/package/@ichef/gypcrete/v/{0}', env.CANARY_VERSION) }}
36 changes: 36 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: CI

on:
pull_request:
types:
- opened
- synchronize
- reopened
push:
branches:
- master
- develop

jobs:
test:
name: Lint and test
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Install packages with cache
uses: iCHEF/npm-install-with-cache-action@v1
with:
is-monorepo: true
- name: Run linter
run: yarn lint
- name: Run tests
run: yarn test
- name: Codecov
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: "./coverage/coverage-final.json"
72 changes: 72 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Release
on:
pull_request:
types:
- closed
branches:
- master

jobs:
release:
if: github.event.pull_request.merged && startsWith(github.head_ref, 'release/')
runs-on: ubuntu-latest
steps:
- name: Set release version
env:
BRANCH_NAME: ${{ github.head_ref }}
run: echo "RELEASE_VERSION=${BRANCH_NAME/release\/}" >> $GITHUB_ENV
- uses: actions/checkout@v2
with:
fetch-depth: 0
ref: master
token: ${{ secrets.ICHEF_BOT_TOKEN }}
- uses: actions/setup-node@v1
with:
node-version: '12'
registry-url: 'https://registry.npmjs.org'
- name: Install packages with cache
uses: iCHEF/npm-install-with-cache-action@v1
with:
is-monorepo: true
- name: Update package version
run: |
git config user.name github-actions
git config user.email github-actions@github.com
npm version "$RELEASE_VERSION" --no-git-tag-version
yarn changelog
git add .
git commit -m "build: bump version to $RELEASE_VERSION"
yarn lerna version "$RELEASE_VERSION" --amend --yes
git push --tags origin master
- name: Get latest commit hash
run: echo "LATEST_COMMIT=$(git rev-parse HEAD)" > $GITHUB_ENV
- name: Retrieve package version
uses: nyaa8/package-version@v1
- name: start deployment
uses: bobheadxi/deployments@v0.4.3
id: deployment
with:
step: start
token: ${{ secrets.GITHUB_TOKEN }}
env: production
ref: ${{ env.LATEST_COMMIT }}
- name: Publish packages
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: yarn lerna publish from-git --yes
- name: update deployment status
uses: bobheadxi/deployments@v0.4.3
if: always()
with:
step: finish
token: ${{ secrets.GITHUB_TOKEN }}
status: ${{ job.status }}
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
env_url: ${{ format('https://www.npmjs.com/package/@ichef/gypcrete/v/{0}', env.PACKAGE_VERSION) }}
- name: Create Github release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: release-drafter/release-drafter@v5
with:
version: ${{ env.PACKAGE_VERSION }}
publish: true
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lts/erbium
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,20 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

### Changed
- [Core] Should not apply asideControlClickableOnDisabled if not disabled. (#332)

### Added
- [Core] Add new icon: Location. (#333)
- [Core] Add Radio component (#338, #339)
- [Form] Add RadioSelectList and RadioSelectOption (#340)

### Breaking
- [Core] Rename radio-empty.svg to checkbox-empty.svg (#337)
- [Core] Rename radio-half.svg to checkbox-half.svg (#337)
- [Core] Rename radio-selected.svg to checkbox-selected.svg (#337)
- [Core] Fix the svgr/cli version at v5.5.0(#347)

## [4.4.0]

### Breaking
Expand Down
17 changes: 17 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
codecov:
branch: develop

comment:
layout: "diff, files"

coverage:
status:
project:
default:
target: 0%
patch:
default:
target: 90%

github_checks:
annotations: false
2 changes: 1 addition & 1 deletion configs/.stylelintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ extends: stylelint-config-standard
configBasedir: ../

rules:
indentation: 4
indentation: 2
number-leading-zero: never
selector-pseudo-element-colon-notation: single

Expand Down
2 changes: 1 addition & 1 deletion configs/jest.config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"rootDir": "../",
"coverageReporters": ["cobertura", "lcov", "text"],
"coverageReporters": ["clover", "json", "lcov", "text"],
"coveragePathIgnorePatterns": [
"/node_modules/",
"<rootDir>/packages/\\w+/lib/"
Expand Down
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"repository": "iCHEF/gypcrete",
"license": "Apache-2.0",
"engines": {
"node": ">= 8.2.1",
"node": ">= 8.2.1 <= 12",
"npm": ">= 5.10.0",
"yarn": ">= 1.10.0"
},
Expand All @@ -25,7 +25,9 @@
"lint": "npm run lint:eslint && npm run lint:stylelint",
"lint:eslint": "eslint ./packages --ignore-path=configs/.eslintignore ./",
"lint:stylelint": "stylelint ./packages/**/*.scss",
"test": "jest ./packages --config=configs/jest.config.json --coverage"
"test": "jest ./packages --config=configs/jest.config.json --coverage",
"test:watch": "jest --config=configs/jest.config.json --runInBand --watch --verbose",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s"
},
"devDependencies": {
"@babel/cli": "^7.4.4",
Expand All @@ -43,6 +45,7 @@
"babel-loader": "^8.0.4",
"babel-plugin-module-resolver": "^3.1.1",
"babel-plugin-strip-css-imports": "zhusee2/babel-plugin-strip-css-imports",
"conventional-changelog-cli": "^2.1.1",
"core-js": "^3.1.1",
"coveralls": "^3.0.0",
"css-loader": "^0.28.8",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"build:dist": "webpack --config ./configs/webpack.dist.js --color",
"build:lib": "BABEL_ENV=lib babel src --root-mode=upward --out-dir lib",
"build:es": "BABEL_ENV=es babel src --root-mode=upward --out-dir es",
"generate-icon-components": "npx @svgr/cli --config-file configs/svgr/svgr.config.js --icon -d src/icons/components src/icons/svg",
"generate-icon-components": "npx @svgr/cli@5.5.0 --config-file configs/svgr/svgr.config.js --icon -d src/icons/components src/icons/svg",
"clean": "rm -rf ./dist ./lib ./es ./deploy"
},
"peerDependencies": {
Expand Down
74 changes: 74 additions & 0 deletions packages/core/src/Radio.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';

import icBEM from './utils/icBEM';
import prefixClass from './utils/prefixClass';
import rowComp from './mixins/rowComp';
import Icon from './Icon';
import './styles/Radio.scss';

export const COMPONENT_NAME = prefixClass('radio');
const ROOT_BEM = icBEM(COMPONENT_NAME);
export const BEM = {
root: ROOT_BEM,
iconWrapper: ROOT_BEM.element('icon-wrapper'),
input: ROOT_BEM.element('input'),
button: ROOT_BEM.element('button'),
};

export const RADIO_BUTTON = <Icon type="empty" className={`${BEM.button}`} />;

function Radio({
input,
// <input> props
checked,
defaultChecked,
disabled,
onChange,
// React props
className,
children,
...otherProps
}) {
const inputProps = {
checked,
defaultChecked,
disabled,
onChange,
...input,
};
const rootClassName = classNames(className, COMPONENT_NAME);
return (
<div className={rootClassName} {...otherProps}>
<span className={BEM.iconWrapper}>
<input
type="radio"
className={BEM.input}
{...inputProps}
/>
{RADIO_BUTTON}
</span>
{children}
</div>
);
}

Radio.propTypes = {
input: PropTypes.objectOf(PropTypes.any),
checked: PropTypes.bool,
defaultChecked: PropTypes.bool,
disabled: PropTypes.bool,
onChange: PropTypes.func,
};

Radio.defaultProps = {
input: {},
checked: undefined,
defaultChecked: undefined,
disabled: false,
onChange: undefined,
};

export default rowComp()(Radio);
export { Radio as PureRadio };
Loading