diff --git a/.changeset/grumpy-planets-show.md b/.changeset/grumpy-planets-show.md new file mode 100644 index 0000000000..c569fade94 --- /dev/null +++ b/.changeset/grumpy-planets-show.md @@ -0,0 +1,5 @@ +--- +'@talend/local-libs-webpack-plugin': major +--- + +move lib to src folder diff --git a/.changeset/open-cases-brush.md b/.changeset/open-cases-brush.md new file mode 100644 index 0000000000..982385c427 --- /dev/null +++ b/.changeset/open-cases-brush.md @@ -0,0 +1,59 @@ +--- +'@talend/react-faceted-search-query-client': patch +'@talend/babel-plugin-import-from-index': patch +'@talend/local-libs-webpack-plugin': patch +'@talend/babel-plugin-import-from-lib': patch +'@talend/scripts-config-react-webpack': patch +'@talend/scripts-config-storybook-lib': patch +'@talend/dynamic-cdn-webpack-plugin': patch +'@talend/scripts-config-typescript': patch +'@talend/scripts-config-stylelint': patch +'@talend/babel-plugin-assets-api': patch +'@talend/scripts-config-prettier': patch +'@talend/babel-plugin-import-d3': patch +'@talend/scripts-yarn-workspace': patch +'@talend/eslint-config': patch +'@talend/scripts-publish-local': patch +'@talend/json-schema-form-core': patch +'@talend/scripts-config-babel': patch +'@talend/ui-playground-vite': patch +'@talend/react-cmf-webpack-plugin': patch +'@talend/scripts-config-cdn': patch +'@talend/react-faceted-search': patch +'@talend/storybook-docs': patch +'@talend/design-system': patch +'@talend/design-tokens': patch +'@talend/react-flow-designer': patch +'@talend/router-bridge': patch +'@talend/react-storybook-cmf': patch +'@talend/ui-storybook-one': patch +'@talend/scripts-locales': patch +'@talend/react-bootstrap': patch +'@talend/design-docs': patch +'@talend/bootstrap-sass': patch +'@talend/assets-api': patch +'@talend/react-cmf-router': patch +'@talend/react-components': patch +'@talend/react-containers': patch +'@talend/ui-playground': patch +'@talend/eslint-plugin': patch +'@talend/scripts-utils': patch +'@talend/module-to-cdn': patch +'@talend/scripts-core': patch +'@talend/upgrade-deps': patch +'@talend/react-cmf-cqrs': patch +'@talend/scripts-cmf': patch +'@talend/react-dataviz': patch +'@talend/react-stepper': patch +'@talend/react-forms': patch +'@talend/icons': patch +'@talend/react-sagas': patch +'@talend/bootstrap-theme': patch +'@talend/utils': patch +'@talend/react-a11y': patch +'@talend/http': patch +'@talend/react-cmf': patch +--- + +chore: move devDeps at the repository level, review build, test lint.\ + diff --git a/.github/actions/setup-node/action.yml b/.github/actions/setup-node/action.yml index 0b85cf0410..cfad00b17f 100644 --- a/.github/actions/setup-node/action.yml +++ b/.github/actions/setup-node/action.yml @@ -9,13 +9,25 @@ inputs: runs: using: 'composite' steps: - - name: Set up Node.js - uses: actions/setup-node@v4 + - name: Cache asdf + uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4 with: - node-version-file: '.tool-versions' - # set up auth to read in from env.NODE_AUTH_TOKEN. - registry-url: 'https://npm.pkg.github.com' - scope: '@talend' + path: | + ~/.asdf/ + key: ${{ runner.os }}-${{ hashFiles('**/.tool-versions') }}-v0.18.0 + restore-keys: | + ${{ runner.os }}-asdf-v0.18.0 + + - name: Install asdf & tools + uses: asdf-vm/actions/install@b7bcd026f18772e44fe1026d729e1611cc435d47 # v4.0.1 + + - name: Setup npm registry + shell: bash + run: | + echo "//npm.pkg.github.com/:always-auth=true" >> ~/.npmrc + if [ -n "${{ inputs.NODE_AUTH_TOKEN }}" ]; then + echo "//npm.pkg.github.com/:_authToken=${{ inputs.NODE_AUTH_TOKEN }}" >> ~/.npmrc + fi - name: Install yarn shell: bash @@ -33,3 +45,6 @@ runs: key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} restore-keys: | ${{ runner.os }}-yarn- + + - name: Cache for Turbo + uses: rharkor/caching-for-turbo@0abc2381e688c4d2832f0665a68a01c6e82f0d6c #v2.3.11 diff --git a/.github/workflows/changeset.yml b/.github/workflows/changeset.yml index 843141bd79..bbe5abfd5c 100644 --- a/.github/workflows/changeset.yml +++ b/.github/workflows/changeset.yml @@ -46,7 +46,9 @@ jobs: - name: Install and Build if: steps.changesetfiles.outputs.count == 1 - run: yarn --frozen-lockfile + run: | + yarn --frozen-lockfile + yarn build env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/demo.yml b/.github/workflows/demo.yml index 2b81ee1a3f..536fb1759d 100644 --- a/.github/workflows/demo.yml +++ b/.github/workflows/demo.yml @@ -35,8 +35,11 @@ jobs: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} run: yarn install --frozen-lockfile + - name: Build + run: yarn build + - name: Build Demo - run: yarn test:demo + run: yarn storybook:build - name: Checkout demo branch uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 #v6.0.1 diff --git a/.github/workflows/pr-demo.yml b/.github/workflows/pr-demo.yml index 9053c473e9..182b3cd849 100644 --- a/.github/workflows/pr-demo.yml +++ b/.github/workflows/pr-demo.yml @@ -32,8 +32,11 @@ jobs: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} run: yarn install --frozen-lockfile + - name: Build + run: yarn build + - name: Build Demo - run: yarn test:demo + run: yarn storybook:build - name: Checkout demo branch uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 #v6.0.1 diff --git a/.github/workflows/pr-lint.yml b/.github/workflows/pr-lint.yml index 36343407ec..709001d160 100644 --- a/.github/workflows/pr-lint.yml +++ b/.github/workflows/pr-lint.yml @@ -36,10 +36,15 @@ jobs: env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + - name: Build + run: yarn build + - name: eslint + stylelint continue-on-error: true id: eslint - run: yarn lint + run: | + yarn eslint:run --concurrency=1 + yarn stylelint:run --concurrency=1 - name: Merge lint uses: ./.github/actions/lint-merge-report diff --git a/.github/workflows/pr-test.yml b/.github/workflows/pr-test.yml index c3f5323584..297f24d89e 100644 --- a/.github/workflows/pr-test.yml +++ b/.github/workflows/pr-test.yml @@ -32,8 +32,12 @@ jobs: env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + - name: Build + run: yarn build + - name: Test - run: yarn test:cov + run: | + yarn vitest:cov --concurrency=1 - name: Jest Coverage Comment uses: MishaKav/jest-coverage-comment@c480abe47ef4f7bcd87bd8b5e6043fdfb1c4d270 #1.0.32 diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index 612d191739..83f06285bb 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -28,6 +28,9 @@ jobs: - name: Install run: yarn install --frozen-lockfile + - name: Build + run: yarn build + - name: Pre-release talend/ui id: version run: | diff --git a/.github/workflows/visual-testing.yml b/.github/workflows/visual-testing.yml index 82bef211b0..f188c48256 100644 --- a/.github/workflows/visual-testing.yml +++ b/.github/workflows/visual-testing.yml @@ -36,7 +36,9 @@ jobs: uses: ./.github/actions/setup-node - name: Install dependencies - run: yarn --frozen-lock + run: | + yarn --frozen-lock + yarn build - name: Publish PR to DS Chromatic if: github.ref != 'refs/heads/master' diff --git a/.vscode/settings.json b/.vscode/settings.json index d0e531c7c6..312d215071 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -11,6 +11,5 @@ "pattern": "fork/**" } ], - "typescript.validate.enable": true, - "javascript.validate.enable": true + "js/ts.validate.enabled": true } diff --git a/docs/adr-2026-04-use-turbo.md b/docs/adr-2026-04-use-turbo.md new file mode 100644 index 0000000000..9858ab2e84 --- /dev/null +++ b/docs/adr-2026-04-use-turbo.md @@ -0,0 +1,142 @@ +# ADR: Set up Turbo Repo and Hoist Dev Dependencies + +## Context + +Talend/UI is a Yarn workspaces monorepo with multiple packages, tools, and forked dependencies spread across `packages/`, `tools/`, and `fork/` directories. Each of these packages and tools has its own `package.json` with duplicated development dependencies. + +Our current build orchestration relies on custom Yarn workspace scripts managed through `@talend/scripts-yarn-workspace`. As the monorepo grows, we face several challenges: + +- **Redundant installations**: Development tools like Babel, ESLint, TypeScript, and build scripts are installed in every package's `node_modules`, consuming significant disk space and installation time. +- **Lack of build caching**: Without proper task orchestration and caching, builds are not optimized across the monorepo, leading to repeated compilation of unchanged dependencies. +- **Inconsistent tooling versions**: Managing identical versions of development tools across multiple `package.json` files is error-prone and difficult to maintain. +- **Slow developer experience**: Install times and build times are longer than necessary due to redundant installations and lack of caching. + +Additionally, the transition to ECMAScript Modules (ESM) and modern build tooling (as defined in ADR: Add support to ECMAScript Modules) requires a more sophisticated build orchestration strategy to handle multiple output formats (`lib/` for CommonJS and `lib-esm/` for ESM). + +## Problem + +As the monorepo scales, we need: + +1. **Efficient task orchestration** — Coordinate builds across packages with proper dependency tracking and parallelization. +2. **Build caching** — Avoid rebuilding packages when their inputs haven't changed. +3. **Centralized tool management** — Reduce disk usage and ensure consistent tool versions across the monorepo. +4. **Faster CI/CD pipelines** — Enable distributed task execution and incremental builds. + +## Decision + +We adopt **Turbo** as our monorepo build orchestration tool and **hoist development dependencies to the workspace root**. + +### Turbo Setup + +Turbo is configured via `turbo.json` to: + +- Define task dependencies and outputs for all build tasks (e.g., `build:lib`, `build:lib:esm`, `test`, `lint`) +- Enable automatic caching of task outputs based on input changed files +- Parallelize independent tasks across packages +- Support distributed task execution for faster CI/CD pipelines + +Example task configuration: + +```json +{ + "tasks": { + "build:lib": { + "dependsOn": ["^build:lib"], + "outputs": ["lib/**"] + } + } +} +``` + +### Dev Dependencies Hoisting + +Development dependencies are moved to the root `package.json`: + +- **Shared tools**: Babel presets, ESLint configs, TypeScript config, Prettier, and all `@talend/scripts-*` packages +- **Locale packages**: Localization files (`@talend/locales-*`) used across packages +- **Peer dependencies for dev**: React, React DOM, and other peer dependencies used during development + +This approach: + +- Eliminates duplicate `node_modules` directories for development tools +- Ensures consistent tool versions across the entire monorepo +- Reduces installation time and disk usage +- Simplifies dependency management (single source of truth) + +Individual packages retain only **runtime dependencies** specific to their functionality (e.g., `lodash`, `date-fns`, `classnames`). + +## Alternatives Considered + +### 1. Keep Current Setup (No Turbo, Distributed Dev Dependencies) + +**Pros:** + +- Minimal changes required +- Packages remain fully independent + +**Cons:** + +- Continued redundant installations and slow build times +- Lack of build caching and optimization +- Difficult to scale as the monorepo grows +- Higher CI/CD costs due to lack of caching and incremental builds + +### 2. Use Nx Instead of Turbo + +**Pros:** + +- Nx provides advanced features like computation hashing and distributed computation +- More opinionated project structure + +**Cons:** + +- Heavier framework with more learning curve +- Overkill for current needs +- Would require more significant restructuring + +### 3. Partially Hoist Dev Dependencies + +**Pros:** + +- Reduces disk usage without fully removing package autonomy + +**Cons:** + +- Still leaves redundancy and inconsistency +- More complex to maintain than full hoisting +- Does not fully solve the caching and orchestration problems + +## Consequences + +### Positive + +- **Faster builds**: Turbo's caching prevents rebuilding unchanged packages. +- **Reduced disk usage**: Dev dependencies are installed once at the root instead of in each package. +- **Faster CI/CD**: Incremental builds and caching reduce total build time in pipelines. +- **Simplified dependency management**: Tool versions are managed in a single file. +- **Better parallelization**: Turbo automatically parallelizes independent tasks. +- **Future-proof**: Enables easier adoption of distributed task execution and remote caching. + +### Negative + +- **Setup complexity**: Requires careful configuration of task dependencies in `turbo.json`. +- **Learning curve**: Developers need to understand Turbo concepts (tasks, caching, outputs). +- **Potential compatibility issues**: Moving dev dependencies to root may expose version conflicts if individual packages had pinned to different versions. +- **Debugging complexity**: Turbo caching can sometimes make debugging harder if developers don't understand what's cached. + +### Risks + +- **Misconfigured task outputs**: If `outputs` in `turbo.json` don't match actual build outputs, caching will fail silently, causing stale artifacts to be served. +- **Root-level dependency bloat**: Over time, the root `package.json` could accumulate unnecessary dependencies if not carefully curated. +- **Local development friction**: Developers must run `yarn install` at the root; package-level `yarn install` in subdirectories won't work as expected. + +## Implementation Notes + +1. **Migration approach**: Move dev dependencies incrementally from individual packages to the root, testing each batch to ensure no regressions. +2. **Task configuration**: Configure task dependencies carefully in `turbo.json` to reflect the actual build dependency graph (e.g., `"dependsOn": ["^build:lib"]` means "run after dependencies' build:lib"). +3. **Documentation**: Update developer guides to explain the new setup and how to run tasks correctly. +4. **CI/CD updates**: Update CI pipelines to use `turbo` commands for task orchestration and to take advantage of caching (e.g., `.turbo/` cache in CI). + +## Related Decisions + +- **ADR: Add support to ECMAScript Modules (ESM)** — This ADR enables efficient handling of multiple output formats through Turbo's task orchestration. diff --git a/fork/bootstrap-sass/package.json b/fork/bootstrap-sass/package.json index f63c95a721..86eefaa303 100644 --- a/fork/bootstrap-sass/package.json +++ b/fork/bootstrap-sass/package.json @@ -5,12 +5,7 @@ "main": "assets/javascripts/bootstrap.js", "style": "assets/stylesheets/_bootstrap.scss", "sass": "assets/stylesheets/_bootstrap.scss", - "scripts": { - "build": "echo nothing to build in bootsrap-sass", - "test": "echo nothing to test in bootsrap-sass", - "test:update": "echo nothing to test in bootsrap-sass", - "test:cov": "echo nothing to test in bootsrap-sass" - }, + "scripts": {}, "files": [ "assets", "CHANGELOG.md", @@ -38,10 +33,5 @@ }, "publishConfig": { "access": "public" - }, - "devDependencies": { - "@talend/eslint-config": "^14.1.2", - "@talend/eslint-plugin": "^1.8.1", - "eslint": "^10.1.0" } } diff --git a/fork/dynamic-cdn-webpack-plugin/package.json b/fork/dynamic-cdn-webpack-plugin/package.json index 6ac6f17602..46b1b6895e 100644 --- a/fork/dynamic-cdn-webpack-plugin/package.json +++ b/fork/dynamic-cdn-webpack-plugin/package.json @@ -16,9 +16,9 @@ "access": "public" }, "scripts": { - "test": "vitest run", - "test:cov": "vitest run --coverage", - "test:update": "vitest run --update" + "vitest:run": "vitest run", + "vitest:cov": "vitest run --coverage", + "vitest:update": "vitest run --update" }, "files": [ "index.js", @@ -45,16 +45,9 @@ "webpack": "^5.105.4" }, "devDependencies": { - "@eslint/js": "^9.39.4", - "eslint": "^10.1.0", - "eslint-config-prettier": "^10.1.8", - "eslint-plugin-prettier": "^5.5.5", "globals": "^15.15.0", "html-webpack-plugin": "^5.6.6", - "@vitest/coverage-v8": "^4.1.2", "mz": "^2.7.0", - "rimraf": "^6.1.3", - "vitest": "^4.1.2", "webpack": "^5.105.4", "webpack-cli": "^6.0.1", "webpack-manifest-plugin": "^5.0.1" diff --git a/fork/dynamic-cdn-webpack-plugin/test/fixtures/app/package.json b/fork/dynamic-cdn-webpack-plugin/test/fixtures/app/package.json index e42dcc9a37..5c95d3c44d 100644 --- a/fork/dynamic-cdn-webpack-plugin/test/fixtures/app/package.json +++ b/fork/dynamic-cdn-webpack-plugin/test/fixtures/app/package.json @@ -3,9 +3,7 @@ "version": "1.0.0", "description": "", "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, + "scripts": {}, "keywords": [], "author": "", "license": "ISC", diff --git a/fork/dynamic-cdn-webpack-plugin/test/fixtures/nested-dependencies/package.json b/fork/dynamic-cdn-webpack-plugin/test/fixtures/nested-dependencies/package.json index 47ec8ae3fa..3e0a91d670 100644 --- a/fork/dynamic-cdn-webpack-plugin/test/fixtures/nested-dependencies/package.json +++ b/fork/dynamic-cdn-webpack-plugin/test/fixtures/nested-dependencies/package.json @@ -3,9 +3,7 @@ "version": "1.0.0", "description": "", "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, + "scripts": {}, "keywords": [], "author": "", "license": "ISC", diff --git a/fork/dynamic-cdn-webpack-plugin/test/html-webpack-plugin.test.js b/fork/dynamic-cdn-webpack-plugin/test/html-webpack-plugin.test.js index 308daa3265..d9366be3e5 100644 --- a/fork/dynamic-cdn-webpack-plugin/test/html-webpack-plugin.test.js +++ b/fork/dynamic-cdn-webpack-plugin/test/html-webpack-plugin.test.js @@ -30,10 +30,9 @@ describe('html-webpack-plugin integration', () => { // then const indexFile = fs - .readFileSync( - path.resolve(__dirname, './fixtures/output/html-webpack-plugin/index.html'), - { encoding: 'utf-8' }, - ) + .readFileSync(path.resolve(__dirname, './fixtures/output/html-webpack-plugin/index.html'), { + encoding: 'utf-8', + }) .toString(); expect(indexFile).toContain('src="/app.js"'); expect(indexFile).toContain('src="https://unpkg.com/react@15.6.1/dist/react.js"'); diff --git a/fork/json-schema-form-core/package.json b/fork/json-schema-form-core/package.json index 3b9eeda83d..614f38517a 100644 --- a/fork/json-schema-form-core/package.json +++ b/fork/json-schema-form-core/package.json @@ -13,12 +13,12 @@ "scripts": { "build:lib": "talend-scripts build", "build:lib:esm": "talend-scripts build --esm", - "lint": "eslint -o eslint-report.json --format json .", + "eslint": "eslint -o eslint-report.json --format json .", "watch": "webpack --watch", "dist-untested": "webpack --config webpack.config.dist.js", - "test:cov": "vitest run --coverage", - "test": "vitest run", - "test:update": "vitest run --update" + "vitest:cov": "vitest run --coverage", + "vitest:run": "vitest run", + "vitest:update": "vitest run --update" }, "author": "json-schema-form", "contributors": [ @@ -48,19 +48,8 @@ "json-schema" ], "devDependencies": { - "@vitest/coverage-v8": "^4.1.2", - "@talend/babel-plugin-assets-api": "^1.9.1", - "@talend/babel-plugin-import-from-index": "^1.13.1", - "@talend/eslint-config": "^14.1.2", - "@talend/eslint-plugin": "^1.8.1", - "@talend/scripts-config-react-webpack": "^17.1.1", - "@talend/scripts-config-typescript": "^12.1.1", - "@talend/scripts-core": "^20.0.0", "@types/chai": "^3.5.2", "@types/node": "^6.14.13", - "eslint": "^10.1.0", - "rimraf": "^6.1.3", - "vitest": "^4.1.2", "webpack": "^5.105.4" }, "dependencies": { diff --git a/fork/json-schema-form-core/tsconfig.json b/fork/json-schema-form-core/tsconfig.json index 0f7c9589bb..65cecdae5a 100644 --- a/fork/json-schema-form-core/tsconfig.json +++ b/fork/json-schema-form-core/tsconfig.json @@ -5,6 +5,7 @@ "noImplicitAny": false, "declaration": true, "target": "ES5", - "module": "CommonJs" + "module": "CommonJs", + "moduleResolution": "node" } } diff --git a/fork/module-to-cdn/package.json b/fork/module-to-cdn/package.json index 641931486b..e5adc01c65 100644 --- a/fork/module-to-cdn/package.json +++ b/fork/module-to-cdn/package.json @@ -18,11 +18,11 @@ "node": ">=14" }, "scripts": { - "test": "vitest run index.test.js", - "test:cov": "vitest run --coverage index.test.js", - "test:update": "vitest run --update index.test.js", + "vitest:run": "vitest run index.test.js", + "vitest:cov": "vitest run --coverage index.test.js", + "vitest:update": "vitest run --update index.test.js", "test:cron": "vitest run modules.test.js", - "lint": "eslint -o eslint-report.json --format json ." + "eslint": "eslint -o eslint-report.json --format json ." }, "files": [ "index.js", @@ -39,13 +39,7 @@ "semver": "^7.7.4" }, "devDependencies": { - "@eslint/js": "^9.39.4", - "eslint": "^10.1.0", - "eslint-config-prettier": "^10.1.8", - "eslint-plugin-prettier": "^5.5.5", - "globals": "^15.15.0", - "@vitest/coverage-v8": "^4.1.2", - "vitest": "^4.1.2" + "globals": "^15.15.0" }, "publishConfig": { "access": "public" diff --git a/fork/react-bootstrap/package.json b/fork/react-bootstrap/package.json index 3f1aa20ee4..360b4a5538 100644 --- a/fork/react-bootstrap/package.json +++ b/fork/react-bootstrap/package.json @@ -19,12 +19,12 @@ "scripts": { "build:lib:esm": "talend-scripts build --esm", "build:lib": "talend-scripts build", - "lint": "eslint -o eslint-report.json --format json .", - "test": "vitest run", + "eslint": "eslint -o eslint-report.json --format json .", + "vitest:run": "vitest run", "storybook": "start-storybook -p 6006", "build-storybook": "build-storybook", - "test:update": "vitest run --update", - "test:cov": "vitest run --coverage" + "vitest:update": "vitest run --update", + "vitest:cov": "vitest run --coverage" }, "files": [ "CHANGELOG.md", @@ -46,28 +46,17 @@ "react-dom": "^18.3.1" }, "devDependencies": { - "@vitejs/plugin-react": "^5.2.0", - "@vitest/coverage-v8": "^4.1.2", - "@talend/eslint-config": "^14.1.2", - "@talend/eslint-plugin": "^1.8.1", - "@talend/scripts-config-typescript": "^12.1.1", - "@talend/scripts-core": "^20.0.0", - "@talend/scripts-config-babel": "^13.10.1", - "@talend/scripts-config-react-webpack": "^17.1.1", "@testing-library/jest-dom": "^6.9.1", "@testing-library/react": "^14.3.1", "@testing-library/user-event": "^14.6.1", "chai": "^4.5.0", "chalk": "^2.4.2", "create-react-class": "^15.7.0", - "cross-env": "^10.1.0", - "eslint": "^10.1.0", "lodash": "^4.18.0", "react": "^18.3.1", "react-dom": "^18.3.1", "react-test-renderer": "^18.3.1", - "sinon": "^11.1.2", - "vitest": "^4.1.2" + "sinon": "^11.1.2" }, "dependencies": { "classnames": "^2.5.1", diff --git a/package.json b/package.json index 66d1efb89b..6e905285b1 100644 --- a/package.json +++ b/package.json @@ -1,45 +1,80 @@ { + "scripts": { + "build": "yarn build:lib && yarn build:lib:esm", + "build:lib": "turbo run build:lib", + "build:lib:esm": "turbo run build:lib:esm", + "clean:build": "rimraf {packages,tools,fork}/*/{lib,lib-esm,dist}", + "clean:demo": "rimraf {packages,tools,fork}/*/.storybook-static", + "start": "yarn workspace @talend/ui-playground run start", + "release": "yarn pre-release && yarn changeset publish", + "lint-staged": "lint-staged", + "eslint:run": "turbo run eslint:run --continue=always", + "stylelint:run": "turbo run stylelint:run --continue=always", + "vitest:run": "cross-env TZ=UTC turbo run vitest:run", + "vitest:cov": "cross-env TZ=UTC turbo run vitest:cov", + "vitest:update": "cross-env TZ=UTC talend-yarn-workspace run vitest:update", + "storybook:build": "turbo run storybook:build", + "storybook:start": "yarn workspace @talend/ui-storybook-one run start", + "storybook:start-components": "yarn workspace @talend/react-components run start", + "storybook:start-containers": "yarn workspace @talend/react-containers run start", + "storybook:start-dataviz": "yarn workspace @talend/react-dataviz run start", + "storybook:start-design-system": "yarn workspace @talend/design-system run start", + "storybook:start-stepper": "yarn workspace @talend/react-stepper run start", + "storybook:start-forms": "yarn workspace @talend/react-forms run start", + "storybook:start-theme": "yarn workspace @talend/bootstrap-theme run start", + "storybook:start-icons": "yarn workspace @talend/icons run start-storybook", + "test:cron": "talend-yarn-workspace run test:cron", + "changelog": "git log --pretty=\"format:%C(bold green)%ad%C(reset) %s\" --date=short --color", + "prepare": "husky install" + }, + "packageManager": "yarn@1.22.22", "devDependencies": { + "@babel/preset-env": "^7.29.2", + "@babel/preset-react": "^7.28.5", + "@babel/preset-typescript": "^7.28.5", + "@babel/core": "^7.29.0", "@changesets/cli": "^2.30.0", + "@talend/eslint-plugin": "^1.8.1", "@talend/eslint-config": "^14.1.2", + "@talend/scripts-core": "^20.0.0", "@talend/scripts-config-babel": "^13.10.1", "@talend/scripts-config-prettier": "^12.7.1", "@talend/scripts-yarn-workspace": "^2.4.1", + "@talend/scripts-config-typescript": "^12.1.1", + "@talend/scripts-config-react-webpack": "^17.1.1", + "@talend/locales-design-system": "^7.15.1", + "@talend/locales-tui-components": "^16.0.1", + "@talend/locales-tui-containers": "^9.1.3", + "@talend/locales-tui-dataviz": "^3.0.1", + "@talend/locales-tui-faceted-search": "^11.3.0", + "@talend/locales-tui-forms": "^15.2.0", + "@talend/scripts-config-storybook-lib": "^6.1.1", + "@talend/scripts-config-stylelint": "^5.0.0", + "@talend/babel-plugin-import-from-index": "^1.13.1", + "@talend/babel-plugin-assets-api": "^1.9.1", + "@talend/dynamic-cdn-webpack-plugin": "^14.5.1", + "@talend/scripts-cmf": "^1.8.1", + "@testing-library/react": "^14.3.1", + "@testing-library/user-event": "^14.6.1", + "@vitejs/plugin-react": "^5.2.0", + "@vitest/coverage-v8": "^4.1.2", "baseline-browser-mapping": "^2.10.13", + "cpx2": "^8.0.0", "cross-env": "^10.1.0", "cross-spawn": "^7.0.6", "eslint": "^10.1.0", + "@eslint/js": "^9.39.4", + "eslint-config-prettier": "^10.1.8", + "eslint-plugin-prettier": "^5.5.5", "husky": "^8.0.3", "i18next-scanner": "^4.6.0", "lint-staged": "^15.5.2", "prettier": "^3.8.1", "rimraf": "^6.1.3", - "typescript": "^5.9.3" - }, - "scripts": { - "postinstall": "talend-yarn-workspace run build:lib && talend-yarn-workspace run build:lib:esm", - "pre-release": "talend-yarn-workspace run pre-release", - "start": "yarn workspace @talend/ui-playground run start", - "start-storybook": "yarn workspace @talend/ui-storybook-one run start", - "release": "yarn pre-release && yarn changeset publish", - "lint-staged": "lint-staged", - "lint": "cross-env WORKSPACE_RUN_FAIL=no-bail talend-yarn-workspace run lint", - "test": "cross-env TZ=UTC talend-yarn-workspace run test", - "test:update": "cross-env TZ=UTC talend-yarn-workspace run test:update", - "test:cov": "cross-env TZ=UTC talend-yarn-workspace run test:cov", - "test:demo": "talend-yarn-workspace run test:demo", - "test:cron": "talend-yarn-workspace run test:cron", - "start-one": "yarn workspace @talend/ui-storybook-one run start", - "start-components": "yarn workspace @talend/react-components run start", - "start-containers": "yarn workspace @talend/react-containers run start", - "start-dataviz": "yarn workspace @talend/react-dataviz run start", - "start-design-system": "yarn workspace @talend/design-system run start", - "start-stepper": "yarn workspace @talend/react-stepper run start", - "start-forms": "yarn workspace @talend/react-forms run start", - "start-theme": "yarn workspace @talend/bootstrap-theme run start", - "start-icons": "yarn workspace @talend/icons run start-storybook", - "changelog": "git log --pretty=\"format:%C(bold green)%ad%C(reset) %s\" --date=short --color", - "prepare": "husky install" + "turbo": "^2.9.5", + "typescript": "^5.9.3", + "vitest": "^4.1.2", + "stylelint": "^17.6.0" }, "resolutions": { "**/ace-builds": "1.10.1", diff --git a/packages/a11y/package.json b/packages/a11y/package.json index bf0d0717c9..18db0a4dc2 100644 --- a/packages/a11y/package.json +++ b/packages/a11y/package.json @@ -15,10 +15,10 @@ "scripts": { "build:lib": "talend-scripts build", "build:lib:esm": "talend-scripts build --esm", - "test": "vitest run", - "lint": "eslint -o eslint-report.json --format json .", - "test:update": "vitest run --update", - "test:cov": "vitest run --coverage" + "vitest:run": "vitest run", + "eslint": "eslint -o eslint-report.json --format json .", + "vitest:update": "vitest run --update", + "vitest:cov": "vitest run --coverage" }, "keywords": [ "react", @@ -37,21 +37,12 @@ "@talend/utils": "^3.7.1" }, "devDependencies": { - "@talend/eslint-config": "^14.1.2", - "@talend/eslint-plugin": "^1.8.1", - "@talend/scripts-core": "^20.0.0", - "@talend/scripts-config-typescript": "^12.1.1", - "@testing-library/react": "^14.3.1", - "@testing-library/user-event": "^14.6.1", "@types/date-fns": "^2.6.3", "@types/react": "^18.3.28", "@types/react-dom": "^18.3.7", - "@vitest/coverage-v8": "^4.1.2", "date-fns": "^3.6.0", - "eslint": "^10.1.0", "react": "^18.3.1", - "react-dom": "^18.3.1", - "vitest": "^4.1.2" + "react-dom": "^18.3.1" }, "peerDependencies": { "react": "^18.3.1", diff --git a/packages/a11y/src/Gesture/withListGesture.tsx b/packages/a11y/src/Gesture/withListGesture.tsx index c7e6a2a548..e1c7eb57ab 100644 --- a/packages/a11y/src/Gesture/withListGesture.tsx +++ b/packages/a11y/src/Gesture/withListGesture.tsx @@ -1,30 +1,30 @@ import { focusOn } from './focus'; -function getAllItems(ref: HTMLElement): NodeList { - const closest = ref.closest('[role="list"]'); +function getAllItems(ref: HTMLElement): HTMLElement[] { + const closest = ref.closest('[role="list"]'); if (!closest) { - return new NodeList(); + return []; } - return closest.querySelectorAll('[role="listitem"]'); + return Array.from(closest.querySelectorAll('[role="listitem"]')); } -function getNextItem(ref: HTMLElement, loop: boolean) { - let nextElement; - let currentFound; - let hasNext; +function getNextItem(ref: HTMLElement, loop: boolean): HTMLElement | null { + let nextElement: HTMLElement | null = null; + let currentFound = false; + let hasNext = false; const nodes = getAllItems(ref); const iterator = nodes.values(); - if (loop && ref === nodes.item(nodes.length - 1)) { - return nodes.item(0); + if (loop && ref === nodes[nodes.length - 1]) { + return nodes[0] ?? null; } do { const { value, done } = iterator.next(); if (currentFound) { - nextElement = value; + nextElement = value ?? null; hasNext = false; } else { currentFound = value === ref; @@ -35,15 +35,15 @@ function getNextItem(ref: HTMLElement, loop: boolean) { return nextElement; } -function getPreviousItem(ref: HTMLElement, loop: boolean) { - let previousElement; - let hasNext; +function getPreviousItem(ref: HTMLElement, loop: boolean): HTMLElement | null { + let previousElement: HTMLElement | null = null; + let hasNext = false; const nodes = getAllItems(ref); const iterator = nodes.values(); - if (loop && ref === nodes.item(0)) { - return nodes.item(nodes.length - 1); + if (loop && ref === nodes[0]) { + return nodes[nodes.length - 1] ?? null; } do { @@ -53,7 +53,7 @@ function getPreviousItem(ref: HTMLElement, loop: boolean) { if (currentFound) { hasNext = false; } else { - previousElement = value; + previousElement = value ?? null; hasNext = !done; } } while (hasNext); diff --git a/packages/a11y/src/Gesture/withTreeGesture.tsx b/packages/a11y/src/Gesture/withTreeGesture.tsx index 9c49ca115a..bb997ef430 100644 --- a/packages/a11y/src/Gesture/withTreeGesture.tsx +++ b/packages/a11y/src/Gesture/withTreeGesture.tsx @@ -3,12 +3,12 @@ import { Component, ComponentType, KeyboardEvent } from 'react'; import { focusOn } from './focus'; -function getAllItems(ref: HTMLElement) { +function getAllItems(ref: HTMLElement): HTMLElement[] { const nodes = ref.closest('ul[role="tree"]'); if (nodes) { - return nodes.querySelectorAll('li[role="treeitem"]'); + return Array.from(nodes.querySelectorAll('li[role="treeitem"]')); } - return null; + return []; } function getFirstItem(ref: HTMLElement): HTMLElement | null { @@ -21,8 +21,8 @@ function getFirstItem(ref: HTMLElement): HTMLElement | null { function getLastItem(ref: HTMLElement): HTMLElement | null { const nodes = getAllItems(ref); - if (nodes && nodes.length > 0) { - return nodes.item(nodes.length - 1) as HTMLElement; + if (nodes.length > 0) { + return nodes[nodes.length - 1]; } return null; } @@ -36,24 +36,21 @@ function getParentItem(ref: HTMLElement): HTMLElement | null { } function getFirstChildItem(ref: HTMLElement): HTMLElement | null { - return ref.querySelector('li[role="treeitem"]'); + return ref.querySelector('li[role="treeitem"]'); } function getNextItem(ref: HTMLElement): HTMLElement | null { let nextElement = null; - let currentFound; - let hasNext; + let currentFound = false; + let hasNext = false; - const nodes = getAllItems(ref)?.values(); - if (!nodes) { - return nextElement; - } + const nodes = getAllItems(ref).values(); do { const { value, done } = nodes.next(); if (currentFound) { - nextElement = value; + nextElement = value ?? null; hasNext = false; } else { currentFound = value === ref; @@ -64,14 +61,11 @@ function getNextItem(ref: HTMLElement): HTMLElement | null { return nextElement; } -function getPreviousItem(ref: HTMLElement) { +function getPreviousItem(ref: HTMLElement): HTMLElement | null { let previousElement = null; - let hasNext; + let hasNext = false; - const nodes = getAllItems(ref)?.values(); - if (!nodes) { - return previousElement; - } + const nodes = getAllItems(ref).values(); do { const { value, done } = nodes.next(); @@ -80,7 +74,7 @@ function getPreviousItem(ref: HTMLElement) { if (currentFound) { hasNext = false; } else { - previousElement = value; + previousElement = value ?? null; hasNext = !done; } } while (hasNext); diff --git a/packages/a11y/tsconfig.build.json b/packages/a11y/tsconfig.build.json new file mode 100644 index 0000000000..7e7e22bc8f --- /dev/null +++ b/packages/a11y/tsconfig.build.json @@ -0,0 +1,4 @@ +{ + "extends": "./tsconfig.json", + "exclude": ["src/**/*.test.*", "src/test-setup.ts", "src/__mocks__/**"] +} diff --git a/packages/a11y/tsconfig.json b/packages/a11y/tsconfig.json index 9379b6fad2..577189f576 100644 --- a/packages/a11y/tsconfig.json +++ b/packages/a11y/tsconfig.json @@ -6,6 +6,7 @@ "allowJs": false, "declaration": true, "target": "ES5", - "module": "CommonJs" + "module": "CommonJs", + "moduleResolution": "node" } } diff --git a/packages/assets-api/package.json b/packages/assets-api/package.json index 41fc6f355b..f83dc546e6 100644 --- a/packages/assets-api/package.json +++ b/packages/assets-api/package.json @@ -14,12 +14,11 @@ "scripts": { "build:lib": "talend-scripts build", "build:lib:esm": "talend-scripts build --esm", - "start": "echo nothing to start", - "test": "vitest run", + "vitest:run": "vitest run", "test:watch": "vitest --watch", - "test:cov": "vitest run --coverage", - "lint": "eslint -o eslint-report.json --format json .", - "test:update": "vitest run --update" + "vitest:cov": "vitest run --coverage", + "eslint": "eslint -o eslint-report.json --format json .", + "vitest:update": "vitest run --update" }, "keywords": [ "talend" @@ -35,17 +34,8 @@ }, "dependencies": {}, "devDependencies": { - "@talend/babel-plugin-import-from-index": "^1.13.1", - "@talend/eslint-config": "^14.1.2", - "@talend/eslint-plugin": "^1.8.1", - "@talend/scripts-core": "^20.0.0", - "@talend/scripts-config-react-webpack": "^17.1.1", - "@talend/scripts-config-typescript": "^12.1.1", "@types/node": "^6.14.13", - "@vitest/coverage-v8": "^4.1.2", - "eslint": "^10.1.0", - "read-pkg-up": "^7.0.1", - "vitest": "^4.1.2" + "read-pkg-up": "^7.0.1" }, "publishConfig": { "access": "public" diff --git a/packages/cmf-cqrs/package.json b/packages/cmf-cqrs/package.json index c62f55d09b..59c5498b38 100644 --- a/packages/cmf-cqrs/package.json +++ b/packages/cmf-cqrs/package.json @@ -17,12 +17,11 @@ "scripts": { "build:lib": "talend-scripts build", "build:lib:esm": "talend-scripts build --esm", - "start": "echo nothing to start", - "test": "vitest run", + "vitest:run": "vitest run", "test:watch": "vitest", - "test:cov": "vitest run --coverage", - "lint": "eslint -o eslint-report.json --format json .", - "test:update": "vitest run --update" + "vitest:cov": "vitest run --coverage", + "eslint": "eslint -o eslint-report.json --format json .", + "vitest:update": "vitest run --update" }, "repository": { "type": "git", @@ -47,22 +46,13 @@ "redux-saga": "^1.4.2" }, "devDependencies": { - "@vitest/coverage-v8": "^4.1.2", - "@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-react-webpack": "^17.1.1", - "@talend/scripts-config-typescript": "^12.1.1", "@testing-library/react": "^14.3.1", "@testing-library/react-hooks": "^8.0.1", - "eslint": "^10.1.0", "mock-socket": "^9.3.1", "prop-types": "^15.8.1", "react": "^18.3.1", "react-dom": "^18.3.1", - "redux-mock-store": "^1.5.5", - "vitest": "^4.1.2" + "redux-mock-store": "^1.5.5" }, "peerDependencies": { "prop-types": "^15.5.10", diff --git a/packages/cmf-router/package.json b/packages/cmf-router/package.json index 8d12569404..8c0dbb2d7c 100644 --- a/packages/cmf-router/package.json +++ b/packages/cmf-router/package.json @@ -19,12 +19,11 @@ "scripts": { "build:lib:esm": "talend-scripts build --esm", "build:lib": "talend-scripts build", - "start": "echo nothing to start", - "test": "vitest run", + "vitest:run": "vitest run", "test:watch": "vitest", - "test:cov": "vitest run --coverage", - "lint": "eslint -o eslint-report.json --format json .", - "test:update": "vitest run --update" + "vitest:cov": "vitest run --coverage", + "eslint": "eslint -o eslint-report.json --format json .", + "vitest:update": "vitest run --update" }, "dependencies": { "@talend/react-cmf": "^12.2.0", @@ -42,19 +41,10 @@ "react-dom": "^18.3.1" }, "devDependencies": { - "@vitest/coverage-v8": "^4.1.2", "@redux-saga/testing-utils": "^1.2.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-react-webpack": "^17.1.1", - "@talend/scripts-config-typescript": "^12.1.1", - "eslint": "^10.1.0", "react": "^18.3.1", "react-dom": "^18.3.1", - "redux-saga-tester": "^1.0.874", - "vitest": "^4.1.2" + "redux-saga-tester": "^1.0.874" }, "publishConfig": { "access": "public" diff --git a/packages/cmf/package.json b/packages/cmf/package.json index dd71200f91..eb77557f87 100644 --- a/packages/cmf/package.json +++ b/packages/cmf/package.json @@ -19,12 +19,11 @@ }, "scripts": { "build:lib": "talend-scripts build && talend-scripts build --esm", - "start": "echo nothing to start", - "test": "vitest run", - "test:update": "vitest run --update", + "vitest:run": "vitest run", + "vitest:update": "vitest run --update", "test:watch": "vitest --watch", - "test:cov": "vitest run --coverage", - "lint": "eslint -o eslint-report.json --format json ." + "vitest:cov": "vitest run --coverage", + "eslint": "eslint -o eslint-report.json --format json ." }, "keywords": [ "react", @@ -61,23 +60,13 @@ "redux-thunk": "^2.4.2" }, "devDependencies": { - "@vitejs/plugin-react": "^5.2.0", - "@vitest/coverage-v8": "^4.1.2", "@redux-saga/testing-utils": "^1.2.1", - "@talend/eslint-config": "^14.1.2", - "@talend/eslint-plugin": "^1.8.1", - "@talend/scripts-config-typescript": "^12.1.1", - "@talend/scripts-core": "^20.0.0", - "@talend/scripts-config-babel": "^13.10.1", - "@talend/scripts-config-react-webpack": "^17.1.1", "@testing-library/react": "^14.3.1", - "eslint": "^10.1.0", "node-fetch": "^2.7.0", "react": "^18.3.1", "react-dom": "^18.3.1", "redux-mock-store": "^1.5.5", - "redux-saga-tester": "^1.0.874", - "vitest": "^4.1.2" + "redux-saga-tester": "^1.0.874" }, "peerDependencies": { "react": "^18.3.1", diff --git a/packages/components/package.json b/packages/components/package.json index 69df8359d0..55fb9b80bc 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -20,13 +20,12 @@ "build:lib:esm": "talend-scripts build --esm", "watch": "talend-scripts build --watch", "tsc": "tsc --emitDeclarationOnly --project ./tsconfig.json --outDir ./types", - "test": "cross-env TZ=UTC vitest run", - "test:update": "cross-env TZ=UTC vitest run --update", + "vitest:run": "cross-env TZ=UTC vitest run", + "vitest:update": "cross-env TZ=UTC vitest run --update", "test:watch": "cross-env TZ=UTC vitest --watch", - "test:cov": "cross-env TZ=UTC vitest run --coverage", - "lint:js": "eslint -o eslint-report.json --format json .", - "lint:css": "stylelint --formatter json -o stylelint-report.json \"**/*.css\"", - "lint": "npm run lint:js && npm run lint:css", + "vitest:cov": "cross-env TZ=UTC vitest run --coverage", + "eslint:run": "eslint -o eslint-report.json --format json .", + "stylelint:run": "stylelint --formatter json -o stylelint-report.json \"**/*.css\"", "start": "storybook dev", "extract-i18n": "i18next-scanner --config i18next-scanner.config.js" }, @@ -80,23 +79,12 @@ "warning": "^3.0.0" }, "devDependencies": { + "@talend/bootstrap-theme": "^10.1.1", + "@talend/design-system": "^12.1.1", "@storybook/addon-a11y": "^10.3.3", "@storybook/addon-links": "^10.3.3", "@storybook/react": "^10.3.3", "@storybook/react-vite": "^10.3.3", - "@vitejs/plugin-react": "^5.2.0", - "@vitest/coverage-v8": "^4.1.2", - "@talend/bootstrap-theme": "^10.1.1", - "@talend/design-system": "^12.1.1", - "@talend/eslint-config": "^14.1.2", - "@talend/eslint-plugin": "^1.8.1", - "@talend/locales-design-system": "^7.15.1", - "@talend/locales-tui-components": "^16.0.1", - "@talend/scripts-config-babel": "^13.10.1", - "@talend/scripts-config-react-webpack": "^17.1.1", - "@talend/scripts-config-stylelint": "^5.0.0", - "@talend/scripts-config-typescript": "^12.1.1", - "@talend/scripts-core": "^20.0.0", "@testing-library/jest-dom": "^6.9.1", "@testing-library/react": "^14.3.1", "@testing-library/react-hooks": "^8.0.1", @@ -107,9 +95,6 @@ "@types/prop-types": "^15.7.15", "@types/react": "^18.3.28", "@types/react-dom": "^18.3.7", - "cross-env": "^10.1.0", - "eslint": "^10.1.0", - "stylelint": "^17.6.0", "i18next": "^23.16.8", "jsdom": "^26.1.0", "prop-types": "^15.8.1", @@ -120,8 +105,7 @@ "react-router-dom": "~6.3.0", "react-test-renderer": "^18.3.1", "esbuild-plugin-react-virtualized": "^1.0.6", - "storybook": "^10.3.3", - "vitest": "^4.1.2" + "storybook": "^10.3.3" }, "peerDependencies": { "@talend/design-system": "^12.0.0", diff --git a/packages/containers/.storybook/cmfModule/actionCreators.js b/packages/containers/.storybook/cmfModule/actionCreators.js index 2680bbb922..c5c1422739 100644 --- a/packages/containers/.storybook/cmfModule/actionCreators.js +++ b/packages/containers/.storybook/cmfModule/actionCreators.js @@ -1,4 +1,5 @@ import { action } from 'storybook/actions'; +import { actions } from '@talend/react-cmf'; export default { 'http:get:photos1': () => diff --git a/packages/containers/package.json b/packages/containers/package.json index 8350f656da..f9f3fc33ba 100644 --- a/packages/containers/package.json +++ b/packages/containers/package.json @@ -19,15 +19,14 @@ "build:lib": "talend-scripts build", "build:lib:esm": "talend-scripts build --esm", "start": "storybook dev -p 6007", - "test": "vitest run", + "vitest:run": "vitest run", "test:watch": "vitest --watch", - "test:cov": "vitest run --coverage", - "test:demo": "storybook build", - "lint:js": "eslint -o eslint-report.json --format json .", - "lint:css": "stylelint --formatter json -o stylelint-report.json \"**/*.css\"", - "lint": "npm run lint:js && npm run lint:css", + "vitest:cov": "vitest run --coverage", + "storybook:build": "storybook build", + "eslint:run": "eslint -o eslint-report.json --format json .", + "stylelint:run": "stylelint --formatter json -o stylelint-report.json \"**/*.css\"", "extract-i18n": "i18next-scanner --config i18next-scanner.config.js", - "test:update": "vitest run --update" + "vitest:update": "vitest run --update" }, "keywords": [ "react", @@ -60,25 +59,10 @@ "reselect": "^2.5.4" }, "devDependencies": { - "@vitejs/plugin-react": "^5.2.0", - "@vitest/coverage-v8": "^4.1.2", "@talend/icons": "^8.0.0", - "@talend/locales-tui-components": "^16.0.1", - "@talend/locales-tui-containers": "^9.1.3", - "@talend/locales-tui-forms": "^15.2.0", - "@talend/locales-design-system": "^7.15.1", "@talend/react-storybook-cmf": "^12.1.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-react-webpack": "^17.1.1", - "@talend/scripts-config-storybook-lib": "^6.1.1", - "@talend/scripts-config-stylelint": "^5.0.0", "@testing-library/react": "^14.3.1", "@testing-library/user-event": "^14.6.1", - "eslint": "^10.1.0", - "stylelint": "^17.6.0", "i18next": "^23.16.8", "msw": "2.12.7", "@storybook/addon-a11y": "^10.3.3", @@ -89,8 +73,7 @@ "react-dom": "^18.3.1", "react-i18next": "^13.5.0", "react-test-renderer": "^18.3.1", - "redux-saga-tester": "^1.0.874", - "vitest": "^4.1.2" + "redux-saga-tester": "^1.0.874" }, "peerDependencies": { "i18next": "^23.16.8", diff --git a/packages/containers/tsconfig.json b/packages/containers/tsconfig.json index 5b10cd0419..ca58c487c2 100644 --- a/packages/containers/tsconfig.json +++ b/packages/containers/tsconfig.json @@ -1,9 +1,9 @@ { "extends": "@talend/scripts-config-typescript/tsconfig.json", - "include": ["custom.d.ts", "src/**/*"], + "include": ["src/**/*"], "exclude": ["node_modules"], "compilerOptions": { - "types": ["jest", "@testing-library/jest-dom"], + "rootDir": "./src", "allowJs": true, "checkJs": false, "declaration": true, diff --git a/packages/dataviz/package.json b/packages/dataviz/package.json index 2b254f42e0..39164a3108 100644 --- a/packages/dataviz/package.json +++ b/packages/dataviz/package.json @@ -17,14 +17,13 @@ "build:lib:esm": "talend-scripts build --esm", "build-storybook": "storybook build", "extract-i18n": "i18next-scanner --config i18next-scanner.config.js", - "lint:js": "eslint -o eslint-report.json --format json .", - "lint:css": "stylelint --formatter json -o stylelint-report.json \"**/*.css\"", - "lint": "npm run lint:js && npm run lint:css", + "eslint:run": "eslint -o eslint-report.json --format json .", + "stylelint:run": "stylelint --formatter json -o stylelint-report.json \"**/*.css\"", "start": "storybook dev -p 6006", - "test": "cross-env TZ=UTC vitest run", - "test:update": "cross-env TZ=UTC vitest run --update", + "vitest:run": "cross-env TZ=UTC vitest run", + "vitest:update": "cross-env TZ=UTC vitest run --update", "test:watch": "cross-env TZ=UTC vitest", - "test:cov": "cross-env TZ=UTC vitest run --coverage --coverage.reporter=json-summary" + "vitest:cov": "cross-env TZ=UTC vitest run --coverage --coverage.reporter=json-summary" }, "keywords": [ "react", @@ -53,22 +52,12 @@ "topojson-client": "^3.1.0" }, "devDependencies": { - "@storybook/addon-a11y": "^10.3.3", - "@storybook/react": "^10.3.3", - "@storybook/react-vite": "^10.3.3", "@talend/design-system": "^12.1.1", - "@talend/eslint-config": "^14.1.2", - "@talend/eslint-plugin": "^1.8.1", "@talend/icons": "^8.0.0", - "@talend/locales-tui-components": "^16.0.1", - "@talend/locales-tui-dataviz": "^3.0.1", "@talend/react-components": "^18.1.1", - "@talend/scripts-config-babel": "^13.10.1", - "@talend/scripts-config-react-webpack": "^17.1.1", - "@talend/scripts-config-storybook-lib": "^6.1.1", - "@talend/scripts-config-stylelint": "^5.0.0", - "@talend/scripts-config-typescript": "^12.1.1", - "@talend/scripts-core": "^20.0.0", + "@storybook/addon-a11y": "^10.3.3", + "@storybook/react": "^10.3.3", + "@storybook/react-vite": "^10.3.3", "@testing-library/jest-dom": "^6.9.1", "@testing-library/react": "^14.3.1", "@testing-library/user-event": "^14.6.1", @@ -80,18 +69,12 @@ "@types/react": "^18.3.28", "@types/topojson-client": "^3.1.5", "@types/topojson-specification": "^1.0.5", - "@vitejs/plugin-react": "^5.2.0", - "@vitest/coverage-v8": "^4.1.2", - "eslint": "^10.1.0", - "stylelint": "^17.6.0", - "cross-env": "^10.1.0", "i18next": "^23.16.8", "jsdom": "^28.1.0", "react": "^18.3.1", "react-dom": "^18.3.1", "react-i18next": "^13.5.0", - "storybook": "^10.3.3", - "vitest": "^4.1.2" + "storybook": "^10.3.3" }, "peerDependencies": { "i18next": "^23.16.8", diff --git a/packages/dataviz/src/setupTests.ts b/packages/dataviz/src/setupTests.ts index 82ef524f41..89d4f65a72 100644 --- a/packages/dataviz/src/setupTests.ts +++ b/packages/dataviz/src/setupTests.ts @@ -16,6 +16,7 @@ i18next.use(initReactI18next).init({ }); // Polyfill ResizeObserver for jsdom +// @ts-ignore global.ResizeObserver = class ResizeObserver { observe() {} unobserve() {} diff --git a/packages/dataviz/tsconfig.json b/packages/dataviz/tsconfig.json index 25302fdb7d..8d67ed8a8f 100755 --- a/packages/dataviz/tsconfig.json +++ b/packages/dataviz/tsconfig.json @@ -5,6 +5,7 @@ "baseUrl": ".", "declaration": true, "module": "CommonJs", + "moduleResolution": "node", "rootDirs": ["src"], "target": "es5", diff --git a/packages/design-docs/package.json b/packages/design-docs/package.json index 89a4749508..633e26e8f4 100644 --- a/packages/design-docs/package.json +++ b/packages/design-docs/package.json @@ -7,11 +7,10 @@ "scripts": { "build-storybook": "storybook build --docs", "start-storybook": "storybook dev -p 6006 --docs", - "lint:js": "eslint -o eslint-report.json --format json .", - "lint:css": "stylelint --formatter json -o stylelint-report.json \"**/*.css\"", - "lint": "npm run lint:js && npm run lint:css", + "eslint:run": "eslint -o eslint-report.json --format json .", + "stylelint:run": "stylelint --formatter json -o stylelint-report.json \"**/*.css\"", "start": "storybook dev -p 6006 --docs", - "test:demo": "storybook build --docs" + "storybook:build": "storybook build --docs" }, "repository": { "type": "git", @@ -42,21 +41,7 @@ "@storybook/addon-links": "^10.3.3", "@storybook/addon-docs": "^10.3.3", "@storybook/react-vite": "^10.3.3", - "@talend/eslint-config": "^14.1.2", - "@talend/eslint-plugin": "^1.8.1", - "@talend/locales-design-system": "^7.15.1", - "@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/scripts-core": "^20.0.0", - "@talend/scripts-config-babel": "^13.10.1", - "@talend/scripts-config-react-webpack": "^17.1.1", - "@talend/scripts-config-stylelint": "^5.0.0", - "@talend/scripts-config-typescript": "^12.1.1", "@types/react": "^18.3.28", - "eslint": "^10.1.0", - "stylelint": "^17.6.0", "i18next": "^23.16.8", "mdx-embed": "^1.1.2", "react": "^18.3.1", diff --git a/packages/design-docs/tsconfig.json b/packages/design-docs/tsconfig.json index 2e361de75b..d3f158fb18 100644 --- a/packages/design-docs/tsconfig.json +++ b/packages/design-docs/tsconfig.json @@ -10,6 +10,7 @@ "compilerOptions": { "baseUrl": ".", "module": "CommonJs", + "moduleResolution": "node", "rootDirs": [".storybook", "src"] } } diff --git a/packages/design-system/package.json b/packages/design-system/package.json index 1fa6ea188f..393e7afe0d 100644 --- a/packages/design-system/package.json +++ b/packages/design-system/package.json @@ -19,13 +19,12 @@ "build:lib": "talend-scripts build && talend-scripts build --esm", "watch": "talend-scripts build --watch", "watch:esm": "talend-scripts build --watch --esm", - "test": "vitest run", - "test:update": "vitest run --update", - "test:cov": "vitest run --coverage", + "vitest:run": "vitest run", + "vitest:update": "vitest run --update", + "vitest:cov": "vitest run --coverage", "extract-i18n": "i18next-scanner --config i18next-scanner.config.js", - "lint:js": "eslint -o eslint-report.json --format json .", - "lint:css": "stylelint --formatter json -o stylelint-report.json \"**/*.css\"", - "lint": "npm run lint:js && npm run lint:css", + "eslint:run": "eslint -o eslint-report.json --format json .", + "stylelint:run": "stylelint --formatter json -o stylelint-report.json \"**/*.css\"", "start": "storybook dev" }, "repository": { @@ -57,20 +56,12 @@ "typeface-source-sans-pro": "^1.1.13" }, "devDependencies": { + "@talend/icons": "^8.0.0", + "@talend/storybook-docs": "^3.1.1", "@storybook/addon-a11y": "^10.3.3", "@storybook/addon-links": "^10.3.3", "@storybook/react": "^10.3.3", "@svgr/webpack": "^8.1.0", - "@talend/eslint-config": "^14.1.2", - "@talend/eslint-plugin": "^1.8.1", - "@talend/icons": "^8.0.0", - "@talend/locales-design-system": "^7.15.1", - "@talend/scripts-config-babel": "^13.10.1", - "@talend/scripts-config-react-webpack": "^17.1.1", - "@talend/scripts-config-typescript": "^12.1.1", - "@talend/scripts-config-stylelint": "^5.0.0", - "@talend/scripts-core": "^20.0.0", - "@talend/storybook-docs": "^3.1.1", "@testing-library/jest-dom": "^6.9.1", "@types/classnames": "^2.3.4", "@types/jest-axe": "^3.5.9", @@ -79,10 +70,7 @@ "@types/react-is": "^18.3.1", "@types/react-transition-group": "^2.9.2", "@types/react-virtualized": "^9.22.3", - "@vitejs/plugin-react": "^5.2.0", - "@vitest/coverage-v8": "^4.1.2", "concurrently": "^8.2.2", - "eslint": "^10.1.0", "focus-outline-manager": "^1.0.2", "i18next": "^23.16.8", "i18next-scanner": "^4.6.0", @@ -96,9 +84,7 @@ "react-hook-form": "^7.72.0", "react-i18next": "^13.5.0", "react-router-dom": "~6.3.0", - "stylelint": "^17.6.0", - "storybook": "^10.3.3", - "vitest": "^4.1.2" + "storybook": "^10.3.3" }, "peerDependencies": { "@talend/icons": "^8.0.0", diff --git a/packages/design-system/src/components/Badge/Badge.tsx b/packages/design-system/src/components/Badge/Badge.tsx index 85ccccaf04..534e207492 100644 --- a/packages/design-system/src/components/Badge/Badge.tsx +++ b/packages/design-system/src/components/Badge/Badge.tsx @@ -1,4 +1,4 @@ -import { forwardRef, Ref } from 'react'; +import { forwardRef } from 'react'; import { BadgeVariantType } from './primitive/BadgePrimitive'; import BadgeDropdown, { BadgeDropdownProps } from './variants/BadgeDropdown'; import BadgePopover, { BadgePopoverProps } from './variants/BadgePopover'; @@ -12,7 +12,7 @@ type BadgePopoverType = BadgeVariantType<'popover', BadgePopoverProps>; export type BadgeProps = BadgeValueType | BadgeTagType | BadgeDropdownType | BadgePopoverType; -export const Badge = forwardRef((props: BadgeProps, ref: Ref) => { +export const Badge = forwardRef((props, ref) => { switch (props.variant) { case 'badge': { const { variant, ...rest } = props; diff --git a/packages/design-system/src/components/Badge/primitive/BadgePrimitive.tsx b/packages/design-system/src/components/Badge/primitive/BadgePrimitive.tsx index 062b1a40b2..13777558b4 100644 --- a/packages/design-system/src/components/Badge/primitive/BadgePrimitive.tsx +++ b/packages/design-system/src/components/Badge/primitive/BadgePrimitive.tsx @@ -1,4 +1,4 @@ -import { Children, PropsWithChildren, Ref } from 'react'; +import { Children, forwardRef, PropsWithChildren } from 'react'; import classnames from 'classnames'; import { DataAttributes } from 'src/types'; @@ -58,49 +58,54 @@ function BadgeDivider() { export type BadgePrimitiveProps = { label: string; onClose?: () => void; - ref: Ref; semanticIcon?: SemanticIcon; } & Partial; -function BadgePrimitive({ - children, - 'data-testid': dataTestId, - 'data-test': dataTest, - label, - onClose, - ref, - semanticIcon = 'none', -}: PropsWithChildren) { - // TODO BADGE - handle onClose to manage close button - - // TODO BADGE - handle semanticIcon to display semantic icon - - // TODO BADGE - implement withOperator props - - const defaultTestId = 'badge-label'; - - return ( - - - >( + ( + { + children, + 'data-testid': dataTestId, + 'data-test': dataTest, + label, + onClose, + semanticIcon = 'none', + }, + ref, + ) => { + // TODO BADGE - handle onClose to manage close button + + // TODO BADGE - handle semanticIcon to display semantic icon + + // TODO BADGE - implement withOperator props + + const defaultTestId = 'badge-label'; + + return ( + + - {label} - - - {Children.count(children) > 0 && } - - {children} - - - ); -} + + {label} + + + {Children.count(children) > 0 && } + + {children} + + + ); + }, +); + +BadgePrimitive.displayName = 'BadgePrimitive'; export default BadgePrimitive; diff --git a/packages/design-system/src/components/Badge/variants/BadgeDropdown.tsx b/packages/design-system/src/components/Badge/variants/BadgeDropdown.tsx index fe988cb4e7..31bf9652e7 100644 --- a/packages/design-system/src/components/Badge/variants/BadgeDropdown.tsx +++ b/packages/design-system/src/components/Badge/variants/BadgeDropdown.tsx @@ -82,7 +82,7 @@ export type BadgeDropdownProps = Omit & value: BadgeDropdownItem[]; }; -const BadgeDropdown = forwardRef((props: BadgeDropdownProps, ref: Ref) => { +const BadgeDropdown = forwardRef((props, ref) => { const { onChange, selectedId, diff --git a/packages/design-system/src/components/Badge/variants/BadgePopover.tsx b/packages/design-system/src/components/Badge/variants/BadgePopover.tsx index a97a7d2aa5..f7aadf791c 100644 --- a/packages/design-system/src/components/Badge/variants/BadgePopover.tsx +++ b/packages/design-system/src/components/Badge/variants/BadgePopover.tsx @@ -1,4 +1,4 @@ -import { forwardRef, Fragment, PropsWithChildren, Ref, useState } from 'react'; +import { forwardRef, Fragment, PropsWithChildren, useState } from 'react'; import { Divider } from '../../Divider'; import { Popover } from '../../Popover'; @@ -15,7 +15,7 @@ export type BadgePopoverProps = PropsWithChildren< } >; -const BadgePopover = forwardRef((props: BadgePopoverProps, ref: Ref) => { +const BadgePopover = forwardRef((props, ref) => { const { children, value } = props; const [showPopover, setShowPopover] = useState(false); diff --git a/packages/design-system/src/components/Badge/variants/BadgeTag.tsx b/packages/design-system/src/components/Badge/variants/BadgeTag.tsx index ca34d8e8bc..619823bd82 100644 --- a/packages/design-system/src/components/Badge/variants/BadgeTag.tsx +++ b/packages/design-system/src/components/Badge/variants/BadgeTag.tsx @@ -1,9 +1,9 @@ -import { forwardRef, Ref } from 'react'; +import { forwardRef } from 'react'; import BadgePrimitive, { BadgePrimitiveProps } from '../primitive/BadgePrimitive'; export type BadgeTagProps = Omit; -const BadgeTag = forwardRef((props: BadgeTagProps, ref: Ref) => { +const BadgeTag = forwardRef((props, ref) => { return ; }); diff --git a/packages/design-system/src/components/Badge/variants/BadgeValue.tsx b/packages/design-system/src/components/Badge/variants/BadgeValue.tsx index d79eb87e56..ce49f38c26 100644 --- a/packages/design-system/src/components/Badge/variants/BadgeValue.tsx +++ b/packages/design-system/src/components/Badge/variants/BadgeValue.tsx @@ -1,4 +1,4 @@ -import { forwardRef, Fragment, Ref } from 'react'; +import { forwardRef, Fragment } from 'react'; import classnames from 'classnames'; @@ -15,7 +15,7 @@ export type BadgeValueProps = BadgePrimitiveProps & { value: string[]; }; -const BadgeValue = forwardRef((props: BadgeValueProps, ref: Ref) => { +const BadgeValue = forwardRef((props, ref) => { const { value } = props; return ( diff --git a/packages/design-system/src/components/Form/Affix/variations/AffixReadOnly.tsx b/packages/design-system/src/components/Form/Affix/variations/AffixReadOnly.tsx index 1d4a1f919a..0793df848e 100644 --- a/packages/design-system/src/components/Form/Affix/variations/AffixReadOnly.tsx +++ b/packages/design-system/src/components/Form/Affix/variations/AffixReadOnly.tsx @@ -1,6 +1,6 @@ import { forwardRef, HTMLAttributes, Ref } from 'react'; import classnames from 'classnames'; -import { IconNameWithSize } from '@talend/icons'; +import type { IconNameWithSize } from '@talend/icons/dist/typeUtils'; import { DeprecatedIconNames } from '../../../../types'; import { StackHorizontal } from '../../../Stack'; diff --git a/packages/design-system/src/components/Loading/Loading.tsx b/packages/design-system/src/components/Loading/Loading.tsx index e7e858322a..d8f5eea0fe 100644 --- a/packages/design-system/src/components/Loading/Loading.tsx +++ b/packages/design-system/src/components/Loading/Loading.tsx @@ -1,17 +1,19 @@ import { forwardRef, HTMLAttributes } from 'react'; -import { IconSize } from '@talend/icons'; +import type { IconSize } from '@talend/icons/dist/typeUtils'; declare type LoadingIconSize = IconSize | 'XL' | 'XXL'; +const sizeMap: Record = { + XS: '0.5rem', + S: '0.75rem', + M: '1rem', + L: '1.5rem', + XL: '2.5rem', + XXL: '4rem', +}; + const getNumericSize = (size: LoadingIconSize) => { - return { - XS: '0.5rem', - S: '0.75rem', - M: '1rem', - L: '1.5rem', - XL: '2.5rem', - XXL: '4rem', - }[size]; + return sizeMap[size]; }; export type LoadingProps = HTMLAttributes & { size?: LoadingIconSize }; diff --git a/packages/design-system/src/components/Tabs/Primitive/Tabs.tsx b/packages/design-system/src/components/Tabs/Primitive/Tabs.tsx index 5aec9010e8..e5ccca299f 100644 --- a/packages/design-system/src/components/Tabs/Primitive/Tabs.tsx +++ b/packages/design-system/src/components/Tabs/Primitive/Tabs.tsx @@ -2,7 +2,7 @@ import { useContext } from 'react'; import classNames from 'classnames'; -import { IconNameWithSize } from '@talend/icons'; +import type { IconNameWithSize } from '@talend/icons/dist/typeUtils'; import { SizedIcon } from '../../Icon'; import { StackHorizontal } from '../../Stack'; diff --git a/packages/design-system/tsconfig.json b/packages/design-system/tsconfig.json index 9688834435..7a5f7247ce 100644 --- a/packages/design-system/tsconfig.json +++ b/packages/design-system/tsconfig.json @@ -6,6 +6,7 @@ "baseUrl": ".", "paths": {}, "module": "CommonJs", + "moduleResolution": "node", "rootDirs": ["src"], "types": ["vitest/globals"] } diff --git a/packages/design-tokens/package.json b/packages/design-tokens/package.json index 6a3c074a90..8f0b60d0a2 100644 --- a/packages/design-tokens/package.json +++ b/packages/design-tokens/package.json @@ -31,7 +31,7 @@ "build:lib": "talend-scripts build && npm run build:css", "build:lib:esm": "talend-scripts build --esm", "build:css": "sass src/index.scss dist/TalendDesignTokens.css --no-source-map --style=compressed", - "lint": "eslint -o eslint-report.json --format json ." + "eslint": "eslint -o eslint-report.json --format json ." }, "keywords": [ "talend", @@ -53,14 +53,6 @@ }, "devDependencies": { "sass": "^1.98.0", - "@talend/eslint-config": "^14.1.2", - "@talend/eslint-plugin": "^1.8.1", - "@talend/scripts-core": "^20.0.0", - "@talend/scripts-config-react-webpack": "^17.1.1", - "@talend/scripts-config-typescript": "^12.1.1", - "@talend/babel-plugin-import-from-index": "^1.13.1", - "@talend/babel-plugin-assets-api": "^1.9.1", - "eslint": "^10.1.0", "typeface-source-sans-pro": "^1.1.13", "webpack": "^5.105.4" }, diff --git a/packages/faceted-search-query-client/package.json b/packages/faceted-search-query-client/package.json index c1d7961e60..08cdb8f7cd 100644 --- a/packages/faceted-search-query-client/package.json +++ b/packages/faceted-search-query-client/package.json @@ -18,12 +18,12 @@ "scripts": { "build:lib": "talend-scripts build", "build:lib:esm": "talend-scripts build --esm", - "test": "vitest run", + "vitest:run": "vitest run", "test:watch": "vitest --watch", - "test:cov": "vitest run --coverage", - "lint": "eslint -o eslint-report.json --format json .", + "vitest:cov": "vitest run --coverage", + "eslint": "eslint -o eslint-report.json --format json .", "extract-i18n": "i18next-scanner --config i18next-scanner.config.js", - "test:update": "vitest run --update" + "vitest:update": "vitest run --update" }, "keywords": [ "react", @@ -45,20 +45,9 @@ "@talend/daikon-tql-client": "^1.3.1", "lodash": "^4.18.0" }, - "devDependencies": { - "@talend/eslint-config": "^14.1.2", - "@talend/eslint-plugin": "^1.8.1", - "@talend/react-faceted-search": "22.1.1", - "@talend/scripts-core": "^20.0.0", - "@talend/scripts-config-babel": "^13.10.1", - "@talend/scripts-config-react-webpack": "^17.1.1", - "@talend/scripts-config-typescript": "^12.1.1", - "@vitest/coverage-v8": "^4.1.2", - "eslint": "^10.1.0", - "vitest": "^4.1.2" - }, + "devDependencies": {}, "peerDependencies": { - "@talend/react-faceted-search": "^22.0.0" + "@talend/react-faceted-search": "22.1.1" }, "publishConfig": { "access": "public" diff --git a/packages/faceted-search/package.json b/packages/faceted-search/package.json index 6c250bd5f8..fd77341160 100644 --- a/packages/faceted-search/package.json +++ b/packages/faceted-search/package.json @@ -18,16 +18,15 @@ "scripts": { "build:lib": "talend-scripts build", "build:lib:esm": "talend-scripts build --esm", - "test": "vitest run", + "vitest:run": "vitest run", "test:watch": "vitest --watch", - "test:cov": "vitest run --coverage", - "test:demo": "storybook build --docs", - "lint:js": "eslint -o eslint-report.json --format json .", - "lint:css": "stylelint --formatter json -o stylelint-report.json \"**/*.css\"", - "lint": "npm run lint:js && npm run lint:css", + "vitest:cov": "vitest run --coverage", + "storybook:build": "storybook build --docs", + "eslint:run": "eslint -o eslint-report.json --format json .", + "stylelint:run": "stylelint --formatter json -o stylelint-report.json \"**/*.css\"", "start": "storybook dev -p 6006", "extract-i18n": "i18next-scanner --config i18next-scanner.config.js", - "test:update": "vitest run --update" + "vitest:update": "vitest run --update" }, "keywords": [ "react", @@ -53,36 +52,19 @@ "lodash": "^4.18.0" }, "devDependencies": { - "@vitejs/plugin-react": "^5.2.0", - "@vitest/coverage-v8": "^4.1.2", "@storybook/react": "^10.3.3", "@storybook/react-vite": "^10.3.3", "@storybook/addon-a11y": "^10.3.3", - "@talend/design-system": "^12.1.1", - "@talend/eslint-config": "^14.1.2", - "@talend/eslint-plugin": "^1.8.1", - "@talend/icons": "^8.0.0", - "@talend/scripts-config-storybook-lib": "^6.1.1", - "@talend/locales-tui-components": "^16.0.1", - "@talend/locales-tui-faceted-search": "^11.3.0", - "@talend/scripts-core": "^20.0.0", - "@talend/scripts-config-babel": "^13.10.1", - "@talend/scripts-config-react-webpack": "^17.1.1", - "@talend/scripts-config-stylelint": "^5.0.0", - "@talend/scripts-config-typescript": "^12.1.1", "@testing-library/react": "^14.3.1", "@testing-library/user-event": "^14.6.1", - "babel-plugin-angularjs-annotate": "^0.10.0", - "cross-env": "^10.1.0", - "eslint": "^10.1.0", - "stylelint": "^17.6.0", + "@talend/design-system": "^12.1.1", + "@talend/icons": "^8.0.0", "i18next": "^23.16.8", "storybook": "^10.3.3", "prop-types": "^15.8.1", "react": "^18.3.1", "react-dom": "^18.3.1", - "react-i18next": "^13.5.0", - "vitest": "^4.1.2" + "react-i18next": "^13.5.0" }, "peerDependencies": { "@talend/design-system": "^12.0.0", diff --git a/packages/flow-designer/package.json b/packages/flow-designer/package.json index f86f28c772..0eb51d01a2 100644 --- a/packages/flow-designer/package.json +++ b/packages/flow-designer/package.json @@ -18,10 +18,10 @@ "scripts": { "build:lib": "talend-scripts build", "build:lib:esm": "talend-scripts build --esm", - "lint": "eslint -o eslint-report.json --format json .", - "test": "vitest run", - "test:update": "vitest run --update", - "test:cov": "vitest run --coverage" + "eslint": "eslint -o eslint-report.json --format json .", + "vitest:run": "vitest run", + "vitest:update": "vitest run --update", + "vitest:cov": "vitest run --coverage" }, "repository": { "type": "git", @@ -30,15 +30,6 @@ "author": "Talend ", "license": "Apache-2.0", "devDependencies": { - "@vitejs/plugin-react": "^5.2.0", - "@vitest/coverage-v8": "^4.1.2", - "@talend/babel-plugin-import-from-index": "^1.13.1", - "@talend/babel-plugin-assets-api": "^1.9.1", - "@talend/eslint-config": "^14.1.2", - "@talend/eslint-plugin": "^1.8.1", - "@talend/scripts-core": "^20.0.0", - "@talend/scripts-config-typescript": "^12.1.1", - "@talend/scripts-config-react-webpack": "^17.1.1", "@testing-library/react": "^14.3.1", "@testing-library/jest-dom": "^6.9.1", "@types/d3": "^7.4.3", @@ -51,7 +42,6 @@ "@types/react-test-renderer": "^18.3.1", "@types/redux-mock-store": "^1.5.0", "@types/redux-thunk": "^2.1.0", - "eslint": "^10.1.0", "i18next": "^23.16.8", "immutable": "^3.8.3", "lodash": "^4.18.0", @@ -64,8 +54,7 @@ "redux": "^4.2.1", "redux-mock-store": "^1.5.5", "redux-thunk": "^2.4.2", - "reselect": "^4.1.8", - "vitest": "^4.1.2" + "reselect": "^4.1.8" }, "peerDependencies": { "immutable": "^3.8.3", diff --git a/packages/flow-designer/tsconfig.build.json b/packages/flow-designer/tsconfig.build.json new file mode 100644 index 0000000000..a8c5294268 --- /dev/null +++ b/packages/flow-designer/tsconfig.build.json @@ -0,0 +1,4 @@ +{ + "extends": "./tsconfig.json", + "exclude": ["src/**/*.test.*", "src/**/*.stories.*"] +} diff --git a/packages/flow-designer/tsconfig.json b/packages/flow-designer/tsconfig.json index 8eaf460e3d..0988b9076c 100644 --- a/packages/flow-designer/tsconfig.json +++ b/packages/flow-designer/tsconfig.json @@ -6,6 +6,7 @@ "declaration": true, "allowJs": false, "incremental": true, - "module": "CommonJs" + "module": "CommonJs", + "moduleResolution": "node" } } diff --git a/packages/forms/package.json b/packages/forms/package.json index ac1d83cf7a..5da020935e 100644 --- a/packages/forms/package.json +++ b/packages/forms/package.json @@ -19,15 +19,14 @@ "build:lib:esm": "talend-scripts build --esm", "build-storybook": "storybook build", "build:lib": "talend-scripts build", - "test": "cross-env TZ=UTC vitest run", + "vitest:run": "cross-env TZ=UTC vitest run", "test:watch": "cross-env TZ=UTC vitest", - "test:cov": "cross-env TZ=UTC vitest run --coverage", - "lint:js": "eslint -o eslint-report.json --format json .", - "lint:css": "stylelint --formatter json -o stylelint-report.json \"**/*.css\"", - "lint": "npm run lint:js && npm run lint:css", + "vitest:cov": "cross-env TZ=UTC vitest run --coverage", + "eslint:run": "eslint -o eslint-report.json --format json .", + "stylelint:run": "stylelint --formatter json -o stylelint-report.json \"**/*.css\"", "start": "talend-scripts start-storybook -p 6008", "extract-i18n": "i18next-scanner --config i18next-scanner.config.js", - "test:update": "cross-env TZ=UTC vitest run --update" + "vitest:update": "cross-env TZ=UTC vitest run --update" }, "keywords": [ "react", @@ -66,23 +65,11 @@ "tv4": "^1.3.0" }, "devDependencies": { - "@vitejs/plugin-react": "^5.2.0", - "@vitest/coverage-v8": "^4.1.2", - "@talend/locales-tui-forms": "^15.2.0", + "@talend/design-system": "^12.1.1", "@talend/react-components": "^18.1.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-react-webpack": "^17.1.1", - "@talend/scripts-config-storybook-lib": "^6.1.1", - "@talend/scripts-config-stylelint": "^5.0.0", - "@talend/scripts-config-typescript": "^12.1.1", "@testing-library/jest-dom": "^6.9.1", "@testing-library/react": "^14.3.1", "@testing-library/user-event": "^14.6.1", - "eslint": "^10.1.0", - "stylelint": "^17.6.0", "i18next": "^23.16.8", "i18next-scanner-typescript": "^1.2.1", "json-loader": "^0.5.7", @@ -92,8 +79,7 @@ "react-dom": "^18.3.1", "react-virtualized": "^9.22.6", "react-i18next": "^13.5.0", - "react-test-renderer": "^18.3.1", - "vitest": "^4.1.2" + "react-test-renderer": "^18.3.1" }, "peerDependencies": { "i18next": "^23.16.8", diff --git a/packages/forms/src/UIForm/UIForm.container.jsx b/packages/forms/src/UIForm/UIForm.container.jsx index 4b8e4f56a2..7d63abe05e 100644 --- a/packages/forms/src/UIForm/UIForm.container.jsx +++ b/packages/forms/src/UIForm/UIForm.container.jsx @@ -81,13 +81,17 @@ const setInitialStateAsLiveState = prevState => ({ liveState: prevState.initialState, }); -export default class UIForm extends Component { +/** @type {any} */ +const UIForm = class UIForm extends Component { static displayName = 'Container(UIForm)'; + /** @type {any} */ static FormTemplate = FormTemplate; + /** @type {any} */ static TextModeTemplate = TextModeTemplate; + /** @type {any} */ static FieldTemplate = FieldTemplate; static Message = Message; @@ -231,7 +235,9 @@ export default class UIForm extends Component { ); } -} +}; + +export default UIForm; if (process.env.NODE_ENV !== 'production') { UIForm.propTypes = { diff --git a/packages/forms/src/UIForm/fields/Datalist/Datalist.component.jsx b/packages/forms/src/UIForm/fields/Datalist/Datalist.component.jsx index a6b995a978..af27dfeee3 100644 --- a/packages/forms/src/UIForm/fields/Datalist/Datalist.component.jsx +++ b/packages/forms/src/UIForm/fields/Datalist/Datalist.component.jsx @@ -316,4 +316,6 @@ if (process.env.NODE_ENV !== 'production') { }; } -export default withTranslation(I18N_DOMAIN_FORMS)(Datalist); +const I18NDatalist = /** @type {typeof Datalist} */ (withTranslation(I18N_DOMAIN_FORMS)(Datalist)); + +export default I18NDatalist; diff --git a/packages/forms/src/UIForm/fields/Datalist/displayMode/TextMode.component.jsx b/packages/forms/src/UIForm/fields/Datalist/displayMode/TextMode.component.jsx index b892ec6034..5bcf320580 100644 --- a/packages/forms/src/UIForm/fields/Datalist/displayMode/TextMode.component.jsx +++ b/packages/forms/src/UIForm/fields/Datalist/displayMode/TextMode.component.jsx @@ -99,4 +99,6 @@ TextMode.defaultProps = { t: getDefaultT(), }; -export default withTranslation(I18N_DOMAIN_FORMS)(TextMode); +const I18NTextMode = /** @type {typeof TextMode} */ (withTranslation(I18N_DOMAIN_FORMS)(TextMode)); + +export default I18NTextMode; diff --git a/packages/forms/src/UIForm/fields/Enumeration/EnumerationWidget.jsx b/packages/forms/src/UIForm/fields/Enumeration/EnumerationWidget.jsx index 3e26c7cba5..f6a5273df1 100644 --- a/packages/forms/src/UIForm/fields/Enumeration/EnumerationWidget.jsx +++ b/packages/forms/src/UIForm/fields/Enumeration/EnumerationWidget.jsx @@ -1083,4 +1083,8 @@ EnumerationForm.defaultProps = { }; export { EnumerationForm }; -export default withTranslation(I18N_DOMAIN_FORMS)(EnumerationForm); +const I18NEnumerationForm = /** @type {typeof EnumerationForm} */ ( + withTranslation(I18N_DOMAIN_FORMS)(EnumerationForm) +); + +export default I18NEnumerationForm; diff --git a/packages/forms/src/UIForm/fields/File/File.component.jsx b/packages/forms/src/UIForm/fields/File/File.component.jsx index 45d45058f5..97d6bee122 100644 --- a/packages/forms/src/UIForm/fields/File/File.component.jsx +++ b/packages/forms/src/UIForm/fields/File/File.component.jsx @@ -203,4 +203,8 @@ FileWidget.defaultProps = { export { FileWidget, base64Decode, getFileName }; -export default withTranslation(I18N_DOMAIN_FORMS)(FileWidget); +const I18NFileWidget = /** @type {typeof FileWidget} */ ( + withTranslation(I18N_DOMAIN_FORMS)(FileWidget) +); + +export default I18NFileWidget; diff --git a/packages/forms/src/UIForm/fields/ListView/ListView.component.jsx b/packages/forms/src/UIForm/fields/ListView/ListView.component.jsx index 16d9959266..88e3985a66 100644 --- a/packages/forms/src/UIForm/fields/ListView/ListView.component.jsx +++ b/packages/forms/src/UIForm/fields/ListView/ListView.component.jsx @@ -238,4 +238,8 @@ if (process.env.NODE_ENV !== 'production') { export { ListViewWidget }; -export default withTranslation(I18N_DOMAIN_FORMS)(ListViewWidget); +const I18NListViewWidget = /** @type {typeof ListViewWidget} */ ( + withTranslation(I18N_DOMAIN_FORMS)(ListViewWidget) +); + +export default I18NListViewWidget; diff --git a/packages/forms/src/UIForm/fields/NestedListView/NestedListView.component.jsx b/packages/forms/src/UIForm/fields/NestedListView/NestedListView.component.jsx index 85632863ab..0c0b8d625a 100644 --- a/packages/forms/src/UIForm/fields/NestedListView/NestedListView.component.jsx +++ b/packages/forms/src/UIForm/fields/NestedListView/NestedListView.component.jsx @@ -289,4 +289,8 @@ if (process.env.NODE_ENV !== 'production') { export { NestedListViewWidget }; -export default withTranslation(I18N_DOMAIN_FORMS)(NestedListViewWidget); +const I18NNestedListViewWidget = /** @type {typeof NestedListViewWidget} */ ( + withTranslation(I18N_DOMAIN_FORMS)(NestedListViewWidget) +); + +export default I18NNestedListViewWidget; diff --git a/packages/http/package.json b/packages/http/package.json index e76a2535c8..9c7bc4433d 100644 --- a/packages/http/package.json +++ b/packages/http/package.json @@ -30,26 +30,16 @@ "scripts": { "build:lib": "talend-scripts build", "build:lib:esm": "talend-scripts build --esm", - "start": "echo nothing to start", - "test": "vitest run", - "lint": "eslint -o eslint-report.json --format json .", - "test:update": "vitest run --update", - "test:cov": "vitest run --coverage" + "vitest:run": "vitest run", + "eslint": "eslint -o eslint-report.json --format json .", + "vitest:update": "vitest run --update", + "vitest:cov": "vitest run --coverage" }, "devDependencies": { - "@vitest/coverage-v8": "^4.1.2", - "@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-react-webpack": "^17.1.1", - "@talend/scripts-config-typescript": "^12.1.1", "@types/node-fetch": "^2.6.13", - "eslint": "^10.1.0", "node-fetch": "^2.7.0", "react-dom": "^18.3.1", - "react": "^18.3.1", - "vitest": "^4.1.2" + "react": "^18.3.1" }, "jest": { "collectCoverageFrom": [ diff --git a/packages/http/tsconfig.build.json b/packages/http/tsconfig.build.json new file mode 100644 index 0000000000..f281e3a1f4 --- /dev/null +++ b/packages/http/tsconfig.build.json @@ -0,0 +1,4 @@ +{ + "extends": "./tsconfig.json", + "exclude": ["src/**/*.test.*", "src/test-setup.ts"] +} diff --git a/packages/http/tsconfig.json b/packages/http/tsconfig.json index 845fe55cb5..6a6cf25869 100644 --- a/packages/http/tsconfig.json +++ b/packages/http/tsconfig.json @@ -6,6 +6,7 @@ "declaration": true, "target": "ES5", "module": "CommonJs", + "moduleResolution": "node", "types": ["jest"] } } diff --git a/packages/icons/package.json b/packages/icons/package.json index a273c0b089..bda5e46865 100644 --- a/packages/icons/package.json +++ b/packages/icons/package.json @@ -34,11 +34,8 @@ "build:webfont": "node scripts/build-webfont.mjs", "build:types": "tsc --emitDeclarationOnly", "type-check": "tsc --noEmit", - "test": "echo no test", - "test:cov": "echo no test", "start": "storybook dev -p 6010", "build-storybook": "storybook build", - "lint": "echo nothing to lint", "svgo": "svgo -rf src/svg --config svgo-icons.config.mjs && svgo -rf src/filters --config svgo-filters.config.mjs" }, "files": [ @@ -61,9 +58,6 @@ }, "devDependencies": { "@talend/design-tokens": "^4.1.1", - "@talend/eslint-config": "^14.1.2", - "@talend/eslint-plugin": "^1.8.1", - "@talend/scripts-config-typescript": "^12.1.1", "@types/node": "^20.19.37", "fantasticon": "^4.1.0", "mkdirp": "^1.0.4", @@ -71,7 +65,6 @@ "react": "^18.3.1", "storybook": "^10.3.3", "svgo": "^3.3.3", - "typescript": "^5.9.3", "vite": "^7.3.1" }, "publishConfig": { diff --git a/packages/icons/stories/Icon.tsx b/packages/icons/stories/Icon.tsx index 2ea5f7f8c6..b224baa50b 100644 --- a/packages/icons/stories/Icon.tsx +++ b/packages/icons/stories/Icon.tsx @@ -2,17 +2,15 @@ import { createContext, useContext, useState } from 'react'; import type { ChangeEvent, PropsWithChildren } from 'react'; import { useCopyToClipboard } from 'react-use'; -import tokens from '@talend/design-tokens'; - import { infoFromFigma as icons } from '../dist/info'; import metadata from '../src/metadata.json'; const iconColorTokens = { - 'neutral/icon': tokens.coralColorNeutralIcon, - 'accent/icon': tokens.coralColorAccentIcon, - 'warning/icon': tokens.coralColorWarningIcon, - 'danger/icon': tokens.coralColorDangerIcon, - 'beta/icon': tokens.coralColorBetaIcon, + 'neutral/icon': 'var(--coral-color-neutral-icon)', + 'accent/icon': 'var(--coral-color-accent-icon)', + 'warning/icon': 'var(--coral-color-warning-icon)', + 'danger/icon': 'var(--coral-color-danger-icon)', + 'beta/icon': 'var(--coral-color-beta-icon)', }; export const iconSizes = { @@ -186,7 +184,7 @@ export const Grid = ({ }; const IconList = (props: PropsWithChildren) => ( -
+
); export const IconGallery = ({ children }: PropsWithChildren) => { @@ -252,9 +250,9 @@ export const IconItem = ({ const iconMetadata = metadata.find(data => data.name.endsWith(size + '/' + name)); const isFound = size ? iconMetadata && - Object.values(iconMetadata).some(property => + Object.values(iconMetadata).some(property => property.toString().toLocaleLowerCase().includes(searchContext.query), - ) + ) : true; return (
@@ -262,8 +260,8 @@ export const IconItem = ({
@@ -288,7 +286,7 @@ export const IconItem = ({ tabIndex={0} style={{ flex: 1, - font: tokens.coralParagraphM, + font: 'var(--coral-paragraph-m)', }} > {size ? ( @@ -310,8 +308,8 @@ export const IconItem = ({ 'description' in iconMetadata && iconMetadata.description.length > 0 && ( <> -
Desc
-
+
Desc
+
{iconMetadata.description}
diff --git a/packages/local-libs-webpack-plugin/package.json b/packages/local-libs-webpack-plugin/package.json index 707f37fefe..16421fdbb3 100644 --- a/packages/local-libs-webpack-plugin/package.json +++ b/packages/local-libs-webpack-plugin/package.json @@ -2,13 +2,13 @@ "name": "@talend/local-libs-webpack-plugin", "version": "0.6.1", "description": "Easier development on local libraries", - "main": "lib/index.js", + "main": "src/index.js", "license": "Apache-2.0", "scripts": { - "test": "vitest run --passWithNoTests", - "test:cov": "vitest run --coverage --passWithNoTests", - "test:update": "vitest run --update --passWithNoTests", - "lint": "eslint -o eslint-report.json --format json ." + "vitest:run": "vitest run --passWithNoTests", + "vitest:cov": "vitest run --coverage --passWithNoTests", + "vitest:update": "vitest run --update --passWithNoTests", + "eslint": "eslint -o eslint-report.json --format json ." }, "keywords": [ "webpack", @@ -27,13 +27,5 @@ }, "publishConfig": { "access": "public" - }, - "devDependencies": { - "@talend/eslint-config": "^14.1.2", - "@talend/eslint-plugin": "^1.8.1", - "@talend/scripts-core": "^20.0.0", - "@vitest/coverage-v8": "^4.1.2", - "eslint": "^10.1.0", - "vitest": "^4.1.2" } } diff --git a/packages/local-libs-webpack-plugin/lib/addAliases.js b/packages/local-libs-webpack-plugin/src/addAliases.js similarity index 100% rename from packages/local-libs-webpack-plugin/lib/addAliases.js rename to packages/local-libs-webpack-plugin/src/addAliases.js diff --git a/packages/local-libs-webpack-plugin/lib/addAliases.test.js b/packages/local-libs-webpack-plugin/src/addAliases.test.js similarity index 100% rename from packages/local-libs-webpack-plugin/lib/addAliases.test.js rename to packages/local-libs-webpack-plugin/src/addAliases.test.js diff --git a/packages/local-libs-webpack-plugin/lib/convertRequest.js b/packages/local-libs-webpack-plugin/src/convertRequest.js similarity index 100% rename from packages/local-libs-webpack-plugin/lib/convertRequest.js rename to packages/local-libs-webpack-plugin/src/convertRequest.js diff --git a/packages/local-libs-webpack-plugin/lib/convertRequest.test.js b/packages/local-libs-webpack-plugin/src/convertRequest.test.js similarity index 100% rename from packages/local-libs-webpack-plugin/lib/convertRequest.test.js rename to packages/local-libs-webpack-plugin/src/convertRequest.test.js diff --git a/packages/local-libs-webpack-plugin/lib/getLinkedLibs.js b/packages/local-libs-webpack-plugin/src/getLinkedLibs.js similarity index 100% rename from packages/local-libs-webpack-plugin/lib/getLinkedLibs.js rename to packages/local-libs-webpack-plugin/src/getLinkedLibs.js diff --git a/packages/local-libs-webpack-plugin/lib/getPackageJsonInfo.js b/packages/local-libs-webpack-plugin/src/getPackageJsonInfo.js similarity index 100% rename from packages/local-libs-webpack-plugin/lib/getPackageJsonInfo.js rename to packages/local-libs-webpack-plugin/src/getPackageJsonInfo.js diff --git a/packages/local-libs-webpack-plugin/lib/index.js b/packages/local-libs-webpack-plugin/src/index.js similarity index 100% rename from packages/local-libs-webpack-plugin/lib/index.js rename to packages/local-libs-webpack-plugin/src/index.js diff --git a/packages/local-libs-webpack-plugin/lib/pathWithoutFilename.js b/packages/local-libs-webpack-plugin/src/pathWithoutFilename.js similarity index 100% rename from packages/local-libs-webpack-plugin/lib/pathWithoutFilename.js rename to packages/local-libs-webpack-plugin/src/pathWithoutFilename.js diff --git a/packages/local-libs-webpack-plugin/lib/pathWithoutFilename.test.js b/packages/local-libs-webpack-plugin/src/pathWithoutFilename.test.js similarity index 100% rename from packages/local-libs-webpack-plugin/lib/pathWithoutFilename.test.js rename to packages/local-libs-webpack-plugin/src/pathWithoutFilename.test.js diff --git a/packages/playground-vite/package.json b/packages/playground-vite/package.json index 79bf5e10e5..342b075525 100644 --- a/packages/playground-vite/package.json +++ b/packages/playground-vite/package.json @@ -7,11 +7,9 @@ "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 ." + "eslint": "eslint -o eslint-report.json --format json ." }, "repository": { "type": "git", @@ -24,17 +22,9 @@ "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.6", - "eslint": "^10.1.0", "i18next-http-backend": "^1.4.5", "mockjs": "^1.1.0", "sass": "^1.98.0", diff --git a/packages/playground/package.json b/packages/playground/package.json index 685cd1f08b..5f2c18953c 100644 --- a/packages/playground/package.json +++ b/packages/playground/package.json @@ -6,9 +6,8 @@ "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", - "lint": "eslint -o eslint-report.json --format json ." + "eslint": "eslint -o eslint-report.json --format json ." }, "repository": { "type": "git", @@ -21,15 +20,7 @@ "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-core": "^20.0.0", - "@talend/scripts-config-babel": "^13.10.1", - "@talend/scripts-config-stylelint": "^5.0.0", "copy-webpack-plugin": "^14.0.0", - "cross-env": "^10.1.0", - "eslint": "^10.1.0", "webpack": "^5.105.4" }, "dependencies": { diff --git a/packages/router-bridge/package.json b/packages/router-bridge/package.json index 765092ff96..b14a4f43e8 100644 --- a/packages/router-bridge/package.json +++ b/packages/router-bridge/package.json @@ -17,10 +17,10 @@ "build:lib": "talend-scripts build", "build:lib:esm": "talend-scripts build --esm", "build": "talend-scripts build", - "lint": "eslint -o eslint-report.json --format json .", - "test": "vitest run", - "test:update": "vitest run --update", - "test:cov": "vitest run --coverage" + "eslint": "eslint -o eslint-report.json --format json .", + "vitest:run": "vitest run", + "vitest:update": "vitest run --update", + "vitest:cov": "vitest run --coverage" }, "repository": { "type": "git", @@ -30,18 +30,10 @@ "license": "Apache-2.0", "homepage": "https://github.com/ui/tree/master/packages/router-bridge#readme", "devDependencies": { - "@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-react-webpack": "^17.1.1", - "@vitest/coverage-v8": "^4.1.2", "connected-react-router": "^6.9.3", - "eslint": "^10.1.0", "history": "^5.3.0", "react": "^18.3.1", - "react-router-dom": "~6.3.0", - "vitest": "^4.1.2" + "react-router-dom": "~6.3.0" }, "peerDependencies": { "connected-react-router": "^6.9.2", diff --git a/packages/sagas/package.json b/packages/sagas/package.json index e1e1688cc3..e51e8f133a 100644 --- a/packages/sagas/package.json +++ b/packages/sagas/package.json @@ -18,11 +18,11 @@ "scripts": { "build:lib": "talend-scripts build", "build:lib:esm": "talend-scripts build --esm", - "test": "vitest run", + "vitest:run": "vitest run", "test:watch": "vitest", - "test:cov": "vitest run --coverage", - "lint": "eslint -o eslint-report.json --format json .", - "test:update": "vitest run --update" + "vitest:cov": "vitest run --coverage", + "eslint": "eslint -o eslint-report.json --format json .", + "vitest:update": "vitest run --update" }, "keywords": [ "react", @@ -50,17 +50,9 @@ "react-dom": "^18.3.1" }, "devDependencies": { - "@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-react-webpack": "^17.1.1", - "@vitest/coverage-v8": "^4.1.2", - "eslint": "^10.1.0", "prop-types": "^15.8.1", "react": "^18.3.1", - "react-dom": "^18.3.1", - "vitest": "^4.1.2" + "react-dom": "^18.3.1" }, "publishConfig": { "access": "public" diff --git a/packages/stepper/package.json b/packages/stepper/package.json index bba9a21efe..e5840017a8 100644 --- a/packages/stepper/package.json +++ b/packages/stepper/package.json @@ -19,15 +19,14 @@ "build:lib": "talend-scripts build", "build:lib:esm": "talend-scripts build --esm", "extract-i18n": "i18next-scanner --config i18next-scanner.config.js", - "test": "vitest run", + "vitest:run": "vitest run", "test:noisy": "vitest run", "test:watch": "vitest --watch", - "test:cov": "vitest run --coverage", - "lint:js": "eslint -o eslint-report.json --format json .", - "lint:css": "stylelint --formatter json -o stylelint-report.json \"**/*.css\"", - "lint": "npm run lint:js && npm run lint:css", + "vitest:cov": "vitest run --coverage", + "eslint:run": "eslint -o eslint-report.json --format json .", + "stylelint:run": "stylelint --formatter json -o stylelint-report.json \"**/*.css\"", "start": "talend-scripts start-storybook -p 6006", - "test:update": "vitest run --update" + "vitest:update": "vitest run --update" }, "keywords": [ "react", @@ -52,21 +51,8 @@ "lodash": "^4.18.0" }, "devDependencies": { - "@vitejs/plugin-react": "^5.2.0", - "@vitest/coverage-v8": "^4.1.2", "@talend/icons": "^8.0.0", - "@talend/eslint-config": "^14.1.2", - "@talend/eslint-plugin": "^1.8.1", - "@talend/scripts-config-babel": "^13.10.1", - "@talend/scripts-config-prettier": "^12.7.1", - "@talend/scripts-config-react-webpack": "^17.1.1", - "@talend/scripts-config-storybook-lib": "^6.1.1", - "@talend/scripts-config-stylelint": "^5.0.0", - "@talend/scripts-config-typescript": "^12.1.1", - "@talend/scripts-core": "^20.0.0", "@testing-library/react-hooks": "^8.0.1", - "eslint": "^10.1.0", - "stylelint": "^17.6.0", "i18next": "^23.16.8", "immutable": "^3.8.3", "jsdom": "^26.1.0", @@ -76,8 +62,7 @@ "react-dom": "^18.3.1", "react-i18next": "^13.5.0", "react-redux": "^7.2.9", - "react-transition-group": "^2.9.0", - "vitest": "^4.1.2" + "react-transition-group": "^2.9.0" }, "peerDependencies": { "i18next": "^23.16.8", diff --git a/packages/stepper/custom.d.ts b/packages/stepper/src/custom.d.ts similarity index 100% rename from packages/stepper/custom.d.ts rename to packages/stepper/src/custom.d.ts diff --git a/packages/stepper/src/hooks/useStepperForm/useStepperForm.hook.test.tsx b/packages/stepper/src/hooks/useStepperForm/useStepperForm.hook.test.tsx index 280be6a6a7..4833a46742 100644 --- a/packages/stepper/src/hooks/useStepperForm/useStepperForm.hook.test.tsx +++ b/packages/stepper/src/hooks/useStepperForm/useStepperForm.hook.test.tsx @@ -1,4 +1,5 @@ import { renderHook, act } from '@testing-library/react-hooks'; +import { describe, it, expect, vi } from 'vitest'; import { useStepperForm } from './useStepperForm.hook'; import { StepperState } from './useStepperForm.types'; diff --git a/packages/stepper/src/stories/Stepper.components.tsx b/packages/stepper/src/stories/Stepper.components.tsx index 3e48138a68..e2182972fc 100644 --- a/packages/stepper/src/stories/Stepper.components.tsx +++ b/packages/stepper/src/stories/Stepper.components.tsx @@ -70,7 +70,7 @@ export const FormComponentStep1 = () => { id="randomInput" label="Random input" name={field.name} - onChange={e => { + onChange={(e: any) => { field.onChange(e); }} value={field.value} diff --git a/packages/stepper/tsconfig.json b/packages/stepper/tsconfig.json index f791062fe2..56b8837140 100644 --- a/packages/stepper/tsconfig.json +++ b/packages/stepper/tsconfig.json @@ -1,10 +1,11 @@ { "extends": "@talend/scripts-config-typescript/tsconfig.json", - "include": ["src/**/*", "custom.d.ts"], + "include": ["src/**/*"], "compilerOptions": { "allowJs": true, "checkJs": false, "declaration": true, - "noEmit": false + "noEmit": false, + "rootDir": "src" } } diff --git a/packages/storybook-cmf/package.json b/packages/storybook-cmf/package.json index 732161e951..887d91d5c5 100644 --- a/packages/storybook-cmf/package.json +++ b/packages/storybook-cmf/package.json @@ -19,10 +19,10 @@ "scripts": { "build:lib": "talend-scripts build", "build:lib:esm": "talend-scripts build --esm", - "test": "vitest run", - "lint": "eslint -o eslint-report.json --format json .", - "test:update": "vitest run --update", - "test:cov": "vitest run --coverage" + "vitest:run": "vitest run", + "eslint": "eslint -o eslint-report.json --format json .", + "vitest:update": "vitest run --update", + "vitest:cov": "vitest run --coverage" }, "main": "lib/index.js", "mainSrc": "src/index.js", @@ -34,21 +34,13 @@ } }, "devDependencies": { - "@vitejs/plugin-react": "^5.2.0", - "@vitest/coverage-v8": "^4.1.2", - "@talend/eslint-config": "^14.1.2", - "@talend/eslint-plugin": "^1.8.1", "@talend/react-cmf": "^12.2.0", - "@talend/scripts-core": "^20.0.0", - "@talend/scripts-config-babel": "^13.10.1", "@testing-library/react": "^14.3.1", - "eslint": "^10.1.0", "react": "^18.3.1", "react-dom": "^18.3.1", "react-redux": "^7.2.9", "redux-saga": "^1.4.2", - "storybook": "^10.3.3", - "vitest": "^4.1.2" + "storybook": "^10.3.3" }, "dependencies": { "prop-types": "^15.8.1" diff --git a/packages/storybook-docs/package.json b/packages/storybook-docs/package.json index f638c22a1f..342e38f8f8 100644 --- a/packages/storybook-docs/package.json +++ b/packages/storybook-docs/package.json @@ -10,10 +10,8 @@ "build:lib": "talend-scripts build && npm run build:styles", "build:lib:esm": "talend-scripts build --esm", "start": "npm run storybook", - "lint:js": "eslint -o eslint-report.json --format json .", - "lint:css": "stylelint --formatter json -o stylelint-report.json \"**/*.css\"", - "lint": "npm run lint:js && npm run lint:css", - "test": "echo no test", + "eslint:run": "eslint -o eslint-report.json --format json .", + "stylelint:run": "stylelint --formatter json -o stylelint-report.json \"**/*.css\"", "storybook": "storybook dev -p 6106", "build-storybook": "storybook build --docs" }, @@ -43,18 +41,10 @@ "@figma/rest-api-spec": "^0.36.0", "@storybook/addon-a11y": "^10.3.3", "@storybook/react-vite": "^10.3.3", - "@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-config-typescript": "^12.1.1", - "@talend/scripts-core": "^20.0.0", "@types/node": "^6.14.13", "@types/react": "^18.3.28", "@types/react-dom": "^18.3.7", "css-loader": "^7.1.4", - "eslint": "^10.1.0", - "stylelint": "^17.6.0", "mini-css-extract-plugin": "^2.10.2", "postcss-loader": "^8.2.1", "resolve-url-loader": "^5.0.0", diff --git a/packages/storybook-one/package.json b/packages/storybook-one/package.json index c437f9fd19..8ced69946a 100644 --- a/packages/storybook-one/package.json +++ b/packages/storybook-one/package.json @@ -5,10 +5,10 @@ "homepage": "https://github.com/Talend/ui#readme", "main": "src/index.ts", "scripts": { - "test:demo": "storybook build", + "storybook:build": "storybook build", "build-storybook": "storybook build", "start-storybook": "storybook dev", - "lint": "eslint -o eslint-report.json --format json .", + "eslint": "eslint -o eslint-report.json --format json .", "start": "storybook dev" }, "repository": { @@ -34,25 +34,9 @@ "react-hook-form": "^7.72.0" }, "devDependencies": { - "@babel/preset-env": "^7.29.2", - "@babel/preset-react": "^7.28.5", - "@babel/preset-typescript": "^7.28.5", "@storybook/addon-a11y": "^10.3.3", "@storybook/addon-links": "^10.3.3", - "@talend/eslint-config": "^14.1.2", - "@talend/eslint-plugin": "^1.8.1", - "@talend/locales-design-system": "^7.15.1", - "@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/scripts-config-babel": "^13.10.1", - "@talend/scripts-config-react-webpack": "^17.1.1", - "@talend/scripts-config-storybook-lib": "^6.1.1", - "@talend/scripts-config-typescript": "^12.1.1", - "@talend/scripts-core": "^20.0.0", "@types/react": "^18.3.28", - "eslint": "^10.1.0", "storybook": "^10.3.3", "i18next": "^23.16.8", "react": "^18.3.1", diff --git a/packages/storybook-one/tsconfig.json b/packages/storybook-one/tsconfig.json index 2e361de75b..d3f158fb18 100644 --- a/packages/storybook-one/tsconfig.json +++ b/packages/storybook-one/tsconfig.json @@ -10,6 +10,7 @@ "compilerOptions": { "baseUrl": ".", "module": "CommonJs", + "moduleResolution": "node", "rootDirs": [".storybook", "src"] } } diff --git a/packages/theme/package.json b/packages/theme/package.json index 97cfe2a7de..aec4316c89 100644 --- a/packages/theme/package.json +++ b/packages/theme/package.json @@ -5,13 +5,10 @@ "mainSrc": "src/index.js", "license": "Apache-2.0", "scripts": { - "build:lib": "rimraf ./dist && webpack", + "build:lib": "webpack", "start": "webpack serve --mode=development", - "test": "echo no test for @talend/bootstrap-theme", - "test:cov": "echo no test for @talend/bootstrap-theme", - "lint": "npm run lint:js && npm run lint:css", - "lint:js": "eslint -o eslint-report.json --format json .", - "lint:css": "stylelint --config .stylelintrc.js --formatter json -o stylelint-report.json 'src/**/*.{css,scss}'" + "eslint:run": "eslint -o eslint-report.json --format json .", + "stylelint:run": "stylelint --config .stylelintrc.js --formatter json -o stylelint-report.json 'src/**/*.{css,scss}'" }, "keywords": [ "talend", @@ -33,20 +30,14 @@ "@talend/design-tokens": "^4.1.1" }, "devDependencies": { - "@talend/eslint-config": "^14.1.2", - "@talend/eslint-plugin": "^1.8.1", - "@talend/scripts-config-stylelint": "^5.0.0", - "@talend/scripts-core": "^20.0.0", "copy-webpack-plugin": "^14.0.0", "css-minimizer-webpack-plugin": "^8.0.0", "css-loader": "^7.1.4", - "eslint": "^10.1.0", "html-webpack-plugin": "^5.6.6", "mini-css-extract-plugin": "^2.10.2", "postcss": "^8.5.8", "postcss-loader": "^8.2.1", "postcss-preset-env": "^7.8.3", - "rimraf": "^6.1.3", "sass": "^1.98.0", "sass-loader": "^14.2.1", "style-loader": "^3.3.4", diff --git a/packages/utils/package.json b/packages/utils/package.json index 726448debc..3f7f5c9445 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -24,25 +24,17 @@ "scripts": { "build:lib": "talend-scripts build --tsc", "build:lib:esm": "talend-scripts build --esm", - "lint": "eslint -o eslint-report.json --format json .", - "test": "vitest run", - "test:cov": "vitest run --coverage", + "eslint": "eslint -o eslint-report.json --format json .", + "vitest:run": "vitest run", + "vitest:cov": "vitest run --coverage", "test:noisy": "vitest run", "test:watch": "vitest --watch", "extends": "talend-scripts extends", - "test:update": "vitest run --update" + "vitest:update": "vitest run --update" }, "devDependencies": { - "@talend/eslint-config": "^14.1.2", - "@talend/eslint-plugin": "^1.8.1", - "@talend/scripts-core": "^20.0.0", - "@talend/scripts-config-stylelint": "^5.0.0", - "@talend/scripts-config-typescript": "^12.1.1", "@types/date-fns": "^2.6.3", - "@types/lodash": "^4.17.24", - "@vitest/coverage-v8": "^4.1.2", - "eslint": "^10.1.0", - "vitest": "^4.1.2" + "@types/lodash": "^4.17.24" }, "dependencies": { "date-fns": "^3.6.0", diff --git a/packages/utils/tsconfig.json b/packages/utils/tsconfig.json index 03264a1df9..d53566b41b 100644 --- a/packages/utils/tsconfig.json +++ b/packages/utils/tsconfig.json @@ -4,6 +4,7 @@ "compilerOptions": { "declaration": true, "target": "ES5", - "module": "CommonJs" + "module": "CommonJs", + "moduleResolution": "node" } } diff --git a/tools/babel-plugin-assets-api/package.json b/tools/babel-plugin-assets-api/package.json index f328d41c60..dfc2d29988 100644 --- a/tools/babel-plugin-assets-api/package.json +++ b/tools/babel-plugin-assets-api/package.json @@ -4,10 +4,10 @@ "description": "", "main": "src/index.js", "scripts": { - "lint": "eslint -o eslint-report.json --format json ./src", - "test": "vitest run", - "test:cov": "vitest run --coverage", - "test:update": "vitest run --update" + "eslint": "eslint -o eslint-report.json --format json ./src", + "vitest:run": "vitest run", + "vitest:cov": "vitest run --coverage", + "vitest:update": "vitest run --update" }, "dependencies": { "read-pkg-up": "^7.0.1", @@ -18,17 +18,9 @@ "url": "https://github.com/Talend/ui.git" }, "devDependencies": { - "@babel/core": "^7.29.0", - "@babel/preset-env": "^7.29.2", - "@vitest/coverage-v8": "^4.1.2", "babel-plugin-tester": "^10.1.0", - "@eslint/js": "^9.39.4", - "eslint": "^10.1.0", - "eslint-config-prettier": "^10.1.8", - "eslint-plugin-prettier": "^5.5.5", "globals": "^15.15.0", - "react": "^18.3.1", - "vitest": "^4.1.2" + "react": "^18.3.1" }, "babel": { "presets": [ diff --git a/tools/babel-plugin-import-d3/package.json b/tools/babel-plugin-import-d3/package.json index 561917bb17..a16578a8c1 100644 --- a/tools/babel-plugin-import-d3/package.json +++ b/tools/babel-plugin-import-d3/package.json @@ -14,21 +14,13 @@ "url": "https://github.com/Talend/ui.git" }, "scripts": { - "lint": "eslint -o eslint-report.json --format json .", - "test": "vitest run", - "test:cov": "vitest run --coverage", - "test:update": "vitest run --update" + "eslint": "eslint -o eslint-report.json --format json .", + "vitest:run": "vitest run", + "vitest:cov": "vitest run --coverage", + "vitest:update": "vitest run --update" }, "devDependencies": { - "@talend/eslint-config": "^14.1.2", - "@talend/eslint-plugin": "^1.8.1", - "@talend/scripts-core": "^20.0.0", - "@babel/core": "^7.29.0", - "@babel/preset-env": "^7.29.2", - "@vitest/coverage-v8": "^4.1.2", - "babel-plugin-tester": "^10.1.0", - "eslint": "^10.1.0", - "vitest": "^4.1.2" + "babel-plugin-tester": "^10.1.0" }, "babel": { "presets": [ diff --git a/tools/babel-plugin-import-from-index/package.json b/tools/babel-plugin-import-from-index/package.json index 52c90dd0fa..bf3b124e0f 100644 --- a/tools/babel-plugin-import-from-index/package.json +++ b/tools/babel-plugin-import-from-index/package.json @@ -14,25 +14,17 @@ "url": "https://github.com/Talend/ui.git" }, "scripts": { - "lint": "eslint -o eslint-report.json --format json ./src", - "test": "vitest run", - "test:cov": "vitest run --coverage", - "test:update": "vitest run --update" + "eslint": "eslint -o eslint-report.json --format json ./src", + "vitest:run": "vitest run", + "vitest:cov": "vitest run --coverage", + "vitest:update": "vitest run --update" }, "dependencies": { "semver": "^7.7.4" }, "devDependencies": { - "@babel/core": "^7.29.0", - "@babel/preset-env": "^7.29.2", - "@vitest/coverage-v8": "^4.1.2", "babel-plugin-tester": "^10.1.0", - "@eslint/js": "^9.39.4", - "eslint": "^10.1.0", - "eslint-config-prettier": "^10.1.8", - "eslint-plugin-prettier": "^5.5.5", - "globals": "^15.15.0", - "vitest": "^4.1.2" + "globals": "^15.15.0" }, "babel": { "presets": [ diff --git a/tools/babel-plugin-import-from-lib/package.json b/tools/babel-plugin-import-from-lib/package.json index 35097baf21..a9d8ce45d3 100644 --- a/tools/babel-plugin-import-from-lib/package.json +++ b/tools/babel-plugin-import-from-lib/package.json @@ -4,10 +4,10 @@ "description": "This plugin transform imports of lib using /lib path", "main": "index.js", "scripts": { - "lint": "eslint -o eslint-report.json --format json .", - "test": "vitest run", - "test:cov": "vitest run --coverage", - "test:update": "vitest run --update" + "eslint": "eslint -o eslint-report.json --format json .", + "vitest:run": "vitest run", + "vitest:cov": "vitest run --coverage", + "vitest:update": "vitest run --update" }, "repository": { "type": "git", @@ -18,16 +18,10 @@ "publishConfig": { "access": "public" }, + "devDependencies": { + "babel-plugin-tester": "^10.1.0" + }, "dependencies": { "@babel/types": "^7.29.0" - }, - "devDependencies": { - "@talend/eslint-config": "^14.1.2", - "@talend/eslint-plugin": "^1.8.1", - "@talend/scripts-core": "^20.0.0", - "@vitest/coverage-v8": "^4.1.2", - "babel-plugin-tester": "^10.1.0", - "eslint": "^10.1.0", - "vitest": "^4.1.2" } } diff --git a/tools/cmf-webpack-plugin/package.json b/tools/cmf-webpack-plugin/package.json index c000d30c82..a533220463 100644 --- a/tools/cmf-webpack-plugin/package.json +++ b/tools/cmf-webpack-plugin/package.json @@ -4,8 +4,7 @@ "main": "src/index.js", "mainSrc": "src/index.js", "scripts": { - "lint": "eslint -o eslint-report.json --format json .", - "test": "echo nothing to test yet in @talend/react-cmf-webpack-plugin" + "eslint": "eslint -o eslint-report.json --format json ." }, "repository": { "type": "git", @@ -29,11 +28,6 @@ "lodash": "^4.18.0", "webpack-sources": "^3.3.4" }, - "devDependencies": { - "@talend/eslint-config": "^14.1.2", - "@talend/scripts-config-babel": "^13.10.1", - "eslint": "^10.1.0" - }, "publishConfig": { "access": "public" }, diff --git a/tools/eslint-plugin/package.json b/tools/eslint-plugin/package.json index 67f1283b49..f4bed05503 100644 --- a/tools/eslint-plugin/package.json +++ b/tools/eslint-plugin/package.json @@ -14,21 +14,15 @@ "url": "https://github.com/Talend/ui.git" }, "scripts": { - "lint": "eslint -o eslint-report.json --format json .", - "test": "vitest run", - "test:cov": "vitest run --coverage", - "test:update": "vitest run --update" + "eslint": "eslint -o eslint-report.json --format json .", + "vitest:run": "vitest run", + "vitest:cov": "vitest run --coverage", + "vitest:update": "vitest run --update" }, "dependencies": { "@talend/scripts-config-cdn": "^10.17.1", "requireindex": "^1.2.0" }, - "devDependencies": { - "@talend/scripts-config-babel": "^13.10.1", - "@vitest/coverage-v8": "^4.1.2", - "eslint": "^10.1.0", - "vitest": "^4.1.2" - }, "engines": { "node": ">=14" }, diff --git a/tools/scripts-cmf/package.json b/tools/scripts-cmf/package.json index 52effb9658..ef35dce76e 100644 --- a/tools/scripts-cmf/package.json +++ b/tools/scripts-cmf/package.json @@ -10,7 +10,7 @@ "cmf-settings": "./cmf-settings.js" }, "scripts": { - "lint": "eslint -o eslint-report.json --format json ." + "eslint": "eslint -o eslint-report.json --format json ." }, "dependencies": { "commander": "^6.2.1", @@ -19,11 +19,6 @@ "lodash": "^4.18.0", "mkdirp": "^1.0.4" }, - "devDependencies": { - "@talend/eslint-config": "^14.1.2", - "@talend/eslint-plugin": "^1.8.1", - "eslint": "^10.1.0" - }, "repository": { "type": "git", "url": "https://github.com/Talend/ui.git" diff --git a/tools/scripts-config-babel/package.json b/tools/scripts-config-babel/package.json index 47d811b255..ca0a06e67e 100644 --- a/tools/scripts-config-babel/package.json +++ b/tools/scripts-config-babel/package.json @@ -14,10 +14,10 @@ "url": "https://github.com/Talend/ui.git" }, "scripts": { - "lint": "eslint -o eslint-report.json --format json .", - "test": "vitest run", - "test:cov": "vitest run --coverage", - "test:update": "vitest run --update" + "eslint": "eslint -o eslint-report.json --format json .", + "vitest:run": "vitest run", + "vitest:cov": "vitest run --coverage", + "vitest:update": "vitest run --update" }, "dependencies": { "@babel/core": "^7.29.0", @@ -37,13 +37,7 @@ "babel-plugin-angularjs-annotate": "^0.10.0" }, "devDependencies": { - "@eslint/js": "^9.39.4", - "@vitest/coverage-v8": "^4.1.2", - "eslint": "^10.1.0", - "eslint-config-prettier": "^10.1.8", - "eslint-plugin-prettier": "^5.5.5", - "globals": "^15.15.0", - "vitest": "^4.1.2" + "globals": "^15.15.0" }, "publishConfig": { "access": "public" diff --git a/tools/scripts-config-cdn/package.json b/tools/scripts-config-cdn/package.json index 8ee90fac61..c1cc48a541 100644 --- a/tools/scripts-config-cdn/package.json +++ b/tools/scripts-config-cdn/package.json @@ -8,8 +8,7 @@ "url": "https://github.com/Talend/ui.git" }, "scripts": { - "lint": "eslint -o eslint-report.json --format json .", - "test": "echo \"Nothing to test\"" + "eslint": "eslint -o eslint-report.json --format json ." }, "author": "Talend Frontend (http://www.talend.com)", "license": "Apache-2.0", @@ -22,10 +21,6 @@ "read-pkg-up": "^7.0.1" }, "devDependencies": { - "@eslint/js": "^9.39.4", - "eslint": "^10.1.0", - "eslint-config-prettier": "^10.1.8", - "eslint-plugin-prettier": "^5.5.5", "globals": "^15.15.0" }, "publishConfig": { diff --git a/tools/scripts-config-eslint/__tests__/config.test.js b/tools/scripts-config-eslint/__tests__/config.test.js index a25ad63500..c93bd144bf 100644 --- a/tools/scripts-config-eslint/__tests__/config.test.js +++ b/tools/scripts-config-eslint/__tests__/config.test.js @@ -1,12 +1,13 @@ +import { vi, describe, it, expect } from 'vitest'; +import config from '../index'; + vi.mock('eslint-plugin-mdx', () => ({ configs: { flat: {} }, rules: {}, })); describe('eslint config', () => { - it('should require', () => { - // eslint-disable-next-line global-require - const config = require('../index'); + it('should exists', () => { expect(config).toBeDefined(); }); }); diff --git a/tools/scripts-config-eslint/package.json b/tools/scripts-config-eslint/package.json index 964738272a..3d496b878d 100644 --- a/tools/scripts-config-eslint/package.json +++ b/tools/scripts-config-eslint/package.json @@ -14,14 +14,10 @@ "url": "https://github.com/Talend/ui.git" }, "scripts": { - "lint": "eslint -o eslint-report.json --format json .", - "test": "vitest run", - "test:cov": "vitest run --coverage", - "test:update": "vitest run --update" - }, - "devDependencies": { - "@vitest/coverage-v8": "^4.1.2", - "vitest": "^4.1.2" + "eslint": "eslint -o eslint-report.json --format json .", + "vitest:run": "vitest run", + "vitest:cov": "vitest run --coverage", + "vitest:update": "vitest run --update" }, "dependencies": { "@eslint/compat": "^2.0.3", diff --git a/tools/scripts-config-prettier/package.json b/tools/scripts-config-prettier/package.json index ebc76f9789..d492528dbb 100644 --- a/tools/scripts-config-prettier/package.json +++ b/tools/scripts-config-prettier/package.json @@ -12,8 +12,7 @@ "url": "https://github.com/Talend/ui.git" }, "scripts": { - "lint": "eslint -o eslint-report.json --format json .", - "test": "echo \"Nothing to test\"" + "eslint": "eslint -o eslint-report.json --format json ." }, "license": "Apache-2.0", "publishConfig": { @@ -21,10 +20,5 @@ }, "dependencies": { "@trivago/prettier-plugin-sort-imports": "^4.3.0" - }, - "devDependencies": { - "@talend/eslint-config": "^14.1.2", - "@talend/eslint-plugin": "^1.8.1", - "eslint": "^10.1.0" } } diff --git a/tools/scripts-config-react-webpack/package.json b/tools/scripts-config-react-webpack/package.json index 6912c68d50..da1fe97c19 100644 --- a/tools/scripts-config-react-webpack/package.json +++ b/tools/scripts-config-react-webpack/package.json @@ -14,8 +14,7 @@ "url": "https://github.com/Talend/ui.git" }, "scripts": { - "lint": "eslint -o eslint-report.json --format json .", - "test": "echo \"Nothing to test\"" + "eslint": "eslint -o eslint-report.json --format json ." }, "peerDependencies": { "@talend/icons": "^8.0.0" @@ -60,11 +59,6 @@ "webpack-cli": "^6.0.1", "webpack-dev-server": "^5.2.3" }, - "devDependencies": { - "@talend/eslint-config": "^14.1.2", - "@talend/eslint-plugin": "^1.8.1", - "eslint": "^10.1.0" - }, "publishConfig": { "access": "public" } diff --git a/tools/scripts-config-storybook-lib/package.json b/tools/scripts-config-storybook-lib/package.json index a62c4ad15f..e492512373 100644 --- a/tools/scripts-config-storybook-lib/package.json +++ b/tools/scripts-config-storybook-lib/package.json @@ -28,7 +28,7 @@ "scripts": { "build:lib": "tsc", "build:watch": "tsc --watch", - "lint": "eslint -o eslint-report.json --format json .", + "eslint": "eslint -o eslint-report.json --format json .", "update:msw": "npx msw init public/msw --save" }, "files": [ @@ -62,14 +62,9 @@ "react": "^18.0.0" }, "devDependencies": { - "@talend/scripts-cmf": "^1.8.1", - "@talend/eslint-config": "^14.1.2", - "@talend/eslint-plugin": "^1.8.1", "@types/lodash": "^4.17.24", "@types/node": "^25.5.0", - "@types/react": "^18.3.28", - "eslint": "^10.1.0", - "typescript": "^5.9.3" + "@types/react": "^18.3.28" }, "publishConfig": { "access": "public" diff --git a/tools/scripts-config-storybook-lib/tsconfig.json b/tools/scripts-config-storybook-lib/tsconfig.json index 3c9fb78d49..42206d2df4 100644 --- a/tools/scripts-config-storybook-lib/tsconfig.json +++ b/tools/scripts-config-storybook-lib/tsconfig.json @@ -1,9 +1,10 @@ { "extends": "@talend/scripts-config-typescript/tsconfig.json", "compilerOptions": { + "rootDir": "./src", + "outDir": "./dist", "types": ["node"], "jsx": "react-jsx", - "outDir": "dist", "noEmit": false, "module": "Node16", "moduleResolution": "node16", diff --git a/tools/scripts-config-stylelint/package.json b/tools/scripts-config-stylelint/package.json index 5d3d0f54af..d9e48c36ac 100644 --- a/tools/scripts-config-stylelint/package.json +++ b/tools/scripts-config-stylelint/package.json @@ -10,7 +10,7 @@ "url": "https://github.com/Talend/ui/issues" }, "scripts": { - "lint": "eslint -o eslint-report.json --format json ." + "eslint": "eslint -o eslint-report.json --format json ." }, "repository": { "type": "git", @@ -19,11 +19,6 @@ "dependencies": { "stylelint-config-standard": "^40.0.0" }, - "devDependencies": { - "@talend/eslint-config": "^14.1.2", - "@talend/eslint-plugin": "^1.8.1", - "eslint": "^10.1.0" - }, "publishConfig": { "access": "public" } diff --git a/tools/scripts-config-typescript/package.json b/tools/scripts-config-typescript/package.json index b35beff80c..4d4af51aa9 100644 --- a/tools/scripts-config-typescript/package.json +++ b/tools/scripts-config-typescript/package.json @@ -10,18 +10,12 @@ "url": "https://github.com/Talend/ui/issues" }, "scripts": { - "lint": "eslint -o eslint-report.json --format json .", - "test": "echo \"Nothing to test\"" + "eslint": "eslint -o eslint-report.json --format json ." }, "repository": { "type": "git", "url": "https://github.com/Talend/ui.git" }, - "devDependencies": { - "@talend/eslint-config": "^14.1.2", - "@talend/eslint-plugin": "^1.8.1", - "eslint": "^10.1.0" - }, "publishConfig": { "access": "public" } diff --git a/tools/scripts-core/package.json b/tools/scripts-core/package.json index 895b6f1b5a..65d424cd81 100644 --- a/tools/scripts-core/package.json +++ b/tools/scripts-core/package.json @@ -18,9 +18,9 @@ "url": "https://github.com/Talend/ui.git" }, "scripts": { - "lint": "eslint -o eslint-report.json --format json .", - "test": "vitest run", - "test:cov": "vitest run" + "eslint": "eslint -o eslint-report.json --format json .", + "vitest:run": "vitest run", + "vitest:cov": "vitest run --coverage" }, "peerDependencies": { "@talend/scripts-config-react-webpack": ">=16.0.0" @@ -48,10 +48,6 @@ "webpack-merge": "^5.10.0", "yargs": "^15.4.1" }, - "devDependencies": { - "eslint": "^10.1.0", - "vitest": "^4.1.2" - }, "publishConfig": { "access": "public" } diff --git a/tools/scripts-core/vitest.config.ts b/tools/scripts-core/vitest.config.ts index b7a83dbad6..19b1b339f8 100644 --- a/tools/scripts-core/vitest.config.ts +++ b/tools/scripts-core/vitest.config.ts @@ -6,5 +6,9 @@ export default defineConfig({ environment: 'node', include: ['__tests__/**/*.test.{js,ts}'], testTimeout: 60000, + coverage: { + provider: 'v8', + reporter: ['text', 'json-summary'], + }, }, }); diff --git a/tools/scripts-locales/package.json b/tools/scripts-locales/package.json index 77f5254772..872bd48e0f 100644 --- a/tools/scripts-locales/package.json +++ b/tools/scripts-locales/package.json @@ -11,18 +11,12 @@ "url": "https://github.com/Talend/ui.git" }, "scripts": { - "lint": "eslint -o eslint-report.json --format json ." + "eslint": "eslint -o eslint-report.json --format json ." }, "dependencies": { "@talend/scripts-utils": "^2.8.1", "cross-spawn": "^7.0.6" }, - "devDependencies": { - "@talend/eslint-config": "^14.1.2", - "@talend/eslint-plugin": "^1.8.1", - "@talend/scripts-core": "^20.0.0", - "eslint": "^10.1.0" - }, "keywords": [ "i18next", "talend" diff --git a/tools/scripts-publish-local/package.json b/tools/scripts-publish-local/package.json index a3e42c428f..03c9cc7e11 100644 --- a/tools/scripts-publish-local/package.json +++ b/tools/scripts-publish-local/package.json @@ -11,20 +11,13 @@ }, "main": "src/index.js", "scripts": { - "lint": "eslint -o eslint-report.json --format json .", - "test": "echo nothing to test" + "eslint": "eslint -o eslint-report.json --format json ." }, "dependencies": { "cross-spawn": "^7.0.6", "generate-password": "^1.7.1", "rimraf": "^6.1.3" }, - "devDependencies": { - "@talend/eslint-config": "^14.1.2", - "@talend/eslint-plugin": "^1.8.1", - "@talend/scripts-core": "^20.0.0", - "eslint": "^10.1.0" - }, "author": "Talend Frontend (http://www.talend.com)", "license": "Apache-2.0", "publishConfig": { diff --git a/tools/scripts-utils/package.json b/tools/scripts-utils/package.json index 649abfef5e..3d192f1780 100644 --- a/tools/scripts-utils/package.json +++ b/tools/scripts-utils/package.json @@ -4,22 +4,16 @@ "description": "", "main": "src/index.js", "scripts": { - "lint": "eslint -o eslint-report.json --format json .", - "test": "vitest run", - "test:cov": "vitest run --coverage", - "test:update": "vitest run --update" + "eslint": "eslint -o eslint-report.json --format json .", + "vitest:run": "vitest run", + "vitest:cov": "vitest run --coverage", + "vitest:update": "vitest run --update" }, "dependencies": { "fs-extra": "^10.1.0", "glob": "^11.1.0", "which": "^2.0.2" }, - "devDependencies": { - "@talend/eslint-config": "^14.1.2", - "@vitest/coverage-v8": "^4.1.2", - "eslint": "^10.1.0", - "vitest": "^4.1.2" - }, "repository": { "type": "git", "url": "git+https://github.com/Talend/ui.git" diff --git a/tools/scripts-yarn-workspace/package.json b/tools/scripts-yarn-workspace/package.json index 40d95fc659..bad9898f16 100644 --- a/tools/scripts-yarn-workspace/package.json +++ b/tools/scripts-yarn-workspace/package.json @@ -7,15 +7,9 @@ "talend-yarn-workspace": "./src/index.js" }, "scripts": { - "lint": "eslint -o eslint-report.json --format json ." + "eslint": "eslint -o eslint-report.json --format json ." }, "author": "frontend@talend.com", - "devDependencies": { - "@talend/eslint-config": "^14.1.2", - "@talend/eslint-plugin": "^1.8.1", - "@talend/scripts-core": "^20.0.0", - "eslint": "^10.1.0" - }, "license": "Apache-2.0", "publishConfig": { "access": "public" diff --git a/tools/upgrade-deps/package.json b/tools/upgrade-deps/package.json index 97fe2ae5b7..9c726e7e65 100644 --- a/tools/upgrade-deps/package.json +++ b/tools/upgrade-deps/package.json @@ -13,15 +13,6 @@ "strip-ansi": "^7.2.0", "yarn-deduplicate": "^6.0.2" }, - "devDependencies": { - "@talend/eslint-config": "^14.1.2", - "@talend/eslint-plugin": "^1.8.1", - "@talend/scripts-core": "^20.0.0", - "@vitest/coverage-v8": "^4.1.2", - "cpx2": "^8.0.0", - "eslint": "^10.1.0", - "vitest": "^4.1.2" - }, "license": "Apache-2.0", "homepage": "https://github.com/Talend/ui", "bugs": { @@ -32,12 +23,11 @@ "url": "https://github.com/Talend/ui.git" }, "scripts": { - "lint": "eslint -o eslint-report.json --format json .", - "test": "vitest run", + "eslint": "eslint -o eslint-report.json --format json .", + "vitest:run": "vitest run", "test:watch": "vitest --watch", - "test:update": "vitest run --update", - "test:cov": "vitest run --coverage", - "test:cron": "vitest run" + "vitest:update": "vitest run --update", + "vitest:cov": "vitest run --coverage" }, "publishConfig": { "access": "public" diff --git a/turbo.json b/turbo.json new file mode 100644 index 0000000000..5c42ad2b6b --- /dev/null +++ b/turbo.json @@ -0,0 +1,60 @@ +{ + "$schema": "https://turbo.build/schema.json", + "tasks": { + "build:lib": { + "dependsOn": ["^build:lib"], + "outputs": ["lib/**"] + }, + "@talend/bootstrap-theme#build:lib": { + "dependsOn": ["^build:lib"], + "outputs": ["dist/**"] + }, + "@talend/design-system#build:lib": { + "dependsOn": ["^build:lib"], + "outputs": ["lib/**", "lib-esm/**"] + }, + "@talend/design-tokens#build:lib": { + "dependsOn": ["^build:lib"], + "outputs": ["lib/**", "dist/**"] + }, + "@talend/react-cmf#build:lib": { + "dependsOn": ["^build:lib"], + "outputs": ["lib/**", "lib-esm/**"] + }, + "@talend/icons#build:lib": { + "dependsOn": ["^build:lib"], + "outputs": ["dist/**"] + }, + "@talend/scripts-config-storybook-lib#build:lib": { + "dependsOn": ["^build:lib"], + "outputs": ["dist/**"] + }, + "@talend/storybook-docs#build:lib": { + "dependsOn": ["^build:lib"], + "outputs": ["lib/**", "dist/**"] + }, + "build:lib:esm": { + "dependsOn": ["^build:lib:esm"], + "outputs": ["lib-esm/**"] + }, + "eslint:run": { + "dependsOn": ["^eslint:run"], + "outputs": ["eslint-report.json"] + }, + "stylelint:run": { + "dependsOn": ["^stylelint:run"], + "outputs": ["stylelint-report.json"] + }, + "storybook:build": { + "dependsOn": ["^storybook:build"], + "outputs": ["storybook-static/**"] + }, + "vitest:run": { + "dependsOn": ["^vitest:run"] + }, + "vitest:cov": { + "dependsOn": ["^vitest:cov"], + "outputs": ["coverage/**"] + } + } +} diff --git a/yarn.lock b/yarn.lock index 5a10d80495..c016aa3889 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3407,6 +3407,36 @@ javascript-natural-sort "0.7.1" lodash "^4.17.21" +"@turbo/darwin-64@2.9.5": + version "2.9.5" + resolved "https://registry.yarnpkg.com/@turbo/darwin-64/-/darwin-64-2.9.5.tgz#8f9b9b497ed01aa85382972933546ff99de3773a" + integrity sha512-qPxhKsLMQP+9+dsmPgAGidi5uNifD4AoAOnEnljab3Qgn0QZRR31Hp+/CgW3Ia5AanWj6JuLLTBYvuQj4mqTWg== + +"@turbo/darwin-arm64@2.9.5": + version "2.9.5" + resolved "https://registry.yarnpkg.com/@turbo/darwin-arm64/-/darwin-arm64-2.9.5.tgz#6ffc591c61c0ae896fe12db2ec81cd9185b72f7c" + integrity sha512-vkF/9F/l3aWd4bHxTui5Hh0F5xrTZ4e3rbBsc57zA6O8gNbmHN3B6eZ5psAIP2CnJRZ8ZxRjV3WZHeNXMXkPBw== + +"@turbo/linux-64@2.9.5": + version "2.9.5" + resolved "https://registry.yarnpkg.com/@turbo/linux-64/-/linux-64-2.9.5.tgz#2a845a77b4dbf296af3918a21c6c55553779e186" + integrity sha512-z/Get5NUaUxm5HSGFqVMICDRjFNsCUhSc4wnFa/PP1QD0NXCjr7bu9a2EM6md/KMCBW0Qe393Ac+UM7/ryDDTw== + +"@turbo/linux-arm64@2.9.5": + version "2.9.5" + resolved "https://registry.yarnpkg.com/@turbo/linux-arm64/-/linux-arm64-2.9.5.tgz#2aeb297b1479a4c40156e374d96768681af3c912" + integrity sha512-jyBifaNoI5/NheyswomiZXJvjdAdvT7hDRYzQ4meP0DKGvpXUjnqsD+4/J2YSDQ34OHxFkL30FnSCUIVOh2PHw== + +"@turbo/windows-64@2.9.5": + version "2.9.5" + resolved "https://registry.yarnpkg.com/@turbo/windows-64/-/windows-64-2.9.5.tgz#2643e7ca7419f922a57de1a0ebf86cbf9aab34d9" + integrity sha512-ph24K5uPtvo7UfuyDXnBiB/8XvrO+RQWbbw5zkA/bVNoy9HDiNoIJJj3s62MxT9tjEb6DnPje5PXSz1UR7QAyg== + +"@turbo/windows-arm64@2.9.5": + version "2.9.5" + resolved "https://registry.yarnpkg.com/@turbo/windows-arm64/-/windows-arm64-2.9.5.tgz#98d50bf471442de0d66b26b976e27cdac5137c9a" + integrity sha512-6c5RccT/+iR39SdT1G5HyZaD2n57W77o+l0TTfxG/cVlhV94Acyg2gTQW7zUOhW1BeQpBjHzu9x8yVBZwrHh7g== + "@tybys/wasm-util@^0.10.1": version "0.10.1" resolved "https://registry.yarnpkg.com/@tybys/wasm-util/-/wasm-util-0.10.1.tgz#ecddd3205cf1e2d5274649ff0eedd2991ed7f414" @@ -14784,6 +14814,18 @@ ttf2woff@^3.0.0: argparse "^2.0.1" pako "^1.0.0" +turbo@^2.9.5: + version "2.9.5" + resolved "https://registry.yarnpkg.com/turbo/-/turbo-2.9.5.tgz#2efbe979139337d03194e89ed480a7b41ef1ff45" + integrity sha512-JXNkRe6H6MjSlk5UQRTjyoKX5YN2zlc2632xcSlSFBao5yvbMWTpv9SNolOZlZmUlcDOHuszPLItbKrvcXnnZA== + optionalDependencies: + "@turbo/darwin-64" "2.9.5" + "@turbo/darwin-arm64" "2.9.5" + "@turbo/linux-64" "2.9.5" + "@turbo/linux-arm64" "2.9.5" + "@turbo/windows-64" "2.9.5" + "@turbo/windows-arm64" "2.9.5" + tv4@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/tv4/-/tv4-1.3.0.tgz#d020c846fadd50c855abb25ebaecc68fc10f7963"