fix: make ui package standalone

This commit is contained in:
vince 2026-06-20 12:20:33 +02:00
parent 000a3ac643
commit a7a4720835
4 changed files with 57 additions and 1 deletions

36
README.md Normal file
View file

@ -0,0 +1,36 @@
# Dimension Lab UI
Reusable React component package for Dimension Lab dashboards.
## Use As A Submodule
```sh
git submodule add -b main ssh://git@git.dimensionlab.net/vince/dimensionlab-ui.git packages/ui
git submodule update --init --recursive
bun install
```
The package is workspace-friendly as `@dimensionlab/ui`. Keep the consuming
repo's workspace configuration pointed at the checked-out package path.
## Use As A Git Package
The package exports built files from `dist/`. Git-package consumers can depend
on the repository directly; the `prepare` script builds `dist/` during install.
```json
{
"dependencies": {
"@dimensionlab/ui": "git+ssh://git@git.dimensionlab.net/vince/dimensionlab-ui.git#main"
}
}
```
## Development
```sh
bun install
bun run check
bun run test
bun run build
```

View file

@ -3,6 +3,7 @@
"version": "0.0.1",
"private": true,
"type": "module",
"packageManager": "bun@1.3.14",
"sideEffects": ["*.css", "**/*.css"],
"exports": {
".": {
@ -42,6 +43,7 @@
"scripts": {
"build": "rm -rf dist && tsc -p tsconfig.build.json && mkdir -p dist/components && cp src/styles.css dist/styles.css && cp src/tokens.css dist/tokens.css && cp src/components/styles.css dist/components/styles.css",
"check": "tsc --noEmit",
"prepare": "bun run build",
"test": "vitest run",
"test:unit": "vitest run",
"storybook": "storybook dev -p 6006 --host 0.0.0.0",

18
tsconfig.base.json Normal file
View file

@ -0,0 +1,18 @@
{
"compilerOptions": {
"allowJs": true,
"checkJs": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"ignoreDeprecations": "6.0",
"jsx": "react-jsx",
"module": "ESNext",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"skipLibCheck": true,
"sourceMap": true,
"strict": true,
"target": "ES2022",
"types": ["node", "bun-types", "react", "react-dom"]
}
}

View file

@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.base.json",
"extends": "./tsconfig.base.json",
"compilerOptions": {
"baseUrl": "."
},