Skip to content

Feat/updates #557

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

Merged
merged 37 commits into from
Dec 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
1275dee
build: updates release script
chrishavekost Nov 13, 2021
877865d
feat(workflow): migrates to dart-sass from node-sass
chrishavekost Nov 13, 2021
297a1d6
feat(workflow): updates webpack-dev-server
chrishavekost Nov 13, 2021
d81baf2
refactor(workflow): removes HMR plugin, dev server entry points
chrishavekost Nov 13, 2021
cdadb9b
refactor(workflow): migrates webpack-dev-server options to work with v4
chrishavekost Nov 13, 2021
6a7cb58
fix(workflow): updates react-refresh, uses enableHotLoader when deter…
chrishavekost Nov 13, 2021
6fb1883
feat(workflow): removes deprecated react-hot-loader
chrishavekost Nov 13, 2021
478accb
feat(workflow): removes ie 11 support
chrishavekost Nov 13, 2021
333edd5
chore: updates url-parse to ^1.5.3
chrishavekost Nov 14, 2021
37a8289
chore: updates commitlint, copy-webpack-plugin, terser-webpack-plugin
chrishavekost Nov 14, 2021
bdab642
build: adds node 16 to pipeline builds
chrishavekost Nov 15, 2021
83f1a6e
chore: udpates eslint, adds cache:true to plugin config
chrishavekost Nov 16, 2021
3eb5d01
feat(workflow): adds caching for eslint
chrishavekost Nov 16, 2021
8819d27
fix(workflow): passes correct option for webpack-dev-server v4
chrishavekost Nov 16, 2021
b08cd6e
feat(workflow): adds infrastructure logging to dev server options
chrishavekost Nov 16, 2021
ede2b45
chore(workflow): catches and logs errors during server startup
chrishavekost Nov 16, 2021
fbb482c
fix(workflow): only copies static files if dir exists
chrishavekost Nov 16, 2021
de6b9e6
chore: fixes and ignores some eslint errors
chrishavekost Nov 16, 2021
e6684f7
fix(workflow): removes nullish coalescing operator
chrishavekost Nov 23, 2021
7f0fea5
docs: adds note about dart-sass deprecation warnings
chrishavekost Nov 23, 2021
1a8c717
chore: upgrades dependencies
chrishavekost Nov 23, 2021
8b66b8a
chore(workflow): updates babel-jest import to resolve breaking change…
chrishavekost Nov 23, 2021
72310b7
refactor(workflow): only uses contenthash in production
chrishavekost Nov 23, 2021
7b26334
refactor(workflow): defaults client.logging to infrastructureLogLevel
chrishavekost Nov 23, 2021
f59d96a
fix(workflow): correctly sets default values, changes default stats l…
chrishavekost Nov 23, 2021
ba375d2
fix(workflow): removes custom stats messages on startup
chrishavekost Nov 23, 2021
c56a462
refactor(workflow): disables dev server overlay on startup, defaults …
chrishavekost Nov 23, 2021
9e5134d
refactor(workflow): uses makeRange to get preferred server ports
chrishavekost Nov 23, 2021
53c8f28
refactor(workflow): yargs works with async operations
chrishavekost Nov 23, 2021
50fea18
chore: commit version strategy
chrishavekost Nov 24, 2021
af73aac
chore: updates engines to support node 16
chrishavekost Nov 24, 2021
25cc384
build: fixes failing yarn version check in CI
chrishavekost Nov 24, 2021
cbc405b
build: re-enables windows-latest workflow, changes cache dir
chrishavekost Nov 24, 2021
86a7db5
build: tries yarn node for eslint support on windows
chrishavekost Nov 24, 2021
83e287a
chore(example): updates typescript eslint packages
chrishavekost Nov 24, 2021
37903be
build: disables windows os in CI
chrishavekost Nov 24, 2021
4380bb4
chore(workflow): updates webpack logging levels for minimal output
chrishavekost Nov 30, 2021
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
2 changes: 1 addition & 1 deletion .github/workflows/dependabot-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
node: [12, 14]
node: [12, 14, 16]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@ jobs:
node-version: 14
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
run: |
echo "::set-output name=dir::$(yarn config get cacheFolder)"
- uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
key: ${{ runner.os }}-14-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
${{ runner.os }}-14-yarn-
- run: yarn install --immutable
- run: yarn constraints
- run: yarn version check
Expand All @@ -46,8 +47,8 @@ jobs:
yarn changelog:generate
git add CHANGELOG.md packages/*
git commit -m "ci: bumps version [skip ci]"
yarn workspaces foreach -ipvt --no-private --since=origin/master npm publish --tolerate-republish --access public
git push
yarn workspaces foreach -ipv --no-private --since=origin/master npm publish --tolerate-republish --access public
git push && git push --tags

- run: yarn build:docs
- name: Deploy docs
Expand Down
15 changes: 9 additions & 6 deletions .github/workflows/pr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,31 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest] # TODO: windows-latest yarn-cache-dir-path
node: [12, 14]
os: [ubuntu-latest, macos-latest] # TODO: re-enable windows-latest after yarn lint fixed
node: [12, 14, 16]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
run: |
echo "::set-output name=dir::$(yarn config get cacheFolder)"

- uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
key: ${{ runner.os }}-${{ matrix.node }}-yarn-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
${{ runner.os }}-${{ matrix.node }}-yarn-

- run: yarn install --immutable
- run: yarn constraints
- run: yarn lint
- run: yarn lint # FIXME: 'node ./node_modules/.bin/eslint .' is mac/linux specific, but 'yarn eslint .' currently broken
- run: yarn test
- run: yarn test:integration
- run: yarn version check
7 changes: 7 additions & 0 deletions .yarn/versions/eab86adc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
releases:
"@availity/dinosaurdocs": minor
"@availity/example": minor
"@availity/mock-server": minor
"@availity/workflow": major
"@availity/workflow-logger": minor
"@availity/workflow-upgrade": minor
50 changes: 24 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ CLI options are documented in it's [README](./packages/workflow/README.md)
module.exports = {
development: {
notification: true
hot: true
hotLoader: true
},
app: {
title: 'My Awesome App'
Expand Down Expand Up @@ -123,11 +123,7 @@ or
```js
module.exports = (config) => {
config.development.open = '/';

config.development.hotLoader = {
enabled: true,
experimental: true
};
config.development.hotLoader = true;

return config;
};
Expand All @@ -152,29 +148,21 @@ Webpack dev server host
Webpack dev server port. If the port at this value is unavailable, the port value will be incremented until an unused port is found.
Default: `3000`

#### `development.logLevel`
#### `development.stats.level`

Allows [Webpack log levels presets](https://webpack.js.org/configuration/stats/#stats) to be used during development.

#### `development.infrastructureLogging.level`

Allows [Webpack log levels presets](https://webpack.js.org/configuration/stats/#stats) to be used during development. A custom logger is used by default.
Allows [Webpack infrastructure log levels](https://webpack.js.org/configuration/other-options/#infrastructurelogging) to be set during development.

#### `development.sourceMap`

Webpack `devtool` setting. Default is `source-map`. For more options please see <https://webpack.js.org/configuration/devtool/#devtool>.

#### `development.hotLoader`

Enable or disable react-hot-loader. Default is `true`.

Can also be an object to enable experimental `react-refresh` features
ex.

```json
{
"hotLoader": {
"enabled": true,
"experimental": true
}
}
```
Enable or disable Fast Refresh using [`react-refresh`](https://github.com/pmmmwh/react-refresh-webpack-plugin). Default is `true`.

#### `development.webpackDevServer`

Expand All @@ -188,7 +176,9 @@ When starting the dev server using production settings as a dry run, `yarn start

```js
{
contentBase: path.join(process.cwd(), 'dist'),
static: {
directory: path.join(process.cwd(), 'dist'),
},
compress: true, // gzip content before serving
port: 3000, // serve content on localhost:3000
};
Expand All @@ -198,7 +188,7 @@ When starting the dev server using production settings as a dry run, `yarn start

Allows developers to override the `webpack` target to match their developer environment. This is beneficial if a developer is doing their primary development environment in a browser like Chrome 57+ that already supports a lot of the ES6 features, therefore, not needing to Babelfy code completely.

This setting is is only used for development and does not effect staging/production/testing builds which default to `'browserslist: defaults, ie 11'`. **@See** [https://webpack.js.org/configuration/target/](https://webpack.js.org/configuration/target/)
This setting is is only used for development and does not effect staging/production/testing builds which default to `'browserslist: defaults'`. **@See** [https://webpack.js.org/configuration/target/](https://webpack.js.org/configuration/target/)

##### Note about `browserslist`

Expand Down Expand Up @@ -482,13 +472,19 @@ Now the runtime issue has been resolved! Note that this only polyfills `process`

[Link to specific vfile issue and solution](https://github.com/vfile/vfile/issues/38#issuecomment-683198538)

### How can I test locally running code in IE 11?
### Why are there so many deprecation warnings when compiling or running the dev server?

`@availity/workflow` has recently switched from the deprecated `node-sass` to `dart-sass`, which emits these upcoming deprecation warnings. [The Node API is not able to use the `--quiet-upstream` flag](https://github.com/sass/dart-sass/issues/672#issuecomment-846311746), but these warnings can be safely ignored. They will eventually be handled by Availity's UI Kit and other upstream dependencies.

### **DEPRECATED IE 11 SECTION**

#### How can I test locally running code in IE 11?

The webpack config for development does not actively support development in IE 11, even though our production config does. In both environments we will transpile our Availity packages to meet that target, and in production we take the extra step to transform all other packages and hit the IE 11 compatibility target.

Most packages will ship transpiled, but more and more are starting to drop IE 11 support. In production that still doesn't affect us, we will make necessary changes to support IE 11, but for active local development you have a few ways forward to avoid things like syntax errors inside `node_modules`:

### Recommended Approach
#### Recommended Approach

This approach, requiring the least amount of investigating, is to develop locally against modern targets, then use a combination of `yarn build:production`, `yarn start --dry-run`, and something like below inside `workflow.js` to allow you to test what the production-like code will look like in IE 11.

Expand All @@ -508,12 +504,14 @@ if (dryRun) {

This will instruct the webpackDevServer to serve content from your `dist` folder. Running `yarn build:production` will generate the production-like code and place it in the `dist` folder. Then, after manually setting a `dryRun` boolean to `true` inside `workflow.js` (or setting it up to take a command-line argument), you can run `yarn start --dry-run` which will start up the dev server with some production-like settings, and serve your IE 11 compatible-code for testing.

### Other Approaches
#### Other Approaches

- Figure out which packages are causing the issue and then add them to `configuration.development.babelInclude` inside `workflow.js`

- Alternatively, use `modifyWebpackConfig` to include the packages and specify a custom loader or rule for them https://github.com/Availity/availity-workflow#modifywebpackconfig

### **END DEPRECATED IE 11 SECTION**

### How to integrate with Visual Studio Code's [Jest plugin](https://marketplace.visualstudio.com/items?itemName=Orta.vscode-jest)?

Create `./vscode/settings.json` file with the following configuration:
Expand Down
8 changes: 1 addition & 7 deletions docusaurus/docs/reference/workflow-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,16 +130,10 @@ Optional options for Webpack development server. If undefined, `workflow` defaul

Allows developers to override the `babel-preset-env` target to match their developer environment. This is beneficial if a developer is doing their primary development environment in a browser like Chrome 57+ that already supports a lot of the ES6 features, therefore, not needing to Babelfy code completely.

This setting is is only used for development and does not effect staging/production/testing builds which default to `IE11`. **@See** [https://github.com/babel/babel-preset-env](https://github.com/babel/babel-preset-env)
This setting is is only used for development and does not effect staging/production/testing builds which use browserslist defaults. **@See** [https://github.com/babel/babel-preset-env](https://github.com/babel/babel-preset-env)

**Examples:**

```js
targets: {
ie: 11;
}
```

```js
targets: {
browsers: ['last 2 Chrome versions'];
Expand Down
4 changes: 2 additions & 2 deletions docusaurus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"@docusaurus/preset-classic": "2.0.0-alpha.70",
"@mdx-js/react": "^1.5.8",
"clsx": "^1.1.1",
"react": "^16.11.0",
"react-dom": "^16.11.0"
"react": "^16.14.0",
"react-dom": "^16.14.0"
},
"browserslist": {
"production": [
Expand Down
65 changes: 32 additions & 33 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,45 +31,44 @@
"license": "MIT",
"homepage": "https://github.com/availity/availity-workflow#readme",
"dependencies": {
"@availity/api-axios": "^5.4.4",
"@availity/api-core": "^6.0.1",
"@availity/breadcrumbs": "^3.1.5",
"@availity/favorites": "^2.1.30",
"@availity/form": "^0.5.8",
"@availity/icon": "^0.7.17",
"@availity/api-axios": "^6.0.5",
"@availity/breadcrumbs": "^3.2.0",
"@availity/favorites": "^2.3.0",
"@availity/form": "^1.2.0",
"@availity/icon": "^0.10.0",
"@availity/localstorage-core": "^3.0.0",
"@availity/page-header": "^10.0.63",
"@availity/spaces": "4.0.26",
"@availity/yup": "^3.0.7",
"availity-uikit": "^3.0.0",
"axios": "^0.20.0",
"classnames": "^2.2.6",
"formik": "^2.0.3",
"prop-types": "^15.5.7",
"react": "^16.11.0",
"react-block-ui": "^1.3.2",
"react-dom": "^16.11.0",
"reactstrap": "^8.6.0",
"yup": "^0.29.3"
"@availity/page-header": "^11.1.3",
"@availity/spaces": "5.1.0",
"@availity/yup": "^4.1.0",
"availity-uikit": "^4.1.5",
"axios": "^0.24.0",
"classnames": "^2.3.1",
"formik": "^2.2.9",
"prop-types": "^15.7.2",
"react": "^16.14.0",
"react-block-ui": "^1.3.3",
"react-dom": "^16.14.0",
"reactstrap": "^8.10.1",
"yup": "^0.32.11"
},
"devDependencies": {
"@availity/workflow": "workspace:*",
"@testing-library/react": "^11.0.4",
"@types/jest": "^26.0.14",
"@types/node": "^14.11.2",
"@types/react": "^16.9.11",
"@types/react-dom": "^16.9.4",
"@types/reactstrap": "^8.0.6",
"@types/yup": "^0.29.7",
"@typescript-eslint/eslint-plugin": "^4.33.0",
"@typescript-eslint/parser": "^4.33.0",
"cross-env": "^7.0.2",
"eslint-config-availity": "^7.1.1",
"@testing-library/react": "^12.1.2",
"@types/jest": "^27.0.3",
"@types/node": "^16.11.9",
"@types/react": "^16.14.21",
"@types/react-dom": "^16.9.14",
"@types/reactstrap": "^8.7.1",
"@types/yup": "^0.29.13",
"@typescript-eslint/eslint-plugin": "^5.4.0",
"@typescript-eslint/parser": "^5.4.0",
"cross-env": "^7.0.3",
"eslint-config-availity": "^8.0.5",
"eslint-import-resolver-root-import": "^1.0.4",
"eslint-import-resolver-typescript": "^2.3.0",
"jest": "^26.4.2",
"eslint-import-resolver-typescript": "^2.5.0",
"jest": "^27.3.1",
"jest-dom": "^4.0.0",
"typescript": "^4.4.4"
"typescript": "^4.5.2"
},
"lint-staged": {
"*.(js|ts|jsx|tsx)": [
Expand Down
2 changes: 1 addition & 1 deletion example/project/app/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ import { render } from 'react-dom';
import './index.scss';
import 'react-block-ui/style.css';
import '@availity/yup';
import App from './App.tsx';
import App from './App';

render(<App />, document.querySelector('#root'));
7 changes: 3 additions & 4 deletions example/project/config/workflow.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ const path = require('path');
module.exports = (config) => {
config.development.open = '/';

config.development.hotLoader = {
enabled: true,
experimental: true,
};
config.development.hotLoader = true;

config.ekko.enabled = false;

config.modifyWebpackConfig = (webpackConfig, settings) => {
webpackConfig.resolveLoader.modules.push(path.join(settings.project(), '../node_modules'));
Expand Down
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,26 @@
"name": "availity-workflow",
"engines": {
"yarn": "^3.0.0",
"node": "^12.0.0 || ^14.0.0"
"node": "^12.0.0 || ^14.0.0 || ^16.0.0"
},
"workspaces": [
"packages/*",
"docusaurus",
"example"
],
"devDependencies": {
"@commitlint/cli": "^11.0.0",
"@commitlint/config-conventional": "^11.0.0",
"@types/is-ci": "^3",
"conventional-changelog-cli": "^2.0.27",
"@commitlint/cli": "^15.0.0",
"@commitlint/config-conventional": "^15.0.0",
"@types/is-ci": "^3.0.0",
"conventional-changelog-cli": "^2.1.1",
"conventional-changelog-conventionalcommits": "^4.6.1",
"dependency-check": "^4.1.0",
"eslint-config-availity": "^7.1.1",
"gh-pages": "^3.1.0",
"husky": "^7.0.0",
"eslint-config-availity": "^8.0.5",
"gh-pages": "^3.2.3",
"husky": "^7.0.4",
"is-ci": "^3.0.1",
"jest": "^26.4.2",
"lint-staged": "^10.4.0",
"jest": "^27.3.1",
"lint-staged": "^12.1.2",
"prettier": "^2.4.1"
},
"scripts": {
Expand Down
14 changes: 7 additions & 7 deletions packages/mock-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
"license": "MIT",
"dependencies": {
"@availity/mock-data": "workspace:*",
"body-parser": "^1.18.2",
"chalk": "^4.1.0",
"compression": "^1.7.0",
"body-parser": "^1.19.0",
"chalk": "^4.1.2",
"compression": "^1.7.4",
"connect-busboy": "0.0.2",
"cors": "^2.8.4",
"delay": "^4.0.0",
"errorhandler": "^1.5.0",
"express": "^4.15.5",
"cors": "^2.8.5",
"delay": "^5.0.0",
"errorhandler": "^1.5.1",
"express": "^4.17.1",
"lodash": "^4.17.21",
"method-override": "^3.0.0",
"on-finished": "^2.3.0"
Expand Down
Loading