diff --git a/.claude/agents/code-reviewer.md b/.claude/agents/code-reviewer.md index 5ab526596..1fed44ce7 100644 --- a/.claude/agents/code-reviewer.md +++ b/.claude/agents/code-reviewer.md @@ -90,7 +90,8 @@ Easy-to-miss invariants beyond the generic checks above: `test:jest` and `test:playwright` ([.github/workflows/](../../.github/workflows/)). `npm run lint` covers `lint:eslint`, `lint:stylelint`, `lint:markdownlint` and `lint:types`; the - tests run separately. `npm run lint:eslint` covers `src` and `tests`. + tests run separately. `npm run lint:eslint` covers `src`, `tests`, `scripts`, + `webpack` and the config files in the project root. Remind the author to run them. * **Component layout** ([frontend.md](../rules/frontend.md)): every component folder has the `.tsx` + `.types.ts` + `index.ts` barrel + `*.module.scss` + `_settings`/ diff --git a/.claude/rules/frontend.md b/.claude/rules/frontend.md index 7c1ff0788..1246f09bb 100644 --- a/.claude/rules/frontend.md +++ b/.claude/rules/frontend.md @@ -21,14 +21,13 @@ paths: React UI is a themeable React component library, distributed as a UMD bundle (with separate CSS) and as ESM (consumers run their own SASS pipeline). Components are TypeScript / TSX for React. Babel (`@babel/preset-typescript`) -transpiles for the bundle and Jest; TypeScript (`tsc` from the -`@typescript/native` package) type-checks (`strict: true`) and emits the -published declarations (`dist/types`, via `tsconfig.build.json` in -`npm run build`); `dts-bundle-generator` then flattens them into the single -`dist/react-ui.d.ts` referenced by `package.json` `types`. An older TypeScript -is installed alongside under the `typescript` package name for tools that need -the compiler API (typescript-eslint). For the exact versions of these packages, -see [package.json](../../package.json). +transpiles for the bundle and Jest. TypeScript (`tsc`) type-checks +(`strict: true`) and emits the published declarations to `dist/types`, using +`tsconfig.build.json` in `npm run build`. `dts-bundle-generator` then flattens +the declarations into the single `dist/react-ui.d.ts` referenced by +`package.json` `types`. typescript-eslint uses the same `typescript` package. +For the exact versions of these packages, see +[package.json](../../package.json). Plain function components are annotated as `React.FunctionComponent`. diff --git a/.editorconfig b/.editorconfig index ccf5a2ea7..d883aaa88 100644 --- a/.editorconfig +++ b/.editorconfig @@ -12,5 +12,14 @@ indent_style = space insert_final_newline = true trim_trailing_whitespace = true -[*.{scss,md}] +[*.{css,scss,md}] indent_size = 4 + +[*.{cpp,hpp}] +indent_size = 4 + +[*.py] +indent_size = 4 + +[Makefile] +indent_style = tab diff --git a/.env.dist b/.env.dist index 28c69eec1..d665a1527 100644 --- a/.env.dist +++ b/.env.dist @@ -3,14 +3,17 @@ ################################ # Must match Docker Compose project name used to start the other service containers to allow devcontainer -# to communicate with them (setup.sh derives this from the directory basename by default) +# to communicate with them (setup.sh derives this from the directory basename by default, lowercased and +# stripped of characters that are not allowed in Docker Compose project names) COMPOSE_PROJECT_NAME=react-ui -# Docker compose ports for Docs server instances -COMPOSE_DOCS_SERVER_PORT=8000 +# The default host ports are unique per project, so several projects can run side by side -# Docker compose ports for Playwright Component Testing report server -COMPOSE_PLAYWRIGHT_REPORT_PORT=9323 +# Docker compose port for the docs server +COMPOSE_DOCS_SERVER_PORT=21001 + +# Docker compose port for the Playwright report server +COMPOSE_PLAYWRIGHT_REPORT_PORT=21002 # Flag whether the `node` and `docs` service containers should automatically install dependencies, # build, and run the application (JavaScript files watcher, docs server) when they start @@ -19,14 +22,14 @@ COMPOSE_AUTOSTART=false # Ownership of the files created in the container # ⚠️ [Linux] This needs to be set to the output of `id --user` # ⚠️ [MacOS] This needs to be set to 1000 -COMPOSE_UID=1000 +COMPOSE_UID= # ⚠️ [Linux] This needs to be set to the output of `id --group` # ⚠️ [MacOS] This needs to be set to 1000 -COMPOSE_GID=1000 +COMPOSE_GID= -############################# +############################## # Devcontainer configuration # -############################# +############################## # IDEs automatically mount the host's SSH agent socket into the container # Visual Studio Code does this by default, it can be disabled by setting the following variable to true. @@ -40,9 +43,9 @@ VISUAL=vim # Select your preferred shell (/bin/bash, /bin/fish, /bin/zsh) SHELL=/bin/bash -########################### +############################ # Playwright configuration # -########################### +############################ # Number of workers to use to run Playwright tests PW_WORKERS=1 @@ -55,7 +58,10 @@ PW_CT_PORT=3100 #################################### # Host Chrome debug port -# CHROME_DEBUG_PORT=9333 +CHROME_DEBUG_PORT=21003 # Host Chrome binary path (skip for auto-detection) # CHROME_BIN= + +# URL that the host Chrome opens (skip to open the application, or the docs when the project has no application port) +# CHROME_START_URL= diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 1fe475b6c..e0b130204 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -7,16 +7,27 @@ # Soft gates — any team member can review, but relevant expert is notified # Infrastructure & build tooling +/.devcontainer/ @bedrich-schindler @mbohal @react-ui-org/maintainers +/.env.dist @bedrich-schindler @mbohal @react-ui-org/maintainers +/.github/workflows/ @bedrich-schindler @mbohal @react-ui-org/maintainers /docker/ @bedrich-schindler @mbohal @react-ui-org/maintainers -/docker-compose.yml @bedrich-schindler @mbohal @react-ui-org/maintainers -/webpack.config.js @bedrich-schindler @mbohal @react-ui-org/maintainers -/babel.config.js @bedrich-schindler @mbohal @react-ui-org/maintainers -/jest.config.js @bedrich-schindler @mbohal @react-ui-org/maintainers +/docker-compose.base.yml @bedrich-schindler @mbohal @react-ui-org/maintainers +/docker-compose.yml.dist @bedrich-schindler @mbohal @react-ui-org/maintainers +/scripts/ @bedrich-schindler @mbohal @react-ui-org/maintainers +/setup.sh @bedrich-schindler @mbohal @react-ui-org/maintainers +/tools/ @bedrich-schindler @mbohal @react-ui-org/maintainers +/webpack.config.mjs @bedrich-schindler @mbohal @react-ui-org/maintainers +/webpack/ @bedrich-schindler @mbohal @react-ui-org/maintainers +/babel.config.mjs @bedrich-schindler @mbohal @react-ui-org/maintainers +/jest.config.mjs @bedrich-schindler @mbohal @react-ui-org/maintainers /eslint.config.mjs @bedrich-schindler @mbohal @react-ui-org/maintainers +/playwright-ct.config.ts @bedrich-schindler @mbohal @react-ui-org/maintainers +/tsconfig.build.json @bedrich-schindler @mbohal @react-ui-org/maintainers +/tsconfig.json @bedrich-schindler @mbohal @react-ui-org/maintainers # Docs, styles & style tooling *.md @adamkudrna @react-ui-org/maintainers -/postcss.config.js @adamkudrna @react-ui-org/maintainers +/postcss.config.mjs @adamkudrna @react-ui-org/maintainers /src/docs/ @adamkudrna @react-ui-org/maintainers /src/styles/ @adamkudrna @react-ui-org/maintainers /src/theme.scss @adamkudrna @react-ui-org/maintainers diff --git a/.github/markdown-link-check.json b/.github/markdown-link-check.json deleted file mode 100644 index 3bbd632ca..000000000 --- a/.github/markdown-link-check.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "ignorePatterns": [ - { - "pattern": "^/components/" - }, - { - "pattern": "^/docs/" - } - ] -} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c547be023..e8b02d0b0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -53,7 +53,7 @@ jobs: uses: actions/checkout@v6 - name: Set up Node.js (${{ env.NODE_PREVIOUS_LTS_VERSION }}) - uses: actions/setup-node@v6 + uses: actions/setup-node@v7 with: node-version: ${{ env.NODE_PREVIOUS_LTS_VERSION }} cache: npm @@ -79,7 +79,7 @@ jobs: uses: actions/checkout@v6 - name: Set up Node.js (${{ env.NODE_ACTIVE_LTS_VERSION }}) - uses: actions/setup-node@v6 + uses: actions/setup-node@v7 with: node-version: ${{ env.NODE_ACTIVE_LTS_VERSION }} cache: npm diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index b72003019..894f8b719 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -31,7 +31,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v6 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index d2216abb8..567fc7910 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-24.04 steps: - name: Clone repository - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Set up Python uses: actions/setup-python@v5 @@ -19,18 +19,18 @@ jobs: python-version: 3.x - name: Get cache ID - run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV + run: echo "cache_id=$(date --utc '+%V')" >> "$GITHUB_ENV" - name: Restore cache uses: actions/cache@v4 with: - key: mkdocs-material-${{ env.cache_id }} + key: mkdocs-material-9.8.0-${{ env.cache_id }} path: .cache restore-keys: | - mkdocs-material- + mkdocs-material-9.8.0- - name: Install MkDocs - run: pip install 'mkdocs-material>=9.0.0,<10.0.0' + run: pip install 'mkdocs-material==9.8.0' - name: Build MkDocs run: mkdocs build diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index f9db02fd5..df5c780f2 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -2,25 +2,35 @@ name: Lint on: [ pull_request ] +# The Node.js version is the active LTS, the same version as in `.nvmrc`. Node.js and +# npm are pinned so that a broken npm release cannot break the build, see +# . +env: + NODE_VERSION: 26.13.1 + NPM_VERSION: 11.20.0 + jobs: lint: name: Lint runs-on: ubuntu-24.04 steps: - name: Clone repository - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Set up Node.js - uses: actions/setup-node@v4 + uses: actions/setup-node@v7 with: - node-version: 26.13.1 + node-version: ${{ env.NODE_VERSION }} cache: npm + - name: Install npm@${{ env.NPM_VERSION }} + run: npm install -g npm@${{ env.NPM_VERSION }} + - name: Print Node.js and npm version run: node --version && npm --version - name: Install run: npm ci - - name: Test + - name: Lint run: npm run lint diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 87e6fb3b4..0f51e2750 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -5,6 +5,13 @@ on: schedule: - cron: '0 6 * * *' # daily at 6:00 UTC (7:00 CET, 8:00 CEST) +# The Node.js version is the active LTS, the same version as in `.nvmrc`. Node.js and +# npm are pinned so that a broken npm release cannot break the build, see +# . +env: + NODE_VERSION: 26.13.1 + NPM_VERSION: 11.20.0 + jobs: test: name: Playwright @@ -14,29 +21,26 @@ jobs: image: mcr.microsoft.com/playwright:v1.65.0-noble@sha256:9beb546099e11f52d62e505537914870e01a67e0e6b00ae41da4775324e73dbe steps: - name: Clone repository - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Set up Node.js - uses: actions/setup-node@v4 + uses: actions/setup-node@v7 with: - node-version: 26.13.1 + node-version: ${{ env.NODE_VERSION }} cache: npm + - name: Install npm@${{ env.NPM_VERSION }} + run: npm install -g npm@${{ env.NPM_VERSION }} + - name: Print Node.js and npm version run: node --version && npm --version - name: Install run: npm ci - - name: Install Playwright Browsers - run: npx playwright install --with-deps - - name: Run Playwright tests and generate test report run: npm run test:playwright - - name: Install Playwright Browsers - run: npx playwright install --with-deps - - name: Upload Playwright test report uses: actions/upload-artifact@v4 if: ${{ !cancelled() }} diff --git a/.github/workflows/pull-request-meta.yml b/.github/workflows/pull-request-meta.yml index 98175f98f..6d46eade1 100644 --- a/.github/workflows/pull-request-meta.yml +++ b/.github/workflows/pull-request-meta.yml @@ -14,5 +14,5 @@ jobs: - name: Add labels uses: TimonVS/pr-labeler-action@v5 - env: + with: repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/pull-request-preview.yml b/.github/workflows/pull-request-preview.yml index b6f95fba1..c5139a460 100644 --- a/.github/workflows/pull-request-preview.yml +++ b/.github/workflows/pull-request-preview.yml @@ -6,13 +6,15 @@ on: paths: - 'src/**' - '.browserslistrc' - - 'babel.config.js' + - 'babel.config.mjs' - 'mkdocs.yml' - 'package-lock.json' - 'package.json' - - 'postcss.config.js' + - 'postcss.config.mjs' + - 'tsconfig.build.json' - 'tsconfig.json' - - 'webpack.config.js' + - 'webpack.config.mjs' + - 'webpack/**' concurrency: group: preview-${{ github.ref }} @@ -23,8 +25,10 @@ permissions: deployments: write pull-requests: write +# Kept in sync with lint.yml. env: NODE_VERSION: 26.13.1 + NPM_VERSION: 11.20.0 jobs: build: @@ -36,15 +40,18 @@ jobs: uses: actions/checkout@v6 - name: Set up Node.js - uses: actions/setup-node@v6 + uses: actions/setup-node@v7 with: node-version: ${{ env.NODE_VERSION }} cache: npm - - name: Install Node.js dependencies + - name: Install npm@${{ env.NPM_VERSION }} + run: npm install -g npm@${{ env.NPM_VERSION }} + + - name: Install run: npm ci - - name: Build assets + - name: Build run: npm run build # Docoff looks up types imported by components in the bundled type declarations @@ -57,18 +64,18 @@ jobs: python-version: 3.x - name: Get cache ID - run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV + run: echo "cache_id=$(date --utc '+%V')" >> "$GITHUB_ENV" - name: Restore cache uses: actions/cache@v4 with: - key: mkdocs-material-${{ env.cache_id }} + key: mkdocs-material-9.8.0-${{ env.cache_id }} path: .cache restore-keys: | - mkdocs-material- + mkdocs-material-9.8.0- - name: Install MkDocs - run: pip install 'mkdocs-material>=9.0.0,<10.0.0' + run: pip install 'mkdocs-material==9.8.0' - name: Build docs run: mkdocs build diff --git a/.github/workflows/release-management.yml b/.github/workflows/release-management.yml index 8756e626a..7afe931dd 100644 --- a/.github/workflows/release-management.yml +++ b/.github/workflows/release-management.yml @@ -8,6 +8,11 @@ permissions: contents: read id-token: write +# Kept in sync with lint.yml. +env: + NODE_VERSION: 26.13.1 + NPM_VERSION: 11.20.0 + jobs: test_and_build: name: Test and build @@ -17,14 +22,17 @@ jobs: version_changed: ${{ steps.check_package_version.outputs.changed }} steps: - name: Clone repository - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Set up Node.js - uses: actions/setup-node@v4 + uses: actions/setup-node@v7 with: - node-version: 26.13.1 + node-version: ${{ env.NODE_VERSION }} cache: npm + - name: Install npm@${{ env.NPM_VERSION }} + run: npm install -g npm@${{ env.NPM_VERSION }} + - name: Install run: npm ci @@ -71,7 +79,7 @@ jobs: runs-on: ubuntu-24.04 steps: - name: Clone repository - uses: actions/checkout@v4 + uses: actions/checkout@v6 # An existing release draft is published only if there is a version bump in `package.json`. # Throws an error and breaks the job if called regardless. We check for version changes in the @@ -87,6 +95,7 @@ jobs: gh release create "v${{ needs.test_and_build.outputs.version }}" --draft --title "v${{ needs.test_and_build.outputs.version }}" fi gh release edit "v${{ needs.test_and_build.outputs.version }}" --draft=false + echo "release_url=$(gh release view "v${{ needs.test_and_build.outputs.version }}" --json url --jq .url)" >> "$GITHUB_OUTPUT" - name: Write out the release URL run: echo "Released at $RELEASE_URL" @@ -100,15 +109,18 @@ jobs: runs-on: ubuntu-24.04 steps: - name: Clone repository - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Set up Node.js - uses: actions/setup-node@v4 + uses: actions/setup-node@v7 with: - node-version: 26.13.1 + node-version: ${{ env.NODE_VERSION }} cache: npm registry-url: https://registry.npmjs.org + - name: Install npm@${{ env.NPM_VERSION }} + run: npm install -g npm@${{ env.NPM_VERSION }} + - name: Install run: npm ci @@ -124,7 +136,7 @@ jobs: runs-on: ubuntu-24.04 steps: - name: Clone repository - uses: actions/checkout@v4 + uses: actions/checkout@v6 # Hard-coded username and email for the GitHub bot user # https://api.github.com/users/github-actions%5Bbot%5D @@ -134,11 +146,14 @@ jobs: git config user.email 41898282+github-actions[bot]@users.noreply.github.com - name: Set up Node.js - uses: actions/setup-node@v4 + uses: actions/setup-node@v7 with: - node-version: 26.13.1 + node-version: ${{ env.NODE_VERSION }} cache: npm + - name: Install npm@${{ env.NPM_VERSION }} + run: npm install -g npm@${{ env.NPM_VERSION }} + - name: Install run: npm ci @@ -155,18 +170,18 @@ jobs: python-version: 3.x - name: Get cache ID - run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV + run: echo "cache_id=$(date --utc '+%V')" >> "$GITHUB_ENV" - name: Restore cache uses: actions/cache@v4 with: - key: mkdocs-material-${{ env.cache_id }} + key: mkdocs-material-9.8.0-${{ env.cache_id }} path: .cache restore-keys: | - mkdocs-material- + mkdocs-material-9.8.0- - name: Install MkDocs - run: pip install 'mkdocs-material>=9.0.0,<10.0.0' + run: pip install 'mkdocs-material==9.8.0' - name: Build docs run: mkdocs build diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4639c9797..9948728b4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,20 +5,30 @@ on: schedule: - cron: '0 6 * * *' # daily at 6:00 UTC (7:00 CET, 8:00 CEST) +# The Node.js version is the active LTS, the same version as in `.nvmrc`. Node.js and +# npm are pinned so that a broken npm release cannot break the build, see +# . +env: + NODE_VERSION: 26.13.1 + NPM_VERSION: 11.20.0 + jobs: test: name: Test runs-on: ubuntu-24.04 steps: - name: Clone repository - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Set up Node.js - uses: actions/setup-node@v4 + uses: actions/setup-node@v7 with: - node-version: 26.13.1 + node-version: ${{ env.NODE_VERSION }} cache: npm + - name: Install npm@${{ env.NPM_VERSION }} + run: npm install -g npm@${{ env.NPM_VERSION }} + - name: Print Node.js and npm version run: node --version && npm --version diff --git a/.gitignore b/.gitignore index b5096964b..978f638d0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,19 +1,41 @@ +# Project /coverage -/docker-compose.yml -/docker/react_ui_devcontainer_local -!/docker/react_ui_devcontainer_local/Dockerfile.dist /dist -/node_modules -/playwright-report/ +/playwright-report /site /src/docs/_assets/generated/* -/tests/playwright/.temp/ -.env -statistics.html -!.gitkeep +/stats.html +/tests/playwright/.temp +# Dependencies +/node_modules + +# Local environment +/.env* +!/.env.dist +!/.env.*.dist +/docker-compose.yml +/docker-compose.yml.backup +/docker/react-ui-devcontainer-local/* +!/docker/react-ui-devcontainer-local/Dockerfile.dist + +# Local AI assistant files /.claude/settings.local.json /CLAUDE.local.md +# IDE +/.idea/* +!/.idea/runConfigurations/ +/*/**/.idea/ +/.vscode/* +!/.vscode/tasks.json + +# Python __pycache__/ *.pyc + +# Logs +npm-debug.log* + +# Placeholders of ignored directories +!.gitkeep diff --git a/.markdownlint-cli2.jsonc b/.markdownlint-cli2.jsonc new file mode 100644 index 000000000..f0fe2abe3 --- /dev/null +++ b/.markdownlint-cli2.jsonc @@ -0,0 +1,5 @@ +// Lints every Markdown file that Git does not ignore. +{ + "gitignore": true, + "globs": ["**/*.md"] +} diff --git a/.markdownlint.jsonc b/.markdownlint.jsonc index 8ba4e7892..e1998c14d 100644 --- a/.markdownlint.jsonc +++ b/.markdownlint.jsonc @@ -1,5 +1,4 @@ // See https://github.com/DavidAnson/markdownlint#rules--aliases for the complete list of rules. - { "default": true, "MD007": { // Unordered list indentation @@ -10,7 +9,7 @@ "tables": false // Do not check length inside tables }, "MD024": { // Allow duplicate headings - "allow_different_nesting": true // Allow same heading level under different parents + "siblings_only": true // Only check sibling headings }, "MD033": false, // Allow inline HTML and custom components "MD060": false // Do not enforce table column alignment (emoji widths break it) diff --git a/.mcp.json b/.mcp.json index afd9d01c0..af1768d74 100644 --- a/.mcp.json +++ b/.mcp.json @@ -2,7 +2,7 @@ "mcpServers": { "chrome-host": { "command": "sh", - "args": ["scripts/mcps/chrome-host/mcp-entry.sh"] + "args": ["tools/agents/mcps/chrome-host/mcp-entry.sh"] } } } diff --git a/CLAUDE.md b/CLAUDE.md index 948ac5f16..91792b495 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,6 +1,7 @@ # CLAUDE.md -This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository +This file provides guidance to Claude Code (claude.ai/code) when working with +code in this repository ## Environment @@ -46,7 +47,8 @@ Notes: * `npm run lint` runs all linters (ESLint, Stylelint, Markdownlint, type check). There is no `npm test` script. -* `npm run lint:eslint` lints `src` and `tests`. +* `npm run lint:eslint` lints `src`, `tests`, `scripts`, `webpack` and the + `*.config.js` and `*.config.mjs` files in the project root. * The lint / Jest / Playwright commands are the same gates CI runs ([.github/workflows/](.github/workflows/)). * Commands like `npm`, `playwright` run in specific Docker containers. @@ -89,4 +91,4 @@ Specialized agents live in [.claude/agents/](.claude/agents/). MCP-capable assistants in the `devcontainer` can drive host Chrome to verify the docs site and rendered components. See [AI Integration](src/docs/contribute/ai-integration.md) and -[scripts/mcps/chrome-host/README.md](scripts/mcps/chrome-host/README.md). +[tools/agents/mcps/chrome-host/README.md](tools/agents/mcps/chrome-host/README.md). diff --git a/babel.config.js b/babel.config.js deleted file mode 100644 index 9b95c3693..000000000 --- a/babel.config.js +++ /dev/null @@ -1,26 +0,0 @@ -module.exports = { - plugins: [ - [ - 'babel-plugin-polyfill-corejs3', - { - method: 'usage-global', - version: require('core-js/package.json').version, - }, - ], - ], - presets: [ - [ - '@babel/preset-env', - { - modules: 'commonjs', - }, - ], - [ - '@babel/preset-react', - { - runtime: 'classic', - }, - ], - '@babel/preset-typescript', - ], -}; diff --git a/babel.config.mjs b/babel.config.mjs new file mode 100644 index 000000000..fc794db7d --- /dev/null +++ b/babel.config.mjs @@ -0,0 +1,32 @@ +import corejsPackage from 'core-js/package.json' with { type: 'json' }; + +export default { + overrides: [ + { + // JSX is parsed only in `.tsx` (and `.js`/`.jsx`), like `tsc` does: in `.ts` files, generic arrow + // functions (`(value: T) => ...`) and type assertions (`value`) would be read as JSX tags + exclude: /\.ts$/, + presets: [ + [ + '@babel/preset-react', + { + runtime: 'classic', + }, + ], + ], + }, + ], + plugins: [ + [ + 'babel-plugin-polyfill-corejs3', + { + method: 'usage-global', + version: corejsPackage.version, + }, + ], + ], + presets: [ + '@babel/preset-env', + '@babel/preset-typescript', + ], +}; diff --git a/docker-compose.base.yml b/docker-compose.base.yml index 41d225068..2d3d04058 100644 --- a/docker-compose.base.yml +++ b/docker-compose.base.yml @@ -3,7 +3,7 @@ services: devcontainer: hostname: ${COMPOSE_PROJECT_NAME:-react-ui}_devcontainer build: - context: docker/react_ui_devcontainer/ + context: docker/react-ui-devcontainer/ dockerfile: Dockerfile # Start dependent services before starting the `devcontainer` service to ensure that the necessary environments # and tools are available when the `devcontainer` starts. @@ -51,7 +51,7 @@ services: node: build: docker/node user: ${COMPOSE_UID}:${COMPOSE_GID} - entrypoint: sh -c 'if [ "$$COMPOSE_AUTOSTART" = "true" ]; then sh scripts/auto-start-node.sh; else sleep infinity; fi' + entrypoint: sh -c 'if [ "$$COMPOSE_AUTOSTART" = "true" ]; then sh scripts/docker/autoStartNode.sh; else sleep infinity; fi' env_file: - .env volumes: @@ -73,7 +73,7 @@ services: docs: build: docker/mkdocs user: ${COMPOSE_UID}:${COMPOSE_GID} - entrypoint: sh -c 'if [ "$$COMPOSE_AUTOSTART" = "true" ]; then sh scripts/auto-start-mkdocs.sh; else sleep infinity; fi' + entrypoint: sh -c 'if [ "$$COMPOSE_AUTOSTART" = "true" ]; then sh scripts/docker/autoStartMkdocs.sh; else sleep infinity; fi' env_file: - .env ports: diff --git a/docker-compose.yml.dist b/docker-compose.yml.dist index 1fa6346a1..6a8c2ab47 100644 --- a/docker-compose.yml.dist +++ b/docker-compose.yml.dist @@ -4,12 +4,12 @@ services: extends: file: docker-compose.base.yml service: devcontainer - # Use `build` when you want to customize the devcontainer using `docker/react_ui_devcontainer_local/Dockerfile` + # Use `build` when you want to customize the devcontainer using `docker/react-ui-devcontainer-local/Dockerfile` # build: - # context: ./docker/react_ui_devcontainer_local/ + # context: ./docker/react-ui-devcontainer-local/ # dockerfile: Dockerfile # Use `image` when you want to use the default devcontainer - image: react-ui_devcontainer + image: react-ui-devcontainer # This service provides Node environment and NPM node: diff --git a/docker/build-docker-images.sh b/docker/build-docker-images.sh old mode 100644 new mode 100755 index 03ad3368e..a2b9c35ce --- a/docker/build-docker-images.sh +++ b/docker/build-docker-images.sh @@ -3,6 +3,32 @@ set -e trap 'echo "Failed to build Docker images"; exit 1' ERR +REBUILD=false + +while [ $# -gt 0 ]; do + case "$1" in + -r|--rebuild-docker-images) + REBUILD=true + shift + ;; + -h|--help) + echo "Usage: $0 [options]" + echo "" + echo "Build Docker images required for the development environment." + echo "" + echo "Options:" + echo " -r, --rebuild-docker-images Rebuild all Docker images from scratch, even if they already exist" + echo " -h, --help Show help" + exit 0 + ;; + *) + echo "Unknown option: $1" + echo "Run '$0 --help' for usage information." + exit 1 + ;; + esac +done + cd "$(dirname "$0")" echo "Building Docker images..." @@ -12,15 +38,44 @@ if [ ! -f ../.env ]; then exit 1 fi +# When rebuilding, bypass the Docker layer cache so that even unchanged layers +# are re-executed and produce fresh results +NO_CACHE= +if [ "$REBUILD" = true ]; then + NO_CACHE="--no-cache" +fi + +# The project name in .env.dist is the default project name, the name of the project +# devcontainer directory is derived from it +DEFAULT_PROJECT_NAME=$(grep -E '^COMPOSE_PROJECT_NAME=' ../.env.dist | cut -d '=' -f 2-) PROJECT_NAME=$(grep -E '^COMPOSE_PROJECT_NAME=' ../.env | cut -d '=' -f 2-) -PROJECT_DEVCONTAINER_IMAGE="${PROJECT_NAME}_devcontainer" +PROJECT_NAME="${PROJECT_NAME:-$DEFAULT_PROJECT_NAME}" -echo "Building Docker image $PROJECT_DEVCONTAINER_IMAGE..." -docker build -t "$PROJECT_DEVCONTAINER_IMAGE" -f ./react_ui_devcontainer/Dockerfile ./react_ui_devcontainer/ +# Image names use `-` instead of `_`, like the directories in docker/ +PROJECT_DEVCONTAINER_DIRECTORY="$(printf '%s' "$DEFAULT_PROJECT_NAME" | tr '_' '-')-devcontainer" +PROJECT_DEVCONTAINER_IMAGE="$(printf '%s' "$PROJECT_NAME" | tr '_' '-')-devcontainer" + +# A project that does not pull the `frontend-devcontainer` image from a registry +# keeps its source in docker/frontend-devcontainer/ and builds it locally +if [ -d ./frontend-devcontainer ]; then + if [ "$REBUILD" = false ] && docker image inspect frontend-devcontainer &>/dev/null; then + echo "Docker image frontend-devcontainer already exists, skipping build. Use --rebuild-docker-images to rebuild it." + else + echo "Building Docker image frontend-devcontainer..." + docker build $NO_CACHE -t frontend-devcontainer -f ./frontend-devcontainer/Dockerfile ./frontend-devcontainer/ + fi +fi + +if [ "$REBUILD" = false ] && docker image inspect "$PROJECT_DEVCONTAINER_IMAGE" &>/dev/null; then + echo "Docker image $PROJECT_DEVCONTAINER_IMAGE already exists, skipping build. Use --rebuild-docker-images to rebuild it." +else + echo "Building Docker image $PROJECT_DEVCONTAINER_IMAGE..." + docker build $NO_CACHE -t "$PROJECT_DEVCONTAINER_IMAGE" -f "./$PROJECT_DEVCONTAINER_DIRECTORY/Dockerfile" "./$PROJECT_DEVCONTAINER_DIRECTORY/" +fi cd .. -echo "Building project Docker images using docker-compose..." -docker compose build +echo "Building project Docker images using docker compose..." +docker compose build $NO_CACHE echo "All Docker images built successfully!" diff --git a/docker/react_ui_devcontainer/Dockerfile b/docker/frontend-devcontainer/Dockerfile similarity index 84% rename from docker/react_ui_devcontainer/Dockerfile rename to docker/frontend-devcontainer/Dockerfile index b3f48f14b..99814493e 100644 --- a/docker/react_ui_devcontainer/Dockerfile +++ b/docker/frontend-devcontainer/Dockerfile @@ -1,7 +1,13 @@ -FROM debian:bookworm-slim AS react-ui-devcontainer +# Debian is pinned by digest to keep the build reproducible +FROM debian:bookworm-20261027@sha256:d74df7598108a173a621eda4d58a2adbf850b2d9a9d81bc2cca1a6c21174a880 + +# Fail RUN instructions with pipes when any command in the pipe fails +SHELL ["/bin/bash", "-o", "pipefail", "-c"] # Build arguments for user configuration # Those can be changed using fixuid's remapping feature when running the container +# `USERNAME` is not sensitive data, it is just the name of the user inside the container +# hadolint ignore=DL3064 ARG USERNAME=developer ARG USER_UID=1000 ARG USER_GID=1000 @@ -16,6 +22,8 @@ ENV OPENCODE_CONFIG="${HOME}/.config/opencode/opencode.json" ENV OPENCODE_CONFIG_DIR="${HOME}/.config/opencode" # Install sudo, editors (vim, nano), SSH client, Git, shells (zsh, fish) and common utilities +# Do not fix package versions +# hadolint ignore=DL3008 RUN apt-get update && \ apt-get install -y --no-install-recommends \ sudo \ @@ -41,13 +49,15 @@ RUN addgroup --gid $USER_GID $USERNAME && \ RUN USER=$USERNAME && \ GROUP=$USERNAME && \ ARCH=$(dpkg --print-architecture) && \ - curl -SsL https://github.com/boxboat/fixuid/releases/download/v0.6.0/fixuid-0.6.0-linux-${ARCH}.tar.gz | tar -C /usr/local/bin -xzf - && \ + curl -SsL "https://github.com/boxboat/fixuid/releases/download/v0.6.0/fixuid-0.6.0-linux-${ARCH}.tar.gz" | tar -C /usr/local/bin -xzf - && \ chown root:root /usr/local/bin/fixuid && \ chmod 4755 /usr/local/bin/fixuid && \ mkdir -p /etc/fixuid && \ - printf "user: $USER\ngroup: $GROUP\npaths: [$HOME]" > /etc/fixuid/config.yml + printf 'user: %s\ngroup: %s\npaths: [%s]' "$USER" "$GROUP" "$HOME" > /etc/fixuid/config.yml # Install Docker CLI and Compose plugin to enable Docker-from-Docker +# Do not fix package versions +# hadolint ignore=DL3008 RUN install -m 0755 -d /etc/apt/keyrings && \ curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --batch --yes --dearmor -o /etc/apt/keyrings/docker.gpg && \ chmod a+r /etc/apt/keyrings/docker.gpg && \ @@ -99,17 +109,12 @@ COPY --chmod=+x files/usr/local/bin/opencode /usr/local/bin/opencode COPY --chmod=+x files/usr/local/bin/docker-entrypoint /usr/local/bin/docker-entrypoint COPY --chmod=+x files/home/$USERNAME/shell-init.sh ${HOME}/shell-init.sh COPY --chmod=+x files/home/$USERNAME/shell-init.fish ${HOME}/shell-init.fish - -# Wrapper scripts that execute commands inside the appropriate Docker containers. -# These scripts use Docker-from-Docker to run the commands in the context of the -# respective Docker containers, allowing container agnostic development workflows. -COPY --chmod=+x files/usr/local/bin/node /usr/local/bin/node -COPY --chmod=+x files/usr/local/bin/npm /usr/local/bin/npm -COPY --chmod=+x files/usr/local/bin/npx /usr/local/bin/npx -COPY --chmod=+x files/usr/local/bin/mkdocs /usr/local/bin/mkdocs +COPY --chmod=+x files/home/$USERNAME/check-environment-update.sh ${HOME}/check-environment-update.sh # Ensure /usr/local/bin takes precedence over VS Code injected paths # and run profile script on every shell startup to apply .env configuration +# Single quotes are intentional, variables must expand at shell startup, not at build time +# hadolint ignore=SC2016 RUN mkdir -p $HOME/.config/fish && \ echo 'export PATH="/usr/local/bin:$PATH"' >> $HOME/.bashrc && \ echo 'export PATH="/usr/local/bin:$PATH"' >> $HOME/.zshrc && \ diff --git a/docker/frontend-devcontainer/files/home/developer/check-environment-update.sh b/docker/frontend-devcontainer/files/home/developer/check-environment-update.sh new file mode 100644 index 000000000..44dbe391c --- /dev/null +++ b/docker/frontend-devcontainer/files/home/developer/check-environment-update.sh @@ -0,0 +1,49 @@ +#!/bin/sh + +# Warn the user when the development environment definition has changed since +# this container was created (e.g. after pulling changes), so they know they +# should update the environment. +# +# The current hash of the environment definition files is compared against a +# baseline stored in the container layer — intentionally not in a volume — so +# recreating the container automatically records a fresh baseline. + +BASELINE_FILE="$HOME/.environment_hash" +WORKSPACE="/workspace" + +# Files and directories (relative to the workspace) that define the environment, +# paths that do not exist in the project are skipped +WATCHED_PATHS=" +.devcontainer +.env.dist +.env.secondary.dist +docker +docker-compose.base.yml +docker-compose.yml.dist +setup.sh +" + +cd "$WORKSPACE" 2>/dev/null || exit 0 + +WATCHED_FILES=$( + for WATCHED_PATH in $WATCHED_PATHS; do + [ -e "$WATCHED_PATH" ] && find "$WATCHED_PATH" -type f -print + done | sort +) +[ -n "$WATCHED_FILES" ] || exit 0 + +CURRENT_HASH=$(echo "$WATCHED_FILES" | xargs -r sha256sum | sha256sum | cut -d ' ' -f 1) + +if [ ! -f "$BASELINE_FILE" ]; then + echo "$CURRENT_HASH" > "$BASELINE_FILE" +elif [ "$(cat "$BASELINE_FILE")" != "$CURRENT_HASH" ]; then + # Print the warning in yellow when the output goes to a terminal + if [ -t 1 ]; then + printf '\033[1;33m' + fi + echo "⚠ The development environment definition has changed since this container was created." + echo " Consider updating the environment, see the project documentation." + if [ -t 1 ]; then + printf '\033[0m' + fi +fi diff --git a/docker/react_ui_devcontainer/files/home/developer/shell-init.fish b/docker/frontend-devcontainer/files/home/developer/shell-init.fish similarity index 88% rename from docker/react_ui_devcontainer/files/home/developer/shell-init.fish rename to docker/frontend-devcontainer/files/home/developer/shell-init.fish index e7d6a7803..a09b65f19 100644 --- a/docker/react_ui_devcontainer/files/home/developer/shell-init.fish +++ b/docker/frontend-devcontainer/files/home/developer/shell-init.fish @@ -14,3 +14,6 @@ if test "$BLOCK_SSH_AUTH_SOCK" = "true" # Remove any existing SSH agent socket files created by VS Code find /tmp -maxdepth 1 -name 'vscode-ssh-auth-*.sock' -delete 2>/dev/null end + +# Warn the user when the development environment definition has changed +sh "$HOME/check-environment-update.sh" diff --git a/docker/react_ui_devcontainer/files/home/developer/shell-init.sh b/docker/frontend-devcontainer/files/home/developer/shell-init.sh similarity index 85% rename from docker/react_ui_devcontainer/files/home/developer/shell-init.sh rename to docker/frontend-devcontainer/files/home/developer/shell-init.sh index 91669c995..7a3d9acfc 100644 --- a/docker/react_ui_devcontainer/files/home/developer/shell-init.sh +++ b/docker/frontend-devcontainer/files/home/developer/shell-init.sh @@ -11,3 +11,6 @@ if [ "$BLOCK_SSH_AUTH_SOCK" = "true" ]; then # Remove any existing SSH agent socket files created by VS Code find /tmp -maxdepth 1 -name 'vscode-ssh-auth-*.sock' -delete 2>/dev/null fi + +# Warn the user when the development environment definition has changed +sh "$HOME/check-environment-update.sh" diff --git a/docker/react_ui_devcontainer/files/usr/local/bin/claude b/docker/frontend-devcontainer/files/usr/local/bin/claude similarity index 100% rename from docker/react_ui_devcontainer/files/usr/local/bin/claude rename to docker/frontend-devcontainer/files/usr/local/bin/claude diff --git a/docker/react_ui_devcontainer/files/usr/local/bin/copilot b/docker/frontend-devcontainer/files/usr/local/bin/copilot similarity index 100% rename from docker/react_ui_devcontainer/files/usr/local/bin/copilot rename to docker/frontend-devcontainer/files/usr/local/bin/copilot diff --git a/docker/react_ui_devcontainer/files/usr/local/bin/docker-entrypoint b/docker/frontend-devcontainer/files/usr/local/bin/docker-entrypoint similarity index 100% rename from docker/react_ui_devcontainer/files/usr/local/bin/docker-entrypoint rename to docker/frontend-devcontainer/files/usr/local/bin/docker-entrypoint index 661ebd04f..29dfd678d 100644 --- a/docker/react_ui_devcontainer/files/usr/local/bin/docker-entrypoint +++ b/docker/frontend-devcontainer/files/usr/local/bin/docker-entrypoint @@ -1,10 +1,10 @@ #!/bin/sh -# Ensure the developer user owns their home directory and all files within it -sudo chown -R developer:developer /home/developer - # Remap the developer user's UID/GID to match the host user eval "$(fixuid -q)" +# Ensure the developer user owns their home directory and all files within it +sudo chown -R developer:developer /home/developer + # Execute the command passed to the container (e.g. via `command` in docker-compose) exec "$@" diff --git a/docker/react_ui_devcontainer/files/usr/local/bin/opencode b/docker/frontend-devcontainer/files/usr/local/bin/opencode similarity index 100% rename from docker/react_ui_devcontainer/files/usr/local/bin/opencode rename to docker/frontend-devcontainer/files/usr/local/bin/opencode diff --git a/docker/mkdocs/Dockerfile b/docker/mkdocs/Dockerfile index 8fc814cf6..62d4aeffa 100644 --- a/docker/mkdocs/Dockerfile +++ b/docker/mkdocs/Dockerfile @@ -1,5 +1,4 @@ # We freezed the version of mkdocs-material to prevent issue with live reload # See -FROM squidfunk/mkdocs-material:9.8.0 -RUN mkdir /workspace -WORKDIR /workspace +FROM squidfunk/mkdocs-material:9.8.0 +WORKDIR /workspace diff --git a/docker/node/Dockerfile b/docker/node/Dockerfile index 1922ed912..120fb254d 100644 --- a/docker/node/Dockerfile +++ b/docker/node/Dockerfile @@ -1,3 +1,2 @@ FROM node:26.13.1 -RUN mkdir /workspace WORKDIR /workspace diff --git a/docker/playwright/Dockerfile b/docker/playwright/Dockerfile index 0ae48b53a..a5bab131b 100644 --- a/docker/playwright/Dockerfile +++ b/docker/playwright/Dockerfile @@ -1,5 +1,4 @@ # The Playwright image is pinned by digest, Microsoft rebuilds its tags in place. -# This digest contains Node.js 26.13.1 and npm 11.20.0, matching the `node` service. +# This digest contains Node.js 26.13.1 and npm 11.20.0. FROM mcr.microsoft.com/playwright:v1.65.0-noble@sha256:9beb546099e11f52d62e505537914870e01a67e0e6b00ae41da4775324e73dbe -RUN mkdir /workspace WORKDIR /workspace diff --git a/docker/react-ui-devcontainer-local/Dockerfile.dist b/docker/react-ui-devcontainer-local/Dockerfile.dist new file mode 100644 index 000000000..8a0cfcda1 --- /dev/null +++ b/docker/react-ui-devcontainer-local/Dockerfile.dist @@ -0,0 +1,4 @@ +# Image name `react-ui-devcontainer` might differ based on Docker compose project name +FROM react-ui-devcontainer + +# Your additional setup for the local development can go here diff --git a/docker/react-ui-devcontainer/Dockerfile b/docker/react-ui-devcontainer/Dockerfile new file mode 100644 index 000000000..e6f113e5c --- /dev/null +++ b/docker/react-ui-devcontainer/Dockerfile @@ -0,0 +1,12 @@ +FROM frontend-devcontainer + +# Wrapper scripts that execute commands inside the appropriate Docker containers. +# These scripts use Docker-from-Docker to run the commands in the context of the +# respective Docker containers, allowing container agnostic development workflows. + +COPY --chmod=+x files/usr/local/bin/node /usr/local/bin/node +COPY --chmod=+x files/usr/local/bin/npm /usr/local/bin/npm +COPY --chmod=+x files/usr/local/bin/npx /usr/local/bin/npx +COPY --chmod=+x files/usr/local/bin/mkdocs /usr/local/bin/mkdocs + +WORKDIR /workspace diff --git a/docker/react_ui_devcontainer/files/usr/local/bin/mkdocs b/docker/react-ui-devcontainer/files/usr/local/bin/mkdocs similarity index 100% rename from docker/react_ui_devcontainer/files/usr/local/bin/mkdocs rename to docker/react-ui-devcontainer/files/usr/local/bin/mkdocs diff --git a/docker/react_ui_devcontainer/files/usr/local/bin/node b/docker/react-ui-devcontainer/files/usr/local/bin/node similarity index 100% rename from docker/react_ui_devcontainer/files/usr/local/bin/node rename to docker/react-ui-devcontainer/files/usr/local/bin/node diff --git a/docker/react_ui_devcontainer/files/usr/local/bin/npm b/docker/react-ui-devcontainer/files/usr/local/bin/npm similarity index 100% rename from docker/react_ui_devcontainer/files/usr/local/bin/npm rename to docker/react-ui-devcontainer/files/usr/local/bin/npm diff --git a/docker/react_ui_devcontainer/files/usr/local/bin/npx b/docker/react-ui-devcontainer/files/usr/local/bin/npx similarity index 100% rename from docker/react_ui_devcontainer/files/usr/local/bin/npx rename to docker/react-ui-devcontainer/files/usr/local/bin/npx diff --git a/docker/react_ui_devcontainer_local/Dockerfile.dist b/docker/react_ui_devcontainer_local/Dockerfile.dist deleted file mode 100644 index b61d6a879..000000000 --- a/docker/react_ui_devcontainer_local/Dockerfile.dist +++ /dev/null @@ -1,4 +0,0 @@ -# Image name `react-ui_devcontainer` might differ based on Docker compose project name -FROM react-ui_devcontainer as react-ui_devcontainer_local - -# Your additional setup for the local development can go here diff --git a/eslint.config.mjs b/eslint.config.mjs index 768c94df8..1c1e22062 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -5,9 +5,15 @@ import { } from 'eslint/config'; export default defineConfig([ - globalIgnores(['**/*.js']), - // Only these directories are linted, so `eslint` can be run without a path - globalIgnores(['*', '!src/', '!tests/'], 'app/lint-scope'), + // Only these paths are linted, so `eslint` can be run without a path + globalIgnores( + ['*', '!src/', '!tests/', '!scripts/', '!webpack/', '!*.config.{js,mjs}'], + 'app/lint-scope', + ), + globalIgnores([ + // The build writes the bundles of the library among the generated assets + 'src/docs/_assets/generated/**', + ]), ...configs.base.recommended, ...configs.react.recommended, ...configs.base.typescript, @@ -18,4 +24,20 @@ export default defineConfig([ 'react/jsx-filename-extension': ['error', { extensions: ['.tsx'] }], }, }, + { + files: [ + '*.config.{js,mjs}', + 'scripts/**/*', + 'webpack/**/*', + ], + name: 'react-ui/tooling', + rules: { + // Node ESM requires explicit file extensions + 'import-x/extensions': 'off', + // Tooling runs only during development and build, so it imports development dependencies + 'import-x/no-extraneous-dependencies': ['error', { devDependencies: true }], + // Command line tools report to the terminal + 'no-console': 'off', + }, + }, ]); diff --git a/jest.config.js b/jest.config.mjs similarity index 73% rename from jest.config.js rename to jest.config.mjs index 5889b8689..67f8998aa 100644 --- a/jest.config.js +++ b/jest.config.mjs @@ -1,4 +1,5 @@ -module.exports = { +/** @type {import('jest').Config} */ +export default { moduleFileExtensions: [ // Jest runner requires `js` extension to be defined 'js', @@ -9,18 +10,17 @@ module.exports = { '\\.scss$': 'identity-obj-proxy', '\\.svg$': '/tests/jest/mocks/svgrMock.ts', }, - setupFiles: [ - '/tests/jest/setupJest.ts', + roots: [ + '/src', + '/tests', ], setupFilesAfterEnv: [ + '/tests/jest/setupFailOnConsole.ts', '/tests/jest/setupTestingLibrary.ts', ], testEnvironment: '@happy-dom/jest-environment', testMatch: [ '**/*.test.{ts,tsx}', ], - transformIgnorePatterns: [ - 'node_modules/(?!(@react-ui-org))', - ], verbose: true, }; diff --git a/mkdocs.yml b/mkdocs.yml index 784c68809..cf3474ca2 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -20,7 +20,6 @@ markdown_extensions: - pymdownx.emoji: emoji_index: !!python/name:material.extensions.emoji.twemoji emoji_generator: !!python/name:material.extensions.emoji.to_svg - - attr_list - md_in_html # Configuration @@ -47,8 +46,10 @@ theme: # Additional CSS. Mind the order! extra_css: - - https://unpkg.com/prismjs@1.29.0/themes/prism-twilight.min.css # Prism JS syntax highlighting - - docs/_assets/stylesheets/extra.css # mkDocs theme tweaks + # Prism JS syntax highlighting + - https://unpkg.com/prismjs@1.29.0/themes/prism-twilight.min.css + # material mkdocs theme tweaks + - docs/_assets/stylesheets/extra.css - docs/_assets/generated/docs-custom-properties.development.css # Load React UI CSS custom properties to make them accessible in the document root (outside Shadow DOM), so we can set the root font size and preview colors and helpers/utilities. # Additional JS. Mind the order! diff --git a/opencode.json b/opencode.json index e9feb99bf..a0aa02180 100644 --- a/opencode.json +++ b/opencode.json @@ -3,7 +3,7 @@ "mcp": { "chrome-host": { "type": "local", - "command": ["sh", "scripts/mcps/chrome-host/mcp-entry.sh"], + "command": ["sh", "tools/agents/mcps/chrome-host/mcp-entry.sh"], "enabled": true } } diff --git a/package-lock.json b/package-lock.json index a949181cc..5ac211c65 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,12 +13,12 @@ "normalize.css": "^8.0.1" }, "devDependencies": { - "@babel/core": "^8.0.5", - "@babel/preset-env": "^8.0.5", + "@babel/core": "^8.0.6", + "@babel/preset-env": "^8.0.6", "@babel/preset-react": "^8.0.1", "@babel/preset-typescript": "^8.0.1", "@happy-dom/jest-environment": "^20.14.5", - "@playwright/test": "~1.65.0", + "@playwright/test": "1.65.0", "@react-ui-org/eslint-config": "^1.1.0", "@react-ui-org/stylelint-config": "^1.0.0", "@testing-library/dom": "^10.4.2", @@ -26,21 +26,21 @@ "@testing-library/react": "^16.3.3", "@testing-library/user-event": "^14.6.7", "@types/jest": "^30.0.0", - "@types/node": "^26.5.1", + "@types/node": "^26.6.6", "@types/react": "^19.3.0", "@types/react-dom": "^19.3.0", - "@typescript/native": "npm:typescript@^7.0.2", - "autoprefixer": "^10.6.0", - "babel-jest": "^30.5.1", + "autoprefixer": "^10.6.1", + "babel-jest": "^30.5.2", "babel-loader": "^10.1.1", "babel-plugin-polyfill-corejs3": "^1.0.0", "core-js": "^3.50.0", "css-loader": "^7.1.5", - "dotenv": "^17.4.2", + "dotenv": "^18.0.1", "dts-bundle-generator": "^9.5.1", "eslint": "^9.39.5", "identity-obj-proxy": "^3.0.0", - "jest": "^30.5.1", + "jest": "^30.5.2", + "jest-fail-on-console": "^3.3.4", "markdownlint-cli2": "^0.23.3", "mini-css-extract-plugin": "^2.10.2", "postcss": "^8.5.28", @@ -52,8 +52,8 @@ "stylelint": "^17.15.0", "stylelint-webpack-plugin": "^5.1.0", "terser-webpack-plugin": "^5.6.1", - "typescript": "npm:@typescript/typescript6@^6.0.2", - "webpack": "^5.111.0", + "typescript": "~6.0.3", + "webpack": "^5.111.1", "webpack-cli": "^7.2.3", "webpack-dev-server": "^6.0.0", "webpack-visualizer-plugin2": "^2.0.0" @@ -99,20 +99,20 @@ } }, "node_modules/@babel/core": { - "version": "8.0.5", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-8.0.5.tgz", - "integrity": "sha512-2/oWkgTbBYoqioCWAE4XJobOrzwxTDa5/XjDP3tJ1BhDr/owcd9qnXBp4xc3/2G5X4bvXM04nrxbRJxFcXAxFQ==", + "version": "8.0.6", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-8.0.6.tgz", + "integrity": "sha512-5zwYt1V4ji3mXKKRIAkohSJ29WepxNwxQi+7y7P5AcVPh1dcxnZBU2cfxHnPwS+u9+lZnXPsv30TQaF2xg+Tfg==", "dev": true, "license": "MIT", "dependencies": { - "@babel/code-frame": "^8.0.0", - "@babel/generator": "^8.0.5", - "@babel/helper-compilation-targets": "^8.0.5", + "@babel/code-frame": "^8.0.6", + "@babel/generator": "^8.0.6", + "@babel/helper-compilation-targets": "^8.0.6", "@babel/helpers": "^8.0.5", - "@babel/parser": "^8.0.5", + "@babel/parser": "^8.0.6", "@babel/template": "^8.0.0", - "@babel/traverse": "^8.0.5", - "@babel/types": "^8.0.5", + "@babel/traverse": "^8.0.6", + "@babel/types": "^8.0.6", "@types/gensync": "^1.0.5", "convert-source-map": "^2.0.0", "empathic": "^2.0.1", @@ -131,13 +131,13 @@ } }, "node_modules/@babel/core/node_modules/@babel/code-frame": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-8.0.0.tgz", - "integrity": "sha512-dYYg153EyN2Ekbqw2zAsbd6/JR+9N2SEoC7YV2GyyqMM7x9bLDTjBD6XBhSMLH0wtIVyJj03jWNriQhaN+eoCw==", + "version": "8.0.6", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-8.0.6.tgz", + "integrity": "sha512-uMHhvmDmwFiLuiozaoRYTZHqMFuu3fem/X9JY78lohAuLoh8LSGGC8JqUzo2cVuBsBxkjMZNk56CE7ock8Xxkw==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-validator-identifier": "^8.0.0", + "@babel/helper-validator-identifier": "^8.0.6", "js-tokens": "^10.0.0" }, "engines": { @@ -145,14 +145,14 @@ } }, "node_modules/@babel/core/node_modules/@babel/generator": { - "version": "8.0.5", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-8.0.5.tgz", - "integrity": "sha512-f/TuhuMAxJqhwxEGNsJrswuG9VHmh0oNFoQoo6TbpgtFAz9wYZXcTAcWZMHfp7ljesr0RG04bp3Aos9GI59L7w==", + "version": "8.0.6", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-8.0.6.tgz", + "integrity": "sha512-/pcanjdRsonCexCuxgGD8fKnBLLzk2i9uM4kmcmGyyev2R5YDs+rafMYZ89RvaGY1mW8T7C5au0TyYaEeHBGng==", "dev": true, "license": "MIT", "dependencies": { - "@babel/parser": "^8.0.5", - "@babel/types": "^8.0.5", + "@babel/parser": "^8.0.6", + "@babel/types": "^8.0.6", "@jridgewell/gen-mapping": "0.4.0-beta.0", "@jridgewell/trace-mapping": "^0.3.31", "@types/jsesc": "^2.5.0", @@ -163,9 +163,9 @@ } }, "node_modules/@babel/core/node_modules/@babel/helper-string-parser": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-8.0.0.tgz", - "integrity": "sha512-6mJgmFFFIIO82vvoLt9XtRC7/TkzXfts1t/SpRX4IHSzMgqoPYCWesVu1udUPUWioAE/2fcG6WuI8zrkE1gwrg==", + "version": "8.0.6", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-8.0.6.tgz", + "integrity": "sha512-+6HYEBnsDRZHJtUTAEfMQd0zMDqdFHS7C+5vAsEZqBUr3vEMWOWlHJ0Jz1gS8jJIlCvLsuA6ivmeoqzH936YcA==", "dev": true, "license": "MIT", "engines": { @@ -173,9 +173,9 @@ } }, "node_modules/@babel/core/node_modules/@babel/helper-validator-identifier": { - "version": "8.0.4", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-8.0.4.tgz", - "integrity": "sha512-4wFaiLd0bVo4cIoTXI3zKI038NIWE/cr3jvBjejOVYVxV/m8Ltav1USiGzG1fmS5J2RhgEOgXNNK46cRPnRsrg==", + "version": "8.0.6", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-8.0.6.tgz", + "integrity": "sha512-HYx0YmuchRxRSpnjvcNffnPS8DCauKNmnumIuHG3jnQAVewRA7kfJGwF13ayEpSZs7s4R/oBH4eppuXcAQd5JQ==", "dev": true, "license": "MIT", "engines": { @@ -183,13 +183,13 @@ } }, "node_modules/@babel/core/node_modules/@babel/parser": { - "version": "8.0.5", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-8.0.5.tgz", - "integrity": "sha512-51RXvQNFakaS0bTpYiGkxNbUVwkPO4kONv6EVLorZABxsx+KZ6Z7uSYvi/wmKS/+X+rfj9RvOw0/ZNh+cmI0Rw==", + "version": "8.0.6", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-8.0.6.tgz", + "integrity": "sha512-LpGDIYJAzc3Y3PT9x+FxBrGYu2PlWxLmyN7SwPTzaX0LSwEmFJBsRnPBqmaXF2r1v+Zhz6lNiEJ+7yKtM5+Ugg==", "dev": true, "license": "MIT", "dependencies": { - "@babel/types": "^8.0.5" + "@babel/types": "^8.0.6" }, "bin": { "parser": "bin/babel-parser.js" @@ -199,14 +199,14 @@ } }, "node_modules/@babel/core/node_modules/@babel/types": { - "version": "8.0.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-8.0.5.tgz", - "integrity": "sha512-eVdMqi3ej5aHhyQ2Si6yD2cAWeV8FJK9UrhK5aL0Sd8hu5GhT+YswhVNbVheOGVYMg8kuGuMaUpkB3stjj4z8A==", + "version": "8.0.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-8.0.6.tgz", + "integrity": "sha512-c+xgSWboV2pdwXP67BUWDVRHi2BO5Q3KwxyFVs7taVTY+fsK47/L51ZXQoV9rozHJDNHvJ4v4WEsI/IlxV2l2A==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-string-parser": "^8.0.0", - "@babel/helper-validator-identifier": "^8.0.4" + "@babel/helper-string-parser": "^8.0.6", + "@babel/helper-validator-identifier": "^8.0.6" }, "engines": { "node": "^22.18.0 || >=24.11.0" @@ -295,16 +295,16 @@ } }, "node_modules/@babel/helper-compilation-targets": { - "version": "8.0.5", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-8.0.5.tgz", - "integrity": "sha512-Qk8ahMGooH5mz6uuhoDvfZGkUf/Mf3RTBucVVl4MKx4LKMTv872TeW8O92h15iVtlN8wAROBIpI1aV6x1z0LCQ==", + "version": "8.0.6", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-8.0.6.tgz", + "integrity": "sha512-HTrtZ4+iA0+kzdbCgvdSk1U4pEl3BvpGnlUbualCGNbrVhhQvhgBzurTUmqpWyvyHbWYWaIfdx2mOlL9LJjsew==", "dev": true, "license": "MIT", "dependencies": { "@babel/compat-data": "^8.0.5", "@babel/helper-validator-option": "^8.0.0", "browserslist": "^4.24.0", - "lru-cache": "^11.0.0", + "flru": "1.0.2", "verkit": "^0.3.2" }, "engines": { @@ -383,9 +383,9 @@ } }, "node_modules/@babel/helper-globals": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-8.0.0.tgz", - "integrity": "sha512-lLozHOM6sWWlxNo8CYqHy4MBZeTvHXNgVPBfPOGsjPKUzHC2Az9QwB6gxdQmpwHl6GlQtbGgS+lj5887guDiLw==", + "version": "8.0.6", + "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-8.0.6.tgz", + "integrity": "sha512-OdnA/N52LhzFpeUuVz5YGuSWjc7TPHiFmVYZbPlSgExocO2GwbxVpSni9MVs5wwW+wZ4kPuwBEBN9pIPDYz1mA==", "dev": true, "license": "MIT", "engines": { @@ -888,9 +888,9 @@ } }, "node_modules/@babel/plugin-bugfix-safari-rest-destructuring-rhs-array": { - "version": "8.0.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-rest-destructuring-rhs-array/-/plugin-bugfix-safari-rest-destructuring-rhs-array-8.0.5.tgz", - "integrity": "sha512-e5eeoBASO+893sCNdFE/vQ9STIxkSRtIcQwBmLdfDOWn1nnXDY+/ngqFC5zTSUTRl0yWR3inkPRlOQD4MMHeFg==", + "version": "8.0.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-rest-destructuring-rhs-array/-/plugin-bugfix-safari-rest-destructuring-rhs-array-8.0.6.tgz", + "integrity": "sha512-vk9CzgaQGcTTBL8F0YNr7LBEka6pXP/I5KcMj0oicGXUquWSNqxiijHGQkHF+s8m910NbGMpn5mU2sFV7AQjBA==", "dev": true, "license": "MIT", "dependencies": { @@ -1272,15 +1272,15 @@ } }, "node_modules/@babel/plugin-transform-async-generator-functions": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-8.0.1.tgz", - "integrity": "sha512-kqnSMF1YHBzuiQrl68675i5Ma1oljvo+SJsNEZFZVBu5BUrVIZm9KId3ui2PdtLK2sv2zM8sJnjPDfgLxQlEqQ==", + "version": "8.0.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-8.0.6.tgz", + "integrity": "sha512-4K13qZ2TVi9W/NHMg3y0Fguu63cPjGNZT5TpPctIUDdiuIpxo4jwvySGrPWlD6KD00exvpx6Y6l5foFEpnzDcg==", "dev": true, "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^8.0.1", "@babel/helper-remap-async-to-generator": "^8.0.1", - "@babel/traverse": "^8.0.0" + "@babel/traverse": "^8.0.6" }, "engines": { "node": "^22.18.0 || >=24.11.0" @@ -2556,9 +2556,9 @@ } }, "node_modules/@babel/plugin-transform-regenerator": { - "version": "8.0.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-8.0.5.tgz", - "integrity": "sha512-eSjLoICd0l8SkUAyV7hnVrsDycTVK7DRKXi3Pr1oqAVe37vdd4sesp8t6aZ/Wa23rV2ZQbnYJWDn7pOIf9Z/Jw==", + "version": "8.0.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-8.0.6.tgz", + "integrity": "sha512-ky/yW+PcQfHyOhbQFNkcHOCIHXaEANYaXCucZ1MY1PdSJRjaf3AX/TMKS6nCij73YtU1bVNy7Zx5NWAJy42TQA==", "dev": true, "license": "MIT", "dependencies": { @@ -2942,24 +2942,24 @@ } }, "node_modules/@babel/preset-env": { - "version": "8.0.5", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-8.0.5.tgz", - "integrity": "sha512-0ZiW2jOnEQ3+FV3ro3uh6B5afBT0C2yJHCKvw+s1BOKKXg7VfCvTpGBylN5UFeO2SFtkVJB2KY0tEpdnUjjguw==", + "version": "8.0.6", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-8.0.6.tgz", + "integrity": "sha512-Ekl110OgRBQtibBTXrXyuxhy2p7QxpzWT45cFOZCBFKBan3o8vN54sQ26GtqyTyORSNWKx0GOmIdLTTu/Y+prA==", "dev": true, "license": "MIT", "dependencies": { "@babel/compat-data": "^8.0.5", - "@babel/helper-compilation-targets": "^8.0.5", + "@babel/helper-compilation-targets": "^8.0.6", "@babel/helper-plugin-utils": "^8.0.1", "@babel/helper-validator-option": "^8.0.0", "@babel/plugin-bugfix-firefox-class-in-computed-class-key": "^8.0.1", "@babel/plugin-bugfix-safari-class-field-initializer-scope": "^8.0.1", "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^8.0.1", - "@babel/plugin-bugfix-safari-rest-destructuring-rhs-array": "^8.0.5", + "@babel/plugin-bugfix-safari-rest-destructuring-rhs-array": "^8.0.6", "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^8.0.1", "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": "^8.0.1", "@babel/plugin-transform-arrow-functions": "^8.0.1", - "@babel/plugin-transform-async-generator-functions": "^8.0.1", + "@babel/plugin-transform-async-generator-functions": "^8.0.6", "@babel/plugin-transform-async-to-generator": "^8.0.1", "@babel/plugin-transform-block-scoped-functions": "^8.0.1", "@babel/plugin-transform-block-scoping": "^8.0.5", @@ -2997,7 +2997,7 @@ "@babel/plugin-transform-private-methods": "^8.0.1", "@babel/plugin-transform-private-property-in-object": "^8.0.5", "@babel/plugin-transform-property-literals": "^8.0.1", - "@babel/plugin-transform-regenerator": "^8.0.5", + "@babel/plugin-transform-regenerator": "^8.0.6", "@babel/plugin-transform-regexp-modifiers": "^8.0.1", "@babel/plugin-transform-reserved-words": "^8.0.1", "@babel/plugin-transform-shorthand-properties": "^8.0.1", @@ -3261,18 +3261,18 @@ "license": "MIT" }, "node_modules/@babel/traverse": { - "version": "8.0.5", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-8.0.5.tgz", - "integrity": "sha512-XFfnuvapSc/vJOcUO7kwORSvpBIvraofKEZ2dhT0PjiF21BRCD7YbAFC8UEeDJNeLoQz82/gVqzgX5hCzkCbdg==", + "version": "8.0.6", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-8.0.6.tgz", + "integrity": "sha512-ilYV+qLStGzSKLipJlETdvdtpK3rAuwfCmCoGKv15MU4EoeIuLkespSNoNLFGOPSciEHx9TLWtN5mv0fz5w5mQ==", "dev": true, "license": "MIT", "dependencies": { - "@babel/code-frame": "^8.0.0", - "@babel/generator": "^8.0.5", - "@babel/helper-globals": "^8.0.0", - "@babel/parser": "^8.0.5", + "@babel/code-frame": "^8.0.6", + "@babel/generator": "^8.0.6", + "@babel/helper-globals": "^8.0.6", + "@babel/parser": "^8.0.6", "@babel/template": "^8.0.0", - "@babel/types": "^8.0.5", + "@babel/types": "^8.0.6", "obug": "^2.1.1" }, "engines": { @@ -3280,13 +3280,13 @@ } }, "node_modules/@babel/traverse/node_modules/@babel/code-frame": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-8.0.0.tgz", - "integrity": "sha512-dYYg153EyN2Ekbqw2zAsbd6/JR+9N2SEoC7YV2GyyqMM7x9bLDTjBD6XBhSMLH0wtIVyJj03jWNriQhaN+eoCw==", + "version": "8.0.6", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-8.0.6.tgz", + "integrity": "sha512-uMHhvmDmwFiLuiozaoRYTZHqMFuu3fem/X9JY78lohAuLoh8LSGGC8JqUzo2cVuBsBxkjMZNk56CE7ock8Xxkw==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-validator-identifier": "^8.0.0", + "@babel/helper-validator-identifier": "^8.0.6", "js-tokens": "^10.0.0" }, "engines": { @@ -3294,14 +3294,14 @@ } }, "node_modules/@babel/traverse/node_modules/@babel/generator": { - "version": "8.0.5", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-8.0.5.tgz", - "integrity": "sha512-f/TuhuMAxJqhwxEGNsJrswuG9VHmh0oNFoQoo6TbpgtFAz9wYZXcTAcWZMHfp7ljesr0RG04bp3Aos9GI59L7w==", + "version": "8.0.6", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-8.0.6.tgz", + "integrity": "sha512-/pcanjdRsonCexCuxgGD8fKnBLLzk2i9uM4kmcmGyyev2R5YDs+rafMYZ89RvaGY1mW8T7C5au0TyYaEeHBGng==", "dev": true, "license": "MIT", "dependencies": { - "@babel/parser": "^8.0.5", - "@babel/types": "^8.0.5", + "@babel/parser": "^8.0.6", + "@babel/types": "^8.0.6", "@jridgewell/gen-mapping": "0.4.0-beta.0", "@jridgewell/trace-mapping": "^0.3.31", "@types/jsesc": "^2.5.0", @@ -3312,9 +3312,9 @@ } }, "node_modules/@babel/traverse/node_modules/@babel/helper-string-parser": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-8.0.0.tgz", - "integrity": "sha512-6mJgmFFFIIO82vvoLt9XtRC7/TkzXfts1t/SpRX4IHSzMgqoPYCWesVu1udUPUWioAE/2fcG6WuI8zrkE1gwrg==", + "version": "8.0.6", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-8.0.6.tgz", + "integrity": "sha512-+6HYEBnsDRZHJtUTAEfMQd0zMDqdFHS7C+5vAsEZqBUr3vEMWOWlHJ0Jz1gS8jJIlCvLsuA6ivmeoqzH936YcA==", "dev": true, "license": "MIT", "engines": { @@ -3322,9 +3322,9 @@ } }, "node_modules/@babel/traverse/node_modules/@babel/helper-validator-identifier": { - "version": "8.0.4", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-8.0.4.tgz", - "integrity": "sha512-4wFaiLd0bVo4cIoTXI3zKI038NIWE/cr3jvBjejOVYVxV/m8Ltav1USiGzG1fmS5J2RhgEOgXNNK46cRPnRsrg==", + "version": "8.0.6", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-8.0.6.tgz", + "integrity": "sha512-HYx0YmuchRxRSpnjvcNffnPS8DCauKNmnumIuHG3jnQAVewRA7kfJGwF13ayEpSZs7s4R/oBH4eppuXcAQd5JQ==", "dev": true, "license": "MIT", "engines": { @@ -3332,13 +3332,13 @@ } }, "node_modules/@babel/traverse/node_modules/@babel/parser": { - "version": "8.0.5", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-8.0.5.tgz", - "integrity": "sha512-51RXvQNFakaS0bTpYiGkxNbUVwkPO4kONv6EVLorZABxsx+KZ6Z7uSYvi/wmKS/+X+rfj9RvOw0/ZNh+cmI0Rw==", + "version": "8.0.6", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-8.0.6.tgz", + "integrity": "sha512-LpGDIYJAzc3Y3PT9x+FxBrGYu2PlWxLmyN7SwPTzaX0LSwEmFJBsRnPBqmaXF2r1v+Zhz6lNiEJ+7yKtM5+Ugg==", "dev": true, "license": "MIT", "dependencies": { - "@babel/types": "^8.0.5" + "@babel/types": "^8.0.6" }, "bin": { "parser": "bin/babel-parser.js" @@ -3348,14 +3348,14 @@ } }, "node_modules/@babel/traverse/node_modules/@babel/types": { - "version": "8.0.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-8.0.5.tgz", - "integrity": "sha512-eVdMqi3ej5aHhyQ2Si6yD2cAWeV8FJK9UrhK5aL0Sd8hu5GhT+YswhVNbVheOGVYMg8kuGuMaUpkB3stjj4z8A==", + "version": "8.0.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-8.0.6.tgz", + "integrity": "sha512-c+xgSWboV2pdwXP67BUWDVRHi2BO5Q3KwxyFVs7taVTY+fsK47/L51ZXQoV9rozHJDNHvJ4v4WEsI/IlxV2l2A==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-string-parser": "^8.0.0", - "@babel/helper-validator-identifier": "^8.0.4" + "@babel/helper-string-parser": "^8.0.6", + "@babel/helper-validator-identifier": "^8.0.6" }, "engines": { "node": "^22.18.0 || >=24.11.0" @@ -4170,9 +4170,9 @@ } }, "node_modules/@jest/console": { - "version": "30.5.1", - "resolved": "https://registry.npmjs.org/@jest/console/-/console-30.5.1.tgz", - "integrity": "sha512-u5Ncuc+gXVUwjNMFQOnphHo2Qx2DxyC8Dvpmf4HCx4y0kvSkRRNiQYRixrvOP4V7y52JcSuNxqochCt0PpdHVg==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-30.5.2.tgz", + "integrity": "sha512-e8sQC4pCMHPBrPX7Hk8TJr+DM5dkUnImSTNag8SEWFAFAF6xIz4AJvCKapnrdHnZxep4bxw4PhG+ZbimYBMyKw==", "dev": true, "license": "MIT", "dependencies": { @@ -4198,17 +4198,17 @@ } }, "node_modules/@jest/core": { - "version": "30.5.1", - "resolved": "https://registry.npmjs.org/@jest/core/-/core-30.5.1.tgz", - "integrity": "sha512-BL9g6CJUUhIbdoAflz/Va658erSSXUIvU8XUYiWNTbZljJjZ5yaC9EJ9/dQ19rpbYV3ZOK4sBACqhPaTyhoUIA==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-30.5.2.tgz", + "integrity": "sha512-/jqvFWoJF7LV1a6AUpYMbMm+2yIYsHJfR474H0SCzr9k8tnO/jl9wRg6zSG6lxgf6EozNlCG4amFzWsbZSvvZA==", "dev": true, "license": "MIT", "dependencies": { - "@jest/console": "30.5.1", + "@jest/console": "30.5.2", "@jest/pattern": "30.5.0", - "@jest/reporters": "30.5.1", - "@jest/test-result": "30.5.1", - "@jest/transform": "30.5.1", + "@jest/reporters": "30.5.2", + "@jest/test-result": "30.5.2", + "@jest/transform": "30.5.2", "@jest/types": "30.5.1", "@types/node": "*", "ansi-escapes": "^4.3.2", @@ -4218,18 +4218,18 @@ "fast-json-stable-stringify": "^2.1.0", "graceful-fs": "^4.2.11", "jest-changed-files": "30.5.1", - "jest-config": "30.5.1", + "jest-config": "30.5.2", "jest-haste-map": "30.5.1", "jest-message-util": "30.5.1", "jest-regex-util": "30.5.0", "jest-resolve": "30.5.1", - "jest-resolve-dependencies": "30.5.1", - "jest-runner": "30.5.1", - "jest-runtime": "30.5.1", - "jest-snapshot": "30.5.1", + "jest-resolve-dependencies": "30.5.2", + "jest-runner": "30.5.2", + "jest-runtime": "30.5.2", + "jest-snapshot": "30.5.2", "jest-util": "30.5.1", "jest-validate": "30.5.1", - "jest-watcher": "30.5.1", + "jest-watcher": "30.5.2", "pretty-format": "30.5.1", "slash": "^3.0.0" }, @@ -4295,39 +4295,39 @@ } }, "node_modules/@jest/environment": { - "version": "30.5.1", - "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-30.5.1.tgz", - "integrity": "sha512-eYJAkOsrpwDXPcoLNEG6lN9Zo3Cy35pxnVQD74vyIfsi/Q8wB/lZFsEjU4wrecOgT4ZviQDZaX/cFIJyMdMxTw==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-30.5.2.tgz", + "integrity": "sha512-nwFPOUMbmsjNNRCpnJpB9HbSZu4C07wDDds++5j+j1MezzPLxMPDdbdUVjr2o4RULDOValnDd70taPFI1EtxAg==", "dev": true, "license": "MIT", "dependencies": { - "@jest/fake-timers": "30.5.1", + "@jest/fake-timers": "30.5.2", "@jest/types": "30.5.1", "@types/node": "*", - "jest-mock": "30.5.1" + "jest-mock": "30.5.2" }, "engines": { "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/@jest/expect": { - "version": "30.5.1", - "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-30.5.1.tgz", - "integrity": "sha512-uOGd40P/COyUp9xHf5jeGiGJC2/ANg+2+Tk9/xN5/LxmlY/r/gxsPrx3DTEtaRZsLAX4wgNSLEDELZ5bmVs2bA==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-30.5.2.tgz", + "integrity": "sha512-2E+1Pg6jJxbRjLNLpciC71iri/3qsKJL222/aXJEFwC0VdUSvfS+JZQQLEVjUYYc8t8pQu2MGE3cF2+bNTYRsg==", "dev": true, "license": "MIT", "dependencies": { - "expect": "30.5.1", - "jest-snapshot": "30.5.1" + "expect": "30.5.2", + "jest-snapshot": "30.5.2" }, "engines": { "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, "node_modules/@jest/expect-utils": { - "version": "30.5.1", - "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-30.5.1.tgz", - "integrity": "sha512-WcRWhHQdTMRDpyWKZ/6MINBmovI7zeD+bL8wFjCncRV3NQOwKy1X45IfyblfHR4k/XciIlNEdFL9QjFO+HNKOg==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-30.5.2.tgz", + "integrity": "sha512-d/HOLSrJUlBIl6n3LzOa7cjW3xdePm5H5gQw2lixZ/0h157l9sw3mLblzFqnPcTbhDzhRQdBOX3A3KcG73nm5Q==", "dev": true, "license": "MIT", "dependencies": { @@ -4338,9 +4338,9 @@ } }, "node_modules/@jest/fake-timers": { - "version": "30.5.1", - "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-30.5.1.tgz", - "integrity": "sha512-rEkV6YzpBXo/L9cnj2ibyuYZuyGiNWaPUsyCu3HYJbqCV4jnEiKmf7hId20z8eKjZ0JQ9jtIYKxRSmYB/OYSsA==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-30.5.2.tgz", + "integrity": "sha512-GKk0h0tKT5SpDPxDhPg3r9mm5s8/YCBzVNMOGdRiQXwUiMsjU10mVPlMaQstH6/cu50vOb8N9oQUMETHuwwxKw==", "dev": true, "license": "MIT", "dependencies": { @@ -4348,7 +4348,7 @@ "@sinonjs/fake-timers": "^15.4.0", "@types/node": "*", "jest-message-util": "30.5.1", - "jest-mock": "30.5.1", + "jest-mock": "30.5.2", "jest-util": "30.5.1" }, "engines": { @@ -4366,16 +4366,16 @@ } }, "node_modules/@jest/globals": { - "version": "30.5.1", - "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-30.5.1.tgz", - "integrity": "sha512-VhqvQ251XIC7pk46YymI3HCeBLOdvriDw9zibekodAHEwoVvbVVgpU5H13GvmyOAzxtZCfsm1uvzqkaqJf2I+g==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-30.5.2.tgz", + "integrity": "sha512-62zfS+dL+M5aTNHXCNLyqD+j4oqxTIzDYrZbpqMP8Yn+gvlAGyzC6BSPNb1ZmFOakV1RtFYX/O3FCQXSWmQdgg==", "dev": true, "license": "MIT", "dependencies": { - "@jest/environment": "30.5.1", - "@jest/expect": "30.5.1", + "@jest/environment": "30.5.2", + "@jest/expect": "30.5.2", "@jest/types": "30.5.1", - "jest-mock": "30.5.1" + "jest-mock": "30.5.2" }, "engines": { "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" @@ -4412,16 +4412,16 @@ "license": "MIT" }, "node_modules/@jest/reporters": { - "version": "30.5.1", - "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-30.5.1.tgz", - "integrity": "sha512-RbUXIfv85KxitJn4l3MpAoMilkvXe2QCO5lXxHWftywo/VdZ5vkEoHRDgphcxP6qmoIkUaN8/UZj6NhdkIFdJg==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-30.5.2.tgz", + "integrity": "sha512-ev6E9iG73twQcfAfoTnviuYkr3yOrYbzAtMFCimv2fxHXPIp9PBt2u1wNMt0aYWgl8FPwIcS8oqRJg6alnht4Q==", "dev": true, "license": "MIT", "dependencies": { "@bcoe/v8-coverage": "^0.2.3", - "@jest/console": "30.5.1", - "@jest/test-result": "30.5.1", - "@jest/transform": "30.5.1", + "@jest/console": "30.5.2", + "@jest/test-result": "30.5.2", + "@jest/transform": "30.5.2", "@jest/types": "30.5.1", "@jridgewell/trace-mapping": "^0.3.31", "@types/node": "*", @@ -4494,9 +4494,9 @@ } }, "node_modules/@jest/source-map": { - "version": "30.5.0", - "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-30.5.0.tgz", - "integrity": "sha512-xWpTJP9D0bDFGbPGT8XuWSwwha/iHADyyKzUnMx4UbdgnHugxrDaQFO4RZ8x4ZsFzRP6pNii8uvlgKCDxCIuDg==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-30.5.2.tgz", + "integrity": "sha512-c5CehvkbfHX6yyNg7bMn2ylqlp9AHXuZ/3hPH/Lh5bxD/vefd/lV9HBjMqXef9yQNqkdwyZvkLSVSwB38hy8Qw==", "dev": true, "license": "MIT", "dependencies": { @@ -4510,13 +4510,13 @@ } }, "node_modules/@jest/test-result": { - "version": "30.5.1", - "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-30.5.1.tgz", - "integrity": "sha512-A/1S6ZBdpic50E0pxLgvaB9XNPL4k7AksmG69OO2oiotxciWZwHkbOec+qbIi+uUtIIByOVlXJUl97oZUsz+Jw==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-30.5.2.tgz", + "integrity": "sha512-eO6YU5rsLfs60ne694e0IAmRgeBnoA8mu0nlxXDbl/1j5km0o2vO9/VbbUIKIH+WRKKEI+ELgwraRGn2Lhep8g==", "dev": true, "license": "MIT", "dependencies": { - "@jest/console": "30.5.1", + "@jest/console": "30.5.2", "@jest/types": "30.5.1", "@types/istanbul-lib-coverage": "^2.0.6", "collect-v8-coverage": "^1.0.2" @@ -4526,13 +4526,13 @@ } }, "node_modules/@jest/test-sequencer": { - "version": "30.5.1", - "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-30.5.1.tgz", - "integrity": "sha512-SHcPnrjdVRYJv6y6l4JUTy4Jccu7zmO6BmiOfOA34UiVBto22s19WiDC0A/2qfM7MWB/qdcoqfSIRMitpjTT4A==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-30.5.2.tgz", + "integrity": "sha512-bmij8jZyYAC47ExT2GeP7PcrlwSNS+Bp3KeRuBH88gpcxqDv6fljN8PemS4J/lLZ79xb6mpaennQTTq0zUAVVg==", "dev": true, "license": "MIT", "dependencies": { - "@jest/test-result": "30.5.1", + "@jest/test-result": "30.5.2", "graceful-fs": "^4.2.11", "jest-haste-map": "30.5.1", "slash": "^3.0.0" @@ -4552,9 +4552,9 @@ } }, "node_modules/@jest/transform": { - "version": "30.5.1", - "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-30.5.1.tgz", - "integrity": "sha512-EDnDhn0jleU9ZhpVoA4gvqw+Ev0iw/r5upNT2b79RiwiaTiYAMMhvNJP3lmocjIe5J2ZkoNr0B3K/J6O5GIm4Q==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-30.5.2.tgz", + "integrity": "sha512-LBGwmaE886C41jDZ65eqR1YbXM7642MK3ZhTowZd5+xDlrDLuf4ePuDdDmVSvcr8NTVJ3MqxLkMbUCzuigUaoQ==", "dev": true, "license": "MIT", "dependencies": { @@ -6501,9 +6501,9 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "26.5.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-26.5.1.tgz", - "integrity": "sha512-CzNm2FezW4VR/LjG6yUdiEgLE/rAQ9Slj5gCu/C2VrdcW7I0ahNZ8DRbHT7zOZ6r3ONgd/bsQIeSaoDGrd1C6g==", + "version": "26.6.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-26.6.6.tgz", + "integrity": "sha512-MzQj+8Kx3XI40OmUAE6Qoh58ZMNstNNMwn2nfd3qWsfe7nDNSqJNzes4njhz6AHwrSHOffSLwXU6yb474Q4aog==", "dev": true, "license": "MIT", "dependencies": { @@ -6869,397 +6869,6 @@ "url": "https://opencollective.com/eslint" } }, - "node_modules/@typescript/native": { - "name": "typescript", - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-7.0.2.tgz", - "integrity": "sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA==", - "dev": true, - "license": "Apache-2.0", - "bin": { - "tsc": "bin/tsc" - }, - "engines": { - "node": ">=16.20.0" - }, - "optionalDependencies": { - "@typescript/typescript-aix-ppc64": "7.0.2", - "@typescript/typescript-darwin-arm64": "7.0.2", - "@typescript/typescript-darwin-x64": "7.0.2", - "@typescript/typescript-freebsd-arm64": "7.0.2", - "@typescript/typescript-freebsd-x64": "7.0.2", - "@typescript/typescript-linux-arm": "7.0.2", - "@typescript/typescript-linux-arm64": "7.0.2", - "@typescript/typescript-linux-loong64": "7.0.2", - "@typescript/typescript-linux-mips64el": "7.0.2", - "@typescript/typescript-linux-ppc64": "7.0.2", - "@typescript/typescript-linux-riscv64": "7.0.2", - "@typescript/typescript-linux-s390x": "7.0.2", - "@typescript/typescript-linux-x64": "7.0.2", - "@typescript/typescript-netbsd-arm64": "7.0.2", - "@typescript/typescript-netbsd-x64": "7.0.2", - "@typescript/typescript-openbsd-arm64": "7.0.2", - "@typescript/typescript-openbsd-x64": "7.0.2", - "@typescript/typescript-sunos-x64": "7.0.2", - "@typescript/typescript-win32-arm64": "7.0.2", - "@typescript/typescript-win32-x64": "7.0.2" - } - }, - "node_modules/@typescript/old": { - "name": "typescript", - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.3.tgz", - "integrity": "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==", - "dev": true, - "license": "Apache-2.0", - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } - }, - "node_modules/@typescript/typescript-aix-ppc64": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-aix-ppc64/-/typescript-aix-ppc64-7.0.2.tgz", - "integrity": "sha512-MTKKkWB7p/0E9xi1d1tHtZ5PiLkGEMIq88pK2CubZjOsLtYTLqhgIgi6zepFa+9GHZ6h05NMCkQxGKiPXMxXtQ==", - "cpu": [ - "ppc64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "aix" - ], - "engines": { - "node": ">=16.20.0" - } - }, - "node_modules/@typescript/typescript-darwin-arm64": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-darwin-arm64/-/typescript-darwin-arm64-7.0.2.tgz", - "integrity": "sha512-gowzar9MwS/aRWp6f3a4KUqzRjAZjOsmGNCM6LcTgXum+dBfgsBVMN+AgvOCCbguXyick6LJhpBszxMebJ8syA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=16.20.0" - } - }, - "node_modules/@typescript/typescript-darwin-x64": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-darwin-x64/-/typescript-darwin-x64-7.0.2.tgz", - "integrity": "sha512-SZ9xZInqApNlNGc9s0W1VSsktYSOe9cFqNOIqmN1Gs8SmkjKZYFt017G4VwPxASInODuAdbTW7sXiFUf893RgA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=16.20.0" - } - }, - "node_modules/@typescript/typescript-freebsd-arm64": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-freebsd-arm64/-/typescript-freebsd-arm64-7.0.2.tgz", - "integrity": "sha512-W5NH4y/J0plIIS5b2xvTEkU7JFxyqdMAOgf+Ilhl0vHQXKO5dZoxd+C/jEtq56c4F3wk71RB4BMRQ2XdI+bwYQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=16.20.0" - } - }, - "node_modules/@typescript/typescript-freebsd-x64": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-freebsd-x64/-/typescript-freebsd-x64-7.0.2.tgz", - "integrity": "sha512-UMGDx5sTpzNw3WiPebH7l90IWfJggEd+egHt/q6p7/Cm3zqoV7VxkGXt+3DxPIw8CcmvAB0j3sVVfbhX+M4Tpw==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=16.20.0" - } - }, - "node_modules/@typescript/typescript-linux-arm": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-arm/-/typescript-linux-arm-7.0.2.tgz", - "integrity": "sha512-gffT3xPz9sR7j/YJExkyPntrI0P2EP9XbOyWzth2/Gs0RstK+90RBcO0ncXoXy/beYll1SXw846Nf2zdnEz0QQ==", - "cpu": [ - "arm" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=16.20.0" - } - }, - "node_modules/@typescript/typescript-linux-arm64": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-arm64/-/typescript-linux-arm64-7.0.2.tgz", - "integrity": "sha512-Qh4eU4/y3yDjnfjjyPYihMj5/ODIlmt+Bzu17OI+fiSRDW57QmU5SiN63exPRNJPKUzcc1INa1NXdrJ+MqHjUQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=16.20.0" - } - }, - "node_modules/@typescript/typescript-linux-loong64": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-loong64/-/typescript-linux-loong64-7.0.2.tgz", - "integrity": "sha512-uEHck9i8hoAzXPiYRib1O7miOnz23SxIeVl6F4LXox+qov1K35jHcEW6VHKvZI+pyvl7fZEP4MCU5LYvIq1GuQ==", - "cpu": [ - "loong64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=16.20.0" - } - }, - "node_modules/@typescript/typescript-linux-mips64el": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-mips64el/-/typescript-linux-mips64el-7.0.2.tgz", - "integrity": "sha512-R4KvAMnE43W5Qeqb0Ly56O3mWMWIAgsMyz36DCaycd5nbg/9kzm0liw3JocfRqyJY0KPmzFjbswozXyW0DnIYA==", - "cpu": [ - "mips64el" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=16.20.0" - } - }, - "node_modules/@typescript/typescript-linux-ppc64": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-ppc64/-/typescript-linux-ppc64-7.0.2.tgz", - "integrity": "sha512-DORx5b3sd/4S7eayxm4FQv+A7CrkUIGRaHiwI8oiHTAI1fAPWhF4J0vAlkC8biAlHSVVwxMQ3tjZ2/DVbnQiiA==", - "cpu": [ - "ppc64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=16.20.0" - } - }, - "node_modules/@typescript/typescript-linux-riscv64": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-riscv64/-/typescript-linux-riscv64-7.0.2.tgz", - "integrity": "sha512-wf0jqEDOjrPRnKwYRyyJDRo11KMbvMFrU+q4zqKyChODBzvlkbhNQfKvLxQCcwTpdDaXSHZTVuh0JoCrKCUMHQ==", - "cpu": [ - "riscv64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=16.20.0" - } - }, - "node_modules/@typescript/typescript-linux-s390x": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-s390x/-/typescript-linux-s390x-7.0.2.tgz", - "integrity": "sha512-IkwJc3L7yhytWd/ewjyxNDfOmswCm9GWMJT/ue/dU4aZNbwZeYAetq42VyLmsmSjvoX7z74X6ZaYCtzAr0EuGw==", - "cpu": [ - "s390x" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=16.20.0" - } - }, - "node_modules/@typescript/typescript-linux-x64": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-x64/-/typescript-linux-x64-7.0.2.tgz", - "integrity": "sha512-EYdf2cNg7rgCWJnxCdJ+F3V39O8ihb37eHAu1LK8oAFizgTQbPOK7zHHXbPt8rX24COqODXeI3sIf0fCXG7H/A==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=16.20.0" - } - }, - "node_modules/@typescript/typescript-netbsd-arm64": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-netbsd-arm64/-/typescript-netbsd-arm64-7.0.2.tgz", - "integrity": "sha512-+polYF4MF04aPpO5FTkHran9yUQDSXqy5GiSDKpsll5jy3l3+g9QLhpf39T+ePtefhXLOGrLl0QIjkQP6VnelA==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=16.20.0" - } - }, - "node_modules/@typescript/typescript-netbsd-x64": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-netbsd-x64/-/typescript-netbsd-x64-7.0.2.tgz", - "integrity": "sha512-8YIT0EHM/3dq10ZOVF/A7pc/YSMtbcecct4rWtexrnSCHOPcpC2KTLXfTCR6vDpnSiY12heNb1GiN/wu+T/FyA==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=16.20.0" - } - }, - "node_modules/@typescript/typescript-openbsd-arm64": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-openbsd-arm64/-/typescript-openbsd-arm64-7.0.2.tgz", - "integrity": "sha512-APT8+ClYnuYm1u9+kgGXoMj2VzWzcymwh2gNSQVySHfkRDGOTVkoWLjCmOQSaO+PoqQ57B0flRp9SA+7GnnkzQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=16.20.0" - } - }, - "node_modules/@typescript/typescript-openbsd-x64": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-openbsd-x64/-/typescript-openbsd-x64-7.0.2.tgz", - "integrity": "sha512-yX7s+Q0Dln0Dt9tEzZsAjXXR/+ytBM7AlglaqyeMPxQszJ1JhlJdZ6jLA+IzldHtflX81em7lDao1xXu+aRRkg==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=16.20.0" - } - }, - "node_modules/@typescript/typescript-sunos-x64": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-sunos-x64/-/typescript-sunos-x64-7.0.2.tgz", - "integrity": "sha512-dLJDGaLZ1D4HPQn62u1n8mBDkJREwMsAkCdkwd4Ieqw+x3TUyTsqY0YiBCtE6H6OzzgGk3iuZ3vFWRS+E8/d1g==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "sunos" - ], - "engines": { - "node": ">=16.20.0" - } - }, - "node_modules/@typescript/typescript-win32-arm64": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-win32-arm64/-/typescript-win32-arm64-7.0.2.tgz", - "integrity": "sha512-Gyl1Vy6OsWesLzmq+EP0Fb7b4Nid5232AvcA2SFcdYreldpNtYFFofPjnt62y9hQy7VTaZp65ICJjuAQRaVcIQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=16.20.0" - } - }, - "node_modules/@typescript/typescript-win32-x64": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript-win32-x64/-/typescript-win32-x64-7.0.2.tgz", - "integrity": "sha512-0BQ3HkAHHlKLSp1qRvf3SUhGpGsDuhB/jgFw75guyqbxJqEaS0Cw/VFO8i2nHglJUzQCRtMMR/IBAKE3ETMC4g==", - "cpu": [ - "x64" - ], - "dev": true, - "license": "Apache-2.0", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=16.20.0" - } - }, "node_modules/@ungap/structured-clone": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.4.0.tgz", @@ -7928,19 +7537,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/ansi-escapes/node_modules/type-fest": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", - "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", - "dev": true, - "license": "(MIT OR CC0-1.0)", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/ansi-html-community": { "version": "0.0.8", "resolved": "https://registry.npmjs.org/ansi-html-community/-/ansi-html-community-0.0.8.tgz", @@ -8224,9 +7820,9 @@ } }, "node_modules/autoprefixer": { - "version": "10.6.0", - "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.6.0.tgz", - "integrity": "sha512-A26d6qs9kqGgkmImIXMYvXTzqb4Qv7AVgpY1NXzr9Y659J8qHHnLOO/zE8ewIGFMprOolAoRAQYDgNryXIJKBw==", + "version": "10.6.1", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.6.1.tgz", + "integrity": "sha512-cL1Qz6ADZhcEbny/8HPfe99J6HhNoYtpX2LFLIbhgGE7Q1hlQVkYFdetDN7Id3KiQxhDrHwzlHr/YQCnZ8+xSA==", "dev": true, "funding": [ { @@ -8297,13 +7893,13 @@ } }, "node_modules/babel-jest": { - "version": "30.5.1", - "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-30.5.1.tgz", - "integrity": "sha512-ge1xUVZS91ml09YRMgRGgeKJ4YJpcOiuwteAxFBYLugQyp7cRw+hHej6Ho0vPjvLrjq60bb7JPHH9LAMA1/krA==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-30.5.2.tgz", + "integrity": "sha512-ES8WeJ2fNWPEDunyAtUfJ12nHyaWUloCHdkfK2oW5uSoQSUmjNKdWiGaXJITJwvFEWoD/evHEg/QoCXAvLaQqQ==", "dev": true, "license": "MIT", "dependencies": { - "@jest/transform": "30.5.1", + "@jest/transform": "30.5.2", "@types/babel__core": "^7.20.5", "babel-plugin-istanbul": "^8.0.0", "babel-preset-jest": "30.5.0", @@ -9610,11 +9206,14 @@ "license": "MIT" }, "node_modules/dotenv": { - "version": "17.4.2", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-17.4.2.tgz", - "integrity": "sha512-nI4U3TottKAcAD9LLud4Cb7b2QztQMUEfHbvhTH09bqXTxnSie8WnjPALV/WMCrJZ6UV/qHJ6L03OqO3LcdYZw==", + "version": "18.0.1", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-18.0.1.tgz", + "integrity": "sha512-0eR4m4D/jH5eaI3evo2ZqqMii5mrTCR12v12VChdie6O1gPHs7XAjzTep0CWc1Bd+oNx3vVfbi734dK4zghigw==", "dev": true, "license": "BSD-2-Clause", + "bin": { + "dotenv": "dist/index.cjs" + }, "engines": { "node": ">=12" }, @@ -11126,17 +10725,17 @@ } }, "node_modules/expect": { - "version": "30.5.1", - "resolved": "https://registry.npmjs.org/expect/-/expect-30.5.1.tgz", - "integrity": "sha512-m8YrYgvKe9+9gEnWEuKz+qCGfHqkrff7PPfyDnOFkjsfYRKqiYyOxDFMFieCGAuhtk/VNm63tvNgKZVzVy+Hvg==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/expect/-/expect-30.5.2.tgz", + "integrity": "sha512-0LNuMvs8/5mRYhnCR4k+lGV7fqPMs6Bnksda4S3zsCUmdxBpAn4zU4NNzXdq1pMKe/H4W5t/zVIDSJ/H3e0vDA==", "dev": true, "license": "MIT", "dependencies": { - "@jest/expect-utils": "30.5.1", + "@jest/expect-utils": "30.5.2", "@jest/get-type": "30.5.0", - "jest-matcher-utils": "30.5.1", + "jest-matcher-utils": "30.5.2", "jest-message-util": "30.5.1", - "jest-mock": "30.5.1", + "jest-mock": "30.5.2", "jest-util": "30.5.1" }, "engines": { @@ -11368,6 +10967,16 @@ "dev": true, "license": "ISC" }, + "node_modules/flru": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/flru/-/flru-1.0.2.tgz", + "integrity": "sha512-kWyh8ADvHBFz6ua5xYOPnUroZTT/bwWfrCeL0Wj1dzG4/YOmOcfJ99W8dOVyyynJN35rZ9aCOtHChqQovV7yog==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/for-each": { "version": "0.3.5", "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.5.tgz", @@ -13220,35 +12829,6 @@ "node": ">=10" } }, - "node_modules/istanbul-lib-report/node_modules/make-dir": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", - "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", - "dev": true, - "license": "MIT", - "dependencies": { - "semver": "^7.5.3" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/istanbul-lib-report/node_modules/semver": { - "version": "7.8.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", - "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/istanbul-lib-source-maps": { "version": "5.0.6", "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-5.0.6.tgz", @@ -13313,16 +12893,16 @@ } }, "node_modules/jest": { - "version": "30.5.1", - "resolved": "https://registry.npmjs.org/jest/-/jest-30.5.1.tgz", - "integrity": "sha512-3qrR8+ZXFnn7y0H2yjWQNkGGBLBY4zTRoTMAq9zJcgwLLtlyonfsCLviIXK9xuE2KgIyM+M36AFcoK2DgFR36w==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/jest/-/jest-30.5.2.tgz", + "integrity": "sha512-3gnpdBIza8ijCl3iMV9ChE3hSt1+46865qqod863gQtJr1DixOkAU5DoGbi3u+XlRcw++BhZQMu/y4xBdHBvSQ==", "dev": true, "license": "MIT", "dependencies": { - "@jest/core": "30.5.1", + "@jest/core": "30.5.2", "@jest/types": "30.5.1", "import-local": "^3.2.0", - "jest-cli": "30.5.1" + "jest-cli": "30.5.2" }, "bin": { "jest": "bin/jest.js" @@ -13355,26 +12935,26 @@ } }, "node_modules/jest-circus": { - "version": "30.5.1", - "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-30.5.1.tgz", - "integrity": "sha512-NgliezXQ6yznqR4W5Gqw++0cZSbBZlF0NknNIAE5VmSJKWOtmWJmWnBq3TSkUOVBTPrT7FGGhVdA8DLWnxo2Sw==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-30.5.2.tgz", + "integrity": "sha512-vffFgjs5JSJ9q4ds1vNW3klKYPJfYfIY61LT/zaZgvTeASJOWZUt8LBfHgIcV4rwxlPBLl/ePBGccHEclS4PlQ==", "dev": true, "license": "MIT", "dependencies": { - "@jest/environment": "30.5.1", - "@jest/expect": "30.5.1", - "@jest/test-result": "30.5.1", + "@jest/environment": "30.5.2", + "@jest/expect": "30.5.2", + "@jest/test-result": "30.5.2", "@jest/types": "30.5.1", "@types/node": "*", "chalk": "^4.1.2", "co": "^4.6.0", "dedent": "^1.6.0", "is-generator-fn": "^2.1.0", - "jest-each": "30.5.1", - "jest-matcher-utils": "30.5.1", + "jest-each": "30.5.2", + "jest-matcher-utils": "30.5.2", "jest-message-util": "30.5.1", - "jest-runtime": "30.5.1", - "jest-snapshot": "30.5.1", + "jest-runtime": "30.5.2", + "jest-snapshot": "30.5.2", "jest-util": "30.5.1", "p-limit": "^3.1.0", "pretty-format": "30.5.1", @@ -13426,19 +13006,19 @@ } }, "node_modules/jest-cli": { - "version": "30.5.1", - "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-30.5.1.tgz", - "integrity": "sha512-uwNYepWgaNBCplm42fCIUZTf/tIEHIy5AYvx7eL1BrwIgyjPt+2poouR23UO2yopIP+kV8oZFHfv+l4pg/8prQ==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-30.5.2.tgz", + "integrity": "sha512-YYYxUUVjFgPvgEleKNKMaYGIFgR3l3832Cl0kRL/oCiDZ03v7wImUtquHl2OOBCCNgprjZgBN5bczS/JklPBDg==", "dev": true, "license": "MIT", "dependencies": { - "@jest/core": "30.5.1", - "@jest/test-result": "30.5.1", + "@jest/core": "30.5.2", + "@jest/test-result": "30.5.2", "@jest/types": "30.5.1", "chalk": "^4.1.2", "exit-x": "^0.2.2", "import-local": "^3.2.0", - "jest-config": "30.5.1", + "jest-config": "30.5.2", "jest-util": "30.5.1", "jest-validate": "30.5.1", "yargs": "^17.7.2" @@ -13459,29 +13039,29 @@ } }, "node_modules/jest-config": { - "version": "30.5.1", - "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-30.5.1.tgz", - "integrity": "sha512-L8PKM2X/ngG8PxfLMqglKGZjylPgw84bVPUlMY9W/o76TnLqPWrmQgsaT0HrheGdRtpGE5FbmREA0Kvb+Qx5gQ==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-30.5.2.tgz", + "integrity": "sha512-U6221OZekabePvGcGPf4raIBKMvYQWFHvhobDJRojOYaFMj2HaGytAdknjDhYc6JTz2fdHW9+6k0wWUDaNeOFQ==", "dev": true, "license": "MIT", "dependencies": { "@babel/core": "^7.27.4", "@jest/get-type": "30.5.0", "@jest/pattern": "30.5.0", - "@jest/test-sequencer": "30.5.1", + "@jest/test-sequencer": "30.5.2", "@jest/types": "30.5.1", - "babel-jest": "30.5.1", + "babel-jest": "30.5.2", "chalk": "^4.1.2", "ci-info": "^4.2.0", "deepmerge": "^4.3.1", "glob": "^13.0.6", "graceful-fs": "^4.2.11", - "jest-circus": "30.5.1", + "jest-circus": "30.5.2", "jest-docblock": "30.5.0", - "jest-environment-node": "30.5.1", + "jest-environment-node": "30.5.2", "jest-regex-util": "30.5.0", "jest-resolve": "30.5.1", - "jest-runner": "30.5.1", + "jest-runner": "30.5.2", "jest-util": "30.5.1", "jest-validate": "30.5.1", "parse-json": "^5.2.0", @@ -13717,9 +13297,9 @@ } }, "node_modules/jest-diff": { - "version": "30.5.1", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-30.5.1.tgz", - "integrity": "sha512-e3cNNMpv8Kh20MjjphTXs+3Vz7DQyLM1nft7KJhnh46atFhjVJRa+0Hq0beywuwsACtMQUBihQkFl8zxb7gt1Q==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-30.5.2.tgz", + "integrity": "sha512-rBtHnI6BWTiWj3lM7fOLVfChx7R9B0u9VV3PRHawKs79x6ZjW1QoSrKenaigNGWlvhtoi2BqvDbABDie+Os3xQ==", "dev": true, "license": "MIT", "dependencies": { @@ -13775,15 +13355,16 @@ } }, "node_modules/jest-each": { - "version": "30.5.1", - "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-30.5.1.tgz", - "integrity": "sha512-S1af0TU4v1EZ/AUlkFs/sxf/5KGsbAT9kRgdyoMX/x72y7C8ZEgETE5o1TPnbKRnrbprc5FR/moYLfdRmqEjsQ==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-30.5.2.tgz", + "integrity": "sha512-GRrW+7fmmgmkvyfEBqc1QFdWnF1Ex5yG6Y6AWL4TTxnkWlKIT98dsKh3P3UuWm6v4XsQwVE6DEzXIPMzWJ3ZbA==", "dev": true, "license": "MIT", "dependencies": { "@jest/get-type": "30.5.0", "@jest/types": "30.5.1", "chalk": "^4.1.2", + "jest-regex-util": "30.5.0", "jest-util": "30.5.1", "pretty-format": "30.5.1" }, @@ -13821,17 +13402,17 @@ } }, "node_modules/jest-environment-node": { - "version": "30.5.1", - "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-30.5.1.tgz", - "integrity": "sha512-LrPj3sPMjsQoOB3jrb8p/sa+XkSFNKo60TTsyc+EB2kxQJHgbwElpXnx1yX25fdFn5958FIObRtcLSHyV8VIAw==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-30.5.2.tgz", + "integrity": "sha512-Ciz4KgTGIbojxSKpuFImgWJj5EyqfE8xMq9NxWmOXnQywHHS03H9Mv+vaCB29J5pr3JBrY27WbRV18rBdjh8Dg==", "dev": true, "license": "MIT", "dependencies": { - "@jest/environment": "30.5.1", - "@jest/fake-timers": "30.5.1", + "@jest/environment": "30.5.2", + "@jest/fake-timers": "30.5.2", "@jest/types": "30.5.1", "@types/node": "*", - "jest-mock": "30.5.1", + "jest-mock": "30.5.2", "jest-util": "30.5.1", "jest-validate": "30.5.1" }, @@ -13839,6 +13420,19 @@ "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" } }, + "node_modules/jest-fail-on-console": { + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/jest-fail-on-console/-/jest-fail-on-console-3.3.4.tgz", + "integrity": "sha512-ckcABlg7ZLy83RRVOE1YvJMF1thgVPozVp+DjnE36Z1CaIbTrSeSR2AU4de/SEpfFgp2qK62EHXfm47N74zMuw==", + "dev": true, + "license": "MIT", + "engines": { + "yarn": "1.x" + }, + "peerDependencies": { + "@jest/globals": ">=27.5.1" + } + }, "node_modules/jest-haste-map": { "version": "30.5.1", "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-30.5.1.tgz", @@ -13937,15 +13531,15 @@ } }, "node_modules/jest-matcher-utils": { - "version": "30.5.1", - "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-30.5.1.tgz", - "integrity": "sha512-aroZVqwOz/wC2y6pC+obgFWKV9viaQWQTTSB6W5H55+egtUczIfXR/rxExTv92xD/ADYwpqaYfVWx1aqwKg7FA==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-30.5.2.tgz", + "integrity": "sha512-lFkB365PTIHOhPzwrb9T6gvlDnPpOZ7/c3ewOKKB7bzztqjVrtlyRL2MkyfJXpyY2u2SKw001JKrTx14fBUFcQ==", "dev": true, "license": "MIT", "dependencies": { "@jest/get-type": "30.5.0", "chalk": "^4.1.2", - "jest-diff": "30.5.1", + "jest-diff": "30.5.2", "pretty-format": "30.5.1" }, "engines": { @@ -14056,13 +13650,13 @@ } }, "node_modules/jest-mock": { - "version": "30.5.1", - "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-30.5.1.tgz", - "integrity": "sha512-9fVjc3leUpGID2/by/LU4Dvdcp7PFh9LlxS3QRWK3ABm+KtvEVsG/AEGeLY3gKOZsjkBxyfwGltoAVlW7dygHg==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-30.5.2.tgz", + "integrity": "sha512-KTHb37Fhj8xY8qPFvTFaFJHcdsumQp+ExsUlgoX232Agmc706gagBs53+CYvulV7MVQo9AgXOUxsqzzVBoJlrA==", "dev": true, "license": "MIT", "dependencies": { - "@jest/expect-utils": "30.5.1", + "@jest/expect-utils": "30.5.2", "@jest/types": "30.5.1", "@types/node": "*", "jest-util": "30.5.1" @@ -14101,14 +13695,14 @@ } }, "node_modules/jest-resolve-dependencies": { - "version": "30.5.1", - "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-30.5.1.tgz", - "integrity": "sha512-JKpXGONDcTaunrNVn8KCl6qAnwl06jIkvv70lhq0Ze47lsPx9sH5HoeEUiXX6iFGnliHN/qpIbQ0l38wrVmXaw==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-30.5.2.tgz", + "integrity": "sha512-GMI0DP5enX9Z2qW2zFy1bOkrCfWAOPRJQ7qHt0pdfrxBPsgWxglMPrRSK2TX/wRWYxcPRSLFg3Z88qPOzHx7FQ==", "dev": true, "license": "MIT", "dependencies": { "jest-regex-util": "30.5.0", - "jest-snapshot": "30.5.1" + "jest-snapshot": "30.5.2" }, "engines": { "node": "^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0" @@ -14125,17 +13719,17 @@ } }, "node_modules/jest-runner": { - "version": "30.5.1", - "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-30.5.1.tgz", - "integrity": "sha512-FPlQE4+mwnFxXmpPrSi836KV2ZzvK1g6/nPCT8o5BcoDUUNJQeHo1/Qdkoe/QeoL4M7OeJpbnGUhYKhC1VMdaQ==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-30.5.2.tgz", + "integrity": "sha512-/B6px7hiiNhVSRwuv9AGn0nawYvwsHeQZ3ItTd5Gp2diFd0EOKaWVeWqcbw3L88vx1GfpCKjQkxWItZCTl11Rw==", "dev": true, "license": "MIT", "dependencies": { - "@jest/console": "30.5.1", - "@jest/environment": "30.5.1", - "@jest/source-map": "30.5.0", - "@jest/test-result": "30.5.1", - "@jest/transform": "30.5.1", + "@jest/console": "30.5.2", + "@jest/environment": "30.5.2", + "@jest/source-map": "30.5.2", + "@jest/test-result": "30.5.2", + "@jest/transform": "30.5.2", "@jest/types": "30.5.1", "@types/node": "*", "chalk": "^4.1.2", @@ -14143,14 +13737,14 @@ "exit-x": "^0.2.2", "graceful-fs": "^4.2.11", "jest-docblock": "30.5.0", - "jest-environment-node": "30.5.1", + "jest-environment-node": "30.5.2", "jest-haste-map": "30.5.1", "jest-leak-detector": "30.5.1", "jest-message-util": "30.5.1", "jest-resolve": "30.5.1", - "jest-runtime": "30.5.1", + "jest-runtime": "30.5.2", "jest-util": "30.5.1", - "jest-watcher": "30.5.1", + "jest-watcher": "30.5.2", "jest-worker": "30.5.1", "p-limit": "^3.1.0" }, @@ -14159,18 +13753,18 @@ } }, "node_modules/jest-runtime": { - "version": "30.5.1", - "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-30.5.1.tgz", - "integrity": "sha512-UB88+NRkK2Tw/OqV7dofYcyiUGrVZtD41k/N0xQOs9fG//57XHK7JLWG52HD1UYpUAhjK4xm6DBvFX3yWudsMA==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-30.5.2.tgz", + "integrity": "sha512-0paUAHBlheai10A3XSy9Xh+YBG0IROy+/qzcDPzQ/nbbXrznQzeWy5qniICWK6d3W3scaRQCVAbXdcK0ibBq4w==", "dev": true, "license": "MIT", "dependencies": { - "@jest/environment": "30.5.1", - "@jest/fake-timers": "30.5.1", - "@jest/globals": "30.5.1", - "@jest/source-map": "30.5.0", - "@jest/test-result": "30.5.1", - "@jest/transform": "30.5.1", + "@jest/environment": "30.5.2", + "@jest/fake-timers": "30.5.2", + "@jest/globals": "30.5.2", + "@jest/source-map": "30.5.2", + "@jest/test-result": "30.5.2", + "@jest/transform": "30.5.2", "@jest/types": "30.5.1", "@types/node": "*", "chalk": "^4.1.2", @@ -14181,10 +13775,10 @@ "graceful-fs": "^4.2.11", "jest-haste-map": "30.5.1", "jest-message-util": "30.5.1", - "jest-mock": "30.5.1", + "jest-mock": "30.5.2", "jest-regex-util": "30.5.0", "jest-resolve": "30.5.1", - "jest-snapshot": "30.5.1", + "jest-snapshot": "30.5.2", "jest-util": "30.5.1", "slash": "^3.0.0", "strip-bom": "^4.0.0" @@ -14204,9 +13798,9 @@ } }, "node_modules/jest-snapshot": { - "version": "30.5.1", - "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-30.5.1.tgz", - "integrity": "sha512-cNWFdSb5xuDGl8hKkAZJ3YtI/PzHpAPFV+HUXWIOG8rMhpDTLVbvAc2d2wRicoYw2wGsJGLaurJT6BLC97bLXQ==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-30.5.2.tgz", + "integrity": "sha512-jKIdes25AnAH73dOCi2qE6J6vHJ6L2vyBS11M89kT50DVJcLTf2AOjvcc+2vVaN8lUbY5v2R83aqXo3Ro9fqYA==", "dev": true, "license": "MIT", "dependencies": { @@ -14215,17 +13809,17 @@ "@babel/plugin-syntax-jsx": "^7.27.1", "@babel/plugin-syntax-typescript": "^7.27.1", "@babel/types": "^7.27.3", - "@jest/expect-utils": "30.5.1", + "@jest/expect-utils": "30.5.2", "@jest/get-type": "30.5.0", "@jest/snapshot-utils": "30.5.1", - "@jest/transform": "30.5.1", + "@jest/transform": "30.5.2", "@jest/types": "30.5.1", "babel-preset-current-node-syntax": "^1.2.0", "chalk": "^4.1.2", - "expect": "30.5.1", + "expect": "30.5.2", "graceful-fs": "^4.2.11", - "jest-diff": "30.5.1", - "jest-matcher-utils": "30.5.1", + "jest-diff": "30.5.2", + "jest-matcher-utils": "30.5.2", "jest-message-util": "30.5.1", "jest-util": "30.5.1", "pretty-format": "30.5.1", @@ -14577,13 +14171,13 @@ } }, "node_modules/jest-watcher": { - "version": "30.5.1", - "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-30.5.1.tgz", - "integrity": "sha512-+FHJ7C+S7b3ySfhA1aFmoa6TztsnwZVv84ycPRn0tVN93np2EU4b8C/KadqA3l6igdjgLBTnUotab9ER0HLG8A==", + "version": "30.5.2", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-30.5.2.tgz", + "integrity": "sha512-rqRgg4R11GA9m1UsEZwQeixHsgZReCn6TOHAHtIH33yXrIvoX0OGPA20Yzzjkz7X40fZvcRSxEpQppYPcWzmcQ==", "dev": true, "license": "MIT", "dependencies": { - "@jest/test-result": "30.5.1", + "@jest/test-result": "30.5.2", "@jest/types": "30.5.1", "@types/node": "*", "ansi-escapes": "^4.3.2", @@ -14943,9 +14537,9 @@ } }, "node_modules/lru-cache": { - "version": "11.5.2", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.2.tgz", - "integrity": "sha512-4pfM1Ff0x50o0tQwb5ucw/RzNyD0/YJME6IVcStalZuMWxdt3sR3huStTtxz4PUmvZfRguvDejasvQ2kifR11g==", + "version": "11.5.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.3.tgz", + "integrity": "sha512-U4N8FgzmWxc8k1VH8Kr6lQg18U7Fjvby6wXHVRX/ZZ7IwWbRMgrRbP0Wrb5q5NVinryp4SQampHKdvtecItxUg==", "dev": true, "license": "BlueOak-1.0.0", "engines": { @@ -14962,6 +14556,35 @@ "lz-string": "bin/bin.js" } }, + "node_modules/make-dir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", + "dev": true, + "license": "MIT", + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/make-dir/node_modules/semver": { + "version": "7.8.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", + "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/markdown-it": { "version": "15.0.1", "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-15.0.1.tgz", @@ -19577,6 +19200,19 @@ "node": ">=4" } }, + "node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/type-is": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.1.0.tgz", @@ -19689,17 +19325,17 @@ } }, "node_modules/typescript": { - "name": "@typescript/typescript6", - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/@typescript/typescript6/-/typescript6-6.0.2.tgz", - "integrity": "sha512-mbCddXd+jm7hfx7w2YU64/Av4/NqqeG3GoRZgxPcgoTxYjhrcfJRw9ULch71SS4G+Q3bOXFhRvPqjguN0Hyp5w==", + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.3.tgz", + "integrity": "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==", "dev": true, "license": "Apache-2.0", - "dependencies": { - "@typescript/old": "npm:typescript@^6" - }, "bin": { - "tsc6": "bin/tsc6" + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" } }, "node_modules/typescript-eslint": { @@ -19964,9 +19600,9 @@ } }, "node_modules/webpack": { - "version": "5.111.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.111.0.tgz", - "integrity": "sha512-A2R74kfE6b3eLKS91iZiol03Ebx7avmJJBOyiP+4LePW9NNeNJGQkKeSQos4dk6R4H0YAMYlv+aOrs1CyWT3eA==", + "version": "5.111.1", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.111.1.tgz", + "integrity": "sha512-cNypaz0RP+S4cvQVi1M/3bRUkvNP0xZpL0TjFx+c6jg64VbxD+2weWDgY9UnjRI6dhZgtaj8DU76GGFcJ79xPQ==", "dev": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index bd03e887c..f6b9d821f 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "dist/react-ui.development.css", "dist/react-ui.development.js", "dist/react-ui.js", - "scripts/write-lockfile-hash.sh", + "scripts/writeLockfileHash.sh", "src", "!src/**/__tests__", "!src/CNAME", @@ -60,24 +60,25 @@ }, "scripts": { "build": "webpack --mode=production && webpack --mode=development", - "build:types": "node node_modules/@typescript/native/bin/tsc -p tsconfig.build.json && dts-bundle-generator --project tsconfig.build.json --no-check -o dist/react-ui.d.ts dist/types/index.d.ts", + "build:types": "tsc -p tsconfig.build.json && dts-bundle-generator --project tsconfig.build.json --no-check -o dist/react-ui.d.ts dist/types/index.d.ts", "copy": "npm run copy:css && npm run copy:js", "copy:css": "cp src/docs/_assets/generated/react-ui.css dist && cp src/docs/_assets/generated/react-ui.development.css dist", "copy:js": "cp src/docs/_assets/generated/react-ui.js dist && cp src/docs/_assets/generated/react-ui.development.js dist", "lint": "npm run lint:stylelint && npm run lint:eslint && npm run lint:types && npm run lint:markdownlint", "lint:eslint": "eslint", - "lint:markdownlint": "markdownlint-cli2 \"README.md\" \"src/**/*.md\"", - "lint:stylelint": "stylelint \"src/**/*.{css,scss}\" \"!src/docs/_assets/generated/**\" --config stylelint.config.mjs", - "lint:types": "node node_modules/@typescript/native/bin/tsc --noEmit", + "lint:markdownlint": "markdownlint-cli2", + "lint:stylelint": "stylelint \"{src,tests}/**/*.{css,scss}\" --ignore-path .gitignore", + "lint:types": "tsc --noEmit", "postbuild": "npm run copy && npm run build:types", - "postinstall": "sh scripts/write-lockfile-hash.sh", + "postinstall": "sh scripts/writeLockfileHash.sh", "precopy": "rm -rf dist && mkdir dist", "prepublishOnly": "npm run build", "start": "webpack --watch --mode=development", - "start:chrome": "sh scripts/mcps/chrome-host/start-host-chrome.sh", + "start:chrome": "sh ./tools/agents/mcps/chrome-host/start-host-chrome.sh", "test:jest": "jest --coverage", "test:playwright": "playwright test -c playwright-ct.config.ts", - "test:playwright:report": "playwright show-report --host=0.0.0.0" + "test:playwright:clear-cache": "rm -rf ./tests/playwright/.temp/playwright-ct-cache/", + "test:playwright:report": "playwright show-report --host 0.0.0.0" }, "dependencies": { "normalize.css": "^8.0.1" @@ -87,12 +88,12 @@ "react-dom": "^18.2.0" }, "devDependencies": { - "@babel/core": "^8.0.5", - "@babel/preset-env": "^8.0.5", + "@babel/core": "^8.0.6", + "@babel/preset-env": "^8.0.6", "@babel/preset-react": "^8.0.1", "@babel/preset-typescript": "^8.0.1", "@happy-dom/jest-environment": "^20.14.5", - "@playwright/test": "~1.65.0", + "@playwright/test": "1.65.0", "@react-ui-org/eslint-config": "^1.1.0", "@react-ui-org/stylelint-config": "^1.0.0", "@testing-library/dom": "^10.4.2", @@ -100,21 +101,21 @@ "@testing-library/react": "^16.3.3", "@testing-library/user-event": "^14.6.7", "@types/jest": "^30.0.0", - "@types/node": "^26.5.1", + "@types/node": "^26.6.6", "@types/react": "^19.3.0", "@types/react-dom": "^19.3.0", - "@typescript/native": "npm:typescript@^7.0.2", - "autoprefixer": "^10.6.0", - "babel-jest": "^30.5.1", + "autoprefixer": "^10.6.1", + "babel-jest": "^30.5.2", "babel-loader": "^10.1.1", "babel-plugin-polyfill-corejs3": "^1.0.0", "core-js": "^3.50.0", "css-loader": "^7.1.5", - "dotenv": "^17.4.2", + "dotenv": "^18.0.1", "dts-bundle-generator": "^9.5.1", "eslint": "^9.39.5", "identity-obj-proxy": "^3.0.0", - "jest": "^30.5.1", + "jest": "^30.5.2", + "jest-fail-on-console": "^3.3.4", "markdownlint-cli2": "^0.23.3", "mini-css-extract-plugin": "^2.10.2", "postcss": "^8.5.28", @@ -126,8 +127,8 @@ "stylelint": "^17.15.0", "stylelint-webpack-plugin": "^5.1.0", "terser-webpack-plugin": "^5.6.1", - "typescript": "npm:@typescript/typescript6@^6.0.2", - "webpack": "^5.111.0", + "typescript": "~6.0.3", + "webpack": "^5.111.1", "webpack-cli": "^7.2.3", "webpack-dev-server": "^6.0.0", "webpack-visualizer-plugin2": "^2.0.0" diff --git a/playwright-ct.config.ts b/playwright-ct.config.ts index 530112a7d..c59737a6d 100644 --- a/playwright-ct.config.ts +++ b/playwright-ct.config.ts @@ -4,6 +4,7 @@ import { } from '@playwright/test'; import { parseEnvironment } from './tests/playwright/env/parseEnvironment'; +// Load and parse Playwright's environment file arguments const environment = parseEnvironment(); const isCI = !!process.env.CI; @@ -14,7 +15,7 @@ const componentTestingUrl = `http://localhost:${environment.CT_PORT}/index.html` /** * @see https://playwright.dev/docs/test-configuration */ -module.exports = defineConfig({ +export default defineConfig({ // Fail the build on CI if you accidentally left test.only in the source code forbidOnly: isCI, // Run tests in files in parallel @@ -25,11 +26,13 @@ module.exports = defineConfig({ projects: [ { name: 'chromium', + // No rendering flags are set on purpose. Playwright runs the Chromium headless shell, which renders in + // software by default, so the snapshots are stable without them. use: { ...devices['Desktop Chrome'] }, }, ], - /* Reporter to use. See https://playwright.dev/docs/test-reporters */ - reporter: 'html', + // Reporter to use. See https://playwright.dev/docs/test-reporters + reporter: [['html', { open: 'never' }]], // Retry failed tests once to eliminate flakiness retries: 1, // Directory where the snapshots are located @@ -51,24 +54,12 @@ module.exports = defineConfig({ reuseContext: true, // Prevent a service worker from serving cached responses that would shadow `page.route()` mocks serviceWorkers: 'block', - // Launch options for Playwright - launchOptions: { - args: [ - '--use-gl=egl', - // # Must be set to `new` to enable new version of Chromium Headless to obtain correct snapshots - '--headless=new', - ], - ignoreDefaultArgs: [ - // # Must be ignored to enable new version of Chromium Headless to obtain correct snapshots - '--headless', - ], - }, - // Collect trace on all retries - trace: 'on-all-retries', + // Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer + trace: 'on-first-retry', }, // Webpack dev server serving the Playwright Component Testing page webServer: { - command: `webpack serve --config tests/playwright/ct/webpack.config.js --port ${environment.CT_PORT}`, + command: `webpack serve --config tests/playwright/ct/webpack.config.mjs --port ${environment.CT_PORT}`, reuseExistingServer: !isCI, url: componentTestingUrl, }, diff --git a/postcss.config.js b/postcss.config.js deleted file mode 100644 index 676dfad57..000000000 --- a/postcss.config.js +++ /dev/null @@ -1,9 +0,0 @@ -const autoprefixer = require('autoprefixer'); - -module.exports = { - plugins: [ - autoprefixer({ - grid: true, - }), - ], -}; diff --git a/postcss.config.mjs b/postcss.config.mjs new file mode 100644 index 000000000..7738160ab --- /dev/null +++ b/postcss.config.mjs @@ -0,0 +1,5 @@ +export default { + plugins: { + autoprefixer: {}, + }, +}; diff --git a/scripts/auto-start-mkdocs.sh b/scripts/docker/autoStartMkdocs.sh similarity index 100% rename from scripts/auto-start-mkdocs.sh rename to scripts/docker/autoStartMkdocs.sh diff --git a/scripts/auto-start-node.sh b/scripts/docker/autoStartNode.sh similarity index 83% rename from scripts/auto-start-node.sh rename to scripts/docker/autoStartNode.sh index 50a11de5d..2cb8eb379 100644 --- a/scripts/auto-start-node.sh +++ b/scripts/docker/autoStartNode.sh @@ -8,8 +8,8 @@ LOCK_HASH_FILE="node_modules/.package-lock-hash" # Parent directory of the script SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )" -# Change to the parent directory of the script -cd "$SCRIPT_DIR/.." +# Change to the root directory +cd "$SCRIPT_DIR/../.." # Install dependencies if node_modules is missing or out of date CURRENT_HASH=$(sha256sum package-lock.json | awk '{print $1}') @@ -28,6 +28,6 @@ fi echo "Building the application..." npm run build -# Start the application -echo "Starting the application..." +# Start the library webpack watcher that feeds the documentation site +echo "Starting the library build watcher..." npm start diff --git a/scripts/write-lockfile-hash.sh b/scripts/writeLockfileHash.sh old mode 100755 new mode 100644 similarity index 100% rename from scripts/write-lockfile-hash.sh rename to scripts/writeLockfileHash.sh diff --git a/setup.sh b/setup.sh index 5469d779c..5393d3c11 100755 --- a/setup.sh +++ b/setup.sh @@ -1,12 +1,44 @@ #!/bin/bash -DEFAULT_PROJECT_NAME="react-ui" DEFAULT_USER_ID=1000 DEFAULT_GROUP_ID=1000 set -e trap 'echo "Failed to set up project"; rm -f .env.temp; exit 1' ERR +REBUILD=false +RECREATE_FILES=false + +while [ $# -gt 0 ]; do + case "$1" in + -r|--rebuild-docker-images) + REBUILD=true + shift + ;; + -c|--recreate-files) + RECREATE_FILES=true + shift + ;; + -h|--help) + echo "Usage: $0 [options]" + echo "" + echo "Set up the project: create and configure the .env and docker-compose.yml" + echo "files if they do not exist yet and build Docker images." + echo "" + echo "Options:" + echo " -r, --rebuild-docker-images Rebuild all Docker images from scratch, even if they already exist" + echo " -c, --recreate-files Recreate the .env and docker-compose.yml files and the existing .env. files, backing up the existing ones as *.backup" + echo " -h, --help Show help" + exit 0 + ;; + *) + echo "Unknown option: $1" + echo "Run '$0 --help' for usage information." + exit 1 + ;; + esac +done + # Function to handle sed command with cross-platform compatibility sed_cmd() { if [[ "$OSTYPE" == "darwin"* ]]; then @@ -18,8 +50,34 @@ sed_cmd() { cd "$(dirname "$0")" +# The project name in .env.dist is the default project name, the name of the project +# devcontainer image and the name of its directory in docker/ are derived from it +DEFAULT_PROJECT_NAME=$(grep -E '^COMPOSE_PROJECT_NAME=' .env.dist | cut -d '=' -f 2-) + echo "Setting up project..." +# Back up and remove the existing configuration files when their recreation is requested +if [ "$RECREATE_FILES" = true ]; then + if [ -f .env ]; then + echo "Backing up existing .env file to .env.backup..." + mv .env .env.backup + fi + if [ -f docker-compose.yml ]; then + echo "Backing up existing docker-compose.yml file to docker-compose.yml.backup..." + mv docker-compose.yml docker-compose.yml.backup + fi + # A project may have more environment files, each .env. file is an optional + # copy of its .env..dist template that needs no further configuration + for ENV_DIST_FILE in .env.*.dist; do + ENV_FILE="${ENV_DIST_FILE%.dist}" + if [ -f "$ENV_FILE" ]; then + echo "Backing up existing $ENV_FILE file to $ENV_FILE.backup and recreating it..." + mv "$ENV_FILE" "$ENV_FILE.backup" + cp "$ENV_DIST_FILE" "$ENV_FILE" + fi + done +fi + # Create and configure .env file if it doesn't exist if [ ! -f .env ]; then echo "Creating .env file..." @@ -28,7 +86,9 @@ if [ ! -f .env ]; then echo "Configuring .env file..." PROJECT_PATH=$(pwd) - PROJECT_NAME=$(basename "$PROJECT_PATH") + # Normalize the basename the same way Docker Compose derives its default project name + PROJECT_NAME=$(basename "$PROJECT_PATH" | LC_ALL=C tr '[:upper:]' '[:lower:]' | LC_ALL=C sed -e 's/[^a-z0-9_-]//g' -e 's/^[^a-z0-9]*//') + PROJECT_NAME="${PROJECT_NAME:-$DEFAULT_PROJECT_NAME}" if [[ "$OSTYPE" == "darwin"* ]]; then # MacOS @@ -43,23 +103,37 @@ if [ ! -f .env ]; then sed_cmd "s|^COMPOSE_PROJECT_NAME=.*|COMPOSE_PROJECT_NAME=$PROJECT_NAME|" .env.temp sed_cmd "s|^COMPOSE_UID=.*|COMPOSE_UID=$USER_ID|" .env.temp sed_cmd "s|^COMPOSE_GID=.*|COMPOSE_GID=$GROUP_ID|" .env.temp + # Only projects that map the workspace to the host path have this variable + sed_cmd "s|^COMPOSE_PROJECT_PATH=.*|COMPOSE_PROJECT_PATH=/workspace=$PROJECT_PATH|" .env.temp LOCAL_SHELL= if [ -n "$SHELL" ]; then - sed_cmd "s|^SHELL=.*|SHELL=$SHELL|" .env.temp - LOCAL_SHELL=$SHELL + case "$(basename "$SHELL")" in + bash|fish|zsh) + LOCAL_SHELL="/bin/$(basename "$SHELL")" + sed_cmd "s|^SHELL=.*|SHELL=$LOCAL_SHELL|" .env.temp + ;; + esac fi LOCAL_EDITOR= if [ -n "$EDITOR" ]; then - sed_cmd "s|^EDITOR=.*|EDITOR=$EDITOR|" .env.temp - LOCAL_EDITOR=$EDITOR + case "$(basename "$EDITOR")" in + vim|nano) + LOCAL_EDITOR=$(basename "$EDITOR") + sed_cmd "s|^EDITOR=.*|EDITOR=$LOCAL_EDITOR|" .env.temp + ;; + esac fi LOCAL_VISUAL= if [ -n "$VISUAL" ]; then - sed_cmd "s|^VISUAL=.*|VISUAL=$VISUAL|" .env.temp - LOCAL_VISUAL=$VISUAL + case "$(basename "$VISUAL")" in + vim|nano) + LOCAL_VISUAL=$(basename "$VISUAL") + sed_cmd "s|^VISUAL=.*|VISUAL=$LOCAL_VISUAL|" .env.temp + ;; + esac fi cp .env.temp .env @@ -81,7 +155,14 @@ if [ ! -f .env ]; then echo "Visual: $LOCAL_VISUAL" fi else - echo ".env file already exists, skipping creation." + echo ".env file already exists, skipping creation. Use --recreate-files to recreate it." +fi + +# Validate the project name in .env, it may have been edited manually +PROJECT_NAME=$(grep -E '^COMPOSE_PROJECT_NAME=' .env | cut -d '=' -f 2-) +if ! printf '%s' "$PROJECT_NAME" | grep -Eq '^[a-z0-9][a-z0-9_-]*$'; then + echo "Error: COMPOSE_PROJECT_NAME=\"$PROJECT_NAME\" in .env is not a valid Docker Compose project name, use only lowercase letters, digits, '-' and '_' and start with a letter or digit" + exit 1 fi # Create docker-compose.yml if it doesn't exist @@ -89,19 +170,23 @@ if [ ! -f docker-compose.yml ]; then echo "Creating and configuring docker-compose.yml file..." cp docker-compose.yml.dist docker-compose.yml - DEFAULT_PROJECT_DEVCONTAINER_IMAGE="${DEFAULT_PROJECT_NAME}_devcontainer" - PROJECT_NAME=$(grep -E '^COMPOSE_PROJECT_NAME=' .env | cut -d '=' -f 2-) - PROJECT_DEVCONTAINER_IMAGE="${PROJECT_NAME}_devcontainer" + # Image names use `-` instead of `_`, like the directories in docker/ + DEFAULT_PROJECT_DEVCONTAINER_IMAGE="$(printf '%s' "$DEFAULT_PROJECT_NAME" | tr '_' '-')-devcontainer" + PROJECT_DEVCONTAINER_IMAGE="$(printf '%s' "$PROJECT_NAME" | tr '_' '-')-devcontainer" sed_cmd "s|image: $DEFAULT_PROJECT_DEVCONTAINER_IMAGE|image: $PROJECT_DEVCONTAINER_IMAGE|" docker-compose.yml else - echo "docker-compose.yml file already exists, skipping creation." + echo "docker-compose.yml file already exists, skipping creation. Use --recreate-files to recreate it." fi # Configure the Chrome-host bridge networking (native Docker Engine only) -sh ./scripts/mcps/chrome-host/mcp-setup.sh +sh ./tools/agents/mcps/chrome-host/mcp-setup.sh # Build Docker images -sh ./docker/build-docker-images.sh +if [ "$REBUILD" = true ]; then + bash ./docker/build-docker-images.sh --rebuild-docker-images +else + bash ./docker/build-docker-images.sh +fi echo "Project setup completed successfully!" diff --git a/src/components/CheckboxField/__tests__/CheckboxField.spec.tsx b/src/components/CheckboxField/__tests__/CheckboxField.spec.tsx index 0496cbade..79b0905a4 100644 --- a/src/components/CheckboxField/__tests__/CheckboxField.spec.tsx +++ b/src/components/CheckboxField/__tests__/CheckboxField.spec.tsx @@ -10,7 +10,7 @@ test.describe('CheckboxField', () => { test.describe('visual', () => { [ ...propTests.defaultComponentPropTest, - ...propTests.helpTextAndValidationTextPropType, + ...propTests.helpTextAndValidationTextPropTest, ...propTests.isLabelVisiblePropTest, ...propTests.labelPositionPropTest, ...propTests.labelPropTest, diff --git a/src/components/FileInputField/__tests__/FileInputField.spec.tsx b/src/components/FileInputField/__tests__/FileInputField.spec.tsx index 8a62a79c6..383cb8257 100644 --- a/src/components/FileInputField/__tests__/FileInputField.spec.tsx +++ b/src/components/FileInputField/__tests__/FileInputField.spec.tsx @@ -20,7 +20,7 @@ test.describe('FileInputField', () => { propTests.fullWidthPropTest, propTests.layoutPropTest, ]), - ...propTests.helpTextAndValidationTextPropType, + ...propTests.helpTextAndValidationTextPropTest, ...propTests.helpTextPropTest, ...propTests.isLabelVisiblePropTest, ...propTests.labelPropTest, diff --git a/src/components/Radio/__tests__/Radio.spec.tsx b/src/components/Radio/__tests__/Radio.spec.tsx index e1b625ab0..02f8ac83d 100644 --- a/src/components/Radio/__tests__/Radio.spec.tsx +++ b/src/components/Radio/__tests__/Radio.spec.tsx @@ -31,7 +31,7 @@ test.describe('Radio', () => { test.describe('visual', () => { [ ...propTests.defaultComponentPropTest, - ...propTests.helpTextAndValidationTextPropType, + ...propTests.helpTextAndValidationTextPropTest, ...propTests.isLabelVisiblePropTest, ...propTests.labelPropTest, ...propTests.layoutPropTest, diff --git a/src/components/SelectField/__tests__/SelectField.spec.tsx b/src/components/SelectField/__tests__/SelectField.spec.tsx index e158ef817..ce53e1504 100644 --- a/src/components/SelectField/__tests__/SelectField.spec.tsx +++ b/src/components/SelectField/__tests__/SelectField.spec.tsx @@ -44,7 +44,7 @@ test.describe('SelectField', () => { test.describe('visual', () => { [ ...propTests.defaultComponentPropTest, - ...propTests.helpTextAndValidationTextPropType, + ...propTests.helpTextAndValidationTextPropTest, ...propTests.isLabelVisiblePropTest, ...propTests.labelPropTest, ...propTests.renderAsRequiredPropTest, diff --git a/src/components/TextArea/__tests__/TextArea.spec.tsx b/src/components/TextArea/__tests__/TextArea.spec.tsx index d32ecd3e3..b029befcf 100644 --- a/src/components/TextArea/__tests__/TextArea.spec.tsx +++ b/src/components/TextArea/__tests__/TextArea.spec.tsx @@ -10,7 +10,7 @@ test.describe('TextArea', () => { test.describe('visual', () => { [ ...propTests.defaultComponentPropTest, - ...propTests.helpTextAndValidationTextPropType, + ...propTests.helpTextAndValidationTextPropTest, ...propTests.isLabelVisiblePropTest, ...propTests.labelPropTest, ...propTests.requiredPropTest, diff --git a/src/components/TextField/__tests__/TextField.spec.tsx b/src/components/TextField/__tests__/TextField.spec.tsx index 1b475f7b5..0d51d3324 100644 --- a/src/components/TextField/__tests__/TextField.spec.tsx +++ b/src/components/TextField/__tests__/TextField.spec.tsx @@ -21,7 +21,7 @@ test.describe('TextField', () => { propTests.fullWidthPropTest, propTests.layoutPropTest, ]), - ...propTests.helpTextAndValidationTextPropType, + ...propTests.helpTextAndValidationTextPropTest, ...inputSizePropTest, ...propTests.isLabelVisiblePropTest, ...propTests.labelPropTest, diff --git a/src/components/Toggle/__tests__/Toggle.spec.tsx b/src/components/Toggle/__tests__/Toggle.spec.tsx index 6cba533a3..726996b97 100644 --- a/src/components/Toggle/__tests__/Toggle.spec.tsx +++ b/src/components/Toggle/__tests__/Toggle.spec.tsx @@ -10,7 +10,7 @@ test.describe('Toggle', () => { test.describe('visual', () => { [ ...propTests.defaultComponentPropTest, - ...propTests.helpTextAndValidationTextPropType, + ...propTests.helpTextAndValidationTextPropTest, ...propTests.isLabelVisiblePropTest, ...propTests.labelPositionPropTest, ...propTests.labelPropTest, diff --git a/src/docs/contribute/ai-integration.md b/src/docs/contribute/ai-integration.md index edea31a08..c02a52c4b 100644 --- a/src/docs/contribute/ai-integration.md +++ b/src/docs/contribute/ai-integration.md @@ -17,7 +17,7 @@ running on your **host** machine, using [`chrome-devtools-mcp`][chrome-devtools- This is useful for verifying UI changes, taking screenshots, and interactively debugging the running application in a real browser. -The wiring lives in the `scripts/mcps/chrome-host/` directory and works on +The wiring lives in the `tools/agents/mcps/chrome-host/` directory and works on macOS and Linux. ### Setup @@ -31,7 +31,7 @@ by default and the `node` service needs a host-gateway mapping. The host-gateway mapping is added automatically on native Docker Engine as part of the project's [automatic setup](./general-guidelines.md#automatic-setup) -(`setup.sh` runs `scripts/mcps/chrome-host/mcp-setup.sh`). +(`setup.sh` runs `tools/agents/mcps/chrome-host/mcp-setup.sh`). #### Manual setup @@ -63,7 +63,7 @@ through Docker Compose). See `.env.dist` for the available options. or if you do not have `npm` installed on the host: ```bash - ./scripts/mcps/chrome-host/start-host-chrome.sh + ./tools/agents/mcps/chrome-host/start-host-chrome.sh ``` A dedicated browser window opens using a throwaway profile, so your everyday @@ -83,7 +83,7 @@ through Docker Compose). See `.env.dist` for the available options. * For how it works, platform specifics (Docker Desktop vs. native Docker on Linux), and configuration options, see - `scripts/mcps/chrome-host/README.md`. + `tools/agents/mcps/chrome-host/README.md`. [mcp]: https://modelcontextprotocol.io/ [chrome-devtools-mcp]: https://github.com/ChromeDevTools/chrome-devtools-mcp diff --git a/src/docs/contribute/general-guidelines.md b/src/docs/contribute/general-guidelines.md index 9f3dd8a83..8604979b0 100644 --- a/src/docs/contribute/general-guidelines.md +++ b/src/docs/contribute/general-guidelines.md @@ -100,11 +100,11 @@ The IDE will automatically set up the environment using the configuration in ### Customization To customize the `devcontainer`, create a -`docker/react_ui_devcontainer_local/Dockerfile` that extends the base image: +`docker/react-ui-devcontainer-local/Dockerfile` that extends the base image: ```Dockerfile -# Image name `react-ui_devcontainer` might differ based on Docker compose project name -FROM react-ui_devcontainer as react-ui_devcontainer_local +# Image name `react-ui-devcontainer` might differ based on Docker compose project name +FROM react-ui-devcontainer # Add your customizations here ``` @@ -117,7 +117,7 @@ devcontainer: file: docker-compose.base.yml service: devcontainer build: - context: ./docker/react_ui_devcontainer_local/ + context: ./docker/react-ui-devcontainer-local/ dockerfile: Dockerfile ``` @@ -135,7 +135,7 @@ done in `docker-compose.base.yml`. You will need to add a volume mapping to the The `devcontainer` is built in the following layers: -#### Base Layer (`react-ui_devcontainer`) +#### Base Layer (`react-ui-devcontainer`) General-purpose development layer. Makes the environment container-agnostic by wrapping commands to run in the appropriate service containers. @@ -146,7 +146,7 @@ by wrapping commands to run in the appropriate service containers. * **Tools:** Git, SSH client, Docker CLI (Docker-from-Docker) * **AI coding assistants:** Claude Code, GitHub Copilot CLI, Open Code -#### Local Layer (`react-ui_devcontainer_local`) +#### Local Layer (`react-ui-devcontainer-local`) Optional layer that allows individual developers to customize the environment. See [Customization](#customization) for details. diff --git a/src/docs/contribute/testing-guidelines.md b/src/docs/contribute/testing-guidelines.md index 61888897a..1bebb4883 100644 --- a/src/docs/contribute/testing-guidelines.md +++ b/src/docs/contribute/testing-guidelines.md @@ -222,8 +222,8 @@ the following command: npm run test:playwright:report ``` -Then open the displayed URL (typically `http://localhost:9323`) -in your browser. Please note that the test report is only available +Then open `http://localhost:` (`21002` by +default, see `.env`) in your browser. Please note that the test report is only available if the tests were run prior to serving the report. [playwright-cli]: https://playwright.dev/docs/test-cli#reference diff --git a/stylelint.config.mjs b/stylelint.config.mjs index 1c3a15383..6380bcc23 100644 --- a/stylelint.config.mjs +++ b/stylelint.config.mjs @@ -15,10 +15,10 @@ export default { // Also allow kebab-case class names for global helper and utility classes. // // A: camelCase pattern - // B: kebab-case pattern + // B: kebab-case pattern, written so that a name can be matched in one way only 'selector-class-pattern': [ // ↓ A OR ↓ B - '^(?:(([a-z][a-z0-9]*)([A-Z][a-z0-9]+)*)|(([a-z0-9]+-?)+))$', + '^(?:(([a-z][a-z0-9]*)([A-Z][a-z0-9]+)*)|([a-z0-9]+(-[a-z0-9]+)*-?))$', { message: 'Expected class selector to be either camelCase (CSS Modules) or kebab-case (global classes)', }, diff --git a/tests/jest/setupFailOnConsole.ts b/tests/jest/setupFailOnConsole.ts new file mode 100644 index 000000000..4267fc40a --- /dev/null +++ b/tests/jest/setupFailOnConsole.ts @@ -0,0 +1,4 @@ +import failOnConsole from 'jest-fail-on-console'; + +// Fail every test that calls `console.error` or `console.warn` +failOnConsole(); diff --git a/tests/jest/setupJest.ts b/tests/jest/setupJest.ts deleted file mode 100644 index 7a89495ac..000000000 --- a/tests/jest/setupJest.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* eslint-disable no-console */ -console.warn = (error: string) => { - throw new Error(error); -}; - -console.error = (error: string) => { - throw new Error(error); -}; diff --git a/tests/playwright/ct/_helpers/resolveStory.ts b/tests/playwright/ct/_helpers/resolveStory.ts index 393f2514f..b2f026f1a 100644 --- a/tests/playwright/ct/_helpers/resolveStory.ts +++ b/tests/playwright/ct/_helpers/resolveStory.ts @@ -18,8 +18,8 @@ const storyFiles = storyContext.keys().map((modulePath) => ({ * Resolve a story ID to the story component. * * A story is a named export of a `*.story.tsx` file in `src/`. Its ID is the file path relative to `src/` without the - * `.story.tsx` extension, followed by the export name, e.g. `components/Button/__tests__/Button/ButtonForTest`. Any - * unique suffix on a `/` boundary is accepted too, e.g. `Button/ButtonForTest`. + * `.story.tsx` extension, followed by the export name, e.g. `components/Example/__tests__/Example/ExampleForTest`. Any + * unique suffix on a `/` boundary is accepted too, e.g. `Example/ExampleForTest`. */ export const resolveStory = async (storyId: string) => { const separatorIndex = storyId.lastIndexOf('/'); diff --git a/tests/playwright/ct/webpack.config.js b/tests/playwright/ct/webpack.config.mjs similarity index 66% rename from tests/playwright/ct/webpack.config.js rename to tests/playwright/ct/webpack.config.mjs index dcba8da86..1f3454a98 100644 --- a/tests/playwright/ct/webpack.config.js +++ b/tests/playwright/ct/webpack.config.mjs @@ -1,9 +1,8 @@ -const Path = require('path'); -const MiniCssExtractPlugin = require('mini-css-extract-plugin'); +import Path from 'path'; +import MiniCssExtractPlugin from 'mini-css-extract-plugin'; +import libraryConfig from '../../../webpack.config.mjs'; -const LIBRARY_CONFIG_PATH = require.resolve('../../../webpack.config'); - -const libraryConfig = require(LIBRARY_CONFIG_PATH); +const LIBRARY_CONFIG_PATH = Path.resolve(import.meta.dirname, '../../../webpack.config.mjs'); /** * Webpack configuration of the Playwright Component Testing page. @@ -11,7 +10,7 @@ const libraryConfig = require(LIBRARY_CONFIG_PATH); * The dev server is started by Playwright (see `webServer` in `playwright-ct.config.ts`). The loader rules and the * module resolution are shared with the library build so that the components are compiled the same way. */ -module.exports = (env, argv) => { +export default (env, argv) => { const { module: libraryModule, resolve, @@ -22,11 +21,11 @@ module.exports = (env, argv) => { cache: { buildDependencies: { config: [ - __filename, + import.meta.filename, LIBRARY_CONFIG_PATH, ], }, - cacheDirectory: Path.resolve(__dirname, '../.temp/playwright-ct-cache'), + cacheDirectory: Path.resolve(import.meta.dirname, '../.temp/playwright-ct-cache'), type: 'filesystem', }, devServer: { @@ -35,16 +34,16 @@ module.exports = (env, argv) => { hot: false, liveReload: false, static: { - directory: __dirname, + directory: import.meta.dirname, }, }, devtool: 'cheap-module-source-map', - entry: Path.join(__dirname, 'index.tsx'), + entry: Path.join(import.meta.dirname, 'index.tsx'), mode: 'development', module: libraryModule, output: { filename: 'ct.js', - path: Path.resolve(__dirname, '../.temp/playwright-ct-dist'), + path: Path.resolve(import.meta.dirname, '../.temp/playwright-ct-dist'), publicPath: '/', }, plugins: [ diff --git a/tests/playwright/index.ts b/tests/playwright/index.ts index 254eb13f8..5151a8c6d 100644 --- a/tests/playwright/index.ts +++ b/tests/playwright/index.ts @@ -2,15 +2,15 @@ import { actionColorPropTest } from './propTests/actionColorPropTest'; import { afterLabelPropTest } from './propTests/afterLabelPropTest'; import { beforeLabelPropTest } from './propTests/beforeLabelPropTest'; import { blockPropTest } from './propTests/blockPropTest'; +import { checkedPropTest } from './propTests/checkedPropTest'; import { defaultComponentPropTest } from './propTests/defaultComponentPropTest'; import { disabledPropTest } from './propTests/disabledPropTest'; -import { checkedPropTest } from './propTests/checkedPropTest'; import { endCornerPropTest } from './propTests/endCornerPropTest'; import { feedbackColorPropTest } from './propTests/feedbackColorPropTest'; import { feedbackIconPropTest } from './propTests/feedbackIconPropTest'; import { fullWidthPropTest } from './propTests/fullWidthPropTest'; +import { helpTextAndValidationTextPropTest } from './propTests/helpTextAndValidationTextPropTest'; import { helpTextPropTest } from './propTests/helpTextPropTest'; -import { helpTextAndValidationTextPropType } from './propTests/helpTextAndValidationTextPropType'; import { iconPropTest } from './propTests/iconPropTest'; import { isLabelVisiblePropTest } from './propTests/isLabelVisiblePropTest'; import { labelPositionPropTest } from './propTests/labelPositionPropTest'; @@ -21,21 +21,12 @@ import { neutralColorPropTest } from './propTests/neutralColorPropTest'; import { priorityPropTest } from './propTests/priorityPropTest'; import { raisedPropTest } from './propTests/raisedPropTest'; import { renderAsRequiredPropTest } from './propTests/renderAsRequiredPropTest'; +import { requiredPropTest } from './propTests/requiredPropTest'; import { sizePropTest } from './propTests/sizePropTest'; import { startCornerPropTest } from './propTests/startCornerPropTest'; import { statePropTest } from './propTests/statePropTest'; import { validationTextPropTest } from './propTests/validationTextPropTest'; import { variantPropTest } from './propTests/variantPropTest'; -import { requiredPropTest } from './propTests/requiredPropTest'; - -export { - expect, - test, -} from './test'; - -export { element } from './utils/element'; -export { mixPropTests } from './utils/mixPropTests'; -export { getActualFocusedElementText } from './utils/getActualFocusedElementText'; export const propTests = { actionColorPropTest, @@ -49,7 +40,7 @@ export const propTests = { feedbackColorPropTest, feedbackIconPropTest, fullWidthPropTest, - helpTextAndValidationTextPropType, + helpTextAndValidationTextPropTest, helpTextPropTest, iconPropTest, isLabelVisiblePropTest, @@ -68,5 +59,18 @@ export const propTests = { validationTextPropTest, variantPropTest, }; + +export { + expect, + test, +} from './test'; + +export { element } from './utils/element'; +export { getActualFocusedElementText } from './utils/getActualFocusedElementText'; +export { mixPropTests } from './utils/mixPropTests'; export type { MountResult } from './test'; -export type { StoryProps } from './types'; +export type { + PropTest, + PropTests, + StoryProps, +} from './types'; diff --git a/tests/playwright/propTests/helpTextAndValidationTextPropType.ts b/tests/playwright/propTests/helpTextAndValidationTextPropTest.ts similarity index 89% rename from tests/playwright/propTests/helpTextAndValidationTextPropType.ts rename to tests/playwright/propTests/helpTextAndValidationTextPropTest.ts index b245fc203..e59fb2174 100644 --- a/tests/playwright/propTests/helpTextAndValidationTextPropType.ts +++ b/tests/playwright/propTests/helpTextAndValidationTextPropTest.ts @@ -1,6 +1,6 @@ import type { PropTests } from '../types'; -export const helpTextAndValidationTextPropType: PropTests = [ +export const helpTextAndValidationTextPropTest: PropTests = [ { name: 'helpText:string & validationText:undefined', props: { diff --git a/tests/playwright/types.ts b/tests/playwright/types.ts index 638ca0b0d..10ef184a7 100644 --- a/tests/playwright/types.ts +++ b/tests/playwright/types.ts @@ -6,6 +6,7 @@ export type PropTest = { onBeforeSnapshot?: (page: Page, component: MountResult) => Promise; onBeforeTest?: (page: Page) => Promise; props: Record; + takeScreenshot?: (page: Page, component: MountResult) => Promise; }; export type PropTests = PropTest[]; diff --git a/tests/playwright/utils/__tests__/mixPropTests.test.ts b/tests/playwright/utils/__tests__/mixPropTests.test.ts index 690e8555b..0f2c258c9 100644 --- a/tests/playwright/utils/__tests__/mixPropTests.test.ts +++ b/tests/playwright/utils/__tests__/mixPropTests.test.ts @@ -1,3 +1,5 @@ +import type { Page } from '@playwright/test'; +import type { MountResult } from '../../test'; import { mixPropTests } from '../mixPropTests'; describe('mixPropTests', () => { @@ -152,4 +154,78 @@ describe('mixPropTests', () => { }, ]); }); + + it('calls onBeforeSnapshot and onBeforeTest from both prop tests if defined', async () => { + const beforeSnapshotA = jest.fn(); + const beforeSnapshotB = jest.fn(); + const beforeTestA = jest.fn(); + const beforeTestB = jest.fn(); + + const groupA = [ + { + name: 'A', + onBeforeSnapshot: beforeSnapshotA, + onBeforeTest: beforeTestA, + props: { a: 1 }, + }, + ]; + + const groupB = [ + { + name: 'B', + onBeforeSnapshot: beforeSnapshotB, + onBeforeTest: beforeTestB, + props: { b: 2 }, + }, + ]; + + const [mixed] = mixPropTests([groupA, groupB]); + + expect(mixed.name).toBe('A & B'); + expect(mixed.props).toEqual({ + a: 1, b: 2, + }); + + const fakePage = {} as Page; + const fakeComponent = {} as MountResult; + + await mixed.onBeforeSnapshot?.(fakePage, fakeComponent); + await mixed.onBeforeTest?.(fakePage); + + expect(beforeSnapshotA).toHaveBeenCalledWith(fakePage, fakeComponent); + expect(beforeSnapshotB).toHaveBeenCalledWith(fakePage, fakeComponent); + expect(beforeTestA).toHaveBeenCalledWith(fakePage); + expect(beforeTestB).toHaveBeenCalledWith(fakePage); + }); + + it('handles missing onBeforeSnapshot or onBeforeTest', async () => { + const beforeSnapshotB = jest.fn(); + const beforeTestB = jest.fn(); + + const groupA = [ + { + name: 'A', + props: { a: 1 }, + }, + ]; + + const groupB = [ + { + name: 'B', + onBeforeSnapshot: beforeSnapshotB, + onBeforeTest: beforeTestB, + props: { b: 2 }, + }, + ]; + + const [mixed] = mixPropTests([groupA, groupB]); + const fakePage = {} as Page; + const fakeComponent = {} as MountResult; + + await mixed.onBeforeSnapshot?.(fakePage, fakeComponent); + await mixed.onBeforeTest?.(fakePage); + + expect(beforeSnapshotB).toHaveBeenCalledTimes(1); + expect(beforeTestB).toHaveBeenCalledTimes(1); + }); }); diff --git a/tests/playwright/utils/mixPropTests.ts b/tests/playwright/utils/mixPropTests.ts index 90452f433..c87e90dac 100644 --- a/tests/playwright/utils/mixPropTests.ts +++ b/tests/playwright/utils/mixPropTests.ts @@ -1,4 +1,7 @@ -import type { PropTests } from '../types'; +import type { + PropTest, + PropTests, +} from '../types'; /** * Make combinations of two prop tests. @@ -10,13 +13,37 @@ const mixTwoPropTests = ( const mixedPropTests: PropTests = []; propTestsA.forEach((propTestA) => { propTestsB.forEach((propTestB) => { - mixedPropTests.push({ + const mixedPropTest: PropTest = { name: `${propTestA.name} & ${propTestB.name}`, props: { ...propTestA.props, ...propTestB.props, }, - }); + }; + + if (propTestA.onBeforeSnapshot || propTestB.onBeforeSnapshot) { + mixedPropTest.onBeforeSnapshot = async (page, component) => { + if (propTestA.onBeforeSnapshot) { + await propTestA.onBeforeSnapshot(page, component); + } + if (propTestB.onBeforeSnapshot) { + await propTestB.onBeforeSnapshot(page, component); + } + }; + } + + if (propTestA.onBeforeTest || propTestB.onBeforeTest) { + mixedPropTest.onBeforeTest = async (page) => { + if (propTestA.onBeforeTest) { + await propTestA.onBeforeTest(page); + } + if (propTestB.onBeforeTest) { + await propTestB.onBeforeTest(page); + } + }; + } + + mixedPropTests.push(mixedPropTest); }); }); return mixedPropTests; diff --git a/scripts/mcps/chrome-host/README.md b/tools/agents/mcps/chrome-host/README.md similarity index 91% rename from scripts/mcps/chrome-host/README.md rename to tools/agents/mcps/chrome-host/README.md index 56129520f..73ff62fdb 100644 --- a/scripts/mcps/chrome-host/README.md +++ b/tools/agents/mcps/chrome-host/README.md @@ -49,7 +49,7 @@ works — point its config at the script. "mcpServers": { "chrome-host": { "command": "sh", - "args": ["scripts/mcps/chrome-host/mcp-entry.sh"] + "args": ["tools/agents/mcps/chrome-host/mcp-entry.sh"] } } } @@ -62,7 +62,7 @@ works — point its config at the script. "mcp": { "chrome-host": { "type": "local", - "command": ["sh", "scripts/mcps/chrome-host/mcp-entry.sh"], + "command": ["sh", "tools/agents/mcps/chrome-host/mcp-entry.sh"], "enabled": true } } @@ -78,7 +78,7 @@ Requirements: a `docker-compose.yml` at the repo root, the repo mounted at 1. Start host Chrome (from a host terminal, **not** from inside an AI action): ```sh - ./scripts/mcps/chrome-host/start-host-chrome.sh + ./tools/agents/mcps/chrome-host/start-host-chrome.sh ``` 2. On first run, approve the `chrome-host` server in your MCP client. @@ -105,6 +105,10 @@ Decided by **Docker Desktop vs native Docker Engine**, not the OS. non-loopback bind exposes the unauthenticated CDP port; firewall it. The proxy's listen port and target host are fixed constants; only its upstream port is configurable, and it follows the same `CHROME_DEBUG_PORT`. +- Start page: `CHROME_START_URL` in the repo `.env` sets the URL that the + launcher opens. Without it the launcher opens the application on + `COMPOSE_WEB_SERVER_PORT` over HTTPS, or the docs on + `COMPOSE_DOCS_SERVER_PORT` when the project has no application port. - Set these in the repo `.env`; Compose passes `CHROME_DEBUG_PORT` into the container, so a single knob drives both sides. Recreate the node container after editing. See `.env.dist`. diff --git a/scripts/mcps/chrome-host/cdp_proxy.py b/tools/agents/mcps/chrome-host/cdp_proxy.py similarity index 100% rename from scripts/mcps/chrome-host/cdp_proxy.py rename to tools/agents/mcps/chrome-host/cdp_proxy.py diff --git a/scripts/mcps/chrome-host/mcp-entry.sh b/tools/agents/mcps/chrome-host/mcp-entry.sh similarity index 100% rename from scripts/mcps/chrome-host/mcp-entry.sh rename to tools/agents/mcps/chrome-host/mcp-entry.sh diff --git a/scripts/mcps/chrome-host/mcp-launch.sh b/tools/agents/mcps/chrome-host/mcp-launch.sh similarity index 90% rename from scripts/mcps/chrome-host/mcp-launch.sh rename to tools/agents/mcps/chrome-host/mcp-launch.sh index c47119ed0..69dbeca23 100755 --- a/scripts/mcps/chrome-host/mcp-launch.sh +++ b/tools/agents/mcps/chrome-host/mcp-launch.sh @@ -33,4 +33,7 @@ fi # package.json: it is host/dev MCP tooling for this bridge, not an app build or # runtime dependency, so it deliberately stays out of the lockfile. `-y` confirms # the one-off npx install; `@latest` tracks upstream fixes for the dev tool. +# +# Requires `python3` in the node image for cdp_proxy.py: the full `node:` +# image ships it, the `-slim` variants do not. exec npx -y chrome-devtools-mcp@latest --browser-url "http://127.0.0.1:${PROXY_PORT}" "$@" diff --git a/scripts/mcps/chrome-host/mcp-setup.sh b/tools/agents/mcps/chrome-host/mcp-setup.sh similarity index 97% rename from scripts/mcps/chrome-host/mcp-setup.sh rename to tools/agents/mcps/chrome-host/mcp-setup.sh index 54cfeb0e6..e4ca0fa79 100755 --- a/scripts/mcps/chrome-host/mcp-setup.sh +++ b/tools/agents/mcps/chrome-host/mcp-setup.sh @@ -13,7 +13,7 @@ set -eu -ROOT="$(CDPATH= cd -- "$(dirname -- "$0")/../../.." && pwd)" +ROOT="$(CDPATH= cd -- "$(dirname -- "$0")/../../../.." && pwd)" COMPOSE_FILE="$ROOT/docker-compose.yml" DOCKER_SERVICE_NAME=node MAPPING="host.docker.internal:host-gateway" diff --git a/scripts/mcps/chrome-host/start-host-chrome.sh b/tools/agents/mcps/chrome-host/start-host-chrome.sh similarity index 94% rename from scripts/mcps/chrome-host/start-host-chrome.sh rename to tools/agents/mcps/chrome-host/start-host-chrome.sh index 03f4f1fe0..0df0a24e9 100755 --- a/scripts/mcps/chrome-host/start-host-chrome.sh +++ b/tools/agents/mcps/chrome-host/start-host-chrome.sh @@ -19,6 +19,9 @@ # CHROME_DEBUG_BIND bind address (else auto-detected: loopback on Docker # Desktop, docker bridge gateway on native Engine). # SECURITY: a non-loopback bind exposes the port -- firewall it. +# CHROME_START_URL URL opened in the new window (else the application on +# COMPOSE_WEB_SERVER_PORT over HTTPS when the project has +# one, otherwise the docs on COMPOSE_DOCS_SERVER_PORT) # # Profile is always ~/.chrome-debug-profile- (not configurable). @@ -45,7 +48,7 @@ ENV_FILE="$env_root/.env" # matching .env line. Letting the shell run the assignment strips quotes and # inline comments for free. Values containing spaces must be quoted in .env. if [ -f "$ENV_FILE" ]; then - for env_key in CHROME_DEBUG_PORT CHROME_BIN CHROME_DEBUG_BIND COMPOSE_PROJECT_NAME COMPOSE_DOCS_SERVER_PORT; do + for env_key in CHROME_DEBUG_PORT CHROME_BIN CHROME_DEBUG_BIND COMPOSE_PROJECT_NAME COMPOSE_WEB_SERVER_PORT COMPOSE_DOCS_SERVER_PORT CHROME_START_URL; do eval "[ -n \"\${$env_key+x}\" ]" && continue eval "$(grep -E "^[[:space:]]*$env_key=" "$ENV_FILE" | tail -n 1 || true)" done @@ -245,7 +248,14 @@ set -- \ --no-first-run \ --no-default-browser-check \ --ignore-certificate-errors -set -- "$@" --new-window "http://localhost:${COMPOSE_DOCS_SERVER_PORT:-8000}" +if [ -n "${CHROME_START_URL:-}" ]; then + START_URL="$CHROME_START_URL" +elif [ -n "${COMPOSE_WEB_SERVER_PORT:-}" ]; then + START_URL="https://localhost:$COMPOSE_WEB_SERVER_PORT" +else + START_URL="http://localhost:${COMPOSE_DOCS_SERVER_PORT:-8000}" +fi +set -- "$@" --new-window "$START_URL" nohup "$CHROME" "$@" >"$PROFILE/chrome-debug.log" 2>&1 & diff --git a/tools/run-in-devcontainer.sh b/tools/run-in-devcontainer.sh new file mode 100755 index 000000000..7e4d62815 --- /dev/null +++ b/tools/run-in-devcontainer.sh @@ -0,0 +1,60 @@ +#!/bin/sh + +# Run a command inside the `devcontainer`, regardless of where this script is +# invoked from. It is used by the IDE run configurations (`.vscode/tasks.json` +# and `.idea/runConfigurations/`) so that a single definition works both when +# the IDE runs inside the Dev Container and when it runs on the host: +# +# * Inside the `devcontainer` the command is executed directly. +# * On the host the `devcontainer` is started when it is not running yet and +# the command is executed in it via `docker compose exec`. +# +# Usage: tools/run-in-devcontainer.sh [args...] +# e.g. tools/run-in-devcontainer.sh npm run start +# tools/run-in-devcontainer.sh npm run lint +# +# See the IDE integration documentation of the project for details. + +set -eu + +if [ $# -eq 0 ]; then + echo "Usage: $0 [args...]" >&2 + exit 1 +fi + +# Always run from the project root, the commands rely on paths relative to it +cd "$(dirname "$0")/.." + +if [ -f /.dockerenv ]; then + # Inside the `devcontainer`: make sure the wrapper scripts (`npm`, `make`, ...) + # in `/usr/local/bin` take precedence over paths injected by the IDE + PATH="/usr/local/bin:$PATH" + export PATH + exec "$@" +fi + +# On the host: IDEs launched from the desktop may not have the Docker CLI in PATH +PATH="$PATH:/usr/local/bin:/opt/homebrew/bin" +export PATH + +if [ ! -f .env ] || [ ! -f docker-compose.yml ]; then + echo "The development environment is not set up yet, run 'bash setup.sh' first." >&2 + echo "See the development environment documentation of the project for details." >&2 + exit 1 +fi + +# Start the `devcontainer` (and the service containers it depends on) when it is +# not running yet. The output is shown only when it fails. +if ! OUTPUT=$(docker compose up -d devcontainer 2>&1); then + echo "$OUTPUT" >&2 + exit 1 +fi + +# Allocate a pseudo-TTY only when the script itself runs in a terminal, so that +# colors, progress bars and Ctrl+C work in the IDE terminals while the script +# still works in non-interactive contexts (e.g. when its output is piped). +if [ -t 0 ] && [ -t 1 ]; then + exec docker compose exec devcontainer "$@" +else + exec docker compose exec -T devcontainer "$@" +fi diff --git a/tsconfig.build.json b/tsconfig.build.json index e20960a86..2bee32a29 100644 --- a/tsconfig.build.json +++ b/tsconfig.build.json @@ -13,6 +13,8 @@ ], "exclude": [ "src/**/__tests__/**", + "src/**/*.test.ts", + "src/**/*.test.tsx", "src/docs/**", "src/docsCustomProperties.ts" ] diff --git a/tsconfig.json b/tsconfig.json index 69a3f180c..0d3963bd3 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "target": "es2020", + "target": "esnext", "lib": [ "dom", "dom.iterable", @@ -10,7 +10,6 @@ "jest", "node" ], - "allowJs": false, "skipLibCheck": true, "strict": true, "forceConsistentCasingInFileNames": true, @@ -23,6 +22,7 @@ "jsx": "react-jsx" }, "include": [ + "playwright-ct.config.ts", "src", "tests" ] diff --git a/webpack.config.js b/webpack.config.js deleted file mode 100644 index 1f749e3d9..000000000 --- a/webpack.config.js +++ /dev/null @@ -1,114 +0,0 @@ -const Path = require('path'); -const MiniCssExtractPlugin = require('mini-css-extract-plugin'); -const StyleLintPlugin = require('stylelint-webpack-plugin'); -const TerserPlugin = require('terser-webpack-plugin'); -const VisualizerPlugin = require('webpack-visualizer-plugin2'); - -const MAX_DEVELOPMENT_OUTPUT_SIZE = 3400000; -const MAX_PRODUCTION_OUTPUT_SIZE = 470000; - -module.exports = (env, argv) => ({ - devtool: argv.mode === 'production' - ? false - : 'eval-cheap-module-source-map', - entry: { - 'docs-custom-properties': Path.join(__dirname, 'src/docsCustomProperties.ts'), - 'react-ui': Path.join(__dirname, 'src/index.ts'), - }, - externals: { - react: { - amd: 'react', - commonjs: 'react', - commonjs2: 'react', - root: 'React', - umd: 'react', - }, - 'react-dom': { - amd: 'react-dom', - commonjs: 'react-dom', - commonjs2: 'react-dom', - root: 'ReactDOM', - umd: 'react-dom', - }, - }, - module: { - rules: [ - { - // `core-js` must not be transpiled, see https://github.com/babel/babel-loader#exclude-libraries-that-should-not-be-transpiled - exclude: /node_modules[\\/]core-js/, - test: /\.(js|jsx|ts|tsx)$/, - use: [{ loader: 'babel-loader' }], - }, - { - test: /\.scss$/, - use: [ - MiniCssExtractPlugin.loader, - { - loader: 'css-loader', - options: { - modules: { - auto: true, // Enable CSS Modules only for files with `.module.*` extension - exportLocalsConvention: 'as-is', - localIdentName: argv.mode === 'production' - ? '[hash:base64:8]' - : '[name]__[local]__[hash:base64:8]', - namedExport: false, - }, - }, - }, - { loader: 'postcss-loader' }, - { - loader: 'sass-loader', - options: { - sassOptions: { - includePaths: ['node_modules'], - }, - }, - }, - ], - }, - ], - }, - optimization: { - minimize: argv.mode === 'production', - minimizer: [new TerserPlugin()], - }, - output: { - filename: argv.mode === 'production' - ? '[name].js' - : '[name].development.js', - libraryTarget: 'umd', - path: Path.join(__dirname, 'src/docs/_assets/generated/'), - }, - performance: { - hints: 'error', - maxAssetSize: argv.mode === 'production' - ? MAX_PRODUCTION_OUTPUT_SIZE - : MAX_DEVELOPMENT_OUTPUT_SIZE, - maxEntrypointSize: argv.mode === 'production' - ? MAX_PRODUCTION_OUTPUT_SIZE - : MAX_DEVELOPMENT_OUTPUT_SIZE, - }, - plugins: [ - new MiniCssExtractPlugin({ - chunkFilename: argv.mode === 'production' - ? '[id].css' - : '[id].development.css', - filename: argv.mode === 'production' - ? '[name].css' - : '[name].development.css', - ignoreOrder: false, // Enable to remove warnings about conflicting order - }), - new StyleLintPlugin({ - configFile: 'stylelint.config.mjs', - files: 'src/**/*.scss', - }), - new VisualizerPlugin({ - filename: Path.join('..', '..', '..', '..', 'statistics.html'), // Relative to output.path - }), - ], - resolve: { - extensions: ['.js', '.jsx', '.ts', '.tsx', '.scss'], - modules: ['src', 'node_modules'], - }, -}); diff --git a/webpack.config.mjs b/webpack.config.mjs new file mode 100644 index 000000000..3c23c8b3a --- /dev/null +++ b/webpack.config.mjs @@ -0,0 +1,3 @@ +import { webpackConfig } from './webpack/index.mjs'; + +export default (env, argv) => webpackConfig(argv); diff --git a/webpack/_config/devtoolConfig.mjs b/webpack/_config/devtoolConfig.mjs new file mode 100644 index 000000000..69f7a9af9 --- /dev/null +++ b/webpack/_config/devtoolConfig.mjs @@ -0,0 +1,9 @@ +/** @typedef {import('webpack').Configuration['devtool']} WebpackDevtoolConfig */ + +/** + * @param {Environment} environment + * @returns {WebpackDevtoolConfig} + */ +export const devtoolConfig = (environment) => (environment.WEBPACK_MODE === 'development' + ? 'eval-cheap-module-source-map' + : false); diff --git a/webpack/_config/entryConfig.mjs b/webpack/_config/entryConfig.mjs new file mode 100644 index 000000000..c4d9d58fb --- /dev/null +++ b/webpack/_config/entryConfig.mjs @@ -0,0 +1,12 @@ +import path from 'path'; +import { getRootDirname } from '../_helpers/getRootDirname.mjs'; + +/** @typedef {import('webpack').Configuration['entry']} WebpackEntryConfig */ + +/** + * @returns {WebpackEntryConfig} + */ +export const entryConfig = () => ({ + 'docs-custom-properties': path.join(getRootDirname(), 'src/docsCustomProperties.ts'), + 'react-ui': path.join(getRootDirname(), 'src/index.ts'), +}); diff --git a/webpack/_config/externalsConfig.mjs b/webpack/_config/externalsConfig.mjs new file mode 100644 index 000000000..d1dfc8a2c --- /dev/null +++ b/webpack/_config/externalsConfig.mjs @@ -0,0 +1,21 @@ +/** @typedef {import('webpack').Configuration['externals']} WebpackExternalsConfig */ + +/** + * @returns {WebpackExternalsConfig} + */ +export const externalsConfig = () => ({ + react: { + amd: 'react', + commonjs: 'react', + commonjs2: 'react', + root: 'React', + umd: 'react', + }, + 'react-dom': { + amd: 'react-dom', + commonjs: 'react-dom', + commonjs2: 'react-dom', + root: 'ReactDOM', + umd: 'react-dom', + }, +}); diff --git a/webpack/_config/moduleConfig.mjs b/webpack/_config/moduleConfig.mjs new file mode 100644 index 000000000..791f1512d --- /dev/null +++ b/webpack/_config/moduleConfig.mjs @@ -0,0 +1,38 @@ +import MiniCssExtractPlugin from 'mini-css-extract-plugin'; + +/** @typedef {import('webpack').Configuration['module']} WebpackModuleConfig */ + +/** + * @param {Environment} environment + * @returns {WebpackModuleConfig} + */ +export const moduleConfig = (environment) => ({ + rules: [ + { + exclude: /node_modules/, + test: /\.(js|jsx|ts|tsx)$/, + use: [{ loader: 'babel-loader' }], + }, + { + test: /\.scss$/, + use: [ + MiniCssExtractPlugin.loader, + { + loader: 'css-loader', + options: { + modules: { + auto: true, // Enable CSS Modules only for files with `.module.*` extension + exportLocalsConvention: 'as-is', + localIdentName: environment.WEBPACK_MODE === 'production' + ? '[hash:base64:8]' + : '[name]__[local]__[hash:base64:8]', + namedExport: false, + }, + }, + }, + { loader: 'postcss-loader' }, + { loader: 'sass-loader' }, + ], + }, + ], +}); diff --git a/webpack/_config/optimizationConfig.mjs b/webpack/_config/optimizationConfig.mjs new file mode 100644 index 000000000..f3ad7b765 --- /dev/null +++ b/webpack/_config/optimizationConfig.mjs @@ -0,0 +1,12 @@ +import TerserPlugin from 'terser-webpack-plugin'; + +/** @typedef {import('webpack').Configuration['optimization']} WebpackOptimizationConfig */ + +/** + * @param {Environment} environment + * @returns {WebpackOptimizationConfig} + */ +export const optimizationConfig = (environment) => ({ + minimize: environment.WEBPACK_MODE === 'production', + minimizer: [new TerserPlugin()], +}); diff --git a/webpack/_config/outputConfig.mjs b/webpack/_config/outputConfig.mjs new file mode 100644 index 000000000..f535dd40a --- /dev/null +++ b/webpack/_config/outputConfig.mjs @@ -0,0 +1,16 @@ +import path from 'path'; +import { getRootDirname } from '../_helpers/getRootDirname.mjs'; + +/** @typedef {import('webpack').Configuration['output']} WebpackOutputConfig */ + +/** + * @param {Environment} environment + * @returns {WebpackOutputConfig} + */ +export const outputConfig = (environment) => ({ + filename: environment.WEBPACK_MODE === 'production' + ? '[name].js' + : '[name].development.js', + libraryTarget: 'umd', + path: path.join(getRootDirname(), 'src/docs/_assets/generated/'), +}); diff --git a/webpack/_config/performanceConfig.mjs b/webpack/_config/performanceConfig.mjs new file mode 100644 index 000000000..7f14cf78a --- /dev/null +++ b/webpack/_config/performanceConfig.mjs @@ -0,0 +1,20 @@ +const MAX_DEVELOPMENT_OUTPUT_SIZE_BYTES = 3400000; +const MAX_PRODUCTION_OUTPUT_SIZE_BYTES = 470000; + +/** @typedef {import('webpack').Configuration['performance']} WebpackPerformanceConfig */ + +/** + * @param {Environment} environment + * @returns {WebpackPerformanceConfig} + */ +export const performanceConfig = (environment) => { + const maxOutputSize = environment.WEBPACK_MODE === 'production' + ? MAX_PRODUCTION_OUTPUT_SIZE_BYTES + : MAX_DEVELOPMENT_OUTPUT_SIZE_BYTES; + + return { + hints: 'error', + maxAssetSize: maxOutputSize, + maxEntrypointSize: maxOutputSize, + }; +}; diff --git a/webpack/_config/pluginsConfig.mjs b/webpack/_config/pluginsConfig.mjs new file mode 100644 index 000000000..c966269aa --- /dev/null +++ b/webpack/_config/pluginsConfig.mjs @@ -0,0 +1,29 @@ +import MiniCssExtractPlugin from 'mini-css-extract-plugin'; +import StyleLintPlugin from 'stylelint-webpack-plugin'; +import VisualizerPlugin from 'webpack-visualizer-plugin2'; + +/** @typedef {import('webpack').Configuration['plugins']} WebpackPluginsConfig */ + +/** + * @param {Environment} environment + * @returns {WebpackPluginsConfig} + */ +export const pluginsConfig = (environment) => [ + new MiniCssExtractPlugin({ + chunkFilename: environment.WEBPACK_MODE === 'production' + ? '[id].css' + : '[id].development.css', + filename: environment.WEBPACK_MODE === 'production' + ? '[name].css' + : '[name].development.css', + ignoreOrder: false, // Enable to remove warnings about conflicting order + }), + new StyleLintPlugin({ + configFile: 'stylelint.config.mjs', + files: '{src,tests}/**/*.{css,scss}', // Same files as the `lint:stylelint` script + ignorePath: '.gitignore', + }), + new VisualizerPlugin({ + filename: '../../../../stats.html', // Relative to `output.path` + }), +]; diff --git a/webpack/_config/resolveConfig.mjs b/webpack/_config/resolveConfig.mjs new file mode 100644 index 000000000..15e0027d5 --- /dev/null +++ b/webpack/_config/resolveConfig.mjs @@ -0,0 +1,9 @@ +/** @typedef {import('webpack').Configuration['resolve']} WebpackResolveConfig */ + +/** + * @returns {WebpackResolveConfig} + */ +export const resolveConfig = () => ({ + extensions: ['.ts', '.tsx', '.js', '.jsx', '.scss'], + modules: ['src', 'node_modules'], +}); diff --git a/webpack/_helpers/getRootDirname.mjs b/webpack/_helpers/getRootDirname.mjs new file mode 100644 index 000000000..db496719c --- /dev/null +++ b/webpack/_helpers/getRootDirname.mjs @@ -0,0 +1,8 @@ +import path from 'path'; + +/** + * Get the root dirname of the project. + * + * @returns {string} + */ +export const getRootDirname = () => path.join(import.meta.dirname, '..', '..'); diff --git a/webpack/index.mjs b/webpack/index.mjs new file mode 100644 index 000000000..f7e2c7aae --- /dev/null +++ b/webpack/index.mjs @@ -0,0 +1 @@ +export { webpackConfig } from './webpackConfig.mjs'; diff --git a/webpack/webpackConfig.mjs b/webpack/webpackConfig.mjs new file mode 100644 index 000000000..723a2f61d --- /dev/null +++ b/webpack/webpackConfig.mjs @@ -0,0 +1,39 @@ +import { devtoolConfig } from './_config/devtoolConfig.mjs'; +import { entryConfig } from './_config/entryConfig.mjs'; +import { externalsConfig } from './_config/externalsConfig.mjs'; +import { moduleConfig } from './_config/moduleConfig.mjs'; +import { optimizationConfig } from './_config/optimizationConfig.mjs'; +import { outputConfig } from './_config/outputConfig.mjs'; +import { performanceConfig } from './_config/performanceConfig.mjs'; +import { pluginsConfig } from './_config/pluginsConfig.mjs'; +import { resolveConfig } from './_config/resolveConfig.mjs'; + +/** @typedef {import('webpack').Configuration} WebpackConfig */ + +/** + * @typedef {Object} Environment + * @property {'development' | 'production'} WEBPACK_MODE + */ + +/** + * @param webpackArgs + * @returns {WebpackConfig} + */ +export const webpackConfig = (webpackArgs) => { + /** @type {Environment} */ + const environment = { + WEBPACK_MODE: webpackArgs.mode || 'development', + }; + + return ({ + devtool: devtoolConfig(environment), + entry: entryConfig(), + externals: externalsConfig(), + module: moduleConfig(environment), + optimization: optimizationConfig(environment), + output: outputConfig(environment), + performance: performanceConfig(environment), + plugins: pluginsConfig(environment), + resolve: resolveConfig(), + }); +};