gdb-component-library is a small, custom React + TypeScript component library built with Vite. The components in this repo are intended to be consumed by other projects (for example, a demo application) via npm or local installation during development.
Package info
- Package name:
gdb-component-library(seepackage.json) - Version:
0.0.0(update before publishing) - Note:
package.jsoncurrently sets"private": true. Set this tofalseand bump the version to publish to the npm registry.
What this repo contains
- Reusable React components under
src/(for examplesrc/components/Button). - An entry point
src/index.tswhich exports components and types. - Build scripts in
package.jsonthat output distributable files todist/.
Install (use in a demo project)
Local (recommended for development):
# from your demo project's directory
npm install ../path/to/gdb-component-library
# or with yarn
yarn add ../path/to/gdb-component-libraryInstall from npm (after publishing):
npm install gdb-component-libraryInstall from a Git URL:
npm install git+ssh://git@github.com/<owner>/gdb-component-library.gitBuild
Run the build script defined in package.json (TypeScript build + Vite build):
npm run buildThe output will be placed in dist/, which is what gets published or installed by consumers.
Usage example (in a demo app)
After installing, import components like this:
import React from 'react'
import { Button } from 'gdb-component-library'
export default function App() {
return <Button variant="primary">Click me</Button>
}TypeScript consumers can also import types:
import type { ButtonProps } from 'gdb-component-library'Notes
- Peer dependencies:
react,react-dom— the consuming project must provide compatible versions. - Entry points:
main,module, andtypesinpackage.jsonpoint to built files underdist/.
Next steps
- Remove
private: trueinpackage.jsonand set a releaseversionbefore publishing. - Add an
examples/demoapp to the repository to simplify local development and QA. - Add CI to build and optionally publish releases.
If you want, I can add a small demo app under examples/demo and wire it into the repo for local testing.