diff --git a/packages/a11y/package.json b/packages/a11y/package.json index 0639f8c96ab..1009fe6624d 100644 --- a/packages/a11y/package.json +++ b/packages/a11y/package.json @@ -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": "^17.0.20", + "date-fns": "^1.30.1", + "jest-in-case": "^1.0.2", "react": "^18.2.0", "react-dom": "^18.2.0" }, diff --git a/packages/a11y/tsconfig.json b/packages/a11y/tsconfig.json index 23310ba411a..52e32860ed8 100644 --- a/packages/a11y/tsconfig.json +++ b/packages/a11y/tsconfig.json @@ -5,6 +5,7 @@ "allowJs": false, "declaration": true, "target": "ES5", - "module": "CommonJs" + "module": "CommonJs", + "types": ["jest", "@testing-library/jest-dom"] } } diff --git a/packages/assets-api/package.json b/packages/assets-api/package.json index feaf575e0f4..178ec677b7b 100644 --- a/packages/assets-api/package.json +++ b/packages/assets-api/package.json @@ -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": { diff --git a/packages/assets-api/src/index.test.ts b/packages/assets-api/src/index.test.ts index af31b052cdc..def049485c0 100644 --- a/packages/assets-api/src/index.test.ts +++ b/packages/assets-api/src/index.test.ts @@ -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'; @@ -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/icons@6.60.1${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; }); diff --git a/packages/cmf/src/action.js b/packages/cmf/src/action.js index 22e2121a96c..31e12ddf879 100644 --- a/packages/cmf/src/action.js +++ b/packages/cmf/src/action.js @@ -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), ); } diff --git a/packages/cmf/src/reduxstorage/reduxLocalStorage.js b/packages/cmf/src/reduxstorage/reduxLocalStorage.js index 6cd15b10755..501430258a0 100644 --- a/packages/cmf/src/reduxstorage/reduxLocalStorage.js +++ b/packages/cmf/src/reduxstorage/reduxLocalStorage.js @@ -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']; diff --git a/packages/containers/package.json b/packages/containers/package.json index 629a3967a39..56c0a362d4f 100644 --- a/packages/containers/package.json +++ b/packages/containers/package.json @@ -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", @@ -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", diff --git a/packages/containers/src/ConfirmDialog/ConfirmDialog.test.js b/packages/containers/src/ConfirmDialog/ConfirmDialog.test.js index bdd332eada2..3643033d9cd 100644 --- a/packages/containers/src/ConfirmDialog/ConfirmDialog.test.js +++ b/packages/containers/src/ConfirmDialog/ConfirmDialog.test.js @@ -12,22 +12,21 @@ import { showConfirmDialog, hideConfirmDialog } from './showHideConfirmDialog'; jest.mock( '@talend/react-components/lib/ConfirmDialog', () => - ({ cancelAction, validateAction, show, ...props }) => - ( -
- - -
- ), + ({ cancelAction, validateAction, show, ...props }) => ( +
+ + +
+ ), ); jest.unmock('@talend/design-system'); diff --git a/packages/containers/src/cmfModule.js b/packages/containers/src/cmfModule.js index 975eabdf015..dd9d1242fb8 100644 --- a/packages/containers/src/cmfModule.js +++ b/packages/containers/src/cmfModule.js @@ -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', diff --git a/packages/dataviz/package.json b/packages/dataviz/package.json index dc8f1d4954c..e150bc29bd2 100644 --- a/packages/dataviz/package.json +++ b/packages/dataviz/package.json @@ -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", diff --git a/packages/design-docs/package.json b/packages/design-docs/package.json index 8a925817c29..b090441d102 100644 --- a/packages/design-docs/package.json +++ b/packages/design-docs/package.json @@ -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", @@ -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", diff --git a/packages/design-system/package.json b/packages/design-system/package.json index a4cd3f4c809..223f9b5b87d 100644 --- a/packages/design-system/package.json +++ b/packages/design-system/package.json @@ -62,6 +62,7 @@ "@storybook/theming": "^7.5.3", "@svgr/webpack": "^5.5.0", "@talend/bootstrap-theme": "^8.2.1", + "@talend/design-system": "*", "@talend/eslint-config": "^12.2.0", "@talend/eslint-plugin": "^1.0.1", "@talend/icons": "^7.1.0", diff --git a/packages/design-system/src/stories/form/ToggleSwitch/ToggleSwitch.mdx b/packages/design-system/src/stories/form/ToggleSwitch/ToggleSwitch.mdx index 7dfdd89c6de..8c9e2cbaa4e 100644 --- a/packages/design-system/src/stories/form/ToggleSwitch/ToggleSwitch.mdx +++ b/packages/design-system/src/stories/form/ToggleSwitch/ToggleSwitch.mdx @@ -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'; diff --git a/packages/design-tokens/jest.config.js b/packages/design-tokens/jest.config.js new file mode 100644 index 00000000000..603f020ff46 --- /dev/null +++ b/packages/design-tokens/jest.config.js @@ -0,0 +1,4 @@ +module.exports = { + testEnvironment: 'jest-environment-jsdom', + testRegex: '(/__tests__/.*|src/|scripts/).*\\.test.(js|ts|tsx)$', +}; diff --git a/packages/design-tokens/package.json b/packages/design-tokens/package.json index d5773411a22..79ec90f1a5e 100644 --- a/packages/design-tokens/package.json +++ b/packages/design-tokens/package.json @@ -34,9 +34,17 @@ "access": "public" }, "devDependencies": { + "@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", - "typeface-source-sans-pro": "^1.1.13" + "@talend/scripts-config-typescript": "^11.1.0", + "@talend/babel-plugin-import-from-index": "^1.5.1", + "@talend/babel-plugin-assets-api": "^1.1.0", + "jest": "^29.7.0", + "jest-environment-jsdom": "^29.7.0", + "typeface-source-sans-pro": "^1.1.13", + "webpack": "^5.88.2" }, "dependencies": {} } diff --git a/packages/flow-designer/package.json b/packages/flow-designer/package.json index 73ca49acd9b..de2b719e2d5 100644 --- a/packages/flow-designer/package.json +++ b/packages/flow-designer/package.json @@ -18,16 +18,25 @@ "author": "Talend ", "license": "Apache-2.0", "devDependencies": { + "@talend/babel-plugin-import-from-index": "^1.5.1", + "@talend/babel-plugin-assets-api": "^1.1.0", + "@talend/eslint-config": "^12.2.0", + "@talend/eslint-plugin": "^1.0.1", "@talend/scripts-config-jest": "^13.0.0", "@talend/scripts-core": "^16.1.0", + "@talend/scripts-config-typescript": "^11.1.0", "@talend/scripts-config-react-webpack": "^16.2.0", + "@testing-library/react": "^12.1.5", + "@testing-library/jest-dom": "^5.17.0", "@types/d3": "^7.4.3", - "@types/enzyme": "^3.10.16", "@types/invariant": "^2.2.37", + "@types/jest": "^29.5.5", "@types/lodash": "^4.14.201", + "@types/node": "^6.14.13", + "@types/prop-types": "^15.7.5", + "@types/react": "^18.2.37", "@types/react-redux": "^7.1.30", "@types/react-test-renderer": "^18.0.6", - "@types/react": "^18.2.37", "@types/redux-mock-store": "^1.0.6", "@types/redux-thunk": "^2.1.0", "i18next": "^23.6.0", diff --git a/packages/flow-designer/src/components/node/AbstractNode.test.tsx b/packages/flow-designer/src/components/node/AbstractNode.test.tsx index 4be29513683..ac7673986a1 100644 --- a/packages/flow-designer/src/components/node/AbstractNode.test.tsx +++ b/packages/flow-designer/src/components/node/AbstractNode.test.tsx @@ -1,3 +1,4 @@ +import '@testing-library/jest-dom'; import { fireEvent, render, screen } from '@testing-library/react'; import { diff --git a/packages/flow-designer/tsconfig.json b/packages/flow-designer/tsconfig.json index 0a281ba5d05..68a6d5c1e05 100644 --- a/packages/flow-designer/tsconfig.json +++ b/packages/flow-designer/tsconfig.json @@ -1,11 +1,11 @@ { - "extends": "../../node_modules/@talend/scripts-config-typescript/tsconfig.json", + "extends": "@talend/scripts-config-typescript/tsconfig.json", "include": ["src/**/*"], "compilerOptions": { "declaration": true, "allowJs": false, "incremental": true, "module": "CommonJs", - "typeRoots": ["src/customTypings/index.d", "../../node_modules/@types"] + "typeRoots": ["src/customTypings/index.d", "node_modules/@types"] } } diff --git a/packages/forms/src/UIForm/Widget/Widget.component.js b/packages/forms/src/UIForm/Widget/Widget.component.js index 5022be3bcf3..b4a84fb29ca 100644 --- a/packages/forms/src/UIForm/Widget/Widget.component.js +++ b/packages/forms/src/UIForm/Widget/Widget.component.js @@ -9,6 +9,7 @@ import shouldRender from '../utils/condition'; import theme from './Widget.component.module.scss'; import { useWidget } from '../context'; +// eslint-disable-next-line @typescript-eslint/default-param-last function isUpdating(updatingKeys = [], key) { if (updatingKeys.length === 0 || !key) { return false; diff --git a/packages/forms/src/UIForm/fields/CheckBox/displayMode/TextMode.module.scss b/packages/forms/src/UIForm/fields/CheckBox/displayMode/TextMode.module.scss index 914116cf8b3..ccff0f25ad8 100644 --- a/packages/forms/src/UIForm/fields/CheckBox/displayMode/TextMode.module.scss +++ b/packages/forms/src/UIForm/fields/CheckBox/displayMode/TextMode.module.scss @@ -17,6 +17,7 @@ } // override bootstrap style. This for is needed to write a bigger weight selector +/* stylelint-disable-next-line selector-no-qualifying-type */ form div:not(.has-success):not(.has-warning):not(.has-error).checkbox label { color: inherit; font-size: inherit; diff --git a/packages/forms/src/UIForm/fields/Datalist/Datalist.component.js b/packages/forms/src/UIForm/fields/Datalist/Datalist.component.js index 9cd71f127eb..de27de0dff2 100644 --- a/packages/forms/src/UIForm/fields/Datalist/Datalist.component.js +++ b/packages/forms/src/UIForm/fields/Datalist/Datalist.component.js @@ -218,6 +218,7 @@ class Datalist extends Component { {...this.state} dataFeature={this.props.schema.dataFeature} className="form-control-container" + // eslint-disable-next-line jsx-a11y/no-autofocus autoFocus={this.props.schema.autoFocus} disabled={this.props.schema.disabled || this.props.valueIsUpdating} multiSection={get(this.props, 'schema.options.isMultiSection', false)} diff --git a/packages/forms/src/UIForm/fields/Date/Date.component.js b/packages/forms/src/UIForm/fields/Date/Date.component.js index 37c7eef45d3..a3c9ef6ca4e 100644 --- a/packages/forms/src/UIForm/fields/Date/Date.component.js +++ b/packages/forms/src/UIForm/fields/Date/Date.component.js @@ -55,6 +55,7 @@ function DateWidget(props) { valueIsUpdating={valueIsUpdating} > { ], }, }; + beforeEach(() => { jest.resetAllMocks(); }); + it('should render default File', () => { // when const { container } = render(); @@ -100,7 +103,9 @@ describe('File field', () => { // when const fileInput = document.querySelector('input[type="file"]'); await userEvent.upload(fileInput, blob); - expect(props.onChange).toHaveBeenCalledWith(expect.anything(), { schema, value }); + await waitFor(() => + expect(props.onChange).toHaveBeenCalledWith(expect.anything(), { schema, value }), + ); }); it('should trigger pre-signed url related onChange when user select file', async () => { @@ -116,10 +121,12 @@ describe('File field', () => { const fileInput = document.querySelector('input[type="file"]'); await userEvent.upload(fileInput, blob); - expect(propsWithPresignedUrlTrigger.onTrigger).toHaveBeenCalledWith(expect.anything(), { - schema: propsWithPresignedUrlTrigger.schema, - trigger: propsWithPresignedUrlTrigger.schema.triggers[0], - }); + await waitFor(() => + expect(propsWithPresignedUrlTrigger.onTrigger).toHaveBeenCalledWith(expect.anything(), { + schema: propsWithPresignedUrlTrigger.schema, + trigger: propsWithPresignedUrlTrigger.schema.triggers[0], + }), + ); }); it('should not change filename in state when props are not updated', () => { diff --git a/packages/forms/src/UIForm/fields/MultiSelectTag/MultiSelectTag.component.js b/packages/forms/src/UIForm/fields/MultiSelectTag/MultiSelectTag.component.js index ab489e681f3..fd18b757889 100644 --- a/packages/forms/src/UIForm/fields/MultiSelectTag/MultiSelectTag.component.js +++ b/packages/forms/src/UIForm/fields/MultiSelectTag/MultiSelectTag.component.js @@ -254,6 +254,7 @@ export default class MultiSelectTag extends Component { ", "license": "Apache-2.0", "devDependencies": { + "@talend/dynamic-cdn-webpack-plugin": "^13.0.1", "@talend/eslint-config": "^12.2.0", "@talend/eslint-plugin": "^1.0.1", "@talend/scripts-core": "^16.1.0", "@talend/scripts-config-babel": "^13.1.0", "@talend/scripts-config-stylelint": "^4.0.0", + "body-parser": "1.20.1", "compression": "^1.7.4", + "copy-webpack-plugin": "^10.2.4", "cross-env": "^7.0.3", "express": "^4.18.2", - "i18next-http-backend": "^1.4.5" + "i18next-http-backend": "^1.4.5", + "webpack": "^5.88.2" }, "dependencies": { "@talend/bootstrap-theme": "^8.2.1", "@talend/react-bootstrap": "^2.1.0", "@talend/assets-api": "^1.2.2", + "@talend/design-system": "^8.1.3", + "@talend/design-tokens": "^2.9.0", "@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/react-cmf": "^8.1.0", "@talend/react-cmf-router": "^6.1.0", "@talend/react-components": "^12.1.0", diff --git a/packages/playground/webpack.config.dev.js b/packages/playground/webpack.config.dev.js index 080650d90fa..93942c7d875 100644 --- a/packages/playground/webpack.config.dev.js +++ b/packages/playground/webpack.config.dev.js @@ -30,7 +30,6 @@ const PKGS = [ '@talend/assets-api', '@talend/design-tokens', '@talend/design-system', - '@talend/design-tokens', '@talend/react-bootstrap', '@talend/react-components', '@talend/react-containers', diff --git a/packages/stepper/package.json b/packages/stepper/package.json index e2870006eec..e8c2d948921 100644 --- a/packages/stepper/package.json +++ b/packages/stepper/package.json @@ -34,6 +34,7 @@ }, "dependencies": { "@talend/design-system": "^8.1.3", + "@talend/design-tokens": "^2.9.0", "@talend/react-components": "^12.1.0", "classnames": "^2.3.2", "invariant": "^2.2.4", diff --git a/packages/storybook-cmf/package.json b/packages/storybook-cmf/package.json index 9df9a30f1ad..ed1e1847bc3 100644 --- a/packages/storybook-cmf/package.json +++ b/packages/storybook-cmf/package.json @@ -39,7 +39,7 @@ "prop-types": "^15.8.1" }, "peerDependencies": { - "@talend/react-cmf": "^8.0.0", + "@talend/react-cmf": "^8.1.0", "react": ">= 16.14.0", "react-dom": ">= 16.14.0", "react-redux": "^7.2.9", diff --git a/packages/storybook-docs/package.json b/packages/storybook-docs/package.json index d9607c5c69b..15e36e28708 100644 --- a/packages/storybook-docs/package.json +++ b/packages/storybook-docs/package.json @@ -44,7 +44,7 @@ "@talend/scripts-config-storybook-lib": "^5.1.0", "@talend/scripts-config-typescript": "^11.1.0", "@types/node": "^6.14.13", - "@types/react": "^17.0.70", + "@types/react": "^18.2.37", "@types/react-dom": "^17.0.23", "css-loader": "^4.3.0", "mini-css-extract-plugin": "^2.7.6", diff --git a/packages/storybook-docs/src/components/FigmaContext.ts b/packages/storybook-docs/src/components/FigmaContext.ts index 6b722678d34..eb363647dbd 100644 --- a/packages/storybook-docs/src/components/FigmaContext.ts +++ b/packages/storybook-docs/src/components/FigmaContext.ts @@ -3,10 +3,16 @@ import * as Figma from 'figma-js'; const token = process.env.STORYBOOK_FIGMA_ACCESS_TOKEN; -export default createContext({ +interface FigmaClient extends ReturnType { + isConfigured: boolean; +} + +export const FigmaContext = createContext({ // eslint-disable-next-line new-cap ...Figma.Client({ personalAccessToken: token, }), isConfigured: !!token, }); + +export default FigmaContext; diff --git a/packages/storybook-docs/src/components/Trial/Trial.stories.tsx b/packages/storybook-docs/src/components/Trial/Trial.stories.tsx index 3ab5c25ffc5..febc0bdcc41 100644 --- a/packages/storybook-docs/src/components/Trial/Trial.stories.tsx +++ b/packages/storybook-docs/src/components/Trial/Trial.stories.tsx @@ -2,9 +2,11 @@ import { Trial } from './Trial'; import { Meta, StoryFn } from '@storybook/react'; -export default { +const meta: Meta = { component: Trial, -} as Meta; +}; + +export default meta; export const Story: StoryFn = () => { return Trial component; diff --git a/packages/storybook-one/.storybook/main.js b/packages/storybook-one/.storybook/main.js index b1bcc023b84..bb3f6bf3391 100644 --- a/packages/storybook-one/.storybook/main.js +++ b/packages/storybook-one/.storybook/main.js @@ -12,8 +12,8 @@ const STORIES = [ titlePrefix: 'Design System', directory: `${rootPath}/../design-system/src`, }, - `${rootPath}/../components/**/*.stories.@(js|tsx)`, - `${rootPath}/../forms/**/*.stories.@(js|tsx)`, + `${rootPath}/../components/src/**/*.stories.@(js|tsx)`, + `${rootPath}/../forms/src/**/*.stories.@(js|tsx)`, `${rootPath}/../dataviz/src/**/*.stories.@(js|tsx)`, `${rootPath}/../icons/stories/**/*.stories.@(js|tsx)`, `${rootPath}/../faceted-search/stories/**/*.stories.@(js|tsx)`, diff --git a/packages/storybook-one/package.json b/packages/storybook-one/package.json index 5ce60ce18a2..1bac8ffd2e9 100644 --- a/packages/storybook-one/package.json +++ b/packages/storybook-one/package.json @@ -28,6 +28,7 @@ "@talend/react-components": "^12.1.0", "@talend/react-forms": "^12.0.0", "@talend/react-dataviz": "^4.1.0", + "lodash": "^4.17.21", "pkg-dir": "^7.0.0", "react-hook-form": "^7.48.2" }, @@ -43,7 +44,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", @@ -55,6 +55,7 @@ "@talend/locales-tui-faceted-search": "^11.3.0", "@talend/locales-tui-forms": "^10.2.4", "@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", "@talend/scripts-core": "^16.1.0", diff --git a/packages/theme/package.json b/packages/theme/package.json index e08e535ec10..bfb830eaf92 100644 --- a/packages/theme/package.json +++ b/packages/theme/package.json @@ -28,11 +28,12 @@ }, "dependencies": { "@talend/bootstrap-sass": "^3.5.0", - "@talend/design-tokens": "^2.9.0", - "@talend/icons": "^7.1.0" + "@talend/design-tokens": "^2.9.0" }, "devDependencies": { - "@talend/icons": "^7.1.0", + "@talend/eslint-config": "^12.2.0", + "@talend/eslint-plugin": "^1.0.1", + "@talend/scripts-config-stylelint": "^4.0.0", "@talend/scripts-core": "^16.1.0", "copy-webpack-plugin": "^10.2.4", "css-minimizer-webpack-plugin": "^4.2.2", diff --git a/packages/theme/webpack.config.js b/packages/theme/webpack.config.js index ccf1f08de1c..2ffb9d6c2da 100644 --- a/packages/theme/webpack.config.js +++ b/packages/theme/webpack.config.js @@ -25,7 +25,7 @@ module.exports = (env, argv) => { test: /\.woff(2)?(\?[a-z0-9=&.]+)?$/, use: [ { - loader: 'file-loader', + loader: require.resolve('file-loader'), options: { outputPath: 'fonts', name: '[name].[ext]', @@ -38,17 +38,17 @@ module.exports = (env, argv) => { test: /bootstrap\.scss$/, use: [ { - loader: isDev ? 'style-loader' : MiniCssExtractPlugin.loader, + loader: isDev ? require.resolve('style-loader') : MiniCssExtractPlugin.loader, }, { - loader: 'css-loader', + loader: require.resolve('css-loader'), options: { importLoaders: 3, sourceMap: true, }, }, { - loader: 'postcss-loader', + loader: require.resolve('postcss-loader'), options: { postcssOptions: { plugins: [postcssPresetEnv({ browsers: 'last 2 versions' })], @@ -57,7 +57,7 @@ module.exports = (env, argv) => { }, }, { - loader: 'sass-loader', + loader: require.resolve('sass-loader'), options: { sourceMap: true, }, diff --git a/packages/utils/package.json b/packages/utils/package.json index 0e6e00ae128..decae8027f5 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -20,7 +20,14 @@ "extends": "talend-scripts extends" }, "devDependencies": { + "@talend/eslint-config": "^12.2.0", + "@talend/eslint-plugin": "^1.0.1", "@talend/scripts-core": "^16.1.0", + "@talend/scripts-config-jest": "^13.0.0", + "@talend/scripts-config-stylelint": "^4.0.0", + "@talend/scripts-config-typescript": "^11.1.0", + "@types/date-fns": "^0.0.2", + "@types/lodash": "^4.14.201", "cross-env": "^7.0.3" }, "dependencies": { diff --git a/packages/utils/tsconfig.json b/packages/utils/tsconfig.json index 636087290d4..03264a1df9f 100644 --- a/packages/utils/tsconfig.json +++ b/packages/utils/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../node_modules/@talend/scripts-config-typescript/tsconfig.json", + "extends": "@talend/scripts-config-typescript/tsconfig.json", "include": ["src/**/*"], "compilerOptions": { "declaration": true,