Skip to content

Commit 042a5bf

Browse files
authored
(CDPE-6560) Fixes for release (#652)
* (CDPE-6560) Update publish github action * (CDPE-6560) Add npm auth token to publish github action * (CDPE-6560) Move react-layouts dependency from artifactory to npm registry * (MAINT) Fix CHANGELOG version for react-components * (MAINT) Update deploy and test github actions. Remove 40 minute sleep timer for the gh page deploy action. * (MAINT) Fix import casing * (CDPE-6560) Update publish action .npmrc content
1 parent aeb103b commit 042a5bf

File tree

15 files changed

+77
-105
lines changed

15 files changed

+77
-105
lines changed

.github/workflows/deploy.yml

+24-26
Original file line numberDiff line numberDiff line change
@@ -3,42 +3,40 @@ name: GitHub Pages
33
on:
44
push:
55
branches: [main]
6+
workflow_dispatch:
67

78
jobs:
89
test:
9-
1010
runs-on: ubuntu-latest
1111

1212
steps:
13-
- uses: actions/checkout@v2
14-
- uses: actions/setup-node@v1
15-
with:
16-
node-version: 12.4.0
17-
- run: npm install
18-
- run: npm run build --if-present
19-
- run: npm test
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-node@v4
15+
with:
16+
node-version: 12.4.0
17+
- run: npm install
18+
- run: npm run build --if-present
19+
- run: npm test
2020

2121
deploy:
22-
2322
needs: test
2423

2524
runs-on: ubuntu-latest
2625

2726
steps:
28-
- name: sleep
29-
uses: jakejarvis/[email protected]
30-
with:
31-
time: '40m'
32-
- name: Checkout
33-
uses: actions/checkout@v2
34-
- name: Set Node version
35-
uses: actions/setup-node@v1
36-
with:
37-
node-version: 12.4.0
38-
- name: Install
39-
run: (cd packages/design-system-website && npm install && npm run styleguide:build)
40-
- name: Deploy to GitHub Pages
41-
uses: JamesIves/github-pages-deploy-action@v4
42-
with:
43-
branch: gh-pages
44-
folder: packages/design-system-website/dist
27+
- name: Checkout
28+
uses: actions/checkout@v4
29+
- name: Set Node version
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version: 12.4.0
33+
- name: Install
34+
run: |
35+
cd packages/design-system-website
36+
npm install
37+
npm run styleguide:build
38+
- name: Deploy to GitHub Pages
39+
uses: JamesIves/github-pages-deploy-action@v4
40+
with:
41+
branch: gh-pages
42+
folder: packages/design-system-website/dist

.github/workflows/publish.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,14 @@ jobs:
1818
- run: npm run build --if-present
1919
- run: npm test
2020

21-
deploy:
21+
publish:
2222
needs: test
2323
runs-on: ubuntu-latest
2424
steps:
2525
- name: Checkout
2626
uses: actions/checkout@v4
2727
- name: Set Node version
2828
uses: actions/setup-node@v4
29-
with:
30-
node-version: 12.4.0
3129
- name: Install all package dependencies
3230
run: npm install
3331
- name: Publish packages

.github/workflows/test.yml

+7-8
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,17 @@ on: [pull_request]
44

55
jobs:
66
test:
7-
87
runs-on: ubuntu-latest
98

109
strategy:
1110
matrix:
1211
node-version: [12.4.0]
1312

1413
steps:
15-
- uses: actions/checkout@v2
16-
- uses: actions/setup-node@v1
17-
with:
18-
node-version: ${{ matrix.node-version }}
19-
- run: npm install
20-
- run: npm run build --if-present
21-
- run: npm test
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-node@v4
16+
with:
17+
node-version: ${{ matrix.node-version }}
18+
- run: npm install
19+
- run: npm run build --if-present
20+
- run: npm test

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
- [Table] Bug fixing table loader width on selectable tables (by [@Lukeaber](https://github.com/Lukeaber) in [#636](https://github.com/puppetlabs/design-system/pull/636))
44

5-
## react-components 5.34.9 (2022-07-28)
5+
## react-components 5.34.0 (2022-07-28)
66

77
- [Menu] Adding Detail, Menu, Menu.Search, and Tag.Search components (by [@krable55](https://github.com/krable55) in [#621](https://github.com/puppetlabs/design-system/pull/621))
88

CONTRIBUTING.md

+12-13
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ Run `npm test` in the top folder to test all packages, or `npm test` in the desi
5555
- Tense: Use the imperative present tense (e.g. "Add feature", not "Added feature") to describe what changed from the consumer's perspective in the commit summary.
5656

5757
| <img src="https://imgs.xkcd.com/comics/git_commit.png" alt="xkcd comic about commit messages"/> |
58-
| ------------- |
59-
| <p align="center">Don't do this</p> |
58+
| ----------------------------------------------------------------------------------------------- |
59+
| <p align="center">Don't do this</p> |
6060

6161
See more guidelines for contributors and maintainers in the [Principles, Patterns, and Guidelines](principles-patterns-guidelines.md) doc.
6262

@@ -65,17 +65,16 @@ See more guidelines for contributors and maintainers in the [Principles, Pattern
6565
Once you have made a change and verified that it works locally including in the Styleguidist website, put up a PR. The author should own seeking review and merging/publishing. Publishing packages to npm is automated with Relay when a PR is merged to `main` or `releases/alpha` if Lerna detects a new version in a package's `package.json` that doesn't yet exist on npm.
6666

6767
1. **Branch**: Create a PR from your branch. Note that we usually push the branch directly to this repository rather than a fork.
68-
- Target the `main` branch (the default branch) if the change should be published upon merge.
69-
- Target the `releases/alpha` branch if it includes a breaking change.
70-
- Target a feature branch if the change shouldn't be released yet. For example, a "feature" or "integration" branch can be used if you want to batch up multiple changes into a single release, which would then need to be followed up with another PR from that branch to `main` for a release.
68+
- Target the `main` branch (the default branch) if the change should be published upon merge.
69+
- Target the `releases/alpha` branch if it includes a breaking change.
70+
- Target a feature branch if the change shouldn't be released yet. For example, a "feature" or "integration" branch can be used if you want to batch up multiple changes into a single release, which would then need to be followed up with another PR from that branch to `main` for a release.
7171
2. **Changelog**: Add a line about your change to the package's CHANGELOG.md.
72-
- Add a heading with the release date. Note that you may use "Unreleased" if it's not going to be released yet.
73-
- Add context and be specific about the change by prefixing the change with the component affected and referencing props by name.
72+
- Add a heading with the release date. Note that you may use "Unreleased" if it's not going to be released yet.
73+
- Add context and be specific about the change by prefixing the change with the component affected and referencing props by name.
7474
3. **Version**: Update the version to be published, following [semver](https://semver.org/) for patch, minor, and major versions. Note that alpha versions also follow semver, in the form `6.0.0-alpha.3`.
75-
- Increment the version in the appropriate `package.json` files, e.g. [packages/react-components/package.json](packages/react-components/package.json).
76-
- Also increment the version in the corresponding `package-lock.json` files. When updating a single package, this is most easily done by simply manually incrementing the `version` field in the `package-lock.json` file to match, but can also be done by running `npm install`, though you may have to run `git clean -dfX` first to force them to update.
77-
- Note: Other packages in this project that depend on the incremented package may also need to be udpated to point to the new version, otherwise, you could end up with multiple versions due to the use of lockfiles.
75+
- Increment the version in the appropriate `package.json` files, e.g. [packages/react-components/package.json](packages/react-components/package.json).
76+
- Also increment the version in the corresponding `package-lock.json` files. When updating a single package, this is most easily done by simply manually incrementing the `version` field in the `package-lock.json` file to match, but can also be done by running `npm install`, though you may have to run `git clean -dfX` first to force them to update.
77+
- Note: Other packages in this project that depend on the incremented package may also need to be udpated to point to the new version, otherwise, you could end up with multiple versions due to the use of lockfiles.
7878
4. **Review**: Get a +1 on the PR. Feel free to ping people to find a reviewer. The [design-system-codeowners](https://github.com/orgs/puppetlabs/teams/design-system-codeowners/members) team should be able to help.
79-
5. **Merge**: Merge the PR. Merging to `main` or `releases/alpha` will trigger a Relay workflow that runs the `npm run release` command.
80-
6. **Notification**: Wait for a successful notification in the #alerts-design-system Slack channel, which could take a half hour or so.
81-
7. **Verify**: Verify the new version got published, e.g. by checking [https://www.npmjs.com/package/@puppet/react-components](https://www.npmjs.com/package/@puppet/react-components).
79+
5. **Merge**: Merge the PR. Merging to `main` or `releases/alpha` will trigger a github workflow that runs the `npm run publish` command.
80+
6. **Verify**: Verify the new version got published, e.g. by checking [https://www.npmjs.com/package/@puppet/react-components](https://www.npmjs.com/package/@puppet/react-components).

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"test": "lerna run lint && lerna run test",
1010
"start": "cd packages/design-system-website && npm start",
1111
"styleguide:build": "cd packages/design-system-website && npm run styleguide:build",
12-
"release": "lerna publish --yes from-package",
12+
"publish": "lerna publish --yes from-package",
1313
"upgrade": "npx npm-check-updates --upgrade && lerna run upgrade"
1414
},
1515
"devDependencies": {

packages/react-components/package-lock.json

+8-27
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/react-components/source/react/library/button-select/ButtonSelect.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { Component } from 'react';
22
import classNames from 'classnames';
33
import PropTypes from 'prop-types';
4-
import Button from '../button/Button';
4+
import Button from '../button';
55
import TooltipHoverArea from '../tooltips/TooltipHoverArea';
66
import OptionMenuList from '../../internal/option-menu-list';
77
import { anchorOrientation } from '../../helpers/customPropTypes';

packages/react-components/source/react/library/menu/Menu.md

+12-15
Original file line numberDiff line numberDiff line change
@@ -66,24 +66,24 @@ const closeOnSelect = opt => {
6666

6767
## Managing Menu Items
6868

69-
#### Menu.Item
69+
### Menu.Item
7070

7171
To improve accessibility and event handling, the `Menu` component provides the `Menu.Item` [HOC](https://reactjs.org/docs/higher-order-components.html) for managing its internal focusable elements and adding common event handlers. To use, wrap any component that accepts an `innerRef` prop with the `Menu.Item` function.
7272

73-
#### Focus
73+
### Focus
7474

7575
`Menu.Item` uses the 'roving focus' pattern and is meant to be used for simple menu navigation. The tab index will be tracked automatically according to its x/y location on the page. For more complex menus, it's recommended you add your own focus management.
7676

77-
#### Controlled vs Uncontrolled
77+
### Controlled vs Uncontrolled
7878

7979
`Menu.Item` will add basic open and close handlers, allowing for a simple uncontrolled menu. `onKeydown` events for the space & enter key will be added to match the onClick event provided to the menu item component.
8080

8181
_To control the menu while using components wrapped in the `Menu.Item` HOC, pass a boolean value to the `open` prop. Setting `closeOnSelect` to false will keep the menu open after selections are made_
8282

8383
```jsx
8484
import Heading from '../heading';
85-
import Detail from '../Detail';
86-
import Button from '../Button';
85+
import Detail from '../detail';
86+
import Button from '../button';
8787

8888
const [option, setOption] = React.useState();
8989
const [openControlledMenu, setControlledMenu] = React.useState(false);
@@ -153,9 +153,8 @@ _\*Note: This is meant ot be a controlled component. The `Menu.SearchMenu` compo
153153

154154
```jsx
155155
import Heading from '../heading';
156-
import Avatar from '../Avatar';
157-
158-
import Detail from '../Detail';
156+
import Avatar from '../avatar';
157+
import Detail from '../detail';
159158
const [selected, setSelected] = React.useState([]);
160159
const [open, setMenu] = React.useState(false);
161160
const exampleStyle = { margin: 0, padding: '4px' };
@@ -251,15 +250,14 @@ const options = [
251250
</div>;
252251
```
253252

254-
#### Columns
253+
### Columns
255254

256255
For a more compact view, columns can be set to true, for two columns, or a number for more than two columns. It's not recommended to display more than 3 columns in a menu.
257256

258257
```jsx
259258
import Heading from '../heading';
260-
import Avatar from '../Avatar';
261-
262-
import Detail from '../Detail';
259+
import Avatar from '../avatar';
260+
import Detail from '../detail';
263261
const [selected, setSelected] = React.useState([]);
264262
const [open, setMenu] = React.useState(false);
265263
const exampleStyle = { margin: 0, padding: '4px' };
@@ -362,9 +360,8 @@ The default search function searches for a match against an Item's label and gro
362360

363361
```jsx
364362
import Heading from '../heading';
365-
import Avatar from '../Avatar';
366-
367-
import Detail from '../Detail';
363+
import Avatar from '../avatar';
364+
import Detail from '../detail';
368365
const [selected, setSelected] = React.useState([]);
369366
const [open, setMenu] = React.useState(false);
370367
const exampleStyle = { margin: 0, padding: '4px' };

packages/react-components/source/react/library/tag/Tag.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Creates a list of tags from a menu of searchable / filterable options. Menu opti
6767

6868
```jsx
6969
import React from 'react';
70-
import Button from '../Button';
70+
import Button from '../button';
7171

7272
const [selected, onApply] = React.useState([]);
7373

packages/react-components/test/buttons/button.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { shallow } from 'enzyme';
33
import { expect } from 'chai';
44
import React from 'react';
55

6-
import Button from '../../source/react/library/button/Button';
6+
import Button from '../../source/react/library/button';
77

88
describe('<Button />', () => {
99
jsdom({ skipWindowCheck: true });

packages/react-components/test/form/Form.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import sinon from 'sinon';
55

66
import Form from '../../source/react/library/form/Form';
77
import { isEmpty } from '../../source/react/library/form/internal/methods';
8-
import Button from '../../source/react/library/button/Button';
9-
import Alert from '../../source/react/library/alert/Alert';
8+
import Button from '../../source/react/library/button';
9+
import Alert from '../../source/react/library/alert';
1010

1111
describe('<Form />', () => {
1212
it('should propagate user provided className', () => {

packages/react-components/test/menu/menu.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import { shallow, mount } from 'enzyme';
33
import { expect } from 'chai';
44
import React from 'react';
55
import sinon from 'sinon';
6-
import Menu from '../../source/react/library/menu/Menu';
7-
import Button from '../../source/react/library/button/Button';
6+
import Menu from '../../source/react/library/menu';
7+
import Button from '../../source/react/library/button';
88
import MenuContext from '../../source/react/internal/popup-menus/menu-context';
99
import { RovingFocusContext } from '../../source/react/helpers/useRovingFocus';
1010

packages/react-layouts/package-lock.json

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/react-layouts/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
"query-string": "^6.13.1",
7474
"ramda": "^0.27.1",
7575
"raw-loader": "^4.0.1",
76-
"react": "^16.13.1",
76+
"react": "^16.14.0",
7777
"react-dom": "^16.13.1",
7878
"react-hot-loader": "^4.12.21",
7979
"react-i18next": "^11.7.1",

0 commit comments

Comments
 (0)