@combeenation/be-lib-public
v0.0.1-alpha1
Published
Combeenation backend library public package
Downloads
7
Readme
Readme
This is kind of like a middleman package which contains the parts of our private be-lib which are also used by the
public configurator-client package and which shall be accessible by consuming projects.
Why is this needed?
Whilst we can bundle/embed the runtime code from our private be-lib package into the build output of the public
configurator-client, we can't do the same for the TS types.
E.g.:
If CfgrConnectionOptions from ConfiguratorClient.connect(options: CfgrConnectionOptions) is defined inside the
be-lib, consumers have access to the runtime code for ConfiguratorClient.connect but they wouldn't have access
to the TS type CfgrConnectionOptions b/c the built types of the configurator-client package would only re-export the
types from the private be-lib package like import { Xyz } from '@repo/be-lib/xyz'; export { Xyz }; where
@repo/be-lib could not be resolved in the consuming project...
In theory, our bundler should be able to inline the types from the private be-lib package into the public build but I
wasn't able to make that work yet, which is why we have this package.
See comments around usage of the dts plugin in configurator-client/vite.config.ts for more details.
Known issues
Some definitions have not been moved to this package yet. E.g. Configuration.checkout(...) does exist at runtime in
consuming projects, but there won't be any type definitions for it.
