Skip to content

Commit

Permalink
chore: bump nextjs version to 14.1.1 (fixes turbopack) (#2837)
Browse files Browse the repository at this point in the history
* chore: bump nextjs version to 14.1.0 (turbopack now works)

* chore: bump nextjs version to 14.1.1

* chore: add next-router-mock as router no longer works in jest

* chore: add missing codemod to TET
  • Loading branch information
sirtawast authored Mar 4, 2024
1 parent 23f4208 commit 854ff87
Show file tree
Hide file tree
Showing 19 changed files with 124 additions and 114 deletions.
3 changes: 2 additions & 1 deletion frontend/benefit/applicant/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
"hds-design-tokens": "^2.17.1",
"hds-react": "^2.17.1",
"lodash": "^4.17.21",
"next": "14.0.3",
"next": "14.1.1",
"next-router-mock": "0.9.12",
"next-compose-plugins": "^2.2.1",
"next-i18next": "^13.0.3",
"next-transpile-modules": "^9.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import React from 'react';

import ApplicationList, { ApplicationListProps } from '../ApplicationList';

jest.mock('next/router', () => jest.requireActual('next-router-mock'));

describe('ApplicationList', () => {
const initialProps: ApplicationListProps = {
heading: 'Application List',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import React from 'react';

import AttachmentsList, { AttachmentsListProps } from '../AttachmentsList';

jest.mock('next/router', () => jest.requireActual('next-router-mock'));

describe('AttachmentsList', () => {
const initialProps: AttachmentsListProps = {
attachmentType: ATTACHMENT_TYPES.HELSINKI_BENEFIT_VOUCHER,
Expand Down
2 changes: 2 additions & 0 deletions frontend/benefit/handler/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ const config = {
setupFilesAfterEnv: [
'<rootDir>/../../shared/src/__tests__/utils/setupTests.ts',
'<rootDir>/test/i18n/i18n-test.ts',
'<rootDir>/test/next-router-mock.ts',
// '<rootDir>/../../shared/src/__tests__/utils/next-router-mock.ts',
],
coveragePathIgnorePatterns: [
'<rootDir>/src/pages/',
Expand Down
3 changes: 2 additions & 1 deletion frontend/benefit/handler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
"hds-react": "^2.17.1",
"ibantools": "^4.3.4",
"lodash": "^4.17.21",
"next": "14.0.3",
"next": "14.1.1",
"next-router-mock": "0.9.12",
"next-compose-plugins": "^2.2.1",
"next-i18next": "^13.0.3",
"next-transpile-modules": "^9.1.0",
Expand Down
2 changes: 2 additions & 0 deletions frontend/benefit/handler/test/next-router-mock.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import mockRouter from 'next-router-mock';
jest.mock('next/router', () => jest.requireActual('next-router-mock'));
3 changes: 2 additions & 1 deletion frontend/benefit/shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"date-fns": "^2.24.0",
"hds-react": "^2.17.1",
"ibantools": "^4.1.5",
"next": "14.0.3",
"next": "14.1.1",
"next-router-mock": "0.9.12",
"react": "^18.2.0",
"styled-components": "^5.3.11",
"yup": "^0.32.9"
Expand Down
3 changes: 2 additions & 1 deletion frontend/kesaseteli/employer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@
"hds-react": "^2.17.1",
"ibantools": "^4.1.5",
"lodash": "^4.17.21",
"next": "14.0.3",
"next": "14.1.1",
"next-compose-plugins": "^2.2.1",
"next-i18next": "^13.0.3",
"next-router-mock": "0.9.12",
"next-transpile-modules": "^9.0.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand Down
2 changes: 1 addition & 1 deletion frontend/kesaseteli/handler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"hds-design-tokens": "^2.17.1",
"hds-react": "^2.17.1",
"lodash": "^4.17.21",
"next": "14.0.3",
"next": "14.1.1",
"next-compose-plugins": "^2.2.1",
"next-i18next": "^13.0.3",
"next-transpile-modules": "^9.1.0",
Expand Down
3 changes: 2 additions & 1 deletion frontend/kesaseteli/youth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@
"hds-design-tokens": "^2.17.1",
"hds-react": "^2.17.1",
"lodash": "^4.17.21",
"next": "14.0.3",
"next": "14.1.1",
"next-compose-plugins": "^2.2.1",
"next-i18next": "^13.0.3",
"next-router-mock": "0.9.12",
"next-transpile-modules": "^9.0.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand Down
4 changes: 3 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
"eslint-config-airbnb": "^19.0.2",
"eslint-config-airbnb-typescript": "^16.1.0",
"eslint-config-auto": "^0.7.1",
"eslint-config-next": "^14.0.4",
"eslint-config-next": "^14.1.1",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-array-func": "^3.1.7",
"eslint-plugin-chai-expect": "^3.0.0",
Expand Down Expand Up @@ -141,6 +141,8 @@
"lerna-audit": "^1.3.3",
"lint-staged": "^12.3.1",
"lodash": "^4.17.21",
"next": "14.1.1",
"next-router-mock": "0.9.12",
"nock": "^13.5.0",
"picocolors": "1.0.0",
"prettier": "^2.5.1",
Expand Down
2 changes: 1 addition & 1 deletion frontend/shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"hds-react": "^2.17.1",
"js-file-download": "^0.4.12",
"lodash": "^4.17.21",
"next": "14.0.3",
"next": "14.1.1",
"next-i18next": "^13.0.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand Down
1 change: 1 addition & 0 deletions frontend/shared/src/__tests__/utils/next-router-mock.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
jest.mock('next/router', () => require('next-router-mock'));
2 changes: 2 additions & 0 deletions frontend/shared/src/__tests__/utils/setupTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import { isString } from 'shared/utils/type-guards';
jest.setTimeout(JEST_TIMEOUT);
expect.extend(toHaveNoViolations);

jest.mock('next/router', () => jest.requireActual('next-router-mock'));

// eslint-disable-next-line no-console
const originalError = console.error;
let consoleWarnSpy: jest.SpyInstance;
Expand Down
2 changes: 1 addition & 1 deletion frontend/tet/admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"hds-design-tokens": "^2.17.1",
"hds-react": "^2.17.1",
"leaflet": "^1.7.1",
"next": "14.0.3",
"next": "14.1.1",
"next-compose-plugins": "^2.2.1",
"next-i18next": "^13.0.3",
"next-transpile-modules": "^9.0.0",
Expand Down
2 changes: 1 addition & 1 deletion frontend/tet/shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@frontend/shared": "*",
"axios": "^0.27.2",
"hds-react": "^2.17.1",
"next": "14.0.3",
"next": "14.1.1",
"next-i18next": "^13.0.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand Down
2 changes: 1 addition & 1 deletion frontend/tet/youth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"hds-react": "^2.17.1",
"leaflet": "^1.7.1",
"leaflet.markercluster": "^1.5.3",
"next": "14.0.3",
"next": "14.1.1",
"next-compose-plugins": "^2.2.1",
"next-i18next": "^13.0.3",
"next-transpile-modules": "^9.0.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Button, IconMap } from 'hds-react';
import Image from 'next/image';
import Image from 'next/legacy/image';
import { useRouter } from 'next/router';
import { useTranslation } from 'next-i18next';
import React from 'react';
Expand Down
Loading

0 comments on commit 854ff87

Please sign in to comment.