Skip to content

Commit

Permalink
fix(build): npm updates (#912)
Browse files Browse the repository at this point in the history
* build, move npmCheckUpdates to sh
* docs, schedule for deps updates
  • Loading branch information
cdcabrera committed Jun 14, 2022
1 parent e90b0c6 commit fef62d1
Show file tree
Hide file tree
Showing 7 changed files with 654 additions and 627 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ node_modules
.pnp*

# logs
dependency-update-log.txt
npm-debug.log*
yarn-debug.log*
yarn-error.log*
Expand Down
13 changes: 13 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,19 @@ Things to try:
You can take the easy way out and just run, `$ yarn start`, it'll be styled and use mock data, but you'll have enough access to continue development.
## Build
### Maintenance
#### NPMs
Our schedule for updating NPMs
- dependabot running once a week on low level packages that require only testing confirmation
- 1x a month: running our aggregated dependency update script for all low level packages that require only testing confirmation
- `$ yarn build:deps`
- 1x a month: running updates on NPMs that require additional visual confirmation, this includes...
- dependency-name: "@patternfly/*"
- dependency-name: "@redhat-cloud-services/frontend*"
- dependency-name: "*i18next*"
- dependency-name: "victory*"
- dependency-name: "react-router*"
### dotenv files
Our current build leverages `dotenv`, or `.env*`, files to apply environment build configuration.
Expand Down
52 changes: 26 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"build:js": "export NODE_ENV=production; webpack --config config/webpack.prod.config.js",
"build:post": "bash ./scripts/post.sh",
"build:pre": "bash ./scripts/pre.sh",
"build:deps": "ncu --doctor -u --doctorInstall \"yarn\" --doctorTest \"yarn test:deps\" --reject \"@patternfly/*, @redhat-cloud-services/frontend*, victory*\"",
"build:deps": "bash ./scripts/dependencies.sh --doctor -u --doctorInstall \"yarn\" --doctorTest \"yarn test:deps\" --reject \"@patternfly/*, @redhat-cloud-services/frontend*, victory*\"",
"dev:chrome": "bash ./scripts/dev.chrome.sh -b prod-stable",
"release": "standard-version",
"start": "run-p -l api:dev start:js",
Expand All @@ -78,31 +78,31 @@
},
"dependencies": {
"@joi/date": "^2.1.0",
"@patternfly/patternfly": "4.171.1",
"@patternfly/react-charts": "6.45.15",
"@patternfly/react-core": "4.192.15",
"@patternfly/react-icons": "4.43.15",
"@patternfly/react-styles": "4.42.15",
"@patternfly/react-table": "4.61.15",
"@patternfly/react-tokens": "4.44.15",
"@redhat-cloud-services/frontend-components": "3.7.0",
"@patternfly/patternfly": "4.183.1",
"@patternfly/react-charts": "6.51.19",
"@patternfly/react-core": "4.198.19",
"@patternfly/react-icons": "4.49.19",
"@patternfly/react-styles": "4.48.19",
"@patternfly/react-table": "4.67.19",
"@patternfly/react-tokens": "4.50.19",
"@redhat-cloud-services/frontend-components": "3.8.3",
"@redhat-cloud-services/frontend-components-notifications": "3.2.5",
"@redhat-cloud-services/frontend-components-utilities": "3.2.8",
"axios": "^0.26.0",
"@redhat-cloud-services/frontend-components-utilities": "3.2.12",
"axios": "^0.26.1",
"classnames": "^2.3.1",
"i18next": "^21.6.11",
"i18next": "^21.6.14",
"i18next-xhr-backend": "^3.2.2",
"joi": "^17.6.0",
"js-cookie": "^3.0.1",
"locale-code": "^2.0.2",
"lodash": "^4.17.21",
"lru-cache": "^7.3.1",
"lru-cache": "^7.7.1",
"moment": "^2.29.1",
"numbro": "^2.3.6",
"prop-types": "^15.8.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-i18next": "^11.15.4",
"react-i18next": "^11.16.2",
"react-redux": "^7.2.6",
"react-router": "^5.2.1",
"react-router-dom": "^5.3.0",
Expand All @@ -112,32 +112,32 @@
"redux-promise-middleware": "^6.1.2",
"redux-thunk": "^2.4.1",
"reselect": "^4.1.5",
"victory": "36.3.0",
"victory-create-container": "36.3.0"
"victory": "36.3.1",
"victory-create-container": "36.3.1"
},
"devDependencies": {
"@babel/core": "7.17.5",
"@babel/core": "7.17.8",
"@babel/eslint-parser": "^7.17.0",
"@redhat-cloud-services/frontend-components-config": "4.6.2",
"@redhat-cloud-services/frontend-components-config": "4.6.6",
"@wojtekmaj/enzyme-adapter-react-17": "^0.6.6",
"apidoc-mock": "^4.0.2",
"babel-jest": "^27.5.1",
"babel-preset-react-app": "^10.0.1",
"copy-webpack-plugin": "^10.2.4",
"cspell": "^5.18.5",
"cspell": "^5.19.3",
"dotenv": "^16.0.0",
"dotenv-expand": "^8.0.1",
"dotenv-expand": "^8.0.3",
"dotenv-webpack": "^7.1.0",
"enzyme": "^3.11.0",
"enzyme-to-json": "^3.6.2",
"eslint": "8.9.0",
"eslint": "8.11.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-prettier": "^8.4.0",
"eslint-config-prettier": "^8.5.0",
"eslint-config-react-app": "^7.0.0",
"eslint-plugin-flowtype": "^8.0.3",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-jest": "^26.1.1",
"eslint-plugin-jsdoc": "^37.9.4",
"eslint-plugin-jest": "^26.1.3",
"eslint-plugin-jsdoc": "^38.0.6",
"eslint-plugin-json": "^3.1.0",
"eslint-plugin-jsx-a11y": "^6.5.1",
"eslint-plugin-prettier": "^4.0.0",
Expand All @@ -150,9 +150,9 @@
"jest-resolve": "27.5.1",
"jest-watch-typeahead": "1.0.0",
"moxios": "^0.4.0",
"npm-check-updates": "^12.5.0",
"npm-check-updates": "^12.5.4",
"npm-run-all": "^4.1.5",
"prettier": "^2.5.1",
"prettier": "^2.6.1",
"redux-mock-store": "^1.5.4",
"standard-version": "^9.3.2",
"swagger-ui-express": "^4.3.0",
Expand Down
25 changes: 25 additions & 0 deletions scripts/dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash
#
#
# main()
#
{
GREEN="\e[32m"
YELLOW="\e[33m"
NOCOLOR="\e[39m"

echo "Confirm and update build dependencies..."

DEPS_UPDATE=$(ncu "$@");
echo "$DEPS_UPDATE"

DEPS_LOG=$(ncu);
echo $DEPS_LOG

printf "${YELLOW}Generate dependency log...${NOCOLOR}"
echo "Curiosity dependency update log" > ./dependency-update-log.txt
echo "$DEPS_UPDATE" >> ./dependency-update-log.txt
echo "$DEPS_LOG" >> ./dependency-update-log.txt
printf "${GREEN}COMPLETED${NOCOLOR}\n"
printf "${YELLOW}Log generated at ./dependency-update-log.txt${NOCOLOR}\n"
}
20 changes: 20 additions & 0 deletions src/components/table/__tests__/__snapshots__/table.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ exports[`Table Component should allow expandable content: expandable content 1`]
<Table
aria-label="t(curiosity-inventory.tableAriaLabel, {\\"appName\\":\\"Subscriptions\\"})"
borders={true}
canCollapseAll={true}
canSelectAll={true}
canSortFavorites={true}
cells={
Expand All @@ -20,6 +21,7 @@ exports[`Table Component should allow expandable content: expandable content 1`]
]
}
className="curiosity-table "
collapseAllAriaLabel=""
contentId="expanded-content"
dropdownDirection="down"
dropdownPosition="right"
Expand Down Expand Up @@ -83,6 +85,7 @@ exports[`Table Component should allow expandable content: expanded row 1`] = `
<Table
aria-label="t(curiosity-inventory.tableAriaLabel, {\\"appName\\":\\"Subscriptions\\"})"
borders={true}
canCollapseAll={true}
canSelectAll={true}
canSortFavorites={true}
cells={
Expand All @@ -93,6 +96,7 @@ exports[`Table Component should allow expandable content: expanded row 1`] = `
]
}
className="curiosity-table "
collapseAllAriaLabel=""
contentId="expanded-content"
dropdownDirection="down"
dropdownPosition="right"
Expand Down Expand Up @@ -156,6 +160,7 @@ exports[`Table Component should allow sortable content: sortable content 1`] = `
<Table
aria-label="t(curiosity-inventory.tableAriaLabel, {\\"appName\\":\\"Subscriptions\\"})"
borders={true}
canCollapseAll={true}
canSelectAll={true}
canSortFavorites={true}
cells={
Expand All @@ -170,6 +175,7 @@ exports[`Table Component should allow sortable content: sortable content 1`] = `
]
}
className="curiosity-table "
collapseAllAriaLabel=""
contentId="expanded-content"
dropdownDirection="down"
dropdownPosition="right"
Expand Down Expand Up @@ -223,6 +229,7 @@ exports[`Table Component should allow sortable content: sorted column callback 1
<Table
aria-label="t(curiosity-inventory.tableAriaLabel, {\\"appName\\":\\"Subscriptions\\"})"
borders={true}
canCollapseAll={true}
canSelectAll={true}
canSortFavorites={true}
cells={
Expand Down Expand Up @@ -253,6 +260,7 @@ exports[`Table Component should allow sortable content: sorted column callback 1
]
}
className="curiosity-table "
collapseAllAriaLabel=""
contentId="expanded-content"
dropdownDirection="down"
dropdownPosition="right"
Expand Down Expand Up @@ -311,6 +319,7 @@ exports[`Table Component should allow variations in table layout: ariaLabel and
<Table
aria-label="lorem ipsum aria-label"
borders={false}
canCollapseAll={true}
canSelectAll={true}
canSortFavorites={true}
cells={
Expand All @@ -321,6 +330,7 @@ exports[`Table Component should allow variations in table layout: ariaLabel and
]
}
className="curiosity-table-no-border "
collapseAllAriaLabel=""
contentId="expanded-content"
dropdownDirection="down"
dropdownPosition="right"
Expand Down Expand Up @@ -371,6 +381,7 @@ exports[`Table Component should allow variations in table layout: borders and ta
<Table
aria-label="t(curiosity-inventory.tableAriaLabel, {\\"appName\\":\\"Subscriptions\\"})"
borders={false}
canCollapseAll={true}
canSelectAll={true}
canSortFavorites={true}
cells={
Expand All @@ -381,6 +392,7 @@ exports[`Table Component should allow variations in table layout: borders and ta
]
}
className="curiosity-table-no-border "
collapseAllAriaLabel=""
contentId="expanded-content"
dropdownDirection="down"
dropdownPosition="right"
Expand Down Expand Up @@ -431,6 +443,7 @@ exports[`Table Component should allow variations in table layout: className and
<Table
aria-label="lorem ipsum aria-label"
borders={false}
canCollapseAll={true}
canSelectAll={true}
canSortFavorites={true}
cells={
Expand All @@ -441,6 +454,7 @@ exports[`Table Component should allow variations in table layout: className and
]
}
className="curiosity-table-no-border lorem-ipsum-class"
collapseAllAriaLabel=""
contentId="expanded-content"
dropdownDirection="down"
dropdownPosition="right"
Expand Down Expand Up @@ -491,6 +505,7 @@ exports[`Table Component should allow variations in table layout: generated rows
<Table
aria-label="t(curiosity-inventory.tableAriaLabel, {\\"appName\\":\\"Subscriptions\\"})"
borders={true}
canCollapseAll={true}
canSelectAll={true}
canSortFavorites={true}
cells={
Expand All @@ -501,6 +516,7 @@ exports[`Table Component should allow variations in table layout: generated rows
]
}
className="curiosity-table "
collapseAllAriaLabel=""
contentId="expanded-content"
dropdownDirection="down"
dropdownPosition="right"
Expand Down Expand Up @@ -552,6 +568,7 @@ exports[`Table Component should pass child components, nodes when there are no r
<Table
aria-label="t(curiosity-inventory.tableAriaLabel, {\\"appName\\":\\"Subscriptions\\"})"
borders={true}
canCollapseAll={true}
canSelectAll={true}
canSortFavorites={true}
cells={
Expand All @@ -562,6 +579,7 @@ exports[`Table Component should pass child components, nodes when there are no r
]
}
className="curiosity-table "
collapseAllAriaLabel=""
contentId="expanded-content"
dropdownDirection="down"
dropdownPosition="right"
Expand Down Expand Up @@ -597,6 +615,7 @@ exports[`Table Component should render a non-connected component: non-connected
<Table
aria-label="t(curiosity-inventory.tableAriaLabel, {\\"appName\\":\\"Subscriptions\\"})"
borders={true}
canCollapseAll={true}
canSelectAll={true}
canSortFavorites={true}
cells={
Expand All @@ -616,6 +635,7 @@ exports[`Table Component should render a non-connected component: non-connected
]
}
className="curiosity-table "
collapseAllAriaLabel=""
contentId="expanded-content"
dropdownDirection="down"
dropdownPosition="right"
Expand Down
Loading

0 comments on commit fef62d1

Please sign in to comment.