Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Define an explicit export surface for the admin client #44260

@jonkoops

Description

@jonkoops

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions