From a7a472083555152b8e1a2dc018d3be5b3b10d60b Mon Sep 17 00:00:00 2001 From: vince Date: Sat, 20 Jun 2026 12:20:33 +0200 Subject: [PATCH] fix: make ui package standalone --- README.md | 36 ++++++++++++++++++++++++++++++++++++ package.json | 2 ++ tsconfig.base.json | 18 ++++++++++++++++++ tsconfig.json | 2 +- 4 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 README.md create mode 100644 tsconfig.base.json diff --git a/README.md b/README.md new file mode 100644 index 0000000..a1e8358 --- /dev/null +++ b/README.md @@ -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 +``` diff --git a/package.json b/package.json index a30db52..a66bbe9 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/tsconfig.base.json b/tsconfig.base.json new file mode 100644 index 0000000..dcde3db --- /dev/null +++ b/tsconfig.base.json @@ -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"] + } +} diff --git a/tsconfig.json b/tsconfig.json index 2ad97bc..bd99d8b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.base.json", + "extends": "./tsconfig.base.json", "compilerOptions": { "baseUrl": "." },