Commit Graph

875 Commits

Author SHA1 Message Date
Vishal Kumar Singh 6e7e28306c fix(admin): use ISO 639-1 da for Danish admin locale (#26322)
* fix(admin): use ISO 639-1 da for Danish admin locale

Rename admin translation bundles from dk to da, normalize legacy dk in
app config, custom translation keys, localStorage, and stored user language.

Closes #25761

* fix(admin): add dk json fallback and admin user language migration

Register internal migration admin::migrate-prefered-language-dk-to-da to
rewrite admin_users.prefered_language from dk to da.

Export importLocaleJsonWithLegacyDkFallback from strapi-admin and use it in
core loadAdminTrads plus every bundled plugin registerTrads so third-party
plugins that still ship only dk.json keep loading when the UI locale is da.

Add @strapi/admin devDependency where the helper is imported from JS or
packages that did not already list it.

Refs #26322

* fix(types): add importLocaleJson to strapi-admin registerTrads typing

* fix(admin): expand plugin locale list and merge under canonical codes

Moves legacy dk handling into StrapiApp.loadTrads (flatMap + uniq + normalize merge) so registerTrads keeps a stable API without importLocaleJson. Core admin bundles use try/catch dynamic imports per locale code.

* fix(admin): route plugin translations through importLocaleJson

Pass StrapiApp.importLocaleJson into registerTrads so core and third-party plugins share legacy locale JSON fallback (da -> dk) and one-shot deprecation warnings. Relax admin test console.warn filter for those messages. Refs #26322.

* fix(admin): keep plugin locale fallback internal

---------

Co-authored-by: Bassel Kanso <basselkanso82@gmail.com>
2026-05-29 18:26:00 +03:00
Jonas Thelemann 8da3847d16 fix(deps): upgrade koa-session to v7.0.2 (#26140)
* fix(deps): upgrade `koa-session` to v7.0.2

* chore(deps): remove `@types/koa-session`

* chore: yarn dedupe

---------

Co-authored-by: Ben Irvin <ben@innerdvations.com>
2026-05-29 10:30:02 +00:00
Filip Ónodi e7772d621e feat(i18n): update and create Slovak translations (#25831)
Co-authored-by: Bassel Kanso <basselkanso82@gmail.com>
2026-05-26 15:10:41 +03:00
Bassel17 04ac8c3e90 release: 5.46.1 2026-05-20 09:09:00 +00:00
Ben Irvin 6ed22b5cfa security(deps): upgrade multiple dependencies (#26326)
* chore: upgrade simple-git

* chore: upgrade axios

* chore: upgrade docusaurus

* chore: upgrade docusaurus family

* chore: yarn.lock

* chore: upgrade styled-components

* chore: upgrade yaml

* chore: bump fast-uri in pinned deps

* chore: bump axios in cloud plugin

* chore: remove unnecessary ts error suppression

* chore: align docusaurus packages

* chore: yarn.lock

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Jamie Howard <jhoward1994@gmail.com>
2026-05-15 08:52:31 +01:00
Mark Kaylor 83fec11da9 Merge remote-tracking branch 'origin/main' into develop 2026-05-13 19:12:11 +02:00
markkaylor 7f34c4b7d9 release: 5.46.0 2026-05-13 13:39:32 +00:00
Andrei L b5452ab89f chore(eslint): migrate .eslintrc + .eslintignore to .eslintrc.cjs (#26216)
* chore(eslint): migrate .eslintrc + .eslintignore to .eslintrc.cjs

Consolidates the per-package ESLint setup into a single typed
`.eslintrc.cjs` file across the monorepo (177 files touched).

Why
- `.eslintignore` is removed in ESLint v9/v10. Folding ignore patterns
  into `ignorePatterns` inside the rc file is the supported migration
  path and unblocks future ESLint upgrades (which will likely be needed
  alongside the in-flight TypeScript 6 migration).
- `.cjs` extension is explicit about module format, so the configs keep
  working if any package later adopts `"type": "module"` (no CJS/ESM
  surprises).
- Wrapping each config in `// @ts-check` + a `Linter.Config`-typed
  `const config` block gives editor autocomplete and catches typos.
  Surfaced two real duplicates in
  `eslint-config-custom/back/typescript.js`
  (`node/no-unsupported-features/es-syntax`,
  `node/no-missing-import`), now deduplicated.
- `extends` references switched from the `custom/*` shorthand to the
  explicit `eslint-config-custom/*` package name. ESLint resolves both,
  but the explicit form makes the source unambiguous.
- Added `coverage/` to `ignorePatterns` so coverage output produced
  inside a workspace is not linted.

Misc
- `examples/kitchensink` had ESLint configured but no `lint` script;
  added one so the config actually runs.
- `nx.json` hash inputs updated:
  - removed `.eslintignore` (no longer exists)
  - replaced `{projectRoot}/.eslintrc.js` with
    `{projectRoot}/**/.eslintrc.cjs` so nested package configs are also
    part of the cache key (the previous glob missed them).
- `packages/utils/upgrade/tsconfig.eslint.json` include path updated
  from `.eslintrc.js` to `.eslintrc.cjs`.

Verification
- `eslint --print-config` resolves cleanly on sampled back/front
  packages (admin, users-permissions, upload).
- Full `pnpm -r lint` is clean.

* chore(eslint): set tsconfigRootDir for vscode-eslint typed linting

CLI lint resolved tsconfig paths via cwd, but vscode-eslint runs from
the workspace root and could not locate per-package tsconfigs. Set
parserOptions.tsconfigRootDir to __dirname in each package's
.eslintrc.cjs so the editor resolves typed-lint configs correctly.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore(eslint): self-ignore configs, scope coverage to jest packages

- Replace `env: { es6: true }` workaround with `.eslintrc.cjs` in
  ignorePatterns so eslint never lints the config file itself
  (root cause of the "const is not a keyword" parse error in es5)
- Add `.eslintrc.cjs` to ignorePatterns across all configs that
  were missing it
- Restrict `coverage/` ignorePatterns to workspace roots that
  actually run jest; drop from non-test packages and admin/server
  subdir configs (tests run from the workspace root)
2026-05-12 07:32:12 +00:00
Jamie Howard a2c5ecb225 Merge remote-tracking branch 'origin/main' into develop 2026-05-11 16:16:35 +01:00
jhoward1994 9300041094 release: 5.45.1 2026-05-11 10:41:36 +00:00
Andrei L 6d83054647 chore(deps): migrate msw 1.x → 2.13.4 across admin test suites (#26065)
* chore(deps): bump msw to 1.3.5 and typedoc to 0.25.13

Widens TypeScript peer ranges in msw (>= 4.4.x) and typedoc (adds 5.4.x),
unblocking a future bump to typescript 5.6 required by react-intl 7.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore(deps): bump msw to 2.13.4 across admin test suites

Migrates 8 workspaces (admin, content-manager, content-releases, upload,
review-workflows, plugin-i18n, plugin-documentation, plugin-users-permissions)
from msw 1.3.5 to 2.13.4; bumps email's unused dep for consistency.

Handler changes:
- rest.X((req, res, ctx) => res(ctx.json(X))) → http.X(() => HttpResponse.json(X))
- res(ctx.status(N)) → new HttpResponse(null, { status: N })
- res.once(...) → http.X(path, handler, { once: true })
- res.networkError(...) → HttpResponse.error()
- await req.json<T>() / casts → http.METHOD<Params, Body>(...) generics
- RequestHandler → HttpHandler
- Empty 200 responses use HttpResponse.json({}) to avoid cross-realm
  SyntaxError instanceof check in getFetchClient.ts

Jest setup (per msw frequent-issues guide):
- jest-preset.front.js: customExportConditions: [''] so msw/node resolves
  under jsdom; .mjs swc transform; ESM allow-list for msw deps
  (rettime, @open-draft, outvariant, until-async, etc.)
- packages/admin-test-utils/src/environment.ts: polyfill Node fetch +
  streams + BroadcastChannel + URL into jsdom global. Blob/File/FormData
  intentionally left as jsdom's — Strapi app code threads them through
  jsdom-only APIs (FileReader, Image, HTMLFormElement) where realm matters.
  Comment in env.ts documents the trade-off.

Verified vs develop+msw@1.3.5 baseline: 0 net regressions across all 7
workspaces with msw test files; TypeScript clean.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* Revert "chore(deps): bump typedoc to 0.25.13"

The typedoc bump was bundled with the msw 1.3.5 bump in 39d169cfbb but
isn't required for the msw v2 migration. Reverting the docs/ and
core/types typedoc dep back to 0.25.10 to keep this branch focused on
the msw upgrade.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore(tests): type msw handler params via generics

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore(tests): address review feedback on msw v2 migration

- env.ts: snapshot jsdom globals in setup(), restore in teardown() so
  per-test mutations cannot leak across files in a Jest worker.
- env.ts: collapse polyfill list and value map into a single NODE_GLOBALS
  source of truth; document the fetch trade-off (Node undici vs jsdom).
- handlers: replace `<never, Body>` generics with `<Record<string, never>,
  Body>` (msw v2 convention; `{}` blocked by ban-types).
- email: drop unused msw devDep entirely (zero source usage in workspace).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore(tests): use realm-agnostic SyntaxError check; drop URL polyfill

Two follow-ups to the msw v2 migration:

- `getFetchClient.responseInterceptor` now matches `error?.name === 'SyntaxError'`
  rather than `instanceof SyntaxError`. Constructor identity differs across JS realms
  (under jsdom + Node fetch, an empty 200 throws a Node-realm `SyntaxError` that
  fails the jsdom-realm `instanceof` check; the same is true in browsers when the
  Response originates from a service worker / iframe). Name comparison is realm-
  agnostic. With this in place, empty 200 handlers can return `new HttpResponse()`
  again (closer to v1's `res(ctx.status(200))`) instead of the `HttpResponse.json({})`
  workaround.

- Drop `URL` / `URLSearchParams` from the env.ts polyfill list. jsdom already
  provides browser-spec versions, and Node's `URL.createObjectURL` only accepts
  Node-realm `Blob` — replacing it broke the "from computer" upload path in
  `LogoInput.tsx`. MSW v2's interceptor doesn't require these to come from Node.

env.ts comments restructured: all polyfill rationale lives in one top-of-file block
so the body is short and the trade-offs are documented in one place.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore(tests): switch content-type-builder jest env to shared polyfilled env

`aiClient.test.ts` constructs `new Response(...)` which jsdom does not provide
spec-compliantly. Align CTB with the other admin test suites by using
`@strapi/admin-test-utils/environment`, which polyfills Node's
`fetch`/`Request`/`Response`/streams into the jsdom global.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(tests): make msw v2 + undici body + jsdom realms work together

Three regressions surfaced by running the full front test suite under
jsdom + Node's undici fetch polyfill:

1. `TypeError: Body is unusable: Body has already been read` in every
   handler doing `await request.json()`. MSW v2's `RequestHandler.run()`
   calls `request.clone()` before invoking the resolver (to keep a copy
   for post-hoc logging). Under Node's undici, `Request.clone()` tees the
   underlying `ReadableStream` and locks the original body, so the
   resolver's `.json()` throws. Fix in `environment.ts`: wrap the global
   `Request` constructor to stash the stringified body on every instance
   and patch `Request.prototype.json` / `.text` to return the stash when
   present. Handlers now get the body regardless of how many times msw
   clones internally.

2. `expect.any(Array)` and `toStrictEqual` failing with "serializes to
   the same string" against msw response bodies. `Response.prototype.json`
   runs Node's `JSON.parse`, so the resulting objects carry Node-realm
   `Object`/`Array` prototypes; jsdom's `instanceof`/strict-equality
   matchers reject them. Patch `Response.prototype.json` to parse with
   the jsdom-realm `JSON`.

3. `useWidgets > should handle network errors gracefully` expected the
   toast text "Network error", which msw v1's `res.networkError('Network
   error')` surfaced verbatim. v2's `HttpResponse.error()` drops the
   custom message and fetch throws `TypeError: Failed to fetch`; update
   the assertion accordingly.

Also: `UIDInput` uses `jest.useFakeTimers()`. Adding `doNotFake:
['queueMicrotask', 'setImmediate']` keeps per-test runtime at ~1s
instead of ~10s (plain fake timers stall undici's internal microtasks
between request emission and handler resolution), and an `afterEach`
restores real timers so a failing test cannot leak fake timers into
the next one.

Verified with `nx run-many --target=test:front --parallel=1` across all
12 projects — all suites green.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* test(admin): assert toast container in Widgets error tests

Replace text-match (`findByText('Server error' | 'Failed to fetch')`) with
`[data-sonner-toast]` container assertion. Decouples the test from toast
copy and from msw v1/v2 network-error message differences.

Addresses @jhoward1994's review comment on PR #26065.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* test(admin): assert toast text, scope msw handlers, use jsdom env

- Widgets tests: match actual toast text (Server error / fetch failure
  regex) instead of data-sonner-toast container.
- ConfirmBulkActionDialog: mark msw runtime handlers { once: true } so
  they do not leak across cases.
- content-type-builder: jest testEnvironment back to jsdom.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore(tests): split jest env patches into modules

Refactor packages/admin-test-utils/src/environment.ts by extracting
the msw v2 + undici body + jsdom realm shims into dedicated modules
under src/patches/ (node-globals, request-body-stash,
response-json-realm, types).

Co-Authored-By: Jamie Howard <jhoward1994@gmail.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 08:45:04 +00:00
Bassel17 c5bc749fee release: 5.45.0 2026-05-06 10:06:46 +00:00
Andrei L 90623baa6f fix(admin): clean up lazy component registration warnings (#25015)
* fix(admin): don't warn when Component is missing in addMenuLink/addSettingsLink

* fix: add some missing StrapiApp types

* fix(admin): clean up lazy component registrations

---------

Co-authored-by: Bassel Kanso <basselkanso82@gmail.com>
2026-04-30 16:27:48 +03:00
Adzouz 11554fe43e release: 5.44.0 2026-04-29 13:06:31 +00:00
nclsndr 765bd19a3a Merge branch 'develop' of github.com:strapi/strapi 2026-04-24 15:40:44 +02:00
Ben Irvin ac6cd0063c chore(deps): bump multiple dependencies (#26103)
dotenv: 16.4.5 → 16.6.1
fs-extra: 11.2.0 → 11.3.4
semver: 7.5.4 → 7.7.4
typescript: 5.4.4 → 5.4.5
esbuild-loader: 4.3.0 → 4.4.3
esbuild-register: 3.5.0 → 3.6.0
grant: ^5.4.8 → 5.4.24 (pinned)
markdown-it: ^13.0.2 → 14.1.1
2026-04-24 13:11:54 +01:00
Filip Ónodi 4ccaab3c74 enhancement(translations): update czech translations (#25824)
Co-authored-by: Bassel Kanso <basselkanso82@gmail.com>
2026-04-24 11:11:48 +03:00
otociulis e95b505aad fix(openapi): documentation plugin generates OpenAPI with incorrect ID parameter (#26067) 2026-04-23 19:50:43 +03:00
nclsndr 14628987b5 release: 5.43.0 2026-04-22 14:30:40 +00:00
jhoward1994 4709832272 release: 5.42.1 2026-04-15 11:13:30 +00:00
dependabot[bot] 5a61cef634 chore(deps): bump path-to-regexp from 8.4.1 to 8.4.2 (#25901)
Bumps [path-to-regexp](https://github.com/pillarjs/path-to-regexp) from 8.4.1 to 8.4.2.
- [Release notes](https://github.com/pillarjs/path-to-regexp/releases)
- [Changelog](https://github.com/pillarjs/path-to-regexp/blob/master/History.md)
- [Commits](https://github.com/pillarjs/path-to-regexp/compare/v8.4.1...v8.4.2)

---
updated-dependencies:
- dependency-name: path-to-regexp
  dependency-version: 8.4.2
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-10 11:00:15 +02:00
dependabot[bot] 68e20493cc chore(deps): bump lodash from 4.17.23 to 4.18.1 (#25919)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.23 to 4.18.1.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.23...4.18.1)

---
updated-dependencies:
- dependency-name: lodash
  dependency-version: 4.18.1
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-10 10:50:59 +02:00
Mark Kaylor 7d6ce043e0 Merge branch 'main' into develop 2026-04-09 15:36:49 +02:00
Michał Kleszczyński 62023de80d chore: update Polish language translations (#23762) 2026-04-08 15:29:18 +02:00
markkaylor e86a5190a5 release: 5.42.0 2026-04-08 12:14:52 +00:00
Adrien Lepoutre 8e11e41247 docs: fix typos in documentation plugin README
- Fix "so one" → "so on"
- Fix "In other to" → "In order to"
2026-04-03 16:34:04 +02:00
dependabot[bot] 56713ef0ed chore(deps): bump path-to-regexp from 8.4.0 to 8.4.1 (#25888) 2026-04-01 14:28:38 +02:00
dependabot[bot] 3d0e869d2f chore(deps): bump path-to-regexp from 8.2.0 to 8.4.0 (#25850) 2026-04-01 13:32:57 +02:00
Bassel Kanso b35ea93f83 Merge branch 'main' into develop 2026-04-01 13:29:10 +03:00
Bassel17 5ae36e382d release: 5.41.1 2026-04-01 09:48:47 +00:00
Bassel Kanso 056df8eaec Merge branch 'main' into develop 2026-04-01 12:30:46 +03:00
Bassel17 967175a13b release: 5.41.0 2026-04-01 09:10:30 +00:00
Joshua Klinesmith 8745b6a023 fix(documentation): use dist extensions path in production (#25863)
* fix(documentation): use dist extensions path in production

The documentation plugin hardcoded strapi.dirs.app.extensions (src/)
for reading OpenAPI spec files. In production, these files live under
dist/src/extensions/ after the build step, causing ENOENT errors when
the src/ directory is not deployed.

Use strapi.dirs.dist.extensions in production for both the service
(getFullDocumentationPath, getApiDocumentationPath) and the controller
(index route serving the spec and HTML). In development, the original
app.extensions path is preserved for writing generated docs.

Fixes #22701

* fix: use config instead of node_env

---------

Co-authored-by: Ben Irvin <ben@innerdvations.com>
Co-authored-by: Ben Irvin <ben.irvin@strapi.io>
2026-03-31 10:17:39 +00:00
Adzouz e1cdebd2a5 release: 5.40.0 2026-03-18 13:25:35 +00:00
Bassel Kanso ea3b700d6d Merge branch 'main' into develop 2026-03-11 16:37:26 +02:00
Bassel17 243c96ff4a release: 5.39.0 2026-03-11 10:13:31 +00:00
Bassel17 cd12da721d release: 5.38.1 2026-03-11 09:56:28 +00:00
Nikolas Rimikis a0a18654b2 chore: use https instead of git url in package.repository.url (#25698)
Signed-off-by: Nikolas Rimikis <leptopoda@users.noreply.github.com>
Co-authored-by: Nikolas Rimikis <leptopoda@users.noreply.github.com>
2026-03-10 12:42:42 +00:00
Nikolas Rimikis f2a8048761 chore: update package metadata (#25599)
Add homepage, bugs and repository information to every public package

Signed-off-by: Nikolas Rimikis <leptopoda@users.noreply.github.com>
Co-authored-by: Nikolas Rimikis <leptopoda@users.noreply.github.com>
2026-03-09 15:34:48 +01:00
Adrien L 9ef7aa5f21 fix: es translations (#25655)
Co-authored-by: Iñigo Zulueta <eggamer131@gmail.com>
2026-03-05 16:03:00 +01:00
Ben Irvin 12c801db9e chore: upgrade koa to 20.8.4 and minimatch to 10.2.4 (#25624) 2026-03-05 12:25:36 +00:00
markkaylor 29f5741e96 release: 5.38.0 2026-03-04 13:09:53 +00:00
mathildeleg 55f985dfaa chore: bump design-system to v2.2.0 (#25584) 2026-02-27 15:56:24 +00:00
Bassel17 e7bb15d0fd release: 5.37.1 2026-02-26 14:50:27 +00:00
innerdvations c18dbf7892 release: 5.37.0 2026-02-26 08:27:53 +00:00
innerdvations 6187e8a9d7 release: 5.36.1 2026-02-18 14:16:09 +00:00
Mark Kaylor 9ecfab0e5d Merge branch 'main' of github.com:strapi/strapi into develop 2026-02-11 17:13:52 +01:00
Ben Irvin bf72b0ec43 security: update react-router (#25391) 2026-02-11 16:30:17 +01:00
markkaylor 23a521fab4 release: 5.36.0 2026-02-11 14:05:28 +00:00
innerdvations ec17c9e1ed release: 5.35.0 2026-02-04 12:48:11 +00:00