Skip to content

Commit

Permalink
fix(TDOPS-5641): Update deps in packages in the folder packages + fix…
Browse files Browse the repository at this point in the history
… some lint (#4983)
  • Loading branch information
smouillour authored Nov 13, 2023
1 parent e82cc7f commit b9cc5b0
Show file tree
Hide file tree
Showing 69 changed files with 328 additions and 105 deletions.
5 changes: 5 additions & 0 deletions .changeset/brown-geese-trade.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@talend/utils': minor
---

Add missing deps and fix tsconfig
5 changes: 5 additions & 0 deletions .changeset/calm-eagles-confess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@talend/react-containers': minor
---

Add missing deps and fix some lint issues
5 changes: 5 additions & 0 deletions .changeset/cold-camels-cheat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@talend/assets-api': minor
---

Add missing deps and remove link to @talend/icons (circular deps)
5 changes: 5 additions & 0 deletions .changeset/eighty-readers-complain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@talend/react-storybook-cmf': minor
---

Add missing deps
5 changes: 5 additions & 0 deletions .changeset/five-fans-begin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@talend/design-tokens': minor
---

Add missing deps and missing jest config file
5 changes: 5 additions & 0 deletions .changeset/four-numbers-doubt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@talend/react-dataviz': minor
---

Add missing deps
5 changes: 5 additions & 0 deletions .changeset/great-cars-relate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@talend/design-system': minor
---

Fix lint issues
5 changes: 5 additions & 0 deletions .changeset/honest-weeks-agree.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@talend/react-flow-designer': minor
---

Add missing deps, fix tsconfig file and fix some lint issue
5 changes: 5 additions & 0 deletions .changeset/loud-papayas-boil.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@talend/react-a11y': minor
---

Add missing deps and fix tsconfig file
5 changes: 5 additions & 0 deletions .changeset/many-wolves-invent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@talend/local-libs-webpack-plugin': minor
---

Add missing deps and fix lint issue
5 changes: 5 additions & 0 deletions .changeset/mean-walls-admire.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@talend/react-cmf': minor
---

Fix lint issues
5 changes: 5 additions & 0 deletions .changeset/nine-turtles-accept.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@talend/storybook-docs': minor
---

Add missing deps and fix lint issues
5 changes: 5 additions & 0 deletions .changeset/orange-suits-chew.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@talend/react-stepper': minor
---

Add missing deps
5 changes: 5 additions & 0 deletions .changeset/poor-poems-greet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@talend/icons': minor
---

Add missing deps
5 changes: 5 additions & 0 deletions .changeset/quick-tools-rescue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@talend/design-docs': minor
---

Add missing deps and remove unnecessary one
5 changes: 5 additions & 0 deletions .changeset/stale-carpets-cheat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@talend/react-forms': minor
---

Fix lint issues
5 changes: 5 additions & 0 deletions .changeset/tall-waves-approve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@talend/ui-storybook-one': minor
---

Add missing deps, fix code for PNPM
5 changes: 5 additions & 0 deletions .changeset/tidy-carpets-trade.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@talend/json-schema-form-core': minor
---

Add missing deps, fix lint issue and fix tsconfig file
5 changes: 5 additions & 0 deletions .changeset/wet-bears-think.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@talend/ui-playground': minor
---

Add missing deps and fix webpack.config file
5 changes: 5 additions & 0 deletions .changeset/yellow-bats-tie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@talend/bootstrap-theme': minor
---

Add missing deps and fix webpack.config file
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"prepare": "husky install"
},
"resolutions": {
"**/cypress": "^12.17.4",
"**/@types/react": "^18.2.7",
"**/@types/react-dom": "^18.2.7",
"**/i18next-scanner-typescript/typescript": "^5.0.4",
Expand Down Expand Up @@ -60,7 +61,7 @@
},
"dependencies": {
"@types/react": "^18.2.7",
"@types/react-dom": "^18.2.7",
"@types/react-dom": "^18.2.15",
"terser-webpack-plugin": "^5.3.9",
"typescript": "^5.2.2",
"webpack": "^5.89.0"
Expand Down
13 changes: 11 additions & 2 deletions packages/a11y/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,21 @@
},
"dependencies": {
"@talend/utils": "^2.7.0",
"keycode": "^2.2.1",
"lodash": "^4.17.21"
"keycode": "^2.2.1"
},
"devDependencies": {
"@talend/eslint-config": "^12.2.0",
"@talend/eslint-plugin": "^1.0.1",
"@talend/scripts-core": "^16.1.0",
"@talend/scripts-config-typescript": "^11.1.0",
"@testing-library/react": "^12.1.5",
"@testing-library/user-event": "^13.5.0",
"@types/date-fns": "^0.0.2",
"@types/jest": "^29.5.5",
"@types/react": "^18.2.37",
"@types/react-dom": "^18.2.15",
"date-fns": "^1.30.1",
"jest-in-case": "^1.0.2",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
Expand Down
3 changes: 2 additions & 1 deletion packages/a11y/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"allowJs": false,
"declaration": true,
"target": "ES5",
"module": "CommonJs"
"module": "CommonJs",
"types": ["jest", "@testing-library/jest-dom"]
}
}
6 changes: 6 additions & 0 deletions packages/assets-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,14 @@
},
"dependencies": {},
"devDependencies": {
"@talend/babel-plugin-import-from-index": "^1.5.1",
"@talend/eslint-config": "^12.2.0",
"@talend/eslint-plugin": "^1.0.1",
"@talend/scripts-core": "^16.1.0",
"@talend/scripts-config-react-webpack": "^16.2.0",
"@talend/scripts-config-typescript": "^11.1.0",
"@types/node": "^6.14.13",
"@types/jest": "^29.5.5",
"read-pkg-up": "^7.0.1"
},
"publishConfig": {
Expand Down
20 changes: 9 additions & 11 deletions packages/assets-api/src/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import readPackageUp from 'read-pkg-up';
import assetsApi, { Asset } from '.';

const iconsInfo = readPackageUp.sync({ cwd: require.resolve('@talend/icons') });
const currentInfo = readPackageUp.sync({ cwd: __dirname });
const bundlePath = '/dist/svg-bundles/all.svg';

Expand All @@ -12,28 +11,27 @@ describe('assets-api', () => {
});

it('should return unpkg url', () => {
const url = assetsApi.getURL(bundlePath, '@talend/icons', iconsInfo?.packageJson.version);
expect(url).toBe(
`https://unpkg.com/@talend/icons@${iconsInfo?.packageJson.version}${bundlePath}`,
);
const url = assetsApi.getURL(bundlePath, '@talend/icons', '6.60.1');
expect(url).toBe(`https://unpkg.com/@talend/[email protected]${bundlePath}`);
});

it('should return /cdn url', () => {
const original = window.Talend.CDN_URL;
window.Talend.CDN_URL = '/cdn';
const url = assetsApi.getURL(bundlePath, '@talend/icons', iconsInfo?.packageJson.version);
expect(url).toBe(`/cdn/@talend/icons/${iconsInfo?.packageJson.version}${bundlePath}`);
const url = assetsApi.getURL(bundlePath, '@talend/icons', '6.60.1');
expect(url).toBe(`/cdn/@talend/icons/6.60.1${bundlePath}`);
window.Talend.CDN_URL = original;
});

it('should prevent // as start url', () => {
const original = window.Talend.CDN_URL;
window.Talend.CDN_URL = '/cdn';
const mockedBaseElement = { getAttribute: jest.fn().mockReturnValueOnce('/') };
// @ts-ignore
const mockedBaseElement = {
getAttribute: jest.fn().mockReturnValueOnce('/'),
} as unknown as Element;
jest.spyOn(document, 'querySelector').mockImplementation(() => mockedBaseElement);
const url = assetsApi.getURL(bundlePath, '@talend/icons', iconsInfo?.packageJson.version);
expect(url).toBe(`/cdn/@talend/icons/${iconsInfo?.packageJson.version}${bundlePath}`);
const url = assetsApi.getURL(bundlePath, '@talend/icons', '6.60.1');
expect(url).toBe(`/cdn/@talend/icons/6.60.1${bundlePath}`);
window.Talend.CDN_URL = original;
});

Expand Down
2 changes: 1 addition & 1 deletion packages/cmf/src/action.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function getActionObject(context, action, event, data) {
*/
function getOnProps(props) {
return Object.keys(props).filter(
name => ({}.hasOwnProperty.call(props, name) && /^on.+/.test(name)),
name => ({}).hasOwnProperty.call(props, name) && /^on.+/.test(name),
);
}

Expand Down
5 changes: 4 additions & 1 deletion packages/cmf/src/reduxstorage/reduxLocalStorage.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import createEngine from 'redux-storage-engine-localstorage';
import filter from 'redux-storage-decorator-filter';
import immutablejs from './redux-storage-decorator-immutablejs';

const CMF_IMMUTABLE_PATHS = [['cmf', 'components'], ['cmf', 'collections']];
const CMF_IMMUTABLE_PATHS = [
['cmf', 'components'],
['cmf', 'collections'],
];

const CMF_MIDDLEWARE_BLACK_LIST = ['@@INIT', '@@router/LOCATION_CHANGE'];

Expand Down
4 changes: 4 additions & 0 deletions packages/containers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@
"@storybook/addon-actions": "^7.5.3",
"@talend/bootstrap-theme": "^8.2.1",
"@talend/icons": "^7.1.0",
"@talend/locales-tui-components": "^11.4.5",
"@talend/locales-tui-containers": "^9.1.3",
"@talend/locales-tui-forms": "^10.2.4",
"@talend/locales-design-system": "^7.15.1",
"@talend/react-storybook-cmf": "^8.1.0",
"@talend/eslint-config": "^12.2.0",
"@talend/eslint-plugin": "^1.0.1",
Expand All @@ -65,6 +68,7 @@
"@testing-library/user-event": "^13.5.0",
"i18next": "^23.6.0",
"jest-in-case": "^1.0.2",
"msw": "^1.3.2",
"prop-types": "^15.8.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand Down
31 changes: 15 additions & 16 deletions packages/containers/src/ConfirmDialog/ConfirmDialog.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,21 @@ import { showConfirmDialog, hideConfirmDialog } from './showHideConfirmDialog';
jest.mock(
'@talend/react-components/lib/ConfirmDialog',
() =>
({ cancelAction, validateAction, show, ...props }) =>
(
<div
data-testid="ConfirmDialog"
className="tc-confirm-dialog"
{...props}
aria-hidden={(!show).toString()}
>
<button data-testid="cancelAction" onClick={cancelAction.onClick}>
cancelAction.label
</button>
<button data-testid="validateAction" onClick={validateAction.onClick}>
validateAction.label
</button>
</div>
),
({ cancelAction, validateAction, show, ...props }) => (
<div
data-testid="ConfirmDialog"
className="tc-confirm-dialog"
{...props}
aria-hidden={(!show).toString()}
>
<button data-testid="cancelAction" onClick={cancelAction.onClick}>
cancelAction.label
</button>
<button data-testid="validateAction" onClick={validateAction.onClick}>
validateAction.label
</button>
</div>
),
);
jest.unmock('@talend/design-system');

Expand Down
29 changes: 16 additions & 13 deletions packages/containers/src/cmfModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,23 @@ import { cmfConnect } from '@talend/react-cmf';
import * as allComponents from '@talend/react-components';
import * as containers from './containers';

const components = Object.keys(allComponents).reduce((acc, key) => {
if (!acc[key] && typeof allComponents[key] === 'function') {
const options = {};
if (['ActionList', 'AppSwitcher', 'Layout', 'RichLayout', 'Dialog'].includes(key)) {
options.withComponentRegistry = true;
const components = Object.keys(allComponents).reduce(
(acc, key) => {
if (!acc[key] && typeof allComponents[key] === 'function') {
const options = {};
if (['ActionList', 'AppSwitcher', 'Layout', 'RichLayout', 'Dialog'].includes(key)) {
options.withComponentRegistry = true;
}
if (!allComponents[key].displayName) {
allComponents[key].displayName = key;
}
// eslint-disable-next-line no-param-reassign
acc[key] = cmfConnect(options)(allComponents[key]);
}
if (!allComponents[key].displayName) {
allComponents[key].displayName = key;
}
// eslint-disable-next-line no-param-reassign
acc[key] = cmfConnect(options)(allComponents[key]);
}
return acc;
}, omit(containers, ['actionAPI']));
return acc;
},
omit(containers, ['actionAPI']),
);

export default {
id: 'containers',
Expand Down
1 change: 1 addition & 0 deletions packages/dataviz/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
"@testing-library/user-event": "^13.5.0",
"@types/classnames": "^2.3.1",
"@types/d3": "^7.4.3",
"@types/cypress": "^1.1.3",
"@types/geojson": "^7946.0.13",
"@types/lodash": "^4.14.201",
"@types/node": "^6.14.13",
Expand Down
2 changes: 1 addition & 1 deletion packages/design-docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
"@storybook/addons": "^7.5.3",
"@storybook/core-events": "^7.5.3",
"@storybook/preset-scss": "^1.0.3",
"@storybook/react-webpack5": "^7.5.3",
"@storybook/testing-library": "^0.2.2",
"@storybook/testing-react": "^2.0.1",
"@storybook/theming": "^7.5.3",
Expand All @@ -59,6 +58,7 @@
"@talend/locales-tui-forms": "^10.2.4",
"@talend/scripts-core": "^16.1.0",
"@talend/scripts-config-babel": "^13.1.0",
"@talend/scripts-config-react-webpack": "^16.2.0",
"@talend/scripts-config-storybook-lib": "^5.1.0",
"@talend/scripts-config-typescript": "^11.1.0",
"@types/react": "^18.2.37",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { Canvas, Meta, Story } from '@storybook/addon-docs';

import { FigmaImage, Use } from '@talend/storybook-docs';
import { Form, ToggleSwitch } from '@talend/design-system';

import { Form, ToggleSwitch } from '../../../';

import * as Stories from './ToggleSwitch.stories';

Expand Down
4 changes: 4 additions & 0 deletions packages/design-tokens/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
testEnvironment: 'jest-environment-jsdom',
testRegex: '(/__tests__/.*|src/|scripts/).*\\.test.(js|ts|tsx)$',
};
Loading

0 comments on commit b9cc5b0

Please sign in to comment.