Installation
Sulmu UI is published as @beyul/sulmu-ui, a private package on GitHub Packages. Installing it
takes two things that a public npm package does not need: telling the package manager where the
@beyul scope lives, and a token that is allowed to read it.
Requirements
Section titled “Requirements”- React and React DOM 18 or newer (peer dependencies).
- A bundler that can import CSS files and ES modules. The package is ESM only.
- A GitHub token with the
read:packagesscope, from an account that can see thebeyul/sulmu-uirepository.
@ark-ui/react and @tanstack/react-table are regular dependencies of the package and are
installed with it. The app does not need Panda CSS or any CSS-in-JS runtime.
1. Get a token
Section titled “1. Get a token”-
If you use the GitHub CLI, add the scope to your existing login and export the token:
Terminal window gh auth refresh --scopes read:packagesTerminal window export NPM_AUTH_TOKEN=$(gh auth token) -
Otherwise, create a personal access token (classic) on GitHub with the
read:packagesscope and export it asNPM_AUTH_TOKEN. -
CI and Docker builds need the same variable, set from a secret.
Never commit the token. The configuration below reads it from the environment.
2. Point the @beyul scope at GitHub Packages
Section titled “2. Point the @beyul scope at GitHub Packages”Add this to .npmrc in the app:
@beyul:registry=https://npm.pkg.github.com//npm.pkg.github.com/:_authToken=${NPM_AUTH_TOKEN}pnpm reads .npmrc too. Add this to .npmrc in the app:
@beyul:registry=https://npm.pkg.github.com//npm.pkg.github.com/:_authToken=${NPM_AUTH_TOKEN}Yarn 2 and later ignore .npmrc. Add this to .yarnrc.yml:
npmScopes: beyul: npmRegistryServer: 'https://npm.pkg.github.com' npmAlwaysAuth: true npmAuthToken: '${NPM_AUTH_TOKEN:-}'The :- makes the variable optional, so commands that do not touch the registry still run
without a token. This is the configuration the Tourism Suite frontend uses.
3. Install the package
Section titled “3. Install the package”npm install @beyul/sulmu-uipnpm add @beyul/sulmu-uiyarn add @beyul/sulmu-uiIn a monorepo, add it to each app that imports it. The Tourism Suite frontend lists it in
apps/shell and in each micro frontend that uses it.
What the package contains
Section titled “What the package contains”| Import | What it is |
|---|---|
@beyul/sulmu-ui |
The components, the icons and their types. |
@beyul/sulmu-ui/styles.css |
The precompiled stylesheet. Import it once. |
@beyul/sulmu-ui/preset |
The Panda CSS preset (sulmuPreset), for apps that use Panda themselves. |
@beyul/sulmu-ui/tokens/* |
The token JSON files, e.g. tokens/color.semantic.json. |
@beyul/sulmu-ui/icons/* |
The icon SVG files, e.g. icons/edit-2.svg. |
@beyul/sulmu-ui/illustrations/* |
The error page artwork, e.g. illustrations/error-404.svg. |
Troubleshooting
Section titled “Troubleshooting”- 401 or 403 from
npm.pkg.github.com: the token is missing, has expired, or lacksread:packages. Checkecho $NPM_AUTH_TOKENin the same shell. - 404 for
@beyul/sulmu-ui: the scope is not mapped to GitHub Packages (the request went to the public npm registry), or the token’s account cannot see the repository. - Jest cannot find the module: the package is ESM only. See Jest setup.