diff --git a/.changeset/proud-suits-shout.md b/.changeset/proud-suits-shout.md new file mode 100644 index 00000000000..1a77cc95b24 --- /dev/null +++ b/.changeset/proud-suits-shout.md @@ -0,0 +1,5 @@ +--- +'@talend/scripts-core': major +--- + +feat: drop build of app which was using webpack diff --git a/packages/playground-vite/.babelrc.json b/packages/playground-vite/.babelrc.json deleted file mode 100644 index abd323e11de..00000000000 --- a/packages/playground-vite/.babelrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "@talend/scripts-config-babel/babel.config.js" -} diff --git a/packages/playground-vite/.editorconfig b/packages/playground-vite/.editorconfig deleted file mode 100644 index 1afd48691fd..00000000000 --- a/packages/playground-vite/.editorconfig +++ /dev/null @@ -1,13 +0,0 @@ -# http://editorconfig.org -root = true -[*] -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true -[*.js, *.jsx, *.css, *.scss] -indent_style = tab -# special rule for json expecially package.json wich npm reset to space for any modification -[*.json] -indent_style = space -indent_size = 2 diff --git a/packages/playground-vite/.gitignore b/packages/playground-vite/.gitignore deleted file mode 100644 index d44b5d89dee..00000000000 --- a/packages/playground-vite/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -dist -package-lock.json -.cache-loader/ diff --git a/packages/playground-vite/.talend/head.html b/packages/playground-vite/.talend/head.html deleted file mode 100644 index 7224a9a22bc..00000000000 --- a/packages/playground-vite/.talend/head.html +++ /dev/null @@ -1,8 +0,0 @@ - diff --git a/packages/playground-vite/CHANGELOG.md b/packages/playground-vite/CHANGELOG.md deleted file mode 100644 index 92c268f6cdd..00000000000 --- a/packages/playground-vite/CHANGELOG.md +++ /dev/null @@ -1,794 +0,0 @@ -# @talend/ui-playground - -## 0.6.1 - -### Patch Changes - -- 6181519: chore: update eslint 10 -- Updated dependencies [6181519] - - @talend/react-faceted-search@22.1.1 - - @talend/design-system@12.1.1 - - @talend/design-tokens@4.1.1 - - @talend/assets-api@2.1.1 - - @talend/react-cmf-router@9.1.1 - - @talend/react-components@18.1.1 - - @talend/react-containers@12.1.1 - - @talend/react-dataviz@8.1.1 - - @talend/react-forms@16.1.1 - - @talend/bootstrap-theme@10.1.1 - - @talend/react-cmf@12.1.1 - -## 0.6.0 - -### Minor Changes - -- c1eae85: Update eslint to v9 + update config - -### Patch Changes - -- Updated dependencies [c1eae85] -- Updated dependencies [faebbb7] -- Updated dependencies [9c93ab3] -- Updated dependencies [b8c0bc6] - - @talend/react-faceted-search@22.1.0 - - @talend/design-system@12.1.0 - - @talend/design-tokens@4.1.0 - - @talend/assets-api@2.1.0 - - @talend/react-cmf-router@9.1.0 - - @talend/react-components@18.1.0 - - @talend/react-containers@12.1.0 - - @talend/react-dataviz@8.1.0 - - @talend/react-forms@16.1.0 - - @talend/bootstrap-theme@10.1.0 - - @talend/react-cmf@12.1.0 - -## 0.5.0 - -### Minor Changes - -- bb95e38: Fix CVE's by upgrading sq to v6.14.1, tar to 7.5.4 and eslint to 9.39.2 - -### Patch Changes - -- 53e97a0: chore: upgrade dependencies -- Updated dependencies [ecbfee8] -- Updated dependencies [ecbfee8] -- Updated dependencies [ecbfee8] -- Updated dependencies [bb95e38] -- Updated dependencies [ecbfee8] -- Updated dependencies [a525026] -- Updated dependencies [ecbfee8] -- Updated dependencies [1d3bb12] -- Updated dependencies [18e73d1] -- Updated dependencies [ecbfee8] -- Updated dependencies [53e97a0] -- Updated dependencies [16703c7] - - @talend/react-faceted-search@22.0.0 - - @talend/react-components@18.0.0 - - @talend/react-forms@16.0.0 - - @talend/icons@8.0.0 - - @talend/design-system@12.0.0 - - @talend/design-tokens@4.0.0 - - @talend/assets-api@2.0.0 - - @talend/react-cmf-router@9.0.0 - - @talend/react-containers@12.0.0 - - @talend/react-dataviz@8.0.0 - - @talend/bootstrap-theme@10.0.0 - - @talend/react-cmf@12.0.0 - -## 0.4.0 - -### Minor Changes - -- ed37213: Update dependencies - -### Patch Changes - -- Updated dependencies [ed37213] - - @talend/react-faceted-search@21.3.0 - - @talend/design-system@11.9.0 - - @talend/design-tokens@3.5.0 - - @talend/assets-api@1.6.0 - - @talend/react-cmf-router@8.1.0 - - @talend/react-components@17.6.0 - - @talend/react-containers@11.6.0 - - @talend/react-dataviz@7.3.0 - - @talend/react-forms@15.6.0 - - @talend/icons@7.14.0 - - @talend/bootstrap-theme@9.6.0 - - @talend/react-cmf@11.1.0 - -## 0.3.0 - -### Minor Changes - -- 3a513cb: Update deps - -### Patch Changes - -- Updated dependencies [3a513cb] - - @talend/react-faceted-search@21.2.0 - - @talend/design-system@11.8.0 - - @talend/react-components@17.5.0 - - @talend/react-containers@11.5.0 - - @talend/react-dataviz@7.2.0 - - @talend/react-forms@15.5.0 - - @talend/icons@7.13.0 - - @talend/bootstrap-theme@9.5.0 - -## 0.2.0 - -### Minor Changes - -- 00e4dde: Bump deps and set RHF to latest with caret - -### Patch Changes - -- Updated dependencies [00e4dde] - - @talend/react-faceted-search@21.1.0 - - @talend/design-system@11.7.0 - - @talend/react-components@17.4.0 - - @talend/react-containers@11.4.0 - - @talend/react-dataviz@7.1.0 - - @talend/react-forms@15.4.0 - - @talend/icons@7.12.0 - - @talend/bootstrap-theme@9.4.0 - -## 0.1.6 - -### Patch Changes - -- ae979f0: Bump dependencies -- Updated dependencies [ae979f0] -- Updated dependencies [d91656d] - - @talend/react-components@17.3.8 - - @talend/react-dataviz@7.0.3 - - @talend/icons@7.11.2 - - @talend/bootstrap-theme@9.3.2 - -## 0.1.5 - -### Patch Changes - -- 2a30ccc: Bump express@^5.1.0 - -## 0.1.4 - -### Patch Changes - -- 4f5cc5c: Bump security CVE -- Updated dependencies [4f5cc5c] - - @talend/assets-api@1.5.2 - - @talend/react-cmf@11.0.1 - - @talend/react-cmf-router@8.0.1 - - @talend/react-components@17.3.6 - - @talend/react-containers@11.3.3 - - @talend/react-dataviz@7.0.2 - - @talend/design-system@11.5.2 - - @talend/design-tokens@3.4.4 - - @talend/react-faceted-search@21.0.1 - - @talend/react-forms@15.2.3 - - @talend/icons@7.11.1 - - @talend/bootstrap-theme@9.3.1 - -## 0.1.3 - -### Patch Changes - -- Updated dependencies [816bb91] - - @talend/react-cmf-router@8.0.0 - - @talend/react-cmf@11.0.0 - - @talend/react-containers@11.3.2 - -## 0.1.2 - -### Patch Changes - -- ea14b87: Fix Dependabot alerts -- Updated dependencies [5168318] -- Updated dependencies [ea14b87] - - @talend/design-system@11.4.0 - - @talend/react-components@17.3.1 - - @talend/react-cmf-router@7.1.0 - - @talend/react-containers@11.3.0 - - @talend/react-cmf@10.1.0 - -## 0.1.1 - -### Patch Changes - -- Updated dependencies [78b4dbf] - - @talend/react-faceted-search@21.0.0 - -## 0.1.0 - -### Minor Changes - -- c3750a1: chore: upgrade dependencies - - Major upgrade for all packages that have a peerDependency on react or react-dom. Those packages now ask for react@18 and react-dom@18. - -### Patch Changes - -- Updated dependencies [c3750a1] - - @talend/react-faceted-search@20.0.0 - - @talend/design-system@11.0.0 - - @talend/react-cmf-router@7.0.0 - - @talend/react-components@17.0.0 - - @talend/react-containers@11.0.0 - - @talend/react-dataviz@7.0.0 - - @talend/react-forms@15.0.0 - - @talend/react-cmf@10.0.0 - - @talend/design-tokens@3.4.0 - - @talend/assets-api@1.5.0 - - @talend/icons@7.10.0 - - @talend/bootstrap-theme@9.2.0 - -## 2.4.4 - -### Patch Changes - -- Updated dependencies [27a4a5d] - - @talend/react-faceted-search@19.0.0 - -## 2.4.3 - -### Patch Changes - -- Updated dependencies [0629df7] - - @talend/react-forms@14.0.0 - - @talend/react-containers@10.7.3 - -## 2.4.2 - -### Patch Changes - -- Updated dependencies [ce93823] - - @talend/design-system@10.0.0 - - @talend/react-components@16.0.0 - - @talend/react-containers@10.7.2 - - @talend/react-dataviz@6.1.3 - - @talend/react-faceted-search@18.0.0 - - @talend/react-forms@13.2.3 - -## 2.4.1 - -### Patch Changes - -- 1abc22f: chore: upgrade dependencies -- Updated dependencies [1abc22f] -- Updated dependencies [5cedaf1] - - @talend/react-faceted-search@17.2.1 - - @talend/design-system@9.8.1 - - @talend/design-tokens@3.1.1 - - @talend/assets-api@1.3.2 - - @talend/react-cmf-router@6.1.2 - - @talend/react-components@15.3.1 - - @talend/react-containers@10.7.1 - - @talend/react-dataviz@6.1.2 - - @talend/react-forms@13.2.2 - - @talend/icons@7.7.1 - - @talend/bootstrap-theme@9.1.1 - - @talend/react-cmf@8.4.1 - -## 2.4.0 - -### Minor Changes - -- 9568363: Use include instead of same-origin in the credentials option of fetch. - -### Patch Changes - -- Updated dependencies [5770c9f] -- Updated dependencies [9568363] - - @talend/react-faceted-search@17.1.0 - - @talend/design-system@9.2.0 - - @talend/design-tokens@3.1.0 - - @talend/react-components@15.1.0 - - @talend/react-containers@10.7.0 - - @talend/react-dataviz@6.1.0 - - @talend/react-forms@13.1.0 - - @talend/icons@7.7.0 - - @talend/bootstrap-theme@9.1.0 - - @talend/react-cmf@8.4.0 - -## 2.3.4 - -### Patch Changes - -- Updated dependencies [b1c72a1] - - @talend/design-tokens@3.0.0 - - @talend/bootstrap-theme@9.0.0 - - @talend/react-components@15.0.1 - - @talend/react-dataviz@6.0.1 - - @talend/design-system@9.0.1 - - @talend/react-faceted-search@17.0.1 - - @talend/react-forms@13.0.1 - -## 2.3.3 - -### Patch Changes - -- Updated dependencies [18c1d97] -- Updated dependencies [18c1d97] - - @talend/react-faceted-search@17.0.0 - - @talend/react-components@15.0.0 - - @talend/react-dataviz@6.0.0 - - @talend/react-forms@13.0.0 - - @talend/design-system@9.0.0 - - @talend/react-containers@10.6.1 - -## 2.3.2 - -### Patch Changes - -- f675918: fix(DFD-536): Fix click on collapsible toggle -- Updated dependencies [f0770b1] -- Updated dependencies [f675918] -- Updated dependencies [7cc4321] -- Updated dependencies [2065869] - - @talend/design-system@8.11.1 - - @talend/react-forms@12.6.0 - - @talend/react-faceted-search@16.0.0 - -## 2.3.1 - -### Patch Changes - -- Updated dependencies [e095335] -- Updated dependencies [922e3eb] - - @talend/react-components@14.0.0 - - @talend/react-faceted-search@15.0.0 - - @talend/react-dataviz@5.0.0 - - @talend/react-containers@10.5.1 - - @talend/react-forms@12.5.1 - - @talend/react-cmf@8.3.3 - - @talend/design-system@8.8.3 - -## 2.3.0 - -### Minor Changes - -- 7de44f9: Remove dependency on react-bootstrap - -### Patch Changes - -- Updated dependencies [7de44f9] -- Updated dependencies [7de44f9] -- Updated dependencies [7de44f9] -- Updated dependencies [c9e740d] - - @talend/react-components@13.0.0 - - @talend/react-containers@10.4.0 - - @talend/react-forms@12.4.0 - - @talend/react-dataviz@4.2.2 - - @talend/react-faceted-search@14.0.0 - -## 2.2.2 - -### Patch Changes - -- Updated dependencies [b71e4e6] -- Updated dependencies [a7b06bc] -- Updated dependencies [a7b06bc] -- Updated dependencies [424544a] -- Updated dependencies [266df87] - - @talend/design-system@8.7.0 - - @talend/react-faceted-search@13.0.0 - - @talend/react-components@12.4.0 - -## 2.2.1 - -### Patch Changes - -- c468f2f: chore: upgrade dependencies -- Updated dependencies [c468f2f] -- Updated dependencies [6c2df2b] - - @talend/react-faceted-search@12.2.1 - - @talend/design-system@8.6.1 - - @talend/design-tokens@2.10.1 - - @talend/react-bootstrap@2.2.1 - - @talend/assets-api@1.3.1 - - @talend/react-cmf-router@6.1.1 - - @talend/react-components@12.3.1 - - @talend/react-containers@10.3.1 - - @talend/react-dataviz@4.2.1 - - @talend/react-forms@12.3.1 - - @talend/icons@7.3.1 - - @talend/bootstrap-theme@8.3.1 - - @talend/react-cmf@8.3.1 - -## 2.2.0 - -### Minor Changes - -- b9cc5b097: Add missing deps and fix webpack.config file - -### Patch Changes - -- Updated dependencies [b9cc5b097] -- Updated dependencies [b9cc5b097] -- Updated dependencies [b9cc5b097] -- Updated dependencies [b9cc5b097] -- Updated dependencies [b9cc5b097] -- Updated dependencies [b9cc5b097] -- Updated dependencies [b9cc5b097] -- Updated dependencies [b9cc5b097] -- Updated dependencies [b9cc5b097] - - @talend/react-containers@10.2.0 - - @talend/assets-api@1.3.0 - - @talend/design-tokens@2.10.0 - - @talend/react-dataviz@4.2.0 - - @talend/design-system@8.2.0 - - @talend/react-cmf@8.2.0 - - @talend/icons@7.2.0 - - @talend/react-forms@12.1.0 - - @talend/bootstrap-theme@8.3.0 - -## 2.1.1 - -### Patch Changes - -- Updated dependencies [8ec56028a] - - @talend/react-forms@12.0.0 - - @talend/react-containers@10.1.1 - -## 2.1.0 - -### Minor Changes - -- 3f9c8a7bb: update babel config to use babel.config.js instead of .babelrc.json - add missing deps - -### Patch Changes - -- Updated dependencies [3f9c8a7bb] -- Updated dependencies [3f9c8a7bb] -- Updated dependencies [3f9c8a7bb] -- Updated dependencies [2177ddfb3] -- Updated dependencies [3f9c8a7bb] -- Updated dependencies [3f9c8a7bb] -- Updated dependencies [3f9c8a7bb] -- Updated dependencies [77826b091] -- Updated dependencies [3f9c8a7bb] -- Updated dependencies [3f9c8a7bb] -- Updated dependencies [3f9c8a7bb] - - @talend/react-cmf@8.1.0 - - @talend/react-containers@10.1.0 - - @talend/icons@7.1.0 - - @talend/react-components@12.1.0 - - @talend/react-forms@11.1.0 - - @talend/react-cmf-router@6.1.0 - - @talend/react-dataviz@4.1.0 - - @talend/react-bootstrap@2.1.0 - - @talend/react-faceted-search@12.1.0 - -## 2.0.0 - -### Major Changes - -- 4044f6198: ARCH-662 - Bump i18next from v20 to v23 and react-i18next from v11 to v13 - -### Patch Changes - -- Updated dependencies [96d688489] -- Updated dependencies [9a0732ec5] -- Updated dependencies [da4cf2971] -- Updated dependencies [4044f6198] - - @talend/react-faceted-search@12.0.0 - - @talend/react-bootstrap@2.0.0 - - @talend/react-cmf-router@6.0.0 - - @talend/react-components@12.0.0 - - @talend/react-containers@10.0.0 - - @talend/react-dataviz@4.0.0 - - @talend/react-forms@11.0.0 - - @talend/icons@7.0.0 - - @talend/react-cmf@8.0.0 - - @talend/bootstrap-theme@8.2.1 - -## 1.1.15 - -### Patch Changes - -- Updated dependencies [bfc02c4fb] -- Updated dependencies [bfc02c4fb] -- Updated dependencies [40e70c055] -- Updated dependencies [bfc02c4fb] -- Updated dependencies [bfc02c4fb] -- Updated dependencies [bfc02c4fb] - - @talend/react-faceted-search@11.0.0 - - @talend/react-dataviz@3.0.0 - - @talend/react-components@11.0.0 - - @talend/react-forms@10.0.0 - - @talend/bootstrap-theme@8.0.0 - - @talend/react-containers@9.1.3 - -## 1.1.14 - -### Patch Changes - -- Updated dependencies [aab0eeb36] - - @talend/react-faceted-search@10.0.0 - -## 1.1.13 - -### Patch Changes - -- 616601fda: chore: clean unnecessary react imports after React v17 - - removed by running script `npx react-codemod update-react-imports` - - see doc https://legacy.reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html#removing-unused-react-imports - -- Updated dependencies [9db7ef2fe] -- Updated dependencies [9db7ef2fe] -- Updated dependencies [9db7ef2fe] -- Updated dependencies [e7d785a6a] -- Updated dependencies [7a097213f] -- Updated dependencies [9db7ef2fe] -- Updated dependencies [9db7ef2fe] -- Updated dependencies [b0193afbd] -- Updated dependencies [616601fda] -- Updated dependencies [f47e34dd0] -- Updated dependencies [9db7ef2fe] -- Updated dependencies [9db7ef2fe] -- Updated dependencies [7a097213f] - - @talend/icons@6.55.0 - - @talend/react-components@10.2.2 - - @talend/react-faceted-search@9.1.1 - - @talend/react-cmf-router@5.2.6 - - @talend/react-containers@9.0.2 - - @talend/react-dataviz@2.8.7 - - @talend/react-forms@9.0.4 - - @talend/react-cmf@7.2.0 - -## 1.1.12 - -### Patch Changes - -- Updated dependencies [4dfe7b010] - - @talend/react-components@10.0.0 - - @talend/react-containers@9.0.0 - - @talend/react-dataviz@2.8.6 - - @talend/react-faceted-search@9.0.0 - - @talend/react-forms@9.0.2 - -## 1.1.11 - -### Patch Changes - -- Updated dependencies [99398080f] -- Updated dependencies [5e4aad637] - - @talend/react-containers@8.0.2 - - @talend/react-dataviz@2.8.5 - - @talend/react-forms@9.0.0 - -## 1.1.10 - -### Patch Changes - -- Updated dependencies [9c44d724f] -- Updated dependencies [e83d88f83] -- Updated dependencies [14b462534] -- Updated dependencies [1200c70f8] -- Updated dependencies [70677664b] - - @talend/react-components@9.0.0 - - @talend/react-containers@8.0.0 - - @talend/bootstrap-theme@7.0.0 - - @talend/react-datagrid@14.0.0 - - @talend/react-dataviz@2.8.4 - - @talend/react-forms@8.1.7 - -## 1.1.9 - -### Patch Changes - -- Updated dependencies [ef3977697] -- Updated dependencies [2be2c3f47] -- Updated dependencies [2be2c3f47] -- Updated dependencies [105990b24] -- Updated dependencies [c0ed60ee5] - - @talend/react-components@8.0.0 - - @talend/react-dataviz@2.8.3 - - @talend/react-containers@7.3.2 - - @talend/react-datagrid@13.0.3 - - @talend/react-forms@8.1.6 - -## 1.1.8 - -### Patch Changes - -- Updated dependencies [25f96d364] -- Updated dependencies [25f96d364] -- Updated dependencies [25f96d364] -- Updated dependencies [25f96d364] -- Updated dependencies [25f96d364] -- Updated dependencies [25f96d364] -- Updated dependencies [25f96d364] -- Updated dependencies [25f96d364] -- Updated dependencies [25f96d364] -- Updated dependencies [25f96d364] -- Updated dependencies [25f96d364] -- Updated dependencies [25f96d364] -- Updated dependencies [25f96d364] -- Updated dependencies [25f96d364] -- Updated dependencies [25f96d364] -- Updated dependencies [25f96d364] -- Updated dependencies [25f96d364] -- Updated dependencies [25f96d364] -- Updated dependencies [25f96d364] -- Updated dependencies [25f96d364] -- Updated dependencies [25f96d364] -- Updated dependencies [25f96d364] -- Updated dependencies [25f96d364] -- Updated dependencies [25f96d364] -- Updated dependencies [25f96d364] -- Updated dependencies [25f96d364] -- Updated dependencies [25f96d364] -- Updated dependencies [25f96d364] -- Updated dependencies [94435b8cd] - - @talend/icons@6.51.0 - - @talend/react-datagrid@13.0.0 - -## 1.1.7 - -### Patch Changes - -- Updated dependencies [d134a19e8] - - @talend/react-faceted-search@8.0.0 - -## 1.1.6 - -### Patch Changes - -- 6f333498f: fix datagrid page -- a3c65c4fe: fix(playground): display playground icons -- Updated dependencies [47dec5cb4] -- Updated dependencies [e6efa126f] - - @talend/react-faceted-search@7.0.2 - - @talend/react-components@7.10.1 - -## 1.1.5 - -### Patch Changes - -- Updated dependencies [e5aa63ef6] - - @talend/react-faceted-search@7.0.0 - -## 1.1.4 - -### Patch Changes - -- de6f9f80c: Handle datagrid breaking changes -- Updated dependencies [2a7278a95] -- Updated dependencies [c02aeb6ae] -- Updated dependencies [1df17ebbc] -- Updated dependencies [a99154a7d] -- Updated dependencies [c815ba11f] -- Updated dependencies [262e60063] - - @talend/react-datagrid@12.0.0 - - @talend/react-forms@8.1.0 - - @talend/react-components@7.5.0 - - @talend/react-containers@7.3.0 - - @talend/react-dataviz@2.4.0 - - @talend/react-faceted-search@6.0.0 - -## 1.1.3 - -### Patch Changes - -- Updated dependencies [8f396f7d5] -- Updated dependencies [3be0e2d22] -- Updated dependencies [a64664410] -- Updated dependencies [f8a5555eb] -- Updated dependencies [6daf0e5dc] - - @talend/react-components@7.3.0 - - @talend/react-cmf-router@5.2.0 - - @talend/react-forms@8.0.0 - - @talend/react-cmf@7.1.3 - - @talend/react-containers@7.2.4 - -## 1.1.2 - -### Patch Changes - -- Updated dependencies [df3460428] -- Updated dependencies [6887f0fcf] -- Updated dependencies [6887f0fcf] - - @talend/react-datagrid@11.0.0 - - @talend/icons@6.44.0 - -## 1.1.1 - -### Patch Changes - -- Updated dependencies [9a581a4bc] -- Updated dependencies [c8fbf0130] -- Updated dependencies [1160ec1f6] - - @talend/react-components@7.0.0 - - @talend/react-forms@7.3.1 - - @talend/react-containers@7.2.2 - - @talend/react-datagrid@10.0.0 - - @talend/react-dataviz@2.2.1 - - @talend/react-faceted-search@5.0.0 - -## 1.1.0 - -### Minor Changes - -- 47b758112: feat(ARCH-482): use React 17 internally and extend react peer dep version - -### Patch Changes - -- Updated dependencies [6562e397f] -- Updated dependencies [47b758112] - - @talend/react-components@6.49.0 - - @talend/react-bootstrap@1.35.0 - - @talend/react-cmf@7.1.0 - - @talend/react-cmf-router@5.1.0 - - @talend/react-containers@7.2.0 - - @talend/react-datagrid@9.3.0 - - @talend/react-dataviz@2.2.0 - - @talend/react-faceted-search@4.2.0 - - @talend/react-forms@7.3.0 - - @talend/icons@6.42.0 - - @talend/bootstrap-theme@6.39.0 - -## 1.0.6 - -### Patch Changes - -- Updated dependencies [df182bbd4] - - @talend/react-cmf-router@5.0.0 - -## 1.0.5 - -### Patch Changes - -- Updated dependencies [9f84c4ad7] -- Updated dependencies [65599e1a5] -- Updated dependencies [20e907887] -- Updated dependencies [e04e3910f] -- Updated dependencies [e04e3910f] - - @talend/react-datagrid@9.0.0 - - @talend/react-dataviz@2.1.1 - - @talend/react-components@6.46.2 - -## 1.0.4 - -### Patch Changes - -- Updated dependencies [d1815c0af] -- Updated dependencies [4605d2ce4] -- Updated dependencies [d1815c0af] -- Updated dependencies [d1815c0af] - - @talend/react-datagrid@8.0.0 - - @talend/react-forms@7.1.0 - - @talend/react-dataviz@2.1.0 - -## 1.0.3 - -### Patch Changes - -- Updated dependencies [9f3cad9bd] - - @talend/react-dataviz@2.0.0 - -## 1.0.2 - -### Patch Changes - -- Updated dependencies [aaba017d2] -- Updated dependencies [5062e05c1] -- Updated dependencies [1c20a3b6b] - - @talend/react-components@6.44.11 - - @talend/react-containers@7.0.5 - - @talend/react-faceted-search@4.0.0 - -## 1.0.1 - -### Patch Changes - -- Updated dependencies [593026b37] - - @talend/react-cmf@7.0.0 - - @talend/react-cmf-router@4.0.0 - - @talend/react-forms@7.0.0 - - @talend/react-containers@7.0.0 diff --git a/packages/playground-vite/README.md b/packages/playground-vite/README.md deleted file mode 100644 index 0d7b93ea28f..00000000000 --- a/packages/playground-vite/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# Playground - -This app is aiming to help demonstrate `ui/container` containers in an environement where we can run a `cmf` app and mock a backend. - -It can also be used as a development environment. - -## How to use - -#### Install - -Install is done at the root of the mono repository but because we use the UMD we need to do - -cd Talend/ui -yarn -yarn pre-release -yarn start diff --git a/packages/playground-vite/cmf.json b/packages/playground-vite/cmf.json deleted file mode 100644 index 842a07bc87c..00000000000 --- a/packages/playground-vite/cmf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "settings": { - "sources": ["src/settings"], - "sources-dev": ["src/settings"], - "destination": "dist/settings.json" - } -} diff --git a/packages/playground-vite/eslint.config.mjs b/packages/playground-vite/eslint.config.mjs deleted file mode 100644 index 4db97f23a31..00000000000 --- a/packages/playground-vite/eslint.config.mjs +++ /dev/null @@ -1,3 +0,0 @@ -import config from '@talend/eslint-config'; - -export default config; diff --git a/packages/playground-vite/package.json b/packages/playground-vite/package.json deleted file mode 100644 index c1fbd14d3fd..00000000000 --- a/packages/playground-vite/package.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "name": "@talend/ui-playground-vite", - "version": "0.6.1", - "description": "Showcase Talend/UI", - "private": true, - "type": "module", - "main": "app/index.js", - "scripts": { - "build": "vite build && cmf-settings", - "test": "echo nothing to test in playground", - "test:demo:umd": "cross-env BASENAME='/playground/' INITIATOR_URL='/playground/inject.js' talend-scripts build --prod", - "start": "vite dev", - "start-dist": "node serve-dist.mjs", - "lint": "eslint -o eslint-report.json --format json ." - }, - "repository": { - "type": "git", - "url": "" - }, - "keywords": [ - "react", - "talend" - ], - "author": "Talend Frontend ", - "license": "Apache-2.0", - "devDependencies": { - "@talend/dynamic-cdn-webpack-plugin": "^14.5.1", - "@talend/eslint-config": "^14.1.2", - "@talend/eslint-plugin": "^1.8.1", - "@talend/scripts-config-babel": "^13.10.1", - "@talend/scripts-config-stylelint": "^5.0.0", - "@talend/scripts-core": "^20.0.0", - "@vitejs/plugin-react": "^4.7.0", - "copy-webpack-plugin": "^14.0.0", - "cross-env": "^10.1.0", - "esbuild-plugin-react-virtualized": "^1.0.5", - "eslint": "^10.0.3", - "i18next-http-backend": "^1.4.5", - "mockjs": "^1.1.0", - "sass": "^1.97.3", - "vite": "^7.3.1", - "vite-plugin-mock": "^3.0.2", - "webpack": "^5.104.1" - }, - "dependencies": { - "@talend/assets-api": "^2.1.1", - "@talend/bootstrap-theme": "^10.1.1", - "@talend/design-system": "^12.1.1", - "@talend/design-tokens": "^4.1.1", - "@talend/icons": "^8.0.0", - "@talend/locales-tui-components": "^16.0.1", - "@talend/locales-tui-containers": "^9.1.3", - "@talend/locales-tui-faceted-search": "^11.3.0", - "@talend/locales-tui-forms": "^15.2.0", - "@talend/react-cmf": "^12.1.1", - "@talend/react-cmf-router": "^9.1.1", - "@talend/react-components": "^18.1.1", - "@talend/react-containers": "^12.1.1", - "@talend/react-dataviz": "^8.1.1", - "@talend/react-faceted-search": "^22.1.1", - "@talend/react-forms": "^16.1.1", - "history": "^5.3.0", - "i18next": "^23.16.8", - "prop-types": "^15.8.1", - "react": "^18.3.1", - "react-dom": "^18.3.1", - "react-i18next": "^13.5.0", - "redux-logger": "^3.0.6" - } -} diff --git a/packages/playground-vite/src/app/actions/index.js b/packages/playground-vite/src/app/actions/index.js deleted file mode 100644 index 0d8b889742c..00000000000 --- a/packages/playground-vite/src/app/actions/index.js +++ /dev/null @@ -1,5 +0,0 @@ -import redirect from './redirect.js'; - -export default { - redirect, -}; diff --git a/packages/playground-vite/src/app/actions/redirect.js b/packages/playground-vite/src/app/actions/redirect.js deleted file mode 100644 index 7d6ef074fa0..00000000000 --- a/packages/playground-vite/src/app/actions/redirect.js +++ /dev/null @@ -1,17 +0,0 @@ -/** - * action creator - * @param {Event} event which trigger this action - * @param {Object} data {model,action} sub objects - * @returns {Object} action - */ -export default function redirect(event, data) { - let path = data.action.path; - path = path.replace('$id', data.model.id); - return { - type: 'foo', - payload: { - method: 'push', - args: [path], - }, - }; -} diff --git a/packages/playground-vite/src/app/components/ComponentFormSandbox.jsx b/packages/playground-vite/src/app/components/ComponentFormSandbox.jsx deleted file mode 100644 index ba4aeac920d..00000000000 --- a/packages/playground-vite/src/app/components/ComponentFormSandbox.jsx +++ /dev/null @@ -1,131 +0,0 @@ -import { useState } from 'react'; - -import PropTypes from 'prop-types'; - -import { InlineMessageInformation } from '@talend/design-system'; -import { cmfConnect } from '@talend/react-cmf'; -import Layout from '@talend/react-components/lib/Layout'; -import SubHeaderBar from '@talend/react-components/lib/SubHeaderBar'; -import ComponentForm from '@talend/react-containers/lib/ComponentForm'; -import HeaderBar from '@talend/react-containers/lib/HeaderBar'; -import SidePanel from '@talend/react-containers/lib/SidePanel'; -import UIForm from '@talend/react-forms'; - -import example from './example.json'; - -// test new behavior on non css module files -import './ComponentFormSandbox.scss'; - -const { isComponentFormDirty } = ComponentForm.selectors; -const { setComponentFormDirtyState } = ComponentForm.actions; - -const componentId = 'external'; -const jsonSchema = { - type: 'object', - title: 'config', - properties: { - definitionURL: { - type: 'string', - enum: ['/api/v1/forms/example', '/api/v1/forms/validation'], - }, - uiSpecPath: { - type: 'string', - }, - triggerURL: { - type: 'string', - }, - }, -}; - -const uiSchema = [ - { - key: 'definitionURL', - title: 'definitionURL', - }, - { - key: 'uiSpecPath', - title: 'uiSpecPath', - }, - { - key: 'triggerURL', - title: 'triggerURL', - }, -]; - -function ComponentFormSandBox({ dirty, dispatch }) { - const hasAPI = process.env.NODE_ENV === 'development'; - const [displayConfig, setConfig] = useState(false); - const defaultFormProps = { - definitionURL: '/api/v1/forms/example', - uiSpecPath: 'ui', - triggerURL: '/api/v1/application/action', - definition: hasAPI ? undefined : example.ui, // do not fetch - // data: hasAPI ? uispec : undefined, - }; - const uispec = { - jsonSchema, - uiSchema, - properties: defaultFormProps, - }; - const [formProps, setFormProps] = useState(defaultFormProps); - const right = [ - { - label: `Reset (dirty=${dirty.toString()})`, - onClick: () => dispatch(setComponentFormDirtyState(componentId, false)), - }, - { - label: 'Configure', - icon: 'talend-cog', - onClick: () => setConfig(!displayConfig), - }, - ]; - return ( - } header={}> - { - window.location = '/'; - }} - /> -
- {!hasAPI && ( - - )} - {displayConfig ? ( - { - // eslint-disable-next-line no-console - console.log(event, data); - setFormProps(data); - setConfig(false); - }} - /> - ) : ( - - )} -
-
- ); -} -ComponentFormSandBox.displayName = 'ComponentFormSandBox'; -ComponentFormSandBox.propTypes = { - dirty: PropTypes.bool.isRequired, - dispatch: PropTypes.func, -}; - -function mapStateToProps(state) { - return { dirty: isComponentFormDirty(state, componentId) }; -} - -export default cmfConnect({ mapStateToProps, withDispatch: true })(ComponentFormSandBox); diff --git a/packages/playground-vite/src/app/components/ComponentFormSandbox.scss b/packages/playground-vite/src/app/components/ComponentFormSandbox.scss deleted file mode 100644 index aca40f912dd..00000000000 --- a/packages/playground-vite/src/app/components/ComponentFormSandbox.scss +++ /dev/null @@ -1,4 +0,0 @@ -#example { - margin: 10px; - max-width: 800px; -} diff --git a/packages/playground-vite/src/app/components/Dataviz.jsx b/packages/playground-vite/src/app/components/Dataviz.jsx deleted file mode 100644 index 147fdeb9c5a..00000000000 --- a/packages/playground-vite/src/app/components/Dataviz.jsx +++ /dev/null @@ -1,79 +0,0 @@ -import { useEffect, useState } from 'react'; - -import { ErrorBoundary } from '@talend/react-cmf'; -import Layout from '@talend/react-components/lib/Layout'; -import HeaderBar from '@talend/react-containers/lib/HeaderBar'; -import SidePanel from '@talend/react-containers/lib/SidePanel'; -import { - GeoChart, - getGeoChartConfig, - getHorizontalBarChartTooltip, - HorizontalBarChart, - KeyValueTooltip, - ValueType, -} from '@talend/react-dataviz'; - -const data = [ - { - key: 'Entry fully matching filter', - value: 2145, - filteredValue: 2145, - }, - { - key: 'Entry not matching filter', - value: 1500, - filteredValue: 0, - }, - { - key: 'Entry partially matching filter', - value: 3200, - filteredValue: 2080, - }, -]; - -const geo = [ - { key: 'Asia', value: 10 }, - { key: 'Amérique du Nord', value: 20 }, -]; - -export function Dataviz() { - const [chartsConfig, setConfig] = useState(); - useEffect(() => { - async function load() { - try { - const config = await getGeoChartConfig('CONTINENT'); - setConfig(config); - } catch (error) { - console.error(error); - } - } - load(); - }, []); - - return ( - } header={}> -
- ( - - )} - /> -
-
- - ( - - )} - /> - -
-
- ); -} diff --git a/packages/playground-vite/src/app/components/FacetedSearch.jsx b/packages/playground-vite/src/app/components/FacetedSearch.jsx deleted file mode 100644 index dd04869ad38..00000000000 --- a/packages/playground-vite/src/app/components/FacetedSearch.jsx +++ /dev/null @@ -1,59 +0,0 @@ -// eslint-disable-next-line @talend/import-depth -import Layout from '@talend/react-components/lib/Layout'; -import HeaderBar from '@talend/react-containers/lib/HeaderBar'; -import SidePanel from '@talend/react-containers/lib/SidePanel'; -import FacetedSearch from '@talend/react-faceted-search'; - -import * as badges from './badgesDefinitions'; - -function action(msg) { - // eslint-disable-next-line no-console - return (...args) => console.log(msg, ...args); -} - -const badgesDefinitions = Object.values(badges); - -const callbacks = { - getTags: () => - new Promise(resolve => - setTimeout(resolve, 2000, [ - 'clean', - 'production', - 'last chunk', - 'salesforce', - 'outdated', - 'extracted', - 'security', - 'in processing', - 'deep learning', - 'sql', - 'cluster', - 'visualization', - 'analytics', - 'users', - 'warehouse', - 'api', - ]), - ), -}; - -export function FacetedSearchPlayground() { - return ( - } header={}> - - {currentFacetedMode => - (currentFacetedMode === FacetedSearch.constants.FACETED_MODE.ADVANCED && ( - - )) || - (currentFacetedMode === FacetedSearch.constants.FACETED_MODE.BASIC && ( - - )) - } - - - ); -} diff --git a/packages/playground-vite/src/app/components/Icons.jsx b/packages/playground-vite/src/app/components/Icons.jsx deleted file mode 100644 index 0a66b443098..00000000000 --- a/packages/playground-vite/src/app/components/Icons.jsx +++ /dev/null @@ -1,23 +0,0 @@ -// eslint-disable-next-line @talend/import-depth -import logo from '@talend/icons/src/svg/products/logo.svg'; -import Layout from '@talend/react-components/lib/Layout'; -import HeaderBar from '@talend/react-containers/lib/HeaderBar'; -import SidePanel from '@talend/react-containers/lib/SidePanel'; - -export function Icons() { - return ( - } header={}> -
-

Use SVG Icons in our apps

-

- I can import svg in my app code using the following snippet. You will have the url as - string -

-
import logo from '@talend/icons/src/svg/products/logo.svg';
-

Current url generated is {logo}

- Let's use an image to display it: - logo -
-
- ); -} diff --git a/packages/playground-vite/src/app/components/List.jsx b/packages/playground-vite/src/app/components/List.jsx deleted file mode 100644 index 9022201f845..00000000000 --- a/packages/playground-vite/src/app/components/List.jsx +++ /dev/null @@ -1,120 +0,0 @@ -/* eslint-disable no-console */ -import { Layout, List, SubHeaderBar } from '@talend/react-components'; -import { HeaderBar, SidePanel } from '@talend/react-containers'; - -const props = { - id: 'talend', - displayMode: 'table', - list: { - columns: [ - { key: 'id', label: 'Id', order: 1 }, - { key: 'name', label: 'Name', order: 2 }, - { key: 'author', label: 'Author', order: 3 }, - { key: 'created', label: 'Created', order: 6 }, - { - key: 'modified', - label: 'Modified', - order: 4, - header: 'icon', - data: { iconName: 'talend-scheduler' }, - }, - { key: 'icon', label: 'Icon', hidden: true, order: 5 }, - ], - items: [ - { - id: 0, - name: 'Title with actions', - created: '2016-09-22', - modified: '2016-09-22', - author: 'Jean-Pierre DUPONT', - icon: 'talend-file-s3-o', - display: 'text', - className: 'item-0-class', - }, - { - id: 1, - name: 'Title with a lot of actions', - created: '2016-09-22', - modified: '2016-09-22', - author: 'Jean-Pierre DUPONT', - icon: 'talend-file-xls-o', - display: 'text', - className: 'item-1-class', - }, - { - id: 2, - name: 'Title with super super super super super super super super super super super super super super super super super super super super super super super super super super super super super super long title oh yeah', - created: '2016-09-22', - modified: '2016-09-22', - author: 'Jean-Pierre DUPONT', - icon: 'talend-file-xls-o', - display: 'text', - className: 'item-1-class', - }, - { - id: 3, - name: 'Title in input mode', - created: '2016-09-22', - modified: '2016-09-22', - author: 'Jean-Pierre DUPONT', - icon: 'talend-file-json-o', - display: 'input', - className: 'item-2-class', - }, - { - id: 4, - name: 'Super long title to trigger overflow on tile rendering', - created: '2016-09-22', - modified: '2016-09-22', - author: - 'Jean-Pierre DUPONT with super super super super super super super super super super super super super super super super super super super super super super super long name, but there was not enough long text', - className: 'item-3-class', - }, - ], - titleProps: { - key: 'name', - iconKey: 'icon', - displayModeKey: 'display', - onClick: () => console.log('onClick'), - onEditCancel: () => console.log('onEditCancel'), - onEditSubmit: () => console.log('onEditSubmit'), - }, - itemProps: { - classNameKey: 'className', - }, - }, - toolbar: { - actionBar: { - actions: { - left: [], - }, - }, - display: { - onChange: () => console.log('display.onChange'), - }, - sort: { - field: 'name', - onChange: () => console.log('sort.onChange'), - options: [ - { id: 'id', name: 'Id' }, - { id: 'name', name: 'Name With Multiple Words' }, - ], - }, - }, -}; - -export function LeaguesList() { - return ( - } header={}> - { - window.location = '/'; - }} - /> - - - ); -} - -LeaguesList.displayName = 'LeaguesList'; diff --git a/packages/playground-vite/src/app/components/badgesDefinitions.js b/packages/playground-vite/src/app/components/badgesDefinitions.js deleted file mode 100644 index 3313caaaf01..00000000000 --- a/packages/playground-vite/src/app/components/badgesDefinitions.js +++ /dev/null @@ -1,522 +0,0 @@ -export const badgeName = { - properties: { - attribute: 'name', - initialOperatorOpened: true, - initialValueOpened: false, - label: 'Name', - operator: {}, - operators: [], - type: 'text', - placeholder: 'Enter a dataset name', - }, - metadata: { - isAvailableForQuickSearch: true, - isAvailableForFacetList: true, - badgePerFacet: 'N', - entitiesPerBadge: '1', - operators: [ - 'containsIgnoreCase', - 'notContainsIgnoreCase', - 'equals', - 'notEquals', - 'match a regexp', - ], - 'data-feature': 'faceted-badge-name', - }, -}; - -export const badgeConnectionName = { - properties: { - attribute: 'connectionName', - initialOperatorOpened: true, - initialValueOpened: false, - label: 'Connection name', - operator: {}, - operators: [], - type: 'text', - placeholder: 'Enter a connection name', - }, - metadata: { - isAvailableForQuickSearch: true, - isAvailableForFacetList: true, - badgePerFacet: 'N', - entitiesPerBadge: '1', - operators: [ - 'containsIgnoreCase', - 'notContainsIgnoreCase', - 'equals', - 'notEquals', - 'match a regexp', - ], - 'data-feature': 'faceted-badge-connection-name', - }, -}; - -export const badgeAuthor = { - properties: { - attribute: 'Author', - initialOperatorOpened: true, - initialValueOpened: false, - label: 'Author', - operator: {}, - operators: [], - type: 'text', - placeholder: 'Enter an author name', - }, - metadata: { - isAvailableForQuickSearch: true, - isAvailableForFacetList: true, - badgePerFacet: 'N', - entitiesPerBadge: '1', - operators: [ - 'containsIgnoreCase', - 'notContainsIgnoreCase', - 'equals', - 'notEquals', - 'match a regexp', - ], - 'data-feature': 'faceted-badge-author', - }, -}; - -export const badgeAll = { - properties: { - attribute: 'all', - initialOperatorOpened: true, - initialValueOpened: false, - label: 'All', - operator: {}, - operators: [], - type: 'text', - }, - metadata: { - isAvailableForFacetList: false, - badgePerFacet: '1', - entitiesPerBadge: '1', - operators: ['containsIgnoreCase', 'notContainsIgnoreCase'], - 'data-feature': 'faceted-badge-all', - }, -}; - -export const badgeMenu = { - properties: { - attribute: 'workspaceId', - initialOperatorOpened: true, - initialValueOpened: false, - label: 'Workspace', - operator: {}, - operators: [], - type: 'menu', - filterBarPlaceholder: 'Find a workspace', - }, - metadata: { - badgePerFacet: '1', - entitiesPerBadge: 'N', - values: [ - { id: 'personal', label: 'Personal' }, - { id: 'shared', label: 'Shared' }, - { id: 'custom', label: 'Custom' }, - { - id: 'ws1', - label: - "Long long workspace name can't fit in one line. Long long workspace name can't fit in one line. ", - }, - { id: 'ws2', label: 'Workspace 2' }, - { id: 'ws3', label: 'Workspace 3' }, - { id: 'ws4', label: 'Workspace 4' }, - { id: 'ws5', label: 'Workspace 5' }, - { id: 'ws6', label: 'Workspace 6' }, - { id: 'ws7', label: 'Workspace 7' }, - { id: 'ws8', label: 'Workspace 8' }, - { id: 'ws9', label: 'Workspace 9' }, - { id: 'ws10', label: 'Workspace Test' }, - ], - operators: ['equals', 'notEquals'], - 'data-feature': 'faceted-badge-workspace', - }, -}; - -export const badgeConnectionType = { - properties: { - attribute: 'connection.type', - initialOperatorOpened: true, - initialValueOpened: false, - label: 'Connection type', - operator: {}, - operators: [], - type: 'checkbox', - filterBarPlaceholder: 'Find a connection type', - }, - metadata: { - badgePerFacet: '1', - entitiesPerBadge: 'N', - values: [ - { id: 'amazon_s3', label: 'Amazon S3' }, - { id: 'hdfs', label: 'HDFS' }, - { id: 'kafka', label: 'Kafka' }, - { id: 'localcon', label: 'Local connection' }, - { id: 'salesforce', label: 'Salesforce' }, - { id: 'aws_kinesis', label: 'AWS kinesis' }, - ], - operators: ['in', 'notIn'], - 'data-feature': 'faceted-badge-connection-type', - }, -}; - -export const badgeConnectionTypeAllSelector = { - properties: { - attribute: 'connection.type', - initialOperatorOpened: true, - initialValueOpened: false, - label: 'Connection type', - operator: {}, - operators: [], - type: 'checkbox', - filterBarPlaceholder: 'Find a connection type', - }, - metadata: { - badgePerFacet: '1', - entitiesPerBadge: 'N', - values: [ - { id: 'amazon_s3', label: 'Amazon S3' }, - { id: 'hdfs', label: 'HDFS' }, - { id: 'kafka', label: 'Kafka' }, - { id: 'localcon', label: 'Local connection' }, - { id: 'salesforce', label: 'Salesforce' }, - { id: 'aws_kinesis', label: 'AWS kinesis' }, - ], - operators: ['in', 'notIn'], - allSelector: true, - }, -}; - -export const badgePrice = { - properties: { - attribute: 'price', - initialOperatorOpened: true, - initialValueOpened: false, - label: 'Price', - operator: {}, - operators: [], - type: 'number', - }, - metadata: { - badgePerFacet: 'N', - entitiesPerBadge: '1', - operators: [ - 'equals', - 'notEquals', - 'greaterThan', - 'greaterThanOrEquals', - 'lessThan', - 'lessThanOrEquals', - ], - 'data-feature': 'faceted-badge-price', - }, -}; - -export const badgeValid = { - properties: { - attribute: 'valid', - initialOperatorOpened: true, - initialValueOpened: false, - label: 'Valid', - operator: {}, - operators: [], - type: 'slider', - icon: { - name: 'talend-pie-charts', - class: 'valid', - }, - unit: '%', - defaultValue: 50, - }, - metadata: { - badgePerFacet: 'N', - entitiesPerBadge: '1', - operators: ['equals', 'greaterThan', 'lessThan'], - }, -}; - -export const badgeEmpty = { - properties: { - attribute: 'empty', - initialOperatorOpened: true, - initialValueOpened: false, - label: 'Empty', - operator: {}, - operators: [], - type: 'slider', - icon: { - name: 'talend-pie-charts', - class: 'empty', - }, - unit: '%', - }, - metadata: { - badgePerFacet: 'N', - entitiesPerBadge: '1', - operators: ['equals', 'greaterThan', 'lessThan'], - }, -}; - -export const badgeInvalid = { - properties: { - attribute: 'invalid', - initialOperatorOpened: true, - initialValueOpened: false, - label: 'Invalid', - operator: {}, - operators: [], - type: 'slider', - icon: { - name: 'talend-pie-charts', - class: 'invalid', - }, - unit: '%', - defaultValue: 50, - }, - metadata: { - badgePerFacet: 'N', - entitiesPerBadge: '1', - operators: ['equals', 'greaterThan', 'lessThan'], - }, -}; - -export const badgeTags = { - properties: { - attribute: 'tags', - initialOperatorOpened: true, - initialValueOpened: false, - label: 'Tags', - operator: {}, - operators: [], - type: 'checkbox', - }, - metadata: { - badgePerFacet: '1', - entitiesPerBadge: 'N', - operators: ['in', 'notIn'], - 'data-feature': 'faceted-badge-tags', - }, -}; - -export const badgeWithVeryLongName = { - properties: { - attribute: 'price', - initialOperatorOpened: true, - initialValueOpened: false, - label: 'helloverybeautifullworldhowareyouinthislovelydaythesunishiningandtheskyisbright?', - operator: {}, - operators: [], - type: 'number', - }, - metadata: { - badgePerFacet: 'N', - entitiesPerBadge: '1', - operators: [ - 'equals', - 'notEquals', - 'greaterThan', - 'greaterThanOrEquals', - 'lessThan', - 'lessThanOrEquals', - ], - }, -}; - -export const badgeEnumWithLotOfValues = { - properties: { - attribute: 'connection.type', - initialOperatorOpened: true, - initialValueOpened: false, - label: 'Connection type', - operator: {}, - operators: [], - type: 'checkbox', - filterBarPlaceholder: 'Find a connection type', - }, - metadata: { - badgePerFacet: '1', - entitiesPerBadge: 'N', - values: [ - { id: 'amazon_s3', label: 'Amazon S3' }, - { id: 'hdfs', label: 'HDFS' }, - { id: 'kafka', label: 'Kafka' }, - { id: 'localcon', label: 'Local connection' }, - { id: 'salesforce', label: 'Salesforce' }, - { id: 'aws_kinesis', label: 'AWS kinesis' }, - { id: 'amazon_s3_low', label: 'Amazon S3 Low' }, - { id: 'hdfs_low', label: 'HDFS Low' }, - { id: 'kafka_low', label: 'Kafka Low' }, - { id: 'localcon_low', label: 'Local connection Low' }, - { id: 'salesforce_low', label: 'Salesforce Low' }, - { id: 'aws_kinesis_low', label: 'AWS kinesis Low' }, - { id: 'amazon_s3_high', label: 'Amazon S3 High' }, - { id: 'hdfs_high', label: 'HDFS High' }, - { id: 'kafka_high', label: 'Kafka High' }, - { id: 'localcon_high', label: 'Local connection High' }, - { id: 'salesforce_high', label: 'Salesforce High' }, - { id: 'aws_kinesis_high', label: 'AWS kinesis High' }, - { id: 'amazon_s3_classic', label: 'Amazon S3 Classic' }, - { id: 'hdfs_classic', label: 'HDFS Classic' }, - { id: 'kafka_classic', label: 'Kafka Classic' }, - { id: 'localcon_classic', label: 'Local connection Classic' }, - { id: 'salesforce_classic', label: 'Salesforce Classic' }, - { id: 'aws_kinesis_classic', label: 'AWS kinesis Classic' }, - ], - operators: ['in', 'notIn'], - }, -}; - -export const badgeTextAsCustomAttribute = { - properties: { - attribute: 'target', - initialOperatorOpened: true, - initialValueOpened: false, - label: 'Target', - operator: {}, - operators: [], - type: 'text', - placeholder: 'Enter a custom attribute', - }, - metadata: { - category: 'Custom attributes', - badgePerFacet: 'N', - entitiesPerBadge: '1', - operators: [ - 'containsIgnoreCase', - 'notContainsIgnoreCase', - 'equals', - 'notEquals', - 'match a regexp', - ], - }, -}; - -export const badgeEnumsAsCustomAttribute = { - properties: { - attribute: 'visibility', - initialOperatorOpened: true, - initialValueOpened: false, - label: 'Visibility', - operator: {}, - operators: [], - type: 'checkbox', - filterBarPlaceholder: 'Find a visibility', - }, - metadata: { - badgePerFacet: '1', - entitiesPerBadge: 'N', - category: 'Custom attributes', - values: [ - { id: 'internal', label: 'Internal' }, - { id: 'public', label: 'Public' }, - ], - operators: ['in', 'notIn'], - }, -}; - -export const badgeTextAsCategory = { - properties: { - attribute: 'owner', - initialOperatorOpened: true, - initialValueOpened: false, - label: 'Owner', - operator: {}, - operators: [], - type: 'text', - placeholder: 'Enter a category name', - }, - metadata: { - category: 'Very long long long long long long long category', - badgePerFacet: 'N', - entitiesPerBadge: '1', - operators: ['containsIgnoreCase', 'notContainsIgnoreCase', 'equals'], - }, -}; - -export const badgeEmptyLabel = { - properties: { - attribute: 'title', - initialOperatorOpened: true, - initialValueOpened: false, - label: '', - operator: {}, - operators: [], - type: 'text', - }, - metadata: { - badgePerFacet: 'N', - entitiesPerBadge: '1', - operators: ['containsIgnoreCase', 'notContainsIgnoreCase', 'equals'], - }, -}; - -export const badgePriceAsCustomAttribute = { - properties: { - attribute: 'price', - initialOperatorOpened: true, - initialValueOpened: false, - label: 'Price', - operator: {}, - operators: [], - type: 'number', - }, - metadata: { - badgePerFacet: 'N', - entitiesPerBadge: '1', - category: 'Custom attributes', - operators: [ - 'equals', - 'notEquals', - 'greaterThan', - 'greaterThanOrEquals', - 'lessThan', - 'lessThanOrEquals', - ], - }, -}; - -export const badgeCreationDate = { - properties: { - attribute: 'creationDate', - initialOperatorOpened: true, - initialValueOpened: false, - label: 'Creation Date', - operator: {}, - operators: [], - type: 'date', - }, - metadata: { - badgePerFacet: 'N', - entitiesPerBadge: '1', - operators: [ - 'equals', - 'notEquals', - 'greaterThan', - 'greaterThanOrEquals', - 'lessThan', - 'lessThanOrEquals', - ], - 'data-feature': 'faceted-badge-creation-date', - }, -}; - -export const badgePeriod = { - properties: { - attribute: 'period', - initialOperatorOpened: true, - initialValueOpened: false, - label: 'Period', - operator: {}, - operators: [], - type: 'period', - }, - metadata: { - badgePerFacet: 'N', - entitiesPerBadge: '1', - operators: ['in'], - 'data-feature': 'faceted-badge-period', - }, -}; diff --git a/packages/playground-vite/src/app/foo.html b/packages/playground-vite/src/app/foo.html deleted file mode 100644 index c6092001570..00000000000 --- a/packages/playground-vite/src/app/foo.html +++ /dev/null @@ -1 +0,0 @@ -

Hello my name is foo

diff --git a/packages/playground-vite/src/app/i18n.js b/packages/playground-vite/src/app/i18n.js deleted file mode 100644 index 2364a509cca..00000000000 --- a/packages/playground-vite/src/app/i18n.js +++ /dev/null @@ -1,53 +0,0 @@ -/* eslint-disable @talend/import-depth */ - -/* eslint-disable import/no-extraneous-dependencies */ -import { initReactI18next } from 'react-i18next'; - -import i18next from 'i18next'; -import HttpApi from 'i18next-http-backend'; - -import assetsApi from '@talend/assets-api'; -import { namespaces as tuiComponentsNamespaces } from '@talend/locales-tui-components/namespaces.js'; -import { namespaces as tuiContainersNamespaces } from '@talend/locales-tui-containers/namespaces.js'; -import { namespaces as tuiFormsNamespaces } from '@talend/locales-tui-forms/namespaces.js'; - -const LOCALES_MAP = { - 'tui-components': assetsApi.getURL( - '/locales/{{lng}}/{{ns}}.json', - '@talend/locales-tui-components', - ), - 'tui-containers': assetsApi.getURL( - '/locales/{{lng}}/{{ns}}.json', - '@talend/locales-tui-containers', - ), - 'tui-forms': assetsApi.getURL('/locales/{{lng}}/{{ns}}.json', '@talend/locales-tui-forms'), - 'tui-faceted-search': assetsApi.getURL( - '/locales/{{lng}}/{{ns}}.json', - '@talend/locales-tui-faceted-search', - ), -}; - -function loadPath(languages, namespaces) { - return LOCALES_MAP[namespaces[0]] || '/assets/locales/{{lng}}/{{ns}}.json'; -} - -export function initI18n() { - i18next - .use(initReactI18next) - .use(HttpApi) - .init({ - fallbackLng: 'en', - lng: 'fr', - ns: [...tuiComponentsNamespaces, ...tuiContainersNamespaces, ...tuiFormsNamespaces], - react: { - useSuspense: false, - }, - interpolation: { - escapeValue: false, - }, - backend: { - loadPath, - }, - defaultNS: 'talend-ui-playground', - }); -} diff --git a/packages/playground-vite/src/app/index.jsx b/packages/playground-vite/src/app/index.jsx deleted file mode 100644 index 294210a87ed..00000000000 --- a/packages/playground-vite/src/app/index.jsx +++ /dev/null @@ -1,64 +0,0 @@ -/* eslint-disable no-console */ - -/** - * Import theme. - * Being the first import is important, so that it is the default style - * and other style can override it - */ - -// eslint-disable-next-line @talend/import-depth -import '@talend/bootstrap-theme/dist/bootstrap.css'; -import cmf from '@talend/react-cmf'; -import getRouter from '@talend/react-cmf-router'; -import { AppLoader } from '@talend/react-components'; -import containersModule from '@talend/react-containers'; -import ComponentForm from '@talend/react-containers/lib/ComponentForm'; - -import actions from './actions/index.js'; -import ComponentFormSandbox from './components/ComponentFormSandbox.jsx'; -import { Dataviz } from './components/Dataviz.jsx'; -import { FacetedSearchPlayground } from './components/FacetedSearch.jsx'; -import { Icons } from './components/Icons.jsx'; -import { LeaguesList } from './components/List.jsx'; -import { initI18n } from './i18n.js'; - -// thanks ui-scripts -let basename = window.basename; -if (basename === '/') { - basename = undefined; -} - -const router = getRouter({ basename }); - -initI18n(); - -const app = { - components: { - ComponentForm, - ComponentFormSandbox, - FacetedSearch: FacetedSearchPlayground, - LeaguesList, - Dataviz, - Icons, - }, - settingsURL: `${basename || ''}/settings.json`, - actionCreators: actions, - middlewares: [], - modules: [router.cmfModule, containersModule], - RootComponent: router.RootComponent, - AppLoader, -}; - -// eslint-disable-next-line no-console -console.log('app bootstrap should happens only once'); -/** - * Initialize CMF - * This will: - * - Register your components in the CMF registry - * - Register your action creators in CMF registry - * - Setup redux store using reducer - * - Fetch the settings - * - render react-dom in the dom 'app' element - */ -debugger; -cmf.bootstrap(app); diff --git a/packages/playground-vite/src/assets/inject.js b/packages/playground-vite/src/assets/inject.js deleted file mode 100644 index 700b1483df1..00000000000 --- a/packages/playground-vite/src/assets/inject.js +++ /dev/null @@ -1,42 +0,0 @@ -// custom inject to UMD from surge and the others from unpkg - -// eslint-disable-next-line func-names -(function () { - const CDN_URL_REGEX = /^(\/?.*\/cdn)\//; - - function removeIntegrity(info) { - if (info.name && info.name.startsWith('@talend')) { - // eslint-disable-next-line no-param-reassign - delete info.integrity; - } - return info; - } - function prepareUrl(url) { - let newUrl; - const m = CDN_URL_REGEX.exec(url); - if (m !== null) { - // return base ? url.slice(1) : url; - if (!url.includes('/cdn/@talend')) { - newUrl = url.replace(m[1], 'https://statics.cloud.talend.com'); - } - } - return newUrl || url; - } - window.Talend.CDN_URL = 'https://statics.cloud.talend.com'; - - // let's override the assets-api's getCDNUrl to serve local package - window.Talend.getCDNUrl = function getCDNUrl(pkg = {}) { - // if local to the repository load from /cdn - if (['@talend/react-dataviz', '@talend/icons'].includes(pkg.name)) { - const baseTag = document.querySelector('base'); - if (baseTag) { - const root = baseTag.getAttribute('href') || '/'; - return `${root === '/' ? '' : root}/cdn/${pkg.name}/${pkg.version}${pkg.path}`; - } - return `/cdn/${pkg.name}/${pkg.version}${pkg.path}`; - } - return `${window.Talend.CDN_URL}/${pkg.name}/${pkg.version}${pkg.path}`; - }; - window.talendAddStyles(window.Talend.cssBuild.map(removeIntegrity), prepareUrl); - window.talendAddScripts(window.Talend.build.map(removeIntegrity), prepareUrl); -})(); diff --git a/packages/playground-vite/src/settings/settings.json b/packages/playground-vite/src/settings/settings.json deleted file mode 100644 index 9f1884a2573..00000000000 --- a/packages/playground-vite/src/settings/settings.json +++ /dev/null @@ -1,146 +0,0 @@ -{ - "actions": { - "menu:ComponentForm": { - "icon": "talend-text", - "label": "ComponentForm", - "onClickDispatch": { - "type": "MENU_COMPONENT_FORM_CLICKED", - "cmf": { - "routerPush": "/ComponentForm" - } - } - }, - "menu:List": { - "icon": "talend-table", - "label": "List", - "onClickDispatch": { - "type": "MENU_LIST_CLICKED", - "cmf": { - "routerPush": "/List" - } - } - }, - "menu:Dataviz": { - "icon": "talend-charts", - "label": "Dataviz", - "onClickDispatch": { - "type": "MENU_LIST_CLICKED", - "cmf": { - "routerPush": "/Dataviz" - } - } - }, - "menu:FacetedSearch": { - "icon": "talend-search", - "label": "Faceted Search", - "onClickDispatch": { - "type": "MENU_LIST_CLICKED", - "cmf": { - "routerPush": "/FacetedSearch" - } - } - }, - "menu:Icons": { - "icon": "talend-datagrid", - "label": "Icons", - "onClickDispatch": { - "type": "MENU_LIST_CLICKED", - "cmf": { - "routerPush": "/Icons" - } - } - } - }, - "props": { - "AppLoader#default": { - "components": { - "before-children": [ - { - "component": "Notification" - }, - { - "component": "IconsProvider" - } - ] - } - }, - "HeaderBar#default": { - "keepComponentState": true, - "logo": { - "id": "header-bar-demo-logo", - "icon": "talend-world", - "isFull": false - }, - "brand": { - "id": "header-bar-demo-brand", - "label": "Choose a product" - }, - "products": { - "id": "header-bar-demo-brands", - "items": [ - { - "icon": "talend-star", - "label": "Static menu entry", - "dispatch": { - "type": "CUSTOM_ACTION_TYPE", - "payload": { - "foo": "bar" - } - } - } - ] - }, - "productsUrl": "/api/mock/header-bar/products-list" - }, - "SidePanel#default": { - "actionIds": [ - "menu:ComponentForm", - "menu:List", - "menu:Dataviz", - "menu:FacetedSearch", - "menu:Icons" - ] - }, - "Layout#default": { - "mode": "TwoColumns", - "header": { "component": "HeaderBar" }, - "one": { "component": "SidePanel" }, - "content": {} - }, - "ComponentForm#default": { - "definitionURL": "/api/v1/forms/example", - "uiSpecPath": "ui", - "triggerURL": "/api/v1/application/action", - "className": "full-form" - } - }, - "routes": { - "path": "/", - "component": "AppLoader", - "indexRoute": { - "component": "LeaguesList" - }, - "childRoutes": [ - { - "path": "List", - "component": "LeaguesList" - }, - { - "path": "ComponentForm", - "component": "ComponentFormSandbox" - }, - { - "path": "Dataviz", - "component": "Dataviz" - }, - { - "path": "FacetedSearch", - "component": "FacetedSearch" - }, - { - "path": "Icons", - "component": "Icons" - } - ] - } -} diff --git a/packages/playground-vite/talend-scripts.json b/packages/playground-vite/talend-scripts.json deleted file mode 100644 index 57ed06df2f4..00000000000 --- a/packages/playground-vite/talend-scripts.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "cmf": true, - "html": {}, - "webpack": { - "monoRepoFixSourceMap": ["../dataviz/src", "../containers/src", "../components/src"], - "config": { - "development": "./webpack.config.dev.cjs", - "production": "./webpack.config.dev.cjs" - } - }, - "dynamic-cdn-webpack-plugin": false -} diff --git a/packages/playground/CHANGELOG.md b/packages/playground/CHANGELOG.md index 6129d345339..92c268f6cdd 100644 --- a/packages/playground/CHANGELOG.md +++ b/packages/playground/CHANGELOG.md @@ -1,6 +1,6 @@ # @talend/ui-playground -## 3.1.1 +## 0.6.1 ### Patch Changes @@ -18,7 +18,7 @@ - @talend/bootstrap-theme@10.1.1 - @talend/react-cmf@12.1.1 -## 3.1.0 +## 0.6.0 ### Minor Changes @@ -42,12 +42,7 @@ - @talend/bootstrap-theme@10.1.0 - @talend/react-cmf@12.1.0 -## 3.0.0 - -### Major Changes - -- 18e73d1: chore: move from sass to css -- 16703c7: chore: drop UMD format +## 0.5.0 ### Minor Changes @@ -55,6 +50,7 @@ ### Patch Changes +- 53e97a0: chore: upgrade dependencies - Updated dependencies [ecbfee8] - Updated dependencies [ecbfee8] - Updated dependencies [ecbfee8] @@ -80,7 +76,7 @@ - @talend/bootstrap-theme@10.0.0 - @talend/react-cmf@12.0.0 -## 2.8.0 +## 0.4.0 ### Minor Changes @@ -102,7 +98,7 @@ - @talend/bootstrap-theme@9.6.0 - @talend/react-cmf@11.1.0 -## 2.7.0 +## 0.3.0 ### Minor Changes @@ -120,7 +116,7 @@ - @talend/icons@7.13.0 - @talend/bootstrap-theme@9.5.0 -## 2.6.0 +## 0.2.0 ### Minor Changes @@ -138,31 +134,25 @@ - @talend/icons@7.12.0 - @talend/bootstrap-theme@9.4.0 -## 2.5.5 +## 0.1.6 ### Patch Changes -- de6ae38: Bump dependencies -- Updated dependencies [de6ae38] - - @talend/react-faceted-search@21.0.2 - - @talend/design-system@11.5.3 - - @talend/design-tokens@3.4.5 - - @talend/assets-api@1.5.3 - - @talend/react-cmf-router@8.0.2 - - @talend/react-components@17.3.9 - - @talend/react-containers@11.3.4 - - @talend/react-dataviz@7.0.4 - - @talend/react-forms@15.2.4 - - @talend/icons@7.11.3 - - @talend/react-cmf@11.0.2 +- ae979f0: Bump dependencies +- Updated dependencies [ae979f0] +- Updated dependencies [d91656d] + - @talend/react-components@17.3.8 + - @talend/react-dataviz@7.0.3 + - @talend/icons@7.11.2 + - @talend/bootstrap-theme@9.3.2 -## 2.5.4 +## 0.1.5 ### Patch Changes - 2a30ccc: Bump express@^5.1.0 -## 2.5.3 +## 0.1.4 ### Patch Changes @@ -181,7 +171,7 @@ - @talend/icons@7.11.1 - @talend/bootstrap-theme@9.3.1 -## 2.5.2 +## 0.1.3 ### Patch Changes @@ -190,14 +180,27 @@ - @talend/react-cmf@11.0.0 - @talend/react-containers@11.3.2 -## 2.5.1 +## 0.1.2 + +### Patch Changes + +- ea14b87: Fix Dependabot alerts +- Updated dependencies [5168318] +- Updated dependencies [ea14b87] + - @talend/design-system@11.4.0 + - @talend/react-components@17.3.1 + - @talend/react-cmf-router@7.1.0 + - @talend/react-containers@11.3.0 + - @talend/react-cmf@10.1.0 + +## 0.1.1 ### Patch Changes - Updated dependencies [78b4dbf] - @talend/react-faceted-search@21.0.0 -## 2.5.0 +## 0.1.0 ### Minor Changes @@ -221,15 +224,6 @@ - @talend/icons@7.10.0 - @talend/bootstrap-theme@9.2.0 -## 2.4.5 - -### Patch Changes - -- Updated dependencies [e48ae5f] - - @talend/react-cmf@9.0.0 - - @talend/react-cmf-router@6.1.3 - - @talend/react-containers@10.7.4 - ## 2.4.4 ### Patch Changes diff --git a/packages/playground-vite/index.html b/packages/playground/index.html similarity index 100% rename from packages/playground-vite/index.html rename to packages/playground/index.html diff --git a/packages/playground/mockBackend/jsonForward.js b/packages/playground/mockBackend/jsonForward.js deleted file mode 100644 index 207cb53158a..00000000000 --- a/packages/playground/mockBackend/jsonForward.js +++ /dev/null @@ -1,53 +0,0 @@ -const fs = require('fs'); - -/** - * Read the content of a file - * @param filepath {String} File to the file to read - * @returns {Promise} - */ -const readFile = filepath => - new Promise((resolve, reject) => { - fs.readFile(filepath, 'utf-8', (err, data) => { - if (err) { - reject(err); - } else { - resolve(data); - } - }); - }); - -/** - * Resolve the return promise after the given delay - * @param {Number} delay Delay length (in ms) - * @returns {Promise} - */ -const wait = (delay = 1000) => new Promise(resolve => setTimeout(resolve, delay)); - -/** - * Directly bind /api/mock/* HTTP queries to local mockBackend/mock/* contents - */ -module.exports = function addRoutes(req, res) { - const API_MOCK_ENDPOINT = '/api/mock'; - - if (!req.url.startsWith(API_MOCK_ENDPOINT)) { - res.writeHead(404); - res.end('Not Found'); - return; - } - - const urlPath = req.url.split('?')[0]; - const mockFilePath = `${__dirname}/mock/${urlPath.substr(API_MOCK_ENDPOINT.length)}.json`; - - wait() - .then(() => readFile(mockFilePath)) - .then(content => { - res.writeHead(200, { 'Content-Type': 'application/json' }); - res.end(JSON.stringify(JSON.parse(content))); - }) - .catch(error => { - // eslint-disable-next-line no-console - console.error('Unable to load mock file "%s" due to :', mockFilePath, error); - res.writeHead(400, { 'Content-Type': 'text/plain' }); - res.end('Bad Request'); - }); -}; diff --git a/packages/playground/mockBackend/kit.js b/packages/playground/mockBackend/kit.js deleted file mode 100644 index 16bbcb4302f..00000000000 --- a/packages/playground/mockBackend/kit.js +++ /dev/null @@ -1,190 +0,0 @@ -/* eslint-disable no-console */ -const url = require('url'); -const http = require('https'); -const forms = require('./mock/kit'); - -function getTriggerInfo(req) { - return { - ...req.query, - args: req.body, - }; -} - -function basicAuth(args) { - let comment; - let status; - if (!args['basicAuth.url']) { - comment = 'no url'; - status = 'KO'; - } else if (!args['basicAuth.password']) { - comment = 'no password'; - status = 'KO'; - } else if (!args['basicAuth.username']) { - comment = 'no username'; - status = 'KO'; - } - - if (!status) { - if (args['basicAuth.username'] === args['basicAuth.password']) { - comment = 'Yes username === password'; - status = 'OK'; - } else { - status = 'KO'; - comment = 'invalid credentials'; - } - } - return { comment, status }; -} - -function urlValidation({ arg0 }) { - if (arg0) { - const parsed = url.parse(arg0); - if (!parsed.protocol) { - return { comment: `no protocol: ${arg0}`, status: 'KO' }; - } - if (!parsed.hostname) { - return { comment: `no hostname: ${arg0}`, status: 'KO' }; - } - } - return { status: 'OK' }; -} - -function guessTableSchema() { - return { status: 'OK' }; -} - -function reloadForm({ id }) { - if (!id) { - return add.ui; - } - return basic; -} - -function suggestionForDemo() { - return { - cacheable: true, - items: [ - { id: 'clafoutis', label: 'Clafoutis aux poires et aux fruits' }, - { id: 'conchiglioni-au-thon', label: 'Conchiglioni au thon' }, - { id: 'coquillettes-crevettes', label: 'coquillettes aux crevettes' }, - { id: 'crumble', label: 'Crumble a la danette' }, - { id: 'pomme-savane', label: 'Pomme savane' }, - { id: 'tarte-au-citron', label: 'Tarte au citron' }, - ], - }; -} - -const cache = {}; - -function suggestionBig() { - if (cache.photos) { - return cache.photos; - } - return res => { - let body = ''; - function onData(chunk) { - console.log('onData', chunk); - body += chunk; - } - function onEnd() { - console.log('onEnd', body); - cache.photos = { - cacheable: true, - items: JSON.parse(body).map(item => ({ id: item.id.toString(), label: item.title })), - }; - res.writeHead(200, { 'Content-Type': 'application/json' }); - res.end(JSON.stringify(cache.photos)); - } - function onResponse(resp) { - console.log(`Got response: ${resp.statusCode}`); - resp.on('data', onData); - resp.on('end', onEnd); - } - function onError(e) { - console.error(e.message); - } - http.get('https://jsonplaceholder.typicode.com/photos', onResponse).on('error', onError); - }; -} - -function updateProperties({ type }) { - switch (type) { - case 'clafoutis': - case 'pomme-savane': - case 'crumble': - case 'tarte-au-citron': - return { data: 'yes !' }; - case 'coquillettes-crevettes': - return { data: 'this is not a dessert !' }; - default: - return { data: 'don t know that' }; - } -} - -function giveMeFive() { - return res => { - res.writeHead(500, { 'Content-Type': 'application/json' }); - res.end( - JSON.stringify({ - timestamp: 1548781374412, - status: 500, - error: 'Internal Server Error', - exception: 'javax.ws.rs.ClientErrorException', - message: 'An internal server error occurs', - path: '/proxy/v1/action/execute/dataset', - }), - ); - }; -} - -const TRIGGERS = { - validation: { - urlValidation, - }, - healthcheck: { - basicAuth, - }, - schema: { - guessTableSchema, - }, - reloadForm: { - 'builtin::root::reloadFromId': reloadForm, - }, - suggestions: { - suggestionForDemo, - suggestionBig, - }, - update: { - updateProperties, - }, - error: { - giveMeFive, - }, -}; - -function trigger(req) { - const info = getTriggerInfo(req); - return TRIGGERS[info.type][info.action](info.args); -} - -module.exports = function addRoutes(req, res) { - if (req.url.startsWith('/api/v1/forms/')) { - const formId = req.url.split('/')[4]; - res.writeHead(200, { 'Content-Type': 'application/json' }); - res.end(JSON.stringify(forms[formId])); - } else if (req.url === '/api/v1/forms' && req.method === 'POST') { - res.writeHead(200, { 'Content-Type': 'application/json' }); - res.end(JSON.stringify({ body: req.body })); - } else if (req.url === '/api/v1/application/action' && req.method === 'POST') { - const result = trigger(req); - if (typeof result === 'function') { - result(res); - } else { - res.writeHead(200, { 'Content-Type': 'application/json' }); - res.end(JSON.stringify(result)); - } - } else { - res.writeHead(404); - res.end('Not Found'); - } -}; diff --git a/packages/playground/mockBackend/mock/header-bar/products-list.json b/packages/playground/mockBackend/mock/header-bar/products-list.json deleted file mode 100644 index 7ebfe8f7268..00000000000 --- a/packages/playground/mockBackend/mock/header-bar/products-list.json +++ /dev/null @@ -1,26 +0,0 @@ -[ - { - "id": "TMC", - "name": "Management Console", - "url": "https://www.talend.com/products#tmc", - "icon": "tmc" - }, - { - "id": "TDP", - "name": "Data Preparation", - "url": "https://www.talend.com/products#tdp", - "icon": "tdp" - }, - { - "id": "TIPAAS", - "name": "TIPAAS", - "url": "https://www.talend.com/products#tipaas", - "icon": "tic" - }, - { - "id": "TDC", - "name": "Catalog", - "url": "https://www.talend.com/products#tdc", - "icon": "tdc" - } -] diff --git a/packages/playground/mockBackend/mock/kit/example.json b/packages/playground/mockBackend/mock/kit/example.json deleted file mode 100644 index cec63cee94f..00000000000 --- a/packages/playground/mockBackend/mock/kit/example.json +++ /dev/null @@ -1,343 +0,0 @@ -{ - "metadata": { - "children": [], - "id": "example", - "label": "Form example", - "name": "example", - "version": 0 - }, - "ui": { - "jsonSchema": { - "properties": { - "array": { - "type": "object", - "properties": { - "strings": { - "type": "array", - "items": { - "type": "string", - "enum": ["red", "green", "blue"] - } - }, - "keyvalue": { - "default": [ - { - "value": "value", - "key": "key" - } - ], - "title": "key value", - "type": "array", - "items": { - "type": "object", - "properties": { - "value": { - "title": "Value", - "type": "string", - "default": "" - }, - "key": { - "title": "Key", - "type": "string", - "default": "" - } - } - } - } - } - }, - "triggers": { - "login": { - "type": "string" - }, - "password": { - "type": "string" - }, - "url": { - "pattern": "^(http://|https://).*", - "title": "URL", - "type": "string" - } - }, - "example": { - "properties": { - "code": { - "type": "string" - }, - "string": { - "type": "string" - }, - "datalist": { - "type": "string" - }, - "datalistRestricted": { - "type": "string" - }, - "multiSelect": { - "type": "array", - "items": { - "type": "string" - } - }, - "tags": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "type": "object", - "required": ["url", "login", "password"] - } - }, - "title": "example", - "type": "object" - }, - "properties": { - "example": { - "datalist": "clafoutis", - "$datalist_name": "Clafoutis aux poires et aux fruits", - "tags": ["clafoutis"], - "$tags_name": ["Clafoutis aux poires et aux fruits"], - "multiSelect": ["1"], - "$multiSelect_name": ["accusamus beatae ad facilis cum similique qui sunt"] - }, - "triggers": { - "login": "login", - "password": "login", - "url": "http://www.example.com" - }, - "array": { - "strings": ["red"], - "keyvalue": [{ "value": "value", "key": "key" }] - } - }, - "uiSchema": [ - { - "title": "Example", - "widget": "tabs", - "items": [ - { - "title": "Advanced Widget", - "widget": "fieldset", - "items": [ - { - "key": "example.code", - "title": "Code", - "widget": "code", - "options": { - "language": "python", - "height": "300px" - } - }, - { - "key": "example.datalist", - "title": "Datalist", - "titleMap": [], - "triggers": [ - { - "action": "suggestionForDemo", - "family": "remote", - "type": "suggestions", - "onEvent": "focus", - "parameters": [ - { - "path": "example.datalist", - "key": "id" - } - ] - } - ], - "widget": "datalist" - }, - { - "key": "example.datalistRestricted", - "restricted": true, - "title": "Datalist (restricted)", - "titleMap": [], - "triggers": [ - { - "action": "suggestionForDemo", - "family": "remote", - "type": "suggestions", - "onEvent": "focus", - "parameters": [ - { - "path": "example.datalistRestricted", - "key": "id" - } - ] - } - ], - "widget": "datalist" - }, - { - "key": "example.tags", - "title": "multiSelectTag", - "titleMap": [], - "triggers": [ - { - "action": "suggestionForDemo", - "family": "remote", - "type": "suggestions", - "onEvent": "focus", - "parameters": [ - { - "path": "example.tags", - "key": "id" - } - ] - } - ], - "widget": "multiSelectTag" - }, - { - "key": "example.multiSelect", - "title": "multiSelect", - "titleMap": [], - "triggers": [ - { - "action": "suggestionBig", - "family": "remote", - "type": "suggestions", - "onEvent": "focus", - "parameters": [ - { - "path": "example.multiSelect", - "key": "id" - } - ] - } - ], - "widget": "multiSelect" - } - ] - }, - { - "title": "Triggers", - "widget": "fieldset", - "items": [ - { - "widget": "button", - "key": "example.neededToDisplayTheError", - "type": "button", - "title": "Give me HTTP five", - "triggers": [ - { - "action": "giveMeFive", - "family": "test", - "options": [], - "parameters": [ - { - "key": "type", - "path": "example.type" - } - ], - "type": "error" - } - ] - }, - { - "key": "triggers.url", - "placeholder": "url", - "widget": "text" - }, - { - "key": "triggers.login", - "placeholder": "login", - "widget": "text" - }, - { - "key": "triggers.password", - "placeholder": "password", - "type": "password", - "widget": "text" - }, - { - "key": "my.bad.i.need.a.key", - "title": "Validate auth", - "triggers": [ - { - "action": "basicAuth", - "family": "Example", - "parameters": [ - { - "key": "basicAuth.username", - "path": "example.login" - }, - { - "key": "basicAuth.password", - "path": "example.password" - }, - { - "key": "basicAuth.url", - "path": "example.url" - } - ], - "options": ["triggers.url", "triggers.password", "triggers.login"], - "type": "healthcheck" - } - ], - "widget": "button" - } - ] - }, - { - "title": "Arrays", - "widget": "fieldset", - "items": [ - { - "key": "array.strings", - "title": "Strings", - "widget": "array", - "items": [ - { - "key": "array.strings[]", - "widget": "select", - "titleMap": [ - { "name": "red", "value": "red" }, - { "name": "green", "value": "green" }, - { "name": "blue", "value": "blue" } - ] - } - ] - }, - { - "placeholder": "key value", - "key": "array.keyvalue", - "itemWidget": "collapsibleFieldset", - "itemTitle": "Column", - "itemManaged": true, - "items": [ - { - "key": "array.keyvalue[]", - "items": [ - { - "widget": "columns", - "items": [ - { - "placeholder": "key", - "widget": "text", - "title": "Key", - "key": "array.keyvalue[].key", - "required": true - }, - { - "placeholder": "value", - "widget": "text", - "title": "Value", - "key": "array.keyvalue[].value" - } - ] - } - ] - } - ] - } - ] - } - ] - } - ] - } -} diff --git a/packages/playground/mockBackend/mock/kit/index.js b/packages/playground/mockBackend/mock/kit/index.js deleted file mode 100644 index a55a2f2395f..00000000000 --- a/packages/playground/mockBackend/mock/kit/index.js +++ /dev/null @@ -1,5 +0,0 @@ -/* eslint-disable global-require */ -module.exports = { - example: require('./example.json'), - validation: require('./validation.json'), -}; diff --git a/packages/playground/mockBackend/mock/kit/validation.json b/packages/playground/mockBackend/mock/kit/validation.json deleted file mode 100644 index dd985df09ed..00000000000 --- a/packages/playground/mockBackend/mock/kit/validation.json +++ /dev/null @@ -1,122 +0,0 @@ -{ - "metadata": { - "children": [], - "id": "desert", - "label": "Desert", - "name": "desert", - "version": 0 - }, - "ui": { - "jsonSchema": { - "properties": { - "configuration": { - "properties": { - "solrDataset": { - "properties": { - "schema": { - "items": { - "title": "schema", - "type": "string" - }, - "title": "schema", - "type": "array" - }, - "solrUrl": { - "properties": { - "password": { - "title": "password", - "type": "string" - }, - "login": { - "title": "login", - "type": "string" - }, - "url": { - "pattern": "^(http://|https://).*", - "title": "URL", - "type": "string" - } - }, - "required": [ - "url" - ], - "title": "solrUrl", - "type": "object" - } - }, - "required": [ - "core" - ], - "title": "solrDataset", - "type": "object" - } - }, - "title": "configuration", - "type": "object" - } - }, - "required": [], - "title": "Input", - "type": "object" - }, - "properties": {}, - "uiSchema": [ - { - "items": [ - { - "key": "configuration.solrDataset.solrUrl.url", - "placeholder": "url", - "required": true, - "title": "URL", - "widget": "text" - }, - { - "key": "configuration.solrDataset.solrUrl.login", - "placeholder": "login", - "required": false, - "title": "login", - "widget": "text" - }, - { - "key": "configuration.solrDataset.solrUrl.password", - "placeholder": "password", - "required": false, - "title": "password", - "type": "password", - "widget": "text" - }, - { - "key": "button_healthcheck_configuration.solrDataset.solrUrl", - "title": "Validate Datastore", - "triggers": [ - { - "action": "basicAuth", - "family": "Solr", - "parameters": [ - { - "key": "basicAuth.username", - "path": "configuration.solrDataset.solrUrl.login" - }, - { - "key": "basicAuth.password", - "path": "configuration.solrDataset.solrUrl.password" - }, - { - "key": "basicAuth.url", - "path": "configuration.solrDataset.solrUrl.url" - } - ], - "type": "healthcheck" - } - ], - "widget": "button" - } - ], - "key": "configuration.solrDataset.solrUrl", - "placeholder": "solrUrl", - "required": false, - "title": "solrUrl" - } - ] - } -} diff --git a/packages/playground/mockBackend/server.js b/packages/playground/mockBackend/server.js deleted file mode 100644 index 1df6ab75e9d..00000000000 --- a/packages/playground/mockBackend/server.js +++ /dev/null @@ -1,33 +0,0 @@ -const kit = require('./kit'); -const jsonForward = require('./jsonForward'); - -const server = (req, res) => { - // Parse JSON body for POST/PUT requests - let body = ''; - req.on('data', chunk => { - body += chunk.toString(); - }); - req.on('end', () => { - try { - req.body = body ? JSON.parse(body) : {}; - } catch (e) { - req.body = {}; - } - // Parse query string - const url = new URL(req.url, `http://${req.headers.host}`); - req.query = Object.fromEntries(url.searchParams); - req.url = url.pathname; - - // Route to appropriate handler - if (req.url.startsWith('/api/mock/')) { - jsonForward(req, res); - } else if (req.url.startsWith('/api/')) { - kit(req, res); - } else { - res.writeHead(404); - res.end('Not Found'); - } - }); -}; - -module.exports = server; diff --git a/packages/playground-vite/mockVite/kit.js b/packages/playground/mockVite/kit.js similarity index 100% rename from packages/playground-vite/mockVite/kit.js rename to packages/playground/mockVite/kit.js diff --git a/packages/playground-vite/mockVite/mock/header-bar/products-list.json b/packages/playground/mockVite/mock/header-bar/products-list.json similarity index 100% rename from packages/playground-vite/mockVite/mock/header-bar/products-list.json rename to packages/playground/mockVite/mock/header-bar/products-list.json diff --git a/packages/playground-vite/mockVite/mock/kit/example.json b/packages/playground/mockVite/mock/kit/example.json similarity index 100% rename from packages/playground-vite/mockVite/mock/kit/example.json rename to packages/playground/mockVite/mock/kit/example.json diff --git a/packages/playground-vite/mockVite/mock/kit/index.js b/packages/playground/mockVite/mock/kit/index.js similarity index 100% rename from packages/playground-vite/mockVite/mock/kit/index.js rename to packages/playground/mockVite/mock/kit/index.js diff --git a/packages/playground-vite/mockVite/mock/kit/validation.json b/packages/playground/mockVite/mock/kit/validation.json similarity index 100% rename from packages/playground-vite/mockVite/mock/kit/validation.json rename to packages/playground/mockVite/mock/kit/validation.json diff --git a/packages/playground-vite/mockVite/server.js b/packages/playground/mockVite/server.js similarity index 100% rename from packages/playground-vite/mockVite/server.js rename to packages/playground/mockVite/server.js diff --git a/packages/playground/package.json b/packages/playground/package.json index 8922d46da31..18bb7e91051 100644 --- a/packages/playground/package.json +++ b/packages/playground/package.json @@ -1,13 +1,15 @@ { "name": "@talend/ui-playground", - "version": "3.1.1", + "version": "0.6.1", "description": "Showcase Talend/UI", "private": true, + "type": "module", "main": "app/index.js", "scripts": { - "build": "cross-env BASENAME='/playground' talend-scripts build", - "test": "echo nothing to test in playground", - "start": "talend-scripts build && node serve-dist", + "start": "vite dev", + "build": "vite build && cmf-settings", + "build:settings": "cmf-settings", + "start-dist": "node serve-dist.mjs", "lint": "eslint -o eslint-report.json --format json ." }, "repository": { @@ -24,22 +26,28 @@ "@talend/dynamic-cdn-webpack-plugin": "^14.5.1", "@talend/eslint-config": "^14.1.2", "@talend/eslint-plugin": "^1.8.1", - "@talend/scripts-core": "^20.0.0", "@talend/scripts-config-babel": "^13.10.1", "@talend/scripts-config-stylelint": "^5.0.0", - "copy-webpack-plugin": "^14.0.0", + "@talend/scripts-core": "^20.0.0", + "@vitejs/plugin-react": "^4.7.0", "cross-env": "^10.1.0", + "esbuild-plugin-react-virtualized": "^1.0.5", "eslint": "^10.0.3", - "webpack": "^5.104.1" + "i18next-http-backend": "^1.4.5", + "mockjs": "^1.1.0", + "sass": "^1.97.3", + "vite": "^7.3.1", + "vite-plugin-mock": "^3.0.2" }, "dependencies": { - "@talend/bootstrap-theme": "^10.1.1", "@talend/assets-api": "^2.1.1", + "@talend/bootstrap-theme": "^10.1.1", "@talend/design-system": "^12.1.1", "@talend/design-tokens": "^4.1.1", "@talend/icons": "^8.0.0", "@talend/locales-tui-components": "^16.0.1", "@talend/locales-tui-containers": "^9.1.3", + "@talend/locales-tui-faceted-search": "^11.3.0", "@talend/locales-tui-forms": "^15.2.0", "@talend/react-cmf": "^12.1.1", "@talend/react-cmf-router": "^9.1.1", diff --git a/packages/playground/serve-dist.js b/packages/playground/serve-dist.js deleted file mode 100644 index 938eceb18a0..00000000000 --- a/packages/playground/serve-dist.js +++ /dev/null @@ -1,99 +0,0 @@ -const http = require('http'); -const fs = require('fs'); -const path = require('path'); -const backend = require('./mockBackend/server'); - -const options = process.argv.slice(2); -const useGzip = options.includes('--gzip'); -const ROOT = path.resolve(__dirname, 'dist'); - -// Simple static file server -function serveStatic(req, res, filePath) { - // Validate that the file path is within ROOT directory to prevent path traversal - // Normalize the path to handle both absolute and relative paths - const resolvedPath = path.isAbsolute(filePath) - ? path.resolve(filePath) - : path.resolve(ROOT, filePath); - - if (resolvedPath !== ROOT && !resolvedPath.startsWith(ROOT + path.sep)) { - res.writeHead(403, { 'Content-Type': 'text/plain' }); - res.end('Forbidden'); - return; - } - - fs.readFile(resolvedPath, (err, data) => { - if (err) { - res.writeHead(404, { 'Content-Type': 'text/plain' }); - res.end('Not Found'); - return; - } - - const ext = path.extname(resolvedPath); - const contentTypes = { - '.html': 'text/html', - '.js': 'application/javascript', - '.css': 'text/css', - '.json': 'application/json', - '.png': 'image/png', - '.jpg': 'image/jpeg', - '.gif': 'image/gif', - '.svg': 'image/svg+xml', - }; - - const contentType = contentTypes[ext] || 'application/octet-stream'; - const headers = { - 'Content-Type': contentType, - 'Content-Length': data.length, - }; - - if (useGzip) { - headers['Content-Encoding'] = 'gzip'; - } - - res.writeHead(200, headers); - res.end(data); - }); -} - -const server = http.createServer((req, res) => { - // Handle API routes through backend - if (req.url.startsWith('/api/')) { - backend(req, res); - return; - } - - // Serve static files from dist - let urlPath; - try { - // Use WHATWG URL to reliably extract the pathname (ignores query, hash) - const parsedUrl = new URL(req.url, 'http://localhost'); - urlPath = parsedUrl.pathname || '/'; - } catch (e) { - res.writeHead(400, { 'Content-Type': 'text/plain' }); - res.end('Bad Request'); - return; - } - - // Prevent directory traversal: resolve against ROOT and verify containment - let filePath = path.resolve(ROOT, '.' + urlPath); - - // Ensure the resolved path is within the ROOT directory - if (filePath !== ROOT && !filePath.startsWith(ROOT + path.sep)) { - res.writeHead(403, { 'Content-Type': 'text/plain' }); - res.end('Forbidden'); - return; - } - - // Handle directory requests (serve index.html) - fs.stat(filePath, (err, stats) => { - if (!err && stats.isDirectory()) { - filePath = path.join(filePath, 'index.html'); - } - - serveStatic(req, res, filePath); - }); -}); - -server.listen(3000, () => { - console.log('ready http://localhost:3000'); -}); diff --git a/packages/playground-vite/serve-dist.mjs b/packages/playground/serve-dist.mjs similarity index 100% rename from packages/playground-vite/serve-dist.mjs rename to packages/playground/serve-dist.mjs diff --git a/packages/playground/src/app/actions/index.js b/packages/playground/src/app/actions/index.js index e294039d493..0d8b889742c 100644 --- a/packages/playground/src/app/actions/index.js +++ b/packages/playground/src/app/actions/index.js @@ -1,4 +1,4 @@ -import redirect from './redirect'; +import redirect from './redirect.js'; export default { redirect, diff --git a/packages/playground/src/app/components/ComponentFormSandbox.jsx b/packages/playground/src/app/components/ComponentFormSandbox.jsx index d524f0e023b..ba4aeac920d 100644 --- a/packages/playground/src/app/components/ComponentFormSandbox.jsx +++ b/packages/playground/src/app/components/ComponentFormSandbox.jsx @@ -11,11 +11,11 @@ import HeaderBar from '@talend/react-containers/lib/HeaderBar'; import SidePanel from '@talend/react-containers/lib/SidePanel'; import UIForm from '@talend/react-forms'; +import example from './example.json'; + // test new behavior on non css module files import './ComponentFormSandbox.scss'; -const example = require('../../../mockBackend/mock/kit/example.json'); - const { isComponentFormDirty } = ComponentForm.selectors; const { setComponentFormDirtyState } = ComponentForm.actions; diff --git a/packages/playground-vite/src/app/components/example.json b/packages/playground/src/app/components/example.json similarity index 100% rename from packages/playground-vite/src/app/components/example.json rename to packages/playground/src/app/components/example.json diff --git a/packages/playground/src/app/i18n.js b/packages/playground/src/app/i18n.js index 238619f77db..2364a509cca 100644 --- a/packages/playground/src/app/i18n.js +++ b/packages/playground/src/app/i18n.js @@ -7,9 +7,9 @@ import i18next from 'i18next'; import HttpApi from 'i18next-http-backend'; import assetsApi from '@talend/assets-api'; -import { namespaces as tuiComponentsNamespaces } from '@talend/locales-tui-components/namespaces'; -import { namespaces as tuiContainersNamespaces } from '@talend/locales-tui-containers/namespaces'; -import { namespaces as tuiFormsNamespaces } from '@talend/locales-tui-forms/namespaces'; +import { namespaces as tuiComponentsNamespaces } from '@talend/locales-tui-components/namespaces.js'; +import { namespaces as tuiContainersNamespaces } from '@talend/locales-tui-containers/namespaces.js'; +import { namespaces as tuiFormsNamespaces } from '@talend/locales-tui-forms/namespaces.js'; const LOCALES_MAP = { 'tui-components': assetsApi.getURL( diff --git a/packages/playground/src/app/index.jsx b/packages/playground/src/app/index.jsx index 9b51d5c5989..294210a87ed 100644 --- a/packages/playground/src/app/index.jsx +++ b/packages/playground/src/app/index.jsx @@ -5,23 +5,22 @@ * Being the first import is important, so that it is the default style * and other style can override it */ -// eslint-disable-next-line @talend/import-depth // eslint-disable-next-line @talend/import-depth import '@talend/bootstrap-theme/dist/bootstrap.css'; import cmf from '@talend/react-cmf'; import getRouter from '@talend/react-cmf-router'; -import { AppLoader, IconsProvider } from '@talend/react-components'; +import { AppLoader } from '@talend/react-components'; import containersModule from '@talend/react-containers'; import ComponentForm from '@talend/react-containers/lib/ComponentForm'; -import { initI18n } from './i18n'; -import actions from './actions'; -import ComponentFormSandbox from './components/ComponentFormSandbox'; -import { Dataviz } from './components/Dataviz'; -import { FacetedSearchPlayground } from './components/FacetedSearch'; -import { Icons } from './components/Icons'; -import { LeaguesList } from './components/List'; +import actions from './actions/index.js'; +import ComponentFormSandbox from './components/ComponentFormSandbox.jsx'; +import { Dataviz } from './components/Dataviz.jsx'; +import { FacetedSearchPlayground } from './components/FacetedSearch.jsx'; +import { Icons } from './components/Icons.jsx'; +import { LeaguesList } from './components/List.jsx'; +import { initI18n } from './i18n.js'; // thanks ui-scripts let basename = window.basename; @@ -39,7 +38,6 @@ const app = { ComponentFormSandbox, FacetedSearch: FacetedSearchPlayground, LeaguesList, - IconsProvider, Dataviz, Icons, }, @@ -62,4 +60,5 @@ console.log('app bootstrap should happens only once'); * - Fetch the settings * - render react-dom in the dom 'app' element */ +debugger; cmf.bootstrap(app); diff --git a/packages/playground/talend-scripts.json b/packages/playground/talend-scripts.json index 23c100bf93c..57ed06df2f4 100644 --- a/packages/playground/talend-scripts.json +++ b/packages/playground/talend-scripts.json @@ -4,8 +4,8 @@ "webpack": { "monoRepoFixSourceMap": ["../dataviz/src", "../containers/src", "../components/src"], "config": { - "development": "./webpack.config.dev.js", - "production": "./webpack.config.dev.js" + "development": "./webpack.config.dev.cjs", + "production": "./webpack.config.dev.cjs" } }, "dynamic-cdn-webpack-plugin": false diff --git a/packages/playground-vite/vite.config.js b/packages/playground/vite.config.js similarity index 100% rename from packages/playground-vite/vite.config.js rename to packages/playground/vite.config.js diff --git a/packages/playground/webpack.config.dev.js b/packages/playground/webpack.config.dev.js deleted file mode 100644 index 9a4450147a5..00000000000 --- a/packages/playground/webpack.config.dev.js +++ /dev/null @@ -1,19 +0,0 @@ -const mockBackend = require('./mockBackend/server'); - -const webpackConfig = { - plugins: [], - output: { - publicPath: process.env.BASENAME || '/', - }, - devServer: { - setupMiddlewares: (middlewares, devServer) => { - devServer.app.use(mockBackend); - return middlewares; - }, - historyApiFallback: { - index: `${process.env.BASENAME || '/'}index.html`, - }, - }, -}; - -module.exports = webpackConfig; diff --git a/tools/scripts-core/README.md b/tools/scripts-core/README.md index 6295c333dc5..bf887785791 100644 --- a/tools/scripts-core/README.md +++ b/tools/scripts-core/README.md @@ -2,7 +2,10 @@ ## Description -This project, inspired by `react-scripts` and `kcd-scripts`, aims to abstract all tools and configuration from your project. +THIS PROJECT IS DEPRECATED ! Please plan to move away from talend-scripts tool. + +This project was inspired by `react-scripts` and `kcd-scripts`, aims to abstract all tools and configuration from your project. +Nowdays tools like vite / vitest comes with great zero config approach if the code is standard. It will expose basic scripts: diff --git a/tools/scripts-core/__tests__/index.test.js b/tools/scripts-core/__tests__/index.test.js index 0131b91b672..3cdcc930add 100644 --- a/tools/scripts-core/__tests__/index.test.js +++ b/tools/scripts-core/__tests__/index.test.js @@ -24,21 +24,6 @@ describe('talend-scripts', () => { rimrafSync(path.join(__dirname, 'tmp*'), { glob: { silent: true } }); }); describe('build', () => { - it('should by default create a dist folder', () => { - const tmp = getTmpDirectory('build-lib-umd'); - const output = spawnSync('node', [bin, 'build', '--umd'], { cwd: tmp }); - const logs = output.stdout.toString(); - expect(output.error).toBeUndefined(); - expect(logs).toContain('CONFIGURATION -----'); - expect(logs).toContain('Running command: build With options: --umd'); - expect(logs).toContain('Talend scripts mode : production'); - expect(logs).toContain('Talend scripts configuration file found and loaded'); - expect(logs).toContain('RUN ------------'); - // expect(output.stderr.toString()).toBe(''); - fs.existsSync(path.join(tmp, 'dist', 'TalendTestScriptsCore.min.js')); - fs.existsSync(path.join(tmp, 'dist', 'TalendTestScriptsCore.min.js.dependencies.json')); - fs.existsSync(path.join(tmp, 'dist', 'TalendTestScriptsCore.min.js.map')); - }); it('should by default put build output in lib folder', () => { const tmp = getTmpDirectory('build-lib'); const output = spawnSync('node', [bin, 'build'], { cwd: tmp }); diff --git a/tools/scripts-core/package.json b/tools/scripts-core/package.json index e42d926771f..4df235b8763 100644 --- a/tools/scripts-core/package.json +++ b/tools/scripts-core/package.json @@ -22,14 +22,6 @@ "test": "vitest run", "test:cov": "vitest run" }, - "peerDependencies": { - "@talend/scripts-config-react-webpack": ">=16.0.0" - }, - "peerDependenciesMeta": { - "@talend/scripts-config-react-webpack": { - "optional": true - } - }, "dependencies": { "@babel/cli": "^7.28.6", "@babel/core": "^7.28.6", @@ -44,8 +36,6 @@ "lodash": "^4.17.23", "rimraf": "^6.1.2", "typescript": "^5.9.3", - "webpack": "^5.104.1", - "webpack-merge": "^5.10.0", "yargs": "^15.4.1" }, "devDependencies": { diff --git a/tools/scripts-core/src/config/webpack.config.js b/tools/scripts-core/src/config/webpack.config.js deleted file mode 100644 index a495006b4ac..00000000000 --- a/tools/scripts-core/src/config/webpack.config.js +++ /dev/null @@ -1,64 +0,0 @@ -/* eslint-disable no-console */ -import { merge } from 'webpack-merge'; -import * as utils from '@talend/scripts-utils'; -import { getPresetApi } from '../utils/preset.js'; - -function getPluginInfo(a) { - return { - name: a.constructor.name, - simpleattr: Object.keys(a) - .filter(key => ['string', 'boolean'].includes(typeof a[key])) - .filter(key => !Array.isArray(a[key])) - .map(key => [key, a[key]]), - }; -} - -export default async (env = {}) => { - const presetApi = getPresetApi(); - - let webpackConfigurations = []; - const defaultConfig = await import('@talend/scripts-config-react-webpack'); - webpackConfigurations = webpackConfigurations.concat( - defaultConfig.default(presetApi, { umd: env.umd }), - ); - - // User configuration file - const userConfigPath = presetApi.getUserConfig(['webpack', 'config', presetApi.mode]); - if (userConfigPath) { - let userConfigAbsolutePath = utils.path.getAbsolutePath(userConfigPath); - if (process.platform === 'win32') { - userConfigAbsolutePath = `file:///${userConfigAbsolutePath}`; - } - console.log( - `Merge ${presetApi.mode} webpack config with custom one (${userConfigAbsolutePath})`, - ); - const config = await import(userConfigAbsolutePath); - webpackConfigurations.push(config.default); - } - - webpackConfigurations = await Promise.all( - webpackConfigurations.map(async conf => { - if (typeof conf === 'function') { - const asyncConf = await conf(env); - return asyncConf; - } - return conf; - }), - ); - - // Merge all configuration. User config can override preset ones, - const config = merge(...webpackConfigurations); - - if (presetApi.getUserConfig(['webpack', 'debug'], false)) { - const light = Object.keys(config) - .filter(key => key !== 'plugins') - .reduce((acc, key) => { - acc[key] = config[key]; - return acc; - }, {}); - console.log(JSON.stringify(light, null, 2)); - console.log('plugins:', JSON.stringify(config.plugins.map(getPluginInfo), null, 2)); - } - - return config; -}; diff --git a/tools/scripts-core/src/index.js b/tools/scripts-core/src/index.js index eddc613446b..16a970eabf0 100755 --- a/tools/scripts-core/src/index.js +++ b/tools/scripts-core/src/index.js @@ -10,7 +10,6 @@ const options = process.argv.slice(3); if (command === '--help' || command === '-h' || command === 'help') { console.log(`Please use one of the following commands: -* start * build `); process.exit(0); @@ -73,7 +72,6 @@ async function runScript() { switch (command) { case 'build': - case 'start': runScript(command, options); break; default: diff --git a/tools/scripts-core/src/scripts/build-lib-umd.js b/tools/scripts-core/src/scripts/build-lib-umd.js deleted file mode 100644 index 47a4a05e7e4..00000000000 --- a/tools/scripts-core/src/scripts/build-lib-umd.js +++ /dev/null @@ -1,31 +0,0 @@ -import fs from 'fs'; - -import * as utils from '@talend/scripts-utils'; - -import { resolveScript } from '../utils/bin.js'; -import { getUserConfigFile } from '../utils/env.js'; - -const dirname = utils.path.getDirName(import.meta.url); - -async function buildUMD(env, presetApi, options = []) { - return utils.process.spawn( - 'node', - [ - resolveScript('webpack/bin/webpack.js'), - '--config', - utils.path.hereRelative(dirname, '../config/webpack.config.js'), - ].concat(options), - { stdio: 'inherit', env }, - ); -} - -export default async function build(env, presetApi, options) { - const packageJSON = JSON.parse(fs.readFileSync(getUserConfigFile(['package.json']))); - const UMDName = packageJSON.name - .replace(/[^a-zA-Z0-9]/g, ' ') - .split(' ') - .map(w => w.replace(/./, m => m.toUpperCase())) - .join(''); - - return buildUMD(env, presetApi, options.concat(['--env', `umd=${UMDName}`], options)); -} diff --git a/tools/scripts-core/src/scripts/build.js b/tools/scripts-core/src/scripts/build.js index 5702f6dadfe..63a2bce45f0 100755 --- a/tools/scripts-core/src/scripts/build.js +++ b/tools/scripts-core/src/scripts/build.js @@ -1,37 +1,15 @@ import * as utils from '@talend/scripts-utils'; -import { resolveScript } from '../utils/bin.js'; -import buildUMD from './build-lib-umd.js'; import buildLib from './build-lib.js'; // eslint-disable-next-line consistent-return export default async function build(env, _, options) { const packageType = utils.pkg.getPackageType(); if (packageType.isApp) { - return utils.process.spawn( - 'node', - [ - resolveScript('webpack/bin/webpack.js'), - '--config', - utils.path.hereRelative( - utils.path.getDirName(import.meta.url), - '../config/webpack.config.js', - ), - '--progress', - ...options, - ], - { stdio: 'inherit', env }, - ); + console.error('Building apps is not supported.'); + process.exit(1); } if (packageType.isLib) { - // detect UMD here - if (options.includes('--umd')) { - return buildUMD( - env, - _, - options.filter(o => o !== '--umd'), - ); - } return buildLib(env, _, options); } } diff --git a/tools/scripts-core/src/scripts/start.js b/tools/scripts-core/src/scripts/start.js deleted file mode 100755 index 9af4fefb664..00000000000 --- a/tools/scripts-core/src/scripts/start.js +++ /dev/null @@ -1,27 +0,0 @@ -import * as utils from '@talend/scripts-utils'; - -import { resolveScript } from '../utils/bin.js'; - -export default async function start(env, _, options) { - const packageType = utils.pkg.getPackageType(); - - if (packageType.isApp) { - return utils.process.spawn( - 'node', - [ - resolveScript('webpack/bin/webpack.js'), - 'serve', - '--config', - utils.path.hereRelative( - utils.path.getDirName(import.meta.url), - '../config/webpack.config.js', - ), - '--progress', - ...options, - ], - { stdio: 'inherit', env }, - ); - } - - return null; -} diff --git a/yarn.lock b/yarn.lock index d21bc218e0c..00d01b3c8a5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3558,6 +3558,15 @@ raf "^3.4.1" regenerator-runtime "^0.13.11" +"@talend/scripts-config-stylelint@^4.5.0": + version "4.5.1" + resolved "https://npm.pkg.github.com/download/@talend/scripts-config-stylelint/4.5.1/df7b6c06a47504b0c65fcac0508b7efd8357b70f#df7b6c06a47504b0c65fcac0508b7efd8357b70f" + integrity sha512-irjusFPw/LRsyUg6NPqiwykpxrX1fHRZ43Yrjb6SUjcPrVuPRqOMvDzEuRqwXEGlmpNbFIstxdg761zGnvo0WQ== + dependencies: + stylelint "^15.11.0" + stylelint-config-sass-guidelines "^10.0.0" + stylelint-config-standard "^34.0.0" + "@talend/scripts-core@^18.0.0": version "18.0.0" resolved "https://npm.pkg.github.com/download/@talend/scripts-core/18.0.0/1272cbee7eca7082519b4bbbb4b3c64e023f9ea1#1272cbee7eca7082519b4bbbb4b3c64e023f9ea1" @@ -13008,6 +13017,11 @@ postcss-media-minmax@^5.0.0: resolved "https://registry.yarnpkg.com/postcss-media-minmax/-/postcss-media-minmax-5.0.0.tgz#7140bddec173e2d6d657edbd8554a55794e2a5b5" integrity sha512-yDUvFf9QdFZTuCUg0g0uNSHVlJ5X1lSzDZjPSFaiCWvjgsvu8vEVxtahPrLMinIDEEGnx6cBe6iqdx5YWz08wQ== +postcss-media-query-parser@^0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/postcss-media-query-parser/-/postcss-media-query-parser-0.2.3.tgz#27b39c6f4d94f81b1a73b8f76351c609e5cef244" + integrity sha512-3sOlxmbKcSHMjlUXQZKQ06jOswE7oVkXPxmZdoB1r5l0q6gTFTQSHxNxOrCccElbW7dxNytifNEo8qidX2Vsig== + postcss-merge-longhand@^7.0.5: version "7.0.5" resolved "https://registry.yarnpkg.com/postcss-merge-longhand/-/postcss-merge-longhand-7.0.5.tgz#e1b126e92f583815482e8b1e82c47d2435a20421" @@ -13286,6 +13300,11 @@ postcss-safe-parser@^7.0.1: resolved "https://registry.yarnpkg.com/postcss-safe-parser/-/postcss-safe-parser-7.0.1.tgz#36e4f7e608111a0ca940fd9712ce034718c40ec0" integrity sha512-0AioNCJZ2DPYz5ABT6bddIqlhgwhpHZ/l65YAYo0BCIn0xiDpsnTHz0gnoTGk0OXZW0JRs+cDwL8u/teRdz+8A== +postcss-scss@^4.0.6: + version "4.0.9" + resolved "https://registry.yarnpkg.com/postcss-scss/-/postcss-scss-4.0.9.tgz#a03c773cd4c9623cb04ce142a52afcec74806685" + integrity sha512-AjKOeiwAitL/MXxQW2DliT28EKukvvbEWx3LBmJIRN8KfBGZbRTxNYW0kSqi1COiTZ57nZ9NW06S6ux//N1c9A== + postcss-selector-not@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/postcss-selector-not/-/postcss-selector-not-6.0.1.tgz#8f0a709bf7d4b45222793fc34409be407537556d" @@ -13293,7 +13312,7 @@ postcss-selector-not@^6.0.1: dependencies: postcss-selector-parser "^6.0.10" -postcss-selector-parser@^6.0.10, postcss-selector-parser@^6.0.13, postcss-selector-parser@^6.0.4, postcss-selector-parser@^6.0.9: +postcss-selector-parser@^6.0.10, postcss-selector-parser@^6.0.11, postcss-selector-parser@^6.0.13, postcss-selector-parser@^6.0.4, postcss-selector-parser@^6.0.9: version "6.1.2" resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-6.1.2.tgz#27ecb41fb0e3b6ba7a1ec84fff347f734c7929de" integrity sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg== @@ -15462,11 +15481,31 @@ stylehacks@^7.0.5: browserslist "^4.28.1" postcss-selector-parser "^7.1.1" +stylelint-config-recommended@^13.0.0: + version "13.0.0" + resolved "https://registry.yarnpkg.com/stylelint-config-recommended/-/stylelint-config-recommended-13.0.0.tgz#c48a358cc46b629ea01f22db60b351f703e00597" + integrity sha512-EH+yRj6h3GAe/fRiyaoO2F9l9Tgg50AOFhaszyfov9v6ayXJ1IkSHwTxd7lB48FmOeSGDPLjatjO11fJpmarkQ== + stylelint-config-recommended@^18.0.0: version "18.0.0" resolved "https://registry.yarnpkg.com/stylelint-config-recommended/-/stylelint-config-recommended-18.0.0.tgz#1d86be73565c3cd5e6babb8abcc932012a86bd76" integrity sha512-mxgT2XY6YZ3HWWe3Di8umG6aBmWmHTblTgu/f10rqFXnyWxjKWwNdjSWkgkwCtxIKnqjSJzvFmPT5yabVIRxZg== +stylelint-config-sass-guidelines@^10.0.0: + version "10.0.0" + resolved "https://registry.yarnpkg.com/stylelint-config-sass-guidelines/-/stylelint-config-sass-guidelines-10.0.0.tgz#ace99689eb6769534c9b40d62e2a8562b1ddc9f2" + integrity sha512-+Rr2Dd4b72CWA4qoj1Kk+y449nP/WJsrD0nzQAWkmPPIuyVcy2GMIcfNr0Z8JJOLjRvtlkKxa49FCNXMePBikQ== + dependencies: + postcss-scss "^4.0.6" + stylelint-scss "^4.4.0" + +stylelint-config-standard@^34.0.0: + version "34.0.0" + resolved "https://registry.yarnpkg.com/stylelint-config-standard/-/stylelint-config-standard-34.0.0.tgz#309f3c48118a02aae262230c174282e40e766cf4" + integrity sha512-u0VSZnVyW9VSryBG2LSO+OQTjN7zF9XJaAJRX/4EwkmU0R2jYwmBSN10acqZisDitS0CLiEiGjX7+Hrq8TAhfQ== + dependencies: + stylelint-config-recommended "^13.0.0" + stylelint-config-standard@^40.0.0: version "40.0.0" resolved "https://registry.yarnpkg.com/stylelint-config-standard/-/stylelint-config-standard-40.0.0.tgz#6bb72b94f8be434cdf2902ba26b2167d572c5414" @@ -15474,6 +15513,16 @@ stylelint-config-standard@^40.0.0: dependencies: stylelint-config-recommended "^18.0.0" +stylelint-scss@^4.4.0: + version "4.7.0" + resolved "https://registry.yarnpkg.com/stylelint-scss/-/stylelint-scss-4.7.0.tgz#f986bf8c5a4b93eae2b67d3a3562eef822657908" + integrity sha512-TSUgIeS0H3jqDZnby1UO1Qv3poi1N8wUYIJY6D1tuUq2MN3lwp/rITVo0wD+1SWTmRm0tNmGO0b7nKInnqF6Hg== + dependencies: + postcss-media-query-parser "^0.2.3" + postcss-resolve-nested-selector "^0.1.1" + postcss-selector-parser "^6.0.11" + postcss-value-parser "^4.2.0" + stylelint@^15.11.0: version "15.11.0" resolved "https://registry.yarnpkg.com/stylelint/-/stylelint-15.11.0.tgz#3ff8466f5f5c47362bc7c8c9d382741c58bc3292"