diff --git a/.editorconfig b/.editorconfig index a182e3b56..9005c51dc 100644 --- a/.editorconfig +++ b/.editorconfig @@ -12,5 +12,6 @@ quote_type = single [Makefile] indent_style = tab -[{*.yaml, *.yml}] +[{*.yaml,*.yml}] indent_size = 2 +quote_type = double diff --git a/.github/workflows/_checks.yaml b/.github/workflows/_checks.yaml index 34814ec5d..588df770a 100644 --- a/.github/workflows/_checks.yaml +++ b/.github/workflows/_checks.yaml @@ -155,7 +155,7 @@ jobs: strategy: matrix: - os: ["ubuntu-latest"] + os: [ubuntu-latest] python-version: ["3.11", "3.14"] runs-on: ${{ matrix.os }} @@ -215,7 +215,7 @@ jobs: strategy: matrix: - os: ["ubuntu-latest"] + os: [ubuntu-latest] python-version: ["3.11", "3.14"] runs-on: ${{ matrix.os }} diff --git a/.github/workflows/manual_release_beta.yaml b/.github/workflows/manual_release_beta.yaml index 978265702..9a1632426 100644 --- a/.github/workflows/manual_release_beta.yaml +++ b/.github/workflows/manual_release_beta.yaml @@ -27,7 +27,7 @@ jobs: uses: apify/actions/wait-for-checks@v1.6.2 with: ref: ${{ github.sha }} - check-regexp: '^Checks' + check-regexp: ^Checks release_prepare: name: Release prepare diff --git a/.github/workflows/manual_release_docs.yaml b/.github/workflows/manual_release_docs.yaml index ed1af2dca..c3120b0de 100644 --- a/.github/workflows/manual_release_docs.yaml +++ b/.github/workflows/manual_release_docs.yaml @@ -46,7 +46,7 @@ jobs: uses: apify/actions/wait-for-checks@v1.6.2 with: ref: ${{ github.sha }} - check-regexp: '^Checks' + check-regexp: ^Checks - name: Checkout repository uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -84,8 +84,8 @@ jobs: uses: apify/actions/signed-commit@v1.6.2 with: message: "chore: Automatic docs theme update [skip ci]" - add: 'website/package.json website/pnpm-lock.yaml' - pull: '--rebase --autostash' + add: website/package.json website/pnpm-lock.yaml + pull: --rebase --autostash github-token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }} - name: Build docs diff --git a/.github/workflows/manual_release_stable.yaml b/.github/workflows/manual_release_stable.yaml index 64ca4bb2c..52fb51116 100644 --- a/.github/workflows/manual_release_stable.yaml +++ b/.github/workflows/manual_release_stable.yaml @@ -40,7 +40,7 @@ jobs: uses: apify/actions/wait-for-checks@v1.6.2 with: ref: ${{ github.sha }} - check-regexp: '^Checks' + check-regexp: ^Checks release_prepare: name: Release prepare diff --git a/.github/workflows/manual_version_docs.yaml b/.github/workflows/manual_version_docs.yaml index 7a771ad20..520c33b26 100644 --- a/.github/workflows/manual_version_docs.yaml +++ b/.github/workflows/manual_version_docs.yaml @@ -50,7 +50,7 @@ jobs: uses: apify/actions/wait-for-checks@v1.6.2 with: ref: ${{ github.sha }} - check-regexp: '^Checks' + check-regexp: ^Checks - name: Checkout repository uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -131,6 +131,6 @@ jobs: uses: apify/actions/signed-commit@v1.6.2 with: message: "docs: Version docs for v${{ steps.snapshot.outputs.version }} [skip ci]" - add: 'website/versioned_docs website/versioned_sidebars website/versions.json' - pull: '--rebase --autostash' + add: website/versioned_docs website/versioned_sidebars website/versions.json + pull: --rebase --autostash github-token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }} diff --git a/.markdownlint.yaml b/.markdownlint.yaml index 0c492ccd2..3716a76f3 100644 --- a/.markdownlint.yaml +++ b/.markdownlint.yaml @@ -8,9 +8,9 @@ line-length: false ul-style: style: dash -# Nested unordered lists use 4-space indentation. -ul-indent: - indent: 4 +# Code blocks are fenced, never indented. +code-block-style: + style: fenced # Docs are MDX and embed JSX components. no-inline-html: false diff --git a/.rules.md b/.rules.md index 047895dbf..4edef808b 100644 --- a/.rules.md +++ b/.rules.md @@ -52,12 +52,12 @@ uv run poe e2e-tests - Unused imports are allowed in `__init__.py` files (re-exports) - **Pre-commit hooks**: lint check + type check run automatically on commit - **Commits**: [Conventional Commits](https://www.conventionalcommits.org/) format. Choose the type based on *what* changed, not just *why*: - - `feat:` / `fix:` / `perf:` / `refactor:` / `style:` — **source code only**; these trigger a release and appear in the changelog - - `test:` — test additions or changes (no release triggered) - - `docs:` — documentation changes; also triggers a doc release on master - - `ci:` — CI/workflow changes - - `chore:` — dependency bumps, tooling, and other housekeeping - - `build:` — build system changes + - `feat:` / `fix:` / `perf:` / `refactor:` / `style:` — **source code only**; these trigger a release and appear in the changelog + - `test:` — test additions or changes (no release triggered) + - `docs:` — documentation changes; also triggers a doc release on master + - `ci:` — CI/workflow changes + - `chore:` — dependency bumps, tooling, and other housekeeping + - `build:` — build system changes ### Pydantic aliases diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8651363d7..85c11e28a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -122,7 +122,8 @@ uv run poe run-docs Markdown content (this guide, `README.md`, and the `docs/` folder) is checked with [markdownlint](https://github.com/DavidAnson/markdownlint). The Docusaurus website code is linted -with [oxlint](https://oxc.rs/) and formatted with [oxfmt](https://oxc.rs/). All of them run in CI. +with [oxlint](https://oxc.rs/) in type-aware mode (types come from `website/tsconfig.json`) and +formatted with [oxfmt](https://oxc.rs/). All of them run in CI. To run them locally (requires Node.js 22.12 or newer and pnpm), from the `website/` directory: ```sh diff --git a/docs/04_upgrading/upgrading_to_v2.md b/docs/04_upgrading/upgrading_to_v2.md index 313183927..1f897a2d0 100644 --- a/docs/04_upgrading/upgrading_to_v2.md +++ b/docs/04_upgrading/upgrading_to_v2.md @@ -14,9 +14,9 @@ Support for Python 3.8 has been dropped. The Apify Python SDK v2.x now requires - The SDK now uses [crawlee](https://github.com/apify/crawlee-python) for local storage emulation. This change should not affect intended usage (working with `Dataset`, `KeyValueStore` and `RequestQueue` classes from the `apify.storages` module or using the shortcuts exposed by the `Actor` class) in any way. - There is a difference in the `RequestQueue.add_request` method: it accepts an `apify.Request` object instead of a free-form dictionary. - - A quick way to migrate from dict-based arguments is to wrap it with a `Request.model_validate()` call. - - The preferred way is using the `Request.from_url` helper which prefills the `unique_key` and `id` attributes, or instantiating it directly, e.g., `Request(url='https://example.tld', ...)`. - - For simple use cases, `add_request` also accepts plain strings that contain a URL, e.g. `queue.add_request('https://example.tld')`. + - A quick way to migrate from dict-based arguments is to wrap it with a `Request.model_validate()` call. + - The preferred way is using the `Request.from_url` helper which prefills the `unique_key` and `id` attributes, or instantiating it directly, e.g., `Request(url='https://example.tld', ...)`. + - For simple use cases, `add_request` also accepts plain strings that contain a URL, e.g. `queue.add_request('https://example.tld')`. - Removing the `StorageClientManager` class is a significant change. If you need to change the storage client, use `crawlee.service_container` instead. ## Configuration diff --git a/website/oxlint.config.ts b/website/oxlint.config.mts similarity index 100% rename from website/oxlint.config.ts rename to website/oxlint.config.mts diff --git a/website/package.json b/website/package.json index e84fa0487..08ad99f8a 100644 --- a/website/package.json +++ b/website/package.json @@ -16,8 +16,8 @@ "lint:fix": "pnpm lint:md:fix && pnpm lint:code:fix", "lint:md": "cd .. && markdownlint --config .markdownlint.yaml \"**/*.{md,mdx}\" --ignore-path .gitignore --ignore website/versioned_docs --ignore website/versioned_sidebars --ignore CHANGELOG.md --ignore docs/changelog.md", "lint:md:fix": "cd .. && markdownlint --fix --config .markdownlint.yaml \"**/*.{md,mdx}\" --ignore-path .gitignore --ignore website/versioned_docs --ignore website/versioned_sidebars --ignore CHANGELOG.md --ignore docs/changelog.md", - "lint:code": "oxlint", - "lint:code:fix": "oxlint --fix", + "lint:code": "oxlint --type-aware --deny-warnings", + "lint:code:fix": "oxlint --type-aware --fix", "format": "oxfmt", "format:check": "oxfmt --check", "opt:images": "pnx --config.onlyBuiltDependencies=* @343dev/optimizt --webp", @@ -28,26 +28,25 @@ "@apify/docusaurus-plugin-typedoc-api": "^5.1.16", "@docusaurus/core": "^3.10.2", "@docusaurus/faster": "^3.10.2", - "@docusaurus/plugin-client-redirects": "^3.10.2", "@docusaurus/preset-classic": "^3.10.2", "@signalwire/docusaurus-plugin-llms-txt": "^1.2.2", "clsx": "^2.1.1", - "docusaurus-gtm-plugin": "^0.0.2", - "prop-types": "^15.8.1", "raw-loader": "^4.0.2", - "react": "^19.2.8", - "react-dom": "^19.2.8", + "react": "^19.3.0", + "react-dom": "^19.3.0", "unist-util-visit": "^5.1.0" }, "devDependencies": { "@apify/oxlint-config": "^0.3.0", "@apify/tsconfig": "^0.2.0", - "@types/react": "^19.2.18", + "@docusaurus/module-type-aliases": "^3.10.2", + "@docusaurus/types": "^3.10.2", + "@types/react": "^19.3.0", "markdownlint": "^0.41.1", "markdownlint-cli": "^0.49.1", "oxfmt": "^0.72.0", - "oxlint": "^1.80.0", - "path-browserify": "^1.0.1", + "oxlint": "^1.87.0", + "oxlint-tsgolint": "^7.0.2004", "rimraf": "^6.1.3", "typescript": "^6.0.3" }, diff --git a/website/pnpm-lock.yaml b/website/pnpm-lock.yaml index ff6a653e8..4a61357af 100644 --- a/website/pnpm-lock.yaml +++ b/website/pnpm-lock.yaml @@ -181,9 +181,6 @@ importers: '@docusaurus/faster': specifier: ^3.10.2 version: 3.10.2(@docusaurus/types@3.10.2(@swc/core@1.16.13)(@swc/html@1.16.13)(clean-css@5.3.3)(cssnano@6.1.2(postcss@8.5.29))(csso@5.0.5)(html-minifier-terser@7.2.0)(lightningcss@1.33.0)(postcss@8.5.29)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)(supports-color@5.5.0)(svgo@3.3.5))(clean-css@5.3.3)(cssnano@6.1.2(postcss@8.5.29))(csso@5.0.5)(html-minifier-terser@7.2.0)(postcss@8.5.29)(svgo@3.3.5) - '@docusaurus/plugin-client-redirects': - specifier: ^3.10.2 - version: 3.10.2(@docusaurus/faster@3.10.2(@docusaurus/types@3.10.2(@swc/core@1.16.13)(@swc/html@1.16.13)(clean-css@5.3.3)(cssnano@6.1.2(postcss@8.5.29))(csso@5.0.5)(html-minifier-terser@7.2.0)(lightningcss@1.33.0)(postcss@8.5.29)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)(supports-color@5.5.0)(svgo@3.3.5))(clean-css@5.3.3)(cssnano@6.1.2(postcss@8.5.29))(csso@5.0.5)(html-minifier-terser@7.2.0)(postcss@8.5.29)(svgo@3.3.5))(@mdx-js/react@3.1.1(@types/react@19.3.0)(react@19.3.0))(@rspack/core@1.7.12)(@swc/core@1.16.13)(@swc/html@1.16.13)(clean-css@5.3.3)(cssnano@6.1.2(postcss@8.5.29))(csso@5.0.5)(debug@4.4.3(supports-color@5.5.0))(html-minifier-terser@7.2.0)(lightningcss@1.33.0)(postcss@8.5.29)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)(supports-color@5.5.0)(svgo@3.3.5)(typescript@6.0.3) '@docusaurus/preset-classic': specifier: ^3.10.2 version: 3.10.2(@algolia/client-search@5.59.0)(@docusaurus/faster@3.10.2(@docusaurus/types@3.10.2(@swc/core@1.16.13)(@swc/html@1.16.13)(clean-css@5.3.3)(cssnano@6.1.2(postcss@8.5.29))(csso@5.0.5)(html-minifier-terser@7.2.0)(lightningcss@1.33.0)(postcss@8.5.29)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)(supports-color@5.5.0)(svgo@3.3.5))(clean-css@5.3.3)(cssnano@6.1.2(postcss@8.5.29))(csso@5.0.5)(html-minifier-terser@7.2.0)(postcss@8.5.29)(svgo@3.3.5))(@mdx-js/react@3.1.1(@types/react@19.3.0)(react@19.3.0))(@rspack/core@1.7.12)(@swc/core@1.16.13)(@swc/html@1.16.13)(@types/react@19.3.0)(clean-css@5.3.3)(cssnano@6.1.2(postcss@8.5.29))(csso@5.0.5)(debug@4.4.3(supports-color@5.5.0))(html-minifier-terser@7.2.0)(lightningcss@1.33.0)(postcss@8.5.29)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)(search-insights@2.17.3)(supports-color@5.5.0)(svgo@3.3.5)(typescript@6.0.3) @@ -193,20 +190,14 @@ importers: clsx: specifier: ^2.1.1 version: 2.1.1 - docusaurus-gtm-plugin: - specifier: ^0.0.2 - version: 0.0.2 - prop-types: - specifier: ^15.8.1 - version: 15.8.1 raw-loader: specifier: ^4.0.2 version: 4.0.2(webpack@5.111.1(@swc/core@1.16.13)(@swc/html@1.16.13)(clean-css@5.3.3)(cssnano@6.1.2(postcss@8.5.29))(csso@5.0.5)(html-minifier-terser@7.2.0)(lightningcss@1.33.0)(postcss@8.5.29)(svgo@3.3.5)) react: - specifier: ^19.2.8 + specifier: ^19.3.0 version: 19.3.0 react-dom: - specifier: ^19.2.8 + specifier: ^19.3.0 version: 19.3.0(react@19.3.0) unist-util-visit: specifier: ^5.1.0 @@ -214,12 +205,18 @@ importers: devDependencies: '@apify/oxlint-config': specifier: ^0.3.0 - version: 0.3.0(oxlint@1.87.0) + version: 0.3.0(oxlint@1.87.0(oxlint-tsgolint@7.0.2004)) '@apify/tsconfig': specifier: ^0.2.0 version: 0.2.0 + '@docusaurus/module-type-aliases': + specifier: ^3.10.2 + version: 3.10.2(@swc/core@1.16.13)(@swc/html@1.16.13)(clean-css@5.3.3)(cssnano@6.1.2(postcss@8.5.29))(csso@5.0.5)(html-minifier-terser@7.2.0)(lightningcss@1.33.0)(postcss@8.5.29)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)(supports-color@5.5.0)(svgo@3.3.5) + '@docusaurus/types': + specifier: ^3.10.2 + version: 3.10.2(@swc/core@1.16.13)(@swc/html@1.16.13)(clean-css@5.3.3)(cssnano@6.1.2(postcss@8.5.29))(csso@5.0.5)(html-minifier-terser@7.2.0)(lightningcss@1.33.0)(postcss@8.5.29)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)(supports-color@5.5.0)(svgo@3.3.5) '@types/react': - specifier: ^19.2.18 + specifier: ^19.3.0 version: 19.3.0 markdownlint: specifier: ^0.41.1 @@ -231,11 +228,11 @@ importers: specifier: ^0.72.0 version: 0.72.0 oxlint: - specifier: ^1.80.0 - version: 1.87.0 - path-browserify: - specifier: ^1.0.1 - version: 1.0.1 + specifier: ^1.87.0 + version: 1.87.0(oxlint-tsgolint@7.0.2004) + oxlint-tsgolint: + specifier: ^7.0.2004 + version: 7.0.2004 rimraf: specifier: ^6.1.3 version: 6.1.3 @@ -1768,13 +1765,6 @@ packages: react: '*' react-dom: '*' - '@docusaurus/plugin-client-redirects@3.10.2': - resolution: {integrity: sha512-z5I5ttCXw+8y2gHVZvqAMmUw4Rb0ZzKA5eCPk87SfM/jCKOTvE24yDpPAwwipvug96ij7mOwEHXWw8G4LlWdGA==} - engines: {node: '>=20.0'} - peerDependencies: - react: ^18.0.0 || ^19.0.0 - react-dom: ^18.0.0 || ^19.0.0 - '@docusaurus/plugin-content-blog@3.10.2': resolution: {integrity: sha512-0cbEnNKf0InmLkhj/+nVRmqEnWEoOE8Mh+2x1qOXI0qYpCnphq4RXknVJ8BvybKRXqYVvbmdMfiJSup+k4tm5w==} engines: {node: '>=20.0'} @@ -2303,6 +2293,36 @@ packages: cpu: [x64] os: [win32] + '@oxlint-tsgolint/darwin-arm64@7.0.2004': + resolution: {integrity: sha512-uJk3ttju7Lz+Nv8WG4CsLyewoL1qf/Ny8S8OksJ7Bm/F14Tc9gMfW6arM1PCc57IzH/X/I79YsCWTgxX1FKibQ==} + cpu: [arm64] + os: [darwin] + + '@oxlint-tsgolint/darwin-x64@7.0.2004': + resolution: {integrity: sha512-0BFfHTzDxNDFPcu0UZAXT6CyCJHAXM0dZveyDb4KEHa2qF/DSnOKOrmvK/wFuFol9kvijbGM9JfuOsor+zWXRw==} + cpu: [x64] + os: [darwin] + + '@oxlint-tsgolint/linux-arm64@7.0.2004': + resolution: {integrity: sha512-TAehQc+qdRXyDN3nl/r/3/oPrBVrbtrDeGMkFyG6mf+XphpoJ2lAMVFLclyvrVZCw02RbKROjyw8h72XwQQHcw==} + cpu: [arm64] + os: [linux] + + '@oxlint-tsgolint/linux-x64@7.0.2004': + resolution: {integrity: sha512-LPunZvm6ZbWPfHMAyfZf9ci3HHvNEzLejO8zdqO3GoVGoSEHqqufHUD7+OgeatVSaJP7uXDJ2HaNOHIoH7go4Q==} + cpu: [x64] + os: [linux] + + '@oxlint-tsgolint/win32-arm64@7.0.2004': + resolution: {integrity: sha512-FVWplzDImWhiuawnIZVETaQecv4GWom6Jv4Fx2xj7hhXXDZ5okEgiw1gTCImHTIQsi2ycC5oSxVwrn69bMh7iw==} + cpu: [arm64] + os: [win32] + + '@oxlint-tsgolint/win32-x64@7.0.2004': + resolution: {integrity: sha512-7PsxuUx11Ry9DYTWcljTzRbmZY9B6O9fFFfZV+aodQEMy6pfRT3fhoQRv9PtGN/89z1pPz3nFKrsFm6WqNtX7w==} + cpu: [x64] + os: [win32] + '@oxlint/binding-android-arm-eabi@1.87.0': resolution: {integrity: sha512-22tVIHlB9898OYsBKmYB6He1MCSqdTmK1BVWuSNUTVrpS0KWNege+U9uEYqGJ+KatQag0r/oU44i3OOs46z7HQ==} engines: {node: ^20.19.0 || >=22.12.0} @@ -5736,6 +5756,10 @@ packages: vite-plus: optional: true + oxlint-tsgolint@7.0.2004: + resolution: {integrity: sha512-vQ9WDF3fiZJvRdSDosNOflerOCOpwol6vWzVDxW76RcU19cjTh7engvkHLvmv+tzedR8fAiJUVUGr6IVZdkzXQ==} + hasBin: true + oxlint@1.87.0: resolution: {integrity: sha512-drxVlaW7Oqq7wSy1CN25znRu00aRq8n57Q2wniJRxCmtYVz07ufCm7EVDPQFZURrTgQIjzKrVEHAD/HcvJXObg==} engines: {node: ^20.19.0 || >=22.12.0} @@ -5833,9 +5857,6 @@ packages: pascal-case@3.1.2: resolution: {integrity: sha512-uWlGT3YSnK9x3BQJaOdcZwrnV6hPpd8jFH1/ucpiLRPh/2zCVJKS19E4GvYHvaCcACn3foXZ0cLB9Wrx1KGe5g==} - path-browserify@1.0.1: - resolution: {integrity: sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==} - path-exists@4.0.0: resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} engines: {node: '>=8'} @@ -7953,9 +7974,9 @@ snapshots: typescript: 6.0.3 zx: 8.8.5 - '@apify/oxlint-config@0.3.0(oxlint@1.87.0)': + '@apify/oxlint-config@0.3.0(oxlint@1.87.0(oxlint-tsgolint@7.0.2004))': dependencies: - oxlint: 1.87.0 + oxlint: 1.87.0(oxlint-tsgolint@7.0.2004) '@apify/tsconfig@0.2.0': {} @@ -9776,47 +9797,6 @@ snapshots: - uglify-js - webpack-cli - '@docusaurus/plugin-client-redirects@3.10.2(@docusaurus/faster@3.10.2(@docusaurus/types@3.10.2(@swc/core@1.16.13)(@swc/html@1.16.13)(clean-css@5.3.3)(cssnano@6.1.2(postcss@8.5.29))(csso@5.0.5)(html-minifier-terser@7.2.0)(lightningcss@1.33.0)(postcss@8.5.29)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)(supports-color@5.5.0)(svgo@3.3.5))(clean-css@5.3.3)(cssnano@6.1.2(postcss@8.5.29))(csso@5.0.5)(html-minifier-terser@7.2.0)(postcss@8.5.29)(svgo@3.3.5))(@mdx-js/react@3.1.1(@types/react@19.3.0)(react@19.3.0))(@rspack/core@1.7.12)(@swc/core@1.16.13)(@swc/html@1.16.13)(clean-css@5.3.3)(cssnano@6.1.2(postcss@8.5.29))(csso@5.0.5)(debug@4.4.3(supports-color@5.5.0))(html-minifier-terser@7.2.0)(lightningcss@1.33.0)(postcss@8.5.29)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)(supports-color@5.5.0)(svgo@3.3.5)(typescript@6.0.3)': - dependencies: - '@docusaurus/core': 3.10.2(@docusaurus/faster@3.10.2(@docusaurus/types@3.10.2(@swc/core@1.16.13)(@swc/html@1.16.13)(clean-css@5.3.3)(cssnano@6.1.2(postcss@8.5.29))(csso@5.0.5)(html-minifier-terser@7.2.0)(lightningcss@1.33.0)(postcss@8.5.29)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)(supports-color@5.5.0)(svgo@3.3.5))(clean-css@5.3.3)(cssnano@6.1.2(postcss@8.5.29))(csso@5.0.5)(html-minifier-terser@7.2.0)(postcss@8.5.29)(svgo@3.3.5))(@mdx-js/react@3.1.1(@types/react@19.3.0)(react@19.3.0))(@rspack/core@1.7.12)(@swc/core@1.16.13)(@swc/html@1.16.13)(clean-css@5.3.3)(cssnano@6.1.2(postcss@8.5.29))(csso@5.0.5)(debug@4.4.3(supports-color@5.5.0))(html-minifier-terser@7.2.0)(lightningcss@1.33.0)(postcss@8.5.29)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)(supports-color@5.5.0)(svgo@3.3.5)(typescript@6.0.3) - '@docusaurus/logger': 3.10.2 - '@docusaurus/utils': 3.10.2(@swc/core@1.16.13)(@swc/html@1.16.13)(clean-css@5.3.3)(cssnano@6.1.2(postcss@8.5.29))(csso@5.0.5)(html-minifier-terser@7.2.0)(lightningcss@1.33.0)(postcss@8.5.29)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)(supports-color@5.5.0)(svgo@3.3.5) - '@docusaurus/utils-common': 3.10.2(@swc/core@1.16.13)(@swc/html@1.16.13)(clean-css@5.3.3)(cssnano@6.1.2(postcss@8.5.29))(csso@5.0.5)(html-minifier-terser@7.2.0)(lightningcss@1.33.0)(postcss@8.5.29)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)(supports-color@5.5.0)(svgo@3.3.5) - '@docusaurus/utils-validation': 3.10.2(@swc/core@1.16.13)(@swc/html@1.16.13)(clean-css@5.3.3)(cssnano@6.1.2(postcss@8.5.29))(csso@5.0.5)(html-minifier-terser@7.2.0)(lightningcss@1.33.0)(postcss@8.5.29)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)(supports-color@5.5.0)(svgo@3.3.5) - eta: 2.2.0 - fs-extra: 11.4.1 - lodash: 4.18.1 - react: 19.3.0 - react-dom: 19.3.0(react@19.3.0) - tslib: 2.8.1 - transitivePeerDependencies: - - '@docusaurus/faster' - - '@mdx-js/react' - - '@minify-html/node' - - '@napi-rs/image' - - '@parcel/css' - - '@rspack/core' - - '@swc/core' - - '@swc/css' - - '@swc/html' - - bufferutil - - clean-css - - cssnano - - csso - - debug - - esbuild - - html-minifier-terser - - imagemin - - lightningcss - - postcss - - sharp - - supports-color - - svgo - - typescript - - uglify-js - - utf-8-validate - - webpack-cli - '@docusaurus/plugin-content-blog@3.10.2(606eb685b7aef6d421472852beeece8b)': dependencies: '@docusaurus/core': 3.10.2(@docusaurus/faster@3.10.2(@docusaurus/types@3.10.2(@swc/core@1.16.13)(@swc/html@1.16.13)(clean-css@5.3.3)(cssnano@6.1.2(postcss@8.5.29))(csso@5.0.5)(html-minifier-terser@7.2.0)(lightningcss@1.33.0)(postcss@8.5.29)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)(supports-color@5.5.0)(svgo@3.3.5))(clean-css@5.3.3)(cssnano@6.1.2(postcss@8.5.29))(csso@5.0.5)(html-minifier-terser@7.2.0)(postcss@8.5.29)(svgo@3.3.5))(@mdx-js/react@3.1.1(@types/react@19.3.0)(react@19.3.0))(@rspack/core@1.7.12)(@swc/core@1.16.13)(@swc/html@1.16.13)(clean-css@5.3.3)(cssnano@6.1.2(postcss@8.5.29))(csso@5.0.5)(debug@4.4.3(supports-color@5.5.0))(html-minifier-terser@7.2.0)(lightningcss@1.33.0)(postcss@8.5.29)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)(supports-color@5.5.0)(svgo@3.3.5)(typescript@6.0.3) @@ -10991,6 +10971,24 @@ snapshots: '@oxfmt/binding-win32-x64-msvc@0.72.0': optional: true + '@oxlint-tsgolint/darwin-arm64@7.0.2004': + optional: true + + '@oxlint-tsgolint/darwin-x64@7.0.2004': + optional: true + + '@oxlint-tsgolint/linux-arm64@7.0.2004': + optional: true + + '@oxlint-tsgolint/linux-x64@7.0.2004': + optional: true + + '@oxlint-tsgolint/win32-arm64@7.0.2004': + optional: true + + '@oxlint-tsgolint/win32-x64@7.0.2004': + optional: true + '@oxlint/binding-android-arm-eabi@1.87.0': optional: true @@ -14883,7 +14881,16 @@ snapshots: '@oxfmt/binding-win32-ia32-msvc': 0.72.0 '@oxfmt/binding-win32-x64-msvc': 0.72.0 - oxlint@1.87.0: + oxlint-tsgolint@7.0.2004: + optionalDependencies: + '@oxlint-tsgolint/darwin-arm64': 7.0.2004 + '@oxlint-tsgolint/darwin-x64': 7.0.2004 + '@oxlint-tsgolint/linux-arm64': 7.0.2004 + '@oxlint-tsgolint/linux-x64': 7.0.2004 + '@oxlint-tsgolint/win32-arm64': 7.0.2004 + '@oxlint-tsgolint/win32-x64': 7.0.2004 + + oxlint@1.87.0(oxlint-tsgolint@7.0.2004): optionalDependencies: '@oxlint/binding-android-arm-eabi': 1.87.0 '@oxlint/binding-android-arm64': 1.87.0 @@ -14904,6 +14911,7 @@ snapshots: '@oxlint/binding-win32-arm64-msvc': 1.87.0 '@oxlint/binding-win32-ia32-msvc': 1.87.0 '@oxlint/binding-win32-x64-msvc': 1.87.0 + oxlint-tsgolint: 7.0.2004 p-cancelable@3.0.0: {} @@ -15003,8 +15011,6 @@ snapshots: no-case: 3.0.4 tslib: 2.8.1 - path-browserify@1.0.1: {} - path-exists@4.0.0: {} path-exists@5.0.0: {} diff --git a/website/pnpm-workspace.yaml b/website/pnpm-workspace.yaml index d1e84afc0..563961803 100644 --- a/website/pnpm-workspace.yaml +++ b/website/pnpm-workspace.yaml @@ -7,11 +7,11 @@ nodeLinker: hoisted linkWorkspacePackages: true preferWorkspacePackages: true publicHoistPattern: - - "*" + - "*" allowBuilds: - '@apify/ui-icons': true - '@swc/core': true + "@apify/ui-icons": true + "@swc/core": true core-js: false unrs-resolver: true patchedDependencies: - '@signalwire/docusaurus-plugin-llms-txt@1.2.2': patches/@signalwire__docusaurus-plugin-llms-txt@1.2.2.patch + "@signalwire/docusaurus-plugin-llms-txt@1.2.2": patches/@signalwire__docusaurus-plugin-llms-txt@1.2.2.patch diff --git a/website/roa-loader/index.js b/website/roa-loader/index.js index 1a0af6d82..ecebc0456 100644 --- a/website/roa-loader/index.js +++ b/website/roa-loader/index.js @@ -62,7 +62,7 @@ async function encodeAndSign(source) { if (working) { return new Promise((resolve, reject) => { - queue.push(() => { + queue.push(async () => { return getHash(source).then(resolve, reject); }); }); diff --git a/website/src/theme/NavbarItem/DocsVersionDropdownNavbarItem.js b/website/src/theme/NavbarItem/DocsVersionDropdownNavbarItem.js index d42eb46a5..51b3e6e72 100644 --- a/website/src/theme/NavbarItem/DocsVersionDropdownNavbarItem.js +++ b/website/src/theme/NavbarItem/DocsVersionDropdownNavbarItem.js @@ -1,4 +1,4 @@ -import React, { useMemo } from 'react'; +import React from 'react'; import { useVersions, useActiveDocContext, useDocsVersionCandidates } from '@docusaurus/plugin-content-docs/client'; import { useDocsPreferredVersion } from '@docusaurus/theme-common'; import { translate } from '@docusaurus/Translate'; @@ -9,6 +9,18 @@ import DropdownNavbarItem from '@theme/NavbarItem/DropdownNavbarItem'; const getVersionMainDoc = (version) => version.docs.find((doc) => doc.id === version.mainDocId); +function getApiLinks(props, pathname, baseUrl) { + if (!pathname.startsWith(`${baseUrl}reference`)) { + return []; + } + + try { + return JSON.parse(props['data-api-links']); + } catch { + return []; + } +} + /* eslint-disable react/prop-types */ export default function DocsVersionDropdownNavbarItem({ mobile, @@ -21,16 +33,7 @@ export default function DocsVersionDropdownNavbarItem({ const { search, hash, pathname } = useLocation(); const { siteConfig } = useDocusaurusContext(); const baseUrl = siteConfig.baseUrl.endsWith('/') ? siteConfig.baseUrl : `${siteConfig.baseUrl}/`; - const apiLinks = useMemo(() => { - if (!pathname.startsWith(`${baseUrl}reference`)) { - return []; - } - try { - return JSON.parse(props['data-api-links']); - } catch { - return []; - } - }, [props['data-api-links'], pathname, baseUrl]); + const apiLinks = getApiLinks(props, pathname, baseUrl); const activeDocContext = useActiveDocContext(docsPluginId); const versions = useVersions(docsPluginId); diff --git a/website/tsconfig.json b/website/tsconfig.json new file mode 100644 index 000000000..2c6756f38 --- /dev/null +++ b/website/tsconfig.json @@ -0,0 +1,15 @@ +{ + "extends": "@apify/tsconfig", + "compilerOptions": { + "lib": ["ESNext", "DOM", "DOM.Iterable"], + "jsx": "react-jsx", + "module": "ESNext", + "moduleResolution": "Bundler", + "allowJs": true, + "noEmit": true, + "skipLibCheck": true, + "types": ["@docusaurus/module-type-aliases"] + }, + "include": ["src", "tools", "roa-loader", "*.js", "*.mts"], + "exclude": ["**/node_modules", "build", ".docusaurus"] +}