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

Node 18 & Jest 29 #2210

Merged
merged 43 commits into from
Nov 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
3c3c46f
Add Node 18 to tests
AlbertoBrusa Nov 7, 2022
efbb100
Add Node 18 to supported engines
AlbertoBrusa Nov 7, 2022
5772293
Pinned rollup-plugin-esbuild to 4.10.1 as newer versions drop support…
AlbertoBrusa Nov 7, 2022
daa248e
Updated yarn.lock
AlbertoBrusa Nov 7, 2022
616a6cb
Update build.test snapshot
AlbertoBrusa Nov 8, 2022
eeeea94
Update modular-scripts snapshot
AlbertoBrusa Nov 8, 2022
94aad39
Change rollup-plugin-eslint to latest compatible version
AlbertoBrusa Nov 9, 2022
4bcf9b5
Added changeset
AlbertoBrusa Nov 9, 2022
fae4e7c
Update lockfile
AlbertoBrusa Nov 9, 2022
105aa18
Resolve to source-map ^0.7.0 to try and fix https://github.com/mozill…
AlbertoBrusa Nov 9, 2022
561602b
Try to resolve v8-to-istanbul to fix https://github.com/mozilla/sourc…
AlbertoBrusa Nov 9, 2022
91b1b56
Merge branch 'main' of https://github.com/jpmorganchase/modular into …
AlbertoBrusa Nov 10, 2022
66851de
Dropped support for Node 14.17.0 (14.18.0 and greater) to allow upgra…
AlbertoBrusa Nov 10, 2022
016a4c2
Update tests to use Node 14.18.0
AlbertoBrusa Nov 10, 2022
37d7519
Make tests use Node 14.18.0
AlbertoBrusa Nov 10, 2022
6bc398d
update jest to 29
AlbertoBrusa Nov 10, 2022
be97f64
change Node 16 supported version to 16.10+ as that's what Jest supports
AlbertoBrusa Nov 10, 2022
a21371e
Upgrade to Jest 29 and fix problems caused by the upgrade
AlbertoBrusa Nov 14, 2022
e27117a
Update changelog
AlbertoBrusa Nov 14, 2022
4dddf8b
Update snapshots (default no longer includes escape characters etc)
AlbertoBrusa Nov 14, 2022
6369acf
Update snapshots not to include espace caracters
AlbertoBrusa Nov 14, 2022
a7eacb3
More snapshots updates
AlbertoBrusa Nov 14, 2022
530c935
Change env for port tests to Node
AlbertoBrusa Nov 15, 2022
99b4c0d
Update snapshots and switch default test env to Node (while setting i…
AlbertoBrusa Nov 15, 2022
0dd0c7a
Update more snapshots
AlbertoBrusa Nov 15, 2022
3758206
Remove broken Rename test (Rename functionality to be removed with Mo…
AlbertoBrusa Nov 16, 2022
700267f
Fix tests (test.test wasn't closing after running with the --watchAll…
AlbertoBrusa Nov 16, 2022
2559c07
Try to fix tests on Windows
AlbertoBrusa Nov 17, 2022
66fd5d2
DEBUG windows tests
AlbertoBrusa Nov 17, 2022
393d950
Fix windows tests
AlbertoBrusa Nov 17, 2022
469816d
Try more things to fix tests
AlbertoBrusa Nov 17, 2022
508b9da
More attempts to fix windows tests
AlbertoBrusa Nov 17, 2022
e7d34cc
More desperate attempts to fix windows tests
AlbertoBrusa Nov 17, 2022
4badd56
Clean up windows fix
AlbertoBrusa Nov 17, 2022
a7d0cb5
Cleanup
AlbertoBrusa Nov 17, 2022
631d2a4
Update changeset
AlbertoBrusa Nov 17, 2022
a1410e6
Set Jest watchAll default to false regardless of if CI or not
AlbertoBrusa Nov 21, 2022
3552d2b
Added ESLint ignore comments to svgr.ts for new TS complaints
AlbertoBrusa Nov 21, 2022
397652a
Documentation
AlbertoBrusa Nov 21, 2022
fda49b3
Update docs
AlbertoBrusa Nov 21, 2022
a7f1741
Add feature/v4 to branches to run CI Tests on (Needs to be reverted b…
AlbertoBrusa Nov 21, 2022
cf48235
Small fixes
AlbertoBrusa Nov 21, 2022
b173d0c
Refactor out generateJestConfig flag logic to reduce duplication
AlbertoBrusa Nov 21, 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
14 changes: 14 additions & 0 deletions .changeset/fluffy-dragons-behave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
'create-modular-react-app': major
'eslint-config-modular-app': major
'modular-scripts': major
'modular-template-app': patch
'modular-template-esm-view': patch
'modular-template-view': patch
---

Added Node 18 engine support
Upgraded Jest from 26 to 29 as 26 wasn't compatible with Node 18
Upgraded to rollup-plugin-esbuild 5, dropping support for Node 14.17 and below
Supported Node versions now: ^14.18.0 || >=16.10.0 || >=18.0.0
Changed Jest flag --watchAll default to false (was previously true if running locally and not in CI)
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v3.3.0
with:
node-version: '14.17.0'
node-version: '14.18.0'
registry-url: https://registry.npmjs.org/
cache: 'yarn'

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Lint

on:
push:
branches: [main, 'release/**']
branches: [main, 'release/**', feature/v4]
pull_request:
branches: [main, 'release/**']
branches: [main, 'release/**', feature/v4]

jobs:
Static:
Expand All @@ -29,7 +29,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v3.3.0
with:
node-version: '14.17.0'
node-version: '14.18.0'
cache: 'yarn'

- name: 'Install Dependencies'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ name: Windows Test

on:
push:
branches: [main, 'release/**']
branches: [main, 'release/**', feature/v4]
pull_request:
branches: [main, 'release/**']
branches: [main, 'release/**', feature/v4]

jobs:
Test:
Expand All @@ -20,7 +20,7 @@ jobs:
fail-fast: false
matrix:
os: [windows-latest]
node-version: ['14.17.0', '16.x']
node-version: ['14.18.0', '16.x', '18.x']

steps:
- uses: actions/checkout@v3
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ name: Test

on:
push:
branches: [main, 'release/**']
branches: [main, 'release/**', feature/v4]
pull_request:
branches: [main, 'release/**']
branches: [main, 'release/**', feature/v4]

jobs:
Test:
Expand All @@ -22,7 +22,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
node-version: ['14.17.0', '16.x']
node-version: ['14.18.0', '16.x', '18.x']

steps:
- uses: actions/checkout@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: 'Validate'
on:
push:
branches: [main, 'release/**']
branches: [main, 'release/**', feature/v4]
pull_request:
branches: [main, 'release/**']
branches: [main, 'release/**', feature/v4]

jobs:
check-yarn-lock-registry:
Expand Down
81 changes: 81 additions & 0 deletions docs/releases/4.0.x.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
---
parent: Release Notes
title: 4.0.x
---

# Modular 4.0.0 (IN PROGRESS, EDIT BEFORE RELEASE)

## New Features

- Node 18 Support
- Updated Jest to [^29.3.1](https://github.com/facebook/jest/releases)

## Breaking Changes

### Upgraded to Jest 29

Jest has been bumped up three major versions from Jest 26, and it comes with a
number of breaking changes.

We suggest reading through the following migration guides:

- [Jest 26 to 27 Change Log](https://github.com/facebook/jest/releases/tag/v27.0.0)
- [Jest 27 to 28 Migration Guide](https://jestjs.io/docs/28.x/upgrading-to-jest28)
| [Change log](https://github.com/facebook/jest/releases/tag/v28.0.0)
- [Jest 28 to 29 Migration Guide](https://jestjs.io/docs/next/upgrading-to-jest29)
| [Change log](https://github.com/facebook/jest/releases/tag/v29.0.0)

Some noteworthy breaking changes:

- Changed default snapshot formatting options to {escapeString: false,
printBasicPrototype: false} as outlined by
[this blogpost](https://jestjs.io/blog/2022/04/25/jest-28#future) - Any
snapshots tests will have to be updated with the new format, or you can
override the snapshotFormat option to the old defaults.
- As of Jest 28 Jest-Environment-JSDOM is no longer shipped with Jest and needs
to be installed separately
- Jest now includes full support of package.json exports - some existing imports
might not resolve correctly

### Upgraded to ESLint 8

(NOT YET DONE, ADD ANY ISSUES/BREAKING CHANGES)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Started documenting Modular 4.0 changes - will be updating it in future PRs before release


### Removed Commands

We no longer provide the following commands: (FILL AS NEEDED) (PROVIDE/LINK
DOCUMENTATION FOR HOW TO REPLICATE COMMAND BEHAVIOUR MANUALLY)

### Other

- Jest `--watchAll` flag when running modular test is now `false` by default
(Previously set to true unless running in CI)
- Dropped support for minor versions of Node 14.17 and Node 16 version 16.9 and
below
- Now support Node ^14.18.0, >=16.10.0, and >=18.0.0

# Merged Changes

ADD WHEN RELEASING

<!-- UPDATE WHEN RELEASING - `modular-scripts` @ 3.4.0 - See
[the GitHub release](https://github.com/jpmorganchase/modular/releases/tag/modular-scripts%403.4.0)
for full details
- `create-modular-react-app` @ 3.0.1 - See
[the GitHub release](https://github.com/jpmorganchase/modular/releases/tag/create-modular-react-app%403.0.1)
for full details
- `eslint-config-modular-app` @ 3.0.2 - See
[the GitHub release](https://github.com/jpmorganchase/modular/releases/tag/eslint-config-modular-app%403.0.2)
for full details
- `@modular-scripts/modular-types` @ 1.1.0 - See
[the GitHub release](https://github.com/jpmorganchase/modular/releases/tag/%40modular-scripts%2Fmodular-types%401.1.0)
for full details
- `@modular-scripts/workspace-resolver` @ 1.1.0 - See
[the GitHub release](https://github.com/jpmorganchase/modular/releases/tag/%40modular-scripts%2Fworkspace-resolver%401.1.0)
for full details -->

# Patch Versions

Patch versions of this release do not have a dedicated summary. For details of
patch releases, please visit
[the GitHub releases page](https://github.com/jpmorganchase/modular/releases).
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"packages/**"
],
"engines": {
"node": "^14.17.0 || >=16.0.0"
"node": "^14.18.0 || >=16.10.0 || >=18.0.0"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Matched node support to what Jest 29 supports

},
"repository": "https://github.com/jpmorganchase/modular.git",
"scripts": {
Expand All @@ -14,7 +14,7 @@
"lint:fix": "yarn lint --fix",
"create-modular-react-app": "ts-node packages/create-modular-react-app/src/cli.ts",
"modular": "ts-node packages/modular-scripts/src/cli.ts",
"test": "yarn modular test --watchAll false --runInBand",
"test": "yarn modular test --watchAll false --runInBand --env node",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our tests are mostly back end tests that don't require the JSDOM env that we set as default for Modular (Modular users will continue to use JSDOM as default)
Modular tests that build/run front end components have been changed to specify JSDOM as the env (ignoring the flag passed here)

"build": "yarn workspace @modular-scripts/workspace-resolver build && yarn workspace create-modular-react-app build && yarn workspace modular-scripts build && yarn workspace modular-views.macro build",
"start": "yarn modular start modular-site",
"prepare": "is-ci || husky install",
Expand Down Expand Up @@ -59,7 +59,7 @@
"@types/global-modules": "^2.0.0",
"@types/html-minifier-terser": "6.1.0",
"@types/is-ci": "3.0.0",
"@types/jest": "26.0.24",
"@types/jest": "^29.0.0",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting Jest version range to allow minor updates so that we stay up to date until we come across any issues

"@types/mime": "^2.0.3",
"@types/node": "*",
"@types/npm-packlist": "3.0.0",
Expand All @@ -80,6 +80,7 @@
"execa": "5.1.1",
"husky": "8.0.1",
"is-ci": "2.0.0",
"jest-environment-jsdom": "^29.3.1",
"lint-staged": "12.4.1",
"micromatch": "4.0.5",
"patch-package": "^6.4.7",
Expand Down
2 changes: 1 addition & 1 deletion packages/create-modular-react-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"./package.json": "./package.json"
},
"engines": {
"node": "^14.17.0 || >=16.0.0"
"node": "^14.18.0 || >=16.10.0 || >=18.0.0"
},
"scripts": {
"create-modular-react-app": "ts-node src/cli.ts",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ exports[`create-modular-react-app WHEN it sets up a project with prefer Offline
"version": "0.1.0",
}
1`] = `
Object {
{
"author": "?",
"modular": Object {
"modular": {
"type": "app",
},
"name": "app",
Expand Down Expand Up @@ -83,21 +83,21 @@ exports[`create-modular-react-app WHEN it sets up a project with prefer Offline
],
}
1`] = `
Object {
{
"author": "?",
"browserslist": Object {
"development": Array [
"browserslist": {
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version",
],
"production": Array [
"production": [
">0.2%",
"not dead",
"not op_mini all",
],
},
"dependencies": Object {
"dependencies": {
"@testing-library/dom": "?",
"@testing-library/jest-dom": "?",
"@testing-library/react": "?",
Expand All @@ -114,31 +114,31 @@ Object {
"react-dom": "?",
"typescript": "?",
},
"eslintConfig": Object {
"eslintConfig": {
"extends": "modular-app",
},
"license": "MIT",
"main": "index.js",
"modular": Object {
"modular": {
"type": "root",
},
"name": "test-repo",
"prettier": Object {
"prettier": {
"printWidth": 80,
"proseWrap": "always",
"singleQuote": true,
"trailingComma": "all",
},
"private": true,
"scripts": Object {
"scripts": {
"build": "modular build",
"lint": "eslint . --ext .js,.ts,.tsx",
"prettier": "prettier --write .",
"start": "modular start",
"test": "modular test",
},
"version": "1.0.0",
"workspaces": Array [
"workspaces": [
"packages/**",
],
}
Expand Down Expand Up @@ -236,9 +236,9 @@ exports[`create-modular-react-app WHEN setting a project with defaults Sets up a
"version": "0.1.0",
}
1`] = `
Object {
{
"author": "?",
"modular": Object {
"modular": {
"type": "app",
},
"name": "app",
Expand Down Expand Up @@ -307,21 +307,21 @@ exports[`create-modular-react-app WHEN setting a project with defaults Sets up t
],
}
1`] = `
Object {
{
"author": "?",
"browserslist": Object {
"development": Array [
"browserslist": {
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version",
],
"production": Array [
"production": [
">0.2%",
"not dead",
"not op_mini all",
],
},
"dependencies": Object {
"dependencies": {
"@testing-library/dom": "?",
"@testing-library/jest-dom": "?",
"@testing-library/react": "?",
Expand All @@ -338,31 +338,31 @@ Object {
"react-dom": "?",
"typescript": "?",
},
"eslintConfig": Object {
"eslintConfig": {
"extends": "modular-app",
},
"license": "MIT",
"main": "index.js",
"modular": Object {
"modular": {
"type": "root",
},
"name": "test-repo",
"prettier": Object {
"prettier": {
"printWidth": 80,
"proseWrap": "always",
"singleQuote": true,
"trailingComma": "all",
},
"private": true,
"scripts": Object {
"scripts": {
"build": "modular build",
"lint": "eslint . --ext .js,.ts,.tsx",
"prettier": "prettier --write .",
"start": "modular start",
"test": "modular test",
},
"version": "1.0.0",
"workspaces": Array [
"workspaces": [
"packages/**",
],
}
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config-modular-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"license": "Apache-2.0",
"main": "index.js",
"engines": {
"node": "^14.17.0 || >=16.0.0"
"node": "^14.18.0 || >=16.10.0 || >=18.0.0"
},
"exports": {
".": "./index.js",
Expand Down
Loading