diff --git a/.github/ISSUE_TEMPLATE/BUG_REPORT.md b/.github/ISSUE_TEMPLATE/BUG_REPORT.md index 6549f174613..bc701527bda 100644 --- a/.github/ISSUE_TEMPLATE/BUG_REPORT.md +++ b/.github/ISSUE_TEMPLATE/BUG_REPORT.md @@ -20,7 +20,7 @@ https://github.com/strapi/strapi/blob/main/CONTRIBUTING.md#reporting-an-issue ### Required System information - + diff --git a/.github/actions/check-pr-status/README.md b/.github/actions/check-pr-status/README.md index 0ef40e9fe7f..bcaf9b260cb 100644 --- a/.github/actions/check-pr-status/README.md +++ b/.github/actions/check-pr-status/README.md @@ -19,7 +19,7 @@ This action checks a PR labels, milestone and status to validate it is ready for ### Requirements -- The code is compatible with Node 18, and 20 +- The code is compatible with Node 18, 20, and 22 ### Dependencies diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 272b8e61d03..d4ab88976ca 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -37,15 +37,18 @@ jobs: filters: .github/filters.yaml pretty: - name: 'pretty (node: 20)' + name: 'pretty (node: ${{ matrix.node }})' runs-on: ubuntu-latest + strategy: + matrix: + node: [20, 22] steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - uses: actions/setup-node@v4 with: - node-version: 20 + node-version: ${{ matrix.node }} - uses: nrwl/nx-set-shas@v4 - name: Monorepo install uses: ./.github/actions/yarn-nm-install @@ -53,16 +56,18 @@ jobs: run: yarn prettier:check lint: - name: 'lint (node: 20)' - needs: [build] + name: 'lint (node: ${{ matrix.node }})' runs-on: ubuntu-latest + strategy: + matrix: + node: [20, 22] steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - uses: actions/setup-node@v4 with: - node-version: 20 + node-version: ${{ matrix.node }} - uses: nrwl/nx-set-shas@v4 - name: Monorepo install uses: ./.github/actions/yarn-nm-install @@ -72,29 +77,35 @@ jobs: run: yarn nx affected --target=lint --parallel --nx-ignore-cycles build: - name: 'build (node: 20)' + name: 'build (node: ${{ matrix.node }})' runs-on: ubuntu-latest + strategy: + matrix: + node: [20, 22] steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: 20 + node-version: ${{ matrix.node }} - name: Monorepo install uses: ./.github/actions/yarn-nm-install - name: Monorepo build uses: ./.github/actions/run-build typescript: - name: 'typescript' - needs: [build] + name: 'typescript (node: ${{ matrix.node }})' + needs: [changes, lint, pretty, build] runs-on: ubuntu-latest + strategy: + matrix: + node: [20, 22] steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - uses: actions/setup-node@v4 with: - node-version: 20 + node-version: ${{ matrix.node }} - uses: nrwl/nx-set-shas@v4 - name: Monorepo install uses: ./.github/actions/yarn-nm-install @@ -108,14 +119,15 @@ jobs: run: yarn nx affected --target=test:ts:front --nx-ignore-cycles unit_back: + if: needs.changes.outputs.backend == 'true' name: 'unit_back (node: ${{ matrix.node }})' - needs: [changes, build] + needs: [changes, lint, pretty, build] runs-on: ubuntu-latest env: YARN_ENABLE_IMMUTABLE_INSTALLS: false strategy: matrix: - node: [18, 20] + node: [20, 22] steps: - uses: actions/checkout@v4 with: @@ -133,9 +145,10 @@ jobs: unit_front: name: 'unit_front (node: ${{ matrix.node }})' - needs: [changes, build] + needs: [changes, lint, pretty, build] runs-on: ubuntu-latest strategy: + fail-fast: false # remove once tests aren't flaky matrix: node: [20] steps: @@ -150,16 +163,17 @@ jobs: uses: ./.github/actions/yarn-nm-install - name: Monorepo build uses: ./.github/actions/run-build - - name: Run test + - name: Run tests run: yarn nx affected --target=test:front --nx-ignore-cycles -- --runInBand e2e_ce: + if: needs.changes.outputs.backend == 'true' || needs.changes.outputs.frontend == 'true' timeout-minutes: 60 - needs: [changes, build] + needs: [changes, lint, pretty, build] name: '[CE] e2e (browser: ${{ matrix.project }})' runs-on: ubuntu-latest strategy: - fail-fast: false + fail-fast: false # remove once tests aren't flaky matrix: project: ['chromium', 'webkit', 'firefox'] shard: [1/2, 2/2] @@ -195,14 +209,15 @@ jobs: retention-days: 1 e2e_ee: + if: needs.changes.outputs.backend == 'true' || needs.changes.outputs.frontend == 'true' timeout-minutes: 60 - needs: [changes, build] + needs: [changes, lint, pretty, build] name: '[EE] e2e (browser: ${{ matrix.project }})' runs-on: ubuntu-latest env: STRAPI_LICENSE: ${{ secrets.strapiLicense }} strategy: - fail-fast: false + fail-fast: false # remove once tests aren't flaky matrix: project: ['chromium', 'webkit', 'firefox'] shard: [1/2, 2/2] @@ -239,10 +254,14 @@ jobs: retention-days: 1 cli: + if: needs.changes.outputs.backend == 'true' timeout-minutes: 60 - needs: [changes, build, typescript] - name: 'CLI Tests' + needs: [changes, lint, pretty, build] + name: 'CLI Tests (node: ${{ matrix.node }})' runs-on: ubuntu-latest + strategy: + matrix: + node: [20, 22] steps: - uses: actions/checkout@v4 with: @@ -250,7 +269,7 @@ jobs: - uses: actions/setup-node@v4 with: - node-version: 18 + node-version: ${{ matrix.node }} - name: Monorepo install uses: ./.github/actions/yarn-nm-install @@ -264,17 +283,15 @@ jobs: api_ce_pg: if: needs.changes.outputs.backend == 'true' runs-on: ubuntu-latest - needs: [changes, build] + needs: [changes, lint, pretty, build] name: '[CE] API Integration (postgres, node: ${{ matrix.node }}, shard: ${{ matrix.shard }})' strategy: matrix: - node: [18, 20] + node: [20, 22] shard: [1/5, 2/5, 3/5, 4/5, 5/5] services: postgres: - # Docker Hub image image: postgres - # Provide the password for postgres env: POSTGRES_USER: strapi POSTGRES_PASSWORD: strapi @@ -306,11 +323,11 @@ jobs: api_ce_mysql: if: needs.changes.outputs.backend == 'true' runs-on: ubuntu-latest - needs: [changes, build, typescript, unit_back, unit_front] + needs: [changes, lint, pretty, build] name: '[CE] API Integration (mysql:latest, package: mysql2}, node: ${{ matrix.node }}, shard: ${{ matrix.shard }})' strategy: matrix: - node: [18, 20] + node: [20, 22] shard: [1/5, 2/5, 3/5, 4/5, 5/5] services: mysql: @@ -345,11 +362,11 @@ jobs: api_ce_sqlite: if: needs.changes.outputs.backend == 'true' runs-on: ubuntu-latest - needs: [changes, build, typescript, unit_back, unit_front] + needs: [changes, lint, pretty, build] name: '[CE] API Integration (sqlite, package: better-sqlite3, node: ${{ matrix.node }}, shard: ${{ matrix.shard }})' strategy: matrix: - node: [18, 20] + node: [20, 22] shard: [1/5, 2/5, 3/5, 4/5, 5/5] steps: - uses: actions/checkout@v4 @@ -368,20 +385,18 @@ jobs: # EE api_ee_pg: runs-on: ubuntu-latest - needs: [changes, build] + needs: [changes, lint, pretty, build] name: '[EE] API Integration (postgres, node: ${{ matrix.node }}, shard: ${{ matrix.shard }})' if: needs.changes.outputs.backend == 'true' && github.event.pull_request.head.repo.full_name == github.repository && !(github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]') env: STRAPI_LICENSE: ${{ secrets.strapiLicense }} strategy: matrix: - node: [18, 20] + node: [20, 22] shard: [1/5, 2/5, 3/5, 4/5, 5/5] services: postgres: - # Docker Hub image image: postgres - # Provide the password for postgres env: POSTGRES_USER: strapi POSTGRES_PASSWORD: strapi @@ -413,14 +428,14 @@ jobs: api_ee_mysql: runs-on: ubuntu-latest - needs: [changes, build, typescript, unit_back, unit_front] + needs: [changes, lint, pretty, build] name: '[EE] API Integration (mysql:latest, package: mysql2, node: ${{ matrix.node }}, shard: ${{ matrix.shard }})' if: needs.changes.outputs.backend == 'true' && github.event.pull_request.head.repo.full_name == github.repository && !(github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]') env: STRAPI_LICENSE: ${{ secrets.strapiLicense }} strategy: matrix: - node: [18, 20] + node: [20, 22] shard: [1/5, 2/5, 3/5, 4/5, 5/5] services: mysql: @@ -455,14 +470,14 @@ jobs: api_ee_sqlite: runs-on: ubuntu-latest - needs: [changes, build, typescript, unit_back, unit_front] + needs: [changes, lint, pretty, build] name: '[EE] API Integration (sqlite, client: better-sqlite3, node: ${{ matrix.node }}, shard: ${{ matrix.shard }})' if: needs.changes.outputs.backend == 'true' && github.event.pull_request.head.repo.full_name == github.repository && !(github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]') env: STRAPI_LICENSE: ${{ secrets.strapiLicense }} strategy: matrix: - node: [18, 20] + node: [20, 22] shard: [1/5, 2/5, 3/5, 4/5, 5/5] steps: - uses: actions/checkout@v4 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2430febbb25..62b5bb0bc84 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -46,7 +46,7 @@ The Strapi core team will review your pull request and either merge it, request ## Contribution Prerequisites -- You have [Node.js](https://nodejs.org/en/) at version `>= v18 and <= v20` and [Yarn](https://yarnpkg.com/en/) at v1.2.0+ installed. +- You have [Node.js](https://nodejs.org/en/) at version `>= v18 and <= v22` and [Yarn](https://yarnpkg.com/en/) at v1.2.0+ installed. - You are familiar with [Git](https://git-scm.com). **Before submitting your pull request** make sure the following requirements are fulfilled: diff --git a/examples/experimental-dev/package.json b/examples/experimental-dev/package.json index e8a79b31f74..225356a728a 100644 --- a/examples/experimental-dev/package.json +++ b/examples/experimental-dev/package.json @@ -16,14 +16,14 @@ "dependencies": { "@strapi/plugin-users-permissions": "workspace:*", "@strapi/strapi": "workspace:*", - "better-sqlite3": "9.4.3", + "better-sqlite3": "11.3.0", "react": "rc", "react-dom": "rc", "react-router-dom": "6.22.3", "styled-components": "6.1.8" }, "engines": { - "node": ">=18.0.0 <=20.x.x", + "node": ">=18.0.0 <=22.x.x", "npm": ">=6.0.0" }, "devDependencies": { diff --git a/examples/getstarted/package.json b/examples/getstarted/package.json index 549325d6a8a..12875406f89 100644 --- a/examples/getstarted/package.json +++ b/examples/getstarted/package.json @@ -23,7 +23,7 @@ "@strapi/provider-upload-aws-s3": "workspace:*", "@strapi/provider-upload-cloudinary": "workspace:*", "@strapi/strapi": "workspace:*", - "better-sqlite3": "9.4.3", + "better-sqlite3": "11.3.0", "lodash": "4.17.21", "mysql2": "3.9.4", "passport-google-oauth2": "0.2.0", @@ -36,7 +36,7 @@ "styled-components": "6.1.8" }, "engines": { - "node": ">=18.0.0 <=20.x.x", + "node": ">=18.0.0 <=22.x.x", "npm": ">=6.0.0" }, "strapi": { diff --git a/examples/kitchensink-ts/package.json b/examples/kitchensink-ts/package.json index 07fd09ea872..47dd6b985c4 100644 --- a/examples/kitchensink-ts/package.json +++ b/examples/kitchensink-ts/package.json @@ -16,14 +16,14 @@ "dependencies": { "@strapi/plugin-users-permissions": "workspace:*", "@strapi/strapi": "workspace:*", - "better-sqlite3": "9.4.3", + "better-sqlite3": "11.3.0", "react": "18.3.1", "react-dom": "18.3.1", "react-router-dom": "6.22.3", "styled-components": "6.1.8" }, "engines": { - "node": ">=18.0.0 <=20.x.x", + "node": ">=18.0.0 <=22.x.x", "npm": ">=6.0.0" }, "strapi": { diff --git a/examples/kitchensink/package.json b/examples/kitchensink/package.json index 88ff537eb96..3fc47725e8e 100644 --- a/examples/kitchensink/package.json +++ b/examples/kitchensink/package.json @@ -17,7 +17,7 @@ "@strapi/provider-upload-aws-s3": "workspace:*", "@strapi/provider-upload-cloudinary": "workspace:*", "@strapi/strapi": "workspace:*", - "better-sqlite3": "9.4.3", + "better-sqlite3": "11.3.0", "lodash": "4.17.21", "mysql2": "3.9.4", "passport-google-oauth2": "0.2.0", @@ -28,7 +28,7 @@ "styled-components": "6.1.8" }, "engines": { - "node": ">=18.0.0 <=20.x.x", + "node": ">=18.0.0 <=22.x.x", "npm": ">=6.0.0" }, "strapi": { diff --git a/examples/plugins/todo-example/package.json b/examples/plugins/todo-example/package.json index c4106a593ec..41bca85739c 100644 --- a/examples/plugins/todo-example/package.json +++ b/examples/plugins/todo-example/package.json @@ -40,7 +40,7 @@ "@strapi/strapi": "workspace:*" }, "engines": { - "node": ">=12.x.x <=20.x.x", + "node": ">=18.0.0 <=22.x.x", "npm": ">=6.0.0" }, "strapi": { diff --git a/package.json b/package.json index cefb9e0d1ff..cc3e8e3af2f 100644 --- a/package.json +++ b/package.json @@ -156,7 +156,7 @@ }, "packageManager": "yarn@4.5.0", "engines": { - "node": ">=18.0.0 <=20.x.x", + "node": ">=18.0.0 <=22.x.x", "npm": ">=6.0.0" }, "isStrapiMonorepo": true diff --git a/packages/admin-test-utils/package.json b/packages/admin-test-utils/package.json index ae8208fd7b6..095a83c7912 100644 --- a/packages/admin-test-utils/package.json +++ b/packages/admin-test-utils/package.json @@ -93,6 +93,6 @@ "styled-components": "^6.0.0" }, "engines": { - "node": ">=18.0.0 <=20.x.x" + "node": ">=18.0.0 <=22.x.x" } } diff --git a/packages/cli/cloud/package.json b/packages/cli/cloud/package.json index b1c13063296..7dca1a9fbba 100644 --- a/packages/cli/cloud/package.json +++ b/packages/cli/cloud/package.json @@ -74,7 +74,7 @@ "tsconfig": "workspace:*" }, "engines": { - "node": ">=18.0.0 <=20.x.x", + "node": ">=18.0.0 <=22.x.x", "npm": ">=6.0.0" } } diff --git a/packages/cli/create-strapi-app/package.json b/packages/cli/create-strapi-app/package.json index 5747940344a..7f5a1a215db 100644 --- a/packages/cli/create-strapi-app/package.json +++ b/packages/cli/create-strapi-app/package.json @@ -72,7 +72,7 @@ "tsconfig": "workspace:*" }, "engines": { - "node": ">=18.0.0 <=20.x.x", + "node": ">=18.0.0 <=22.x.x", "npm": ">=6.0.0" } } diff --git a/packages/cli/create-strapi-app/src/utils/database.ts b/packages/cli/create-strapi-app/src/utils/database.ts index 41cfd052747..a6e1ab8b8d7 100644 --- a/packages/cli/create-strapi-app/src/utils/database.ts +++ b/packages/cli/create-strapi-app/src/utils/database.ts @@ -107,7 +107,7 @@ export async function getDatabaseInfos(options: Options): Promise { const sqlClientModule = { mysql: { mysql2: '3.9.4' }, postgres: { pg: '8.8.0' }, - sqlite: { 'better-sqlite3': '9.4.3' }, + sqlite: { 'better-sqlite3': '11.3.0' }, }; export function addDatabaseDependencies(scope: Scope) { diff --git a/packages/cli/create-strapi-app/src/utils/engines.ts b/packages/cli/create-strapi-app/src/utils/engines.ts index 084d7485540..67fe99a0bf9 100644 --- a/packages/cli/create-strapi-app/src/utils/engines.ts +++ b/packages/cli/create-strapi-app/src/utils/engines.ts @@ -1,4 +1,4 @@ export const engines = { - node: '>=18.0.0 <=20.x.x', + node: '>=18.0.0 <=22.x.x', npm: '>=6.0.0', }; diff --git a/packages/cli/create-strapi/package.json b/packages/cli/create-strapi/package.json index 9c5020ff7ff..d0381debb51 100644 --- a/packages/cli/create-strapi/package.json +++ b/packages/cli/create-strapi/package.json @@ -39,7 +39,7 @@ "create-strapi-app": "workspace:*" }, "engines": { - "node": ">=18.0.0 <=20.x.x", + "node": ">=18.0.0 <=22.x.x", "npm": ">=6.0.0" } } diff --git a/packages/core/admin/package.json b/packages/core/admin/package.json index 347a170bdbd..83663cd7d44 100644 --- a/packages/core/admin/package.json +++ b/packages/core/admin/package.json @@ -175,7 +175,7 @@ "styled-components": "^6.0.0" }, "engines": { - "node": ">=18.0.0 <=20.x.x", + "node": ">=18.0.0 <=22.x.x", "npm": ">=6.0.0" }, "nx": { diff --git a/packages/core/content-manager/package.json b/packages/core/content-manager/package.json index fa2b6d32421..3b24fa4c969 100644 --- a/packages/core/content-manager/package.json +++ b/packages/core/content-manager/package.json @@ -118,7 +118,7 @@ "styled-components": "^6.0.0" }, "engines": { - "node": ">=18.0.0 <=20.x.x", + "node": ">=18.0.0 <=22.x.x", "npm": ">=6.0.0" }, "strapi": { diff --git a/packages/core/content-releases/package.json b/packages/core/content-releases/package.json index 990a9f1858f..753a2c802aa 100644 --- a/packages/core/content-releases/package.json +++ b/packages/core/content-releases/package.json @@ -96,7 +96,7 @@ "styled-components": "^6.0.0" }, "engines": { - "node": ">=16.0.0 <=20.x.x", + "node": ">=18.0.0 <=22.x.x", "npm": ">=6.0.0" }, "strapi": { diff --git a/packages/core/content-type-builder/package.json b/packages/core/content-type-builder/package.json index 04597f4a039..f87cb4234ed 100644 --- a/packages/core/content-type-builder/package.json +++ b/packages/core/content-type-builder/package.json @@ -97,7 +97,7 @@ "styled-components": "^6.0.0" }, "engines": { - "node": ">=18.0.0 <=20.x.x", + "node": ">=18.0.0 <=22.x.x", "npm": ">=6.0.0" }, "strapi": { diff --git a/packages/core/core/package.json b/packages/core/core/package.json index 2a56454c254..374e905cd6e 100644 --- a/packages/core/core/package.json +++ b/packages/core/core/package.json @@ -131,7 +131,7 @@ "tsconfig": "workspace:*" }, "engines": { - "node": ">=18.0.0 <=20.x.x", + "node": ">=18.0.0 <=22.x.x", "npm": ">=6.0.0" } } diff --git a/packages/core/data-transfer/package.json b/packages/core/data-transfer/package.json index 9f7d5efadd4..280af391c80 100644 --- a/packages/core/data-transfer/package.json +++ b/packages/core/data-transfer/package.json @@ -78,7 +78,7 @@ "typescript": "5.3.2" }, "engines": { - "node": ">=18.0.0 <=20.x.x", + "node": ">=18.0.0 <=22.x.x", "npm": ">=6.0.0" } } diff --git a/packages/core/database/package.json b/packages/core/database/package.json index 8b62a21866a..2a71cae4cc2 100644 --- a/packages/core/database/package.json +++ b/packages/core/database/package.json @@ -57,7 +57,7 @@ "tsconfig": "workspace:*" }, "engines": { - "node": ">=18.0.0 <=20.x.x", + "node": ">=18.0.0 <=22.x.x", "npm": ">=6.0.0" } } diff --git a/packages/core/email/package.json b/packages/core/email/package.json index 443c3bcfb92..91d880d3030 100644 --- a/packages/core/email/package.json +++ b/packages/core/email/package.json @@ -85,7 +85,7 @@ "styled-components": "^6.0.0" }, "engines": { - "node": ">=18.0.0 <=20.x.x", + "node": ">=18.0.0 <=22.x.x", "npm": ">=6.0.0" }, "strapi": { diff --git a/packages/core/permissions/package.json b/packages/core/permissions/package.json index dab6ccb4ef9..f559a3f85f6 100644 --- a/packages/core/permissions/package.json +++ b/packages/core/permissions/package.json @@ -48,7 +48,7 @@ "tsconfig": "workspace:*" }, "engines": { - "node": ">=18.0.0 <=20.x.x", + "node": ">=18.0.0 <=22.x.x", "npm": ">=6.0.0" } } diff --git a/packages/core/review-workflows/package.json b/packages/core/review-workflows/package.json index 80c029f657f..ed0a14892b1 100644 --- a/packages/core/review-workflows/package.json +++ b/packages/core/review-workflows/package.json @@ -86,7 +86,7 @@ "styled-components": "^6.0.0" }, "engines": { - "node": ">=18.0.0 <=20.x.x", + "node": ">=18.0.0 <=22.x.x", "npm": ">=6.0.0" }, "strapi": { diff --git a/packages/core/strapi/README.md b/packages/core/strapi/README.md index baa0727aecc..569645b902a 100644 --- a/packages/core/strapi/README.md +++ b/packages/core/strapi/README.md @@ -109,6 +109,16 @@ Strapi only supports maintenance and LTS versions of Node.js. Please refer to th | PostgreSQL | 14.0 | 11.0 | | SQLite | 3 | 3 | +**Minimum Database Driver:** + +Database driver packages often have their own minimum versions for each version of Node, so here you can find the minimum required versions + +| Node Version | PostgreSQL (pg) | MySQL (mysql2) | SQLite (better-sqlite3) | +| ------------ | --------------- | -------------- | ----------------------- | +| 18 | pg@8.x | mysql2@2.x | better-sqlite3@7.6.2 | +| 20 | pg@8.x | mysql2@3.x | better-sqlite3@9.4.x | +| 22 | pg@8.x | mysql2@3.x | better-sqlite3@11.x | + **We recommend always using the latest version of Strapi stable to start your new projects**. ## Features diff --git a/packages/core/strapi/package.json b/packages/core/strapi/package.json index 6d0392f01c1..4b4b7004920 100644 --- a/packages/core/strapi/package.json +++ b/packages/core/strapi/package.json @@ -195,7 +195,7 @@ "styled-components": "^6.0.0" }, "engines": { - "node": ">=18.0.0 <=20.x.x", + "node": ">=18.0.0 <=22.x.x", "npm": ">=6.0.0" } } diff --git a/packages/core/types/package.json b/packages/core/types/package.json index 4492c9ead9e..787ed54afac 100644 --- a/packages/core/types/package.json +++ b/packages/core/types/package.json @@ -72,7 +72,7 @@ "undici": "6.19.2" }, "engines": { - "node": ">=18.0.0 <=20.x.x", + "node": ">=18.0.0 <=22.x.x", "npm": ">=6.0.0" } } diff --git a/packages/core/upload/package.json b/packages/core/upload/package.json index 51651c459ec..abbf7d6fa97 100644 --- a/packages/core/upload/package.json +++ b/packages/core/upload/package.json @@ -109,7 +109,7 @@ "styled-components": "^6.0.0" }, "engines": { - "node": ">=18.0.0 <=20.x.x", + "node": ">=18.0.0 <=22.x.x", "npm": ">=6.0.0" }, "strapi": { diff --git a/packages/core/utils/package.json b/packages/core/utils/package.json index 632dff41b35..77a4bc6866c 100644 --- a/packages/core/utils/package.json +++ b/packages/core/utils/package.json @@ -66,7 +66,7 @@ "tsconfig": "workspace:*" }, "engines": { - "node": ">=18.0.0 <=20.x.x", + "node": ">=18.0.0 <=22.x.x", "npm": ">=6.0.0" } } diff --git a/packages/generators/generators/package.json b/packages/generators/generators/package.json index 4f32ba8b4eb..cbbeb99e3f2 100644 --- a/packages/generators/generators/package.json +++ b/packages/generators/generators/package.json @@ -62,7 +62,7 @@ "tsconfig": "workspace:*" }, "engines": { - "node": ">=18.0.0 <=20.x.x", + "node": ">=18.0.0 <=22.x.x", "npm": ">=6.0.0" } } diff --git a/packages/plugins/cloud/package.json b/packages/plugins/cloud/package.json index b697dc9bc5c..72f4d866403 100644 --- a/packages/plugins/cloud/package.json +++ b/packages/plugins/cloud/package.json @@ -59,7 +59,7 @@ "styled-components": "^6.0.0" }, "engines": { - "node": ">=18.0.0 <=20.x.x", + "node": ">=18.0.0 <=22.x.x", "npm": ">=6.0.0" }, "strapi": { diff --git a/packages/plugins/color-picker/package.json b/packages/plugins/color-picker/package.json index caa6beddc8e..afa08051ba5 100644 --- a/packages/plugins/color-picker/package.json +++ b/packages/plugins/color-picker/package.json @@ -77,7 +77,7 @@ "styled-components": "^6.0.0" }, "engines": { - "node": ">=18.0.0 <=20.x.x", + "node": ">=18.0.0 <=22.x.x", "npm": ">=6.0.0" }, "strapi": { diff --git a/packages/plugins/documentation/package.json b/packages/plugins/documentation/package.json index efd9055e85d..75a77d2fa89 100644 --- a/packages/plugins/documentation/package.json +++ b/packages/plugins/documentation/package.json @@ -103,7 +103,7 @@ "styled-components": "^6.0.0" }, "engines": { - "node": ">=18.0.0 <=20.x.x", + "node": ">=18.0.0 <=22.x.x", "npm": ">=6.0.0" }, "strapi": { diff --git a/packages/plugins/graphql/package.json b/packages/plugins/graphql/package.json index be9973a11c1..5f37bbd9b2c 100644 --- a/packages/plugins/graphql/package.json +++ b/packages/plugins/graphql/package.json @@ -91,7 +91,7 @@ "styled-components": "^6.0.0" }, "engines": { - "node": ">=18.0.0 <=20.x.x", + "node": ">=18.0.0 <=22.x.x", "npm": ">=6.0.0" }, "strapi": { diff --git a/packages/plugins/i18n/package.json b/packages/plugins/i18n/package.json index 9f9f9860e55..7416a8f4410 100644 --- a/packages/plugins/i18n/package.json +++ b/packages/plugins/i18n/package.json @@ -86,7 +86,7 @@ "styled-components": "^6.0.0" }, "engines": { - "node": ">=18.0.0 <=20.x.x", + "node": ">=18.0.0 <=22.x.x", "npm": ">=6.0.0" }, "strapi": { diff --git a/packages/plugins/sentry/package.json b/packages/plugins/sentry/package.json index bc754317de8..bb609df2dae 100644 --- a/packages/plugins/sentry/package.json +++ b/packages/plugins/sentry/package.json @@ -71,7 +71,7 @@ "styled-components": "^6.0.0" }, "engines": { - "node": ">=18.0.0 <=20.x.x", + "node": ">=18.0.0 <=22.x.x", "npm": ">=6.0.0" }, "strapi": { diff --git a/packages/plugins/users-permissions/package.json b/packages/plugins/users-permissions/package.json index d768bb62e87..a1f8edbfcc5 100644 --- a/packages/plugins/users-permissions/package.json +++ b/packages/plugins/users-permissions/package.json @@ -86,7 +86,7 @@ "styled-components": "^6.0.0" }, "engines": { - "node": ">=18.0.0 <=20.x.x", + "node": ">=18.0.0 <=22.x.x", "npm": ">=6.0.0" }, "strapi": { diff --git a/packages/providers/email-amazon-ses/package.json b/packages/providers/email-amazon-ses/package.json index 212a24564d3..6a5ceff944e 100644 --- a/packages/providers/email-amazon-ses/package.json +++ b/packages/providers/email-amazon-ses/package.json @@ -51,7 +51,7 @@ "tsconfig": "workspace:*" }, "engines": { - "node": ">=18.0.0 <=20.x.x", + "node": ">=18.0.0 <=22.x.x", "npm": ">=6.0.0" } } diff --git a/packages/providers/email-mailgun/package.json b/packages/providers/email-mailgun/package.json index ff892c132cd..a7df70d49e7 100644 --- a/packages/providers/email-mailgun/package.json +++ b/packages/providers/email-mailgun/package.json @@ -54,7 +54,7 @@ "tsconfig": "workspace:*" }, "engines": { - "node": ">=18.0.0 <=20.x.x", + "node": ">=18.0.0 <=22.x.x", "npm": ">=6.0.0" } } diff --git a/packages/providers/email-nodemailer/package.json b/packages/providers/email-nodemailer/package.json index 107d05bc4ed..3184c6a1526 100644 --- a/packages/providers/email-nodemailer/package.json +++ b/packages/providers/email-nodemailer/package.json @@ -65,7 +65,7 @@ "tsconfig": "workspace:*" }, "engines": { - "node": ">=18.0.0 <=20.x.x", + "node": ">=18.0.0 <=22.x.x", "npm": ">=6.0.0" } } diff --git a/packages/providers/email-sendgrid/package.json b/packages/providers/email-sendgrid/package.json index f99c479032b..0cd6f712c71 100644 --- a/packages/providers/email-sendgrid/package.json +++ b/packages/providers/email-sendgrid/package.json @@ -51,7 +51,7 @@ "tsconfig": "workspace:*" }, "engines": { - "node": ">=18.0.0 <=20.x.x", + "node": ">=18.0.0 <=22.x.x", "npm": ">=6.0.0" } } diff --git a/packages/providers/email-sendmail/package.json b/packages/providers/email-sendmail/package.json index e36cfaff430..e817aec5063 100644 --- a/packages/providers/email-sendmail/package.json +++ b/packages/providers/email-sendmail/package.json @@ -51,7 +51,7 @@ "tsconfig": "workspace:*" }, "engines": { - "node": ">=18.0.0 <=20.x.x", + "node": ">=18.0.0 <=22.x.x", "npm": ">=6.0.0" } } diff --git a/packages/providers/upload-aws-s3/package.json b/packages/providers/upload-aws-s3/package.json index 442aebabb99..8589358636e 100644 --- a/packages/providers/upload-aws-s3/package.json +++ b/packages/providers/upload-aws-s3/package.json @@ -58,7 +58,7 @@ "tsconfig": "workspace:*" }, "engines": { - "node": ">=18.0.0 <=20.x.x", + "node": ">=18.0.0 <=22.x.x", "npm": ">=6.0.0" } } diff --git a/packages/providers/upload-cloudinary/package.json b/packages/providers/upload-cloudinary/package.json index 2a000f5b05a..de2b3f18ea4 100644 --- a/packages/providers/upload-cloudinary/package.json +++ b/packages/providers/upload-cloudinary/package.json @@ -52,7 +52,7 @@ "tsconfig": "workspace:*" }, "engines": { - "node": ">=18.0.0 <=20.x.x", + "node": ">=18.0.0 <=22.x.x", "npm": ">=6.0.0" } } diff --git a/packages/providers/upload-local/package.json b/packages/providers/upload-local/package.json index e5d7e937995..02e6d758e27 100644 --- a/packages/providers/upload-local/package.json +++ b/packages/providers/upload-local/package.json @@ -56,7 +56,7 @@ "tsconfig": "workspace:*" }, "engines": { - "node": ">=18.0.0 <=20.x.x", + "node": ">=18.0.0 <=22.x.x", "npm": ">=6.0.0" } } diff --git a/packages/utils/logger/package.json b/packages/utils/logger/package.json index dcc94f29c6f..3e6be97bb3b 100644 --- a/packages/utils/logger/package.json +++ b/packages/utils/logger/package.json @@ -47,7 +47,7 @@ "tsconfig": "workspace:*" }, "engines": { - "node": ">=18.0.0 <=20.x.x", + "node": ">=18.0.0 <=22.x.x", "npm": ">=6.0.0" } } diff --git a/packages/utils/typescript/package.json b/packages/utils/typescript/package.json index 0ac19044e44..3414d4b830c 100644 --- a/packages/utils/typescript/package.json +++ b/packages/utils/typescript/package.json @@ -46,7 +46,7 @@ "@types/fs-extra": "11.0.4" }, "engines": { - "node": ">=18.0.0 <=20.x.x", + "node": ">=18.0.0 <=22.x.x", "npm": ">=6.0.0" } } diff --git a/packages/utils/upgrade/package.json b/packages/utils/upgrade/package.json index d3365c8b86d..c79194e5f3d 100644 --- a/packages/utils/upgrade/package.json +++ b/packages/utils/upgrade/package.json @@ -83,7 +83,7 @@ "rimraf": "5.0.5" }, "engines": { - "node": ">=18.0.0 <=20.x.x", + "node": ">=18.0.0 <=22.x.x", "npm": ">=6.0.0" } } diff --git a/packages/utils/upgrade/resources/codemods/5.0.0/sqlite3-to-better-sqlite3.json.ts b/packages/utils/upgrade/resources/codemods/5.0.0/sqlite3-to-better-sqlite3.json.ts index d42d409aa7a..15acd2654d2 100644 --- a/packages/utils/upgrade/resources/codemods/5.0.0/sqlite3-to-better-sqlite3.json.ts +++ b/packages/utils/upgrade/resources/codemods/5.0.0/sqlite3-to-better-sqlite3.json.ts @@ -30,7 +30,6 @@ const transform: modules.runner.json.JSONTransform = (file, params) => { }); if (removed && !j.has('dependencies.better-sqlite3')) { - // TODO check this version when releasing V5 j.set('dependencies.better-sqlite3', '9.4.3'); } diff --git a/packages/utils/upgrade/resources/codemods/5.1.0/dependency-better-sqlite3.json.ts b/packages/utils/upgrade/resources/codemods/5.1.0/dependency-better-sqlite3.json.ts new file mode 100644 index 00000000000..aa93be7255b --- /dev/null +++ b/packages/utils/upgrade/resources/codemods/5.1.0/dependency-better-sqlite3.json.ts @@ -0,0 +1,48 @@ +import path from 'path'; +import semver from 'semver'; +import type { modules } from '../../../dist'; + +const DEP_NAME = 'better-sqlite3'; +const DEP_PATH = `dependencies.${DEP_NAME}`; +const DEP_VERSION = '11.3.0'; + +/** + * + */ +const transform: modules.runner.json.JSONTransform = (file, params) => { + return upgradeIfExists(file, params, DEP_PATH, DEP_VERSION); +}; + +export default transform; + +// TODO: move this to a utility once we solve the issue where codemods are not transpiled properly +const upgradeIfExists = ( + file: modules.runner.json.JSONSourceFile, + params: modules.runner.json.JSONTransformParams, + packagePath: string, + targetVersion: string +) => { + const { cwd, json } = params; + + // Return early if the file path is not the root package.json + if (file.path !== path.join(cwd, 'package.json')) { + return file.json; + } + + const packageJson = json(file.json); + + // Check if the package exists + if (packageJson.has(packagePath)) { + const currentVersion = packageJson.get(packagePath); + // ensure we only upgrade, not downgrade + if ( + typeof currentVersion === 'string' && + semver.valid(currentVersion) && + semver.lt(currentVersion, targetVersion) + ) { + packageJson.set(packagePath, targetVersion); + } + } + + return packageJson.root(); +}; diff --git a/packages/utils/upgrade/src/modules/project/project.ts b/packages/utils/upgrade/src/modules/project/project.ts index 21782337c37..aebc33281c5 100644 --- a/packages/utils/upgrade/src/modules/project/project.ts +++ b/packages/utils/upgrade/src/modules/project/project.ts @@ -93,6 +93,7 @@ export class Project { silent: true, verbose: 0, }); + const jsonRunner = jsonRunnerFactory(jsonFiles, { dry, cwd: this.cwd }); return [codeRunner, jsonRunner] as const; diff --git a/tests/cli/app-template/package.json b/tests/cli/app-template/package.json index 34ff5462c8f..81c08df1587 100644 --- a/tests/cli/app-template/package.json +++ b/tests/cli/app-template/package.json @@ -13,14 +13,14 @@ "dependencies": { "@strapi/plugin-users-permissions": "latest", "@strapi/strapi": "latest", - "better-sqlite3": "9.4.3", + "better-sqlite3": "11.3.0", "react": "18.3.1", "react-dom": "18.3.1", "react-router-dom": "6.21.1", "styled-components": "6.1.8" }, "engines": { - "node": ">=18.0.0 <=20.x.x", + "node": ">=18.0.0 <=22.x.x", "npm": ">=6.0.0" } } diff --git a/tests/e2e/app-template/package.json b/tests/e2e/app-template/package.json index 34ff5462c8f..81c08df1587 100644 --- a/tests/e2e/app-template/package.json +++ b/tests/e2e/app-template/package.json @@ -13,14 +13,14 @@ "dependencies": { "@strapi/plugin-users-permissions": "latest", "@strapi/strapi": "latest", - "better-sqlite3": "9.4.3", + "better-sqlite3": "11.3.0", "react": "18.3.1", "react-dom": "18.3.1", "react-router-dom": "6.21.1", "styled-components": "6.1.8" }, "engines": { - "node": ">=18.0.0 <=20.x.x", + "node": ">=18.0.0 <=22.x.x", "npm": ">=6.0.0" } } diff --git a/yarn.lock b/yarn.lock index c23e17e4478..fe0e254c78e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11793,14 +11793,14 @@ __metadata: languageName: node linkType: hard -"better-sqlite3@npm:9.4.3": - version: 9.4.3 - resolution: "better-sqlite3@npm:9.4.3" +"better-sqlite3@npm:11.3.0": + version: 11.3.0 + resolution: "better-sqlite3@npm:11.3.0" dependencies: bindings: "npm:^1.5.0" node-gyp: "npm:latest" prebuild-install: "npm:^7.1.1" - checksum: 10c0/efc8b1440388ff0ada7bd1d41021dd5a5a9cfa440d3e66a661e3f89c8d72229de939887aa0a9b24695843f88710ff79b34c5990aaf951b55a00858801a3b134c + checksum: 10c0/9adc99683300699581da5d7288e4a261b7d4381fd99c762fc6a0e9b1e1e226009c1333b46b10c1c453c356b20cb8be037a4616b1e717b3d1a00bd8493bec506e languageName: node linkType: hard @@ -16351,7 +16351,7 @@ __metadata: "@strapi/strapi": "workspace:*" "@vitejs/plugin-react": "npm:4.2.1" babel-plugin-react-compiler: "npm:0.0.0-experimental-c23de8d-20240515" - better-sqlite3: "npm:9.4.3" + better-sqlite3: "npm:11.3.0" react: "npm:rc" react-dom: "npm:rc" react-router-dom: "npm:6.22.3" @@ -17435,7 +17435,7 @@ __metadata: "@strapi/provider-upload-aws-s3": "workspace:*" "@strapi/provider-upload-cloudinary": "workspace:*" "@strapi/strapi": "workspace:*" - better-sqlite3: "npm:9.4.3" + better-sqlite3: "npm:11.3.0" lodash: "npm:4.17.21" mysql2: "npm:3.9.4" passport-google-oauth2: "npm:0.2.0" @@ -20797,7 +20797,7 @@ __metadata: dependencies: "@strapi/plugin-users-permissions": "workspace:*" "@strapi/strapi": "workspace:*" - better-sqlite3: "npm:9.4.3" + better-sqlite3: "npm:11.3.0" react: "npm:18.3.1" react-dom: "npm:18.3.1" react-router-dom: "npm:6.22.3" @@ -20813,7 +20813,7 @@ __metadata: "@strapi/provider-upload-aws-s3": "workspace:*" "@strapi/provider-upload-cloudinary": "workspace:*" "@strapi/strapi": "workspace:*" - better-sqlite3: "npm:9.4.3" + better-sqlite3: "npm:11.3.0" lodash: "npm:4.17.21" mysql2: "npm:3.9.4" passport-google-oauth2: "npm:0.2.0"