Skip to content

Commit b986c24

Browse files
authored
Merge pull request #407 from iCHEF/release/6.0.0
Release v6.0.0
2 parents 0ecf5c9 + 5c4c3e6 commit b986c24

File tree

17 files changed

+713
-269
lines changed

17 files changed

+713
-269
lines changed

README.md

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -66,28 +66,17 @@ Gypcrete does not publish develop builds to the `dist` branch anymore. It now pu
6666
* When pushed to `develop` branch --> publish a canary build
6767
* When pushed to `master` branch --> publish a relase build
6868

69-
### Releasing
70-
71-
We're relying on Lerna for versioning and publishing. When you create a Release on Github, it will trigger task on Travis CI to publish with Lerna. It also converts the lightweight tag created by Github Release to an annotated tag for Lerna to calculate versions.
72-
73-
When releasing a new version for Gypcrete, follow the steps:
74-
75-
1. Create a release branch `release/x.y.z`
76-
2. *(Optional)* Release beta builds with `yarn release:pre` locally to specify version.
77-
3. Bump version for `package.json` and `CHANGELOG`.
78-
4. Bump children packages version with script:
79-
```sh
80-
yarn bumpversion
81-
```
82-
This will run `lerna version`, which updates all `package.json` files in `packages/`.
83-
84-
5. Commit above changes, then create a pull request for this release branch.
85-
6. *[Important]* Create a new Release on Github in format of `v3.4.5` once it's merged into `master`.
86-
Please be sure to prefix the tag name with `v` as Lerna uses them to calculate changes.
87-
88-
7. Backport changes from `master` back to `develop` by creating a `backport/x.y.y` branch and create a pull request for that.
89-
90-
At the time Github Release is created, it should trigger `yarn release` on Travis CI and publishes packages to npm.
69+
## Release
70+
71+
1. 從 develop 開出新的 release branch,release branch 的格式必須符合 `release/x.y.z`,例如 `release/1.2.3``x.y.z` 的部分為欲發佈的版號,必須符合 semantic versioning。
72+
2. 以這支新的 release branch 開出新的 PR,base branch 設為 `master`
73+
3. 當 PR 被 merge 時,會觸發 github action 的 [Release workflow](https://github.com/iCHEF/fe-modules/blob/master/.github/workflows/release.yml),此 workflow 會在 master branch 做下列動作:
74+
- 更新 package.json 的 version 並 commit
75+
- 執行 `yarn changelog` 更新 CHANGELOG.md
76+
- 打 git tag 並將 tag push 上 github
77+
- 發佈新版本到 npm
78+
- 開出 backport 到 develop branch 的 PR
79+
4. merge backport PR。至此完成 release 流程。
9180

9281
## LICENSE
9382
This project is licensed under the terms of the [Apache License 2.0](https://github.com/ichef/gypcrete/blob/master/LICENSE)

configs/jestSetup.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* eslint-disable import/no-extraneous-dependencies */
22
import Enzyme from 'enzyme';
3-
import Adapter from 'enzyme-adapter-react-16';
3+
import Adapter from '@wojtekmaj/enzyme-adapter-react-17';
44

55
Enzyme.configure({ adapter: new Adapter() });

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"@babel/preset-react": "^7.0.0",
3939
"@babel/runtime": "^7.4.4",
4040
"@babel/runtime-corejs3": "^7.4.4",
41+
"@wojtekmaj/enzyme-adapter-react-17": "^0.8.0",
4142
"autoprefixer": "^9.6.1",
4243
"babel-core": "7.0.0-bridge.0",
4344
"babel-eslint": "^10.0.1",
@@ -50,7 +51,6 @@
5051
"coveralls": "^3.0.0",
5152
"css-loader": "^0.28.8",
5253
"enzyme": "^3.7.0",
53-
"enzyme-adapter-react-16": "^1.6.0",
5454
"eslint": "7.8",
5555
"eslint-config-airbnb": "18.2",
5656
"eslint-config-ichef": "8.0",
@@ -69,9 +69,9 @@
6969
"node-sass": "^4.12.0",
7070
"postcss-loader": "^3.0.0",
7171
"prop-types": "^15.6.2",
72-
"react": "^16.6.3",
73-
"react-dom": "^16.6.3",
74-
"react-test-renderer": "^16.6.3",
72+
"react": "^17.0.2",
73+
"react-dom": "^17.0.2",
74+
"react-test-renderer": "^17.0.2",
7575
"sass-loader": "^6.0.2",
7676
"style-loader": "^0.19.1",
7777
"stylelint": "^10.1.0",

packages/core/package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,23 +33,22 @@
3333
"peerDependencies": {
3434
"@babel/runtime-corejs3": "^7.4.4",
3535
"prop-types": "^15.5.8",
36-
"react": "^16.6.0",
37-
"react-dom": "^16.6.0"
36+
"react": "^17.0.2",
37+
"react-dom": "^17.0.2"
3838
},
3939
"dependencies": {
4040
"classnames": "^2.2.5",
41-
"create-react-context": "^0.2.3",
4241
"document-offset": "^1.0.4",
4342
"keycode": "^2.1.9",
4443
"lodash.omit": "^4.5.0",
4544
"memoize-one": "^4.0.3",
46-
"react-textarea-autosize": "^7.1.0",
45+
"react-textarea-autosize": "^8.4.1",
4746
"warning": "^4.0.3"
4847
},
4948
"devDependencies": {
5049
"@babel/cli": "^7.4.4",
5150
"enzyme": "^3.7.0",
52-
"react-is": "^16.6.1",
51+
"react-is": "^17.0.2",
5352
"webpack": "^3.10.0",
5453
"webpack-merge": "^4.1.2"
5554
}

packages/core/src/EditableBasicRow.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ class EditableBasicRow extends PureComponent {
9393
focused: false,
9494
};
9595

96-
// eslint-disable-next-line react/no-deprecated
97-
componentWillReceiveProps(nextProps) {
96+
// eslint-disable-next-line react/no-deprecated, camelcase
97+
UNSAFE_componentWillReceiveProps(nextProps) {
9898
if (nextProps.value !== this.props.value) {
9999
this.setState({ currentValue: nextProps.value });
100100
}

packages/core/src/EditableTextLabel.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -63,18 +63,6 @@ class EditableTextLabel extends PureComponent {
6363
dblTouchTimeout: null,
6464
};
6565

66-
// eslint-disable-next-line react/no-deprecated
67-
componentWillReceiveProps(nextProps) {
68-
/**
69-
* If the edit-state of <EditableTextLabel> is *controlled* by `inEdit` prop.
70-
* If the prop is `undefined`, this component became *uncontrolled*
71-
* and should run itself.
72-
*/
73-
if (this.getEditabilityControlled(nextProps)) {
74-
this.setState({ inEdit: nextProps.inEdit });
75-
}
76-
}
77-
7866
getEditabilityControlled(fromProps = this.props) {
7967
return fromProps.inEdit !== undefined;
8068
}
@@ -86,6 +74,18 @@ class EditableTextLabel extends PureComponent {
8674
});
8775
}
8876

77+
// eslint-disable-next-line react/no-deprecated, camelcase
78+
UNSAFE_componentWillReceiveProps(nextProps) {
79+
/**
80+
* If the edit-state of <EditableTextLabel> is *controlled* by `inEdit` prop.
81+
* If the prop is `undefined`, this component became *uncontrolled*
82+
* and should run itself.
83+
*/
84+
if (this.getEditabilityControlled(nextProps)) {
85+
this.setState({ inEdit: nextProps.inEdit });
86+
}
87+
}
88+
8989
leaveEditModeIfNotControlled() {
9090
if (!this.getEditabilityControlled(this.props)) {
9191
this.setState({ inEdit: false });
@@ -94,9 +94,9 @@ class EditableTextLabel extends PureComponent {
9494

9595
handleDoubleClick = (event) => {
9696
/**
97-
* If `inEdit` isn't controlled, this component by default
98-
* goes into edit mode on double click/touch.
99-
*/
97+
* If `inEdit` isn't controlled, this component by default
98+
* goes into edit mode on double click/touch.
99+
*/
100100
if (!this.getEditabilityControlled()) {
101101
this.setState({ inEdit: true });
102102
}

packages/core/src/StatusIcon.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,17 @@ class StatusIcon extends PureComponent {
4848
hideIcon: false,
4949
};
5050

51-
// eslint-disable-next-line react/no-deprecated
52-
componentWillMount() {
51+
componentWillUnmount() {
52+
clearTimeout(this.hideIconTimeout);
53+
}
54+
55+
// eslint-disable-next-line react/no-deprecated, camelcase
56+
UNSAFE_componentWillMount() {
5357
this.autoToggleStatusIcon();
5458
}
5559

56-
// eslint-disable-next-line react/no-deprecated
57-
componentWillReceiveProps(nextProps) {
60+
// eslint-disable-next-line react/no-deprecated, camelcase
61+
UNSAFE_componentWillReceiveProps(nextProps) {
5862
if (nextProps.status !== this.props.status) {
5963
this.autoToggleStatusIcon(nextProps.status);
6064
}
@@ -65,10 +69,6 @@ class StatusIcon extends PureComponent {
6569
}
6670
}
6771

68-
componentWillUnmount() {
69-
clearTimeout(this.hideIconTimeout);
70-
}
71-
7272
/**
7373
* Auto hides status icon after being SUCCESS for 2 secs,
7474
* or shows icon when component leaves SUCCESS state.
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
// #FIXME: use React navive context API when upgraded to v16+
2-
import createReactContext from 'create-react-context';
1+
import React from 'react';
32

4-
const ListSpacingContext = createReactContext(true);
3+
const ListSpacingContext = React.createContext(true);
54

65
export default ListSpacingContext;

packages/core/src/mixins/__tests__/closable.test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ describe.each`
125125
const handleClose = jest.fn();
126126
const closableOptions = { onClickInside, onClickOutside };
127127

128-
mount(
128+
const wrapper = mount(
129129
<ClosableFoo closable={closableOptions} onClose={handleClose} />,
130130
{ attachTo: rootNode },
131131
);
@@ -139,6 +139,8 @@ describe.each`
139139
keyEvent = new KeyboardEvent('keyup', { keyCode: keycode('Escape') });
140140
document.dispatchEvent(keyEvent);
141141
expect(handleClose).toHaveBeenCalledTimes(shouldBeCalled ? 1 : 0);
142+
143+
wrapper.unmount();
142144
});
143145
});
144146

0 commit comments

Comments
 (0)