From 4c6f37f9186955abe3694dbc8870859543234623 Mon Sep 17 00:00:00 2001 From: Gbacc Date: Mon, 11 Mar 2024 17:03:46 +0100 Subject: [PATCH 01/32] fix(jest-config): avoid warning spam when mocking missing lib for jest (#5224) --- .changeset/wet-flowers-beg.md | 5 +++ tools/scripts-config-jest/test-setup.js | 42 +++---------------------- 2 files changed, 10 insertions(+), 37 deletions(-) create mode 100644 .changeset/wet-flowers-beg.md diff --git a/.changeset/wet-flowers-beg.md b/.changeset/wet-flowers-beg.md new file mode 100644 index 00000000000..b13147d76f1 --- /dev/null +++ b/.changeset/wet-flowers-beg.md @@ -0,0 +1,5 @@ +--- +"@talend/scripts-config-jest": patch +--- + +Avoid warning spam in case of mocking missing library for jest diff --git a/tools/scripts-config-jest/test-setup.js b/tools/scripts-config-jest/test-setup.js index a69f837392c..39adbaaa525 100644 --- a/tools/scripts-config-jest/test-setup.js +++ b/tools/scripts-config-jest/test-setup.js @@ -12,35 +12,14 @@ require('core-js/stable'); require('regenerator-runtime/runtime'); require('raf/polyfill'); -const warnMessageOptionalDep = (mainDepToMock, depList = []) => { - if (depList.length === 0) { - console.warn( - `JEST MOCK WARN: ${mainDepToMock} is not resolved.` + - '\nThis is an optional dependency.' + - '\nPlease add it in your dependencies if you need it', - ); - } else if (depList.length > 0) { - console.warn( - `JEST MOCK WARN: one or more of those deps are not resolved: ${depList.join(', ')}` + - 'These are optional dependencies but work together.' + - `\nIt's needed to mock ${mainDepToMock}` + - '\nPlease add them in your dependencies if you need them', - ); - } -}; - try { const jestAxe = require('jest-axe'); expect.extend(jestAxe.toHaveNoViolations); -} catch (e) { - warnMessageOptionalDep('jest-axe'); -} +} catch (e) {} try { jest.mock('ally.js'); -} catch (e) { - warnMessageOptionalDep('ally.js'); -} +} catch (e) {} // add missing ResizeObserver class ResizeObserver { @@ -147,9 +126,7 @@ try { i18nextMock.addResources = () => {}; return i18nextMock; }); -} catch (e) { - warnMessageOptionalDep('i18next'); -} +} catch (e) {} try { jest.mock('react-i18next', () => { @@ -201,9 +178,7 @@ try { Array.isArray(children) ? renderNodes(children) : renderNodes([children]), }; }); -} catch (e) { - warnMessageOptionalDep('react-i18next', ['react-i18next', 'i18next', 'react']); -} +} catch (e) {} try { jest.mock('@talend/design-system', () => { @@ -260,14 +235,7 @@ try { return mocks; }); -} catch { - warnMessageOptionalDep('@talend/design-system', [ - '@talend/design-system', - 'react', - 'prop-types', - 'classnames', - ]); -} +} catch {} // @floating-ui/react // https://github.com/floating-ui/floating-ui/issues/1908 From 319d4b6b8961e72e6028e99362470fa43b056aeb Mon Sep 17 00:00:00 2001 From: Talend bot Date: Mon, 11 Mar 2024 17:29:31 +0100 Subject: [PATCH 02/32] chore: prepare release (#5225) Co-authored-by: github-actions[bot] --- .changeset/wet-flowers-beg.md | 5 ----- tools/scripts-config-jest/CHANGELOG.md | 6 ++++++ tools/scripts-config-jest/package.json | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 .changeset/wet-flowers-beg.md diff --git a/.changeset/wet-flowers-beg.md b/.changeset/wet-flowers-beg.md deleted file mode 100644 index b13147d76f1..00000000000 --- a/.changeset/wet-flowers-beg.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@talend/scripts-config-jest": patch ---- - -Avoid warning spam in case of mocking missing library for jest diff --git a/tools/scripts-config-jest/CHANGELOG.md b/tools/scripts-config-jest/CHANGELOG.md index 57813152dee..7027a0a8528 100644 --- a/tools/scripts-config-jest/CHANGELOG.md +++ b/tools/scripts-config-jest/CHANGELOG.md @@ -1,5 +1,11 @@ # @talend/scripts-config-jest +## 14.0.3 + +### Patch Changes + +- 4c6f37f: Avoid warning spam in case of mocking missing library for jest + ## 14.0.2 ### Patch Changes diff --git a/tools/scripts-config-jest/package.json b/tools/scripts-config-jest/package.json index a1067a67708..17cceefb8b7 100644 --- a/tools/scripts-config-jest/package.json +++ b/tools/scripts-config-jest/package.json @@ -1,7 +1,7 @@ { "name": "@talend/scripts-config-jest", "description": "Jest configuration for @talend/scripts-core", - "version": "14.0.2", + "version": "14.0.3", "license": "Apache-2.0", "main": "index.js", "author": "Talend Frontend ", From af0ac2df603f164e7dd752453be2dc82a97b44ea Mon Sep 17 00:00:00 2001 From: Sebastien LE MOUILLOUR <32456736+smouillour@users.noreply.github.com> Date: Tue, 12 Mar 2024 14:57:56 +0100 Subject: [PATCH 03/32] chore: Upgrade rimraf (#5227) --- .changeset/pretty-knives-judge.md | 11 +++++++++++ fork/dynamic-cdn-webpack-plugin/package.json | 2 +- .../test/helpers/clean-dir.js | 12 ++---------- package.json | 2 +- packages/jsfc/package.json | 2 +- packages/theme/package.json | 2 +- tools/scripts-build-cdn/build.js | 2 +- tools/scripts-build-cdn/clean.js | 4 ++-- tools/scripts-build-cdn/package.json | 2 +- tools/scripts-core/__tests__/index.test.js | 4 ++-- tools/scripts-core/package.json | 2 +- tools/scripts-core/src/scripts/build-lib.js | 4 ++-- tools/scripts-publish-local/package.json | 2 +- tools/scripts-publish-local/src/npm.js | 18 +++++++++--------- tools/scripts-publish-local/src/verdaccio.js | 4 ++-- tools/upgrade-deps/tests/cli-security.test.js | 4 ++-- tools/upgrade-deps/tests/cli.test.js | 4 ++-- tools/upgrade-deps/tests/utils.js | 2 +- 18 files changed, 43 insertions(+), 40 deletions(-) create mode 100644 .changeset/pretty-knives-judge.md diff --git a/.changeset/pretty-knives-judge.md b/.changeset/pretty-knives-judge.md new file mode 100644 index 00000000000..0d5302d29b5 --- /dev/null +++ b/.changeset/pretty-knives-judge.md @@ -0,0 +1,11 @@ +--- +"@talend/dynamic-cdn-webpack-plugin": patch +"@talend/scripts-publish-local": patch +"@talend/scripts-build-cdn": patch +"@talend/scripts-core": patch +"@talend/upgrade-deps": patch +"@talend/bootstrap-theme": patch +"@talend/json-schema-form-core": patch +--- + +Upgrade rimraf to version 5.0.5 diff --git a/fork/dynamic-cdn-webpack-plugin/package.json b/fork/dynamic-cdn-webpack-plugin/package.json index c74a325a844..556eac71b6d 100644 --- a/fork/dynamic-cdn-webpack-plugin/package.json +++ b/fork/dynamic-cdn-webpack-plugin/package.json @@ -52,7 +52,7 @@ "html-webpack-plugin": "^5.6.0", "jest": "^29.7.0", "mz": "^2.7.0", - "rimraf": "^3.0.2", + "rimraf": "^5.0.5", "webpack": "^5.90.3", "webpack-cli": "^4.10.0", "webpack-manifest-plugin": "^5.0.0" diff --git a/fork/dynamic-cdn-webpack-plugin/test/helpers/clean-dir.js b/fork/dynamic-cdn-webpack-plugin/test/helpers/clean-dir.js index 23ae125d635..dfae7778fcb 100644 --- a/fork/dynamic-cdn-webpack-plugin/test/helpers/clean-dir.js +++ b/fork/dynamic-cdn-webpack-plugin/test/helpers/clean-dir.js @@ -1,14 +1,6 @@ // eslint-disable-next-line import/no-extraneous-dependencies -const rimraf = require('rimraf'); +const { rimraf } = require('rimraf'); module.exports = function cleanDir(dir) { - return new Promise((resolve, reject) => { - rimraf(dir, err => { - if (err) { - return reject(err); - } - - return resolve(); - }); - }); + return rimraf(dir); }; diff --git a/package.json b/package.json index 23cb1b1e370..1cd282d1e76 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "i18next-scanner": "^4.4.0", "lint-staged": "^15.2.2", "prettier": "^3.2.5", - "rimraf": "^3.0.2", + "rimraf": "^5.0.5", "typescript": "^5.3.3" }, "scripts": { diff --git a/packages/jsfc/package.json b/packages/jsfc/package.json index ce57832ec7d..67478f9a8e3 100644 --- a/packages/jsfc/package.json +++ b/packages/jsfc/package.json @@ -49,7 +49,7 @@ "@types/chai": "^3.5.2", "@types/node": "^6.14.13", "json-refs": "^3.0.15", - "rimraf": "^3.0.2", + "rimraf": "^5.0.5", "webpack": "^5.90.3" }, "dependencies": { diff --git a/packages/theme/package.json b/packages/theme/package.json index a0cea50b155..e9728035963 100644 --- a/packages/theme/package.json +++ b/packages/theme/package.json @@ -44,7 +44,7 @@ "postcss": "^8.4.35", "postcss-loader": "^7.3.4", "postcss-preset-env": "^7.8.3", - "rimraf": "^3.0.2", + "rimraf": "^5.0.5", "sass": "^1.71.1", "sass-loader": "^13.3.3", "style-loader": "^3.3.4", diff --git a/tools/scripts-build-cdn/build.js b/tools/scripts-build-cdn/build.js index cabb7d47b28..b6d6babb151 100755 --- a/tools/scripts-build-cdn/build.js +++ b/tools/scripts-build-cdn/build.js @@ -9,7 +9,7 @@ const moduleToCdn = require('@talend/module-to-cdn'); const mkdirp = require('mkdirp'); const cpx = require('cpx2'); -const rimraf = require('rimraf'); +const { rimraf } = require('rimraf'); const fs = require('fs'); const util = require('util'); const { exec } = require('child_process'); diff --git a/tools/scripts-build-cdn/clean.js b/tools/scripts-build-cdn/clean.js index aa69ccf276b..60a2f78f35a 100644 --- a/tools/scripts-build-cdn/clean.js +++ b/tools/scripts-build-cdn/clean.js @@ -1,5 +1,5 @@ /* eslint-disable no-plusplus */ -const rimraf = require('rimraf'); +const { rimrafSync } = require('rimraf'); const CWD = process.cwd(); const DIST = 'dist'; @@ -35,6 +35,6 @@ module.exports = function cleanup(program) { for (let index = 0; index < PATHS.length; index++) { const path = PATHS[index]; log(`rm -rf ${path}`); - rimraf.sync(path); + rimrafSync(path); } }; diff --git a/tools/scripts-build-cdn/package.json b/tools/scripts-build-cdn/package.json index 524c65ae885..76922fa0559 100644 --- a/tools/scripts-build-cdn/package.json +++ b/tools/scripts-build-cdn/package.json @@ -30,7 +30,7 @@ "execa": "^4.1.0", "mkdirp": "^1.0.4", "queue": "^6.0.2", - "rimraf": "^3.0.2", + "rimraf": "^5.0.5", "semver": "^7.6.0", "webpack": "^5.90.3", "webpack-bundle-analyzer": "^4.10.1", diff --git a/tools/scripts-core/__tests__/index.test.js b/tools/scripts-core/__tests__/index.test.js index b17fd25971b..56a19033b22 100644 --- a/tools/scripts-core/__tests__/index.test.js +++ b/tools/scripts-core/__tests__/index.test.js @@ -3,7 +3,7 @@ const path = require('path'); const cpx = require('cpx2'); const { spawnSync } = require('child_process'); const fs = require('fs'); -const rimraf = require('rimraf'); +const { rimrafSync } = require('rimraf'); const fixture = path.join(__dirname, 'fixture'); const bin = path.resolve(__dirname, '../src/index.js'); @@ -20,7 +20,7 @@ function getTmpDirectory(prefix) { describe('talend-scripts', () => { afterAll(() => { - rimraf.sync(path.join(__dirname, 'tmp*')); + rimrafSync(path.join(__dirname, 'tmp*'), { glob: { silent: true } }); }); describe('build', () => { it('should by default create a dist folder', () => { diff --git a/tools/scripts-core/package.json b/tools/scripts-core/package.json index 2314f3a6437..8b8de61b98a 100644 --- a/tools/scripts-core/package.json +++ b/tools/scripts-core/package.json @@ -58,7 +58,7 @@ "cpx2": "^3.0.2", "fs-extra": "^10.1.0", "lodash": "^4.17.21", - "rimraf": "^3.0.2", + "rimraf": "^5.0.5", "typescript": "^5.3.3", "webpack": "^5.90.3", "webpack-merge": "^5.10.0", diff --git a/tools/scripts-core/src/scripts/build-lib.js b/tools/scripts-core/src/scripts/build-lib.js index 65ba1875c83..2a3a3f48bf9 100755 --- a/tools/scripts-core/src/scripts/build-lib.js +++ b/tools/scripts-core/src/scripts/build-lib.js @@ -2,7 +2,7 @@ import cpx from 'cpx2'; import fs from 'fs'; import path from 'path'; -import rimraf from 'rimraf'; +import { rimrafSync } from 'rimraf'; import { fileURLToPath } from 'url'; import * as utils from '@talend/scripts-utils'; @@ -43,7 +43,7 @@ export default async function build(env, presetApi, unsafeOptions) { if (!options.includes('--watch')) { console.log(`Removing target folder (${targetFolder})...`); - rimraf.sync(targetFolder); + rimrafSync(targetFolder); } const babelPromise = () => new Promise((resolve, reject) => { diff --git a/tools/scripts-publish-local/package.json b/tools/scripts-publish-local/package.json index e6aa5ecdeff..01f8e533890 100644 --- a/tools/scripts-publish-local/package.json +++ b/tools/scripts-publish-local/package.json @@ -13,7 +13,7 @@ "dependencies": { "cross-spawn": "^7.0.3", "generate-password": "^1.7.1", - "rimraf": "^3.0.2" + "rimraf": "^5.0.5" }, "devDependencies": { "@talend/eslint-config": "^13.0.3", diff --git a/tools/scripts-publish-local/src/npm.js b/tools/scripts-publish-local/src/npm.js index 16783936704..5a00421f2db 100644 --- a/tools/scripts-publish-local/src/npm.js +++ b/tools/scripts-publish-local/src/npm.js @@ -3,7 +3,7 @@ const fs = require('fs'); const os = require('os'); const path = require('path'); const generator = require('generate-password'); -const rimraf = require('rimraf'); +const { rimrafSync, rimraf } = require('rimraf'); const cmd = require('./cmd'); const NPMRC = `${os.homedir()}/.npmrc`; @@ -30,12 +30,12 @@ function beforeSetup() { const yarnrc = path.join(CWD, '.yarnrc'); if (fs.existsSync(npmrc)) { console.log(`rm -rf ${npmrc}`); - rimraf.sync(npmrc); + rimrafSync(npmrc); } fs.writeFileSync(npmrc, 'registry=http://localhost:4873/'); if (fs.existsSync(yarnrc)) { console.log(`rm -rf ${yarnrc}`); - rimraf.sync(yarnrc); + rimrafSync(yarnrc); } fs.writeFileSync(yarnrc, 'registry "http://localhost:4873/"'); } @@ -104,17 +104,17 @@ async function setup(repositories) { const yarnlock = path.join(cwd, 'yarn.lock'); if (fs.existsSync(npmrc)) { console.log(`rm -rf ${npmrc}`); - rimraf.sync(npmrc); + rimrafSync(npmrc); fs.writeFileSync(npmrc, 'registry "http://localhost:4873/"'); } if (fs.existsSync(yarnrc)) { console.log(`rm -rf ${yarnrc}`); - rimraf.sync(yarnrc); + rimrafSync(yarnrc); fs.writeFileSync(yarnrc, 'registry "http://localhost:4873/"'); } if (fs.existsSync(yarnlock)) { console.log(`rm -rf ${yarnlock}`); - rimraf.sync(yarnlock); + rimrafSync(yarnlock); } }); return addUser(); @@ -127,13 +127,13 @@ function tearDown() { const yarnrc = path.join(CWD, '.yarnrc'); if (fs.existsSync(npmrc)) { console.log(`rm -rf ${npmrc}`); - rimraf.sync(npmrc); + rimrafSync(npmrc); } if (fs.existsSync(yarnrc)) { console.log(`rm -rf ${yarnrc}`); - rimraf.sync(yarnrc); + rimrafSync(yarnrc); } - rimraf(YARN_CACHE_DIR, function (error) { + rimraf(YARN_CACHE_DIR).then(error => { console.error(error); }); cmd.runSync('yarn config delete cache-folder'); diff --git a/tools/scripts-publish-local/src/verdaccio.js b/tools/scripts-publish-local/src/verdaccio.js index f5586b35528..5d939880098 100644 --- a/tools/scripts-publish-local/src/verdaccio.js +++ b/tools/scripts-publish-local/src/verdaccio.js @@ -1,7 +1,7 @@ /* eslint-disable no-console */ const fs = require('fs'); const os = require('os'); -const rimraf = require('rimraf'); +const { rimrafSync } = require('rimraf'); const path = require('path'); const cmd = require('./cmd'); const npm = require('./npm'); @@ -42,7 +42,7 @@ function stop() { ].forEach(toBeDeleted => { if (fs.existsSync(toBeDeleted)) { try { - rimraf.sync(toBeDeleted); + rimrafSync(toBeDeleted); } catch (error) { console.error(`Can't delete ${toBeDeleted}, error:`, error); } diff --git a/tools/upgrade-deps/tests/cli-security.test.js b/tools/upgrade-deps/tests/cli-security.test.js index f2b81abc413..f85aaa204cb 100644 --- a/tools/upgrade-deps/tests/cli-security.test.js +++ b/tools/upgrade-deps/tests/cli-security.test.js @@ -3,7 +3,7 @@ const path = require('path'); const { spawnSync } = require('child_process'); const { readFileSync } = require('fs'); const yarnpkg = require('@yarnpkg/lockfile'); -const rimraf = require('rimraf'); +const { rimrafSync } = require('rimraf'); const semver = require('semver'); const { getTmpDirectory } = require('./utils'); @@ -12,7 +12,7 @@ const bin = path.resolve(__dirname, '..', 'bin', 'cli.js'); describe('talend-upgrade-deps --security', () => { afterAll(() => { - rimraf.sync(path.join(__dirname, 'tmp-security-*')); + rimrafSync(path.join(__dirname, 'tmp-security-*'), { glob: { silent: true } }); }); it('should fail when used with another option', async () => { diff --git a/tools/upgrade-deps/tests/cli.test.js b/tools/upgrade-deps/tests/cli.test.js index 02a00573d2a..f8d452885cc 100644 --- a/tools/upgrade-deps/tests/cli.test.js +++ b/tools/upgrade-deps/tests/cli.test.js @@ -2,7 +2,7 @@ const path = require('path'); const { spawnSync } = require('child_process'); const { readFileSync } = require('fs'); -const rimraf = require('rimraf'); +const { rimrafSync } = require('rimraf'); const { getLockContent, getTmpDirectory, @@ -28,7 +28,7 @@ describe.each(['package-lock.json', 'yarn.lock'])('talend-upgrade-deps %s', lock originLock = getLockContent(fixturePath, lock); }); afterAll(() => { - rimraf.sync(path.join(__dirname, 'tmp-basic-*')); + rimrafSync(path.join(__dirname, 'tmp-basic-*'), { glob: { silent: true } }); }); it('should by default only do safe upgrade', async () => { diff --git a/tools/upgrade-deps/tests/utils.js b/tools/upgrade-deps/tests/utils.js index 174753a72a8..c212b9b1535 100644 --- a/tools/upgrade-deps/tests/utils.js +++ b/tools/upgrade-deps/tests/utils.js @@ -7,7 +7,7 @@ const { exec } = require('child_process'); const cpx = require('cpx2'); const semver = require('semver'); const yarnpkg = require('@yarnpkg/lockfile'); -const rimraf = require('rimraf'); +const { rimraf } = require('rimraf'); const util = require('util'); const execProm = util.promisify(exec); From 5f94fc203d1885fadfa98fb598a9565f7a814e93 Mon Sep 17 00:00:00 2001 From: Talend bot Date: Tue, 12 Mar 2024 15:16:50 +0100 Subject: [PATCH 04/32] chore: prepare release (#5228) --- .changeset/pretty-knives-judge.md | 11 ----------- fork/dynamic-cdn-webpack-plugin/CHANGELOG.md | 6 ++++++ fork/dynamic-cdn-webpack-plugin/package.json | 2 +- packages/jsfc/CHANGELOG.md | 6 ++++++ packages/jsfc/package.json | 4 ++-- packages/theme/CHANGELOG.md | 6 ++++++ packages/theme/package.json | 4 ++-- tools/scripts-build-cdn/CHANGELOG.md | 6 ++++++ tools/scripts-build-cdn/package.json | 2 +- tools/scripts-core/CHANGELOG.md | 6 ++++++ tools/scripts-core/package.json | 2 +- tools/scripts-publish-local/CHANGELOG.md | 6 ++++++ tools/scripts-publish-local/package.json | 4 ++-- tools/upgrade-deps/CHANGELOG.md | 6 ++++++ tools/upgrade-deps/package.json | 4 ++-- 15 files changed, 53 insertions(+), 22 deletions(-) delete mode 100644 .changeset/pretty-knives-judge.md diff --git a/.changeset/pretty-knives-judge.md b/.changeset/pretty-knives-judge.md deleted file mode 100644 index 0d5302d29b5..00000000000 --- a/.changeset/pretty-knives-judge.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -"@talend/dynamic-cdn-webpack-plugin": patch -"@talend/scripts-publish-local": patch -"@talend/scripts-build-cdn": patch -"@talend/scripts-core": patch -"@talend/upgrade-deps": patch -"@talend/bootstrap-theme": patch -"@talend/json-schema-form-core": patch ---- - -Upgrade rimraf to version 5.0.5 diff --git a/fork/dynamic-cdn-webpack-plugin/CHANGELOG.md b/fork/dynamic-cdn-webpack-plugin/CHANGELOG.md index 40e3cfab528..596f65f0fc7 100644 --- a/fork/dynamic-cdn-webpack-plugin/CHANGELOG.md +++ b/fork/dynamic-cdn-webpack-plugin/CHANGELOG.md @@ -1,5 +1,11 @@ # CHANGELOG +## 13.1.2 + +### Patch Changes + +- af0ac2d: Upgrade rimraf to version 5.0.5 + ## 13.1.1 ### Patch Changes diff --git a/fork/dynamic-cdn-webpack-plugin/package.json b/fork/dynamic-cdn-webpack-plugin/package.json index 556eac71b6d..4a5254fb490 100644 --- a/fork/dynamic-cdn-webpack-plugin/package.json +++ b/fork/dynamic-cdn-webpack-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@talend/dynamic-cdn-webpack-plugin", - "version": "13.1.1", + "version": "13.1.2", "description": "Dynamically get your dependencies from a cdn rather than bundling them in your app", "license": "MIT", "repository": "Talend/dynamic-cdn-webpack-plugin", diff --git a/packages/jsfc/CHANGELOG.md b/packages/jsfc/CHANGELOG.md index c25ebce3f42..aed607db27a 100644 --- a/packages/jsfc/CHANGELOG.md +++ b/packages/jsfc/CHANGELOG.md @@ -1,5 +1,11 @@ # @talend/json-schema-form-core +## 1.2.4 + +### Patch Changes + +- af0ac2d: Upgrade rimraf to version 5.0.5 + ## 1.2.3 ### Patch Changes diff --git a/packages/jsfc/package.json b/packages/jsfc/package.json index 67478f9a8e3..db287e92964 100644 --- a/packages/jsfc/package.json +++ b/packages/jsfc/package.json @@ -1,6 +1,6 @@ { "name": "@talend/json-schema-form-core", - "version": "1.2.3", + "version": "1.2.4", "description": "JSON-Schema and JSON-UI-Schema utilities for form generation.", "main": "dist/index.js", "mainSrc": "src/index.js", @@ -41,7 +41,7 @@ "devDependencies": { "@talend/eslint-config": "^13.0.3", "@talend/eslint-plugin": "^1.1.1", - "@talend/scripts-core": "^16.3.5", + "@talend/scripts-core": "^16.3.6", "@talend/scripts-config-react-webpack": "^16.5.1", "@talend/scripts-config-typescript": "^11.2.1", "@talend/babel-plugin-import-from-index": "^1.7.1", diff --git a/packages/theme/CHANGELOG.md b/packages/theme/CHANGELOG.md index b61295d2257..f14a8f53d6f 100644 --- a/packages/theme/CHANGELOG.md +++ b/packages/theme/CHANGELOG.md @@ -1,5 +1,11 @@ # @talend/bootstrap-theme +## 9.1.2 + +### Patch Changes + +- af0ac2d: Upgrade rimraf to version 5.0.5 + ## 9.1.1 ### Patch Changes diff --git a/packages/theme/package.json b/packages/theme/package.json index e9728035963..ff0d1a8811a 100644 --- a/packages/theme/package.json +++ b/packages/theme/package.json @@ -34,7 +34,7 @@ "@talend/eslint-config": "^13.0.3", "@talend/eslint-plugin": "^1.1.1", "@talend/scripts-config-stylelint": "^4.1.1", - "@talend/scripts-core": "^16.3.5", + "@talend/scripts-core": "^16.3.6", "copy-webpack-plugin": "^11.0.0", "css-minimizer-webpack-plugin": "^5.0.1", "css-loader": "^4.3.0", @@ -55,5 +55,5 @@ "publishConfig": { "access": "public" }, - "version": "9.1.1" + "version": "9.1.2" } diff --git a/tools/scripts-build-cdn/CHANGELOG.md b/tools/scripts-build-cdn/CHANGELOG.md index a7ea5ce37f2..97443b3eccf 100644 --- a/tools/scripts-build-cdn/CHANGELOG.md +++ b/tools/scripts-build-cdn/CHANGELOG.md @@ -1,5 +1,11 @@ # @talend/scripts-build-cdn +## 11.1.3 + +### Patch Changes + +- af0ac2d: Upgrade rimraf to version 5.0.5 + ## 11.1.2 ### Patch Changes diff --git a/tools/scripts-build-cdn/package.json b/tools/scripts-build-cdn/package.json index 76922fa0559..b4a1246e2d7 100644 --- a/tools/scripts-build-cdn/package.json +++ b/tools/scripts-build-cdn/package.json @@ -1,6 +1,6 @@ { "name": "@talend/scripts-build-cdn", - "version": "11.1.2", + "version": "11.1.3", "description": "Give a CLI to build a CDN for js and css with unpkg like structures", "main": "index.js", "bin": { diff --git a/tools/scripts-core/CHANGELOG.md b/tools/scripts-core/CHANGELOG.md index ac12b92f430..1ae0e4e6c52 100644 --- a/tools/scripts-core/CHANGELOG.md +++ b/tools/scripts-core/CHANGELOG.md @@ -1,5 +1,11 @@ # @talend/scripts-core +## 16.3.6 + +### Patch Changes + +- af0ac2d: Upgrade rimraf to version 5.0.5 + ## 16.3.5 ### Patch Changes diff --git a/tools/scripts-core/package.json b/tools/scripts-core/package.json index 8b8de61b98a..cc40c820f00 100644 --- a/tools/scripts-core/package.json +++ b/tools/scripts-core/package.json @@ -1,7 +1,7 @@ { "name": "@talend/scripts-core", "description": "Set of scripts", - "version": "16.3.5", + "version": "16.3.6", "license": "Apache-2.0", "exports": "./src/index.js", "type": "module", diff --git a/tools/scripts-publish-local/CHANGELOG.md b/tools/scripts-publish-local/CHANGELOG.md index 09faa898702..399b9e76a4b 100644 --- a/tools/scripts-publish-local/CHANGELOG.md +++ b/tools/scripts-publish-local/CHANGELOG.md @@ -1,5 +1,11 @@ # @talend/scripts-publish-local +## 1.3.3 + +### Patch Changes + +- af0ac2d: Upgrade rimraf to version 5.0.5 + ## 1.3.2 ### Patch Changes diff --git a/tools/scripts-publish-local/package.json b/tools/scripts-publish-local/package.json index 01f8e533890..1d95c5e5e70 100644 --- a/tools/scripts-publish-local/package.json +++ b/tools/scripts-publish-local/package.json @@ -1,6 +1,6 @@ { "name": "@talend/scripts-publish-local", - "version": "1.3.2", + "version": "1.3.3", "description": "", "bin": { "talend-publish-local": "./bin/cli.js" @@ -18,7 +18,7 @@ "devDependencies": { "@talend/eslint-config": "^13.0.3", "@talend/eslint-plugin": "^1.1.1", - "@talend/scripts-core": "^16.3.5" + "@talend/scripts-core": "^16.3.6" }, "author": "Talend Frontend (http://www.talend.com)", "license": "Apache-2.0", diff --git a/tools/upgrade-deps/CHANGELOG.md b/tools/upgrade-deps/CHANGELOG.md index f23c40bf641..1cffa1eedd5 100644 --- a/tools/upgrade-deps/CHANGELOG.md +++ b/tools/upgrade-deps/CHANGELOG.md @@ -1,5 +1,11 @@ # @talend/upgrade-deps +## 3.0.3 + +### Patch Changes + +- af0ac2d: Upgrade rimraf to version 5.0.5 + ## 3.0.2 ### Patch Changes diff --git a/tools/upgrade-deps/package.json b/tools/upgrade-deps/package.json index 7ccb3b0aa02..78f699a5094 100644 --- a/tools/upgrade-deps/package.json +++ b/tools/upgrade-deps/package.json @@ -1,6 +1,6 @@ { "name": "@talend/upgrade-deps", - "version": "3.0.2", + "version": "3.0.3", "description": "CLI to help management of dependencies", "type": "module", "bin": { @@ -16,7 +16,7 @@ "devDependencies": { "@talend/eslint-config": "^13.0.3", "@talend/eslint-plugin": "^1.1.1", - "@talend/scripts-core": "^16.3.5" + "@talend/scripts-core": "^16.3.6" }, "license": "Apache-2.0", "homepage": "https://github.com/Talend/ui", From 0629df799f0e5f1bf8fa395fa741879864fc9422 Mon Sep 17 00:00:00 2001 From: Gbacc Date: Wed, 13 Mar 2024 16:11:13 +0100 Subject: [PATCH 05/32] chore(ui-form): migrate to DS and remove bootstrap (#5162) * migrate text and textarea * textmode and checkboxes * added file input * change the wrapper to use DS form * too much wrapping * update tests and many fixes * fix remaining test * refactoring a bit * oops * update snap * reduce git changes * changeset * option for drawer buttons * fix buttons * some fixes * enhance radio and inline fieldset * fix some more stuff * some more fixes * and some more * reduce git changes * some more cleanup * git diff cleanup * fix snapshot * last minute fix on drawers * pr review * correct accessibility on fieldset * snapshot * last batch * Some more fixes * improve styling --- .changeset/thin-cups-worry.md | 13 + .../__snapshots__/ComponentForm.test.js.snap | 92 +- .../src/Form/__snapshots__/Form.test.js.snap | 23 +- packages/forms/package.json | 1 - packages/forms/src/FormSkeleton.module.scss | 77 +- packages/forms/src/FormSkeleton.test.tsx | 4 +- packages/forms/src/FormSkeleton.tsx | 52 +- packages/forms/src/FormSwitcher.tsx | 10 +- .../DefaultFormTemplate.component.js | 14 +- .../TextModeFormTemplate.component.js | 12 +- .../src/UIForm/Message/Message.component.js | 15 +- .../UIForm/Message/Message.component.test.js | 4 +- .../Message.component.test.js.snap | 52 +- packages/forms/src/UIForm/UIForm.component.js | 67 +- .../forms/src/UIForm/UIForm.container.test.js | 56 +- packages/forms/src/UIForm/UIForm.module.scss | 64 +- .../src/UIForm/Widget/Widget.component.js | 8 +- .../Widget/Widget.component.module.scss | 2 - .../UIForm/Widget/Widget.component.test.js | 13 +- .../Widget.component.test.js.snap | 74 +- .../UIForm/fields/Button/Button.component.js | 27 +- .../UIForm/fields/Button/Buttons.component.js | 15 +- .../UIForm/fields/Button/Buttons.module.scss | 23 - .../Button.component.test.js.snap | 82 +- .../Buttons.component.test.js.snap | 64 +- .../fields/CheckBox/CheckBox.component.js | 25 +- .../fields/CheckBox/CheckBoxes.component.js | 6 +- .../CheckBox/SimpleCheckBox.component.js | 44 +- .../fields/CheckBox/SimpleCheckBox.test.js | 4 +- .../__snapshots__/CheckBox.test.js.snap | 25 +- .../__snapshots__/CheckBoxes.test.js.snap | 85 +- .../__snapshots__/SimpleCheckBox.test.js.snap | 29 +- .../displayMode/TextMode.component.js | 27 +- .../CheckBox/displayMode/TextMode.module.scss | 24 - .../CheckBox/displayMode/TextMode.test.js | 8 +- .../__snapshots__/TextMode.test.js.snap | 36 +- .../src/UIForm/fields/Code/Code.component.tsx | 11 +- .../fields/Comparator/Comparator.module.scss | 24 +- .../Comparator/displayMode/TextMode.test.js | 5 +- .../__snapshots__/TextMode.test.js.snap | 20 +- .../fields/Datalist/Datalist.component.js | 21 +- .../Datalist.component.test.js.snap | 233 +-- .../displayMode/TextMode.component.js | 15 +- .../displayMode/TextMode.component.test.js | 4 +- .../Datalist/displayMode/TextMode.module.scss | 7 - .../TextMode.component.test.js.snap | 20 +- .../__snapshots__/Date.component.test.js.snap | 1847 +++++++++-------- .../DateTime.component.test.js.snap | 145 +- .../__snapshots__/Time.component.test.js.snap | 477 ++--- .../FieldTemplate/FieldTemplate.component.js | 87 +- .../FieldTemplate.component.test.js | 15 +- .../FieldTemplate/FieldTemplate.module.scss | 47 - .../FieldTemplate.component.test.js.snap | 24 +- .../displayMode/TextMode.component.js | 21 +- .../displayMode/TextMode.component.test.js | 11 +- .../TextMode.component.test.js.snap | 24 +- .../src/UIForm/fields/File/File.component.js | 193 +- .../UIForm/fields/File/File.component.test.js | 51 +- .../src/UIForm/fields/File/File.module.scss | 23 - .../__snapshots__/File.component.test.js.snap | 93 +- .../File/displayMode/TextMode.component.js | 1 + .../displayMode/TextMode.component.test.js | 11 +- .../TextMode.component.test.js.snap | 20 +- .../fields/KeyValue/KeyValue.module.scss | 38 +- .../KeyValue.component.test.js.snap | 62 +- .../MultiSelectTag.component.js | 3 +- .../MultiSelectTag/MultiSelectTag.module.scss | 34 +- .../displayMode/TextMode.component.js | 21 +- .../displayMode/TextMode.module.scss | 2 - .../NestedListView/NestedListView.module.scss | 2 - .../RadioOrSelect.component.test.js | 3 +- .../RadioOrSelect.component.test.js.snap | 50 +- .../UIForm/fields/Radios/Radios.component.js | 49 +- .../fields/Radios/Radios.component.test.js | 2 +- .../Radios.component.test.js.snap | 68 +- .../ResourcePicker.component.test.js.snap | 153 +- .../UIForm/fields/Select/Select.component.js | 89 +- .../fields/Select/Select.component.test.js | 2 +- .../Select.component.test.js.snap | 115 +- .../TextMode.component.test.js.snap | 28 +- .../src/UIForm/fields/Text/Text.component.js | 79 +- .../UIForm/fields/Text/Text.component.test.js | 32 +- .../__snapshots__/Text.component.test.js.snap | 79 +- .../Text/displayMode/TextMode.component.js | 1 + .../displayMode/TextMode.component.test.js | 7 +- .../TextMode.component.test.js.snap | 28 +- .../fields/TextArea/TextArea.component.js | 53 +- .../TextArea.component.test.js.snap | 59 +- .../displayMode/TextMode.component.js | 1 + .../displayMode/TextMode.component.test.js | 4 +- .../TextMode.component.test.js.snap | 28 +- .../UIForm/fields/Toggle/Toggle.component.js | 51 +- .../Toggle.component.test.js.snap | 73 +- .../Toggle/displayMode/TextMode.component.js | 47 - .../Toggle/displayMode/TextMode.test.js | 21 - .../__snapshots__/TextMode.test.js.snap | 44 - .../forms/src/UIForm/fields/Toggle/index.js | 2 - .../fieldsets/Array/ArrayItem.component.js | 7 +- .../fieldsets/Array/ArrayItem.module.scss | 15 +- .../Array/DefaultArrayTemplate.component.js | 19 +- .../DefaultArrayTemplate.component.test.js | 23 +- .../Array/DefaultArrayTemplate.module.scss | 7 +- .../Array.component.test.js.snap | 434 ++-- ...efaultArrayTemplate.component.test.js.snap | 62 +- .../TextModeArrayTemplate.module.scss | 15 - .../CollapsibleFieldset.component.js | 21 +- .../CollapsibleFieldset.module.scss | 8 - ...CollapsibleFieldset.component.test.js.snap | 70 +- .../fieldsets/Columns/Columns.component.js | 17 +- .../fieldsets/Columns/Columns.module.scss | 15 - .../Columns.component.test.js.snap | 191 +- .../fieldsets/Fieldset/Fieldset.component.js | 17 +- .../Fieldset/Fieldset.component.test.js | 2 +- .../Fieldset.component.test.js.snap | 54 +- .../displayMode/TextMode.component.js | 34 - .../displayMode/TextMode.component.test.js | 65 - .../TextMode.component.test.js.snap | 45 - .../src/UIForm/fieldsets/Fieldset/index.js | 2 - .../UIForm/fieldsets/Tabs/Tabs.module.scss | 22 - .../__snapshots__/Tabs.component.test.js.snap | 99 +- packages/forms/src/UIForm/utils/labels.js | 32 + packages/forms/src/UIForm/utils/widgets.js | 23 +- packages/forms/src/index.ts | 8 +- .../src/rhf/fields/Input/Input.stories.js | 66 +- .../forms/src/rhf/fields/Input/Input.test.js | 2 +- .../rhf/fields/Input/RHFInput.component.js | 15 +- .../rhf/fields/Select/RHFSelect.component.js | 28 +- .../src/rhf/fields/Select/Select.stories.js | 46 +- .../src/rhf/fields/Select/Select.test.js | 1 - .../fields/TextArea/RHFTextArea.component.js | 14 +- .../rhf/fields/TextArea/TextArea.stories.js | 42 +- .../widgets/fields/Input/Input.component.js | 52 - .../src/widgets/fields/Input/Input.test.js | 37 - .../Input/__snapshots__/Input.test.js.snap | 22 - .../forms/src/widgets/fields/Input/index.js | 3 - .../widgets/fields/Select/Select.component.js | 73 - .../src/widgets/fields/Select/Select.test.js | 42 - .../Select/__snapshots__/Select.test.js.snap | 33 - .../forms/src/widgets/fields/Select/index.js | 3 - .../fields/TextArea/TextArea.component.js | 51 - .../widgets/fields/TextArea/TextArea.test.js | 39 - .../__snapshots__/TextArea.test.js.snap | 22 - .../src/widgets/fields/TextArea/index.js | 3 - packages/forms/src/widgets/fields/index.js | 9 - packages/forms/src/widgets/index.js | 7 - .../FieldTemplate/FieldTemplate.component.js | 63 - .../FieldTemplate/FieldTemplate.module.scss | 11 - .../FieldTemplate/FieldTemplate.test.js | 39 - .../__snapshots__/FieldTemplate.test.js.snap | 80 - .../widgets/templates/FieldTemplate/index.js | 3 - packages/forms/src/widgets/templates/index.js | 7 - packages/forms/src/widgets/templates/utils.js | 16 - .../forms/stories/SchemaLayout.stories.tsx | 33 +- .../displayMode.schema.js | 3 +- 154 files changed, 3532 insertions(+), 4597 deletions(-) create mode 100644 .changeset/thin-cups-worry.md delete mode 100644 packages/forms/src/UIForm/fields/Button/Buttons.module.scss delete mode 100644 packages/forms/src/UIForm/fields/CheckBox/displayMode/TextMode.module.scss delete mode 100644 packages/forms/src/UIForm/fields/Datalist/displayMode/TextMode.module.scss delete mode 100644 packages/forms/src/UIForm/fields/FieldTemplate/FieldTemplate.module.scss delete mode 100644 packages/forms/src/UIForm/fields/File/File.module.scss delete mode 100644 packages/forms/src/UIForm/fields/Toggle/displayMode/TextMode.component.js delete mode 100644 packages/forms/src/UIForm/fields/Toggle/displayMode/TextMode.test.js delete mode 100644 packages/forms/src/UIForm/fields/Toggle/displayMode/__snapshots__/TextMode.test.js.snap delete mode 100644 packages/forms/src/UIForm/fieldsets/CollapsibleFieldset/CollapsibleFieldset.module.scss delete mode 100644 packages/forms/src/UIForm/fieldsets/Columns/Columns.module.scss delete mode 100644 packages/forms/src/UIForm/fieldsets/Fieldset/displayMode/TextMode.component.js delete mode 100644 packages/forms/src/UIForm/fieldsets/Fieldset/displayMode/TextMode.component.test.js delete mode 100644 packages/forms/src/UIForm/fieldsets/Fieldset/displayMode/__snapshots__/TextMode.component.test.js.snap delete mode 100644 packages/forms/src/UIForm/fieldsets/Tabs/Tabs.module.scss create mode 100644 packages/forms/src/UIForm/utils/labels.js delete mode 100644 packages/forms/src/widgets/fields/Input/Input.component.js delete mode 100644 packages/forms/src/widgets/fields/Input/Input.test.js delete mode 100644 packages/forms/src/widgets/fields/Input/__snapshots__/Input.test.js.snap delete mode 100644 packages/forms/src/widgets/fields/Input/index.js delete mode 100644 packages/forms/src/widgets/fields/Select/Select.component.js delete mode 100644 packages/forms/src/widgets/fields/Select/Select.test.js delete mode 100644 packages/forms/src/widgets/fields/Select/__snapshots__/Select.test.js.snap delete mode 100644 packages/forms/src/widgets/fields/Select/index.js delete mode 100644 packages/forms/src/widgets/fields/TextArea/TextArea.component.js delete mode 100644 packages/forms/src/widgets/fields/TextArea/TextArea.test.js delete mode 100644 packages/forms/src/widgets/fields/TextArea/__snapshots__/TextArea.test.js.snap delete mode 100644 packages/forms/src/widgets/fields/TextArea/index.js delete mode 100644 packages/forms/src/widgets/fields/index.js delete mode 100644 packages/forms/src/widgets/index.js delete mode 100644 packages/forms/src/widgets/templates/FieldTemplate/FieldTemplate.component.js delete mode 100644 packages/forms/src/widgets/templates/FieldTemplate/FieldTemplate.module.scss delete mode 100644 packages/forms/src/widgets/templates/FieldTemplate/FieldTemplate.test.js delete mode 100644 packages/forms/src/widgets/templates/FieldTemplate/__snapshots__/FieldTemplate.test.js.snap delete mode 100644 packages/forms/src/widgets/templates/FieldTemplate/index.js delete mode 100644 packages/forms/src/widgets/templates/index.js delete mode 100644 packages/forms/src/widgets/templates/utils.js diff --git a/.changeset/thin-cups-worry.md b/.changeset/thin-cups-worry.md new file mode 100644 index 00000000000..ed8e14b11c4 --- /dev/null +++ b/.changeset/thin-cups-worry.md @@ -0,0 +1,13 @@ +--- +'@talend/react-forms': major +--- + +UI-FORM will now heavily use form components from the Design System +- Parent element is wrapped with a DS Form +- File / Checkboxes / Text / Number and Textare will now use DS components +- All elements will now use DS Label in both text and normal display mode + +# BREAKING CHANGE +- Many style overrides will break because of removed bootstrap classes like `form-group` `control-label` `form-actions` `tf-actions-wrapper` `tf-buttons` or `tf-uiform` +- No more hearthbeat styling from bootstrap when form elements are in updating state +- Removed many possibilities to pass down classNames because DS components won't allow it diff --git a/packages/containers/src/ComponentForm/__snapshots__/ComponentForm.test.js.snap b/packages/containers/src/ComponentForm/__snapshots__/ComponentForm.test.js.snap index e32d83f84f0..ddf29f61419 100644 --- a/packages/containers/src/ComponentForm/__snapshots__/ComponentForm.test.js.snap +++ b/packages/containers/src/ComponentForm/__snapshots__/ComponentForm.test.js.snap @@ -2,46 +2,46 @@ exports[`ComponentForm #render should render a UIForm 1`] = `
-
-
+ Metadata + +
- - Metadata - + Name +
- -
+
+
-
-
+
+
`; diff --git a/packages/forms/src/UIForm/fields/TextArea/displayMode/TextMode.component.js b/packages/forms/src/UIForm/fields/TextArea/displayMode/TextMode.component.js index cbf0172c569..27f66d3cc3d 100644 --- a/packages/forms/src/UIForm/fields/TextArea/displayMode/TextMode.component.js +++ b/packages/forms/src/UIForm/fields/TextArea/displayMode/TextMode.component.js @@ -1,4 +1,5 @@ import PropTypes from 'prop-types'; + import { TextMode as FieldTemplate } from '../../FieldTemplate'; export default function TextMode({ id, schema, value }) { diff --git a/packages/forms/src/UIForm/fields/TextArea/displayMode/TextMode.component.test.js b/packages/forms/src/UIForm/fields/TextArea/displayMode/TextMode.component.test.js index 2bc62041317..240f84cb168 100644 --- a/packages/forms/src/UIForm/fields/TextArea/displayMode/TextMode.component.test.js +++ b/packages/forms/src/UIForm/fields/TextArea/displayMode/TextMode.component.test.js @@ -26,9 +26,7 @@ describe('TextArea field text display mode', () => { render(