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

DRAFT PNPM 6 #4945

Closed
wants to merge 38 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
9e1dac4
big commit pnpm
Oct 12, 2023
03d2f1a
syn with master
Oct 12, 2023
de2c965
add warn pnpm
Oct 12, 2023
160eaf7
fix
Oct 12, 2023
5654709
fix: build icons
jmfrancois Oct 12, 2023
3bd4e96
chore: remove enzyme and fix some lint
jmfrancois Oct 12, 2023
c72ba53
fix: prettier
jmfrancois Oct 12, 2023
9528a05
chore: lint forms
jmfrancois Oct 12, 2023
d104543
chore: CI on pnpm
jmfrancois Oct 12, 2023
2b87eee
chore: CI use pnpm everywhere
jmfrancois Oct 12, 2023
d4250ea
chore: remove cache-loader deprecated webpack plugin
jmfrancois Oct 12, 2023
930d566
npmrc + remove @talend/scripts-config-babel
Oct 12, 2023
32e236c
chore: add typescript config devDep for VSCode
jmfrancois Oct 12, 2023
7ed6a6a
Merge branch 'smouillour/fix/TDOPS-5327-pnpm' of github.com:Talend/ui…
jmfrancois Oct 12, 2023
fd29e1c
revert
Oct 12, 2023
c1b527b
add "@talend/scripts-config-typescript": "^11.1.0" in package having …
Oct 12, 2023
3313a64
add @talend/scripts-config-babel in each package with babel file
Oct 12, 2023
19c72e7
fix import testing-library
Oct 12, 2023
bb9e680
a11n add compiler option with type jest
Oct 12, 2023
e5d894a
add compiler option in http to add type jest
Oct 12, 2023
092b39d
fix package util adding type lodash
Oct 12, 2023
8cf2480
try to fix issue with jsfc (missing babel-loader)
Oct 12, 2023
fd58ec4
revert change made on jsfc
Oct 12, 2023
6749610
remove babel-loader to config-react-webpack and add it (+add webapp) …
Oct 12, 2023
7459b77
Merge 67496107ffbb4cabcc41b97ac4e16ee7968c12e9 into cd04f75e88298e9b8…
smouillour Oct 12, 2023
527af9c
chore: pnpm-deduplicate
github-actions[bot] Oct 12, 2023
9001885
remove yarn in tool-versions
Oct 12, 2023
4e7be57
change way to call webpack in build-lib-umd
Oct 12, 2023
8b6656e
try something to inprove findPackagesFromScopeFolder for PNPM
Oct 12, 2023
c2acf07
DRAFT PNPM 2(#4932)
smouillour Oct 13, 2023
9bc0d00
fix lockfile
Oct 13, 2023
f305cfb
More fixes (#4934)
smouillour Oct 17, 2023
813cdca
DRAFT PNPM 5 (more fixes) (#4938)
smouillour Oct 19, 2023
89ed2f3
Merge 813cdcacde6cbf5907dbab2275cf31436f0121e1 into 6efd54301e87eff51…
smouillour Oct 19, 2023
46de8a2
chore: pnpm-deduplicate
github-actions[bot] Oct 19, 2023
1c97306
Merge with master and manage conflict
Oct 19, 2023
27f728b
fixes after merge
Oct 19, 2023
08fb9f9
Fix script-config-jest + remove not necessary mock in packages
Oct 20, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Prev Previous commit
Next Next commit
Merge with master and manage conflict
  • Loading branch information
smouillour committed Oct 19, 2023
commit 1c97306ca0187f6aee3990cc20bb7f6dfa8450fb
26 changes: 26 additions & 0 deletions .changeset/bright-dodos-deny.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
'@talend/scripts-core': major
'@talend/scripts-config-jest': major
---

- fix: enforce timer at the end of all tests.
- feat: mock ally.js has it uses unsupported dom method from jsdom.
- feat: add jest-axe configuration


To support floating-ui/react following issue we have decided to add an afterAll to let floating-ui finish stuff
https://github.com/floating-ui/floating-ui/issues/1908


Breaking changes:

you may have tests where you ask for jest.useFakeTimer without go back to real at some point. This is a side effect and it is not compatible with our change to support floating-ui.

```diff
jest.useFakeTimers()
render(<Tooltip><button></Tooltip>)
+jest.useRealTimers()
```

This will fix an error said your test is still pending after 5000 ms.

6 changes: 6 additions & 0 deletions .changeset/bright-zoos-hug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@talend/scripts-config-storybook-lib': patch
---

fix: add keys on all items in the decorators
fix: improve build performance copy/pasted from #4931
98 changes: 98 additions & 0 deletions .changeset/chatty-apes-speak.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
---
'@talend/design-system': major
---

chore: remove reakit

* Rewrite components without reakit
* use `@floating-ui/react` for tooltip, popover
* export all types and components from the root

Breaking changes:
* HTML structure output may have changed
* Some passed props from our component to reakit and not documented as a usage as been removed. If you need a different usage let us knwow, now we own the code
* Tabs props API has been completly changed

Components changed:
* Accordion (useId)
* Clickable (rewrite)
* Combobox (add as primitive)
* Disclosure (add as primitive)
* Divider (rewrite)
* Drawer (rewrite using `react-transition-group`)
* Dropdown (rewrite using `@floating-ui/react`)
* Form/Affix/Button (typings)
* Form/Affix/Select (useId)
* Form/Field/Datalist (useId)
* Form/Field/InputFile (useId)
* Form/Field/InputToggleSwitch (rewrite)
* Form/Primitives/Checkbox (rewrite)
* Form/Primitives/Field (useId)
* Form/Primitives/Radio (useId)
* Modal (rewrite Dialog as primitive)
* Popover (rewrite using `@floating-ui/react`)
* Switch (rewrite)
* Tabs (rewrite + props changed)
* Tooltip (rewrite using `@floating-ui/react` + API Change)
* VisuallyHidden (rewrite)


**Migration Guide**

* Checkbox component

Checkbox has two versions now : controlled one and uncontrolled one.
To use controlled version, import Checkbox component and provide `checked` and `onChange` props.
To use uncontrolled version, import UncontrolledCheckbox component and optionally provide `defaultChecked` prop.

We also change way to import it to be less verbose.

Old use
```
import { Form } from '@talend/design-system';
(...)
<Form.Checkbox (...) />
```

New use
```
import { Checkbox, UncontrolledCheckbox } from '@talend/design-system';
(...)
<Checkbox checked={isChecked} onChange={changeHandler} (...) />
<UncontrolledCheckbox defaultChecked={isChecked} (...) />
```

* ToggleSwitch component

ToggleSwitch has two versions now : controlled one and uncontrolled one.
To use controlled version, import ToggleSwitch component and provide `checked` and `onChange` props.
To use uncontrolled version, import UncontrolledToggleSwitch component and optionally provide `defaultChecked` prop.

We also change way to import it to be less verbose.

Old use
```
import { Form } from '@talend/design-system';
(...)
<Form.ToggleSwitch (...) />
```

New use
```
import { ToggleSwitch, UncontrolledToggleSwitch } from '@talend/design-system';
(...)
<ToggleSwitch checked={isChecked} onChange={changeHandler} (...) />
<UncontrolledToggleSwitch defaultChecked={isChecked} (...) />
```

* Switch component

`onChange` prop's signature change from
```
(event: React.MouseEvent<HTMLButtonElement>, value: string) => void
```
to
```
(value: string) => void
```

6 changes: 6 additions & 0 deletions .changeset/famous-hotels-retire.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@talend/react-components': minor
'@talend/design-system': minor
---

feat: upgrade react-is
5 changes: 5 additions & 0 deletions .changeset/selfish-hairs-tie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@talend/design-system': patch
---

fix: some lint errors
6 changes: 6 additions & 0 deletions .changeset/strange-coats-poke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@talend/scripts-config-jest': minor
---

feat: add api to set a fetch MockResponse
feat: add jest-axe integration
1 change: 1 addition & 0 deletions .github/workflows/design-system-component-testing.yml
Original file line number Diff line number Diff line change
@@ -37,6 +37,7 @@ jobs:
pnpm install --frozen-lockfile --ignore-scripts
pnpm cypress install
pnpm --filter @talend/assets-api run build:lib
pnpm --filter @talend/utils run build:lib
pnpm --filter @talend/icons run build:lib
pnpm --filter @talend/design-tokens run build:lib

4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -10,5 +10,7 @@
{
"pattern": "fork/**"
}
]
],
"typescript.validate.enable": true,
"javascript.validate.enable": true
}
2 changes: 2 additions & 0 deletions fork/react-bootstrap/src/Carousel.test.js
Original file line number Diff line number Diff line change
@@ -140,6 +140,7 @@ describe('<Carousel>', () => {

// then
expect(screen.getByText('Item 2 content')).toHaveClass('active');
jest.useRealTimers();
});

it('Should show next button control on the last image if wrap is true', () => {
@@ -158,6 +159,7 @@ describe('<Carousel>', () => {

// then
expect(screen.getByText('Item 1 content')).toHaveClass('active');
jest.useRealTimers();
});

it('Should not show the prev button on the first image if wrap is false', () => {
1 change: 1 addition & 0 deletions packages/cmf-cqrs/src/middleware/smartWebsocket.test.js
Original file line number Diff line number Diff line change
@@ -215,6 +215,7 @@ describe('smart websocket tests', () => {

// then
expect(options.onPingTimeout).toBeCalled();
jest.useRealTimers();
});
});
});
2 changes: 1 addition & 1 deletion packages/components/package.json
Original file line number Diff line number Diff line change
@@ -58,7 +58,7 @@
"react-draggable": "^4.4.5",
"react-grid-layout": "^1.4.1",
"react-immutable-proptypes": "^2.2.0",
"react-is": "^16.13.1",
"react-is": "^17.0.0",
"react-popper": "^2.3.0",
"react-transition-group": "^2.9.0",
"react-use": "^17.4.0",
Original file line number Diff line number Diff line change
@@ -160,6 +160,7 @@ describe('Intercom service', () => {
expect(styleElement.textContent.trim().replace(/\s/g, ' ')).toBe(
'.intercom-namespace .intercom-app div.intercom-messenger-frame { top: 39px; left: 427px; right: 221px; margin-top: 2rem; }',
);
jest.useRealTimers();
});

it('should remove custom style with cleanup return function', () => {
@@ -182,6 +183,7 @@ describe('Intercom service', () => {

// then
expect(intercomContainer.querySelector('style')).toBeFalsy();
jest.useRealTimers();
});
});
});
8 changes: 8 additions & 0 deletions packages/components/src/Datalist/Datalist.component.test.js
Original file line number Diff line number Diff line change
@@ -171,6 +171,7 @@ describe('Datalist component', () => {

// then
expect(screen.queryByRole('listbox')).not.toBeInTheDocument();
jest.useRealTimers();
});

it('should close suggestions on enter', () => {
@@ -218,6 +219,7 @@ describe('Datalist component', () => {

// then
expect(onChange).toBeCalledWith(expect.anything(), { value: '' });
jest.useRealTimers();
});

it('should reset previous value on ESC keydown', () => {
@@ -368,6 +370,7 @@ describe('Datalist component', () => {

// then
expect(onChange).toBeCalledWith(expect.anything(), { value: 'foo' });
jest.useRealTimers();
});

it('should persist unknown value on blur', () => {
@@ -384,6 +387,7 @@ describe('Datalist component', () => {

// then
expect(onChange).toBeCalledWith(expect.anything(), { value: 'not a known value' });
jest.useRealTimers();
});

it('should persist known value on enter', () => {
@@ -431,6 +435,7 @@ describe('Datalist component', () => {

// // then
expect(onChange).toBeCalledWith(expect.anything(), { value: 'not there' });
jest.useRealTimers();
});
});

@@ -450,6 +455,7 @@ describe('Datalist component', () => {

// then
expect(onChange).toBeCalledWith(expect.anything(), { value: 'foo' });
jest.useRealTimers();
});

it('should reset unknown value on blur', () => {
@@ -467,6 +473,7 @@ describe('Datalist component', () => {
// then
expect(onChange).not.toBeCalled();
expect(input).toHaveValue('My foo');
jest.useRealTimers();
});

it('should persist known value on enter', () => {
@@ -527,6 +534,7 @@ describe('Datalist component', () => {

// then
expect(onChange).toBeCalledWith(expect.anything(), { value: '' });
jest.useRealTimers();
});
});
});
Original file line number Diff line number Diff line change
@@ -36,6 +36,7 @@ describe('InputDateTimePicker', () => {

// then
expect(getPopup()).not.toBeInTheDocument();
jest.useRealTimers();
});

it('should trigger props.onBlur', async () => {
@@ -52,6 +53,7 @@ describe('InputDateTimePicker', () => {

// then
expect(onBlur).toBeCalled();
jest.useRealTimers();
});
});

@@ -93,6 +95,7 @@ describe('InputDateTimePicker', () => {

// then
expect(document.activeElement).toHaveClass('tc-date-picker-day');
jest.useRealTimers();
});
});

Original file line number Diff line number Diff line change
@@ -83,6 +83,7 @@ describe('TimePicker', () => {

// then
expect(onChange).toBeCalledWith(expect.anything(), { hours: '17', minutes: '38' }, FIELD_HOURS);
jest.useRealTimers();
});

it('should trigger onChange on minutes change', () => {
@@ -109,6 +110,7 @@ describe('TimePicker', () => {
{ hours: '15', minutes: '17' },
FIELD_MINUTES,
);
jest.useRealTimers();
});

it('should manage tabIndex', () => {
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { TFunction } from 'i18next';
import { withTranslation } from 'react-i18next';

import Icon from '../../Icon';
import { Icon, SVG_TRANSFORMS } from '@talend/design-system';
import I18N_DOMAIN_COMPONENTS from '../../constants';
import getDefaultT from '../../translate';

@@ -16,7 +15,7 @@ function SkipTo({ href, label }: SkipToProps) {
return (
<a href={href}>
<span className={theme.icon}>
<Icon transform="rotate-270" name="talend-arrow-left" />
<Icon transform={SVG_TRANSFORMS.Rotate270} name="talend-arrow-left" />
</span>
<span className={theme.text}>{label}</span>
</a>
Original file line number Diff line number Diff line change
@@ -16,7 +16,6 @@ exports[`Skip links should render 1`] = `
<span
class="CoralIcon"
name="talend-arrow-left"
transform="rotate-270"
/>
</span>
<span
@@ -36,7 +35,6 @@ exports[`Skip links should render 1`] = `
<span
class="CoralIcon"
name="talend-arrow-left"
transform="rotate-270"
/>
</span>
<span
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@ exports[`List DisplayMode should render 1`] = `
>
<button
aria-describedby="id-42"
aria-label="Set Table as current display mode."
aria-pressed="true"
class="theme-clickable theme-buttonIcon theme-toggle theme-size_S"
id="myDisplayMode-table"
@@ -28,6 +29,7 @@ exports[`List DisplayMode should render 1`] = `
</button>
<button
aria-describedby="id-42"
aria-label="Set Expanded as current display mode."
aria-pressed="false"
class="theme-clickable theme-buttonIcon theme-toggle theme-size_S"
id="myDisplayMode-large"
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.