@asirsamr/rishon-basekit
v1.0.0
Published
React library for Rishon Communication
Readme
@asirsamr/rishon-basekit
A production-ready React component library for Rishon Communications.
Features
- Fully tree-shakeable ES modules.
- Built with Vite for ultra-fast compilation.
- Pre-configured
CodeDiffViewerwithreact-aceintegration. - Configurable API client built in.
Installation
Install the package via npm:
npm install @asirsamr/rishon-basekitEnsure you have the required peer dependencies installed:
npm install react react-domUsage Example
import React from 'react';
import { CodeDiffViewer } from '@asirsamr/rishon-basekit';
// Import CSS if components rely on bundled CSS
import '@asirsamr/rishon-basekit/style.css';
const MyComponent = () => {
return (
<CodeDiffViewer
api="/api/v1/diff"
filterData={{ id: 123 }}
mode="javascript"
theme="monokai"
height="500px"
/>
);
};
export default MyComponent;Local Development
To run the library locally and test changes:
- Clone the repository and install dependencies:
cd rishon-basekit npm install - Run Vite in watch mode (if testing with an external app via
npm link):npm run build -- --watch
Build Instructions
To create a production build of the library:
npm run buildThis generates ES Module (.es.js) and UMD (.umd.js) bundles in the dist folder.
Publishing to npm
- Ensure your working directory is clean.
- Build the project:
npm run build - Login to npm (if not already):
npm login - Publish the package:
npm publish --access public
Folder Structure
rishon-basekit/
├── src/
│ ├── components/ # UI Components
│ │ └── CodeDiffViewer/
│ ├── models/ # Data Models
│ ├── services/ # API and external integrations
│ └── index.js # Main library export
├── package.json
└── vite.config.jsAdding New Components
- Create a new folder under
src/components/. - Add your
.jsxand.cssfiles. - Export the component from an
index.jsfile within that folder. - Export the component publicly in
src/index.js. - Rebuild the library using
npm run build.
