-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Open
Description
Description
Currently, the JavaScript admin client exposes all its internals publically, meaning that is leaking private APIs that we now have to commit to as a public API in terms of stability. For example, when importing type definitions, a path that deeply accesses the package contents is used:
import type UserRepresentation from "@keycloak/keycloak-admin-client/lib/defs/userRepresentation.js";The package should add all explicitly exported parts of the API surface to a single index file, and use the exports field of the package to define it, so no other parts of the API are leaked:
{
"name": "@keycloak/keycloak-admin-client",
"type": "module",
"exports": {
".": {
"types": "./lib/index.d.ts",
"default": "./lib/index.js"
}
}
}This will allow us to make breaking changes on internal APIs, without violating the API public stability contract with the consumers of the library.