Skip to content

Commit 344e555

Browse files
authored
chore: ⬆️ Update dependencies (#4158)
* chore: ⬆️ Update dependencies all packages + lockfile * test: ✅ Update tests after upgrading Jest dependency * update rollup-plugin-delete import for compatibility with latest version * Avoid naming conflict for react-datepicker import * Snapshot link update * Resolve merge conflict lockfile * fix: update tests and types after dependency upgrades * downgrade eslint-plugin-react-hooks# * fix: 🚨 Address linter errors * test: replace DOM manipulation with string replacement in Autocomplete snapshot test * refactor: ♻️ migrate rollup configs to native ES modules Remove --bundleConfigAsCjs flag and migrate all rollup configurations from CommonJS require() to native ES module syntax with proper import assertions. The previous require() syntax was a workaround for rollup-plugin-delete v3's pure ESM implementation conflicting with --bundleConfigAsCjs. This change addresses the root cause by removing the legacy CommonJS compatibility flag and modernizing the build configuration to use current Node.js ESM standards. Changes: - Remove --bundleConfigAsCjs flag from all package.json build scripts - Replace require() with native ES module imports for rollup-plugin-delete - Add JSON import assertions (with { type: 'json' }) for package.json imports - Add "type": "module" to package.json where missing Updated packages: - @equinor/eds-core-react - @equinor/eds-data-grid-react - @equinor/eds-lab-react - @equinor/eds-icons - @equinor/eds-tokens - @equinor/eds-utils * refactor: use exports field instead of type: module
1 parent da830e0 commit 344e555

72 files changed

Lines changed: 4963 additions & 6381 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintrc.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,5 +173,16 @@ module.exports = {
173173
'import/no-default-export': ['off'],
174174
},
175175
},
176+
// Exception for Next.js
177+
{
178+
files: [
179+
'**/app/**/page.tsx',
180+
'**/app/**/layout.tsx',
181+
'**/tailwind.config.ts',
182+
],
183+
rules: {
184+
'import/no-default-export': 'off',
185+
},
186+
},
176187
],
177188
}

apps/design-system-docs/package.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,25 @@
1515
"typecheck": "tsc"
1616
},
1717
"dependencies": {
18-
"@docusaurus/core": "3.8.1",
19-
"@docusaurus/eslint-plugin": "^3.8.1",
20-
"@docusaurus/plugin-content-docs": "^3.8.1",
21-
"@docusaurus/preset-classic": "3.8.1",
22-
"@docusaurus/theme-common": "^3.8.1",
18+
"@docusaurus/core": "3.9.2",
19+
"@docusaurus/eslint-plugin": "^3.9.2",
20+
"@docusaurus/plugin-content-docs": "^3.9.2",
21+
"@docusaurus/preset-classic": "3.9.2",
22+
"@docusaurus/theme-common": "^3.9.2",
2323
"@easyops-cn/docusaurus-search-local": "^0.52.1",
2424
"@equinor/eds-core-react": "workspace:*",
2525
"@equinor/eds-tokens": "workspace:*",
26-
"@mdx-js/react": "^3.0.0",
27-
"clsx": "^2.0.0",
28-
"prism-react-renderer": "^2.3.0",
29-
"react": "^19.1.1",
30-
"react-dom": "^19.1.1"
26+
"@mdx-js/react": "^3.1.1",
27+
"clsx": "^2.1.1",
28+
"prism-react-renderer": "^2.4.1",
29+
"react": "^19.2.0",
30+
"react-dom": "^19.2.0"
3131
},
3232
"devDependencies": {
33-
"@docusaurus/module-type-aliases": "3.8.1",
34-
"@docusaurus/tsconfig": "3.8.1",
35-
"@docusaurus/types": "3.8.1",
36-
"typescript": "~5.6.3"
33+
"@docusaurus/module-type-aliases": "3.9.2",
34+
"@docusaurus/tsconfig": "3.9.2",
35+
"@docusaurus/types": "3.9.2",
36+
"typescript": "~5.9.3"
3737
},
3838
"browserslist": {
3939
"production": [

package.json

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -53,30 +53,30 @@
5353
"types": "pnpm --filter @equinor/eds-tokens types && pnpm --filter @equinor/eds-utils types && pnpm --filter @equinor/eds-icons types && pnpm --filter @equinor/eds-core-react types && pnpm --filter @equinor/eds-lab-react types && pnpm --filter @equinor/eds-data-grid-react types"
5454
},
5555
"devDependencies": {
56-
"@babel/core": "^7.28.3",
57-
"@babel/eslint-parser": "^7.28.0",
58-
"@babel/plugin-transform-runtime": "^7.28.3",
59-
"@babel/preset-env": "^7.28.3",
60-
"@babel/preset-react": "^7.27.1",
61-
"@babel/preset-typescript": "^7.27.1",
62-
"@babel/runtime": "^7.28.3",
63-
"@types/jest": "^29.5.14",
56+
"@babel/core": "^7.28.5",
57+
"@babel/eslint-parser": "^7.28.5",
58+
"@babel/plugin-transform-runtime": "^7.28.5",
59+
"@babel/preset-env": "^7.28.5",
60+
"@babel/preset-react": "^7.28.5",
61+
"@babel/preset-typescript": "^7.28.5",
62+
"@babel/runtime": "^7.28.4",
63+
"@types/jest": "^30.0.0",
6464
"@types/jest-axe": "^3.5.9",
65-
"@typescript-eslint/eslint-plugin": "^8.41.0",
66-
"@typescript-eslint/parser": "^8.41.0",
65+
"@typescript-eslint/eslint-plugin": "^8.46.2",
66+
"@typescript-eslint/parser": "^8.46.2",
6767
"babel-plugin-styled-components": "^2.1.4",
6868
"eslint": "^8.57.1",
69-
"eslint-config-prettier": "^9.1.2",
70-
"eslint-import-resolver-typescript": "^3.10.1",
69+
"eslint-config-prettier": "^10.1.8",
70+
"eslint-import-resolver-typescript": "^4.4.4",
7171
"eslint-plugin-import": "^2.32.0",
7272
"eslint-plugin-jsx-a11y": "^6.10.2",
7373
"eslint-plugin-prettier": "^5.5.4",
7474
"eslint-plugin-react": "^7.37.5",
7575
"eslint-plugin-react-hooks": "^5.2.0",
76-
"eslint-plugin-testing-library": "^7.6.6",
77-
"jest-axe": "^9.0.0",
76+
"eslint-plugin-testing-library": "^7.13.3",
77+
"jest-axe": "^10.0.0",
7878
"prettier": "3.6.2",
79-
"typescript": "^5.9.2"
79+
"typescript": "^5.9.3"
8080
},
8181
"browserslist": "last 2 Chrome versions, last 2 firefox versions, last 2 safari versions, last 2 edge versions, not dead",
8282
"packageManager": "pnpm@10.15.0"

packages/eds-color-palette-generator/package.json

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -27,26 +27,26 @@
2727
"@equinor/eds-tailwind": "workspace:*",
2828
"@equinor/eds-tokens": "workspace:*",
2929
"colorjs.io": "^0.5.2",
30-
"lucide-react": "^0.542.0",
31-
"next": "15.2.4",
32-
"react": "^19.1.1",
33-
"react-dom": "^19.1.1"
30+
"lucide-react": "^0.546.0",
31+
"next": "16.0.0",
32+
"react": "^19.2.0",
33+
"react-dom": "^19.2.0"
3434
},
3535
"devDependencies": {
3636
"@eslint/eslintrc": "^3.3.1",
37-
"@playwright/test": "^1.55.0",
38-
"@tailwindcss/postcss": "^4.1.12",
39-
"@types/node": "^20.19.11",
40-
"@types/react": "^19.1.13",
41-
"@types/react-dom": "^19.1.9",
42-
"dotenv": "^17.2.1",
43-
"eslint": "^9.34.0",
44-
"eslint-config-next": "15.2.4",
45-
"tailwindcss": "^4.1.12",
46-
"tsx": "^4.20.5",
47-
"typescript": "^5.9.2",
48-
"vite": "^7.1.3",
49-
"vite-plugin-dts": "^3.9.1",
50-
"vitest": "^3.2.4"
37+
"@playwright/test": "^1.56.1",
38+
"@tailwindcss/postcss": "^4.1.16",
39+
"@types/node": "^24.9.1",
40+
"@types/react": "^19.2.2",
41+
"@types/react-dom": "^19.2.2",
42+
"dotenv": "^17.2.3",
43+
"eslint": "^9.38.0",
44+
"eslint-config-next": "16.0.0",
45+
"tailwindcss": "^4.1.16",
46+
"tsx": "^4.20.6",
47+
"typescript": "^5.9.3",
48+
"vite": "^7.1.12",
49+
"vite-plugin-dts": "^4.5.4",
50+
"vitest": "^4.0.2"
5151
}
5252
}

packages/eds-core-react/package.json

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"./style.css": "./dist/style.css"
3636
},
3737
"scripts": {
38-
"build": "rollup -c --bundleConfigAsCjs && tsc -p tsconfig.build.json",
38+
"build": "rollup -c && tsc -p tsconfig.build.json",
3939
"test": "tsc -p tsconfig.test.json && jest",
4040
"test:watch": "tsc-watch -p tsconfig.test.json --onFirstSuccess \"jest --watch\"",
4141
"test:update-snapshots": "jest --updateSnapshot",
@@ -55,63 +55,63 @@
5555
],
5656
"devDependencies": {
5757
"@playwright/test": "^1.55.0",
58-
"@rollup/plugin-babel": "^6.0.4",
59-
"@rollup/plugin-commonjs": "^28.0.6",
60-
"@rollup/plugin-node-resolve": "^16.0.1",
61-
"@storybook/addon-a11y": "^9.1.5",
62-
"@storybook/addon-docs": "^9.1.5",
63-
"@storybook/addon-links": "^9.1.5",
64-
"@storybook/react-vite": "^9.1.5",
58+
"@rollup/plugin-babel": "^6.1.0",
59+
"@rollup/plugin-commonjs": "^28.0.8",
60+
"@rollup/plugin-node-resolve": "^16.0.3",
61+
"@storybook/addon-a11y": "^9.1.13",
62+
"@storybook/addon-docs": "^9.1.13",
63+
"@storybook/addon-links": "^9.1.13",
64+
"@storybook/react-vite": "^9.1.13",
6565
"@testing-library/dom": "^10.4.1",
66-
"@testing-library/jest-dom": "^6.8.0",
66+
"@testing-library/jest-dom": "^6.9.1",
6767
"@testing-library/react": "16.3.0",
68-
"@testing-library/user-event": "14.5.2",
69-
"@types/jest": "^29.5.14",
68+
"@testing-library/user-event": "14.6.1",
69+
"@types/jest": "^30.0.0",
7070
"@types/mdx": "^2.0.13",
7171
"@types/node": "^24.9.1",
72-
"@types/ramda": "^0.30.2",
73-
"@types/react": "^19.1.12",
74-
"@types/react-dom": "^19.1.9",
72+
"@types/ramda": "^0.31.1",
73+
"@types/react": "^19.2.2",
74+
"@types/react-dom": "^19.2.2",
7575
"babel-plugin-styled-components": "^2.1.4",
76-
"eslint-plugin-storybook": "9.1.5",
77-
"jest": "^29.7.0",
78-
"jest-environment-jsdom": "^29.7.0",
76+
"eslint-plugin-storybook": "9.1.13",
77+
"jest": "^30.2.0",
78+
"jest-environment-jsdom": "^30.2.0",
7979
"jest-styled-components": "^7.2.0",
8080
"js-file-download": "^0.4.12",
8181
"postcss": "^8.5.6",
8282
"postcss-import": "^16.1.1",
83-
"ramda": "^0.31.3",
84-
"react": "^19.1.1",
85-
"react-dom": "^19.1.1",
86-
"react-hook-form": "^7.62.0",
87-
"react-router-dom": "^6.30.1",
88-
"rollup": "^4.50.0",
89-
"rollup-plugin-delete": "^2.2.0",
83+
"ramda": "^0.32.0",
84+
"react": "^19.2.0",
85+
"react-dom": "^19.2.0",
86+
"react-hook-form": "^7.65.0",
87+
"react-router-dom": "^7.9.4",
88+
"rollup": "^4.52.5",
89+
"rollup-plugin-delete": "^3.0.1",
9090
"rollup-plugin-postcss": "^4.0.2",
9191
"rollup-preserve-directives": "^1.1.3",
92-
"storybook": "^9.1.6",
92+
"storybook": "^9.1.13",
9393
"styled-components": "6.1.19",
94-
"tsc-watch": "^6.3.1",
95-
"typescript": "^5.9.2"
94+
"tsc-watch": "^7.2.0",
95+
"typescript": "^5.9.3"
9696
},
9797
"peerDependencies": {
9898
"react": "^19",
9999
"react-dom": "^19",
100100
"styled-components": "^6"
101101
},
102102
"dependencies": {
103-
"@babel/runtime": "^7.28.3",
103+
"@babel/runtime": "^7.28.4",
104104
"@equinor/eds-icons": "workspace:^",
105105
"@equinor/eds-tokens": "workspace:*",
106106
"@equinor/eds-utils": "workspace:*",
107107
"@floating-ui/react": "^0.27.16",
108-
"@internationalized/date": "^3.9.0",
109-
"@react-aria/utils": "^3.30.1",
110-
"@react-stately/calendar": "^3.8.4",
111-
"@react-stately/datepicker": "^3.15.1",
112-
"@react-types/shared": "^3.32.0",
108+
"@internationalized/date": "^3.10.0",
109+
"@react-aria/utils": "^3.31.0",
110+
"@react-stately/calendar": "^3.9.0",
111+
"@react-stately/datepicker": "^3.15.2",
112+
"@react-types/shared": "^3.32.1",
113113
"@tanstack/react-virtual": "3.13.12",
114-
"downshift": "9.0.8",
115-
"react-aria": "^3.43.1"
114+
"downshift": "9.0.10",
115+
"react-aria": "^3.44.0"
116116
}
117117
}

packages/eds-core-react/rollup.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ import commonjs from '@rollup/plugin-commonjs'
66
import { preserveDirective } from 'rollup-preserve-directives'
77
import { babel } from '@rollup/plugin-babel'
88
import del from 'rollup-plugin-delete'
9-
import pkg from './package.json'
9+
10+
import pkg from './package.json' with { type: 'json' }
1011

1112
const environment = process.env.NODE_ENV
1213

packages/eds-core-react/src/components/Accordion/__snapshots__/Accordion.test.tsx.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Jest Snapshot v1, https://goo.gl/fbAQLP
1+
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
22

33
exports[`Accordion Matches snapshot 1`] = `
44
<DocumentFragment>

packages/eds-core-react/src/components/Autocomplete/Autocomplete.test.tsx

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
within,
88
waitFor,
99
} from '@testing-library/react'
10+
import '@testing-library/jest-dom'
1011
import styled from 'styled-components'
1112
import { Autocomplete } from '.'
1213

@@ -87,7 +88,9 @@ const StyledAutocomplete = styled(Autocomplete)`
8788

8889
describe('Autocomplete', () => {
8990
it('Matches snapshot', async () => {
90-
render(<Autocomplete options={items} label={labelText} />)
91+
const { container } = render(
92+
<Autocomplete options={items} label={labelText} />,
93+
)
9194

9295
const autocomplete = screen.getAllByLabelText(labelText)
9396
const input = autocomplete[0]
@@ -98,10 +101,24 @@ describe('Autocomplete', () => {
98101
const optionsList = openAutocomplete[1]
99102

100103
await waitFor(() => {
101-
expect(optionsList).toBeVisible()
102-
})
103-
104-
expect(optionsList).toMatchSnapshot()
104+
expect(optionsList).toBeInTheDocument()
105+
})
106+
107+
// Replace auto-generated IDs with static values for deterministic snapshots
108+
const htmlString = container.innerHTML
109+
const normalizedHtml = htmlString
110+
.replace(/id="downshift-[^"]*"/g, 'id="downshift-test-id"')
111+
.replace(
112+
/aria-labelledby="downshift-[^"]*"/g,
113+
'aria-labelledby="downshift-test-label-id"',
114+
)
115+
.replace(
116+
/aria-controls="downshift-[^"]*"/g,
117+
'aria-controls="downshift-test-controls"',
118+
)
119+
.replace(/for="downshift-[^"]*"/g, 'for="downshift-test-id"')
120+
121+
expect(normalizedHtml).toMatchSnapshot()
105122
})
106123
it('Has provided label', async () => {
107124
render(<Autocomplete label={labelText} options={items} />)
@@ -237,7 +254,7 @@ describe('Autocomplete', () => {
237254
render(
238255
<StyledAutocomplete
239256
//a bug in styled-components 6.1.8 breaks the conditional type for optionLabel when using styled(Autocomplete)
240-
optionLabel={(label: string) => label}
257+
optionLabel={(option: unknown) => option as string}
241258
label={labelText}
242259
options={items}
243260
data-testid="styled-autocomplete"
@@ -357,7 +374,7 @@ describe('Autocomplete', () => {
357374
}
358375

359376
const ControlledAutoComplete = ({ onOptionsChange }: ControlledProps) => {
360-
const [selected, setSelected] = useState([])
377+
const [selected, setSelected] = useState<string[]>([])
361378
return (
362379
<Autocomplete
363380
multiple
@@ -522,18 +539,19 @@ describe('Autocomplete', () => {
522539
it('Can extend the css for the component & props are passed correctly to input', async () => {
523540
const { container } = render(
524541
<StyledAutocomplete
525-
//a bug in styled-components 6.1.8 breaks the conditional type for optionLabel when using styled(Autocomplete)
526-
optionLabel={(label: string) => label}
542+
optionLabel={(option: unknown) => option as string}
527543
label="test"
528544
options={items}
529545
data-testid="styled-autocomplete"
546+
style={{ margin: '3px' }}
530547
/>,
531548
)
532549

533550
const autocomplete = await screen.findByTestId('styled-autocomplete')
534551

552+
// CSS testing requires access to container - this is a legitimate testing pattern
535553
// eslint-disable-next-line testing-library/no-node-access
536-
expect(container.firstChild).toHaveStyleRule('clip-path', 'unset')
554+
expect(container.firstChild).toHaveStyle('margin: 3px')
537555
expect(autocomplete.nodeName).toBe('INPUT')
538556
})
539557
})

0 commit comments

Comments
 (0)