Login: Removes @hey-api/openapi-ts from the login project - #22757
Conversation
this is an ongoing project to be able to finally merge 'login' into 'client'
|
Claude finished @iOvergaard's task in 3m 59s —— View job PR ReviewTarget: Removes the locally-generated
Suggestions
Approved with Suggestions for improvementGood to go, but please carefully consider the importance of the suggestions. |
There was a problem hiding this comment.
Pull request overview
This PR removes the Login project’s locally generated Management API client (previously produced via @hey-api/openapi-ts) and switches Login to consume the same generated SDK/types exposed via @umbraco-cms/backoffice/external/backend-api, aligning with the longer-term goal of merging Login into Client.
Changes:
- Removed
@hey-api/openapi-tsusage in Login (config, generated files, npm script, and direct dependency). - Replaced Login’s local generated API calls with
SecurityService/UserServicefrom@umbraco-cms/backoffice/external/backend-api. - Removed deprecated local ProblemDetails type/guard in favor of
isProblemDetailsLikefrom@umbraco-cms/backoffice/resources.
Reviewed changes
Copilot reviewed 22 out of 23 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Umbraco.Web.UI.Login/src/utils/is-problem-details.function.ts | Removed deprecated local ProblemDetails type guard. |
| src/Umbraco.Web.UI.Login/src/types.ts | Switched password configuration types to come from @umbraco-cms/backoffice/external/backend-api; removed deprecated local types. |
| src/Umbraco.Web.UI.Login/src/mocks/handlers/login.handlers.ts | Removed dependency on locally generated API types; minor formatting updates. |
| src/Umbraco.Web.UI.Login/src/contexts/auth.repository.ts | Replaced local SDK calls with SecurityService/UserService calls and updated error handling. |
| src/Umbraco.Web.UI.Login/src/api/types.gen.ts | Deleted locally generated API types. |
| src/Umbraco.Web.UI.Login/src/api/sdk.gen.ts | Deleted locally generated API SDK functions. |
| src/Umbraco.Web.UI.Login/src/api/index.ts | Deleted local API barrel export. |
| src/Umbraco.Web.UI.Login/src/api/core/utils.gen.ts | Deleted local generated client core utilities. |
| src/Umbraco.Web.UI.Login/src/api/core/types.gen.ts | Deleted local generated core types. |
| src/Umbraco.Web.UI.Login/src/api/core/serverSentEvents.gen.ts | Deleted local generated SSE client. |
| src/Umbraco.Web.UI.Login/src/api/core/queryKeySerializer.gen.ts | Deleted local generated query key serialization helpers. |
| src/Umbraco.Web.UI.Login/src/api/core/pathSerializer.gen.ts | Deleted local generated URL/path serializers. |
| src/Umbraco.Web.UI.Login/src/api/core/params.gen.ts | Deleted local generated client params builder. |
| src/Umbraco.Web.UI.Login/src/api/core/bodySerializer.gen.ts | Deleted local generated body/query serializers. |
| src/Umbraco.Web.UI.Login/src/api/core/auth.gen.ts | Deleted local generated auth helpers. |
| src/Umbraco.Web.UI.Login/src/api/client/utils.gen.ts | Deleted local generated fetch client utilities. |
| src/Umbraco.Web.UI.Login/src/api/client/types.gen.ts | Deleted local generated fetch client types. |
| src/Umbraco.Web.UI.Login/src/api/client/index.ts | Deleted local generated client barrel export. |
| src/Umbraco.Web.UI.Login/src/api/client/client.gen.ts | Deleted local generated fetch client implementation. |
| src/Umbraco.Web.UI.Login/src/api/client.gen.ts | Deleted local generated client instantiation entrypoint. |
| src/Umbraco.Web.UI.Login/package.json | Removed generate:server-api script and direct @hey-api/openapi-ts devDependency. |
| src/Umbraco.Web.UI.Login/package-lock.json | Updated lockfile to reflect dependency/script changes (and associated dependency graph updates). |
| src/Umbraco.Web.UI.Login/openapi-ts.config.ts | Deleted local OpenAPI generator configuration. |
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…braco/Umbraco-CMS into v18/feature/login-pure-client
@hey-api/openapi-ts from the login project
|
Claude finished @leekelleher's task in 6m 49s —— View job PR ReviewTarget: Removes the locally-generated
Suggestions
ApprovedThe migration is correct and clean. Error handling is behaviorally equivalent — the backoffice client's |
leekelleher
left a comment
There was a problem hiding this comment.
Tested out, all working as described! 🚀
Great reduction and step towards bringing Login into the (backoffice) Client project. 💪
Backports #22757 from main. The login project generated its own API client for five operations that the backoffice client already exports, so it now imports SecurityService and UserService from @umbraco-cms/backoffice/external/backend-api instead. This removes the dependency entirely rather than upgrading it, which takes the login app from 1 critical + 1 high advisory to zero: every advisory against it came from the openapi-ts chain (handlebars, then json-schema-ref-parser -> js-yaml), and no release of openapi-ts is currently free of both. login.js drops from 76.24 kB to 60.65 kB (gzip 17.88 -> 13.44 kB). Unlike on main, the deprecated UmbProblemDetails type and isProblemDetails() are kept: they were deprecated in V16 (#19495), so the earliest removal is V18. They are hand-written and independent of the generated client, so keeping them costs nothing and this stays non-breaking. Closes #23500 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Backports #22757 from main. The login project generated its own API client for five operations that the backoffice client already exports, so it now imports SecurityService and UserService from @umbraco-cms/backoffice/external/backend-api instead. This removes the dependency entirely rather than upgrading it, which takes the login app from 1 critical + 1 high advisory to zero: every advisory against it came from the openapi-ts chain (handlebars, then json-schema-ref-parser -> js-yaml), and no release of openapi-ts is currently free of both. login.js drops from 76.24 kB to 60.65 kB (gzip 17.88 -> 13.44 kB). Unlike on main, the deprecated UmbProblemDetails type and isProblemDetails() are kept: they were deprecated in V16 (#19495), so the earliest removal is V18. They are hand-written and independent of the generated client, so keeping them costs nothing and this stays non-breaking. Closes #23500 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Backports #22757 from main. The login project generated its own API client for five operations that the backoffice client already exports, so it now imports SecurityService and UserService from @umbraco-cms/backoffice/external/backend-api instead. This removes the dependency entirely rather than upgrading it, which takes the login app from 1 critical + 1 high advisory to zero: every advisory against it came from the openapi-ts chain (handlebars, then json-schema-ref-parser -> js-yaml), and no release of openapi-ts is currently free of both. login.js drops from 76.24 kB to 60.65 kB (gzip 17.88 -> 13.44 kB). Unlike on main, the deprecated UmbProblemDetails type and isProblemDetails() are kept: they were deprecated in V16 (#19495), so the earliest removal is V18. They are hand-written and independent of the generated client, so keeping them costs nothing and this stays non-breaking. Closes #23500 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Backports #22757 from main. The login project generated its own API client for five operations that the backoffice client already exports, so it now imports SecurityService and UserService from @umbraco-cms/backoffice/external/backend-api instead. This removes the dependency entirely rather than upgrading it, which takes the login app from 1 critical + 1 high advisory to zero: every advisory against it came from the openapi-ts chain (handlebars, then json-schema-ref-parser -> js-yaml), and no release of openapi-ts is currently free of both. login.js drops from 76.24 kB to 60.65 kB (gzip 17.88 -> 13.44 kB). Unlike on main, the deprecated UmbProblemDetails type and isProblemDetails() are kept: they were deprecated in V16 (#19495), so the earliest removal is V18. They are hand-written and independent of the generated client, so keeping them costs nothing and this stays non-breaking. Closes #23500 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Backports #22757 from main. The login project generated its own API client for five operations that the backoffice client already exports, so it now imports SecurityService and UserService from @umbraco-cms/backoffice/external/backend-api instead. This removes the dependency entirely rather than upgrading it, which takes the login app from 1 critical + 1 high advisory to zero: every advisory against it came from the openapi-ts chain (handlebars, then json-schema-ref-parser -> js-yaml), and no release of openapi-ts is currently free of both. login.js drops from 76.24 kB to 60.65 kB (gzip 17.88 -> 13.44 kB). Unlike on main, the deprecated UmbProblemDetails type and isProblemDetails() are kept: they were deprecated in V16 (#19495), so the earliest removal is V18. They are hand-written and independent of the generated client, so keeping them costs nothing and this stays non-breaking. Closes #23500 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Resolves the TODO left by the previous commit. UmbProblemDetails and isProblemDetails() were kept out of caution for the V16 deprecation window, but the login project is private with no exports, main or types, nothing outside it can import from it, and its only internal use is isProblemDetailsLike from @umbraco-cms/backoffice/resources — the replacement. So there is no consumer to break and no reason to hold them until V18. Brings this fully in line with #22757 on main. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…) (#23501) * improvement(login): remove @hey-api/openapi-ts from the login project Backports #22757 from main. The login project generated its own API client for five operations that the backoffice client already exports, so it now imports SecurityService and UserService from @umbraco-cms/backoffice/external/backend-api instead. This removes the dependency entirely rather than upgrading it, which takes the login app from 1 critical + 1 high advisory to zero: every advisory against it came from the openapi-ts chain (handlebars, then json-schema-ref-parser -> js-yaml), and no release of openapi-ts is currently free of both. login.js drops from 76.24 kB to 60.65 kB (gzip 17.88 -> 13.44 kB). Unlike on main, the deprecated UmbProblemDetails type and isProblemDetails() are kept: they were deprecated in V16 (#19495), so the earliest removal is V18. They are hand-written and independent of the generated client, so keeping them costs nothing and this stays non-breaking. Closes #23500 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * docs(login): correct CLAUDE.md drift from the backport The cherry-pick pulled main's wording over two v17-accurate details: the runtime line (v17 enforces node >=24.13 / npm >=11 in package.json) and the utils listing, which dropped is-problem-details.function.ts even though this backport deliberately keeps that file. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * improvement(login): remove the deprecated problem-details helpers Resolves the TODO left by the previous commit. UmbProblemDetails and isProblemDetails() were kept out of caution for the V16 deprecation window, but the login project is private with no exports, main or types, nothing outside it can import from it, and its only internal use is isProblemDetailsLike from @umbraco-cms/backoffice/resources — the replacement. So there is no consumer to break and no reason to hold them until V18. Brings this fully in line with #22757 on main. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * improvement(login): bump typescript to 6 and sync CLAUDE.md TS 6 was held back on v17 for the published backoffice types, but the login project is private with no exports, so its compiler version affects nothing downstream. Matches main. Verified that tsc 6.0.3 still type-checks the Client source it reaches through the tsconfig path aliases, not just the login source. CLAUDE.md: drops the deleted is-problem-details helper from the folder listing, and makes the type-resolution note version-agnostic — it claimed the types align with "the in-repo v18 backoffice", which was already wrong on v17 and would drift again on every merge-up. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Description
This removes the
@hey-api/openapi-tsdependency from the Login project since the same types are exported from the Client.The new login.js bundle is now down from 70+ to 59 KB:
Note
This is part of an ongoing project to merge 'login' into 'client' in the future.
Test plan