chore(users-permissions): move server code into server/src by unrevised6419 · Pull Request #26105 · strapi/strapi · GitHub
Skip to content

chore(users-permissions): move server code into server/src#26105

Open
unrevised6419 wants to merge 2 commits intostrapi:developfrom
unrevised6419:worktree-users-permissions-src
Open

chore(users-permissions): move server code into server/src#26105
unrevised6419 wants to merge 2 commits intostrapi:developfrom
unrevised6419:worktree-users-permissions-src

Conversation

@unrevised6419
Copy link
Copy Markdown
Contributor

@unrevised6419 unrevised6419 commented Apr 23, 2026

Summary

  • Move packages/plugins/users-permissions/server/*server/src/* so the plugin matches the admin/src + server/src layout used by every other plugin in packages/plugins/ (color-picker, i18n, graphql, sentry, cloud, documentation).
  • Update package.json exports["./strapi-server"].source and rollup.config.mjs input + rootDir.
  • Fix one relative path in server/src/services/__tests__/jwt.test.js that reached tests/helpers/ at the repo root (now one level deeper).
  • Update 5 stale doc references (docs/.../00-sessions-and-jwt.md, packages/plugins/documentation/README.md).

Why

Precursor to adding TypeScript support to the users-permissions plugin. TypeScript is in turn needed to drop React propTypes / defaultProps usage in the admin side — both removed from function components in React 19. Normalizing the folder layout first avoids entrenching the odd structure inside new TS tooling configs (tsconfig, rollup, jest).

No runtime or behavior changes. All server files were moved with git mv (R100 — identical content). The jest coverage glob server/**/*.{js,ts} continues to match recursively.

Conflict surface with open PRs

Swept all 218 open PRs; 16 touch packages/plugins/users-permissions/. The 8 that touch the renamed server/* paths will need rebase + path remap. Staleness snapshot (as of 2026-04-23):

Will need rebase (touch server/*)

PR Last update Age Paths Mergeable
#25368 2026-02-13 69d server/controllers/auth.js yes
#25144 2026-02-16 66d server/controllers/validation/__tests__/auth.test.js yes
#25106 2026-02-16 66d server/controllers/auth.js yes
#24818 2025-11-10 164d server/middlewares/rateLimit.js draft / unknown
#24476 2025-10-01 204d server/routes/content-api/auth.js unknown
#24465 2025-09-30 205d server/controllers/user.js yes
#24360 2025-09-17 218d server/controllers/user.js + graphql mutations + services/user.js conflicting
#22674 2025-06-11 316d server/bootstrap/index.js + server/controllers/auth.js + admin yes

Unaffected by rename (admin-only or package.json only)

PR Last update Age Paths Mergeable
#26103 2026-04-23 today package.json yes
#26100 2026-04-23 today package.json yes
#26065 2026-04-22 1d admin/src/tests/setup.js + package.json yes
#26038 2026-04-16 7d admin/src/pages/** yes
#25925 2026-04-04 19d admin/src/translations/zh-Hans.json conflicting (unrelated)
#25831 2026-04-23 today admin/src/translations/sk.json yes
#25824 2026-04-23 today admin/src/translations/cs.json yes
#25820 2026-03-24 30d admin/src/translations/da.json yes
#25766 2026-03-18 36d package.json (pnpm PoC) draft / conflicting

Note: my package.json change touches only exports["./strapi-server"].source; expect trivial conflicts with the dep-bump / release PRs (#26103, #26100, #26065, #25766) that modify dependencies.

Test plan

Plugin-scoped (@strapi/plugin-users-permissions):

  • yarn workspace @strapi/plugin-users-permissions build — rollup emits dist/admin + dist/server from new server/src root
  • yarn workspace @strapi/plugin-users-permissions test:unit43/43 pass (4 suites: jwt, email-template, auth, utils/index)
  • yarn workspace @strapi/plugin-users-permissions test:front:ce45/45 pass (18 suites)
  • yarn workspace @strapi/plugin-users-permissions lint — 0 errors (6 pre-existing func-names warnings in server/src/controllers/validation/auth.js, unrelated to rename)

Monorepo-wide (sanity: rename doesn't break neighbouring workspaces):

  • yarn test:unit:all25 nx projects pass
  • yarn test:front:all:ce5 nx projects pass

Runtime verification:

  • Smoke test: Strapi app with users-permissions enabled; auth flows (login / register / forgot-password / refresh-token) work end-to-end
  • require('@strapi/plugin-users-permissions/strapi-server') resolves correctly in both source and built dist/ consumers (the exports["./strapi-server"] map covers source, import, require, default — only source changed)

Left for CI:

  • API / e2e / cli suites (not run locally — they provision a test app + DB)

🤖 Generated with Claude Code

Align plugin folder structure with all other packages/plugins/* which
use an admin/src + server/src split. The users-permissions server
tree previously lived at the package root under server/ — an outlier.

Precursor to adding TypeScript support, which is in turn required to
drop React propTypes/defaultProps usage in the admin side (both
removed from function components in React 19).

- Move packages/plugins/users-permissions/server/* → server/src/*
- Update package.json exports["./strapi-server"].source
- Update rollup.config.mjs input + rootDir
- Adjust one relative path in server/src/services/__tests__/jwt.test.js
  that reached tests/helpers at repo root (now one level deeper)

No runtime or behavior changes. Jest coverage glob already uses
server/**/*.{js,ts} which continues to match recursively.

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

vercel Bot commented Apr 23, 2026

@dosubot dosubot Bot added pr: chore This PR contains chore tasks (cleanups, configs, tooling...) source: plugin:users-permissions Source is plugin/users-permissions package labels Apr 23, 2026
@unrevised6419 unrevised6419 marked this pull request as draft April 23, 2026 16:10
Follow-up to the server → server/src rename: update stale path
references in the sessions-and-jwt auth doc and the documentation
plugin README.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@butcherZ butcherZ added the community Changes and fixes created by community members label Apr 23, 2026
@unrevised6419 unrevised6419 marked this pull request as ready for review April 23, 2026 16:20
@butcherZ butcherZ added community Changes and fixes created by community members and removed community Changes and fixes created by community members labels Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community Changes and fixes created by community members pr: chore This PR contains chore tasks (cleanups, configs, tooling...) source: plugin:users-permissions Source is plugin/users-permissions package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants